decocms 4.278.6 → 4.279.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 (244) hide show
  1. package/dist/client/assets/{AlertCircle-C_ue5dpm.js → AlertCircle-AfuEl6i_.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BW-CQ84u.js → AreaChart-BLvG0wgr.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-D_1i_-_K.js → ArrowLeft-G2Q7b2Vv.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-2ENJuKn1.js → ArrowUp-jFDLSKjT.js} +1 -1
  5. package/dist/client/assets/{Check-D3rP61VF.js → Check-CO9JUorL.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-i_syDqdQ.js → CheckCircle-BmJ_yJMM.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Dr8vCWZv.js → ChevronDown-DnW-d7HA.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CvdpRaYe.js → ChevronRight-B2mPFeF-.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-Dv_pTodY.js → ChevronSelectorVertical-wG_7wjmJ.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-BzXRNWp_.js → ChevronUp-BoZldCIU.js} +1 -1
  11. package/dist/client/assets/{Copy01-CFs5dLvg.js → Copy01-bSuS0gw-.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-B0k56rzq.js → CreditCard01-CKfPLrWv.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-hb3NfPIe.js → DotsVertical-DXUJ3s5t.js} +1 -1
  14. package/dist/client/assets/{Download01-DxQvMChl.js → Download01-TyN4APBN.js} +1 -1
  15. package/dist/client/assets/{Eye-mrurW8BJ.js → Eye-CovDpCZx.js} +1 -1
  16. package/dist/client/assets/{FilterLines-jfYmDBkV.js → FilterLines-9RKQPkQH.js} +1 -1
  17. package/dist/client/assets/{Globe01-ChvjLPM2.js → Globe01-DuzuRmJC.js} +1 -1
  18. package/dist/client/assets/{Globe04-GZK8hXZj.js → Globe04-G7z-OdfS.js} +1 -1
  19. package/dist/client/assets/{HardDrive-bQRF3cZb.js → HardDrive-BXiZuiTi.js} +1 -1
  20. package/dist/client/assets/{Key01-D5LVGaJJ.js → Key01-C0yYr5jp.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BcSO7_Tr.js → LinkExternal01-qq0UxrCS.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-CY5J19s0.js → LockUnlocked01-Cjtyjwjk.js} +1 -1
  23. package/dist/client/assets/{LogOut01-DW9UNyyB.js → LogOut01-CzIje5W2.js} +1 -1
  24. package/dist/client/assets/{Monitor01-B4Jy2ot3.js → Monitor01-TfYwWOSI.js} +1 -1
  25. package/dist/client/assets/{Palette-C1Iyut6b.js → Palette-USh_w8GC.js} +1 -1
  26. package/dist/client/assets/{Play-DzEIXwV3.js → Play-CiNOaIIr.js} +1 -1
  27. package/dist/client/assets/{Plus-vGWd1KNe.js → Plus-Czn4u1x_.js} +1 -1
  28. package/dist/client/assets/{SearchLg-Cys207lC.js → SearchLg-liDgtqHC.js} +1 -1
  29. package/dist/client/assets/{SearchMd-XqjOgOFN.js → SearchMd-ChTNPQAR.js} +1 -1
  30. package/dist/client/assets/{Settings02-Bxo2JBIC.js → Settings02-CJb2ln7l.js} +1 -1
  31. package/dist/client/assets/{Share07-BjvPJZVx.js → Share07-DGDDJHk7.js} +1 -1
  32. package/dist/client/assets/{Shield01-DOAbMUeh.js → Shield01-Bc1tfti_.js} +1 -1
  33. package/dist/client/assets/{Stars01-Bpn6m19l.js → Stars01-Dj_hVzKG.js} +1 -1
  34. package/dist/client/assets/{Stars02-BI31D4OX.js → Stars02-C2E32y55.js} +1 -1
  35. package/dist/client/assets/{Sun-DsNQ6nv4.js → Sun-BOXJu3xV.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-CgC73t0c.js → SwitchHorizontal01-CElfBjNW.js} +1 -1
  37. package/dist/client/assets/{Tool01-DjC_P2pS.js → Tool01-PUZaGpgk.js} +1 -1
  38. package/dist/client/assets/{Tool02-p2g1RG2k.js → Tool02-Ci-UWiRd.js} +1 -1
  39. package/dist/client/assets/{Trash01-C3-kPIxA.js → Trash01-CzwLn9S8.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-DnG2kf95.js → TrendUp01-BBQq9Bmp.js} +1 -1
  41. package/dist/client/assets/{Upload01-98bMMhx8.js → Upload01-CqmfBBT8.js} +1 -1
  42. package/dist/client/assets/{User01-DRaAh8Fc.js → User01-DjwAl7Z-.js} +1 -1
  43. package/dist/client/assets/{UserSquare-DVQPfFoA.js → UserSquare-COPYs6Az.js} +1 -1
  44. package/dist/client/assets/{Users01-Bayg2V9E.js → Users01-BNptsVTW.js} +1 -1
  45. package/dist/client/assets/{Users03-C2R3qA_D.js → Users03-nHBDn-bd.js} +1 -1
  46. package/dist/client/assets/{XCircle-BPD_epMV.js → XCircle-BcwIF1GP.js} +1 -1
  47. package/dist/client/assets/{XClose-CY0G2wZ2.js → XClose-BFqMcbTJ.js} +1 -1
  48. package/dist/client/assets/{YAxis-DXzCgwmX.js → YAxis-ok-x2JsP.js} +1 -1
  49. package/dist/client/assets/{Zap-BMa0uCBP.js → Zap-DswlVXdq.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-DwfBHtg5.js → ZapSquare-DFywxT8s.js} +1 -1
  51. package/dist/client/assets/{access-gate-DTH0BHKb.js → access-gate-DNjzdtU3.js} +1 -1
  52. package/dist/client/assets/{agent-icon-Dmq8gvpL.js → agent-icon-CmdHa-W8.js} +1 -1
  53. package/dist/client/assets/{agents-list-CZbgfn23.js → agents-list-D1qxQ6PF.js} +1 -1
  54. package/dist/client/assets/{ai-providers-P0I3A00w.js → ai-providers-v1D_k88C.js} +1 -1
  55. package/dist/client/assets/{alert-DWirX9mM.js → alert-CqZJQpVq.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-DHfylh_L.js → alert-dialog-Ds4MdKbO.js} +1 -1
  57. package/dist/client/assets/{api-keys-VWO5Em38.js → api-keys-DKJfPSSq.js} +1 -1
  58. package/dist/client/assets/app-editor-CMTArVTL.js +1 -0
  59. package/dist/client/assets/{auth-cBUP-u5Z.js → auth-8w1NyWkB.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-7I7KzfuX.js → auth-catchall-CipEVcJL.js} +1 -1
  61. package/dist/client/assets/{auth-entry-BybY4IF1.js → auth-entry-C9JNIjJA.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-hFRedI7x.js → auth-split-layout-D2K1eWKx.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-C-pvekCw.js → authenticate-and-persist-oauth-K5JCjRUS.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-D0TtyuXL.js → automation-list-row-D28V0FeZ.js} +1 -1
  65. package/dist/client/assets/automation-runs-DKrfOVez.js +281 -0
  66. package/dist/client/assets/{automations-CTFkT9Q1.js → automations-iSbyTqu7.js} +1 -1
  67. package/dist/client/assets/{avatar-BaPskY-5.js → avatar-C133NGhV.js} +1 -1
  68. package/dist/client/assets/{badge-Cvu8IrGy.js → badge-4RlRg0AS.js} +1 -1
  69. package/dist/client/assets/{block-document-Dwwp7ees.js → block-document-BtF2nxXF.js} +1 -1
  70. package/dist/client/assets/breadcrumb-9dNLQe_a.js +1 -0
  71. package/dist/client/assets/{buckets-D4x2tO-p.js → buckets-CEUMTv1t.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-BSV4AwXn.js → bulk-category-panel-BgjUXJ0P.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-C-eiPEAT.js → capability-load-error-LyvHD9-b.js} +1 -1
  74. package/dist/client/assets/{cards-DJbGuhSK.js → cards-Bcg2LHFz.js} +1 -1
  75. package/dist/client/assets/category-editor-9ucFi_Ma.js +1 -0
  76. package/dist/client/assets/{chart-CHwJyIyC.js → chart-CYvI0sm4.js} +1 -1
  77. package/dist/client/assets/chat-context-m4bT6osr.js +35 -0
  78. package/dist/client/assets/{checkbox-DSH1E9rZ.js → checkbox-BTnJntiS.js} +1 -1
  79. package/dist/client/assets/{choose-editor-C2NVGgwf.js → choose-editor-y-oCgOGh.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BA84c4c1.js → cli-auth-success-Di-B8_y7.js} +1 -1
  81. package/dist/client/assets/collection-detail-HXDll4m-.js +1 -0
  82. package/dist/client/assets/{collection-display-button-Bf8PlyTf.js → collection-display-button-87RjeBSx.js} +1 -1
  83. package/dist/client/assets/{collection-search-Gw3AHYq2.js → collection-search-ozIAHQcm.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-BdPuCGXT.js → collection-table-wrapper-CeWTfOOi.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-D94VP5DH.js → collection-tabs-BmrCLo6q.js} +1 -1
  86. package/dist/client/assets/{command-DvjLTSyu.js → command-wiPjZqkQ.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-D4mVyX0F.js → commerce-onboarding-DZ5rc0vQ.js} +1 -1
  88. package/dist/client/assets/{connect-CEWWNZ1t.js → connect-Dn1CupK6.js} +1 -1
  89. package/dist/client/assets/{connection-CIqUa7HQ.js → connection-B4saCvQS.js} +1 -1
  90. package/dist/client/assets/{connection-card-CWSZ91pp.js → connection-card-YoPVo-ye.js} +1 -1
  91. package/dist/client/assets/{connection-detail-W7C52anb.js → connection-detail-BztcPhYC.js} +1 -1
  92. package/dist/client/assets/{connection-form-helpers-Bl-AQbWU.js → connection-form-helpers-By6fm_rz.js} +1 -1
  93. package/dist/client/assets/{connections-Ih53l-pw.js → connections-D67-eXhM.js} +1 -1
  94. package/dist/client/assets/{decopilot-sse-pool-B5-Oi7QM.js → decopilot-sse-pool-CVPhpHVF.js} +1 -1
  95. package/dist/client/assets/{dialog-DKtG2q4B.js → dialog-CsrlhN35.js} +1 -1
  96. package/dist/client/assets/{domain-settings-eh55Ohfo.js → domain-settings-BEyzBata.js} +1 -1
  97. package/dist/client/assets/{drawer-C8FILhQy.js → drawer-OD5Om0R-.js} +1 -1
  98. package/dist/client/assets/{dropdown-menu-B7bLBmU2.js → dropdown-menu-ByhjAM2S.js} +1 -1
  99. package/dist/client/assets/{empty-state-35WpGuH2.js → empty-state-Dkc5gMex.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-BnNbJQwk.js → extract-connection-data-LAapPQPH.js} +1 -1
  101. package/dist/client/assets/file-explorer-D0tg_bGT.js +2 -0
  102. package/dist/client/assets/{file-type-icon-DIsDLikB.js → file-type-icon-CabL4ea0.js} +1 -1
  103. package/dist/client/assets/{form-D6zBacj_.js → form-q5lvpMu-.js} +1 -1
  104. package/dist/client/assets/{general-BcL_Nh10.js → general-DD4h1x46.js} +1 -1
  105. package/dist/client/assets/{github-repo-picker-Bid7nQHp.js → github-repo-picker-DQQJ7vS2.js} +1 -1
  106. package/dist/client/assets/{hooks-Ql-21rZI.js → hooks-Di7wVSG_.js} +1 -1
  107. package/dist/client/assets/{index-CmirivJl.js → index-BbcMZE-L.js} +1 -1
  108. package/dist/client/assets/{index-D1w5cwbe.js → index-BixsVI0N.js} +1 -1
  109. package/dist/client/assets/{index-2CobItH_.js → index-BnDTWciL.js} +1 -1
  110. package/dist/client/assets/index-Bu6TotWT.js +5 -0
  111. package/dist/client/assets/{index-T6DmNp2G.js → index-C3TG8IPO.js} +8 -8
  112. package/dist/client/assets/index-CUnbqbDo.js +744 -0
  113. package/dist/client/assets/index-Cq-PV2G1.css +1 -0
  114. package/dist/client/assets/{index-CAJCIeWO.js → index-DT-H7jz-.js} +1 -1
  115. package/dist/client/assets/{index-C4_R7wcg.js → index-Di3foT8c.js} +1 -1
  116. package/dist/client/assets/{index-Cesl-36d.js → index-DxgjuGoN.js} +1 -1
  117. package/dist/client/assets/{index-redirect-EoVvvvpO.js → index-redirect-BsgnT8lf.js} +1 -1
  118. package/dist/client/assets/{index-DoGnuonz.js → index-z-JdfD76.js} +1 -1
  119. package/dist/client/assets/{infra-billing-Bb3ydaRH.js → infra-billing-6BYEVuzn.js} +1 -1
  120. package/dist/client/assets/{input-oGRrJ1WQ.js → input-BAcN5l6B.js} +1 -1
  121. package/dist/client/assets/{integration-icon-Dws-vFYP.js → integration-icon-DrygRjKQ.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-DlTu3o0c.js → invite-member-dialog-CCRG89hV.js} +1 -1
  123. package/dist/client/assets/{label-TreJijRH.js → label-B_BH72Xd.js} +1 -1
  124. package/dist/client/assets/{layout-CfmYAaDp.js → layout-DKK94tAs.js} +1 -1
  125. package/dist/client/assets/{login-Bg-SXz0y.js → login-BYlvKUjs.js} +1 -1
  126. package/dist/client/assets/{mcp-oauth-Baiyn1cx.js → mcp-oauth-FK0RvnlU.js} +1 -1
  127. package/dist/client/assets/{members-Bc8pHUW1.js → members-BTr3HPMy.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-2T4Cd5Nl.js → monaco-editor-BnWTqgYz.js} +1 -1
  129. package/dist/client/assets/{monitoring-stats-row-BuY-S-yG.js → monitoring-stats-row-Ce0479EX.js} +1 -1
  130. package/dist/client/assets/{multi-select-C7XFuG2t.js → multi-select-TWUyAmvr.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-CA9jaB2U.js → oauth-callback-JwUyjJCd.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-ai-provider-9krZE01Z.js → oauth-callback-ai-provider-Ba3UE2v4.js} +1 -1
  133. package/dist/client/assets/{onboarding-B9pGuoHU.js → onboarding-ietHnY47.js} +1 -1
  134. package/dist/client/assets/{org-layout-CDp0J9wZ.js → org-layout-GH4Rmo6q.js} +1 -1
  135. package/dist/client/assets/{organization-choice-DdnQWmHR.js → organization-choice-zbfetJiG.js} +1 -1
  136. package/dist/client/assets/{orgs-KdLSbbMI.js → orgs-B9A5KlC2.js} +1 -1
  137. package/dist/client/assets/{page-seo-form-DKtPWD8K.js → page-seo-form-BJV7Fm59.js} +1 -1
  138. package/dist/client/assets/{popover-BVSaKROt.js → popover-CJpTaswq.js} +1 -1
  139. package/dist/client/assets/post-calendar-DWAObQm2.js +1 -0
  140. package/dist/client/assets/post-editor-DOV2pBL0.js +1 -0
  141. package/dist/client/assets/{primitives-CXjYjPuc.js → primitives-CMCCRfM6.js} +1 -1
  142. package/dist/client/assets/{profile-Pz5F-h0u.js → profile-CYUaQryB.js} +1 -1
  143. package/dist/client/assets/project-app-view-oHs1wUGk.js +1 -0
  144. package/dist/client/assets/{prompts-Bzj8QNvu.js → prompts-BZGBfcoD.js} +1 -1
  145. package/dist/client/assets/record-editor-CYjb7Lwt.js +1 -0
  146. package/dist/client/assets/redirect-editor-K1mZMGFA.js +1 -0
  147. package/dist/client/assets/registry-BfBKhEV7.js +2 -0
  148. package/dist/client/assets/{registry-layout-DYyKCZ-t.js → registry-layout-DUgQUudf.js} +1 -1
  149. package/dist/client/assets/{reports-CohW2NBH.js → reports-BFhg7BdP.js} +1 -1
  150. package/dist/client/assets/{require-capability-3tTWC58Z.js → require-capability-CG-tfoXY.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-CI-I7_n9.js → required-auth-layout-DfYqrcPn.js} +1 -1
  152. package/dist/client/assets/{reset-password-WH6rFL-n.js → reset-password-CFS65PwD.js} +1 -1
  153. package/dist/client/assets/{review-settings-Dw5Y3Ng0.js → review-settings-BXo477_9.js} +1 -1
  154. package/dist/client/assets/{roles-AxUW9bno.js → roles--1AZtVjf.js} +1 -1
  155. package/dist/client/assets/{search-input-DSM3Ad2f.js → search-input-BrNPjamm.js} +1 -1
  156. package/dist/client/assets/{secrets-tOFruUeV.js → secrets-C3Dv1Y_k.js} +1 -1
  157. package/dist/client/assets/sections-editor-Daeik6-Q.js +2 -0
  158. package/dist/client/assets/{select-model-CDy87sWK.js → select-model-DJBJ_0g-.js} +1 -1
  159. package/dist/client/assets/{select-C7mOn2qi.js → select-qQ8K68aV.js} +1 -1
  160. package/dist/client/assets/{self-tool-result-BAMf28tz.js → self-tool-result-D1ovXrrO.js} +1 -1
  161. package/dist/client/assets/seo-editor-i89Reuuh.js +1 -0
  162. package/dist/client/assets/{settings-layout-B7_kl_l_.js → settings-layout-O-1if8RR.js} +1 -1
  163. package/dist/client/assets/{shell-controls-D36dTQCz.js → shell-controls-DJdWsgSD.js} +1 -1
  164. package/dist/client/assets/{shell-layout-CzDL5OMt.js → shell-layout-BBIijT68.js} +1 -1
  165. package/dist/client/assets/{spinner-CZJvZw9q.js → spinner-LPV48ok9.js} +1 -1
  166. package/dist/client/assets/{sso-CsfaWoQ9.js → sso-Cuiuxauv.js} +1 -1
  167. package/dist/client/assets/{store-bQczCqRJ.js → store-DYt3SLfs.js} +1 -1
  168. package/dist/client/assets/store-registry-DZdPuTj5.js +2 -0
  169. package/dist/client/assets/{switch-DX0CchGd.js → switch-D_pJdTv5.js} +1 -1
  170. package/dist/client/assets/{synced-repos-Bu9Xm495.js → synced-repos-hKBJ1FHt.js} +1 -1
  171. package/dist/client/assets/{tab-id-Crl7Lrhw.js → tab-id-Ccgv0vSL.js} +1 -1
  172. package/dist/client/assets/{table-C0RPqLOv.js → table-enEeTVoC.js} +1 -1
  173. package/dist/client/assets/{tabs-D17bVbFO.js → tabs-lDpH7JmI.js} +1 -1
  174. package/dist/client/assets/{tasks-B4bBl-14.js → tasks-Db4ewzje.js} +1 -1
  175. package/dist/client/assets/{textarea-CDV_NSfk.js → textarea-qDQNnVc9.js} +1 -1
  176. package/dist/client/assets/{toggle-group-B02MEILt.js → toggle-group-Ba3_-oKv.js} +1 -1
  177. package/dist/client/assets/{toolbar-DywkE492.js → toolbar-LzKMuads.js} +1 -1
  178. package/dist/client/assets/{track-DS7Oiirh.js → track-BSgjOEdB.js} +1 -1
  179. package/dist/client/assets/{types-IPakUJfp.js → types-Ye93bD_b.js} +1 -1
  180. package/dist/client/assets/{use-ai-providers-CxBvAmu8.js → use-ai-providers-BsQa_196.js} +1 -1
  181. package/dist/client/assets/{use-api-keys-Dk-U4-fo.js → use-api-keys-ZSdLAfvN.js} +1 -1
  182. package/dist/client/assets/{use-automations-BPP6NFoz.js → use-automations-wsIpARi1.js} +1 -1
  183. package/dist/client/assets/{use-autosave-DY8AuAQq.js → use-autosave-Dlz0mGoT.js} +1 -1
  184. package/dist/client/assets/{use-clock-tick-llo_i55R.js → use-clock-tick-CpueyOFj.js} +1 -1
  185. package/dist/client/assets/{use-commerce-diagnostic-CD2P0Cgl.js → use-commerce-diagnostic-CtCCuMfo.js} +1 -1
  186. package/dist/client/assets/{use-connection-Be_N4k3-.js → use-connection-Cn467-iP.js} +1 -1
  187. package/dist/client/assets/{use-copy-DB5BOq-H.js → use-copy-C1YzMpH8.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-CTVcOIF-.js → use-create-virtual-mcp-DgfAHelk.js} +1 -1
  189. package/dist/client/assets/{use-debounced-autosave-0DqbtGT9.js → use-debounced-autosave-CpGtHTmC.js} +1 -1
  190. package/dist/client/assets/{use-debounced-value-DDOHyvnN.js → use-debounced-value-WnqMfrh5.js} +1 -1
  191. package/dist/client/assets/{use-decopilot-events-LtP-eSLP.js → use-decopilot-events-ENne0bDf.js} +1 -1
  192. package/dist/client/assets/{use-delete-connection-BqG-SdIt.js → use-delete-connection-CUnA9KoS.js} +1 -1
  193. package/dist/client/assets/{use-deployment-admin-CzI_yTK-.js → use-deployment-admin-C2sUfxkv.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-2Otf5vu6.js → use-file-configs-CelXgc20.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DxpnNTDN.js → use-infinite-scroll-DY7tF5sn.js} +1 -1
  196. package/dist/client/assets/{use-join-requests-CBsFgeLX.js → use-join-requests-CqYyMB3P.js} +1 -1
  197. package/dist/client/assets/{use-mcp-auth-status-Cc6w6BXA.js → use-mcp-auth-status-ChXZMxXw.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-CDW5sZtI.js → use-mcp-client-CWX5_3sx.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-BBQ0wX2A.js → use-mcp-tools-BtKVoYna.js} +1 -1
  200. package/dist/client/assets/{use-members-BG7a44vO.js → use-members-dn6dNJd_.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-8vvrRa64.js → use-navigate-to-agent-tIOZj2PM.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-tDH7ZEw3.js → use-org-auth-client-BV2XyDWd.js} +1 -1
  203. package/dist/client/assets/{use-org-repo-syncs-CU706fVV.js → use-org-repo-syncs-Bcdq0MPX.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-Bsjlvsw0.js → use-org-sso-CIoBd3AL.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-Dn-bOK38.js → use-organization-roles-BlffpYUV.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-DYyCCrCY.js → use-organization-settings-DvNZGriV.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-CAUwAi1r.js → use-registry-connections-fdiuSX9G.js} +1 -1
  208. package/dist/client/assets/{use-secrets-CYZAF1A3.js → use-secrets-BZZ_3zlM.js} +1 -1
  209. package/dist/client/assets/{use-section-preview-base-BhQyh96f.js → use-section-preview-base-C0KA4QVk.js} +1 -1
  210. package/dist/client/assets/{use-status-sounds-BDEAnt5F.js → use-status-sounds-lZ5pkFCV.js} +1 -1
  211. package/dist/client/assets/{use-tags-FefTsanW.js → use-tags-BvM9tnwW.js} +1 -1
  212. package/dist/client/assets/{use-task-board-items-DF6WCEaC.js → use-task-board-items-4f6uxdKU.js} +1 -1
  213. package/dist/client/assets/{use-view-mode-BJVofJAT.js → use-view-mode-BQv1OxeW.js} +1 -1
  214. package/dist/client/assets/{use-virtual-mcp-CN9IG9dM.js → use-virtual-mcp-B9WROBX7.js} +1 -1
  215. package/dist/client/assets/useInfiniteQuery-DheoLSIh.js +1 -0
  216. package/dist/client/assets/useSuspenseInfiniteQuery-cNc-PZV6.js +1 -0
  217. package/dist/client/assets/{users-DlhlKNKv.js → users-RZMSq2eG.js} +1 -1
  218. package/dist/client/assets/variant-calendar-BMcqBsia.js +1 -0
  219. package/dist/client/assets/{view-mode-toggle-DCoMfZFL.js → view-mode-toggle-VMCRJ3_K.js} +1 -1
  220. package/dist/client/index.html +2 -2
  221. package/dist/server/cli.js +1 -1
  222. package/dist/server/server.js +1 -1
  223. package/package.json +1 -1
  224. package/dist/client/assets/app-editor-DiZiM6qQ.js +0 -1
  225. package/dist/client/assets/automation-runs-CduAJwId.js +0 -281
  226. package/dist/client/assets/category-editor-CVFWBf5Q.js +0 -1
  227. package/dist/client/assets/chat-context-CSLWuE9T.js +0 -35
  228. package/dist/client/assets/collection-detail-D31S7Gj6.js +0 -1
  229. package/dist/client/assets/file-explorer-mVER__5f.js +0 -2
  230. package/dist/client/assets/index-CT0xBlIh.css +0 -1
  231. package/dist/client/assets/index-DM_rfzV2.js +0 -5
  232. package/dist/client/assets/index-gw3w5L0d.js +0 -744
  233. package/dist/client/assets/post-calendar-RlS-f50y.js +0 -1
  234. package/dist/client/assets/post-editor-Bm6mmN5s.js +0 -1
  235. package/dist/client/assets/project-app-view-D1N_kGSa.js +0 -1
  236. package/dist/client/assets/record-editor-BSU0OIiO.js +0 -1
  237. package/dist/client/assets/redirect-editor-CtdqV76F.js +0 -1
  238. package/dist/client/assets/registry-o5ihTpah.js +0 -2
  239. package/dist/client/assets/sections-editor-Cm0M7PrE.js +0 -2
  240. package/dist/client/assets/seo-editor-D3RefuqI.js +0 -1
  241. package/dist/client/assets/store-registry-DNqZXcnh.js +0 -2
  242. package/dist/client/assets/useInfiniteQuery-B3KIBI9K.js +0 -1
  243. package/dist/client/assets/useSuspenseInfiniteQuery-DS72bgMq.js +0 -1
  244. package/dist/client/assets/variant-calendar-CaGCYEqw.js +0 -1
