@openhands/agent-canvas 1.19.0 → 1.20.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 (326) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BQ4o4vqy.js → acp-providers-DOKcGeaV.js} +1 -1
  4. package/build/assets/active-backend-context-BETEdaJl.js +2 -0
  5. package/build/assets/{agent-context-settings-D9i6ezoJ.js → agent-context-settings-Dir0loAn.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-U-9YzDFU.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-D-bUV2PX.js → agent-profiles-settings-CT5owzRT.js} +1 -1
  8. package/build/assets/{agent-server-conversation-service.api-BaVQ6NpE.js → agent-server-conversation-service.api-BtOlitCD.js} +3 -3
  9. package/build/assets/agent-settings-BnzyTgCb.js +2 -0
  10. package/build/assets/agent-settings-CeXj3xK-.js +1 -0
  11. package/build/assets/{alert-banner-BkVt_8Or.js → alert-banner-Ccx1Du6n.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-fAIld-n7.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
  13. package/build/assets/{app-settings-DITbrM2u.js → app-settings-DkIJVTKL.js} +1 -1
  14. package/build/assets/{automation-detail-DawHmaOl.js → automation-detail-CF2SweVs.js} +1 -1
  15. package/build/assets/{automation-disabled-reason-DtgC8Ppt.js → automation-disabled-reason-QFtMrdOr.js} +1 -1
  16. package/build/assets/{automation-export-Kv6e0bHx.js → automation-export-CkvehhPF.js} +1 -1
  17. package/build/assets/{automation-git-sync-Dd98G_Oz.js → automation-git-sync-di4tBAyZ.js} +1 -1
  18. package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
  19. package/build/assets/{automation-templates-Xhr-FDAB.js → automation-templates-DlaCRvD-.js} +1 -1
  20. package/build/assets/{automations-list-BeP1LuzQ.js → automations-list-yK7ETmYP.js} +1 -1
  21. package/build/assets/{back-nav-button-DWNiN277.js → back-nav-button-oDvIxpQ5.js} +1 -1
  22. package/build/assets/{backend-form-modal-DeaUJIik.js → backend-form-modal-DzYf_arO.js} +1 -1
  23. package/build/assets/{backend-synced-settings-badge-Br85iWIY.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
  24. package/build/assets/{badge-Cdnei7Ly.js → badge-CDHZEVeN.js} +1 -1
  25. package/build/assets/{base-modal-Ds7grR67.js → base-modal-CZq4kB_H.js} +1 -1
  26. package/build/assets/{brand-button-mQq2Ld1I.js → brand-button-CGUwj6zK.js} +1 -1
  27. package/build/assets/{browser-Bfum8fkE.js → browser-kY6jN61T.js} +1 -1
  28. package/build/assets/{browser-tab-CmYT4j_r.js → browser-tab-DFyZXsnB.js} +1 -1
  29. package/build/assets/{canvas-extension-page-CokKSVRG.js → canvas-extension-page-DsGq1DtT.js} +1 -1
  30. package/build/assets/{canvas-extensions-BoQEYG-2.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-Du2M5iEX.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
  32. package/build/assets/{chat-send-button-DM3JgMc2.js → chat-send-button-B6aVaD9V.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BbYBiUwv.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D02kgq1s.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
  35. package/build/assets/{cog-Dy1eWbSZ.js → cog-DVZT1f0s.js} +1 -1
  36. package/build/assets/{command-menu-mehU3Evb.js → command-menu-ImeHQ6c2.js} +1 -1
  37. package/build/assets/{commits-tab-DhQW8CXi.js → commits-tab-B5SUF66c.js} +1 -1
  38. package/build/assets/{condenser-settings-eRk6Fkx6.js → condenser-settings-BlGOXEXM.js} +1 -1
  39. package/build/assets/{confirmation-modal-BmVt_c0I.js → confirmation-modal-oN1EId79.js} +1 -1
  40. package/build/assets/{context-menu-list-item-lx2zk9G7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
  41. package/build/assets/{conversation-BOj0ENI6.js → conversation-9a53tdbO.js} +3 -3
  42. package/build/assets/conversation-XRsI28ZM.js +1 -0
  43. package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
  44. package/build/assets/{conversation-state-store-C6YncQNo.js → conversation-state-store-Br-eE-gg.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-DIhwCC2J.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-DVNXLylP.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
  47. package/build/assets/{device-verify-LP-x7nra.js → device-verify-DX0xdNjo.js} +1 -1
  48. package/build/assets/{dropdown-classes-goDldkiu.js → dropdown-classes-DyyMaaXl.js} +1 -1
  49. package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
  50. package/build/assets/{empty-state-Cd-TFe7i.js → empty-state-B5advKVW.js} +1 -1
  51. package/build/assets/{entry.client-CJdjIvMZ.js → entry.client-D_2gnSyB.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-pocrz9AL.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-Dwe78wRl.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
  54. package/build/assets/{error-state-SuWwztxV.js → error-state-BgYl7YeB.js} +1 -1
  55. package/build/assets/{extensions-hub-O0esK3Er.js → extensions-hub-DjhOed1I.js} +1 -1
  56. package/build/assets/{extensions-navigation-CgCVSXje.js → extensions-navigation-Di-J2KUR.js} +1 -1
  57. package/build/assets/{files-tab-B_6t8ljw.js → files-tab-BNDp3e_x.js} +1 -1
  58. package/build/assets/{form-control-classes-lQfLxzH4.js → form-control-classes-BVI_szaj.js} +1 -1
  59. package/build/assets/{get-git-path-Bp5rsUkl.js → get-git-path-DOe6PM_a.js} +1 -1
  60. package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
  61. package/build/assets/{git-repo-dropdown-DPQVumZg.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
  62. package/build/assets/{highlighted-source-view-Bp0sgK-f.js → highlighted-source-view-DPerL6tF.js} +1 -1
  63. package/build/assets/home-4lyLzYjG.js +1 -0
  64. package/build/assets/{home-BghzJd-D.js → home-BGaB0EeK.js} +1 -1
  65. package/build/assets/{home-automation-run-tooltip-BdpCckKO.js → home-automation-run-tooltip-v5n7zXR0.js} +1 -1
  66. package/build/assets/{home-store-DNQpfIEO.js → home-store-roz1x6D5.js} +1 -1
  67. package/build/assets/{hooks-service-DkxnQa4N.js → hooks-service-tzRqtAlm.js} +1 -1
  68. package/build/assets/index-home-6Y_Y7kOo.js +1 -0
  69. package/build/assets/{install-server-modal-DvxxYKia.js → install-server-modal-DkMCfj0J.js} +1 -1
  70. package/build/assets/{key-CwTE6XJj.js → key-DpfBWQbk.js} +1 -1
  71. package/build/assets/{launch-jsRGPRBx.js → launch-TrnYlJe6.js} +1 -1
  72. package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
  73. package/build/assets/{llm-settings-dkQ5Oq7W.js → llm-settings-CUgt39uu.js} +1 -1
  74. package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
  75. package/build/assets/{llm-subscription-service-BiQaZbvv.js → llm-subscription-service-LGYVzyAc.js} +1 -1
  76. package/build/assets/{loading-spinner-DK1sAwVg.js → loading-spinner-BJc2J0Dw.js} +1 -1
  77. package/build/assets/{manage-backends-modal-DqCJohsX.js → manage-backends-modal-CIjk0B2H.js} +1 -1
  78. package/build/assets/manifest-23d79467.js +1 -0
  79. package/build/assets/{manifest-subpage-layout-sxuPqfUr.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
  80. package/build/assets/{markdown-renderer-BH5pqDuJ.js → markdown-renderer-DRpwRlNm.js} +1 -1
  81. package/build/assets/{mcp-BtaJDXnP.js → mcp-CoUOIGBF.js} +1 -1
  82. package/build/assets/{mcp-installed-servers-Br4ZLsjr.js → mcp-installed-servers-BW51n6PC.js} +1 -1
  83. package/build/assets/{mcp-page-DwbnQpVs.js → mcp-page-hZ4aJjj_.js} +1 -1
  84. package/build/assets/{messages-DmFJlW6c.js → messages-WUb9Yh-p.js} +1 -1
  85. package/build/assets/{modal-body-DBweM2EN.js → modal-body-B_95ci1c.js} +1 -1
  86. package/build/assets/{modal-classes-jvG85nkU.js → modal-classes-BPcBCWVj.js} +1 -1
  87. package/build/assets/{modal-close-button-BrM5fNnn.js → modal-close-button-Cq3dma5u.js} +1 -1
  88. package/build/assets/{onboarding-CQ8T6T0U.js → onboarding-Cc4Av7bi.js} +1 -1
  89. package/build/assets/{onboarding-modal-CnliiaSN.js → onboarding-modal-DCFD4Dsa.js} +1 -1
  90. package/build/assets/{organization-service.api-DmFUEmu5.js → organization-service.api-zhHpQU0t.js} +1 -1
  91. package/build/assets/{planner-tab-CXph_C9F.js → planner-tab-yISBVUKu.js} +1 -1
  92. package/build/assets/{plugins-management-service-CcEpfNKz.js → plugins-management-service-2oP6_tWr.js} +1 -1
  93. package/build/assets/{profiles-service.api-DdF_4Zhe.js → profiles-service.api-B5thiTI3.js} +1 -1
  94. package/build/assets/{providers-BWRnl31s.js → providers-Co9PsD0s.js} +1 -1
  95. package/build/assets/{proxy-DbEf3Nqr.js → proxy-BCCQUna8.js} +1 -1
  96. package/build/assets/{recommended-automations-launcher-r0oI91HN.js → recommended-automations-launcher-D1Do753p.js} +1 -1
  97. package/build/assets/{root-j2fFRlWS.js → root-D1y82Lhg.js} +2 -2
  98. package/build/assets/{root-layout-CfGgm2lo.js → root-layout-cQTYEG2w.js} +2 -2
  99. package/build/assets/{schema-field-c3Ncgm4x.js → schema-field-DSi0d7a8.js} +1 -1
  100. package/build/assets/{sdk-section-page-DFEiuiFQ.js → sdk-section-page-DCoI2dtd.js} +1 -1
  101. package/build/assets/{secret-form-WXXNFqTM.js → secret-form-BDvzojzN.js} +1 -1
  102. package/build/assets/{secrets-service-DU6wh3wX.js → secrets-service-C3CNNEpY.js} +1 -1
  103. package/build/assets/{secrets-settings-BEqbPvjy.js → secrets-settings-BKqfYQt5.js} +1 -1
  104. package/build/assets/{settings-DjaSQwFh.js → settings-C8ZLONyx.js} +1 -1
  105. package/build/assets/{settings-dropdown-input-BRR2OZwi.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
  106. package/build/assets/{settings-index-DHv4XFcM.js → settings-index-BWvlGHg3.js} +1 -1
  107. package/build/assets/{settings-input-Cm4VxUon.js → settings-input-B3i5U9GL.js} +1 -1
  108. package/build/assets/{settings-list-classes-CaUfKZ33.js → settings-list-classes-DbqcSiVW.js} +1 -1
  109. package/build/assets/{settings-modal-djXuAnBO.js → settings-modal-DHKJSBPL.js} +1 -1
  110. package/build/assets/{settings-nav-DFb3hBMr.js → settings-nav-BThjwLWD.js} +1 -1
  111. package/build/assets/{settings-service.api-Q9lKW1TX.js → settings-service.api-CYBTLGOd.js} +1 -1
  112. package/build/assets/{settings-switch-seaSJc7t.js → settings-switch-CI93Iozg.js} +1 -1
  113. package/build/assets/{shared-conversation-x3rxVCon.js → shared-conversation-C7OILS-U.js} +1 -1
  114. package/build/assets/{sidebar-layout-B6mcvvdV.js → sidebar-layout-Csb6Geq0.js} +1 -1
  115. package/build/assets/{sidebar-mobile-menu-toggle-CEqS8KnA.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
  116. package/build/assets/{sidebar-nav-link-BTHX11LG.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
  117. package/build/assets/{sidebar-onboarding-checklist-storage-BP1kzn6p.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
  118. package/build/assets/{skill-card-pill-row-TD39nfP3.js → skill-card-pill-row-CxOFySng.js} +1 -1
  119. package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
  120. package/build/assets/{skill-filter-CdBbbwjm.js → skill-filter-BvtbD--b.js} +1 -1
  121. package/build/assets/{skill-icon-badge-vUEp7gsC.js → skill-icon-badge-CVxE42yg.js} +1 -1
  122. package/build/assets/{skill-scope-BTRBQt0-.js → skill-scope-C0NxJnpT.js} +1 -1
  123. package/build/assets/{skills-plugins-k1tUNAw4.js → skills-plugins-BGjX4jve.js} +1 -1
  124. package/build/assets/{skills-settings-CENviPT7.js → skills-settings-d3ZwIjSP.js} +1 -1
  125. package/build/assets/{styled-tooltip-DVAlWYnL.js → styled-tooltip-CknPQH4Y.js} +1 -1
  126. package/build/assets/{task-list-tab-BLKF_x9f.js → task-list-tab-CQisRcPh.js} +1 -1
  127. package/build/assets/{terminal-Ckbnqb23.js → terminal-Bs50gJPC.js} +1 -1
  128. package/build/assets/{toggle-switch-DeiG9Mf6.js → toggle-switch-D3TBxlsc.js} +1 -1
  129. package/build/assets/{trash-CXN2R54L.js → trash-D1QMHInX.js} +1 -1
  130. package/build/assets/{typography-NarNyelM.js → typography-BdAApXGl.js} +1 -1
  131. package/build/assets/{usage-tab-Drd3O006.js → usage-tab-ClVHAFJy.js} +1 -1
  132. package/build/assets/{use-acp-credential-form-CJ5wPsQm.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
  133. package/build/assets/{use-activate-agent-profile-iQZ0U3qV.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
  134. package/build/assets/{use-agent-profiles-LCvb5OXT.js → use-agent-profiles-YsBlt3tT.js} +1 -1
  135. package/build/assets/{use-automation-health-DdgSa8sA.js → use-automation-health-CbQ9n-k7.js} +1 -1
  136. package/build/assets/{use-automation-permissions-D3kEeieu.js → use-automation-permissions-gFy-2VD0.js} +1 -1
  137. package/build/assets/{use-automations-CEubcYTD.js → use-automations-7_XBXHQK.js} +1 -1
  138. package/build/assets/{use-can-manage-org-profiles-CB8ybxFK.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
  139. package/build/assets/{use-canvas-extensions-BMacwi2v.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
  140. package/build/assets/{use-cloud-current-user-id-BEKRd6XZ.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
  141. package/build/assets/{use-config-3WYcJsgC.js → use-config-BJ_FJCjV.js} +1 -1
  142. package/build/assets/use-create-conversation-D15Px574.js +1 -0
  143. package/build/assets/use-create-secret-D_qPU88t.js +1 -0
  144. package/build/assets/{use-free-models-Ci3FkKEm.js → use-free-models-FAk2nngq.js} +1 -1
  145. package/build/assets/{use-get-secrets-fqS0kxt6.js → use-get-secrets-Pbo9jh2A.js} +1 -1
  146. package/build/assets/{use-llm-configured-B71ZEVg2.js → use-llm-configured-DF9BYmIe.js} +1 -1
  147. package/build/assets/{use-llm-profiles-xtCBMbef.js → use-llm-profiles-U4u1gzuk.js} +1 -1
  148. package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
  149. package/build/assets/{use-onboarding-completion-CEgjL02y.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
  150. package/build/assets/{use-pinned-home-route-pK4IlJ-p.js → use-pinned-home-route-DByWTojw.js} +1 -1
  151. package/build/assets/{use-plugins-marketplace-B8-ZEB34.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
  152. package/build/assets/{use-save-agent-profile-D7hJuW_u.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
  153. package/build/assets/{use-save-settings-CikTu5xV.js → use-save-settings-CmX41wlf.js} +1 -1
  154. package/build/assets/{use-settings-BWIH5EuN.js → use-settings-D69cw06D.js} +1 -1
  155. package/build/assets/{use-settings-nav-items-DSKwLDnd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
  156. package/build/assets/use-tracking-BAFpgpgq.js +3 -0
  157. package/build/assets/{use-user-conversation-C_l65DqW.js → use-user-conversation-BBDXUbOc.js} +1 -1
  158. package/build/assets/utils-CbjwNcR-.js +1 -0
  159. package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
  160. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
  161. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
  162. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js} +1 -1
  163. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
  164. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
  165. package/build/assets/{verification-settings-PKtoIUUY.js → verification-settings-BXspn27q.js} +1 -1
  166. package/build/index.html +4 -4
  167. package/build/locales/ar/openhands.json +8 -1
  168. package/build/locales/ca/openhands.json +8 -1
  169. package/build/locales/de/openhands.json +8 -1
  170. package/build/locales/en/openhands.json +8 -1
  171. package/build/locales/es/openhands.json +8 -1
  172. package/build/locales/fr/openhands.json +8 -1
  173. package/build/locales/it/openhands.json +8 -1
  174. package/build/locales/ja/openhands.json +8 -1
  175. package/build/locales/ko-KR/openhands.json +8 -1
  176. package/build/locales/no/openhands.json +8 -1
  177. package/build/locales/pt/openhands.json +8 -1
  178. package/build/locales/tr/openhands.json +8 -1
  179. package/build/locales/uk/openhands.json +8 -1
  180. package/build/locales/zh-CN/openhands.json +8 -1
  181. package/build/locales/zh-TW/openhands.json +8 -1
  182. package/config/defaults.json +3 -3
  183. package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
  184. package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
  185. package/dist/config/defaults.cjs +1 -1
  186. package/dist/config/defaults.cjs.map +1 -1
  187. package/dist/config/defaults.js +3 -3
  188. package/dist/config/defaults.js.map +1 -1
  189. package/dist/constants/profile-scope.d.ts +2 -2
  190. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  191. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  192. package/dist/hooks/mutation/use-create-conversation.js +30 -19
  193. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  194. package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
  195. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
  196. package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
  197. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
  198. package/dist/hooks/query/query-keys.cjs +1 -1
  199. package/dist/hooks/query/query-keys.cjs.map +1 -1
  200. package/dist/hooks/query/query-keys.d.ts +1 -0
  201. package/dist/hooks/query/query-keys.js +10 -1
  202. package/dist/hooks/query/query-keys.js.map +1 -1
  203. package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
  204. package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
  205. package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
  206. package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
  207. package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
  208. package/dist/i18n/declaration.cjs +1 -1
  209. package/dist/i18n/declaration.cjs.map +1 -1
  210. package/dist/i18n/declaration.d.ts +8 -1
  211. package/dist/i18n/declaration.js +1 -1
  212. package/dist/i18n/declaration.js.map +1 -1
  213. package/dist/i18n/translation.cjs +2 -2
  214. package/dist/i18n/translation.cjs.map +1 -1
  215. package/dist/i18n/translation.js +119 -0
  216. package/dist/i18n/translation.js.map +1 -1
  217. package/dist/locales/ar/openhands.json +8 -1
  218. package/dist/locales/ca/openhands.json +8 -1
  219. package/dist/locales/de/openhands.json +8 -1
  220. package/dist/locales/en/openhands.json +8 -1
  221. package/dist/locales/es/openhands.json +8 -1
  222. package/dist/locales/fr/openhands.json +8 -1
  223. package/dist/locales/it/openhands.json +8 -1
  224. package/dist/locales/ja/openhands.json +8 -1
  225. package/dist/locales/ko-KR/openhands.json +8 -1
  226. package/dist/locales/no/openhands.json +8 -1
  227. package/dist/locales/pt/openhands.json +8 -1
  228. package/dist/locales/tr/openhands.json +8 -1
  229. package/dist/locales/uk/openhands.json +8 -1
  230. package/dist/locales/zh-CN/openhands.json +8 -1
  231. package/dist/locales/zh-TW/openhands.json +8 -1
  232. package/dist/manifests/automation-setup.cjs.map +1 -1
  233. package/dist/manifests/automation-setup.js.map +1 -1
  234. package/dist/manifests/manifest-local-validation.cjs.map +1 -1
  235. package/dist/manifests/manifest-local-validation.js.map +1 -1
  236. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
  237. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  238. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
  239. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  240. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  241. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  242. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
  243. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  244. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
  245. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
  246. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
  247. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
  248. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
  249. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  250. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
  251. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  252. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
  253. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
  254. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
  255. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
  256. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
  257. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  258. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
  259. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  260. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
  261. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
  262. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
  263. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
  264. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  265. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  266. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
  267. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  268. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
  269. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
  270. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
  271. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
  272. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  273. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  274. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
  275. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  276. package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
  277. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  278. package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
  279. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  280. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  281. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  282. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
  283. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  284. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  285. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  286. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
  287. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  288. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  289. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +0 -1
  290. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
  291. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
  292. package/dist/package.cjs +1 -1
  293. package/dist/package.cjs.map +1 -1
  294. package/dist/package.js +3 -3
  295. package/dist/package.js.map +1 -1
  296. package/dist/routes/agent-settings.d.ts +6 -0
  297. package/dist/types/automation.cjs.map +1 -1
  298. package/dist/types/automation.d.ts +3 -1
  299. package/dist/types/automation.js.map +1 -1
  300. package/package.json +3 -3
  301. package/scripts/check-sdk-version-sync.mjs +6 -6
  302. package/scripts/dev-safe.mjs +14 -1
  303. package/scripts/docker-build.mjs +3 -0
  304. package/build/assets/active-backend-context-BsLfwrXB.js +0 -2
  305. package/build/assets/agent-settings-BZJHtaIK.js +0 -2
  306. package/build/assets/agent-settings-D4snDd6u.js +0 -1
  307. package/build/assets/automation-setup-route-Cdc109ZD.js +0 -3
  308. package/build/assets/conversation-SouWlGvs.js +0 -1
  309. package/build/assets/conversation-panel-SouWlGvs.js +0 -1
  310. package/build/assets/edit-automation-modal-BJJR9wSW.js +0 -1
  311. package/build/assets/git-repo-dropdown-CbD0_LPN.js +0 -1
  312. package/build/assets/home-CXZ8zawS.js +0 -1
  313. package/build/assets/index-home-Ca6Q5CtT.js +0 -1
  314. package/build/assets/llm-not-configured-banner-DMdL1vaX.js +0 -27
  315. package/build/assets/llm-settings-lNDerSlu.js +0 -1
  316. package/build/assets/manifest-ff93dc8c.js +0 -1
  317. package/build/assets/use-create-conversation-Be-eVpFp.js +0 -1
  318. package/build/assets/use-create-secret-Bk9ZxTjl.js +0 -1
  319. package/build/assets/use-manifest-capabilities-Bso6A_-A.js +0 -1
  320. package/build/assets/use-tracking-ChnSFChv.js +0 -3
  321. package/build/assets/utils-D-gOfhmN.js +0 -1
  322. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +0 -2
  323. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
  324. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
  325. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -18
  326. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as n}from"./sdk-section-page-DFEiuiFQ.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`condenser`]}],testId:`condenser-settings-screen`})}var a=t(i);export{a as default};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as n}from"./sdk-section-page-DCoI2dtd.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`condenser`]}],testId:`condenser-settings-screen`})}var a=t(i);export{a as default};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{K as n}from"./utils-D-gOfhmN.js";import{t as r}from"./modal-backdrop-BSzNhM4r.js";import{t as i}from"./brand-button-mQq2Ld1I.js";var a=e();function o({text:e,onConfirm:o,onCancel:s,confirmText:c,isConfirming:l=!1}){let{t:u}=t(`openhands`);return(0,a.jsx)(r,{onClose:l?void 0:s,closeOnEscape:!l,children:(0,a.jsxs)(`div`,{"data-testid":`confirmation-modal`,className:`bg-base-secondary p-4 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,children:[(0,a.jsx)(`p`,{children:e}),(0,a.jsxs)(`div`,{className:`w-full flex justify-end gap-2`,children:[(0,a.jsx)(i,{testId:`cancel-button`,type:`button`,onClick:s,variant:`secondary`,isDisabled:l,children:u(n.BUTTON$CANCEL)}),(0,a.jsx)(i,{testId:`confirm-button`,type:`button`,onClick:o,variant:`primary`,isDisabled:l,children:c??u(n.BUTTON$CONFIRM)})]})]})})}export{o as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{K as n}from"./utils-CbjwNcR-.js";import{t as r}from"./modal-backdrop-BSzNhM4r.js";import{t as i}from"./brand-button-CGUwj6zK.js";var a=e();function o({text:e,onConfirm:o,onCancel:s,confirmText:c,isConfirming:l=!1}){let{t:u}=t(`openhands`);return(0,a.jsx)(r,{onClose:l?void 0:s,closeOnEscape:!l,children:(0,a.jsxs)(`div`,{"data-testid":`confirmation-modal`,className:`bg-base-secondary p-4 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,children:[(0,a.jsx)(`p`,{children:e}),(0,a.jsxs)(`div`,{className:`w-full flex justify-end gap-2`,children:[(0,a.jsx)(i,{testId:`cancel-button`,type:`button`,onClick:s,variant:`secondary`,isDisabled:l,children:u(n.BUTTON$CANCEL)}),(0,a.jsx)(i,{testId:`confirm-button`,type:`button`,onClick:o,variant:`primary`,isDisabled:l,children:c??u(n.BUTTON$CONFIRM)})]})]})})}export{o as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./utils-D-gOfhmN.js";import{a as i,s as a}from"./dropdown-classes-goDldkiu.js";import{t as o}from"./dist-Bl64nBZL.js";var s=n(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);e();var c=t(),l=o(`z-50 overflow-hidden text-[var(--oh-foreground)]`,{variants:{theme:{default:`absolute rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,naked:`relative`,popover:`relative rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`},size:{compact:`py-1 px-1`,default:``},layout:{vertical:r(`flex flex-col`,i)},position:{top:`bottom-full`,bottom:`top-full`,none:``},spacing:{default:`mt-2`,none:``},alignment:{left:`left-0`,right:`right-0`,none:``}},compoundVariants:[{theme:`naked`,className:`shadow-none`}],defaultVariants:{theme:`default`,size:`default`,layout:`vertical`,spacing:`default`}});function u({testId:e,children:t,className:n,style:i,onKeyDown:a,ref:o,theme:s,size:u,layout:d,position:f,spacing:p,alignment:m}){return(0,c.jsx)(`ul`,{"data-testid":e,"data-position":f,ref:o,style:i,onKeyDown:a,className:r(l({theme:s,size:u,layout:d,position:f,spacing:p,alignment:m}),n),children:t})}function d({children:e,testId:t,onClick:n,isDisabled:i,className:o,ref:s}){return(0,c.jsx)(`button`,{ref:s,"data-testid":t||`context-menu-list-item`,type:`button`,onClick:n,disabled:i,className:r(a,`text-nowrap`,o),children:e})}export{u as n,s as r,d as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./utils-CbjwNcR-.js";import{a as i,s as a}from"./dropdown-classes-DyyMaaXl.js";import{t as o}from"./dist-Bl64nBZL.js";var s=n(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);e();var c=t(),l=o(`z-50 overflow-hidden text-[var(--oh-foreground)]`,{variants:{theme:{default:`absolute rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,naked:`relative`,popover:`relative rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`},size:{compact:`py-1 px-1`,default:``},layout:{vertical:r(`flex flex-col`,i)},position:{top:`bottom-full`,bottom:`top-full`,none:``},spacing:{default:`mt-2`,none:``},alignment:{left:`left-0`,right:`right-0`,none:``}},compoundVariants:[{theme:`naked`,className:`shadow-none`}],defaultVariants:{theme:`default`,size:`default`,layout:`vertical`,spacing:`default`}});function u({testId:e,children:t,className:n,style:i,onKeyDown:a,ref:o,theme:s,size:u,layout:d,position:f,spacing:p,alignment:m}){return(0,c.jsx)(`ul`,{"data-testid":e,"data-position":f,ref:o,style:i,onKeyDown:a,className:r(l({theme:s,size:u,layout:d,position:f,spacing:p,alignment:m}),n),children:t})}function d({children:e,testId:t,onClick:n,isDisabled:i,className:o,ref:s}){return(0,c.jsx)(`button`,{ref:s,"data-testid":t||`context-menu-list-item`,type:`button`,onClick:n,disabled:i,className:r(a,`text-nowrap`,o),children:e})}export{u as n,s as r,d as t};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-B_6t8ljw.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Ck5D_A2Q.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js","assets/useQuery-DAAacS7O.js","assets/messages-DmFJlW6c.js","assets/active-backend-context-BsLfwrXB.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/utils-D-gOfhmN.js","assets/vendor-markdown-j0kYzV48.js","assets/useMutation-Cszf8mKy.js","assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js","assets/useTranslation-CCgUjPJF.js","assets/markdown-renderer-BH5pqDuJ.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js","assets/iconBase-C2sR-uAp.js","assets/agent-server-conversation-service.api-BaVQ6NpE.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js","assets/proxy-DbEf3Nqr.js","assets/profiles-service.api-DdF_4Zhe.js","assets/settings-service.api-Q9lKW1TX.js","assets/settings-CKqk8ZnH.js","assets/llm-subscription-service-BiQaZbvv.js","assets/llm-subscription-DTqtBCWz.js","assets/acp-providers-BQ4o4vqy.js","assets/skill-enablement-DXeaImBz.js","assets/conversation-store-DC-JlJuq.js","assets/react-BX7IV650.js","assets/conversation-state-store-C6YncQNo.js","assets/syntax-highlighter-BGDg_7w9.js","assets/copy-to-clipboard-button-DVNXLylP.js","assets/checkmark-XZyokq_Y.js","assets/copy-Drmhc2jD.js","assets/navigation-context-CQZwH_tC.js","assets/use-settings-BWIH5EuN.js","assets/use-user-conversation-C_l65DqW.js","assets/scroll-fade-state-Dt_fx2kf.js","assets/chevron-down-Cr6Fn_wS.js","assets/chevron-right-CfdfRn-8.js","assets/loader-circle-BxJgk73D.js","assets/vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js","assets/use-free-models-Ci3FkKEm.js","assets/use-config-3WYcJsgC.js","assets/styled-tooltip-DVAlWYnL.js","assets/modal-backdrop-BSzNhM4r.js","assets/modal-close-button-BrM5fNnn.js","assets/get-git-path-Bp5rsUkl.js","assets/close-ScPlnwyq.js","assets/skills-B0IliMxw.js","assets/u-check-circle-BKn1spCL.js","assets/typography-NarNyelM.js","assets/dist-Bl64nBZL.js","assets/form-control-classes-lQfLxzH4.js","assets/format-model-name-Dfh9Udrx.js","assets/cloud-funnel-analytics-D02kgq1s.js","assets/mouse-pointer-click-BXlRN92t.js","assets/use-llm-configured-B71ZEVg2.js","assets/agent-profiles-service.api-U-9YzDFU.js","assets/use-tracking-ChnSFChv.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js","assets/bot-ByolqPEr.js","assets/use-agent-profiles-LCvb5OXT.js","assets/use-llm-profiles-xtCBMbef.js","assets/settings-utils-BTaaRhLZ.js","assets/map-provider-iRs80q_6.js","assets/conversation-tab-empty-state-DIhwCC2J.js","assets/highlighted-source-view-Bp0sgK-f.js","assets/folder-C1ou4_DT.js","assets/link-external-B4gx3EeM.js","assets/commits-tab-DhQW8CXi.js","assets/vendor~commits-tab-BaO2Ce3e.js","assets/vendor~conversation-panel~conversation-C22sJuWZ.js","assets/vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js","assets/llm-not-configured-banner-DMdL1vaX.js","assets/vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js","assets/useInfiniteQuery-CtSRG7uW.js","assets/recommended-automations-launcher-r0oI91HN.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js","assets/secrets-service-DU6wh3wX.js","assets/install-server-modal-DvxxYKia.js","assets/brand-button-mQq2Ld1I.js","assets/settings-input-Cm4VxUon.js","assets/mcp-marketplace-utils-BwEnDYqm.js","assets/modal-classes-jvG85nkU.js","assets/skill-card-pill-row-TD39nfP3.js","assets/extension-module-card-classes-DpeaYhYo.js","assets/circle-plus-check-toggle-BbYBiUwv.js","assets/x-mark-BopmFoBq.js","assets/use-create-conversation-Be-eVpFp.js","assets/plugins-management-service-CcEpfNKz.js","assets/use-create-secret-Bk9ZxTjl.js","assets/use-automations-CEubcYTD.js","assets/automation-C_eCrGyP.js","assets/mcp-installed-servers-Br4ZLsjr.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js","assets/chat-send-button-DM3JgMc2.js","assets/check-Bo8s5Ylg.js","assets/circle-check-5pH3qCji.js","assets/plus-C2e21TFC.js","assets/refresh-cw-BtdC3T8P.js","assets/context-menu-list-item-lx2zk9G7.js","assets/dropdown-classes-goDldkiu.js","assets/home-store-DNQpfIEO.js","assets/use-is-authed-A2Yinlt0.js","assets/skill-scope-BTRBQt0-.js","assets/use-save-settings-CikTu5xV.js","assets/use-can-manage-org-profiles-CB8ybxFK.js","assets/organization-service.api-DmFUEmu5.js","assets/git-repo-dropdown-DPQVumZg.js","assets/settings-dropdown-input-BRR2OZwi.js","assets/merge-agent-profile-save-input-WcFmQVKK.js","assets/base-modal-Ds7grR67.js","assets/modal-body-DBweM2EN.js","assets/loading-spinner-DK1sAwVg.js","assets/navigation-link-Bxo3-4vo.js","assets/use-activate-agent-profile-iQZ0U3qV.js","assets/use-click-outside-element-W6Os4Nlb.js","assets/settings-gear-DaJj6Pde.js","assets/u-robot-BvAOA2ZD.js","assets/format-time-delta-BIR5Os7T.js","assets/browser-tab-CmYT4j_r.js","assets/external-link-Bd7Tga-1.js","assets/vendor~browser-tab-C5uuAxZX.js","assets/planner-tab-CXph_C9F.js","assets/list-todo-Caa8E1X_.js","assets/task-list-tab-BLKF_x9f.js","assets/usage-tab-Drd3O006.js","assets/info-BcajzHn1.js","assets/terminal-Ckbnqb23.js","assets/vendor~terminal-BVSbSr6V.js","assets/vendor~terminal-T4IDBjWs.css"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,a as n,bt as r,m as i,xt as a,yt as o}from"./vendor-styling-Ck5D_A2Q.js";import{F as s,I as c,R as l,U as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as d}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{c as f,n as p,r as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as h}from"./useMutation-Cszf8mKy.js";import{t as g}from"./useQueries-pUohFMSP.js";import{t as _}from"./useQuery-DAAacS7O.js";import{i as v}from"./recommended-automations-launcher-r0oI91HN.js";import{t as y}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as b}from"./useTranslation-CCgUjPJF.js";import{$ as x,ct as S,dt as C,gt as w,n as T,ot as E,st as D}from"./active-backend-context-BsLfwrXB.js";import{A as O,D as k,E as A,F as j,G as M,K as N,L as P,M as F,T as ee,V as te,W as ne,a as I,d as re,f as ie,h as ae,i as oe,j as se,k as L,l as ce,m as le,n as ue,o as de,p as fe,r as pe,s as me,t as R,u as z,w as he,y as ge}from"./utils-D-gOfhmN.js";import{a as _e,c as ve,i as ye,n as B}from"./agent-server-client-options-EHB23gyx.js";import{c as be}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js";import{A as xe,D as Se,E as Ce,M as we,N as Te,O as Ee,P as De,S as Oe,T as ke,_ as Ae,b as je,c as Me,f as Ne,g as Pe,h as Fe,j as Ie,k as Le,l as Re,m as ze,n as Be,p as Ve,s as He,t as Ue,u as We,v as Ge,w as Ke,x as qe,y as Je}from"./messages-DmFJlW6c.js";import{t as Ye}from"./check-Bo8s5Ylg.js";import{n as Xe,r as Ze,t as Qe}from"./vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js";import{r as $e}from"./map-provider-iRs80q_6.js";import{i as et,n as tt,r as nt,t as rt}from"./empty-state-Cd-TFe7i.js";import{t as it}from"./external-link-Bd7Tga-1.js";import{n as at,r as ot,t as st}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{c as ct,d as lt,l as ut,n as dt,s as ft,u as pt}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{a as mt,i as ht}from"./cloud-funnel-analytics-D02kgq1s.js";import{t as gt}from"./info-BcajzHn1.js";import{t as _t}from"./list-todo-Caa8E1X_.js";import{t as vt}from"./loader-circle-BxJgk73D.js";import{a as yt,c as bt,d as xt,f as St,i as Ct,l as wt,m as Tt,n as Et,p as Dt,r as Ot,t as kt}from"./skill-filter-CdBbbwjm.js";import{t as At}from"./x-CX8lVGwm.js";import{t as jt}from"./trash-2-Bb40zQzs.js";import{n as Mt,t as V}from"./context-menu-list-item-lx2zk9G7.js";import{f as Nt}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{t as Pt}from"./proxy-DbEf3Nqr.js";import{t as Ft}from"./react-BX7IV650.js";import{i as It}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js";import{t as Lt}from"./loading-spinner-DK1sAwVg.js";import{t as Rt}from"./use-tracking-ChnSFChv.js";import{l as zt}from"./settings-service.api-Q9lKW1TX.js";import{n as Bt}from"./use-settings-BWIH5EuN.js";import{t as Vt}from"./modal-backdrop-BSzNhM4r.js";import{n as Ht}from"./modal-body-DBweM2EN.js";import{n as Ut,r as Wt}from"./base-modal-Ds7grR67.js";import{_ as Gt,i as Kt,u as qt}from"./form-control-classes-lQfLxzH4.js";import{t as Jt}from"./brand-button-mQq2Ld1I.js";import{n as Yt}from"./navigation-context-CQZwH_tC.js";import{t as Xt}from"./styled-tooltip-DVAlWYnL.js";import{r as Zt,u as Qt}from"./dropdown-classes-goDldkiu.js";import{c as $t,d as en,i as tn,l as nn,m as rn,t as an}from"./use-llm-configured-B71ZEVg2.js";import{a as on,c as sn,d as cn,f as ln,h as un,l as H,o as dn,p as fn,t as U,u as W}from"./conversation-store-DC-JlJuq.js";import{t as pn}from"./modal-close-button-BrM5fNnn.js";import{t as mn}from"./confirmation-modal-BmVt_c0I.js";import{E as hn,T as gn,j as _n,o as vn,t as yn}from"./agent-server-conversation-service.api-BaVQ6NpE.js";import{t as bn}from"./use-is-authed-A2Yinlt0.js";import{d as xn,g as Sn,l as Cn,m as wn,s as Tn,t as En,u as Dn,v as On}from"./conversation-state-store-C6YncQNo.js";import{c as kn,d as An,i as jn,l as Mn,n as Nn,r as Pn,s as Fn,t as In,u as Ln}from"./sidebar-mobile-menu-toggle-CEqS8KnA.js";import{t as Rn}from"./use-click-outside-element-W6Os4Nlb.js";import{n as zn}from"./use-create-conversation-Be-eVpFp.js";import{r as Bn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{a as G,i as Vn,n as Hn}from"./use-can-manage-org-profiles-CB8ybxFK.js";import{t as Un}from"./u-edit-DAkcF52u.js";import{t as Wn}from"./skills-B0IliMxw.js";import{t as Gn}from"./install-server-modal-DvxxYKia.js";import{o as Kn,s as qn,t as Jn}from"./home-store-DNQpfIEO.js";import{t as Yn}from"./use-automation-health-DdgSa8sA.js";import{t as Xn}from"./use-automations-CEubcYTD.js";import{t as Zn}from"./use-user-conversation-C_l65DqW.js";import{t as Qn}from"./copy-Drmhc2jD.js";import{r as $n}from"./typography-NarNyelM.js";import{n as er,o as tr,t as nr}from"./extension-module-card-classes-DpeaYhYo.js";import{t as rr}from"./secrets-service-DU6wh3wX.js";import{t as ir}from"./use-get-secrets-fqS0kxt6.js";import{t as ar}from"./mcp-installed-servers-Br4ZLsjr.js";import{t as or}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{l as sr,s as cr,t as lr}from"./mcp-marketplace-utils-BwEnDYqm.js";import{t as ur}from"./x-mark-BopmFoBq.js";import{A as dr,B as fr,C as pr,D as mr,E as hr,F as gr,G as _r,I as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,R as wr,S as Tr,T as Er,U as Dr,V as Or,W as kr,_ as Ar,a as jr,b as Mr,c as Nr,g as Pr,h as Fr,i as Ir,j as Lr,n as Rr,o as zr,p as Br,q as Vr,r as Hr,s as Ur,t as Wr,v as Gr,w as Kr,x as qr,y as Jr}from"./llm-not-configured-banner-DMdL1vaX.js";import{$ as Yr,A as Xr,B as Zr,D as K,E as Qr,F as $r,H as ei,I as ti,J as ni,K as ri,M as ii,N as ai,O as oi,P as si,Q as ci,S as li,T as q,U as ui,V as di,W as fi,Z as pi,a as mi,c as hi,et as gi,h as _i,k as vi,m as yi,nt as J,p as bi,q as xi,rt as Si,s as Ci,tt as Y,u as wi,v as Ti,w as Ei,y as Di,z as Oi}from"./markdown-renderer-BH5pqDuJ.js";import{a as ki,n as Ai,t as ji}from"./skill-scope-BTRBQt0-.js";import{t as Mi}from"./git-repo-dropdown-DPQVumZg.js";import{n as Ni,t as Pi}from"./get-git-path-Bp5rsUkl.js";import{t as Fi}from"./parse-git-remote-url-BG8pcKL8.js";import{t as Ii}from"./use-breakpoint-DWtihr9g.js";import{n as Li,t as Ri}from"./error-state-SuWwztxV.js";import{a as zi,i as Bi,n as Vi,o as Hi,r as Ui,t as Wi}from"./mcp-page-DwbnQpVs.js";import{n as Gi,t as Ki}from"./secret-form-WXXNFqTM.js";var X=e(t(),1),qi={curAgentState:L.LOADING},Ji=Ft(e=>({...qi,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(qi)})),Yi=`openhands-last-conversation-by-backend`;function Xi(e,t){return t?`${e}::${t}`:e}function Zi(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Yi);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&r.length>0&&(n[e]=r);return n}catch{return{}}}function Qi(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Yi,JSON.stringify(e))}catch{}}function $i(e,t,n){if(!n)return;let r=Zi();r[Xi(e,t)]=n,Qi(r)}function ea(e,t){let n=Zi(),r=Xi(e,t);r in n&&(delete n[r],Qi(n))}var ta=e=>({action:Te.CHANGE_AGENT_STATE,args:{agent_state:e}}),na=e=>`error`in e,ra=e=>`type`in e&&e.type===`error`,ia=()=>{let{send:e}=we(),t=K(e=>e.events);X.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!(ti(n)&&$r(n))){if(na(n)){if(n.error_code===401){D(`Session expired.`);return}typeof n.error==`string`?D(n.error):D(n.message);return}ra(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(ta(L.PAUSED))}},[t.length])},aa=()=>{let{curAgentState:e}=Yr();return{runtimeActive:!O.includes(e)}};function oa({children:e}){return ia(),aa(),e}var sa=`ACPAuthRequired`,ca={ACPAuthRequired:N.ERROR$ACP_AUTH_REQUIRED_TITLE,ACPSpawnError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPInitError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPPromptError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,UsagePolicyRefusal:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE};function la(e){return e?ca[e]??null:null}function ua(e){return e===sa}var da={entriesByConversation:{}},fa=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),pa=Ft()(un(e=>({...da,addPending:(t,n)=>{let r=_n();return e(e=>fa(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>fa(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`})),Z=o();function ma({onClick:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-normal text-success bg-success/10 hover:bg-success/20 border border-success/30 transition-colors`,children:[(0,Z.jsx)(Le,{className:`w-3.5 h-3.5 fill-success`}),(0,Z.jsx)(`span`,{children:t(N.CHAT_INTERFACE$BTW_GOT_IT)})]})}function ha({conversationId:e}){let{t}=b(`openhands`),n=pa(e=>e.entriesByConversation),r=pa(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,Z.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,Z.jsx)(xe,{title:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`opacity-60`,children:t(N.CHAT_INTERFACE$BTW_PREFIX)}),(0,Z.jsx)(`span`,{children:n.question}),i&&(0,Z.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`})]}),details:i?t(N.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,Z.jsx)(ma,{onClick:()=>r(e,n.id)})},n.id)})})}function ga({conversationId:e}){let t=li(e=>e.statusByConversation),n=e?t[e]:void 0;return n?.active?(0,Z.jsx)(Ee,{status:n}):null}var _a=`${F} `,va=(e,t)=>{let n=pa(e=>e.addPending),r=pa(e=>e.resolve),i=pa(e=>e.fail);return(0,X.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(_a);if(!e||!s){t(a);return}let c=o.slice(F.length).trim();if(!c)return;let l=n(e,c);Dn(e,c).then(({response:t})=>r(e,l,t)).catch(t=>i(e,l,t?.message??`Failed to ask agent`))},[e,t,n,r,i])},ya=`${P} `,ba=/^--max(?:=|\s+)(\d+)\s*/,xa=(e,t)=>{let{t:n}=b();return(0,X.useCallback)(r=>{let i=r.trim(),a=i===`/goal`||i.startsWith(ya);if(!e||!a){t(r);return}let o=i.slice(P.length).trim(),s,c=o.match(ba);c&&(s=parseInt(c[1],10),o=o.slice(c[0].length).trim());let l=o;if(!l){D(n(N.GOAL$OBJECTIVE_REQUIRED));return}let u={objective:l};s&&s>=1&&(u.max_iterations=s),Sn(e,u).catch(e=>{let t=n(N.GOAL$START_FAILED);D(e instanceof Error&&e.message?e.message:t)})},[e,t,n])},Sa=`${te} `,Ca=`${j} `,wa=(e,t,n)=>{let r=U(e=>e.setConversationMode),{handlePlanClick:i,hasPlanner:a,isCreatingConversation:o}=xr(),s=Dr()===`OPEN`,c=kr()===`OPEN`,{isPlanningAgentRunning:l}=gi();return(0,X.useCallback)(u=>{let d=u.trim(),f=d===`/plan`||d.startsWith(Sa),p=d===`/code`||d.startsWith(Ca);if(!e||!f&&!p){n(u);return}if(!(t===L.RUNNING||o))if(f){if(l||!c)return;let e=d.slice(te.length).trim();e&&a?(r(`plan`),n(e)):i(void 0,e||void 0)}else{if(!s)return;r(`code`);let e=d.slice(j.length).trim();e&&n(e)}},[e,t,a,o,s,l,c,n,i,r])},Ta=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function Ea(e){return R(Ta,e?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer text-white`:`bg-[var(--oh-surface)] cursor-not-allowed opacity-50 text-[var(--oh-muted)]`)}function Da(e){return e?`white`:`var(--oh-muted)`}var Oa=`font-normal text-sm leading-5 truncate`;function ka({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=b(`openhands`),{trackPullButtonClick:a}=Rt(),o=n&&t&&r;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(re())},disabled:!o,className:R(Ea(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Er,{width:12,height:12,color:Da(o)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[76px]`),title:i(N.COMMON$PULL),children:i(N.COMMON$PULL)})]})}function Aa({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackPushButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(ie(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(hr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[77px]`),title:a(N.COMMON$PUSH),children:a(N.COMMON$PUSH)})]})}function ja({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackCreatePrButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(me(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Kr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[126px]`),title:a(N.COMMON$PULL_REQUEST),children:a(N.COMMON$PULL_REQUEST)})]})}function Ma(e){return e.kind===`BashCommand`}function Na(e){return e.kind===`BashOutput`}function Pa(e){return e.kind===`BashError`}function Fa(e,t,n){let r=(0,X.useRef)(null),i=(0,X.useRef)(null),a=(0,X.useRef)([]),o=(0,X.useRef)([]),s=(0,X.useRef)(new Map);return(0,X.useEffect)(()=>{if(!n)return;let c=ye(e),l=new WebSocket(c);r.current=l,i.current=null;let u=pi(l);l.onopen=()=>{u(),ci(l,t),i.current=l;for(let{command:e,cwd:t,timeout:n,resolve:r,reject:i}of a.current)o.current.push({resolve:r,reject:i}),l.send(JSON.stringify({command:e,cwd:t,timeout:n}));a.current=[]},l.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Ma(t)){let e=o.current.shift();e&&s.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Na(t)&&t.command_id){let e=s.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(s.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else Pa(t)&&d(`Bash error: ${t.code}: ${t.detail}`)};function d(e){let t=Error(e);for(let{reject:e}of a.current)e(t);a.current=[];for(let e of o.current)e.reject(t);o.current=[];for(let e of s.current.values())e.reject(t);s.current.clear()}return l.onclose=()=>{u(),r.current=null,i.current=null,d(`Bash WebSocket closed`)},l.onerror=()=>{r.current=null,i.current=null,d(`Bash WebSocket error`)},()=>{u(),l.onclose=null,l.onerror=null,l.close(),r.current=null,i.current=null,d(`Bash WebSocket unmounted`)}},[n,e,t]),(0,X.useCallback)((e,t,n)=>new Promise((s,c)=>{let l=r.current;if(!l||l.readyState===WebSocket.CLOSED||l.readyState===WebSocket.CLOSING){c(Error(`Bash WebSocket not available`));return}l.readyState!==WebSocket.OPEN||i.current!==l?a.current.push({command:e,cwd:t,timeout:n,resolve:s,reject:c}):(o.current.push({resolve:s,reject:c}),l.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var Ia={repository:null,branch:null,provider:null,remoteUrl:null},La=[`r=$(git remote get-url origin 2>/dev/null)`,`b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)`,`if [ -z "$r$b" ]; then`,`n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)`,`c=$(printf '%s\\n' "$n" | grep -c '[^[:space:]]')`,`if [ "$c" = "1" ] && [ -n "$n" ]; then`,`r=$(git -C "$n" remote get-url origin 2>/dev/null)`,`b=$(git -C "$n" rev-parse --abbrev-ref HEAD 2>/dev/null)`,`fi`,`fi`,`printf '%s\\n%s' "$r" "$b"`].join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-BNDp3e_x.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Ck5D_A2Q.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js","assets/useQuery-DAAacS7O.js","assets/messages-WUb9Yh-p.js","assets/active-backend-context-BETEdaJl.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/utils-CbjwNcR-.js","assets/vendor-markdown-j0kYzV48.js","assets/useMutation-Cszf8mKy.js","assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js","assets/useTranslation-CCgUjPJF.js","assets/markdown-renderer-DRpwRlNm.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js","assets/iconBase-C2sR-uAp.js","assets/agent-server-conversation-service.api-BtOlitCD.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js","assets/proxy-BCCQUna8.js","assets/profiles-service.api-B5thiTI3.js","assets/settings-service.api-CYBTLGOd.js","assets/settings-CKqk8ZnH.js","assets/llm-subscription-service-LGYVzyAc.js","assets/llm-subscription-DTqtBCWz.js","assets/acp-providers-DOKcGeaV.js","assets/skill-enablement-BBKya60C.js","assets/conversation-store-DC-JlJuq.js","assets/react-BX7IV650.js","assets/conversation-state-store-Br-eE-gg.js","assets/syntax-highlighter-BGDg_7w9.js","assets/copy-to-clipboard-button-CvTHqY13.js","assets/checkmark-XZyokq_Y.js","assets/copy-Drmhc2jD.js","assets/navigation-context-CQZwH_tC.js","assets/use-settings-D69cw06D.js","assets/use-user-conversation-BBDXUbOc.js","assets/scroll-fade-state-Dt_fx2kf.js","assets/chevron-down-Cr6Fn_wS.js","assets/chevron-right-CfdfRn-8.js","assets/loader-circle-BxJgk73D.js","assets/vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js","assets/use-free-models-FAk2nngq.js","assets/use-config-BJ_FJCjV.js","assets/styled-tooltip-CknPQH4Y.js","assets/modal-backdrop-BSzNhM4r.js","assets/modal-close-button-Cq3dma5u.js","assets/get-git-path-DOe6PM_a.js","assets/close-ScPlnwyq.js","assets/skills-B0IliMxw.js","assets/u-check-circle-BKn1spCL.js","assets/typography-BdAApXGl.js","assets/dist-Bl64nBZL.js","assets/form-control-classes-BVI_szaj.js","assets/format-model-name-Dfh9Udrx.js","assets/cloud-funnel-analytics-BH_zxjiO.js","assets/mouse-pointer-click-BXlRN92t.js","assets/use-llm-configured-DF9BYmIe.js","assets/agent-profiles-service.api-CiMVQAIT.js","assets/use-tracking-BAFpgpgq.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js","assets/bot-ByolqPEr.js","assets/use-agent-profiles-YsBlt3tT.js","assets/use-llm-profiles-U4u1gzuk.js","assets/settings-utils-BTaaRhLZ.js","assets/map-provider-iRs80q_6.js","assets/conversation-tab-empty-state-BT1GrnKP.js","assets/highlighted-source-view-DPerL6tF.js","assets/folder-C1ou4_DT.js","assets/link-external-B4gx3EeM.js","assets/commits-tab-B5SUF66c.js","assets/vendor~commits-tab-BaO2Ce3e.js","assets/vendor~conversation-panel~conversation-C22sJuWZ.js","assets/vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js","assets/llm-not-configured-banner-BdjItKQR.js","assets/vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js","assets/useInfiniteQuery-CtSRG7uW.js","assets/recommended-automations-launcher-D1Do753p.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js","assets/secrets-service-C3CNNEpY.js","assets/install-server-modal-DkMCfj0J.js","assets/brand-button-CGUwj6zK.js","assets/settings-input-B3i5U9GL.js","assets/mcp-marketplace-utils-BwEnDYqm.js","assets/modal-classes-BPcBCWVj.js","assets/skill-card-pill-row-CxOFySng.js","assets/extension-module-card-classes-DpeaYhYo.js","assets/circle-plus-check-toggle-ZOXpJ3I2.js","assets/x-mark-BopmFoBq.js","assets/use-create-conversation-D15Px574.js","assets/plugins-management-service-2oP6_tWr.js","assets/use-create-secret-D_qPU88t.js","assets/use-automations-7_XBXHQK.js","assets/automation-C_eCrGyP.js","assets/mcp-installed-servers-BW51n6PC.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js","assets/chat-send-button-B6aVaD9V.js","assets/check-Bo8s5Ylg.js","assets/circle-check-5pH3qCji.js","assets/plus-C2e21TFC.js","assets/refresh-cw-BtdC3T8P.js","assets/context-menu-list-item-DIm5xQg6.js","assets/dropdown-classes-DyyMaaXl.js","assets/home-store-roz1x6D5.js","assets/use-is-authed-A2Yinlt0.js","assets/skill-scope-C0NxJnpT.js","assets/use-save-settings-CmX41wlf.js","assets/use-can-manage-org-profiles-Dt4YkPO7.js","assets/organization-service.api-zhHpQU0t.js","assets/git-repo-dropdown-DNlinQ7r.js","assets/settings-dropdown-input-Df_HXRk4.js","assets/merge-agent-profile-save-input-WcFmQVKK.js","assets/base-modal-CZq4kB_H.js","assets/modal-body-B_95ci1c.js","assets/loading-spinner-BJc2J0Dw.js","assets/navigation-link-Bxo3-4vo.js","assets/use-activate-agent-profile-DO6SNPkK.js","assets/use-click-outside-element-W6Os4Nlb.js","assets/settings-gear-DaJj6Pde.js","assets/u-robot-BvAOA2ZD.js","assets/format-time-delta-BIR5Os7T.js","assets/browser-tab-DFyZXsnB.js","assets/external-link-Bd7Tga-1.js","assets/vendor~browser-tab-C5uuAxZX.js","assets/planner-tab-yISBVUKu.js","assets/list-todo-Caa8E1X_.js","assets/task-list-tab-CQisRcPh.js","assets/usage-tab-ClVHAFJy.js","assets/info-BcajzHn1.js","assets/terminal-Bs50gJPC.js","assets/vendor~terminal-BVSbSr6V.js","assets/vendor~terminal-T4IDBjWs.css"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,a as n,bt as r,m as i,xt as a,yt as o}from"./vendor-styling-Ck5D_A2Q.js";import{F as s,I as c,R as l,U as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as d}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{c as f,n as p,r as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as h}from"./useMutation-Cszf8mKy.js";import{t as g}from"./useQueries-pUohFMSP.js";import{t as _}from"./useQuery-DAAacS7O.js";import{i as v}from"./recommended-automations-launcher-D1Do753p.js";import{t as y}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as b}from"./useTranslation-CCgUjPJF.js";import{$ as x,ct as S,dt as C,gt as w,n as T,ot as E,st as D}from"./active-backend-context-BETEdaJl.js";import{A as O,D as k,E as A,F as j,G as M,K as N,L as P,M as F,T as ee,V as te,W as ne,a as I,d as re,f as ie,h as ae,i as oe,j as se,k as L,l as ce,m as le,n as ue,o as de,p as fe,r as pe,s as me,t as R,u as z,w as he,y as ge}from"./utils-CbjwNcR-.js";import{a as _e,c as ve,i as ye,n as B}from"./agent-server-client-options-EHB23gyx.js";import{c as be}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js";import{A as xe,D as Se,E as Ce,M as we,N as Te,O as Ee,P as De,S as Oe,T as ke,_ as Ae,b as je,c as Me,f as Ne,g as Pe,h as Fe,j as Ie,k as Le,l as Re,m as ze,n as Be,p as Ve,s as He,t as Ue,u as We,v as Ge,w as Ke,x as qe,y as Je}from"./messages-WUb9Yh-p.js";import{t as Ye}from"./check-Bo8s5Ylg.js";import{n as Xe,r as Ze,t as Qe}from"./vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js";import{r as $e}from"./map-provider-iRs80q_6.js";import{i as et,n as tt,r as nt,t as rt}from"./empty-state-B5advKVW.js";import{t as it}from"./external-link-Bd7Tga-1.js";import{n as at,r as ot,t as st}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{c as ct,d as lt,l as ut,n as dt,s as ft,u as pt}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{a as mt,i as ht}from"./cloud-funnel-analytics-BH_zxjiO.js";import{t as gt}from"./info-BcajzHn1.js";import{t as _t}from"./list-todo-Caa8E1X_.js";import{t as vt}from"./loader-circle-BxJgk73D.js";import{a as yt,c as bt,d as xt,f as St,i as Ct,l as wt,m as Tt,n as Et,p as Dt,r as Ot,t as kt}from"./skill-filter-BvtbD--b.js";import{t as At}from"./x-CX8lVGwm.js";import{t as jt}from"./trash-2-Bb40zQzs.js";import{n as Mt,t as V}from"./context-menu-list-item-DIm5xQg6.js";import{f as Nt}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as Pt}from"./proxy-BCCQUna8.js";import{t as Ft}from"./react-BX7IV650.js";import{i as It}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";import{t as Lt}from"./loading-spinner-BJc2J0Dw.js";import{t as Rt}from"./use-tracking-BAFpgpgq.js";import{l as zt}from"./settings-service.api-CYBTLGOd.js";import{n as Bt}from"./use-settings-D69cw06D.js";import{t as Vt}from"./modal-backdrop-BSzNhM4r.js";import{n as Ht}from"./modal-body-B_95ci1c.js";import{n as Ut,r as Wt}from"./base-modal-CZq4kB_H.js";import{_ as Gt,i as Kt,u as qt}from"./form-control-classes-BVI_szaj.js";import{t as Jt}from"./brand-button-CGUwj6zK.js";import{n as Yt}from"./navigation-context-CQZwH_tC.js";import{t as Xt}from"./styled-tooltip-CknPQH4Y.js";import{r as Zt,u as Qt}from"./dropdown-classes-DyyMaaXl.js";import{c as $t,d as en,i as tn,l as nn,m as rn,t as an}from"./use-llm-configured-DF9BYmIe.js";import{a as on,c as sn,d as cn,f as ln,h as un,l as H,o as dn,p as fn,t as U,u as W}from"./conversation-store-DC-JlJuq.js";import{t as pn}from"./modal-close-button-Cq3dma5u.js";import{t as mn}from"./confirmation-modal-oN1EId79.js";import{E as hn,T as gn,j as _n,o as vn,t as yn}from"./agent-server-conversation-service.api-BtOlitCD.js";import{t as bn}from"./use-is-authed-A2Yinlt0.js";import{d as xn,g as Sn,l as Cn,m as wn,s as Tn,t as En,u as Dn,v as On}from"./conversation-state-store-Br-eE-gg.js";import{c as kn,d as An,i as jn,l as Mn,n as Nn,r as Pn,s as Fn,t as In,u as Ln}from"./sidebar-mobile-menu-toggle-B2xwXm4s.js";import{t as Rn}from"./use-click-outside-element-W6Os4Nlb.js";import{n as zn}from"./use-create-conversation-D15Px574.js";import{r as Bn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{a as G,i as Vn,n as Hn}from"./use-can-manage-org-profiles-Dt4YkPO7.js";import{t as Un}from"./u-edit-DAkcF52u.js";import{t as Wn}from"./skills-B0IliMxw.js";import{t as Gn}from"./install-server-modal-DkMCfj0J.js";import{o as Kn,s as qn,t as Jn}from"./home-store-roz1x6D5.js";import{t as Yn}from"./use-automation-health-CbQ9n-k7.js";import{t as Xn}from"./use-automations-7_XBXHQK.js";import{t as Zn}from"./use-user-conversation-BBDXUbOc.js";import{t as Qn}from"./copy-Drmhc2jD.js";import{r as $n}from"./typography-BdAApXGl.js";import{n as er,o as tr,t as nr}from"./extension-module-card-classes-DpeaYhYo.js";import{t as rr}from"./secrets-service-C3CNNEpY.js";import{t as ir}from"./use-get-secrets-Pbo9jh2A.js";import{t as ar}from"./mcp-installed-servers-BW51n6PC.js";import{t as or}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js";import{l as sr,s as cr,t as lr}from"./mcp-marketplace-utils-BwEnDYqm.js";import{t as ur}from"./x-mark-BopmFoBq.js";import{A as dr,B as fr,C as pr,D as mr,E as hr,F as gr,G as _r,I as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,R as wr,S as Tr,T as Er,U as Dr,V as Or,W as kr,_ as Ar,a as jr,b as Mr,c as Nr,g as Pr,h as Fr,i as Ir,j as Lr,n as Rr,o as zr,p as Br,q as Vr,r as Hr,s as Ur,t as Wr,v as Gr,w as Kr,x as qr,y as Jr}from"./llm-not-configured-banner-BdjItKQR.js";import{$ as Yr,A as Xr,B as Zr,D as K,E as Qr,F as $r,H as ei,I as ti,J as ni,K as ri,M as ii,N as ai,O as oi,P as si,Q as ci,S as li,T as q,U as ui,V as di,W as fi,Z as pi,a as mi,c as hi,et as gi,h as _i,k as vi,m as yi,nt as J,p as bi,q as xi,rt as Si,s as Ci,tt as Y,u as wi,v as Ti,w as Ei,y as Di,z as Oi}from"./markdown-renderer-DRpwRlNm.js";import{a as ki,n as Ai,t as ji}from"./skill-scope-C0NxJnpT.js";import{t as Mi}from"./git-repo-dropdown-DNlinQ7r.js";import{n as Ni,t as Pi}from"./get-git-path-DOe6PM_a.js";import{t as Fi}from"./parse-git-remote-url-BG8pcKL8.js";import{t as Ii}from"./use-breakpoint-DWtihr9g.js";import{n as Li,t as Ri}from"./error-state-BgYl7YeB.js";import{a as zi,i as Bi,n as Vi,o as Hi,r as Ui,t as Wi}from"./mcp-page-hZ4aJjj_.js";import{n as Gi,t as Ki}from"./secret-form-BDvzojzN.js";var X=e(t(),1),qi={curAgentState:L.LOADING},Ji=Ft(e=>({...qi,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(qi)})),Yi=`openhands-last-conversation-by-backend`;function Xi(e,t){return t?`${e}::${t}`:e}function Zi(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Yi);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&r.length>0&&(n[e]=r);return n}catch{return{}}}function Qi(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Yi,JSON.stringify(e))}catch{}}function $i(e,t,n){if(!n)return;let r=Zi();r[Xi(e,t)]=n,Qi(r)}function ea(e,t){let n=Zi(),r=Xi(e,t);r in n&&(delete n[r],Qi(n))}var ta=e=>({action:Te.CHANGE_AGENT_STATE,args:{agent_state:e}}),na=e=>`error`in e,ra=e=>`type`in e&&e.type===`error`,ia=()=>{let{send:e}=we(),t=K(e=>e.events);X.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!(ti(n)&&$r(n))){if(na(n)){if(n.error_code===401){D(`Session expired.`);return}typeof n.error==`string`?D(n.error):D(n.message);return}ra(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(ta(L.PAUSED))}},[t.length])},aa=()=>{let{curAgentState:e}=Yr();return{runtimeActive:!O.includes(e)}};function oa({children:e}){return ia(),aa(),e}var sa=`ACPAuthRequired`,ca={ACPAuthRequired:N.ERROR$ACP_AUTH_REQUIRED_TITLE,ACPSpawnError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPInitError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPPromptError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,UsagePolicyRefusal:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE};function la(e){return e?ca[e]??null:null}function ua(e){return e===sa}var da={entriesByConversation:{}},fa=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),pa=Ft()(un(e=>({...da,addPending:(t,n)=>{let r=_n();return e(e=>fa(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>fa(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`})),Z=o();function ma({onClick:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-normal text-success bg-success/10 hover:bg-success/20 border border-success/30 transition-colors`,children:[(0,Z.jsx)(Le,{className:`w-3.5 h-3.5 fill-success`}),(0,Z.jsx)(`span`,{children:t(N.CHAT_INTERFACE$BTW_GOT_IT)})]})}function ha({conversationId:e}){let{t}=b(`openhands`),n=pa(e=>e.entriesByConversation),r=pa(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,Z.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,Z.jsx)(xe,{title:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`opacity-60`,children:t(N.CHAT_INTERFACE$BTW_PREFIX)}),(0,Z.jsx)(`span`,{children:n.question}),i&&(0,Z.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`})]}),details:i?t(N.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,Z.jsx)(ma,{onClick:()=>r(e,n.id)})},n.id)})})}function ga({conversationId:e}){let t=li(e=>e.statusByConversation),n=e?t[e]:void 0;return n?.active?(0,Z.jsx)(Ee,{status:n}):null}var _a=`${F} `,va=(e,t)=>{let n=pa(e=>e.addPending),r=pa(e=>e.resolve),i=pa(e=>e.fail);return(0,X.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(_a);if(!e||!s){t(a);return}let c=o.slice(F.length).trim();if(!c)return;let l=n(e,c);Dn(e,c).then(({response:t})=>r(e,l,t)).catch(t=>i(e,l,t?.message??`Failed to ask agent`))},[e,t,n,r,i])},ya=`${P} `,ba=/^--max(?:=|\s+)(\d+)\s*/,xa=(e,t)=>{let{t:n}=b();return(0,X.useCallback)(r=>{let i=r.trim(),a=i===`/goal`||i.startsWith(ya);if(!e||!a){t(r);return}let o=i.slice(P.length).trim(),s,c=o.match(ba);c&&(s=parseInt(c[1],10),o=o.slice(c[0].length).trim());let l=o;if(!l){D(n(N.GOAL$OBJECTIVE_REQUIRED));return}let u={objective:l};s&&s>=1&&(u.max_iterations=s),Sn(e,u).catch(e=>{let t=n(N.GOAL$START_FAILED);D(e instanceof Error&&e.message?e.message:t)})},[e,t,n])},Sa=`${te} `,Ca=`${j} `,wa=(e,t,n)=>{let r=U(e=>e.setConversationMode),{handlePlanClick:i,hasPlanner:a,isCreatingConversation:o}=xr(),s=Dr()===`OPEN`,c=kr()===`OPEN`,{isPlanningAgentRunning:l}=gi();return(0,X.useCallback)(u=>{let d=u.trim(),f=d===`/plan`||d.startsWith(Sa),p=d===`/code`||d.startsWith(Ca);if(!e||!f&&!p){n(u);return}if(!(t===L.RUNNING||o))if(f){if(l||!c)return;let e=d.slice(te.length).trim();e&&a?(r(`plan`),n(e)):i(void 0,e||void 0)}else{if(!s)return;r(`code`);let e=d.slice(j.length).trim();e&&n(e)}},[e,t,a,o,s,l,c,n,i,r])},Ta=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function Ea(e){return R(Ta,e?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer text-white`:`bg-[var(--oh-surface)] cursor-not-allowed opacity-50 text-[var(--oh-muted)]`)}function Da(e){return e?`white`:`var(--oh-muted)`}var Oa=`font-normal text-sm leading-5 truncate`;function ka({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=b(`openhands`),{trackPullButtonClick:a}=Rt(),o=n&&t&&r;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(re())},disabled:!o,className:R(Ea(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Er,{width:12,height:12,color:Da(o)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[76px]`),title:i(N.COMMON$PULL),children:i(N.COMMON$PULL)})]})}function Aa({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackPushButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(ie(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(hr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[77px]`),title:a(N.COMMON$PUSH),children:a(N.COMMON$PUSH)})]})}function ja({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackCreatePrButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(me(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Kr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[126px]`),title:a(N.COMMON$PULL_REQUEST),children:a(N.COMMON$PULL_REQUEST)})]})}function Ma(e){return e.kind===`BashCommand`}function Na(e){return e.kind===`BashOutput`}function Pa(e){return e.kind===`BashError`}function Fa(e,t,n){let r=(0,X.useRef)(null),i=(0,X.useRef)(null),a=(0,X.useRef)([]),o=(0,X.useRef)([]),s=(0,X.useRef)(new Map);return(0,X.useEffect)(()=>{if(!n)return;let c=ye(e),l=new WebSocket(c);r.current=l,i.current=null;let u=pi(l);l.onopen=()=>{u(),ci(l,t),i.current=l;for(let{command:e,cwd:t,timeout:n,resolve:r,reject:i}of a.current)o.current.push({resolve:r,reject:i}),l.send(JSON.stringify({command:e,cwd:t,timeout:n}));a.current=[]},l.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Ma(t)){let e=o.current.shift();e&&s.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Na(t)&&t.command_id){let e=s.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(s.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else Pa(t)&&d(`Bash error: ${t.code}: ${t.detail}`)};function d(e){let t=Error(e);for(let{reject:e}of a.current)e(t);a.current=[];for(let e of o.current)e.reject(t);o.current=[];for(let e of s.current.values())e.reject(t);s.current.clear()}return l.onclose=()=>{u(),r.current=null,i.current=null,d(`Bash WebSocket closed`)},l.onerror=()=>{r.current=null,i.current=null,d(`Bash WebSocket error`)},()=>{u(),l.onclose=null,l.onerror=null,l.close(),r.current=null,i.current=null,d(`Bash WebSocket unmounted`)}},[n,e,t]),(0,X.useCallback)((e,t,n)=>new Promise((s,c)=>{let l=r.current;if(!l||l.readyState===WebSocket.CLOSED||l.readyState===WebSocket.CLOSING){c(Error(`Bash WebSocket not available`));return}l.readyState!==WebSocket.OPEN||i.current!==l?a.current.push({command:e,cwd:t,timeout:n,resolve:s,reject:c}):(o.current.push({resolve:s,reject:c}),l.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var Ia={repository:null,branch:null,provider:null,remoteUrl:null},La=[`r=$(git remote get-url origin 2>/dev/null)`,`b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)`,`if [ -z "$r$b" ]; then`,`n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)`,`c=$(printf '%s\\n' "$n" | grep -c '[^[:space:]]')`,`if [ "$c" = "1" ] && [ -n "$n" ]; then`,`r=$(git -C "$n" remote get-url origin 2>/dev/null)`,`b=$(git -C "$n" rev-parse --abbrev-ref HEAD 2>/dev/null)`,`fi`,`fi`,`printf '%s\\n%s' "$r" "$b"`].join(`
3
3
  `);async function Ra(e,t){let n=await e(La,t,10);if(n.exit_code!==0)return Ia;let r=n.stdout.indexOf(`
4
4
  `),i=(r>=0?n.stdout.slice(0,r):n.stdout).trim(),a=(r>=0?n.stdout.slice(r+1):``).trim(),o=a&&a!==`HEAD`?a:null;if(!i&&!o)return Ia;let s=Fi(i);return{repository:s?.repository??null,provider:s?.provider??null,remoteUrl:i||null,branch:o}}var za=()=>{let{data:e}=Y(),t=Ni(),{backend:n}=T(),r=n.kind===`local`,i=e?.id,a=e?.conversation_url,o=e?.session_api_key,s=e?.workspace?.working_dir?.trim(),c=!!e?.selected_repository,l=!!e?.git_provider,u=!!e?.selected_branch,d=r&&t&&!!i&&!!s&&(!c||!l||!u),f=Fa(a,o,d),p=(0,X.useRef)(f);return p.current=f,_({queryKey:[`local-git-info`,i,a,o,s],queryFn:async()=>Ra((e,t,n)=>p.current(e,t,n),s),enabled:d,retry:!1,staleTime:1e4,refetchInterval:1e4,gcTime:1e3*60*5,meta:{disableToast:!0}})},Ba=()=>{let e=d(),{t}=b(`openhands`);return h({mutationFn:e=>yn.updateConversationRepository(e.conversationId,e.repository,e.branch,e.gitProvider),onMutate:async t=>{let n=[`user`,`conversation`,t.conversationId];await e.cancelQueries({queryKey:n});let r=e.getQueriesData({queryKey:n});return e.setQueriesData({queryKey:n},e=>e&&{...e,selected_repository:t.repository,selected_branch:t.branch??null,git_provider:t.gitProvider??null}),{previousEntries:r}},onError:(n,r,i)=>{i?.previousEntries.forEach(([t,n])=>{e.setQueryData(t,n)}),D(t(N.CONVERSATION$FAILED_TO_UPDATE_REPOSITORY))},onSuccess:()=>{S(t(N.CONVERSATION$REPOSITORY_UPDATED))},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`local-git-info`,r.conversationId]})}})};function Va({children:e,tooltipMessage:t,testId:n,shouldShowTooltip:r}){return r?(0,Z.jsx)(Xt,{content:t,placement:`top`,showArrow:!0,tooltipClassName:`bg-white text-black`,children:(0,Z.jsx)(`span`,{"data-testid":n,className:`hover:opacity-100`,children:e})}):e}function Ha({isOpen:e,onClose:t,onLaunch:n,defaultProvider:r=`github`}){let{t:i}=b(`openhands`),{providers:a}=qn(),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(null);(0,X.useEffect)(()=>{a.length===1&&!o?s(a[0]):a.length>1&&!o&&r&&a.includes(r)&&s(r)},[a,o,r]);let f=(0,X.useCallback)(e=>{e!==o&&(s(e),l(null),d(null))},[o]),p=(0,X.useCallback)(e=>{e?(l(e),d(null)):(l(null),d(null))},[]),m=(0,X.useCallback)(e=>{d(e)},[]),h=()=>{!c||!u||(n(c,u),l(null),d(null),t())},g=()=>{s(null),l(null),d(null),t()};if(!e)return null;let _=c?.git_provider||o||r,v=!!c&&!!u;return(0,Z.jsx)(Vt,{onClose:g,children:(0,Z.jsxs)(Ht,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(pn,{onClose:g,testId:`close-open-repository-modal`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(Wt,{title:i(N.CONVERSATION$OPEN_REPOSITORY)})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:i(N.CONVERSATION$SELECT_OR_INSERT_LINK)}),a.length>1&&(0,Z.jsx)(jr,{providers:a,value:o,onChange:f})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] w-full`,children:[(0,Z.jsx)(Mi,{provider:_,value:c?.id||null,repositoryName:c?.full_name||null,onChange:p,className:`w-full`}),(0,Z.jsx)(Ir,{repository:c?.full_name||null,provider:_,selectedBranch:u,onBranchSelect:m,defaultBranch:c?.main_branch||null,disabled:!c,className:`w-full`})]})]}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(Jt,{type:`button`,variant:`secondary`,onClick:g,children:i(N.BUTTON$CANCEL)}),(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,onClick:h,isDisabled:!v,children:i(N.BUTTON$LAUNCH)})]})]})})}function Ua({onSuggestionsClick:e}){let{t}=b(`openhands`),{conversationId:n}=J(),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(null),{addRecentRepository:c}=Jn(),l=q(e=>e.enqueuePendingMessage),u=q(e=>e.markPendingMessageError),{backend:d}=T(),f=d.kind===`local`,{providers:p}=qn(),m=f||p.length>0,{data:h}=Y(),{repositoryInfo:g}=vr(),{data:_}=za(),v=kr(),y=hi()?.isLoadingHistory??!1,x=(0,X.useRef)(v);(0,X.useEffect)(()=>{x.current=v},[v]);let{send:S}=we(),C=(0,X.useRef)(S);(0,X.useEffect)(()=>{C.current=S},[S]);let w=ke(),{mutate:E}=Ba(),{mutate:O,isPending:k}=zn(),A=h?.selected_repository||g?.selectedRepository,j=h?.git_provider||g?.gitProvider,M=h?.selected_branch||g?.selectedBranch,P=A||_?.repository||void 0,F=j||_?.provider,ee=M||_?.branch||void 0,te=(h?.id?hn(h.id):null)?.selected_workspace??null,ne=te&&te.replace(/\/+$/,``).split(`/`).pop()||null,I=!!P&&!!F,re=!!h&&v===`OPEN`&&!y;(0,X.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),(0,X.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let ie=(e,r)=>{n&&(c(e),E({conversationId:n,repository:e.full_name,branch:r.name,gitProvider:e.git_provider},{onSuccess:()=>{if(x.current!==`OPEN`){D(t(N.CONVERSATION$CLONE_COMMAND_FAILED_DISCONNECTED));return}let i=e.git_provider.charAt(0).toUpperCase()+e.git_provider.slice(1),a=`Clone ${e.full_name} from ${i} and checkout branch ${r.name}.`,o=n?l({conversationId:n,text:a}):null;w?.scrollDomToBottom(),Promise.resolve(C.current({action:`message`,args:{content:a,timestamp:new Date().toISOString()}})).catch(e=>{o&&u(o,e instanceof Error?e.message:t(N.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))})}}))},ae=!f||!!P||!!ne,oe=f&&!I;return ae||ee||I?(0,Z.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center overflow-x-auto flex-nowrap relative scrollbar-hide`,children:[ae?(0,Z.jsx)(Hr,{selectedRepository:P,gitProvider:F,workspaceName:ne,onClick:()=>i(!0),disabled:!re||oe}):null,ee?(0,Z.jsx)(Rr,{selectedBranch:ee,selectedRepository:P,gitProvider:F}):null,I?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Va,{tooltipMessage:t(N.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pull-button-tooltip`,shouldShowTooltip:!I,children:(0,Z.jsx)(ka,{onSuggestionsClick:e,hasRepository:I,providerTokensReady:m,isConversationReady:re})}),(0,Z.jsx)(Va,{tooltipMessage:t(N.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-push-button-tooltip`,shouldShowTooltip:!I,children:(0,Z.jsx)(Aa,{onSuggestionsClick:e,hasRepository:I,providerTokensReady:m,currentGitProvider:F,isConversationReady:re})}),(0,Z.jsx)(Va,{tooltipMessage:t(N.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pr-button-tooltip`,shouldShowTooltip:!I,children:(0,Z.jsx)(ja,{onSuggestionsClick:e,hasRepository:I,providerTokensReady:m,currentGitProvider:F,isConversationReady:re})})]}):null]}),(0,Z.jsx)(Ha,{isOpen:r,onClose:()=>i(!1),onLaunch:ie,defaultProvider:F})]}):null}function Wa({onSubmit:e,disabled:t=!1,hasStartedConversation:n}){let{images:r,files:i,imagesMarkedUploadAsFile:a,clearAllFiles:o,subConversationTaskId:s}=U(),{curAgentState:c}=Yr(),{data:l}=Y(),{conversationId:u}=Si(),d=u??l?.id??null,{taskStatus:f}=gr(s,l?.id||null),{handleUpload:p}=zr(),m=Ur(d,xa(d,wa(d,c,va(d,t=>{let{imagesToEmbed:n,imagesAsFiles:s}=Vr(r,a);e(t,n,[...i,...s]),o()}))));return(0,Z.jsxs)(`div`,{"data-testid":`interactive-chat-box`,children:[(0,Z.jsx)(Nr,{disabled:t||c===L.AWAITING_USER_CONFIRMATION||ge(f),isNewConversationPending:t,hasStartedConversation:n,onSubmit:m,onFilesPaste:p}),(0,Z.jsx)(`div`,{className:`mt-3 pb-3`,children:(0,Z.jsx)(Ua,{onSuggestionsClick:e=>{m(e)}})})]})}function Ga(){let e=K(e=>e.events),t=K(e=>e.uiEvents),n=X.useMemo(()=>t.filter(yi),[t]),r=X.useMemo(()=>e,[e]),i=X.useMemo(()=>n.length,[n]),a=X.useMemo(()=>r.some(e=>e.source===`agent`&&!ni(e)&&!Oi(e)),[r]),o=bi(r);return{storeEvents:e,uiEvents:t,renderableEvents:n,allConversationEvents:r,totalEvents:i,hasSubstantiveAgentActions:a,conversationUserEventsExist:o,userEventsExist:o}}var Ka=e=>`timestamp`in e?e.timestamp:void 0,qa=e=>{let t=!!e&&on(e),n=t?void 0:e,{data:r}=Zn(e??null),{data:i,isFetched:a}=_i(n??void 0),o=K(e=>e.addEvents),[s,c]=X.useState(!1),[l,u]=X.useState(!0),d=X.useRef(!1),f=X.useRef(!0);return X.useEffect(()=>{if(d.current=!1,c(!1),t){f.current=!1,u(!1);return}f.current=!0,u(!0)},[e,t]),X.useEffect(()=>{t||!a||!i||i.hasMore||(f.current=!1,u(!1))},[t,a,i?.hasMore,n]),{isLoading:s,hasMore:l,loadOlder:X.useCallback(async()=>{if(!e||on(e)||d.current||!f.current||!r)return;let{events:t}=K.getState(),n=t[0];if(!n)return;let i=Ka(n);if(!i){f.current=!1,u(!1);return}d.current=!0,c(!0);try{let t=await Ti.searchEvents(e,r?.conversation_url??null,r?.session_api_key??null,{limit:50,sortOrder:`TIMESTAMP_DESC`,timestampLt:i});if(!Array.isArray(t.items))throw Error(`Invalid older-events response: expected page.items to be an array.`);let n=[...t.items].reverse();n.length>0&&(o(n),wi(e,K.getState().uiEvents)),(!t.next_page_id||t.items.length<50)&&(f.current=!1,u(!1))}finally{d.current=!1,c(!1)}},[e,r,r?.conversation_url,r?.session_api_key,o])}},Ja=Ft(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function Ya(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var Xa=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Za=new Set([`view`]),Qa=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function $a(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Xa.has(t.kind)||t.command&&Za.has(t.command))}function eo(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Qa.has(t.kind)}function to(){let e=d(),t=K(e=>e.events),n=Ja(e=>e.bump),r=(0,X.useRef)(new Set),i=(0,X.useRef)(new WeakSet);(0,X.useEffect)(()=>{let a=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?i.current.has(e):r.current.has(t))||(t===void 0?i.current.add(e):r.current.add(t),$a(e)?a=!0:eo(e)&&(o=!0))}!a&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),a&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var no={kind:`translation`,key:`ACTION_MESSAGE$THINK`,values:{}},ro=new Set([`ExecuteBashAction`,`TerminalAction`,`FileEditorAction`,`StrReplaceEditorAction`,`MCPToolAction`,`InvokeSkillAction`,`TaskAction`,`ThinkAction`,`TaskTrackerAction`,`GrepAction`,`GlobAction`,`BrowserNavigateAction`,`BrowserClickAction`,`BrowserTypeAction`,`BrowserGetStateAction`,`BrowserGetContentAction`,`BrowserScrollAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserSwitchTabAction`,`BrowserCloseTabAction`]),io=e=>{if(!si(e))return null;let t=Ge(e);return t?{kind:`text`,text:t}:ro.has(e.action.kind)?Ae(e):null},ao=e=>e.source===`environment`&&`rejection_reason`in e,oo=e=>{let t=new Set,n=new Set;for(let r=e.length-1;r>=0;--r){let i=e[r];if(!i.isFromPlanningAgent){if(fi(i)||ao(i)){t.add(i.action_id),n.add(i.tool_call_id);continue}if($r(i)){n.add(i.tool_call_id);continue}if(ai(i)){if(!(i.status===`pending`||i.status===`in_progress`)){n.add(i.tool_call_id);continue}if(n.has(i.tool_call_id))continue;let e=qe(i);return e?{kind:`translation`,key:je(i),values:{title:e}}:no}if(si(i)&&!t.has(i.id)&&!n.has(i.tool_call_id))return io(i)??no}}return no};function so({events:e}){let t=oo(e);return(0,Z.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface)] px-3 py-1.5 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`live-activity-chip`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 shrink-0 animate-pulse rounded-full bg-[var(--oh-status-success)] motion-reduce:animate-none`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t.kind===`text`?t.text:(0,Z.jsx)(y,{ns:`openhands`,i18nKey:t.key,values:t.values,components:{path:(0,Z.jsx)(Fe,{}),cmd:(0,Z.jsx)(Pe,{})}})})]})}function co({suggestion:e,onClick:t}){let{t:n}=b(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,className:`list-none border border-[var(--oh-border)] rounded-[15px] hover:bg-surface-raised hover:border-[var(--oh-interactive-hover)] transition-colors flex-1 flex items-center justify-center cursor-pointer gap-[10px] h-[55px] px-4`,onClick:()=>t(e.value),children:[(0,X.useMemo)(()=>{switch(e.label){case`INCREASE_TEST_COVERAGE`:return(0,Z.jsx)(pr,{width:24,height:24,color:`#fff`});case`AUTO_MERGE_PRS`:return(0,Z.jsx)(Tr,{width:19,height:20,color:`#fff`});case`FIX_README`:return(0,Z.jsx)(qr,{width:24,height:24,color:`#fff`});case`CLEAN_DEPENDENCIES`:return(0,Z.jsx)(Mr,{width:24,height:24,color:`#fff`});default:return null}},[e]),(0,Z.jsx)(`span`,{"data-testid":`suggestion`,className:`text-[15px] font-normal leading-5 text-white text-center cursor-pointer`,children:n(e.label)})]})}function lo({suggestions:e,onSuggestionClick:t}){return(0,Z.jsx)(`div`,{"data-testid":`suggestions`,className:`grid grid-cols-2 gap-5 max-w-fit`,children:e.map((e,n)=>(0,Z.jsx)(co,{suggestion:e,onClick:t},n))})}var uo=N.SUGGESTIONS$HACKER_NEWS,fo=`Please write a bash script which displays the top story on Hacker News. It should show the title, the link, and the number of points.
5
5
  The script should only use tools that are widely available on unix systems, like curl and grep.`,po=N.SUGGESTIONS$HELLO_WORLD,mo=`I want to create a Hello World app in Javascript that:
@@ -20,7 +20,7 @@ This should be a client-only app with no backend. The list should persist in loc
20
20
  `)}`,h=p.length>0?`${r}\n\n${m}`:r,g=w({conversationId:z,text:r,content:h,imageUrls:u,fileUrls:p,timestamp:d});A(),n(``);try{await _(Ie(h,u,p,d))}catch(e){T(g,e instanceof Error?e.message:O(N.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))}};X.useEffect(()=>{if(B.current&&k.current){let{scrollHeight:e,scrollTop:t}=B.current,n=k.current,r=n.scrollHeight-e;r>0&&(n.scrollTop=t+r),B.current=null;return}P&&A()},[v.length,Te,he,A]);let Ne=X.useRef(be);X.useEffect(()=>{Ne.current=be}),X.useEffect(()=>{let e=k.current;e&&Ne.current(e)},[v.length,ve]);let Pe={scrollRef:k,autoScroll:P,setAutoScroll:F,scrollDomToBottom:A,hitBottom:M,setHitBottom:ee,onChatBodyScroll:j},Fe=I===L.LOADING||I===L.INIT,Le=I===L.STOPPED,Re=I===L.PAUSED,Be=le({isPausing:Re,isTask:f,taskStatus:p,isStartingStatus:Fe,isStopStatus:Le,curAgentState:I}),Ve=ae({isPausing:Re,isTask:f,taskStatus:p,taskDetail:m,isStartingStatus:Fe,isStopStatus:Le,curAgentState:I,errorMessage:a,t:O});return(0,Z.jsx)(Oe,{children:(0,Z.jsx)(Ke,{value:Pe,children:(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between px-4`,"data-testid":`chat-interface`,children:[!S&&!Te&&!C&&!Ee&&!je&&!h&&x===0&&!ce&&!fe&&(0,Z.jsx)(vo,{onSuggestionsClick:e=>n(e)}),(0,Z.jsxs)(`div`,{ref:k,"data-testid":`chat-scroll-container`,onScroll:e=>{j(e.currentTarget),be(e.currentTarget)},onWheel:xe,className:`custom-scrollbar-always flex min-h-0 grow flex-col gap-2 overflow-x-hidden overflow-y-auto px-0 pt-4 pb-8 md:px-4`,children:[je&&Ae&&(0,Z.jsx)(To,{}),je&&!Ae&&(0,Z.jsx)(`div`,{className:`flex justify-center`,"data-testid":`loading-spinner`,children:(0,Z.jsx)(Lt,{size:`small`})}),_e&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-sm text-neutral-400`,"data-testid":`loading-older-events`,children:[(0,Z.jsx)(Lt,{size:`small`}),(0,Z.jsx)(`span`,{children:O(N.CHAT_INTERFACE$FETCHING_OLDER_MESSAGES)})]}),(0,Z.jsx)(Se,{conversationId:z,anchorEventId:null}),ke&&v.length>0&&(0,Z.jsx)(Ue,{messages:v,allEvents:y}),(0,Z.jsx)(Po,{}),(0,Z.jsx)(ga,{conversationId:z})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-[6px] pb-4`,children:[(0,Z.jsx)(No,{conversationId:z}),(0,Z.jsx)(ha,{conversationId:z}),a&&(0,Z.jsx)(Do,{message:a,code:o,classification:s,onDismiss:c,onRetry:a===`Unable to connect to server`?()=>g?.reconnect():void 0,onReauth:ua(o)?()=>d(`/settings/agents`):void 0}),fe&&!ce&&(0,Z.jsx)(Wr,{}),ce?(0,Z.jsxs)(`div`,{"data-testid":`archived-conversation-banner`,className:`mx-1 px-4 py-3 rounded-lg bg-[var(--oh-surface)] border border-[var(--oh-border-subtle)]`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold text-[var(--oh-foreground)]`,children:O(se===`ERROR`?N.CHAT_INTERFACE$ERROR_SANDBOX_TITLE:N.CHAT_INTERFACE$ARCHIVED_SANDBOX_TITLE)}),(0,Z.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] mt-0.5`,children:O(se===`ERROR`?N.CHAT_INTERFACE$ERROR_SANDBOX_DESCRIPTION:N.CHAT_INTERFACE$ARCHIVED_SANDBOX_DESCRIPTION)})]}):(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-full mb-1 z-20`,children:(0,Z.jsxs)(`div`,{className:`flex justify-between relative`,children:[(0,Z.jsxs)(`div`,{className:`flex items-end gap-1 pointer-events-auto`,children:[(0,Z.jsx)(Lo,{}),Fe&&(0,Z.jsx)(zo,{statusColor:Be,status:Ve})]}),M?(I===L.RUNNING||re)&&(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-9 bottom-0 flex justify-center`,children:(0,Z.jsx)(so,{events:y})}):(0,Z.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,Z.jsx)(So,{onClick:A})})]})}),(0,Z.jsx)(Wa,{onSubmit:Me,disabled:ne||fe,hasStartedConversation:De})]})]})]})})})}function Uo(e){return e?e.replace(/\/+$/,``).split(`/`).pop()||e:null}function Wo(){let{conversationId:e}=J(),{data:t}=Y();return{workspaceName:Uo((e?hn(e):null)?.selected_workspace??t?.selected_workspace??null)}}function Go(){let{data:e}=Y(),{repositoryInfo:t}=vr(),{data:n}=za(),r=e?.selected_repository||t?.selectedRepository,i=e?.git_provider||t?.gitProvider,a=e?.selected_branch||t?.selectedBranch,o=r||n?.repository||null,s=i||n?.provider||null;return{repository:o,provider:s,branch:a||n?.branch||null,isConnected:!!(o&&s)}}function Ko(e){return e.startsWith(`/`)?e:`/${e}`}async function qo(e,t,n,r){let i=ve().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:Ko(r.path)});return Pt({backend:i,method:`GET`,hostOverride:_e(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new It(B({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function Jo(e){return x(e,404)||f(e)&&e.response?.status===404}var Yo=class{static async getGitChanges(e,t,n,r){let i=ve().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,Ko(r));let n=await Pt({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:Kn(String(e.status)),path:e.path}))}let a=await new It(B({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:Kn(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await qo(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(Jo(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await qo(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:Kn(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await qo(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=ve().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,Ko(r));let n=await Pt({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new It(B({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}},Xo=()=>{let{conversationId:e}=J(),{data:t}=Y(),[n,r]=X.useState([]),i=X.useRef(null),a=Ni(),o=t?.conversation_url,s=t?.session_api_key,c=t?.selected_repository,l=t?.workspace?.working_dir?.trim(),u=X.useMemo(()=>Pi(c,l),[c,l]),d=_({queryKey:[`file_changes`,e,o,s,u],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return Yo.getGitChanges(e,o,s,u)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:a&&!!e,meta:{disableToast:!0}});return X.useEffect(()=>{if(!d.isFetching&&d.isSuccess&&d.data){let e=d.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[d.isFetching,d.isSuccess,d.data]),{data:n,isLoading:d.isLoading,isFetching:d.isFetching,isSuccess:d.isSuccess,isError:d.isError,error:d.error,refetch:d.refetch}};function Zo(e){let t=0,n=0,r=!1;for(let i of e.split(`
21
21
  `)){if(i.startsWith(`diff --git`)||i.startsWith(`index `)){r=!1;continue}if(i.startsWith(`@@`)){r=!0;continue}!r&&(i.startsWith(`---`)||i.startsWith(`+++`))||r&&(i.startsWith(`+`)?t+=1:i.startsWith(`-`)&&(n+=1))}return{additions:t,deletions:n}}function Qo(e,t){let n=e.length===0?[]:e.split(`
22
22
  `),r=t.length===0?[]:t.split(`
23
- `);if(n.length===0)return{additions:r.length,deletions:0};if(r.length===0)return{additions:0,deletions:n.length};let i=0,a=0,o=0,s=0;for(;o<n.length||s<r.length;){let e=n[o],t=r[s];if(o<n.length&&s<r.length&&e===t){o+=1,s+=1;continue}if(s<r.length&&(o>=n.length||!n.slice(o).includes(t))){i+=1,s+=1;continue}o<n.length&&(a+=1,o+=1)}return{additions:i,deletions:a}}function $o(e){return typeof e.diff==`string`&&e.diff.length>0?Zo(e.diff):Qo(e.original??``,e.modified??``)}function es(e){return e.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}function ts(){let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),{data:r,isLoading:i,isSuccess:a,isError:o}=Xo(),s=t?.conversation_url,c=t?.session_api_key,l=(0,X.useMemo)(()=>Pi(t?.selected_repository,t?.workspace?.working_dir?.trim()),[t?.selected_repository,t?.workspace?.working_dir]),u=g({queries:(0,X.useMemo)(()=>(r??[]).filter(e=>e.status!==`D`),[r]).map(t=>({queryKey:[`conversation_overview_file_diff`,e,s,c,l,t.path],queryFn:async()=>Yo.getGitChangeDiff(e,s,c,`${l}/${t.path}`),enabled:n&&!!e&&a&&!!t.path,staleTime:1e3*60*5,meta:{disableToast:!0}}))}),d=u.some(e=>e.isLoading),f=es(u.flatMap(e=>e.data?[$o(e.data)]:[]));return{additions:f.additions,deletions:f.deletions,changeCount:r?.length??0,isLoading:i||d,isError:o}}var ns=(0,X.createContext)(null);function rs({children:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(0),s=(0,X.useCallback)((e,t)=>{n(e),i(!!t?.openAdd),o(0)},[]),c=(0,X.useCallback)(()=>{n(null),i(!1),o(0)},[]),l=(0,X.useCallback)(()=>{o(e=>e+1)},[]),u=(0,X.useMemo)(()=>({section:t,openAdd:r,addRequestKey:a,openSection:s,closeDrawer:c,requestAdd:l}),[a,c,r,s,l,t]);return(0,Z.jsx)(ns.Provider,{value:u,children:e})}function is(){let e=(0,X.useContext)(ns);if(!e)throw Error(`useConversationOverviewDrawer must be used within ConversationOverviewDrawerProvider`);return e}function as(){return(0,X.useContext)(ns)}var os=e(r(),1),ss=`!w-auto whitespace-nowrap`;function cs({anchorRef:e,onClose:t,gitProvider:n,testIdPrefix:r=`conversation-git-actions`}){let{t:i}=b(`openhands`),a=Rn(t),o=U(e=>e.setMessageToSend),[s,c]=(0,X.useState)();return(0,X.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{let e=t.getBoundingClientRect();c({position:`fixed`,top:e.bottom+4,right:window.innerWidth-e.right,zIndex:50})};return n(),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]),s?os.createPortal((0,Z.jsxs)(Mt,{ref:a,testId:`${r}-menu`,theme:`popover`,style:s,className:`w-max min-w-[8rem]`,children:[(0,Z.jsx)(V,{testId:`${r}-commit`,onClick:()=>{o(ce()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0}),text:i(N.DIFF_VIEWER$COMMITS)})}),(0,Z.jsx)(V,{testId:`${r}-pull`,onClick:()=>{o(re()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Er,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PULL)})}),(0,Z.jsx)(V,{testId:`${r}-push`,onClick:()=>{o(ie(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(hr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PUSH)})}),(0,Z.jsx)(V,{testId:`${r}-create-pr`,onClick:()=>{o(me(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Kr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_PR)})}),(0,Z.jsx)(V,{testId:`${r}-create-new-branch`,onClick:()=>{o(de()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(dr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_NEW_BRANCH)})})]}),document.body):null}var ls=R(`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer border-0 bg-transparent text-left`),us=`size-4 shrink-0 text-[var(--oh-muted)]`,ds=`conversation-overview-diffs-git-action`,fs=R(ds,`absolute inset-0 inline-flex items-center justify-center`,`rounded-md text-[var(--oh-muted)] transition-opacity`,`hover:bg-white/10 hover:text-[var(--oh-foreground)]`),ps=R(`flex items-center rounded-md transition-colors`,`hover:bg-white/5`,`has-[.${ds}:hover]:bg-transparent`),ms=R(`pointer-events-none invisible opacity-0`,`group-hover/diffstats:pointer-events-auto group-hover/diffstats:visible group-hover/diffstats:opacity-100`,`group-focus-within/diffstats:pointer-events-auto group-focus-within/diffstats:visible group-focus-within/diffstats:opacity-100`);function hs(){let{t:e}=b(`openhands`),{navigateToChanges:t}=mi(),n=as(),{data:r}=Y(),{additions:i,deletions:a,isLoading:o}=ts(),s=r?.git_provider??`github`,[c,l]=(0,X.useState)(!1),u=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!c)return;let e=e=>{e.key===`Escape`&&l(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,Z.jsxs)(`li`,{className:ps,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-diffs`,"aria-label":e(N.CONVERSATION$OVERVIEW_OPEN_CHANGES),onClick:()=>{n?.closeDrawer(),t()},className:ls,children:[(0,Z.jsx)(dt,{className:us,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.COMMON$CHANGES)})]}),(0,Z.jsx)(`div`,{className:`group/diffstats relative mr-2 flex h-6 min-w-6 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:R(`flex items-center gap-1.5 text-sm tabular-nums transition-opacity`,c?`opacity-0`:`group-hover/diffstats:opacity-0 group-focus-within/diffstats:opacity-0`),children:[(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-additions`,style:{color:M},children:e(N.CONVERSATION$OVERVIEW_DIFF_ADDITIONS,{count:i.toLocaleString()})}),(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-deletions`,style:{color:ne},children:e(N.CONVERSATION$OVERVIEW_DIFF_DELETIONS,{count:a.toLocaleString()})})]}),(0,Z.jsx)(`button`,{ref:u,type:`button`,"data-testid":`conversation-overview-diffs-git-action`,"aria-label":e(N.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS),"aria-expanded":c,"aria-haspopup":`menu`,onClick:e=>{e.stopPropagation(),l(e=>!e)},className:R(fs,!c&&ms,c&&`pointer-events-auto visible opacity-100 text-[var(--oh-foreground)]`),children:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0})}),c?(0,Z.jsx)(cs,{anchorRef:u,gitProvider:s,testIdPrefix:`conversation-overview-diffs-git`,onClose:()=>l(!1)}):null]})})]})}var gs=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.13832 8.76476C8.25957 8.17949 9.52697 7.9727 10.7515 8.14436L14.9025 2.52826L21.4717 9.09737L15.8555 13.2484C16.0272 14.4729 15.8204 15.7403 15.2351 16.8616C15.1872 16.9535 15.1366 17.0444 15.0836 17.1343C14.8318 17.5605 14.5228 17.9624 14.1566 18.3286L10.4443 14.6163L4.75207 20.3085H3.69141V19.2478L9.38361 13.5556L5.6713 9.84332C6.03755 9.47708 6.43936 9.16808 6.86562 8.91632C6.95547 8.86326 7.04641 8.81274 7.13832 8.76476ZM15.0735 4.82054L19.1794 8.92641L14.2461 12.5727L14.3701 13.4567C14.492 14.3266 14.3596 15.2233 13.9758 16.0265L7.97338 10.0241C8.77665 9.64035 9.67335 9.50789 10.5432 9.62984L11.4272 9.75376L15.0735 4.82054Z`,fill:`currentColor`})}),_s=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{d:`M10.9706 10.1586C10.2819 10.0621 9.56905 10.1784 8.93842 10.5075C8.88672 10.5345 8.83557 10.5629 8.78504 10.5928C8.54529 10.7344 8.3193 10.9082 8.11331 11.1142L9.83702 12.8372L7.00054 15.75L7 17H8.25064L11.1628 14.1632L12.8857 15.8865C13.0917 15.6805 13.2655 15.4545 13.4071 15.2147C13.437 15.1642 13.4654 15.1131 13.4924 15.0614C13.8215 14.4308 13.9378 13.718 13.8413 13.0293L17 10.6946L13.3053 7L10.9706 10.1586Z`,fill:`currentColor`})}),Q={automations:`automations`,skills:`skills`,mcp:`mcp`,secrets:`secrets`,pull_requests:`pull_requests`,issues:`issues`},vs={[W.workspace]:{section:W.workspace,icon:pt,i18nKey:N.CONVERSATION$OVERVIEW_WORKSPACE}},ys=[{part:H.changes,icon:dt,i18nKey:N.COMMON$CHANGES,opensChanges:!0},{part:H.repository,icon:Xe,i18nKey:N.CONVERSATION$REPOSITORY},{part:H.branch,icon:at,i18nKey:N.CONVERSATION$BRANCH},{part:H.commits,icon:lt,i18nKey:N.DIFF_VIEWER$COMMITS,opensCommits:!0},{part:H.pull_requests,icon:Kr,i18nKey:N.CONVERSATION$OVERVIEW_PULL_REQUESTS,drawerSection:Q.pull_requests}];function bs({testId:e,pinned:t,pinnedLabel:n,unpinnedLabel:r,onClick:i}){return(0,Z.jsx)(`button`,{type:`button`,"data-testid":e,className:R(`flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white`,Zt,`hover:bg-white/10`),"aria-pressed":t,"aria-label":t?n:r,onClick:i,children:(0,Z.jsx)(`span`,{className:R(`ml-auto overflow-hidden`,Qt),"aria-hidden":!0,children:t?(0,Z.jsx)(_s,{className:`size-4`,width:16,height:16}):(0,Z.jsx)(gs,{className:`size-4`,width:16,height:16})})})}function xs({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Rn(t,n),[a,o]=(0,X.useState)(),{t:s}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedOverviewSections:u,setUnpinnedOverviewGitParts:d}=sn(c),{navigateToChanges:f,navigateToCommits:p}=mi(),m=as();(0,X.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let h=e=>{if(e.opensChanges){m?.closeDrawer(),f(),t();return}if(e.opensCommits){m?.closeDrawer(),p(),t();return}e.drawerSection&&(m?.openSection(e.drawerSection),t())},g=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewSections??[];if(n.includes(e)){u?.(n.filter(t=>t!==e));return}u?.([...n,e])},_=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewGitParts??[];if(n.includes(e)){d?.(n.filter(t=>t!==e));return}d?.([...n,e])};if(!e)return null;let v=!!(r?.current&&a),y=fn(W.git,l.unpinnedOverviewSections??[]),x=s(N.CONVERSATION$UNPIN_OVERVIEW_SECTION),S=s(N.CONVERSATION$PIN_OVERVIEW_SECTION),C=({key:e,testIdOpen:t,testIdPin:n,icon:r,label:i,pinned:a,isActionable:o,indent:s=!1,onOpen:c,onPinToggle:l})=>{let u=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:(0,Z.jsx)(r,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:i})]});return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsxs)(`div`,{className:R(`group flex h-[30px] w-full min-w-0 items-stretch rounded hover:bg-[var(--oh-interactive-hover)]`,s&&`pl-4`),children:[o?(0,Z.jsx)(`button`,{type:`button`,"data-testid":t,className:R(`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white`,Zt),onClick:c,children:u}):(0,Z.jsx)(`div`,{"data-testid":t,className:R(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Zt),children:u}),(0,Z.jsx)(bs,{testId:n,pinned:a,pinnedLabel:x,unpinnedLabel:S,onClick:l})]})},e)},w=e=>{if(e===W.git)return null;let t=vs[e];return C({key:e,testIdOpen:`conversation-overview-menu-open-${e}`,testIdPin:`conversation-overview-menu-pin-${e}`,icon:t.icon,label:s(t.i18nKey),pinned:fn(e,l.unpinnedOverviewSections??[]),isActionable:!1,onPinToggle:t=>g(e,t)})},T=(0,Z.jsxs)(Mt,{ref:i,testId:`conversation-overview-context-menu`,theme:v?`popover`:`default`,position:v?`none`:`bottom`,alignment:v?`none`:`right`,spacing:v?`none`:`default`,className:R(`z-[9999] w-fit`,v?`mt-0`:`mt-2`),children:[cn.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-${t}`,inset:`menu`}):null,e.sections.map(e=>w(e))]},e.sections.join(`-`))),(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-git`,inset:`menu`}),C({key:W.git,testIdOpen:`conversation-overview-menu-open-${W.git}`,testIdPin:`conversation-overview-menu-pin-${W.git}`,icon:at,label:s(N.CONVERSATION$OVERVIEW_GIT),pinned:y,isActionable:!1,onPinToggle:e=>g(W.git,e)}),ys.map(e=>C({key:e.part,testIdOpen:`conversation-overview-menu-open-git-${e.part}`,testIdPin:`conversation-overview-menu-pin-git-${e.part}`,icon:e.icon,label:s(e.i18nKey),pinned:ln(e.part,l.unpinnedOverviewGitParts??[]),isActionable:!!(e.drawerSection||e.opensCommits||e.opensChanges),indent:!0,onOpen:()=>h(e),onPinToggle:t=>_(e.part,t)}))]});return v&&a&&typeof document<`u`?os.createPortal((0,Z.jsx)(`div`,{style:a,children:T}),document.body):T}var Ss={github:[`GITHUB_TOKEN`,`GH_TOKEN`,`github`],gitlab:[`GITLAB_TOKEN`,`GL_TOKEN`,`gitlab`],bitbucket:[`BITBUCKET_TOKEN`,`bitbucket`],forgejo:[`FORGEJO_TOKEN`,`forgejo`]},Cs=30;async function ws(e){if(ve().backend.kind!==`local`)return null;let t=Ss[e]??[];if(t.length===0)return null;let n=await rr.getSecrets(),r=new Set(n.map(e=>e.name)),i=t.find(e=>r.has(e));if(!i)return null;try{return await new Nt(B()).getSecret(i)}catch{return null}}function Ts(e,t,n){let r=z(t);switch(t){case`gitlab`:return`${r}/${n}/-/issues/${e}`;case`bitbucket`:return`${r}/${n}/issues/${e}`;case`forgejo`:return`${r}/${n}/issues/${e}`;default:return`${r}/${n}/issues/${e}`}}function Es(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/issues`;case`bitbucket`:return`${n}/${t}/issues`;case`forgejo`:return`${n}/${t}/issues`;default:return`${n}/${t}/issues`}}function Ds(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/merge_requests`;case`bitbucket`:return`${n}/${t}/pull-requests`;case`forgejo`:return`${n}/${t}/pulls`;default:return`${n}/${t}/pulls`}}async function Os(e,t){let n={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`https://api.github.com${e}`,{headers:n});if(!r.ok)throw Error(`GitHub API ${r.status}`);return r.json()}async function ks(e,t){let n={Accept:`application/json`};t&&(n[`PRIVATE-TOKEN`]=t);let r=await fetch(`https://gitlab.com/api/v4${e}`,{headers:n});if(!r.ok)throw Error(`GitLab API ${r.status}`);return r.json()}var As=class{static constructIssuesListUrl=Es;static constructPullRequestsListUrl=Ds;static async listPullRequests(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/merge_requests?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/pulls?state=open&per_page=${Cs}`,n)).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||pe(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}static async listIssues(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/issues?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/issues?state=open&per_page=${Cs}`,n)).filter(e=>!e.pull_request).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||Ts(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}};function js(e,t){return _({queryKey:[`repository-pull-requests`,t,e],queryFn:()=>As.listPullRequests(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}function Ms(e,t){return _({queryKey:[`repository-issues`,t,e],queryFn:()=>As.listIssues(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}var Ns=()=>{let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),s=X.useMemo(()=>Pi(a,o),[a,o]),c=_({queryKey:[`git_commits`,e,r,i,s],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return Yo.getGitCommits(r,i,s,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:c.data?.commits??[],hasMore:c.data?.hasMore??!1,isUnsupported:c.data===null,isLoading:c.isLoading,isFetching:c.isFetching,isSuccess:c.isSuccess,isError:c.isError}},Ps=`size-4 shrink-0 text-[var(--oh-muted)]`,Fs=R(`size-3.5 shrink-0 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`),Is=`-`;function Ls(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{state:n}=sn(t),{navigateToCommits:r}=mi(),i=as(),{data:a}=Bt(),{repository:o,provider:s,branch:c,isConnected:l}=Go(),u=ln(H.repository,n.unpinnedOverviewGitParts??[]),d=ln(H.branch,n.unpinnedOverviewGitParts??[]),f=ln(H.commits,n.unpinnedOverviewGitParts??[]),p=ln(H.pull_requests,n.unpinnedOverviewGitParts??[]),m=js(p?o:null,p?s:null),h=Ns();if(!l||!o||!s||!u&&!d&&!f&&!p)return null;let g=a?.provider_tokens_set?.[s]??null,_=oe(s,o,g),v=c?ue(s,o,c,g):null,y=m.data?.length??null,x=h.isUnsupported?null:h.commits.length,S=x!==null&&x>0?h.hasMore?`${x}+`:String(x):Is,C=()=>{i?.openSection(Q.pull_requests)},w=()=>{i?.closeDrawer(),r()},T=u||d,E=f||p;return(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-section`,children:[T?(0,Z.jsxs)(`div`,{className:`px-2 pb-1`,children:[u?(0,Z.jsxs)(`a`,{href:_,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-repo`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(tn,{gitProvider:s,className:Ps}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:o}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):null,d?c&&v?(0,Z.jsxs)(`a`,{href:v,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-branch`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Bn,{size:14,className:`shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:c}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-branch`,className:`flex min-w-0 items-center gap-2 px-2 py-1.5`,children:[(0,Z.jsx)(at,{className:`size-3.5 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:R(`text-sm`,c?`text-[var(--oh-foreground)]`:`text-[var(--oh-muted)]`),children:c||e(N.CONVERSATION$OVERVIEW_NONE)})]}):null]}):null,E?(0,Z.jsxs)(`ul`,{className:`px-2`,children:[f?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-commits`,onClick:w,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(lt,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.DIFF_VIEWER$COMMITS)}),h.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-commits-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:S})]})}):null,p?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-pull-requests`,onClick:C,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Kr,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.CONVERSATION$OVERVIEW_PULL_REQUESTS)}),m.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-pull-requests-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:y!==null&&y>0?y:Is})]})}):null]}):null]})}var Rs=R(`w-full max-w-[240px] rounded-xl border border-[var(--oh-border)]`,`bg-[var(--oh-surface)] pb-1`),zs=R(`flex items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),Bs=`size-4 shrink-0 text-[var(--oh-muted)]`;function Vs({icon:e,label:t,value:n,testId:r}){return(0,Z.jsxs)(`li`,{"data-testid":r,className:zs,children:[e,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:t}),(0,Z.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-right text-sm text-[var(--oh-muted)]`,children:n})]})}function Hs(){return(0,Z.jsx)(`div`,{className:`px-1`,children:(0,Z.jsx)(rn,{inset:`menu`})})}function Us(){let{t:e}=b(`openhands`),t=Wo(),{conversationId:n}=J(),{state:r}=sn(n),{isConnected:i}=Go(),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(null),c=e=>fn(e,r.unpinnedOverviewSections??[]),l=ln(H.changes,r.unpinnedOverviewGitParts??[]),u=c(W.git)&&(l||i),d=cn.flatMap(e=>e.sections.filter(e=>c(e))),f=[];u&&f.push({kind:`git`,key:`git`}),d.length>0&&f.push({kind:`sections`,key:d.join(`-`),sections:d});let p=n=>{switch(n){case W.workspace:return(0,Z.jsx)(Vs,{testId:`conversation-overview-workspace`,icon:(0,Z.jsx)(pt,{className:Bs}),label:e(N.CONVERSATION$OVERVIEW_WORKSPACE),value:t.workspaceName??e(N.CONVERSATION$OVERVIEW_NONE)},n);case W.git:return null;default:return n}};return(0,Z.jsxs)(`aside`,{"data-testid":`conversation-overview-panel`,"aria-label":e(N.CONVERSATION$OVERVIEW),className:Rs,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-0.5 pt-2.5`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-[var(--oh-muted)]`,children:e(N.CONVERSATION$OVERVIEW)}),(0,Z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Z.jsx)(Hn,{ref:s,testId:`conversation-overview-ellipsis`,onClick:()=>o(e=>!e),ariaLabel:e(N.COMMON$MORE_OPTIONS)}),(0,Z.jsx)(xs,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:s,anchorRef:s})]})]}),f.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(Hs,{}):null,e.kind===`git`?(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-block`,children:[l?(0,Z.jsx)(`ul`,{className:`px-2`,children:(0,Z.jsx)(hs,{})}):null,i?(0,Z.jsx)(Ls,{}):null]}):(0,Z.jsx)(`ul`,{className:`px-2`,children:e.sections.map(e=>p(e))})]},e.key))]})}var Ws={duration:.2,ease:`easeInOut`};function Gs(e){return e>=596}var Ks=typeof window<`u`?X.useLayoutEffect:X.useEffect;function qs(e,t){let[n,r]=(0,X.useState)(!1);return Ks(()=>{if(!t){r(!1);return}let n=e.current;if(!n)return;let i=()=>{r(Gs(n.clientWidth))};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),()=>a.disconnect()},[e,t]),n}var Js=`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0`;function Ys({isRightPanelShown:e}){let t=Ii(),n=!De()&&!0,r=U(e=>e.isOverviewPanelShown),a=(0,X.useRef)(null),o=!t&&r,s=qs(a,o);return(0,Z.jsxs)(`div`,{ref:a,className:`flex h-full min-h-0 w-full overflow-hidden`,children:[(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 justify-center overflow-hidden`,children:(0,Z.jsx)(`div`,{className:Js,children:(0,Z.jsx)(Ho,{})})}),(0,Z.jsx)(i,{children:o&&s?(0,Z.jsx)(Qe.div,{"data-testid":`conversation-overview-column`,initial:n?{width:0,opacity:0}:!1,animate:{width:268,opacity:1},exit:n?{width:0,opacity:0}:{opacity:0},transition:Ws,className:`flex shrink-0 flex-col items-start overflow-hidden pt-4 pl-3 pr-4`,children:(0,Z.jsx)(`div`,{className:`w-full shrink-0`,style:{width:268},children:(0,Z.jsx)(Us,{})})},`conversation-overview-column`):null})]})}function Xs({children:e}){return(0,Z.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Zs({children:e}){return(0,Z.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Qs({children:e}){return(0,Z.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}function $s({className:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`div`,{className:R(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,Z.jsx)(vt,{className:`h-8 w-8 shrink-0 animate-spin text-tertiary-light`,"aria-hidden":!0}),(0,Z.jsx)(Ve,{as:`p`,role:`status`,"aria-live":`polite`,className:`block w-full text-center text-base font-normal leading-5`,duration:1,spread:2,children:t(N.HOME$LOADING)})]})}function ec({children:e,onReady:t}){return(0,X.useLayoutEffect)(()=>{t()},[t]),e}function tc({onPending:e}){return(0,X.useLayoutEffect)(()=>{e()},[e]),(0,Z.jsx)($s,{})}var nc={duration:.35,ease:`easeInOut`};function rc({showAgentLoading:e,tabKey:t,children:n}){let r=De(),[a,o]=(0,X.useState)(!1);(0,X.useLayoutEffect)(()=>{o(!1)},[t]);let s=(0,X.useCallback)(()=>{o(!0)},[]),c=(0,X.useCallback)(()=>{o(!1)},[]),l=e||a;return r?(0,Z.jsx)(`div`,{className:`relative h-full w-full overflow-hidden`,children:l?(0,Z.jsx)($s,{}):(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}):(0,Z.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden`,children:[(0,Z.jsx)(Qe.div,{className:`absolute inset-0 h-full w-full`,initial:!1,animate:{opacity:+!l},transition:nc,"aria-hidden":l,children:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}),(0,Z.jsx)(i,{children:l?(0,Z.jsx)(Qe.div,{className:`absolute inset-0 z-10 h-full w-full`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:nc,children:(0,Z.jsx)($s,{})},`conversation-tab-loading-overlay`):null})]})}var ic=(0,X.lazy)(()=>a(()=>import(`./files-tab-B_6t8ljw.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),ac=(0,X.lazy)(()=>a(()=>import(`./commits-tab-DhQW8CXi.js`),__vite__mapDeps([74,1,2,75,7,5,76,6,20,77,8,9,4,10,11,12,13,14,3,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,103,59,104,105,106,107,108,109,110,111,61,68,69,112,113,114,115,116,117,118,119,120,121,122,73,123,124,70,125]))),oc=(0,X.lazy)(()=>a(()=>import(`./browser-tab-CmYT4j_r.js`),__vite__mapDeps([126,2,1,18,9,4,6,5,10,11,12,13,14,3,15,7,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,127,128,70]))),sc=(0,X.lazy)(()=>a(()=>import(`./planner-tab-CXph_C9F.js`),__vite__mapDeps([129,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,130,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,103,59,104,105,106,107,108,109,110,111,61,68,69,112,113,114,115,116,117,118,119,120,121,122,73,123,124,70]))),cc=(0,X.lazy)(()=>a(()=>import(`./task-list-tab-BLKF_x9f.js`),__vite__mapDeps([131,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,70]))),lc=(0,X.lazy)(()=>a(()=>import(`./usage-tab-Drd3O006.js`),__vite__mapDeps([132,1,2,9,4,6,5,10,11,12,13,79,7,99,18,14,3,15,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,133,44,105,78,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,56,100,101,102,42,43,103,59,104,106,107,108,109,110,111,46,61,47,68,69,112,113,114,115,55,116,117,118,119,120,121,122,73,123,53,124,58,70]))),uc=(0,X.lazy)(()=>a(()=>import(`./terminal-Ckbnqb23.js`),__vite__mapDeps([134,1,2,135,136,76,6,5,20,18,9,4,10,11,12,13,14,3,15,7,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,78,79,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,56,100,101,102,42,43,103,59,44,104,105,106,107,108,109,110,111,46,61,47,68,69,112,113,114,115,55,116,117,118,119,120,121,122,73,123,53,124,58,70]))),dc={tasklist:{component:cc},files:{component:ic},commits:{component:ac},browser:{component:oc},terminal:{component:uc},planner:{component:sc},usage:{component:lc}};function fc(){let{selectedTab:e,shouldShownAgentLoading:t}=U(),{conversationId:n}=J(),r=(0,X.useMemo)(()=>dc[e]??dc.files,[e]).component,i=e===`terminal`?`${e}-${n}`:e??`files`;return(0,Z.jsx)(Zs,{children:(0,Z.jsx)(Qs,{children:(0,Z.jsx)(rc,{showAgentLoading:t,tabKey:i,children:(0,Z.jsx)(Xs,{children:(0,Z.jsx)(r,{})},i)})})})}var pc=()=>{let e=d(),t=Qr(e=>e.removeErrorMessage);return h({mutationKey:[`start-conversation`],mutationFn:async e=>wn(e.conversationId),onMutate:async()=>(await e.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:e.getQueryData([`user`,`conversations`])}),onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{xn(e,r.conversationId)},onSuccess:(n,r)=>{t(),On(e,r.conversationId,k.RUNNING)}})},mc=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM10 9H14A1 1 0 0 1 15 10V14A1 1 0 0 1 14 15H10A1 1 0 0 1 9 14V10A1 1 0 0 1 10 9Z`,fill:`currentColor`})}),hc=e=>(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`}),(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 7.49998L10.1655 6.87598L16.9155 11.376V12.624L10.1655 17.124L9 16.5V7.49998ZM10.5 8.90098V15.099L15.1485 12L10.5 8.90098Z`,fill:`currentColor`})]});function gc({icon:e,text:t,onClick:n,testId:r}){return(0,Z.jsx)(V,{testId:r,onClick:n,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:e})]})})}function _c({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=Yr(),{isTask:i,taskStatus:a,taskDetail:o}=vr(),{t:s}=b(`openhands`),{errorMessage:c}=Qr(),l=r===L.LOADING||r===L.INIT,u=ee(t)||A(t),d=le({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=ae({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,Z.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(Ro,{className:`w-6 h-6 shrink-0`,color:d}),(0,Z.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function vc({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1,ignoreOutsideClickRef:s}){let{t:c}=b(`openhands`),l=Rn(e,s),u=he(r),d=A(r),f=u||d;return(0,Z.jsxs)(Mt,{ref:l,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:R(`left-2 w-fit min-w-42`,a),children:[(0,Z.jsx)(_c,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rn,{inset:`menu`}),u&&t&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(mc,{width:18,height:18}),text:c(N.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),d&&n&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(hc,{width:18,height:18}),text:c(N.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}function yc({isPublic:e,onToggle:t,ariaLabel:n}){return(0,Z.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,Z.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:R(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,Z.jsx)(`span`,{className:R(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function bc({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onExportTranscript:u,onDownloadConversation:d,shareUrl:f,position:p=`bottom`,anchorRef:m}){let h=Ii(),{t:g}=b(`openhands`),{backend:_}=T(),{data:v}=Y(),y=Ar(),x=Rn(e,m),S=m?.current??null,[C,w]=X.useState();X.useLayoutEffect(()=>{if(!S)return;let e=()=>{let e=S.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};p===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,w(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[S,p]);let E=!!(a||o||s),D=!!i,O=!!(r||n),k=_.kind===`cloud`?N.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:N.COMMON$STOP_CONVERSATION,A=_.kind===`cloud`&&!!c,j=v?.public||!1,M=!!S,P=(0,Z.jsxs)(Mt,{ref:x,testId:`conversation-name-context-menu`,position:p,alignment:`left`,className:R(h?`right-0 translate-x-[34%] left-auto`:``,M?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,Z.jsx)(V,{testId:`rename-button`,onClick:t,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Un,{width:16,height:16}),text:g(N.BUTTON$RENAME)})}),E&&(0,Z.jsx)(rn,{testId:`separator-tools`,inset:`menu`}),o&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-skills-button`,onClick:o,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Wn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_SKILLS)})})}),s&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-hooks-button`,onClick:s,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Sr,{width:16,height:16,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_HOOKS)})})}),a&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-agent-tools-button`,onClick:a,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(nn,{width:16,height:16}),text:g(N.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),u&&(0,Z.jsx)(V,{testId:`export-transcript-button`,onClick:u,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$EXPORT_TRANSCRIPT)})}),d&&(0,Z.jsx)(V,{testId:`download-trajectory-button`,onClick:d,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(D||O)&&(0,Z.jsx)(rn,{testId:`separator-info-control`,inset:`menu`}),i&&(0,Z.jsx)(V,{testId:`display-cost-button`,onClick:i,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(ot,{size:16}),text:g(N.BUTTON$DISPLAY_COST)})}),A&&c&&(0,Z.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,Z.jsx)(ut,{size:16})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:g(N.CONVERSATION$SHARE_PUBLICLY)}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[j&&f&&l&&(0,Z.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:l,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$COPY_TO_CLIPBOARD),children:(0,Z.jsx)(Qn,{width:14,height:14})}),(0,Z.jsx)(`a`,{"data-testid":`open-share-link-button`,href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$OPEN_IN_NEW_TAB),children:(0,Z.jsx)(it,{size:14,"aria-hidden":!0})})]}),(0,Z.jsx)(yc,{isPublic:j,onToggle:c,ariaLabel:g(N.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`stop-button`,onClick:r,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)($t,{width:16,height:16}),text:g(k)})})}),n&&(0,Z.jsx)(V,{testId:`delete-button`,onClick:n,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Vn,{width:16,height:16}),text:g(N.COMMON$DELETE_CONVERSATION)})})]});return M?typeof document>`u`||!C?null:os.createPortal((0,Z.jsx)(`div`,{style:C,children:P}),document.body):P}var xc=new Set([`BrowserClickAction`,`BrowserCloseTabAction`,`BrowserGetContentAction`,`BrowserGetStateAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserNavigateAction`,`BrowserScrollAction`,`BrowserSwitchTabAction`,`BrowserTypeAction`,`ExecuteBashAction`,`FileEditorAction`,`GlobAction`,`GrepAction`,`InvokeSkillAction`,`MCPToolAction`,`StrReplaceEditorAction`,`TaskAction`,`TaskTrackerAction`,`TerminalAction`,`ThinkAction`]),Sc=new Set([`BrowserObservation`,`CanvasUIObservation`,`ExecuteBashObservation`,`FileEditorObservation`,`GlobObservation`,`GrepObservation`,`InvokeSkillObservation`,`MCPToolObservation`,`StrReplaceEditorObservation`,`SwitchLLMObservation`,`TaskTrackerObservation`,`TaskObservation`,`TerminalObservation`]),Cc=e=>e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim(),wc=(e,t=100)=>e.length>t?`${e.slice(0,t)}…`:e,Tc=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()},$=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#039;`),Ec=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replace(/(!?)\[([^\]]*)\]\(\s*((?:javascript|data|vbscript):[^)]*)\)/gi,`$1\\[$2\\]($3)`).replace(/^(\s{0,3})\[([^\]]+)\]:(\s*<?(?:javascript|data|vbscript):)/gim,`$1\\[$2\\]:$3`),Dc=e=>Cc(e||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE))||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE),Oc=(e,t)=>Cc(w.t(e,t).replace(/<\/?(?:cmd|path)>/g,``)),kc=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Ac=e=>e.replace(/(?:Action|Observation)$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).trim(),jc=e=>{let t=Cc(e.summary||``);return t&&!kc(t)?t:Cc(e.tool_name)||Ac(e.action.kind)},Mc=(e,t)=>t?jc(t):Cc(e.tool_name)||Ac(e.observation.kind),Nc=e=>e.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
23
+ `);if(n.length===0)return{additions:r.length,deletions:0};if(r.length===0)return{additions:0,deletions:n.length};let i=0,a=0,o=0,s=0;for(;o<n.length||s<r.length;){let e=n[o],t=r[s];if(o<n.length&&s<r.length&&e===t){o+=1,s+=1;continue}if(s<r.length&&(o>=n.length||!n.slice(o).includes(t))){i+=1,s+=1;continue}o<n.length&&(a+=1,o+=1)}return{additions:i,deletions:a}}function $o(e){return typeof e.diff==`string`&&e.diff.length>0?Zo(e.diff):Qo(e.original??``,e.modified??``)}function es(e){return e.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}function ts(){let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),{data:r,isLoading:i,isSuccess:a,isError:o}=Xo(),s=t?.conversation_url,c=t?.session_api_key,l=(0,X.useMemo)(()=>Pi(t?.selected_repository,t?.workspace?.working_dir?.trim()),[t?.selected_repository,t?.workspace?.working_dir]),u=g({queries:(0,X.useMemo)(()=>(r??[]).filter(e=>e.status!==`D`),[r]).map(t=>({queryKey:[`conversation_overview_file_diff`,e,s,c,l,t.path],queryFn:async()=>Yo.getGitChangeDiff(e,s,c,`${l}/${t.path}`),enabled:n&&!!e&&a&&!!t.path,staleTime:1e3*60*5,meta:{disableToast:!0}}))}),d=u.some(e=>e.isLoading),f=es(u.flatMap(e=>e.data?[$o(e.data)]:[]));return{additions:f.additions,deletions:f.deletions,changeCount:r?.length??0,isLoading:i||d,isError:o}}var ns=(0,X.createContext)(null);function rs({children:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(0),s=(0,X.useCallback)((e,t)=>{n(e),i(!!t?.openAdd),o(0)},[]),c=(0,X.useCallback)(()=>{n(null),i(!1),o(0)},[]),l=(0,X.useCallback)(()=>{o(e=>e+1)},[]),u=(0,X.useMemo)(()=>({section:t,openAdd:r,addRequestKey:a,openSection:s,closeDrawer:c,requestAdd:l}),[a,c,r,s,l,t]);return(0,Z.jsx)(ns.Provider,{value:u,children:e})}function is(){let e=(0,X.useContext)(ns);if(!e)throw Error(`useConversationOverviewDrawer must be used within ConversationOverviewDrawerProvider`);return e}function as(){return(0,X.useContext)(ns)}var os=e(r(),1),ss=`!w-auto whitespace-nowrap`;function cs({anchorRef:e,onClose:t,gitProvider:n,testIdPrefix:r=`conversation-git-actions`}){let{t:i}=b(`openhands`),a=Rn(t),o=U(e=>e.setMessageToSend),[s,c]=(0,X.useState)();return(0,X.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{let e=t.getBoundingClientRect();c({position:`fixed`,top:e.bottom+4,right:window.innerWidth-e.right,zIndex:50})};return n(),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]),s?os.createPortal((0,Z.jsxs)(Mt,{ref:a,testId:`${r}-menu`,theme:`popover`,style:s,className:`w-max min-w-[8rem]`,children:[(0,Z.jsx)(V,{testId:`${r}-commit`,onClick:()=>{o(ce()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0}),text:i(N.DIFF_VIEWER$COMMITS)})}),(0,Z.jsx)(V,{testId:`${r}-pull`,onClick:()=>{o(re()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Er,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PULL)})}),(0,Z.jsx)(V,{testId:`${r}-push`,onClick:()=>{o(ie(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(hr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PUSH)})}),(0,Z.jsx)(V,{testId:`${r}-create-pr`,onClick:()=>{o(me(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Kr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_PR)})}),(0,Z.jsx)(V,{testId:`${r}-create-new-branch`,onClick:()=>{o(de()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(dr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_NEW_BRANCH)})})]}),document.body):null}var ls=R(`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer border-0 bg-transparent text-left`),us=`size-4 shrink-0 text-[var(--oh-muted)]`,ds=`conversation-overview-diffs-git-action`,fs=R(ds,`absolute inset-0 inline-flex items-center justify-center`,`rounded-md text-[var(--oh-muted)] transition-opacity`,`hover:bg-white/10 hover:text-[var(--oh-foreground)]`),ps=R(`flex items-center rounded-md transition-colors`,`hover:bg-white/5`,`has-[.${ds}:hover]:bg-transparent`),ms=R(`pointer-events-none invisible opacity-0`,`group-hover/diffstats:pointer-events-auto group-hover/diffstats:visible group-hover/diffstats:opacity-100`,`group-focus-within/diffstats:pointer-events-auto group-focus-within/diffstats:visible group-focus-within/diffstats:opacity-100`);function hs(){let{t:e}=b(`openhands`),{navigateToChanges:t}=mi(),n=as(),{data:r}=Y(),{additions:i,deletions:a,isLoading:o}=ts(),s=r?.git_provider??`github`,[c,l]=(0,X.useState)(!1),u=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!c)return;let e=e=>{e.key===`Escape`&&l(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,Z.jsxs)(`li`,{className:ps,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-diffs`,"aria-label":e(N.CONVERSATION$OVERVIEW_OPEN_CHANGES),onClick:()=>{n?.closeDrawer(),t()},className:ls,children:[(0,Z.jsx)(dt,{className:us,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.COMMON$CHANGES)})]}),(0,Z.jsx)(`div`,{className:`group/diffstats relative mr-2 flex h-6 min-w-6 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:R(`flex items-center gap-1.5 text-sm tabular-nums transition-opacity`,c?`opacity-0`:`group-hover/diffstats:opacity-0 group-focus-within/diffstats:opacity-0`),children:[(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-additions`,style:{color:M},children:e(N.CONVERSATION$OVERVIEW_DIFF_ADDITIONS,{count:i.toLocaleString()})}),(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-deletions`,style:{color:ne},children:e(N.CONVERSATION$OVERVIEW_DIFF_DELETIONS,{count:a.toLocaleString()})})]}),(0,Z.jsx)(`button`,{ref:u,type:`button`,"data-testid":`conversation-overview-diffs-git-action`,"aria-label":e(N.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS),"aria-expanded":c,"aria-haspopup":`menu`,onClick:e=>{e.stopPropagation(),l(e=>!e)},className:R(fs,!c&&ms,c&&`pointer-events-auto visible opacity-100 text-[var(--oh-foreground)]`),children:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0})}),c?(0,Z.jsx)(cs,{anchorRef:u,gitProvider:s,testIdPrefix:`conversation-overview-diffs-git`,onClose:()=>l(!1)}):null]})})]})}var gs=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.13832 8.76476C8.25957 8.17949 9.52697 7.9727 10.7515 8.14436L14.9025 2.52826L21.4717 9.09737L15.8555 13.2484C16.0272 14.4729 15.8204 15.7403 15.2351 16.8616C15.1872 16.9535 15.1366 17.0444 15.0836 17.1343C14.8318 17.5605 14.5228 17.9624 14.1566 18.3286L10.4443 14.6163L4.75207 20.3085H3.69141V19.2478L9.38361 13.5556L5.6713 9.84332C6.03755 9.47708 6.43936 9.16808 6.86562 8.91632C6.95547 8.86326 7.04641 8.81274 7.13832 8.76476ZM15.0735 4.82054L19.1794 8.92641L14.2461 12.5727L14.3701 13.4567C14.492 14.3266 14.3596 15.2233 13.9758 16.0265L7.97338 10.0241C8.77665 9.64035 9.67335 9.50789 10.5432 9.62984L11.4272 9.75376L15.0735 4.82054Z`,fill:`currentColor`})}),_s=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{d:`M10.9706 10.1586C10.2819 10.0621 9.56905 10.1784 8.93842 10.5075C8.88672 10.5345 8.83557 10.5629 8.78504 10.5928C8.54529 10.7344 8.3193 10.9082 8.11331 11.1142L9.83702 12.8372L7.00054 15.75L7 17H8.25064L11.1628 14.1632L12.8857 15.8865C13.0917 15.6805 13.2655 15.4545 13.4071 15.2147C13.437 15.1642 13.4654 15.1131 13.4924 15.0614C13.8215 14.4308 13.9378 13.718 13.8413 13.0293L17 10.6946L13.3053 7L10.9706 10.1586Z`,fill:`currentColor`})}),Q={automations:`automations`,skills:`skills`,mcp:`mcp`,secrets:`secrets`,pull_requests:`pull_requests`,issues:`issues`},vs={[W.workspace]:{section:W.workspace,icon:pt,i18nKey:N.CONVERSATION$OVERVIEW_WORKSPACE}},ys=[{part:H.changes,icon:dt,i18nKey:N.COMMON$CHANGES,opensChanges:!0},{part:H.repository,icon:Xe,i18nKey:N.CONVERSATION$REPOSITORY},{part:H.branch,icon:at,i18nKey:N.CONVERSATION$BRANCH},{part:H.commits,icon:lt,i18nKey:N.DIFF_VIEWER$COMMITS,opensCommits:!0},{part:H.pull_requests,icon:Kr,i18nKey:N.CONVERSATION$OVERVIEW_PULL_REQUESTS,drawerSection:Q.pull_requests}];function bs({testId:e,pinned:t,pinnedLabel:n,unpinnedLabel:r,onClick:i}){return(0,Z.jsx)(`button`,{type:`button`,"data-testid":e,className:R(`flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white`,Zt,`hover:bg-white/10`),"aria-pressed":t,"aria-label":t?n:r,onClick:i,children:(0,Z.jsx)(`span`,{className:R(`ml-auto overflow-hidden`,Qt),"aria-hidden":!0,children:t?(0,Z.jsx)(_s,{className:`size-4`,width:16,height:16}):(0,Z.jsx)(gs,{className:`size-4`,width:16,height:16})})})}function xs({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Rn(t,n),[a,o]=(0,X.useState)(),{t:s}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedOverviewSections:u,setUnpinnedOverviewGitParts:d}=sn(c),{navigateToChanges:f,navigateToCommits:p}=mi(),m=as();(0,X.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let h=e=>{if(e.opensChanges){m?.closeDrawer(),f(),t();return}if(e.opensCommits){m?.closeDrawer(),p(),t();return}e.drawerSection&&(m?.openSection(e.drawerSection),t())},g=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewSections??[];if(n.includes(e)){u?.(n.filter(t=>t!==e));return}u?.([...n,e])},_=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewGitParts??[];if(n.includes(e)){d?.(n.filter(t=>t!==e));return}d?.([...n,e])};if(!e)return null;let v=!!(r?.current&&a),y=fn(W.git,l.unpinnedOverviewSections??[]),x=s(N.CONVERSATION$UNPIN_OVERVIEW_SECTION),S=s(N.CONVERSATION$PIN_OVERVIEW_SECTION),C=({key:e,testIdOpen:t,testIdPin:n,icon:r,label:i,pinned:a,isActionable:o,indent:s=!1,onOpen:c,onPinToggle:l})=>{let u=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:(0,Z.jsx)(r,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:i})]});return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsxs)(`div`,{className:R(`group flex h-[30px] w-full min-w-0 items-stretch rounded hover:bg-[var(--oh-interactive-hover)]`,s&&`pl-4`),children:[o?(0,Z.jsx)(`button`,{type:`button`,"data-testid":t,className:R(`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white`,Zt),onClick:c,children:u}):(0,Z.jsx)(`div`,{"data-testid":t,className:R(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Zt),children:u}),(0,Z.jsx)(bs,{testId:n,pinned:a,pinnedLabel:x,unpinnedLabel:S,onClick:l})]})},e)},w=e=>{if(e===W.git)return null;let t=vs[e];return C({key:e,testIdOpen:`conversation-overview-menu-open-${e}`,testIdPin:`conversation-overview-menu-pin-${e}`,icon:t.icon,label:s(t.i18nKey),pinned:fn(e,l.unpinnedOverviewSections??[]),isActionable:!1,onPinToggle:t=>g(e,t)})},T=(0,Z.jsxs)(Mt,{ref:i,testId:`conversation-overview-context-menu`,theme:v?`popover`:`default`,position:v?`none`:`bottom`,alignment:v?`none`:`right`,spacing:v?`none`:`default`,className:R(`z-[9999] w-fit`,v?`mt-0`:`mt-2`),children:[cn.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-${t}`,inset:`menu`}):null,e.sections.map(e=>w(e))]},e.sections.join(`-`))),(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-git`,inset:`menu`}),C({key:W.git,testIdOpen:`conversation-overview-menu-open-${W.git}`,testIdPin:`conversation-overview-menu-pin-${W.git}`,icon:at,label:s(N.CONVERSATION$OVERVIEW_GIT),pinned:y,isActionable:!1,onPinToggle:e=>g(W.git,e)}),ys.map(e=>C({key:e.part,testIdOpen:`conversation-overview-menu-open-git-${e.part}`,testIdPin:`conversation-overview-menu-pin-git-${e.part}`,icon:e.icon,label:s(e.i18nKey),pinned:ln(e.part,l.unpinnedOverviewGitParts??[]),isActionable:!!(e.drawerSection||e.opensCommits||e.opensChanges),indent:!0,onOpen:()=>h(e),onPinToggle:t=>_(e.part,t)}))]});return v&&a&&typeof document<`u`?os.createPortal((0,Z.jsx)(`div`,{style:a,children:T}),document.body):T}var Ss={github:[`GITHUB_TOKEN`,`GH_TOKEN`,`github`],gitlab:[`GITLAB_TOKEN`,`GL_TOKEN`,`gitlab`],bitbucket:[`BITBUCKET_TOKEN`,`bitbucket`],forgejo:[`FORGEJO_TOKEN`,`forgejo`]},Cs=30;async function ws(e){if(ve().backend.kind!==`local`)return null;let t=Ss[e]??[];if(t.length===0)return null;let n=await rr.getSecrets(),r=new Set(n.map(e=>e.name)),i=t.find(e=>r.has(e));if(!i)return null;try{return await new Nt(B()).getSecret(i)}catch{return null}}function Ts(e,t,n){let r=z(t);switch(t){case`gitlab`:return`${r}/${n}/-/issues/${e}`;case`bitbucket`:return`${r}/${n}/issues/${e}`;case`forgejo`:return`${r}/${n}/issues/${e}`;default:return`${r}/${n}/issues/${e}`}}function Es(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/issues`;case`bitbucket`:return`${n}/${t}/issues`;case`forgejo`:return`${n}/${t}/issues`;default:return`${n}/${t}/issues`}}function Ds(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/merge_requests`;case`bitbucket`:return`${n}/${t}/pull-requests`;case`forgejo`:return`${n}/${t}/pulls`;default:return`${n}/${t}/pulls`}}async function Os(e,t){let n={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`https://api.github.com${e}`,{headers:n});if(!r.ok)throw Error(`GitHub API ${r.status}`);return r.json()}async function ks(e,t){let n={Accept:`application/json`};t&&(n[`PRIVATE-TOKEN`]=t);let r=await fetch(`https://gitlab.com/api/v4${e}`,{headers:n});if(!r.ok)throw Error(`GitLab API ${r.status}`);return r.json()}var As=class{static constructIssuesListUrl=Es;static constructPullRequestsListUrl=Ds;static async listPullRequests(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/merge_requests?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/pulls?state=open&per_page=${Cs}`,n)).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||pe(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}static async listIssues(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/issues?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/issues?state=open&per_page=${Cs}`,n)).filter(e=>!e.pull_request).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||Ts(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}};function js(e,t){return _({queryKey:[`repository-pull-requests`,t,e],queryFn:()=>As.listPullRequests(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}function Ms(e,t){return _({queryKey:[`repository-issues`,t,e],queryFn:()=>As.listIssues(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}var Ns=()=>{let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),s=X.useMemo(()=>Pi(a,o),[a,o]),c=_({queryKey:[`git_commits`,e,r,i,s],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return Yo.getGitCommits(r,i,s,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:c.data?.commits??[],hasMore:c.data?.hasMore??!1,isUnsupported:c.data===null,isLoading:c.isLoading,isFetching:c.isFetching,isSuccess:c.isSuccess,isError:c.isError}},Ps=`size-4 shrink-0 text-[var(--oh-muted)]`,Fs=R(`size-3.5 shrink-0 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`),Is=`-`;function Ls(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{state:n}=sn(t),{navigateToCommits:r}=mi(),i=as(),{data:a}=Bt(),{repository:o,provider:s,branch:c,isConnected:l}=Go(),u=ln(H.repository,n.unpinnedOverviewGitParts??[]),d=ln(H.branch,n.unpinnedOverviewGitParts??[]),f=ln(H.commits,n.unpinnedOverviewGitParts??[]),p=ln(H.pull_requests,n.unpinnedOverviewGitParts??[]),m=js(p?o:null,p?s:null),h=Ns();if(!l||!o||!s||!u&&!d&&!f&&!p)return null;let g=a?.provider_tokens_set?.[s]??null,_=oe(s,o,g),v=c?ue(s,o,c,g):null,y=m.data?.length??null,x=h.isUnsupported?null:h.commits.length,S=x!==null&&x>0?h.hasMore?`${x}+`:String(x):Is,C=()=>{i?.openSection(Q.pull_requests)},w=()=>{i?.closeDrawer(),r()},T=u||d,E=f||p;return(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-section`,children:[T?(0,Z.jsxs)(`div`,{className:`px-2 pb-1`,children:[u?(0,Z.jsxs)(`a`,{href:_,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-repo`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(tn,{gitProvider:s,className:Ps}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:o}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):null,d?c&&v?(0,Z.jsxs)(`a`,{href:v,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-branch`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Bn,{size:14,className:`shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:c}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-branch`,className:`flex min-w-0 items-center gap-2 px-2 py-1.5`,children:[(0,Z.jsx)(at,{className:`size-3.5 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:R(`text-sm`,c?`text-[var(--oh-foreground)]`:`text-[var(--oh-muted)]`),children:c||e(N.CONVERSATION$OVERVIEW_NONE)})]}):null]}):null,E?(0,Z.jsxs)(`ul`,{className:`px-2`,children:[f?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-commits`,onClick:w,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(lt,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.DIFF_VIEWER$COMMITS)}),h.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-commits-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:S})]})}):null,p?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-pull-requests`,onClick:C,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Kr,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.CONVERSATION$OVERVIEW_PULL_REQUESTS)}),m.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-pull-requests-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:y!==null&&y>0?y:Is})]})}):null]}):null]})}var Rs=R(`w-full max-w-[240px] rounded-xl border border-[var(--oh-border)]`,`bg-[var(--oh-surface)] pb-1`),zs=R(`flex items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),Bs=`size-4 shrink-0 text-[var(--oh-muted)]`;function Vs({icon:e,label:t,value:n,testId:r}){return(0,Z.jsxs)(`li`,{"data-testid":r,className:zs,children:[e,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:t}),(0,Z.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-right text-sm text-[var(--oh-muted)]`,children:n})]})}function Hs(){return(0,Z.jsx)(`div`,{className:`px-1`,children:(0,Z.jsx)(rn,{inset:`menu`})})}function Us(){let{t:e}=b(`openhands`),t=Wo(),{conversationId:n}=J(),{state:r}=sn(n),{isConnected:i}=Go(),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(null),c=e=>fn(e,r.unpinnedOverviewSections??[]),l=ln(H.changes,r.unpinnedOverviewGitParts??[]),u=c(W.git)&&(l||i),d=cn.flatMap(e=>e.sections.filter(e=>c(e))),f=[];u&&f.push({kind:`git`,key:`git`}),d.length>0&&f.push({kind:`sections`,key:d.join(`-`),sections:d});let p=n=>{switch(n){case W.workspace:return(0,Z.jsx)(Vs,{testId:`conversation-overview-workspace`,icon:(0,Z.jsx)(pt,{className:Bs}),label:e(N.CONVERSATION$OVERVIEW_WORKSPACE),value:t.workspaceName??e(N.CONVERSATION$OVERVIEW_NONE)},n);case W.git:return null;default:return n}};return(0,Z.jsxs)(`aside`,{"data-testid":`conversation-overview-panel`,"aria-label":e(N.CONVERSATION$OVERVIEW),className:Rs,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-0.5 pt-2.5`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-[var(--oh-muted)]`,children:e(N.CONVERSATION$OVERVIEW)}),(0,Z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Z.jsx)(Hn,{ref:s,testId:`conversation-overview-ellipsis`,onClick:()=>o(e=>!e),ariaLabel:e(N.COMMON$MORE_OPTIONS)}),(0,Z.jsx)(xs,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:s,anchorRef:s})]})]}),f.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(Hs,{}):null,e.kind===`git`?(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-block`,children:[l?(0,Z.jsx)(`ul`,{className:`px-2`,children:(0,Z.jsx)(hs,{})}):null,i?(0,Z.jsx)(Ls,{}):null]}):(0,Z.jsx)(`ul`,{className:`px-2`,children:e.sections.map(e=>p(e))})]},e.key))]})}var Ws={duration:.2,ease:`easeInOut`};function Gs(e){return e>=596}var Ks=typeof window<`u`?X.useLayoutEffect:X.useEffect;function qs(e,t){let[n,r]=(0,X.useState)(!1);return Ks(()=>{if(!t){r(!1);return}let n=e.current;if(!n)return;let i=()=>{r(Gs(n.clientWidth))};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),()=>a.disconnect()},[e,t]),n}var Js=`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0`;function Ys({isRightPanelShown:e}){let t=Ii(),n=!De()&&!0,r=U(e=>e.isOverviewPanelShown),a=(0,X.useRef)(null),o=!t&&r,s=qs(a,o);return(0,Z.jsxs)(`div`,{ref:a,className:`flex h-full min-h-0 w-full overflow-hidden`,children:[(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 justify-center overflow-hidden`,children:(0,Z.jsx)(`div`,{className:Js,children:(0,Z.jsx)(Ho,{})})}),(0,Z.jsx)(i,{children:o&&s?(0,Z.jsx)(Qe.div,{"data-testid":`conversation-overview-column`,initial:n?{width:0,opacity:0}:!1,animate:{width:268,opacity:1},exit:n?{width:0,opacity:0}:{opacity:0},transition:Ws,className:`flex shrink-0 flex-col items-start overflow-hidden pt-4 pl-3 pr-4`,children:(0,Z.jsx)(`div`,{className:`w-full shrink-0`,style:{width:268},children:(0,Z.jsx)(Us,{})})},`conversation-overview-column`):null})]})}function Xs({children:e}){return(0,Z.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Zs({children:e}){return(0,Z.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Qs({children:e}){return(0,Z.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}function $s({className:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`div`,{className:R(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,Z.jsx)(vt,{className:`h-8 w-8 shrink-0 animate-spin text-tertiary-light`,"aria-hidden":!0}),(0,Z.jsx)(Ve,{as:`p`,role:`status`,"aria-live":`polite`,className:`block w-full text-center text-base font-normal leading-5`,duration:1,spread:2,children:t(N.HOME$LOADING)})]})}function ec({children:e,onReady:t}){return(0,X.useLayoutEffect)(()=>{t()},[t]),e}function tc({onPending:e}){return(0,X.useLayoutEffect)(()=>{e()},[e]),(0,Z.jsx)($s,{})}var nc={duration:.35,ease:`easeInOut`};function rc({showAgentLoading:e,tabKey:t,children:n}){let r=De(),[a,o]=(0,X.useState)(!1);(0,X.useLayoutEffect)(()=>{o(!1)},[t]);let s=(0,X.useCallback)(()=>{o(!0)},[]),c=(0,X.useCallback)(()=>{o(!1)},[]),l=e||a;return r?(0,Z.jsx)(`div`,{className:`relative h-full w-full overflow-hidden`,children:l?(0,Z.jsx)($s,{}):(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}):(0,Z.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden`,children:[(0,Z.jsx)(Qe.div,{className:`absolute inset-0 h-full w-full`,initial:!1,animate:{opacity:+!l},transition:nc,"aria-hidden":l,children:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}),(0,Z.jsx)(i,{children:l?(0,Z.jsx)(Qe.div,{className:`absolute inset-0 z-10 h-full w-full`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:nc,children:(0,Z.jsx)($s,{})},`conversation-tab-loading-overlay`):null})]})}var ic=(0,X.lazy)(()=>a(()=>import(`./files-tab-BNDp3e_x.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),ac=(0,X.lazy)(()=>a(()=>import(`./commits-tab-B5SUF66c.js`),__vite__mapDeps([74,1,2,75,7,5,76,6,20,77,8,9,4,10,11,12,13,14,3,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,103,59,104,105,106,107,108,109,110,111,61,68,69,112,113,114,115,116,117,118,119,120,121,122,73,123,124,70,125]))),oc=(0,X.lazy)(()=>a(()=>import(`./browser-tab-DFyZXsnB.js`),__vite__mapDeps([126,2,1,18,9,4,6,5,10,11,12,13,14,3,15,7,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,127,128,70]))),sc=(0,X.lazy)(()=>a(()=>import(`./planner-tab-yISBVUKu.js`),__vite__mapDeps([129,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,130,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,103,59,104,105,106,107,108,109,110,111,61,68,69,112,113,114,115,116,117,118,119,120,121,122,73,123,124,70]))),cc=(0,X.lazy)(()=>a(()=>import(`./task-list-tab-CQisRcPh.js`),__vite__mapDeps([131,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,70]))),lc=(0,X.lazy)(()=>a(()=>import(`./usage-tab-ClVHAFJy.js`),__vite__mapDeps([132,1,2,9,4,6,5,10,11,12,13,79,7,99,18,14,3,15,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,133,44,105,78,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,56,100,101,102,42,43,103,59,104,106,107,108,109,110,111,46,61,47,68,69,112,113,114,115,55,116,117,118,119,120,121,122,73,123,53,124,58,70]))),uc=(0,X.lazy)(()=>a(()=>import(`./terminal-Bs50gJPC.js`),__vite__mapDeps([134,1,2,135,136,76,6,5,20,18,9,4,10,11,12,13,14,3,15,7,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,78,79,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,56,100,101,102,42,43,103,59,44,104,105,106,107,108,109,110,111,46,61,47,68,69,112,113,114,115,55,116,117,118,119,120,121,122,73,123,53,124,58,70]))),dc={tasklist:{component:cc},files:{component:ic},commits:{component:ac},browser:{component:oc},terminal:{component:uc},planner:{component:sc},usage:{component:lc}};function fc(){let{selectedTab:e,shouldShownAgentLoading:t}=U(),{conversationId:n}=J(),r=(0,X.useMemo)(()=>dc[e]??dc.files,[e]).component,i=e===`terminal`?`${e}-${n}`:e??`files`;return(0,Z.jsx)(Zs,{children:(0,Z.jsx)(Qs,{children:(0,Z.jsx)(rc,{showAgentLoading:t,tabKey:i,children:(0,Z.jsx)(Xs,{children:(0,Z.jsx)(r,{})},i)})})})}var pc=()=>{let e=d(),t=Qr(e=>e.removeErrorMessage);return h({mutationKey:[`start-conversation`],mutationFn:async e=>wn(e.conversationId),onMutate:async()=>(await e.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:e.getQueryData([`user`,`conversations`])}),onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{xn(e,r.conversationId)},onSuccess:(n,r)=>{t(),On(e,r.conversationId,k.RUNNING)}})},mc=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM10 9H14A1 1 0 0 1 15 10V14A1 1 0 0 1 14 15H10A1 1 0 0 1 9 14V10A1 1 0 0 1 10 9Z`,fill:`currentColor`})}),hc=e=>(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`}),(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 7.49998L10.1655 6.87598L16.9155 11.376V12.624L10.1655 17.124L9 16.5V7.49998ZM10.5 8.90098V15.099L15.1485 12L10.5 8.90098Z`,fill:`currentColor`})]});function gc({icon:e,text:t,onClick:n,testId:r}){return(0,Z.jsx)(V,{testId:r,onClick:n,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:e})]})})}function _c({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=Yr(),{isTask:i,taskStatus:a,taskDetail:o}=vr(),{t:s}=b(`openhands`),{errorMessage:c}=Qr(),l=r===L.LOADING||r===L.INIT,u=ee(t)||A(t),d=le({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=ae({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,Z.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(Ro,{className:`w-6 h-6 shrink-0`,color:d}),(0,Z.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function vc({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1,ignoreOutsideClickRef:s}){let{t:c}=b(`openhands`),l=Rn(e,s),u=he(r),d=A(r),f=u||d;return(0,Z.jsxs)(Mt,{ref:l,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:R(`left-2 w-fit min-w-42`,a),children:[(0,Z.jsx)(_c,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rn,{inset:`menu`}),u&&t&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(mc,{width:18,height:18}),text:c(N.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),d&&n&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(hc,{width:18,height:18}),text:c(N.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}function yc({isPublic:e,onToggle:t,ariaLabel:n}){return(0,Z.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,Z.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:R(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,Z.jsx)(`span`,{className:R(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function bc({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onExportTranscript:u,onDownloadConversation:d,shareUrl:f,position:p=`bottom`,anchorRef:m}){let h=Ii(),{t:g}=b(`openhands`),{backend:_}=T(),{data:v}=Y(),y=Ar(),x=Rn(e,m),S=m?.current??null,[C,w]=X.useState();X.useLayoutEffect(()=>{if(!S)return;let e=()=>{let e=S.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};p===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,w(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[S,p]);let E=!!(a||o||s),D=!!i,O=!!(r||n),k=_.kind===`cloud`?N.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:N.COMMON$STOP_CONVERSATION,A=_.kind===`cloud`&&!!c,j=v?.public||!1,M=!!S,P=(0,Z.jsxs)(Mt,{ref:x,testId:`conversation-name-context-menu`,position:p,alignment:`left`,className:R(h?`right-0 translate-x-[34%] left-auto`:``,M?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,Z.jsx)(V,{testId:`rename-button`,onClick:t,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Un,{width:16,height:16}),text:g(N.BUTTON$RENAME)})}),E&&(0,Z.jsx)(rn,{testId:`separator-tools`,inset:`menu`}),o&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-skills-button`,onClick:o,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Wn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_SKILLS)})})}),s&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-hooks-button`,onClick:s,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Sr,{width:16,height:16,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_HOOKS)})})}),a&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-agent-tools-button`,onClick:a,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(nn,{width:16,height:16}),text:g(N.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),u&&(0,Z.jsx)(V,{testId:`export-transcript-button`,onClick:u,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$EXPORT_TRANSCRIPT)})}),d&&(0,Z.jsx)(V,{testId:`download-trajectory-button`,onClick:d,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(D||O)&&(0,Z.jsx)(rn,{testId:`separator-info-control`,inset:`menu`}),i&&(0,Z.jsx)(V,{testId:`display-cost-button`,onClick:i,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(ot,{size:16}),text:g(N.BUTTON$DISPLAY_COST)})}),A&&c&&(0,Z.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,Z.jsx)(ut,{size:16})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:g(N.CONVERSATION$SHARE_PUBLICLY)}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[j&&f&&l&&(0,Z.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:l,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$COPY_TO_CLIPBOARD),children:(0,Z.jsx)(Qn,{width:14,height:14})}),(0,Z.jsx)(`a`,{"data-testid":`open-share-link-button`,href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$OPEN_IN_NEW_TAB),children:(0,Z.jsx)(it,{size:14,"aria-hidden":!0})})]}),(0,Z.jsx)(yc,{isPublic:j,onToggle:c,ariaLabel:g(N.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`stop-button`,onClick:r,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)($t,{width:16,height:16}),text:g(k)})})}),n&&(0,Z.jsx)(V,{testId:`delete-button`,onClick:n,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Vn,{width:16,height:16}),text:g(N.COMMON$DELETE_CONVERSATION)})})]});return M?typeof document>`u`||!C?null:os.createPortal((0,Z.jsx)(`div`,{style:C,children:P}),document.body):P}var xc=new Set([`BrowserClickAction`,`BrowserCloseTabAction`,`BrowserGetContentAction`,`BrowserGetStateAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserNavigateAction`,`BrowserScrollAction`,`BrowserSwitchTabAction`,`BrowserTypeAction`,`ExecuteBashAction`,`FileEditorAction`,`GlobAction`,`GrepAction`,`InvokeSkillAction`,`MCPToolAction`,`StrReplaceEditorAction`,`TaskAction`,`TaskTrackerAction`,`TerminalAction`,`ThinkAction`]),Sc=new Set([`BrowserObservation`,`CanvasUIObservation`,`ExecuteBashObservation`,`FileEditorObservation`,`GlobObservation`,`GrepObservation`,`InvokeSkillObservation`,`MCPToolObservation`,`StrReplaceEditorObservation`,`SwitchLLMObservation`,`TaskTrackerObservation`,`TaskObservation`,`TerminalObservation`]),Cc=e=>e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim(),wc=(e,t=100)=>e.length>t?`${e.slice(0,t)}…`:e,Tc=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()},$=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#039;`),Ec=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replace(/(!?)\[([^\]]*)\]\(\s*((?:javascript|data|vbscript):[^)]*)\)/gi,`$1\\[$2\\]($3)`).replace(/^(\s{0,3})\[([^\]]+)\]:(\s*<?(?:javascript|data|vbscript):)/gim,`$1\\[$2\\]:$3`),Dc=e=>Cc(e||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE))||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE),Oc=(e,t)=>Cc(w.t(e,t).replace(/<\/?(?:cmd|path)>/g,``)),kc=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Ac=e=>e.replace(/(?:Action|Observation)$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).trim(),jc=e=>{let t=Cc(e.summary||``);return t&&!kc(t)?t:Cc(e.tool_name)||Ac(e.action.kind)},Mc=(e,t)=>t?jc(t):Cc(e.tool_name)||Ac(e.observation.kind),Nc=e=>e.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
24
24
  `),Pc=e=>[`${w.t(N.TASK$SUBAGENT)}: ${e.subagent_type}`,`${w.t(N.TASK$QUERY)}:\n${e.prompt}`].join(`
