@openhands/agent-canvas 1.0.0-beta.6 → 1.0.0-beta.7

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 (802) hide show
  1. package/README.md +24 -7
  2. package/README.windows.md +27 -0
  3. package/bin/agent-canvas.mjs +26 -3
  4. package/build/assets/{QueryClientProvider-CkGuhXg-.js → QueryClientProvider-Cnr-Yl3j.js} +1 -1
  5. package/build/assets/{Trans-Cvm_-SMi.js → Trans-4jmk54WC.js} +1 -1
  6. package/build/assets/acp-providers-CPdgcp13.js +1 -0
  7. package/build/assets/{acp-route-guard-B2yoBZ_4.js → acp-route-guard-BoVmCn0e.js} +1 -1
  8. package/build/assets/active-backend-context-Beu-LZL-.js +1 -0
  9. package/build/assets/add-backend-modal-BheqYXHK.js +1 -0
  10. package/build/assets/agent-server-client-options-HEOwGVIU.js +1 -0
  11. package/build/assets/agent-server-compatibility-CdI3N7dr.js +1 -0
  12. package/build/assets/agent-server-conversation-service.api-CORdqJZg.js +5 -0
  13. package/build/assets/{agent-settings-CnGSCmK8.js → agent-settings-UFvcGjoI.js} +1 -1
  14. package/build/assets/{alert-banner-DtzAX654.js → alert-banner-DFnn_lC6.js} +1 -1
  15. package/build/assets/{analytics-consent-form-modal-CHZ3I37v.js → analytics-consent-form-modal-CVNugqzu.js} +1 -1
  16. package/build/assets/api-key-entry-screen-M6su2VSf.js +1 -0
  17. package/build/assets/{app-settings-Db9ITeJH.js → app-settings-BlvBhBdc.js} +1 -1
  18. package/build/assets/automation-detail-BWrQk4Oa.js +1 -0
  19. package/build/assets/automations-list-ux9KvYsU.js +1 -0
  20. package/build/assets/back-nav-button-7dQJ2k3O.js +1 -0
  21. package/build/assets/backend-form-modal-CDnEYjaU.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-Dc6c7GT4.js → backend-synced-settings-badge-BTIj-Ffq.js} +1 -1
  23. package/build/assets/base-modal-C2oy2EBG.js +1 -0
  24. package/build/assets/brand-button-DJ_S16rO.js +1 -0
  25. package/build/assets/{browser-D810xUYt.js → browser-CGM-k-sH.js} +2 -2
  26. package/build/assets/browser-store-DAsixKdU.js +1 -0
  27. package/build/assets/{browser-tab-B-aIqXRl.js → browser-tab-dvSPdvkm.js} +1 -1
  28. package/build/assets/{checkmark-DL7acQA7.js → checkmark-Dus0b6jt.js} +1 -1
  29. package/build/assets/{chevron-left-small-CVWf8TI6.js → chevron-left-small-_uvG7RVM.js} +1 -1
  30. package/build/assets/{circle-plus-check-toggle-P7ZZToV4.js → circle-plus-check-toggle-DKS8MAVV.js} +1 -1
  31. package/build/assets/{close-B5LROHR3.js → close-BU5iTc66.js} +1 -1
  32. package/build/assets/code-tag-BzyqOtPD.js +1 -0
  33. package/build/assets/combobox-caret-BJC7XJsz.js +1 -0
  34. package/build/assets/{command-store-DFN_17p1.js → command-store-CE1weJy8.js} +1 -1
  35. package/build/assets/{condenser-settings-wnEKhBof.js → condenser-settings-BolbDvm5.js} +1 -1
  36. package/build/assets/{confirmation-modal-Dau3w_sa.js → confirmation-modal-B5Ca6qFE.js} +1 -1
  37. package/build/assets/context-menu-list-item-7tAcm2c3.js +1 -0
  38. package/build/assets/conversation-D0N4dw_p.js +19 -0
  39. package/build/assets/conversation-DhRJuZLG.js +1 -0
  40. package/build/assets/conversation-panel-CNqHbS_Z.js +1 -0
  41. package/build/assets/conversation-service.api-BsJy6uuL.js +1 -0
  42. package/build/assets/conversation-state-store-D-w0uurj.js +1 -0
  43. package/build/assets/conversation-store-CC-isCnP.js +1 -0
  44. package/build/assets/{conversation-tab-empty-state-DyssnnWa.js → conversation-tab-empty-state-CStQLPVW.js} +1 -1
  45. package/build/assets/conversation-websocket-context-DvHgx_FE.js +3 -0
  46. package/build/assets/{copy-DYgmUdIw.js → copy-Chg-sFu3.js} +1 -1
  47. package/build/assets/{custom-toast-handlers-C-SZFmto.js → custom-toast-handlers-ufGJ6_Rc.js} +1 -1
  48. package/build/assets/declaration-CR6HMp29.js +1 -0
  49. package/build/assets/{device-verify-DqDlphsG.js → device-verify-C6mj28zv.js} +1 -1
  50. package/build/assets/dist-DNeWJ2bh.js +1 -0
  51. package/build/assets/dropdown-classes-BsVmxlNG.js +1 -0
  52. package/build/assets/edit-automation-modal-BpX-t-HD.js +1 -0
  53. package/build/assets/ellipsis-button-Vh5MvRZa.js +1 -0
  54. package/build/assets/entry.client-Ck9rQCg-.js +2 -0
  55. package/build/assets/enum-filter-dropdown-5JeF2RLb.js +1 -0
  56. package/build/assets/{environment-switch-overlay-XL8yCGP6.js → environment-switch-overlay-Tf_BIfeR.js} +1 -1
  57. package/build/assets/extensions-hub-CE9QOb5n.js +1 -0
  58. package/build/assets/{extensions-navigation-BYR8Giqq.js → extensions-navigation-DSLGNGbS.js} +1 -1
  59. package/build/assets/file-BTY6Gyy9.js +1 -0
  60. package/build/assets/files-tab-cL668j1I.js +1 -0
  61. package/build/assets/files-tab-store-m0ARqX_E.js +1 -0
  62. package/build/assets/{folder-ZZJVGgd7.js → folder-D1T2W1cj.js} +1 -1
  63. package/build/assets/git-control-bar-branch-button-DtIrOrie.js +27 -0
  64. package/build/assets/git-provider-icon-CHdGBdU2.js +1 -0
  65. package/build/assets/globe-Bzj_0oXT.js +1 -0
  66. package/build/assets/home-Cz2Veg56.js +1 -0
  67. package/build/assets/{i18n-CTohRuoO.js → i18n-DET2iOyh.js} +1 -1
  68. package/build/assets/install-server-modal-B9nXCS3u.js +1 -0
  69. package/build/assets/launch-CWz0dm4o.js +1 -0
  70. package/build/assets/{lesson-plan-dH5Bj0pN.js → lesson-plan-duSsqWVs.js} +1 -1
  71. package/build/assets/link-external-DGxVm4Ps.js +1 -0
  72. package/build/assets/{llm-client-DaH1TuyR.js → llm-client-CYEaUjGx.js} +1 -1
  73. package/build/assets/llm-settings-DFkXHuvT.js +1 -0
  74. package/build/assets/llm-settings-DhrdCXqX.js +1 -0
  75. package/build/assets/{loading-spinner-BPtYORNK.js → loading-spinner-5GT9q1xy.js} +1 -1
  76. package/build/assets/manage-backends-modal-DpBD_vR9.js +1 -0
  77. package/build/assets/manage-workspaces-modal-CtRbxREx.js +1 -0
  78. package/build/assets/manifest-eed90ff5.js +1 -0
  79. package/build/assets/{markdown-renderer-DMzf2i4x.js → markdown-renderer-B3IAVfv4.js} +1 -1
  80. package/build/assets/mcp-BUe7kiYM.js +9 -0
  81. package/build/assets/messages-dqp_KYyl.js +36 -0
  82. package/build/assets/{modal-backdrop-BAbgYsqB.js → modal-backdrop-RfNCrSpK.js} +1 -1
  83. package/build/assets/{modal-body-BI6Ru2Qr.js → modal-body-aoa2fx5W.js} +1 -1
  84. package/build/assets/modal-classes-6YqcqA6y.js +1 -0
  85. package/build/assets/{modal-close-button-t1Gh3qmL.js → modal-close-button-CtWOUMmw.js} +1 -1
  86. package/build/assets/{model-selector-SM9IUz-q.js → model-selector-BvSTrkhT.js} +1 -1
  87. package/build/assets/{navigation-context-D0YWpT8d.js → navigation-context-BdKYH32C.js} +1 -1
  88. package/build/assets/{navigation-link-Cn7KP3c5.js → navigation-link-U4vY9i_C.js} +1 -1
  89. package/build/assets/{openhands-logo-CnrF6LKb.js → openhands-logo-CCo0wJZX.js} +1 -1
  90. package/build/assets/{option-service.api-KvY_mZMY.js → option-service.api-DmNVxAvS.js} +1 -1
  91. package/build/assets/{organization-service.api-DzYTHTYC.js → organization-service.api-DbnougaQ.js} +1 -1
  92. package/build/assets/{path-utils-C3bQf6lJ.js → path-utils-onx24uF5.js} +1 -1
  93. package/build/assets/{plan-components-atxXCF0R.js → plan-components-CRDMQzsS.js} +1 -1
  94. package/build/assets/{planner-tab-BlrCpv-7.js → planner-tab-CmIjLz7q.js} +1 -1
  95. package/build/assets/{profiles-client-D6IkTJof.js → profiles-client-fEmgWkCW.js} +1 -1
  96. package/build/assets/{providers-Bx6EfrzZ.js → providers-CbD7fiic.js} +1 -1
  97. package/build/assets/proxy-BAdHH8QB.js +1 -0
  98. package/build/assets/{query-client-config-B7u9asM0.js → query-client-config-CRnGSujB.js} +1 -1
  99. package/build/assets/{recommended-automations-launcher-CgV8FyPK.js → recommended-automations-launcher-uTyODuzB.js} +3 -3
  100. package/build/assets/{root-dNntxffj.js → root-DmjpFpTu.js} +2 -2
  101. package/build/assets/root-Z2VHU4R3.css +1 -0
  102. package/build/assets/root-layout-DejMsKhy.js +2 -0
  103. package/build/assets/{sdk-section-page-DOIKvwSL.js → sdk-section-page-BgDlMhcq.js} +1 -1
  104. package/build/assets/{sdk-settings-schema-DsUf9wu1.js → sdk-settings-schema-CLmJ9sho.js} +1 -1
  105. package/build/assets/{search-27Owlc3A.js → search-SuJctqNJ.js} +1 -1
  106. package/build/assets/secrets-service-B7CxNinp.js +1 -0
  107. package/build/assets/secrets-settings-yK7CqIpm.js +1 -0
  108. package/build/assets/{server-client-DyAQ3NZ_.js → server-client-Kh4QSwDJ.js} +1 -1
  109. package/build/assets/{settings-BYkVX7vW.js → settings-DN5PpgRD.js} +1 -1
  110. package/build/assets/{settings-dropdown-input-BJYvGdg-.js → settings-dropdown-input-BtoovFre.js} +1 -1
  111. package/build/assets/{settings-gear-C77PgE_O.js → settings-gear-Dd8K2_8B.js} +1 -1
  112. package/build/assets/settings-index-DKC8IY1P.js +1 -0
  113. package/build/assets/{settings-input-Bn7F5C75.js → settings-input-CehsXnb3.js} +1 -1
  114. package/build/assets/settings-list-classes-E3v_f6QG.js +1 -0
  115. package/build/assets/settings-modal-DJ4kGzUx.js +1 -0
  116. package/build/assets/{settings-section-header-context-BgZe5YkE.js → settings-section-header-context-DewwJ0-F.js} +1 -1
  117. package/build/assets/settings-service.api-C3rxTtPj.js +1 -0
  118. package/build/assets/{settings-switch-BeIKrWms.js → settings-switch-BiBuS3xa.js} +1 -1
  119. package/build/assets/{settings-utils-B6Nl07io.js → settings-utils-DY04tWG1.js} +1 -1
  120. package/build/assets/{shared-conversation-AMyqXvpk.js → shared-conversation-h9YnBtCU.js} +1 -1
  121. package/build/assets/sidebar-mobile-menu-toggle-D0-AvsnT.js +1 -0
  122. package/build/assets/{sidebar-nav-link-BGjiJq-4.js → sidebar-nav-link-OhIeFyna.js} +1 -1
  123. package/build/assets/{sidebar-store-Uy3v0AOV.js → sidebar-store-DnQAJAE5.js} +1 -1
  124. package/build/assets/{skill-card-pill-row-DF1axQCG.js → skill-card-pill-row-BW9qvhoK.js} +1 -1
  125. package/build/assets/{skills-ChIKZPK4.js → skills-0GRKX5Xj.js} +1 -1
  126. package/build/assets/{skills-plugins-CcI_19lM.js → skills-plugins-DNcsNF88.js} +1 -1
  127. package/build/assets/skills-settings-7liFiSY6.js +2 -0
  128. package/build/assets/{styled-tooltip-CBzrri6o.js → styled-tooltip-hdfMXPQC.js} +1 -1
  129. package/build/assets/{switch-skeleton-DnC9wLp7.js → switch-skeleton-DSKqSx2A.js} +1 -1
  130. package/build/assets/{task-list-tab-DUJn1sgz.js → task-list-tab-DT6_zfUs.js} +1 -1
  131. package/build/assets/{terminal-DgQk1Ay6.js → terminal-CDhQGDua.js} +2 -2
  132. package/build/assets/{terminal-RmuaSdhJ.js → terminal-CPYWdo4j.js} +1 -1
  133. package/build/assets/{toggle-switch-Pvyp2RAN.js → toggle-switch-T2v6sJ6l.js} +1 -1
  134. package/build/assets/{typography-gpuWmrQO.js → typography-BDgnT7Yp.js} +1 -1
  135. package/build/assets/{u-check-circle-IUIfACQQ.js → u-check-circle-DOauqQKb.js} +1 -1
  136. package/build/assets/{u-check-circle-half-C1YxB6py.js → u-check-circle-half-steSK_JB.js} +1 -1
  137. package/build/assets/{u-circuit-BmVikJHu.js → u-circuit-x3ExjBbU.js} +1 -1
  138. package/build/assets/{u-edit-CFvXHqZk.js → u-edit-BbrptMCa.js} +1 -1
  139. package/build/assets/{use-active-conversation-BEFNwnFk.js → use-active-conversation-DHGcmjCK.js} +1 -1
  140. package/build/assets/use-agent-settings-schema-CLoTOSJI.js +1 -0
  141. package/build/assets/{use-agent-state-Bkrd1FZq.js → use-agent-state-PKrUPMJ3.js} +1 -1
  142. package/build/assets/{use-cloud-current-user-id-CvkXFnTT.js → use-cloud-current-user-id-Ddr75hEz.js} +1 -1
  143. package/build/assets/{use-config-Co1O8-Ey.js → use-config-OIMQLQ2s.js} +1 -1
  144. package/build/assets/{use-create-conversation-CEgXpkfH.js → use-create-conversation-Bszyp13O.js} +1 -1
  145. package/build/assets/{use-event-store-BT_gV3ut.js → use-event-store-BomO7ywK.js} +1 -1
  146. package/build/assets/{use-get-secrets-DuhdIA59.js → use-get-secrets-8Jby8ele.js} +1 -1
  147. package/build/assets/{use-handle-plan-click-Ckkm5eIY.js → use-handle-plan-click-CohJPvvW.js} +1 -1
  148. package/build/assets/use-is-authed-dw2026rR.js +1 -0
  149. package/build/assets/{use-is-creating-conversation-BZ5hB_Bg.js → use-is-creating-conversation-DX2qSlfL.js} +1 -1
  150. package/build/assets/{use-launch-skill-in-chat-fNN_xGZG.js → use-launch-skill-in-chat-sQNEOLGD.js} +1 -1
  151. package/build/assets/use-llm-profiles-C861aFAq.js +1 -0
  152. package/build/assets/use-runtime-is-ready-Do2h_hRl.js +1 -0
  153. package/build/assets/{use-save-settings-VUrj_QNG.js → use-save-settings-DkAOEfD9.js} +1 -1
  154. package/build/assets/use-settings-D5hbTS9t.js +1 -0
  155. package/build/assets/{use-settings-nav-items-1ZvovKSr.js → use-settings-nav-items-BcSbo02d.js} +1 -1
  156. package/build/assets/{use-skills-DAMLFjKU.js → use-skills-D7PS0fH0.js} +1 -1
  157. package/build/assets/{use-task-list-CLJbuJgM.js → use-task-list-CsT10CBb.js} +1 -1
  158. package/build/assets/{use-unified-vscode-url-DdSRw-6P.js → use-unified-vscode-url-DEoe-NRI.js} +1 -1
  159. package/build/assets/use-user-conversation-Cs5H1pUF.js +1 -0
  160. package/build/assets/{useMutation-DqrumCWD.js → useMutation-GSSKKebK.js} +1 -1
  161. package/build/assets/{useTranslation-DCOdSSMl.js → useTranslation-B6voJV4y.js} +1 -1
  162. package/build/assets/utils-DCVfKFRt.js +1 -0
  163. package/build/assets/{vendor~browser-BNjNhjFU.js → vendor~browser-BrOJLj3y.js} +1 -1
  164. package/build/assets/vendor~conversation-panel~conversation-C9o-K1hW.js +1 -0
  165. package/build/assets/vendor~conversation-panel~conversation~index-RXYdJYxU.js +1 -0
  166. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js} +1 -1
  167. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DpAdkv8m.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-6ByzelMS.js} +1 -1
  168. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B92czPCF.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BED5W_c4.js} +1 -1
  169. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-By5W2oHN.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CCbqAFiI.js} +1 -1
  170. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BbFOrAjI.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CG96FCly.js} +1 -1
  171. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-smY2r837.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-E4d6IEfI.js} +1 -1
  172. package/build/assets/{vendor~home~mcp~automations-list-Cs-TO3fK.js → vendor~home~mcp~automations-list-CZSK-lT2.js} +1 -1
  173. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-Z3nsiNNq.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js} +1 -1
  174. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-DbfELDJu.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js} +2 -2
  175. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js → vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js} +1 -1
  176. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js +1 -0
  177. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js +9 -0
  178. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BkQGKpye.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js} +1 -1
  179. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-Bbs7UJ5U.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js} +2 -2
  180. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-hTzSytKK.js} +1 -1
  181. package/build/assets/{vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js → vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js} +1 -1
  182. package/build/assets/{verification-settings-CsbvQcYS.js → verification-settings-Dlt8pINd.js} +1 -1
  183. package/build/assets/{vscode-tab-DjNArCgY.js → vscode-tab-DgepcYtF.js} +1 -1
  184. package/build/assets/{waiting-for-runtime-message-CntjExbU.js → waiting-for-runtime-message-CdK3btDZ.js} +1 -1
  185. package/build/assets/{x-mark-CrpjscNc.js → x-mark-BrkSPIiT.js} +1 -1
  186. package/build/index.html +4 -4
  187. package/build/locales/ar/openhands.json +20 -2
  188. package/build/locales/ca/openhands.json +20 -2
  189. package/build/locales/de/openhands.json +20 -2
  190. package/build/locales/en/openhands.json +20 -2
  191. package/build/locales/es/openhands.json +20 -2
  192. package/build/locales/fr/openhands.json +20 -2
  193. package/build/locales/it/openhands.json +20 -2
  194. package/build/locales/ja/openhands.json +20 -2
  195. package/build/locales/ko-KR/openhands.json +20 -2
  196. package/build/locales/no/openhands.json +20 -2
  197. package/build/locales/pt/openhands.json +20 -2
  198. package/build/locales/tr/openhands.json +20 -2
  199. package/build/locales/uk/openhands.json +20 -2
  200. package/build/locales/zh-CN/openhands.json +20 -2
  201. package/build/locales/zh-TW/openhands.json +20 -2
  202. package/dist/api/acp-service/acp-service.api.d.ts +18 -0
  203. package/dist/api/agent-server-adapter.cjs +3 -3
  204. package/dist/api/agent-server-adapter.cjs.map +1 -1
  205. package/dist/api/agent-server-adapter.js +54 -55
  206. package/dist/api/agent-server-adapter.js.map +1 -1
  207. package/dist/api/agent-server-client-options.cjs +1 -1
  208. package/dist/api/agent-server-client-options.cjs.map +1 -1
  209. package/dist/api/agent-server-client-options.d.ts +4 -0
  210. package/dist/api/agent-server-client-options.js +18 -12
  211. package/dist/api/agent-server-client-options.js.map +1 -1
  212. package/dist/api/agent-server-compatibility.cjs +1 -1
  213. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  214. package/dist/api/agent-server-compatibility.d.ts +1 -1
  215. package/dist/api/agent-server-compatibility.js +30 -25
  216. package/dist/api/agent-server-compatibility.js.map +1 -1
  217. package/dist/api/agent-server-config.cjs +1 -1
  218. package/dist/api/agent-server-config.cjs.map +1 -1
  219. package/dist/api/agent-server-config.d.ts +1 -51
  220. package/dist/api/agent-server-config.js +20 -70
  221. package/dist/api/agent-server-config.js.map +1 -1
  222. package/dist/api/backend-registry/active-store.cjs +1 -1
  223. package/dist/api/backend-registry/active-store.cjs.map +1 -1
  224. package/dist/api/backend-registry/active-store.d.ts +11 -5
  225. package/dist/api/backend-registry/active-store.js +36 -27
  226. package/dist/api/backend-registry/active-store.js.map +1 -1
  227. package/dist/api/backend-registry/auth.cjs +1 -1
  228. package/dist/api/backend-registry/auth.cjs.map +1 -1
  229. package/dist/api/backend-registry/auth.js +3 -9
  230. package/dist/api/backend-registry/auth.js.map +1 -1
  231. package/dist/api/backend-registry/default-backend.cjs +1 -1
  232. package/dist/api/backend-registry/default-backend.cjs.map +1 -1
  233. package/dist/api/backend-registry/default-backend.d.ts +9 -16
  234. package/dist/api/backend-registry/default-backend.js +5 -4
  235. package/dist/api/backend-registry/default-backend.js.map +1 -1
  236. package/dist/api/backend-registry/storage.cjs +1 -1
  237. package/dist/api/backend-registry/storage.cjs.map +1 -1
  238. package/dist/api/backend-registry/storage.js +67 -34
  239. package/dist/api/backend-registry/storage.js.map +1 -1
  240. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  241. package/dist/api/cloud/conversation-service.api.d.ts +8 -13
  242. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  243. package/dist/api/cloud/organization-service.api.cjs.map +1 -1
  244. package/dist/api/cloud/organization-service.api.d.ts +1 -2
  245. package/dist/api/cloud/organization-service.api.js.map +1 -1
  246. package/dist/api/cloud/proxy.cjs +1 -1
  247. package/dist/api/cloud/proxy.cjs.map +1 -1
  248. package/dist/api/cloud/proxy.d.ts +6 -6
  249. package/dist/api/cloud/proxy.js +33 -24
  250. package/dist/api/cloud/proxy.js.map +1 -1
  251. package/dist/api/cloud/sandbox-service.api.cjs.map +1 -1
  252. package/dist/api/cloud/sandbox-service.api.d.ts +3 -3
  253. package/dist/api/cloud/sandbox-service.api.js.map +1 -1
  254. package/dist/api/cloud/secrets-service.api.cjs.map +1 -1
  255. package/dist/api/cloud/secrets-service.api.d.ts +3 -4
  256. package/dist/api/cloud/secrets-service.api.js.map +1 -1
  257. package/dist/api/cloud/settings-service.api.cjs +1 -1
  258. package/dist/api/cloud/settings-service.api.cjs.map +1 -1
  259. package/dist/api/cloud/settings-service.api.js +5 -1
  260. package/dist/api/cloud/settings-service.api.js.map +1 -1
  261. package/dist/api/cloud/skills-service.api.cjs.map +1 -1
  262. package/dist/api/cloud/skills-service.api.d.ts +5 -5
  263. package/dist/api/cloud/skills-service.api.js.map +1 -1
  264. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  265. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  266. package/dist/api/conversation-service/agent-server-conversation-service.api.js +115 -108
  267. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  268. package/dist/api/device-flow-client.cjs +1 -1
  269. package/dist/api/device-flow-client.cjs.map +1 -1
  270. package/dist/api/device-flow-client.d.ts +3 -5
  271. package/dist/api/device-flow-client.js +55 -66
  272. package/dist/api/device-flow-client.js.map +1 -1
  273. package/dist/api/event-service/event-service.api.cjs +1 -1
  274. package/dist/api/event-service/event-service.api.cjs.map +1 -1
  275. package/dist/api/event-service/event-service.api.d.ts +3 -3
  276. package/dist/api/event-service/event-service.api.js +17 -17
  277. package/dist/api/event-service/event-service.api.js.map +1 -1
  278. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  279. package/dist/api/git-service/agent-server-git-service.api.js +11 -11
  280. package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
  281. package/dist/api/runtime-service/agent-server-runtime-service.js +6 -6
  282. package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.cjs +2 -2
  283. package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.js +10 -10
  284. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.cjs.map +1 -1
  285. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.d.ts +5 -5
  286. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.js.map +1 -1
  287. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
  288. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  289. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +1 -1
  290. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  291. package/dist/components/features/automations/automation-action-button-classes.d.ts +2 -2
  292. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  293. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  294. package/dist/components/features/backends/backend-form-modal.d.ts +1 -0
  295. package/dist/components/features/backends/backend-form-modal.js +203 -140
  296. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  297. package/dist/components/features/backends/backend-selector.cjs +1 -1
  298. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  299. package/dist/components/features/backends/backend-selector.js +117 -105
  300. package/dist/components/features/backends/backend-selector.js.map +1 -1
  301. package/dist/components/features/backends/backend-status-dot.cjs +1 -1
  302. package/dist/components/features/backends/backend-status-dot.cjs.map +1 -1
  303. package/dist/components/features/backends/backend-status-dot.d.ts +1 -1
  304. package/dist/components/features/backends/backend-status-dot.js +1 -1
  305. package/dist/components/features/backends/backend-status-dot.js.map +1 -1
  306. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  307. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  308. package/dist/components/features/backends/manage-backends-modal.js +81 -70
  309. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  310. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  311. package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
  312. package/dist/components/features/chat/change-agent-button.js +59 -57
  313. package/dist/components/features/chat/change-agent-button.js.map +1 -1
  314. package/dist/components/features/chat/change-agent-context-menu.cjs +1 -1
  315. package/dist/components/features/chat/change-agent-context-menu.cjs.map +1 -1
  316. package/dist/components/features/chat/change-agent-context-menu.d.ts +3 -1
  317. package/dist/components/features/chat/change-agent-context-menu.js +30 -25
  318. package/dist/components/features/chat/change-agent-context-menu.js.map +1 -1
  319. package/dist/components/features/chat/chat-add-file-button.cjs +1 -1
  320. package/dist/components/features/chat/chat-add-file-button.cjs.map +1 -1
  321. package/dist/components/features/chat/chat-add-file-button.js +39 -38
  322. package/dist/components/features/chat/chat-add-file-button.js.map +1 -1
  323. package/dist/components/features/chat/chat-message.cjs +1 -1
  324. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  325. package/dist/components/features/chat/chat-message.d.ts +2 -1
  326. package/dist/components/features/chat/chat-message.js +185 -57
  327. package/dist/components/features/chat/chat-message.js.map +1 -1
  328. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  329. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  330. package/dist/components/features/chat/components/chat-input-actions.js +113 -113
  331. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  332. package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
  333. package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
  334. package/dist/components/features/chat/components/chat-input-model.js +52 -51
  335. package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
  336. package/dist/components/features/chat/components/slash-command-menu.cjs +2 -2
  337. package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
  338. package/dist/components/features/chat/components/slash-command-menu.js +38 -34
  339. package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
  340. package/dist/components/features/chat/git-control-bar-pr-button.cjs +1 -1
  341. package/dist/components/features/chat/git-control-bar-pr-button.cjs.map +1 -1
  342. package/dist/components/features/chat/git-control-bar-pr-button.js +16 -15
  343. package/dist/components/features/chat/git-control-bar-pr-button.js.map +1 -1
  344. package/dist/components/features/chat/git-control-bar-pull-button.cjs +1 -1
  345. package/dist/components/features/chat/git-control-bar-pull-button.cjs.map +1 -1
  346. package/dist/components/features/chat/git-control-bar-pull-button.js +16 -15
  347. package/dist/components/features/chat/git-control-bar-pull-button.js.map +1 -1
  348. package/dist/components/features/chat/git-control-bar-push-button.cjs +1 -1
  349. package/dist/components/features/chat/git-control-bar-push-button.cjs.map +1 -1
  350. package/dist/components/features/chat/git-control-bar-push-button.js +16 -15
  351. package/dist/components/features/chat/git-control-bar-push-button.js.map +1 -1
  352. package/dist/components/features/chat/git-control-bar.cjs +1 -1
  353. package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
  354. package/dist/components/features/chat/git-control-bar.js +63 -62
  355. package/dist/components/features/chat/git-control-bar.js.map +1 -1
  356. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  357. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  358. package/dist/components/features/chat/pending-user-messages.js +27 -23
  359. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  360. package/dist/components/features/chat/switch-profile-button.cjs +1 -1
  361. package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
  362. package/dist/components/features/chat/switch-profile-button.js +26 -25
  363. package/dist/components/features/chat/switch-profile-button.js.map +1 -1
  364. package/dist/components/features/chat/switch-profile-context-menu.cjs +1 -1
  365. package/dist/components/features/chat/switch-profile-context-menu.cjs.map +1 -1
  366. package/dist/components/features/chat/switch-profile-context-menu.js +77 -67
  367. package/dist/components/features/chat/switch-profile-context-menu.js.map +1 -1
  368. package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs +1 -1
  369. package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs.map +1 -1
  370. package/dist/components/features/context-menu/context-menu-icon-text-with-description.d.ts +2 -1
  371. package/dist/components/features/context-menu/context-menu-icon-text-with-description.js +3 -2
  372. package/dist/components/features/context-menu/context-menu-icon-text-with-description.js.map +1 -1
  373. package/dist/components/features/context-menu/context-menu-icon-text.cjs +1 -1
  374. package/dist/components/features/context-menu/context-menu-icon-text.cjs.map +1 -1
  375. package/dist/components/features/context-menu/context-menu-icon-text.d.ts +2 -1
  376. package/dist/components/features/context-menu/context-menu-icon-text.js +20 -10
  377. package/dist/components/features/context-menu/context-menu-icon-text.js.map +1 -1
  378. package/dist/components/features/context-menu/context-menu-list-item.cjs +1 -1
  379. package/dist/components/features/context-menu/context-menu-list-item.cjs.map +1 -1
  380. package/dist/components/features/context-menu/context-menu-list-item.js +10 -9
  381. package/dist/components/features/context-menu/context-menu-list-item.js.map +1 -1
  382. package/dist/components/features/controls/agent-status.cjs +1 -1
  383. package/dist/components/features/controls/agent-status.js +12 -12
  384. package/dist/components/features/controls/git-tools-submenu.cjs +1 -1
  385. package/dist/components/features/controls/git-tools-submenu.cjs.map +1 -1
  386. package/dist/components/features/controls/git-tools-submenu.js +1 -1
  387. package/dist/components/features/controls/git-tools-submenu.js.map +1 -1
  388. package/dist/components/features/controls/macros-submenu.cjs +1 -1
  389. package/dist/components/features/controls/macros-submenu.cjs.map +1 -1
  390. package/dist/components/features/controls/macros-submenu.js +1 -1
  391. package/dist/components/features/controls/macros-submenu.js.map +1 -1
  392. package/dist/components/features/controls/server-status-context-menu-icon-text.cjs +1 -1
  393. package/dist/components/features/controls/server-status-context-menu-icon-text.cjs.map +1 -1
  394. package/dist/components/features/controls/server-status-context-menu-icon-text.js +14 -15
  395. package/dist/components/features/controls/server-status-context-menu-icon-text.js.map +1 -1
  396. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  397. package/dist/components/features/controls/server-status-context-menu.js +4 -4
  398. package/dist/components/features/controls/server-status.cjs +1 -1
  399. package/dist/components/features/controls/server-status.js +7 -7
  400. package/dist/components/features/controls/tools-context-menu-icon-text.cjs +1 -1
  401. package/dist/components/features/controls/tools-context-menu-icon-text.cjs.map +1 -1
  402. package/dist/components/features/controls/tools-context-menu-icon-text.js +16 -16
  403. package/dist/components/features/controls/tools-context-menu-icon-text.js.map +1 -1
  404. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs +1 -1
  405. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs.map +1 -1
  406. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js +11 -11
  407. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js.map +1 -1
  408. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  409. package/dist/components/features/conversation/conversation-name-with-status.js +11 -11
  410. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  411. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  412. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +60 -47
  413. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  414. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs +1 -1
  415. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs.map +1 -1
  416. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js +86 -82
  417. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js.map +1 -1
  418. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  419. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +4 -4
  420. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  421. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +9 -9
  422. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  423. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  424. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +93 -93
  425. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  426. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  427. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  428. package/dist/components/features/conversation-panel/conversation-panel.js +177 -177
  429. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  430. package/dist/components/features/conversation-panel/ellipsis-button.cjs +1 -1
  431. package/dist/components/features/conversation-panel/ellipsis-button.cjs.map +1 -1
  432. package/dist/components/features/conversation-panel/ellipsis-button.js +13 -13
  433. package/dist/components/features/conversation-panel/ellipsis-button.js.map +1 -1
  434. package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs +1 -1
  435. package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs.map +1 -1
  436. package/dist/components/features/conversation-panel/local-new-conversation-menu.js +57 -53
  437. package/dist/components/features/conversation-panel/local-new-conversation-menu.js.map +1 -1
  438. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs +1 -1
  439. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs.map +1 -1
  440. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js +3 -2
  441. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js.map +1 -1
  442. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs +1 -1
  443. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs.map +1 -1
  444. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js +11 -8
  445. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js.map +1 -1
  446. package/dist/components/features/conversation-panel/system-message-modal/tab-content.cjs.map +1 -1
  447. package/dist/components/features/conversation-panel/system-message-modal/tab-content.d.ts +2 -5
  448. package/dist/components/features/conversation-panel/system-message-modal/tab-content.js.map +1 -1
  449. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  450. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  451. package/dist/components/features/files-tab/file-content-viewer.js +45 -42
  452. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  453. package/dist/components/features/home/llm-not-configured-banner.d.ts +11 -0
  454. package/dist/components/features/home/shared/dropdown-item.cjs +1 -1
  455. package/dist/components/features/home/shared/dropdown-item.cjs.map +1 -1
  456. package/dist/components/features/home/shared/dropdown-item.js +20 -16
  457. package/dist/components/features/home/shared/dropdown-item.js.map +1 -1
  458. package/dist/components/features/home/shared/generic-dropdown-menu.cjs +1 -1
  459. package/dist/components/features/home/shared/generic-dropdown-menu.cjs.map +1 -1
  460. package/dist/components/features/home/shared/generic-dropdown-menu.js +23 -22
  461. package/dist/components/features/home/shared/generic-dropdown-menu.js.map +1 -1
  462. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs +1 -1
  463. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs.map +1 -1
  464. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js +103 -102
  465. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js.map +1 -1
  466. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs +1 -1
  467. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs.map +1 -1
  468. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js +68 -67
  469. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js.map +1 -1
  470. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  471. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  472. package/dist/components/features/mcp-page/custom-server-editor.js +62 -60
  473. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  474. package/dist/components/features/mcp-page/index.cjs +1 -1
  475. package/dist/components/features/mcp-page/index.d.ts +1 -0
  476. package/dist/components/features/mcp-page/index.js +1 -0
  477. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  478. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  479. package/dist/components/features/mcp-page/install-server-modal.js +141 -121
  480. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  481. package/dist/components/features/mcp-page/save-as-secret-toggle.cjs +2 -0
  482. package/dist/components/features/mcp-page/save-as-secret-toggle.cjs.map +1 -0
  483. package/dist/components/features/mcp-page/save-as-secret-toggle.d.ts +7 -0
  484. package/dist/components/features/mcp-page/save-as-secret-toggle.js +50 -0
  485. package/dist/components/features/mcp-page/save-as-secret-toggle.js.map +1 -0
  486. package/dist/components/features/onboarding/onboarding-modal.d.ts +2 -2
  487. package/dist/components/features/onboarding/steps/check-backend-step.d.ts +1 -1
  488. package/dist/components/features/onboarding/steps/choose-agent-step.d.ts +2 -1
  489. package/dist/components/features/onboarding/steps/setup-acp-secrets-step.d.ts +19 -10
  490. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  491. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.d.ts +5 -0
  492. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -0
  493. package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
  494. package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
  495. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  496. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  497. package/dist/components/features/skills/extensions-navigation.js +1 -1
  498. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  499. package/dist/components/shared/buttons/back-nav-button.cjs +2 -0
  500. package/dist/components/shared/buttons/back-nav-button.cjs.map +1 -0
  501. package/dist/components/shared/buttons/back-nav-button.d.ts +17 -0
  502. package/dist/components/shared/buttons/back-nav-button.js +33 -0
  503. package/dist/components/shared/buttons/back-nav-button.js.map +1 -0
  504. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  505. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +5 -5
  506. package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
  507. package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
  508. package/dist/components/shared/filters/enum-filter-dropdown.js +32 -31
  509. package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
  510. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  511. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  512. package/dist/components/shared/modals/confirmation-modals/base-modal.js +14 -13
  513. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  514. package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
  515. package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
  516. package/dist/components/shared/modals/settings/settings-modal.js +17 -16
  517. package/dist/components/shared/modals/settings/settings-modal.js.map +1 -1
  518. package/dist/components/shared/text-shimmer.cjs +2 -0
  519. package/dist/components/shared/text-shimmer.cjs.map +1 -0
  520. package/dist/components/shared/text-shimmer.d.ts +11 -0
  521. package/dist/components/shared/text-shimmer.js +43 -0
  522. package/dist/components/shared/text-shimmer.js.map +1 -0
  523. package/dist/constants/acp-providers.cjs +1 -1
  524. package/dist/constants/acp-providers.cjs.map +1 -1
  525. package/dist/constants/acp-providers.d.ts +16 -3
  526. package/dist/constants/acp-providers.js +0 -1
  527. package/dist/constants/acp-providers.js.map +1 -1
  528. package/dist/contexts/active-backend-context.cjs +1 -1
  529. package/dist/contexts/active-backend-context.cjs.map +1 -1
  530. package/dist/contexts/active-backend-context.js +32 -32
  531. package/dist/contexts/active-backend-context.js.map +1 -1
  532. package/dist/hooks/chat/use-chat-input-logic.cjs +1 -1
  533. package/dist/hooks/chat/use-chat-input-logic.cjs.map +1 -1
  534. package/dist/hooks/chat/use-chat-input-logic.js +13 -6
  535. package/dist/hooks/chat/use-chat-input-logic.js.map +1 -1
  536. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs +2 -0
  537. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs.map +1 -0
  538. package/dist/hooks/mutation/use-save-fields-as-secrets.d.ts +9 -0
  539. package/dist/hooks/mutation/use-save-fields-as-secrets.js +24 -0
  540. package/dist/hooks/mutation/use-save-fields-as-secrets.js.map +1 -0
  541. package/dist/hooks/mutation/use-unified-start-conversation.cjs +1 -1
  542. package/dist/hooks/mutation/use-unified-start-conversation.js +8 -8
  543. package/dist/hooks/mutation/use-unified-stop-conversation.cjs +1 -1
  544. package/dist/hooks/mutation/use-unified-stop-conversation.js +15 -15
  545. package/dist/hooks/query/use-acp-auth-status.d.ts +36 -0
  546. package/dist/hooks/query/use-agent-settings-schema.cjs +1 -1
  547. package/dist/hooks/query/use-agent-settings-schema.cjs.map +1 -1
  548. package/dist/hooks/query/use-agent-settings-schema.js +26 -16
  549. package/dist/hooks/query/use-agent-settings-schema.js.map +1 -1
  550. package/dist/hooks/query/use-backends-health.cjs +1 -1
  551. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  552. package/dist/hooks/query/use-backends-health.d.ts +2 -0
  553. package/dist/hooks/query/use-backends-health.js +31 -21
  554. package/dist/hooks/query/use-backends-health.js.map +1 -1
  555. package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
  556. package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
  557. package/dist/hooks/query/use-paginated-conversations.js +15 -14
  558. package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
  559. package/dist/hooks/query/use-settings.cjs +1 -1
  560. package/dist/hooks/query/use-settings.cjs.map +1 -1
  561. package/dist/hooks/query/use-settings.js +65 -52
  562. package/dist/hooks/query/use-settings.js.map +1 -1
  563. package/dist/hooks/query/use-user-conversation.cjs +1 -1
  564. package/dist/hooks/query/use-user-conversation.cjs.map +1 -1
  565. package/dist/hooks/query/use-user-conversation.js +20 -11
  566. package/dist/hooks/query/use-user-conversation.js.map +1 -1
  567. package/dist/hooks/use-agent-state.cjs +1 -1
  568. package/dist/hooks/use-agent-state.js +13 -13
  569. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  570. package/dist/hooks/use-conversation-name-context-menu.js +10 -10
  571. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  572. package/dist/hooks/use-llm-configured.d.ts +25 -0
  573. package/dist/hooks/use-runtime-is-ready.cjs +1 -1
  574. package/dist/hooks/use-runtime-is-ready.js +5 -5
  575. package/dist/i18n/declaration.cjs +1 -1
  576. package/dist/i18n/declaration.cjs.map +1 -1
  577. package/dist/i18n/declaration.d.ts +19 -1
  578. package/dist/i18n/declaration.js +1 -1
  579. package/dist/i18n/declaration.js.map +1 -1
  580. package/dist/i18n/translation.cjs +3 -3
  581. package/dist/i18n/translation.cjs.map +1 -1
  582. package/dist/i18n/translation.js +321 -15
  583. package/dist/i18n/translation.js.map +1 -1
  584. package/dist/icons/stop-circle.cjs +1 -1
  585. package/dist/icons/stop-circle.cjs.map +1 -1
  586. package/dist/icons/stop-circle.js +7 -10
  587. package/dist/icons/stop-circle.js.map +1 -1
  588. package/dist/locales/ar/openhands.json +20 -2
  589. package/dist/locales/ca/openhands.json +20 -2
  590. package/dist/locales/de/openhands.json +20 -2
  591. package/dist/locales/en/openhands.json +20 -2
  592. package/dist/locales/es/openhands.json +20 -2
  593. package/dist/locales/fr/openhands.json +20 -2
  594. package/dist/locales/it/openhands.json +20 -2
  595. package/dist/locales/ja/openhands.json +20 -2
  596. package/dist/locales/ko-KR/openhands.json +20 -2
  597. package/dist/locales/no/openhands.json +20 -2
  598. package/dist/locales/pt/openhands.json +20 -2
  599. package/dist/locales/tr/openhands.json +20 -2
  600. package/dist/locales/uk/openhands.json +20 -2
  601. package/dist/locales/zh-CN/openhands.json +20 -2
  602. package/dist/locales/zh-TW/openhands.json +20 -2
  603. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs +2 -0
  604. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs.map +1 -0
  605. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +15 -0
  606. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js.map +1 -0
  607. package/dist/package.cjs +1 -1
  608. package/dist/package.cjs.map +1 -1
  609. package/dist/package.js +1 -1
  610. package/dist/package.js.map +1 -1
  611. package/dist/routes/conversation.cjs +1 -1
  612. package/dist/routes/conversation.cjs.map +1 -1
  613. package/dist/routes/conversation.js +1 -1
  614. package/dist/routes/conversation.js.map +1 -1
  615. package/dist/routes/llm-settings.cjs +1 -1
  616. package/dist/routes/llm-settings.cjs.map +1 -1
  617. package/dist/routes/llm-settings.js +55 -54
  618. package/dist/routes/llm-settings.js.map +1 -1
  619. package/dist/routes/secrets-settings.cjs +1 -1
  620. package/dist/routes/secrets-settings.cjs.map +1 -1
  621. package/dist/routes/secrets-settings.js +19 -27
  622. package/dist/routes/secrets-settings.js.map +1 -1
  623. package/dist/stores/conversation-store.cjs +1 -1
  624. package/dist/stores/conversation-store.cjs.map +1 -1
  625. package/dist/stores/conversation-store.d.ts +4 -0
  626. package/dist/stores/conversation-store.js +6 -0
  627. package/dist/stores/conversation-store.js.map +1 -1
  628. package/dist/types/agent-server/core/events/acp-tool-call-event.d.ts +6 -4
  629. package/dist/types/agent-server/core/events/system-event.d.ts +5 -0
  630. package/dist/types/automation.d.ts +15 -0
  631. package/dist/types/settings.d.ts +3 -1
  632. package/dist/ui/combobox-caret.cjs +1 -1
  633. package/dist/ui/combobox-caret.cjs.map +1 -1
  634. package/dist/ui/combobox-caret.d.ts +1 -1
  635. package/dist/ui/combobox-caret.js +9 -8
  636. package/dist/ui/combobox-caret.js.map +1 -1
  637. package/dist/ui/context-menu.cjs +1 -1
  638. package/dist/ui/context-menu.cjs.map +1 -1
  639. package/dist/ui/context-menu.js +9 -8
  640. package/dist/ui/context-menu.js.map +1 -1
  641. package/dist/ui/dropdown/dropdown-menu.cjs +1 -1
  642. package/dist/ui/dropdown/dropdown-menu.cjs.map +1 -1
  643. package/dist/ui/dropdown/dropdown-menu.js +21 -17
  644. package/dist/ui/dropdown/dropdown-menu.js.map +1 -1
  645. package/dist/ui/dropdown/dropdown.cjs +1 -1
  646. package/dist/ui/dropdown/dropdown.cjs.map +1 -1
  647. package/dist/ui/dropdown/dropdown.js +2 -2
  648. package/dist/ui/dropdown/dropdown.js.map +1 -1
  649. package/dist/utils/automation-schedule.d.ts +1 -0
  650. package/dist/utils/dropdown-classes.cjs +2 -0
  651. package/dist/utils/dropdown-classes.cjs.map +1 -0
  652. package/dist/utils/dropdown-classes.d.ts +32 -0
  653. package/dist/utils/dropdown-classes.js +8 -0
  654. package/dist/utils/dropdown-classes.js.map +1 -0
  655. package/dist/utils/form-control-classes.cjs +1 -1
  656. package/dist/utils/form-control-classes.cjs.map +1 -1
  657. package/dist/utils/form-control-classes.d.ts +18 -2
  658. package/dist/utils/form-control-classes.js +4 -3
  659. package/dist/utils/form-control-classes.js.map +1 -1
  660. package/dist/utils/git-control-bar-classes.cjs +2 -0
  661. package/dist/utils/git-control-bar-classes.cjs.map +1 -0
  662. package/dist/utils/git-control-bar-classes.d.ts +4 -0
  663. package/dist/utils/git-control-bar-classes.js +14 -0
  664. package/dist/utils/git-control-bar-classes.js.map +1 -0
  665. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  666. package/dist/utils/handle-event-for-ui.d.ts +6 -3
  667. package/dist/utils/handle-event-for-ui.js.map +1 -1
  668. package/dist/utils/mobile-top-bar-icon-button-classes.cjs +1 -1
  669. package/dist/utils/mobile-top-bar-icon-button-classes.cjs.map +1 -1
  670. package/dist/utils/mobile-top-bar-icon-button-classes.js +3 -3
  671. package/dist/utils/mobile-top-bar-icon-button-classes.js.map +1 -1
  672. package/dist/utils/modal-classes.cjs +2 -0
  673. package/dist/utils/modal-classes.cjs.map +1 -0
  674. package/dist/utils/modal-classes.d.ts +8 -0
  675. package/dist/utils/modal-classes.js +7 -0
  676. package/dist/utils/modal-classes.js.map +1 -0
  677. package/dist/utils/openhands-llm.cjs +2 -0
  678. package/dist/utils/openhands-llm.cjs.map +1 -0
  679. package/dist/utils/openhands-llm.d.ts +2 -0
  680. package/dist/utils/openhands-llm.js +9 -0
  681. package/dist/utils/openhands-llm.js.map +1 -0
  682. package/dist/utils/redact-custom-secrets.cjs +2 -0
  683. package/dist/utils/redact-custom-secrets.cjs.map +1 -0
  684. package/dist/utils/redact-custom-secrets.d.ts +6 -0
  685. package/dist/utils/redact-custom-secrets.js +10 -0
  686. package/dist/utils/redact-custom-secrets.js.map +1 -0
  687. package/dist/utils/status.cjs +1 -1
  688. package/dist/utils/status.cjs.map +1 -1
  689. package/dist/utils/status.d.ts +2 -1
  690. package/dist/utils/status.js +9 -8
  691. package/dist/utils/status.js.map +1 -1
  692. package/dist/utils/system-message-adapter.cjs +1 -1
  693. package/dist/utils/system-message-adapter.cjs.map +1 -1
  694. package/dist/utils/system-message-adapter.js +10 -7
  695. package/dist/utils/system-message-adapter.js.map +1 -1
  696. package/dist/utils/utils.cjs +1 -1
  697. package/dist/utils/utils.cjs.map +1 -1
  698. package/dist/utils/utils.d.ts +2 -1
  699. package/dist/utils/utils.js +21 -20
  700. package/dist/utils/utils.js.map +1 -1
  701. package/package.json +1 -1
  702. package/scripts/dev-safe.mjs +3 -1
  703. package/scripts/dev-static.mjs +2 -2
  704. package/scripts/dev-with-automation.mjs +283 -108
  705. package/scripts/static-build.mjs +20 -19
  706. package/scripts/static-server.mjs +50 -3
  707. package/build/assets/acp-providers-CbiRekh9.js +0 -1
  708. package/build/assets/active-backend-context-cCM1vYYZ.js +0 -1
  709. package/build/assets/add-backend-modal-DIUQzMPa.js +0 -1
  710. package/build/assets/agent-server-client-options-Bc5ZorQZ.js +0 -1
  711. package/build/assets/agent-server-compatibility-BlkUsrX2.js +0 -1
  712. package/build/assets/agent-server-conversation-service.api-C2V5SlHu.js +0 -5
  713. package/build/assets/api-key-entry-screen-B2gynaCp.js +0 -1
  714. package/build/assets/automation-detail-DJvbVSYK.js +0 -1
  715. package/build/assets/automations-list-6FDbI5dc.js +0 -1
  716. package/build/assets/backend-form-modal-Dnk33xA_.js +0 -1
  717. package/build/assets/base-modal-_dYTw1ri.js +0 -1
  718. package/build/assets/brand-button-Br7f0kZJ.js +0 -1
  719. package/build/assets/browser-store-Couc4S5D.js +0 -1
  720. package/build/assets/clock-BRjCgHTc.js +0 -1
  721. package/build/assets/combobox-caret-to1O8irE.js +0 -1
  722. package/build/assets/context-menu-list-item-CWNFpuiC.js +0 -1
  723. package/build/assets/conversation-DVrKU0oz.js +0 -19
  724. package/build/assets/conversation-Dlys-D5A.js +0 -1
  725. package/build/assets/conversation-panel-iF09WjZ4.js +0 -1
  726. package/build/assets/conversation-service.api-CCfztilW.js +0 -1
  727. package/build/assets/conversation-state-store-u5jepov0.js +0 -1
  728. package/build/assets/conversation-store-Z5iMCRpc.js +0 -1
  729. package/build/assets/conversation-websocket-context-DhJhqUna.js +0 -3
  730. package/build/assets/declaration-BNMqORFE.js +0 -1
  731. package/build/assets/dist-BxBP7tFD.js +0 -1
  732. package/build/assets/edit-automation-modal-BGzR3nfZ.js +0 -1
  733. package/build/assets/ellipsis-button-ZyLMPURn.js +0 -1
  734. package/build/assets/entry.client-1VMHpktY.js +0 -2
  735. package/build/assets/enum-filter-dropdown-CEgCdu4A.js +0 -1
  736. package/build/assets/extensions-hub-C651jsVh.js +0 -1
  737. package/build/assets/files-tab-R5z0lLdY.js +0 -1
  738. package/build/assets/files-tab-store-CDyVTXNT.js +0 -1
  739. package/build/assets/git-control-bar-branch-button-COdRAYHb.js +0 -27
  740. package/build/assets/git-provider-icon-BzLbc0yC.js +0 -1
  741. package/build/assets/home-e-egNUXZ.js +0 -1
  742. package/build/assets/install-server-modal-DHlbgqVH.js +0 -1
  743. package/build/assets/launch-CshDse3e.js +0 -1
  744. package/build/assets/link-external-D2POYx4c.js +0 -1
  745. package/build/assets/llm-settings-Bql-vydt.js +0 -1
  746. package/build/assets/llm-settings-C_tal6Ds.js +0 -1
  747. package/build/assets/manage-backends-modal-l7RkKfwX.js +0 -1
  748. package/build/assets/manage-workspaces-modal-DhKF_8z3.js +0 -1
  749. package/build/assets/manifest-3bf30d69.js +0 -1
  750. package/build/assets/mcp-ByeBfdfU.js +0 -9
  751. package/build/assets/messages-D0rWot7s.js +0 -36
  752. package/build/assets/proxy-CxydCnis.js +0 -1
  753. package/build/assets/root-DHeCXo9N.css +0 -1
  754. package/build/assets/root-layout-Czo9Ma6Q.js +0 -2
  755. package/build/assets/secrets-service-BsnKFc2x.js +0 -1
  756. package/build/assets/secrets-settings-Bz_UohPJ.js +0 -1
  757. package/build/assets/settings-client-C73C7IgV.js +0 -1
  758. package/build/assets/settings-index-Dz0BmdJD.js +0 -1
  759. package/build/assets/settings-list-classes-Bf80tWtc.js +0 -1
  760. package/build/assets/settings-modal-Brzgh5Yw.js +0 -1
  761. package/build/assets/settings-service.api-CZ3uWx4v.js +0 -1
  762. package/build/assets/sidebar-mobile-menu-toggle-Do_aA9Zm.js +0 -1
  763. package/build/assets/skills-settings-DlA5hlXw.js +0 -2
  764. package/build/assets/status-hp6M6E7E.js +0 -1
  765. package/build/assets/use-agent-settings-schema-33Un7UF2.js +0 -1
  766. package/build/assets/use-is-authed-BggE5wPj.js +0 -1
  767. package/build/assets/use-llm-profiles-DDOol3gK.js +0 -1
  768. package/build/assets/use-runtime-is-ready-B7EF4BKU.js +0 -1
  769. package/build/assets/use-settings-DQIZmIov.js +0 -1
  770. package/build/assets/use-user-conversation-C6hrMMtn.js +0 -1
  771. package/build/assets/utils-i18rdUj2.js +0 -1
  772. package/build/assets/vendor~conversation-panel~conversation-a9SyrrhV.js +0 -1
  773. package/build/assets/vendor~conversation-panel~conversation~index-C23ZXO4R.js +0 -1
  774. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-BebWhFNT.js +0 -1
  775. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DzIXV3Ui.js +0 -9
  776. /package/build/assets/{automation-IdgZq6ZK.js → automation-XDPAjiZi.js} +0 -0
  777. /package/build/assets/{color-themes-DSaoIL6A.js → color-themes-B9pm9c-R.js} +0 -0
  778. /package/build/assets/{common-DR1t-EeP.js → common-DqjLSBOt.js} +0 -0
  779. /package/build/assets/{conversation-local-storage-UYl-SX-r.js → conversation-local-storage-YmOVXxxW.js} +0 -0
  780. /package/build/assets/{dist-C6t0EXL7.js → dist-C3NfioQC.js} +0 -0
  781. /package/build/assets/{environment-switch-store-C4ulFJKp.js → environment-switch-store-CiurvTtK.js} +0 -0
  782. /package/build/assets/{health-store-BDC2rM-X.js → health-store-B5f0S2FY.js} +0 -0
  783. /package/build/assets/{map-provider-COBVzZYo.js → map-provider-BJ_8KZKU.js} +0 -0
  784. /package/build/assets/{middleware-BC9EwbB9.js → middleware-CfatjPYZ.js} +0 -0
  785. /package/build/assets/{objectWithoutPropertiesLoose-Du6eBn-V.js → objectWithoutPropertiesLoose-DSQKyRhw.js} +0 -0
  786. /package/build/assets/{react-Do0CT17Y.js → react-Dy05vyj5.js} +0 -0
  787. /package/build/assets/{sdk-settings-field-metadata-CBPmeqYa.js → sdk-settings-field-metadata-DQiaIBie.js} +0 -0
  788. /package/build/assets/{settings-D_H-qsRm.js → settings-DGY6n4J2.js} +0 -0
  789. /package/build/assets/{settings-like-page-layout-classes-I0BDBEoq.js → settings-like-page-layout-classes-D7YjdTd0.js} +0 -0
  790. /package/build/assets/{use-breakpoint-DbJ6FkQ-.js → use-breakpoint-DF_RiQ6s.js} +0 -0
  791. /package/build/assets/{use-click-outside-element-DffgWWoZ.js → use-click-outside-element-DhxCUyWl.js} +0 -0
  792. /package/build/assets/{v4-CNn21NXa.js → v4-khGvL7i2.js} +0 -0
  793. /package/build/assets/{vendor~browser-DDiZgqD3.js → vendor~browser-DisFGEp9.js} +0 -0
  794. /package/build/assets/{vendor~browser-tab-BgwV1mxF.js → vendor~browser-tab-BxhTtM9_.js} +0 -0
  795. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DbvX3OcM.js → vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js} +0 -0
  796. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js} +0 -0
  797. /package/build/assets/{vendor~files-tab-BGKayPiK.js → vendor~files-tab-BtkpAiMX.js} +0 -0
  798. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BW6261Sb.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CyZ-3lDQ.js} +0 -0
  799. /package/build/assets/{vendor~home~mcp~automations-list-DoPfwaXj.js → vendor~home~mcp~automations-list-BgV86Sti.js} +0 -0
  800. /package/build/assets/{vendor~launch-vdeRTWFu.js → vendor~launch-BXgl67Re.js} +0 -0
  801. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js} +0 -0
  802. /package/build/assets/{vendor~terminal-DUrOWGFE.js → vendor~terminal-DZaJIY8A.js} +0 -0