@@ -1 +0,0 @@
1
- import{c as J,r as w,n as Q,j as t,b as Z,B as $,k as K,t as U}from"./index-T6DmNp2G.js";import{b as _}from"./chat-context-CSLWuE9T.js";import{i as tt}from"./XCircle-BPD_epMV.js";import{bb as ot,B as W}from"./agent-icon-Dmq8gvpL.js";import{n as et}from"./LinkExternal01-BcSO7_Tr.js";import{A as rt,a as it,b as st,c as at,d as nt,e as mt,f as lt,g as pt}from"./alert-dialog-DHfylh_L.js";import{I as G}from"./input-oGRrJ1WQ.js";import{L as H}from"./label-TreJijRH.js";import{G as ct,U as dt,V as ut,as as gt,K as xt,X as A,a3 as ft,at as ht,Y as yt}from"./index-gw3w5L0d.js";import{c as bt,B as jt,a as vt}from"./block-document-Dwwp7ees.js";import{u as Et}from"./use-autosave-DY8AuAQq.js";import{t as Ct}from"./ChevronDown-Dr8vCWZv.js";import{a9 as Nt,aa as St,ab as kt}from"./automation-runs-CduAJwId.js";import{s as j,E as wt}from"./primitives-CXjYjPuc.js";import"./tab-id-Crl7Lrhw.js";import"./dialog-DKtG2q4B.js";import"./Check-D3rP61VF.js";import"./Copy01-CFs5dLvg.js";import"./Download01-DxQvMChl.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-Ql-21rZI.js";import"./use-mcp-client-CDW5sZtI.js";import"./constants-z9Iog-sb.js";import"./auth-cBUP-u5Z.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B5-Oi7QM.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CN9IG9dM.js";import"./use-ai-providers-CxBvAmu8.js";import"./use-decopilot-events-LtP-eSLP.js";import"./use-organization-settings-DYyCCrCY.js";import"./AlertCircle-C_ue5dpm.js";import"./Tool01-DjC_P2pS.js";import"./ArrowUp-2ENJuKn1.js";import"./ArrowLeft-D_1i_-_K.js";import"./Tool02-p2g1RG2k.js";import"./TrendUp01-DnG2kf95.js";import"./ZapSquare-DwfBHtg5.js";import"./Users03-C2R3qA_D.js";import"./CheckCircle-i_syDqdQ.js";import"./ChevronRight-CvdpRaYe.js";import"./ChevronSelectorVertical-Dv_pTodY.js";import"./ChevronUp-BzXRNWp_.js";import"./DotsVertical-hb3NfPIe.js";import"./Stars02-BI31D4OX.js";import"./UserSquare-DVQPfFoA.js";import"./CreditCard01-B0k56rzq.js";import"./Settings02-Bxo2JBIC.js";import"./Eye-mrurW8BJ.js";import"./FilterLines-jfYmDBkV.js";import"./Share07-BjvPJZVx.js";import"./Globe01-ChvjLPM2.js";import"./Globe04-GZK8hXZj.js";import"./SwitchHorizontal01-CgC73t0c.js";import"./HardDrive-bQRF3cZb.js";import"./Key01-D5LVGaJJ.js";import"./LockUnlocked01-CY5J19s0.js";import"./LogOut01-DW9UNyyB.js";import"./Monitor01-B4Jy2ot3.js";import"./Sun-DsNQ6nv4.js";import"./Palette-C1Iyut6b.js";import"./Play-DzEIXwV3.js";import"./Plus-vGWd1KNe.js";import"./SearchLg-Cys207lC.js";import"./SearchMd-XqjOgOFN.js";import"./Shield01-DOAbMUeh.js";import"./Stars01-Bpn6m19l.js";import"./Trash01-C3-kPIxA.js";import"./Upload01-98bMMhx8.js";import"./User01-DRaAh8Fc.js";import"./Users01-Bayg2V9E.js";import"./XClose-CY0G2wZ2.js";import"./Zap-BMa0uCBP.js";import"./spinner-CZJvZw9q.js";import"./drawer-C8FILhQy.js";import"./collection-search-Gw3AHYq2.js";import"./chart-CHwJyIyC.js";import"./index-CmirivJl.js";import"./shell-layout-CzDL5OMt.js";import"./avatar-BaPskY-5.js";import"./required-auth-layout-CI-I7_n9.js";import"./use-org-sso-Bsjlvsw0.js";import"./form-D6zBacj_.js";import"./select-C7mOn2qi.js";import"./tabs-D17bVbFO.js";import"./toggle-group-B02MEILt.js";import"./use-commerce-diagnostic-CD2P0Cgl.js";import"./popover-BVSaKROt.js";import"./self-tool-result-BAMf28tz.js";import"./integration-icon-Dws-vFYP.js";import"./extract-connection-data-BnNbJQwk.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DDOHyvnN.js";import"./authenticate-and-persist-oauth-C-pvekCw.js";import"./mcp-oauth-Baiyn1cx.js";import"./track-DS7Oiirh.js";import"./toolbar-DywkE492.js";import"./github-repo-picker-Bid7nQHp.js";import"./use-connection-Be_N4k3-.js";import"./use-mcp-tools-BBQ0wX2A.js";import"./use-navigate-to-agent-8vvrRa64.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-CWSZ91pp.js";import"./use-registry-connections-CAUwAi1r.js";import"./useInfiniteQuery-B3KIBI9K.js";import"./use-infinite-scroll-DxpnNTDN.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CDV_NSfk.js";import"./connection-form-helpers-Bl-AQbWU.js";import"./collection-tabs-D94VP5DH.js";import"./badge-Cvu8IrGy.js";import"./useSuspenseInfiniteQuery-DS72bgMq.js";import"./command-DvjLTSyu.js";import"./index-CAJCIeWO.js";import"./use-clock-tick-llo_i55R.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./select-model-CDy87sWK.js";import"./checkbox-DSH1E9rZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DJbGuhSK.js";import"./dropdown-menu-B7bLBmU2.js";import"./file-type-icon-DIsDLikB.js";import"./question-004-sINsf4GQ.js";import"./use-members-BG7a44vO.js";import"./use-org-auth-client-tDH7ZEw3.js";import"./use-status-sounds-BDEAnt5F.js";import"./empty-state-35WpGuH2.js";import"./types-IPakUJfp.js";import"./use-file-configs-2Otf5vu6.js";import"./monaco-editor-2T4Cd5Nl.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-0DqbtGT9.js";import"./search-input-DSM3Ad2f.js";import"./use-mcp-auth-status-Cc6w6BXA.js";import"./switch-DX0CchGd.js";import"./use-secrets-CYZAF1A3.js";import"./AreaChart-BW-CQ84u.js";import"./use-task-board-items-DF6WCEaC.js";import"./use-copy-DB5BOq-H.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-FefTsanW.js";import"./task-key-BCHdFiOO.js";import"./use-automations-BPP6NFoz.js";import"./automation-list-row-D0TtyuXL.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-CU706fVV.js";import"./table-C0RPqLOv.js";function Pt(h){const o=J.c(18),{icon:d,title:n,defaultOpen:v,children:u}=h,P=v===void 0?!1:v,[g,D]=w.useState(P);let m;o[0]!==d?(m=t.jsx(d,{size:15}),o[0]=d,o[1]=m):m=o[1];let r;o[2]!==n?(r=t.jsx("span",{className:"flex-1 text-left",children:n}),o[2]=n,o[3]=r):r=o[3];const y=g&&"rotate-180";let s;o[4]!==y?(s=Q("transition-transform",y),o[4]=y,o[5]=s):s=o[5];let l;o[6]!==s?(l=t.jsx(Ct,{size:15,className:s}),o[6]=s,o[7]=l):l=o[7];let p;o[8]!==m||o[9]!==r||o[10]!==l?(p=t.jsx(Nt,{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:[m,r,l]})}),o[8]=m,o[9]=r,o[10]=l,o[11]=p):p=o[11];let i;o[12]!==u?(i=t.jsx(St,{className:"px-2 pt-4",children:u}),o[12]=u,o[13]=i):i=o[13];let x;return o[14]!==g||o[15]!==p||o[16]!==i?(x=t.jsxs(kt,{open:g,onOpenChange:D,className:"mt-4",children:[p,i]}),o[14]=g,o[15]=p,o[16]=i,o[17]=x):x=o[17],x}function jr({orgSlug:h,virtualMcpId:o,branch:d,blockKey:n,block:v,decofile:u,meta:P,onManagePosts:g,onOpenPost:D,previewBaseUrl:m}){const r=Z(),y=_()?.taskId??null,s=ct({orgSlug:h,virtualMcpId:o,branch:d}),l=dt({orgSlug:h,virtualMcpId:o,branch:d}),p=ut(v,"categories"),[i,x,M]=Et(p,e=>{s.mutate({blockKey:n,data:A(n,"categories",e)})}),E=(e,k)=>x({...i,[e]:k}),T=bt({decofile:u,category:i,previewBaseUrl:m,draftPointer:l}),a=j(i.slug),[B,b]=w.useState(a),[c,C]=w.useState(null),[N,z]=w.useState(!1),F=a?gt(u).filter(e=>e.categorySlugs.includes(a)):[],S=F.length,V=e=>E("slug",e),X=async(e,k)=>{const q=j(i.name);z(!0);try{let f=0;for(const{key:R,payload:I}of ft(u,"posts")){const L=ht(I,e,{name:q,slug:k});L!==I&&(await s.mutateAsync({blockKey:R,data:A(R,"posts",yt(L))}),f+=1)}const O={...i,slug:k};await s.mutateAsync({blockKey:n,data:A(n,"categories",O)}),M(O),U.success(f>0?r("sandbox.categoryEditor.renameSuccessWithPosts",{count:String(f)}):r("sandbox.categoryEditor.renameSuccessNoPosts")),C(null)}catch(f){b(e),C(null),U.error(f instanceof Error?f.message:r("sandbox.categoryEditor.renameFailed"))}finally{z(!1)}},Y=()=>{const e=B.trim();if(e===a){B!==e&&b(e);return}if(!e){b(a);return}if(S===0){V(e);return}C({oldSlug:a,newSlug:e,count:S})};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:j(i.name)||r("sandbox.categoryEditor.untitledCategory")}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(xt,{isPending:s.isPending,isError:s.isError}),T&&t.jsxs($,{type:"button",variant:"outline",size:"sm",title:r("sandbox.categoryEditor.previewTooltip"),onClick:()=>window.open(T,"_blank","noopener,noreferrer"),children:[t.jsx(et,{size:14}),r("sandbox.categoryEditor.seeCategoryPreview")]})]})]}),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(wt,{value:j(i.name),onChange:e=>E("name",e),placeholder:r("sandbox.categoryEditor.categoryNamePlaceholder"),className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-slug",children:r("sandbox.categoryEditor.slugLabel")}),t.jsx(G,{id:"category-slug",value:B,onChange:e=>b(e.target.value),onBlur:Y,placeholder:r("sandbox.categoryEditor.slugPlaceholder"),className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(H,{htmlFor:"category-description",children:r("sandbox.categoryEditor.descriptionLabel")}),t.jsx(G,{id:"category-description",value:j(i.description),onChange:e=>E("description",e.target.value),placeholder:r("sandbox.categoryEditor.descriptionPlaceholder"),className:"h-10"})]}),t.jsx(Pt,{icon:ot,title:r("sandbox.categoryEditor.contentTitle"),defaultOpen:!0,children:t.jsx(jt,{value:vt(i.sections),onChange:e=>E("sections",e),meta:P,sandboxRef:{orgSlug:h,virtualMcpId:o,branch:d,threadId:y},emptyMessage:r("sandbox.categoryEditor.noContentEmpty")})}),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(W,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:r("sandbox.categoryEditor.postsInCategory",{count:String(S)})})]}),t.jsxs($,{type:"button",variant:"outline",size:"sm",disabled:!a,title:r(a?"sandbox.categoryEditor.pickPostsTooltip":"sandbox.categoryEditor.setSlugTooltip"),onClick:()=>g(a),children:[r("sandbox.categoryEditor.addPostsButton"),t.jsx(tt,{size:14})]})]}),S>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:F.map(e=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(e.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(W,{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:e.title||r("sandbox.categoryEditor.untitledPost")}),e.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:e.slug})]})]})},e.key))})]})]})})]}),t.jsx(rt,{open:!!c,onOpenChange:e=>{e||N||(b(a),C(null))},children:t.jsxs(it,{children:[t.jsxs(st,{children:[t.jsx(at,{children:r("sandbox.categoryEditor.renameDialogTitle")}),t.jsx(nt,{children:c?r("sandbox.categoryEditor.renameDialogDescription",{oldSlug:c.oldSlug,newSlug:c.newSlug,count:String(c.count)}):null})]}),t.jsxs(mt,{children:[t.jsx(lt,{disabled:N,children:r("sandbox.categoryEditor.cancelButton")}),t.jsx(pt,{onClick:e=>{e.preventDefault(),c&&X(c.oldSlug,c.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(K,{size:14,className:"animate-spin"}),r("sandbox.categoryEditor.renamingLabel")]}):r("sandbox.categoryEditor.renameActionButton")})]})]})})]})}export{jr as CategoryEditor};
@@ -1,35 +0,0 @@
1
- import{I as ae,c as te,a4 as Ke,u as De,p as Oe,H as G,K as ie,t as oe,R as ue,d as Ge,f as st,r as k,o as nt,ac as rt,e as at,aW as ot,j as ye,b as Ce,a as it,x as ct,aC as lt,q as ut}from"./index-T6DmNp2G.js";import{e as dt,t as pt,A as Xe,u as ft,v as ht,q as mt,w as gt}from"./tab-id-Crl7Lrhw.js";import{p as yt}from"./session-runtime-wVXsCwcJ.js";import{S as St,c as bt,f as kt,a as vt}from"./hooks-Ql-21rZI.js";import{u as It}from"./use-is-desktop-app-BNujXJc_.js";import{u as Tt}from"./use-mcp-client-CDW5sZtI.js";import{a as Mt,S as xt}from"./constants-z9Iog-sb.js";import{a as Ct}from"./use-virtual-mcp-CN9IG9dM.js";import{u as ze,p as wt,b as ge,i as $t,c as At}from"./use-ai-providers-CxBvAmu8.js";import{u as Et}from"./use-decopilot-events-LtP-eSLP.js";import{c as Pt}from"./use-organization-settings-DYyCCrCY.js";function Ne(t,e){return ae.chatThreadIntent(t,e)}function Fe(t,e,s,n){if(!(!n.runtime&&!n.branch))try{t.setItem(Ne(e,s),JSON.stringify(n))}catch{}}function Qe(t,e,s){try{t.removeItem(Ne(e,s))}catch{}}function Ds(t,e,s){const n=Ne(e,s);let a=null;try{a=t.getItem(n),t.removeItem(n)}catch{return{}}if(!a)return{};let r;try{r=JSON.parse(a)}catch{return{}}if(!r||typeof r!="object")return{};const o=r,i=yt(o.runtime),d=typeof o.branch=="string"&&o.branch?o.branch:void 0;return{...i?{runtime:i}:{},...d?{branch:d}:{}}}function Rt(t,e=[]){return t==="stop"?"completed":t==="tool-calls"?e.some(n=>n.type==="tool-user_ask"&&n.state==="input-available"||n.state==="approval-requested")?"requires_action":"completed":"failed"}const je={"claude-code-desktop":"claude-code","codex-desktop":"codex","opencode-desktop":"opencode"};function _t(t){return t==="claude-code"?"claude-code-desktop":t==="codex"?"codex-desktop":t==="opencode"?"opencode-desktop":null}function Dt({pendingOption:t,lockedHarness:e}){return e?_t(e):t}function Ot(t){return t.thread?.harness_id!=null?{}:{branch:t.globals.branch??null}}const Nt=new Set(["decopilot","claude-code"]);function Lt({isDesktopApp:t,harnessId:e}){return e!=null&&!Nt.has(e)}const qt="home",Ut=new Set(["output","upload","public","home"]),Ft=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function Os(t){return Ut.has(t)||!Ft.test(t)?"home":t}function Qt(t){const e=t?t.split("/").filter(Boolean):[],s=e[0]==="public",n=s?e[1]??null:null,a=s?n?`public-${n}`:null:e[0]??null,r=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:a,dirPath:r,isPublic:s,publicSet:n,readOnly:s,isHomeRoot:a===qt&&r===""}}function Ns(t){return t==="public"?"skills":t}function Ls(t,e){return t.isPublic&&t.publicSet?`public/${t.publicSet}/${e}`:t.volume?`${t.volume}/${e}`:e}const Be="public-";function Ye(t){return t.startsWith(Be)?t.slice(Be.length):null}function qs(t,e){const s=Ye(t);return s?`public/${s}/${e}`:`${t}/${e}`}function jt(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function Bt(t){const{volume:e,dirPath:s}=Qt(t);if(!e)return null;let n;if(e==="home")n="org/home";else if(e==="outputs")n="org/.outputs";else if(e==="uploads")n="org/.uploads";else{const a=Ye(e);n=a?`org/public/${a}`:`org/${e}`}return s?`${n}/${s}`:n}function Ht(t){const e=te.c(21);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=s):s=e[0];const n=Ke(s);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const r=De(a);let o;e[2]!==r.brand||e[3]!==r.main||e[4]!==r.preview||e[5]!==r.skill?(o=(typeof r.main=="string"?dt(r.main)?.path:void 0)??r.preview??r.skill??r.brand??null,e[2]=r.brand,e[3]=r.main,e[4]=r.preview,e[5]=r.skill,e[6]=o):o=e[6];const i=o;let d;if(e[7]!==n?.params.appSlug||e[8]!==n?.params.collectionName||e[9]!==n?.params.itemId||e[10]!==i||e[11]!==t){if(d=[],t&&d.push(`### Selected Agent
2
- - ID: ${t}`),i){let g;e[13]!==i?(g=Bt(i),e[13]=i,e[14]=g):g=e[14];const v=g;let M;e[15]!==i?(M=jt(i),e[15]=i,e[16]=M):M=e[16],d.push(`### Currently Open File
3
- The user has this file open in the Library and is most likely referring to it:
4
- - Name: ${M}
5
- - Library path: ${i}${v?`
6
- - Read/edit it with your file tools at: \`${v}\``:""}
7
-
8
- When a request is ambiguous about which file or resource it targets (e.g. "change the h1", "fix this", "what's in this file", "update the title"), assume it means this file unless the user clearly indicates otherwise.`)}let f;e[17]!==n?.params.appSlug||e[18]!==n?.params.collectionName||e[19]!==n?.params.itemId?(f=[],n?.params.appSlug&&f.push(`- Connection ID: ${n?.params.appSlug}`),n?.params.collectionName&&f.push(`- Collection: ${n?.params.collectionName}`),n?.params.itemId&&f.push(`- Item ID: ${n?.params.itemId}`),e[17]=n?.params.appSlug,e[18]=n?.params.collectionName,e[19]=n?.params.itemId,e[20]=f):f=e[20],f.length>0&&d.push(`### Current Resource
9
- The user is viewing the following resource:
10
- ${f.join(`
11
- `)}
12
-
13
- Help the user understand and work with this resource.`),e[7]=n?.params.appSlug,e[8]=n?.params.collectionName,e[9]=n?.params.itemId,e[10]=i,e[11]=t,e[12]=d}else d=e[12];return d.join(`
14
-
15
- `)}function Wt(){const t=te.c(5),e=Oe(),{org:s}=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=n):n=t[0];const a=Ke(n);let r;return t[1]!==a?.params||t[2]!==s||t[3]!==e?(r=o=>{const d=o.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!d||!d[1])return;const f=d[1],g=a?.params.appSlug;if(!g)return;e.invalidateQueries({queryKey:ie.collection(s.slug,g,f)});const v=f.toLowerCase().replace(/_/g," ");oe.success(`${v} updated`)},t[1]=a?.params,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}function Vt(){const t=te.c(4),{org:e,project:s}=G(),n=`${e.id}/${s.id}`;let a;t[0]!==n?(a=ae.taskLastViewed(n),t[0]=n,t[1]=a):a=t[1];const[,r]=ue(a,Kt);let o;return t[2]!==r?(o={markTaskRead:d=>{r(f=>({...f,[d]:new Date().toISOString()}))}},t[2]=r,t[3]=o):o=t[3],o}function Kt(t){return t??{}}function Ze(){const t=Ge(),{org:e}=G(),s=De({strict:!1}),n=st({strict:!1}),a=s.virtualmcpid??Mt(e.id).id,r=(d,f)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:d},search:g=>{const v={},M=f?.virtualMcpId??g.virtualmcpid;M&&(v.virtualmcpid=M);const p=g.main;return p&&typeof p=="string"&&!pt(p)&&(v.main=p),(g.sidepanel==="chat"||g.sidepanel===0)&&(v.sidepanel=g.sidepanel),f?.autosend&&(v.autosend=Xe),v}})},o=k.useRef(crypto.randomUUID()),i=n.taskId??o.current;return{virtualMcpId:a,taskId:i,navigateToTask:r}}function Gt(t,e){const{mimeType:s,data:n}=t;if(s.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(n),r=>r.charCodeAt(0)));return[{type:"text",text:`${e}
16
- ${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${s};base64,${n}`,filename:e,mediaType:s}]}function He(t,e){const s=[];for(const n of t)!n||typeof n!="object"||("text"in n&&n.text?s.push({type:"text",text:`[${e}]
17
- ${n.text}`}):"blob"in n&&n.blob&&n.mimeType&&s.push({type:"file",url:`data:${n.mimeType};base64,${n.blob}`,filename:String(n.uri),mediaType:String(n.mimeType)}));return s}function Xt(t,e){const s=(t.files??[]).filter(o=>o.content?.trim()),n=t.omittedPaths??[];if(s.length===0&&n.length===0)return[];const a=s.map(o=>`<skill-file path="${o.relPath}">
18
- ${o.content.trim()}
19
- </skill-file>`).join(`
20
-
21
- `),r=n.length>0?`
22
-
23
- Other files in \`${t.sandboxPath}/\`: ${n.join(", ")}`:"";return[{type:"text",text:`[${e}]
24
- ${a}${r}`}]}function zt(t,e){const s=[];for(const n of t){if(n.role!=="user"||!n.content)continue;const a=Array.isArray(n.content)?n.content:[n.content];for(const r of a)switch(r.type){case"text":{const o=r.text?.trim();if(!o)continue;s.push({type:"text",text:`[${e}]
25
- ${o}`});break}case"image":case"audio":{if(!r.data||!r.mimeType)continue;s.push({type:"file",url:`data:${r.mimeType};base64,${r.data}`,mediaType:r.mimeType});break}case"resource":{const o=r.resource;if(!o||!o.mimeType)continue;o&&("text"in o&&o.text?s.push({type:"text",text:`[${e}]
26
- ${o.text}`}):"blob"in o&&o.blob&&o.mimeType&&s.push({type:"file",url:`data:${o.mimeType};base64,${o.blob}`,filename:String(o.uri),mediaType:String(o.mimeType)}));break}}}return s}function Je(t){if(!t)return[];const e=[];let s="";const n=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")s+=a.text;else if(a.type==="mention"&&a.attrs){const r=a.attrs.char??"/",o=`${r}${a.attrs.name}`;if(a.attrs.kind==="task"){const i=a.attrs.metadata,d=i?.title??a.attrs.name??"",f=i?.context?.trim()||[d,i?.description?.trim()].filter(Boolean).join(`
27
-
28
- `);f&&e.push({type:"text",text:f});return}if(s+=o,r==="@"){const i=a.attrs.metadata;i&&typeof i=="object"&&!Array.isArray(i)&&"agentId"in i?e.push({type:"text",text:`[DELEGATE TO AGENT: ${i.title??a.attrs.name} (agent_id: ${i.agentId})]
29
- 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(i)&&e.push(...He(i,o))}else if(a.attrs.kind==="skill"){const i=a.attrs.metadata;i&&!Array.isArray(i)&&Array.isArray(i.files)&&e.push(...Xt(i,o))}else{const i=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(i)&&i.length>0&&typeof i[0]=="object"&&i[0]!==null&&"role"in i[0]?e.push(...zt(i,o)):Array.isArray(i)&&e.push(...He(i,o))}}else if(a.type==="file"&&a.attrs){const r=a.attrs,o=`[file:://${encodeURIComponent(r.name)}]`;s+=o,e.push(...Gt(r,o))}if("content"in a&&Array.isArray(a.content))for(const r of a.content)n(r)}};return n(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}function Us(t){const e=Je(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function Fs(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Yt(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function Qs(t){return t.filter(e=>e.status==="queued").sort((e,s)=>e.enqueuedAt-s.enqueuedAt)}function Zt(t,e){return t.some(s=>s.messageId===e.messageId)?t:[...t,e]}function Jt(t,e){return t.filter(s=>s.messageId!==e)}const ee=new Map,es=200;function ts(t){if(ee.size<es||ee.has(t))return;const e=ee.keys().next().value;if(e!==void 0){ee.delete(e),we.delete(e);for(const s of de.keys())s.startsWith(`${e}:`)&&de.delete(s)}}const we=new Set;function ss(t){we.add(t)}function ns(t){return we.has(t)}function rs(t){we.delete(t)}function be(t){const e=ee.get(t);if(e)return ee.delete(t),ee.set(t,e),e;ts(t);const s=new St([]);return ee.set(t,s),s}function et(t,e){be(t).update(s=>Zt(s,e))}function _e(t,e){be(t).update(s=>Jt(s,e))}function as(t,e){be(t).set(e)}const de=new Map;function os(t,e){de.set(`${t}:${e.id}`,e)}function is(t,e){const s=`${t}:${e}`,n=de.get(s);return de.delete(s),n}function We(t,e){de.delete(`${t}:${e}`)}async function J(t,e){try{const s=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!s.ok)return;const n=await s.json();as(e,n.items??[])}catch{}}function js(t){const e=te.c(2);let s;e[0]!==t?(s=be(t),e[0]=t,e[1]=s):s=e[1];const n=s;return k.useSyncExternalStore(n.subscribe,n.get,n.get)}function cs(){const{org:t}=G();return{enqueue:et,refresh:e=>J(t.slug,e),cancel:async(e,s)=>{const n=`thread-run:${e}:${s}`;_e(e,s);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(n)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return oe.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await J(t.slug,e)}}}}function xe(t,e){return t.find(s=>s!=null&&e.has(s.keyId))??null}function ls(t,e,s){const n=a=>xe([a],s);return{tiers:{fast:xe([e.tiers.fast,t.tiers.fast],s),smart:xe([e.tiers.smart,t.tiers.smart],s),thinking:xe([e.tiers.thinking,t.tiers.thinking],s),image:n(t.tiers.image),web_search:n(t.tiers.web_search),deep_research:n(t.tiers.deep_research)}}}const Se={tiers:{}};function us(){const t=te.c(7),{org:e}=G();let s;t[0]!==e.id?(s=ie.userModelPreferences(e.id),t[0]=e.id,t[1]=s):s=t[1];let n;t[2]!==e.slug?(n=async()=>{const r=await ot(e.slug,"USER_MODEL_PREFERENCES_GET",{});return r?.tiers?r:Se},t[2]=e.slug,t[3]=n):n=t[3];let a;return t[4]!==s||t[5]!==n?(a={queryKey:s,queryFn:n,staleTime:6e4},t[4]=s,t[5]=n,t[6]=a):a=t[6],nt(a)}function ds(){return us().data??Se}function Bs(){const t=te.c(19),{org:e}=G(),s=rt(),n=Oe();let a;t[0]!==e.id?(a=ie.userModelPreferences(e.id),t[0]=e.id,t[1]=a):a=t[1];const r=a;let o;t[2]!==r||t[3]!==n||t[4]!==s?(o=async M=>{const p=n.getQueryData(r)??Se;return await s.call("USER_MODEL_PREFERENCES_UPDATE",p)??p},t[2]=r,t[3]=n,t[4]=s,t[5]=o):o=t[5];let i,d,f,g;t[6]!==r||t[7]!==n?(i=M=>{const{tier:p,slot:w}=M,N=n.getQueryData(r),L=N??Se;return n.setQueryData(r,{tiers:{...L.tiers,[p]:w}}),{prev:N}},d=(M,p,w)=>{n.setQueryData(r,w?.prev??Se)},f=M=>{n.setQueryData(r,M)},g=()=>{n.isMutating({mutationKey:r})===1&&n.invalidateQueries({queryKey:r})},t[6]=r,t[7]=n,t[8]=i,t[9]=d,t[10]=f,t[11]=g):(i=t[8],d=t[9],f=t[10],g=t[11]);let v;return t[12]!==r||t[13]!==o||t[14]!==i||t[15]!==d||t[16]!==f||t[17]!==g?(v={mutationKey:r,mutationFn:o,onMutate:i,onError:d,onSuccess:f,onSettled:g},t[12]=r,t[13]=o,t[14]=i,t[15]=d,t[16]=f,t[17]=g,t[18]=v):v=t[18],at(v)}function ps(){const t=te.c(4),e=Pt(),s=ds(),n=ze();let a;return t[0]!==n||t[1]!==e||t[2]!==s?(a=ls(e,s,new Set(n.map(fs))),t[0]=n,t[1]=e,t[2]=s,t[3]=a):a=t[3],a}function fs(t){return t.id}function re(t,e,s,n){if(!t)return null;const a=e.find(o=>o.id===t.keyId);if(!a)return null;const r=s.find(o=>o.modelId===t.modelId);return r?{...r,keyId:t.keyId}:{modelId:t.modelId,title:n??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function hs(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function ms(t,e,s,n){if(!s||n.length===0)return null;const a=e.find(d=>d.id===s);if(!a)return null;const r=wt([a],{[s]:n}),o=t==="fast"?r.chat.fast:t==="thinking"?r.chat.thinking:r.chat.smart;if(!o)return null;const i=n.find(d=>d.modelId===o.modelId);return i?{...i,keyId:s}:null}const Ve=new Set,Z=new Set;function le(t){return k.useSyncExternalStore(t.subscribe,t.get,t.get)}function gs(t){return t.kind==="loading"?"ready":t.kind}const ys=1e4,Ss=10,Le=k.createContext(null),qe=k.createContext(null),Ue=k.createContext(null),tt=k.createContext(null);function bs({children:t}){const{locator:e}=G(),{virtualMcpId:s}=Ze(),[n,a]=ue(ae.chatSelectedImageModel(e),null),[r,o]=ue(ae.chatSelectedWebSearchModel(e),null),[i,d]=ue(ae.chatSelectedDeepResearchModel(e),null),[f,g]=k.useState(null),[v,M]=k.useState("default"),p=ps(),[w,N]=ue(ae.chatSimpleModeTier(e),null),L=hs(w),I=ze(),x=p.tiers[L],F=I.some(c=>c.id===x?.keyId)?x?.keyId:void 0,Q=f&&I.some(c=>c.id===f)?f:F??I[0]?.id??null,{models:_,isLoading:$}=ge(Q??void 0),{models:A}=ge(F),X=I.some(c=>c.id===p.tiers.image?.keyId)?p.tiers.image?.keyId:void 0,{models:se}=ge(X),D=I.some(c=>c.id===p.tiers.web_search?.keyId)?p.tiers.web_search?.keyId:void 0,{models:j}=ge(D),q=I.some(c=>c.id===p.tiers.deep_research?.keyId)?p.tiers.deep_research?.keyId:void 0,{models:W}=ge(q),V=re(x,I,A,x?.title)??ms(L,I,Q,_),K=$,z=_.filter(c=>c.capabilities?.includes("image")),h=re(n,I,z),E=re(p.tiers.image,I,se,p.tiers.image?.title)??h??z[0]??null,b=_.filter($t),C=re(r,I,b),U=b.find(c=>c.modelId==="perplexity/sonar")??b[0]??null,Y=re(p.tiers.web_search,I,j,p.tiers.web_search?.title)??C??U,ce=_.filter(At),O=re(i,I,ce),pe=ce.find(c=>c.modelId==="perplexity/deep-research")??ce.find(c=>c.asyncResearch===!0)??ce[0]??null,$e=re(p.tiers.deep_research,I,W,p.tiers.deep_research?.title)??O??pe,Ee=Ct(s)??{id:s,title:"",description:null,icon:null},[ke,fe]=k.useState({}),ve=(c,y)=>{const T=[];for(const m of y.content??[])m.type==="text"&&m.text?.trim()&&T.push(m.text.trim());const S=T.join(`
30
- `);if(!S){ne(c);return}new TextEncoder().encode(S).length>ys||fe(m=>Object.keys(m).length>=Ss&&!(c in m)?m:{...m,[c]:S})},ne=c=>{fe(y=>{const{[c]:T,...S}=y;return S})},[Pe,Re]=ue(ae.chatLastAgentOption(e),c=>c&&c in je?c:null),Ie=Is(),Te=Dt({pendingOption:Pe,lockedHarness:Ie?.isThreadLocked?Ie.lockedHarness:null}),Me=Te?je[Te]:null,[he,l]=k.useState(void 0),u=k.useRef(he);u.current=he;const P={selectedModel:V,setModel:()=>{},credentialId:Q,setCredentialId:g,allModelsConnections:I,isModelsLoading:K,selectedVirtualMcp:Ee,imageModel:E,setImageModel:c=>{a(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},webSearchModel:Y,setWebSearchModel:c=>{o(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},deepResearchModel:$e,setDeepResearchModel:c=>{d(c?.keyId?{keyId:c.keyId,modelId:c.modelId}:null)},chatMode:v,setChatMode:M,appContexts:ke,setAppContext:ve,clearAppContext:ne,tiptapDoc:he,setTiptapDoc:l,tiptapDocRef:u,resetInteraction:()=>{},simpleModeTier:L,setSimpleModeTier:c=>N(c),pendingAgentOption:Te,setPendingAgentOption:Re,pendingHarnessId:Me};return ye.jsx(Ue.Provider,{value:P,children:t})}function Hs(t){const e=te.c(41),{virtualMcpId:s,task:n,children:a}=t,{locator:r}=G(),{data:o}=it.useSession(),i=o?.user??null,{taskId:d,virtualMcpId:f,navigateToTask:g}=Ze(),[v]=ct(),{markTaskRead:M}=Vt(),p=vt(),w=d,N=f,L=Ht(N);let I;e[0]!==M||e[1]!==g?(I=(b,C)=>{M(b),g(b,{virtualMcpId:C?.virtualMcpId,autosend:C?.autosend})},e[0]=M,e[1]=g,e[2]=I):I=e[2];const x=I,F=w&&n?.id===w?n:null,Q=F?.harness_id??null,_=F?.branch??null,$=Q!=null,A=_;let X;e[3]!==A||e[4]!==r||e[5]!==x||e[6]!==p||e[7]!==s?(X=b=>{const C=crypto.randomUUID(),U=b?.branch??A;return Fe(sessionStorage,r,C,{...b?.runtime?{runtime:b.runtime}:{},...U?{branch:U}:{}}),p.create({id:C,virtual_mcp_id:s,...U?{branch:U}:{},...b?.runtime?{runtime:b.runtime}:{}}).then(()=>{Qe(sessionStorage,r,C),x(C)}).catch(()=>{x(C)}),C},e[3]=A,e[4]=r,e[5]=x,e[6]=p,e[7]=s,e[8]=X):X=e[8];const se=X;let D;e[9]!==A||e[10]!==r||e[11]!==x||e[12]!==p||e[13]!==s?(D=b=>{const C=crypto.randomUUID(),U=b.virtualMcpId??s,Y=U===s?A:null;gt(sessionStorage,r,C,b.message),Y&&Fe(sessionStorage,r,C,{branch:Y}),p.create({id:C,virtual_mcp_id:U,...Y?{branch:Y}:{}}).then(()=>{Qe(sessionStorage,r,C),x(C,{virtualMcpId:b.virtualMcpId,autosend:!0})}).catch(()=>{x(C,{virtualMcpId:b.virtualMcpId,autosend:!0})})},e[9]=A,e[10]=r,e[11]=x,e[12]=p,e[13]=s,e[14]=D):D=e[14];const j=D;let q;e[15]!==w||e[16]!==p?(q=b=>{w&&p.setBranch(w,b)},e[15]=w,e[16]=p,e[17]=q):q=e[17];let W;e[18]!==F||e[19]!==se||e[20]!==j||e[21]!==A||e[22]!==w||e[23]!==N||e[24]!==$||e[25]!==_||e[26]!==Q||e[27]!==x||e[28]!==q?(W={virtualMcpId:N,taskId:w,openTask:x,createTask:se,createTaskWithMessage:j,activeTask:F,isThreadLocked:$,lockedHarness:Q,lockedBranch:_,currentBranch:A,setCurrentTaskBranch:q},e[18]=F,e[19]=se,e[20]=j,e[21]=A,e[22]=w,e[23]=N,e[24]=$,e[25]=_,e[26]=Q,e[27]=x,e[28]=q,e[29]=W):W=e[29];const V=W;let K;e[30]!==L||e[31]!==v||e[32]!==g||e[33]!==i?(K={user:i,contextPrompt:L,preferences:v,rawNavigateToTask:g},e[30]=L,e[31]=v,e[32]=g,e[33]=i,e[34]=K):K=e[34];const z=K;let h;e[35]!==a||e[36]!==z?(h=ye.jsx(bs,{children:ye.jsx(tt.Provider,{value:z,children:a})}),e[35]=a,e[36]=z,e[37]=h):h=e[37];let E;return e[38]!==h||e[39]!==V?(E=ye.jsx(qe.Provider,{value:V,children:h}),e[38]=h,e[39]=V,e[40]=E):E=e[40],E}function Ws({taskId:t,children:e}){const s=Ce(),n=It(),{virtualMcpId:a,activeTask:r,currentBranch:o}=ks(),i=Lt({isDesktopApp:n,harnessId:r?.harness_id}),d=s("chat.input.codingAgentRequiresDesktop");t&&!Ve.has(t)&&(Ve.add(t),ut("chat_opened",{thread_id:t}));const{imageModel:f,webSearchModel:g,deepResearchModel:v,chatMode:M,setChatMode:p,appContexts:w,setTiptapDoc:N,simpleModeTier:L}=vs(),I=k.useContext(tt);if(!I)throw new Error(s("chat.chatContext.activeTaskProviderMissingContext"));const{user:x,contextPrompt:F,preferences:Q,rawNavigateToTask:_}=I,{org:$,locator:A}=G(),X=cs(),[se,D]=k.useState(null),j=()=>{D(new Error(d))},q=Wt(),W=Oe(),V=bt(),K=Ge(),z=Tt({connectionId:xt,orgId:$.id,orgSlug:$.slug}),h=kt($.slug,t,{client:z});k.use(h.ready);const E=le(h.messages),b=le(h.status),C=le(h.finishReason),U=le(h.runStatusStage),Y=le(h.hasMoreOlder),ce=le(h.isFetchingOlder),O=k.useRef({onToolCall:q,queryClient:W,rawNavigateToTask:_,taskId:t,manager:V,navigate:K,orgId:$.id,orgSlug:$.slug});O.current={onToolCall:q,queryClient:W,rawNavigateToTask:_,taskId:t,manager:V,navigate:K,orgId:$.id,orgSlug:$.slug},Et({orgSlug:$.slug,taskId:t,onTaskStatus:l=>{const u=O.current,P=l.data.message_id;if(l.data.status==="in_progress"&&P){_e(u.taskId,P);const c=is(u.taskId,P);c&&h.applyLocalMessage(c),J(u.orgSlug,u.taskId)}ns(u.taskId)&&(async()=>(await J(u.orgSlug,u.taskId),await h.reconcileFromServer()&&be(u.taskId).get().length===0&&rs(u.taskId)))()}}),k.useEffect(()=>{const l={onData:y=>{if(y.type==="data-thread-title"){const T=y.data;if(!T?.title)return;const S=O.current;if(!S.taskId)return;S.manager.patchThread({id:S.taskId,title:T.title,updated_at:new Date().toISOString()});return}if(y.type==="data-deck-updated"){const T=y.data;if(!T?.path)return;const S=T.path,m=O.current;m.queryClient.invalidateQueries({queryKey:ie.orgFsStat(m.orgId,"home",S)}),m.queryClient.invalidateQueries({queryKey:ie.orgFsRecent(m.orgId)}),m.navigate({to:".",search:B=>({...B,main:mt(S)}),replace:!0});return}if(y.type==="data-open-preview"){const T=y.data,S=O.current,m=S.taskId;if(m){const B=S.manager.threads.get().find(H=>H.id===m);S.manager.patchThread({id:m,...T?.branch?{branch:T.branch}:{},metadata:{...B?.metadata??{},...T?.githubRepo?{githubRepo:T.githubRepo}:{},...T?.sandboxMap?{sandboxMap:T.sandboxMap}:{}}})}S.navigate({to:".",search:B=>({...B,main:"preview"}),replace:!0});return}},onFinish:(y,T,S)=>{const m=O.current;m.taskId&&J(m.orgSlug,m.taskId),m.taskId&&m.manager.patchThread({id:m.taskId,status:Rt(S,y.parts),updated_at:new Date().toISOString()});const B=y.parts?.some(R=>{const me=R;return(me.type==="tool-bash"||me.type==="tool-write")&&me.state==="output-available"});if(m.taskId&&B){const R=ie.threadOutputs(m.taskId);for(const me of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{m.queryClient.invalidateQueries({queryKey:R})},me)}m.queryClient.invalidateQueries({queryKey:ie.homeNextActions(m.orgSlug)});const H=y.metadata?.thread_id;H&&H!==m.taskId&&m.rawNavigateToTask(H)},onError:y=>{D(y),console.error("[chat] Error",y)},onToolCall:y=>O.current.onToolCall(y)};h.observer=l,J(O.current.orgSlug,O.current.taskId);const u=y=>y==="submitted"||y==="streaming";let P=u(h.status.get().kind);const c=h.status.subscribe(()=>{const y=u(h.status.get().kind);if(y===P)return;P=y;const T=O.current;J(T.orgSlug,T.taskId)});return()=>{h.observer===l&&(h.observer=null),c()}},[h]);const pe=b.kind==="submitted"||b.kind==="streaming",$e=E.length===0,Ae=E.at(-1),Ee=!pe&&Ae?.role==="assistant"&&Ae.parts.some(l=>"state"in l&&l.state==="approval-requested"),ke=r,fe=(ke?.status==="in_progress"||ke?.status==="expired")&&b.kind==="ready"&&E.length>0;async function ve(l){const u=t,P=a;if(i)return j(),Z.delete(u),!1;const c=Object.entries(w),y=c.length>0?c.map(([H,R])=>`### App Context: ${H}
31
- ${R}`).join(`
32
-
33
- `):"",T=[F,y].filter(Boolean).join(`
34
-
35
- `);let S=M;S==="gen-image"&&!f&&(S="default"),S==="web-search"&&!g&&(S="default"),S==="deep-research"&&!v&&(S="default"),(S==="web-search"||S==="deep-research")&&p("default");const m=Ot({thread:r?{harness_id:r.harness_id??null,branch:r.branch??null}:null,globals:{branch:o}});r?.harness_id||V.patchThread({id:u,harness_id:"decopilot",updated_at:new Date().toISOString()});const B={tier:L,mode:S,toolApprovalLevel:Q.toolApprovalLevel??lt(),system:T||void 0,agent:{id:P},thread_id:u,...m};try{if(pe||fe){let H=!0;try{os(u,l),await h.enqueue(l,B),et(u,{workflowId:`thread-run:${u}:${l.id}`,messageId:l.id,text:Yt(l.parts),hasAttachments:l.parts.some(R=>R.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),ss(u)}catch(R){H=!1,We(u,l.id),_e(u,l.id),D(R instanceof Error?R:new Error(String(R))),oe.error(R instanceof Error?R.message:s("chat.chatContext.failedToQueueMessage"))}return J($.slug,u),H}return await h.submit({kind:"message",message:l},B),!0}finally{Z.delete(u)}}async function ne(l){const u=l.parts??Je(l.tiptapDoc);if(u.length===0||Z.has(t))return;Z.add(t),D(null),N(void 0);const P={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:x?.image??void 0,name:x?.name??"you"}},c={id:crypto.randomUUID(),role:"user",parts:u,metadata:P};await ve(c)}async function Pe(l,u){if(i)return j(),!1;if(Z.has(t))return oe.info(s("chat.chatContext.stillSendingPreviousMessage")),!1;if(Z.add(t),!await X.cancel(t,l))return Z.delete(t),oe.error(s("chat.chatContext.couldNotRemoveOriginalMessage")),!1;We(t,l),h.removeLocalMessage(l);const c={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:x?.image??void 0,name:x?.name??"you"}}};try{return await ve(c)}catch(y){return oe.error(y instanceof Error?y.message:s("chat.chatContext.failedToSendEditedMessage")),!1}}const Re=async()=>{h.stop();try{const l=await fetch(`/api/${$.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.message??s("chat.chatContext.cancelFailedStatus",{status:l.status}))}}catch(l){const u=l instanceof Error?l.message:s("chat.chatContext.failedToCancel");oe.error(u),console.error("[chat] cancelRun",l)}},Ie=l=>l&&typeof l=="object"&&"type"in l?ne({tiptapDoc:l}):ne(l),Me=De({strict:!1}).autosend===Xe;k.useEffect(()=>{if(!Me||E.length>0||i)return;const l=ft(sessionStorage,A,t);l&&ne(l.message).then(()=>{ht(sessionStorage,A,t)})},[Me,E.length,i,A,t,ne]);const he={messages:E,status:gs(b),sendMessage:Ie,editQueuedMessage:Pe,stop:()=>{if(i){j();return}Re()},submit:async(l,u)=>{if(i){j();return}await h.submit(l,u)},removeLocalMessage:l=>h.removeLocalMessage(l),isSendInFlight:()=>Z.has(t),error:se,clearError:()=>D(null),finishReason:C,runStatusStage:U,clearFinishReason:()=>h.finishReason.set(null),isStreaming:pe,isChatEmpty:$e,isWaitingForApprovals:Ee??!1,isRunInProgress:fe,hasMoreOlder:Y,isFetchingOlder:ce,fetchOlderMessages:h.fetchOlderMessages.bind(h)};return ye.jsx(Le.Provider,{value:he,children:e})}function Vs(){const t=Ce(),e=k.useContext(Le);if(!e)throw new Error(t("chat.chatContext.useChatStreamMissingContext"));return e}function Ks(){return k.useContext(Le)}function ks(){const t=Ce(),e=k.useContext(qe);if(!e)throw new Error(t("chat.chatContext.useChatTaskMissingContext"));return e}function vs(){const t=Ce(),e=k.useContext(Ue);if(!e)throw new Error(t("chat.chatContext.useChatPrefsMissingContext"));return e}function Gs(){return k.useContext(Ue)}function Is(){return k.useContext(qe)}export{Ws as A,Ds as B,bs as C,Gs as D,qt as H,Vs as a,Is as b,ks as c,js as d,cs as e,We as f,xe as g,us as h,Bs as i,ps as j,Ks as k,Lt as l,Hs as m,Fs as n,Je as o,Qt as p,jt as q,Ns as r,Qs as s,Us as t,vs as u,Os as v,Ls as w,Ye as x,qs as y,Ze as z};
@@ -1 +0,0 @@
1
- import{c as P,j as t,B as W,k as oe,ak as Ye,an as re,b as Q,E as Ee,r as E,H as fe,bU as Ge,bV as Oe,ax as Ze,n as K,bW as et,u as tt,L as te,aa as st,ab as ye,a8 as we,a9 as Ce,t as lt,f as he,bX as Re}from"./index-T6DmNp2G.js";import{E as ze}from"./empty-state-35WpGuH2.js";import{u as ge}from"./use-mcp-client-CDW5sZtI.js";import{d as ae,F as ot,a as ce,b as de}from"./form-D6zBacj_.js";import{I as pe}from"./input-oGRrJ1WQ.js";import{T as xe}from"./textarea-CDV_NSfk.js";import{a as nt,b as it,V as je,O as rt,M as at}from"./index-2CobItH_.js";import{aV as ct,T as dt,aW as mt,as as ut,au as pt,aX as xt,r as Ie}from"./agent-icon-Dmq8gvpL.js";import{g as ft,M as ht,a as $e}from"./types-IPakUJfp.js";import{A as gt,a as jt,b as bt}from"./alert-DWirX9mM.js";import{S as Te,a as ke,b as Pe,c as Ae,d as me}from"./select-C7mOn2qi.js";import{i as Nt}from"./AlertCircle-C_ue5dpm.js";import{s as vt}from"./Stars02-BI31D4OX.js";import{a as St}from"./Copy01-CFs5dLvg.js";import{i as yt}from"./Play-DzEIXwV3.js";import{i as wt}from"./ChevronRight-CvdpRaYe.js";import{g as Ct}from"./connection-slug-eyAPH6o3.js";import{u as It,T as $t}from"./use-mcp-auth-status-Cc6w6BXA.js";import{a as Fe,u as Me}from"./use-connection-Be_N4k3-.js";import{a as Tt}from"./use-mcp-tools-BBQ0wX2A.js";import{M as kt,c as Pt}from"./monaco-editor-2T4Cd5Nl.js";import{I as De}from"./integration-icon-Dws-vFYP.js";import{k as At,D as Dt}from"./chat-context-CSLWuE9T.js";import{u as Et}from"./shell-layout-CzDL5OMt.js";import{n as Ot}from"./Tool02-p2g1RG2k.js";import"./constants-z9Iog-sb.js";import"./auth-cBUP-u5Z.js";import"./label-TreJijRH.js";import"./Key01-D5LVGaJJ.js";import"./extract-connection-data-BnNbJQwk.js";import"./metadata-dUsYcpuu.js";import"./use-registry-connections-CAUwAi1r.js";import"./use-organization-settings-DYyCCrCY.js";import"./Plus-vGWd1KNe.js";import"./index-CmirivJl.js";import"./index-DoGnuonz.js";import"./index-CAJCIeWO.js";import"./popover-BVSaKROt.js";import"./use-virtual-mcp-CN9IG9dM.js";import"./Check-D3rP61VF.js";import"./SearchMd-XqjOgOFN.js";import"./Users03-C2R3qA_D.js";import"./use-create-virtual-mcp-CTVcOIF-.js";import"./use-navigate-to-agent-8vvrRa64.js";import"./hooks-Ql-21rZI.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B5-Oi7QM.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./session-runtime-wVXsCwcJ.js";import"./Tool01-DjC_P2pS.js";import"./ArrowUp-2ENJuKn1.js";import"./ArrowLeft-D_1i_-_K.js";import"./XCircle-BPD_epMV.js";import"./TrendUp01-DnG2kf95.js";import"./ZapSquare-DwfBHtg5.js";import"./CheckCircle-i_syDqdQ.js";import"./ChevronDown-Dr8vCWZv.js";import"./ChevronSelectorVertical-Dv_pTodY.js";import"./ChevronUp-BzXRNWp_.js";import"./DotsVertical-hb3NfPIe.js";import"./UserSquare-DVQPfFoA.js";import"./CreditCard01-B0k56rzq.js";import"./Download01-DxQvMChl.js";import"./Settings02-Bxo2JBIC.js";import"./Eye-mrurW8BJ.js";import"./FilterLines-jfYmDBkV.js";import"./Share07-BjvPJZVx.js";import"./Globe01-ChvjLPM2.js";import"./Globe04-GZK8hXZj.js";import"./SwitchHorizontal01-CgC73t0c.js";import"./HardDrive-bQRF3cZb.js";import"./LinkExternal01-BcSO7_Tr.js";import"./LockUnlocked01-CY5J19s0.js";import"./LogOut01-DW9UNyyB.js";import"./Monitor01-B4Jy2ot3.js";import"./Sun-DsNQ6nv4.js";import"./Palette-C1Iyut6b.js";import"./SearchLg-Cys207lC.js";import"./Shield01-DOAbMUeh.js";import"./Stars01-Bpn6m19l.js";import"./Trash01-C3-kPIxA.js";import"./Upload01-98bMMhx8.js";import"./User01-DRaAh8Fc.js";import"./Users01-Bayg2V9E.js";import"./XClose-CY0G2wZ2.js";import"./Zap-BMa0uCBP.js";import"./badge-Cvu8IrGy.js";import"./mcp-oauth-Baiyn1cx.js";import"./spinner-CZJvZw9q.js";import"./tab-id-Crl7Lrhw.js";import"./dialog-DKtG2q4B.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-ai-providers-CxBvAmu8.js";import"./use-decopilot-events-LtP-eSLP.js";import"./avatar-BaPskY-5.js";import"./required-auth-layout-CI-I7_n9.js";import"./use-org-sso-Bsjlvsw0.js";function Rt(s){const e=P.c(15),{onSave:n,onUndo:l,isDirty:o,isSaving:i,saveLabel:r,undoLabel:c}=s,d=r===void 0?"Save":r,a=c===void 0?"Undo":c;if(!o)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ct,{size:14}),e[0]=x):x=e[0];let h;e[1]!==i||e[2]!==l||e[3]!==a?(h=t.jsxs(W,{variant:"outline",size:"sm",onClick:l,disabled:i,"aria-label":a,children:[x,a]}),e[1]=i,e[2]=l,e[3]=a,e[4]=h):h=e[4];let m;e[5]!==i?(m=i?t.jsx(oe,{size:14,className:"animate-spin"}):t.jsx(dt,{size:14}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==n||e[9]!==d||e[10]!==m?(f=t.jsxs(W,{variant:"default",size:"sm",onClick:n,disabled:i,"aria-label":d,children:[m,d]}),e[7]=i,e[8]=n,e[9]=d,e[10]=m,e[11]=f):f=e[11];let p;return e[12]!==h||e[13]!==f?(p=t.jsxs(t.Fragment,{children:[h,f]}),e[12]=h,e[13]=f,e[14]=p):p=e[14],p}Ye({title:re().min(1),description:re().nullable(),body:re()});function ue(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function zt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(l=>l==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Ft(s){const e=P.c(43),{form:n}=s,l=Q();let o;e[0]!==l?(o=l("details.prompt.details"),e[0]=l,e[1]=o):o=e[1];let i;e[2]!==o?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:o}),e[2]=o,e[3]=i):i=e[3];let r;e[4]!==l?(r=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.title")}),t.jsx(de,{children:t.jsx(pe,{...N,placeholder:l("details.prompt.titlePlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[4]=l,e[5]=r):r=e[5];let c;e[6]!==n.control||e[7]!==r?(c=t.jsx(ae,{control:n.control,name:"title",render:r}),e[6]=n.control,e[7]=r,e[8]=c):c=e[8];let d;e[9]!==l?(d=w=>{const{field:N}=w;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:l("details.prompt.description")}),t.jsx(de,{children:t.jsx(pe,{...N,value:N.value??"",placeholder:l("details.prompt.descriptionPlaceholder"),className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})},e[9]=l,e[10]=d):d=e[10];let a;e[11]!==n.control||e[12]!==d?(a=t.jsx(ae,{control:n.control,name:"description",render:d}),e[11]=n.control,e[12]=d,e[13]=a):a=e[13];let x;e[14]!==c||e[15]!==a?(x=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c,a]}),e[14]=c,e[15]=a,e[16]=x):x=e[16];let h;e[17]!==i||e[18]!==x?(h=t.jsxs("div",{className:"flex flex-col gap-4",children:[i,x]}),e[17]=i,e[18]=x,e[19]=h):h=e[19];let m;e[20]!==l?(m=l("details.prompt.message"),e[20]=l,e[21]=m):m=e[21];let f;e[22]!==m?(f=t.jsx("div",{className:"text-sm font-medium text-foreground",children:m}),e[22]=m,e[23]=f):f=e[23];let p;e[24]!==l?(p=l("details.prompt.messageDescription"),e[24]=l,e[25]=p):p=e[25];let g;e[26]!==p?(g=t.jsx("div",{className:"text-xs text-muted-foreground",children:p}),e[26]=p,e[27]=g):g=e[27];let b;e[28]!==l?(b=w=>{const{field:N}=w;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(xe,{...N,value:N.value??"",placeholder:l("details.prompt.bodyPlaceholder"),className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})},e[28]=l,e[29]=b):b=e[29];let S;e[30]!==n.control||e[31]!==b?(S=t.jsx(ae,{control:n.control,name:"body",render:b}),e[30]=n.control,e[31]=b,e[32]=S):S=e[32];let T;e[33]!==f||e[34]!==g||e[35]!==S?(T=t.jsxs("div",{className:"flex flex-col gap-2",children:[f,g,S]}),e[33]=f,e[34]=g,e[35]=S,e[36]=T):T=e[36];let y;e[37]!==T||e[38]!==h?(y=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[h,T]}),e[37]=T,e[38]=h,e[39]=y):y=e[39];let k;return e[40]!==n||e[41]!==y?(k=t.jsx(ot,{...n,children:y}),e[40]=n,e[41]=y,e[42]=k):k=e[42],k}function Mt(s){const e=P.c(42),{providerId:n,promptId:l}=s,o=Q(),{org:i}=fe(),r=n||null;let c;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(c={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=c):c=e[3];const d=ge(c),a=Ge(n,"PROMPT",l,d),x=Oe(n,"PROMPT",d),h=x.update.isPending;let m;e[4]!==a?(m=a?{title:a.title,description:a.description??null,body:ue(a)}:void 0,e[4]=a,e[5]=m):m=e[5];let f;e[6]!==m?(f={values:m},e[6]=m,e[7]=f):f=e[7];const p=Ze(f);let g;e[8]!==p||e[9]!==a?(g=()=>{a&&p.reset({title:a.title,description:a.description??null,body:ue(a)})},e[8]=p,e[9]=a,e[10]=g):g=e[10];const b=g;let S;e[11]!==x.update||e[12]!==p||e[13]!==l?(S=p.handleSubmit(async C=>{const I=await x.update.mutateAsync({id:l,data:{title:C.title,description:C.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:C.body}}]}});p.reset({title:I.title,description:I.description??null,body:ue(I)})}),e[11]=x.update,e[12]=p,e[13]=l,e[14]=S):S=e[14];const T=S;if(!a){let C;e[15]!==o?(C=o("details.prompt.notFoundTitle"),e[15]=o,e[16]=C):C=e[16];let I;e[17]!==o?(I=o("details.prompt.notFoundDescription"),e[17]=o,e[18]=I):I=e[18];let R;return e[19]!==C||e[20]!==I?(R=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ze,{title:C,description:I})}),e[19]=C,e[20]=I,e[21]=R):R=e[21],R}let y;e[22]!==a.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[22]=a.title,e[23]=y):y=e[23];let k;e[24]!==a.description?(k=a.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[24]=a.description,e[25]=k):k=e[25];let w;e[26]!==y||e[27]!==k?(w=t.jsx(it,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,k]})}),e[26]=y,e[27]=k,e[28]=w):w=e[28];let N;e[29]!==T?(N=()=>{T()},e[29]=T,e[30]=N):N=e[30];let A;e[31]!==p.formState.isDirty||e[32]!==h||e[33]!==b||e[34]!==N?(A=t.jsx(nt,{children:t.jsx(Rt,{onSave:N,onUndo:b,isDirty:p.formState.isDirty,isSaving:h})}),e[31]=p.formState.isDirty,e[32]=h,e[33]=b,e[34]=N,e[35]=A):A=e[35];let D;e[36]!==p?(D=t.jsx("div",{className:"h-full",children:t.jsx(Ft,{form:p})}),e[36]=p,e[37]=D):D=e[37];let O;return e[38]!==A||e[39]!==D||e[40]!==w?(O=t.jsxs(je,{children:[w,A,D]}),e[38]=A,e[39]=D,e[40]=w,e[41]=O):O=e[41],O}function Lt(s){const e=P.c(10),{itemId:n}=s,l=Q();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=zt(),e[0]=o):o=e[0];const i=o;if(!i){let c;e[1]!==l?(c=l("details.prompt.notFoundTitle"),e[1]=l,e[2]=c):c=e[2];let d;e[3]!==l?(d=l("details.prompt.missingConnectionDescription"),e[3]=l,e[4]=d):d=e[4];let a;return e[5]!==c||e[6]!==d?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ze,{title:c,description:d})}),e[5]=c,e[6]=d,e[7]=a):a=e[7],a}let r;return e[8]!==n?(r=t.jsx(Ee,{children:t.jsx(E.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:i,promptId:n})})}),e[8]=n,e[9]=r):r=e[9],r}function Le(s){const e=P.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("min-w-0 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function Be(s){const e=P.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function Y(s){const e=P.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function se(s){const e=P.c(10);let n,l,o;e[0]!==s?({asChild:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);const i=n?et:"a";let r;e[4]!==l?(r=K("hover:text-foreground transition-colors truncate",l),e[4]=l,e[5]=r):r=e[5];let c;return e[6]!==i||e[7]!==o||e[8]!==r?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:r,...o}),e[6]=i,e[7]=o,e[8]=r,e[9]=c):c=e[9],c}function Ue(s){const e=P.c(8);let n,l;e[0]!==s?({className:n,...l}=s,e[0]=s,e[1]=n,e[2]=l):(n=e[1],l=e[2]);let o;e[3]!==n?(o=K("text-foreground font-medium truncate",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==l||e[6]!==o?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:o,...l}),e[5]=l,e[6]=o,e[7]=i):i=e[7],i}function le(s){const e=P.c(12);let n,l,o;e[0]!==s?({children:n,className:l,...o}=s,e[0]=s,e[1]=n,e[2]=l,e[3]=o):(n=e[1],l=e[2],o=e[3]);let i;e[4]!==l?(i=K("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",l),e[4]=l,e[5]=i):i=e[5];let r;e[6]!==n?(r=n??t.jsx(wt,{}),e[6]=n,e[7]=r):r=e[7];let c;return e[8]!==o||e[9]!==i||e[10]!==r?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...o,children:r}),e[8]=o,e[9]=i,e[10]=r,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=P.c(12),{toolName:n,connectionId:l,siblings:o,onSelectInstance:i,onBack:r}=s,c=Q();let d;e[0]!==l?(d={connectionId:l},e[0]=l,e[1]=d):d=e[1];const a=It(d);if(!a.isAuthenticated){let m;return e[2]!==a.supportsOAuth||e[3]!==r||e[4]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?t.jsx(rt,{onAuthenticate:()=>r(),buttonText:c("details.tool.goBackToAuthenticate")}):t.jsx(at,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=r,e[4]=c,e[5]=m):m=e[5],m}const x=`${l}:${n}`;let h;return e[6]!==l||e[7]!==i||e[8]!==o||e[9]!==x||e[10]!==n?(h=t.jsx(Vt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:i},x),e[6]=l,e[7]=i,e[8]=o,e[9]=x,e[10]=n,e[11]=h):h=e[11],h}function Vt({toolName:s,connectionId:e,siblings:n,onSelectInstance:l}){const o=Q(),{replayId:i}=tt({strict:!1}),r=(()=>{if(!i)return null;const u=`replay-${i}`,j=sessionStorage.getItem(u);if(!j)return null;sessionStorage.removeItem(u);try{return JSON.parse(j)}catch{return null}})(),c=(()=>{if(!r)return null;const u={};for(const[j,$]of Object.entries(r))$!==null&&typeof $=="object"?u[j]=JSON.stringify($,null,2):u[j]=$;return u})(),[d,a]=E.useState(c??{}),[x,h]=E.useState(r?JSON.stringify(r,null,2):"{}"),[m,f]=E.useState(null),[p,g]=E.useState(null),[b,S]=E.useState(null),[T,y]=E.useState(null),[k,w]=E.useState(!1),[N,A]=E.useState(null),{org:D}=fe(),O=Fe(e),C=At(),I=Dt(),{openSidePanel:R}=Et(),U=`${e}:${s}`,F=ge({connectionId:e,orgId:D.id,orgSlug:D.slug}),V=Tt({client:F}),v=V.data?.tools?.find(u=>u.name===s),z=ft(v?._meta),J=u=>{if(!C)return;const j=Pt(u.content);j.content.length>0&&(R("chat"),C.sendMessage({tiptapDoc:j}))},[M,L]=E.useState("json"),[q,X]=E.useState(!1);z&&!q&&(L("ui"),X(!0));const _=v?.inputSchema?.properties,be=_?Object.keys(_):[],G=be.length>0,Z={};if(G&&v?.inputSchema?.properties)for(const u of be)Z[u]=v.inputSchema.required?.includes(u)?"":void 0;const ne=u=>Object.prototype.hasOwnProperty.call(d,u),Ve=async()=>{w(!0),y(null),f(null),g(null),S(null),A(null);const u=performance.now();try{if(!F)throw new Error("MCP client is not available");const j=G?{...Z,...d}:(()=>{const B=x.trim();if(!B)return{};const H=JSON.parse(B);if(H&&typeof H=="object")return H;throw new Error("Raw JSON input must be an object.")})();G&&v?.inputSchema?.properties&&Object.entries(v.inputSchema.properties).forEach(([B,H])=>{if((H.type==="object"||H.type==="array")&&typeof j[B]=="string")try{j[B]=JSON.parse(j[B])}catch{}else if((H.type==="number"||H.type==="integer")&&typeof j[B]=="string"&&j[B]!==""){const Se=Number(j[B]);Number.isNaN(Se)||(j[B]=Se)}});const $=await F.callTool({name:s,arguments:j}),ee=$.structuredContent??$,Ke=performance.now(),Qe=Math.round(Ke-u);f(ee),g($),S(j);const Xe=JSON.stringify(ee),ve=new TextEncoder().encode(Xe).length;A({duration:`${Qe}ms`,bytes:`${ve} bytes`,tokens:`~${Math.ceil(ve/4)} tokens`,cost:"$0.0000"})}catch(j){const $=j instanceof Error?j.message:String(j);y($||"Unknown error occurred");const ee=performance.now();A({duration:`${Math.round(ee-u)}ms`})}finally{w(!1)}},ie=(u,j)=>{a($=>({...$,[u]:j}))},_e=()=>{f(null),g(null),S(null),y(null),A(null)},Je=v?.name??Bt(s),qe=t.jsx(Le,{children:t.jsxs(Be,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:D.slug},children:o("details.tool.connections")})})}),t.jsx(le,{}),O&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:D.slug,appSlug:Ct(O)},search:{tab:"tools"},children:O.title})})}),t.jsx(le,{})]}),t.jsx(Y,{children:t.jsx(Ue,{children:Je})})]})}),Ne=n.length>1&&t.jsxs(Te,{value:e,onValueChange:l,children:[t.jsx(ke,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(Pe,{})}),t.jsx(Ae,{children:n.map(u=>t.jsx(me,{value:u.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(De,{icon:u.icon,name:u.title,size:"xs",className:"shrink-0"}),u.title]})},u.id))})]}),He=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:o("details.tool.parameters")}),v?.inputSchema?.required&&v.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," ",o("details.tool.required")]})]}),t.jsx("div",{className:"space-y-4",children:G&&v?.inputSchema?.properties?Object.entries(v.inputSchema.properties).map(([u,j])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[u,v.inputSchema?.required?.includes(u)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:j.type})]}),j.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.description}),j.type==="object"||j.type==="array"?t.jsx(xe,{className:"font-mono text-xs",value:ne(u)?d[u]??"":Z[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enterAsJson",{key:u}),rows:3}):j.type==="boolean"?t.jsxs(Te,{value:ne(u)?String(d[u]??""):"",onValueChange:$=>ie(u,$==="true"),children:[t.jsx(ke,{children:t.jsx(Pe,{placeholder:o("details.tool.selectTrueOrFalse")})}),t.jsxs(Ae,{children:[t.jsx(me,{value:"true",children:"true"}),t.jsx(me,{value:"false",children:"false"})]})]}):t.jsx(pe,{value:ne(u)?d[u]??"":Z[u]??"",onChange:$=>ie(u,$.target.value),placeholder:o("details.tool.enter",{key:u})})]},u)):v?.inputSchema&&!G?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:o("details.tool.rawJsonInput")}),t.jsx(xe,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:u=>h(u.target.value),placeholder:o("details.tool.rawJsonExample")})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o("details.tool.noParametersRequired")})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:_e,children:[t.jsx(mt,{className:"h-3.5 w-3.5"}),o("details.tool.cancel")]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ve,children:[t.jsx(yt,{className:"h-3.5 w-3.5 fill-current"}),o("details.tool.executeTool")]})})]}),We=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:o("details.tool.result")}),t.jsxs("div",{className:"flex items-center gap-3",children:[N&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(vt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.duration})]}),N.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.tokens})]}),N.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:N.bytes})]}),N.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:N.cost})})]}),z&&t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(W,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("ui"),children:t.jsx(xt,{size:14})})}),t.jsx(Ce,{children:o("details.tool.interactiveView")})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(W,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>L("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:o("details.tool.jsonView")})]})]})})]})]}),T&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(gt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Nt,{className:"h-4 w-4"}),t.jsx(jt,{className:"mb-0",children:o("details.tool.executionFailed")})]}),t.jsx(bt,{className:"text-xs text-destructive",children:T})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:z&&M==="ui"&&F?t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:o("details.tool.loadingApp")})]})}),children:t.jsx(ht,{resourceURI:z,toolInfo:v?{tool:v}:void 0,toolInput:b??void 0,toolResult:p??void 0,displayMode:"fullscreen",minHeight:$e.view.minHeight,maxHeight:$e.view.maxHeight,client:F,onMessage:J,onUpdateModelContext:u=>I?.setAppContext(U,u),onTeardown:()=>I?.clearAppContext(U),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(kt,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),lt.success(o("details.tool.copiedToClipboard"))},children:t.jsx(St,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:o("details.tool.runToolToSeeResults")})]})})]});return t.jsx(je,{breadcrumb:qe,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(De,{icon:O?.icon||null,name:O?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[V.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):V.isLoading?t.jsx(oe,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:V.isSuccess?"ready":V.isLoading?"connecting":"error"})]}),t.jsx($t,{annotations:v?.annotations,_meta:v?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:Ne})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:v?.description||"No description available"})]}),n.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:o("details.tool.instance")}),Ne]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:He}),We]})})]})})}function _t(s){const e=P.c(20),{itemId:n,siblings:l,onBack:o}=s,i=Q(),[r,c]=E.useState(l[0]?.id??"");let d;e[0]!==r||e[1]!==l?(d=l.find(f=>f.id===r)?.id??l[0]?.id??"",e[0]=r,e[1]=l,e[2]=d):d=e[2];const a=d;if(!Fe(a||void 0)||!a){let f;e[3]!==i?(f=i("details.tool.connectionNotFound"),e[3]=i,e[4]=f):f=e[4];let p;e[5]!==f?(p=t.jsx("h3",{className:"text-lg font-semibold",children:f}),e[5]=f,e[6]=p):p=e[6];let g;e[7]!==i?(g=i("details.tool.connectionNotFoundMessage"),e[7]=i,e[8]=g):g=e[8];let b;e[9]!==g?(b=t.jsx("p",{className:"text-sm text-muted-foreground",children:g}),e[9]=g,e[10]=b):b=e[10];let S;return e[11]!==p||e[12]!==b?(S=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[p,b]})}),e[11]=p,e[12]=b,e[13]=S):S=e[13],S}let h;e[14]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[14]=h):h=e[14];let m;return e[15]!==a||e[16]!==o||e[17]!==l||e[18]!==n?(m=t.jsx(E.Suspense,{fallback:h,children:t.jsx(Ut,{toolName:n,connectionId:a,siblings:l,onSelectInstance:c,onBack:o})}),e[15]=a,e[16]=o,e[17]=l,e[18]=n,e[19]=m):m=e[19],m}function Jt(s){const e=P.c(21),{icon:n,illustration:l,title:o,description:i,buttonProps:r,buttonComponent:c,className:d,children:a}=s;let x;e[0]!==d?(x=K("flex flex-col items-center justify-center py-16 text-center",d),e[0]=d,e[1]=x):x=e[1];let h;e[2]!==n||e[3]!==l?(h=l?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:l}):n?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:n}):null,e[2]=n,e[3]=l,e[4]=h):h=e[4];let m;e[5]!==o?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==c||e[13]!==r?(g=(c??r)&&t.jsx("div",{className:"mt-4",children:c??(r&&t.jsx(W,{size:"sm",className:K(r?.className),...r}))}),e[12]=c,e[13]=r,e[14]=g):g=e[14];let b;return e[15]!==a||e[16]!==x||e[17]!==h||e[18]!==p||e[19]!==g?(b=t.jsxs("div",{className:x,children:[h,p,g,a]}),e[15]=a,e[16]=x,e[17]=h,e[18]=p,e[19]=g,e[20]=b):b=e[20],b}const qt={prompt:Lt};function Ht(){const s=P.c(9),e=Re();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=decodeURIComponent(l.itemId);let i;s[1]!==l.appSlug?(i={slug:l.appSlug},s[1]=l.appSlug,s[2]=i):i=s[2];const r=Me(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const d=c,a=Wt;let x;return s[5]!==d||s[6]!==o||s[7]!==r?(x=t.jsx(_t,{itemId:o,siblings:r,onBack:d,onUpdate:a}),s[5]=d,s[6]=o,s[7]=r,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=P.c(52),e=Re();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const l=he(n),o=Q(),i=decodeURIComponent(l.collectionName),r=decodeURIComponent(l.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:a}=fe();let x;s[3]!==l.appSlug?(x={slug:l.appSlug},s[3]=l.appSlug,s[4]=x):x=s[4];const m=Me(x)[0]??null,f=m?.id??"",p=f||"no-connection",g=f??null;let b;s[5]!==a.id||s[6]!==a.slug||s[7]!==g?(b={connectionId:g,orgId:a.id,orgSlug:a.slug},s[5]=a.id,s[6]=a.slug,s[7]=g,s[8]=b):b=s[8];const S=ge(b),T=Oe(p,i,S);let y;s[9]!==T||s[10]!==r?(y=async _=>{r&&await T.update.mutateAsync({id:r,data:_})},s[9]=T,s[10]=r,s[11]=y):y=s[11];const k=y;let w;s[12]!==i?(w=i?.toLowerCase(),s[12]=i,s[13]=w):w=s[13];const N=w,A=N&&qt[N];let D;s[14]!==i?(D=Kt(i),s[14]=i,s[15]=D):D=s[15];const O=D;let C;s[16]!==a.slug?(C=t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections",params:{org:a.slug},children:"Connections"})})}),s[16]=a.slug,s[17]=C):C=s[17];let I;s[18]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(le,{}),s[18]=I):I=s[18];let R;s[19]!==i||s[20]!==m||s[21]!==a.slug||s[22]!==l.appSlug?(R=m&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{children:t.jsx(se,{asChild:!0,children:t.jsx(te,{to:"/$org/settings/connections/$appSlug",params:{org:a.slug,appSlug:l.appSlug},search:{tab:i},children:m.title})})}),t.jsx(le,{})]}),s[19]=i,s[20]=m,s[21]=a.slug,s[22]=l.appSlug,s[23]=R):R=s[23];let U;s[24]!==O?(U=t.jsx(Y,{children:t.jsx(Ue,{children:O})}),s[24]=O,s[25]=U):U=s[25];let F;s[26]!==R||s[27]!==U||s[28]!==C?(F=t.jsx(Le,{children:t.jsxs(Be,{children:[C,I,R,U]})}),s[26]=R,s[27]=U,s[28]=C,s[29]=F):F=s[29];const V=F;if(A){let _;return s[30]!==A||s[31]!==d||s[32]!==k||s[33]!==r?(_=t.jsx(A,{itemId:r,onBack:d,onUpdate:k}),s[30]=A,s[31]=d,s[32]=k,s[33]=r,s[34]=_):_=s[34],_}let v;s[35]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ot,{size:36,className:"text-muted-foreground"}),s[35]=v):v=s[35];let z;s[36]!==o?(z=o("orgs.collectionDetail.noComponentDefinedTitle"),s[36]=o,s[37]=z):z=s[37];let J;s[38]!==o?(J=o("orgs.collectionDetail.noComponentDefinedDescription"),s[38]=o,s[39]=J):J=s[39];let M;s[40]!==o?(M=o("orgs.collectionDetail.goBackButton"),s[40]=o,s[41]=M):M=s[41];let L;s[42]!==d||s[43]!==M?(L={onClick:d,children:M},s[42]=d,s[43]=M,s[44]=L):L=s[44];let q;s[45]!==z||s[46]!==J||s[47]!==L?(q=t.jsx(Jt,{icon:v,title:z,description:J,buttonProps:L}),s[45]=z,s[46]=J,s[47]=L,s[48]=q):q=s[48];let X;return s[49]!==V||s[50]!==q?(X=t.jsx(je,{breadcrumb:V,children:q}),s[49]=V,s[50]=q,s[51]=X):X=s[51],X}function Xt(){const s=P.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const n=he(e);if(decodeURIComponent(n.collectionName)==="tools"){let r;return s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Ht,{}),s[1]=r):r=s[1],r}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{}),s[2]=i):i=s[2],i}function Ul(){const s=P.c(7),e=Q();let n;s[0]!==e?(n=e("orgs.collectionDetail.loadingAriaLabel"),s[0]=e,s[1]=n):n=s[1];let l;s[2]!==n?(l=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(oe,{size:32,className:"animate-spin text-muted-foreground","aria-label":n})}),s[2]=n,s[3]=l):l=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Xt,{}),s[4]=o):o=s[4];let i;return s[5]!==l?(i=t.jsx(Ee,{children:t.jsx(E.Suspense,{fallback:l,children:o})}),s[5]=l,s[6]=i):i=s[6],i}export{Ul as default};
@@ -1,2 +0,0 @@
1
- import{c as se,b as Te,r as d,j as r,k as pe,B as Re,eY as en,bk as tn,bq as ge,eZ as nn,e_ as rn,e$ as on,f0 as sn,cv as an,f1 as ln,f2 as dt,bm as cn,f3 as dn,f4 as un,f5 as fn,f6 as pn,f7 as mn,f8 as xn,f9 as hn,fa as gn,fb as bn,n as le,p as yn,t as te,ab as tt,a8 as nt,a9 as rt,K as ot}from"./index-T6DmNp2G.js";import{d as vn,b9 as Cn,ba as wn}from"./agent-icon-Dmq8gvpL.js";import{s as Nn}from"./XClose-CY0G2wZ2.js";import{S as jn}from"./use-clock-tick-llo_i55R.js";import{a as En}from"./chat-context-CSLWuE9T.js";import{F as Sn}from"./monaco-editor-2T4Cd5Nl.js";import{u as Dn}from"./shell-layout-CzDL5OMt.js";import{i as Mn,E as Rn,a as Oe,b as Tn,f as Pn,g as kn,c as Fn,t as re,d as je,e as Ie,h as Ee,j as Ke,k as $e,l as An,s as Ln,v as On,m as ze,n as Se,o as st,p as In,q as De,r as _e,w as Kn,x as $n,y as zn,z as _n,A as Gn}from"./index-gw3w5L0d.js";import{b as Bn,h as Vn,a as Un,c as qn,d as Hn,e as Wn}from"./dialog-DKtG2q4B.js";import{I as at}from"./input-oGRrJ1WQ.js";import{c as Qn,d as Xn,b as Yn,f as Jn,g as Zn,e as er,a as tr,A as nr}from"./alert-dialog-DHfylh_L.js";import{t as rr}from"./ChevronDown-Dr8vCWZv.js";import{i as or}from"./ChevronRight-CvdpRaYe.js";import{i as sr}from"./Share07-BjvPJZVx.js";import"./AlertCircle-C_ue5dpm.js";import"./Tool01-DjC_P2pS.js";import"./ArrowUp-2ENJuKn1.js";import"./ArrowLeft-D_1i_-_K.js";import"./Tool02-p2g1RG2k.js";import"./XCircle-BPD_epMV.js";import"./TrendUp01-DnG2kf95.js";import"./ZapSquare-DwfBHtg5.js";import"./Users03-C2R3qA_D.js";import"./CheckCircle-i_syDqdQ.js";import"./Check-D3rP61VF.js";import"./ChevronSelectorVertical-Dv_pTodY.js";import"./ChevronUp-BzXRNWp_.js";import"./DotsVertical-hb3NfPIe.js";import"./Stars02-BI31D4OX.js";import"./UserSquare-DVQPfFoA.js";import"./Copy01-CFs5dLvg.js";import"./CreditCard01-B0k56rzq.js";import"./Download01-DxQvMChl.js";import"./Settings02-Bxo2JBIC.js";import"./Eye-mrurW8BJ.js";import"./FilterLines-jfYmDBkV.js";import"./Globe01-ChvjLPM2.js";import"./Globe04-GZK8hXZj.js";import"./SwitchHorizontal01-CgC73t0c.js";import"./HardDrive-bQRF3cZb.js";import"./Key01-D5LVGaJJ.js";import"./LinkExternal01-BcSO7_Tr.js";import"./LockUnlocked01-CY5J19s0.js";import"./LogOut01-DW9UNyyB.js";import"./Monitor01-B4Jy2ot3.js";import"./Sun-DsNQ6nv4.js";import"./Palette-C1Iyut6b.js";import"./Play-DzEIXwV3.js";import"./Plus-vGWd1KNe.js";import"./SearchLg-Cys207lC.js";import"./SearchMd-XqjOgOFN.js";import"./Shield01-DOAbMUeh.js";import"./Stars01-Bpn6m19l.js";import"./Trash01-C3-kPIxA.js";import"./Upload01-98bMMhx8.js";import"./User01-DRaAh8Fc.js";import"./Users01-Bayg2V9E.js";import"./Zap-BMa0uCBP.js";import"./select-C7mOn2qi.js";import"./tab-id-Crl7Lrhw.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-Ql-21rZI.js";import"./use-mcp-client-CDW5sZtI.js";import"./constants-z9Iog-sb.js";import"./auth-cBUP-u5Z.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B5-Oi7QM.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-CN9IG9dM.js";import"./use-ai-providers-CxBvAmu8.js";import"./use-decopilot-events-LtP-eSLP.js";import"./use-organization-settings-DYyCCrCY.js";import"./spinner-CZJvZw9q.js";import"./avatar-BaPskY-5.js";import"./required-auth-layout-CI-I7_n9.js";import"./use-org-sso-Bsjlvsw0.js";import"./automation-runs-CduAJwId.js";import"./useInfiniteQuery-B3KIBI9K.js";import"./use-infinite-scroll-DxpnNTDN.js";import"./use-connection-Be_N4k3-.js";import"./table-C0RPqLOv.js";import"./empty-state-35WpGuH2.js";import"./use-members-BG7a44vO.js";import"./use-org-auth-client-tDH7ZEw3.js";import"./use-automations-BPP6NFoz.js";import"./useSuspenseInfiniteQuery-DS72bgMq.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DB5BOq-H.js";import"./types-IPakUJfp.js";import"./integration-icon-Dws-vFYP.js";import"./use-navigate-to-agent-8vvrRa64.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-CHwJyIyC.js";import"./index-CmirivJl.js";import"./form-D6zBacj_.js";import"./label-TreJijRH.js";import"./file-type-icon-DIsDLikB.js";import"./drawer-C8FILhQy.js";import"./collection-search-Gw3AHYq2.js";import"./tabs-D17bVbFO.js";import"./toggle-group-B02MEILt.js";import"./use-commerce-diagnostic-CD2P0Cgl.js";import"./popover-BVSaKROt.js";import"./self-tool-result-BAMf28tz.js";import"./extract-connection-data-BnNbJQwk.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DDOHyvnN.js";import"./authenticate-and-persist-oauth-C-pvekCw.js";import"./mcp-oauth-Baiyn1cx.js";import"./track-DS7Oiirh.js";import"./toolbar-DywkE492.js";import"./github-repo-picker-Bid7nQHp.js";import"./use-mcp-tools-BBQ0wX2A.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-CWSZ91pp.js";import"./use-registry-connections-CAUwAi1r.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-CDV_NSfk.js";import"./connection-form-helpers-Bl-AQbWU.js";import"./collection-tabs-D94VP5DH.js";import"./badge-Cvu8IrGy.js";import"./command-DvjLTSyu.js";import"./index-CAJCIeWO.js";import"./select-model-CDy87sWK.js";import"./checkbox-DSH1E9rZ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DJbGuhSK.js";import"./dropdown-menu-B7bLBmU2.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BDEAnt5F.js";import"./use-file-configs-2Otf5vu6.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-0DqbtGT9.js";import"./search-input-DSM3Ad2f.js";import"./use-mcp-auth-status-Cc6w6BXA.js";import"./switch-DX0CchGd.js";import"./use-secrets-CYZAF1A3.js";import"./AreaChart-BW-CQ84u.js";import"./use-task-board-items-DF6WCEaC.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-FefTsanW.js";import"./task-key-BCHdFiOO.js";import"./automation-list-row-D0TtyuXL.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-CU706fVV.js";const ar={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function ir(a){const e=se.c(71),{open:s,mode:i,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=a,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ar[i];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let $;e[3]!==h||e[4]!==f||e[5]!==u?($=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=$):$=e[6];const L=$;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Bn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Vn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(Un,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(at,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let F;e[25]!==j?(F=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=F):F=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let z;e[28]!==C.placeholderKey||e[29]!==x?(z=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=z):z=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==z?(Y=r.jsx(at,{id:"file-explorer-name",value:f,onChange:q,placeholder:z,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=z,e[34]=Y):Y=e[34];let J;e[35]!==F||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[F,Y]}),e[35]=F,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{size:14,className:"animate-spin"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let k;e[59]!==H||e[60]!==G?(k=r.jsxs(qn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=k):k=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==k||e[65]!==N?(B=r.jsx(Hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,k]})}),e[62]=L,e[63]=ee,e[64]=k,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Wn,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(a){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:i,fsActionPending:l,onOpenChange:m,onConfirm:y}=a,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(Qn,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==i.length||e[13]!==u?(g=i.length>0&&r.jsxs(r.Fragment,{children:[" ",i.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:i.length})]}),e[12]=i.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(Xn,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let $;e[20]!==R||e[21]!==f?($=r.jsxs(Yn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=$):$=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(Jn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx(Zn,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(er,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==$||e[41]!==M?(j=r.jsxs(tr,{children:[$,M]}),e[40]=$,e[41]=M,e[42]=j):j=e[42];let F;return e[43]!==m||e[44]!==E||e[45]!==j?(F=r.jsx(nr,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=F):F=e[46],F}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=a=>{const{__scopeContextMenu:e,children:s,onOpenChange:i,dir:l,modal:m=!0}=a,[y,u]=d.useState(!1),b=Z(e),E=an(i),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,disabled:i=!1,...l}=a,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{i&&h()},[i,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":i?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...a.style},onContextMenu:i?a.onContextMenu:ge(a.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:i?a.onPointerDown:ge(a.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:i?a.onPointerMove:ge(a.onPointerMove,Me(h)),onPointerCancel:i?a.onPointerCancel:ge(a.onPointerCancel,Me(h)),onPointerUp:i?a.onPointerUp:ge(a.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=a=>{const{__scopeContextMenu:e,...s}=a,i=Z(e);return r.jsx(on,{...i,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...i,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{a.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{a.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.current=!0)},style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(dn,{...l,...i,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(un,{...l,...i,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(nn,{...l,...i,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(fn,{...l,...i,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(pn,{...l,...i,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(mn,{...l,...i,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(xn,{...l,...i,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(rn,{...l,...i,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(hn,{...l,...i,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(gn,{...l,...i,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((a,e)=>{const{__scopeContextMenu:s,...i}=a,l=Z(s);return r.jsx(bn,{...l,...i,ref:e,style:{...a.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pr.displayName=Tr;function Me(a){return e=>e.pointerType!=="mouse"?a(e):void 0}var kr=ft,Fr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(kr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=i):i=e[3],i}function $r(a){const e=se.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let i;return e[2]!==s?(i=r.jsx(Fr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=i):i=e[3],i}function zr(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...i})}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}function fe(a){const e=se.c(12);let s,i,l,m;e[0]!==a?({className:s,inset:i,variant:m,...l}=a,e[0]=a,e[1]=s,e[2]=i,e[3]=l,e[4]=m):(s=e[1],i=e[2],l=e[3],m=e[4]);const y=m===void 0?"default":m;let u;e[5]!==s?(u=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=u):u=e[6];let b;return e[7]!==i||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":i,"data-variant":y,className:u,...l}),e[7]=i,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function it(a){const e=se.c(8);let s,i;e[0]!==a?({className:s,...i}=a,e[0]=a,e[1]=s,e[2]=i):(s=e[1],i=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==i||e[6]!==l?(m=r.jsx(Ir,{"data-slot":"context-menu-separator",className:l,...i}),e[5]=i,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(a){const e=se.c(63),{node:s,depth:i,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=a,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:$,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${i*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==$||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):l?r.jsx(rr,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(or,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(sr,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx($,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=$,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let F;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(F=r.jsx($r,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=F):F=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let z;e[23]!==h||e[24]!==q?(z=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=z):z=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(it,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(it,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let k;e[45]!==X||e[46]!==G?(k=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=k):k=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==z||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==k||e[58]!==V?(Q=r.jsxs(zr,{className:"w-52",children:[z,J,ee,A,K,W,k,V]}),e[53]=z,e[54]=J,e[55]=A,e[56]=K,e[57]=k,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==F?(ne=r.jsxs(Kr,{children:[F,Q]}),e[60]=Q,e[61]=F,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(a,e){return Kn(a,e)}function qr(a){const e=se.c(9),{text:s,query:i}=a;let l,m,y;if(e[0]!==i||e[1]!==s){const{leadingEllipsis:b,segments:E}=An(s,i);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=i,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(a,e){return a.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:a.text},e):r.jsx("span",{children:a.text},e)}function Oa({orgSlug:a,virtualMcpId:e,branch:s,threadId:i,openPath:l}){const m={orgSlug:a,virtualMcpId:e,branch:s,threadId:i},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,$]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[F,q]=d.useState(!1),[z,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),k=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ae,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[ke,Fe]=d.useState(null),[ve,Ce]=d.useState(!1);async function ie(t,n){const o=await fetch(Ur(m,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=_n(t);if(!n)return;const o=`${a}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(a,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>je(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=je(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Et(t){const n=je(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ie("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of $e(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Ee(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ie("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ie("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),Fe(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=On(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,kt]=d.useState(null),w=Te();if(l&&l!==Pt){kt(l);const t=l;queueMicrotask(()=>{Mn(t)&&he(t)})}async function Ae(t){const n=await ie("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?Gn(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Ft(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!ze(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await Ft(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of $e(n)){if(!ze(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Rn});qe(n,!1,t),Y(!0)}catch{z&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ie("read",{path:re(t),full:!0}),c=Ln(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){k.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==k.current)return;T($n(o,t,ct))}catch{if(n!==k.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ie("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==k.current)return;D(zn(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==k.current)return;D([]),j(!1)}finally{n===k.current&&N(!1)}}function $t(t){const n=t.trim(),o=++k.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function zt(t){if($(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{$t(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ie("write",{path:re(t),content:n}),Se("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await In(m);Se("git status after save",o)}catch(o){Se("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){Se("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if(ze(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=$e(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Ee(X.path):f?Ee(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Tn(b,E),Je=Pn(Qt,h),Le=L?.length??0,Ze=kn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=ke?jt(ke.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(t){if(!ae)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ae.filePath}\``,`**Lines:** ${ae.lineStart}–${ae.lineEnd}`];if(ae.selectedCode){const o=Ke(ae.filePath),c=ae.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),Ct("chat"),vt({parts:[{type:"text",text:n.join(`
2
- `)}]}),be(null)}return F&&!z?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:R,onChange:t=>zt(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Ye("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Ye("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!R&&Je.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=h.has(n.path),v=X?.path===n.path,ce=Fn(n.path,n.kind),Ne=c&&ee.has(n.path);return r.jsx(Gr,{node:n,depth:o,isExpanded:p,isSelected:v,isLoading:Ne,fileVisual:Ie(n.name),onSelect:()=>I(n),onOpen:()=>{c?qt(n.path,p):he(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>Be(w,"Path",je(n.path)),onCopyRelativePath:()=>Be(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Fe(n)},n.path)}),!R&&z&&Je.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),R&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Le>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Le,Le>=ct?"+":""]})]}),L!==null&&L.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),L?.map(t=>{const n=t.split("/").pop()??t,o=Ee(t),{Icon:c,color:p}=Ie(n),v=f===t;return r.jsxs("button",{type:"button",onClick:()=>he(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",v&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),R&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),et>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[et,M?"+":""]}),S&&r.jsx(pe,{size:10,className:"animate-spin"})]}),!S&&P!==null&&Ze.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ze.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Ie(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>_t(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(qr,{text:p.text,query:R})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[C.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:C.map(t=>{const n=me.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=f===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{O(t),We(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),Vt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ae&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Zt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&be(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:f&&ue?.loaded?r.jsx(Sn,{language:Ke(f),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ue.editorValue,path:f,onChange:t=>{const n=f;n&&de(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Jt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{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}}},f):f&&!ue?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),f&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:f}),r.jsxs("span",{children:[w(Xt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Ke(f)]})]})]}),r.jsx(ir,{open:U!==null,mode:U?.mode??"new-file",initialName:U?.mode==="rename"?U.node.name:"",parentLabel:U&&U.mode!=="rename"?U.parentDir==="/"?"/":re(U.parentDir):void 0,isPending:ve,onSubmit:t=>Tt(w,t),onOpenChange:t=>{!t&&!ve&&oe(null)}}),r.jsx(lr,{deleteTarget:ke,deleteDirtyPaths:Yt,fsActionPending:ve,onOpenChange:t=>{!t&&!ve&&Fe(null)},onConfirm:t=>{Rt(w,t)}})]})}export{Oa as FileExplorer};