25
25
 
26
26
  `),Fc=(e,t)=>{let n=t?.action.kind===`TaskAction`?t.action:void 0;return[`${w.t(N.TASK$SUBAGENT)}: ${e.subagent}`,`${w.t(N.TASK$TASK_ID)}: ${e.task_id}`,n?`${w.t(N.TASK$QUERY)}:\n${n.prompt}`:``,`${w.t(N.TASK$RESULT)}:\n${Nc(e.content)}`].filter(Boolean).join(`
@@ -0,0 +1 @@
1
+ import{t as e}from"./conversation-9a53tdbO.js";export{e as default};
@@ -0,0 +1 @@
1
+ import{t as e}from"./conversation-9a53tdbO.js";export{e as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{c as n,n as r,r as i}from"./agent-server-client-options-EHB23gyx.js";import{s as a,t as o}from"./agent-server-config-C_x8Otd9.js";import{l as s,v as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{t as l}from"./react-BX7IV650.js";import{a as u,i as d}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js";import{A as f,E as p,S as m,t as h,v as g}from"./agent-server-conversation-service.api-BaVQ6NpE.js";var _=async e=>{let t=(await h.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},v=async e=>{let{conversationUrl:t,sessionApiKey:i,sandboxId:a}=await _(e);if(n().backend.kind===`cloud`){if(!a)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await m(a),{success:!0}}return new c(r({conversationUrl:t,sessionApiKey:i})).interruptConversation(e)},y=async(e,t)=>{let{conversationUrl:n,sessionApiKey:i}=await _(e);return new c(r({conversationUrl:n,sessionApiKey:i})).askAgent(e,t)},b=async(e,t)=>{let{conversationUrl:n,sessionApiKey:i}=await _(e);await new c(r({conversationUrl:n,sessionApiKey:i})).startGoal(e,t)},x=async e=>{let{conversationUrl:t,sessionApiKey:n}=await _(e);await new c(r({conversationUrl:t,sessionApiKey:n})).stopGoal(e)},S=async e=>{let{conversationUrl:t,sessionApiKey:n}=await _(e);await new c(r({conversationUrl:t,sessionApiKey:n})).resumeGoal(e)},C=async e=>{let{conversationUrl:t,sessionApiKey:n}=await _(e);return new c(r({conversationUrl:t,sessionApiKey:n})).runConversation(e)},w=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},T=(e,t,n)=>w(e,t,{execution_status:n}),E=(e,t,n)=>w(e,t,{llm_model:n}),D=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},O=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function k(e){let t=e.split(/[\\/]+/).filter(Boolean),n=t[t.length-1];if(!n||n===`.`||n===`..`)throw Error(`Invalid file name`);return n}async function A(e,t={}){return f(e,t)}async function j(e,t,n={}){let r=k(e);return`${(await A(t,n)).replace(/[/\\]+$/,``)}/${r}`}async function M(e,t){if(t?.id===e&&t.workspace?.working_dir?.trim())return t.workspace.working_dir.trim();let n=p(e);return n?.selected_workspace?.trim()?n.selected_workspace.trim():O.test(e)?h.resolveConversationWorkingDir(e):a()}var N=5;async function P(e,t){if(t?.id===e&&t.conversation_url?.trim()&&t.session_api_key?.trim())return{conversationUrl:t.conversation_url.trim(),sessionApiKey:t.session_api_key.trim()};if(n().backend.kind===`cloud`){let[t]=await g([e]);return{conversationUrl:t?.conversation_url?.trim()??null,sessionApiKey:t?.session_api_key?.trim()??null}}return{conversationUrl:null,sessionApiKey:null}}function F(e){if(!e.conversationUrl||!e.sessionApiKey)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return{conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey}}async function I(e,t,r){let i=await M(e,r),a=await P(e,r),o=n().backend.kind===`cloud`,s=r?.id===e?r.session_api_key??a.sessionApiKey:a.sessionApiKey,c=r?.id===e?r.conversation_url??a.conversationUrl:a.conversationUrl;if(o){let e=F({conversationUrl:c,sessionApiKey:s});return L({files:t,workingDir:i,conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey})}return L({files:t,workingDir:i,conversationUrl:c,sessionApiKey:s})}async function L(e){let{files:t,workingDir:n,conversationUrl:i,sessionApiKey:a}=e,o=new d(r({conversationUrl:i,sessionApiKey:a,workingDir:n})),s=async e=>{try{let t=k(e.name),r=await j(e.name,n,{conversationUrl:i,sessionApiKey:a});return await o.fileUpload(e,r),{uploadedFile:t,skippedFile:null}}catch(t){return{uploadedFile:null,skippedFile:{name:e.name,reason:t instanceof Error?t.message:`Upload failed`}}}},c=[];for(let e=0;e<t.length;e+=N){let n=t.slice(e,e+N);c.push(...await Promise.all(n.map(s)))}return{uploaded_files:c.flatMap(e=>e.uploadedFile?[e.uploadedFile]:[]),skipped_files:c.flatMap(e=>e.skippedFile?[e.skippedFile]:[])}}var R=class{static currentConversation=null;static setCurrentConversation(e){this.currentConversation=e}static getCurrentConversation(){return this.currentConversation}static getClientOverrides(){return{sessionApiKey:this.currentConversation?.session_api_key}}static async getVSCodeUrl(e){let t=this.currentConversation?.id===e?this.currentConversation?.workspace?.working_dir??a():a();return{vscode_url:await new s(r(this.getClientOverrides())).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:t})}}static async getTrajectory(e){return{trajectory:(await new u(i(this.getClientOverrides()),e).search({limit:1e4})).items??[]}}static async uploadFiles(e,t){return I(e,t,this.currentConversation)}};e();var z=t(),B=e=>(0,z.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,z.jsx)(`path`,{d:`M21.0004 6.00001C21.0016 5.43668 20.8441 4.88442 20.5459 4.40644C20.2478 3.92846 19.8212 3.54406 19.3148 3.29726C18.8084 3.05046 18.2428 2.95122 17.6826 3.0109C17.1224 3.07059 16.5904 3.28678 16.1474 3.63473C15.7044 3.98269 15.3683 4.44835 15.1776 4.97841C14.9869 5.50848 14.9493 6.08152 15.0691 6.63197C15.1888 7.18241 15.4612 7.688 15.8549 8.09088C16.2487 8.49375 16.7479 8.77762 17.2954 8.91001V10.5C17.2978 10.6372 17.261 10.7722 17.1892 10.8891C17.1175 11.006 17.0138 11.1 16.8904 11.16L12.7354 13.32L8.59544 11.22C8.46356 11.1544 8.35443 11.0507 8.28221 10.9223C8.21 10.7939 8.17802 10.6468 8.19044 10.5V8.91001C8.89743 8.72746 9.51358 8.29333 9.92339 7.689C10.3332 7.08467 10.5085 6.35161 10.4165 5.62725C10.3245 4.90289 9.97149 4.23695 9.42361 3.75426C8.87573 3.27157 8.17062 3.00527 7.44044 3.00527C6.71026 3.00527 6.00514 3.27157 5.45726 3.75426C4.90938 4.23695 4.55635 4.90289 4.46435 5.62725C4.37234 6.35161 4.54768 7.08467 4.95749 7.689C5.36729 8.29333 5.98344 8.72746 6.69044 8.91001V10.5C6.6913 10.9156 6.80651 11.323 7.02346 11.6776C7.24041 12.0321 7.55073 12.3201 7.92044 12.51L12.0004 14.61V16.59C11.2934 16.7726 10.6773 17.2067 10.2675 17.811C9.85768 18.4153 9.68234 19.1484 9.77435 19.8728C9.86635 20.5971 10.2194 21.2631 10.7673 21.7457C11.3151 22.2284 12.0203 22.4947 12.7504 22.4947C13.4806 22.4947 14.1857 22.2284 14.7336 21.7457C15.2815 21.2631 15.6345 20.5971 15.7265 19.8728C15.8185 19.1484 15.6432 18.4153 15.2334 17.811C14.8236 17.2067 14.2074 16.7726 13.5004 16.59V14.61L17.5504 12.57C17.9317 12.3784 18.2501 12.0816 18.468 11.7148C18.686 11.348 18.7944 10.9265 18.7804 10.5V8.88001C19.4147 8.70922 19.9755 8.33496 20.3765 7.81469C20.7776 7.29442 20.9967 6.6569 21.0004 6.00001ZM6.00044 6.00001C6.00044 5.60218 6.15847 5.22065 6.43978 4.93934C6.72108 4.65804 7.10261 4.5 7.50044 4.5C7.89826 4.5 8.27979 4.65804 8.5611 4.93934C8.8424 5.22065 9.00044 5.60218 9.00044 6.00001C9.00044 6.39783 8.8424 6.77936 8.5611 7.06067C8.27979 7.34197 7.89826 7.50001 7.50044 7.50001C7.10261 7.50001 6.72108 7.34197 6.43978 7.06067C6.15847 6.77936 6.00044 6.39783 6.00044 6.00001ZM14.2054 19.5C14.2054 19.8978 14.0474 20.2794 13.7661 20.5607C13.4848 20.842 13.1033 21 12.7054 21C12.3076 21 11.9261 20.842 11.6448 20.5607C11.3635 20.2794 11.2054 19.8978 11.2054 19.5C11.2054 19.1022 11.3635 18.7207 11.6448 18.4393C11.9261 18.158 12.3076 18 12.7054 18C13.1033 18 13.4848 18.158 13.7661 18.4393C14.0474 18.7207 14.2054 19.1022 14.2054 19.5ZM18.0004 7.50001C17.6026 7.50001 17.2211 7.34197 16.9398 7.06067C16.6585 6.77936 16.5004 6.39783 16.5004 6.00001C16.5004 5.60218 16.6585 5.22065 16.9398 4.93934C17.2211 4.65804 17.6026 4.5 18.0004 4.5C18.3983 4.5 18.7798 4.65804 19.0611 4.93934C19.3424 5.22065 19.5004 5.60218 19.5004 6.00001C19.5004 6.39783 19.3424 6.77936 19.0611 7.06067C18.7798 7.34197 18.3983 7.50001 18.0004 7.50001Z`,fill:`currentColor`})}),V=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e};function H(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/,``);return t?t.startsWith(`/`)||/^[A-Za-z]:(\/|$)/.test(t)?t:`/${t}`:``}var U=(e,t)=>{let n=e.trim().replace(/\\/g,`/`);if(!n)return``;n=n.replace(/:(\d+)(-\d+)?$/,``);let r=[t,o].filter(e=>!!e?.trim());for(let e of r){let t=H(e);if(t){if(n===t)return``;if(n.startsWith(`${t}/`))return n.slice(t.length+1)}}return n.startsWith(`/`)?V(n).replace(/^\.\//,``):n.replace(/^\.\//,``)},W=/\.(md|txt|ts|tsx|js|jsx|mjs|cjs|py|json|html?|css|scss|ya?ml|toml|rs|go|java|kt|swift|c|cc|cpp|h|hpp|sh|bash|zsh|sql|xml|svg|pdf|env|rb|php|vue|svelte|lock|ini|cfg|docx?|xlsx?|pptx?|odt|rtf)$/i,G=e=>{let t=e.trim();if(!t||/\s/.test(t)||/^https?:\/\//i.test(t))return!1;let n=t.replace(/\\/g,`/`).replace(/^\.\//,``);if(n=n.replace(/:(\d+)(-\d+)?$/,``),/^(application|audio|image|text|video|font|multipart|message|model)\/[\w.+-]+$/i.test(n)||/^v?\d+(\.\d+){1,3}([-+][\w.]+)?$/i.test(n))return!1;let r=n.includes(`/`)?n.split(`/`).pop()??``:n;return W.test(r)},K=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n},q=l(e=>({executionStatusByConversation:{},setExecutionStatus:(t,n)=>e(e=>({executionStatusByConversation:{...e.executionStatusByConversation,[t]:n}})),reset:()=>e({executionStatusByConversation:{}})}));export{x as _,U as a,P as c,D as d,w as f,b as g,S as h,V as i,I as l,C as m,K as n,B as o,v as p,G as r,R as s,q as t,y as u,T as v,E as y};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{c as n,n as r,r as i}from"./agent-server-client-options-EHB23gyx.js";import{s as a,t as o}from"./agent-server-config-C_x8Otd9.js";import{l as s,v as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as l}from"./react-BX7IV650.js";import{a as u,i as d}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";import{A as f,E as p,S as m,t as h,v as g}from"./agent-server-conversation-service.api-BtOlitCD.js";var _=async e=>{let t=(await h.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},v=async e=>{let{conversationUrl:t,sessionApiKey:i,sandboxId:a}=await _(e);if(n().backend.kind===`cloud`){if(!a)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await m(a),{success:!0}}return new c(r({conversationUrl:t,sessionApiKey:i})).interruptConversation(e)},y=async(e,t)=>{let{conversationUrl:n,sessionApiKey:i}=await _(e);return new c(r({conversationUrl:n,sessionApiKey:i})).askAgent(e,t)},b=async(e,t)=>{let{conversationUrl:n,sessionApiKey:i}=await _(e);await new c(r({conversationUrl:n,sessionApiKey:i})).startGoal(e,t)},x=async e=>{let{conversationUrl:t,sessionApiKey:n}=await _(e);await new c(r({conversationUrl:t,sessionApiKey:n})).stopGoal(e)},S=async e=>{let{conversationUrl:t,sessionApiKey:n}=await _(e);await new c(r({conversationUrl:t,sessionApiKey:n})).resumeGoal(e)},C=async e=>{let{conversationUrl:t,sessionApiKey:n}=await _(e);return new c(r({conversationUrl:t,sessionApiKey:n})).runConversation(e)},w=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},T=(e,t,n)=>w(e,t,{execution_status:n}),E=(e,t,n)=>w(e,t,{llm_model:n}),D=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},O=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function k(e){let t=e.split(/[\\/]+/).filter(Boolean),n=t[t.length-1];if(!n||n===`.`||n===`..`)throw Error(`Invalid file name`);return n}async function A(e,t={}){return f(e,t)}async function j(e,t,n={}){let r=k(e);return`${(await A(t,n)).replace(/[/\\]+$/,``)}/${r}`}async function M(e,t){if(t?.id===e&&t.workspace?.working_dir?.trim())return t.workspace.working_dir.trim();let n=p(e);return n?.selected_workspace?.trim()?n.selected_workspace.trim():O.test(e)?h.resolveConversationWorkingDir(e):a()}var N=5;async function P(e,t){if(t?.id===e&&t.conversation_url?.trim()&&t.session_api_key?.trim())return{conversationUrl:t.conversation_url.trim(),sessionApiKey:t.session_api_key.trim()};if(n().backend.kind===`cloud`){let[t]=await g([e]);return{conversationUrl:t?.conversation_url?.trim()??null,sessionApiKey:t?.session_api_key?.trim()??null}}return{conversationUrl:null,sessionApiKey:null}}function F(e){if(!e.conversationUrl||!e.sessionApiKey)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return{conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey}}async function I(e,t,r){let i=await M(e,r),a=await P(e,r),o=n().backend.kind===`cloud`,s=r?.id===e?r.session_api_key??a.sessionApiKey:a.sessionApiKey,c=r?.id===e?r.conversation_url??a.conversationUrl:a.conversationUrl;if(o){let e=F({conversationUrl:c,sessionApiKey:s});return L({files:t,workingDir:i,conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey})}return L({files:t,workingDir:i,conversationUrl:c,sessionApiKey:s})}async function L(e){let{files:t,workingDir:n,conversationUrl:i,sessionApiKey:a}=e,o=new d(r({conversationUrl:i,sessionApiKey:a,workingDir:n})),s=async e=>{try{let t=k(e.name),r=await j(e.name,n,{conversationUrl:i,sessionApiKey:a});return await o.fileUpload(e,r),{uploadedFile:t,skippedFile:null}}catch(t){return{uploadedFile:null,skippedFile:{name:e.name,reason:t instanceof Error?t.message:`Upload failed`}}}},c=[];for(let e=0;e<t.length;e+=N){let n=t.slice(e,e+N);c.push(...await Promise.all(n.map(s)))}return{uploaded_files:c.flatMap(e=>e.uploadedFile?[e.uploadedFile]:[]),skipped_files:c.flatMap(e=>e.skippedFile?[e.skippedFile]:[])}}var R=class{static currentConversation=null;static setCurrentConversation(e){this.currentConversation=e}static getCurrentConversation(){return this.currentConversation}static getClientOverrides(){return{sessionApiKey:this.currentConversation?.session_api_key}}static async getVSCodeUrl(e){let t=this.currentConversation?.id===e?this.currentConversation?.workspace?.working_dir??a():a();return{vscode_url:await new s(r(this.getClientOverrides())).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:t})}}static async getTrajectory(e){return{trajectory:(await new u(i(this.getClientOverrides()),e).search({limit:1e4})).items??[]}}static async uploadFiles(e,t){return I(e,t,this.currentConversation)}};e();var z=t(),B=e=>(0,z.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,z.jsx)(`path`,{d:`M21.0004 6.00001C21.0016 5.43668 20.8441 4.88442 20.5459 4.40644C20.2478 3.92846 19.8212 3.54406 19.3148 3.29726C18.8084 3.05046 18.2428 2.95122 17.6826 3.0109C17.1224 3.07059 16.5904 3.28678 16.1474 3.63473C15.7044 3.98269 15.3683 4.44835 15.1776 4.97841C14.9869 5.50848 14.9493 6.08152 15.0691 6.63197C15.1888 7.18241 15.4612 7.688 15.8549 8.09088C16.2487 8.49375 16.7479 8.77762 17.2954 8.91001V10.5C17.2978 10.6372 17.261 10.7722 17.1892 10.8891C17.1175 11.006 17.0138 11.1 16.8904 11.16L12.7354 13.32L8.59544 11.22C8.46356 11.1544 8.35443 11.0507 8.28221 10.9223C8.21 10.7939 8.17802 10.6468 8.19044 10.5V8.91001C8.89743 8.72746 9.51358 8.29333 9.92339 7.689C10.3332 7.08467 10.5085 6.35161 10.4165 5.62725C10.3245 4.90289 9.97149 4.23695 9.42361 3.75426C8.87573 3.27157 8.17062 3.00527 7.44044 3.00527C6.71026 3.00527 6.00514 3.27157 5.45726 3.75426C4.90938 4.23695 4.55635 4.90289 4.46435 5.62725C4.37234 6.35161 4.54768 7.08467 4.95749 7.689C5.36729 8.29333 5.98344 8.72746 6.69044 8.91001V10.5C6.6913 10.9156 6.80651 11.323 7.02346 11.6776C7.24041 12.0321 7.55073 12.3201 7.92044 12.51L12.0004 14.61V16.59C11.2934 16.7726 10.6773 17.2067 10.2675 17.811C9.85768 18.4153 9.68234 19.1484 9.77435 19.8728C9.86635 20.5971 10.2194 21.2631 10.7673 21.7457C11.3151 22.2284 12.0203 22.4947 12.7504 22.4947C13.4806 22.4947 14.1857 22.2284 14.7336 21.7457C15.2815 21.2631 15.6345 20.5971 15.7265 19.8728C15.8185 19.1484 15.6432 18.4153 15.2334 17.811C14.8236 17.2067 14.2074 16.7726 13.5004 16.59V14.61L17.5504 12.57C17.9317 12.3784 18.2501 12.0816 18.468 11.7148C18.686 11.348 18.7944 10.9265 18.7804 10.5V8.88001C19.4147 8.70922 19.9755 8.33496 20.3765 7.81469C20.7776 7.29442 20.9967 6.6569 21.0004 6.00001ZM6.00044 6.00001C6.00044 5.60218 6.15847 5.22065 6.43978 4.93934C6.72108 4.65804 7.10261 4.5 7.50044 4.5C7.89826 4.5 8.27979 4.65804 8.5611 4.93934C8.8424 5.22065 9.00044 5.60218 9.00044 6.00001C9.00044 6.39783 8.8424 6.77936 8.5611 7.06067C8.27979 7.34197 7.89826 7.50001 7.50044 7.50001C7.10261 7.50001 6.72108 7.34197 6.43978 7.06067C6.15847 6.77936 6.00044 6.39783 6.00044 6.00001ZM14.2054 19.5C14.2054 19.8978 14.0474 20.2794 13.7661 20.5607C13.4848 20.842 13.1033 21 12.7054 21C12.3076 21 11.9261 20.842 11.6448 20.5607C11.3635 20.2794 11.2054 19.8978 11.2054 19.5C11.2054 19.1022 11.3635 18.7207 11.6448 18.4393C11.9261 18.158 12.3076 18 12.7054 18C13.1033 18 13.4848 18.158 13.7661 18.4393C14.0474 18.7207 14.2054 19.1022 14.2054 19.5ZM18.0004 7.50001C17.6026 7.50001 17.2211 7.34197 16.9398 7.06067C16.6585 6.77936 16.5004 6.39783 16.5004 6.00001C16.5004 5.60218 16.6585 5.22065 16.9398 4.93934C17.2211 4.65804 17.6026 4.5 18.0004 4.5C18.3983 4.5 18.7798 4.65804 19.0611 4.93934C19.3424 5.22065 19.5004 5.60218 19.5004 6.00001C19.5004 6.39783 19.3424 6.77936 19.0611 7.06067C18.7798 7.34197 18.3983 7.50001 18.0004 7.50001Z`,fill:`currentColor`})}),V=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e};function H(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/,``);return t?t.startsWith(`/`)||/^[A-Za-z]:(\/|$)/.test(t)?t:`/${t}`:``}var U=(e,t)=>{let n=e.trim().replace(/\\/g,`/`);if(!n)return``;n=n.replace(/:(\d+)(-\d+)?$/,``);let r=[t,o].filter(e=>!!e?.trim());for(let e of r){let t=H(e);if(t){if(n===t)return``;if(n.startsWith(`${t}/`))return n.slice(t.length+1)}}return n.startsWith(`/`)?V(n).replace(/^\.\//,``):n.replace(/^\.\//,``)},W=/\.(md|txt|ts|tsx|js|jsx|mjs|cjs|py|json|html?|css|scss|ya?ml|toml|rs|go|java|kt|swift|c|cc|cpp|h|hpp|sh|bash|zsh|sql|xml|svg|pdf|env|rb|php|vue|svelte|lock|ini|cfg|docx?|xlsx?|pptx?|odt|rtf)$/i,G=e=>{let t=e.trim();if(!t||/\s/.test(t)||/^https?:\/\//i.test(t))return!1;let n=t.replace(/\\/g,`/`).replace(/^\.\//,``);if(n=n.replace(/:(\d+)(-\d+)?$/,``),/^(application|audio|image|text|video|font|multipart|message|model)\/[\w.+-]+$/i.test(n)||/^v?\d+(\.\d+){1,3}([-+][\w.]+)?$/i.test(n))return!1;let r=n.includes(`/`)?n.split(`/`).pop()??``:n;return W.test(r)},K=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n},q=l(e=>({executionStatusByConversation:{},setExecutionStatus:(t,n)=>e(e=>({executionStatusByConversation:{...e.executionStatusByConversation,[t]:n}})),reset:()=>e({executionStatusByConversation:{}})}));export{x as _,U as a,P as c,D as d,w as f,b as g,S as h,V as i,I as l,C as m,K as n,B as o,v as p,G as r,R as s,q as t,y as u,T as v,E as y};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-D-gOfhmN.js";var n=e();function r({icon:e,children:r,action:i,className:a}){return(0,n.jsxs)(`div`,{className:t(`flex flex-col items-center justify-center w-full h-full p-10 gap-4 text-center`,a),children:[(0,n.jsx)(`div`,{className:`shrink-0 text-[var(--oh-muted)] [&_svg]:size-10 [&_svg]:max-h-10 [&_svg]:max-w-10 [&_svg]:shrink-0`,"aria-hidden":!0,children:e}),(0,n.jsx)(`p`,{className:`max-w-sm text-center text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:r}),i?(0,n.jsx)(`div`,{className:`flex justify-center pt-1`,children:i}):null]})}export{r as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-CbjwNcR-.js";var n=e();function r({icon:e,children:r,action:i,className:a}){return(0,n.jsxs)(`div`,{className:t(`flex flex-col items-center justify-center w-full h-full p-10 gap-4 text-center`,a),children:[(0,n.jsx)(`div`,{className:`shrink-0 text-[var(--oh-muted)] [&_svg]:size-10 [&_svg]:max-h-10 [&_svg]:max-w-10 [&_svg]:shrink-0`,"aria-hidden":!0,children:e}),(0,n.jsx)(`p`,{className:`max-w-sm text-center text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:r}),i?(0,n.jsx)(`div`,{className:`flex justify-center pt-1`,children:i}):null]})}export{r as t};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{K as n}from"./utils-D-gOfhmN.js";import{t as r}from"./checkmark-XZyokq_Y.js";import{t as i}from"./copy-Drmhc2jD.js";var a=e();function o({isHidden:e,isDisabled:o,onClick:s,mode:c}){let{t:l}=t(`openhands`);return(0,a.jsxs)(`button`,{hidden:e,disabled:o,"data-testid":`copy-to-clipboard`,type:`button`,onClick:s,"aria-label":l(c===`copy`?n.BUTTON$COPY:n.BUTTON$COPIED),className:`button-base p-1 cursor-pointer`,children:[c===`copy`&&(0,a.jsx)(i,{width:15,height:15}),c===`copied`&&(0,a.jsx)(r,{width:15,height:15})]})}export{o as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./useTranslation-CCgUjPJF.js";import{K as n}from"./utils-CbjwNcR-.js";import{t as r}from"./checkmark-XZyokq_Y.js";import{t as i}from"./copy-Drmhc2jD.js";var a=e();function o({isHidden:e,isDisabled:o,onClick:s,mode:c}){let{t:l}=t(`openhands`);return(0,a.jsxs)(`button`,{hidden:e,disabled:o,"data-testid":`copy-to-clipboard`,type:`button`,onClick:s,"aria-label":l(c===`copy`?n.BUTTON$COPY:n.BUTTON$COPIED),className:`button-base p-1 cursor-pointer`,children:[c===`copy`&&(0,a.jsx)(i,{width:15,height:15}),c===`copied`&&(0,a.jsx)(r,{width:15,height:15})]})}export{o as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-D-gOfhmN.js";import{t as c}from"./use-is-authed-A2Yinlt0.js";import{t as l}from"./typography-NarNyelM.js";var u=e(t(),1),d=n(),f=i(function(){let{t:e}=a(`openhands`),[t]=r(),{data:n,isLoading:i}=c(),[f,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(!1),g=t.get(`user_code`),_=async e=>{try{h(!0),(await fetch(`/oauth/device/verify-authenticated`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:`user_code=${encodeURIComponent(e)}`,credentials:`include`})).ok?p({success:!0,messageKey:o.DEVICE$SUCCESS_MESSAGE}):p({success:!1,messageKey:o.DEVICE$ERROR_FAILED})}catch{p({success:!1,messageKey:o.DEVICE$ERROR_OCCURRED})}finally{h(!1)}};return f?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsx)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:s(`mb-4`,f.success?`text-green-600`:`text-red-600`),children:f.success?(0,d.jsx)(`svg`,{className:`w-12 h-12 mx-auto`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}):(0,d.jsx)(`svg`,{className:`w-12 h-12 mx-auto`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})}),(0,d.jsx)(`h2`,{className:`text-xl font-medium mb-2`,children:f.success?e(o.DEVICE$SUCCESS_TITLE):e(o.DEVICE$ERROR_TITLE)}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:e(f.messageKey)}),!f.success&&(0,d.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:e(o.DEVICE$TRY_AGAIN)})]})})}):m?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsx)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$PROCESSING)})]})})}):n&&g?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background p-4`,children:(0,d.jsx)(`div`,{className:`flex flex-col items-center gap-6 w-full max-w-md`,children:(0,d.jsxs)(`div`,{className:`flex-1 min-w-0 max-w-md w-full mx-auto p-6 bg-card rounded-2xl shadow-lg border border-[var(--oh-border-subtle)]`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4 text-center`,children:e(o.DEVICE$AUTHORIZATION_REQUEST)}),(0,d.jsxs)(`div`,{className:`mb-6 p-4 bg-base rounded-lg border border-[var(--oh-border-subtle)]`,children:[(0,d.jsx)(`p`,{className:`text-xs text-[var(--oh-text-subtle)] mb-2 text-center uppercase tracking-wider`,children:e(o.DEVICE$CODE_LABEL)}),(0,d.jsx)(`p`,{className:`text-xl font-mono font-semibold text-center tracking-[0.3em]`,children:g})]}),(0,d.jsxs)(`div`,{className:`mb-6 p-4 bg-amber-950/50 border-l-2 border-amber-500 rounded-r-lg`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-amber-500 mb-1`,children:e(o.DEVICE$SECURITY_NOTICE)}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e(o.DEVICE$SECURITY_WARNING)})]}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-6 text-center`,children:e(o.DEVICE$CONFIRM_PROMPT)}),(0,d.jsxs)(`div`,{className:`flex gap-3`,children:[(0,d.jsx)(`button`,{type:`button`,onClick:()=>window.close(),className:`flex-1 px-4 py-2 border border-[var(--oh-border)] rounded-md hover:bg-muted text-[var(--oh-text-tertiary)]`,children:e(o.DEVICE$CANCEL)}),(0,d.jsx)(`button`,{type:`button`,onClick:()=>_(g),className:`flex-1 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700`,children:e(o.DEVICE$AUTHORIZE)})]})]})})}):n&&!g?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4 text-center`,children:e(o.DEVICE$AUTHORIZATION_TITLE)}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-6 text-center`,children:e(o.DEVICE$ENTER_CODE_PROMPT)}),(0,d.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`user_code`);t&&n&&_(t)},children:[(0,d.jsxs)(`div`,{className:`mb-4`,children:[(0,d.jsx)(`label`,{htmlFor:`user_code`,className:`block text-sm font-medium mb-2`,children:e(o.DEVICE$CODE_INPUT_LABEL)}),(0,d.jsx)(`input`,{type:`text`,id:`user_code`,name:`user_code`,required:!0,className:`w-full px-3 py-2 border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:e(o.DEVICE$CODE_PLACEHOLDER)})]}),(0,d.jsx)(`button`,{type:`submit`,className:`w-full px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:e(o.DEVICE$CONTINUE)})]})]})}):i?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$PROCESSING)})]})}):(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg text-center`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4`,children:e(o.DEVICE$AUTH_REQUIRED)}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$SIGN_IN_PROMPT)})]})})});export{f as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-CbjwNcR-.js";import{t as c}from"./use-is-authed-A2Yinlt0.js";import{t as l}from"./typography-BdAApXGl.js";var u=e(t(),1),d=n(),f=i(function(){let{t:e}=a(`openhands`),[t]=r(),{data:n,isLoading:i}=c(),[f,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(!1),g=t.get(`user_code`),_=async e=>{try{h(!0),(await fetch(`/oauth/device/verify-authenticated`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:`user_code=${encodeURIComponent(e)}`,credentials:`include`})).ok?p({success:!0,messageKey:o.DEVICE$SUCCESS_MESSAGE}):p({success:!1,messageKey:o.DEVICE$ERROR_FAILED})}catch{p({success:!1,messageKey:o.DEVICE$ERROR_OCCURRED})}finally{h(!1)}};return f?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsx)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:s(`mb-4`,f.success?`text-green-600`:`text-red-600`),children:f.success?(0,d.jsx)(`svg`,{className:`w-12 h-12 mx-auto`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}):(0,d.jsx)(`svg`,{className:`w-12 h-12 mx-auto`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})}),(0,d.jsx)(`h2`,{className:`text-xl font-medium mb-2`,children:f.success?e(o.DEVICE$SUCCESS_TITLE):e(o.DEVICE$ERROR_TITLE)}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:e(f.messageKey)}),!f.success&&(0,d.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:e(o.DEVICE$TRY_AGAIN)})]})})}):m?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsx)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$PROCESSING)})]})})}):n&&g?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background p-4`,children:(0,d.jsx)(`div`,{className:`flex flex-col items-center gap-6 w-full max-w-md`,children:(0,d.jsxs)(`div`,{className:`flex-1 min-w-0 max-w-md w-full mx-auto p-6 bg-card rounded-2xl shadow-lg border border-[var(--oh-border-subtle)]`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4 text-center`,children:e(o.DEVICE$AUTHORIZATION_REQUEST)}),(0,d.jsxs)(`div`,{className:`mb-6 p-4 bg-base rounded-lg border border-[var(--oh-border-subtle)]`,children:[(0,d.jsx)(`p`,{className:`text-xs text-[var(--oh-text-subtle)] mb-2 text-center uppercase tracking-wider`,children:e(o.DEVICE$CODE_LABEL)}),(0,d.jsx)(`p`,{className:`text-xl font-mono font-semibold text-center tracking-[0.3em]`,children:g})]}),(0,d.jsxs)(`div`,{className:`mb-6 p-4 bg-amber-950/50 border-l-2 border-amber-500 rounded-r-lg`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-amber-500 mb-1`,children:e(o.DEVICE$SECURITY_NOTICE)}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e(o.DEVICE$SECURITY_WARNING)})]}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-6 text-center`,children:e(o.DEVICE$CONFIRM_PROMPT)}),(0,d.jsxs)(`div`,{className:`flex gap-3`,children:[(0,d.jsx)(`button`,{type:`button`,onClick:()=>window.close(),className:`flex-1 px-4 py-2 border border-[var(--oh-border)] rounded-md hover:bg-muted text-[var(--oh-text-tertiary)]`,children:e(o.DEVICE$CANCEL)}),(0,d.jsx)(`button`,{type:`button`,onClick:()=>_(g),className:`flex-1 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700`,children:e(o.DEVICE$AUTHORIZE)})]})]})})}):n&&!g?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4 text-center`,children:e(o.DEVICE$AUTHORIZATION_TITLE)}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-6 text-center`,children:e(o.DEVICE$ENTER_CODE_PROMPT)}),(0,d.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`user_code`);t&&n&&_(t)},children:[(0,d.jsxs)(`div`,{className:`mb-4`,children:[(0,d.jsx)(`label`,{htmlFor:`user_code`,className:`block text-sm font-medium mb-2`,children:e(o.DEVICE$CODE_INPUT_LABEL)}),(0,d.jsx)(`input`,{type:`text`,id:`user_code`,name:`user_code`,required:!0,className:`w-full px-3 py-2 border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:e(o.DEVICE$CODE_PLACEHOLDER)})]}),(0,d.jsx)(`button`,{type:`submit`,className:`w-full px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:e(o.DEVICE$CONTINUE)})]})]})}):i?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$PROCESSING)})]})}):(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg text-center`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4`,children:e(o.DEVICE$AUTH_REQUIRED)}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$SIGN_IN_PROMPT)})]})})});export{f as default};
@@ -1 +1 @@
1
- import{t as e}from"./utils-D-gOfhmN.js";import{p as t}from"./form-control-classes-lQfLxzH4.js";var n=`transition-none`,r=`gap-0.5`,i=`gap-2`,a=e(`flex flex-col`,r),o=e(`bg-tertiary border border-[var(--oh-border-input)] rounded p-2`,`flex items-center gap-2`,t,n,`group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white`),s=e(`group flex w-full cursor-pointer items-center rounded px-2 py-2 text-left text-sm font-normal text-white`,i,`hover:bg-[var(--oh-interactive-hover)] disabled:cursor-not-allowed disabled:opacity-60`,n),c=e(`group flex w-full cursor-pointer items-center rounded px-2 py-2 text-start text-sm font-normal`,i,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,n),l=e(`shrink-0 text-[var(--oh-muted)] group-hover:text-white group-focus-visible:text-white`,n),u=e(`flex size-4 shrink-0 items-center justify-center [&_svg]:text-current`,l),d=e(`inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium`,`border-[var(--oh-border)] bg-base-secondary text-white`,`focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20`,n);e(a,`overflow-y-auto custom-scrollbar-always`,`max-h-[13.875rem]`);var f=e(`overflow-y-auto custom-scrollbar`,`max-h-[min(60vh,calc(100dvh-5rem))]`),p=e(`group flex w-full items-center rounded-md px-2 py-2 text-sm font-normal text-white`,i,`hover:bg-[var(--oh-interactive-hover)]`,n);export{r as a,i as c,f as d,o as f,a as i,l,p as n,s as o,n as r,c as s,d as t,u};
1
+ import{t as e}from"./utils-CbjwNcR-.js";import{p as t}from"./form-control-classes-BVI_szaj.js";var n=`transition-none`,r=`gap-0.5`,i=`gap-2`,a=e(`flex flex-col`,r),o=e(`bg-tertiary border border-[var(--oh-border-input)] rounded p-2`,`flex items-center gap-2`,t,n,`group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white`),s=e(`group flex w-full cursor-pointer items-center rounded px-2 py-2 text-left text-sm font-normal text-white`,i,`hover:bg-[var(--oh-interactive-hover)] disabled:cursor-not-allowed disabled:opacity-60`,n),c=e(`group flex w-full cursor-pointer items-center rounded px-2 py-2 text-start text-sm font-normal`,i,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,n),l=e(`shrink-0 text-[var(--oh-muted)] group-hover:text-white group-focus-visible:text-white`,n),u=e(`flex size-4 shrink-0 items-center justify-center [&_svg]:text-current`,l),d=e(`inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium`,`border-[var(--oh-border)] bg-base-secondary text-white`,`focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20`,n);e(a,`overflow-y-auto custom-scrollbar-always`,`max-h-[13.875rem]`);var f=e(`overflow-y-auto custom-scrollbar`,`max-h-[min(60vh,calc(100dvh-5rem))]`),p=e(`group flex w-full items-center rounded-md px-2 py-2 text-sm font-normal text-white`,i,`hover:bg-[var(--oh-interactive-hover)]`,n);export{r as a,i as c,f as d,o as f,a as i,l,p as n,s as o,n as r,c as s,d as t,u};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{ct as i,st as a}from"./active-backend-context-BETEdaJl.js";import{K as o,t as s}from"./utils-CbjwNcR-.js";import{_ as c,b as l,g as u,h as d,v as f,y as ee}from"./automation-disabled-reason-QFtMrdOr.js";import{A as p,T as m}from"./use-tracking-BAFpgpgq.js";import{r as h}from"./modal-classes-BPcBCWVj.js";import{f as g,l as _}from"./form-control-classes-BVI_szaj.js";import{t as v}from"./brand-button-CGUwj6zK.js";import{t as y}from"./settings-dropdown-input-Df_HXRk4.js";import{t as b}from"./settings-input-B3i5U9GL.js";import{t as x}from"./use-llm-profiles-U4u1gzuk.js";import{s as S}from"./use-automations-7_XBXHQK.js";import{n as C}from"./api-error-message-BXo0lCI5.js";import{t as w}from"./x-mark-BopmFoBq.js";import{a as T,t as E}from"./use-manifest-capabilities-D81_YdAF.js";var D=e(t(),1);function O(e,t){let n=e.trim();if(!n)return{value:null};let r=Number(n);return Number.isInteger(r)?r<=0?{errorKey:o.AUTOMATIONS$ERROR_TIMEOUT_POSITIVE}:t!==void 0&&r>t?{errorKey:o.AUTOMATIONS$ERROR_TIMEOUT_MAX_EXCEEDED}:{value:r}:{errorKey:o.AUTOMATIONS$ERROR_TIMEOUT_INVALID_NUMBER}}var k=n(),A=`__active__`,j=[o.AUTOMATIONS$WEEKDAY_SUN,o.AUTOMATIONS$WEEKDAY_MON,o.AUTOMATIONS$WEEKDAY_TUE,o.AUTOMATIONS$WEEKDAY_WED,o.AUTOMATIONS$WEEKDAY_THU,o.AUTOMATIONS$WEEKDAY_FRI,o.AUTOMATIONS$WEEKDAY_SAT];function M(e){let t=e.timeout==null?``:String(e.timeout);if(e.trigger.type===`event`)return{name:e.name,prompt:e.prompt??``,agentProfileId:e.agent_profile_id??null,model:e.model??``,frequency:`custom`,weekday:1,timeOfDay:``,isCustomSchedule:!0,rawSchedule:``,timeout:t};let n=f(e.trigger.schedule);return n.kind===`custom`?{name:e.name,prompt:e.prompt??``,agentProfileId:e.agent_profile_id??null,model:e.model??``,frequency:`custom`,weekday:1,timeOfDay:n.hour!==void 0&&n.minute!==void 0?c(n.hour,n.minute):``,isCustomSchedule:!0,rawSchedule:n.raw,timeout:t}:{name:e.name,prompt:e.prompt??``,agentProfileId:e.agent_profile_id??null,model:e.model??``,frequency:n.kind,weekday:n.kind===`weekly`?n.weekday??1:1,timeOfDay:c(n.hour,n.minute),isCustomSchedule:!1,rawSchedule:e.trigger.schedule??``,timeout:t}}function N({automation:e,isOpen:t,onClose:n}){let{t:c}=r(`openhands`),f=S(),N=p().editTitle,P=m(`name`),F=m(`prompt`),I=m(`model`),L=m(`timeout`),R=m(`schedule`),{data:z}=E(),B=z?.maxAutomationTimeoutSeconds,V=B===void 0?void 0:Math.min(B,L.max??B),{data:H,isLoading:U}=x(),W=H?.profiles??[],G=[{key:A,label:c(o.COMMON$ACTIVE_PROFILE)},...W.map(e=>({key:e.name,label:e.name}))],K=(0,D.useMemo)(()=>M(e),[e]),[q,J]=(0,D.useState)(K),[Y,X]=(0,D.useState)(null),[Z,Q]=(0,D.useState)(null),[te,$]=(0,D.useState)(null);if((0,D.useEffect)(()=>{t&&(J(K),X(null),Q(null),$(null))},[t,K]),!t)return null;let ne=[{key:`daily`,label:c(o.AUTOMATIONS$FREQUENCY_DAILY)},{key:`weekdays`,label:c(o.AUTOMATIONS$FREQUENCY_WEEKDAYS)},{key:`weekly`,label:c(o.AUTOMATIONS$FREQUENCY_WEEKLY)},...q.isCustomSchedule?[{key:`custom`,label:c(o.AUTOMATIONS$FREQUENCY_CUSTOM)}]:[]],re=j.map((e,t)=>({key:String(t),label:c(e)}));return(0,k.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,k.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`presentation`}),(0,k.jsxs)(`div`,{className:`relative w-full max-w-md rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":c(o.AUTOMATIONS$CANCEL),children:(0,k.jsx)(w,{className:`size-5`})}),(0,k.jsx)(`h2`,{className:h,children:N}),(0,k.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let r=q.name.trim();if(!r){X(c(o.AUTOMATIONS$NAME_REQUIRED));return}X(null);let s=O(q.timeout,V);if(`errorKey`in s){Q(c(s.errorKey,{max:V}));return}Q(null);let u={};r!==e.name&&(u.name=r);let p=q.prompt.trim();p!==(e.prompt??``).trim()&&(u.prompt=p.length===0?null:p),q.agentProfileId!==(e.agent_profile_id??null)&&(u.agent_profile_id=q.agentProfileId);let m=q.agentProfileId?``:q.model.trim();if(m!==(e.model??``)&&(u.model=m===``?null:m),(s.value??null)!==(e.timeout??null)&&(u.timeout=s.value),e.trigger.type!==`event`&&q.isCustomSchedule){if(q.rawSchedule.trim()!==(e.trigger.schedule??``).trim()){let t=l(q.rawSchedule);if(`errorKey`in t){$(c(t.errorKey));return}u.trigger={...e.trigger,schedule:t.schedule}}$(null)}else if(!q.isCustomSchedule&&q.frequency!==`custom`){let t=ee(q.timeOfDay);if(t){let n=d({kind:q.frequency,hour:t.hour,minute:t.minute,weekday:q.frequency===`weekly`?q.weekday:void 0});n!==e.trigger.schedule&&(u.trigger={...e.trigger,schedule:n})}}if(Object.keys(u).length===0){n();return}f.mutate({id:e.id,body:u},{onSuccess:()=>{i(c(o.AUTOMATIONS$EDIT_SUCCESS)),n()},onError:e=>{a(C(e,c(o.AUTOMATIONS$EDIT_ERROR)))}})},noValidate:!0,className:`mt-4 flex flex-col gap-4`,"aria-label":N,children:[P.present&&(0,k.jsx)(b,{testId:`edit-automation-name`,name:`name`,type:`text`,label:P.label,value:q.name,onChange:e=>J(t=>({...t,name:e})),error:Y??void 0,showRequiredTag:P.required}),F.present&&(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:F.label}),(0,k.jsx)(`textarea`,{"data-testid":`edit-automation-prompt`,name:`prompt`,value:q.prompt,onChange:e=>J(t=>({...t,prompt:e.target.value})),rows:4,className:s(_,`placeholder:italic`)}),F.help!==null&&(0,k.jsx)(`span`,{className:`text-xs text-muted`,children:F.help})]}),z?.features.includes(`agentProfiles`)&&(0,k.jsx)(T,{value:q.agentProfileId,onChange:e=>J(t=>({...t,agentProfileId:e}))}),!q.agentProfileId&&I.present&&(U||W.length>0)&&(0,k.jsx)(y,{testId:`edit-automation-model`,name:`model`,label:I.label,items:G,selectedKey:q.model||A,isLoading:U,placeholder:c(o.COMMON$ACTIVE_PROFILE),onSelectionChange:e=>J(t=>({...t,model:e&&e!==A?String(e):``}))}),L.present&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,k.jsx)(b,{testId:`edit-automation-timeout`,name:`timeout`,type:`number`,label:L.label,value:q.timeout,onChange:e=>J(t=>({...t,timeout:e})),error:Z??void 0,showOptionalTag:!0,min:L.min??1,max:V,step:1,placeholder:`600`}),L.help!==null&&(0,k.jsx)(`span`,{"data-testid":`edit-automation-timeout-hint`,className:`text-xs text-muted`,children:L.help})]}),e.trigger.type===`event`?(0,k.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg bg-[var(--oh-surface-raised)] p-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:c(o.AUTOMATIONS$DETAIL$TRIGGER)}),(0,k.jsx)(`span`,{className:`text-sm text-content`,children:c(o.AUTOMATIONS$DETAIL$TRIGGER_EVENT)})]}),e.trigger.source&&(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:c(o.AUTOMATIONS$DETAIL$EVENT_SOURCE)}),(0,k.jsx)(`span`,{className:`text-sm text-content`,children:e.trigger.source})]}),e.trigger.on&&(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:c(o.AUTOMATIONS$DETAIL$EVENT_TYPE)}),(0,k.jsx)(`code`,{className:`text-xs font-mono text-content`,children:u(e.trigger.on)})]}),e.trigger.filter&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:c(o.AUTOMATIONS$DETAIL$EVENT_FILTER)}),(0,k.jsx)(`code`,{className:`text-xs font-mono text-content break-all`,children:e.trigger.filter})]})]}):R.present?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(y,{testId:`edit-automation-frequency`,name:`frequency`,label:R.label,items:ne,selectedKey:q.frequency,isDisabled:q.isCustomSchedule,onSelectionChange:e=>{!e||q.isCustomSchedule||J(t=>({...t,frequency:e}))}}),q.frequency===`weekly`&&!q.isCustomSchedule&&(0,k.jsx)(y,{testId:`edit-automation-weekday`,name:`weekday`,label:c(o.AUTOMATIONS$WEEKDAY),items:re,selectedKey:String(q.weekday),onSelectionChange:e=>{e!==null&&J(t=>({...t,weekday:Number(e)}))}}),(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:c(o.AUTOMATIONS$TIME_OF_DAY)}),(0,k.jsx)(`input`,{"data-testid":`edit-automation-time`,name:`timeOfDay`,type:`time`,value:q.timeOfDay,onChange:e=>J(t=>({...t,timeOfDay:e.target.value})),disabled:q.isCustomSchedule,className:s(g,`disabled:bg-[var(--oh-surface-raised)]`)}),e.timezone&&(0,k.jsxs)(`span`,{className:`text-xs text-muted`,children:[c(o.AUTOMATIONS$TIMEZONE),`: `,e.timezone]})]}),q.isCustomSchedule&&(0,k.jsx)(b,{testId:`edit-automation-cron`,name:`cron`,type:`text`,label:c(o.AUTOMATIONS$CRON_EXPRESSION),value:q.rawSchedule,onChange:e=>J(t=>({...t,rawSchedule:e})),error:te??void 0,placeholder:`*/10 * * * *`})]}):null,(0,k.jsxs)(`div`,{className:`mt-2 flex justify-end gap-3`,children:[(0,k.jsx)(v,{testId:`edit-automation-cancel`,type:`button`,variant:`secondary`,onClick:n,isDisabled:f.isPending,children:c(o.AUTOMATIONS$CANCEL)}),(0,k.jsx)(v,{testId:`edit-automation-save`,type:`submit`,variant:`primary`,isDisabled:f.isPending,"aria-busy":f.isPending,children:f.isPending?c(o.AUTOMATIONS$SAVING):c(o.AUTOMATIONS$SAVE)})]})]})]})]})}export{N as t};