@openhands/agent-canvas 1.0.0-rc.1 → 1.0.0-rc.3

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 (460) hide show
  1. package/README.md +2 -2
  2. package/README.windows.md +2 -2
  3. package/build/assets/{QueryClientProvider-w1cZWY41.js → QueryClientProvider-7oLZ1RtQ.js} +1 -1
  4. package/build/assets/{Trans-BJeYqz2A.js → Trans-rF21Jwln.js} +1 -1
  5. package/build/assets/acp-providers-C55k29rf.js +1 -0
  6. package/build/assets/active-backend-context-CQTk4wD8.js +1 -0
  7. package/build/assets/add-backend-modal-BdYxoUdL.js +1 -0
  8. package/build/assets/agent-server-client-options-Dvgeb3x4.js +1 -0
  9. package/build/assets/agent-server-compatibility-BANjmMTo.js +1 -0
  10. package/build/assets/agent-server-conversation-service.api-js3oYcdU.js +5 -0
  11. package/build/assets/{agent-settings-BXBaybB_.js → agent-settings-BNrffu3I.js} +1 -1
  12. package/build/assets/{alert-banner-NeUl1-PQ.js → alert-banner-BzU93oDh.js} +1 -1
  13. package/build/assets/{analytics-consent-form-modal-DxkThW4K.js → analytics-consent-form-modal-Ce-_Skcd.js} +1 -1
  14. package/build/assets/api-key-entry-screen-CGyS-Cna.js +1 -0
  15. package/build/assets/{app-settings-C-U6jONZ.js → app-settings-DmOs4oik.js} +1 -1
  16. package/build/assets/automation-detail-DLbCVJCw.js +1 -0
  17. package/build/assets/{automations-list-BLJzAd-p.js → automations-list-Ces5shz5.js} +1 -1
  18. package/build/assets/{back-nav-button-DgkK0Ka6.js → back-nav-button-BDM9vr_o.js} +1 -1
  19. package/build/assets/backend-form-modal-BUy-PzZN.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-BktJcGgH.js → backend-synced-settings-badge-1A63yxGs.js} +1 -1
  21. package/build/assets/{base-modal-DZCNv0A4.js → base-modal-Ba5WcNb6.js} +1 -1
  22. package/build/assets/{brand-button-LBFNic99.js → brand-button-BoiPxAGm.js} +1 -1
  23. package/build/assets/browser-B8bp1IqT.js +5 -0
  24. package/build/assets/browser-store-C5uQbbIi.js +1 -0
  25. package/build/assets/{browser-tab-be3QvXg9.js → browser-tab-CiBRWB4X.js} +1 -1
  26. package/build/assets/chat-send-button-qKFZuB9E.js +1 -0
  27. package/build/assets/check-BDAbW7je.js +1 -0
  28. package/build/assets/{checkmark-Rmpruj7q.js → checkmark-SEZPnU2I.js} +1 -1
  29. package/build/assets/{chevron-down-KhWYEjeW.js → chevron-down-DUxWwzTm.js} +1 -1
  30. package/build/assets/{chevron-left-small-6nyFCWVQ.js → chevron-left-small-x9_-ucHG.js} +1 -1
  31. package/build/assets/{circle-plus-check-toggle-DquBwJ_6.js → circle-plus-check-toggle-CboDp7XB.js} +1 -1
  32. package/build/assets/{close-D_o3d8QM.js → close-CbOsKMRg.js} +1 -1
  33. package/build/assets/{code-tag-DhsjDB-v.js → code-tag-C0vR_IQH.js} +1 -1
  34. package/build/assets/{color-themes-0biOprdo.js → color-themes-B9n7pBQl.js} +1 -1
  35. package/build/assets/{combobox-caret-CO7eozIY.js → combobox-caret-DwMmhrrA.js} +1 -1
  36. package/build/assets/{command-store-UzKGSUC2.js → command-store-BUWgE-vZ.js} +1 -1
  37. package/build/assets/{condenser-settings-BulzYEuW.js → condenser-settings-FCBjvqSo.js} +1 -1
  38. package/build/assets/{confirmation-modal-CMAtd9R0.js → confirmation-modal-BPgWqWRI.js} +1 -1
  39. package/build/assets/{context-menu-list-item-D0swnhFt.js → context-menu-list-item-CHWCx1Mc.js} +1 -1
  40. package/build/assets/conversation-CT8AvxEH.js +1 -0
  41. package/build/assets/conversation-panel-DqDDs4WZ.js +1 -0
  42. package/build/assets/conversation-service.api-y_eB_43m.js +1 -0
  43. package/build/assets/conversation-state-store-DpgQaK_O.js +1 -0
  44. package/build/assets/conversation-store-CiYGBud3.js +6 -0
  45. package/build/assets/{conversation-tab-empty-state-DYjKsg_c.js → conversation-tab-empty-state-Ba5hbJhn.js} +1 -1
  46. package/build/assets/conversation-vNuLKgz6.js +19 -0
  47. package/build/assets/conversation-websocket-context-Bb4XBXoc.js +3 -0
  48. package/build/assets/{copy-BM0RpLez.js → copy-CAxUvM-U.js} +1 -1
  49. package/build/assets/{custom-toast-handlers-BohXx7uh.js → custom-toast-handlers-fgD4IYsu.js} +1 -1
  50. package/build/assets/{declaration-DaUdB2Wg.js → declaration-IA661TBv.js} +1 -1
  51. package/build/assets/{device-verify-DiEJqpJb.js → device-verify-BOQz2LJQ.js} +1 -1
  52. package/build/assets/{dist-xtCm0O6P.js → dist-B-SKiGDl.js} +1 -1
  53. package/build/assets/dist-CeJSjcAI.js +1 -0
  54. package/build/assets/{dropdown-classes-Vqz86I0R.js → dropdown-classes-lT1LUsbO.js} +1 -1
  55. package/build/assets/edit-automation-modal-C-oC5tis.js +1 -0
  56. package/build/assets/ellipsis-button-CiLx8dqc.js +1 -0
  57. package/build/assets/{entry.client-BvKgdCQ9.js → entry.client-Db3BpFL_.js} +2 -2
  58. package/build/assets/{enum-filter-dropdown-DdFgk0EM.js → enum-filter-dropdown-DFwoVtOw.js} +1 -1
  59. package/build/assets/{environment-switch-overlay-CuBuZOaa.js → environment-switch-overlay-Cow6h62p.js} +1 -1
  60. package/build/assets/{extensions-hub-Dayqvv0n.js → extensions-hub-BxZbAtjP.js} +1 -1
  61. package/build/assets/extensions-navigation-BIb-vAa2.js +1 -0
  62. package/build/assets/{file-DwHCkWZT.js → file-BJCSojij.js} +1 -1
  63. package/build/assets/files-tab-DpulQlIo.js +1 -0
  64. package/build/assets/files-tab-store-CZAEwv3x.js +1 -0
  65. package/build/assets/{folder-2h1hR1Qb.js → folder-wShAU0y7.js} +1 -1
  66. package/build/assets/git-control-bar-branch-button-D1uam-nI.js +27 -0
  67. package/build/assets/{globe-qFjFNG6J.js → globe-CQ_5xwpo.js} +1 -1
  68. package/build/assets/home-sJAFzI6v.js +1 -0
  69. package/build/assets/{i18n-zDndR1Ne.js → i18n-CyvU1o95.js} +1 -1
  70. package/build/assets/install-server-modal-BjEzlLF5.js +1 -0
  71. package/build/assets/{launch-I00QV8YT.js → launch-DgtB1JTX.js} +1 -1
  72. package/build/assets/{lesson-plan-C18uB_56.js → lesson-plan-B607buca.js} +1 -1
  73. package/build/assets/{link-external-DtcdPFbw.js → link-external-DCsHkAj4.js} +1 -1
  74. package/build/assets/llm-client-BnqeDPua.js +1 -0
  75. package/build/assets/llm-settings-B8kPJ0Of.js +1 -0
  76. package/build/assets/llm-settings-CjUpPsvA.js +1 -0
  77. package/build/assets/{loading-spinner-DNwR4--Z.js → loading-spinner-CFuA0UNt.js} +1 -1
  78. package/build/assets/manage-backends-modal-CTA-2x4F.js +1 -0
  79. package/build/assets/manifest-d3e8504d.js +1 -0
  80. package/build/assets/{markdown-renderer-D6B-u2nM.js → markdown-renderer-oOUs3tw5.js} +1 -1
  81. package/build/assets/mcp-client-xEdbDxOL.js +1 -0
  82. package/build/assets/mcp-kJYdM8aJ.js +9 -0
  83. package/build/assets/messages-BFJXB6MW.js +36 -0
  84. package/build/assets/{modal-backdrop-BDqI1zBV.js → modal-backdrop-B1si6TUd.js} +1 -1
  85. package/build/assets/{modal-body-CCLCqX1J.js → modal-body-2Po2nl1e.js} +1 -1
  86. package/build/assets/{modal-classes-DwTdT3IK.js → modal-classes-9XTtWCtF.js} +1 -1
  87. package/build/assets/{modal-close-button-gQgKqUf-.js → modal-close-button-DY-rVmld.js} +1 -1
  88. package/build/assets/model-selector-z_QOzaRV.js +1 -0
  89. package/build/assets/{navigation-context-aNGUUtdq.js → navigation-context-CszaA-CJ.js} +1 -1
  90. package/build/assets/{navigation-link-CYkF2y3K.js → navigation-link-DXg4oo29.js} +1 -1
  91. package/build/assets/onboarding-CZ_7nd-M.js +1 -0
  92. package/build/assets/{openhands-logo-CHmtDV-t.js → openhands-logo-B-IDE1ER.js} +1 -1
  93. package/build/assets/{option-service.api-CGNANEcT.js → option-service.api-DHOGfYKh.js} +1 -1
  94. package/build/assets/organization-service.api-D79cdERN.js +1 -0
  95. package/build/assets/path-utils-0KWEiRs9.js +1 -0
  96. package/build/assets/{pencil-Dr0b2jL1.js → pencil-COslZGUC.js} +1 -1
  97. package/build/assets/{plan-components--aLlpASH.js → plan-components-DsiDjcDi.js} +1 -1
  98. package/build/assets/{planner-tab-B-5EeCEm.js → planner-tab-CNmJiZ22.js} +1 -1
  99. package/build/assets/plus-D8aJZRkD.js +1 -0
  100. package/build/assets/profiles-client-CesbAK-7.js +1 -0
  101. package/build/assets/{providers-DknP6O2g.js → providers-Bpq3xFRA.js} +1 -1
  102. package/build/assets/proxy-wIasY2Po.js +1 -0
  103. package/build/assets/{query-client-config-CWWGQWvw.js → query-client-config-CITeuHD7.js} +1 -1
  104. package/build/assets/{recommended-automations-launcher-BIul0osB.js → recommended-automations-launcher-B1kfmFTQ.js} +8 -10
  105. package/build/assets/root-CIZ7Rv1X.js +2 -0
  106. package/build/assets/root-layout-B5ijp9At.js +2 -0
  107. package/build/assets/{sdk-section-page-VmtJWH3A.js → sdk-section-page-DTyvCc52.js} +1 -1
  108. package/build/assets/{sdk-settings-schema-DFievvEK.js → sdk-settings-schema-B0KrqqPX.js} +1 -1
  109. package/build/assets/{search-BeVRXvX7.js → search-BqXT2Ied.js} +1 -1
  110. package/build/assets/secrets-service-rJqZtDmI.js +1 -0
  111. package/build/assets/{secrets-settings-BLMvCkKm.js → secrets-settings-BQNSDLKS.js} +1 -1
  112. package/build/assets/server-client-Cz8PyIbN.js +1 -0
  113. package/build/assets/settings-BUlJrO_h.js +1 -0
  114. package/build/assets/settings-client-BUlG0Gzq.js +1 -0
  115. package/build/assets/{settings-dropdown-input-DA_pzHWE.js → settings-dropdown-input-BUk4m23x.js} +1 -1
  116. package/build/assets/{settings-gear-aNebYlCy.js → settings-gear-DFmoMp-6.js} +1 -1
  117. package/build/assets/{settings-index-CycvkOoq.js → settings-index-DE91Eahc.js} +1 -1
  118. package/build/assets/{settings-input-8y5p4kze.js → settings-input-DsoZj8Dm.js} +1 -1
  119. package/build/assets/{settings-list-classes-Qk7zl0Wu.js → settings-list-classes-D8VAVZmi.js} +1 -1
  120. package/build/assets/{settings-modal-DdntdOGP.js → settings-modal-CCaPYVqW.js} +1 -1
  121. package/build/assets/{settings-section-header-context-B77tsYlx.js → settings-section-header-context-D61smD-W.js} +1 -1
  122. package/build/assets/settings-service.api-4u2RKC8k.js +1 -0
  123. package/build/assets/{settings-switch-ba4DuiNO.js → settings-switch-BQiAS9ga.js} +1 -1
  124. package/build/assets/{settings-utils-BxzHqLmZ.js → settings-utils-chxTa1vn.js} +1 -1
  125. package/build/assets/shared-conversation-sBPLAawM.js +1 -0
  126. package/build/assets/{sidebar-mobile-menu-toggle-C0mmabKj.js → sidebar-mobile-menu-toggle-BDXWzhyB.js} +1 -1
  127. package/build/assets/{sidebar-nav-link-BsYdDFfb.js → sidebar-nav-link-Bhlzlhp8.js} +1 -1
  128. package/build/assets/{skill-card-pill-row-BhUlGcYB.js → skill-card-pill-row-Bg5joQf6.js} +1 -1
  129. package/build/assets/{skills-TYjOUQ2d.js → skills-BDOWVle-.js} +1 -1
  130. package/build/assets/skills-client-Cr9F5306.js +1 -0
  131. package/build/assets/{skills-plugins-D0pdqgKa.js → skills-plugins-fihjo1KZ.js} +1 -1
  132. package/build/assets/{skills-settings-VqKTkmVl.js → skills-settings-NQnuMwZP.js} +1 -1
  133. package/build/assets/{styled-tooltip-TCp7svY3.js → styled-tooltip-GXy1qxsO.js} +1 -1
  134. package/build/assets/suspense-C9MBE_9N.js +1 -0
  135. package/build/assets/{switch-skeleton-cKrdaYGj.js → switch-skeleton-QpdcdxRP.js} +1 -1
  136. package/build/assets/{task-list-tab-BiizRsY3.js → task-list-tab-Hl9BuVfq.js} +1 -1
  137. package/build/assets/telemetry-j9SLrtY7.js +2 -0
  138. package/build/assets/{terminal-BSYITdM0.js → terminal-BUww3Ssl.js} +1 -1
  139. package/build/assets/{terminal-CpgZx6go.js → terminal-DRwe8--D.js} +1 -1
  140. package/build/assets/{toggle-switch-CUgOZqZu.js → toggle-switch-DDr-DnEc.js} +1 -1
  141. package/build/assets/{trash-2-CbVljPko.js → trash-2-DAKXV2Wm.js} +1 -1
  142. package/build/assets/{typography-Bvw0IxaN.js → typography-Cx7uw7z3.js} +1 -1
  143. package/build/assets/{u-check-circle-u9QiS4Fr.js → u-check-circle-CftRwky1.js} +1 -1
  144. package/build/assets/{u-check-circle-half-DjpjzWu3.js → u-check-circle-half-sGVk0BtL.js} +1 -1
  145. package/build/assets/{u-circuit-DlBlOwx9.js → u-circuit-Cg9tH5qb.js} +1 -1
  146. package/build/assets/{u-edit-BIYzjs3v.js → u-edit-foF02hwH.js} +1 -1
  147. package/build/assets/{use-active-conversation-q1wT8LI5.js → use-active-conversation-DJGoI9Mc.js} +1 -1
  148. package/build/assets/use-agent-settings-schema-DtusObuC.js +1 -0
  149. package/build/assets/{use-agent-state-CCHlVqvY.js → use-agent-state-BXgWhFh6.js} +1 -1
  150. package/build/assets/{use-cloud-current-user-id-BAKf91Zx.js → use-cloud-current-user-id-e1Pk7NxQ.js} +1 -1
  151. package/build/assets/use-config-DSzkljTq.js +1 -0
  152. package/build/assets/use-create-conversation-CzvaVA5A.js +1 -0
  153. package/build/assets/use-event-store-DSpvASbC.js +1 -0
  154. package/build/assets/use-get-secrets-DiLgP147.js +1 -0
  155. package/build/assets/use-handle-plan-click-CUZwmKIk.js +1 -0
  156. package/build/assets/use-is-authed-fNsj-Adj.js +1 -0
  157. package/build/assets/{use-launch-skill-in-chat-3ydwpi_M.js → use-launch-skill-in-chat-ClRJlIx7.js} +1 -1
  158. package/build/assets/use-llm-profiles-CyNVoVqm.js +1 -0
  159. package/build/assets/use-runtime-is-ready-CWkGQFsb.js +1 -0
  160. package/build/assets/{use-save-settings-rE9aA29R.js → use-save-settings-CP23emUY.js} +1 -1
  161. package/build/assets/use-settings-0qFqC-r6.js +1 -0
  162. package/build/assets/{use-settings-nav-items-C7MOWj09.js → use-settings-nav-items-C6YxUn4h.js} +1 -1
  163. package/build/assets/use-skills-BWHATXK-.js +1 -0
  164. package/build/assets/{use-task-list-YMkSzdDv.js → use-task-list-JPudBRv3.js} +1 -1
  165. package/build/assets/{use-tracking-DQYdZpxi.js → use-tracking-CjLZgh8X.js} +1 -1
  166. package/build/assets/use-unified-vscode-url-DSn2tT08.js +1 -0
  167. package/build/assets/use-user-conversation-CQ5IwnZk.js +1 -0
  168. package/build/assets/{useMutation-DDo48A8t.js → useMutation-7hG0GuPx.js} +1 -1
  169. package/build/assets/useQuery-JDs8UaWj.js +1 -0
  170. package/build/assets/{useTranslation-CEcjrme-.js → useTranslation-CbJtty1g.js} +1 -1
  171. package/build/assets/{utils-CdgBzLA7.js → utils-CVcuFUYj.js} +1 -1
  172. package/build/assets/{vendor~browser-DWk6fNtJ.js → vendor~browser-Dwwc84Zf.js} +1 -1
  173. package/build/assets/{vendor~browser-tab-NZdVoI2Z.js → vendor~browser-tab-Bhohe29F.js} +1 -1
  174. package/build/assets/{vendor~conversation-panel~conversation-gp03cWZW.js → vendor~conversation-panel~conversation-DYHL7QoY.js} +1 -1
  175. package/build/assets/{vendor~conversation-panel~conversation~index-BZ5C6Xpz.js → vendor~conversation-panel~conversation~index-Be58Romv.js} +1 -1
  176. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js} +1 -1
  177. package/build/assets/{vendor~files-tab-Buz36Y-q.js → vendor~files-tab-B447_Zns.js} +1 -1
  178. package/build/assets/{vendor~home~conversation-panel~conversation-DG0H5SkJ.js → vendor~home~conversation-panel~conversation-DZ-F7J6T.js} +1 -1
  179. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CXivI4Ym.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B4oeCCli.js} +1 -1
  180. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9Il_wz8U.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CQQAW8hY.js} +1 -1
  181. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-1pTajrpX.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DFsI4CLy.js} +1 -1
  182. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Ceeqkj0k.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DcvlNgbn.js} +1 -1
  183. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B7I1ZxCx.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-ojk_J4bB.js} +1 -1
  184. package/build/assets/{vendor~launch-DXL78kBf.js → vendor~launch-BdXJCmwc.js} +1 -1
  185. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-CfAc3nMS.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js} +1 -1
  186. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DkwcKRtv.js → vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js} +1 -1
  187. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DSqEbr0N.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Dr8Ly0at.js} +1 -1
  188. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BC9XTECT.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-DveauQfg.js} +1 -1
  189. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-D0XUSHNN.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-zdl_Rltz.js} +2 -2
  190. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-BaCzvZac.js +48 -0
  191. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js} +1 -1
  192. package/build/assets/{vendor~root-layout~home~mcp~automations-list-cNHi83v_.js → vendor~root-layout~home~mcp~automations-list-CtdIEhjQ.js} +1 -1
  193. package/build/assets/{vendor~root-layout~home~mcp~automations-list-BnIlGhjl.js → vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js} +1 -1
  194. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BGWUbqUq.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-CbuXadI-.js} +1 -1
  195. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BuCSnjsW.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js} +2 -2
  196. package/build/assets/{verification-settings-CIqtxWat.js → verification-settings-Cm02KmeI.js} +1 -1
  197. package/build/assets/{vscode-tab-DEt72yJX.js → vscode-tab-AF70Yke0.js} +1 -1
  198. package/build/assets/{waiting-for-runtime-message-DSjJfeoj.js → waiting-for-runtime-message-Bg27u9JB.js} +1 -1
  199. package/build/assets/x-8AbJWTbX.js +1 -0
  200. package/build/assets/{x-mark-DsJ9tDD0.js → x-mark-Cn-YJVbN.js} +1 -1
  201. package/build/index.html +4 -4
  202. package/build/locales/ar/openhands.json +2 -1
  203. package/build/locales/ca/openhands.json +2 -1
  204. package/build/locales/de/openhands.json +2 -1
  205. package/build/locales/en/openhands.json +2 -1
  206. package/build/locales/es/openhands.json +2 -1
  207. package/build/locales/fr/openhands.json +2 -1
  208. package/build/locales/it/openhands.json +2 -1
  209. package/build/locales/ja/openhands.json +2 -1
  210. package/build/locales/ko-KR/openhands.json +2 -1
  211. package/build/locales/no/openhands.json +2 -1
  212. package/build/locales/pt/openhands.json +2 -1
  213. package/build/locales/tr/openhands.json +2 -1
  214. package/build/locales/uk/openhands.json +2 -1
  215. package/build/locales/zh-CN/openhands.json +2 -1
  216. package/build/locales/zh-TW/openhands.json +2 -1
  217. package/config/defaults.json +1 -1
  218. package/dist/api/agent-server-adapter.cjs +3 -3
  219. package/dist/api/agent-server-adapter.cjs.map +1 -1
  220. package/dist/api/agent-server-adapter.js +94 -86
  221. package/dist/api/agent-server-adapter.js.map +1 -1
  222. package/dist/api/app-preferences-store.cjs.map +1 -1
  223. package/dist/api/app-preferences-store.d.ts +6 -2
  224. package/dist/api/app-preferences-store.js.map +1 -1
  225. package/dist/api/cloud/proxy.cjs +1 -1
  226. package/dist/api/cloud/proxy.cjs.map +1 -1
  227. package/dist/api/cloud/proxy.d.ts +18 -6
  228. package/dist/api/cloud/proxy.js +1 -1
  229. package/dist/api/cloud/proxy.js.map +1 -1
  230. package/dist/api/conversation-metadata-store.cjs.map +1 -1
  231. package/dist/api/conversation-metadata-store.d.ts +8 -0
  232. package/dist/api/conversation-metadata-store.js.map +1 -1
  233. package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +9 -0
  234. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
  235. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  236. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +9 -9
  237. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  238. package/dist/components/conversation-events/chat/event-message.cjs +1 -1
  239. package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
  240. package/dist/components/conversation-events/chat/event-message.js +80 -71
  241. package/dist/components/conversation-events/chat/event-message.js.map +1 -1
  242. package/dist/components/features/automations/recommended-automations-launcher.d.ts +7 -1
  243. package/dist/components/features/chat/switch-profile-button.cjs +1 -1
  244. package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
  245. package/dist/components/features/chat/switch-profile-button.js +5 -5
  246. package/dist/components/features/chat/switch-profile-button.js.map +1 -1
  247. package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
  248. package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
  249. package/dist/components/features/conversation-panel/skills-modal.js +34 -37
  250. package/dist/components/features/conversation-panel/skills-modal.js.map +1 -1
  251. package/dist/components/features/home/workspace-selection-form.d.ts +1 -0
  252. package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +8 -0
  253. package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
  254. package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
  255. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  256. package/dist/components/features/sidebar/sidebar.js +6 -6
  257. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  258. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  259. package/dist/components/features/skills/extensions-navigation.d.ts +1 -9
  260. package/dist/components/features/skills/extensions-navigation.js +31 -50
  261. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  262. package/dist/constants/acp-providers.cjs +1 -1
  263. package/dist/constants/acp-providers.js +1 -1
  264. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  265. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  266. package/dist/hooks/mutation/use-create-conversation.js +26 -14
  267. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  268. package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs +1 -1
  269. package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs.map +1 -1
  270. package/dist/hooks/mutation/use-switch-llm-profile-and-log.js +26 -15
  271. package/dist/hooks/mutation/use-switch-llm-profile-and-log.js.map +1 -1
  272. package/dist/i18n/declaration.cjs +1 -1
  273. package/dist/i18n/declaration.cjs.map +1 -1
  274. package/dist/i18n/declaration.d.ts +1 -0
  275. package/dist/i18n/declaration.js +1 -1
  276. package/dist/i18n/declaration.js.map +1 -1
  277. package/dist/i18n/translation.cjs +1 -1
  278. package/dist/i18n/translation.cjs.map +1 -1
  279. package/dist/i18n/translation.js +32 -15
  280. package/dist/i18n/translation.js.map +1 -1
  281. package/dist/index.cjs +1 -1
  282. package/dist/index.js +10 -10
  283. package/dist/lib/index.cjs +1 -1
  284. package/dist/lib/index.js +1 -1
  285. package/dist/locales/ar/openhands.json +2 -1
  286. package/dist/locales/ca/openhands.json +2 -1
  287. package/dist/locales/de/openhands.json +2 -1
  288. package/dist/locales/en/openhands.json +2 -1
  289. package/dist/locales/es/openhands.json +2 -1
  290. package/dist/locales/fr/openhands.json +2 -1
  291. package/dist/locales/it/openhands.json +2 -1
  292. package/dist/locales/ja/openhands.json +2 -1
  293. package/dist/locales/ko-KR/openhands.json +2 -1
  294. package/dist/locales/no/openhands.json +2 -1
  295. package/dist/locales/pt/openhands.json +2 -1
  296. package/dist/locales/tr/openhands.json +2 -1
  297. package/dist/locales/uk/openhands.json +2 -1
  298. package/dist/locales/zh-CN/openhands.json +2 -1
  299. package/dist/locales/zh-TW/openhands.json +2 -1
  300. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs +1 -1
  301. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
  302. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js +10 -1
  303. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js.map +1 -1
  304. package/dist/package.cjs +1 -1
  305. package/dist/package.cjs.map +1 -1
  306. package/dist/package.js +2 -2
  307. package/dist/package.js.map +1 -1
  308. package/dist/routes/llm-settings.cjs +1 -1
  309. package/dist/routes/llm-settings.cjs.map +1 -1
  310. package/dist/routes/llm-settings.js +21 -21
  311. package/dist/routes/llm-settings.js.map +1 -1
  312. package/dist/routes/mcp.cjs +1 -1
  313. package/dist/routes/mcp.cjs.map +1 -1
  314. package/dist/routes/mcp.d.ts +0 -1
  315. package/dist/routes/mcp.js +0 -1
  316. package/dist/routes/mcp.js.map +1 -1
  317. package/dist/types/agent-server/core/events/index.d.ts +1 -0
  318. package/dist/types/agent-server/core/events/streaming-delta-event.d.ts +7 -0
  319. package/dist/types/agent-server/core/openhands-event.d.ts +2 -2
  320. package/dist/types/agent-server/type-guards.cjs +1 -1
  321. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  322. package/dist/types/agent-server/type-guards.d.ts +2 -0
  323. package/dist/types/agent-server/type-guards.js +3 -3
  324. package/dist/types/agent-server/type-guards.js.map +1 -1
  325. package/dist/utils/handle-event-for-ui.cjs +1 -1
  326. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  327. package/dist/utils/handle-event-for-ui.js +69 -13
  328. package/dist/utils/handle-event-for-ui.js.map +1 -1
  329. package/dist/utils/mcp-config.cjs +1 -1
  330. package/dist/utils/mcp-config.cjs.map +1 -1
  331. package/dist/utils/mcp-config.js +27 -19
  332. package/dist/utils/mcp-config.js.map +1 -1
  333. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  334. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  335. package/dist/utils/mcp-marketplace-utils.js +38 -18
  336. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  337. package/dist/utils/normalize-display-model.cjs +1 -1
  338. package/dist/utils/normalize-display-model.cjs.map +1 -1
  339. package/dist/utils/normalize-display-model.js +8 -7
  340. package/dist/utils/normalize-display-model.js.map +1 -1
  341. package/dist/utils/openhands-llm.cjs +1 -1
  342. package/dist/utils/openhands-llm.cjs.map +1 -1
  343. package/dist/utils/openhands-llm.d.ts +13 -0
  344. package/dist/utils/openhands-llm.js +9 -3
  345. package/dist/utils/openhands-llm.js.map +1 -1
  346. package/package.json +2 -2
  347. package/scripts/check-sdk-version-sync.mjs +6 -6
  348. package/scripts/dev-safe.mjs +71 -120
  349. package/scripts/dev-with-automation.mjs +58 -4
  350. package/scripts/runtime-services-info.mjs +199 -0
  351. package/scripts/static-server.mjs +42 -4
  352. package/build/assets/acp-providers-DJr8DlNG.js +0 -1
  353. package/build/assets/acp-route-guard-A__sWgbc.js +0 -1
  354. package/build/assets/active-backend-context-I2w666XY.js +0 -1
  355. package/build/assets/add-backend-modal-BDBDBXsJ.js +0 -1
  356. package/build/assets/agent-server-client-options-9agOSarV.js +0 -1
  357. package/build/assets/agent-server-compatibility-B7QStIcH.js +0 -1
  358. package/build/assets/agent-server-conversation-service.api-Cagoqq1V.js +0 -5
  359. package/build/assets/api-key-entry-screen-ByXA4hXH.js +0 -1
  360. package/build/assets/automation-detail-Dbmgt974.js +0 -1
  361. package/build/assets/backend-form-modal-CeB983Sj.js +0 -1
  362. package/build/assets/browser-D08Sp3ZY.js +0 -5
  363. package/build/assets/browser-store-JRrcGdlk.js +0 -1
  364. package/build/assets/chat-send-button-5qz0zj6R.js +0 -1
  365. package/build/assets/check-CZhEL6rP.js +0 -1
  366. package/build/assets/conversation-BrjF2-Ky.js +0 -1
  367. package/build/assets/conversation-HgR_TTPE.js +0 -19
  368. package/build/assets/conversation-panel-BlRcO5AC.js +0 -1
  369. package/build/assets/conversation-service.api-B_Pdmwsa.js +0 -1
  370. package/build/assets/conversation-state-store-D-w0uurj.js +0 -1
  371. package/build/assets/conversation-store-CC-isCnP.js +0 -1
  372. package/build/assets/conversation-websocket-context-G95yfL81.js +0 -3
  373. package/build/assets/dist-Bl-1K5Tv.js +0 -1
  374. package/build/assets/edit-automation-modal-CNZgSSiH.js +0 -1
  375. package/build/assets/extensions-navigation-yFLAU06N.js +0 -1
  376. package/build/assets/files-tab-CMredyYX.js +0 -1
  377. package/build/assets/files-tab-store-DLU28g8C.js +0 -1
  378. package/build/assets/git-control-bar-branch-button-D8blTNXh.js +0 -27
  379. package/build/assets/home-CWw845Rz.js +0 -1
  380. package/build/assets/install-server-modal-D8Q0xZcN.js +0 -1
  381. package/build/assets/llm-client-BqyLKgUN.js +0 -1
  382. package/build/assets/llm-settings-CAnFYAEG.js +0 -1
  383. package/build/assets/llm-settings-DotqpmCF.js +0 -1
  384. package/build/assets/manage-backends-modal-Ceo_SOcf.js +0 -1
  385. package/build/assets/manifest-61ec2d68.js +0 -1
  386. package/build/assets/mcp-EvrLVTla.js +0 -9
  387. package/build/assets/messages-Bz9TWjlh.js +0 -36
  388. package/build/assets/middleware-CfatjPYZ.js +0 -6
  389. package/build/assets/model-selector-CZOi4V7r.js +0 -1
  390. package/build/assets/onboarding-CPCKYvFh.js +0 -1
  391. package/build/assets/organization-service.api-Dn74hBTH.js +0 -1
  392. package/build/assets/path-utils-BjxzIGLp.js +0 -1
  393. package/build/assets/plus-DT-M0FA1.js +0 -1
  394. package/build/assets/profiles-client-BrqNmaDV.js +0 -1
  395. package/build/assets/proxy-sRh0WKI7.js +0 -1
  396. package/build/assets/root-CklXEh3W.js +0 -2
  397. package/build/assets/root-layout-BCA_X8XL.js +0 -2
  398. package/build/assets/secrets-service-DVtlLWY8.js +0 -1
  399. package/build/assets/server-client-DYv_GHPl.js +0 -1
  400. package/build/assets/settings-CXvJUx_j.js +0 -1
  401. package/build/assets/settings-service.api-DxIEtvx6.js +0 -1
  402. package/build/assets/shared-conversation-x41nZQi7.js +0 -1
  403. package/build/assets/sidebar-store-DnQAJAE5.js +0 -1
  404. package/build/assets/telemetry-fQFd-8V3.js +0 -2
  405. package/build/assets/use-agent-settings-schema-Yxf7KGyG.js +0 -1
  406. package/build/assets/use-config-DwfigQ_Y.js +0 -1
  407. package/build/assets/use-create-conversation-BEzddjXn.js +0 -1
  408. package/build/assets/use-event-store-Cxqc45Sw.js +0 -1
  409. package/build/assets/use-get-secrets-BlO1BfUo.js +0 -1
  410. package/build/assets/use-handle-plan-click-Bfl0zIBr.js +0 -1
  411. package/build/assets/use-is-authed-hHndEep7.js +0 -1
  412. package/build/assets/use-llm-profiles-E-jjZMZw.js +0 -1
  413. package/build/assets/use-runtime-is-ready-DBWzvAmc.js +0 -1
  414. package/build/assets/use-settings-BPTbE7lg.js +0 -1
  415. package/build/assets/use-skills-QhoaIYGF.js +0 -1
  416. package/build/assets/use-unified-vscode-url-DFtNIC1Q.js +0 -1
  417. package/build/assets/use-user-conversation-BRAseenw.js +0 -1
  418. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js +0 -48
  419. package/build/assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js +0 -1
  420. package/build/assets/x-JOBEVLW0.js +0 -1
  421. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.cjs +0 -2
  422. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.cjs.map +0 -1
  423. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.d.ts +0 -1
  424. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.js +0 -21
  425. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.js.map +0 -1
  426. package/dist/utils/acp-route-guard.cjs +0 -1
  427. package/dist/utils/acp-route-guard.d.ts +0 -26
  428. package/dist/utils/acp-route-guard.js +0 -4
  429. /package/build/assets/{agent-server-ui-style-scope-BwIZYdC1.js → agent-server-ui-style-scope-Bhc5vpWO.js} +0 -0
  430. /package/build/assets/{automation-DJ_3GeXD.js → automation-BzmydDjr.js} +0 -0
  431. /package/build/assets/{common-DqjLSBOt.js → common-Cfviy7yT.js} +0 -0
  432. /package/build/assets/{context-CEQZwATj.js → context-BBqptpXX.js} +0 -0
  433. /package/build/assets/{conversation-local-storage-YmOVXxxW.js → conversation-local-storage-D5Tre_GA.js} +0 -0
  434. /package/build/assets/{createLucideIcon-Ddu8jDOQ.js → createLucideIcon-C9OEnwvX.js} +0 -0
  435. /package/build/assets/{environment-switch-store-CiurvTtK.js → environment-switch-store-BpKxp6Xq.js} +0 -0
  436. /package/build/assets/{git-status-mapper-DnL9OC8_.js → git-status-mapper-C3rfzUex.js} +0 -0
  437. /package/build/assets/{handle-capture-consent-3XrjZ8wi.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
  438. /package/build/assets/{health-store-B5f0S2FY.js → health-store-d-d2ssv4.js} +0 -0
  439. /package/build/assets/{iconBase-BVhFI-0E.js → iconBase-1A_WRQ4E.js} +0 -0
  440. /package/build/assets/{map-provider-C3Z5Dx2J.js → map-provider-XSFHmdDs.js} +0 -0
  441. /package/build/assets/{objectWithoutPropertiesLoose-DSQKyRhw.js → objectWithoutPropertiesLoose-B-IA9dU9.js} +0 -0
  442. /package/build/assets/{query-keys-tAsQcc_9.js → query-keys-CQaji0wJ.js} +0 -0
  443. /package/build/assets/{react-Dy05vyj5.js → react-CuAHzoGi.js} +0 -0
  444. /package/build/assets/{retrieve-axios-error-message-BY-yIkIq.js → retrieve-axios-error-message-DbnSBc_1.js} +0 -0
  445. /package/build/assets/{sdk-settings-field-metadata-C6KMD-jZ.js → sdk-settings-field-metadata-CETNItbo.js} +0 -0
  446. /package/build/assets/{settings-DGY6n4J2.js → settings-BgL2HUsU.js} +0 -0
  447. /package/build/assets/{settings-like-page-layout-classes-DNg2vKSM.js → settings-like-page-layout-classes-DENKlZpD.js} +0 -0
  448. /package/build/assets/{use-breakpoint-DpxHDmuH.js → use-breakpoint-Dt2knceC.js} +0 -0
  449. /package/build/assets/{use-click-outside-element-DhxCUyWl.js → use-click-outside-element-Bu2A3s59.js} +0 -0
  450. /package/build/assets/{v4-khGvL7i2.js → v4-BygpdDmc.js} +0 -0
  451. /package/build/assets/{vendor~browser-BDNLFng6.js → vendor~browser-BYEwwJqV.js} +0 -0
  452. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-D_hRW_zc.js → vendor~conversation-panel~conversation~alert-banner-BnHToS5O.js} +0 -0
  453. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-OFpe9fX_.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js} +0 -0
  454. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BPuuVEqr.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js} +0 -0
  455. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-87v-LliW.js} +0 -0
  456. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dr3Ow7Ms.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D8cqyq4k.js} +0 -0
  457. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-B1TKKuuH.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DspdqGPW.js} +0 -0
  458. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js} +0 -0
  459. /package/build/assets/{vendor~terminal-0ObOedYm.js → vendor~terminal-aeP3PnKf.js} +0 -0
  460. /package/build/assets/{vscode-url-helper-BMq8JBhB.js → vscode-url-helper-DOCkV_-G.js} +0 -0
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{i as r,r as i}from"./organization-service.api-Dn74hBTH.js";import{o as a,t as o}from"./declaration-DaUdB2Wg.js";import{t as s}from"./useTranslation-CEcjrme-.js";import{t as c}from"./utils-CdgBzLA7.js";import{i as l,n as u,o as d,r as f}from"./health-store-B5f0S2FY.js";import{n as p,s as m}from"./agent-server-client-options-9agOSarV.js";import{r as h}from"./active-backend-context-I2w666XY.js";import{t as g}from"./server-client-DYv_GHPl.js";import{i as _}from"./agent-server-compatibility-B7QStIcH.js";import{t as v}from"./modal-backdrop-BDqI1zBV.js";import{r as y,t as b}from"./modal-body-CCLCqX1J.js";import{n as x,r as S}from"./modal-classes-DwTdT3IK.js";import{t as C}from"./brand-button-LBFNic99.js";import{n as w}from"./navigation-context-aNGUUtdq.js";import{t as T}from"./modal-close-button-gQgKqUf-.js";import{t as E}from"./settings-input-8y5p4kze.js";var D=a(),O=e(t(),1),k=1e4,A=4e3,j=`Invalid API key`;function M(e){return e===j}async function N(e){if(e.kind===`cloud`)return await i(e),!0;try{await new m(p({host:e.host,sessionApiKey:e.apiKey||null,timeout:A})).getSettings()}catch(e){throw _(e,401)?Error(j):e}return!0}function P(e,t={}){let{probeDisabledOnce:n=!1}=t,i=O.useSyncExternalStore(d,u,u),a=r({queries:e.map(e=>{let t=i[e.id]?.disabled===!0,r=!t||n;return{queryKey:[`backend-health`,e.id,e.kind,e.host,e.apiKey??``],queryFn:async()=>{try{let t=await N(e);return l(e.id),t}catch(t){throw f(e.id,t),t}},enabled:r,refetchInterval:t?!1:k,refetchIntervalInBackground:!1,refetchOnMount:t&&n?`always`:!0,refetchOnReconnect:!t,refetchOnWindowFocus:!t,retry:!1,staleTime:t?0:k,meta:{disableToast:!0}}})}),o={};return e.forEach((e,t)=>{let n=a[t],r=i[e.id],s=r?.disabled===!0,c=r?.consecutiveFailures??0,l=r?.lastError??null,u;u=s?!1:n.isSuccess?!0:n.isError?!1:null,o[e.id]={isConnected:u,consecutiveFailures:c,lastError:l,disabled:s}}),o}var F=e=>(0,D.jsxs)(`svg`,{width:1365,height:1365,viewBox:`0 -24 148 148`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,D.jsx)(`path`,{d:`M71.7542 16.863V2.97414C71.7542 1.82355 72.6872 0.890503 73.8378 0.890503C74.9884 0.890503 75.9214 1.82355 75.9214 2.97414V16.863C75.9214 18.0136 74.9884 18.9466 73.8378 18.9466C72.6872 18.9466 71.7542 18.0136 71.7542 16.863Z`,fill:`white`}),(0,D.jsx)(`path`,{d:`M82.5272 18.9329L89.4716 6.90477C90.0469 5.90832 91.3215 5.5668 92.3179 6.1421C93.3144 6.7174 93.6559 7.99197 93.0806 8.98841L86.1362 21.0165C85.5609 22.0129 84.2863 22.3545 83.2899 21.7792C82.2934 21.2039 81.9519 19.9293 82.5272 18.9329Z`,fill:`white`}),(0,D.jsx)(`path`,{d:`M65.1481 18.9329L58.2037 6.90477C57.6284 5.90832 56.3538 5.5668 55.3574 6.1421C54.3609 6.7174 54.0194 7.99197 54.5947 8.98841L61.5391 21.0165C62.1144 22.0129 63.389 22.3545 64.3854 21.7792C65.3819 21.2039 65.7234 19.9293 65.1481 18.9329Z`,fill:`white`}),(0,D.jsx)(`path`,{d:`M140.606 62.0292C140.606 58.409 141.583 47.6748 141.89 44.1323C142.097 41.7374 141.809 40.4247 141.424 39.7542C141.141 39.2626 140.699 38.915 139.634 38.8436C138.865 38.7921 138.027 39.0114 137.401 39.5761C136.814 40.1052 136.159 41.1682 136.159 43.3176L136.155 43.4388L135.198 59.758C135.164 60.3451 134.883 60.8911 134.424 61.2599C133.966 61.6284 133.374 61.7859 132.793 61.6941L122.764 60.1068L111.948 58.6703C110.949 58.5376 110.188 57.7084 110.142 56.7016L109.561 44.1323C109.535 43.621 109.51 43.1141 109.484 42.6146C109.241 37.9294 109.022 33.7805 109.022 32.4282C109.022 28.3859 108.338 26.6806 107.74 25.9634C107.263 25.3915 106.577 25.1402 105.11 25.1402C104.583 25.1402 104.212 25.2481 103.933 25.4111C103.659 25.5714 103.346 25.8587 103.049 26.4208C102.41 27.6257 101.945 29.891 102.118 33.8479C102.342 38.9804 102.692 42.8146 103.035 46.2718C103.377 49.7231 103.718 52.8561 103.908 56.4971C104.204 62.1966 104.178 66.1256 103.945 68.7924C103.828 70.124 103.656 71.1996 103.423 72.0501C103.202 72.8558 102.871 73.6757 102.296 74.2887C101.6 75.0303 100.608 75.3844 99.577 75.136C98.7592 74.9389 98.1847 74.4215 97.8706 74.0916C97.2141 73.4017 96.7501 72.5106 96.568 72.0512C95.5097 69.3812 92.2352 63.1808 87.8023 59.6811C86.5089 58.6599 85.5666 58.3652 84.9736 58.3204C84.4148 58.2783 84.0094 58.4436 83.6909 58.6967C83.34 58.9756 83.0781 59.3811 82.9479 59.7643C82.9019 59.8999 82.8823 59.9968 82.8741 60.0584C84.0759 62.0865 88.8421 69.5222 91.0896 77.069C92.7648 82.6941 96.8038 88.4259 99.8194 90.8809C102.74 93.258 107.988 94.7313 113.9 95.0218C119.756 95.3095 125.788 94.4121 130.033 92.5092C138.233 88.8334 139.903 80.7382 140.651 77.2292C141.232 74.5057 141.243 71.5987 141.087 68.9009C141.01 67.5551 140.894 66.2969 140.793 65.1373C140.695 64.0105 140.606 62.9215 140.606 62.0292ZM120.986 27.0953C120.986 25.8314 120.648 24.7049 120.089 23.9514C119.583 23.27 118.84 22.7987 117.646 22.7984C116.668 22.7982 116.011 22.9187 115.546 23.1167C115.13 23.2943 114.781 23.5699 114.463 24.0831C113.73 25.2671 113.192 27.6455 113.189 32.384L113.721 43.9088C113.91 47.5661 114.106 51.4922 114.235 54.7707L120.986 55.6666V27.0953ZM125.153 56.2652L131.172 57.218L131.992 43.267V32.5083C131.992 31.031 131.39 30.1275 130.678 29.5489C129.884 28.9039 128.957 28.6731 128.519 28.6731C127.722 28.6731 126.899 28.797 126.306 29.2179C125.849 29.5421 125.153 30.3087 125.153 32.5083V56.2652ZM136.159 35.4278C137.406 34.8069 138.74 34.6083 139.912 34.6868C142.037 34.8292 143.91 35.718 145.037 37.6779C146.06 39.4592 146.273 41.8136 146.041 44.4927C145.72 48.1949 144.772 58.6457 144.772 62.0292C144.772 62.708 144.843 63.6116 144.944 64.7758C145.042 65.907 145.165 67.2389 145.247 68.6606C145.411 71.4987 145.422 74.8383 144.727 78.0987C144.002 81.4953 142.041 91.6918 131.738 96.3108C126.731 98.5551 120.002 99.4936 113.696 99.1838C107.445 98.8767 101.128 97.3189 97.1887 94.1122C93.4809 91.0937 88.9938 84.6307 87.0962 78.2589C84.9529 71.0619 80.3109 63.9646 79.1527 61.9533C78.4706 60.7689 78.684 59.3628 79.0019 58.4258C79.3607 57.3688 80.0554 56.2631 81.0993 55.4337C82.1758 54.5784 83.6043 54.0377 85.2876 54.1647C86.9369 54.2893 88.6462 55.0393 90.3834 56.4107C94.8541 59.9401 98.1342 65.5082 99.7424 68.9231C99.759 68.7664 99.779 68.6024 99.7941 68.4298C100.003 66.0435 100.039 62.3344 99.7467 56.7132C99.5635 53.1942 99.2356 50.1809 98.8888 46.6828C98.5425 43.1904 98.184 39.2713 97.955 34.0302C97.7722 29.8481 98.2012 26.6722 99.3672 24.471C99.9716 23.3302 100.79 22.4223 101.83 21.814C102.866 21.2087 103.995 20.974 105.11 20.974C106.759 20.974 108.813 21.2062 110.448 22.7678C110.593 22.4576 110.75 22.1652 110.921 21.8899C111.676 20.6698 112.681 19.8084 113.912 19.2835C115.095 18.7791 116.378 18.6309 117.646 18.6311C120.195 18.6315 122.164 19.7567 123.434 21.4683C124.256 22.576 124.75 23.8775 124.985 25.1982C126.338 24.5876 127.691 24.5068 128.519 24.5068C129.933 24.5068 131.784 25.0791 133.305 26.3154C134.908 27.6179 136.159 29.6733 136.159 32.5083V35.4278Z`,fill:`white`}),(0,D.jsx)(`path`,{d:`M7.15661 62.0292C7.15661 58.409 6.17994 47.6748 5.87291 44.1323C5.6654 41.7374 5.95357 40.4247 6.33875 39.7542C6.62116 39.2626 7.06336 38.915 8.12834 38.8436C8.89759 38.7921 9.73544 39.0114 10.3616 39.5761C10.9484 40.1052 11.6032 41.1682 11.6032 43.3176L11.6074 43.4388L12.5644 59.758C12.5988 60.3451 12.8798 60.8911 13.338 61.2599C13.7961 61.6284 14.3887 61.7859 14.9695 61.6941L24.9988 60.1068L35.8143 58.6703C36.8135 58.5376 37.5741 57.7084 37.6208 56.7016L38.2015 44.1323C38.2279 43.621 38.2525 43.1141 38.2784 42.6146C38.5218 37.9294 38.7401 33.7805 38.7401 32.4282C38.7401 28.3859 39.4246 26.6806 40.0227 25.9634C40.4996 25.3915 41.185 25.1402 42.6523 25.1402C43.1794 25.1402 43.5505 25.2481 43.8295 25.4111C44.1038 25.5714 44.416 25.8587 44.7138 26.4208C45.3521 27.6257 45.8173 29.891 45.6444 33.8479C45.4201 38.9804 45.0703 42.8146 44.7275 46.2718C44.3853 49.7231 44.0443 52.8561 43.8548 56.4971C43.5582 62.1966 43.5847 66.1256 43.8179 68.7924C43.9344 70.124 44.1069 71.1996 44.3396 72.0501C44.5601 72.8558 44.891 73.6757 45.4663 74.2887C46.1625 75.0303 47.1546 75.3844 48.1855 75.136C49.0033 74.9389 49.5778 74.4215 49.8918 74.0916C50.5484 73.4017 51.0123 72.5106 51.1945 72.0512C52.2527 69.3812 55.5272 63.1808 59.9601 59.6811C61.2536 58.6599 62.1958 58.3652 62.7889 58.3204C63.3476 58.2783 63.753 58.4436 64.0715 58.6967C64.4225 58.9756 64.6844 59.3811 64.8146 59.7643C64.8606 59.8999 64.8801 59.9968 64.8883 60.0584C63.6866 62.0865 58.9204 69.5222 56.6729 77.069C54.9977 82.6941 50.9586 88.4259 47.9431 90.8809C45.0229 93.258 39.7747 94.7313 33.8624 95.0218C28.0068 95.3095 21.9748 94.4121 17.7297 92.5092C9.52988 88.8334 7.85961 80.7382 7.11129 77.2292C6.53054 74.5057 6.5195 71.5987 6.67496 68.9009C6.75251 67.5551 6.86809 66.2969 6.96901 65.1373C7.06707 64.0105 7.1566 62.9215 7.15661 62.0292ZM26.7768 27.0953C26.7768 25.8314 27.1147 24.7049 27.6737 23.9514C28.1792 23.27 28.9221 22.7987 30.1167 22.7984C31.0942 22.7982 31.7518 22.9187 32.2162 23.1167C32.6326 23.2943 32.9817 23.5699 33.2996 24.0831C34.0328 25.2671 34.5705 27.6455 34.5738 32.384L34.0416 43.9088C33.8524 47.5661 33.6565 51.4922 33.5273 54.7707L26.7768 55.6666V27.0953ZM22.6095 56.2652L16.5904 57.218L15.7705 43.267V32.5083C15.7705 31.031 16.3726 30.1275 17.0847 29.5489C17.8785 28.9039 18.8058 28.6731 19.2432 28.6731C20.0404 28.6731 20.8634 28.797 21.4565 29.2179C21.9131 29.5421 22.6095 30.3087 22.6095 32.5083V56.2652ZM11.6032 35.4278C10.3568 34.8069 9.02265 34.6083 7.8501 34.6868C5.72541 34.8292 3.85197 35.718 2.72584 37.6779C1.70247 39.4592 1.48924 41.8136 1.72143 44.4927C2.0423 48.1949 2.99038 58.6457 2.99038 62.0292C2.99037 62.708 2.91991 63.6116 2.81859 64.7758C2.72014 65.907 2.59699 67.2389 2.51505 68.6606C2.3515 71.4987 2.34041 74.8383 3.0357 78.0987C3.76005 81.4953 5.72154 91.6918 16.0245 96.3108C21.0311 98.5551 27.7601 99.4936 34.0669 99.1838C40.3172 98.8767 46.6346 97.3189 50.5737 94.1122C54.2816 91.0937 58.7686 84.6307 60.6662 78.2589C62.8095 71.0619 67.4515 63.9646 68.6098 61.9533C69.2919 60.7689 69.0785 59.3628 68.7605 58.4258C68.4018 57.3688 67.707 56.2631 66.6632 55.4337C65.5867 54.5784 64.1582 54.0377 62.4748 54.1647C60.8256 54.2893 59.1162 55.0393 57.379 56.4107C52.9083 59.9401 49.6283 65.5082 48.02 68.9231C48.0034 68.7664 47.9835 68.6024 47.9684 68.4298C47.7597 66.0435 47.7232 62.3344 48.0158 56.7132C48.1989 53.1942 48.5269 50.1809 48.8737 46.6828C49.22 43.1904 49.5784 39.2713 49.8075 34.0302C49.9903 29.8481 49.5612 26.6722 48.3952 24.471C47.7909 23.3302 46.9729 22.4223 45.9321 21.814C44.8964 21.2087 43.7676 20.974 42.6523 20.974C41.0038 20.974 38.9497 21.2062 37.3141 22.7678C37.1698 22.4576 37.0124 22.1652 36.8419 21.8899C36.0863 20.6698 35.0817 19.8084 33.8508 19.2835C32.6679 18.7791 31.3849 18.6309 30.1167 18.6311C27.5677 18.6315 25.5986 19.7567 24.3285 21.4683C23.5066 22.576 23.0121 23.8775 22.7771 25.1982C21.4247 24.5876 20.0718 24.5068 19.2432 24.5068C17.8298 24.5068 15.9788 25.0791 14.4573 26.3154C12.8542 27.6179 11.6032 29.6733 11.6032 32.5083V35.4278Z`,fill:`white`})]}),I=e=>(0,D.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.3235 10.9352L11.5016 14.2111L7.67969 10.9352L8.6152 9.84375L11.5016 12.3178L14.388 9.84375L15.3235 10.9352Z`,fill:`currentColor`})});function L({isConnected:e,className:t}){let n,r,i;return e===`unavailable`?(n=`bg-[var(--oh-text-tertiary)]`,r=`No Backend Available`,i=`unavailable`):e===!0?(n=`bg-[var(--oh-status-success)]`,r=`Connected`,i=`connected`):e===!1?(n=`bg-red-500`,r=`Disconnected`,i=`disconnected`):(n=`bg-[var(--oh-interactive-selected)]`,r=`Checking connection`,i=`checking`),(0,D.jsx)(`span`,{"data-testid":`backend-status-dot`,"data-status":i,"aria-label":r,title:r,role:`status`,className:c(`inline-block w-2 h-2 rounded-full shrink-0`,n,t)})}var R=class extends Error{constructor(e,t){super(e),this.code=t,this.name=`DeviceFlowError`}},z=6e5,ee=3e4;async function B(e,t,n,r,i,a){let o=r===void 0?void 0:typeof r==`string`||r instanceof Blob||r instanceof FormData||r instanceof URLSearchParams?r:JSON.stringify(r);return await fetch(`${e.replace(/\/+$/,``)}${n}`,{method:t,headers:{...i?{"Content-Type":i}:{}},body:o,signal:a})}async function V(e){let t=e.replace(/\/+$/,``);try{let e=await B(t,`POST`,`/oauth/device/authorize`,{},`application/json`);if(!e.ok)throw new R(`Failed to start device flow: Server returned ${e.status}`);let n=await e.json();if(!n.device_code||!n.user_code||!n.verification_uri)throw new R(`Invalid response from device authorization endpoint: missing required fields`);let r=n.verification_uri_complete??`${n.verification_uri}?user_code=${encodeURIComponent(n.user_code)}`;return{device_code:n.device_code,user_code:n.user_code,verification_uri:n.verification_uri,verification_uri_complete:r,expires_in:n.expires_in??600,interval:n.interval??5}}catch(e){throw e instanceof R?e:new R(`Failed to start device flow: ${e instanceof Error?e.message:String(e)}`)}}async function te(e,t,n){let r=e.replace(/\/+$/,``),i=n.timeout??z,a=Math.max(1,n.interval)*1e3,o=Date.now();for(;Date.now()-o<i;){if(n.signal?.aborted)throw new R(`Authorization cancelled`,`cancelled`);try{let e=await B(r,`POST`,`/oauth/device/token`,new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:device_code`,device_code:t}).toString(),`application/x-www-form-urlencoded`,n.signal);if(e.ok){let t=await e.json();if(!t.access_token)throw new R(`Invalid token response: missing access_token`);return{access_token:t.access_token,token_type:t.token_type??`Bearer`,expires_in:t.expires_in}}let i;try{i=await e.json()}catch{throw new R(`Unexpected response from server: ${e.status}`)}let{error:o,error_description:s}=i;switch(o){case`authorization_pending`:break;case`slow_down`:a=typeof i.interval==`number`&&isFinite(i.interval)&&i.interval>0?Math.max(1,Math.min(i.interval,30))*1e3:Math.min(a+5e3,ee);break;case`expired_token`:throw new R(`Device code has expired. Please try again.`,`expired_token`);case`access_denied`:throw new R(`Authorization request was denied.`,`access_denied`);default:throw new R(`Authorization error: ${o}${s?` - ${s}`:``}`,o)}}catch(e){if(e instanceof R)throw e;if(e instanceof DOMException&&e.name===`AbortError`)throw new R(`Authorization cancelled`,`cancelled`);console.warn(`Network error during polling, retrying:`,e)}try{await ne(a,n.signal)}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?new R(`Authorization cancelled`,`cancelled`):e}}throw new R(`Timeout waiting for authorization. Please try again.`,`timeout`)}function ne(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))},{once:!0})})}var H={status:`idle`,verificationUrl:null,userCode:null,apiKey:null,error:null,errorCode:null};function re(){let[e,t]=O.useState(H),n=O.useRef(null),r=O.useCallback(e=>{n.current?.abort();let r=new AbortController;n.current=r,t({...H,status:`starting`}),(async()=>{let n;try{n=await V(e)}catch(e){if(r.signal.aborted)return;let n=e instanceof Error?e.message:`Failed to start device flow`,i=e instanceof R?e.code:void 0;t({...H,status:`error`,error:n,errorCode:i??null});return}if(!r.signal.aborted){t({...H,status:`awaiting_authorization`,verificationUrl:n.verification_uri_complete,userCode:n.user_code});try{let i=await te(e,n.device_code,{interval:n.interval,signal:r.signal});if(r.signal.aborted)return;t({...H,status:`success`,apiKey:i.access_token})}catch(e){if(r.signal.aborted)return;if(e instanceof R&&e.code===`cancelled`){t(H);return}let n=e instanceof Error?e.message:`Authorization failed`,i=e instanceof R?e.code:void 0;t({...H,status:`error`,error:n,errorCode:i??null})}}})()},[]),i=O.useCallback(()=>{n.current?.abort(),n.current=null,t(H)},[]),a=O.useCallback(()=>{n.current?.abort(),n.current=null,t(H)},[]);return O.useEffect(()=>()=>{n.current?.abort()},[]),{...e,start:r,cancel:i,reset:a}}function U(e){try{return new URL(e).protocol===`https:`}catch{return!1}}function ie({host:e,onSuccess:t,testIdRoot:n,isDisabled:r=!1}){let{t:i}=s(`openhands`),a=re(),c=O.useRef(null);O.useEffect(()=>()=>{c.current?.close()},[]),O.useEffect(()=>{if(a.status===`awaiting_authorization`&&a.verificationUrl&&c.current&&!c.current.closed){if(!U(a.verificationUrl)){console.error(`Invalid verification URL protocol`);return}try{c.current.location.href=a.verificationUrl}catch{c.current=window.open(a.verificationUrl,`_blank`,`noopener,noreferrer`)}}},[a.status,a.verificationUrl]),O.useEffect(()=>{if(a.status===`success`&&a.apiKey)try{t(a.apiKey)}finally{a.reset(),c.current?.close()}},[a.status,a.apiKey,a.reset,t]);let l=()=>{let t=e.trim().replace(/\/+$/,``),n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{let e=new URL(n);if(e.username||e.password)throw Error(`Invalid URL format`)}catch{return}c.current=window.open(`about:blank`,`_blank`),c.current||console.warn(`Popup blocked - user will need to use manual link`),a.start(n)};return(0,D.jsxs)(`div`,{"data-testid":`${n}-device-flow`,className:`flex flex-col gap-3`,children:[a.status===`idle`&&(0,D.jsx)(C,{type:`button`,variant:`primary`,onClick:l,testId:`${n}-login-button`,className:`w-full`,isDisabled:r,children:i(o.BACKEND$LOGIN_WITH_OPENHANDS)}),a.status===`starting`&&(0,D.jsxs)(`div`,{className:`flex items-center gap-2 p-3 bg-base-tertiary rounded-lg`,"data-testid":`${n}-auth-starting`,role:`status`,"aria-live":`polite`,children:[(0,D.jsx)(W,{}),(0,D.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:i(o.BACKEND$AUTH_STARTING)})]}),a.status===`awaiting_authorization`&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 bg-base-tertiary rounded-lg`,"data-testid":`${n}-auth-awaiting`,role:`status`,"aria-live":`polite`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(W,{}),(0,D.jsx)(`span`,{className:`text-sm font-medium text-white`,children:i(o.BACKEND$AUTH_AWAITING)})]}),(0,D.jsx)(`p`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:i(o.BACKEND$AUTH_BROWSER_OPENED)}),a.verificationUrl&&U(a.verificationUrl)&&(0,D.jsxs)(`div`,{className:`text-xs text-[var(--oh-muted)]`,children:[(0,D.jsx)(`p`,{children:i(o.BACKEND$AUTH_OPEN_MANUALLY)}),(0,D.jsx)(`a`,{href:a.verificationUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 hover:underline break-all`,children:a.verificationUrl})]}),(0,D.jsx)(C,{type:`button`,variant:`secondary`,onClick:a.cancel,testId:`${n}-auth-cancel`,className:`w-full mt-2`,children:i(o.BACKEND$AUTH_CANCEL)})]}),a.status===`error`&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 bg-red-900/20 border border-red-700 rounded-lg`,"data-testid":`${n}-auth-error`,role:`alert`,children:[(0,D.jsx)(`p`,{className:`text-sm text-red-400`,children:a.error}),(0,D.jsx)(C,{type:`button`,variant:`secondary`,onClick:l,testId:`${n}-auth-retry`,className:`w-full`,children:i(o.BACKEND$AUTH_RETRY)})]})]})}function W(){return(0,D.jsxs)(`svg`,{className:`animate-spin h-4 w-4 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,D.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,D.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function G(e){let t=e.trim().toLowerCase();return t.includes(`all-hands.dev`)||t.includes(`openhands.dev`)?`cloud`:`local`}function ae(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return!!(t===`localhost`||t===`::1`||t===`::`||t===`0.0.0.0`||/^127\./.test(t)||/^::ffff:127\./i.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2\d|3[01])\./.test(t)||/^fe[89ab][0-9a-f]:/i.test(t)||/^f[cd][0-9a-f]{2}:/i.test(t)||t.endsWith(`.local`)||!t.includes(`.`)&&!t.includes(`:`))}function K(e){let t=e.trim().replace(/\/+$/,``);if(!t)return``;if(/^https?:\/\//i.test(t))return t;let n=t.match(/^\[([^\]]+)\]/);return`${ae(n?n[1]:(t.match(/:/g)??[]).length>1?t:t.split(`:`)[0])?`http`:`https`}://${t}`}function q(e){let t=e.trim();if(!t||/\s/.test(t))return!1;let n=K(t);if(!n)return!1;try{let e=new URL(n);return(e.protocol===`http:`||e.protocol===`https:`)&&e.hostname.length>0}catch{return!1}}var J=`https://app.all-hands.dev`;function Y(e,t){return e(o.BACKEND$CONNECTION_TEST_FAILED,{host:t,interpolation:{escapeValue:!1}})}function oe(e){return e instanceof Error?e.message:typeof e==`string`?e:null}function X(e,t){let n=oe(t);return n?`${e}\n${n}`:e}async function Z(e){e.kind===`local`&&await new g(p({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()}function se({backend:e,testIdRoot:t}){let{t:r}=s(`openhands`),i=P([e])[e.id],a=i?.isConnected??null,c=i?.disabled===!0,l=i?.consecutiveFailures??0,u=i?.lastError??null,{data:d}=n({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>(await new g(p({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()).version??null,retry:!1,staleTime:6e4,enabled:e.kind===`local`&&!c}),f;f=r(a===!0?o.ONBOARDING$BACKEND_STATUS_CONNECTED:a===!1?o.ONBOARDING$BACKEND_STATUS_DISCONNECTED:o.ONBOARDING$BACKEND_STATUS_CHECKING);let m=e.kind===`cloud`?r(o.BACKEND$KIND_CLOUD):r(o.BACKEND$KIND_LOCAL);return(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsxs)(`div`,{"data-testid":`${t}-status`,className:`flex items-center gap-3 text-sm`,children:[(0,D.jsx)(L,{isConnected:a}),(0,D.jsx)(`span`,{className:`text-white`,"data-testid":`${t}-status-label`,children:f}),(0,D.jsx)(`span`,{className:`text-tertiary-alt`,children:`·`}),(0,D.jsx)(`span`,{className:`text-[var(--oh-text-tertiary)]`,children:m}),d?(0,D.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`${t}-version`,children:r(o.BACKEND$VERSION_LABEL,{version:d})}):null]}),c?(0,D.jsxs)(`div`,{"data-testid":`${t}-status-error`,className:`flex flex-col gap-1 rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm`,children:[(0,D.jsx)(`span`,{className:`font-semibold text-red-300`,children:r(o.BACKEND$HEALTH_FAILED_TITLE)}),(0,D.jsx)(`span`,{className:`text-xs text-[var(--oh-text-tertiary)]`,children:r(o.BACKEND$HEALTH_FAILED_DETAIL,{count:l})}),u?(0,D.jsx)(`span`,{"data-testid":`${t}-status-error-message`,className:`text-xs text-red-300 whitespace-pre-wrap break-words`,children:u}):null]}):null]})}function Q({mode:e,backend:t,onSubmitted:n,renderActions:r,testIdRoot:i,hostReadOnly:a,requireApiKey:l,hideConfigurationFields:u=!1,onSubmitOverride:d}){let{t:f}=s(`openhands`),{addBackend:p,updateBackend:m}=h(),[g,_]=O.useState(t?.name??``),[v,y]=O.useState(t?.host??``),[b,x]=O.useState(t?.apiKey??``),[S,w]=O.useState(null),[T,k]=O.useState(!1),[A,j]=O.useState(!1),[M,N]=O.useState(!1),P=G(v),F=i??(e===`edit`?`edit-backend`:`add-backend`),I=l||P!==`local`,L=g.trim().length>0&&q(v)&&(!I||b.trim().length>0),R=A&&!g.trim()?f(o.BACKEND$NAME_REQUIRED):void 0,z=M?v.trim()?q(v)?void 0:f(o.BACKEND$HOST_INVALID):f(o.BACKEND$HOST_REQUIRED):void 0;return(0,D.jsxs)(`form`,{"data-testid":`${F}-form`,onSubmit:async r=>{if(r.preventDefault(),T)return;if(!L){j(!0),N(!0);return}let i={name:g.trim(),host:K(v),apiKey:b.trim(),kind:P};w(null),k(!0);try{if(d){await d(i);return}await Z(i),e===`edit`&&t?m(t.id,i):p(i),n()}catch(e){w(X(Y(f,i.host),e))}finally{k(!1)}},className:`flex flex-col gap-4`,children:[(0,D.jsxs)(`div`,{"data-testid":`${F}-configuration-fields`,className:c(`flex flex-col gap-4`,u&&`hidden`),children:[(0,D.jsx)(E,{testId:`${F}-name`,name:`${F}-name`,type:`text`,label:f(o.BACKEND$NAME_LABEL),value:g,onChange:e=>{_(e),w(null)},onBlur:()=>j(!0),placeholder:`Production`,className:`w-full`,showRequiredTag:!0,error:R}),(0,D.jsx)(E,{testId:`${F}-host`,name:`${F}-host`,type:`text`,label:f(o.BACKEND$HOST_LABEL),value:v,onChange:a?void 0:e=>{y(e),w(null)},onBlur:()=>N(!0),placeholder:J,className:`w-full`,showRequiredTag:!0,error:z,isDisabled:a}),(0,D.jsx)(E,{testId:`${F}-api-key`,name:`${F}-api-key`,type:`password`,label:f(o.BACKEND$KEY_LABEL),value:b,onChange:e=>{x(e),w(null)},placeholder:``,className:`w-full`}),S?(0,D.jsx)(`div`,{role:`alert`,"data-testid":`${F}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:S}):null,e===`edit`&&t&&(0,D.jsx)(se,{backend:t,testIdRoot:F})]}),r?r({canSubmit:L&&!T,isSubmitting:T,testIdRoot:F}):(0,D.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2 w-full`,children:[(0,D.jsx)(C,{type:`button`,variant:`secondary`,onClick:n,testId:`${F}-cancel`,children:f(o.BUTTON$CANCEL)}),(0,D.jsx)(C,{type:`submit`,variant:`primary`,isDisabled:!L||T,testId:`${F}-submit`,children:f(o.BACKEND$SAVE)})]})]})}function $(){let{currentPath:e,navigate:t}=w();return O.useCallback(()=>{/^\/automations\/[^/]+/.test(e)?t(`/automations`):/^\/conversations\/[^/]+/.test(e)&&t(`/conversations`)},[e,t])}function ce({onClose:e}){let{t}=s(`openhands`),{addBackend:n}=h(),r=$(),[i,a]=O.useState(``),[c,l]=O.useState(``),[u,d]=O.useState(``),[f,p]=O.useState(null),[m,g]=O.useState(!1),_=G(c),v=i.trim().length>0&&q(c)&&(_===`local`||u.trim().length>0);return(0,D.jsxs)(`form`,{"data-testid":`add-backend-form`,onSubmit:async a=>{if(a.preventDefault(),!v||m)return;let o={name:i.trim(),host:K(c),apiKey:u.trim(),kind:_};p(null),g(!0);try{await Z(o),n(o),r(),e()}catch(e){p(X(Y(t,o.host),e))}finally{g(!1)}},className:`flex flex-col gap-4 flex-1 min-w-0`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,D.jsx)(E,{testId:`add-backend-name`,name:`add-backend-name`,type:`text`,label:t(o.BACKEND$NAME_LABEL),value:i,onChange:e=>{a(e),p(null)},placeholder:`e.g. My Server`,className:`w-full`}),(0,D.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:t(o.BACKEND$NAME_HELPER)})]}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,D.jsx)(E,{testId:`add-backend-host`,name:`add-backend-host`,type:`text`,label:t(o.BACKEND$HOST_LABEL),value:c,onChange:e=>{l(e),p(null)},placeholder:`http://localhost:8000`,className:`w-full`}),(0,D.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`add-backend-host-helper`,children:t(o.BACKEND$HOST_HELPER)})]}),(0,D.jsx)(E,{testId:`add-backend-api-key`,name:`add-backend-api-key`,type:`password`,label:t(o.BACKEND$KEY_LABEL),value:u,onChange:e=>{d(e),p(null)},placeholder:`sk-••••••••••`,className:`w-full`}),f?(0,D.jsx)(`div`,{role:`alert`,"data-testid":`add-backend-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:f}):null,(0,D.jsx)(C,{type:`submit`,variant:`secondary`,isDisabled:!v||m,testId:`add-backend-submit`,className:`w-full text-center`,children:t(m?o.ONBOARDING$BACKEND_STATUS_CHECKING:o.BACKEND$CONNECT)})]})}function le({onClose:e}){let{t}=s(`openhands`),{addBackend:n}=h(),r=$(),[i,a]=O.useState(!1),[l,u]=O.useState(``),d=l.trim()||J;return(0,D.jsxs)(`div`,{className:`flex flex-1 min-w-0 flex-col items-center gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,D.jsx)(F,{width:56,height:56,"aria-hidden":!0}),(0,D.jsx)(`h4`,{className:S,"data-testid":`add-backend-cloud-title`,children:t(o.BACKEND$CLOUD_TITLE)})]}),(0,D.jsx)(`p`,{className:`text-center text-sm leading-relaxed text-[var(--oh-muted)]`,children:t(o.BACKEND$CLOUD_DESCRIPTION)}),(0,D.jsx)(ie,{host:d,onSuccess:t=>{n({name:`OpenHands Cloud`,host:K(d),apiKey:t,kind:`cloud`}),r(),e()},testIdRoot:`add-backend`}),(0,D.jsxs)(`div`,{className:`w-full`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-expanded":i,"data-testid":`add-backend-advanced-toggle`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,D.jsx)(`span`,{children:t(o.BACKEND$ADVANCED)}),(0,D.jsx)(I,{className:c(`h-4 w-4 shrink-0 text-muted transition-transform`,i&&`rotate-180`),"aria-hidden":!0})]}),(0,D.jsxs)(`div`,{className:c(`pt-2`,!i&&`pointer-events-none invisible`),"aria-hidden":!i,children:[(0,D.jsx)(E,{testId:`add-backend-cloud-host`,name:`add-backend-cloud-host`,type:`text`,label:t(o.BACKEND$HOST_LABEL),value:l,onChange:u,placeholder:J,className:`w-full`}),(0,D.jsx)(`p`,{className:`mt-1 text-xs text-[var(--oh-muted)]`,children:t(o.BACKEND$LOGIN_CLOUD_HINT)})]})]})]})}function ue({mode:e,backend:t,onClose:n}){let{t:r}=s(`openhands`);if(e===`add`)return(0,D.jsx)(v,{onClose:n,closeOnEscape:!1,"aria-label":r(o.BACKEND$ADD_TITLE),children:(0,D.jsxs)(`div`,{"data-testid":`add-backend-modal`,className:c(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,y(`xl`),b),children:[(0,D.jsx)(T,{onClose:n,testId:`add-backend-close`}),(0,D.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,D.jsx)(`h2`,{className:x,children:r(o.BACKEND$ADD_TITLE)})}),(0,D.jsxs)(`div`,{className:`flex gap-6 px-6 pb-6 pt-2`,children:[(0,D.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,D.jsx)(ce,{onClose:n})}),(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center`,children:[(0,D.jsx)(`div`,{className:`flex-1 w-px bg-[var(--oh-border)]`}),(0,D.jsx)(`span`,{className:`py-3 text-xs uppercase text-[var(--oh-muted)]`,children:r(o.BACKEND$LOGIN_OR)}),(0,D.jsx)(`div`,{className:`flex-1 w-px bg-[var(--oh-border)]`})]}),(0,D.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,D.jsx)(le,{onClose:n})})]})]})});let i=`edit-backend`;return(0,D.jsx)(v,{onClose:n,closeOnEscape:!1,"aria-label":r(o.BACKEND$EDIT_TITLE),children:(0,D.jsxs)(`div`,{"data-testid":`${i}-modal`,className:c(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,y(`md`)),children:[(0,D.jsx)(T,{onClose:n,testId:`${i}-close`}),(0,D.jsx)(`h2`,{className:c(`pr-6`,x),children:r(o.BACKEND$EDIT_TITLE)}),(0,D.jsx)(Q,{mode:`edit`,backend:t,onSubmitted:n,testIdRoot:i})]})})}export{M as a,I as i,ue as n,P as o,L as r,Q as t};
@@ -1,5 +0,0 @@
1
- import{t as e}from"./common-DqjLSBOt.js";import{t}from"./settings-DGY6n4J2.js";import{t as n}from"./automation-DJ_3GeXD.js";import{i as r,n as i,r as a,t as o}from"./vendor~browser-DWk6fNtJ.js";var s=[`file1.txt`,`file2.txt`,`file3.txt`],c=[`reboot_skynet.exe`,`target_list.txt`,`terminator_blueprint.txt`],l={home:`/home/openhands`,favorites:[{label:`Downloads`,path:`/home/openhands/Downloads`}],locations:[]},u={"/projects":[{name:`demo-app`,path:`/projects/demo-app`},{name:`sample-tools`,path:`/projects/sample-tools`},{name:`notes-service`,path:`/projects/notes-service`}],"/projects/demo-app":[{name:`web-client`,path:`/projects/demo-app/web-client`},{name:`api-service`,path:`/projects/demo-app/api-service`}],"/projects/demo-app/web-client":[]},d=[i.all(`*/api/bash/execute_bash_command`,async()=>r.json({command:``,exit_code:0,output:``})),i.get(`*/api/file/home`,async()=>r.json(l)),i.get(`*/api/file/search_subdirs`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`)??``,n=u[t]??[];return r.json({path:t,items:n,subdirs:n,next_page_id:null})}),i.get(`*/api/file/:path`,async({params:e})=>r.json({path:`/${e.path?.toString()??`home`}`,subdirs:[]})),i.get(`/api/conversations/:conversationId/list-files`,async({params:e})=>{await o();let t=e.conversationId?.toString();return t?t===`test-conversation-id-2`?r.json(c):r.json(s):r.json(null,{status:400})}),i.get(`/api/conversations/:conversationId/select-file`,async({request:e})=>{await o();let t=new URL(e.url).searchParams.get(`file`)?.toString();return t?r.json({code:`Content of ${t}`}):r.json(null,{status:404})})],f=[{issue_number:6968,title:`Fix merge conflicts`,repo:`octocat/hello-world`,task_type:`MERGE_CONFLICTS`,git_provider:`github`}],p=[{issue_number:268,title:`Fix broken CI checks`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:281,title:`Fix issue`,repo:`octocat/earth`,task_type:`UNRESOLVED_COMMENTS`,git_provider:`github`},{issue_number:293,title:`Update documentation`,repo:`octocat/earth`,task_type:`OPEN_ISSUE`,git_provider:`github`},{issue_number:305,title:`Refactor user service`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:312,title:`Fix styling bug`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:327,title:`Add unit tests`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:331,title:`Implement dark mode`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:345,title:`Optimize build process`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:352,title:`Update dependencies`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`}],m=[...f,...p],h=[i.get(`*/api/v1/git/suggested-tasks/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`limit`),i=t.searchParams.get(`page_id`),a=[...m];if(i||n){let e=n?parseInt(n,10):30;a=a.slice(0,e)}return r.json({items:a,next_page_id:null})})],g=new Map([[`OpenAI_API_Key`,{value:`test-123`,description:`OpenAI API Key`}],[`Google_Maps_API_Key`,{value:`test-123`,description:`Google Maps API Key`}]]),_=[i.get(`*/api/settings/secrets`,async({request:e})=>{if(new URL(e.url).pathname.split(`/`).filter(Boolean).length>3)return;let t=Array.from(g.entries()).map(([e,{description:t}])=>({name:e,description:t}));return r.json({secrets:t})}),i.get(`*/api/settings/secrets/:name`,async({params:e})=>{let{name:t}=e;if(typeof t!=`string`)return r.json({detail:`Invalid name`},{status:400});let n=g.get(t);return n?new r(n.value,{headers:{"Content-Type":`text/plain`}}):r.json({detail:`Secret not found`},{status:404})}),i.put(`*/api/settings/secrets`,async({request:e})=>{let t=await e.json();return!t?.name||!t?.value?r.json({detail:`name and value are required`},{status:400}):(g.set(t.name,{value:t.value,description:t.description}),r.json({name:t.name,description:t.description}))}),i.delete(`*/api/settings/secrets/:name`,async({params:e})=>{let{name:t}=e;return typeof t==`string`?g.delete(t)?r.json({deleted:!0}):r.json({detail:`Secret not found`},{status:404}):r.json({detail:`Invalid name`},{status:400})})],v=(e,t)=>Array.from({length:e},(e,n)=>({id:`${n+1}`,full_name:`user/repo-${n+1}`,git_provider:t,is_public:Math.random()>.3,stargazers_count:Math.floor(Math.random()*1e3),pushed_at:new Date(Date.now()-Math.random()*90*24*60*60*1e3).toISOString()})),ee=e=>Array.from({length:e},(e,t)=>({name:t===0?`main`:t===1?`develop`:`feature/branch-${t}`,commit_sha:`abc123${t.toString().padStart(3,`0`)}`,protected:t===0,last_push_date:new Date(Date.now()-Math.random()*7*24*60*60*1e3).toISOString()})),y={github:v(120,`github`),gitlab:v(120,`gitlab`),bitbucket:v(120,`bitbucket`)},b=ee(25),x=[{path:`src/components/hello.tsx`,status:`UPDATED`},{path:`src/utils/new-helper.ts`,status:`ADDED`},{path:`src/old-module.py`,status:`DELETED`}];typeof window<`u`&&(window.__setMockGitChanges__=e=>{x=e});var S=[i.get(`*/api/user/repositories`,async({request:e})=>{await o(500);let t=new URL(e.url),n=t.searchParams.get(`selected_provider`),i=parseInt(t.searchParams.get(`page`)||`1`,10),a=parseInt(t.searchParams.get(`per_page`)||`30`,10),s=t.searchParams.get(`sort`)||`pushed`,c=t.searchParams.get(`installation_id`);if(!n)return r.json(`Git provider token required. (such as GitHub).`,{status:401});let l=[...y[n]||[]];if(s===`pushed`?l.sort((e,t)=>new Date(t.pushed_at).getTime()-new Date(e.pushed_at).getTime()):s===`stars`&&l.sort((e,t)=>(t.stargazers_count||0)-(e.stargazers_count||0)),c&&n===`github`){let e=(parseInt(c,10)||0)*20;l=l.slice(e,e+20)}let u=(i-1)*a,d=u+a,f=l.slice(u,d),p=d<l.length,m=i>1,h=Math.ceil(l.length/a),g=``;if(p||m){let e=[];m&&e.push(`</api/user/repositories?page=${i-1}&per_page=${a}>; rel="prev"`),p&&e.push(`</api/user/repositories?page=${i+1}&per_page=${a}>; rel="next"`),e.push(`</api/user/repositories?page=${h}&per_page=${a}>; rel="last"`),e.push(`</api/user/repositories?page=1&per_page=${a}>; rel="first"`),g=e.join(`, `)}let _=[...f];return _.length>0&&g&&(_[0]={..._[0],link_header:g}),r.json(_)}),i.get(`*/api/user/search/repositories`,async({request:e})=>{await o(300);let t=new URL(e.url),n=t.searchParams.get(`query`)||``,i=t.searchParams.get(`selected_provider`),a=parseInt(t.searchParams.get(`per_page`)||`5`,10),s=t.searchParams.get(`sort`)||`stars`,c=t.searchParams.get(`order`)||`desc`;if(!i)return r.json(`Git provider token required.`,{status:401});let l=[...(y[i]||[]).filter(e=>e.full_name.toLowerCase().includes(n.toLowerCase()))];s===`stars`&&l.sort((e,t)=>{let n=e.stargazers_count||0,r=t.stargazers_count||0;return c===`desc`?r-n:n-r});let u=l.slice(0,a);return r.json(u)}),i.get(`*/api/user/repository/branches`,async({request:e})=>{await o(300);let t=new URL(e.url),n=t.searchParams.get(`repository`),i=parseInt(t.searchParams.get(`page`)||`1`,10),a=parseInt(t.searchParams.get(`per_page`)||`30`,10);if(!n)return r.json(`Repository parameter is required`,{status:400});let s=(i-1)*a,c=s+a,l={branches:b.slice(s,c),has_next_page:c<b.length,current_page:i,per_page:a,total_count:b.length};return r.json(l)}),i.get(`*/api/user/search/branches`,async({request:e})=>{await o(200);let t=new URL(e.url),n=t.searchParams.get(`repository`),i=t.searchParams.get(`query`)||``,a=parseInt(t.searchParams.get(`per_page`)||`30`,10);if(!n)return r.json(`Repository parameter is required`,{status:400});let s=b.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())).slice(0,a);return r.json(s)}),i.get(`*/api/git/changes`,async()=>r.json(x)),i.get(`*/api/git/diff`,async()=>r.json({original:`def greet(name):
2
- return f"Hello, {name}!"
3
- `,modified:`def greet(name: str) -> str:
4
- return f"Hello, {name}! Welcome."
5
- `}))];function C(e,t){let n={...e};for(let[e,r]of Object.entries(t))typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!=null&&!Array.isArray(n[e])?n[e]=C(n[e],r):n[e]=r;return n}var w=t.agent_settings??{},T=w.llm,E=typeof T?.model==`string`?T.model:`openhands/claude-opus-4-5-20251101`,D={model_name:`AgentSettings`,sections:[{key:`general`,label:`General`,fields:[{key:`enable_sub_agents`,label:`Enable sub-agents`,description:`Allow the agent to delegate work to specialized built-in sub-agents.`,section:`general`,section_label:`General`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]},{key:`llm`,label:`LLM`,fields:[{key:`llm.model`,label:`Model`,description:`Select the model to use for this conversation.`,section:`llm`,section_label:`LLM`,value_type:`string`,default:E,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{key:`llm.api_key`,label:`API Key`,description:`Provide the API key used to authenticate requests for the selected model.`,section:`llm`,section_label:`LLM`,value_type:`string`,default:null,choices:[],depends_on:[],prominence:`critical`,secret:!0,required:!1},{key:`llm.base_url`,description:`Override the model provider's default API base URL when needed.`,label:`Base URL`,section:`llm`,section_label:`LLM`,value_type:`string`,default:null,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!1},{key:`llm.temperature`,label:`Temperature`,description:`Adjust randomness for non-deterministic model outputs.`,section:`llm`,section_label:`LLM`,value_type:`number`,default:null,choices:[],depends_on:[],prominence:`minor`,secret:!1,required:!1}]},{key:`critic`,label:`Critic`,fields:[{description:`Enable an additional critic pass to review the agent's work.`,key:`critic.enabled`,label:`Enable critic`,section:`critic`,section_label:`Critic`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{description:`Choose when the critic should review and intervene.`,key:`critic.mode`,label:`Mode`,section:`critic`,section_label:`Critic`,value_type:`string`,default:`finish_and_message`,choices:[{label:`finish_and_message`,value:`finish_and_message`},{label:`all_actions`,value:`all_actions`}],depends_on:[`critic.enabled`],prominence:`minor`,secret:!1,required:!0}]},{key:`condenser`,label:`Condenser`,fields:[{description:`Enable the default LLM-based condenser to summarize long conversation histories.`,key:`condenser.enable_default_condenser`,label:`Enable default condenser`,section:`condenser`,section_label:`Condenser`,value_type:`boolean`,default:!0,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{description:`Maximum number of tokens the condenser keeps after summarization. Leave blank for unlimited.`,key:`condenser.condenser_max_size`,label:`Condenser max size`,section:`condenser`,section_label:`Condenser`,value_type:`integer`,default:null,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]}]},O={model_name:`ConversationSettings`,sections:[{key:`general`,label:`General`,fields:[{key:`max_iterations`,label:`Max iterations`,section:`general`,description:`Maximum number of agent steps allowed before the conversation stops.`,section_label:`General`,value_type:`integer`,default:500,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!0}]},{key:`verification`,label:`Verification`,fields:[{key:`confirmation_mode`,label:`Confirmation mode`,description:`Pause for confirmation before the agent performs high-risk actions.`,section:`verification`,section_label:`Verification`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!0},{key:`security_analyzer`,label:`Security analyzer`,description:`Choose how OpenHands should analyze actions before asking for confirmation.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:`llm`,choices:[{label:`llm`,value:`llm`},{label:`none`,value:`none`}],depends_on:[`confirmation_mode`],prominence:`major`,secret:!1,required:!1}]}]},k={...t,provider_tokens_set:{},agent_settings_schema:D,agent_settings:{...w,critic:{mode:`finish_and_message`,enabled:!1},llm:{...T??{},api_key:null,model:E},condenser:{enable_default_condenser:!0,condenser_max_size:null},enable_sub_agents:!1},conversation_settings_schema:O,conversation_settings:{...t.conversation_settings??{}}},A={settings:structuredClone(k)},j={profiles:new Map,activeProfile:null},M=e=>decodeURIComponent(String(Array.isArray(e)?e[0]??``:e??``)),te=e=>({name:e.name,model:typeof e.config.model==`string`?e.config.model:null,base_url:typeof e.config.base_url==`string`?e.config.base_url:null,api_key_set:e.api_key_set}),N=e=>{let t=A.settings||structuredClone(k);A.settings={...t,agent_settings:{...t.agent_settings??{},llm:structuredClone(e.config)},llm_api_key_set:e.api_key_set}},ne=(e,t)=>{let n=structuredClone(e.config);return e.api_key_set&&`api_key`in n&&(t===`encrypted`?n.api_key=`gAAAAA_mock_encrypted_${e.name}`:t===`plaintext`||(n.api_key=null)),{name:e.name,config:n,api_key_set:e.api_key_set}},re=(e,t)=>{let n=structuredClone(t.llm??{});if(typeof n.model!=`string`||n.model.trim().length===0)return null;let r={name:e,config:n,api_key_set:typeof n.api_key==`string`&&n.api_key.trim().length>0};return j.profiles.set(e,r),j.activeProfile===e&&N(r),r},P=[`anthropic/claude-3.5`,`anthropic/claude-sonnet-4-20250514`,`anthropic/claude-sonnet-4-5-20250929`,`anthropic/claude-haiku-4-5-20251001`,`anthropic/claude-opus-4-5-20251101`,`anthropic/claude-opus-4-8`,`openai/gpt-3.5-turbo`,`openai/gpt-4o`,`openai/gpt-4o-mini`,`openhands/claude-sonnet-4-20250514`,`openhands/claude-sonnet-4-5-20250929`,`openhands/claude-haiku-4-5-20251001`,`openhands/claude-opus-4-5-20251101`,`openhands/minimax-m2.7`,`sambanova/Meta-Llama-3.1-8B-Instruct`],F=new Set([`anthropic/claude-opus-4-5-20251101`,`anthropic/claude-opus-4-8`,`anthropic/claude-sonnet-4-5-20250929`,`openhands/claude-opus-4-5-20251101`,`openhands/claude-sonnet-4-5-20250929`,`openhands/minimax-m2.7`]),I=[`openhands`,`anthropic`,`openai`,`mistral`,`gemini`,`deepseek`,`moonshot`,`minimax`],L=Array.from(new Set(P.map(e=>e.split(`/`)[0]).filter(e=>!!e))),ie=P.reduce((e,t)=>{if(!F.has(t))return e;let[n,...r]=t.split(`/`);return!n||r.length===0?e:(e[n]??=[],e[n].push(r.join(`/`)),e)},{}),ae=`1.24.0`,oe=[i.get(`*/server_info`,async()=>r.json({uptime:0,idle_time:0,version:ae,usable_tools:[`terminal`,`file_editor`,`task_tracker`,`browser_tool_set`],agents:[`CodeActAgent`],default_agent:`CodeActAgent`,models:P,security_analyzers:[`llm`,`none`]})),i.get(`*/api/llm/models`,async()=>r.json({models:P})),i.get(`*/api/llm/models/verified`,async()=>r.json({models:ie})),i.get(`*/api/llm/providers`,async()=>r.json({providers:L})),i.get(`*/api/options/models`,async()=>r.json({models:P,verified_models:[`claude-opus-4-5-20251101`,`claude-sonnet-4-5-20250929`],verified_providers:I,default_model:`openhands/minimax-m2.7`})),i.get(`*/api/v1/config/providers/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`query`)?.toLowerCase(),i=t.searchParams.get(`verified__eq`),a=new Set,o=[];for(let e of P){let[t]=e.split(`/`);t&&!a.has(t)&&(a.add(t),o.push({name:t,verified:I.includes(t)}))}if(n&&(o=o.filter(e=>e.name.toLowerCase().includes(n))),i!=null){let e=i===`true`;o=o.filter(t=>t.verified===e)}return r.json({items:o,next_page_id:null})}),i.get(`*/api/v1/config/models/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`query`)?.toLowerCase(),i=t.searchParams.get(`verified__eq`),a=t.searchParams.get(`provider__eq`),o=P.map(e=>{let[t,...n]=e.split(`/`),r=n.join(`/`);return{provider:t||null,name:r,verified:F.has(e)}});if(a&&(o=o.filter(e=>e.provider===a)),n&&(o=o.filter(e=>e.name.toLowerCase().includes(n))),i!=null){let e=i===`true`;o=o.filter(t=>t.verified===e)}return r.json({items:o,next_page_id:null})}),i.get(`*/api/options/security-analyzers`,async()=>r.json([`llm`,`none`])),i.get(`*/api/profiles`,async()=>r.json({profiles:Array.from(j.profiles.values()).map(te),active_profile:j.activeProfile})),i.get(`*/api/profiles/:name`,async({params:e,request:t})=>{let n=M(e.name),i=j.profiles.get(n);return i?r.json(ne(i,t.headers.get(`X-Expose-Secrets`))):r.json({detail:`Profile '${n}' not found`},{status:404})}),i.post(`*/api/profiles/:name`,async({params:e,request:t})=>{let n=M(e.name),i=await t.json();if(!i)return r.json({detail:`Empty body`},{status:400});let a=re(n,i);return a?r.json({name:a.name,message:`Profile '${a.name}' saved`},{status:201}):r.json({detail:`Profile requires llm.model`},{status:400})}),i.delete(`*/api/profiles/:name`,async({params:e})=>{let t=M(e.name);return j.profiles.delete(t),j.activeProfile===t&&(j.activeProfile=null),r.json({name:t,message:`Profile '${t}' deleted`})}),i.post(`*/api/profiles/:name/rename`,async({params:e,request:t})=>{let n=M(e.name),i=(await t.json())?.new_name?.trim()??``,a=j.profiles.get(n);if(!a)return r.json({detail:`Profile '${n}' not found`},{status:404});if(!i)return r.json({detail:`new_name is required`},{status:400});if(i!==n&&j.profiles.has(i))return r.json({detail:`Profile '${i}' already exists`},{status:409});j.profiles.delete(n);let o={...a,name:i};return j.profiles.set(i,o),j.activeProfile===n&&(j.activeProfile=i,N(o)),r.json({name:i,message:`Profile '${n}' renamed to '${i}'`})}),i.post(`*/api/profiles/:name/activate`,async({params:e})=>{let t=M(e.name),n=j.profiles.get(t);return n?(j.activeProfile=t,N(n),r.json({name:t,message:`Profile '${t}' activated and applied to current settings`,llm_applied:!0})):r.json({detail:`Profile '${t}' not found`},{status:404})}),i.get(`*/api/v1/web-client/config`,()=>{let e={posthog_client_key:`fake-posthog-client-key`,feature_flags:{hide_llm_settings:!1,hide_users_page:!1},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()};return r.json(e)}),i.get(`*/api/settings/conversation-schema`,async()=>(await o(),r.json(O))),i.get(`*/api/v1/settings/conversation-schema`,async()=>(await o(),r.json(O))),i.get(`*/api/v1/settings`,async()=>{await o();let{settings:e}=A;return e?r.json(e):r.json(null,{status:404})}),i.get(`*/api/settings`,async({request:e})=>{if(new URL(e.url).pathname.split(`/`).filter(Boolean).length>2)return;await o();let{settings:t}=A;if(!t)return r.json({agent_settings:{},conversation_settings:{},llm_api_key_is_set:!1});let n=e.headers.get(`X-Expose-Secrets`),i=structuredClone(t.agent_settings??{}),a=i.llm;a?.api_key&&(n===`encrypted`?a.api_key=`gAAAAA_mock_encrypted_${String(a.api_key).slice(0,8)}`:n===`plaintext`||(a.api_key=`**********`));let s=!!t.llm_api_key_set||!!t.agent_settings?.llm&&!!t.agent_settings.llm?.api_key;return r.json({agent_settings:i,conversation_settings:t.conversation_settings??{},llm_api_key_is_set:s})}),i.patch(`*/api/settings`,async({request:e})=>{await o();let t=await e.json();if(!t)return r.json({error:`Empty body`},{status:400});if(!t.agent_settings_diff&&!t.conversation_settings_diff)return r.json({error:`At least one of agent_settings_diff or conversation_settings_diff must be provided`},{status:400});let n=A.settings||structuredClone(k),i={...n};if(t.agent_settings_diff){let e=C(n.agent_settings??{},t.agent_settings_diff);i.agent_settings=e;let r=e.llm;r?.api_key&&typeof r.api_key==`string`&&r.api_key.trim().length>0&&(i.llm_api_key_set=!0)}return t.conversation_settings_diff&&(i.conversation_settings={...n.conversation_settings??{},...t.conversation_settings_diff}),A.settings=i,r.json({agent_settings:i.agent_settings??{},conversation_settings:i.conversation_settings??{},llm_api_key_is_set:i.llm_api_key_set??!1})}),i.post(`*/api/mcp/test`,async()=>(await o(),r.json({ok:!0,tools:[`mock_tool`]}))),i.get(`*/api/settings/agent-schema`,async()=>(await o(),r.json(D))),i.get(`*/api/v1/settings/agent-schema`,async()=>(await o(),r.json(D))),i.post(`*/api/v1/settings`,async({request:e})=>{await o();let t=await e.json();if(t){let e=A.settings||structuredClone(k);if(`agent_settings`in t||`conversation_settings`in t)return r.json({error:`Use *_diff nested settings payloads`,keys:[`agent_settings`,`conversation_settings`].filter(e=>e in t)},{status:422});let n={...e},i=t.agent_settings_diff;i&&(n.agent_settings=C(e.agent_settings??{},i));let a=t.conversation_settings_diff;a&&(n.conversation_settings={...e.conversation_settings??{},...a});for(let[e,r]of Object.entries(t))e!==`agent_settings_diff`&&e!==`conversation_settings_diff`&&e!==`agent_settings_schema`&&e!==`conversation_settings_schema`&&(n[e]=r);return A.settings=n,r.json(null,{status:200})}return r.json(null,{status:400})})],se={},R=Date.now(),z=`pagination-local`,B=`pagination-cloud`,ce=100,le=500,ue=Date.UTC(2026,4,13,0,0,0),V=[{id:`1`,title:`My New Project`,created_at:new Date(R).toISOString(),updated_at:new Date(R).toISOString(),execution_status:`waiting_for_confirmation`},{id:`2`,title:`Repo Testing`,created_at:new Date(R-2880*60*1e3).toISOString(),updated_at:new Date(R-2880*60*1e3).toISOString(),execution_status:`idle`,selected_repository:`octocat/hello-world`,git_provider:`github`},{id:`3`,title:`Another Project`,created_at:new Date(R-7200*60*1e3).toISOString(),updated_at:new Date(R-7200*60*1e3).toISOString(),execution_status:`idle`,selected_repository:`octocat/earth`,selected_branch:`main`},{id:`4`,title:`Archived Project`,created_at:new Date(R-14400*60*1e3).toISOString(),updated_at:new Date(R-14400*60*1e3).toISOString(),execution_status:`idle`,sandbox_status:`MISSING`},{id:`5`,title:`Errored Project`,created_at:new Date(R-10080*60*1e3).toISOString(),updated_at:new Date(R-10080*60*1e3).toISOString(),execution_status:`idle`,sandbox_status:`ERROR`},{id:z,title:`Local pagination fixture`,created_at:new Date(R-8640*60*1e3).toISOString(),updated_at:new Date(R-8640*60*1e3).toISOString(),execution_status:`idle`,workspace:{working_dir:`/workspace/project`}}],H=new Map(V.map(e=>[e.id,e])),de=new Map([[z,U(`Local pagination message`)],[B,U(`Cloud pagination message`)]]);function fe(e,t){return{id:`${t.toLowerCase().replaceAll(` `,`-`)}-${e}`,timestamp:new Date(ue+e*6e4).toISOString(),source:`agent`,llm_message:{role:`assistant`,content:[{type:`text`,text:`${t} ${e}`}]},activated_microagents:[],extended_content:[]}}function U(e){return Array.from({length:ce},(t,n)=>fe(n+1,e))}function pe(e,t){let n=Number(t.get(`limit`)??`100`),r=t.get(`timestamp__lt`),i=t.get(`sort_order`),a=[...r?e.filter(e=>e.timestamp<r):e].sort((e,t)=>i===`TIMESTAMP_DESC`?t.timestamp.localeCompare(e.timestamp):e.timestamp.localeCompare(t.timestamp));return{items:a.slice(0,n),next_page_id:a.length>n?`next-page`:null}}async function W(e,t){let n=de.get(e);return n?(t.has(`timestamp__lt`)&&await o(le),pe(n,t)):null}function me(){let t=new Date(R-8640*60*1e3).toISOString();return{id:B,created_by_user_id:null,selected_repository:null,selected_branch:null,git_provider:null,title:`Cloud pagination fixture`,trigger:null,pr_number:[],llm_model:`openhands/claude-haiku-4-5-20251001`,metrics:null,created_at:t,updated_at:t,execution_status:e.IDLE,conversation_url:null,session_api_key:null,sandbox_id:null,workspace:{working_dir:`/workspace/project`},public:!1,sub_conversation_ids:[]}}var G=me();function K(e){return{id:e.id,title:e.title??null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??`idle`,sandbox_status:e.sandbox_status??null,metrics:e.metrics??null,agent:e.agent??null,workspace:e.workspace??null}}function he(e){return!e||e.length===0?Array.from(H.values()).map(K):e.map(e=>{let t=H.get(e);return t?K(t):null})}var ge=[i.get(`*/api/conversations/search`,async({request:e})=>{let t=new URL(e.url),n=Number(t.searchParams.get(`limit`)??`20`),i=Array.from(H.values()).sort((e,t)=>t.updated_at.localeCompare(e.updated_at)).slice(0,n).map(K);return r.json({items:i,next_page_id:null})}),i.get(`*/api/conversations`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.getAll(`ids[]`).length>0?t.searchParams.getAll(`ids[]`):t.searchParams.getAll(`ids`);return r.json(he(n))}),i.get(`*/api/conversations/:conversationId`,async({params:e})=>{let t=e.conversationId,n=H.get(t);return n?r.json(K(n)):r.json(null,{status:404})}),i.post(`*/api/conversations`,async()=>{await o();let e={id:`${Math.floor(Math.random()*1e5)}`,title:`New Conversation`,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),execution_status:`idle`};return H.set(e.id,e),r.json(K(e),{status:201})}),i.patch(`/api/conversations/:conversationId`,async({params:e,request:t})=>{let n=e.conversationId,i=H.get(n);if(i){let e=await t.json();if(e?.title)return H.set(n,{...i,title:e.title,updated_at:new Date().toISOString()}),r.json(null,{status:200})}return r.json(null,{status:404})}),i.delete(`*/api/conversations/:conversationId`,async({params:e})=>{let t=e.conversationId;return H.has(t)?(H.delete(t),r.json(null,{status:200})):r.json(null,{status:404})}),i.get(`*/api/conversations/:conversationId/events/count`,async()=>r.json(0)),i.get(`*/api/conversations/:conversationId/events/search`,async({params:e,request:t})=>{let n=e.conversationId,i=await W(n,new URL(t.url).searchParams);if(i)return r.json(i);let a=se[n]??[];return r.json({items:a,next_page_id:null})}),i.post(`*/api/conversations/:conversationId/events`,async()=>r.json({ok:!0})),i.post(`*/api/conversations/:conversationId/pause`,async()=>r.json({success:!0})),i.post(`*/api/conversations/:conversationId/interrupt`,async()=>r.json({success:!0})),i.post(`*/api/conversations/:conversationId/run`,async()=>r.json({success:!0})),i.post(`*/api/cloud-proxy`,async({request:e})=>{let t=(await e.json()).path??`/`,n=new URL(t,`https://mock-cloud.test`);if(n.pathname===`/api/v1/app-conversations`){let e=n.searchParams.getAll(`ids`);if(e.length>0)return r.json(e.map(e=>e===B?G:null))}if(n.pathname===`/api/v1/app-conversations/search`)return r.json({items:[G],next_page_id:null});if(n.pathname===`/api/v1/conversation/${B}/events/search`){let e=await W(B,n.searchParams);return r.json(e)}return n.pathname===`/api/v1/settings`?r.json({llm_model:`openhands/claude-haiku-4-5-20251001`,llm_base_url:``,llm_api_key:null,llm_api_key_set:!1,search_api_key_set:!1,agent:`CodeActAgent`,language:`en`,user_consents_to_analytics:!1,provider_tokens_set:{github:``}}):n.pathname===`/api/keys/current`?r.json({id:`mock-key`,name:`Mock key`,org_id:`org-1`,user_id:`user-1`,auth_type:`api_key`}):n.pathname===`/api/organizations`?r.json({items:[{id:`org-1`,name:`Mock Org`,is_personal:!0}],current_org_id:`org-1`}):n.pathname===`/api/organizations/org-1/me`?r.json({org_id:`org-1`,user_id:`org-1`}):n.pathname===`/api/authenticate`?r.json({ok:!0}):r.json({})}),i.post(`*/api/conversations/:conversationId/ask_agent`,async()=>r.json({response:`Mock agent response`})),i.get(`*/api/vscode/url`,async()=>r.json({url:null})),i.post(`*/api/skills`,async()=>r.json({skills:[]})),i.post(`/api/v1/conversations/:conversationId/pending-messages`,async()=>r.json({id:`mock-pending-id`,position:0})),i.get(`*/api/conversations/:conversationId/microagents`,async()=>r.json({microagents:[{name:`init`,type:`agentskills`,content:`Initialize an AGENTS.md file for the repository`,triggers:[`/init`]},{name:`releasenotes`,type:`agentskills`,content:`Generate a changelog from the most recent release`,triggers:[`/releasenotes`]},{name:`test-runner`,type:`agentskills`,content:`Run the test suite and report results`,triggers:[`/test`]},{name:`code-search`,type:`knowledge`,content:`Search the codebase semantically`,triggers:[`/search`]},{name:`docker`,type:`agentskills`,content:`Docker usage guide for container environments`,triggers:[`docker`,`container`]},{name:`github`,type:`agentskills`,content:`GitHub API interaction guide`,triggers:[`github`,`git`]},{name:`work_hosts`,type:`repo`,content:`Available hosts for web applications`,triggers:[]}]}))],_e=[i.post(`*/api/cloud-proxy`,()=>r.json({error:`cloud proxy not available in mock mode`},{status:503})),i.get(`*/api/user/info`,()=>r.json({id:`1`,login:`octocat`,avatar_url:`https://avatars.githubusercontent.com/u/583231?v=4`,company:`GitHub`,email:`placeholder@placeholder.placeholder`,name:`monalisa octocat`})),i.post(`*/api/authenticate`,async()=>r.json({message:`Authenticated`})),i.post(`*/api/logout`,()=>r.json(null,{status:200}))],ve=[i.post(`*/api/submit-feedback`,async()=>(await o(1200),r.json({statusCode:200,body:{message:`Success`,link:`fake-url.com`,password:`abc123`}}))),i.post(`*/api/submit-feedback`,async()=>r.json({statusCode:200},{status:200}))],ye=[i.post(`https://us.i.posthog.com/e`,async()=>r.json(null,{status:200})),i.post(`https://z.openhands.dev/*`,async()=>r.json(null,{status:200}))],q=new Date().toISOString(),J=e=>new Date(Date.now()-e*864e5).toISOString(),be={automations:[{id:`a1000000-0000-0000-0000-000000000001`,name:`PR Triage Digest`,trigger:{type:`cron`,schedule:`0 9 * * 1-5`,schedule_human:`Weekdays at 09:00`},enabled:!0,repository:`acme/frontend-app`,model:`triage-fast`,created_at:J(90),updated_at:q,prompt:`Review newly opened pull requests in acme/frontend-app, identify risky changes, summarize likely impact, and prepare a concise digest with priority ordering for the engineering review channel.`,branch:`main`,plugins:[`GitHub`,`Slack`,`Linear`],notification:`Slack digest to #eng-reviews`,timezone:`America/Los_Angeles`,last_triggered_at:J(0)},{id:`a1000000-0000-0000-0000-000000000002`,name:`Nightly Security Pass`,trigger:{type:`cron`,schedule:`30 1 * * *`,schedule_human:`Daily at 01:30`},enabled:!0,repository:`acme/backend-api`,model:`security-careful`,created_at:J(60),updated_at:q,prompt:`Scan the acme/backend-api repository for known security vulnerabilities, outdated dependencies, and insecure code patterns. Produce a prioritized remediation summary.`,branch:`main`,plugins:[`GitHub`],notification:`Email to security-team@acme.com`,timezone:`UTC`,last_triggered_at:J(0)},{id:`a1000000-0000-0000-0000-000000000003`,name:`Docs Sync on Push`,trigger:{type:`cron`,schedule:`*/5 * * * *`,schedule_human:`Runs on every push`},enabled:!0,repository:`acme/docs`,model:`docs-fast`,created_at:J(45),updated_at:q,prompt:`Monitor acme/docs for new pushes. For each push, generate a changelog-ready summary of what changed and why.`,branch:`main`,plugins:[`GitHub`,`Slack`],notification:`Slack to #docs-updates`,timezone:`America/New_York`,last_triggered_at:J(1)},{id:`a1000000-0000-0000-0000-000000000004`,name:`Release Readiness Review`,trigger:{type:`cron`,schedule:`0 11 * * 5`,schedule_human:`Fridays at 11:00`},enabled:!1,repository:`acme/realtime-service`,model:`release-review`,created_at:J(80),updated_at:q,prompt:`Compile a release readiness report: list open blockers, active incidents, and pending approvals for acme/realtime-service.`,branch:`release`,plugins:[`GitHub`,`Linear`],notification:`Slack to #releases`,timezone:`America/Chicago`,last_triggered_at:J(14)},{id:`a1000000-0000-0000-0000-000000000005`,name:`Incident Webhook Summary`,trigger:{type:`cron`,schedule:`0 */2 * * *`,schedule_human:`On incident webhook`},enabled:!1,repository:`acme/incident-service`,model:`incident-summary`,created_at:J(30),updated_at:q,prompt:`Summarize incoming incident webhooks, categorize by severity, and post a digest to the on-call Slack channel.`,branch:`main`,plugins:[`Slack`],notification:`Slack to #oncall`,timezone:`UTC`,last_triggered_at:null},{id:`a1000000-0000-0000-0000-000000000006`,name:`PR Review on Open`,trigger:{type:`event`,source:`github`,on:`pull_request.opened`,filter:`repository.full_name == 'acme/frontend-app'`},enabled:!0,repository:`acme/frontend-app`,model:`review-fast`,created_at:J(15),updated_at:q,prompt:`When a new PR is opened, perform a thorough code review focusing on correctness, security, and performance. Post findings as inline comments.`,branch:`main`,plugins:[`GitHub`],notification:`GitHub PR comment`,last_triggered_at:J(0)},{id:`a1000000-0000-0000-0000-000000000007`,name:`Release Notes Generator`,trigger:{type:`event`,source:`github`,on:`release.published`,filter:`glob(release.tag_name, 'v*') && !release.prerelease`},enabled:!0,repository:`acme/backend-api`,model:`docs-fast`,created_at:J(10),updated_at:q,prompt:`Generate comprehensive release notes from the commits since the last release. Include breaking changes, new features, and bug fixes.`,branch:`main`,plugins:[`GitHub`],notification:`GitHub release body update`,last_triggered_at:J(3)}],total:7},xe=(e,t=9)=>{let n=new Date(Date.now()-e*864e5);return n.setHours(t,0,0,0),n.toISOString()};function Y(e,t,r,i=9,a=!0){let o=xe(r,i);return{id:e,status:t,conversation_id:a?`conv-${e}`:null,bash_command_id:a?`cmd-${e}`:null,error_detail:t===n.FAILED?`Process exited with code 1`:null,started_at:o,completed_at:new Date(new Date(o).getTime()+12e4).toISOString()}}var Se={"a1000000-0000-0000-0000-000000000001":[Y(`r1-01`,n.COMPLETED,0),Y(`r1-02`,n.COMPLETED,1),Y(`r1-03`,n.FAILED,2),Y(`r1-04`,n.COMPLETED,3),Y(`r1-05`,n.COMPLETED,4),Y(`r1-06`,n.COMPLETED,7),Y(`r1-07`,n.FAILED,8),Y(`r1-08`,n.COMPLETED,9),Y(`r1-09`,n.COMPLETED,10),Y(`r1-10`,n.COMPLETED,11)],"a1000000-0000-0000-0000-000000000002":[Y(`r2-01`,n.COMPLETED,0,1),Y(`r2-02`,n.COMPLETED,1,1),Y(`r2-03`,n.COMPLETED,2,1),Y(`r2-04`,n.FAILED,3,1),Y(`r2-05`,n.COMPLETED,4,1)],"a1000000-0000-0000-0000-000000000003":[Y(`r3-01`,n.COMPLETED,1),Y(`r3-02`,n.COMPLETED,2),Y(`r3-03`,n.COMPLETED,3)],"a1000000-0000-0000-0000-000000000004":[Y(`r4-01`,n.FAILED,14,11,!1),Y(`r4-02`,n.COMPLETED,21,11)],"a1000000-0000-0000-0000-000000000005":[],"a1000000-0000-0000-0000-000000000006":[Y(`r6-01`,n.COMPLETED,0,14),Y(`r6-02`,n.COMPLETED,0,11),Y(`r6-03`,n.FAILED,1,16),Y(`r6-04`,n.COMPLETED,2,10),Y(`r6-05`,n.COMPLETED,3,9)],"a1000000-0000-0000-0000-000000000007":[Y(`r7-01`,n.COMPLETED,3,15),Y(`r7-02`,n.COMPLETED,10,12)]},X=new Map(be.automations.map(e=>[e.id,{...e}])),Ce=[i.get(`*/api/automation/health`,async()=>(await o(100),r.json({status:`ok`}))),i.get(`*/api/automation/v1`,async({request:e})=>{await o(300);let t=new URL(e.url),n=Number(t.searchParams.get(`limit`)??`50`),i=Number(t.searchParams.get(`offset`)??`0`),a=Array.from(X.values()),s={automations:a.slice(i,i+n),total:a.length};return r.json(s)}),i.get(`*/api/automation/v1/:id/runs`,async({params:e,request:t})=>{await o(200);let n=e.id;if(!X.has(n))return r.json({detail:`Automation not found`},{status:404});let i=new URL(t.url),a=Number(i.searchParams.get(`limit`)??`50`),s=Number(i.searchParams.get(`offset`)??`0`),c=Se[n]??[],l={runs:c.slice(s,s+a),total:c.length};return r.json(l)}),i.get(`*/api/automation/v1/:id`,async({params:e})=>{await o(200);let t=X.get(e.id);return t?r.json(t):r.json({detail:`Automation not found`},{status:404})}),i.patch(`*/api/automation/v1/:id`,async({params:e,request:t})=>{await o(200);let n=e.id,i=await t.clone().json(),a=X.get(n);if(!a)return r.json({detail:`Automation not found`},{status:404});let s={...a,...i,updated_at:new Date().toISOString()};return X.set(n,s),r.json(s)}),i.post(`*/api/automation/v1/:id/dispatch`,async({params:e})=>{await o(200);let t=e.id;if(!X.get(t))return r.json({detail:`Automation not found`},{status:404});let i={id:crypto.randomUUID(),status:n.PENDING,conversation_id:null,bash_command_id:null,error_detail:null,started_at:new Date().toISOString(),completed_at:null};return r.json(i,{status:201})}),i.delete(`*/api/automation/v1/:id`,async({params:e})=>{await o(200);let t=e.id;return X.has(t)?(X.delete(t),new r(null,{status:204})):r.json({detail:`Automation not found`},{status:404})})],we={ok:!0,tools:[]},Te=[i.post(`*/api/mcp/test`,async()=>r.json(we))],Z=[],Q=[];function $(){return{workspaces:Z.map(e=>({...e})),workspaceParents:Q.map(e=>({...e}))}}var Ee=[i.get(`*/api/workspaces`,async()=>r.json($())),i.post(`*/api/workspaces`,async({request:e})=>{let t=await e.json();for(let e of t.workspaces??[]){let t=Z.findIndex(t=>t.path===e.path);t>=0?Z[t]={...e}:Z.push({...e})}return r.json($())}),i.delete(`*/api/workspaces`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`),n=Z.length;return Z=Z.filter(e=>e.path!==t),r.json({deleted:Z.length!==n})}),i.post(`*/api/workspaces/parents`,async({request:e})=>{let t=await e.json();for(let e of t.parents??[]){let t=Q.findIndex(t=>t.path===e.path);t>=0?Q[t]={...e}:Q.push({...e})}return r.json($())}),i.delete(`*/api/workspaces/parents`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`),n=Q.length;return Q=Q.filter(e=>e.path!==t),r.json({deleted:Q.length!==n})}),i.post(`*/api/auth/workspace-session`,async()=>r.json({ok:!0})),i.delete(`*/api/auth/workspace-session`,async()=>new r(null,{status:204}))],De=a(...d,...h,..._,...S,...oe,...ge,..._e,...ve,...ye,...Ce,...Te,...Ee);export{De as worker};
@@ -1 +0,0 @@
1
- import{t as e}from"./react-Dy05vyj5.js";var t={url:``,screenshotSrc:``},n=e(e=>({...t,setUrl:t=>e({url:t}),setScreenshotSrc:t=>e({screenshotSrc:t}),reset:()=>e(t)}));export{n as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{a as r,f as i,o as a}from"./path-utils-BjxzIGLp.js";import{t as o}from"./useMutation-DDo48A8t.js";import{o as s,t as c}from"./declaration-DaUdB2Wg.js";import{n as l}from"./QueryClientProvider-w1cZWY41.js";import{t as u}from"./useTranslation-CEcjrme-.js";import{r as d}from"./vendor~root-layout~home~conversation-panel~conversation-DkwcKRtv.js";import{a as f,n as p,t as m}from"./custom-toast-handlers-BohXx7uh.js";import{g as h,i as g,t as _}from"./utils-CdgBzLA7.js";import{t as v}from"./common-DqjLSBOt.js";import{d as y,n as b}from"./agent-server-client-options-9agOSarV.js";import{n as x}from"./active-backend-context-I2w666XY.js";import{r as S}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{t as C}from"./agent-server-conversation-service.api-Cagoqq1V.js";import{n as ee}from"./navigation-context-aNGUUtdq.js";import{t as te}from"./dist-xtCm0O6P.js";import{t as w}from"./proxy-sRh0WKI7.js";import{t as T}from"./react-Dy05vyj5.js";import{r as ne,t as E}from"./middleware-CfatjPYZ.js";import{t as re}from"./conversation-local-storage-YmOVXxxW.js";import{t as D}from"./use-is-authed-hHndEep7.js";import{r as ie}from"./use-settings-BPTbE7lg.js";import{t as ae}from"./use-tracking-DQYdZpxi.js";import{o as oe,s as se,t as O}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js";import{t as k}from"./git-status-mapper-DnL9OC8_.js";var A=s(),j=te(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function M({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,A.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,A.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,A.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(j({orientation:e,color:t,size:n,inset:r}),i)})}var N=()=>{let e=l();return o({mutationFn:e=>C.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{re(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},P=()=>{let{t:e}=u(`openhands`),t=l(),{conversationId:n,navigate:i}=ee();return o({mutationKey:[`stop-conversation`],mutationFn:async e=>a(e.conversationId),onMutate:async()=>{let n=f.loading(e(c.TOAST$STOPPING_CONVERSATION),m);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&f.dismiss(i.toastId),p(e(c.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(a,o,s)=>{s?.toastId&&f.dismiss(s.toastId),f.success(e(c.TOAST$CONVERSATION_STOPPED),m),r(t,o.conversationId,{execution_status:v.PAUSED,sandbox_status:`PAUSED`}),n===o.conversationId&&i(`/conversations`)}})},F=e(t()),I=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),L=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),R=e=>(0,A.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,A.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),z=e=>(0,A.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,A.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`})}),B=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),V=()=>{let{trackDownloadTrajectoryButtonClicked:e}=ae(),{t}=u(`openhands`);return o({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),g(await C.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{p(t(c.CONVERSATION$DOWNLOAD_ERROR))}})},H=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),U=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},W=()=>{let{data:e,isLoading:t}=ie();return{providers:F.useMemo(()=>U(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function G(){let e=y().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function K(e){let t=G(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await w({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function ce(e){let t=G(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await w({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function q(e){let t=G(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await w({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var J=e=>e,Y=()=>y().backend.kind===`cloud`,X=e=>!e||e===`undefined`||e===`null`,Z={items:[],next_page_id:null},Q={items:[],next_page_id:null},le={items:[],next_page_id:null},$=class{static async searchGitRepositories(e,t,n=100,r,i){return X(t)||!Y()?Z:K({provider:J(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return X(e)||!Y()?Z:K({provider:J(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(X(e)||!Y())return Z;let a=n[t];return a?K({provider:J(e),installationId:a,limit:i,pageId:r}):Z}static async getRepositoryBranches(e,t,n=``,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return X(e)||!Y()?le:ce({provider:J(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await C.resolveConversationWorkingDir(e);return(await new S(b({workingDir:t})).gitChanges(t,{ref:`HEAD`})).map(e=>({path:e.path,status:k(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new S(b()).gitDiff(t,{ref:`HEAD`});return{modified:n.modified??``,original:n.original??``}}},ue=e=>{let{data:t}=D(),{providers:r}=W(),i=x();return n({queryKey:[`installations`,e,i.backend.id,i.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&r.length>0&&h(e,i.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function de(e){let{provider:t,pageSize:n=30,enabled:r=!0}=e,{providers:a}=W(),{data:o}=ue(t),s=o?.items,c=x(),l=t?h(t,c.backend.kind):!1,u=i({queryKey:[`repositories`,t,l,n,c.backend.id,c.orgId,...l?[s||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!s)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,s,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&s){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<s.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:r&&(a||[]).length>0&&!!t&&(!l||Array.isArray(s)&&s.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:u.data,isLoading:u.isLoading,isError:u.isError,hasNextPage:u.hasNextPage,isFetchingNextPage:u.isFetchingNextPage,fetchNextPage:u.fetchNextPage,onLoadMore:()=>{u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()}}}function fe(e,t,r,i=100){return n({queryKey:[`repositories`,`search`,e,t,i],queryFn:async()=>t?(await $.searchGitRepositories(e,t,i)).items:[],enabled:!!e&&!!t&&!r,staleTime:1e3*60*5,gcTime:1e3*60*15})}function pe(e,t){let[n,r]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var me={recentRepositories:[],lastSelectedProvider:null},he=T()(ne((e,t)=>({...me,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:E(()=>localStorage)}));function ge({gitProvider:e,className:t}){return(0,A.jsxs)(A.Fragment,{children:[e===`github`&&(0,A.jsx)(oe,{size:14,className:t}),e===`gitlab`&&(0,A.jsx)(se,{size:14,className:t}),e===`bitbucket`&&(0,A.jsx)(O,{size:14,className:t}),e===`bitbucket_data_center`&&(0,A.jsx)(O,{size:14,className:t}),e===`azure_devops`&&(0,A.jsx)(R,{className:_(t,`w-[14px] h-[14px]`)})]})}function _e({buttonClassName:e,handleSubmit:t,disabled:n}){return(0,A.jsx)(`button`,{type:`button`,className:_(`flex items-center justify-center rounded-full border border-white size-8`,n?`cursor-not-allowed border-[var(--oh-muted)]`:`cursor-pointer hover:bg-white/10`,e),"data-name":`arrow-up-circle-fill`,"data-testid":`submit-button`,onClick:t,disabled:n,children:(0,A.jsx)(d,{className:`w-4 h-4`,color:n?`var(--oh-muted)`:`white`})})}export{N as _,fe as a,W as c,B as d,z as f,P as g,I as h,pe as i,H as l,L as m,ge as n,de as o,R as p,he as r,$ as s,_e as t,V as u,M as v};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-Ddu8jDOQ.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./conversation-HgR_TTPE.js";export{e as default};
@@ -1,19 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-CMredyYX.js","assets/rolldown-runtime-BFRubm34.js","assets/vendor~files-tab-Buz36Y-q.js","assets/iconBase-BVhFI-0E.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js","assets/agent-server-client-options-9agOSarV.js","assets/agent-server-conversation-service.api-Cagoqq1V.js","assets/preload-helper-CT1Z6Pdu.js","assets/profiles-client-BrqNmaDV.js","assets/v4-khGvL7i2.js","assets/agent-server-compatibility-B7QStIcH.js","assets/server-client-DYv_GHPl.js","assets/settings-service.api-DxIEtvx6.js","assets/proxy-sRh0WKI7.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js","assets/settings-DGY6n4J2.js","assets/acp-providers-DJr8DlNG.js","assets/declaration-DaUdB2Wg.js","assets/common-DqjLSBOt.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js","assets/QueryClientProvider-w1cZWY41.js","assets/useTranslation-CEcjrme-.js","assets/context-CEQZwATj.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Ceeqkj0k.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CXivI4Ym.js","assets/objectWithoutPropertiesLoose-DSQKyRhw.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9Il_wz8U.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dr3Ow7Ms.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-1pTajrpX.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B7I1ZxCx.js","assets/react-Dy05vyj5.js","assets/conversation-tab-empty-state-DYjKsg_c.js","assets/utils-CdgBzLA7.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-OFpe9fX_.js","assets/markdown-renderer-D6B-u2nM.js","assets/checkmark-Rmpruj7q.js","assets/copy-BM0RpLez.js","assets/active-backend-context-I2w666XY.js","assets/health-store-B5f0S2FY.js","assets/use-active-conversation-q1wT8LI5.js","assets/conversation-service.api-B_Pdmwsa.js","assets/navigation-context-aNGUUtdq.js","assets/use-user-conversation-BRAseenw.js","assets/use-agent-state-CCHlVqvY.js","assets/conversation-state-store-D-w0uurj.js","assets/use-runtime-is-ready-DBWzvAmc.js","assets/chevron-left-small-6nyFCWVQ.js","assets/file-DwHCkWZT.js","assets/folder-2h1hR1Qb.js","assets/link-external-DtcdPFbw.js","assets/files-tab-store-DLU28g8C.js","assets/use-event-store-Cxqc45Sw.js","assets/typography-Bvw0IxaN.js","assets/dist-xtCm0O6P.js","assets/conversation-local-storage-YmOVXxxW.js","assets/git-status-mapper-DnL9OC8_.js","assets/retrieve-axios-error-message-BY-yIkIq.js","assets/browser-tab-be3QvXg9.js","assets/vendor~browser-tab-NZdVoI2Z.js","assets/browser-store-JRrcGdlk.js","assets/vscode-tab-DEt72yJX.js","assets/use-unified-vscode-url-DFtNIC1Q.js","assets/vscode-url-helper-BMq8JBhB.js","assets/waiting-for-runtime-message-DSjJfeoj.js","assets/brand-button-LBFNic99.js","assets/planner-tab-B-5EeCEm.js","assets/plan-components--aLlpASH.js","assets/use-handle-plan-click-Bfl0zIBr.js","assets/custom-toast-handlers-BohXx7uh.js","assets/createLucideIcon-Ddu8jDOQ.js","assets/i18n-zDndR1Ne.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js","assets/use-create-conversation-BEzddjXn.js","assets/useMutation-DDo48A8t.js","assets/mutation-CaJwPR9O.js","assets/use-tracking-DQYdZpxi.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BPuuVEqr.js","assets/use-settings-BPTbE7lg.js","assets/query-keys-tAsQcc_9.js","assets/conversation-store-CC-isCnP.js","assets/middleware-CfatjPYZ.js","assets/lesson-plan-C18uB_56.js","assets/task-list-tab-BiizRsY3.js","assets/use-task-list-YMkSzdDv.js","assets/u-check-circle-half-DjpjzWu3.js","assets/u-check-circle-u9QiS4Fr.js","assets/terminal-CpgZx6go.js","assets/vendor~terminal-0ObOedYm.js","assets/vendor~terminal-T4IDBjWs.css","assets/command-store-UzKGSUC2.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,L as i,M as a,k as o}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as s}from"./react-dom-hVBnwgwZ.js";import{t as c}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{c as l,i as u,r as d,s as f,u as p}from"./path-utils-BjxzIGLp.js";import{t as m}from"./useMutation-DDo48A8t.js";import{o as h,t as g}from"./declaration-DaUdB2Wg.js";import{n as _}from"./QueryClientProvider-w1cZWY41.js";import{t as v}from"./Trans-BJeYqz2A.js";import{t as y}from"./useTranslation-CEcjrme-.js";import{a as b,c as x,d as S,f as C,i as w,l as T,n as E,o as ee,r as D,s as O,t as te,u as k}from"./messages-Bz9TWjlh.js";import{c as ne,d as re,f as A,i as j,l as ie,n as M,r as N,s as P,t as F,u as I}from"./sidebar-mobile-menu-toggle-C0mmabKj.js";import{a as L,n as R,o as ae,r as oe,t as se}from"./custom-toast-handlers-BohXx7uh.js";import{n as z,r as ce,t as B}from"./vendor~conversation-panel~conversation-gp03cWZW.js";import{t as le}from"./x-JOBEVLW0.js";import{C as ue,P as de,S as V,T as H,b as fe,c as pe,d as me,l as he,m as ge,o as _e,t as U,u as ve,w as ye,x as be,y as xe}from"./utils-CdgBzLA7.js";import{t as Se}from"./common-DqjLSBOt.js";import{i as Ce}from"./agent-server-client-options-9agOSarV.js";import{n as W}from"./active-backend-context-I2w666XY.js";import{a as we,i as Te,t as Ee}from"./agent-server-conversation-service.api-Cagoqq1V.js";import{t as De}from"./modal-backdrop-BDqI1zBV.js";import{n as Oe}from"./modal-body-CCLCqX1J.js";import{r as ke}from"./base-modal-DZCNv0A4.js";import{t as Ae}from"./brand-button-LBFNic99.js";import{t as je}from"./loading-spinner-DNwR4--Z.js";import{n as Me}from"./navigation-context-aNGUUtdq.js";import{h as Ne}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BC9XTECT.js";import{O as Pe}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DSqEbr0N.js";import{t as Fe}from"./styled-tooltip-TCp7svY3.js";import{r as Ie,u as Le}from"./dropdown-classes-Vqz86I0R.js";import{c as Re,g as ze,h as Be,m as Ve,r as He,v as Ue}from"./chat-send-button-5qz0zj6R.js";import{t as We}from"./react-Dy05vyj5.js";import{n as Ge}from"./middleware-CfatjPYZ.js";import{i as Ke,s as qe}from"./conversation-local-storage-YmOVXxxW.js";import{t as G}from"./conversation-store-CC-isCnP.js";import{t as Je}from"./modal-close-button-gQgKqUf-.js";import{t as Ye}from"./v4-khGvL7i2.js";import{t as Xe}from"./use-is-authed-hHndEep7.js";import{t as Ze}from"./use-click-outside-element-DhxCUyWl.js";import{r as Qe}from"./use-settings-BPTbE7lg.js";import{t as $e}from"./use-tracking-DQYdZpxi.js";import{t as et}from"./use-create-conversation-BEzddjXn.js";import{r as tt}from"./conversation-service.api-B_Pdmwsa.js";import{i as nt}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-CfAc3nMS.js";import{n as rt,t as K}from"./context-menu-list-item-D0swnhFt.js";import{a as it,o as q,r as at}from"./use-llm-profiles-E-jjZMZw.js";import{t as ot}from"./u-edit-BIYzjs3v.js";import{t as st}from"./skills-TYjOUQ2d.js";import{t as ct}from"./terminal-BSYITdM0.js";import{t as lt}from"./use-user-conversation-BRAseenw.js";import{t as ut}from"./conversation-state-store-D-w0uurj.js";import{r as dt}from"./typography-Bvw0IxaN.js";import{C as ft,D as pt,E as mt,I as ht,M as gt,O as _t,P as vt,S as yt,T as bt,_ as xt,a as St,b as Ct,d as wt,f as Tt,g as Et,h as Dt,i as Ot,j as kt,k as At,m as jt,n as Mt,p as Nt,r as Pt,t as Ft,v as It,w as Lt,x as Rt,y as zt}from"./git-control-bar-branch-button-D8blTNXh.js";import{n as J,r as Bt,t as Y}from"./use-active-conversation-q1wT8LI5.js";import{t as X}from"./use-agent-state-CCHlVqvY.js";import{a as Vt,c as Ht,d as Z,f as Ut,l as Wt,n as Gt,o as Kt,s as qt,t as Jt,u as Yt}from"./conversation-websocket-context-G95yfL81.js";import{S as Xt,a as Zt,d as Qt,o as $t,t as en}from"./use-event-store-Cxqc45Sw.js";import{t as tn}from"./command-store-UzKGSUC2.js";import{t as nn}from"./lesson-plan-C18uB_56.js";import{t as rn}from"./copy-BM0RpLez.js";import{t as an}from"./use-runtime-is-ready-DBWzvAmc.js";import{r as on}from"./plan-components--aLlpASH.js";import{t as sn}from"./use-breakpoint-DpxHDmuH.js";import{t as cn}from"./globe-qFjFNG6J.js";import{n as ln,t as un}from"./use-unified-vscode-url-DFtNIC1Q.js";import{t as dn}from"./use-task-list-YMkSzdDv.js";import{t as fn}from"./vendor~conversation-panel~conversation~alert-banner-D_hRW_zc.js";var Q=e(t(),1),pn={curAgentState:V.LOADING},mn=We(e=>({...pn,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(pn)})),hn=`openhands-last-conversation-by-backend`;function gn(e,t){return t?`${e}::${t}`:e}function _n(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(hn);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 vn(e){if(!(typeof window>`u`))try{window.localStorage.setItem(hn,JSON.stringify(e))}catch{}}function yn(e,t,n){if(!n)return;let r=_n();r[gn(e,t)]=n,vn(r)}function bn(e,t){let n=_n(),r=gn(e,t);r in n&&(delete n[r],vn(n))}var xn=e=>({action:C.CHANGE_AGENT_STATE,args:{agent_state:e}}),Sn=e=>`error`in e,Cn=e=>`type`in e&&e.type===`error`,wn=()=>{let{send:e}=S(),t=en(e=>e.events);Q.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!($t(n)&&Zt(n))){if(Sn(n)){if(n.error_code===401){R(`Session expired.`);return}typeof n.error==`string`?R(n.error):R(n.message);return}Cn(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(xn(V.PAUSED))}},[t.length])},Tn=()=>{let{curAgentState:e}=X();return{runtimeActive:!ue.includes(e)}};function En({children:e}){return wn(),Tn(),e}var $=h(),Dn=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,$.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),On={entriesByConversation:{}},kn=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),An=We()(Ge(e=>({...On,addPending:(t,n)=>{let r=Ye();return e(e=>kn(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>kn(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>kn(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>kn(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`}));function jn({onClick:e}){let{t}=y(`openhands`);return(0,$.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,$.jsx)(Dn,{className:`w-3.5 h-3.5 fill-success`}),(0,$.jsx)(`span`,{children:t(g.CHAT_INTERFACE$BTW_GOT_IT)})]})}function Mn({conversationId:e}){let{t}=y(`openhands`),n=An(e=>e.entriesByConversation),r=An(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,$.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,$.jsx)(T,{title:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`opacity-60`,children:t(g.CHAT_INTERFACE$BTW_PREFIX)}),(0,$.jsx)(`span`,{children:n.question}),i&&(0,$.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-[var(--oh-border-input)] border-t-transparent animate-spin`})]}),details:i?t(g.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,$.jsx)(jn,{onClick:()=>r(e,n.id)})},n.id)})})}var Nn=`${H} `,Pn=(e,t)=>{let n=An(e=>e.addPending),r=An(e=>e.resolve),i=An(e=>e.fail);return(0,Q.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(Nn);if(!e||!s){t(a);return}let c=o.slice(H.length).trim();if(!c)return;let l=n(e,c);d(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])},Fn=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function In(e){return U(Fn,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 Ln(e){return e?`white`:`var(--oh-muted)`}var Rn=`font-normal text-sm leading-5 truncate`;function zn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=y(`openhands`),{trackPullButtonClick:a}=$e(),o=n&&t&&r;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(pe())},disabled:!o,className:U(In(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(ft,{width:12,height:12,color:Ln(o)})}),(0,$.jsx)(`div`,{className:U(Rn,`max-w-[76px]`),title:i(g.COMMON$PULL),children:i(g.COMMON$PULL)})]})}function Bn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=y(`openhands`),{trackPushButtonClick:o}=$e(),s=n&&t&&i;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(he(r))},disabled:!s,className:U(In(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(Lt,{width:12,height:12,color:Ln(s)})}),(0,$.jsx)(`div`,{className:U(Rn,`max-w-[77px]`),title:a(g.COMMON$PUSH),children:a(g.COMMON$PUSH)})]})}function Vn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=y(`openhands`),{trackCreatePrButtonClick:o}=$e(),s=n&&t&&i;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(_e(r))},disabled:!s,className:U(In(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(yt,{width:12,height:12,color:Ln(s)})}),(0,$.jsx)(`div`,{className:U(Rn,`max-w-[126px]`),title:a(g.COMMON$PULL_REQUEST),children:a(g.COMMON$PULL_REQUEST)})]})}function Hn(e){return e.kind===`BashCommand`}function Un(e){return e.kind===`BashOutput`}function Wn(e){return e.kind===`BashError`}function Gn(e,t,n){let r=(0,Q.useRef)(null),i=(0,Q.useRef)([]),a=(0,Q.useRef)([]),o=(0,Q.useRef)(new Map);return(0,Q.useEffect)(()=>{if(!n)return;let s=Ce(e,t),c=new WebSocket(s);r.current=c,c.onopen=()=>{for(let{command:e,cwd:t,timeout:n,resolve:r,reject:o}of i.current)a.current.push({resolve:r,reject:o}),c.send(JSON.stringify({command:e,cwd:t,timeout:n}));i.current=[]},c.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Hn(t)){let e=a.current.shift();e&&o.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Un(t)&&t.command_id){let e=o.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(o.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else Wn(t)&&l(`Bash error: ${t.code}: ${t.detail}`)};function l(e){let t=Error(e);for(let{reject:e}of i.current)e(t);i.current=[];for(let e of a.current)e.reject(t);a.current=[];for(let e of o.current.values())e.reject(t);o.current.clear()}return c.onclose=()=>{r.current=null,l(`Bash WebSocket closed`)},c.onerror=()=>{r.current=null,l(`Bash WebSocket error`)},()=>{c.onclose=null,c.onerror=null,c.close(),r.current=null,l(`Bash WebSocket unmounted`)}},[n,e,t]),(0,Q.useCallback)((e,t,n)=>new Promise((o,s)=>{let c=r.current;if(!c||c.readyState===WebSocket.CLOSED||c.readyState===WebSocket.CLOSING){s(Error(`Bash WebSocket not available`));return}c.readyState===WebSocket.CONNECTING?i.current.push({command:e,cwd:t,timeout:n,resolve:o,reject:s}):(a.current.push({resolve:o,reject:s}),c.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var Kn={"github.com":`github`,"gitlab.com":`gitlab`,"bitbucket.org":`bitbucket`,"dev.azure.com":`azure_devops`};function qn(e){return e.replace(/\.git$/,``)}function Jn(e){return e?Kn[e.toLowerCase()]??null:null}function Yn(e){let t=e.split(`/`).filter(Boolean),n=t.indexOf(`_git`);return n===-1?t.join(`/`):[...t.slice(0,n),...t.slice(n+1)].join(`/`)}function Xn(e,t,n){let r=qn(n.replace(/^\/+/,``)),i=Jn(t);return{url:e,host:t,repository:(i===`azure_devops`?Yn(r):r)||null,provider:i}}function Zn(e){let t=e?.trim();if(!t)return null;let n=t.match(/^[^@\s]+@([^:\s]+):(.+)$/);if(n){let e=n[1];return Xn(t,e,n[2])}try{let e=new URL(t);return Xn(t,e.hostname||null,e.pathname)}catch{return null}}var Qn={repository:null,branch:null,provider:null,remoteUrl:null},$n=[`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
- `);async function er(e,t){let n=await e($n,t,10);if(n.exit_code!==0)return Qn;let r=n.stdout.indexOf(`
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 Qn;let s=Zn(i);return{repository:s?.repository??null,provider:s?.provider??null,remoteUrl:i||null,branch:o}}var tr=()=>{let{data:e}=Y(),t=an(),{backend:n}=W(),r=n.kind===`local`,i=e?.id,a=e?.conversation_url,o=e?.session_api_key,s=e?.workspace?.working_dir?.trim(),l=!!e?.selected_repository,u=!!e?.git_provider,d=!!e?.selected_branch,f=r&&t&&!!i&&!!s&&(!l||!u||!d),p=Gn(a,o,f),m=(0,Q.useRef)(p);return m.current=p,c({queryKey:[`local-git-info`,i,a,o,s],queryFn:async()=>er((e,t,n)=>m.current(e,t,n),s),enabled:f,retry:!1,staleTime:1e4,refetchInterval:1e4,gcTime:1e3*60*5,meta:{disableToast:!0}})},nr=()=>{let e=_(),{t}=y(`openhands`);return m({mutationFn:e=>Ee.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)}),R(t(g.CONVERSATION$FAILED_TO_UPDATE_REPOSITORY))},onSuccess:()=>{oe(t(g.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 rr({children:e,tooltipMessage:t,testId:n,shouldShowTooltip:r}){return r?(0,$.jsx)(Fe,{content:t,placement:`top`,showArrow:!0,tooltipClassName:`bg-white text-black`,children:(0,$.jsx)(`span`,{"data-testid":n,className:`hover:opacity-100`,children:e})}):e}function ir({isOpen:e,onClose:t,onLaunch:n,defaultProvider:r=`github`}){let{t:i}=y(`openhands`),{providers:a}=Re(),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{a.length===1&&!o?s(a[0]):a.length>1&&!o&&r&&a.includes(r)&&s(r)},[a,o,r]);let f=(0,Q.useCallback)(e=>{e!==o&&(s(e),l(null),d(null))},[o]),p=(0,Q.useCallback)(e=>{e?(l(e),d(null)):(l(null),d(null))},[]),m=(0,Q.useCallback)(e=>{d(e)},[]),h=()=>{!c||!u||(n(c,u),l(null),d(null),t())},_=()=>{s(null),l(null),d(null),t()};if(!e)return null;let v=c?.git_provider||o||r,b=!!c&&!!u;return(0,$.jsx)(De,{onClose:_,children:(0,$.jsxs)(Oe,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,$.jsx)(Je,{onClose:_,testId:`close-open-repository-modal`}),(0,$.jsx)(`div`,{className:`w-full pr-6`,children:(0,$.jsx)(ke,{title:i(g.CONVERSATION$OPEN_REPOSITORY)})}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:i(g.CONVERSATION$SELECT_OR_INSERT_LINK)}),a.length>1&&(0,$.jsx)(St,{providers:a,value:o,placeholder:`Select Provider`,onChange:f})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-[10px] w-full`,children:[(0,$.jsx)(Pt,{provider:v,value:c?.id||null,repositoryName:c?.full_name||null,onChange:p,placeholder:`Search repositories...`,className:`w-full`}),(0,$.jsx)(Ot,{repository:c?.full_name||null,provider:v,selectedBranch:u,onBranchSelect:m,defaultBranch:c?.main_branch||null,placeholder:`Select branch...`,disabled:!c,className:`w-full`})]})]}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,$.jsx)(Ae,{type:`button`,variant:`secondary`,onClick:_,children:i(g.BUTTON$CANCEL)}),(0,$.jsx)(Ae,{type:`button`,variant:`primary`,onClick:h,isDisabled:!b,children:i(g.BUTTON$LAUNCH)})]})]})})}function ar({onSuggestionsClick:e}){let{t}=y(`openhands`),{conversationId:n}=J(),[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),{addRecentRepository:c}=He(),l=Z(e=>e.enqueuePendingMessage),u=Z(e=>e.markPendingMessageError),{backend:d}=W(),f=d.kind===`local`,{providers:p}=Re(),m=f||p.length>0,{data:h}=Y(),{repositoryInfo:_}=_t(),{data:v}=tr(),b=vt(),x=Gt()?.isLoadingHistory??!1,C=(0,Q.useRef)(b);(0,Q.useEffect)(()=>{C.current=b},[b]);let{send:w}=S(),T=(0,Q.useRef)(w);(0,Q.useEffect)(()=>{T.current=w},[w]);let E=O(),{mutate:ee}=nr(),{mutate:D,isPending:te}=et(),k=h?.selected_repository||_?.selectedRepository,ne=h?.git_provider||_?.gitProvider,re=h?.selected_branch||_?.selectedBranch,A=k||v?.repository||void 0,j=ne||v?.provider,ie=re||v?.branch||void 0,M=(h?.id?we(h.id):null)?.selected_workspace??null,N=M&&M.replace(/\/+$/,``).split(`/`).pop()||null,P=!!A&&!!j,F=!!h&&b===`OPEN`&&!x;(0,Q.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,Q.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let I=(e,r)=>{n&&(c(e),ee({conversationId:n,repository:e.full_name,branch:r.name,gitProvider:e.git_provider},{onSuccess:()=>{if(C.current!==`OPEN`){R(t(g.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;E?.scrollDomToBottom(),Promise.resolve(T.current({action:`message`,args:{content:a,timestamp:new Date().toISOString()}})).catch(e=>{o&&u(o,e instanceof Error?e.message:`Failed to send message`)})}}))},L=!f||!!A||!!N,ae=f&&!P;return L||ie||P?(0,$.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,$.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center overflow-x-auto flex-nowrap relative scrollbar-hide`,children:[L?(0,$.jsx)(Mt,{selectedRepository:A,gitProvider:j,workspaceName:N,onClick:()=>i(!0),disabled:!F||ae}):null,ie?(0,$.jsx)(Ft,{selectedBranch:ie,selectedRepository:A,gitProvider:j}):null,P?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(rr,{tooltipMessage:t(g.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pull-button-tooltip`,shouldShowTooltip:!P,children:(0,$.jsx)(zn,{onSuggestionsClick:e,hasRepository:P,providerTokensReady:m,isConversationReady:F})}),(0,$.jsx)(rr,{tooltipMessage:t(g.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-push-button-tooltip`,shouldShowTooltip:!P,children:(0,$.jsx)(Bn,{onSuggestionsClick:e,hasRepository:P,providerTokensReady:m,currentGitProvider:j,isConversationReady:F})}),(0,$.jsx)(rr,{tooltipMessage:t(g.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pr-button-tooltip`,shouldShowTooltip:!P,children:(0,$.jsx)(Vn,{onSuggestionsClick:e,hasRepository:P,providerTokensReady:m,currentGitProvider:j,isConversationReady:F})})]}):null]}),(0,$.jsx)(ir,{isOpen:r,onClose:()=>i(!1),onLaunch:I,defaultProvider:j})]}):null}function or({onSubmit:e,disabled:t=!1}){let{images:n,files:r,imagesMarkedUploadAsFile:i,clearAllFiles:a,subConversationTaskId:o}=G(),{curAgentState:s}=X(),{data:c}=Y(),{conversationId:l}=Bt(),u=l??c?.id??null,{taskStatus:d}=pt(o,c?.id||null),{handleUpload:f}=wt(),p=Tt(u,Pn(u,t=>{let{imagesToEmbed:o,imagesAsFiles:s}=ht(n,i);e(t,o,[...r,...s]),a()}));return(0,$.jsxs)(`div`,{"data-testid":`interactive-chat-box`,children:[(0,$.jsx)(Nt,{disabled:t||s===V.AWAITING_USER_CONFIRMATION||ge(d),isNewConversationPending:t,onSubmit:p,onFilesPaste:f}),(0,$.jsx)(`div`,{className:`mt-3 pb-3`,children:(0,$.jsx)(ar,{onSuggestionsClick:e=>{p(e)}})})]})}function sr(){let e=en(e=>e.events),t=en(e=>e.uiEvents),n=Q.useMemo(()=>t.filter(Kt),[t]),r=Q.useMemo(()=>e,[e]),i=Q.useMemo(()=>n.length,[n]),a=Q.useMemo(()=>r.some(e=>e.source===`agent`&&!Xt(e)&&!Qt(e)),[r]),o=Vt(r);return{storeEvents:e,uiEvents:t,renderableEvents:n,allConversationEvents:r,totalEvents:i,hasSubstantiveAgentActions:a,conversationUserEventsExist:o,userEventsExist:o}}var cr=e=>`timestamp`in e?e.timestamp:void 0,lr=e=>{let t=!!e&&Ke(e),n=t?void 0:e,{data:r}=lt(e??null),{data:i,isFetched:a}=qt(n??void 0),o=en(e=>e.addEvents),[s,c]=Q.useState(!1),[l,u]=Q.useState(!0),d=Q.useRef(!1),f=Q.useRef(!0);return Q.useEffect(()=>{if(d.current=!1,c(!1),t){f.current=!1,u(!1);return}f.current=!0,u(!0)},[e,t]),Q.useEffect(()=>{t||!a||!i||i.hasMore||(f.current=!1,u(!1))},[t,a,i?.hasMore,n]),{isLoading:s,hasMore:l,loadOlder:Q.useCallback(async()=>{if(!e||Ke(e)||d.current||!f.current||!r)return;let{events:t}=en.getState(),n=t[0];if(!n)return;let i=cr(n);if(!i){f.current=!1,u(!1);return}d.current=!0,c(!0);try{let t=await Wt.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),(!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])}};function ur(){return(0,$.jsxs)(`div`,{className:`flex items-center space-x-1.5 rounded-full bg-[var(--oh-surface)] px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:0ms]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:75ms]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:150ms]`})]})}function dr({suggestion:e,onClick:t}){let{t:n}=y(`openhands`);return(0,$.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,Q.useMemo)(()=>{switch(e.label){case`INCREASE_TEST_COVERAGE`:return(0,$.jsx)(Rt,{width:24,height:24,color:`#fff`});case`AUTO_MERGE_PRS`:return(0,$.jsx)(Ct,{width:19,height:20,color:`#fff`});case`FIX_README`:return(0,$.jsx)(zt,{width:24,height:24,color:`#fff`});case`CLEAN_DEPENDENCIES`:return(0,$.jsx)(It,{width:24,height:24,color:`#fff`});default:return null}},[e]),(0,$.jsx)(`span`,{"data-testid":`suggestion`,className:`text-[15px] font-normal leading-5 text-white text-center cursor-pointer`,children:n(e.label)})]})}function fr({suggestions:e,onSuggestionClick:t}){return(0,$.jsx)(`div`,{"data-testid":`suggestions`,className:`grid grid-cols-2 gap-5 max-w-fit`,children:e.map((e,n)=>(0,$.jsx)(dr,{suggestion:e,onClick:t},n))})}var pr=g.SUGGESTIONS$HACKER_NEWS,mr=`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
- The script should only use tools that are widely available on unix systems, like curl and grep.`,hr=g.SUGGESTIONS$HELLO_WORLD,gr=`I want to create a Hello World app in Javascript that:
6
- * Displays Hello World in the middle.
7
- * Has a button that when clicked, changes the greeting with a bouncing animation to fun versions of Hello.
8
- * Has a counter for how many times the button has been clicked.
9
- * Has another button that changes the app's background color.`,_r=g.SUGGESTIONS$TODO_APP,vr=`I want to create a VueJS app that allows me to:
10
- * See all the items on my todo list
11
- * add a new item to the list
12
- * mark an item as done
13
- * totally remove an item from the list
14
- * change the text of an item
15
- * set a due date on the item
16
-
17
- This should be a client-only app with no backend. The list should persist in localStorage.`,yr={repo:xt,"non-repo":{[pr]:mr,[hr]:gr,[_r]:vr}};function br({onSuggestionsClick:e}){let{t}=y(`openhands`),{shouldHideSuggestions:n}=G();return(0,$.jsx)(Pe,{children:!n&&(0,$.jsxs)(B.div,{"data-testid":`chat-suggestions`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:`easeInOut`},className:`pointer-events-auto absolute inset-x-4 bottom-[151px] top-0 flex flex-col items-center justify-center md:inset-x-8`,children:[(0,$.jsx)(`div`,{className:`flex flex-col items-center p-4 rounded-xl w-full`,children:(0,$.jsx)(`span`,{className:`pb-6 text-[32px] font-medium leading-5 text-white`,children:t(g.LANDING$TITLE)})}),(0,$.jsx)(fr,{suggestions:Object.entries(yr.repo).slice(0,4).map(([e,t])=>({label:e,value:t})),onSuggestionClick:e})]})})}var xr={files:[],initialPrompt:null,selectedRepository:null,selectedRepositoryProvider:null,replayJson:null},Sr=We(e=>({...xr,addFile:t=>e(e=>({files:[...e.files,t]})),removeFile:t=>e(e=>({files:e.files.filter((e,n)=>n!==t)})),clearFiles:()=>e(()=>({files:[]})),setInitialPrompt:t=>e(()=>({initialPrompt:t})),clearInitialPrompt:()=>e(()=>({initialPrompt:null})),setSelectedRepository:t=>e(()=>({selectedRepository:t})),clearSelectedRepository:()=>e(()=>({selectedRepository:null})),setSelectedRepositoryProvider:t=>e(()=>({selectedRepositoryProvider:t})),setReplayJson:t=>e(()=>({replayJson:t})),reset:()=>e(()=>xr)})),Cr=e=>(0,$.jsx)(`svg`,{width:12,height:17,viewBox:`0 0 12 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.5304 6.46978L10.4697 7.53044L6.75006 3.81077L6.75006 17.0001H5.25006L5.25006 3.81077L1.53039 7.53044L0.469727 6.46978L6.00006 0.939453L11.5304 6.46978Z`,fill:`currentColor`})});function wr({onClick:e}){return(0,$.jsx)(`button`,{type:`button`,onClick:e,"data-testid":`scroll-to-bottom`,className:`flex items-center justify-center size-8 rounded-full bg-[var(--oh-surface)] text-[var(--oh-muted)] hover:bg-tertiary hover:text-white rotate-180 cursor-pointer transition-colors`,children:(0,$.jsx)(Cr,{width:15,height:15})})}var Tr=[{width:`w-[25%]`,height:`h-4`,align:`justify-end`},{width:`w-[60%]`,height:`h-4`,align:`justify-start`},{width:`w-[45%]`,height:`h-4`,align:`justify-start`},{width:`w-[65%]`,height:`h-20`,align:`justify-start`},{width:`w-[35%]`,height:`h-4`,align:`justify-end`},{width:`w-[50%]`,height:`h-4`,align:`justify-start`},{width:`w-[30%]`,height:`h-4`,align:`justify-end`},{width:`w-[75%]`,height:`h-4`,align:`justify-start`},{width:`w-[55%]`,height:`h-4`,align:`justify-start`}];function Er({width:e,height:t}){return(0,$.jsx)(`div`,{className:U(`rounded-md bg-foreground/5 animate-pulse`,e,t)})}function Dr(){return(0,$.jsx)(`div`,{className:`flex flex-col gap-6 p-4 w-full h-full overflow-hidden`,"data-testid":`chat-messages-skeleton`,"aria-label":`Loading conversation`,children:Tr.map((e,t)=>(0,$.jsx)(`div`,{className:U(`flex w-full`,e.align),children:(0,$.jsx)(Er,{width:e.width,height:e.height})},t))})}var Or=220;function kr({message:e,onDismiss:t,onRetry:n}){let{t:r,i18n:i}=y(`openhands`),[a,o]=Q.useState(!1),[s,c]=Q.useState(!1),l=Q.useRef(null),u=i.exists(e,{ns:`openhands`}),d=u?String(r(e)):e,f=d.length>Or,p=f&&!a;return Q.useLayoutEffect(()=>{let e=l.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){c(!1);return}c(e.getBoundingClientRect().height>t*1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[d,p,a,e]),(0,$.jsxs)(`div`,{className:U(`flex w-full gap-2 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-raised)] p-2 text-[var(--oh-foreground)]`,s?`items-start`:`items-center`),"data-testid":`error-message-banner`,children:[(0,$.jsx)(ae,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:de},"data-testid":`error-message-banner-icon`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{ref:l,className:U(`whitespace-pre-wrap break-words text-sm text-[var(--oh-muted)]`,p&&`line-clamp-3`),"data-testid":`error-message-banner-content`,children:u?(0,$.jsx)(v,{ns:`openhands`,i18nKey:e}):e}),f&&(0,$.jsx)(`button`,{type:`button`,className:`mt-1 cursor-pointer text-xs font-normal text-[var(--oh-foreground)] underline`,onClick:()=>o(e=>!e),"data-testid":`error-message-banner-toggle`,children:r(a?g.COMMON$VIEW_LESS:g.COMMON$VIEW_MORE)})]}),(0,$.jsxs)(`div`,{className:U(`flex shrink-0 gap-1`,s?`self-start`:`items-center`),children:[n&&(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`error-message-banner-retry`,children:r(g.CHAT_INTERFACE$MESSAGE_RETRY)}),t&&(0,$.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":r(g.BUTTON$CLOSE),"data-testid":`error-message-banner-dismiss`,children:(0,$.jsx)(le,{className:`h-4 w-4`,"aria-hidden":!0})})]})]})}function Ar(){let{conversationId:e}=Bt(),t=Z(e=>e.pendingMessages),n=Z(e=>e.markPendingMessageError),r=Z(e=>e.markPendingMessageSending),i=Z(e=>e.removePendingMessage),a=G(e=>e.restoreMessageToInputIfEmpty),{send:o}=S(),s=Q.useMemo(()=>e?t.filter(t=>At(e,t.conversationId)):[],[t,e]),c=Q.useCallback(async e=>{let t=Z.getState().pendingMessages.find(t=>t.id===e);if(t){r(e);try{await o(k(t.text,t.imageUrls,t.fileUrls,t.timestamp))}catch(t){n(e,t instanceof Error?t.message:`Failed to send message`)}}},[o,n,r]),l=Q.useCallback((e,t)=>{a(t),i(e)},[a,i]);return s.length===0?null:(0,$.jsx)($.Fragment,{children:s.map(e=>(0,$.jsx)(D,{type:`user`,message:e.text,pendingStatus:e.status,onRetry:e.status===`error`?()=>c(e.id):void 0,onStop:e.status===`sending`?()=>l(e.id,e.text):void 0,children:e.imageUrls.length>0&&(0,$.jsx)(E,{size:`small`,images:e.imageUrls})},e.id))})}var jr=()=>{let{data:e}=Y();return m({mutationKey:[`unified-upload-files`],mutationFn:async t=>{let{conversationId:n,files:r}=t;return tt(n,r,e)},meta:{disableToast:!0}})},Mr=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 3.25C9.92893 3.25 8.25 4.92893 8.25 7V10H7C6.44772 10 6 10.4477 6 11V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V11C18 10.4477 17.5523 10 17 10H15.75V7C15.75 4.92893 14.0711 3.25 12 3.25ZM14.25 10V7C14.25 5.75736 13.2426 4.75 12 4.75C10.7574 4.75 9.75 5.75736 9.75 7V10H14.25Z`,fill:`currentColor`})});function Nr(){let{t:e}=y(`openhands`),{data:t}=Qe();return t?.confirmation_mode?(0,$.jsx)(Fe,{closeDelay:100,content:e(g.COMMON$CONFIRMATION_MODE_ENABLED),tooltipClassName:`bg-white text-black hover:bg-transparent`,children:(0,$.jsx)(`div`,{className:`flex items-center justify-center w-[26px] h-[26px] rounded-lg bg-[var(--oh-surface)]`,children:(0,$.jsx)(Mr,{width:15,height:15})})}):null}var Pr=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.jsx)(`path`,{d:`M15 12C15 12.7956 14.6839 13.5587 14.1213 14.1213C13.5587 14.6839 12.7956 15 12 15C11.2044 15 10.4413 14.6839 9.87868 14.1213C9.31607 13.5587 9 12.7956 9 12C9 11.2044 9.31607 10.4413 9.87868 9.87868C10.4413 9.31607 11.2044 9 12 9C12.7956 9 13.5587 9.31607 14.1213 9.87868C14.6839 10.4413 15 11.2044 15 12Z`,fill:`currentColor`})});function Fr({status:e,statusColor:t}){return(0,$.jsx)(`div`,{"data-testid":`chat-status-indicator`,className:Ne(`w-full max-w-full rounded-[100px] p-1 bg-[var(--oh-surface)] flex items-center gap-1`),children:(0,$.jsxs)(Pe,{mode:`wait`,children:[(0,$.jsx)(B.span,{className:`flex-shrink-0 animate-[pulse_1.2s_ease-in-out_infinite]`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(0,$.jsx)(Pr,{className:`w-4 h-4`,color:t})},`dot-${e}`),(0,$.jsx)(B.span,{initial:{opacity:0,y:-2},animate:{opacity:1,y:0},exit:{opacity:0,y:2},transition:{duration:.3},className:`pr-1.5 font-normal text-[11px] leading-[16px] normal-case break-words whitespace-normal`,children:e},`text-${e}`)]})})}var Ir=()=>{let e=_(),{navigate:t}=Me(),{t:n}=y(`openhands`),{data:r}=Y();return m({mutationFn:async()=>{if(!r?.id)throw Error(`No active conversation`);let e=await Ee.createConversation(void 0,void 0,void 0,void 0,void 0,void 0,void 0,r.sandbox_id??void 0);if(e.status===`ERROR`)throw Error(e.detail||`Failed to create new conversation`);return{newConversationId:e.app_conversation_id?e.app_conversation_id:`task-${e.id}`,oldConversationId:r.id}},onMutate:()=>{L.loading(n(g.CONVERSATION$CLEARING),{...se,id:`clear-conversation`})},onSuccess:r=>{L.dismiss(`clear-conversation`),oe(n(g.CONVERSATION$CLEAR_SUCCESS)),t(`/conversations/${r.newConversationId}`),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]})},onError:e=>{L.dismiss(`clear-conversation`);let t=n(g.CONVERSATION$CLEAR_UNKNOWN_ERROR);e instanceof Error?t=e.message:typeof e==`string`&&(t=e),R(n(g.CONVERSATION$CLEAR_FAILED,{error:t}))}})};function Lr(e,t){return e?`github`:t?`replay`:`direct`}function Rr(){let{trackInitialQuerySubmitted:e,trackUserMessageSent:t}=$e(),{setMessageToSend:n}=G(),{errorMessage:r,removeErrorMessage:i,setErrorMessage:a}=Ut(),{isTask:o,taskStatus:s,taskDetail:c}=_t(),l=o,u=Gt(),{send:d}=S(),{renderableEvents:f,allConversationEvents:p,totalEvents:m,hasSubstantiveAgentActions:h,userEventsExist:_}=sr(),v=Z(e=>e.enqueuePendingMessage),C=Z(e=>e.markPendingMessageError),w=Z(e=>e.pendingMessages),{t:T}=y(`openhands`),E=Q.useRef(null),{scrollDomToBottom:D,onChatBodyScroll:O,hitBottom:ne,autoScroll:re,setAutoScroll:A,setHitBottom:j}=on(E),{mutate:ie,isPending:M}=Ir(),{curAgentState:N}=X(),{handleBuildPlanClick:P}=b(),{data:F}=Y(),I=F?.sandbox_status??null,L=I===`MISSING`||I===`ERROR`,ae=N===V.RUNNING||N===V.LOADING;Q.useEffect(()=>{if(ae)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),P(e),D())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[ae,P,D]);let{selectedRepository:oe,replayJson:se}=Sr(),{conversationId:z}=Bt(),{mutateAsync:ce}=jr(),{isLoading:B,hasMore:le,loadOlder:ue}=lr(z),de=Q.useRef(null),H=Q.useCallback(e=>{if(l||B||!le)return;let t=e.scrollTop<=80,n=e.scrollHeight<=e.clientHeight+80;!t&&!n||(de.current={scrollHeight:e.scrollHeight,scrollTop:e.scrollTop},ue().catch(e=>{de.current=null,a(e instanceof Error&&e.message?e.message:T(g.ERROR$GENERIC))}))},[le,B,l,ue,a,T]),fe=Q.useCallback(e=>{e.deltaY<0&&e.currentTarget.scrollTop<=0&&H(e.currentTarget)},[H]),pe=Q.useMemo(()=>z?w.some(e=>At(z,e.conversationId)):!1,[w,z]),he=p.length>0||pe||!u?.isLoadingHistory,ge=!!z,_e=!he&&!o,U=Yt(e=>z?(e.entriesByConversation[z]?.length??0)>0:!1),ye=async(r,i,a)=>{if(r.trim()===`/new`){if(!z){R(T(g.CONVERSATION$CLEAR_NO_ID));return}if(m===0){R(T(g.CONVERSATION$CLEAR_EMPTY));return}if(M)return;ie();return}let o=[...i],s=[...a];m===0?e({entryPoint:Lr(oe!==null,se!==null),queryCharacterLength:r.length,replayJsonSize:se?.length}):t({sessionMessageCount:m,currentMessageLength:r.length});let c=kt([...o,...s]);if(!c.isValid){R(`Error: ${c.errorMessage}`);return}let l=o.map(e=>gt(e)),u=await Promise.all(l),f=new Date().toISOString(),{skipped_files:p,uploaded_files:h}=s.length>0?await ce({conversationId:z,files:s}):{skipped_files:[],uploaded_files:[]};p.forEach(e=>R(e.reason));let _=`${T(`CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE`)}: ${h.join(`
18
-
19
- `)}`,y=h.length>0?`${r}\n\n${_}`:r,b=v({conversationId:z,text:r,content:y,imageUrls:u,fileUrls:h,timestamp:f});D(),n(``);try{await d(k(y,u,h,f))}catch(e){C(b,e instanceof Error?e.message:`Failed to send message`)}};Q.useEffect(()=>{if(de.current&&E.current){let{scrollHeight:e,scrollTop:t}=de.current,n=E.current,r=n.scrollHeight-e;r>0&&(n.scrollTop=t+r),de.current=null;return}re&&D()},[f.length,pe,D]);let be=Q.useRef(H);Q.useEffect(()=>{be.current=H}),Q.useEffect(()=>{let e=E.current;e&&be.current(e)},[f.length,le]);let xe={scrollRef:E,autoScroll:re,setAutoScroll:A,scrollDomToBottom:D,hitBottom:ne,setHitBottom:j,onChatBodyScroll:O},Se=N===V.LOADING||N===V.INIT,Ce=N===V.STOPPED,W=N===V.PAUSED,we=ve({isPausing:W,isTask:o,taskStatus:s,isStartingStatus:Se,isStopStatus:Ce,curAgentState:N}),Te=me({isPausing:W,isTask:o,taskStatus:s,taskDetail:c,isStartingStatus:Se,isStopStatus:Ce,curAgentState:N,errorMessage:r,t:T});return(0,$.jsx)(ee,{value:xe,children:(0,$.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between px-4`,"data-testid":`chat-interface`,children:[!h&&!pe&&!_&&!U&&!_e&&!l&&m===0&&!L&&(0,$.jsx)(br,{onSuggestionsClick:e=>n(e)}),(0,$.jsxs)(`div`,{ref:E,"data-testid":`chat-scroll-container`,onScroll:e=>{O(e.currentTarget),H(e.currentTarget)},onWheel:fe,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:[_e&&ge&&(0,$.jsx)(Dr,{}),_e&&!ge&&(0,$.jsx)(`div`,{className:`flex justify-center`,"data-testid":`loading-spinner`,children:(0,$.jsx)(je,{size:`small`})}),B&&(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-sm text-neutral-400`,"data-testid":`loading-older-events`,children:[(0,$.jsx)(je,{size:`small`}),(0,$.jsx)(`span`,{children:T(g.CHAT_INTERFACE$FETCHING_OLDER_MESSAGES)})]}),(0,$.jsx)(x,{conversationId:z,anchorEventId:null}),he&&f.length>0&&(0,$.jsx)(te,{messages:f,allEvents:p}),(0,$.jsx)(Ar,{})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-[6px]`,children:[(0,$.jsx)(Mn,{conversationId:z}),r&&(0,$.jsx)(kr,{message:r,onDismiss:i,onRetry:r===`Unable to connect to server`?()=>u?.reconnect():void 0}),L?(0,$.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,$.jsx)(`p`,{className:`text-xs font-semibold text-[var(--oh-foreground)]`,children:T(I===`ERROR`?g.CHAT_INTERFACE$ERROR_SANDBOX_TITLE:g.CHAT_INTERFACE$ARCHIVED_SANDBOX_TITLE)}),(0,$.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] mt-0.5`,children:T(I===`ERROR`?g.CHAT_INTERFACE$ERROR_SANDBOX_DESCRIPTION:g.CHAT_INTERFACE$ARCHIVED_SANDBOX_DESCRIPTION)})]}):(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-full mb-1 z-20`,children:(0,$.jsxs)(`div`,{className:`flex justify-between relative`,children:[(0,$.jsxs)(`div`,{className:`flex items-end gap-1 pointer-events-auto`,children:[(0,$.jsx)(Nr,{}),Se&&(0,$.jsx)(Fr,{statusColor:we,status:Te})]}),ne?N===V.RUNNING&&(0,$.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,$.jsx)(ur,{})}):(0,$.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,$.jsx)(wr,{onClick:D})})]})}),(0,$.jsx)(or,{onSubmit:ye,disabled:M})]})]})]})})}function zr({isRightPanelShown:e}){return(0,$.jsx)(`div`,{className:`flex justify-center w-full h-full`,children:(0,$.jsx)(`div`,{className:`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0 transition-all duration-300 ease-in-out`,children:(0,$.jsx)(Rr,{})})})}function Br({className:e}){let{t}=y(`openhands`);return(0,$.jsxs)(`div`,{className:U(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,$.jsx)(p,{className:`h-8 w-8 shrink-0 animate-spin text-[var(--oh-text-secondary)]`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-base font-normal leading-5 text-[var(--oh-text-secondary)]`,children:t(g.HOME$LOADING)})]})}function Vr({children:e}){return(0,$.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Hr({children:e}){return(0,$.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Ur({children:e}){return(0,$.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}var Wr=(0,Q.lazy)(()=>n(()=>import(`./files-tab-CMredyYX.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]))),Gr=(0,Q.lazy)(()=>n(()=>import(`./browser-tab-be3QvXg9.js`),__vite__mapDeps([60,18,1,23,24,4,61,3,34,35,36,19,62,33]))),Kr=(0,Q.lazy)(()=>n(()=>import(`./vscode-tab-DEt72yJX.js`),__vite__mapDeps([63,1,18,23,24,4,64,7,8,5,6,9,10,11,12,13,14,15,16,17,19,20,21,22,43,40,41,42,44,45,48,35,36,46,47,33,65,66,34,67]))),qr=(0,Q.lazy)(()=>n(()=>import(`./planner-tab-B-5EeCEm.js`),__vite__mapDeps([68,1,18,23,24,4,34,35,36,19,37,29,27,28,30,31,25,3,26,32,38,39,69,67,70,71,72,73,74,75,7,8,5,6,9,10,11,12,13,14,15,16,17,76,21,77,22,78,79,80,81,20,40,41,82,42,43,44,45,83,84,33,57,85]))),Jr=(0,Q.lazy)(()=>n(()=>import(`./task-list-tab-BiizRsY3.js`),__vite__mapDeps([86,1,18,23,24,4,34,35,36,19,87,54,33,88,89,55,56]))),Yr=(0,Q.lazy)(()=>n(()=>import(`./terminal-CpgZx6go.js`),__vite__mapDeps([90,1,91,92,18,4,66,23,24,35,36,19,46,42,43,5,6,7,8,9,10,11,12,13,14,15,16,17,44,45,20,21,22,40,41,47,33,93]))),Xr={tasklist:{component:Jr},files:{component:Wr},browser:{component:Gr},vscode:{component:Kr},terminal:{component:Yr},planner:{component:qr}};function Zr(){let{selectedTab:e,shouldShownAgentLoading:t}=G(),{conversationId:n}=J(),r=(0,Q.useMemo)(()=>Xr[e]??Xr.files,[e]).component;return t?(0,$.jsx)(Br,{}):(0,$.jsx)(Hr,{children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Br,{}),children:(0,$.jsx)(Ur,{children:(0,$.jsx)(Vr,{children:(0,$.jsx)(r,{})},e===`terminal`?`${e}-${n}`:e)})})})}var Qr=()=>{let e=_(),t=Ut(e=>e.removeErrorMessage);return m({mutationKey:[`start-conversation`],mutationFn:async e=>f(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)=>{u(e,r.conversationId)},onSuccess:(n,r)=>{t(),l(e,r.conversationId,Se.RUNNING)}})},$r=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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`})}),ei=e=>(0,$.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,$.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,$.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 ti({icon:e,text:t,onClick:n,testId:r}){return(0,$.jsx)(K,{testId:r,onClick:n,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,$.jsx)(`span`,{className:Le,"aria-hidden":!0,children:e})]})})}function ni({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=X(),{isTask:i,taskStatus:a,taskDetail:o}=_t(),{t:s}=y(`openhands`),{errorMessage:c}=Ut(),l=r===V.LOADING||r===V.INIT,u=fe(t)||be(t),d=ve({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=me({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,$.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,$.jsxs)(`div`,{className:`flex items-center`,children:[(0,$.jsx)(Pr,{className:`w-6 h-6 shrink-0`,color:d}),(0,$.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function ri({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1}){let{t:s}=y(`openhands`),c=Ze(e),l=xe(r),u=be(r),d=l||u;return(0,$.jsxs)(rt,{ref:c,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:U(`left-2 w-fit min-w-42`,a),children:[(0,$.jsx)(ni,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),d&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ue,{inset:`menu`}),l&&t&&(0,$.jsx)(ti,{icon:(0,$.jsx)($r,{width:18,height:18}),text:s(g.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),u&&n&&(0,$.jsx)(ti,{icon:(0,$.jsx)(ei,{width:18,height:18}),text:s(g.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}var ii=e(s(),1);function ai({isPublic:e,onToggle:t,ariaLabel:n}){return(0,$.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,$.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:U(`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,$.jsx)(`span`,{className:U(`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 oi({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onDownloadConversation:u,shareUrl:d,position:f=`bottom`,anchorRef:p}){let m=sn(),{t:h}=y(`openhands`),{backend:_}=W(),{data:v}=Y(),b=Ze(e),x=p?.current??null,[S,C]=Q.useState();Q.useLayoutEffect(()=>{if(!x)return;let e=()=>{let e=x.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};f===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,C(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[x,f]);let w=!!(a||o||s),T=!!i,E=!!(r||n),ee=_.kind===`cloud`?g.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:g.COMMON$STOP_CONVERSATION,D=_.kind===`cloud`&&!!c,O=v?.public||!1,te=!!x,k=(0,$.jsxs)(rt,{ref:b,testId:`conversation-name-context-menu`,position:f,alignment:`left`,className:U(m?`right-0 translate-x-[34%] left-auto`:``,te?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,$.jsx)(K,{testId:`rename-button`,onClick:t,children:(0,$.jsx)(q,{icon:(0,$.jsx)(ot,{width:16,height:16}),text:h(g.BUTTON$RENAME)})}),w&&(0,$.jsx)(Ue,{testId:`separator-tools`,inset:`menu`}),o&&(0,$.jsx)(K,{testId:`show-skills-button`,onClick:o,children:(0,$.jsx)(q,{icon:(0,$.jsx)(st,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:h(g.CONVERSATION$SHOW_SKILLS)})}),s&&(0,$.jsx)(K,{testId:`show-hooks-button`,onClick:s,children:(0,$.jsx)(q,{icon:(0,$.jsx)(bt,{width:16,height:16,"aria-hidden":!0}),text:h(g.CONVERSATION$SHOW_HOOKS)})}),a&&(0,$.jsx)(K,{testId:`show-agent-tools-button`,onClick:a,children:(0,$.jsx)(q,{icon:(0,$.jsx)(Be,{width:16,height:16}),text:h(g.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})}),u&&(0,$.jsx)(K,{testId:`download-trajectory-button`,onClick:u,children:(0,$.jsx)(q,{icon:(0,$.jsx)(ne,{width:16,height:16}),text:h(g.BUTTON$EXPORT_CONVERSATION)})}),(T||E)&&(0,$.jsx)(Ue,{testId:`separator-info-control`,inset:`menu`}),i&&(0,$.jsx)(K,{testId:`display-cost-button`,onClick:i,children:(0,$.jsx)(q,{icon:(0,$.jsx)(P,{width:16,height:16}),text:h(g.BUTTON$DISPLAY_COST)})}),D&&c&&(0,$.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,$.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,$.jsx)(z,{size:16})}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:h(g.CONVERSATION$SHARE_PUBLICLY)}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[O&&d&&l&&(0,$.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,$.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:h(g.BUTTON$COPY_TO_CLIPBOARD),children:(0,$.jsx)(rn,{width:14,height:14})}),(0,$.jsx)(`a`,{"data-testid":`open-share-link-button`,href:d,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:h(g.BUTTON$OPEN_IN_NEW_TAB),children:(0,$.jsx)(ce,{size:14,"aria-hidden":!0})})]}),(0,$.jsx)(ai,{isPublic:O,onToggle:c,ariaLabel:h(g.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,$.jsx)(K,{testId:`stop-button`,onClick:r,children:(0,$.jsx)(q,{icon:(0,$.jsx)(Ve,{width:16,height:16}),text:h(ee)})}),n&&(0,$.jsx)(K,{testId:`delete-button`,onClick:n,children:(0,$.jsx)(q,{icon:(0,$.jsx)(it,{width:16,height:16}),text:h(g.COMMON$DELETE_CONVERSATION)})})]});return te?typeof document>`u`||!S?null:ii.createPortal((0,$.jsx)(`div`,{style:S,children:k}),document.body):k}function si({onClose:e}){let{t}=y(`openhands`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Je,{onClose:e,testId:`close-metrics-modal`}),(0,$.jsx)(`div`,{className:`w-full pr-6`,children:(0,$.jsx)(ke,{title:t(g.CONVERSATION$METRICS_INFO)})})]})}function ci({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,$.jsx)(`div`,{className:`w-full h-1.5 bg-tertiary rounded-full overflow-hidden mt-1`,children:(0,$.jsx)(`div`,{className:U(`h-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function li({currentCost:e,maxBudget:t}){let{t:n}=y(`openhands`),r=e/t*100;return(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(g.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:r.toFixed(2),used:n(g.CONVERSATION$USED)})})})}function ui({cost:e,maxBudgetPerTask:t}){let{t:n}=y(`openhands`);return e===null?null:(0,$.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)]`,children:t!==null&&t>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ci,{currentCost:e,maxBudget:t}),(0,$.jsx)(li,{currentCost:e,maxBudget:t})]}):(0,$.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(g.CONVERSATION$NO_BUDGET_LIMIT)})})}function di({cost:e,maxBudgetPerTask:t}){let{t:n}=y(`openhands`);return e===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex justify-between items-center pb-2`,children:[(0,$.jsx)(`span`,{className:`text-lg font-semibold`,children:n(g.CONVERSATION$TOTAL_COST)}),(0,$.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]}),(0,$.jsx)(ui,{cost:e,maxBudgetPerTask:t})]})}function fi({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`}){return(0,$.jsxs)(`div`,{className:`flex justify-between items-center border-b border-[var(--oh-border-subtle)] pb-2`,children:[(0,$.jsx)(`span`,{className:n,children:e}),(0,$.jsx)(`span`,{className:r,children:t})]})}function pi({usage:e}){let{t}=y(`openhands`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(fi,{label:t(g.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,$.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(g.CONVERSATION$CACHE_HIT)}),(0,$.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,$.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(g.CONVERSATION$CACHE_WRITE)}),(0,$.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,$.jsx)(fi,{label:t(g.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,$.jsx)(fi,{label:t(g.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`})]})}function mi({perTurnToken:e,contextWindow:t}){let{t:n}=y(`openhands`),r=t>0?e/t*100:0,i=Math.min(100,r);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,$.jsx)(`span`,{className:`font-semibold`,children:n(g.CONVERSATION$CONTEXT_WINDOW)})}),(0,$.jsx)(`div`,{className:`w-full h-1.5 bg-tertiary rounded-full overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full bg-foreground transition-all duration-300`,style:{width:`${i}%`}})}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[e.toLocaleString(),` / `,t.toLocaleString(),` (`,r.toFixed(2),`% `,n(g.CONVERSATION$USED),`)`]})})]})}function hi(){let{t:e}=y(`openhands`);return(0,$.jsx)(`div`,{className:`text-center`,children:(0,$.jsx)(`p`,{className:`text-[var(--oh-muted)]`,children:e(g.CONVERSATION$NO_METRICS)})})}function gi(e){let{stats:t}=e;if(!t?.usage_to_metrics)return{accumulated_cost:0,max_budget_per_task:null,accumulated_token_usage:null};let n=0,r=null,i=null;for(let e of Object.values(t.usage_to_metrics))n+=e.accumulated_cost,r===null&&e.max_budget_per_task!==null&&(r=e.max_budget_per_task),e.accumulated_token_usage&&(i=i===null?{...e.accumulated_token_usage}:{prompt_tokens:i.prompt_tokens+e.accumulated_token_usage.prompt_tokens,completion_tokens:i.completion_tokens+e.accumulated_token_usage.completion_tokens,cache_read_tokens:i.cache_read_tokens+e.accumulated_token_usage.cache_read_tokens,cache_write_tokens:i.cache_write_tokens+e.accumulated_token_usage.cache_write_tokens,context_window:Math.max(i.context_window,e.accumulated_token_usage.context_window),per_turn_token:Math.max(i.per_turn_token,e.accumulated_token_usage.per_turn_token)});return{accumulated_cost:n,max_budget_per_task:r,accumulated_token_usage:i}}var _i=(e,t,n,r=!0)=>{let i=c({queryKey:[`conversation-metrics`,e,t,n],queryFn:async()=>{if(!e)throw Error(`Conversation ID is required`);return gi(await Ee.getRuntimeConversation(e,t,n))},enabled:r&&!!e&&!!t,staleTime:1e3*30,gcTime:1e3*60*5,refetchInterval:1e3*30,retry:!1});return{data:i.data,isLoading:i.isLoading,error:i.error}};function vi({isOpen:e,onOpenChange:t}){let n=Ht(),{data:r}=Y(),i=r?.id,a=r?.conversation_url,o=r?.session_api_key,{data:s}=_i(i,a,o,e),c=(0,Q.useMemo)(()=>s?{cost:s.accumulated_cost,max_budget_per_task:s.max_budget_per_task,usage:s.accumulated_token_usage?{prompt_tokens:s.accumulated_token_usage.prompt_tokens??0,completion_tokens:s.accumulated_token_usage.completion_tokens??0,cache_read_tokens:s.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:s.accumulated_token_usage.cache_write_tokens??0,context_window:s.accumulated_token_usage.context_window??0,per_turn_token:s.accumulated_token_usage.per_turn_token??0}:null}:n,[s,n]);return e?(0,$.jsx)(De,{onClose:()=>t(!1),children:(0,$.jsxs)(Oe,{testID:`metrics-modal`,className:`relative items-start border border-[var(--oh-border)]`,children:[(0,$.jsx)(si,{onClose:()=>t(!1)}),(0,$.jsxs)(`div`,{className:`w-full`,children:[(c?.cost!==null||c?.usage!==null)&&(0,$.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(di,{cost:c?.cost??null,maxBudgetPerTask:c?.max_budget_per_task??null}),c?.usage!==null&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(pi,{usage:c.usage}),(0,$.jsx)(mi,{perTurnToken:c.usage.per_turn_token,contextWindow:c.usage.context_window})]})]})}),!c?.cost&&!c?.usage&&(0,$.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,$.jsx)(hi,{})})]})]})}):null}function yi(){let{t:e}=y(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{mutate:r}=ie(),[i,a]=Q.useState(`view`),[o,s]=Q.useState(!1),c=Q.useRef(null),l=Q.useRef(null),{handleDelete:u,handleStop:d,handleDownloadConversation:f,handleDisplayCost:p,handleShowAgentTools:m,handleShowSkills:h,handleShowHooks:_,handleTogglePublic:v,handleCopyShareLink:b,shareUrl:x,handleConfirmDelete:S,handleConfirmStop:C,metricsModalVisible:w,setMetricsModalVisible:T,systemModalVisible:E,setSystemModalVisible:ee,skillsModalVisible:D,setSkillsModalVisible:O,hooksModalVisible:te,setHooksModalVisible:k,confirmDeleteModalVisible:ne,setConfirmDeleteModalVisible:A,confirmStopModalVisible:j,setConfirmStopModalVisible:M,systemMessage:N,shouldShowStop:P,shouldShowDownloadConversation:F,shouldShowDisplayCost:L,shouldShowAgentTools:R,shouldShowSkills:ae,shouldShowHooks:se}=mt({conversationId:t,executionStatus:n?.execution_status,showOptions:!0,onContextMenuToggle:s});return Q.useEffect(()=>{i===`edit`&&c.current?.focus()},[i]),n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 h-[22px] text-base font-normal text-left pl-0 lg:pl-1 min-w-0`,"data-testid":`conversation-name`,children:[i===`edit`?(0,$.jsx)(`input`,{ref:c,"data-testid":`conversation-name-input`,onClick:e=>{i===`edit`&&(e.preventDefault(),e.stopPropagation())},onBlur:()=>{if(c.current?.value&&t){let i=c.current.value.trim();i!==n?.title&&r({conversationId:t,newTitle:i},{onSuccess:()=>{oe(e(g.CONVERSATION$TITLE_UPDATED))}})}else c.current&&(c.current.value=n?.title??``);a(`view`)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:n.title||``,className:`text-white leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content`}):(0,$.jsx)(`div`,{className:`text-white leading-5 truncate`,"data-testid":`conversation-name-title`,onDoubleClick:()=>{a(`edit`)},title:n.title||``,children:n.title}),i!==`edit`&&(0,$.jsxs)(`div`,{ref:l,className:`relative flex items-center shrink-0`,children:[(0,$.jsx)(at,{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o)}}),o&&(0,$.jsx)(oi,{onClose:()=>s(!1),onRename:e=>{e.preventDefault(),e.stopPropagation(),a(`edit`),s(!1)},onDelete:u,onStop:P?d:void 0,onDisplayCost:L?p:void 0,onShowAgentTools:R?m:void 0,onShowSkills:ae?h:void 0,onShowHooks:se?_:void 0,onTogglePublic:v,onCopyShareLink:b,shareUrl:x,onDownloadConversation:F?f:void 0,position:`bottom`,anchorRef:l})]})]}),(0,$.jsx)(vi,{isOpen:w,onOpenChange:T}),(0,$.jsx)(Et,{isOpen:E,onClose:()=>ee(!1),systemMessage:N||null}),D&&(0,$.jsx)(Dt,{onClose:()=>O(!1)}),te&&(0,$.jsx)(jt,{onClose:()=>k(!1)}),ne&&(0,$.jsx)(re,{onConfirm:S,onCancel:()=>A(!1),conversationTitle:n?.title||``}),j&&(0,$.jsx)(I,{onConfirm:C,onCancel:()=>M(!1)})]}):null}function bi({children:e,tooltip:t,ariaLabel:n}){return(0,$.jsx)(Fe,{content:t,placement:`bottom`,tooltipClassName:`bg-white text-black text-xs font-medium leading-5`,children:(0,$.jsx)(`span`,{"data-aria-label":n,children:e})})}function xi({className:e}){let{t}=y(`openhands`),n=sn(),r=a(),{conversationId:i}=J(),{isRightPanelShown:o,setHasRightPanelToggled:s,setIsRightPanelShown:c,setSelectedTab:l}=G(),u=()=>{if(n){if(!i)return;s(!0),c(!0);let{selectedTab:e}=G.getState();e||l(`files`),r(`/conversations/${i}/panel`);return}let e=!o;if(s(e),e){let{selectedTab:e}=G.getState();e||l(`files`)}},d=t(n?g.COMMON$SHOW_PANEL:o?g.COMMON$HIDE_PANEL:g.COMMON$SHOW_PANEL),f=n?!1:o;return(0,$.jsx)(bi,{tooltip:d,ariaLabel:d,children:(0,$.jsx)(`button`,{type:`button`,onClick:u,className:U(N,e),"aria-label":d,"aria-pressed":f,"data-testid":`right-panel-toggle`,children:(0,$.jsx)(M,{className:`w-5 h-5 -scale-x-100`})})})}function Si(){let{conversationId:e}=J(),{data:t}=Y(),{curAgentState:n}=X(),{isTask:r,taskStatus:i}=_t(),{mutate:a}=ze(),{mutate:o}=Qr(),{providers:s}=Re(),c=t?.execution_status??null,l=ve({isPausing:!1,isTask:r,taskStatus:i,isStartingStatus:n===V.LOADING||n===V.INIT,isStopStatus:fe(c),curAgentState:n});return(0,$.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,$.jsxs)(`div`,{className:`flex items-center min-w-0`,children:[(0,$.jsxs)(`div`,{className:`group relative shrink-0`,children:[(0,$.jsx)(Pr,{className:`ml-[3.5px] w-6 h-6 cursor-pointer`,color:l}),(0,$.jsx)(ri,{onClose:()=>{},onStopServer:xe(c)?t=>{t.preventDefault(),t.stopPropagation(),e&&a({conversationId:e})}:void 0,onStartServer:be(c)?t=>{t.preventDefault(),t.stopPropagation(),e&&o({conversationId:e,providers:s})}:void 0,executionStatus:c,position:`bottom`,className:`opacity-0 invisible pointer-events-none group-hover:opacity-100 group-hover:visible group-hover:pointer-events-auto bottom-full left-0 mt-0 min-h-fit`,isPausing:!1})]}),(0,$.jsx)(yi,{})]}),(0,$.jsx)(xi,{className:`mr-2`})]})}var Ci=e=>(0,$.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,$.jsx)(`path`,{d:`M3 10.5L6.5 14L14 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,$.jsx)(`path`,{d:`M7 10.5L10.5 14L18 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`})]});function wi({tabValue:e,icon:t,onClick:n,isActive:r,label:i,className:a,measureOnly:o}){return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{n()},...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:U(`flex items-center gap-2 rounded-md cursor-pointer`,`pl-1.5 pr-2 py-1 lg:py-1.5`,`text-[var(--oh-muted)] bg-transparent`,r&&`bg-[var(--oh-interactive-active)] text-white`,r?`hover:text-white hover:bg-[var(--oh-interactive-hover)]`:`hover:text-white hover:bg-white/5`,r?`focus-within:text-white`:`focus-within:text-[var(--oh-muted)]`,a),children:[(0,$.jsx)(t,{className:U(`w-5 h-5 text-inherit flex-shrink-0`)}),r&&i&&(0,$.jsx)(`span`,{className:`text-sm font-normal whitespace-nowrap`,children:i})]})}function Ti(){let{curAgentState:e}=X(),{t}=y(`openhands`),{data:n,refetch:r}=un(),i=ye.includes(e);return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{children:t(g.COMMON$CODE)}),i?null:(0,$.jsx)(nt,{className:`w-3 h-3 text-inherit cursor-pointer`,onClick:async e=>{e.preventDefault(),e.stopPropagation();let t=n?.url;t||=(await r()).data?.url??null,t&&window.open(t,`_blank`,`noopener,noreferrer`)}})]})}var Ei=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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`})}),Di=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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`})});function Oi({isOpen:e,onClose:t,ignoreOutsideClickRef:n}){let r=Ze(t,n),{t:i}=y(`openhands`),{conversationId:a}=J(),{state:o,setUnpinnedTabs:s,setSelectedTab:c}=qe(a),{selectedTab:l,isRightPanelShown:u,setSelectedTab:d}=G(),{navigateToTab:f}=w(),{hasTaskList:p}=dn(),{backend:m}=W(),h=[{tab:`planner`,icon:nn,i18nKey:g.COMMON$PLANNER},{tab:`files`,icon:zt,i18nKey:g.COMMON$FILES},{tab:`vscode`,icon:ln,i18nKey:g.COMMON$CODE},{tab:`terminal`,icon:ct,i18nKey:g.COMMON$TERMINAL},{tab:`browser`,icon:cn,i18nKey:g.COMMON$BROWSER}];p&&h.unshift({tab:`tasklist`,icon:Ci,i18nKey:g.COMMON$TASK_LIST});let _=h.filter(({tab:e})=>e!==`vscode`&&e!==`planner`||m.kind===`cloud`);if(!e)return null;let v=e=>{f(e),t()},b=(e,t)=>{if(t.preventDefault(),t.stopPropagation(),o.unpinnedTabs.includes(e))s(o.unpinnedTabs.filter(t=>t!==e));else{let t=[...o.unpinnedTabs,e];if(s(t),l===e&&u){let n=_.find(({tab:n})=>n!==e&&!t.includes(n));n&&(d(n.tab),c(n.tab))}}};return(0,$.jsx)(rt,{ref:r,alignment:`right`,position:`bottom`,className:`z-[9999] mt-2 w-fit`,children:_.map(({tab:e,icon:t,i18nKey:n})=>{let r=!o.unpinnedTabs.includes(e);return(0,$.jsx)(`li`,{className:`list-none`,children:(0,$.jsxs)(`div`,{className:U(`group flex h-[30px] w-full min-w-0 items-stretch rounded`,`hover:bg-[var(--oh-interactive-hover)]`),children:[(0,$.jsxs)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-open-${e}`,className:U(`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white`,Ie),onClick:()=>v(e),children:[(0,$.jsx)(`span`,{className:Le,"aria-hidden":!0,children:(0,$.jsx)(t,{className:`h-4 w-4`})}),(0,$.jsx)(`span`,{className:`text-sm`,children:i(n)})]}),(0,$.jsx)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-pin-${e}`,className:U(`flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white hover:bg-white/10`,Ie),"aria-pressed":r,"aria-label":r?`Unpin tab from bar`:`Pin tab to bar`,onClick:t=>b(e,t),children:r?(0,$.jsx)(`span`,{className:U(`-mr-[5px] ml-auto`,Le),"aria-hidden":!0,children:(0,$.jsx)(Di,{className:`h-7 w-7`})}):(0,$.jsx)(`span`,{className:U(`ml-auto`,Le),"aria-hidden":!0,children:(0,$.jsx)(Ei,{className:`h-4.5 w-4.5`})})})]})},e)})})}function ki({variant:e=`default`}){let{conversationId:t}=J(),{setSelectedTab:n,planContent:r}=G(),[i,a]=(0,Q.useState)(!1),{state:o}=qe(t),{hasTaskList:s}=dn(),{backend:c}=W(),{handleBuildPlanClick:l}=b(),{curAgentState:u}=X(),{selectTab:d,isTabActive:f,onTabChange:p,selectedTab:m,isRightPanelShown:h}=w();(0,Q.useEffect)(()=>{n(o.selectedTab)},[n,o.selectedTab]),(0,Q.useEffect)(()=>{h&&(m||p(`files`))},[h,m,p]);let{t:_,i18n:v}=y(`openhands`),x=[{tabValue:`files`,isActive:f(`files`),icon:zt,onClick:()=>d(`files`),tooltipContent:_(g.COMMON$FILES),tooltipAriaLabel:_(g.COMMON$FILES),label:_(g.COMMON$FILES)},{tabValue:`planner`,isActive:f(`planner`),icon:nn,onClick:()=>d(`planner`),tooltipContent:_(g.COMMON$PLANNER),tooltipAriaLabel:_(g.COMMON$PLANNER),label:_(g.COMMON$PLANNER)},{tabValue:`vscode`,isActive:f(`vscode`),icon:ln,onClick:()=>d(`vscode`),tooltipContent:(0,$.jsx)(Ti,{}),tooltipAriaLabel:_(g.COMMON$CODE),label:_(g.COMMON$CODE)},{tabValue:`terminal`,isActive:f(`terminal`),icon:ct,onClick:()=>d(`terminal`),tooltipContent:_(g.COMMON$TERMINAL),tooltipAriaLabel:_(g.COMMON$TERMINAL),label:_(g.COMMON$TERMINAL),className:`pl-2`},{tabValue:`browser`,isActive:f(`browser`),icon:cn,onClick:()=>d(`browser`),tooltipContent:_(g.COMMON$BROWSER),tooltipAriaLabel:_(g.COMMON$BROWSER),label:_(g.COMMON$BROWSER)}];s&&x.splice(1,0,{tabValue:`tasklist`,isActive:f(`tasklist`),icon:Ci,onClick:()=>d(`tasklist`),tooltipContent:_(g.COMMON$TASK_LIST),tooltipAriaLabel:_(g.COMMON$TASK_LIST),label:_(g.COMMON$TASK_LIST)});let S=x.filter(e=>e.tabValue===`vscode`&&c.kind!==`cloud`||e.tabValue===`planner`&&c.kind!==`cloud`?!1:o.unpinnedTabs.includes(e.tabValue)?m===e.tabValue:!0),C=o.unpinnedTabs.join(`,`),T=u===V.RUNNING||u===V.LOADING||!r,E=(0,Q.useRef)(null),ee=(0,Q.useRef)(null),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),[te,k]=(0,Q.useState)(S.length);(0,Q.useLayoutEffect)(()=>{let e=E.current,t=ee.current,n=D.current;if(!e||!t||!n)return;let r=()=>{let r=t.querySelectorAll(`[data-tab-measure="true"]`),i=r.length,a=e.getBoundingClientRect().width;if(a===0){k(i);return}let o=Array.from(r).map(e=>e.getBoundingClientRect().width);if(o.length!==i||i===0){k(Math.max(0,i));return}let s=n.getBoundingClientRect().width,c=getComputedStyle(e).columnGap||getComputedStyle(e).gap,l=parseFloat(c)||6,u=0;for(let e=i;e>=0;--e){let t=s;for(let n=0;n<e;n+=1)t+=o[n]??0;if(e>0&&(t+=e*l),t<=a+.5){u=e;break}}k(e=>e===u?e:u)};if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(e),()=>i.disconnect()},[C,S.length,s,c.kind,m,h,v.language]);let ne=Math.min(te,S.length);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:U(`relative w-full min-w-0`,e===`compact`?`flex h-full min-h-0 items-center py-0 pl-0 pr-1`:`min-h-10 p-1`),children:[(0,$.jsx)(`div`,{ref:ee,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-[-10000px] flex flex-nowrap items-center gap-1.5`,children:S.map(({tabValue:e,icon:t,isActive:n,tooltipContent:r,tooltipAriaLabel:i,label:a,className:o},s)=>(0,$.jsx)(bi,{tooltip:r,ariaLabel:i,children:(0,$.jsx)(wi,{tabValue:e,icon:t,onClick:()=>{},isActive:n,label:a,className:U(o,`shrink-0`),measureOnly:!0})},`measure-${e}-${s}`))}),(0,$.jsx)(`div`,{ref:E,className:`flex w-full min-w-0 flex-nowrap items-center justify-start`,children:(0,$.jsxs)(`div`,{className:`flex w-fit max-w-full min-w-0 flex-nowrap items-center gap-1.5`,children:[(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-nowrap items-center gap-1.5 overflow-x-hidden`,children:S.slice(0,ne).map(({tabValue:e,icon:t,onClick:n,isActive:r,tooltipContent:i,tooltipAriaLabel:a,label:o,className:s},c)=>(0,$.jsx)(bi,{tooltip:i,ariaLabel:a,children:(0,$.jsx)(wi,{tabValue:e,icon:t,onClick:n,isActive:r,label:o,className:U(s,`shrink-0`)})},`${e}-${c}`))}),(0,$.jsxs)(`div`,{ref:D,className:`relative shrink-0`,children:[(0,$.jsx)(at,{ref:O,onClick:()=>a(!i),ariaLabel:_(g.COMMON$MORE_OPTIONS),iconClassName:e===`compact`?j:void 0}),(0,$.jsx)(Oi,{isOpen:i,onClose:()=>a(!1),ignoreOutsideClickRef:O})]})]})})]}),f(`planner`)&&(0,$.jsx)(`div`,{className:U(`flex h-10 min-h-10 shrink-0 items-center border-t border-[var(--oh-border)] pl-[10px] pr-1`),children:(0,$.jsx)(`button`,{type:`button`,onClick:l,disabled:T,className:U(`flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity`,T?`cursor-not-allowed opacity-50`:`cursor-pointer hover:opacity-90`),"data-testid":`planner-tab-build-button`,children:(0,$.jsxs)(dt.Text,{className:`text-[11px] font-normal leading-5 text-black`,children:[_(g.COMMON$BUILD),` ⌘↩`]})})})]})}function Ai({onMouseDown:e,className:t,isDragging:n=!1}){let[r,i]=(0,Q.useState)(!1),a=n||r;return(0,$.jsxs)(`div`,{className:U(`relative z-10 w-0 shrink-0 self-stretch`,t),"aria-hidden":!0,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 w-3 min-w-[12px] -translate-x-1/2 cursor-ew-resize`,onMouseDown:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1)}),(0,$.jsx)(`div`,{className:U(`pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`,a?`bg-white`:`bg-transparent`),"aria-hidden":!0})]})}var ji=200;function Mi({defaultLeftWidth:e=50,minLeftWidth:t=30,maxLeftWidth:n=80,storageKey:r=`desktop-layout-panel-width`}={}){let[i,a]=fn(r,e),o=(0,Q.useCallback)(e=>Math.max(t,Math.min(n,e)),[t,n]),[s,c]=(0,Q.useState)(()=>o(i)),[l,u]=(0,Q.useState)(!1),d=(0,Q.useRef)(null),f=(0,Q.useCallback)(e=>{e.preventDefault(),u(!0)},[]),p=(0,Q.useCallback)(e=>{if(!l||!d.current)return;let t=d.current.getBoundingClientRect();c(o((e.clientX-t.left)/t.width*100))},[l,o]),m=(0,Q.useCallback)(()=>{l&&(u(!1),a(s))},[l,s,a]);return(0,Q.useLayoutEffect)(()=>{if(!l)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(ji),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,m),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,m),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[l,p,m]),{leftWidth:s,rightWidth:100-s,isDragging:l,containerRef:d,handleMouseDown:f}}function Ni(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function Pi(){let e=sn(),t=sn(767),{isRightPanelShown:n}=G(),{leftWidth:r,rightWidth:i,isDragging:a,containerRef:o,handleMouseDown:s}=Mi({defaultLeftWidth:50,minLeftWidth:30,maxLeftWidth:80,storageKey:`desktop-layout-panel-width`});return(0,$.jsx)(`div`,{className:U(e?`relative min-h-0 flex-1 flex flex-col`:`h-full flex flex-col overflow-hidden`),children:(0,$.jsxs)(`div`,{ref:o,className:U(`flex flex-1 overflow-hidden`,e?`flex-col`:`transition-all duration-300 ease-in-out`),style:e?void 0:{transitionProperty:a?`none`:`all`},children:[(0,$.jsxs)(`div`,{className:U(`flex flex-col bg-base overflow-hidden`,e?`flex-1`:`transition-all duration-300 ease-in-out`),style:e?void 0:{width:n?`${r}%`:`100%`,transitionProperty:a?`none`:`all`},children:[(0,$.jsxs)(`div`,{"data-testid":`chat-pane-header`,className:U(`flex h-10 min-h-10 shrink-0 items-center`,t&&`gap-2 pl-2.5`),children:[t?(0,$.jsx)(F,{}):null,(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(Si,{})})]}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,$.jsx)(zr,{isRightPanelShown:!e&&n})})]}),!e&&n&&(0,$.jsx)(Ai,{onMouseDown:s,isDragging:a}),!e&&(0,$.jsx)(`div`,{className:U(`transition-all duration-300 ease-in-out overflow-hidden`,Ni(n)),style:{width:n?`${i}%`:`0%`,transitionProperty:a?`opacity, transform`:`all`},children:(0,$.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:(0,$.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 bg-[var(--oh-surface)] border-l border-[var(--oh-border)] overflow-hidden`,children:[(0,$.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex shrink-0 flex-col border-b border-[var(--oh-border)]`,children:(0,$.jsx)(ki,{})}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,$.jsx)(Zr,{})})]})})})]})})}function Fi({onNavigateBack:e}){let{t}=y(`openhands`),{setIsRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=G();return Q.useLayoutEffect(()=>(n(!0),r(!0),G.getState().selectedTab||i(`files`),()=>{n(!1),r(!1)}),[n,r,i]),(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[var(--oh-surface)]`,children:[(0,$.jsxs)(`div`,{"data-testid":`conversation-mobile-panel-top`,className:`flex h-10 min-h-10 shrink-0 items-center gap-1.5 border-b border-[var(--oh-border)] pl-2.5`,children:[(0,$.jsx)(`button`,{type:`button`,"data-testid":`conversation-mobile-panel-back`,onClick:()=>{e()},"aria-label":t(g.COMMON$BACK),className:N,children:(0,$.jsx)(A,{size:20,className:j,"aria-hidden":!0,strokeWidth:2})}),(0,$.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 items-center self-stretch`,children:(0,$.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex h-full min-h-0 w-full min-w-0 flex-col justify-center`,children:(0,$.jsx)(ki,{variant:`compact`})})})]}),(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--oh-surface)]`,children:(0,$.jsx)(Zr,{})})]})}var Ii=1e3*60*5,Li=1e3*60*15,Ri=e=>{let t=e||[],n=W();return c({queryKey:[`v1`,`sub-conversations`,t,n.backend.id,n.orgId],queryFn:async()=>t.length===0?[]:Ee.batchGetAppConversations(t),enabled:t.length>0,staleTime:Ii,gcTime:Li,retry:!1})};function zi({children:e,conversationId:t}){let{data:n}=Y(),{data:r}=Ri(n?.sub_conversation_ids??[]),i=r?.filter(e=>e!==null);return(0,$.jsx)(Jt,{conversationId:t,conversationUrl:n?.sandbox_status===`PAUSED`?null:n?.conversation_url,sessionApiKey:n?.session_api_key,subConversationIds:n?.sub_conversation_ids,subConversations:i,children:e})}function Bi(){let{t:e}=y(`openhands`),{conversationId:t}=J(),n=r(`/conversations/:conversationId/panel`),{isTask:i,taskStatus:s,taskDetail:c}=_t(),l=W(),u=Q.useRef(l.backend.id),d=Q.useRef(l.orgId),f=u.current!==l.backend.id||d.current!==l.orgId,{data:p,isFetched:m}=Y(),{data:h}=Xe(),{resetConversationState:_}=G(),v=a(),b=o(),x=tn(e=>e.clearTerminal),S=ut(e=>e.reset),C=mn(e=>e.setCurrentAgentState),w=Ut(e=>e.removeErrorMessage);Q.useEffect(()=>{x(),_(),S(),C(V.LOADING),w()},[t,x,_,S,C,w]),Q.useEffect(()=>{if(i&&s===`ERROR`){R(c||e(g.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=b.state?.resumedFromConversationId;v(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[i,s,c,e,v,b.state]),Q.useEffect(()=>{!m||!h||f||p||(bn(l.backend.id,l.orgId),R(e(g.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),v(`/conversations`))},[p,m,h,v,e,f,l.backend.id,l.orgId]),Q.useEffect(()=>{f||t&&(t.startsWith(`task-`)||yn(l.backend.id,l.orgId,t))},[t,f,l.backend.id,l.orgId]);let T=Q.useRef(null);return Q.useEffect(()=>{!m||!p||l.backend.kind===`cloud`&&p.sandbox_status===`PAUSED`&&p.sandbox_id&&T.current!==p.id&&(T.current=p.id,Te(p.sandbox_id).catch(()=>{R(e(g.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[m,p?.id,p?.sandbox_status,p?.sandbox_id,l.backend.kind,e]),f?null:(0,$.jsx)(zi,{conversationId:t,children:(0,$.jsx)(En,{children:(0,$.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:n?(0,$.jsx)(Fi,{onNavigateBack:()=>v(`/conversations/${t}`)}):(0,$.jsx)(Pi,{})})})})}function Vi(){return(0,$.jsx)(Bi,{})}var Hi=i(Vi);export{Hi as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./conversation-HgR_TTPE.js";export{e as default};
@@ -1 +0,0 @@
1
- import{D as e,d as t,n,r}from"./agent-server-client-options-9agOSarV.js";import{i,r as a,s as o}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{a as s,n as c,o as l,t as u}from"./agent-server-conversation-service.api-Cagoqq1V.js";var d=/^[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 f(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 p(e,t={}){return l(e,t)}async function m(e,t,n={}){let r=f(e);return`${(await p(t,n)).replace(/[/\\]+$/,``)}/${r}`}async function h(t,n){if(n?.id===t&&n.workspace?.working_dir?.trim())return n.workspace.working_dir.trim();let r=s(t);return r?.selected_workspace?.trim()?r.selected_workspace.trim():d.test(t)?u.resolveConversationWorkingDir(t):e()}var g=5;async function _(e,n){if(n?.id===e&&n.conversation_url?.trim()&&n.session_api_key?.trim())return{conversationUrl:n.conversation_url.trim(),sessionApiKey:n.session_api_key.trim()};if(t().backend.kind===`cloud`){let[t]=await c([e]);return{conversationUrl:t?.conversation_url?.trim()??null,sessionApiKey:t?.session_api_key?.trim()??null}}return{conversationUrl:null,sessionApiKey:null}}function v(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 y(e,n,r){let i=await h(e,r),a=await _(e,r),o=t().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=v({conversationUrl:c,sessionApiKey:s});return b({files:n,workingDir:i,conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey})}return b({files:n,workingDir:i,conversationUrl:c,sessionApiKey:s})}async function b(e){let{files:t,workingDir:r,conversationUrl:i,sessionApiKey:o}=e,s=new a(n({conversationUrl:i,sessionApiKey:o,workingDir:r})),c=async e=>{try{let t=f(e.name),n=await m(e.name,r,{conversationUrl:i,sessionApiKey:o});return await s.fileUpload(e,n),{uploadedFile:t,skippedFile:null}}catch(t){return{uploadedFile:null,skippedFile:{name:e.name,reason:t instanceof Error?t.message:`Upload failed`}}}},l=[];for(let e=0;e<t.length;e+=g){let n=t.slice(e,e+g);l.push(...await Promise.all(n.map(c)))}return{uploaded_files:l.flatMap(e=>e.uploadedFile?[e.uploadedFile]:[]),skipped_files:l.flatMap(e=>e.skippedFile?[e.skippedFile]:[])}}var x=class{static currentConversation=null;static setCurrentConversation(e){this.currentConversation=e}static getClientOverrides(){return{sessionApiKey:this.currentConversation?.session_api_key}}static async getVSCodeUrl(t){let r=this.currentConversation?.id===t?this.currentConversation?.workspace?.working_dir??e():e();return{vscode_url:await new o(n(this.getClientOverrides())).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async getTrajectory(e){return{trajectory:(await new i(r(this.getClientOverrides()),e).search({limit:1e4})).items??[]}}static async uploadFiles(e,t){return y(e,t,this.currentConversation)}};export{_ as n,y as r,x as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./react-Dy05vyj5.js";var t=e(e=>({execution_status:null,setExecutionStatus:t=>e({execution_status:t}),reset:()=>e({execution_status:null})}));export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./react-Dy05vyj5.js";import{n as t}from"./middleware-CfatjPYZ.js";import{a as n,r}from"./conversation-local-storage-YmOVXxxW.js";var i=()=>{if(typeof window>`u`)return null;let e=window.location.pathname.match(/\/conversations\/([^/]+)/);return e?e[1]:null},a=()=>{if(typeof window>`u`)return`code`;let e=i();return e?r(e).conversationMode:`code`},o=e()(t(e=>({isRightPanelShown:!1,selectedTab:`files`,images:[],files:[],imagesMarkedUploadAsFile:[],pastedImageNames:[],loadingFiles:[],loadingImages:[],messageToSend:null,messageRestoreIfEmpty:null,shouldShownAgentLoading:!1,submittedMessage:null,shouldHideSuggestions:!1,hasRightPanelToggled:!1,planContent:null,conversationMode:a(),subConversationTaskId:null,setIsRightPanelShown:t=>e({isRightPanelShown:t},!1,`setIsRightPanelShown`),setSelectedTab:t=>e({selectedTab:t},!1,`setSelectedTab`),setShouldShownAgentLoading:t=>e({shouldShownAgentLoading:t},!1,`setShouldShownAgentLoading`),setShouldHideSuggestions:t=>e({shouldHideSuggestions:t},!1,`setShouldHideSuggestions`),addImages:t=>e(e=>({images:[...e.images,...t]}),!1,`addImages`),addFiles:t=>e(e=>({files:[...e.files,...t]}),!1,`addFiles`),toggleImageUploadAsFile:t=>e(e=>{let n=new Set(e.imagesMarkedUploadAsFile);return n.has(t)?n.delete(t):n.add(t),{imagesMarkedUploadAsFile:[...n]}},!1,`toggleImageUploadAsFile`),markImagesAsPasted:t=>e(e=>({pastedImageNames:[...new Set([...e.pastedImageNames,...t])]}),!1,`markImagesAsPasted`),removeImage:t=>e(e=>{let n=e.images[t],r=[...e.images];return r.splice(t,1),{images:r,imagesMarkedUploadAsFile:n?e.imagesMarkedUploadAsFile.filter(e=>e!==n.name):e.imagesMarkedUploadAsFile,pastedImageNames:n?e.pastedImageNames.filter(e=>e!==n.name):e.pastedImageNames}},!1,`removeImage`),removeFile:t=>e(e=>{let n=[...e.files];return n.splice(t,1),{files:n}},!1,`removeFile`),clearImages:()=>e({images:[]},!1,`clearImages`),clearFiles:()=>e({files:[]},!1,`clearFiles`),clearAllFiles:()=>e({images:[],files:[],imagesMarkedUploadAsFile:[],pastedImageNames:[],loadingFiles:[],loadingImages:[]},!1,`clearAllFiles`),addFileLoading:t=>e(e=>e.loadingFiles.includes(t)?e:{loadingFiles:[...e.loadingFiles,t]},!1,`addFileLoading`),removeFileLoading:t=>e(e=>({loadingFiles:e.loadingFiles.filter(e=>e!==t)}),!1,`removeFileLoading`),addImageLoading:t=>e(e=>e.loadingImages.includes(t)?e:{loadingImages:[...e.loadingImages,t]},!1,`addImageLoading`),removeImageLoading:t=>e(e=>({loadingImages:e.loadingImages.filter(e=>e!==t)}),!1,`removeImageLoading`),clearAllLoading:()=>e({loadingFiles:[],loadingImages:[]},!1,`clearAllLoading`),setMessageToSend:t=>e({messageToSend:{text:t,timestamp:Date.now()}},!1,`setMessageToSend`),restoreMessageToInputIfEmpty:t=>e({messageRestoreIfEmpty:{text:t,timestamp:Date.now()}},!1,`restoreMessageToInputIfEmpty`),clearMessageRestoreIfEmpty:()=>e({messageRestoreIfEmpty:null},!1,`clearMessageRestoreIfEmpty`),setSubmittedMessage:t=>e({submittedMessage:t},!1,`setSubmittedMessage`),resetConversationState:()=>e({shouldHideSuggestions:!1,conversationMode:a(),subConversationTaskId:null,planContent:null},!1,`resetConversationState`),setHasRightPanelToggled:t=>e({hasRightPanelToggled:t},!1,`setHasRightPanelToggled`),setConversationMode:t=>{let r=i();r&&n(r,{conversationMode:t}),e({conversationMode:t},!1,`setConversationMode`)},setSubConversationTaskId:t=>e({subConversationTaskId:t},!1,`setSubConversationTaskId`),setPlanContent:t=>e({planContent:t},!1,`setPlanContent`)}),{name:`conversation-store`}));export{o as t};
@@ -1,3 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{i as r,l as i,n as a}from"./path-utils-BjxzIGLp.js";import{t as o}from"./useMutation-DDo48A8t.js";import{o as s}from"./declaration-DaUdB2Wg.js";import{n as ee}from"./QueryClientProvider-w1cZWY41.js";import{a as c,d as l,n as u,o as d,r as f}from"./agent-server-client-options-9agOSarV.js";import{n as p}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js";import{i as m}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{s as h,t as g}from"./agent-server-conversation-service.api-Cagoqq1V.js";import{t as _}from"./proxy-sRh0WKI7.js";import{t as v}from"./react-Dy05vyj5.js";import{n as y}from"./middleware-CfatjPYZ.js";import{a as te}from"./conversation-local-storage-YmOVXxxW.js";import{t as b}from"./conversation-store-CC-isCnP.js";import{t as x}from"./v4-khGvL7i2.js";import{t as ne}from"./use-user-conversation-BRAseenw.js";import{t as re}from"./conversation-state-store-D-w0uurj.js";import{C as S,_ as C,a as w,b as ie,c as ae,d as T,f as oe,g as E,h as se,i as D,l as ce,m as le,o as ue,p as de,r as fe,s as pe,t as O,u as me,v as k,x as he,y as ge}from"./use-event-store-Cxqc45Sw.js";import{t as _e}from"./command-store-UzKGSUC2.js";import{t as A}from"./browser-store-JRrcGdlk.js";import{t as j}from"./files-tab-store-DLU28g8C.js";var M=e(t(),1),ve=(e,t)=>{let[n,r]=M.useState(!1),[i,a]=M.useState(null),[o,s]=M.useState([]),[ee,c]=M.useState(null),[l,u]=M.useState(!1),d=M.useRef(null),f=M.useRef(0),p=M.useRef(null),m=M.useRef(!0),h=M.useRef(new WeakSet),g=M.useRef(t);M.useEffect(()=>{g.current=t},[t]);let _=M.useCallback(()=>{let t=e;if(g.current?.queryParams){let n=Object.entries(g.current.queryParams).reduce((e,[t,n])=>(e[t]=String(n),e),{});t=`${e}?${new URLSearchParams(n).toString()}`}let n=new WebSocket(t);d.current=n,h.current.add(n),n.onopen=e=>{r(!0),c(null),u(!1),f.current=0,g.current?.onOpen?.(e)},n.onmessage=e=>{a(e.data),s(t=>[...t,e.data]),g.current?.onMessage?.(e)},n.onclose=e=>{let t=h.current.has(n);r(!1),e.code!==1e3&&(c(Error(`WebSocket closed with code ${e.code}: ${e.reason||`Connection closed unexpectedly`}`)),t&&g.current?.onError?.(e)),g.current?.onClose?.(e);let i=g.current?.reconnect?.enabled??!1,a=g.current?.reconnect?.maxAttempts??1/0;i&&t&&m.current&&f.current<a?(u(!0),f.current+=1,p.current=setTimeout(()=>{_()},3e3)):u(!1)},n.onerror=e=>{r(!1),g.current?.onError?.(e)}},[e]);M.useEffect(()=>(m.current=!0,f.current=0,e&&e.trim()!==``&&_(),()=>{if(m.current=!1,p.current&&=(clearTimeout(p.current),null),d.current){let{readyState:e}=d.current;h.current.delete(d.current),(e===WebSocket.CONNECTING||e===WebSocket.OPEN)&&d.current.close(),d.current=null}}),[e,_]);let v=M.useCallback(e=>{d.current?.readyState===WebSocket.OPEN&&d.current.send(e)},[]),y=M.useCallback(()=>{m.current=!1,u(!1),p.current&&=(clearTimeout(p.current),null),d.current&&(h.current.delete(d.current),d.current.close())},[]),te=M.useCallback(()=>{if(m.current=!0,f.current=0,u(!0),c(null),p.current&&=(clearTimeout(p.current),null),d.current){let e=d.current;h.current.delete(e),d.current=null,(e.readyState===WebSocket.CONNECTING||e.readyState===WebSocket.OPEN)&&e.close()}_()},[_]);return{isConnected:n,lastMessage:i,messages:o,error:ee,socket:d.current,sendMessage:v,isReconnecting:l,attemptCount:f.current,disconnect:y,reconnect:te}},N=`Unable to connect to server`,P={errorMessage:null,errorType:null},ye=v(e=>({...P,setErrorMessage:(t,n=`conversation`)=>e(()=>({errorMessage:t,errorType:n})),removeErrorMessage:()=>e(()=>({errorMessage:null,errorType:null})),clearConnectionError:()=>e(e=>e.errorType===`connection`?{errorMessage:null,errorType:null}:e)})),F=15e4,I={pendingMessages:[]},L=()=>`pending-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,be=v((e,t)=>({...I,enqueuePendingMessage:n=>{let r=L(),i={id:r,conversationId:n.conversationId,text:n.text,content:n.content??n.text,status:`sending`,imageUrls:n.imageUrls??[],fileUrls:n.fileUrls??[],timestamp:n.timestamp??new Date().toISOString()};return e(e=>({pendingMessages:[...e.pendingMessages,i]})),setTimeout(()=>{t().pendingMessages.find(e=>e.id===r)?.status===`sending`&&t().markPendingMessageError(r,`Send timed out`)},F),r},markPendingMessageError:(t,n)=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.id===t?{...e,status:`error`,errorMessage:n}:e)})),markPendingMessageSending:t=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.id===t?{...e,status:`sending`,errorMessage:void 0}:e)})),removePendingMessage:t=>e(e=>({pendingMessages:e.pendingMessages.filter(e=>e.id!==t)})),consumeMatchingPendingMessage:(t,n)=>{let r=null;return e(e=>{let i=e.pendingMessages.map((e,t)=>({m:e,i:t})).filter(({m:e})=>e.status===`sending`&&e.conversationId===t);if(i.length===0)return e;let a=i.find(({m:e})=>e.content===n)??i[0];return r=a.m,{pendingMessages:[...e.pendingMessages.slice(0,a.i),...e.pendingMessages.slice(a.i+1)]}}),r},clearPendingMessages:()=>e(()=>({...I})),reassignPendingMessages:(t,n)=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.conversationId===t?{...e,conversationId:n}:e)}))})),R=new Set([`files`,`browser`,`vscode`,`terminal`,`planner`,`tasklist`]);function z(e){let t=b.getState();t.setSelectedTab(e),t.isRightPanelShown||(t.setHasRightPanelToggled(!0),t.setIsRightPanelShown(!0))}function B(e){return R.has(e)}function xe(e){switch(e.command){case`navigate_to_file`:case`show_preview`:z(`files`),e.path&&j.getState().setSelectedPath(e.path);return;case`open_tab`:e.tab&&B(e.tab)?z(e.tab):e.tab&&console.warn(`[canvas_ui] Ignoring open_tab with unknown tab: ${e.tab}`);return}}var V=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:[...e.entriesByConversation[t]??[],n]}}),H=v()(y(e=>({entriesByConversation:{},activeProfileByConversation:{},show:(t,n,r)=>e(e=>V(e,t,{id:x(),anchorEventId:n,profiles:r})),recordSwitch:(t,n,r)=>e(e=>({...V(e,t,{id:x(),anchorEventId:n,profiles:[],switchedTo:r}),activeProfileByConversation:{...e.activeProfileByConversation,[t]:r}})),clearActiveProfile:t=>e(e=>{if(!(t in e.activeProfileByConversation))return e;let n={...e.activeProfileByConversation};return delete n[t],{activeProfileByConversation:n}}),clear:t=>e(e=>{let n={...e.entriesByConversation};delete n[t];let r={...e.activeProfileByConversation};return delete r[t],{entriesByConversation:n,activeProfileByConversation:r}}),clearAll:()=>e({entriesByConversation:{},activeProfileByConversation:{}})}),{name:`ModelStore`})),Se=(e,t,n)=>{let{action:r}=e;if((r.kind===`StrReplaceEditorAction`||r.kind===`FileEditorAction`||r.kind===`ExecuteBashAction`)&&n.invalidateQueries({queryKey:[`file_changes`,t]},{cancelRefetch:!1}),(r.kind===`StrReplaceEditorAction`||r.kind===`FileEditorAction`)&&r.path){let e=a(r.path);n.invalidateQueries({queryKey:[`file_diff`,t,e]})}e.tool_name===`SwitchLLMTool`&&(n.invalidateQueries({queryKey:[`user`,`conversation`,t]}),H.getState().clearActiveProfile(t))},Ce=class{static async respondToConfirmation(e,t,n,r){let i=l().backend;return i.kind===`cloud`?_({backend:i,method:`POST`,hostOverride:c(t),path:`/api/conversations/${e}/events/respond_to_confirmation`,body:n,authMode:`session-api-key`,sessionApiKey:r}):new h(u({conversationUrl:t,sessionApiKey:r})).respondToConfirmation(e,n)}static async getEventCount(e,t,n){let r=l().backend;return r.kind===`cloud`?_({backend:r,method:`GET`,hostOverride:c(t),path:`/api/conversations/${e}/events/count`,authMode:`session-api-key`,sessionApiKey:n}):new h(u({conversationUrl:t,sessionApiKey:n})).getEventCount(e)}static async searchEvents(e,t,n,r={}){let i=l().backend,a=r.limit??100;if(i.kind===`cloud`){let t=Math.min(a,100),n=!!(r.sortOrder||r.pageId||r.timestampGte||r.timestampLt),o=new URLSearchParams;o.set(`limit`,String(t)),r.sortOrder&&o.set(`sort_order`,r.sortOrder),r.pageId&&o.set(`page_id`,r.pageId),r.timestampGte&&o.set(`timestamp__gte`,r.timestampGte),r.timestampLt&&o.set(`timestamp__lt`,r.timestampLt);let s=t=>_({backend:i,method:`GET`,path:`/api/v1/conversation/${e}/events/search?${t.toString()}`});try{let e=await s(o);return{items:e?.items??[],next_page_id:e?.next_page_id??null}}catch(e){if(!n)throw e;return console.warn(`[EventService] Cloud backend doesn't support pagination filters. Falling back to initial load only. Server needs OpenHands/OpenHands#14399.`),{items:[],next_page_id:null}}}let o=await new m(f({conversationUrl:t,sessionApiKey:n}),e).search({limit:a,...r.pageId?{page_id:r.pageId}:{},...r.sortOrder?{sort_order:r.sortOrder}:{},...r.timestampGte?{timestamp__gte:r.timestampGte}:{},...r.timestampLt?{timestamp__lt:r.timestampLt}:{}});return{items:o?.items??[],next_page_id:o?.next_page_id??null}}};function U({message:e,source:t,metadata:n={},posthog:r}){if(!r)return;let i=Error(e);r.captureException(i,{error_source:t||`unknown`,...n})}var we=()=>o({mutationKey:[`read-conversation-file`],mutationFn:async({conversationId:e,filePath:t})=>g.readConversationFile(e,t)}),Te=v(e=>({cost:null,max_budget_per_task:null,usage:null,setMetrics:t=>e(t)})),Ee=e=>{let{data:t}=ne(e??null);return n({queryKey:[`conversation-history`,e,t?.conversation_url??null,t?.session_api_key??null],enabled:!!e&&!!t,queryFn:async()=>{if(!e)return{events:[],hasMore:!1,nextPageId:null};let n=await Ce.searchEvents(e,t?.conversation_url??null,t?.session_api_key??null,{limit:50,sortOrder:`TIMESTAMP_DESC`});if(!Array.isArray(n.items))throw Error(`Invalid conversation history response: expected page.items to be an array.`);return{events:[...n.items].reverse(),hasMore:!!n.next_page_id||n.items.length>=50,nextPageId:n.next_page_id??null}},staleTime:1/0,gcTime:1800*1e3})},W=e=>{if(T(e))return!1;if(D(e)){let t=e.action.kind;return!(!t||t===`ExecuteBashAction`&&e.source===`user`||t===`PlanningFileEditorAction`||t===`SwitchLLMAction`)}return k(e)?!(e.observation.kind===`SwitchLLMObservation`&&!e.observation.is_error):!!(C(e)||w(e)||E(e)||fe(e))},G=e=>e.some(e=>e.source===`user`),K=()=>{let{uiEvents:e}=O.getState();for(let t=e.length-1;t>=0;--t){let n=e[t];if(W(n))return String(n.id)}return null};function De(e,t,n=K()){H.getState().recordSwitch(e,n,t)}var Oe=s(),ke=(0,M.createContext)(void 0);function Ae(e){return e.llm_message.content.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function je({children:e,conversationId:t,conversationUrl:n,sessionApiKey:a,subConversations:o,subConversationIds:s}){let[c,l]=(0,M.useState)(`CONNECTING`),[f,m]=(0,M.useState)(`CONNECTING`),g=M.useRef(!1),_=M.useRef(!1),v=p(),y=ee(),x=O(e=>e.addEvent),ne=O(e=>e.addEvents),C=O(e=>e.clearEventsForConversation),{setErrorMessage:E,removeErrorMessage:fe,clearConnectionError:k}=ye(),j=be(e=>e.consumeMatchingPendingMessage),{setExecutionStatus:P}=re(),{appendInput:F,appendOutput:I}=_e(),L=A(e=>e.reset),[R,z]=(0,M.useState)(!0),[B,V]=(0,M.useState)(null),{setPlanContent:H}=b(),{mutate:W}=we(),G=(0,M.useRef)(0),K=(0,M.useRef)(null),je=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1,q=(0,M.useCallback)(()=>{k()},[k]),J=(0,M.useCallback)(e=>{if(e.value.usage_to_metrics?.agent){let t=e.value.usage_to_metrics.agent,n={cost:t.accumulated_cost,max_budget_per_task:t.max_budget_per_task??null,usage:t.accumulated_token_usage?{prompt_tokens:t.accumulated_token_usage.prompt_tokens,completion_tokens:t.accumulated_token_usage.completion_tokens,cache_read_tokens:t.accumulated_token_usage.cache_read_tokens,cache_write_tokens:t.accumulated_token_usage.cache_write_tokens,context_window:t.accumulated_token_usage.context_window,per_turn_token:t.accumulated_token_usage.per_turn_token}:null};Te.getState().setMetrics(n)}},[]),{data:Y,isPending:X,isError:Me}=Ee(t),Ne=!!t&&X;(0,M.useLayoutEffect)(()=>{let e=t??null;O.getState().loadedConversationId!==e&&(C(e),L())},[t,C,L]),(0,M.useLayoutEffect)(()=>{if(!(!Y||Y.events.length===0)&&(ne(Y.events),t))for(let e of Y.events)S(e)&&j(t,Ae(e))},[Y,ne,t,j]);let Pe=(0,M.useMemo)(()=>{if(X)return null;let e=Y?.events??[],t=e[e.length-1];return!t||!(`timestamp`in t)||!t.timestamp?null:t.timestamp},[Y,X]),Fe=(0,M.useMemo)(()=>!t||!n||X&&!Me?null:d(t,n),[t,n,X,Me]),Z=(0,M.useMemo)(()=>{if(!o?.length)return null;let e=o[0];return!e?.id||!e.conversation_url?null:d(e.id,e.conversation_url)},[o]),Ie=(0,M.useMemo)(()=>Z?c===`CONNECTING`||f===`CONNECTING`?`CONNECTING`:c===`OPEN`&&f===`OPEN`?`OPEN`:c===`CLOSED`&&f===`CLOSED`?`CLOSED`:c===`CLOSING`||f===`CLOSING`?`CLOSING`:`CLOSED`:c,[c,f,Z]);(0,M.useEffect)(()=>{B!==null&&G.current>=B&&R&&z(!1)},[B,R,G]),(0,M.useEffect)(()=>{if(!R&&K.current){let{path:e,conversationId:t}=K.current;W({conversationId:t,filePath:e},{onSuccess:e=>{H(e)},onError:e=>{console.warn(`Failed to read conversation file:`,e)}}),K.current=null}},[R,W,H]),(0,M.useEffect)(()=>{g.current=!1,z(!!s?.length),V(null),G.current=0,K.current=null},[s]),(0,M.useEffect)(()=>{g.current=!1,_.current=!1,K.current=null},[t]);let Le=(0,M.useMemo)(()=>Ne||R,[Ne,R]),Re=(0,M.useCallback)(e=>{try{let n=JSON.parse(e.data);if(ue(n)){let e=!O.getState().eventIds.has(n.id)&&he(n)?n:null;if(x(n),oe(n)){let e=n;U({message:e.detail,source:`conversation`,metadata:{eventId:e.id,errorCode:e.code},posthog:v}),E(e.detail)}else q();if(w(n)&&U({message:n.error,source:`agent`,metadata:{eventId:n.id,toolName:n.tool_name,toolCallId:n.tool_call_id},posthog:v}),S(n)&&t&&(j(t,Ae(n)),te(t,{draftMessage:null})),D(n)&&Se(n,t||`test-conversation-id`,y),T(n)&&(se(n)&&P(n.value.execution_status),pe(n)&&P(n.value),ie(n)&&J(n)),de(n)&&F(n.action.command),le(n)&&I(n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
2
- `)),ce(n)){let{screenshot_data:e}=n.observation;if(e){let t=e.startsWith(`data:`)?e:`data:image/png;base64,${e}`;A.getState().setScreenshotSrc(t)}}ae(n)&&A.getState().setUrl(n.action.url),t&&e&&!e.observation.is_error&&(De(t,e.observation.profile_name),e.observation.active_model&&i(y,t,e.observation.active_model),r(y,t)),me(n)&&xe(n.action)}}catch(e){console.warn(`Failed to parse WebSocket message as JSON:`,e)}},[x,E,j,y,t,P,F,I,J,q,v]),ze=(0,M.useCallback)(e=>{try{let n=JSON.parse(e.data);if(R&&(G.current+=1,B!==null&&G.current>=B&&z(!1)),ue(n)){if(x({...n,isFromPlanningAgent:!0}),oe(n)){let e=n;U({message:e.detail,source:`planning_conversation`,metadata:{eventId:e.id,errorCode:e.code},posthog:v}),E(e.detail)}else q();if(w(n)&&U({message:n.error,source:`planning_agent`,metadata:{eventId:n.id,toolName:n.tool_name,toolCallId:n.tool_call_id},posthog:v}),S(n)&&t&&(j(t,Ae(n)),te(t,{draftMessage:null})),D(n)&&Se(n,o?.[0]?.id||`test-conversation-id`,y),T(n)&&(se(n)&&P(n.value.execution_status),pe(n)&&P(n.value),ie(n)&&J(n)),de(n)&&F(n.action.command),le(n)&&I(n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
3
- `)),ge(n)){let{path:e}=n.observation;if(je(e)){let t=o?.[0]?.id;t&&e&&(R?K.current={path:e,conversationId:t}:W({conversationId:t,filePath:e},{onSuccess:e=>{H(e)},onError:e=>{console.warn(`Failed to read conversation file:`,e)}}))}}}}catch(e){console.warn(`Failed to parse WebSocket message as JSON:`,e)}},[x,R,B,E,j,y,o,t,P,F,I,W,H,J,q,v]),Be=(0,M.useMemo)(()=>{let e=Pe?{resend_mode:`since`,after_timestamp:Pe}:{resend_mode:`all`};return a&&(e.session_api_key=a),{queryParams:e,reconnect:{enabled:!0},onOpen:()=>{l(`OPEN`),g.current=!0,k()},onClose:()=>{l(`CLOSED`)},onError:()=>{l(`CLOSED`),g.current&&E(N,`connection`)},onMessage:Re}},[Re,E,k,a,Pe]),Ve=(0,M.useMemo)(()=>{let e={resend_all:!0};a&&(e.session_api_key=a);let t=o?.[0];return{queryParams:e,reconnect:{enabled:!0},onOpen:async()=>{if(m(`OPEN`),_.current=!0,k(),t?.id&&t.conversation_url)try{let e=await Ce.getEventCount(t.id,t.conversation_url,t.session_api_key);V(e),e===0&&z(!1)}catch{z(!1)}},onClose:()=>{m(`CLOSED`)},onError:()=>{m(`CLOSED`),_.current&&E(N,`connection`)},onMessage:ze}},[ze,E,k,a,o]),{socket:Q,reconnect:He}=ve(Fe||``,Be),{socket:$,reconnect:Ue}=ve(Z||``,Ve),We=(0,M.useCallback)(()=>{if(fe(),b.getState().conversationMode===`plan`&&Z){Ue();return}He()},[Z,He,Ue,fe]),Ge=(0,M.useCallback)(async e=>{let n=b.getState().conversationMode===`plan`?$:Q;if(n?.readyState!==WebSocket.OPEN){if(!t){let e=Error(`No conversation ID available`);throw E(e.message),e}try{return await new h(u()).sendEvent(t,{role:`user`,content:e.content},{run:!0}),{queued:!0}}catch(e){throw E(e instanceof Error?e.message:`Failed to queue message for delivery`),e}}try{return n.send(JSON.stringify({...e,run:!0})),{queued:!1}}catch(e){throw E(e instanceof Error?e.message:`Failed to send message`),e}},[Q,$,E,t]);(0,M.useEffect)(()=>{Q&&Fe&&(()=>{switch(Q.readyState){case WebSocket.CONNECTING:l(`CONNECTING`);break;case WebSocket.OPEN:l(`OPEN`);break;case WebSocket.CLOSING:l(`CLOSING`);break;case WebSocket.CLOSED:l(`CLOSED`);break;default:l(`CLOSED`);break}})()},[Q,Fe]),(0,M.useEffect)(()=>{$&&Z&&(()=>{switch($.readyState){case WebSocket.CONNECTING:m(`CONNECTING`);break;case WebSocket.OPEN:m(`OPEN`);break;case WebSocket.CLOSING:m(`CLOSING`);break;case WebSocket.CLOSED:m(`CLOSED`);break;default:m(`CLOSED`);break}})()},[$,Z]);let Ke=(0,M.useMemo)(()=>({connectionState:Ie,sendMessage:Ge,isLoadingHistory:Le,reconnect:We}),[Ie,Ge,Le,We]);return(0,Oe.jsx)(ke.Provider,{value:Ke,children:e})}var q=()=>(0,M.useContext)(ke)||null;export{G as a,Te as c,be as d,ye as f,K as i,Ce as l,q as n,W as o,N as p,De as r,Ee as s,je as t,H as u};
@@ -1 +0,0 @@
1
- import{a as e,i as t,t as n}from"./vendor~conversation-panel~conversation~index-BZ5C6Xpz.js";var r={renderer:e,...t,...n};export{r as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./react-dom-hVBnwgwZ.js";import{t as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{t as i}from"./useMutation-DDo48A8t.js";import{o as a,t as o}from"./declaration-DaUdB2Wg.js";import{n as s}from"./QueryClientProvider-w1cZWY41.js";import{t as c}from"./useTranslation-CEcjrme-.js";import{n as l,r as u}from"./custom-toast-handlers-BohXx7uh.js";import{t as d}from"./utils-CdgBzLA7.js";import{d as f,p,t as m}from"./agent-server-client-options-9agOSarV.js";import{n as h}from"./active-backend-context-I2w666XY.js";import{r as g}from"./modal-classes-DwTdT3IK.js";import{c as ee,d as te,t as _}from"./brand-button-LBFNic99.js";import{r as v,u as y}from"./dropdown-classes-Vqz86I0R.js";import{n as ne,r as re}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js";import{t as b}from"./proxy-sRh0WKI7.js";import{t as x}from"./settings-input-8y5p4kze.js";import{n as S,t as ie}from"./context-menu-list-item-D0swnhFt.js";import{t as C}from"./settings-dropdown-input-DA_pzHWE.js";import{t as w}from"./x-mark-DsJ9tDD0.js";import{t as T}from"./automation-DJ_3GeXD.js";var E=`/api/automation`,D=re.create();D.interceptors.request.use(e=>{let t=p();if(!t)throw new m;e.baseURL||=t.host;let n=t.apiKey?.trim();return n&&e.headers.set(`X-Session-API-Key`,n),e});function O(e,t){let n=new URLSearchParams;return n.set(`limit`,String(e)),n.set(`offset`,String(t)),n.toString()}var k=class e{static async listAutomations(e={}){let{limit:t=50,offset:n=0}=e,r=f().backend;if(r.kind===`cloud`)return b({backend:r,method:`GET`,path:`${E}/v1?${O(t,n)}`});let{data:i}=await D.get(`${E}/v1`,{params:{limit:t,offset:n}});return i}static async getAutomations(t=50,n=0){return e.listAutomations({limit:t,offset:n})}static async getAutomation(e){let t=f().backend,n=`${E}/v1/${encodeURIComponent(e)}`;if(t.kind===`cloud`)return b({backend:t,method:`GET`,path:n});let{data:r}=await D.get(n);return r}static async updateAutomation(e,t){let n=f().backend,r=`${E}/v1/${encodeURIComponent(e)}`;if(n.kind===`cloud`)return b({backend:n,method:`PATCH`,path:r,body:t});let{data:i}=await D.patch(r,t);return i}static async deleteAutomation(e){let t=f().backend,n=`${E}/v1/${encodeURIComponent(e)}`;if(t.kind===`cloud`){await b({backend:t,method:`DELETE`,path:n});return}await D.delete(n)}static async dispatchAutomation(e){let t=f().backend,n=`${E}/v1/${encodeURIComponent(e)}/dispatch`;if(t.kind===`cloud`)return b({backend:t,method:`POST`,path:n});let{data:r}=await D.post(n);return r}static async listAutomationRuns(e,t={}){let{limit:n=50,offset:r=0}=t,i=f().backend,a=`${E}/v1/${encodeURIComponent(e)}/runs`;if(i.kind===`cloud`)return b({backend:i,method:`GET`,path:`${a}?${O(n,r)}`});let{data:o}=await D.get(a,{params:{limit:n,offset:r}});return o}static async getAutomationRuns(t,n=50,r=0){return e.listAutomationRuns(t,{limit:n,offset:r})}static async toggleAutomation(t,n){return e.updateAutomation(t,{enabled:n})}static async downloadTarball(e,t){let n=f().backend,r=`${E}/v1/${encodeURIComponent(e)}/tarball`,i;if(n.kind===`cloud`)i=await b({backend:n,method:`GET`,path:r,responseType:`blob`});else{let{data:e}=await D.get(r,{responseType:`blob`});i=e}let a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=`${t}.tar`,o.click(),URL.revokeObjectURL(a)}static async checkHealth(){let e=f().backend,t=`${E}/health`;try{if(e.kind===`cloud`)return await b({backend:e,method:`GET`,path:t});let{data:n}=await D.get(t,{timeout:5e3});return n}catch{return{status:`error`}}}},A=e(t()),ae=e(n(),1),j=a(),M=[`automation-detail`],N=[`automation-runs`];function oe(e){let{id:t,enabled:n=!0}=e,i=h();return r({queryKey:[...M,t,i.backend.id,i.orgId],queryFn:()=>k.getAutomation(t),staleTime:300*1e3,enabled:!!t&&n})}function P(e){let{id:t,limit:n=20,offset:i=0,enabled:a=!0}=e,o=h();return r({queryKey:[...N,t,{limit:n,offset:i},o.backend.id,o.orgId],queryFn:()=>k.getAutomationRuns(t,n,i),staleTime:60*1e3,enabled:!!t&&a,refetchInterval:e=>{let t=e.state.data;return t&&t.runs.some(e=>e.status===T.PENDING||e.status===T.RUNNING)?3e3:!1}})}var F=[`automations`];function I(e={}){let{limit:t=50,offset:n=0,enabled:i=!0}=e,a=h();return r({queryKey:[...F,{limit:t,offset:n},a.backend.id,a.orgId],queryFn:()=>k.getAutomations(t,n),staleTime:0,enabled:i})}function L(){let e=s();return i({mutationFn:({id:e,enabled:t})=>k.toggleAutomation(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:F}),e.invalidateQueries({queryKey:M})}})}function R(){let e=s();return i({mutationFn:({id:e,body:t})=>k.updateAutomation(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:F}),e.invalidateQueries({queryKey:M})}})}function z(){let e=s();return i({mutationFn:e=>k.deleteAutomation(e),onSuccess:()=>{e.invalidateQueries({queryKey:F})}})}function B(){let e=s();return i({mutationFn:e=>k.dispatchAutomation(e),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:F}),e.invalidateQueries({queryKey:M}),e.invalidateQueries({queryKey:[...N,n]})}})}var V=[`automation-health`];function H(){let e=h();return r({queryKey:[...V,e.backend.id,e.orgId],queryFn:()=>k.checkHealth(),staleTime:30*1e3,retry:!1})}var U=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 20 20`,...e,children:(0,j.jsx)(`path`,{d:`M10 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z`})}),W=d(`inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,v),G=d(`inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 text-xs text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,v);function K({icon:e,label:t}){return(0,j.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,j.jsx)(`span`,{className:d(`[&_svg]:size-4`,y),"aria-hidden":!0,children:e}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function q({items:e}){let{t}=c(`openhands`),[n,r]=(0,A.useState)(!1),[i,a]=(0,A.useState)(),s=(0,A.useRef)(null),l=(0,A.useRef)(null);(0,A.useLayoutEffect)(()=>{if(!n||!s.current)return;let e=()=>{let e=s.current?.getBoundingClientRect();e&&a({position:`fixed`,zIndex:9999,top:e.bottom+4,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[n]),(0,A.useEffect)(()=>{if(!n)return;let e=e=>{let t=e.target;s.current?.contains(t)||l.current?.contains(t)||r(!1)},t=e=>{e.key===`Escape`&&r(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[n]);let u=n&&i?(0,j.jsx)(S,{ref:l,theme:`popover`,className:`min-w-[10rem]`,children:e.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(ie,{onClick:t=>{t.stopPropagation(),e.onClick(),r(!1)},isDisabled:e.disabled,className:`group`,children:(0,j.jsx)(K,{icon:e.icon,label:e.label})})},e.label))}):null;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{ref:s,type:`button`,onClick:e=>{e.stopPropagation(),r(e=>!e)},className:W,"aria-label":t(o.AUTOMATIONS$ACTIONS_MENU),"aria-expanded":n,"aria-haspopup":`menu`,children:(0,j.jsx)(U,{className:`size-4`})}),n&&i&&typeof document<`u`?ae.createPortal((0,j.jsx)(`div`,{style:i,children:u}),document.body):null]})}function se(e){return!0}var ce=e=>(0,j.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,j.jsx)(`g`,{clipPath:`url(#clip0_8467_30872)`,children:(0,j.jsx)(`path`,{d:`M6.26693 21.4874L6.25583 21.4951L6.24514 21.5033C5.95991 21.7227 5.5 21.5308 5.5 21.0996V2.89961C5.5 2.4684 5.95991 2.2765 6.24514 2.49592L6.25634 2.50452L6.26799 2.51249L19.518 11.5625L19.518 11.5625L19.5226 11.5656C19.8258 11.7677 19.8258 12.1815 19.5226 12.3836L19.5226 12.3835L19.5169 12.3874L6.26693 21.4874Z`,fill:`currentColor`,stroke:`currentColor`})}),(0,j.jsx)(`defs`,{children:(0,j.jsx)(`clipPath`,{id:`clip0_8467_30872`,children:(0,j.jsx)(`rect`,{width:24,height:24,fill:`white`})})})]}),le=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,j.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),ue=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,j.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z`})}),de=/^(\d+)$/;function J(e,t,n){let r=e.match(de);if(!r)return null;let i=Number(r[1]);return Number.isNaN(i)||i<t||i>n?null:i}function fe(e){let t=(e??``).trim();if(!t)return{kind:`custom`,raw:``};let n=t.split(/\s+/);if(n.length!==5)return{kind:`custom`,raw:t};let[r,i,a,o,s]=n,c=J(r,0,59),l=J(i,0,23);if(c===null||l===null)return{kind:`custom`,raw:t};if(a!==`*`||o!==`*`)return{kind:`custom`,raw:t,hour:l,minute:c};if(s===`*`||s===`0-6`)return{kind:`daily`,hour:l,minute:c};if(s===`1-5`)return{kind:`weekdays`,hour:l,minute:c};let u=J(s,0,6);return u===null?{kind:`custom`,raw:t,hour:l,minute:c}:{kind:`weekly`,hour:l,minute:c,weekday:u}}function pe(e){let{kind:t,hour:n,minute:r,weekday:i}=e;switch(t){case`daily`:return`${r} ${n} * * *`;case`weekdays`:return`${r} ${n} * * 1-5`;case`weekly`:return`${r} ${n} * * ${i??1}`;default:return t}}function Y(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function X(e){let t=e.match(/^(\d{1,2}):(\d{2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return Number.isNaN(n)||Number.isNaN(r)||n<0||n>23||r<0||r>59?null:{hour:n,minute:r}}function Z(e){return e?Array.isArray(e)?e.join(`, `):e:`—`}var me=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,j.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5.636 5.636a9 9 0 1012.728 0M12 3v9`})}),he=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,j.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),Q=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,...e,children:(0,j.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z`})});function ge({onRetry:e}){let{t}=c(`openhands`);return(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,j.jsx)(Q,{className:`size-12 text-danger`}),(0,j.jsx)(`p`,{className:`mt-4 text-sm text-muted`,children:t(o.AUTOMATIONS$ERROR_TITLE)}),(0,j.jsx)(`button`,{type:`button`,onClick:e,className:`mt-4 rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:t(o.AUTOMATIONS$ERROR_RETRY)})]})}function $({onRetry:e}){let{t}=c(`openhands`);return(0,j.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 px-4`,children:[(0,j.jsx)(Q,{className:`size-12 text-[var(--oh-warning)]`}),(0,j.jsx)(`h2`,{className:`mt-4 text-lg font-medium text-content`,children:t(o.AUTOMATIONS$BACKEND_UNAVAILABLE_TITLE)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-muted text-center max-w-md`,children:t(o.AUTOMATIONS$BACKEND_UNAVAILABLE_MESSAGE)}),(0,j.jsx)(_,{type:`button`,variant:`secondary`,className:`mt-6`,onClick:e,children:t(o.AUTOMATIONS$BACKEND_UNAVAILABLE_RETRY)})]})}function _e({automationName:e,isOpen:t,onConfirm:n,onCancel:r}){let{t:i}=c(`openhands`);return t?(0,j.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,j.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,j.jsxs)(`div`,{className:`relative w-full max-w-sm rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":`Close`,children:(0,j.jsx)(w,{className:`size-5`})}),(0,j.jsx)(`h2`,{className:g,children:i(o.AUTOMATIONS$DELETE_CONFIRM_TITLE)}),(0,j.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:i(o.AUTOMATIONS$DELETE_CONFIRM_MESSAGE,{name:e})}),(0,j.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:i(o.AUTOMATIONS$CANCEL)}),(0,j.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg bg-danger px-4 py-2 text-sm text-white hover:bg-danger/80`,children:i(o.AUTOMATIONS$DELETE)})]})]})]}):null}var ve=[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 ye(e){if(e.trigger.type===`event`)return{name:e.name,prompt:e.prompt??``,frequency:`custom`,weekday:1,timeOfDay:``,isCustomSchedule:!0,rawSchedule:``};let t=fe(e.trigger.schedule);return t.kind===`custom`?{name:e.name,prompt:e.prompt??``,frequency:`custom`,weekday:1,timeOfDay:t.hour!==void 0&&t.minute!==void 0?Y(t.hour,t.minute):``,isCustomSchedule:!0,rawSchedule:t.raw}:{name:e.name,prompt:e.prompt??``,frequency:t.kind,weekday:t.kind===`weekly`?t.weekday??1:1,timeOfDay:Y(t.hour,t.minute),isCustomSchedule:!1,rawSchedule:e.trigger.schedule??``}}function be({automation:e,isOpen:t,onClose:n}){let{t:r}=c(`openhands`),i=R(),a=(0,A.useMemo)(()=>ye(e),[e]),[s,f]=(0,A.useState)(a),[p,m]=(0,A.useState)(null);if((0,A.useEffect)(()=>{t&&(f(a),m(null))},[t,a]),!t)return null;let h=[{key:`daily`,label:r(o.AUTOMATIONS$FREQUENCY_DAILY)},{key:`weekdays`,label:r(o.AUTOMATIONS$FREQUENCY_WEEKDAYS)},{key:`weekly`,label:r(o.AUTOMATIONS$FREQUENCY_WEEKLY)},...s.isCustomSchedule?[{key:`custom`,label:r(o.AUTOMATIONS$FREQUENCY_CUSTOM)}]:[]],v=ve.map((e,t)=>({key:String(t),label:r(e)})),y=!s.isCustomSchedule||X(s.timeOfDay)!==null||s.timeOfDay===``;return(0,j.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,j.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`presentation`}),(0,j.jsxs)(`div`,{className:`relative w-full max-w-md rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":r(o.AUTOMATIONS$CANCEL),children:(0,j.jsx)(w,{className:`size-5`})}),(0,j.jsx)(`h2`,{className:g,children:r(o.AUTOMATIONS$EDIT_TITLE)}),(0,j.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let a=s.name.trim();if(!a){m(r(o.AUTOMATIONS$NAME_REQUIRED));return}m(null);let c={};a!==e.name&&(c.name=a);let d=s.prompt.trim();if(d!==(e.prompt??``).trim()&&(c.prompt=d.length===0?null:d),!s.isCustomSchedule&&s.frequency!==`custom`){let t=X(s.timeOfDay);if(t){let n=pe({kind:s.frequency,hour:t.hour,minute:t.minute,weekday:s.frequency===`weekly`?s.weekday:void 0});n!==e.trigger.schedule&&(c.trigger={...e.trigger,schedule:n})}}if(Object.keys(c).length===0){n();return}i.mutate({id:e.id,body:c},{onSuccess:()=>{u(r(o.AUTOMATIONS$EDIT_SUCCESS)),n()},onError:e=>{l(ne(e)?e.response?.data?.message||e.message||r(o.AUTOMATIONS$EDIT_ERROR):e.message||r(o.AUTOMATIONS$EDIT_ERROR))}})},className:`mt-4 flex flex-col gap-4`,"aria-label":r(o.AUTOMATIONS$EDIT_TITLE),children:[(0,j.jsx)(x,{testId:`edit-automation-name`,name:`name`,type:`text`,label:r(o.AUTOMATIONS$NAME),value:s.name,onChange:e=>f(t=>({...t,name:e})),error:p??void 0,showRequiredTag:!0}),(0,j.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,j.jsx)(`span`,{className:`text-sm`,children:r(o.AUTOMATIONS$PROMPT)}),(0,j.jsx)(`textarea`,{"data-testid":`edit-automation-prompt`,name:`prompt`,value:s.prompt,onChange:e=>f(t=>({...t,prompt:e.target.value})),rows:4,className:d(ee,`placeholder:italic`)}),(0,j.jsx)(`span`,{className:`text-xs text-muted`,children:r(o.AUTOMATIONS$EDIT_PROMPT_HINT)})]}),e.trigger.type===`event`?(0,j.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg bg-[var(--oh-surface-raised)] p-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(o.AUTOMATIONS$DETAIL$TRIGGER)}),(0,j.jsx)(`span`,{className:`text-sm text-content`,children:r(o.AUTOMATIONS$DETAIL$TRIGGER_EVENT)})]}),e.trigger.source&&(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(o.AUTOMATIONS$DETAIL$EVENT_SOURCE)}),(0,j.jsx)(`span`,{className:`text-sm text-content`,children:e.trigger.source})]}),e.trigger.on&&(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(o.AUTOMATIONS$DETAIL$EVENT_TYPE)}),(0,j.jsx)(`code`,{className:`text-xs font-mono text-content`,children:Z(e.trigger.on)})]}),e.trigger.filter&&(0,j.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(o.AUTOMATIONS$DETAIL$EVENT_FILTER)}),(0,j.jsx)(`code`,{className:`text-xs font-mono text-content break-all`,children:e.trigger.filter})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(C,{testId:`edit-automation-frequency`,name:`frequency`,label:r(o.AUTOMATIONS$FREQUENCY),items:h,selectedKey:s.frequency,isDisabled:s.isCustomSchedule,onSelectionChange:e=>{!e||s.isCustomSchedule||f(t=>({...t,frequency:e}))}}),s.frequency===`weekly`&&!s.isCustomSchedule&&(0,j.jsx)(C,{testId:`edit-automation-weekday`,name:`weekday`,label:r(o.AUTOMATIONS$WEEKDAY),items:v,selectedKey:String(s.weekday),onSelectionChange:e=>{e!==null&&f(t=>({...t,weekday:Number(e)}))}}),(0,j.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,j.jsx)(`span`,{className:`text-sm`,children:r(o.AUTOMATIONS$TIME_OF_DAY)}),(0,j.jsx)(`input`,{"data-testid":`edit-automation-time`,name:`timeOfDay`,type:`time`,value:s.timeOfDay,onChange:e=>f(t=>({...t,timeOfDay:e.target.value})),disabled:s.isCustomSchedule&&!y,className:d(te,`disabled:bg-[var(--oh-surface-raised)]`)}),e.timezone&&(0,j.jsxs)(`span`,{className:`text-xs text-muted`,children:[r(o.AUTOMATIONS$TIMEZONE),`: `,e.timezone]})]}),s.isCustomSchedule&&(0,j.jsxs)(`p`,{className:`text-xs text-muted`,"data-testid":`custom-schedule-hint`,children:[r(o.AUTOMATIONS$CUSTOM_SCHEDULE_HINT),s.rawSchedule&&(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`code`,{className:`text-xs text-content`,children:s.rawSchedule})]})]})]}),(0,j.jsxs)(`div`,{className:`mt-2 flex justify-end gap-3`,children:[(0,j.jsx)(_,{testId:`edit-automation-cancel`,type:`button`,variant:`secondary`,onClick:n,isDisabled:i.isPending,children:r(o.AUTOMATIONS$CANCEL)}),(0,j.jsx)(_,{testId:`edit-automation-save`,type:`submit`,variant:`primary`,isDisabled:i.isPending,"aria-busy":i.isPending,children:i.isPending?r(o.AUTOMATIONS$SAVING):r(o.AUTOMATIONS$SAVE)})]})]})]})]})}export{k as C,P as S,I as _,Q as a,L as b,Z as c,ce as d,se as f,H as g,G as h,ge as i,ue as l,W as m,_e as n,he as o,q as p,$ as r,me as s,be as t,le as u,z as v,oe as x,B as y};