@@ -72,6 +72,7 @@ export function parseArgs(argv = process.argv.slice(2)) {
72
72
  host: "0.0.0.0",
73
73
  dir: "build",
74
74
  routes: {},
75
+ rejectPrefixes: [],
75
76
  sessionApiKey: null,
76
77
  authRequired: false,
77
78
  };
@@ -112,6 +113,16 @@ export function parseArgs(argv = process.argv.slice(2)) {
112
113
  case "--auth-required":
113
114
  config.authRequired = true;
114
115
  break;
116
+ case "--reject-prefix": {
117
+ const prefix = argv[++i];
118
+ if (!prefix || !prefix.startsWith("/")) {
119
+ throw new Error(
120
+ `--reject-prefix value must start with '/': ${prefix ?? "(empty)"}`,
121
+ );
122
+ }
123
+ config.rejectPrefixes.push(prefix);
124
+ break;
125
+ }
115
126
  case "-h":
116
127
  case "--help":
117
128
  showHelp();
@@ -156,11 +167,18 @@ OPTIONS:
156
167
  --auth-required Inject authRequired flag into index.html so the
157
168
  pre-built frontend shows the API key entry screen
158
169
  (public mode) without VITE_AUTH_REQUIRED baked in.
170
+ --reject-prefix <prefix> Return 503 for requests matching <prefix>
171
+ instead of SPA-fallbacking to index.html;
172
+ may be repeated. Useful in --frontend-only
173
+ mode to cleanly reject API paths.
159
174
  -h, --help Show this help
160
175
 
161
176
  ROUTING:
162
177
  • Routes are matched by longest prefix first (most-specific wins).
163
- Anything that does not match a route is served from --dir.
178
+ Reject prefixes are checked before SPA fallback matching requests
179
+ get 503 immediately.
180
+ • Anything that does not match a route or reject prefix is served
181
+ from --dir.
164
182
  • Unknown paths fall back to index.html (SPA mode), unless they look
165
183
  like an asset request (have a known file extension), in which case
166
184
  a 404 is returned.
@@ -429,7 +447,13 @@ async function serveFile(req, res, filePath, urlPath) {
429
447
  return true;
430
448
  }
431
449
 
432
- async function handleStatic(req, res, dirAbs, injectionOpts = {}) {
450
+ async function handleStatic(
451
+ req,
452
+ res,
453
+ dirAbs,
454
+ injectionOpts = {},
455
+ rejectPrefixes = [],
456
+ ) {
433
457
  const rawPath = req.url.split("?")[0];
434
458
  let urlPath;
435
459
  try {
@@ -464,6 +488,23 @@ async function handleStatic(req, res, dirAbs, injectionOpts = {}) {
464
488
 
465
489
  if (await serveFile(req, res, filePath, urlPath)) return;
466
490
 
491
+ // Reject prefixes: return 503 for known API paths that have no backend
492
+ // configured (e.g. in --frontend-only mode). Checked before SPA fallback
493
+ // so these paths never silently serve index.html.
494
+ if (rejectPrefixes.length > 0) {
495
+ for (const prefix of rejectPrefixes) {
496
+ if (
497
+ urlPath === prefix ||
498
+ urlPath.startsWith(prefix + "/") ||
499
+ urlPath.startsWith(prefix + "?")
500
+ ) {
501
+ res.writeHead(503, { "Content-Type": "text/plain; charset=utf-8" });
502
+ res.end("Service Unavailable (no backend configured for this route)");
503
+ return;
504
+ }
505
+ }
506
+ }
507
+
467
508
  // SPA fallback: only for non-asset requests, and not for non-GET/HEAD.
468
509
  if (
469
510
  (req.method === "GET" || req.method === "HEAD") &&
@@ -491,6 +532,7 @@ export function startStaticServer(config) {
491
532
  sessionApiKey: config.sessionApiKey || null,
492
533
  authRequired: config.authRequired || false,
493
534
  };
535
+ const rejectPrefixes = config.rejectPrefixes ?? [];
494
536
 
495
537
  const server = createServer((req, res) => {
496
538
  const backend = route(req.url);
@@ -498,7 +540,7 @@ export function startStaticServer(config) {
498
540
  proxyRequest(req, res, backend);
499
541
  return;
500
542
  }
501
- handleStatic(req, res, dirAbs, injectionOpts).catch((err) => {
543
+ handleStatic(req, res, dirAbs, injectionOpts, rejectPrefixes).catch((err) => {
502
544
  console.error(`Static handler error for ${req.url}:`, err);
503
545
  if (!res.headersSent) {
504
546
  res.writeHead(500);
@@ -529,6 +571,11 @@ export function startStaticServer(config) {
529
571
  for (const [prefix, backend] of sortedRoutes) {
530
572
  console.log(` ${prefix} -> ${backend}`);
531
573
  }
574
+ if (rejectPrefixes.length > 0) {
575
+ for (const prefix of rejectPrefixes) {
576
+ console.log(` ${prefix} -> 503 (rejected)`);
577
+ }
578
+ }
532
579
  console.log(" * (default) -> static files + SPA fallback");
533
580
  console.log("");
534
581
  resolveListen(server);
@@ -1 +0,0 @@
1
- import{t as e}from"./declaration-BNMqORFE.js";import{t}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js";var n=`cli-generic`,r=new Set([`default`,`default (recommended)`]);function i(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||r.has(t.toLowerCase())||t===`acp-managed`?null:t}function a(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=i(t);if(e)return e}return e.providerDefault??null}var o={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}},s=Object.entries(o).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:r?.available_models?.map(e=>({id:e.id,label:e.label})),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),c=`custom`,l={"claude-code":[{name:`ANTHROPIC_API_KEY`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT},{name:`ANTHROPIC_BASE_URL`,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}],codex:[{name:`OPENAI_API_KEY`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT},{name:`OPENAI_BASE_URL`,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}]};function u(e){return e?l[e]??[]:[]}function d(e){if(e)return s.find(t=>t.key===e)}function f(e){let t=d(e);return t?t.display_name:null}function p(e){return d(e)?.icon??`cli-generic`}function m(e,t){return t?d(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function h(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===c,r=n?void 0:d(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?r?.default_model??null:t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{d as a,m as c,h as i,p as l,s as n,f as o,n as r,u as s,c as t,a as u};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-BNMqORFE.js";import{a as r,t as i}from"./health-store-BDC2rM-X.js";import{_ as a,d as o,f as s,h as c,l,m as u,p as d}from"./agent-server-client-options-Bc5ZorQZ.js";var f=e(t(),1),p=n(),m=f.createContext(null);function h(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function g({children:e}){let t=f.useSyncExternalStore(c,s,s),n=f.useCallback((e,t)=>{let n=l()?.backendId??null,r=l()?.orgId??null,i=t??null;e===n&&i===r||d({backendId:e,orgId:i})},[]),a=f.useCallback(e=>{let t={...e,id:h()};return u([...o(),t]),d({backendId:t.id}),t},[]),g=f.useCallback((e,t)=>{let n=o().find(t=>t.id===e);u(o().map(n=>n.id===e?{...n,...t}:n));let i=t.host!==void 0&&n!==void 0&&t.host!==n.host,a=t.apiKey!==void 0&&n!==void 0&&t.apiKey!==n.apiKey;(i||a)&&r(e)},[]),_=f.useCallback(e=>{u(o().filter(t=>t.id!==e)),i(e)},[]),v=f.useMemo(()=>({backends:t.backends,active:t.active,setActive:n,addBackend:a,updateBackend:g,removeBackend:_}),[t,n,a,g,_]);return(0,p.jsx)(m.Provider,{value:v,children:e})}function _(){let e=f.useContext(m);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function v(){let e=f.useContext(m);return e?e.active:{backend:a(),orgId:null}}export{v as n,_ as r,g as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BFRubm34.js";import{o as t}from"./declaration-BNMqORFE.js";import{n}from"./backend-form-modal-Dnk33xA_.js";var r=e({AddBackendModal:()=>a}),i=t();function a({onClose:e}){return(0,i.jsx)(n,{mode:`add`,onClose:e})}export{r as n,a as t};
@@ -1 +0,0 @@
1
- var e=`openhands-agent-server-config`,t=`workspace/project`;function n(){if(typeof window>`u`)return{};try{let t=window.localStorage.getItem(e);return t?JSON.parse(t)??{}:{}}catch{return{}}}function r(t){if(typeof window>`u`)return;let n=Object.fromEntries(Object.entries(t).flatMap(([e,t])=>{if(typeof t!=`string`)return[];let n=t.trim();return n?[[e,n]]:[]}));if(Object.keys(n).length===0){window.localStorage.removeItem(e);return}window.localStorage.setItem(e,JSON.stringify(n))}function i(e){return e?.trim()||null}function a(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function o(){return a(n().baseUrl)||a(void 0)}function s(){return i(void 0)}function c(){return i(n().sessionApiKey)||s()}function l(){let e=s();if(!e)return;let t=n(),a=i(t.sessionApiKey);a&&a!==e&&r({...t,sessionApiKey:e})}function u(e){if(typeof window>`u`)return!1;try{let t=new URL(e),n=new Set([`127.0.0.1`,`localhost`,`0.0.0.0`]),r=window.location.hostname;return n.has(t.hostname)&&(!n.has(r)||t.hostname!==r)}catch{return!1}}function d(e){return e?u(e)?window.location.origin:e:null}function f(e){r({...n(),baseUrl:a(e.baseUrl),sessionApiKey:i(e.sessionApiKey)})}function p(){return d(o())||(typeof window<`u`?window.location.origin:`http://127.0.0.1:8000`)}function m(){return c()}function h(){return(void 0)?.trim()||n().workingDir?.trim()||t}function g(e){return`${h().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function _(){let e=m();return e?{"X-Session-API-Key":e}:{}}function v(){return!0}function y(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function b(){return y()?!c():!1}var x=`default-local`,ee=`Local`;function S(){return{id:x,name:ee,host:p(),apiKey:m()??``,kind:`local`}}var C=`openhands-backends`,w=`openhands-active-backend`;function T(e){return e===`local`||e===`cloud`}function E(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&T(t.kind)}function D(e){try{return new URL(e).origin}catch{return e.replace(/\/+$/,``)}}function O(e){let t=S();return e.id!==t.id||e.kind!==`local`||!t.apiKey||D(e.host)!==D(t.host)||e.apiKey===t.apiKey?e:{...e,apiKey:t.apiKey}}function k(e){if(!(typeof window>`u`))try{window.localStorage.setItem(C,JSON.stringify(e))}catch{}}function A(){if(typeof window>`u`)return[];l();try{let e=window.localStorage.getItem(C);if(e===null){let e=[S()];return k(e),e}let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=t.filter(E);if(n.length===0){let e=[S()];return k(e),e}let r=n.map(O);return r.some((e,t)=>e!==n[t])&&k(r),r}catch{return[]}}function te(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(w);if(!e)return null;let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function j(e){if(!(typeof window>`u`))try{if(!e){window.localStorage.removeItem(w);return}window.localStorage.setItem(w,JSON.stringify({backendId:e.backendId,orgId:e.orgId??null}))}catch{}}function M(e){return e.find(e=>e.kind===`local`)??S()}function N(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=M(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var P=N(A(),te()),F=new Set;function I(){F.forEach(e=>e())}function L(){return P.active}function R(){let e=P.active.backend;return e.kind===`local`?e:M(P.backends)}function z(){return P.backends}function B(){return P.selection}function V(){return P}function H(e){j(e),P=N(P.backends,e),I()}function U(e){k(e);let t=P.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,j(null)),P=N(e,t),I()}function W(e){return F.add(e),()=>{F.delete(e)}}var G=class extends Error{constructor(e,t,n,r){super(r||`HTTP ${e}: ${t}`),this.status=e,this.statusText=t,this.response=n,this.name=`HttpError`}},K=class{constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.apiKey=e.apiKey,this.timeout=e.timeout||6e4}async request(e){let t=e.url.startsWith(`/`)?e.url.slice(1):e.url,n=new URL(t,this.baseUrl+`/`);e.params&&Object.entries(e.params).forEach(([e,t])=>{t!=null&&(Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,String(t))):n.searchParams.append(e,String(t)))});let r={"Content-Type":`application/json`,...e.headers};this.apiKey&&(r[`X-Session-API-Key`]=this.apiKey);let i={method:e.method,headers:r,signal:AbortSignal.timeout(e.timeout||this.timeout)};e.credentials&&(i.credentials=e.credentials),e.data&&e.method!==`GET`&&(e.data instanceof FormData?(delete r[`Content-Type`],i.body=e.data):i.body=JSON.stringify(e.data));try{let t=await fetch(n.toString(),i);if(!(e.acceptableStatusCodes?.has(t.status)||!e.acceptableStatusCodes&&t.ok)){let e;try{e=t.headers.get(`content-type`)?.includes(`application/json`)?await t.json():await t.text()}catch{e=null}throw new G(t.status,t.statusText,e,`HTTP request failed (${t.status} ${t.statusText}): ${JSON.stringify(e)}`)}let r=await this.parseResponse(t,e.responseType||`auto`),a={};return t.headers.forEach((e,t)=>{a[t]=e}),{data:r,status:t.status,statusText:t.statusText,headers:a}}catch(t){throw t instanceof G?t:t instanceof Error?t.name===`AbortError`?Error(`Request timeout after ${e.timeout||this.timeout}ms`,{cause:t}):Error(`Request failed: ${t.message}`,{cause:t}):Error(`Unknown request error`,{cause:t})}}async parseResponse(e,t){return t===`json`?await e.json():t===`text`?await e.text():t===`blob`?await e.blob():t===`arrayBuffer`?await e.arrayBuffer():e.headers.get(`content-type`)?.includes(`application/json`)?await e.json():await e.text()}async get(e,t){return this.request({method:`GET`,url:e,...t})}async post(e,t,n){return this.request({method:`POST`,url:e,data:t,...n})}async put(e,t,n){return this.request({method:`PUT`,url:e,data:t,...n})}async patch(e,t,n){return this.request({method:`PATCH`,url:e,data:t,...n})}async delete(e,t){return this.request({method:`DELETE`,url:e,...t})}close(){}};function q(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function J(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function Y(e){let t=q(e),n=J(e);return`${window.location.protocol===`https:`?`https:`:`http:`}//${t}${n}`}function X(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function Z(e,t){let n=q(e),r=J(e),i=window.location.protocol===`https:`,a=X(e)===`https:`,o=`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/bash-events`;return t?`${o}?session_api_key=${encodeURIComponent(t)}`:o}function ne(e,t){if(!e)return null;let n=q(t),r=J(t),i=window.location.protocol===`https:`,a=X(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}function Q(e){return e.replace(/\/+$/,``)}function re(e,t){return e.host?Q(e.host):e.conversationUrl?Q(Y(e.conversationUrl)):Q(t.host)}function $(e={}){let t=R(),n=m(),r=t.id===`default-local`?n:null,i=e.sessionApiKey??e.apiKey??r??t.apiKey??void 0;return{host:re(e,t),...i?{apiKey:i}:{},workingDir:e.workingDir??h(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function ie(e){let{host:t,apiKey:n,timeout:r}=$(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}export{y as C,v as E,h as S,f as T,S as _,ne as a,_ as b,L as c,z as d,V as f,x as g,W as h,Y as i,B as l,U as m,ie as n,K as o,H as p,Z as r,G as s,$ as t,R as u,t as v,b as w,m as x,g as y};
@@ -1 +0,0 @@
1
- import{C as e,t,u as n}from"./agent-server-client-options-Bc5ZorQZ.js";import{t as r}from"./server-client-DyAQ3NZ_.js";import{t as i}from"./settings-client-C73C7IgV.js";var a=5e3,o=null,s=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,c=class extends Error{details;constructor(e){super(`Agent server not found. Could not connect to the configured agent server. Start a compatible agent server and reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null}},l=e=>e instanceof c||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,u=t=>e()&&m(t,401);function d(){o=null}function f(e){let t=s(o);return Array.isArray(t)?t.includes(e):!0}function p(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function m(e,t){return p(e)&&e.status===t}async function h(){let s=n(),l=t({host:s.host,sessionApiKey:s.apiKey||null,timeout:a}),u;try{u=await new r(l).getServerInfo()}catch(e){throw d(),p(e)?e:new c(e instanceof Error?e.message:null)}if(e())try{await new i(l).getSettings()}catch(e){if(m(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return o=u,u}export{h as a,m as i,f as n,l as r,u as t};
@@ -1,5 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-BsnKFc2x.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-Bc5ZorQZ.js","assets/settings-client-C73C7IgV.js","assets/proxy-CxydCnis.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-CT1Z6Pdu.js";import{E as t,S as n,c as r,i,o as a,s as o,t as s,u as c,y as l}from"./agent-server-client-options-Bc5ZorQZ.js";import{n as u,s as d,u as f}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js";import{t as p}from"./profiles-client-D6IkTJof.js";import{n as m}from"./agent-server-compatibility-BlkUsrX2.js";import{n as h,t as g}from"./proxy-CxydCnis.js";import{t as ee}from"./v4-CNn21NXa.js";import{t as _}from"./settings-D_H-qsRm.js";import{t as te}from"./common-DR1t-EeP.js";import{a as v,u as y}from"./acp-providers-CbiRekh9.js";import{t as b}from"./settings-service.api-CZ3uWx4v.js";var x=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new a({baseUrl:this.host,apiKey:this.apiKey,timeout:e.timeout||6e4})}async createConversation(e){return(await this.client.post(`/api/conversations`,e)).data}async searchConversations(e={}){return(await this.client.get(`/api/conversations/search`,{params:e})).data}async countConversations(e={}){return(await this.client.get(`/api/conversations/count`,{params:e})).data}async getConversations(e){return(await this.client.get(`/api/conversations`,{params:{ids:e}})).data}async getConversation(e){return(await this.client.get(`/api/conversations/${e}`)).data}async searchEvents(e,t={}){return(await this.client.get(`/api/conversations/${e}/events/search`,{params:t})).data}async getEvent(e,t){return(await this.client.get(`/api/conversations/${e}/events/${t}`)).data}async getEvents(e,t){return Promise.all(t.map(async t=>{try{return await this.getEvent(e,t)}catch(e){if(e instanceof o&&e.status===404)return null;throw e}}))}async sendEvent(e,t,n={}){await this.client.post(`/api/conversations/${e}/events`,{...t,...n.run===void 0?{}:{run:n.run}})}async pauseConversation(e){return(await this.client.post(`/api/conversations/${e}/pause`,{})).data}async interruptConversation(e){return(await this.client.post(`/api/conversations/${e}/interrupt`,{})).data}async runConversation(e){return(await this.client.post(`/api/conversations/${e}/run`,{})).data}async askAgent(e,t){return(await this.client.post(`/api/conversations/${e}/ask_agent`,{question:t})).data}async getEventCount(e,t={}){return(await this.client.get(`/api/conversations/${e}/events/count`,{params:t})).data}async respondToConfirmation(e,t){return(await this.client.post(`/api/conversations/${e}/events/respond_to_confirmation`,t)).data}async getAgentFinalResponse(e){return(await this.client.get(`/api/conversations/${e}/agent_final_response`)).data}async setConfirmationPolicy(e,t){let n=`policy`in t?t:{policy:t};return(await this.client.post(`/api/conversations/${e}/confirmation_policy`,n)).data}async condenseConversation(e){return(await this.client.post(`/api/conversations/${e}/condense`,{})).data}async setSecurityAnalyzer(e,t){let n=ne(t)?t:{security_analyzer:t};return(await this.client.post(`/api/conversations/${e}/security_analyzer`,n)).data}async updateSecrets(e,t){return(await this.client.post(`/api/conversations/${e}/secrets`,t)).data}async forkConversation(e,t={},n={}){return(await this.client.post(`/api/conversations/${e}/fork`,t,{params:n.includeSkills===void 0?void 0:{include_skills:n.includeSkills}})).data}async switchProfile(e,t){await this.client.post(`/api/conversations/${e}/switch_profile`,{profile_name:t})}async switchLLM(e,t){await this.client.post(`/api/conversations/${e}/switch_llm`,{llm:t})}async switchAcpModel(e,t){await this.client.post(`/api/conversations/${e}/switch_acp_model`,{model:t})}async deleteConversation(e){await this.client.delete(`/api/conversations/${e}`)}async updateConversation(e,t){return(await this.client.patch(`/api/conversations/${e}`,t)).data}close(){this.client.close()}};function ne(e){return typeof e==`object`&&!!e&&`security_analyzer`in e}var S=`openhands-agent-server-conversation-metadata`,C=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(S);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},w=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(S);return}window.localStorage.setItem(S,JSON.stringify(e))}},T=e=>C()[e]??null,E=(e,t)=>{let n=C();n[e]=t,w(n)},D=e=>{let t=C();e in t&&(delete t[e],w(t))};function O(e){if(!e?.id)return e;let t=T(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function k(){let e=r().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function re(e=20,t){let n=k(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>O(e)),next_page_id:i?.next_page_id??null}}async function A(e){if(e.length===0)return[];let t=k(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(O)}async function ie(e){return await g({backend:k(),method:`POST`,path:`/api/v1/app-conversations`,body:e})}async function ae(e){return g({backend:k(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function oe(e){await g({backend:k(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function se(e,t){return await g({backend:k(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function ce(e){await g({backend:k(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function le(e){await g({backend:k(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function ue(e,t){let n=k(),r=new URLSearchParams;return r.append(`file_path`,t),await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function de(e){let t=k(),n=new URLSearchParams;return n.set(`ids`,e),(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}var j=`canvas_ui`,fe=`canvas_ui_tool`,pe=[`terminal`,`file_editor`,`task_tracker`,j],M=`browser_tool_set`,N=`task_tool_set`;function me(){return!0}function he(){let e=(void 0)?.trim();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function ge(){let e=he();if(!e?.services)return;let t=[];t.push(`<RUNTIME_SERVICES>`),e.mode?t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`):t.push(`You are running inside an agent-canvas dev stack.`),t.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:n,ingress:r,automation:i}=e.services,a=e.services.frontend??e.services.vite;n?.url_from_agent&&t.push(`* Agent Server (you): ${n.url_from_agent}`,` ${n.description??`The agent-server hosting your tool calls.`}`),r?.url_from_agent&&t.push(`* Ingress: ${r.url_from_agent}`,` ${r.description??`Unified entry point for browser-facing traffic.`}`),a?.url_from_agent&&t.push(`* Frontend: ${a.url_from_agent}`,` ${a.description??`Frontend dev server.`}`),i?.url_from_agent?(t.push(`* Automation backend: ${i.url_from_agent}`,` ${i.description??`OpenHands Automations service.`}`),i.docs_url&&t.push(` Docs: ${i.docs_url}`),i.openapi_url&&t.push(` OpenAPI: ${i.openapi_url}`),i.auth_env_var&&t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)):t.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let o=n?.url_from_agent;return t.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),o&&t.push(`In particular, ${o} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),t.push(`</RUNTIME_SERVICES>`),t.join(`
3
- `)}function _e(e){let{host:t}=s();return`${t}/api/conversations/${e}`}function P(e){return`Conversation ${e.slice(0,5)}`}function F(e){let t=T(e.id),r=e.agent?.kind===`ACPAgent`,i=r?e.tags?.acpserver??null:null;return{id:e.id,created_by_user_id:null,selected_repository:t?.selected_repository??null,selected_branch:t?.selected_branch??null,git_provider:t?.git_provider??null,selected_workspace:t?.selected_workspace??null,title:e.title?.trim()?e.title:P(e.id),trigger:null,pr_number:[],agent_kind:r?`acp`:`openhands`,acp_server:i,llm_model:r?y({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??_.llm_model,metrics:e.metrics?{accumulated_cost:e.metrics.accumulated_cost??null,max_budget_per_task:e.metrics.max_budget_per_task??null,accumulated_token_usage:e.metrics.accumulated_token_usage?{prompt_tokens:e.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:e.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:e.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:e.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:e.metrics.accumulated_token_usage.context_window??0,per_turn_token:e.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??te.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:_e(e.id),session_api_key:s().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??n()},public:!1,sub_conversation_ids:[]}}function ve(e){return{items:e.items.map(F),next_page_id:e.next_page_id??null}}var I=[`acp_command`,`acp_args`,`acp_env`,`acp_model`,`acp_session_mode`,`acp_prompt_timeout`],ye=`acpserver`,be=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function L(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function R(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function xe(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Se(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function Ce(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function z(e,t){return e===M?me()&&m(e):e===N?t.enable_sub_agents===!0&&m(e):!0}function we(e){let t=new Map;for(let e of pe)t.set(e,{name:e,params:{}});for(let n of[M,N])z(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>Ce(e)))for(let r of n)z(r.name,e)&&t.set(r.name,{name:r.name,params:L(r.params)});return Array.from(t.values())}function Te(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
4
-
5
- `)}],run:!0}}function B(e){let n=ge();return{...L(e.agent_context),load_public_skills:t(),load_user_skills:!0,load_project_skills:!0,...n?{system_message_suffix:n}:{}}}function V(e){return L(e.agent_settings).agent_kind===`acp`}function Ee(e){let t=L(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function De(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=v(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Oe(e){let t=L(e.agent_settings),n={agent_kind:`acp`,agent_context:B(t)};for(let e of I){if(e===`acp_model`)continue;let r=e===`acp_command`?De(t):t[e];r!=null&&(n[e]=r)}let r=v(typeof t.acp_server==`string`?t.acp_server:void 0),i=y({configured:t.acp_model,providerDefault:r?.default_model});return i&&(n.acp_model=i),n}function ke(e){let t=L(e.agent_settings),n=L(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:_.llm_model;let r=R(n.api_key);r?n.api_key=r:delete n.api_key;let i=R(n.base_url);i?n.base_url=i:delete n.base_url;let a=L(t.mcp_config);(Object.keys(a).length===0||!(`mcpServers`in a))&&delete t.mcp_config,delete t.acp_server;for(let e of I)delete t[e];return{...t,llm:n,agent_context:B(t),tools:we(t)}}function Ae(e){return V(e)?Oe(e):ke(e)}function je(e){let{settings:t,query:r,conversationInstructions:i,plugins:a,workingDir:o}=e,s=L(t.conversation_settings),c=Te(r,i);return be.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??n()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Me(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=V(t),r=Ae(t),i=n?Ee(t):void 0,a=je(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),o={agent_settings:r,workspace:a.workspace,confirmation_policy:xe(a),max_iterations:typeof a.max_iterations==`number`?a.max_iterations:500,stuck_detection:!0,autotitle:!0,worktree:!0};i&&(o.tags={[ye]:i}),e.secretsEncrypted&&(o.secrets_encrypted=!0),e.conversationId&&(o.conversation_id=e.conversationId);let s=Se(a);if(s&&(o.security_analyzer=s),a.initial_message&&(o.initial_message=a.initial_message),a.plugins&&(o.plugins=a.plugins),a.hook_config&&(o.hook_config=a.hook_config),o.tool_module_qualnames={[j]:fe,...a.tool_module_qualnames??{}},a.agent_definitions&&(o.agent_definitions=a.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=h(c()),r={};for(let n of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(n.name)}`,description:n.description};Object.keys(t).length>0&&(e.headers=t),r[n.name]=e}o.secrets=r,n&&(o.agent_settings.agent_context={...o.agent_settings.agent_context,secrets:r})}return o}async function Ne(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-BsnKFc2x.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4,5])),[r,i]=await Promise.all([b.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return Me({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Pe(){return{hooks:[]}}var Fe=`1970-01-01T00:00:00.000Z`,Ie=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function H(){return Error(Ie)}function U(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function W(e){return typeof e==`number`?e:null}function G(e){return typeof e==`number`?e:0}function K(e){return typeof e==`string`?e:null}function q(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Fe}function Le(e){return U(e)?{prompt_tokens:G(e.prompt_tokens),completion_tokens:G(e.completion_tokens),cache_read_tokens:G(e.cache_read_tokens),cache_write_tokens:G(e.cache_write_tokens),context_window:G(e.context_window),per_turn_token:G(e.per_turn_token)}:null}function J(e){return U(e)?{accumulated_cost:W(e.accumulated_cost),max_budget_per_task:W(e.max_budget_per_task),accumulated_token_usage:Le(e.accumulated_token_usage)}:null}function Re(e){if(!U(e))return null;let t=U(e.llm)?{model:K(e.llm.model)}:null;return{kind:K(e.kind),acp_model:K(e.acp_model),llm:t}}function ze(e){return U(e)?{working_dir:K(e.working_dir)}:null}function Be(e){if(!U(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function Y(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function X(e,t){let n=Y(e),r=Y(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function Z(e){if(!U(e)||typeof e.id!=`string`||!e.id.trim())throw H();return{id:e.id.trim(),title:K(e.title),created_at:q(e,`created_at`,`createdAt`),updated_at:q(e,`updated_at`,`updatedAt`),execution_status:K(e.execution_status),sandbox_status:K(e.sandbox_status),metrics:J(e.metrics),agent:Re(e.agent),workspace:ze(e.workspace),tags:Be(e.tags),current_model_id:K(e.current_model_id),current_model_name:K(e.current_model_name)}}function Q(e){if(!Array.isArray(e))throw H();return e.map(Z)}function Ve(e){if(Array.isArray(e))return{items:Q(e),next_page_id:null};if(!U(e))throw H();return{items:Q(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var He=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function Ue(e){let t=e??`idle`;return He.has(t)?t:`idle`}function $(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var We=class{static async sendMessage(e,t,n){let a=r().backend,o=n?.conversationUrl??null,c=n?.sessionApiKey??null;if(a.kind===`cloud`){if(!o||!c){let[t]=await A([e]);o=t?.conversation_url?.trim()??null,c=t?.session_api_key?.trim()??null}if(!o||!c)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await g({backend:a,method:`POST`,hostOverride:i(o),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:c}),t}return await new x(s({conversationUrl:o,sessionApiKey:c})).sendEvent(e,t,{run:!0}),t}static async createConversation(e,t,n,i,a,o,u,d){if(r().backend.kind===`cloud`)return ie({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:t??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:n??null,parent_conversation_id:o??null,agent_type:u,sandbox_id:d??null});let f=await b.getSettings(),p=ee(),m=await Ne({settings:f,query:e,conversationInstructions:t,plugins:n,conversationId:p,workingDir:a??l(p)}),h=await new x(s()).createConversation(m);return(i?.selected_repository||a)&&E(h.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:a??null}),{id:h.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:h.id,agent_server_url:c().host,request:{initial_message:m.initial_message,plugins:n??null},created_at:h.created_at,updated_at:h.updated_at}}static async getStartTask(e){return r().backend.kind===`cloud`?de(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new d(s({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??n()}static async batchGetAppConversations(e){return e.length===0?[]:r().backend.kind===`cloud`?A(e):Q(await new x(s()).getConversations(e)).map(e=>F(e))}static async updateConversationPublicFlag(e,t){if(r().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return se(e,t)}static async updateConversationRepository(e,t,n,r){t?E(e,{...T(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):D(e);let[i]=await this.batchGetAppConversations([e]);return $(i,e)}static async readConversationFile(e,t){if(r().backend.kind===`cloud`)return ue(e,X(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),i=X(t??`${n}/.agents_tmp/PLAN.md`,n);return new f(s()).downloadTextFile(i)}static async downloadConversation(e){return r().backend.kind===`cloud`?ae(e):new f(s()).downloadTrajectory(e)}static async getHooks(e){return Pe()}static async getRuntimeConversation(e,t,n){let a=r().backend,o=a.kind===`cloud`&&t?await g({backend:a,method:`GET`,hostOverride:i(t),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:n}):await new x(s({conversationUrl:t,sessionApiKey:n})).getConversation(e),c=Z(o),l=U(o)?o.stats:null;return{id:c.id,title:c.title?.trim()?c.title:P(c.id),metrics:J(c.metrics),created_at:c.created_at,updated_at:c.updated_at,status:Ue(c.execution_status),stats:U(l)?l:{usage_to_metrics:{}}}}static async searchConversations(e=20,t){return r().backend.kind===`cloud`?re(e,t):ve(Ve(await new x(s()).searchConversations({limit:e,page_id:t,sort_order:u.UPDATED_AT_DESC})))}static async deleteConversation(e){r().backend.kind===`cloud`?await oe(e):await new x(s()).deleteConversation(e),D(e)}static async updateConversationTitle(e,t){await new x(s()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return $(n,e)}static async switchProfile(e,t){if(r().backend.kind===`cloud`)throw Error(`LLM profile switching is only supported for local agent-server backends.`);if(!e){await new p(s()).activateProfile(t);return}await new x(s()).switchProfile(e,t)}static async switchAcpModel(e,t){if(r().backend.kind===`cloud`)throw Error(`ACP model switching is only supported for local agent-server backends.`);await new x(s()).switchAcpModel(e,t)}};export{T as a,le as i,A as n,x as o,ce as r,We as t};
@@ -1 +0,0 @@
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-BNMqORFE.js";import{t as i}from"./useTranslation-DCOdSSMl.js";import{t as a}from"./utils-i18rdUj2.js";import{T as o,t as s}from"./agent-server-client-options-Bc5ZorQZ.js";import{r as c}from"./active-backend-context-cCM1vYYZ.js";import{t as l}from"./settings-client-C73C7IgV.js";import{i as u}from"./agent-server-compatibility-BlkUsrX2.js";import{r as d,t as f}from"./modal-body-BI6Ru2Qr.js";import{t as p}from"./brand-button-Br7f0kZJ.js";import{r as m,t as h}from"./backend-form-modal-Dnk33xA_.js";var g=e(t(),1),_=n();function v(){let{t:e}=i(`openhands`),{active:t,updateBackend:n}=c(),v=window.location.origin,[y,b]=g.useState(!1),[x,S]=g.useState(`idle`),[C,w]=g.useState(null),T=g.useCallback(async i=>{b(!0),S(`idle`),w(null);try{await new l(s({host:i.host,sessionApiKey:i.apiKey,timeout:5e3})).getSettings(),S(`success`),n(t.backend.id,i),o({baseUrl:i.host,sessionApiKey:i.apiKey}),window.location.reload()}catch(t){if(S(`error`),u(t,401))w(e(r.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);w(`${e(r.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}b(!1)}},[t.backend.id,n,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:a(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,d(`md`),f),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(r.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(h,{mode:`add`,backend:{...t.backend,host:v,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:T,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[x!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(m,{isConnected:x===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:x===`error`?`text-red-400`:`text-green-400`,children:x===`error`?C:e(r.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(p,{type:`submit`,variant:`secondary`,isDisabled:!t||y,testId:`${n}-submit`,className:`w-full text-center`,children:e(y?r.ONBOARDING$BACKEND_STATUS_CHECKING:r.BACKEND$CONNECT)})]})})})]})})}export{v as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,P as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as i}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js";import{o as a,t as o}from"./declaration-BNMqORFE.js";import{t as s}from"./useTranslation-DCOdSSMl.js";import{n as c,r as l}from"./custom-toast-handlers-C-SZFmto.js";import{t as u}from"./utils-i18rdUj2.js";import{c as d,i as f,t as p}from"./agent-server-client-options-Bc5ZorQZ.js";import{n as m}from"./active-backend-context-cCM1vYYZ.js";import{f as h}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js";import{n as g}from"./navigation-context-D0YWpT8d.js";import{t as _}from"./navigation-link-Cn7KP3c5.js";import{n as v,r as y}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js";import{t as b}from"./proxy-CxydCnis.js";import{t as x}from"./u-edit-CFvXHqZk.js";import{t as S}from"./terminal-RmuaSdhJ.js";import{t as C}from"./use-user-conversation-C6hrMMtn.js";import{t as w}from"./toggle-switch-Pvyp2RAN.js";import{t as T}from"./x-mark-CrpjscNc.js";import{t as E}from"./clock-BRjCgHTc.js";import{_ as ee,a as D,b as O,c as k,g as te,h as A,i as ne,l as j,n as re,o as M,p as ie,r as ae,s as N,t as oe,u as P,v as se,y as ce}from"./edit-automation-modal-BGzR3nfZ.js";import{t as F}from"./automation-IdgZq6ZK.js";var I=e(t()),L=a(),le=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15.75 19.5 8.25 12l7.5-7.5`})});function R(){let{t:e}=s(`openhands`);return(0,L.jsxs)(_,{to:`/automations`,className:`inline-flex items-center gap-1.5 text-sm text-muted hover:text-foreground`,children:[(0,L.jsx)(le,{className:`size-4`}),e(o.AUTOMATIONS$DETAIL$BACK_TO_LIST)]})}var ue=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function z({active:e}){let{t}=s(`openhands`);return(0,L.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:u(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?o.AUTOMATIONS$DETAIL$ACTIVE:o.AUTOMATIONS$DETAIL$INACTIVE)})}function B({automation:e,onToggle:t,onEdit:n,onDelete:r,onRunNow:i,isRunningNow:a=!1}){let{t:c}=s(`openhands`),l=j(`manage_automations`),u=[...n?[{label:c(o.AUTOMATIONS$EDIT),icon:(0,L.jsx)(x,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),icon:(0,L.jsx)(N,{className:`size-4`}),onClick:t},{label:c(o.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,L.jsx)(ue,{className:`size-4`}),onClick:()=>{O.downloadTarball(e.id,e.name)}},{label:c(o.AUTOMATIONS$DELETE),icon:(0,L.jsx)(M,{className:`size-4`}),onClick:r}];return(0,L.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,L.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,L.jsx)(z,{active:e.enabled})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&i&&(0,L.jsx)(`button`,{type:`button`,className:`rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:a||!e.enabled,onClick:i,children:a?`Starting…`:`Run now`}),l&&(0,L.jsx)(w,{enabled:e.enabled,label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),onToggle:t}),l&&(0,L.jsx)(P,{items:u})]})]})})}function V({icon:e,title:t,children:n}){return(0,L.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,L.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,L.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,L.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}function H({prompt:e}){let{t}=s(`openhands`);return(0,L.jsx)(V,{icon:(0,L.jsx)(S,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PROMPT),children:(0,L.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6 text-content`,children:e})})}var U=e=>(0,L.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),de=e=>(0,L.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,L.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,L.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,L.jsx)(`circle`,{cx:9,cy:18,r:2})]}),W=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),G=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),fe=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function K({icon:e,label:t,children:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,L.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,L.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function pe({branch:e}){return(0,L.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}function me({automation:e}){let{t}=s(`openhands`),n=e.trigger.schedule??``;e.trigger.schedule_human&&(n=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let r=e.trigger.type===`cron`?`Schedule`:e.trigger.type;return(0,L.jsx)(V,{icon:(0,L.jsx)(U,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,L.jsx)(K,{icon:(0,L.jsx)(de,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,L.jsx)(pe,{branch:e.branch})]})}),(0,L.jsx)(K,{icon:(0,L.jsx)(W,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$TRIGGER),children:r}),(0,L.jsx)(K,{icon:(0,L.jsx)(G,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$SCHEDULE),children:n}),(0,L.jsx)(K,{icon:(0,L.jsx)(k,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$MODEL),children:e.model??`Active profile`}),e.notification&&(0,L.jsx)(K,{icon:(0,L.jsx)(fe,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var he=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function q({name:e}){return(0,L.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function ge({plugins:e}){let{t}=s(`openhands`);return(0,L.jsx)(V,{icon:(0,L.jsx)(he,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PLUGINS),children:(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,L.jsx)(q,{name:e},e))})})}var J=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function Y(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function _e(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),s=Math.floor(r/864e5);return i<1?n(o.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(o.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(o.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):s===1?n(o.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(o.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):Y(e,t)}function ve({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=s(`openhands`),i=r.language;return(0,L.jsx)(V,{icon:(0,L.jsx)(J,{className:`size-4`}),title:n(o.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,L.jsx)(K,{icon:(0,L.jsx)(G,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$CREATED),children:Y(e,i)}),(0,L.jsx)(K,{icon:(0,L.jsx)(E,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$LAST_RUN),children:t?_e(t,i,n):n(o.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var ye=e=>(0,L.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,L.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),be={[F.COMPLETED]:{label:o.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[F.FAILED]:{label:o.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[F.PENDING]:{label:o.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[F.RUNNING]:{label:o.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function xe({status:e}){switch(e){case F.COMPLETED:return(0,L.jsx)(W,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case F.FAILED:return(0,L.jsx)(ye,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,L.jsx)(E,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Se({status:e}){let{t}=s(`openhands`),n=be[e];return(0,L.jsxs)(`span`,{className:u(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,L.jsx)(xe,{status:e}),t(n.label)]})}var Ce=20;function we(e){return e.kind===`BashOutput`}var Te=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<Ce;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{we(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=d().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),b({backend:r,method:`GET`,hostOverride:f(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new h(p({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Ee=[`bash-command-logs`];function De(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function Oe(e){if(!y.isAxiosError(e))return null;if(!e.response)return`unreachable`;let t=e.response.status;return t===404||t>=500?`unreachable`:null}function ke(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,a=m(),o=C(r?t??null:null),s=o.data,c=s?.conversation_url??null,l=s?.session_api_key??null,u=a.backend.kind===`cloud`,d=o.isFetched,f=null,p=!1;u&&d&&(s?f=De(s.sandbox_status)??(s.conversation_url?null:`missing`):p=!0);let h=r&&!!n&&(u?!!c:!0)&&!f&&!p,g=i({queryKey:[...Ee,n,c,l,a.backend.id,a.orgId],queryFn:()=>Te.listOutputs(c,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Oe(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&o.isPending,conversationMissing:p,sandboxIssue:v}}var Ae={missing:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function X(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function je({conversationId:e,bashCommandId:t,isOpen:n,onClose:r}){let{t:i}=s(`openhands`),[a,c]=(0,I.useState)(`stdout`),{data:l,isFetching:u,isResolvingConversation:d,sandboxIssue:f,conversationMissing:p,error:m}=ke({conversationId:e,bashCommandId:t,enabled:n});(0,I.useEffect)(()=>{n&&c(`stdout`)},[n,t]),(0,I.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:h,stderr:g}=(0,I.useMemo)(()=>l?{stdout:X(l,`stdout`),stderr:X(l,`stderr`)}:{stdout:``,stderr:``},[l]);if(!n)return null;let _=d||u&&!l,v=!t,y=a===`stdout`?h:g,b=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,x=`border-[var(--oh-primary)] text-white`,S=`border-transparent text-muted hover:text-content`;return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,L.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":i(o.AUTOMATIONS$CANCEL),children:(0,L.jsx)(T,{className:`size-5`})}),(0,L.jsx)(`h2`,{className:`pr-8 text-lg font-medium text-white`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,L.jsxs)(`div`,{role:`tablist`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:a===`stdout`?0:-1,onClick:()=>c(`stdout`),className:`${b} ${a===`stdout`?x:S}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:a===`stderr`?0:-1,onClick:()=>c(`stderr`),className:`${b} ${a===`stderr`?x:S}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,L.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${a}`,"aria-labelledby":`run-logs-tab-${a}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[v&&(0,L.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!v&&p&&(0,L.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!v&&!p&&f&&(0,L.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${f}`,className:`text-muted italic`,children:i(Ae[f])}),!v&&!p&&!f&&_&&(0,L.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!v&&!p&&!f&&!_&&m&&!l&&(0,L.jsxs)(`p`,{className:`text-danger`,children:[i(o.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(m)]}),!_&&!f&&l&&(0,L.jsx)(`pre`,{"data-testid":`run-logs-output-${a}`,className:`whitespace-pre-wrap break-words ${a===`stderr`?`text-danger`:`text-content`}`,children:y.length>0?y:(0,L.jsx)(`span`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]})]})]})}function Me(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Ne(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function Pe(e){return`/conversations/${e}`}function Fe({run:e}){let{t,i18n:n}=s(`openhands`),r=!!e.conversation_id,i=!!e.bash_command_id,a=e.status===F.COMPLETED||e.status===F.FAILED,c=!r&&a,[l,u]=(0,I.useState)(!1),[d]=(0,I.useState)(()=>new Date().toISOString()),f=Me(Ne(e.started_at)?d:e.started_at,n.language),p=i?(0,L.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),u(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":t(o.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:f}),title:t(o.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,L.jsx)(S,{className:`size-4`})}):null,m=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`span`,{className:`text-sm text-content`,children:f}),c&&(0,L.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,t(o.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,L.jsx)(Se,{status:e.status})]})]});return(0,L.jsxs)(L.Fragment,{children:[r&&e.conversation_id?(0,L.jsx)(`a`,{href:Pe(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":`View conversation for run at ${f}`,children:m}):(0,L.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:m}),i&&(0,L.jsx)(je,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:l,onClose:()=>u(!1)})]})}var Z=20;function Ie({automationId:e}){let{t}=s(`openhands`),[n,r]=(0,I.useState)(Z),{data:i,isLoading:a}=ce({id:e,limit:n,offset:0}),c=i?i.total>i.runs.length:!1;return(0,L.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,L.jsx)(`span`,{className:`size-4 text-muted`,children:(0,L.jsx)(J,{className:`size-4`})}),(0,L.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(o.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),a&&(0,L.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,L.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,L.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!a&&i?.runs.length===0&&(0,L.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(o.AUTOMATIONS$DETAIL$NO_RUNS)}),!a&&i&&i.runs.length>0&&(0,L.jsxs)(`div`,{children:[i.runs.map((e,t)=>(0,L.jsx)(`div`,{className:t>0?`border-t border-[var(--oh-border)]`:``,children:(0,L.jsx)(Fe,{run:e})},e.id)),c&&(0,L.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,L.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+Z),className:`text-sm text-muted hover:text-foreground`,children:t(o.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function Q({className:e}){return(0,L.jsx)(`div`,{className:u(`animate-pulse rounded bg-surface-raised`,e)})}function $(){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,L.jsx)(Q,{className:`h-5 w-40`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(Q,{className:`h-6 w-48`}),(0,L.jsx)(Q,{className:`h-6 w-16 rounded-full`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Q,{className:`h-6 w-11 rounded-full`}),(0,L.jsx)(Q,{className:`h-8 w-8`})]})]}),(0,L.jsx)(Q,{className:`h-5 w-96`}),(0,L.jsx)(Q,{className:`h-36 w-full rounded-2xl`}),(0,L.jsx)(Q,{className:`h-72 w-full rounded-2xl`}),(0,L.jsx)(Q,{className:`h-32 w-full rounded-2xl`}),(0,L.jsx)(Q,{className:`h-40 w-full rounded-2xl`})]})}function Le(){let{t:e}=s(`openhands`);return(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,L.jsx)(D,{className:`size-12 text-muted`}),(0,L.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,L.jsx)(`div`,{className:`mt-6`,children:(0,L.jsx)(R,{})})]})}var Re=n(function(){let{t:e}=s(`openhands`),{automationId:t}=r(),{navigate:n}=g(),[i,a]=(0,I.useState)(!1),[u,d]=(0,I.useState)(!1),{data:f,isLoading:p,refetch:h}=ie(),_=f?.status===`ok`,y=m(),b=(0,I.useRef)(y.backend.id).current!==y.backend.id,{data:x,isLoading:S,isError:C,error:w,refetch:T}=se({id:t??``,enabled:_&&!b}),E=ee(),D=A(),O=te(),k=C&&v(w)&&w.response?.status===404;if(p)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)($,{})})});if(!_)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)(ae,{onRetry:h})})});if(S)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)($,{})})});if(k)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)(Le,{})})});if(C||!x)return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsx)(ne,{onRetry:()=>T()})})});let j=()=>{E.mutate({id:x.id,enabled:!x.enabled})},M=()=>{D.mutate(x.id,{onSuccess:()=>{n?.(`/automations`)}})},N=()=>{O.mutate(x.id,{onSuccess:()=>{l(e(o.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{c(v(t)?t.response?.data?.message||t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR):t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR))}})},P=y.backend.kind===`local`;return(0,L.jsx)(`div`,{className:`min-h-full`,children:(0,L.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(R,{}),(0,L.jsx)(B,{automation:x,onToggle:j,onEdit:P?()=>d(!0):void 0,onDelete:()=>a(!0),onRunNow:N,isRunningNow:O.isPending}),x.prompt&&(0,L.jsx)(H,{prompt:x.prompt}),(0,L.jsx)(me,{automation:x}),x.plugins&&x.plugins.length>0&&(0,L.jsx)(ge,{plugins:x.plugins}),(0,L.jsx)(ve,{createdAt:x.created_at,lastRunAt:x.last_triggered_at}),(0,L.jsx)(Ie,{automationId:x.id}),(0,L.jsx)(re,{automationName:x.name,isOpen:i,onConfirm:M,onCancel:()=>a(!1)}),P&&(0,L.jsx)(oe,{automation:x,isOpen:u,onClose:()=>d(!1)})]})})})});export{Re as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as r}from"./react-dom-hVBnwgwZ.js";import{o as i,t as a}from"./declaration-BNMqORFE.js";import{t as o}from"./Trans-Cvm_-SMi.js";import{t as s}from"./useTranslation-DCOdSSMl.js";import{t as c}from"./createLucideIcon-Ddu8jDOQ.js";import{t as l}from"./check-CYxAHs85.js";import{n as u,r as d}from"./custom-toast-handlers-C-SZFmto.js";import{a as f,c as p,i as m,o as h,r as g,s as _}from"./circle-plus-check-toggle-P7ZZToV4.js";import{t as v}from"./utils-i18rdUj2.js";import{n as ee}from"./active-backend-context-cCM1vYYZ.js";import{t as y}from"./modal-backdrop-BAbgYsqB.js";import{t as b}from"./brand-button-Br7f0kZJ.js";import{n as x}from"./navigation-context-D0YWpT8d.js";import{t as S}from"./styled-tooltip-CBzrri6o.js";import{n as te}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js";import{t as C}from"./modal-close-button-t1Gh3qmL.js";import{n as w,t as T}from"./context-menu-list-item-CWNFpuiC.js";import{t as E}from"./u-edit-CFvXHqZk.js";import{t as D}from"./folder-ZZJVGgd7.js";import{t as O}from"./search-27Owlc3A.js";import{n as k,t as ne}from"./recommended-automations-launcher-CgV8FyPK.js";import{n as A}from"./skill-card-pill-row-DF1axQCG.js";import{t as j}from"./clock-BRjCgHTc.js";import{n as M,t as N}from"./use-launch-skill-in-chat-fNN_xGZG.js";import{_ as re,c as P,d as F,f as I,g as ie,h as ae,i as oe,l as L,m as se,n as ce,o as R,p as le,r as ue,s as z,t as de,u as B}from"./edit-automation-modal-BGzR3nfZ.js";var fe=c(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),V=c(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),pe=c(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),H=e(t()),U=i();function me({value:e,onChange:t,className:n}){let{t:r}=s(`openhands`);return(0,U.jsxs)(`div`,{className:v(`relative flex min-w-0 flex-1 items-center`,`h-9 rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`,n),children:[(0,U.jsx)(O,{className:`ml-3 size-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,U.jsx)(`input`,{type:`text`,value:e,onChange:e=>t(e.target.value),placeholder:r(a.AUTOMATIONS$SEARCH_PLACEHOLDER),"aria-label":r(a.AUTOMATIONS$SEARCH_PLACEHOLDER),className:`min-w-0 flex-1 border-0 bg-transparent px-3 text-sm text-white outline-none placeholder:text-tertiary-alt`})]})}var W=e=>(0,U.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,U.jsx)(`g`,{clipPath:`url(#clip0_8467_30872)`,children:(0,U.jsx)(`path`,{d:`M6.26693 21.4874L6.25583 21.4951L6.24514 21.5033C5.95991 21.7227 5.5 21.5308 5.5 21.0996V2.89961C5.5 2.4684 5.95991 2.2765 6.24514 2.49592L6.25634 2.50452L6.26799 2.51249L19.518 11.5625L19.518 11.5625L19.5226 11.5656C19.8258 11.7677 19.8258 12.1815 19.5226 12.3836L19.5226 12.3835L19.5169 12.3874L6.26693 21.4874Z`,fill:`currentColor`,stroke:`currentColor`})}),(0,U.jsx)(`defs`,{children:(0,U.jsx)(`clipPath`,{id:`clip0_8467_30872`,children:(0,U.jsx)(`rect`,{width:24,height:24,fill:`white`})})})]});function G(e,t){let n=[];return e.repository&&n.push({id:`repository`,node:(0,U.jsxs)(`span`,{className:v(h,`gap-1`),children:[(0,U.jsx)(D,{className:`size-3 shrink-0`}),e.repository]})}),n.push({id:`schedule`,node:(0,U.jsxs)(`span`,{className:v(h,`gap-1`),children:[(0,U.jsx)(j,{className:`size-3 shrink-0`}),t]})}),e.model&&n.push({id:`model`,node:(0,U.jsxs)(`span`,{className:v(h,`gap-1`),children:[(0,U.jsx)(P,{className:`size-3 shrink-0`}),e.model]})}),n}function K({automation:e,t,canManage:n,onRunNow:r,isRunPending:i,onView:o,onEdit:s,onToggle:c,onDelete:l}){return[...n?[{label:t(a.AUTOMATIONS$RUN_NOW),icon:(0,U.jsx)(W,{className:`size-4`}),onClick:()=>r(e.id),disabled:i||!e.enabled}]:[],{label:t(a.COMMON$VIEW),icon:(0,U.jsx)(fe,{className:`size-4`,"aria-hidden":!0}),onClick:o},...n&&s?[{label:t(a.AUTOMATIONS$EDIT),icon:(0,U.jsx)(E,{className:`size-4`}),onClick:()=>s(e.id)}]:[],...n?[{label:e.enabled?t(a.AUTOMATIONS$TURN_OFF):t(a.AUTOMATIONS$TURN_ON),icon:(0,U.jsx)(z,{className:`size-4`}),onClick:()=>c(e.id,e.enabled)},{label:t(a.AUTOMATIONS$DELETE),icon:(0,U.jsx)(R,{className:`size-4`}),onClick:()=>l(e.id)}]:[]]}function he({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onEdit:o}){let{navigate:c}=x(),{t:l}=s(`openhands`),u=L(`manage_automations`),d=e.trigger.schedule_human||e.trigger.type,p=(0,H.useMemo)(()=>G(e,d),[e,d]),m=()=>{c?.(`/automations/${e.id}`)},h=K({automation:e,t:l,canManage:u,onRunNow:n,isRunPending:r,onView:m,onEdit:o,onToggle:t,onDelete:i}),g=()=>{m()};return(0,U.jsxs)(`div`,{role:`link`,tabIndex:0,"data-testid":`automation-card-${e.id}`,onClick:g,onKeyDown:e=>{e.key===`Enter`&&g()},className:v(`flex min-w-0 flex-col gap-3 overflow-hidden p-4 text-left`,_,f),children:[(0,U.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,U.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),e.prompt?(0,U.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.prompt}):null]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[u?(0,U.jsxs)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-busy":r,disabled:r||!e.enabled,onClick:t=>{t.stopPropagation(),n(e.id)},className:I,children:[(0,U.jsx)(W,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),l(a.AUTOMATIONS$RUN_NOW)]}):null,(0,U.jsx)(B,{items:h})]})]}),p.length>0?(0,U.jsx)(A,{pills:p,testId:`automation-pills-${e.id}`}):null]})}var ge=`overflow-hidden rounded-md border border-[var(--oh-border)] bg-base-secondary`,q=[`h-11`,`border-t border-[var(--oh-border)] transition-colors`].join(` `),_e=`hover:bg-interactive-hover-low outline-none focus:outline-none focus-visible:outline-none focus-visible:bg-interactive-hover-low`,J=`px-3 align-middle`,ve=[q,_e,`cursor-pointer`].join(` `),ye=`openhands-automations-view`;function be(){return typeof window>`u`?`grid`:window.localStorage.getItem(`openhands-automations-view`)===`list`?`list`:`grid`}function xe(e){window.localStorage.setItem(ye,e)}function Se({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onEdit:o}){let{navigate:c}=x(),{t:l}=s(`openhands`),u=L(`manage_automations`),d=e.trigger.schedule_human||e.trigger.type,f=(0,H.useMemo)(()=>G(e,d),[e,d]),p=()=>{c?.(`/automations/${e.id}`)},m=K({automation:e,t:l,canManage:u,onRunNow:n,isRunPending:r,onView:p,onEdit:o,onToggle:t,onDelete:i}),h=()=>{p()};return(0,U.jsxs)(`tr`,{"data-testid":`automation-list-row-${e.id}`,onClick:h,onKeyDown:e=>{e.key===`Enter`&&h()},tabIndex:0,className:v(ve,`cursor-pointer`),children:[(0,U.jsx)(`td`,{className:J,children:(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate text-sm font-medium text-white`,title:e.name,children:e.name}),f.length>0?(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(A,{pills:f,testId:`automation-pills-${e.id}`})}):null]})}),(0,U.jsx)(`td`,{className:v(`w-0 whitespace-nowrap`,J),children:(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[u?(0,U.jsx)(S,{content:l(a.AUTOMATIONS$RUN_NOW),placement:`top`,children:(0,U.jsx)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-label":l(a.AUTOMATIONS$RUN_NOW),"aria-busy":r,disabled:r||!e.enabled,onClick:t=>{t.stopPropagation(),n(e.id)},className:F,children:(0,U.jsx)(W,{className:`size-4 shrink-0`,"aria-hidden":!0})})}):null,(0,U.jsx)(B,{items:m})]})})]})}function Y({title:e,count:t,automations:n,view:r,onToggle:i,onRunNow:a,runPendingId:o=null,onDelete:s,onEdit:c}){return n.length===0?null:(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center`,children:[(0,U.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e}),(0,U.jsx)(k,{count:t})]}),r===`grid`?(0,U.jsx)(`div`,{className:v(`mt-3`,m),children:(0,U.jsx)(`div`,{className:g,children:n.map(e=>(0,U.jsx)(he,{automation:e,onToggle:i,onRunNow:a,isRunPending:o===e.id,onDelete:s,onEdit:c},e.id))})}):(0,U.jsx)(`div`,{className:v(ge,`mt-3`),children:(0,U.jsx)(`table`,{className:`w-full min-w-full [&>tbody>tr:first-child]:border-t-0`,children:(0,U.jsx)(`tbody`,{children:n.map(e=>(0,U.jsx)(Se,{automation:e,onToggle:i,onRunNow:a,isRunPending:o===e.id,onDelete:s,onEdit:c},e.id))})})})]})}var Ce=e(r(),1),X=[{value:`grid`,icon:V,labelKey:a.AUTOMATIONS$VIEW_GRID,testId:`automations-view-toggle-grid`},{value:`list`,icon:pe,labelKey:a.AUTOMATIONS$VIEW_LIST,testId:`automations-view-toggle-list`}];function we({icon:e,label:t,isSelected:n}){return(0,U.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)] transition-colors group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:size-4 [&_svg]:text-current`,"aria-hidden":!0,children:(0,U.jsx)(e,{})}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,U.jsx)(l,{className:`size-4 shrink-0`,"aria-hidden":!0}):null]})}function Te({view:e,onChange:t,disabled:n=!1}){let{t:r}=s(`openhands`),[i,o]=(0,H.useState)(!1),[c,l]=(0,H.useState)(),u=(0,H.useRef)(null),d=(0,H.useRef)(null),f=(X.find(t=>t.value===e)??X[0]).icon;(0,H.useLayoutEffect)(()=>{if(!i||!u.current)return;let e=()=>{let e=u.current?.getBoundingClientRect();e&&l({position:`fixed`,zIndex:9999,top:e.bottom+4,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[i]),(0,H.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;u.current?.contains(t)||d.current?.contains(t)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let p=i&&c?(0,U.jsx)(w,{ref:d,theme:`popover`,className:`min-w-[10rem]`,children:X.map(n=>(0,U.jsx)(`li`,{children:(0,U.jsx)(T,{testId:n.testId,onClick:()=>{t(n.value),o(!1)},className:`group`,children:(0,U.jsx)(we,{icon:n.icon,label:r(n.labelKey),isSelected:e===n.value})})},n.value))}):null;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{ref:u,type:`button`,"data-testid":`automations-view-toggle`,"aria-label":r(a.AUTOMATIONS$VIEW_MODE),"aria-haspopup":`menu`,"aria-expanded":i,"aria-disabled":n,disabled:n,onClick:()=>{n||o(e=>!e)},className:v(`inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-[var(--oh-border)] bg-base-secondary text-white transition-colors hover:bg-[var(--oh-interactive-hover)] focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-base-secondary`),children:(0,U.jsx)(f,{className:`size-4`,"aria-hidden":!0})}),i&&c&&typeof document<`u`?Ce.createPortal((0,U.jsx)(`div`,{style:c,children:p}),document.body):null]})}function Z(){return(0,U.jsxs)(`div`,{"data-testid":`automation-card-skeleton`,className:`${_} border border-transparent p-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,U.jsx)(`div`,{className:`h-5 w-40 animate-pulse rounded bg-surface-raised`}),(0,U.jsx)(`div`,{className:`h-5 w-10 animate-pulse rounded-full bg-surface-raised`})]}),(0,U.jsx)(`div`,{className:`mt-2 h-4 w-72 animate-pulse rounded bg-surface-raised`}),(0,U.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,U.jsx)(`div`,{className:`h-7 w-32 animate-pulse rounded-full bg-surface-raised`}),(0,U.jsx)(`div`,{className:`h-7 w-28 animate-pulse rounded-full bg-surface-raised`}),(0,U.jsx)(`div`,{className:`h-7 w-24 animate-pulse rounded-full bg-surface-raised`})]})]})}var Ee=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,U.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m19.5 8.25-7.5 7.5-7.5-7.5`})}),De=`https://docs.openhands.dev/openhands/usage/automations/overview`;function Oe({children:e}){return(0,U.jsx)(`span`,{className:`whitespace-nowrap`,children:e})}function ke({children:e}){return(0,U.jsx)(`code`,{"data-testid":`automations-create-instructions-example`,className:v(`mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white`),children:e})}function Ae({children:e}){return(0,U.jsx)(U.Fragment,{children:e})}var je={example:(0,U.jsx)(Oe,{}),cmd:(0,U.jsx)(ke,{}),punct:(0,U.jsx)(Ae,{})};function Q({onLaunch:e}={}){let{t}=s(`openhands`),n=N();return(0,U.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,U.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[(0,U.jsx)(o,{ns:`openhands`,i18nKey:a.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC,components:je}),` `,t(a.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE)]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsx)(`a`,{href:De,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-muted underline transition-colors hover:text-foreground`,children:t(a.AUTOMATIONS$EMPTY_LEARN_MORE)}),(0,U.jsx)(b,{type:`button`,variant:`primary`,testId:`automations-create-automation`,onClick:()=>{n(t(a.AUTOMATIONS$CREATE_AUTOMATION_PROMPT),e)},startContent:(0,U.jsx)(M,{className:`size-4`,"aria-hidden":!0}),children:t(a.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})]})]})}function Me({collapsible:e=!1}){let{t}=s(`openhands`),[n,r]=(0,H.useState)(!e);return e?(0,U.jsxs)(`div`,{className:`w-full rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`flex w-full items-center justify-between rounded-lg p-4 text-left transition-colors hover:bg-surface-raised`,children:[(0,U.jsx)(`span`,{className:`text-sm font-normal text-content`,children:t(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,U.jsx)(Ee,{className:v(`size-5 text-muted transition-transform`,n&&`rotate-180`)})]}),n?(0,U.jsx)(`div`,{className:`px-4 pb-4`,children:(0,U.jsx)(Q,{})}):null]}):(0,U.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[(0,U.jsx)(`h3`,{className:`text-center text-sm font-medium text-content`,children:t(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,U.jsx)(`div`,{className:`mt-4`,children:(0,U.jsx)(Q,{})})]})}function Ne(){let{t:e}=s(`openhands`);return(0,U.jsxs)(`div`,{"data-testid":`automations-empty`,className:p,children:[(0,U.jsx)(`p`,{className:`text-sm text-white`,children:e(a.AUTOMATIONS$EMPTY)}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-tertiary-light`,children:e(a.AUTOMATIONS$EMPTY_HINT)}),(0,U.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,U.jsx)(Me,{})})]})}function Pe({isOpen:e,onClose:t}){let{t:n}=s(`openhands`);return e?(0,U.jsx)(y,{onClose:t,"aria-label":n(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE),children:(0,U.jsxs)(`div`,{"data-testid":`add-automation-modal`,className:`relative flex w-full max-w-lg flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,U.jsx)(C,{onClose:t,testId:`add-automation-modal-close`}),(0,U.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,U.jsx)(`h2`,{id:`add-automation-modal-title`,className:`pr-6 text-lg font-semibold`,children:n(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)})}),(0,U.jsx)(`div`,{className:`px-6 pb-6`,children:(0,U.jsx)(Q,{onLaunch:t})})]})}):null}var $=50,Fe=n(function(){let{t:e}=s(`openhands`),[t,n]=(0,H.useState)(``),[r,i]=(0,H.useState)(()=>be()),[o,c]=(0,H.useState)($),[l,f]=(0,H.useState)(null),[p,m]=(0,H.useState)(null),[h,g]=(0,H.useState)(!1),_=ee().backend.kind===`local`,{data:v,isLoading:y,refetch:x}=le(),S=v?.status===`ok`,{data:C,isLoading:w,isError:T,refetch:E}=se({limit:o,offset:0,enabled:S}),D=re(),O=ae(),k=ie(),A=(0,H.useMemo)(()=>{if(!C?.automations)return[];let e=t.toLowerCase();return e?C.automations.filter(t=>t.name.toLowerCase().includes(e)||(t.prompt??``).toLowerCase().includes(e)||t.repository?.toLowerCase().includes(e)||t.model?.toLowerCase().includes(e)):C.automations},[C?.automations,t]),j=(0,H.useMemo)(()=>A.filter(e=>e.enabled),[A]),M=(0,H.useMemo)(()=>A.filter(e=>!e.enabled),[A]),N=(e,t)=>{D.mutate({id:e,enabled:!t})},P=t=>{k.mutate(t,{onSuccess:()=>{d(e(a.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{u(te(t)?t.response?.data?.message||t.message||e(a.AUTOMATIONS$RUN_NOW_ERROR):t.message||e(a.AUTOMATIONS$RUN_NOW_ERROR))}})},F=e=>{let t=C?.automations.find(t=>t.id===e);t&&f({id:e,name:t.name})},I=e=>{let t=C?.automations.find(t=>t.id===e);t&&m(t)},L=()=>{l&&(O.mutate(l.id),f(null))},R=(0,H.useCallback)(e=>{i(e),xe(e)},[]),z=C?C.total>C.automations.length:!1,B=!w&&!T&&C?.automations.length===0;return y?(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,U.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e(a.AUTOMATIONS$TITLE)}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(a.AUTOMATIONS$SUBTITLE)}),(0,U.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,U.jsx)(Z,{},`skeleton-${String(t)}`))})]})}):S?(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:e(a.AUTOMATIONS$TITLE)}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(a.AUTOMATIONS$SUBTITLE)})]}),(0,U.jsx)(b,{type:`button`,variant:`secondary`,testId:`automations-add-automation`,className:`shrink-0 whitespace-nowrap`,onClick:()=>g(!0),children:e(a.AUTOMATIONS$ADD_AUTOMATION)})]}),(0,U.jsxs)(`div`,{className:`mt-6 flex items-stretch gap-2`,children:[(0,U.jsx)(me,{value:t,onChange:n}),(0,U.jsx)(Te,{view:r,onChange:R,disabled:B})]}),(0,U.jsxs)(`div`,{className:`mt-6 flex flex-col gap-6`,children:[w&&(0,U.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,U.jsx)(Z,{},`skeleton-${String(t)}`))}),T&&!w&&(0,U.jsx)(oe,{onRetry:E}),B&&(0,U.jsx)(Ne,{}),!w&&!T&&C&&C.automations.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Y,{title:e(a.AUTOMATIONS$ACTIVE),count:j.length,automations:j,view:r,onToggle:N,onRunNow:P,runPendingId:k.isPending?k.variables??null:null,onDelete:F,onEdit:_?I:void 0}),(0,U.jsx)(Y,{title:e(a.AUTOMATIONS$INACTIVE),count:M.length,automations:M,view:r,onToggle:N,onRunNow:P,runPendingId:k.isPending?k.variables??null:null,onDelete:F,onEdit:_?I:void 0}),z&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(e=>e+$),className:`self-center rounded-lg border border-[var(--oh-border)] px-6 py-2 text-sm text-white hover:bg-surface-raised`,children:e(a.AUTOMATIONS$LOAD_MORE)})]})]}),(0,U.jsx)(`div`,{className:`mt-6`,children:(0,U.jsx)(ne,{query:t})}),(0,U.jsx)(ce,{automationName:l?.name??``,isOpen:l!==null,onConfirm:L,onCancel:()=>f(null)}),p&&(0,U.jsx)(de,{automation:p,isOpen:p!==null,onClose:()=>m(null)}),(0,U.jsx)(Pe,{isOpen:h,onClose:()=>g(!1)})]})}):(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,U.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e(a.AUTOMATIONS$TITLE)}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(a.AUTOMATIONS$SUBTITLE)}),(0,U.jsx)(ue,{onRetry:x})]})})});export{Fe as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js";import{i as r,r as i}from"./organization-service.api-DzYTHTYC.js";import{o as a,t as o}from"./declaration-BNMqORFE.js";import{t as s}from"./useTranslation-DCOdSSMl.js";import{t as c}from"./utils-i18rdUj2.js";import{i as l,n as u,o as d,r as f}from"./health-store-BDC2rM-X.js";import{t as p,u as m}from"./agent-server-client-options-Bc5ZorQZ.js";import{r as h}from"./active-backend-context-cCM1vYYZ.js";import{t as g}from"./server-client-DyAQ3NZ_.js";import{t as _}from"./modal-backdrop-BAbgYsqB.js";import{r as v,t as y}from"./modal-body-BI6Ru2Qr.js";import{t as b}from"./brand-button-Br7f0kZJ.js";import{n as x}from"./navigation-context-D0YWpT8d.js";import{n as S}from"./proxy-CxydCnis.js";import{t as C}from"./modal-close-button-t1Gh3qmL.js";import{t as w}from"./settings-input-Bn7F5C75.js";var T=a(),E=e(t(),1),D=1e4,O=4e3;async function k(e){return e.kind===`cloud`?(await i(e),!0):(await new g(p({host:e.host,sessionApiKey:e.apiKey||null,timeout:O})).getServerInfo(),!0)}function A(e,t={}){let{probeDisabledOnce:n=!1}=t,i=E.useSyncExternalStore(d,u,u),a=r({queries:e.map(e=>{let t=i[e.id]?.disabled===!0,r=!t||n;return{queryKey:[`backend-health`,e.id,e.kind,e.host,e.apiKey??``],queryFn:async()=>{try{let t=await k(e);return l(e.id),t}catch(t){throw f(e.id,t),t}},enabled:r,refetchInterval:t?!1:D,refetchIntervalInBackground:!1,refetchOnMount:t&&n?`always`:!0,refetchOnReconnect:!t,refetchOnWindowFocus:!t,retry:!1,staleTime:t?0:D,meta:{disableToast:!0}}})}),o={};return e.forEach((e,t)=>{let n=a[t],r=i[e.id],s=r?.disabled===!0,c=r?.consecutiveFailures??0,l=r?.lastError??null,u;u=s?!1:n.isSuccess?!0:n.isError?!1:null,o[e.id]={isConnected:u,consecutiveFailures:c,lastError:l,disabled:s}}),o}var j=e=>(0,T.jsxs)(`svg`,{width:1365,height:1365,viewBox:`0 -24 148 148`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,T.jsx)(`path`,{d:`M71.7542 16.863V2.97414C71.7542 1.82355 72.6872 0.890503 73.8378 0.890503C74.9884 0.890503 75.9214 1.82355 75.9214 2.97414V16.863C75.9214 18.0136 74.9884 18.9466 73.8378 18.9466C72.6872 18.9466 71.7542 18.0136 71.7542 16.863Z`,fill:`white`}),(0,T.jsx)(`path`,{d:`M82.5272 18.9329L89.4716 6.90477C90.0469 5.90832 91.3215 5.5668 92.3179 6.1421C93.3144 6.7174 93.6559 7.99197 93.0806 8.98841L86.1362 21.0165C85.5609 22.0129 84.2863 22.3545 83.2899 21.7792C82.2934 21.2039 81.9519 19.9293 82.5272 18.9329Z`,fill:`white`}),(0,T.jsx)(`path`,{d:`M65.1481 18.9329L58.2037 6.90477C57.6284 5.90832 56.3538 5.5668 55.3574 6.1421C54.3609 6.7174 54.0194 7.99197 54.5947 8.98841L61.5391 21.0165C62.1144 22.0129 63.389 22.3545 64.3854 21.7792C65.3819 21.2039 65.7234 19.9293 65.1481 18.9329Z`,fill:`white`}),(0,T.jsx)(`path`,{d:`M140.606 62.0292C140.606 58.409 141.583 47.6748 141.89 44.1323C142.097 41.7374 141.809 40.4247 141.424 39.7542C141.141 39.2626 140.699 38.915 139.634 38.8436C138.865 38.7921 138.027 39.0114 137.401 39.5761C136.814 40.1052 136.159 41.1682 136.159 43.3176L136.155 43.4388L135.198 59.758C135.164 60.3451 134.883 60.8911 134.424 61.2599C133.966 61.6284 133.374 61.7859 132.793 61.6941L122.764 60.1068L111.948 58.6703C110.949 58.5376 110.188 57.7084 110.142 56.7016L109.561 44.1323C109.535 43.621 109.51 43.1141 109.484 42.6146C109.241 37.9294 109.022 33.7805 109.022 32.4282C109.022 28.3859 108.338 26.6806 107.74 25.9634C107.263 25.3915 106.577 25.1402 105.11 25.1402C104.583 25.1402 104.212 25.2481 103.933 25.4111C103.659 25.5714 103.346 25.8587 103.049 26.4208C102.41 27.6257 101.945 29.891 102.118 33.8479C102.342 38.9804 102.692 42.8146 103.035 46.2718C103.377 49.7231 103.718 52.8561 103.908 56.4971C104.204 62.1966 104.178 66.1256 103.945 68.7924C103.828 70.124 103.656 71.1996 103.423 72.0501C103.202 72.8558 102.871 73.6757 102.296 74.2887C101.6 75.0303 100.608 75.3844 99.577 75.136C98.7592 74.9389 98.1847 74.4215 97.8706 74.0916C97.2141 73.4017 96.7501 72.5106 96.568 72.0512C95.5097 69.3812 92.2352 63.1808 87.8023 59.6811C86.5089 58.6599 85.5666 58.3652 84.9736 58.3204C84.4148 58.2783 84.0094 58.4436 83.6909 58.6967C83.34 58.9756 83.0781 59.3811 82.9479 59.7643C82.9019 59.8999 82.8823 59.9968 82.8741 60.0584C84.0759 62.0865 88.8421 69.5222 91.0896 77.069C92.7648 82.6941 96.8038 88.4259 99.8194 90.8809C102.74 93.258 107.988 94.7313 113.9 95.0218C119.756 95.3095 125.788 94.4121 130.033 92.5092C138.233 88.8334 139.903 80.7382 140.651 77.2292C141.232 74.5057 141.243 71.5987 141.087 68.9009C141.01 67.5551 140.894 66.2969 140.793 65.1373C140.695 64.0105 140.606 62.9215 140.606 62.0292ZM120.986 27.0953C120.986 25.8314 120.648 24.7049 120.089 23.9514C119.583 23.27 118.84 22.7987 117.646 22.7984C116.668 22.7982 116.011 22.9187 115.546 23.1167C115.13 23.2943 114.781 23.5699 114.463 24.0831C113.73 25.2671 113.192 27.6455 113.189 32.384L113.721 43.9088C113.91 47.5661 114.106 51.4922 114.235 54.7707L120.986 55.6666V27.0953ZM125.153 56.2652L131.172 57.218L131.992 43.267V32.5083C131.992 31.031 131.39 30.1275 130.678 29.5489C129.884 28.9039 128.957 28.6731 128.519 28.6731C127.722 28.6731 126.899 28.797 126.306 29.2179C125.849 29.5421 125.153 30.3087 125.153 32.5083V56.2652ZM136.159 35.4278C137.406 34.8069 138.74 34.6083 139.912 34.6868C142.037 34.8292 143.91 35.718 145.037 37.6779C146.06 39.4592 146.273 41.8136 146.041 44.4927C145.72 48.1949 144.772 58.6457 144.772 62.0292C144.772 62.708 144.843 63.6116 144.944 64.7758C145.042 65.907 145.165 67.2389 145.247 68.6606C145.411 71.4987 145.422 74.8383 144.727 78.0987C144.002 81.4953 142.041 91.6918 131.738 96.3108C126.731 98.5551 120.002 99.4936 113.696 99.1838C107.445 98.8767 101.128 97.3189 97.1887 94.1122C93.4809 91.0937 88.9938 84.6307 87.0962 78.2589C84.9529 71.0619 80.3109 63.9646 79.1527 61.9533C78.4706 60.7689 78.684 59.3628 79.0019 58.4258C79.3607 57.3688 80.0554 56.2631 81.0993 55.4337C82.1758 54.5784 83.6043 54.0377 85.2876 54.1647C86.9369 54.2893 88.6462 55.0393 90.3834 56.4107C94.8541 59.9401 98.1342 65.5082 99.7424 68.9231C99.759 68.7664 99.779 68.6024 99.7941 68.4298C100.003 66.0435 100.039 62.3344 99.7467 56.7132C99.5635 53.1942 99.2356 50.1809 98.8888 46.6828C98.5425 43.1904 98.184 39.2713 97.955 34.0302C97.7722 29.8481 98.2012 26.6722 99.3672 24.471C99.9716 23.3302 100.79 22.4223 101.83 21.814C102.866 21.2087 103.995 20.974 105.11 20.974C106.759 20.974 108.813 21.2062 110.448 22.7678C110.593 22.4576 110.75 22.1652 110.921 21.8899C111.676 20.6698 112.681 19.8084 113.912 19.2835C115.095 18.7791 116.378 18.6309 117.646 18.6311C120.195 18.6315 122.164 19.7567 123.434 21.4683C124.256 22.576 124.75 23.8775 124.985 25.1982C126.338 24.5876 127.691 24.5068 128.519 24.5068C129.933 24.5068 131.784 25.0791 133.305 26.3154C134.908 27.6179 136.159 29.6733 136.159 32.5083V35.4278Z`,fill:`white`}),(0,T.jsx)(`path`,{d:`M7.15661 62.0292C7.15661 58.409 6.17994 47.6748 5.87291 44.1323C5.6654 41.7374 5.95357 40.4247 6.33875 39.7542C6.62116 39.2626 7.06336 38.915 8.12834 38.8436C8.89759 38.7921 9.73544 39.0114 10.3616 39.5761C10.9484 40.1052 11.6032 41.1682 11.6032 43.3176L11.6074 43.4388L12.5644 59.758C12.5988 60.3451 12.8798 60.8911 13.338 61.2599C13.7961 61.6284 14.3887 61.7859 14.9695 61.6941L24.9988 60.1068L35.8143 58.6703C36.8135 58.5376 37.5741 57.7084 37.6208 56.7016L38.2015 44.1323C38.2279 43.621 38.2525 43.1141 38.2784 42.6146C38.5218 37.9294 38.7401 33.7805 38.7401 32.4282C38.7401 28.3859 39.4246 26.6806 40.0227 25.9634C40.4996 25.3915 41.185 25.1402 42.6523 25.1402C43.1794 25.1402 43.5505 25.2481 43.8295 25.4111C44.1038 25.5714 44.416 25.8587 44.7138 26.4208C45.3521 27.6257 45.8173 29.891 45.6444 33.8479C45.4201 38.9804 45.0703 42.8146 44.7275 46.2718C44.3853 49.7231 44.0443 52.8561 43.8548 56.4971C43.5582 62.1966 43.5847 66.1256 43.8179 68.7924C43.9344 70.124 44.1069 71.1996 44.3396 72.0501C44.5601 72.8558 44.891 73.6757 45.4663 74.2887C46.1625 75.0303 47.1546 75.3844 48.1855 75.136C49.0033 74.9389 49.5778 74.4215 49.8918 74.0916C50.5484 73.4017 51.0123 72.5106 51.1945 72.0512C52.2527 69.3812 55.5272 63.1808 59.9601 59.6811C61.2536 58.6599 62.1958 58.3652 62.7889 58.3204C63.3476 58.2783 63.753 58.4436 64.0715 58.6967C64.4225 58.9756 64.6844 59.3811 64.8146 59.7643C64.8606 59.8999 64.8801 59.9968 64.8883 60.0584C63.6866 62.0865 58.9204 69.5222 56.6729 77.069C54.9977 82.6941 50.9586 88.4259 47.9431 90.8809C45.0229 93.258 39.7747 94.7313 33.8624 95.0218C28.0068 95.3095 21.9748 94.4121 17.7297 92.5092C9.52988 88.8334 7.85961 80.7382 7.11129 77.2292C6.53054 74.5057 6.5195 71.5987 6.67496 68.9009C6.75251 67.5551 6.86809 66.2969 6.96901 65.1373C7.06707 64.0105 7.1566 62.9215 7.15661 62.0292ZM26.7768 27.0953C26.7768 25.8314 27.1147 24.7049 27.6737 23.9514C28.1792 23.27 28.9221 22.7987 30.1167 22.7984C31.0942 22.7982 31.7518 22.9187 32.2162 23.1167C32.6326 23.2943 32.9817 23.5699 33.2996 24.0831C34.0328 25.2671 34.5705 27.6455 34.5738 32.384L34.0416 43.9088C33.8524 47.5661 33.6565 51.4922 33.5273 54.7707L26.7768 55.6666V27.0953ZM22.6095 56.2652L16.5904 57.218L15.7705 43.267V32.5083C15.7705 31.031 16.3726 30.1275 17.0847 29.5489C17.8785 28.9039 18.8058 28.6731 19.2432 28.6731C20.0404 28.6731 20.8634 28.797 21.4565 29.2179C21.9131 29.5421 22.6095 30.3087 22.6095 32.5083V56.2652ZM11.6032 35.4278C10.3568 34.8069 9.02265 34.6083 7.8501 34.6868C5.72541 34.8292 3.85197 35.718 2.72584 37.6779C1.70247 39.4592 1.48924 41.8136 1.72143 44.4927C2.0423 48.1949 2.99038 58.6457 2.99038 62.0292C2.99037 62.708 2.91991 63.6116 2.81859 64.7758C2.72014 65.907 2.59699 67.2389 2.51505 68.6606C2.3515 71.4987 2.34041 74.8383 3.0357 78.0987C3.76005 81.4953 5.72154 91.6918 16.0245 96.3108C21.0311 98.5551 27.7601 99.4936 34.0669 99.1838C40.3172 98.8767 46.6346 97.3189 50.5737 94.1122C54.2816 91.0937 58.7686 84.6307 60.6662 78.2589C62.8095 71.0619 67.4515 63.9646 68.6098 61.9533C69.2919 60.7689 69.0785 59.3628 68.7605 58.4258C68.4018 57.3688 67.707 56.2631 66.6632 55.4337C65.5867 54.5784 64.1582 54.0377 62.4748 54.1647C60.8256 54.2893 59.1162 55.0393 57.379 56.4107C52.9083 59.9401 49.6283 65.5082 48.02 68.9231C48.0034 68.7664 47.9835 68.6024 47.9684 68.4298C47.7597 66.0435 47.7232 62.3344 48.0158 56.7132C48.1989 53.1942 48.5269 50.1809 48.8737 46.6828C49.22 43.1904 49.5784 39.2713 49.8075 34.0302C49.9903 29.8481 49.5612 26.6722 48.3952 24.471C47.7909 23.3302 46.9729 22.4223 45.9321 21.814C44.8964 21.2087 43.7676 20.974 42.6523 20.974C41.0038 20.974 38.9497 21.2062 37.3141 22.7678C37.1698 22.4576 37.0124 22.1652 36.8419 21.8899C36.0863 20.6698 35.0817 19.8084 33.8508 19.2835C32.6679 18.7791 31.3849 18.6309 30.1167 18.6311C27.5677 18.6315 25.5986 19.7567 24.3285 21.4683C23.5066 22.576 23.0121 23.8775 22.7771 25.1982C21.4247 24.5876 20.0718 24.5068 19.2432 24.5068C17.8298 24.5068 15.9788 25.0791 14.4573 26.3154C12.8542 27.6179 11.6032 29.6733 11.6032 32.5083V35.4278Z`,fill:`white`})]}),M=e=>(0,T.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,T.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.3235 10.9352L11.5016 14.2111L7.67969 10.9352L8.6152 9.84375L11.5016 12.3178L14.388 9.84375L15.3235 10.9352Z`,fill:`currentColor`})});function N({isConnected:e,className:t}){let n,r,i;return e===!0?(n=`bg-[var(--oh-status-success)]`,r=`Connected`,i=`connected`):e===!1?(n=`bg-red-500`,r=`Disconnected`,i=`disconnected`):(n=`bg-[var(--oh-interactive-selected)]`,r=`Checking connection`,i=`checking`),(0,T.jsx)(`span`,{"data-testid":`backend-status-dot`,"data-status":i,"aria-label":r,title:r,role:`status`,className:c(`inline-block w-2 h-2 rounded-full shrink-0`,n,t)})}var P=class extends Error{constructor(e,t){super(e),this.code=t,this.name=`DeviceFlowError`}},F=6e5,I=3e4;async function L(e,t,n,r,i,a){let o=m(),s=`${o.host.replace(/\/+$/,``)}/api/cloud-proxy`;return await fetch(s,{method:`POST`,headers:{"Content-Type":`application/json`,...S(o)},body:JSON.stringify({host:e,method:t,path:n,headers:i?{"Content-Type":i}:{},body:r??null}),signal:a})}async function R(e){let t=e.replace(/\/+$/,``);try{let e=await L(t,`POST`,`/oauth/device/authorize`,{},`application/json`);if(!e.ok)throw new P(`Failed to start device flow: Server returned ${e.status}`);let n=await e.json();if(!n.device_code||!n.user_code||!n.verification_uri)throw new P(`Invalid response from device authorization endpoint: missing required fields`);let r=n.verification_uri_complete??`${n.verification_uri}?user_code=${encodeURIComponent(n.user_code)}`;return{device_code:n.device_code,user_code:n.user_code,verification_uri:n.verification_uri,verification_uri_complete:r,expires_in:n.expires_in??600,interval:n.interval??5}}catch(e){throw e instanceof P?e:new P(`Failed to start device flow: ${e instanceof Error?e.message:String(e)}`)}}async function z(e,t,n){let r=e.replace(/\/+$/,``),i=n.timeout??F,a=Math.max(1,n.interval)*1e3,o=Date.now();for(;Date.now()-o<i;){if(n.signal?.aborted)throw new P(`Authorization cancelled`,`cancelled`);try{let e=await L(r,`POST`,`/oauth/device/token`,new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:device_code`,device_code:t}).toString(),`application/x-www-form-urlencoded`,n.signal);if(e.ok){let t=await e.json();if(!t.access_token)throw new P(`Invalid token response: missing access_token`);return{access_token:t.access_token,token_type:t.token_type??`Bearer`,expires_in:t.expires_in}}let i;try{i=await e.json()}catch{throw new P(`Unexpected response from server: ${e.status}`)}let{error:o,error_description:s}=i;switch(o){case`authorization_pending`:break;case`slow_down`:a=typeof i.interval==`number`&&isFinite(i.interval)&&i.interval>0?Math.max(1,Math.min(i.interval,30))*1e3:Math.min(a+5e3,I);break;case`expired_token`:throw new P(`Device code has expired. Please try again.`,`expired_token`);case`access_denied`:throw new P(`Authorization request was denied.`,`access_denied`);default:throw new P(`Authorization error: ${o}${s?` - ${s}`:``}`,o)}}catch(e){if(e instanceof P)throw e;if(e instanceof DOMException&&e.name===`AbortError`)throw new P(`Authorization cancelled`,`cancelled`);console.warn(`Network error during polling, retrying:`,e)}try{await B(a,n.signal)}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?new P(`Authorization cancelled`,`cancelled`):e}}throw new P(`Timeout waiting for authorization. Please try again.`,`timeout`)}function B(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))},{once:!0})})}var V={status:`idle`,verificationUrl:null,userCode:null,apiKey:null,error:null,errorCode:null};function H(){let[e,t]=E.useState(V),n=E.useRef(null),r=E.useCallback(e=>{n.current?.abort();let r=new AbortController;n.current=r,t({...V,status:`starting`}),(async()=>{let n;try{n=await R(e)}catch(e){if(r.signal.aborted)return;let n=e instanceof Error?e.message:`Failed to start device flow`,i=e instanceof P?e.code:void 0;t({...V,status:`error`,error:n,errorCode:i??null});return}if(!r.signal.aborted){t({...V,status:`awaiting_authorization`,verificationUrl:n.verification_uri_complete,userCode:n.user_code});try{let i=await z(e,n.device_code,{interval:n.interval,signal:r.signal});if(r.signal.aborted)return;t({...V,status:`success`,apiKey:i.access_token})}catch(e){if(r.signal.aborted)return;if(e instanceof P&&e.code===`cancelled`){t(V);return}let n=e instanceof Error?e.message:`Authorization failed`,i=e instanceof P?e.code:void 0;t({...V,status:`error`,error:n,errorCode:i??null})}}})()},[]),i=E.useCallback(()=>{n.current?.abort(),n.current=null,t(V)},[]),a=E.useCallback(()=>{n.current?.abort(),n.current=null,t(V)},[]);return E.useEffect(()=>()=>{n.current?.abort()},[]),{...e,start:r,cancel:i,reset:a}}function U(e){try{return new URL(e).protocol===`https:`}catch{return!1}}function W({host:e,onSuccess:t,testIdRoot:n,isDisabled:r=!1}){let{t:i}=s(`openhands`),a=H(),c=E.useRef(null);E.useEffect(()=>()=>{c.current?.close()},[]),E.useEffect(()=>{if(a.status===`awaiting_authorization`&&a.verificationUrl&&c.current&&!c.current.closed){if(!U(a.verificationUrl)){console.error(`Invalid verification URL protocol`);return}try{c.current.location.href=a.verificationUrl}catch{c.current=window.open(a.verificationUrl,`_blank`,`noopener,noreferrer`)}}},[a.status,a.verificationUrl]),E.useEffect(()=>{if(a.status===`success`&&a.apiKey)try{t(a.apiKey)}finally{a.reset(),c.current?.close()}},[a.status,a.apiKey,a.reset,t]);let l=()=>{let t=e.trim().replace(/\/+$/,``),n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{let e=new URL(n);if(e.username||e.password)throw Error(`Invalid URL format`)}catch{return}c.current=window.open(`about:blank`,`_blank`),c.current||console.warn(`Popup blocked - user will need to use manual link`),a.start(n)};return(0,T.jsxs)(`div`,{"data-testid":`${n}-device-flow`,className:`flex flex-col gap-3`,children:[a.status===`idle`&&(0,T.jsx)(b,{type:`button`,variant:`primary`,onClick:l,testId:`${n}-login-button`,className:`w-full`,isDisabled:r,children:i(o.BACKEND$LOGIN_WITH_OPENHANDS)}),a.status===`starting`&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 p-3 bg-base-tertiary rounded-lg`,"data-testid":`${n}-auth-starting`,role:`status`,"aria-live":`polite`,children:[(0,T.jsx)(G,{}),(0,T.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:i(o.BACKEND$AUTH_STARTING)})]}),a.status===`awaiting_authorization`&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 bg-base-tertiary rounded-lg`,"data-testid":`${n}-auth-awaiting`,role:`status`,"aria-live":`polite`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(G,{}),(0,T.jsx)(`span`,{className:`text-sm font-medium text-white`,children:i(o.BACKEND$AUTH_AWAITING)})]}),(0,T.jsx)(`p`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:i(o.BACKEND$AUTH_BROWSER_OPENED)}),a.verificationUrl&&U(a.verificationUrl)&&(0,T.jsxs)(`div`,{className:`text-xs text-[var(--oh-muted)]`,children:[(0,T.jsx)(`p`,{children:i(o.BACKEND$AUTH_OPEN_MANUALLY)}),(0,T.jsx)(`a`,{href:a.verificationUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 hover:underline break-all`,children:a.verificationUrl})]}),(0,T.jsx)(b,{type:`button`,variant:`secondary`,onClick:a.cancel,testId:`${n}-auth-cancel`,className:`w-full mt-2`,children:i(o.BACKEND$AUTH_CANCEL)})]}),a.status===`error`&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 bg-red-900/20 border border-red-700 rounded-lg`,"data-testid":`${n}-auth-error`,role:`alert`,children:[(0,T.jsx)(`p`,{className:`text-sm text-red-400`,children:a.error}),(0,T.jsx)(b,{type:`button`,variant:`secondary`,onClick:l,testId:`${n}-auth-retry`,className:`w-full`,children:i(o.BACKEND$AUTH_RETRY)})]})]})}function G(){return(0,T.jsxs)(`svg`,{className:`animate-spin h-4 w-4 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,T.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,T.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]})}function K(e){let t=e.trim().toLowerCase();return t.includes(`all-hands.dev`)||t.includes(`openhands.dev`)?`cloud`:`local`}function q(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return!!(t===`localhost`||t===`::1`||t===`::`||t===`0.0.0.0`||/^127\./.test(t)||/^::ffff:127\./i.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2\d|3[01])\./.test(t)||/^fe[89ab][0-9a-f]:/i.test(t)||/^f[cd][0-9a-f]{2}:/i.test(t)||t.endsWith(`.local`)||!t.includes(`.`)&&!t.includes(`:`))}function J(e){let t=e.trim().replace(/\/+$/,``);if(!t)return``;if(/^https?:\/\//i.test(t))return t;let n=t.match(/^\[([^\]]+)\]/);return`${q(n?n[1]:(t.match(/:/g)??[]).length>1?t:t.split(`:`)[0])?`http`:`https`}://${t}`}function Y(e){let t=e.trim();if(!t||/\s/.test(t))return!1;let n=J(t);if(!n)return!1;try{let e=new URL(n);return(e.protocol===`http:`||e.protocol===`https:`)&&e.hostname.length>0}catch{return!1}}var X=`https://app.all-hands.dev`;function Z({backend:e,testIdRoot:t}){let{t:r}=s(`openhands`),i=A([e])[e.id],a=i?.isConnected??null,c=i?.disabled===!0,l=i?.consecutiveFailures??0,u=i?.lastError??null,{data:d}=n({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>(await new g(p({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()).version??null,retry:!1,staleTime:6e4,enabled:e.kind===`local`&&!c}),f;f=r(a===!0?o.ONBOARDING$BACKEND_STATUS_CONNECTED:a===!1?o.ONBOARDING$BACKEND_STATUS_DISCONNECTED:o.ONBOARDING$BACKEND_STATUS_CHECKING);let m=e.kind===`cloud`?r(o.BACKEND$KIND_CLOUD):r(o.BACKEND$KIND_LOCAL);return(0,T.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,T.jsxs)(`div`,{"data-testid":`${t}-status`,className:`flex items-center gap-3 text-sm`,children:[(0,T.jsx)(N,{isConnected:a}),(0,T.jsx)(`span`,{className:`text-white`,"data-testid":`${t}-status-label`,children:f}),(0,T.jsx)(`span`,{className:`text-tertiary-alt`,children:`·`}),(0,T.jsx)(`span`,{className:`text-[var(--oh-text-tertiary)]`,children:m}),d?(0,T.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`${t}-version`,children:r(o.BACKEND$VERSION_LABEL,{version:d})}):null]}),c?(0,T.jsxs)(`div`,{"data-testid":`${t}-status-error`,className:`flex flex-col gap-1 rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm`,children:[(0,T.jsx)(`span`,{className:`font-semibold text-red-300`,children:r(o.BACKEND$HEALTH_FAILED_TITLE)}),(0,T.jsx)(`span`,{className:`text-xs text-[var(--oh-text-tertiary)]`,children:r(o.BACKEND$HEALTH_FAILED_DETAIL,{count:l})}),u?(0,T.jsx)(`span`,{"data-testid":`${t}-status-error-message`,className:`text-xs text-red-300 whitespace-pre-wrap break-words`,children:u}):null]}):null]})}function Q({mode:e,backend:t,onSubmitted:n,renderActions:r,testIdRoot:i,hostReadOnly:a,requireApiKey:c,onSubmitOverride:l}){let{t:u}=s(`openhands`),{addBackend:d,updateBackend:f}=h(),[p,m]=E.useState(t?.name??``),[g,_]=E.useState(t?.host??``),[v,y]=E.useState(t?.apiKey??``),[x,S]=E.useState(!1),[C,D]=E.useState(!1),O=K(g),k=i??(e===`edit`?`edit-backend`:`add-backend`),A=c||O!==`local`,j=p.trim().length>0&&Y(g)&&(!A||v.trim().length>0),M=x&&!p.trim()?u(o.BACKEND$NAME_REQUIRED):void 0,N=C?g.trim()?Y(g)?void 0:u(o.BACKEND$HOST_INVALID):u(o.BACKEND$HOST_REQUIRED):void 0;return(0,T.jsxs)(`form`,{"data-testid":`${k}-form`,onSubmit:async r=>{if(r.preventDefault(),!j){S(!0),D(!0);return}let i={name:p.trim(),host:J(g),apiKey:v.trim(),kind:O};if(l){await l(i);return}e===`edit`&&t?f(t.id,i):d(i),n()},className:`flex flex-col gap-4`,children:[(0,T.jsx)(w,{testId:`${k}-name`,name:`${k}-name`,type:`text`,label:u(o.BACKEND$NAME_LABEL),value:p,onChange:m,onBlur:()=>S(!0),placeholder:`Production`,className:`w-full`,showRequiredTag:!0,error:M}),(0,T.jsx)(w,{testId:`${k}-host`,name:`${k}-host`,type:`text`,label:u(o.BACKEND$HOST_LABEL),value:g,onChange:a?void 0:_,onBlur:()=>D(!0),placeholder:X,className:`w-full`,showRequiredTag:!0,error:N,isDisabled:a}),(0,T.jsx)(w,{testId:`${k}-api-key`,name:`${k}-api-key`,type:`password`,label:u(o.BACKEND$KEY_LABEL),value:v,onChange:y,placeholder:``,className:`w-full`}),e===`edit`&&t&&(0,T.jsx)(Z,{backend:t,testIdRoot:k}),r?r({canSubmit:j,testIdRoot:k}):(0,T.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2 w-full`,children:[(0,T.jsx)(b,{type:`button`,variant:`secondary`,onClick:n,testId:`${k}-cancel`,children:u(o.BUTTON$CANCEL)}),(0,T.jsx)(b,{type:`submit`,variant:`primary`,isDisabled:!j,testId:`${k}-submit`,children:u(o.BACKEND$SAVE)})]})]})}function $(){let{currentPath:e,navigate:t}=x();return E.useCallback(()=>{/^\/automations\/[^/]+/.test(e)?t(`/automations`):/^\/conversations\/[^/]+/.test(e)&&t(`/conversations`)},[e,t])}function ee({onClose:e}){let{t}=s(`openhands`),{addBackend:n}=h(),r=$(),[i,a]=E.useState(``),[c,l]=E.useState(``),[u,d]=E.useState(``),f=K(c),p=i.trim().length>0&&Y(c)&&(f===`local`||u.trim().length>0);return(0,T.jsxs)(`form`,{"data-testid":`add-backend-form`,onSubmit:t=>{t.preventDefault(),p&&(n({name:i.trim(),host:J(c),apiKey:u.trim(),kind:f}),r(),e())},className:`flex flex-col gap-4 flex-1 min-w-0`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsx)(w,{testId:`add-backend-name`,name:`add-backend-name`,type:`text`,label:t(o.BACKEND$NAME_LABEL),value:i,onChange:a,placeholder:`e.g. My Server`,className:`w-full`}),(0,T.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:t(o.BACKEND$NAME_HELPER)})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsx)(w,{testId:`add-backend-host`,name:`add-backend-host`,type:`text`,label:t(o.BACKEND$HOST_LABEL),value:c,onChange:l,placeholder:`http://localhost:8000`,className:`w-full`}),(0,T.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`add-backend-host-helper`,children:t(o.BACKEND$HOST_HELPER)})]}),(0,T.jsx)(w,{testId:`add-backend-api-key`,name:`add-backend-api-key`,type:`password`,label:t(o.BACKEND$KEY_LABEL),value:u,onChange:d,placeholder:`sk-••••••••••`,className:`w-full`}),(0,T.jsx)(b,{type:`submit`,variant:`secondary`,isDisabled:!p,testId:`add-backend-submit`,className:`w-full text-center`,children:t(o.BACKEND$CONNECT)})]})}function te({onClose:e}){let{t}=s(`openhands`),{addBackend:n}=h(),r=$(),[i,a]=E.useState(!1),[l,u]=E.useState(``),d=l.trim()||X;return(0,T.jsxs)(`div`,{className:`flex flex-1 min-w-0 flex-col items-center gap-3`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,T.jsx)(j,{width:56,height:56,"aria-hidden":!0}),(0,T.jsx)(`h4`,{className:`text-lg font-medium text-white`,"data-testid":`add-backend-cloud-title`,children:t(o.BACKEND$CLOUD_TITLE)})]}),(0,T.jsx)(`p`,{className:`text-center text-sm leading-relaxed text-[var(--oh-muted)]`,children:t(o.BACKEND$CLOUD_DESCRIPTION)}),(0,T.jsx)(W,{host:d,onSuccess:t=>{n({name:`OpenHands Cloud`,host:J(d),apiKey:t,kind:`cloud`}),r(),e()},testIdRoot:`add-backend`}),(0,T.jsxs)(`div`,{className:`w-full`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-expanded":i,"data-testid":`add-backend-advanced-toggle`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,T.jsx)(`span`,{children:t(o.BACKEND$ADVANCED)}),(0,T.jsx)(M,{className:c(`h-4 w-4 shrink-0 text-muted transition-transform`,i&&`rotate-180`),"aria-hidden":!0})]}),(0,T.jsxs)(`div`,{className:c(`pt-2`,!i&&`pointer-events-none invisible`),"aria-hidden":!i,children:[(0,T.jsx)(w,{testId:`add-backend-cloud-host`,name:`add-backend-cloud-host`,type:`text`,label:t(o.BACKEND$HOST_LABEL),value:l,onChange:u,placeholder:X,className:`w-full`}),(0,T.jsx)(`p`,{className:`mt-1 text-xs text-[var(--oh-muted)]`,children:t(o.BACKEND$LOGIN_CLOUD_HINT)})]})]})]})}function ne({mode:e,backend:t,onClose:n}){let{t:r}=s(`openhands`);if(e===`add`)return(0,T.jsx)(_,{onClose:n,closeOnEscape:!1,"aria-label":r(o.BACKEND$ADD_TITLE),children:(0,T.jsxs)(`div`,{"data-testid":`add-backend-modal`,className:c(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,v(`xl`),y),children:[(0,T.jsx)(C,{onClose:n,testId:`add-backend-close`}),(0,T.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,T.jsx)(`h2`,{className:`text-lg font-semibold`,children:r(o.BACKEND$ADD_TITLE)})}),(0,T.jsxs)(`div`,{className:`flex gap-6 px-6 pb-6 pt-2`,children:[(0,T.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,T.jsx)(ee,{onClose:n})}),(0,T.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center`,children:[(0,T.jsx)(`div`,{className:`flex-1 w-px bg-[var(--oh-border)]`}),(0,T.jsx)(`span`,{className:`py-3 text-xs uppercase text-[var(--oh-muted)]`,children:r(o.BACKEND$LOGIN_OR)}),(0,T.jsx)(`div`,{className:`flex-1 w-px bg-[var(--oh-border)]`})]}),(0,T.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,T.jsx)(te,{onClose:n})})]})]})});let i=`edit-backend`;return(0,T.jsx)(_,{onClose:n,closeOnEscape:!1,"aria-label":r(o.BACKEND$EDIT_TITLE),children:(0,T.jsxs)(`div`,{"data-testid":`${i}-modal`,className:c(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,v(`md`)),children:[(0,T.jsx)(C,{onClose:n,testId:`${i}-close`}),(0,T.jsx)(`h2`,{className:`pr-6 text-lg font-semibold`,children:r(o.BACKEND$EDIT_TITLE)}),(0,T.jsx)(Q,{mode:`edit`,backend:t,onSubmitted:n,testIdRoot:i})]})})}export{A as i,ne as n,N as r,Q as t};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-BNMqORFE.js";import{t as n}from"./utils-i18rdUj2.js";import{r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~hkqzh1hb-BZ0HXuHD.js";import{n as i}from"./modal-body-BI6Ru2Qr.js";e();var a=t();function o({testId:e,variant:t=`default`,onClick:n,text:i,className:o,icon:s,type:c=`button`,disabled:l,intent:u}){return(0,a.jsxs)(`button`,{"data-testid":e,type:c===`submit`?`submit`:`button`,disabled:l,onClick:n,className:r(t===`default`&&`text-sm font-normal py-[10px] rounded-sm`,t===`text-like`&&`text-xs leading-4 font-normal`,s&&`flex items-center justify-center gap-2`,l&&`opacity-50 cursor-not-allowed`,o),name:u&&`intent`,value:u,children:[s,i]})}function s({title:e,id:t,className:r}){return(0,a.jsx)(`span`,{id:t,className:n(`text-xl leading-6 -tracking-[0.01em] font-medium text-content-2`,r),children:e})}function c({description:e,children:t}){return(0,a.jsx)(`span`,{className:`text-xs text-modal-muted`,children:t||e})}function l({testId:e,title:t,description:n,buttons:r}){return(0,a.jsxs)(i,{testID:e,children:[(0,a.jsxs)(`div`,{className:`flex flex-col gap-2 self-start`,children:[(0,a.jsx)(s,{title:t}),(0,a.jsx)(c,{description:n})]}),(0,a.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:r.map((e,t)=>(0,a.jsx)(o,{onClick:e.onClick,text:e.text,className:e.className},t))})]})}export{o as i,c as n,s as r,l as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-BNMqORFE.js";import{t as r}from"./utils-i18rdUj2.js";var i=e(t(),1),a=`h-9 min-h-9`,o=`rounded-lg`,s=`border border-[var(--oh-border)]`,c=`bg-base-secondary`,l=`transition-[background-color,border-color,box-shadow,opacity] duration-150 motion-reduce:transition-none`,u=`!transition-[background-color,border-color,box-shadow,opacity] !duration-150 motion-reduce:transition-none`,d=`focus:border-white/40 focus:ring-1 focus:ring-white/20 focus:outline-none`,f=`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,p=`disabled:cursor-not-allowed disabled:opacity-60`,m=r(a,o,s,c,l,d,p,`w-full min-w-0 px-3 text-sm text-white placeholder:text-tertiary-alt`),h=r(m,`placeholder:italic`,u),g=r(o,s,c,l,d,p,`w-full min-w-0 px-3 py-2 text-sm text-white placeholder:text-tertiary-alt`),_=r(a,`relative flex min-w-0 items-center`,o,s,c,l,f),v=r(`min-w-0 flex-1 border-0 bg-transparent px-3 text-sm outline-none`,`placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`),y=r(a,`inline-flex w-fit cursor-pointer items-center justify-center gap-2 px-3`,o,l,`text-sm font-normal disabled:cursor-not-allowed disabled:opacity-30`),b=`pl-12`;r(y,s,c,`shrink-0 text-white`);var x=n(),S=(0,i.forwardRef)(function({testId:e,name:t,children:n,variant:i,type:a,isDisabled:o,className:s,onClick:c,startContent:l,ariaLabel:u,"aria-busy":d},f){return(0,x.jsxs)(`button`,{ref:f,name:t,"data-testid":e,disabled:o,type:a,onClick:c,"aria-label":u,"aria-busy":d,className:r(y,i===`primary`&&`bg-primary text-[var(--oh-color-base)] hover:opacity-80`,i===`secondary`&&`border border-[var(--oh-border)] bg-base-secondary text-white hover:bg-surface-raised`,i===`tertiary`&&`bg-[var(--oh-interactive-hover)] text-white hover:opacity-80`,i===`danger`&&`bg-red-600 text-white hover:bg-red-700`,i===`ghost-danger`&&`h-auto min-h-0 bg-transparent px-0 text-red-600 underline hover:text-red-700 hover:no-underline font-normal`,l&&`flex items-center justify-center gap-2`,s),children:[l,n]})});export{g as a,_ as c,l as d,v as i,c as l,s as n,o,m as r,h as s,S as t,b as u};
@@ -1 +0,0 @@
1
- import{t as e}from"./react-Do0CT17Y.js";var t={url:``,screenshotSrc:``},n=e(e=>({...t,setUrl:t=>e({url:t}),setScreenshotSrc:t=>e({screenshotSrc:t}),reset:()=>e(t)}));export{n as t};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-BNMqORFE.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,n.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})});export{r as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./declaration-BNMqORFE.js";import{t}from"./utils-i18rdUj2.js";var n=e();function r({className:e}){return(0,n.jsx)(`svg`,{"aria-hidden":!0,fill:`none`,focusable:`false`,height:`1em`,role:`presentation`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,viewBox:`0 0 24 24`,width:`1em`,className:e,children:(0,n.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}var i=`inline-flex items-center justify-center shrink-0 rounded-none bg-transparent px-1 min-w-0 w-auto h-auto text-medium cursor-pointer outline-none transition-[transform] duration-150 ease motion-reduce:transition-none`,a=t(i,`!rounded-none !bg-transparent data-[hover=true]:!bg-transparent`);function o({isOpen:e,className:i}){return(0,n.jsx)(r,{className:t(`shrink-0 transition-[transform] duration-150 ease motion-reduce:transition-none`,e&&`rotate-180`,i)})}export{a as i,o as n,i as r,r as t};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-BNMqORFE.js";import{t as n}from"./utils-i18rdUj2.js";import{t as r}from"./dist-C6t0EXL7.js";e();var i=t(),a=r(`z-50 overflow-hidden text-[var(--oh-foreground)]`,{variants:{theme:{default:`absolute rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,naked:`relative`,popover:`relative rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`},size:{compact:`py-1 px-1`,default:``},layout:{vertical:`flex flex-col gap-0`},position:{top:`bottom-full`,bottom:`top-full`,none:``},spacing:{default:`mt-2`,none:``},alignment:{left:`left-0`,right:`right-0`,none:``}},compoundVariants:[{theme:`naked`,className:`shadow-none`}],defaultVariants:{theme:`default`,size:`default`,layout:`vertical`,spacing:`default`}});function o({testId:e,children:t,className:r,style:o,ref:s,theme:c,size:l,layout:u,position:d,spacing:f,alignment:p}){return(0,i.jsx)(`ul`,{"data-testid":e,"data-position":d,ref:s,style:o,className:n(a({theme:c,size:l,layout:u,position:d,spacing:f,alignment:p}),r),children:t})}function s({children:e,testId:t,onClick:r,isDisabled:a,className:o}){return(0,i.jsx)(`button`,{"data-testid":t||`context-menu-list-item`,type:`button`,onClick:r,disabled:a,className:n(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,o),children:e})}export{o as n,s as t};