@openhands/agent-canvas 1.0.0-rc.2 → 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 (296) hide show
  1. package/README.md +2 -2
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-C55k29rf.js +1 -0
  4. package/build/assets/{add-backend-modal-CIfhseZn.js → add-backend-modal-BdYxoUdL.js} +1 -1
  5. package/build/assets/agent-server-conversation-service.api-js3oYcdU.js +5 -0
  6. package/build/assets/{agent-settings-B6htMeS2.js → agent-settings-BNrffu3I.js} +1 -1
  7. package/build/assets/{alert-banner-D41ZKDZT.js → alert-banner-BzU93oDh.js} +1 -1
  8. package/build/assets/{analytics-consent-form-modal-TINgM_jV.js → analytics-consent-form-modal-Ce-_Skcd.js} +1 -1
  9. package/build/assets/{api-key-entry-screen-Di1vHgIU.js → api-key-entry-screen-CGyS-Cna.js} +1 -1
  10. package/build/assets/{app-settings-CjCa1MOB.js → app-settings-DmOs4oik.js} +1 -1
  11. package/build/assets/{automation-detail-DPoxzTdV.js → automation-detail-DLbCVJCw.js} +1 -1
  12. package/build/assets/{automations-list-DwUEe2Ea.js → automations-list-Ces5shz5.js} +1 -1
  13. package/build/assets/{backend-form-modal-B6q897ZX.js → backend-form-modal-BUy-PzZN.js} +1 -1
  14. package/build/assets/{backend-synced-settings-badge-BwTawSCE.js → backend-synced-settings-badge-1A63yxGs.js} +1 -1
  15. package/build/assets/browser-B8bp1IqT.js +5 -0
  16. package/build/assets/{browser-tab-DiRTKik8.js → browser-tab-CiBRWB4X.js} +1 -1
  17. package/build/assets/chat-send-button-qKFZuB9E.js +1 -0
  18. package/build/assets/{circle-plus-check-toggle-B3_W6-nt.js → circle-plus-check-toggle-CboDp7XB.js} +1 -1
  19. package/build/assets/{condenser-settings-DczjwkIp.js → condenser-settings-FCBjvqSo.js} +1 -1
  20. package/build/assets/conversation-CT8AvxEH.js +1 -0
  21. package/build/assets/conversation-panel-DqDDs4WZ.js +1 -0
  22. package/build/assets/conversation-service.api-y_eB_43m.js +1 -0
  23. package/build/assets/conversation-store-CiYGBud3.js +6 -0
  24. package/build/assets/conversation-vNuLKgz6.js +19 -0
  25. package/build/assets/conversation-websocket-context-Bb4XBXoc.js +3 -0
  26. package/build/assets/{device-verify-BVl4GEvt.js → device-verify-BOQz2LJQ.js} +1 -1
  27. package/build/assets/{edit-automation-modal-kc_FzbzK.js → edit-automation-modal-C-oC5tis.js} +1 -1
  28. package/build/assets/{entry.client-CWkbusD1.js → entry.client-Db3BpFL_.js} +2 -2
  29. package/build/assets/{enum-filter-dropdown-DlY0Q3fj.js → enum-filter-dropdown-DFwoVtOw.js} +1 -1
  30. package/build/assets/{extensions-hub-NbQnt-cn.js → extensions-hub-BxZbAtjP.js} +1 -1
  31. package/build/assets/extensions-navigation-BIb-vAa2.js +1 -0
  32. package/build/assets/{files-tab-mK7Mdyuf.js → files-tab-DpulQlIo.js} +1 -1
  33. package/build/assets/{git-control-bar-branch-button-C1qmab0K.js → git-control-bar-branch-button-D1uam-nI.js} +1 -1
  34. package/build/assets/home-sJAFzI6v.js +1 -0
  35. package/build/assets/install-server-modal-BjEzlLF5.js +1 -0
  36. package/build/assets/{launch-BADsYeGp.js → launch-DgtB1JTX.js} +1 -1
  37. package/build/assets/llm-settings-B8kPJ0Of.js +1 -0
  38. package/build/assets/llm-settings-CjUpPsvA.js +1 -0
  39. package/build/assets/{manage-backends-modal-sH7l5NgI.js → manage-backends-modal-CTA-2x4F.js} +1 -1
  40. package/build/assets/manifest-d3e8504d.js +1 -0
  41. package/build/assets/{markdown-renderer-CZq_UdmE.js → markdown-renderer-oOUs3tw5.js} +1 -1
  42. package/build/assets/{mcp-DdQ72_AO.js → mcp-kJYdM8aJ.js} +1 -1
  43. package/build/assets/messages-BFJXB6MW.js +36 -0
  44. package/build/assets/model-selector-z_QOzaRV.js +1 -0
  45. package/build/assets/{onboarding-DCL9stdH.js → onboarding-CZ_7nd-M.js} +1 -1
  46. package/build/assets/{path-utils-CNd_jqv_.js → path-utils-0KWEiRs9.js} +1 -1
  47. package/build/assets/{planner-tab-QBnZgIXd.js → planner-tab-CNmJiZ22.js} +1 -1
  48. package/build/assets/{recommended-automations-launcher-B01jchhe.js → recommended-automations-launcher-B1kfmFTQ.js} +8 -10
  49. package/build/assets/{root-BBV8Ew9E.js → root-CIZ7Rv1X.js} +2 -2
  50. package/build/assets/root-layout-B5ijp9At.js +2 -0
  51. package/build/assets/{sdk-section-page-BQKe3asw.js → sdk-section-page-DTyvCc52.js} +1 -1
  52. package/build/assets/{sdk-settings-schema-DoRnefvb.js → sdk-settings-schema-B0KrqqPX.js} +1 -1
  53. package/build/assets/{secrets-settings-D2EfzdpC.js → secrets-settings-BQNSDLKS.js} +1 -1
  54. package/build/assets/{settings-B7jVceyu.js → settings-BUlJrO_h.js} +1 -1
  55. package/build/assets/{settings-dropdown-input-BD7ziSoR.js → settings-dropdown-input-BUk4m23x.js} +1 -1
  56. package/build/assets/{settings-index-Xj0v9Oas.js → settings-index-DE91Eahc.js} +1 -1
  57. package/build/assets/{settings-modal-CDBy1S9S.js → settings-modal-CCaPYVqW.js} +1 -1
  58. package/build/assets/{settings-service.api-CTQ-LpAA.js → settings-service.api-4u2RKC8k.js} +1 -1
  59. package/build/assets/{settings-switch-CSHSqH99.js → settings-switch-BQiAS9ga.js} +1 -1
  60. package/build/assets/{settings-utils-BCbzc6-u.js → settings-utils-chxTa1vn.js} +1 -1
  61. package/build/assets/{shared-conversation-BHEbOdHj.js → shared-conversation-sBPLAawM.js} +1 -1
  62. package/build/assets/{sidebar-mobile-menu-toggle-YYPXGikp.js → sidebar-mobile-menu-toggle-BDXWzhyB.js} +1 -1
  63. package/build/assets/{sidebar-nav-link-CiXbBMQx.js → sidebar-nav-link-Bhlzlhp8.js} +1 -1
  64. package/build/assets/{skill-card-pill-row-BXILn-GK.js → skill-card-pill-row-Bg5joQf6.js} +1 -1
  65. package/build/assets/{skills-plugins-Bs5HiF1O.js → skills-plugins-fihjo1KZ.js} +1 -1
  66. package/build/assets/{skills-settings-CQYxMmWf.js → skills-settings-NQnuMwZP.js} +1 -1
  67. package/build/assets/{styled-tooltip-DEr7oa0m.js → styled-tooltip-GXy1qxsO.js} +1 -1
  68. package/build/assets/{task-list-tab-R9N3Wd-U.js → task-list-tab-Hl9BuVfq.js} +1 -1
  69. package/build/assets/telemetry-j9SLrtY7.js +2 -0
  70. package/build/assets/{terminal-BTM3UFcQ.js → terminal-DRwe8--D.js} +1 -1
  71. package/build/assets/{use-active-conversation-BY5F6A1G.js → use-active-conversation-DJGoI9Mc.js} +1 -1
  72. package/build/assets/{use-agent-settings-schema-CsuMq16G.js → use-agent-settings-schema-DtusObuC.js} +1 -1
  73. package/build/assets/{use-agent-state-DX5NKEa_.js → use-agent-state-BXgWhFh6.js} +1 -1
  74. package/build/assets/{use-create-conversation-4iJytCT1.js → use-create-conversation-CzvaVA5A.js} +1 -1
  75. package/build/assets/use-event-store-DSpvASbC.js +1 -0
  76. package/build/assets/{use-get-secrets-BMnFFBUx.js → use-get-secrets-DiLgP147.js} +1 -1
  77. package/build/assets/use-handle-plan-click-CUZwmKIk.js +1 -0
  78. package/build/assets/{use-launch-skill-in-chat-BoqKmEHC.js → use-launch-skill-in-chat-ClRJlIx7.js} +1 -1
  79. package/build/assets/use-runtime-is-ready-CWkGQFsb.js +1 -0
  80. package/build/assets/{use-save-settings-hK6LYt0s.js → use-save-settings-CP23emUY.js} +1 -1
  81. package/build/assets/use-settings-0qFqC-r6.js +1 -0
  82. package/build/assets/{use-settings-nav-items-oZ-BlOWX.js → use-settings-nav-items-C6YxUn4h.js} +1 -1
  83. package/build/assets/{use-task-list-DydbuRFM.js → use-task-list-JPudBRv3.js} +1 -1
  84. package/build/assets/{use-tracking-DQU60djN.js → use-tracking-CjLZgh8X.js} +1 -1
  85. package/build/assets/{use-unified-vscode-url-D2Buvmxj.js → use-unified-vscode-url-DSn2tT08.js} +1 -1
  86. package/build/assets/{use-user-conversation-DwOGM1lc.js → use-user-conversation-CQ5IwnZk.js} +1 -1
  87. package/build/assets/{vendor~browser-3J6WDaAB.js → vendor~browser-Dwwc84Zf.js} +1 -1
  88. package/build/assets/{vendor~browser-tab-DYZ-OmbT.js → vendor~browser-tab-Bhohe29F.js} +1 -1
  89. package/build/assets/{vendor~files-tab-Diy4WrQz.js → vendor~files-tab-B447_Zns.js} +1 -1
  90. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CWwn0K2j.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CQQAW8hY.js} +1 -1
  91. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-dZ3D8RVL.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DFsI4CLy.js} +1 -1
  92. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BighOCzm.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DcvlNgbn.js} +1 -1
  93. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D13hiNGV.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-ojk_J4bB.js} +1 -1
  94. package/build/assets/{vendor~launch-D65Vw0VZ.js → vendor~launch-BdXJCmwc.js} +1 -1
  95. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-BJPgfJoU.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js} +1 -1
  96. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-BkicN-14.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-zdl_Rltz.js} +2 -2
  97. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-Cwz6a1DC.js → vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-BaCzvZac.js} +1 -1
  98. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-C37jLHRk.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js} +1 -1
  99. package/build/assets/{vendor~root-layout~home~mcp~automations-list-JQ-neDIa.js → vendor~root-layout~home~mcp~automations-list-CtdIEhjQ.js} +1 -1
  100. package/build/assets/{vendor~root-layout~home~mcp~automations-list-BTTZ58Mb.js → vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js} +1 -1
  101. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-UYEKKX0Y.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js} +2 -2
  102. package/build/assets/{verification-settings-Rabe5TpK.js → verification-settings-Cm02KmeI.js} +1 -1
  103. package/build/assets/{vscode-tab-zLD5Z-PP.js → vscode-tab-AF70Yke0.js} +1 -1
  104. package/build/index.html +4 -4
  105. package/build/locales/ar/openhands.json +1 -1
  106. package/build/locales/ca/openhands.json +1 -1
  107. package/build/locales/de/openhands.json +1 -1
  108. package/build/locales/en/openhands.json +1 -1
  109. package/build/locales/es/openhands.json +1 -1
  110. package/build/locales/fr/openhands.json +1 -1
  111. package/build/locales/it/openhands.json +1 -1
  112. package/build/locales/ja/openhands.json +1 -1
  113. package/build/locales/ko-KR/openhands.json +1 -1
  114. package/build/locales/no/openhands.json +1 -1
  115. package/build/locales/pt/openhands.json +1 -1
  116. package/build/locales/tr/openhands.json +1 -1
  117. package/build/locales/uk/openhands.json +1 -1
  118. package/build/locales/zh-CN/openhands.json +1 -1
  119. package/build/locales/zh-TW/openhands.json +1 -1
  120. package/config/defaults.json +1 -1
  121. package/dist/api/agent-server-adapter.cjs +3 -3
  122. package/dist/api/agent-server-adapter.cjs.map +1 -1
  123. package/dist/api/agent-server-adapter.js +90 -85
  124. package/dist/api/agent-server-adapter.js.map +1 -1
  125. package/dist/api/app-preferences-store.cjs.map +1 -1
  126. package/dist/api/app-preferences-store.d.ts +6 -2
  127. package/dist/api/app-preferences-store.js.map +1 -1
  128. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
  129. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  130. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +9 -9
  131. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  132. package/dist/components/conversation-events/chat/event-message.cjs +1 -1
  133. package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
  134. package/dist/components/conversation-events/chat/event-message.js +80 -71
  135. package/dist/components/conversation-events/chat/event-message.js.map +1 -1
  136. package/dist/components/features/automations/recommended-automations-launcher.d.ts +7 -1
  137. package/dist/components/features/home/workspace-selection-form.d.ts +1 -0
  138. package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +8 -0
  139. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  140. package/dist/components/features/sidebar/sidebar.js +6 -6
  141. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  142. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  143. package/dist/components/features/skills/extensions-navigation.d.ts +1 -1
  144. package/dist/components/features/skills/extensions-navigation.js +27 -29
  145. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  146. package/dist/i18n/translation.cjs +1 -1
  147. package/dist/i18n/translation.cjs.map +1 -1
  148. package/dist/i18n/translation.js +15 -15
  149. package/dist/i18n/translation.js.map +1 -1
  150. package/dist/locales/ar/openhands.json +1 -1
  151. package/dist/locales/ca/openhands.json +1 -1
  152. package/dist/locales/de/openhands.json +1 -1
  153. package/dist/locales/en/openhands.json +1 -1
  154. package/dist/locales/es/openhands.json +1 -1
  155. package/dist/locales/fr/openhands.json +1 -1
  156. package/dist/locales/it/openhands.json +1 -1
  157. package/dist/locales/ja/openhands.json +1 -1
  158. package/dist/locales/ko-KR/openhands.json +1 -1
  159. package/dist/locales/no/openhands.json +1 -1
  160. package/dist/locales/pt/openhands.json +1 -1
  161. package/dist/locales/tr/openhands.json +1 -1
  162. package/dist/locales/uk/openhands.json +1 -1
  163. package/dist/locales/zh-CN/openhands.json +1 -1
  164. package/dist/locales/zh-TW/openhands.json +1 -1
  165. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs +1 -1
  166. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
  167. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js +10 -1
  168. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js.map +1 -1
  169. package/dist/package.cjs +1 -1
  170. package/dist/package.cjs.map +1 -1
  171. package/dist/package.js +2 -2
  172. package/dist/package.js.map +1 -1
  173. package/dist/routes/llm-settings.cjs +1 -1
  174. package/dist/routes/llm-settings.cjs.map +1 -1
  175. package/dist/routes/llm-settings.js +21 -21
  176. package/dist/routes/llm-settings.js.map +1 -1
  177. package/dist/types/agent-server/core/events/index.d.ts +1 -0
  178. package/dist/types/agent-server/core/events/streaming-delta-event.d.ts +7 -0
  179. package/dist/types/agent-server/core/openhands-event.d.ts +2 -2
  180. package/dist/types/agent-server/type-guards.cjs +1 -1
  181. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  182. package/dist/types/agent-server/type-guards.d.ts +2 -0
  183. package/dist/types/agent-server/type-guards.js +3 -3
  184. package/dist/types/agent-server/type-guards.js.map +1 -1
  185. package/dist/utils/handle-event-for-ui.cjs +1 -1
  186. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  187. package/dist/utils/handle-event-for-ui.js +69 -13
  188. package/dist/utils/handle-event-for-ui.js.map +1 -1
  189. package/dist/utils/mcp-config.cjs +1 -1
  190. package/dist/utils/mcp-config.cjs.map +1 -1
  191. package/dist/utils/mcp-config.js +27 -19
  192. package/dist/utils/mcp-config.js.map +1 -1
  193. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  194. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  195. package/dist/utils/mcp-marketplace-utils.js +38 -18
  196. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  197. package/dist/utils/normalize-display-model.cjs +1 -1
  198. package/dist/utils/normalize-display-model.cjs.map +1 -1
  199. package/dist/utils/normalize-display-model.js +8 -7
  200. package/dist/utils/normalize-display-model.js.map +1 -1
  201. package/dist/utils/openhands-llm.cjs +1 -1
  202. package/dist/utils/openhands-llm.cjs.map +1 -1
  203. package/dist/utils/openhands-llm.d.ts +13 -0
  204. package/dist/utils/openhands-llm.js +9 -3
  205. package/dist/utils/openhands-llm.js.map +1 -1
  206. package/package.json +2 -2
  207. package/scripts/check-sdk-version-sync.mjs +6 -6
  208. package/scripts/dev-safe.mjs +53 -118
  209. package/scripts/dev-with-automation.mjs +58 -4
  210. package/scripts/runtime-services-info.mjs +199 -0
  211. package/scripts/static-server.mjs +42 -4
  212. package/build/assets/acp-providers-DZEi8wDz.js +0 -1
  213. package/build/assets/agent-server-conversation-service.api-B82pNNTm.js +0 -5
  214. package/build/assets/browser-DTei6kki.js +0 -5
  215. package/build/assets/chat-send-button-06dIuWXm.js +0 -1
  216. package/build/assets/conversation-CBlJiDaV.js +0 -19
  217. package/build/assets/conversation-Dss8XCN_.js +0 -1
  218. package/build/assets/conversation-panel-B5sVpsz5.js +0 -1
  219. package/build/assets/conversation-service.api-B4s-xIOK.js +0 -1
  220. package/build/assets/conversation-store-kHcewy1E.js +0 -1
  221. package/build/assets/conversation-websocket-context-C2yKCqvj.js +0 -3
  222. package/build/assets/extensions-navigation-oOk5yl8X.js +0 -1
  223. package/build/assets/home-ChuA06Hv.js +0 -1
  224. package/build/assets/install-server-modal--lZ1HSHB.js +0 -1
  225. package/build/assets/llm-settings-D477P0Lg.js +0 -1
  226. package/build/assets/llm-settings-DtlQ7i4C.js +0 -1
  227. package/build/assets/manifest-17af0b17.js +0 -1
  228. package/build/assets/messages-luW9zf1w.js +0 -36
  229. package/build/assets/middleware-B5rcobhi.js +0 -6
  230. package/build/assets/model-selector-DzQRgNGZ.js +0 -1
  231. package/build/assets/root-layout-pQASEqtQ.js +0 -2
  232. package/build/assets/sidebar-store-B76R2gP8.js +0 -1
  233. package/build/assets/telemetry-DCrd7gnV.js +0 -2
  234. package/build/assets/use-event-store-Rw1YbvLm.js +0 -1
  235. package/build/assets/use-handle-plan-click-DYd5a6zN.js +0 -1
  236. package/build/assets/use-runtime-is-ready-DP-KKHO6.js +0 -1
  237. package/build/assets/use-settings-Clf0Y_P3.js +0 -1
  238. /package/build/assets/{automation-LZB0MjdV.js → automation-BzmydDjr.js} +0 -0
  239. /package/build/assets/{browser-store-BjhV_9wS.js → browser-store-C5uQbbIi.js} +0 -0
  240. /package/build/assets/{checkmark-BB7QCG5T.js → checkmark-SEZPnU2I.js} +0 -0
  241. /package/build/assets/{chevron-left-small-CuuwpRi9.js → chevron-left-small-x9_-ucHG.js} +0 -0
  242. /package/build/assets/{close-Cz0OAgTy.js → close-CbOsKMRg.js} +0 -0
  243. /package/build/assets/{code-tag-Cz9AIz-X.js → code-tag-C0vR_IQH.js} +0 -0
  244. /package/build/assets/{command-store-DAd3K0d_.js → command-store-BUWgE-vZ.js} +0 -0
  245. /package/build/assets/{confirmation-modal-C_lds1Tb.js → confirmation-modal-BPgWqWRI.js} +0 -0
  246. /package/build/assets/{context-menu-list-item-DhG1Ln5m.js → context-menu-list-item-CHWCx1Mc.js} +0 -0
  247. /package/build/assets/{conversation-state-store-BUU90dVq.js → conversation-state-store-DpgQaK_O.js} +0 -0
  248. /package/build/assets/{conversation-tab-empty-state-5bW9CQke.js → conversation-tab-empty-state-Ba5hbJhn.js} +0 -0
  249. /package/build/assets/{copy-CA1Dblua.js → copy-CAxUvM-U.js} +0 -0
  250. /package/build/assets/{dist-CBUfAk0Z.js → dist-CeJSjcAI.js} +0 -0
  251. /package/build/assets/{ellipsis-button-DRRmCrWi.js → ellipsis-button-CiLx8dqc.js} +0 -0
  252. /package/build/assets/{environment-switch-overlay-BrHKX6_Z.js → environment-switch-overlay-Cow6h62p.js} +0 -0
  253. /package/build/assets/{file-DM0ihEsO.js → file-BJCSojij.js} +0 -0
  254. /package/build/assets/{files-tab-store-QlUCuW8b.js → files-tab-store-CZAEwv3x.js} +0 -0
  255. /package/build/assets/{folder-UGYUKpqb.js → folder-wShAU0y7.js} +0 -0
  256. /package/build/assets/{git-status-mapper-N4-7eaeC.js → git-status-mapper-C3rfzUex.js} +0 -0
  257. /package/build/assets/{globe-2otpEmVh.js → globe-CQ_5xwpo.js} +0 -0
  258. /package/build/assets/{handle-capture-consent-OitMkDHc.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
  259. /package/build/assets/{iconBase-B_5IRYeZ.js → iconBase-1A_WRQ4E.js} +0 -0
  260. /package/build/assets/{lesson-plan-5O2tVbD1.js → lesson-plan-B607buca.js} +0 -0
  261. /package/build/assets/{link-external-kU6aFXU6.js → link-external-DCsHkAj4.js} +0 -0
  262. /package/build/assets/{map-provider-BHow6ugd.js → map-provider-XSFHmdDs.js} +0 -0
  263. /package/build/assets/{modal-close-button-BCvw9IUN.js → modal-close-button-DY-rVmld.js} +0 -0
  264. /package/build/assets/{plan-components-BRiIX8Wn.js → plan-components-DsiDjcDi.js} +0 -0
  265. /package/build/assets/{sdk-settings-field-metadata-CtO73dY6.js → sdk-settings-field-metadata-CETNItbo.js} +0 -0
  266. /package/build/assets/{search-Cbh-hHBu.js → search-BqXT2Ied.js} +0 -0
  267. /package/build/assets/{secrets-service-DEIB-Cfk.js → secrets-service-rJqZtDmI.js} +0 -0
  268. /package/build/assets/{settings-KgLvVrSm.js → settings-BgL2HUsU.js} +0 -0
  269. /package/build/assets/{settings-gear-xGs_SPgZ.js → settings-gear-DFmoMp-6.js} +0 -0
  270. /package/build/assets/{settings-input-CPr7vX81.js → settings-input-DsoZj8Dm.js} +0 -0
  271. /package/build/assets/{settings-like-page-layout-classes-GknosJgv.js → settings-like-page-layout-classes-DENKlZpD.js} +0 -0
  272. /package/build/assets/{settings-list-classes-CYDn4jUg.js → settings-list-classes-D8VAVZmi.js} +0 -0
  273. /package/build/assets/{settings-section-header-context-aD2iq1gD.js → settings-section-header-context-D61smD-W.js} +0 -0
  274. /package/build/assets/{skills-CCaEu1KQ.js → skills-BDOWVle-.js} +0 -0
  275. /package/build/assets/{switch-skeleton-C87Tx3Tc.js → switch-skeleton-QpdcdxRP.js} +0 -0
  276. /package/build/assets/{terminal-DQJ6IJUd.js → terminal-BUww3Ssl.js} +0 -0
  277. /package/build/assets/{toggle-switch-C-7juZ1u.js → toggle-switch-DDr-DnEc.js} +0 -0
  278. /package/build/assets/{typography-U1gkzkXo.js → typography-Cx7uw7z3.js} +0 -0
  279. /package/build/assets/{u-check-circle-lbkXL2z4.js → u-check-circle-CftRwky1.js} +0 -0
  280. /package/build/assets/{u-check-circle-half-CirnoxXG.js → u-check-circle-half-sGVk0BtL.js} +0 -0
  281. /package/build/assets/{u-circuit-Danff2ks.js → u-circuit-Cg9tH5qb.js} +0 -0
  282. /package/build/assets/{u-edit-CH5nNya1.js → u-edit-foF02hwH.js} +0 -0
  283. /package/build/assets/{use-breakpoint-2sN462wJ.js → use-breakpoint-Dt2knceC.js} +0 -0
  284. /package/build/assets/{use-click-outside-element-_vianyPb.js → use-click-outside-element-Bu2A3s59.js} +0 -0
  285. /package/build/assets/{use-is-authed-DrocXcet.js → use-is-authed-fNsj-Adj.js} +0 -0
  286. /package/build/assets/{use-llm-profiles-BhZRf-NX.js → use-llm-profiles-CyNVoVqm.js} +0 -0
  287. /package/build/assets/{use-skills-v8pQ02ze.js → use-skills-BWHATXK-.js} +0 -0
  288. /package/build/assets/{v4-BMWDcIWQ.js → v4-BygpdDmc.js} +0 -0
  289. /package/build/assets/{vendor~browser-C3GKF4mj.js → vendor~browser-BYEwwJqV.js} +0 -0
  290. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DMcFTqbt.js → vendor~conversation-panel~conversation~alert-banner-BnHToS5O.js} +0 -0
  291. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Cntsv2EN.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B4oeCCli.js} +0 -0
  292. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DTosGXG7.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D8cqyq4k.js} +0 -0
  293. /package/build/assets/{vendor~terminal-CnKZILnC.js → vendor~terminal-aeP3PnKf.js} +0 -0
  294. /package/build/assets/{vscode-url-helper-CwQPl6QN.js → vscode-url-helper-DOCkV_-G.js} +0 -0
  295. /package/build/assets/{waiting-for-runtime-message-B1Dzhtj5.js → waiting-for-runtime-message-Bg27u9JB.js} +0 -0
  296. /package/build/assets/{x-mark-CmcVOTk2.js → x-mark-Cn-YJVbN.js} +0 -0
@@ -0,0 +1,36 @@
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{d as n,u as r}from"./path-utils-0KWEiRs9.js";import{t as i}from"./useMutation-7hG0GuPx.js";import{o as a,t as o}from"./declaration-IA661TBv.js";import{t as s}from"./Trans-rF21Jwln.js";import{t as c}from"./useTranslation-CbJtty1g.js";import{a as l}from"./i18n-CyvU1o95.js";import{t as u}from"./createLucideIcon-C9OEnwvX.js";import{t as d}from"./chevron-down-DUxWwzTm.js";import{A as f,S as p,t as m}from"./utils-CVcuFUYj.js";import{n as h}from"./common-Cfviy7yT.js";import{t as g}from"./use-config-DSzkljTq.js";import{f as _,m as v,p as y}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DspdqGPW.js";import{t as ee}from"./styled-tooltip-GXy1qxsO.js";import{t as te}from"./react-CuAHzoGi.js";import{t as b}from"./conversation-store-CiYGBud3.js";import{s as x}from"./conversation-local-storage-D5Tre_GA.js";import{n as ne}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js";import{t as re}from"./skills-BDOWVle-.js";import{t as S}from"./close-CbOsKMRg.js";import{r as C}from"./typography-Cx7uw7z3.js";import{t as w}from"./u-check-circle-CftRwky1.js";import{n as T,r as E,t as ie}from"./use-active-conversation-DJGoI9Mc.js";import{t as D}from"./use-agent-state-BXgWhFh6.js";import{d as ae,l as oe,n as se,u as ce}from"./conversation-websocket-context-Bb4XBXoc.js";import{a as le,g as ue,i as O,r as k,t as de,v as A,w as fe,x as pe,y as j}from"./use-event-store-DSpvASbC.js";import{t as me}from"./lesson-plan-B607buca.js";import{n as he,t as M}from"./markdown-renderer-oOUs3tw5.js";import{n as ge,r as _e,t as ve}from"./plan-components-DsiDjcDi.js";import{n as ye,t as be}from"./u-check-circle-half-sGVk0BtL.js";var xe=u(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),N=e(t(),1);function Se(){!y.current&&_();let[e]=(0,N.useState)(v.current);return e}var P=a(),F=function(e){return e.INIT=`initialize`,e.MESSAGE=`message`,e.SYSTEM=`system`,e.READ=`read`,e.WRITE=`write`,e.RUN=`run`,e.RUN_IPYTHON=`run_ipython`,e.BROWSE=`browse`,e.BROWSE_INTERACTIVE=`browse_interactive`,e.DELEGATE=`delegate`,e.THINK=`think`,e.FINISH=`finish`,e.REJECT=`reject`,e.CHANGE_AGENT_STATE=`change_agent_state`,e.MCP=`call_tool_mcp`,e.TASK_TRACKING=`task_tracking`,e}(F||{});function Ce(){let{conversationId:e}=E(),t=se();return{send:(0,N.useCallback)(async e=>{if(t){let{action:n,args:r}=e;if(n===`message`&&r?.content){let e=[{type:`text`,text:r.content}];return r.image_urls&&r.image_urls.length>0&&e.push({type:`image`,image_urls:r.image_urls}),await t.sendMessage({role:`user`,content:e})}return{queued:!1}}return{queued:!1}},[t,e])}}function we(e,t,n,r){return{action:F.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),L=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function Te({status:e}){return(0,P.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,P.jsx)(ne,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let[s,c]=N.useState(r),l=t?(0,P.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,P.jsx)(L,{className:m(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,P.jsx)(I,{className:m(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,P.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&l,o,(0,P.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,P.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,P.jsx)(Te,{status:n})]})]}),s&&(typeof t==`string`?(0,P.jsx)(M,{children:t}):t)]})}var Ee=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,P.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,P.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsx)(`defs`,{children:(0,P.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,P.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function De({profile:e}){let[t,r]=N.useState(!1);return(0,P.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,P.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,P.jsx)(d,{size:14}):(0,P.jsx)(n,{size:14})}),(0,P.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`border-neutral-700`}),(0,P.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function Oe({conversationId:e,anchorEventId:t}){let n=ce(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,P.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,P.jsx)(R,{title:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Ee,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,P.jsx)(s,{i18nKey:o.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,P.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,P.jsx)(R,{title:(0,P.jsx)(`span`,{children:t?(0,P.jsx)(s,{i18nKey:o.MODEL$NO_SAVED_PROFILES}):(0,P.jsx)(s,{i18nKey:o.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,P.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,P.jsx)(s,{i18nKey:o.MODEL$NO_PROFILES_HINT})}):(0,P.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,P.jsx)(De,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var z=(0,N.createContext)(void 0);function ke({children:e,value:t}){let n=_e(N.useRef(null)),r=t||n;return(0,P.jsx)(z.Provider,{value:r,children:e})}function Ae(){let e=(0,N.useContext)(z);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function je(){return(0,N.useContext)(z)}var Me=()=>{let{setConversationMode:e}=b(),{send:t}=Ce(),{conversationId:n}=E(),r=ae(e=>e.enqueuePendingMessage),i=ae(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,N.useCallback)(a=>{a?.preventDefault(),a?.stopPropagation(),e(`code`);let o=`Execute the plan based on the .agents_tmp/PLAN.md file.`,s=new Date().toISOString(),c=n?r({conversationId:n,text:o,timestamp:s}):null;t(we(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},Ne=`200%`,B=8,Pe=B*2;function Fe({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Se(),c=`oh-text-shimmer-${(0,N.useId)().replace(/:/g,``)}`,l=(0,N.useMemo)(()=>Math.min(B/2-1,1+i/2),[i]),u=(0,N.useMemo)(()=>{let e=B/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${B}%)`,backgroundSize:`${Ne} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,P.jsx)(t,{className:m(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${Pe}% center}to{background-position:0% center}}`}}),(0,P.jsx)(t,{className:m(`relative inline-block`,n),style:u,...o,children:e})]})}var Ie=N.memo(Fe),Le=3,Re=24;function ze({className:e}){return(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,P.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,P.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var Be={p:({children:e})=>(0,P.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function Ve({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=c(`openhands`),a=N.useRef(null),[s,l]=N.useState(!1);N.useLayoutEffect(()=>{let t=a.current;if(!t||n){l(!1),r(!1);return}let i=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),i=Le*(Number.isFinite(n)&&n>0?n:Re),a=(e.match(/\n/g)??[]).length,o=t.scrollHeight>i+1||a>=Le||e.trim().length>220;l(e=>(e!==o&&r(o),o))};i();let o=new ResizeObserver(i);return o.observe(t),()=>o.disconnect()},[e,n,r]);let u=s&&!n;return(0,P.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,P.jsx)(`div`,{ref:a,className:m(`text-sm leading-6 whitespace-normal [word-break:break-word]`,u&&`line-clamp-3`),children:(0,P.jsx)(M,{includeStandard:!0,includeHeadings:!0,components:Be,children:e})}),u?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,P.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:m(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(o.COMMON$VIEW_MORE)})]}):null]})}function V({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:s,onStop:l}){let{t:u}=c(`openhands`),[d,f]=N.useState(!1),[p,h]=N.useState(!1),[g,_]=N.useState(!1),[v,y]=N.useState(!1),[te,b]=N.useState(!0),x=N.useRef(null);N.useEffect(()=>{_(!1)},[t]);let ne=async()=>{await navigator.clipboard.writeText(t),h(!0)};N.useEffect(()=>{let e;return p&&(e=setTimeout(()=>{h(!1)},2e3)),()=>{clearTimeout(e)}},[p]);let re=e===`user`&&(a===`error`||a===`sending`),S=a===`sending`&&l!=null,C=S&&d,w=e===`user`&&a==null,T=w&&v&&!g,E=N.Children.count(n)>0;N.useLayoutEffect(()=>{if(!S||w)return;let e=x.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:Re;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,S,w]);let ie=w?(0,P.jsx)(Ve,{message:t,isHovering:d,isExpanded:g,onTruncatableChange:y}):(0,P.jsx)(`div`,{ref:x,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,P.jsx)(M,{includeStandard:!0,includeHeadings:!0,components:Be,children:t})}),D=(0,P.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:m(`rounded-xl relative w-fit max-w-full flex flex-col`,E&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!re&&`last:mb-4`),children:[(0,P.jsxs)(`div`,{className:m(`absolute -top-2.5 -right-2.5 z-10`,!d||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,P.jsx)(ee,{content:e.tooltip,placement:`top`,children:(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,P.jsx)(he,{isHidden:!d,isDisabled:p,onClick:ne,mode:p?`copied`:`copy`})]}),ie,S?(0,P.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":u(o.BUTTON$STOP),"aria-hidden":!C,tabIndex:C?0:-1,className:m(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,te?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,C?`opacity-100`:`pointer-events-none opacity-0`),children:(0,P.jsx)(ze,{className:`block h-7 w-7 max-w-none`})}):null,T?(0,P.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":u(o.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>_(!0)}):null,n]});return e===`user`&&a===`error`?(0,P.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[D,(0,P.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,P.jsx)(`span`,{children:u(o.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),s?(0,P.jsx)(`button`,{type:`button`,onClick:s,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":`chat-message-retry`,children:u(o.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,P.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[D,(0,P.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,P.jsx)(Ie,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:u(o.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function He(){let{conversationId:e}=T(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=b(),{setSelectedTab:a}=x(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var H=300,Ue=ve(`shine-text`);function We({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=c(`openhands`),{navigateToTab:i}=He(),{handleBuildPlanClick:a}=Me(),{scrollDomToBottom:s}=Ae(),l=()=>{i(`planner`)},u=(0,N.useCallback)(e=>{a(e),s()},[a,s]),d=(0,N.useMemo)(()=>e?e.length<=H?e:`${e.slice(0,H)}...`:``,[e]);return e?(0,P.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,P.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,P.jsx)(me,{width:18,height:18,color:`var(--oh-muted)`}),(0,P.jsx)(C.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(o.COMMON$PLAN_MD)}),(0,P.jsx)(`div`,{className:`flex-1`}),(0,P.jsxs)(`button`,{type:`button`,onClick:l,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,P.jsx)(C.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(o.COMMON$VIEW)}),(0,P.jsx)(xe,{className:`text-white`,size:18})]})]}),(0,P.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:d&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(M,{includeStandard:!0,components:t?Ue:ge,children:d}),e&&e.length>H&&(0,P.jsx)(`button`,{type:`button`,onClick:l,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(o.COMMON$READ_MORE)})]})}),(0,P.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,P.jsx)(`button`,{type:`button`,onClick:u,disabled:n,className:m(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,P.jsxs)(C.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(o.COMMON$BUILD),` `,(0,P.jsx)(C.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function Ge({errorId:e,defaultMessage:t}){let{t:n}=c(`openhands`),[r,i]=N.useState(!1);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&l.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,P.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,P.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,P.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,P.jsx)(M,{children:t})]})}function Ke({event:e}){return le(e)?(0,P.jsx)(Ge,{errorId:e.id,defaultMessage:e.error}):null}function qe({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Je({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Ye({onClick:e,className:t}){return(0,P.jsx)(`button`,{type:`button`,onClick:e,className:m(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,P.jsx)(S,{width:18,height:18})})}function Xe({src:e,size:t=`small`}){return(0,P.jsx)(`img`,{role:`img`,alt:``,src:e,className:m(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ze({src:e,onRemove:t,size:n=`small`}){return(0,P.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,P.jsx)(Xe,{src:e,size:n}),t&&(0,P.jsx)(Ye,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function Qe({size:e=`small`,images:t,onRemove:n}){let r=N.useRef(null),[i,a]=N.useState(!1),[o,s]=N.useState(!0),[c,l]=N.useState(!1);return N.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,P.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,P.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(qe,{active:!o})}),(0,P.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:m(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,P.jsx)(Ze,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,P.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(Je,{active:!c})})]})}function $e({type:e,onClick:t}){let{t:n}=c(`openhands`),r=e===`confirm`,i=n(r?o.ACTION$CONFIRM:o.ACTION$REJECT),a=n(r?o.CHAT_INTERFACE$USER_CONFIRMED:o.CHAT_INTERFACE$USER_REJECTED),s=r?`${n(o.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(o.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,P.jsx)(ee,{closeDelay:100,content:a,children:(0,P.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:m(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:s})})}function et({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,P.jsxs)(`div`,{className:m(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,P.jsx)(`span`,{className:``,children:n}),(0,P.jsx)(`span`,{className:`font-bold`,children:i}),(0,P.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var tt=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,P.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,P.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,P.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),nt=te(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),rt=()=>i({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return oe.respondToConfirmation(e,t,i,n)}});function it(){let e=nt(e=>e.submittedEventIds),t=nt(e=>e.addSubmittedEventId),{t:n}=c(`openhands`),{data:r}=ie(),{curAgentState:i}=D(),{mutate:a}=rt(),s=de(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===p.AWAITING_USER_CONFIRMATION:!1),l=(0,N.useCallback)(e=>{!s||!r||(t(s.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[s,r,t,a]);return(0,N.useEffect)(()=>{if(!s)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),l(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),l(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[s,l]),i!==p.AWAITING_USER_CONFIRMATION||!s||e.includes(s.id)?null:(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(O(s)?s.security_risk:h.UNKNOWN)===h.HIGH&&(0,P.jsx)(et,{content:n(o.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,P.jsx)(tt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(o.COMMON$HIGH_RISK)}),(0,P.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,P.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(o.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)($e,{type:`reject`,onClick:()=>l(!1)}),(0,P.jsx)($e,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var at=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
2
+ `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=l.t(`CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE`);return n.split(r)[0]};function U({event:e,isLastMessage:t,isFromPlanningAgent:n}){let r=at(e),i=[];return Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&i.push(...e.image_urls)}),(0,P.jsxs)(V,{type:e.source,message:r,isFromPlanningAgent:n,children:[i.length>0&&(0,P.jsx)(Qe,{size:`small`,images:i}),t&&(0,P.jsx)(it,{})]})}var ot=class{static isDevMode=!1;static message(e){this.isDevMode&&console.warn(JSON.stringify(JSON.parse(e.data.toString()),null,2))}static event(e,t){this.isDevMode&&console.warn(t||`EVENT`,e)}static warning(e){this.isDevMode&&console.warn(e)}static error(e){this.isDevMode&&console.error(e)}},st=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function ct(e){let{children:t}=e,n=e=>{try{return st(e)}catch(t){return ot.error(String(t)),e}};return Array.isArray(t)?(0,P.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,P.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,P.jsx)(`strong`,{className:`font-mono`,children:t})}var lt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},ut=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,dt=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return ut(e)&&!n.endsWith(`/`)?`${n}/`:n};function ft(e){let{children:t}=e,n=e=>{try{let t=lt(e);return(0,P.jsx)(`span`,{className:`font-mono`,title:t,children:dt(t)})}catch(t){return ot.error(String(t)),(0,P.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,P.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,P.jsx)(`strong`,{children:n(t)}):(0,P.jsx)(`strong`,{className:`font-mono`,children:t})}var W=1e3,pt=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,mt=e=>{switch(e){case h.LOW:return l.t(`SECURITY$LOW_RISK`);case h.MEDIUM:return l.t(`SECURITY$MEDIUM_RISK`);case h.HIGH:return l.t(`SECURITY$HIGH_RISK`);case h.UNKNOWN:default:return l.t(`SECURITY$UNKNOWN_RISK`)}},G=()=>``,ht=e=>e.name?`**Skill:** \`${e.name}\``:G(),gt=e=>{let{action:t}=e,n=[];return t.pattern&&n.push(`**Pattern:** \`${t.pattern}\``),t.path&&n.push(`**Path:** \`${t.path}\``),`include`in t&&t.include&&n.push(`**Include:** \`${t.include}\``),n.length>0?n.join(`
3
+ `):G()},_t=e=>{if(e.command!==`create`||!e.file_text)return G();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,W)}...`),`${e.path}\n${t}`},vt=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===h.HIGH||e.security_risk===h.MEDIUM)&&(t+=`\n\n${mt(e.security_risk)}`),t},yt=e=>{let t=`**MCP Tool Call**
4
+
5
+ `;return t+=`**Arguments:**\n\`\`\`json\n${JSON.stringify(e.data,null,2)}\n\`\`\``,t},bt=e=>e.thought,xt=e=>e.message.trim(),St=e=>{let t=`**Command:** \`${e.command}\``;return e.command===`plan`&&(e.task_list&&e.task_list.length>0?(t+=`\n\n**Task List (${e.task_list.length} ${e.task_list.length===1?`item`:`items`}):**\n`,e.task_list.forEach((e,n)=>{let r={todo:`⏳`,in_progress:`🔄`,done:`✅`}[e.status]||`❓`;t+=`\n${n+1}. ${r} **[${e.status.toUpperCase().replace(`_`,` `)}]** ${e.title}`,e.notes&&(t+=`\n *Notes: ${e.notes}*`)})):t+=`
6
+
7
+ **Task List:** Empty`),t},Ct=e=>{switch(e.kind){case`BrowserNavigateAction`:{let t=`Browsing ${e.url}`;return e.new_tab&&(t+=`
8
+ **New Tab:** Yes`),t}case`BrowserClickAction`:{let t=`**Element Index:** ${e.index}`;return e.new_tab&&(t+=`
9
+ **New Tab:** Yes`),t}case`BrowserTypeAction`:{let t=e.text.length>50?`${e.text.slice(0,50)}...`:e.text;return`**Element Index:** ${e.index}\n**Text:** ${t}`}case`BrowserGetStateAction`:return e.include_screenshot?`**Include Screenshot:** Yes`:G();case`BrowserGetContentAction`:{let t=[];return e.extract_links&&t.push(`**Extract Links:** Yes`),e.start_from_char>0&&t.push(`**Start From Character:** ${e.start_from_char}`),t.length>0?t.join(`
10
+ `):G()}case`BrowserScrollAction`:return`**Direction:** ${e.direction}`;case`BrowserGoBackAction`:return G();case`BrowserListTabsAction`:return G();case`BrowserSwitchTabAction`:return`**Tab ID:** ${e.tab_id}`;case`BrowserCloseTabAction`:return`**Tab ID:** ${e.tab_id}`;default:return G()}},wt=e=>{let{action:t}=e;switch(t.kind){case`FileEditorAction`:case`StrReplaceEditorAction`:return _t(t);case`ExecuteBashAction`:case`TerminalAction`:return vt(e);case`MCPToolAction`:return yt(t);case`ThinkAction`:return bt(t);case`FinishAction`:return xt(t);case`TaskTrackerAction`:return St(t);case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return Ct(t);case`GrepAction`:case`GlobAction`:return gt(e);case`InvokeSkillAction`:return ht(t);default:return pt(e)}},Tt=e=>{if(e.is_error||e.status===`failed`)return`error`;if(e.status===`completed`)return`success`},Et=e=>{let{observation:t}=e;switch(t.kind){case`ExecuteBashObservation`:{let e=t.exit_code,{metadata:n}=t;return e===-1||n.exit_code===-1?`timeout`:e===0||n.exit_code===0?`success`:`error`}case`TerminalObservation`:{let e=t.exit_code??t.metadata.exit_code??null;return t.timeout||e===-1?`timeout`:e===0?`success`:t.is_error?`error`:`success`}case`FileEditorObservation`:case`StrReplaceEditorObservation`:return t.error?`error`:`success`;case`MCPToolObservation`:return t.is_error?`error`:`success`;case`SwitchLLMObservation`:return t.is_error?`error`:`success`;default:return`success`}},Dt=e=>{let{observation:t}=e;if(t.error)return`**Error:**\n${t.error}`;let n=`content`in t&&Array.isArray(t.content)?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
11
+ `):null;return Et(e)===`success`&&`old_content`in t&&`new_content`in t&&t.old_content&&t.new_content||t.command===`view`?`\`\`\`\n${n||t.output}\n\`\`\``:n||t.output},Ot=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
12
+ `)||``;n.length>1e3&&(n=`${n.slice(0,W)}...`);let r=``;return t.command&&(r+=`Command: \`${t.command}\`\n\n`),r+=`Output:\n\`\`\`sh\n${n.trim()||l.t(`OBSERVATION$COMMAND_NO_OUTPUT`)}\n\`\`\``,r},kt=e=>{let{observation:t}=e,n=`content`in t&&Array.isArray(t.content)?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
13
+ `):t.output||``,r=``;return t.error?r+=`**Error:**\n${t.error}`:n?r+=`**Output:**\n${n}`:r+=`Browser action completed successfully.`,r.length>1e3&&(r=`${r.slice(0,W)}...(truncated)`),r},At=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
14
+ `),r=`**Tool:** ${t.tool_name}\n\n`;return t.is_error?r+=`**Error:**\n${n}`:r+=`**Result:**\n${n}`,r.length>1e3&&(r=`${r.slice(0,W)}...`),r},jt=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
15
+ `),r=`${t.skill_name?`**Skill:** \`${t.skill_name}\`\n\n`:``}${t.is_error?`**Error:**\n${n}`:n}`;return r.length>1e3&&(r=`${r.slice(0,W)}...(truncated)`),r},Mt=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
16
+ `);if(t.is_error)return n?`**Error:**\n${n}`:`**Error:**\nFailed to switch LLM profile \`${t.profile_name}\`.`;let r=[`**Profile:** \`${t.profile_name}\``];return t.active_model&&r.push(`**Active model:** \`${t.active_model}\``),t.reason&&r.push(`**Reason:** ${t.reason}`),r.join(`
17
+ `)},Nt=e=>{let{observation:t}=e,{command:n,task_list:r}=t,i=`**Command:** \`${n}\``;return n===`plan`&&r.length>0?(i+=`\n\n**Task List (${r.length} ${r.length===1?`item`:`items`}):**\n`,r.forEach((e,t)=>{let n={todo:`⏳`,in_progress:`🔄`,done:`✅`}[e.status]||`❓`;i+=`\n${t+1}. ${n} **[${e.status.toUpperCase().replace(`_`,` `)}]** ${e.title}`,e.notes&&(i+=`\n *Notes: ${e.notes}*`)})):n===`plan`&&(i+=`
18
+
19
+ **Task List:** Empty`),`content`in t&&t.content&&typeof t.content==`string`&&t.content.trim()&&(i+=`\n\n**Result:** ${t.content.trim()}`),i},Pt=e=>{let{observation:t}=e;return t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
20
+ `)||``},Ft=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
21
+ `),r=``;return t.is_error?r+=`**Error:**\n${n}`:r+=n,r},It=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
22
+ `),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n\n`,t.is_error?r+=`**Error:**\n${n}`:t.files.length===0?r+=`**Result:** No files found.`:(r+=`**Files Found (${t.files.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.files.map(e=>`- \`${e}\``).join(`
23
+ `)),r.length>1e3&&(r=`${r.slice(0,W)}...(truncated)`),r},Lt=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
24
+ `),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n`,t.include_pattern&&(r+=`**Include:** \`${t.include_pattern}\`\n`),r+=`
25
+ `,t.is_error?r+=`**Error:**\n${n}`:t.matches.length===0?r+=`**Result:** No matches found.`:(r+=`**Matches (${t.matches.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.matches.map(e=>`- \`${e}\``).join(`
26
+ `)),r.length>1e3&&(r=`${r.slice(0,W)}...(truncated)`),r},Rt=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return Dt(e);case`ExecuteBashObservation`:case`TerminalObservation`:return Ot(e);case`BrowserObservation`:return kt(e);case`MCPToolObservation`:return At(e);case`TaskTrackerObservation`:return Nt(e);case`ThinkObservation`:return Pt(e);case`FinishObservation`:return Ft(e);case`GlobObservation`:return It(e);case`GrepObservation`:return Lt(e);case`InvokeSkillObservation`:return jt(e);case`SwitchLLMObservation`:return Mt(e);default:return pt(e)}},zt=e=>{switch(e.tool_kind){case`execute`:return`ACTION_MESSAGE$ACP_RUN`;case`edit`:return`ACTION_MESSAGE$ACP_EDIT`;case`read`:return`ACTION_MESSAGE$ACP_READ`;case`fetch`:return`ACTION_MESSAGE$ACP_FETCH`;default:return`ACTION_MESSAGE$ACP_TOOL`}},Bt={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},Vt=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=Bt[n];if(!r)return t;for(let e of r)if(t.length>e.length&&t.startsWith(e)&&/\s/.test(t.charAt(e.length)))return t.slice(e.length).trimStart();return t},Ht=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Ut=e=>e.length>1e3?`${e.slice(0,W)}...`:e,Wt=e=>{let t=e.tool_kind,n=e.raw_input,r=e.raw_output,i=e.is_error,a=``;if(t===`execute`&&n&&typeof n==`object`&&`command`in n&&typeof n.command==`string`){let{command:e}=n;a+=`Command: \`${e}\`\n\n`}else if(n!=null&&n!==``){let e=Ht(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Ut(Ht(r).trim()),s=i?`**Error:**`:`Output:`,c=o||l.t(`OBSERVATION$COMMAND_NO_OUTPUT`);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a};function Gt({task:e}){let{t}=c(`openhands`),n=(0,N.useMemo)(()=>{switch(e.status){case`todo`:return(0,P.jsx)(ye,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,P.jsx)(be,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,P.jsx)(w,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,P.jsx)(ye,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,P.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,P.jsx)(`div`,{className:`shrink-0`,children:n}),(0,P.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,P.jsx)(C.Text,{className:m(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,P.jsxs)(C.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(o.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function Kt({taskList:e}){let{t}=c(`openhands`);return(0,P.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,P.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,P.jsx)(me,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,P.jsx)(C.Text,{className:`text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-[16px] whitespace-pre`,children:t(o.COMMON$TASKS)})]}),(0,P.jsx)(`div`,{children:e.map((e,t)=>(0,P.jsx)(Gt,{task:e},`task-${t}`))})]})}function qt({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,P.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,P.jsx)(Kt,{taskList:r})})}var Jt=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),Yt=e=>{let t=[],n=/<EXTRA_INFO>([\s\S]*?)<\/EXTRA_INFO>/gi,r=n.exec(e);for(;r!==null;){let i=r[1].trim();i.length>0&&t.push(i),r=n.exec(e)}return t},Xt=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Zt=(e,t)=>{let n=`
27
+
28
+ **Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=Xt(e,i)}),n},Qt=e=>{let t=`
29
+
30
+ **Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},$t=e=>!e||e.length===0?[]:Yt(Jt(e)),en=(e,t)=>{let n=$t(t);return e&&e.length>0?Zt(e,n):n.length>0?Qt(n):``},tn=(e,t)=>{let n=$t(t);return e&&e.length>0?e.map((e,t)=>({name:e,content:t<n.length?n[t].trim():``})):n.length>0?n.filter(e=>e.trim().length>0).map((e,t)=>({name:`Extended Content ${t+1}`,content:e.trim()})):[]},K=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,nn=e=>{let t=e.activated_skills||e.activated_microagents||[],n=e.extended_content||[];if(t.length===0&&n.length===0)throw Error(`Cannot create skill ready event without activated skills or extended content`);let r=en(t,n),i=tn(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},q=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,J=(e,t)=>l.exists(e)?(0,P.jsx)(s,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,P.jsx)(ft,{}),cmd:(0,P.jsx)(ct,{})}}):e,rn=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),an=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||rn(t)?null:t},on=e=>{if(!O(e))return``;let t=an(e);if(t)return t;let n=e.action.kind,r=``,i={};switch(n){case`ExecuteBashAction`:case`TerminalAction`:r=`ACTION_MESSAGE$RUN`,i={command:q(e.action.command,80)};break;case`FileEditorAction`:case`StrReplaceEditorAction`:r=e.action.command===`view`?`ACTION_MESSAGE$READ`:e.action.command===`create`?`ACTION_MESSAGE$WRITE`:`ACTION_MESSAGE$EDIT`,i={path:e.action.path};break;case`MCPToolAction`:r=`ACTION_MESSAGE$CALL_TOOL_MCP`,i={mcp_tool_name:e.tool_name};break;case`InvokeSkillAction`:r=`ACTION_MESSAGE$INVOKE_SKILL`,i={name:e.action.name};break;case`ThinkAction`:r=`ACTION_MESSAGE$THINK`;break;case`FinishAction`:r=`ACTION_MESSAGE$FINISH`;break;case`TaskTrackerAction`:r=`ACTION_MESSAGE$TASK_TRACKING`;break;case`GrepAction`:r=`ACTION_MESSAGE$GREP`,i={pattern:`pattern`in e.action&&e.action.pattern?q(String(e.action.pattern),50):``};break;case`GlobAction`:r=`ACTION_MESSAGE$GLOB`,i={pattern:`pattern`in e.action&&e.action.pattern?q(String(e.action.pattern),50):``};break;case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:r=`ACTION_MESSAGE$BROWSE`;break;default:return String(n).replace(`Action`,``).toUpperCase()}return r?J(r,i):n},sn=(e,t)=>{if(!A(e))return``;if(t){let e=an(t);if(e)return e}let n=e.observation.kind,r=``,i={};switch(n){case`ExecuteBashObservation`:case`TerminalObservation`:r=`OBSERVATION_MESSAGE$RUN`,i={command:e.observation.command?q(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:r=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:`OBSERVATION_MESSAGE$EDIT`,i={path:e.observation.path||``};break;case`MCPToolObservation`:r=`OBSERVATION_MESSAGE$MCP`,i={mcp_tool_name:e.observation.tool_name};break;case`InvokeSkillObservation`:r=`OBSERVATION_MESSAGE$INVOKE_SKILL`,i={name:e.observation.skill_name};break;case`SwitchLLMObservation`:r=e.observation.is_error?`MODEL$SWITCH_FAILED`:`MODEL$SWITCHED_TO_PROFILE`,i={name:e.observation.profile_name};break;case`BrowserObservation`:r=`OBSERVATION_MESSAGE$BROWSE`;break;case`TaskTrackerObservation`:{let{command:t}=e.observation;r=t===`plan`?`OBSERVATION_MESSAGE$TASK_TRACKING_PLAN`:`OBSERVATION_MESSAGE$TASK_TRACKING_VIEW`;break}case`ThinkObservation`:r=`OBSERVATION_MESSAGE$THINK`;break;case`GlobObservation`:r=`OBSERVATION_MESSAGE$GLOB`,i={pattern:e.observation.pattern?q(e.observation.pattern,50):``};break;case`GrepObservation`:r=`OBSERVATION_MESSAGE$GREP`,i={pattern:e.observation.pattern?q(e.observation.pattern,50):``};break;default:return n.replace(`Observation`,``).toUpperCase()}return r?J(r,i):n},Y=(e,t)=>{let n=``,r=``;if(K(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=l.exists(t)?J(t,{}):`Skill Ready`,r=e._skillReadyContent}else O(e)?(n=on(e),r=wt(e)):A(e)?(n=sn(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,P.jsx)(qt,{event:e}):Rt(e)):k(e)?(n=J(zt(e),{title:Vt(e)}),r=Wt(e)):e.source===`agent`&&`action`in e&&e.action!==null&&typeof e.action==`object`&&`kind`in e.action&&typeof e.action.kind==`string`&&(n=String(e.action.kind).replace(`Action`,``).toUpperCase());return{title:n||l.t(`EVENT$UNKNOWN_EVENT`),details:r}};function cn({event:e,isFromPlanningAgent:t=!1}){let n=Y(e);return(0,P.jsx)(V,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t})}function ln(e){let t=e.split(`
31
+ `),n=null,r=null,i=0;for(let e=0;e<t.length;e+=1){let a=t[e];if(a.startsWith(f[0]))n=a.trim(),i=e+1;else if(a.startsWith(f[2]))r=a.replace(f[2],``).trim(),i=e+1;else if(a.startsWith(f[1])||a.startsWith(f[3]))i=e+1;else if(a.trim()===``&&e<=i)i=e+1;else break}return{matchInfo:n,filePath:r,body:t.slice(i).join(`
32
+ `).trim()}}function un(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function dn({content:e}){let{t}=c(`openhands`),{matchInfo:n,filePath:r,body:i}=ln(e),a=n||r;return(0,P.jsxs)(`div`,{className:`pl-6 pr-2 pt-2 pb-2`,children:[a&&(0,P.jsxs)(`div`,{className:`mb-3 text-sm text-[var(--oh-muted)] space-y-1`,children:[n&&(0,P.jsx)(`p`,{children:n}),r&&(0,P.jsxs)(`p`,{children:[(0,P.jsxs)(C.Text,{className:`text-[var(--oh-text-subtle)]`,children:[t(o.COMMON$PATH),` `]}),(0,P.jsx)(`code`,{className:`bg-[var(--oh-surface)] px-1.5 py-0.5 rounded text-[var(--oh-text-tertiary)]`,children:r})]})]}),a&&i&&(0,P.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)] mb-3`}),i&&(0,P.jsx)(M,{children:un(i)})]})}function fn({items:e}){let{t}=c(`openhands`),[r,i]=N.useState({}),a=e=>{i(t=>({...t,[e]:!t[e]}))};return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1`,children:[(0,P.jsx)(C.Text,{className:`font-bold text-[var(--oh-foreground)] text-sm px-2 py-1`,children:t(o.SKILLS$TRIGGERED_SKILL_KNOWLEDGE)}),e.map(e=>{let t=r[e.name]||!1;return(0,P.jsxs)(`div`,{className:`border border-[var(--oh-border-subtle)] rounded-md overflow-hidden`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(e.name),className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-tertiary transition-colors cursor-pointer`,children:[(0,P.jsx)(C.Text,{className:`text-[var(--oh-text-tertiary)]`,children:t?(0,P.jsx)(d,{size:14}):(0,P.jsx)(n,{size:14})}),(0,P.jsx)(C.Text,{className:`font-normal text-[var(--oh-foreground)] text-sm`,children:e.name})]}),t&&e.content&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)]`}),(0,P.jsx)(dn,{content:e.content})]})]},e.name)})]})}function X({event:e,isLastMessage:t,correspondingAction:n}){let{title:r,details:i}=Y(e,n);if(!K(e)&&A(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,P.jsx)(`div`,{children:i});let a;K(e)?a=`success`:A(e)?a=Et(e):k(e)&&(a=Tt(e));let o=K(e);return(0,P.jsxs)(`div`,{children:[(0,P.jsx)(R,{title:r,details:o&&e._skillReadyItems.length>0?(0,P.jsx)(fn,{items:e._skillReadyItems}):i,success:a,initiallyExpanded:!1,titleIcon:o?(0,P.jsx)(re,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0}),t&&(0,P.jsx)(it,{})]})}function Z({event:e,actions:t,isFromPlanningAgent:n=!1}){let r=e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
33
+ `);return r?(0,P.jsx)(V,{type:`agent`,message:r,actions:t,isFromPlanningAgent:n}):null}var pn=e=>(0,P.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,P.jsx)(`path`,{d:`M11.3931 1.88021C10.78 1.37593 10.062 1.01489 9.29157 0.823438C8.52113 0.631981 7.71767 0.614934 6.9398 0.773542C5.90405 0.982756 4.95379 1.49492 4.20959 2.24506C3.46538 2.9952 2.96078 3.9495 2.7598 4.98688C2.61303 5.76469 2.6397 6.56531 2.83791 7.33163C3.03611 8.09795 3.40097 8.8111 3.90647 9.42021C4.37559 9.94959 4.64449 10.6266 4.66647 11.3335V13.3335C4.66647 13.864 4.87718 14.3727 5.25225 14.7478C5.62732 15.1228 6.13603 15.3335 6.66647 15.3335H9.33313C9.86356 15.3335 10.3723 15.1228 10.7473 14.7478C11.1224 14.3727 11.3331 13.864 11.3331 13.3335V11.4602C11.3555 10.6797 11.6423 9.92983 12.1465 9.33354C13.0299 8.24073 13.4463 6.84342 13.3052 5.44529C13.1642 4.04716 12.477 2.7612 11.3931 1.86687V1.88021ZM9.9998 13.3335C9.9998 13.5104 9.92956 13.6799 9.80454 13.8049C9.67951 13.93 9.50994 14.0002 9.33313 14.0002H6.66647C6.48965 14.0002 6.32009 13.93 6.19506 13.8049C6.07004 13.6799 5.9998 13.5104 5.9998 13.3335V12.6669H9.9998V13.3335ZM11.1131 8.50688C10.4428 9.30194 10.0517 10.2949 9.9998 11.3335H8.66647V9.33354C8.66647 9.15673 8.59623 8.98716 8.4712 8.86214C8.34618 8.73711 8.17661 8.66688 7.9998 8.66688C7.82299 8.66688 7.65342 8.73711 7.52839 8.86214C7.40337 8.98716 7.33313 9.15673 7.33313 9.33354V11.3335H5.9998C5.98221 10.3123 5.60443 9.33005 4.93313 8.56021C4.49023 8.02954 4.19239 7.39316 4.06867 6.71311C3.94495 6.03306 3.99957 5.33255 4.22719 4.6799C4.45481 4.02724 4.84768 3.4447 5.36748 2.98909C5.88728 2.53348 6.51627 2.22034 7.19313 2.08021C7.77483 1.96044 8.37591 1.9717 8.95271 2.11319C9.52952 2.25467 10.0676 2.52282 10.5278 2.89818C10.9881 3.27353 11.359 3.74666 11.6136 4.28322C11.8682 4.81978 12.0001 5.4063 11.9998 6.00021C12.0047 6.91345 11.6912 7.79985 11.1131 8.50688Z`,fill:`currentColor`})});function Q({content:e}){let{t}=c(`openhands`),[n,r]=N.useState(!1);if(!e.trim())return null;let i=n?L:I;return(0,P.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-label":t(n?o.THINKING$COLLAPSE:o.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,P.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,P.jsx)(pn,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,P.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(o.THINKING$TITLE)})]}),n&&(0,P.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,P.jsx)(M,{children:e})})]})}function mn(e,t){if(t)return`🚫`;switch(e){case`PreToolUse`:return`⏳`;case`PostToolUse`:return`✅`;case`UserPromptSubmit`:return`📝`;case`SessionStart`:return`🚀`;case`SessionEnd`:return`🏁`;case`Stop`:return`⏹️`;default:return`🔗`}}function hn(e){return e.length>80?`${e.slice(0,77)}...`:e}function gn(e,t){return e?`blocked`:t?`ok`:`failed`}function _n(e,t){return e?`bg-amber-900/50 text-amber-300`:t?`bg-green-900/50 text-green-300`:`bg-red-900/50 text-red-300`}function vn({event:e}){let{t}=c(`openhands`);if(!ue(e))return null;let n=mn(e.hook_event_type,e.blocked),r=gn(e.blocked,e.success),i=_n(e.blocked,e.success),a=(()=>{if(!e.blocked)return e.success?`success`:`error`})();return(0,P.jsx)(R,{title:(0,P.jsxs)(`span`,{children:[n,` `,t(`HOOK$HOOK_LABEL`),`: `,e.hook_event_type,e.tool_name&&(0,P.jsxs)(`span`,{className:`text-[var(--oh-muted)] ml-2`,children:[`(`,e.tool_name,`)`]}),(0,P.jsx)(`span`,{className:m(`ml-2 px-1 py-0.5 rounded text-xs`,i),children:r})]}),details:(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 text-[var(--oh-muted)]`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$COMMAND`),`:`]}),` `,(0,P.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:hn(e.hook_command)})]}),e.exit_code!==null&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$EXIT_CODE`),`:`]}),` `,e.exit_code]}),e.blocked&&e.reason&&(0,P.jsxs)(`div`,{className:`text-amber-400`,children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$BLOCKED_REASON`),`:`]}),` `,e.reason]}),e.additional_context&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$CONTEXT`),`:`]}),` `,e.additional_context]}),e.error&&(0,P.jsxs)(`div`,{className:`text-red-400`,children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$ERROR`),`:`]}),` `,e.error]}),e.stdout&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$OUTPUT`),`:`]}),(0,P.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto`,children:e.stdout})]}),e.stderr&&(0,P.jsxs)(`div`,{children:[(0,P.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(`HOOK$STDERR`),`:`]}),(0,P.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto text-amber-300`,children:e.stderr})]})]}),success:a})}function yn(e){let t=[],n=[];for(let r of e)fe(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var bn=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function xn(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(j(n)&&bn(n.observation.path))return n.id}return null}function Sn(e){return(0,N.useMemo)(()=>{let t=new Set;return yn(e).forEach(e=>{let n=xn(e);n&&t.add(n)}),t},[e])}function Cn(e,t){return t.has(e)}var wn=e=>e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
34
+ `),Tn=e=>e.reasoning_content?e.reasoning_content:e.thinking_blocks?.length?e.thinking_blocks.filter(e=>e.type===`thinking`).map(e=>e.thinking).join(`
35
+
36
+ `):``,En=e=>wn(e).trim().length>0,Dn=(e,t)=>{if(O(e))return e.action.kind===`ThinkAction`?null:En(e)?e:null;if(A(e)){let n=t.find(t=>O(t)&&t.id===e.action_id);return!n||n.action.kind===`ThinkAction`?null:En(n)?n:null}return null},On=e=>e.activated_skills||e.activated_microagents||[],kn=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),An=e=>{let t=On(e).length>0,n=kn(e.extended_content);return t&&n},jn=(e,t,n)=>{try{let r=nn(e);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(U,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,P.jsx)(X,{event:r,isLastMessage:n})]})}catch{return(0,P.jsx)(U,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Mn({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=g(),{planContent:s}=b(),{curAgentState:c}=D(),l=c===p.RUNNING||c===p.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(le(e))return(0,P.jsx)(Ke,{event:e,...d});if(ue(e))return(0,P.jsx)(vn,{event:e});if(k(e))return(0,P.jsx)(X,{event:e,isLastMessage:n});if(pe(e)){let t=e.content??``,n=e.reasoning_content??``;return(0,P.jsxs)(P.Fragment,{children:[n&&(0,P.jsx)(Q,{content:n}),t&&(0,P.jsx)(V,{type:`agent`,message:t,isFromPlanningAgent:u})]})}if(O(e)&&e.action.kind===`FinishAction`)return(0,P.jsx)(cn,{event:e,...d});if(O(e)&&e.action.kind===`ThinkAction`)return(0,P.jsx)(Q,{content:e.action.thought});if(O(e)){let t=Tn(e);return(0,P.jsxs)(P.Fragment,{children:[t&&(0,P.jsx)(Q,{content:t}),!a&&(0,P.jsx)(Z,{event:e,isFromPlanningAgent:u}),(0,P.jsx)(X,{event:e,isLastMessage:n})]})}if(A(e)){if(j(e))return i&&Cn(e.id,i)?(0,P.jsx)(We,{planContent:s,isStreaming:n&&c===p.RUNNING,isBuildDisabled:l}):null;let r=t.find(t=>O(t)&&t.id===e.action_id),o=!a&&r&&O(r)&&r.action.kind!==`ThinkAction`,d=r&&O(r)?Tn(r):``;return(0,P.jsxs)(P.Fragment,{children:[d&&(0,P.jsx)(Q,{content:d}),o&&(0,P.jsx)(Z,{event:r,isFromPlanningAgent:u}),(0,P.jsx)(X,{event:e,isLastMessage:n,correspondingAction:r&&O(r)?r:void 0})]})}if(!O(e)&&!A(e)){let t=e;return fe(e)&&An(t)?jn(t,d,n):(0,P.jsx)(U,{event:t,...d,isLastMessage:n})}return(0,P.jsx)(X,{event:e,isLastMessage:n})}var Nn=e=>{if(O(e)){let{kind:t}=e.action;return!(t===`FinishAction`||t===`ThinkAction`)}return A(e)?!(j(e)||e.observation.kind===`TaskTrackerObservation`):!1},Pn=(e,t=2,n=e)=>{if(t<1)throw Error(`minSize must be at least 1`);let r=[],i=new Set,a=null,o=()=>{a&&=(a.events.length>=t?r.push({kind:`group`,events:a.events,startIndex:a.startIndex}):a.events.forEach((e,t)=>{r.push({kind:`single`,event:e,index:a.startIndex+t})}),null)};return e.forEach((e,t)=>{if(Nn(e)){let s=Dn(e,n);s&&!i.has(s.id)&&(o(),i.add(s.id),r.push({kind:`thought`,action:s,index:t})),a||={events:[],startIndex:t},a.events.push(e)}else o(),r.push({kind:`single`,event:e,index:t})}),o(),r},Fn=(0,N.createContext)(!1);function In({events:e,allEvents:t,isFinalized:n=!1,children:i}){let{t:a}=c(`openhands`),[s,l]=N.useState(!1),u=N.useId(),d=`${u}-toggle`;if(e.length===0)return null;let f=e.find(e=>O(e)),p=e.filter(A).length,m=e.length,h=!!f,g=e[e.length-1],_=null;g&&(O(g)?_=Y(g).title:A(g)&&(_=Y(g,(t??e).find(e=>O(e)&&e.id===g.action_id)).title));let v=h?a(o.EVENT_GROUP$ACTIONS_PROGRESS,{completed:p,total:m}):a(o.EVENT_GROUP$ACTIONS_COMPLETED,{count:m}),y=s?L:I;return(0,P.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`event-group`,children:[(0,P.jsx)(`button`,{id:d,type:`button`,onClick:()=>l(e=>!e),"aria-controls":u,"aria-expanded":s,"aria-label":a(s?o.EVENT_GROUP$COLLAPSE:o.EVENT_GROUP$EXPAND),"data-testid":`event-group-toggle`,className:`w-full flex items-center justify-between gap-2 text-left cursor-pointer`,children:n?(0,P.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,P.jsx)(y,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:v})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,P.jsx)(y,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:_??v})]}),(0,P.jsxs)(`span`,{className:`flex items-center flex-shrink-0 font-normal text-[var(--oh-muted)]`,children:[(0,P.jsx)(`span`,{className:`truncate`,children:v}),h?(0,P.jsx)(r,{"data-testid":`spinner-icon`,className:`h-4 w-4 ml-2 inline animate-spin text-[var(--oh-muted)]`}):null]})]})}),s&&(0,P.jsx)(`div`,{id:u,role:`region`,"aria-labelledby":d,className:`mt-1.5 flex flex-col`,"data-testid":`event-group-content`,children:(0,P.jsx)(Fn.Provider,{value:!0,children:i})})]})}var $=e=>e.at(-1)?.id,Ln=N.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=E(),r=Sn(t),i=ce(e=>n?e.entriesByConversation[n]:void 0),a=N.useMemo(()=>{if(!i||i.length===0)return null;let e=new Set;for(let t of i)t.anchorEventId!==null&&e.add(t.anchorEventId);return e.size>0?e:null},[i]),o=e=>{if(!a||e===void 0)return null;let t=String(e);return a.has(t)?(0,P.jsx)(Oe,{conversationId:n,anchorEventId:t}):null},s=N.useMemo(()=>Pn(e,void 0,t),[e,t]),c=(n,i,a)=>(0,P.jsx)(Mn,{event:n,messages:t,isLastMessage:e.length-1===i,isInLast10Actions:e.length-1-i<10,planPreviewEventIds:r,suppressThought:a},n.id);return(0,P.jsx)(P.Fragment,{children:s.map((e,n)=>{if(e.kind===`single`)return(0,P.jsxs)(N.Fragment,{children:[c(e.event,e.index,!0),o(e.event.id)]},`single-${e.event.id}`);if(e.kind===`thought`)return(0,P.jsxs)(N.Fragment,{children:[(0,P.jsx)(Z,{event:e.action}),o(e.action.id)]},`thought-${e.action.id}`);let r=n<s.length-1,i=e.events[0]?.id??`group-${e.startIndex}`;return(0,P.jsxs)(N.Fragment,{children:[(0,P.jsx)(In,{events:e.events,allEvents:t,isFinalized:r,children:e.events.map((t,n)=>c(t,e.startIndex+n,!0))}),e.events.map(e=>(0,P.jsx)(N.Fragment,{children:o(e.id)},`model-${e.id}`))]},`group-${i}`)})})},(e,t)=>e.messages.length===t.messages.length&&e.allEvents.length===t.allEvents.length&&$(e.messages)===$(t.messages)&&$(e.allEvents)===$(t.allEvents));Ln.displayName=`Messages`;export{Me as a,Oe as c,Ce as d,F as f,V as i,R as l,Qe as n,ke as o,He as r,je as s,Ln as t,we as u};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-IA661TBv.js";import{t as i}from"./useQuery-JDs8UaWj.js";import{t as a}from"./useTranslation-CbJtty1g.js";import{M as o,t as s}from"./utils-CVcuFUYj.js";import{c,n as l}from"./agent-server-client-options-Dvgeb3x4.js";import{t as u}from"./llm-client-BnqeDPua.js";import{d}from"./brand-button-BoiPxAGm.js";import{n as f,t as p}from"./vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js";import{i as m}from"./combobox-caret-DwMmhrrA.js";import{t as h}from"./proxy-wIasY2Po.js";import{n as g}from"./map-provider-XSFHmdDs.js";import{d as _}from"./sdk-settings-schema-B0KrqqPX.js";var v=e(t(),1);function y(e){return null}y.getCollectionNode=function*(e){let{children:t,title:n,items:r}=e;yield{type:`section`,props:e,hasChildNodes:!0,rendered:n,"aria-label":e[`aria-label`],*childNodes(){if(typeof t==`function`){if(!r)throw Error(`props.children was a function but props.items is missing`);for(let e of r)yield{type:`item`,value:e,renderer:t}}else{let e=[];v.Children.forEach(t,t=>{e.push({type:`item`,element:t})}),yield*e}}}};var b=y,x=e=>{let[t,...n]=e.split(`/`);return!t||n.length===0?{provider:``,model:e,separator:``}:{provider:t,model:n.join(`/`),separator:`/`}};function S(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function C(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function w(e,t){return!t||t<=0?e:e.slice(0,t)}function T(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var E=class{static async searchModels(e={},t){let n=c();if(n.backend.kind===`cloud`){let t=T({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return h({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new u(l()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getModels(),i]),s=e.provider__eq??null,d=new Set(s?o?.[s]??[]:[]),f=[...d].map(e=>({provider:s,name:e,verified:!0})),p=s?(a??[]).filter(e=>e.startsWith(`${s}/`)).map(e=>e.slice(s.length+1)).filter(e=>e.length>0&&!d.has(e)).map(e=>({provider:s,name:e,verified:!1})):[];return{items:w(C(S([...f,...p],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=c();if(n.backend.kind===`cloud`){let t=T({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return h({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new u(l()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getProviders(),i]),s=new Set(Object.keys(o??{}));return{items:w(C(S([...new Set([...s,...a??[]])].map(e=>({name:e,verified:s.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},D=[`config`,`verified-models`],O=1e3*60*5,k=1e3*60*15;async function A(){return c().backend.kind===`cloud`?{}:await new u(l()).getVerifiedModels()??{}}var j=()=>i({queryKey:[`config`,`providers`],queryFn:async({client:e})=>{let t=await e.fetchQuery({queryKey:D,queryFn:A,staleTime:O});return(await E.searchProviders({limit:100},t)).items},staleTime:O,gcTime:k}),M=10;async function N(e,t,n,r=0){if(r>=M)throw Error(`Too many pagination requests for provider ${e}`);let i=await E.searchModels({provider__eq:e,limit:100,page_id:n},t);if(i.next_page_id){let n=await N(e,t,i.next_page_id,r+1);return[...i.items,...n]}return i.items}var P=e=>i({queryKey:[`config`,`models`,e],queryFn:async({client:t})=>N(e,await t.fetchQuery({queryKey:D,queryFn:A,staleTime:O})),enabled:!!e,staleTime:O,gcTime:k}),F=()=>i({queryKey:D,queryFn:A,select:e=>e?.openhands??[],staleTime:O,gcTime:k}),I=`https://llm-proxy.app.all-hands.dev/`,L=new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`]),R=`litellm_proxy/`;function z(e){return typeof e==`string`&&e.startsWith(`openhands/`)}function B(e){return typeof e==`string`&&L.has(e.trim().replace(/\/+$/,``))}function V(e,t){return z(e)?!0:typeof e==`string`&&e.startsWith(R)&&B(t)}var H=`litellm_proxy/`;function U(e,t,n){if(!e)return``;if(!e.startsWith(H)||!B(t))return e;let r=e.slice(14);return n.includes(r)?`openhands/${r}`:e}var W=n();function G({isDisabled:e,currentModel:t,currentBaseUrl:n,onChange:i,onDefaultValuesChanged:c,wrapperClassName:l,labelClassName:u}){let[,h]=v.useState(null),[y,S]=v.useState(null),[C,w]=v.useState(null),{data:T=[]}=j(),{data:E}=F(),{data:D=[],isLoading:O,error:k}=P(y),A=v.useMemo(()=>T.filter(e=>e.verified),[T]),M=v.useMemo(()=>T.filter(e=>!e.verified),[T]),N=v.useMemo(()=>D.filter(e=>e.verified),[D]),I=v.useMemo(()=>D.filter(e=>!e.verified),[D]);v.useEffect(()=>{if(t&&E!==void 0){let e=U(t,n,E),{provider:r,model:i}=x(e);h(e),S(r||null),w(i),c?.(r||null,i)}},[t,n,E]);let L=e=>{S(e),w(null),h(`${e}/`),i?.(e,null)},R=e=>{let t=`${y}/${e}`;y===`openai`&&(t=e),h(t),w(e),i?.(y,e)},z=()=>{S(null),h(null)},{t:B}=a(`openhands`);return(0,W.jsxs)(`div`,{className:s(`flex flex-col md:flex-row w-full min-w-0 justify-between gap-4 md:gap-[46px]`,l),children:[(0,W.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,W.jsx)(`label`,{className:s(`text-sm`,u),children:B(r.LLM$PROVIDER)}),(0,W.jsxs)(p,{"data-testid":`llm-provider-input`,isRequired:!0,isVirtualized:!1,name:`llm-provider-input`,isDisabled:e,"aria-label":B(r.LLM$PROVIDER),isClearable:!1,onSelectionChange:e=>{e?.toString()&&L(e.toString())},onInputChange:e=>!e&&z(),defaultSelectedKey:y??void 0,selectedKey:y,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:m},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:d}},children:[(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:A.map(e=>(0,W.jsx)(f,{"data-testid":`provider-item-${e.name}`,children:g(e.name)},e.name))}),M.length>0?(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:M.map(e=>(0,W.jsx)(f,{children:g(e.name)},e.name))}):null]})]}),y===`openhands`&&(0,W.jsx)(_,{testId:`openhands-account-help`,text:B(r.SETTINGS$NEED_OPENHANDS_ACCOUNT),linkText:B(r.SETTINGS$CLICK_HERE),href:o.PRODUCTION,size:`settings`,linkColor:`white`}),(0,W.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,W.jsx)(`label`,{className:s(`text-sm`,u),children:B(r.LLM$MODEL)}),(0,W.jsxs)(p,{"data-testid":`llm-model-input`,isRequired:!0,isVirtualized:!1,isLoading:O,name:`llm-model-input`,"aria-label":B(r.LLM$MODEL),isClearable:!1,onSelectionChange:e=>{e?.toString()&&R(e.toString())},isDisabled:e||!y,selectedKey:C,defaultSelectedKey:C??void 0,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:m},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:d}},children:[(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:N.map(e=>(0,W.jsx)(f,{children:e.name},e.name))}),I.length>0?(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:I.map(e=>(0,W.jsx)(f,{"data-testid":`model-item-${e.name}`,children:e.name},e.name))}):null]}),k&&(0,W.jsx)(`p`,{"data-testid":`models-error`,className:`text-danger text-xs`,children:B(r.CONFIGURATION$ERROR_FETCH_MODELS)})]})]})}export{x as i,I as n,V as r,G as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{k as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{u as r}from"./path-utils-CNd_jqv_.js";import{t as i}from"./useMutation-7hG0GuPx.js";import{i as a}from"./organization-service.api-D79cdERN.js";import{o,t as s}from"./declaration-IA661TBv.js";import{n as c}from"./QueryClientProvider-7oLZ1RtQ.js";import{t as l}from"./useQuery-JDs8UaWj.js";import{r as u,t as d}from"./recommended-automations-launcher-B01jchhe.js";import{t as f}from"./useTranslation-CbJtty1g.js";import{t as p}from"./retrieve-axios-error-message-DbnSBc_1.js";import{t as m}from"./createLucideIcon-C9OEnwvX.js";import{n as h}from"./vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js";import{t as g}from"./check-BDAbW7je.js";import{n as _,r as v}from"./custom-toast-handlers-fgD4IYsu.js";import{a as y,i as b,r as x,t as S}from"./llm-settings-D477P0Lg.js";import{t as C}from"./utils-CVcuFUYj.js";import{S as w,_ as ee,n as T,p as te}from"./agent-server-client-options-Dvgeb3x4.js";import{n as E,r as ne}from"./active-backend-context-CQTk4wD8.js";import{a as re,c as D,l as ie}from"./vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-Cwz6a1DC.js";import{i as O}from"./mcp-client-xEdbDxOL.js";import{r as k}from"./query-keys-CQaji0wJ.js";import{t as A}from"./modal-backdrop-B1si6TUd.js";import{r as j,t as M}from"./modal-body-2Po2nl1e.js";import{r as N}from"./base-modal-Ba5WcNb6.js";import{i as P}from"./modal-classes-9XTtWCtF.js";import{t as F}from"./brand-button-BoiPxAGm.js";import{t as ae}from"./openhands-logo-B-IDE1ER.js";import{n as oe}from"./navigation-context-CszaA-CJ.js";import{t as se}from"./chat-send-button-06dIuWXm.js";import{i as ce,o as le,t as ue}from"./backend-form-modal-B6q897ZX.js";import{t as de}from"./settings-input-CPr7vX81.js";import{t as fe}from"./confirmation-modal-C_lds1Tb.js";import{i as pe,n as I,o as me,s as he}from"./acp-providers-DZEi8wDz.js";import{t as ge}from"./use-create-conversation-4iJytCT1.js";import{t as _e}from"./terminal-DQJ6IJUd.js";import{t as L}from"./folder-UGYUKpqb.js";import{t as ve}from"./chevron-left-small-CuuwpRi9.js";import{t as R}from"./close-Cz0OAgTy.js";import{t as ye}from"./use-save-settings-hK6LYt0s.js";import{n as be,t as xe}from"./use-get-secrets-BMnFFBUx.js";var Se=m(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),z=e(t(),1),B=o(),Ce=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,we=`0 0 100 100`,Te=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,Ee=`0 0 12 12`,De=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,Oe=`0 0 24 24`,ke=3/2;function V({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,B.jsx)(ae,{width:Math.round(t*ke),height:t,className:C(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:we,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:Ce})}):e===`codex`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Ee,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:Te,fill:`currentColor`})}):e===`gemini`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Oe,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:De})}):(0,B.jsx)(_e,{width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function H(){return new re(T())}function U(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var W=class{static async listWorkspaces(){return U(await H().listWorkspaces())}static async addWorkspaces(e){return U(await H().addWorkspaces(e))}static async removeWorkspace(e){await H().deleteWorkspace(e)}static async addWorkspaceParents(e){return U(await H().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await H().deleteWorkspaceParent(e)}};function Ae(){let e=c();return i({mutationFn:e=>W.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function je(){let e=c();return i({mutationFn:e=>W.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function Me(){let e=c();return i({mutationFn:e=>W.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function Ne(){let e=c();return i({mutationFn:e=>W.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function G({enabled:e=!0}={}){return l({queryKey:k.all,queryFn:()=>W.listWorkspaces(),enabled:e,retry:(e,t)=>!O(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function Pe(){let{data:e,isLoading:t,isError:n,error:r}=G(),i=O(r),o=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,z.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,i]),l=a({queries:i?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new D(T()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,z.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),o.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[o,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:u,isError:d,error:r}}function Fe(e,t){return O(e)?t(s.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function K(){return new D(T())}var Ie=e=>{let t=E();return l({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>K().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},Le=()=>{let e=E();return l({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>K().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},q=`/projects`;function J({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,B.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,B.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:C(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,B.jsx)(L,{width:14,height:14,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function Re(e){let t=e.replace(/\/+$/,``);if(!t||t===`/`)return null;let n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function Y(e){return e?.home===`/home/openhands`}function ze({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=f(`openhands`),[a,o]=(0,z.useState)(null),c=E(),{data:l}=Le();(0,z.useEffect)(()=>{e&&l?.home&&a===null&&o(Y(l)?q:l.home),e||o(null)},[e,l?.home,a]),(0,z.useEffect)(()=>{o(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:d,isError:p,error:m}=Ie(e?a:null),h=(0,z.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:l.home.replace(/[\\/]+$/,``)||l.home},...l.favorites??[]];return Y(l)&&!e.some(e=>e.path===q)&&e.push({label:q,path:q}),e},[l]),g=l?.locations??[];if(!e)return null;let _=u?.items??[],v=a?Re(a):null,y=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&a===l?.home&&!d&&!p&&_.length===0,b=e=>{let t=e.replace(/\/+$/,``);if(!t)return`/`;let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1)||`/`:t};return(0,B.jsx)(A,{onClose:t,"aria-label":i(s.HOME$ADD_WORKSPACES_TITLE),children:(0,B.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`xl`),M,`h-[480px]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:i(s.HOME$ADD_WORKSPACES_TITLE)})}),(0,B.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,B.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,B.jsx)(J,{label:i(s.HOME$FAVORITES),entries:h,currentPath:a,onPick:o}),(0,B.jsx)(J,{label:i(s.HOME$LOCATIONS),entries:g,currentPath:a,onPick:o})]}),(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,B.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>v&&o(v),disabled:!v,"aria-label":`Up`,className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,B.jsx)(ve,{width:16,height:16})}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,B.jsx)(`span`,{children:i(s.HOME$NAME)}),(0,B.jsx)(`span`,{children:i(s.HOME$KIND)})]}),(0,B.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[d&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(s.HOME$LOADING)}),p&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:m?.message??`Failed to load`}),!d&&!p&&_.length===0&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":y?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(y?s.HOME$HOST_HOME_NOT_MOUNTED_HINT:s.HOME$NO_WORKSPACES)}),_.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(s.HOME$FOLDER)})]})},e.path))]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(s.HOME$CANCEL)}),r&&(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||d,testId:`folder-browser-add-all-subdirs`,children:i(s.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||d,testId:`folder-browser-use`,children:i(s.HOME$ADD_THIS_DIRECTORY)})]})]})})}function Be({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:o}=f(`openhands`),[c,l]=z.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let p=u.length>0||n.length>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:r,"aria-label":o(s.HOME$MANAGE_WORKSPACES),children:(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`lg`),M,`max-h-[70vh]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:o(s.HOME$MANAGE_WORKSPACES)})}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,B.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:o(s.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,B.jsx)(`ul`,{children:u.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:o(s.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":o(s.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:o(s.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,B.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:o(s.HOME$WORKSPACE_PARENTS)}),(0,B.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,B.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:o(s.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":o(s.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:o(s.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,B.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,B.jsx)(L,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,B.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:o(s.HOME$DONE)})})]})}),c&&(0,B.jsx)(fe,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):a?.(c.path),l(null))},onCancel:()=>l(null)})]})}function Ve({currentStep:e,totalSteps:t,className:n}){return(0,B.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:C(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,B.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:C(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function He(e){return e===`openhands`?`openhands`:I.find(({key:t})=>t===e)?.icon??`cli-generic`}function Ue({id:e,muted:t}){let n=He(e);return n===`openhands`?(0,B.jsx)(V,{kind:`openhands`,size:16,className:C(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,B.jsx)(V,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function We(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:s.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...I.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ge({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:i}=f(`openhands`),{mutate:a,isPending:o}=ye();return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(s.ONBOARDING$AGENT_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(s.ONBOARDING$AGENT_SUBTITLE)})]}),(0,B.jsx)(`div`,{role:`radiogroup`,"aria-label":i(s.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:We().map(n=>{let r=n.id===e;return(0,B.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:C(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(Ue,{id:n.id,muted:!1}),(0,B.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:i(n.descriptionKey)})]}),(0,B.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,B.jsx)(g,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,B.jsx)(F,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:o,children:i(s.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:o,onClick:()=>{let t=pe(e);if(!t){r();return}a({agent_settings_diff:t},{onError:e=>{_(p(e)||i(s.ERROR$GENERIC))},onSuccess:()=>{v(i(s.SETTINGS$SAVED)),r()}})},children:i(o?s.SETTINGS$SAVING:s.ONBOARDING$NEXT)})]})]})}function Ke({isConnected:e}){let{t}=f(`openhands`);return e===!0?(0,B.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:C(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,B.jsx)(h,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:t(s.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-green-200/80`,children:t(s.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]}):e===!1?(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,B.jsx)(Se,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:t(s.ONBOARDING$BACKEND_DISCONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-red-200/80`,children:t(s.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]}):(0,B.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,B.jsx)(r,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,B.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:t(s.ONBOARDING$BACKEND_CHECKING)})]})}function qe({onBack:e,onNext:t}){let{t:n}=f(`openhands`),{active:r}=ne(),{backend:i}=r,a=te(i),o=z.useMemo(()=>w(),[]),c=a?{id:`onboarding-local-backend-draft`,name:ee,host:o.baseUrl,apiKey:o.sessionApiKey,kind:`local`}:i,l=le(a?[]:[i]),u=a?!1:l[i.id]?.isConnected??null,[d,p]=z.useState(!1);z.useEffect(()=>{u===!0&&p(!1)},[u]);let m=u===!0&&!d;return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(s.ONBOARDING$BACKEND_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(s.ONBOARDING$BACKEND_SUBTITLE)})]}),(0,B.jsx)(Ke,{isConnected:u}),u===!0?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-expanded":d,"data-testid":`onboarding-backend-show-configuration`,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,B.jsx)(`span`,{children:n(d?s.ONBOARDING$BACKEND_HIDE_CONFIGURATION:s.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,B.jsx)(ce,{className:C(`h-4 w-4 shrink-0 text-muted transition-transform`,d&&`rotate-180`),"aria-hidden":!0})]}):null,(0,B.jsx)(ue,{mode:a?`add`:`edit`,backend:c,onSubmitted:t,testIdRoot:`onboarding-backend`,requireApiKey:!0,hideConfigurationFields:m,renderActions:({canSubmit:t,isSubmitting:r})=>(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`),children:[e?(0,B.jsx)(F,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:r,children:n(s.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-backend-next`,type:`submit`,variant:`primary`,isDisabled:!t||r,children:n(r?s.SETTINGS$SAVING:s.ONBOARDING$NEXT)})]})})]})}var Je={"llm.model":`anthropic/claude-opus-4-8`};function Ye({onBack:e,onNext:t}){let{t:n}=f(`openhands`),{backend:r}=E(),i=r.kind===`local`,a=x(),o=b(),[c,l]=z.useState(null),[u,d]=z.useState(!1),p=z.useCallback(async()=>{if(!i||!c)return;let e=c.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,s=y(t),l={model:t};n&&(l.api_key=n),r&&(l.base_url=r);try{await a.mutateAsync({name:s,request:{llm:l,include_secrets:!0}}),await o.mutateAsync(s)}catch(e){console.error(`Failed to persist onboarding LLM as profile:`,e)}},[i,c,a,o]),m=z.useCallback(async()=>{d(!0);try{await p()}finally{d(!1),t()}},[p,t]);return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(s.ONBOARDING$LLM_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(s.ONBOARDING$LLM_SUBTITLE)})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,B.jsx)(S,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:Je,onSaveSuccess:m,onSaveControlChange:l})}),(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(s.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(c?.isSaving??!1)||u,onClick:()=>{if(c?.isDirty){c.save();return}t()},children:n(s.ONBOARDING$NEXT)})]})]})}var Xe=10;function Ze(e){return`${e.stdout??``}\n${e.stderr??``}`}function Qe(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function $e(e){let t=Ze(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function et(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var tt={"claude-code":{command:`claude auth status --json`,classify:Qe},codex:{command:`codex login status`,classify:$e},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:et}},nt=class{static async getAuthStatus(e){let t=tt[e];if(!t)return`unknown`;let n=await new ie(T()).executeCommand(t.command,void 0,Xe);return t.classify(n)}};async function rt(e){try{return await nt.getAuthStatus(e)}catch{return`unknown`}}function it(e,t={}){let{enabled:n=!0}=t,r=E(),i=r.backend.kind===`local`,a=n&&i&&!!e,o=l({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>rt(e),enabled:a,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:o.data??`unknown`,isChecking:a&&o.isFetching&&o.data===void 0,isSupported:i}}function at({providerKey:e,isActive:t,onBack:n,onNext:i}){let{t:a}=f(`openhands`),o=c(),{mutateAsync:l}=be(),{data:u}=xe(),{status:d,isChecking:m}=it(e,{enabled:t}),h=z.useMemo(()=>he(e),[e]),[y,b]=z.useState({}),[x,S]=z.useState(!1),C=me(e)??e,w=z.useCallback(e=>(u??[]).some(t=>t.name===e),[u]);return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(s.ONBOARDING$ACP_SECRETS_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(s.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:C})}),d!==`authenticated`&&(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(s.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),d===`authenticated`?(0,B.jsxs)(`div`,{"data-testid":`onboarding-acp-auth-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,B.jsx)(g,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,B.jsx)(`span`,{children:a(s.ONBOARDING$ACP_AUTH_DETECTED,{provider:C})})]}):m?(0,B.jsxs)(`div`,{"data-testid":`onboarding-acp-auth-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,B.jsx)(r,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,B.jsx)(`span`,{children:a(s.ONBOARDING$ACP_AUTH_CHECKING,{provider:C})})]}):null,(0,B.jsx)(`div`,{className:`flex flex-col gap-5`,children:h.map(e=>{let t=w(e.name);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(de,{testId:`onboarding-acp-secret-${e.name}`,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:y[e.name]??``,onChange:t=>b(n=>({...n,[e.name]:t})),showOptionalTag:!0,placeholder:t?a(s.ONBOARDING$ACP_SECRET_ALREADY_SET):``}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(e.hint_key)})]},e.name)})}),(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:x,children:a(s.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:x,onClick:async()=>{let e=h.map(e=>({name:e.name,value:y[e.name]?.trim()})).filter(e=>!!e.value);if(e.length===0){i();return}S(!0);try{for(let{name:t,value:n}of e)await l({name:t,value:n});await o.invalidateQueries({queryKey:[`secrets-search`]}),await o.invalidateQueries({queryKey:[`secrets`]}),v(a(s.SETTINGS$SAVED)),i()}catch(e){_(p(e)||a(s.ERROR$GENERIC))}finally{S(!1)}},children:a(x?s.SETTINGS$SAVING:s.ONBOARDING$NEXT)})]})]})}function ot({onBack:e,onClose:t,onLaunched:n}){let{t:r}=f(`openhands`),{navigate:i}=oe(),a=r(s.ONBOARDING$HELLO_DEFAULT_MESSAGE),[o,c]=z.useState(a),{mutate:l,isPending:p,isSuccess:m}=ge(),h=u(),g=p||m||h,_=z.useRef(!1),v=o.trim().length>0&&!g&&!_.current,y=()=>{!v||_.current||(_.current=!0,l({query:o.trim()},{onSuccess:e=>{n(),i(`/conversations/${e.conversation_id}`)},onError:()=>{_.current=!1}}))};return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(s.ONBOARDING$HELLO_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(s.ONBOARDING$HELLO_SUBTITLE)})]}),(0,B.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),y()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,B.jsx)(`div`,{className:`relative w-full`,children:(0,B.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,B.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(s.ONBOARDING$HELLO_TITLE),type:`text`,value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},placeholder:a,disabled:g,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,B.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,B.jsx)(se,{buttonClassName:``,handleSubmit:y,disabled:!v})})]}),(0,B.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,B.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(s.LANDING$OR)}),(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,B.jsx)(d,{onLaunched:n,scrollableGrid:!0})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:g,children:r(s.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:g,children:r(s.BUTTON$CLOSE)})]})]})}var X=4,Z=2;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,B.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:C(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function st({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=f(`openhands`),[i,a]=z.useState(()=>Math.min(Math.max(t,0),X-1)),[o,c]=z.useState(`openhands`),l=o===`openhands`,u=z.useCallback(()=>a(e=>Math.min(e+1,X-1)),[]),d=z.useCallback(()=>a(e=>Math.max(e-1,0)),[]);return(0,B.jsx)(A,{"aria-label":r(s.ONBOARDING$TITLE),children:(0,B.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,B.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":i,"data-preview":n?`true`:void 0,className:C(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,j(`lg`),M,`max-h-[90vh]`),children:[(0,B.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,B.jsx)(Ve,{currentStep:i,totalSteps:X})}),(0,B.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,B.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":i,className:`relative overflow-clip`,children:[(0,B.jsx)(Q,{index:0,currentStep:i,children:(0,B.jsx)(Ge,{selectedAgentId:o,onSelect:c,onNext:u})}),(0,B.jsx)(Q,{index:1,currentStep:i,children:(0,B.jsx)(qe,{onBack:d,onNext:u})}),(0,B.jsx)(Q,{index:Z,currentStep:i,children:l?(0,B.jsx)(Ye,{onBack:d,onNext:u}):(0,B.jsx)(at,{providerKey:o,isActive:i===Z,onBack:d,onNext:u})}),(0,B.jsx)(Q,{index:3,currentStep:i,children:(0,B.jsx)(ot,{onBack:d,onClose:e,onLaunched:e})})]})})]}),i<X-1?(0,B.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:e,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(s.ONBOARDING$SKIP)}):null]})})}var ct=`previewOnboardingStep`,lt=3;function $(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(ct);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>lt?null:n}function ut(e=typeof window<`u`?window.location.search:``){return $(e)!=null}var dt=`openhands-onboarded`;function ft(){if(typeof window>`u`)return!0;try{return window.localStorage.getItem(dt)!==null}catch{return!0}}function pt(){let[e,t]=z.useState(()=>ft());return z.useEffect(()=>{let e=e=>{e.key===`openhands-onboarded`&&t(ft())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{isCompleted:e,markCompleted:z.useCallback(()=>{try{window.localStorage.setItem(dt,`1`)}catch{}t(!0)},[])}}function mt(){let e=n(),t=$(e.search),r=ut(e.search),{isCompleted:i,markCompleted:a}=pt();return!r&&i?null:(0,B.jsx)(st,{onClose:()=>{r||a()},initialStep:t??0,isPreview:r})}export{Fe as a,Me as c,Ne as d,V as f,ze as i,Ae as l,ut as n,Pe as o,Be as r,G as s,mt as t,je as u};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{k as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{u as r}from"./path-utils-0KWEiRs9.js";import{t as i}from"./useMutation-7hG0GuPx.js";import{i as a}from"./organization-service.api-D79cdERN.js";import{o,t as s}from"./declaration-IA661TBv.js";import{n as c}from"./QueryClientProvider-7oLZ1RtQ.js";import{t as l}from"./useQuery-JDs8UaWj.js";import{r as u,t as d}from"./recommended-automations-launcher-B1kfmFTQ.js";import{t as f}from"./useTranslation-CbJtty1g.js";import{t as p}from"./retrieve-axios-error-message-DbnSBc_1.js";import{t as m}from"./createLucideIcon-C9OEnwvX.js";import{n as h}from"./vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js";import{t as g}from"./check-BDAbW7je.js";import{n as _,r as v}from"./custom-toast-handlers-fgD4IYsu.js";import{a as y,i as b,r as x,t as S}from"./llm-settings-B8kPJ0Of.js";import{t as C}from"./utils-CVcuFUYj.js";import{S as w,_ as ee,n as T,p as te}from"./agent-server-client-options-Dvgeb3x4.js";import{n as E,r as ne}from"./active-backend-context-CQTk4wD8.js";import{l as D,o as re,u as ie}from"./vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-BaCzvZac.js";import{i as O}from"./mcp-client-xEdbDxOL.js";import{r as k}from"./query-keys-CQaji0wJ.js";import{t as A}from"./modal-backdrop-B1si6TUd.js";import{r as j,t as M}from"./modal-body-2Po2nl1e.js";import{r as N}from"./base-modal-Ba5WcNb6.js";import{i as P}from"./modal-classes-9XTtWCtF.js";import{t as F}from"./brand-button-BoiPxAGm.js";import{t as ae}from"./openhands-logo-B-IDE1ER.js";import{n as oe}from"./navigation-context-CszaA-CJ.js";import{t as se}from"./chat-send-button-qKFZuB9E.js";import{i as ce,o as le,t as ue}from"./backend-form-modal-BUy-PzZN.js";import{t as de}from"./settings-input-DsoZj8Dm.js";import{t as fe}from"./confirmation-modal-BPgWqWRI.js";import{i as pe,n as I,o as me,s as he}from"./acp-providers-C55k29rf.js";import{t as ge}from"./use-create-conversation-CzvaVA5A.js";import{t as _e}from"./terminal-BUww3Ssl.js";import{t as L}from"./folder-wShAU0y7.js";import{t as ve}from"./chevron-left-small-x9_-ucHG.js";import{t as R}from"./close-CbOsKMRg.js";import{t as ye}from"./use-save-settings-CP23emUY.js";import{n as be,t as xe}from"./use-get-secrets-DiLgP147.js";var Se=m(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),z=e(t(),1),B=o(),Ce=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,we=`0 0 100 100`,Te=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,Ee=`0 0 12 12`,De=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,Oe=`0 0 24 24`,ke=3/2;function V({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,B.jsx)(ae,{width:Math.round(t*ke),height:t,className:C(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:we,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:Ce})}):e===`codex`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Ee,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:Te,fill:`currentColor`})}):e===`gemini`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Oe,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:De})}):(0,B.jsx)(_e,{width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function H(){return new re(T())}function U(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var W=class{static async listWorkspaces(){return U(await H().listWorkspaces())}static async addWorkspaces(e){return U(await H().addWorkspaces(e))}static async removeWorkspace(e){await H().deleteWorkspace(e)}static async addWorkspaceParents(e){return U(await H().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await H().deleteWorkspaceParent(e)}};function Ae(){let e=c();return i({mutationFn:e=>W.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function je(){let e=c();return i({mutationFn:e=>W.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function Me(){let e=c();return i({mutationFn:e=>W.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function Ne(){let e=c();return i({mutationFn:e=>W.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:k.all})})}function G({enabled:e=!0}={}){return l({queryKey:k.all,queryFn:()=>W.listWorkspaces(),enabled:e,retry:(e,t)=>!O(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function Pe(){let{data:e,isLoading:t,isError:n,error:r}=G(),i=O(r),o=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,z.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,i]),l=a({queries:i?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new D(T()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,z.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),o.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[o,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:u,isError:d,error:r}}function Fe(e,t){return O(e)?t(s.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function K(){return new D(T())}var Ie=e=>{let t=E();return l({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>K().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},Le=()=>{let e=E();return l({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>K().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},q=`/projects`;function J({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,B.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,B.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:C(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,B.jsx)(L,{width:14,height:14,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function Re(e){let t=e.replace(/\/+$/,``);if(!t||t===`/`)return null;let n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function Y(e){return e?.home===`/home/openhands`}function ze({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=f(`openhands`),[a,o]=(0,z.useState)(null),c=E(),{data:l}=Le();(0,z.useEffect)(()=>{e&&l?.home&&a===null&&o(Y(l)?q:l.home),e||o(null)},[e,l?.home,a]),(0,z.useEffect)(()=>{o(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:d,isError:p,error:m}=Ie(e?a:null),h=(0,z.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:l.home.replace(/[\\/]+$/,``)||l.home},...l.favorites??[]];return Y(l)&&!e.some(e=>e.path===q)&&e.push({label:q,path:q}),e},[l]),g=l?.locations??[];if(!e)return null;let _=u?.items??[],v=a?Re(a):null,y=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&a===l?.home&&!d&&!p&&_.length===0,b=e=>{let t=e.replace(/\/+$/,``);if(!t)return`/`;let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1)||`/`:t};return(0,B.jsx)(A,{onClose:t,"aria-label":i(s.HOME$ADD_WORKSPACES_TITLE),children:(0,B.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`xl`),M,`h-[480px]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:i(s.HOME$ADD_WORKSPACES_TITLE)})}),(0,B.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,B.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,B.jsx)(J,{label:i(s.HOME$FAVORITES),entries:h,currentPath:a,onPick:o}),(0,B.jsx)(J,{label:i(s.HOME$LOCATIONS),entries:g,currentPath:a,onPick:o})]}),(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,B.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>v&&o(v),disabled:!v,"aria-label":`Up`,className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,B.jsx)(ve,{width:16,height:16})}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,B.jsx)(`span`,{children:i(s.HOME$NAME)}),(0,B.jsx)(`span`,{children:i(s.HOME$KIND)})]}),(0,B.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[d&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(s.HOME$LOADING)}),p&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:m?.message??`Failed to load`}),!d&&!p&&_.length===0&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":y?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(y?s.HOME$HOST_HOME_NOT_MOUNTED_HINT:s.HOME$NO_WORKSPACES)}),_.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(s.HOME$FOLDER)})]})},e.path))]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(s.HOME$CANCEL)}),r&&(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||d,testId:`folder-browser-add-all-subdirs`,children:i(s.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||d,testId:`folder-browser-use`,children:i(s.HOME$ADD_THIS_DIRECTORY)})]})]})})}function Be({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:o}=f(`openhands`),[c,l]=z.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let p=u.length>0||n.length>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:r,"aria-label":o(s.HOME$MANAGE_WORKSPACES),children:(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`lg`),M,`max-h-[70vh]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:o(s.HOME$MANAGE_WORKSPACES)})}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,B.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:o(s.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,B.jsx)(`ul`,{children:u.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:o(s.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":o(s.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:o(s.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,B.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:o(s.HOME$WORKSPACE_PARENTS)}),(0,B.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,B.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:o(s.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":o(s.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:o(s.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,B.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,B.jsx)(L,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,B.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:o(s.HOME$DONE)})})]})}),c&&(0,B.jsx)(fe,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):a?.(c.path),l(null))},onCancel:()=>l(null)})]})}function Ve({currentStep:e,totalSteps:t,className:n}){return(0,B.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:C(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,B.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:C(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function He(e){return e===`openhands`?`openhands`:I.find(({key:t})=>t===e)?.icon??`cli-generic`}function Ue({id:e,muted:t}){let n=He(e);return n===`openhands`?(0,B.jsx)(V,{kind:`openhands`,size:16,className:C(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,B.jsx)(V,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function We(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:s.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...I.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ge({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:i}=f(`openhands`),{mutate:a,isPending:o}=ye();return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(s.ONBOARDING$AGENT_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(s.ONBOARDING$AGENT_SUBTITLE)})]}),(0,B.jsx)(`div`,{role:`radiogroup`,"aria-label":i(s.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:We().map(n=>{let r=n.id===e;return(0,B.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:C(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(Ue,{id:n.id,muted:!1}),(0,B.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:i(n.descriptionKey)})]}),(0,B.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,B.jsx)(g,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,B.jsx)(F,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:o,children:i(s.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:o,onClick:()=>{let t=pe(e);if(!t){r();return}a({agent_settings_diff:t},{onError:e=>{_(p(e)||i(s.ERROR$GENERIC))},onSuccess:()=>{v(i(s.SETTINGS$SAVED)),r()}})},children:i(o?s.SETTINGS$SAVING:s.ONBOARDING$NEXT)})]})]})}function Ke({isConnected:e}){let{t}=f(`openhands`);return e===!0?(0,B.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:C(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,B.jsx)(h,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:t(s.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-green-200/80`,children:t(s.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]}):e===!1?(0,B.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,B.jsx)(Se,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:t(s.ONBOARDING$BACKEND_DISCONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-red-200/80`,children:t(s.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]}):(0,B.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,B.jsx)(r,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,B.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:t(s.ONBOARDING$BACKEND_CHECKING)})]})}function qe({onBack:e,onNext:t}){let{t:n}=f(`openhands`),{active:r}=ne(),{backend:i}=r,a=te(i),o=z.useMemo(()=>w(),[]),c=a?{id:`onboarding-local-backend-draft`,name:ee,host:o.baseUrl,apiKey:o.sessionApiKey,kind:`local`}:i,l=le(a?[]:[i]),u=a?!1:l[i.id]?.isConnected??null,[d,p]=z.useState(!1);z.useEffect(()=>{u===!0&&p(!1)},[u]);let m=u===!0&&!d;return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(s.ONBOARDING$BACKEND_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(s.ONBOARDING$BACKEND_SUBTITLE)})]}),(0,B.jsx)(Ke,{isConnected:u}),u===!0?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-expanded":d,"data-testid":`onboarding-backend-show-configuration`,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,B.jsx)(`span`,{children:n(d?s.ONBOARDING$BACKEND_HIDE_CONFIGURATION:s.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,B.jsx)(ce,{className:C(`h-4 w-4 shrink-0 text-muted transition-transform`,d&&`rotate-180`),"aria-hidden":!0})]}):null,(0,B.jsx)(ue,{mode:a?`add`:`edit`,backend:c,onSubmitted:t,testIdRoot:`onboarding-backend`,requireApiKey:!0,hideConfigurationFields:m,renderActions:({canSubmit:t,isSubmitting:r})=>(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`),children:[e?(0,B.jsx)(F,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:r,children:n(s.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-backend-next`,type:`submit`,variant:`primary`,isDisabled:!t||r,children:n(r?s.SETTINGS$SAVING:s.ONBOARDING$NEXT)})]})})]})}var Je={"llm.model":`openai/gpt-5.5`};function Ye({onBack:e,onNext:t}){let{t:n}=f(`openhands`),{backend:r}=E(),i=r.kind===`local`,a=x(),o=b(),[c,l]=z.useState(null),[u,d]=z.useState(!1),p=z.useCallback(async()=>{if(!i||!c)return;let e=c.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,s=y(t),l={model:t};n&&(l.api_key=n),r&&(l.base_url=r);try{await a.mutateAsync({name:s,request:{llm:l,include_secrets:!0}}),await o.mutateAsync(s)}catch(e){console.error(`Failed to persist onboarding LLM as profile:`,e)}},[i,c,a,o]),m=z.useCallback(async()=>{d(!0);try{await p()}finally{d(!1),t()}},[p,t]);return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(s.ONBOARDING$LLM_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(s.ONBOARDING$LLM_SUBTITLE)})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,B.jsx)(S,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:Je,onSaveSuccess:m,onSaveControlChange:l})}),(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(s.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(c?.isSaving??!1)||u,onClick:()=>{if(c?.isDirty){c.save();return}t()},children:n(s.ONBOARDING$NEXT)})]})]})}var Xe=10;function Ze(e){return`${e.stdout??``}\n${e.stderr??``}`}function Qe(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function $e(e){let t=Ze(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function et(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var tt={"claude-code":{command:`claude auth status --json`,classify:Qe},codex:{command:`codex login status`,classify:$e},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:et}},nt=class{static async getAuthStatus(e){let t=tt[e];if(!t)return`unknown`;let n=await new ie(T()).executeCommand(t.command,void 0,Xe);return t.classify(n)}};async function rt(e){try{return await nt.getAuthStatus(e)}catch{return`unknown`}}function it(e,t={}){let{enabled:n=!0}=t,r=E(),i=r.backend.kind===`local`,a=n&&i&&!!e,o=l({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>rt(e),enabled:a,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:o.data??`unknown`,isChecking:a&&o.isFetching&&o.data===void 0,isSupported:i}}function at({providerKey:e,isActive:t,onBack:n,onNext:i}){let{t:a}=f(`openhands`),o=c(),{mutateAsync:l}=be(),{data:u}=xe(),{status:d,isChecking:m}=it(e,{enabled:t}),h=z.useMemo(()=>he(e),[e]),[y,b]=z.useState({}),[x,S]=z.useState(!1),C=me(e)??e,w=z.useCallback(e=>(u??[]).some(t=>t.name===e),[u]);return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(s.ONBOARDING$ACP_SECRETS_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(s.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:C})}),d!==`authenticated`&&(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(s.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),d===`authenticated`?(0,B.jsxs)(`div`,{"data-testid":`onboarding-acp-auth-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,B.jsx)(g,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,B.jsx)(`span`,{children:a(s.ONBOARDING$ACP_AUTH_DETECTED,{provider:C})})]}):m?(0,B.jsxs)(`div`,{"data-testid":`onboarding-acp-auth-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,B.jsx)(r,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,B.jsx)(`span`,{children:a(s.ONBOARDING$ACP_AUTH_CHECKING,{provider:C})})]}):null,(0,B.jsx)(`div`,{className:`flex flex-col gap-5`,children:h.map(e=>{let t=w(e.name);return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(de,{testId:`onboarding-acp-secret-${e.name}`,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:y[e.name]??``,onChange:t=>b(n=>({...n,[e.name]:t})),showOptionalTag:!0,placeholder:t?a(s.ONBOARDING$ACP_SECRET_ALREADY_SET):``}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(e.hint_key)})]},e.name)})}),(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:x,children:a(s.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:x,onClick:async()=>{let e=h.map(e=>({name:e.name,value:y[e.name]?.trim()})).filter(e=>!!e.value);if(e.length===0){i();return}S(!0);try{for(let{name:t,value:n}of e)await l({name:t,value:n});await o.invalidateQueries({queryKey:[`secrets-search`]}),await o.invalidateQueries({queryKey:[`secrets`]}),v(a(s.SETTINGS$SAVED)),i()}catch(e){_(p(e)||a(s.ERROR$GENERIC))}finally{S(!1)}},children:a(x?s.SETTINGS$SAVING:s.ONBOARDING$NEXT)})]})]})}function ot({onBack:e,onClose:t,onLaunched:n}){let{t:r}=f(`openhands`),{navigate:i}=oe(),a=r(s.ONBOARDING$HELLO_DEFAULT_MESSAGE),[o,c]=z.useState(a),{mutate:l,isPending:p,isSuccess:m}=ge(),h=u(),g=p||m||h,_=z.useRef(!1),v=o.trim().length>0&&!g&&!_.current,y=()=>{!v||_.current||(_.current=!0,l({query:o.trim()},{onSuccess:e=>{n(),i(`/conversations/${e.conversation_id}`)},onError:()=>{_.current=!1}}))};return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(s.ONBOARDING$HELLO_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(s.ONBOARDING$HELLO_SUBTITLE)})]}),(0,B.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),y()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,B.jsx)(`div`,{className:`relative w-full`,children:(0,B.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,B.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(s.ONBOARDING$HELLO_TITLE),type:`text`,value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},placeholder:a,disabled:g,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,B.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,B.jsx)(se,{buttonClassName:``,handleSubmit:y,disabled:!v})})]}),(0,B.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,B.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(s.LANDING$OR)}),(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,B.jsx)(d,{onLaunched:n,scrollableGrid:!0})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:g,children:r(s.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:g,children:r(s.BUTTON$CLOSE)})]})]})}var X=4,Z=2;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,B.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:C(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function st({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=f(`openhands`),[i,a]=z.useState(()=>Math.min(Math.max(t,0),X-1)),[o,c]=z.useState(`openhands`),l=o===`openhands`,u=z.useCallback(()=>a(e=>Math.min(e+1,X-1)),[]),d=z.useCallback(()=>a(e=>Math.max(e-1,0)),[]);return(0,B.jsx)(A,{"aria-label":r(s.ONBOARDING$TITLE),children:(0,B.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,B.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":i,"data-preview":n?`true`:void 0,className:C(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,j(`lg`),M,`max-h-[90vh]`),children:[(0,B.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,B.jsx)(Ve,{currentStep:i,totalSteps:X})}),(0,B.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,B.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":i,className:`relative overflow-clip`,children:[(0,B.jsx)(Q,{index:0,currentStep:i,children:(0,B.jsx)(Ge,{selectedAgentId:o,onSelect:c,onNext:u})}),(0,B.jsx)(Q,{index:1,currentStep:i,children:(0,B.jsx)(qe,{onBack:d,onNext:u})}),(0,B.jsx)(Q,{index:Z,currentStep:i,children:l?(0,B.jsx)(Ye,{onBack:d,onNext:u}):(0,B.jsx)(at,{providerKey:o,isActive:i===Z,onBack:d,onNext:u})}),(0,B.jsx)(Q,{index:3,currentStep:i,children:(0,B.jsx)(ot,{onBack:d,onClose:e,onLaunched:e})})]})})]}),i<X-1?(0,B.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:e,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(s.ONBOARDING$SKIP)}):null]})})}var ct=`previewOnboardingStep`,lt=3;function $(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(ct);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>lt?null:n}function ut(e=typeof window<`u`?window.location.search:``){return $(e)!=null}var dt=`openhands-onboarded`;function ft(){if(typeof window>`u`)return!0;try{return window.localStorage.getItem(dt)!==null}catch{return!0}}function pt(){let[e,t]=z.useState(()=>ft());return z.useEffect(()=>{let e=e=>{e.key===`openhands-onboarded`&&t(ft())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{isCompleted:e,markCompleted:z.useCallback(()=>{try{window.localStorage.setItem(dt,`1`)}catch{}t(!0)},[])}}function mt(){let e=n(),t=$(e.search),r=ut(e.search),{isCompleted:i,markCompleted:a}=pt();return!r&&i?null:(0,B.jsx)(st,{onClose:()=>{r||a()},initialStep:t??0,isPreview:r})}export{Fe as a,Me as c,Ne as d,V as f,ze as i,Ae as l,ut as n,Pe as o,Be as r,G as s,mt as t,je as u};
@@ -1 +1 @@
1
- import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js";import{u as n}from"./suspense-C9MBE_9N.js";import{n as r}from"./useQuery-JDs8UaWj.js";import{t as i}from"./createLucideIcon-C9OEnwvX.js";import{c as a,n as o}from"./agent-server-client-options-Dvgeb3x4.js";import{c as s,r as c,t as l}from"./agent-server-conversation-service.api-B82pNNTm.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=i(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),m=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},h=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await m(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},g=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await m(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},_=async e=>{let{conversationUrl:t,sessionApiKey:n}=await m(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},v=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},y=(e,t,n)=>v(e,t,{execution_status:n}),b=(e,t,n)=>v(e,t,{llm_model:n}),x=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},S=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},C=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{v as a,y as c,f as d,d as f,x as i,b as l,S as n,h as o,g as r,_ as s,C as t,p as u};
1
+ import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js";import{u as n}from"./suspense-C9MBE_9N.js";import{n as r}from"./useQuery-JDs8UaWj.js";import{t as i}from"./createLucideIcon-C9OEnwvX.js";import{c as a,n as o}from"./agent-server-client-options-Dvgeb3x4.js";import{c as s,r as c,t as l}from"./agent-server-conversation-service.api-js3oYcdU.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=i(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),m=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},h=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await m(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},g=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await m(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},_=async e=>{let{conversationUrl:t,sessionApiKey:n}=await m(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},v=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},y=(e,t,n)=>v(e,t,{execution_status:n}),b=(e,t,n)=>v(e,t,{llm_model:n}),x=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},S=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},C=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{v as a,y as c,f as d,d as f,x as i,b as l,S as n,h as o,g as r,_ as s,C as t,p as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-IA661TBv.js";import{t as i}from"./useTranslation-CbJtty1g.js";import{t as a}from"./brand-button-BoiPxAGm.js";import{t as o}from"./conversation-store-kHcewy1E.js";import{t as s}from"./lesson-plan-5O2tVbD1.js";import{t as c}from"./use-handle-plan-click-DYd5a6zN.js";import{t as l}from"./markdown-renderer-CZq_UdmE.js";import{n as u,r as d}from"./plan-components-BRiIX8Wn.js";import{t as f}from"./conversation-tab-empty-state-5bW9CQke.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=o();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{}),action:(0,m.jsx)(a,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-IA661TBv.js";import{t as i}from"./useTranslation-CbJtty1g.js";import{t as a}from"./brand-button-BoiPxAGm.js";import{t as o}from"./conversation-store-CiYGBud3.js";import{t as s}from"./lesson-plan-B607buca.js";import{t as c}from"./use-handle-plan-click-CUZwmKIk.js";import{t as l}from"./markdown-renderer-oOUs3tw5.js";import{n as u,r as d}from"./plan-components-DsiDjcDi.js";import{t as f}from"./conversation-tab-empty-state-Ba5hbJhn.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=o();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{}),action:(0,m.jsx)(a,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
@@ -1,52 +1,50 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{b as n,c as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js";import{o as i,t as a}from"./declaration-IA661TBv.js";import{n as o}from"./QueryClientProvider-7oLZ1RtQ.js";import{t as s}from"./useTranslation-CbJtty1g.js";import{r as c}from"./vendor~root-layout~home~mcp~automations-list-BTTZ58Mb.js";import{a as l,i as u,o as d,r as f,t as p}from"./circle-plus-check-toggle-B3_W6-nt.js";import{t as m}from"./utils-CVcuFUYj.js";import{n as h}from"./active-backend-context-CQTk4wD8.js";import{n as g}from"./navigation-context-CszaA-CJ.js";import{a as _,o as v}from"./conversation-local-storage-D5Tre_GA.js";import{t as y}from"./conversation-store-kHcewy1E.js";import{i as b,r as x}from"./use-settings-Clf0Y_P3.js";import{t as S}from"./use-tracking-DQU60djN.js";import{t as C}from"./use-create-conversation-4iJytCT1.js";import{f as w,i as T,l as E,m as D,o as O,t as k,u as A}from"./install-server-modal--lZ1HSHB.js";import{n as j}from"./skill-card-pill-row-BXILn-GK.js";var M=e(t(),1);function N(e,t){let n=o(t);return F({filters:{...e,status:`pending`}},n).length}function P(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function F(e={},t){let i=o(t).getMutationCache(),a=M.useRef(e),s=M.useRef(null);return s.current===null&&(s.current=P(i,e)),M.useEffect(()=>{a.current=e}),M.useSyncExternalStore(M.useCallback(e=>i.subscribe(()=>{let t=n(s.current,P(i,a.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var I=()=>{let e=g(),t=N({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},L=[{id:`github-pr-reviewer`,name:`GitHub PR review copilot`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`Create an automation that reviews GitHub pull requests when they are opened or updated. Use the GitHub MCP to inspect the PR diff, changed files, tests, and existing discussion. Post a short review that highlights correctness risks, security issues, missing tests, and concrete next steps. Ask me for the repositories, filters, review tone, and whether comments should be posted automatically or drafted first.`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{b as n,c as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js";import{o as i,t as a}from"./declaration-IA661TBv.js";import{n as o}from"./QueryClientProvider-7oLZ1RtQ.js";import{t as s}from"./useTranslation-CbJtty1g.js";import{r as c}from"./vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js";import{a as l,i as u,o as d,r as f,t as p}from"./circle-plus-check-toggle-CboDp7XB.js";import{t as m}from"./utils-CVcuFUYj.js";import{n as h}from"./active-backend-context-CQTk4wD8.js";import{n as g}from"./navigation-context-CszaA-CJ.js";import{t as _}from"./conversation-store-CiYGBud3.js";import{a as v,o as y}from"./conversation-local-storage-D5Tre_GA.js";import{i as b,r as x}from"./use-settings-0qFqC-r6.js";import{t as S}from"./use-tracking-CjLZgh8X.js";import{t as C}from"./use-create-conversation-CzvaVA5A.js";import{f as w,i as T,l as E,m as D,o as O,t as k,u as A}from"./install-server-modal-BjEzlLF5.js";import{n as j}from"./skill-card-pill-row-Bg5joQf6.js";var M=e(t(),1);function N(e,t){let n=o(t);return F({filters:{...e,status:`pending`}},n).length}function P(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function F(e={},t){let i=o(t).getMutationCache(),a=M.useRef(e),s=M.useRef(null);return s.current===null&&(s.current=P(i,e)),M.useEffect(()=>{a.current=e}),M.useSyncExternalStore(M.useCallback(e=>i.subscribe(()=>{let t=n(s.current,P(i,a.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var I=()=>{let e=g(),t=N({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},L=[{id:`github-pr-reviewer`,name:`GitHub PR review copilot`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
2
2
  Required MCP: GitHub
3
3
 
4
4
  1. Read repository, pull_request, and sender from the event payload.
5
5
  2. Fetch the PR diff and related comments through the GitHub MCP.
6
6
  3. Run a review rubric focused on bugs, security, tests, and maintainability.
7
7
  4. TODO: decide whether to publish inline comments, a summary comment, or a draft artifact.
8
- 5. Post or save the review with links back to the exact files and lines.`},{id:`github-repo-monitor`,name:`GitHub repository monitor`,category:`Developer tools`,description:`Watch a repository for @OpenHands mentions in issues and PR comments, start a conversation, and post the agent's reply back to GitHub.`,requiredIntegrationIds:[`github`],popularityRank:98,estimatedSetupMinutes:5,prompt:`Set up a GitHub repository monitor automation that polls a repository for comments containing a trigger phrase (default: @OpenHands) and starts an OpenHands conversation in response, then posts the agent's reply back to GitHub. Walk me through the setup.`,exampleImplementation:`Trigger: cron, every minute (configurable)
8
+ 5. Post or save the review with links back to the exact files and lines.`},{id:`github-repo-monitor`,name:`GitHub repository monitor`,category:`Developer tools`,description:`Watch a repository for @OpenHands mentions in issues and PR comments, start a conversation, and post the agent's reply back to GitHub.`,requiredIntegrationIds:[`github`],popularityRank:98,estimatedSetupMinutes:5,prompt:`/github-monitor:poll`,exampleImplementation:`Trigger: cron, every minute (configurable)
9
9
  Required secret: GITHUB_TOKEN
10
10
 
11
11
  1. Poll GitHub for new issue and PR comments since the last run.
12
12
  2. Match comments containing the trigger phrase (case-insensitive, default: @OpenHands).
13
13
  3. Post an acknowledgment comment with a link to the new OpenHands conversation.
14
14
  4. Forward follow-up replies in the same thread to the running conversation.
15
- 5. Post the agent's final response back to GitHub when the conversation completes.`},{id:`slack-standup-digest`,name:`Slack standup digest`,category:`Team updates`,description:`Summarize yesterday’s Slack activity into an async standup note with blockers, decisions, and owners.`,requiredIntegrationIds:[`slack`],popularityRank:94,estimatedSetupMinutes:5,prompt:`Create an automation that generates an async standup digest from Slack. Use the Slack MCP to search selected channels since the previous workday, group updates by project, call out blockers and decisions, and draft a message for a target channel. Ask me which channels to watch, what time to run, what timezone to use, and whether the digest should post automatically or wait for approval.`,exampleImplementation:`Trigger: cron, weekday mornings
15
+ 5. Post the agent's final response back to GitHub when the conversation completes.`},{id:`slack-standup-digest`,name:`Slack standup digest`,category:`Team updates`,description:`Summarize yesterday’s Slack activity into an async standup note with blockers, decisions, and owners.`,requiredIntegrationIds:[`slack`],popularityRank:94,estimatedSetupMinutes:5,prompt:`/standup-digest:setup`,exampleImplementation:`Trigger: cron, weekday mornings
16
16
  Required MCP: Slack
17
17
 
18
18
  1. Search configured channels for messages since the last digest window.
19
19
  2. Cluster updates into shipped work, active work, blockers, and decisions.
20
20
  3. TODO: choose a safe allowlist for channels and whether DMs are excluded.
21
21
  4. Draft a Slack message with owners, links, and unanswered questions.
22
- 5. Optionally post to the configured standup channel.`},{id:`slack-channel-monitor`,name:`Slack channel monitor`,category:`Team communication`,description:`Watch Slack channels for @openhands mentions, open a conversation with the message context, and reply in the thread when the agent finishes.`,requiredIntegrationIds:[`slack`],popularityRank:92,estimatedSetupMinutes:7,prompt:`Set up a Slack channel monitor automation that polls Slack channels for messages containing a trigger phrase (default: @openhands) and starts an OpenHands conversation in response, then posts the agent's reply back to the Slack thread. Walk me through the setup — ask me which channels to monitor and what trigger phrase to use.`,exampleImplementation:`Trigger: cron, every minute
22
+ 5. Optionally post to the configured standup channel.`},{id:`slack-channel-monitor`,name:`Slack channel monitor`,category:`Team communication`,description:`Watch Slack channels for @openhands mentions, open a conversation with the message context, and reply in the thread when the agent finishes.`,requiredIntegrationIds:[`slack`],popularityRank:92,estimatedSetupMinutes:7,prompt:`/slack-monitor:poll`,exampleImplementation:`Trigger: cron, every minute
23
23
  Required secret: SLACK_BOT_TOKEN or SLACK_USER_TOKEN
24
24
 
25
25
  1. Poll up to 10 configured Slack channels for new messages since the last run.
26
26
  2. Match messages containing the trigger phrase (default: @openhands).
27
27
  3. React with 👀 and start an OpenHands conversation with the message and recent channel context.
28
28
  4. Post a thread reply with a link to the conversation.
29
- 5. Forward subsequent thread replies to the running conversation and post the agent's response when done.`},{id:`linear-triage-assistant`,name:`Linear issue triage assistant`,category:`Project management`,description:`Classify new Linear issues, suggest labels, find duplicates, and ask clarifying questions.`,requiredIntegrationIds:[`linear`],popularityRank:90,estimatedSetupMinutes:3,prompt:`Create an automation that triages new Linear issues. Use the Linear MCP to inspect the issue title, description, team, customer, priority, and recent related issues. Suggest labels, priority, likely owner, duplicates, and a clarifying comment. Ask me which teams/projects to include and whether updates should be applied directly or presented for approval.`,exampleImplementation:`Trigger: linear Issue create
29
+ 5. Forward subsequent thread replies to the running conversation and post the agent's response when done.`},{id:`linear-triage-assistant`,name:`Linear issue triage assistant`,category:`Project management`,description:`Classify new Linear issues, suggest labels, find duplicates, and ask clarifying questions.`,requiredIntegrationIds:[`linear`],popularityRank:90,estimatedSetupMinutes:3,prompt:`/linear-triage:setup`,exampleImplementation:`Trigger: linear Issue create
30
30
  Required MCP: Linear
31
31
 
32
32
  1. Load the new issue, team context, project, labels, and recent similar issues.
33
33
  2. Score priority and classify the request as bug, feature, support, or chore.
34
34
  3. TODO: map local team labels and priority conventions.
35
35
  4. Add a triage comment with rationale and suggested next actions.
36
- 5. Optionally update labels, priority, and assignee.`},{id:`research-brief-writer`,name:`Research brief writer`,category:`Research`,description:`Monitor a topic, gather sources from the web, and publish a short brief for your team.`,requiredIntegrationIds:[`tavily`,`notion`],popularityRank:84,estimatedSetupMinutes:7,prompt:`Create an automation that writes a recurring research brief. Use Tavily MCP for web research and Notion MCP to publish the final brief. Ask me for the topic, source quality rules, cadence, Notion destination, citation style, and any competitors or keywords to track.`,exampleImplementation:`Trigger: cron, weekly or daily
36
+ 5. Optionally update labels, priority, and assignee.`},{id:`research-brief-writer`,name:`Research brief writer`,category:`Research`,description:`Monitor a topic, gather sources from the web, and publish a short brief for your team.`,requiredIntegrationIds:[`tavily`,`notion`],popularityRank:84,estimatedSetupMinutes:7,prompt:`/research-brief:setup`,exampleImplementation:`Trigger: cron, weekly or daily
37
37
  Required MCPs: Tavily, Notion
38
38
 
39
39
  1. Run focused Tavily searches for configured topics and competitors.
40
40
  2. Deduplicate sources and rank them by freshness and authority.
41
41
  3. TODO: confirm citation format and destination Notion database schema.
42
42
  4. Write an executive summary, implications, and recommended actions.
43
- 5. Create or update a Notion page with citations and source links.`},{id:`incident-retrospective-drafter`,name:`Incident retrospective drafter`,category:`Reliability`,description:`Collect incident chatter and issue updates, then draft a timeline and follow-up checklist.`,requiredIntegrationIds:[`slack`,`linear`,`notion`],popularityRank:78,estimatedSetupMinutes:8,prompt:`Create an automation that drafts incident retrospectives. Use Slack MCP to gather incident-channel messages, Linear MCP to collect linked tickets and follow-ups, and Notion MCP to publish a retrospective draft. Ask me how incidents are identified, which channels and Linear teams to inspect, and the desired retrospective template.`,exampleImplementation:`Trigger: manual, cron, or incident label added
43
+ 5. Create or update a Notion page with citations and source links.`},{id:`incident-retrospective-drafter`,name:`Incident retrospective drafter`,category:`Reliability`,description:`Collect incident chatter and issue updates, then draft a timeline and follow-up checklist.`,requiredIntegrationIds:[`slack`,`linear`,`notion`],popularityRank:78,estimatedSetupMinutes:8,prompt:`/incident-retro:setup`,exampleImplementation:`Trigger: manual, cron, or incident label added
44
44
  Required MCPs: Slack, Linear, Notion
45
45
 
46
46
  1. Gather incident messages, timestamps, and linked issue references.
47
47
  2. Pull Linear follow-up tickets, owners, and status.
48
48
  3. TODO: define the incident identifier format and approved Notion template.
49
49
  4. Build a timeline, impact summary, root-cause hypotheses, and action items.
50
- 5. Publish a draft retrospective and notify the incident owner.`}],R=i(),z=`inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`;function B(e){return e.slice(0,4)}function V({entries:e,className:t,testId:n}){let r=B(e);if(r.length===0)return(0,R.jsx)(T,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,R.jsx)(T,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:m(z,`items-center justify-center`,t),children:(0,R.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,R.jsx)(T,{entry:e,size:`sm`,className:`ring-2 ring-surface-raised`},e.id))})});let i=[r[0]??null,r[1]??null,r[2]??null,r[3]??null];return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:m(z,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,R.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,R.jsx)(T,{entry:e,size:`xs`})},e.id):(0,R.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function H({count:e}){return(0,R.jsx)(`span`,{className:`ml-2 inline-flex items-center justify-center rounded-full bg-surface-raised px-2 py-0.5 text-xs text-foreground`,children:e})}function U(e){return e.map((e,t)=>({automation:e,index:t})).sort((e,t)=>(t.automation.popularityRank??0)-(e.automation.popularityRank??0)||e.index-t.index).map(({automation:e})=>e)}var W=U(L);function G(e){let t=A(c);return e.requiredIntegrationIds.map(e=>E(e,t)).filter(e=>!!e)}function K(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,e.prompt,...t.map(e=>e.name),...t.flatMap(e=>e.keywords??[])].join(` `).toLowerCase().includes(r):!0}function q(e,t){return G(e).every(e=>w(e,t))}function J(e,t,n,r){let i=e.map(e=>{let n=!!O(e,t);return{id:`mcp-${e.id}`,node:(0,R.jsxs)(`span`,{className:m(d,`gap-1`),children:[(0,R.jsx)(T,{entry:e,size:`xs`}),e.name,n?(0,R.jsx)(`span`,{className:`text-white`,children:r(a.RECOMMENDED_AUTOMATIONS$CONNECTED)}):null]})}});return n>0&&i.push({id:`missing-connect`,node:(0,R.jsx)(`span`,{className:d,children:r(a.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:n})})}),i}function Y({backendKind:e,installedServers:t,query:n=``,onSelect:r,scrollableGrid:i=!1}){let{t:o}=s(`openhands`),c=W.filter(t=>{let r=G(t);return q(t,e)&&K(t,r,n)});return c.length===0?null:(0,R.jsx)(`section`,{"data-testid":`recommended-automations-section`,className:m(i&&`flex min-h-0 flex-1 flex-col`),children:(0,R.jsxs)(`div`,{"data-testid":i?`recommended-automations-scroll-area`:void 0,className:m(`mt-3`,u,i&&`min-h-0 flex-1 overflow-y-auto custom-scrollbar-always`),children:[(0,R.jsxs)(`div`,{className:`flex items-center`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:o(a.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,R.jsx)(H,{count:c.length})]}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:o(a.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,R.jsx)(`div`,{className:m(`mt-3`,f),children:c.map(e=>{let n=G(e),i=n.filter(e=>!O(e,t)).length;return(0,R.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>r(e),className:m(`flex min-w-0 overflow-hidden p-4 text-left rounded-xl bg-surface-raised`,l),children:(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,R.jsx)(V,{entries:n,testId:`recommended-automation-icon-${e.id}`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,R.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,R.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,R.jsx)(p,{testId:`recommended-automation-plus-${e.id}`})]}),(0,R.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,R.jsx)(j,{pills:J(n,t,i,o),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})]})})}function X(e){let t=A(c);return e.requiredIntegrationIds.map(e=>E(e,t)).filter(e=>!!e)}function Z(e){return e.replace(/\/+$/,``)}function Q(e,t,n){return t===`cloud`?[e,``,`---`,`**Which API to use:** Create this automation using the active OpenHands Cloud Automations API.`,`- Endpoint: \`${n?`POST ${Z(n)}/api/automation/v1/preset/prompt`:`POST /api/automation/v1/preset/prompt on the active OpenHands Cloud backend`}\``,"- Auth: `Authorization: Bearer $OPENHANDS_API_KEY`"].join(`
51
- `):[e,``,`---`,`**Which API to use:** Create this automation using the **local** OpenHands Automations API that is running alongside this agent.`,"- Read the Automation backend URL from the `<RUNTIME_SERVICES>` block in your system context.","- Endpoint path: `POST /api/automation/v1/preset/prompt`","- Auth: `X-Session-API-Key: $OPENHANDS_AUTOMATION_API_KEY`","- If no local Automation backend is listed in `<RUNTIME_SERVICES>`, stop and ask me to start the full local automation stack instead of using any remote/cloud automation API."].join(`
52
- `)}function $({query:e,onLaunched:t,scrollableGrid:n=!1}){let r=h(),{navigate:i}=g(),{data:a}=x(),{trackPrebuiltAutomationEnabled:o}=S(),s=C(),c=I(),l=y(e=>e.setMessageToSend),[u,d]=(0,M.useState)(null),[f,p]=(0,M.useState)([]),m=(0,M.useRef)(!1),w=(0,M.useRef)(!1),T=(0,M.useMemo)(()=>D(b(a?.agent_settings?.mcp_config)),[a?.agent_settings?.mcp_config]),E=(0,M.useCallback)(e=>{if(w.current||s.isPending||c)return;w.current=!0;let n=Q(e.prompt,r.backend.kind,r.backend.host);s.mutate({},{onSuccess:r=>{o({automationName:e.name,automationCategory:e.category}),r.conversation_id.startsWith(`task-`)&&r.task_id?v(r.task_id,n):_(r.conversation_id,{draftMessage:n}),t?.(),i?.(`/conversations/${r.conversation_id}`),window.setTimeout(()=>l(n),0)},onError:()=>{w.current=!1}})},[r.backend.kind,s,c,i,t,l,o]),A=(0,M.useCallback)(e=>X(e).filter(e=>!O(e,T)),[T]),j=e=>{if(w.current||s.isPending||c||f.length>0)return;let t=A(e);if(t.length===0){E(e);return}d(e),p(t)},N=()=>{if(m.current){m.current=!1;return}d(null),p([])},P=()=>{m.current=!0,p(e=>{let t=e.slice(1);if(t.length===0){let e=u;window.setTimeout(()=>{d(null),e&&E(e)},0)}return t})},F=f[0]??null;return r.backend.kind===`cloud`?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{backendKind:r.backend.kind,installedServers:T,query:e,onSelect:j,scrollableGrid:n}),F&&(0,R.jsx)(k,{entry:F,onClose:N,onSuccess:P},F.id)]})}export{H as n,I as r,$ as t};
50
+ 5. Publish a draft retrospective and notify the incident owner.`}],R=i(),z=`inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`;function B(e){return e.slice(0,4)}function V({entries:e,className:t,testId:n}){let r=B(e);if(r.length===0)return(0,R.jsx)(T,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,R.jsx)(T,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:m(z,`items-center justify-center`,t),children:(0,R.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,R.jsx)(T,{entry:e,size:`sm`,className:`ring-2 ring-surface-raised`},e.id))})});let i=[r[0]??null,r[1]??null,r[2]??null,r[3]??null];return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:m(z,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,R.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,R.jsx)(T,{entry:e,size:`xs`})},e.id):(0,R.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function H({count:e}){return(0,R.jsx)(`span`,{className:`ml-2 inline-flex items-center justify-center rounded-full bg-surface-raised px-2 py-0.5 text-xs text-foreground`,children:e})}function U(e){return e.map((e,t)=>({automation:e,index:t})).sort((e,t)=>(t.automation.popularityRank??0)-(e.automation.popularityRank??0)||e.index-t.index).map(({automation:e})=>e)}var W=U(L);function G(e){let t=A(c);return e.requiredIntegrationIds.map(e=>E(e,t)).filter(e=>!!e)}function K(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,e.prompt,...t.map(e=>e.name),...t.flatMap(e=>e.keywords??[])].join(` `).toLowerCase().includes(r):!0}function q(e,t){return G(e).every(e=>w(e,t))}function J(e,t,n,r){let i=e.map(e=>{let n=!!O(e,t);return{id:`mcp-${e.id}`,node:(0,R.jsxs)(`span`,{className:m(d,`gap-1`),children:[(0,R.jsx)(T,{entry:e,size:`xs`}),e.name,n?(0,R.jsx)(`span`,{className:`text-white`,children:r(a.RECOMMENDED_AUTOMATIONS$CONNECTED)}):null]})}});return n>0&&i.push({id:`missing-connect`,node:(0,R.jsx)(`span`,{className:d,children:r(a.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:n})})}),i}function Y({backendKind:e,installedServers:t,query:n=``,onSelect:r,scrollableGrid:i=!1}){let{t:o}=s(`openhands`),c=W.filter(t=>{let r=G(t);return q(t,e)&&K(t,r,n)});return c.length===0?null:(0,R.jsx)(`section`,{"data-testid":`recommended-automations-section`,className:m(i&&`flex min-h-0 flex-1 flex-col`),children:(0,R.jsxs)(`div`,{"data-testid":i?`recommended-automations-scroll-area`:void 0,className:m(`mt-3`,u,i&&`min-h-0 flex-1 overflow-y-auto custom-scrollbar-always`),children:[(0,R.jsxs)(`div`,{className:`flex items-center`,children:[(0,R.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:o(a.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,R.jsx)(H,{count:c.length})]}),(0,R.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:o(a.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,R.jsx)(`div`,{className:m(`mt-3`,f),children:c.map(e=>{let n=G(e),i=n.filter(e=>!O(e,t)).length;return(0,R.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>r(e),className:m(`flex min-w-0 overflow-hidden p-4 text-left rounded-xl bg-surface-raised`,l),children:(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,R.jsx)(V,{entries:n,testId:`recommended-automation-icon-${e.id}`}),(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,R.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,R.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,R.jsx)(p,{testId:`recommended-automation-plus-${e.id}`})]}),(0,R.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,R.jsx)(j,{pills:J(n,t,i,o),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})]})})}function X(e){let t=A(c);return e.requiredIntegrationIds.map(e=>E(e,t)).filter(e=>!!e)}function Z(e){return e}function Q({query:e,onLaunched:t,scrollableGrid:n=!1}){let r=h(),{navigate:i}=g(),{data:a}=x(),{trackPrebuiltAutomationEnabled:o}=S(),s=C(),c=I(),l=_(e=>e.setMessageToSend),[u,d]=(0,M.useState)(null),[f,p]=(0,M.useState)([]),m=(0,M.useRef)(!1),w=(0,M.useRef)(!1),T=(0,M.useMemo)(()=>D(b(a?.agent_settings?.mcp_config)),[a?.agent_settings?.mcp_config]),E=(0,M.useCallback)(e=>{if(w.current||s.isPending||c)return;w.current=!0;let n=Z(e.prompt);s.mutate({},{onSuccess:r=>{o({automationName:e.name,automationCategory:e.category}),r.conversation_id.startsWith(`task-`)&&r.task_id?y(r.task_id,n):v(r.conversation_id,{draftMessage:n}),t?.(),i?.(`/conversations/${r.conversation_id}`),window.setTimeout(()=>l(n),0)},onError:()=>{w.current=!1}})},[r.backend.kind,s,c,i,t,l,o]),A=(0,M.useCallback)(e=>X(e).filter(e=>!O(e,T)),[T]),j=e=>{if(w.current||s.isPending||c||f.length>0)return;let t=A(e);if(t.length===0){E(e);return}d(e),p(t)},N=()=>{if(m.current){m.current=!1;return}d(null),p([])},P=()=>{m.current=!0,p(e=>{let t=e.slice(1);if(t.length===0){let e=u;window.setTimeout(()=>{d(null),e&&E(e)},0)}return t})},F=f[0]??null;return r.backend.kind===`cloud`?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{backendKind:r.backend.kind,installedServers:T,query:e,onSelect:j,scrollableGrid:n}),F&&(0,R.jsx)(k,{entry:F,onClose:N,onSuccess:P},F.id)]})}export{H as n,I as r,Q as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-sH7l5NgI.js","assets/rolldown-runtime-BFRubm34.js","assets/server-client-Cz8PyIbN.js","assets/settings-client-BUlG0Gzq.js","assets/useQuery-JDs8UaWj.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js","assets/suspense-C9MBE_9N.js","assets/declaration-IA661TBv.js","assets/react-CM_dJw1Z.js","assets/QueryClientProvider-7oLZ1RtQ.js","assets/pencil-COslZGUC.js","assets/createLucideIcon-C9OEnwvX.js","assets/plus-D8aJZRkD.js","assets/trash-2-DAKXV2Wm.js","assets/useTranslation-CbJtty1g.js","assets/context-BBqptpXX.js","assets/agent-server-client-options-Dvgeb3x4.js","assets/backend-form-modal-B6q897ZX.js","assets/organization-service.api-D79cdERN.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js","assets/proxy-wIasY2Po.js","assets/agent-server-compatibility-BANjmMTo.js","assets/health-store-d-d2ssv4.js","assets/brand-button-BoiPxAGm.js","assets/utils-CVcuFUYj.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js","assets/common-Cfviy7yT.js","assets/settings-input-CPr7vX81.js","assets/modal-backdrop-B1si6TUd.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-2Po2nl1e.js","assets/modal-close-button-BCvw9IUN.js","assets/navigation-context-CszaA-CJ.js","assets/active-backend-context-CQTk4wD8.js","assets/modal-classes-9XTtWCtF.js","assets/confirmation-modal-C_lds1Tb.js","assets/api-key-entry-screen-Di1vHgIU.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{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as l,t as u}from"./declaration-IA661TBv.js";import{t as d}from"./useTranslation-CbJtty1g.js";import{r as f}from"./providers-Bpq3xFRA.js";import{i as p,t as m}from"./custom-toast-handlers-fgD4IYsu.js";import{E as h,u as g}from"./agent-server-client-options-Dvgeb3x4.js";import{r as _,t as v}from"./agent-server-compatibility-BANjmMTo.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./telemetry-DCrd7gnV.js";import{t as T}from"./modal-backdrop-B1si6TUd.js";import{n as E}from"./modal-body-2Po2nl1e.js";import{n as D,r as O}from"./base-modal-Ba5WcNb6.js";import{t as k}from"./brand-button-BoiPxAGm.js";import{t as A}from"./loading-spinner-CFuA0UNt.js";import{t as j}from"./use-config-DSzkljTq.js";import{i as M,n as N}from"./color-themes-B9n7pBQl.js";var P=e(t(),1);function F(){let[e,t]=(0,P.useState)(()=>x()),n=(0,P.useRef)(!1);(0,P.useEffect)(()=>{n.current||(n.current=!0,y())},[]),(0,P.useEffect)(()=>{e===`granted`&&S()},[e]);let r=(0,P.useCallback)(async()=>{await C(`granted`),t(`granted`)},[]),i=(0,P.useCallback)(async()=>{await C(`denied`),t(`denied`)},[]),a=(0,P.useCallback)((t,n)=>{e===`granted`&&b(t,n)},[e]),o=(0,P.useCallback)(()=>{w(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var I=l();function L({onChoice:e}){let{t,ready:n}=d(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=F(),[o,s]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,I.jsx)(T,{"aria-label":t(u.TELEMETRY$CONSENT_TITLE),children:(0,I.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,I.jsxs)(E,{className:`border border-[var(--oh-border)]`,children:[(0,I.jsx)(O,{title:t(u.TELEMETRY$CONSENT_TITLE)}),(0,I.jsx)(D,{children:t(u.TELEMETRY$CONSENT_DESCRIPTION)}),(0,I.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,I.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(u.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,I.jsx)(k,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(u.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function R(){return P.useEffect(()=>{N(M())},[]),null}var z=P.lazy(()=>n(()=>import(`./manage-backends-modal-sH7l5NgI.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__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]))),B=P.lazy(()=>n(()=>import(`./api-key-entry-screen-Di1vHgIU.js`),__vite__mapDeps([36,1,3,7,14,15,8,16,21,2,17,18,5,6,9,19,20,4,22,23,24,25,26,27,28,29,30,31,32,33,34])));function V({children:e}){return(0,I.jsxs)(`html`,{lang:`en`,children:[(0,I.jsxs)(`head`,{children:[(0,I.jsx)(`meta`,{charSet:`utf-8`}),(0,I.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,I.jsx)(i,{}),(0,I.jsx)(c,{})]}),(0,I.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,I.jsxs)(f,{contentClassName:`min-h-screen`,children:[(0,I.jsx)(R,{}),e,(0,I.jsx)(p,{toastOptions:m}),(0,I.jsx)(L,{}),(0,I.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,I.jsx)(s,{}),(0,I.jsx)(o,{})]})]})}function H(){return(0,I.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,I.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,I.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,I.jsx)(A,{size:`large`})})})})}function U(){let e=P.useCallback(()=>{},[]);return(0,I.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(z,{onClose:e})})})}var W=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],G=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],K=r(function(){let e=h(),t=!!g()?.apiKey,n=e&&!t,r=j({enabled:!n});return n||v(r.error)?(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(H,{}),children:(0,I.jsx)(B,{})}):r.isPending||r.isLoading?(0,I.jsx)(H,{}):_(r.error)?(0,I.jsx)(U,{}):(0,I.jsx)(a,{})});export{V as Layout,K as default,W as links,G as meta};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-CTA-2x4F.js","assets/rolldown-runtime-BFRubm34.js","assets/server-client-Cz8PyIbN.js","assets/settings-client-BUlG0Gzq.js","assets/useQuery-JDs8UaWj.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js","assets/suspense-C9MBE_9N.js","assets/declaration-IA661TBv.js","assets/react-CM_dJw1Z.js","assets/QueryClientProvider-7oLZ1RtQ.js","assets/pencil-COslZGUC.js","assets/createLucideIcon-C9OEnwvX.js","assets/plus-D8aJZRkD.js","assets/trash-2-DAKXV2Wm.js","assets/useTranslation-CbJtty1g.js","assets/context-BBqptpXX.js","assets/agent-server-client-options-Dvgeb3x4.js","assets/backend-form-modal-BUy-PzZN.js","assets/organization-service.api-D79cdERN.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js","assets/proxy-wIasY2Po.js","assets/agent-server-compatibility-BANjmMTo.js","assets/health-store-d-d2ssv4.js","assets/brand-button-BoiPxAGm.js","assets/utils-CVcuFUYj.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js","assets/common-Cfviy7yT.js","assets/settings-input-DsoZj8Dm.js","assets/modal-backdrop-B1si6TUd.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-2Po2nl1e.js","assets/modal-close-button-DY-rVmld.js","assets/navigation-context-CszaA-CJ.js","assets/active-backend-context-CQTk4wD8.js","assets/modal-classes-9XTtWCtF.js","assets/confirmation-modal-BPgWqWRI.js","assets/api-key-entry-screen-CGyS-Cna.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{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as l,t as u}from"./declaration-IA661TBv.js";import{t as d}from"./useTranslation-CbJtty1g.js";import{r as f}from"./providers-Bpq3xFRA.js";import{i as p,t as m}from"./custom-toast-handlers-fgD4IYsu.js";import{E as h,u as g}from"./agent-server-client-options-Dvgeb3x4.js";import{r as _,t as v}from"./agent-server-compatibility-BANjmMTo.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./telemetry-j9SLrtY7.js";import{t as T}from"./modal-backdrop-B1si6TUd.js";import{n as E}from"./modal-body-2Po2nl1e.js";import{n as D,r as O}from"./base-modal-Ba5WcNb6.js";import{t as k}from"./brand-button-BoiPxAGm.js";import{t as A}from"./loading-spinner-CFuA0UNt.js";import{t as j}from"./use-config-DSzkljTq.js";import{i as M,n as N}from"./color-themes-B9n7pBQl.js";var P=e(t(),1);function F(){let[e,t]=(0,P.useState)(()=>x()),n=(0,P.useRef)(!1);(0,P.useEffect)(()=>{n.current||(n.current=!0,y())},[]),(0,P.useEffect)(()=>{e===`granted`&&S()},[e]);let r=(0,P.useCallback)(async()=>{await C(`granted`),t(`granted`)},[]),i=(0,P.useCallback)(async()=>{await C(`denied`),t(`denied`)},[]),a=(0,P.useCallback)((t,n)=>{e===`granted`&&b(t,n)},[e]),o=(0,P.useCallback)(()=>{w(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var I=l();function L({onChoice:e}){let{t,ready:n}=d(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=F(),[o,s]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,I.jsx)(T,{"aria-label":t(u.TELEMETRY$CONSENT_TITLE),children:(0,I.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,I.jsxs)(E,{className:`border border-[var(--oh-border)]`,children:[(0,I.jsx)(O,{title:t(u.TELEMETRY$CONSENT_TITLE)}),(0,I.jsx)(D,{children:t(u.TELEMETRY$CONSENT_DESCRIPTION)}),(0,I.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,I.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(u.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,I.jsx)(k,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(u.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function R(){return P.useEffect(()=>{N(M())},[]),null}var z=P.lazy(()=>n(()=>import(`./manage-backends-modal-CTA-2x4F.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__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]))),B=P.lazy(()=>n(()=>import(`./api-key-entry-screen-CGyS-Cna.js`),__vite__mapDeps([36,1,3,7,14,15,8,16,21,2,17,18,5,6,9,19,20,4,22,23,24,25,26,27,28,29,30,31,32,33,34])));function V({children:e}){return(0,I.jsxs)(`html`,{lang:`en`,children:[(0,I.jsxs)(`head`,{children:[(0,I.jsx)(`meta`,{charSet:`utf-8`}),(0,I.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,I.jsx)(i,{}),(0,I.jsx)(c,{})]}),(0,I.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,I.jsxs)(f,{contentClassName:`min-h-screen`,children:[(0,I.jsx)(R,{}),e,(0,I.jsx)(p,{toastOptions:m}),(0,I.jsx)(L,{}),(0,I.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,I.jsx)(s,{}),(0,I.jsx)(o,{})]})]})}function H(){return(0,I.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,I.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,I.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,I.jsx)(A,{size:`large`})})})})}function U(){let e=P.useCallback(()=>{},[]);return(0,I.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,I.jsx)(P.Suspense,{fallback:null,children:(0,I.jsx)(z,{onClose:e})})})}var W=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],G=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],K=r(function(){let e=h(),t=!!g()?.apiKey,n=e&&!t,r=j({enabled:!n});return n||v(r.error)?(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(H,{}),children:(0,I.jsx)(B,{})}):r.isPending||r.isLoading?(0,I.jsx)(H,{}):_(r.error)?(0,I.jsx)(U,{}):(0,I.jsx)(a,{})});export{V as Layout,K as default,W as links,G as meta};