@openhands/agent-canvas 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-D1PORKc0.js → acp-providers-CYy8qA2z.js} +1 -1
  4. package/build/assets/active-backend-context-BZDG15C0.js +2 -0
  5. package/build/assets/{agent-context-settings-DMrObcIS.js → agent-context-settings-DGWBBbcp.js} +1 -1
  6. package/build/assets/{agent-profiles-settings-DororXN5.js → agent-profiles-settings-DrkGdf4_.js} +1 -1
  7. package/build/assets/{agent-server-conversation-service.api-DWBe0rbX.js → agent-server-conversation-service.api-DK56YPTs.js} +7 -7
  8. package/build/assets/{agent-settings-BJVk92PU.js → agent-settings-DfcSgkLD.js} +2 -2
  9. package/build/assets/agent-settings-Lrc5-twS.js +1 -0
  10. package/build/assets/{alert-banner-CzZsm7ms.js → alert-banner-BgDHhL7b.js} +1 -1
  11. package/build/assets/api-error-message-BEIE_yD1.js +1 -0
  12. package/build/assets/{api-key-entry-screen-D8Fade_-.js → api-key-entry-screen-DaZnOlVo.js} +1 -1
  13. package/build/assets/{app-settings-CpyGB3AT.js → app-settings-BG5NAUbC.js} +1 -1
  14. package/build/assets/automation-detail-D4Hs831Z.js +3 -0
  15. package/build/assets/automation-export-n0X6FB0C.js +2 -0
  16. package/build/assets/automation-git-sync-CDrm8WV7.js +1 -0
  17. package/build/assets/automation-setup-route-CZCl4ONs.js +1 -0
  18. package/build/assets/{automation-templates-DgpCGOJV.js → automation-templates-DFF96AdL.js} +1 -1
  19. package/build/assets/automations-list-Bl-oGOrV.js +1 -0
  20. package/build/assets/{back-nav-button-HHEneWMw.js → back-nav-button-H_ThtDA0.js} +1 -1
  21. package/build/assets/{backend-form-modal-DiVrD4Cm.js → backend-form-modal-CbCemvHt.js} +1 -1
  22. package/build/assets/backend-not-configured-DP8KLNq_.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-7MIjpr8M.js → backend-synced-settings-badge-BBASWqsb.js} +1 -1
  24. package/build/assets/{badge-CpYmcVZV.js → badge-B-51h-SW.js} +1 -1
  25. package/build/assets/{base-modal-Fnh6Uln9.js → base-modal-BbjycA8X.js} +1 -1
  26. package/build/assets/{bot-BQZx8e2i.js → bot-CGPCg03p.js} +1 -1
  27. package/build/assets/{brand-button-swT1RyO0.js → brand-button-Blxv5nww.js} +1 -1
  28. package/build/assets/browser-CuW0nWvh.js +7 -0
  29. package/build/assets/{browser-tab-zAY12m_i.js → browser-tab-D5G0ORwt.js} +1 -1
  30. package/build/assets/{chat-send-button-DsJtivmL.js → chat-send-button-BD2tii1r.js} +1 -1
  31. package/build/assets/check-DSuS-lyr.js +1 -0
  32. package/build/assets/chevron-down-CgGcmtE2.js +1 -0
  33. package/build/assets/circle-check-CG5-NPw7.js +1 -0
  34. package/build/assets/{circle-plus-check-toggle-Cuzx55bo.js → circle-plus-check-toggle-ASbpB8vN.js} +1 -1
  35. package/build/assets/{cloud-funnel-analytics-86CwNdSh.js → cloud-funnel-analytics-GlCUG0gk.js} +1 -1
  36. package/build/assets/cog-CZiR80uT.js +1 -0
  37. package/build/assets/{combobox-caret-D0fRotFi.js → combobox-caret-DvpEsh2O.js} +1 -1
  38. package/build/assets/{command-menu-BXy03FBl.js → command-menu-DwUQzjYP.js} +1 -1
  39. package/build/assets/{condenser-settings-BmZa0ui_.js → condenser-settings-BptcoiLA.js} +1 -1
  40. package/build/assets/{confirmation-modal-BgoN6lbN.js → confirmation-modal-CiEwxZAA.js} +1 -1
  41. package/build/assets/{context-menu-list-item-Bq02tc-P.js → context-menu-list-item-CdcamfM1.js} +1 -1
  42. package/build/assets/conversation-DREHj4nT.js +1 -0
  43. package/build/assets/conversation-DotRfiDz.js +90 -0
  44. package/build/assets/conversation-panel-DREHj4nT.js +1 -0
  45. package/build/assets/conversation-state-store-DMLtlHbE.js +1 -0
  46. package/build/assets/{conversation-tab-empty-state-CMqo_0Bd.js → conversation-tab-empty-state-D-puECpY.js} +1 -1
  47. package/build/assets/{copy-to-clipboard-button-Cg1pF0xn.js → copy-to-clipboard-button-BGxcUbgy.js} +1 -1
  48. package/build/assets/{device-verify-BfQLgNyq.js → device-verify-CZJfWaJf.js} +1 -1
  49. package/build/assets/{dropdown-classes-BIqQr5mx.js → dropdown-classes-tLhpwtxS.js} +1 -1
  50. package/build/assets/{entry.client-CxFjRYqH.js → entry.client-D8GnI6GZ.js} +2 -2
  51. package/build/assets/{enum-filter-dropdown-C_yV4_bo.js → enum-filter-dropdown-Fk8k60nk.js} +1 -1
  52. package/build/assets/{environment-switch-overlay-Bi4qbh2g.js → environment-switch-overlay-DeztVYuL.js} +1 -1
  53. package/build/assets/{extensions-hub-BqUINAhp.js → extensions-hub-Cd6GCYzq.js} +1 -1
  54. package/build/assets/{extensions-navigation-lraj88Wk.js → extensions-navigation-C4sgZg-y.js} +1 -1
  55. package/build/assets/{external-link-CgtpA_a1.js → external-link-C0UpBgsE.js} +1 -1
  56. package/build/assets/{file-text-DEK4LSVw.js → file-text-C6WYtNdV.js} +1 -1
  57. package/build/assets/files-tab-BW_qzyAm.js +1 -0
  58. package/build/assets/{form-control-classes-7yFSQJq_.js → form-control-classes-CGXBLcn1.js} +1 -1
  59. package/build/assets/format-model-name-BNPKVsIq.js +1 -0
  60. package/build/assets/format-relative-time-ZhQD4rsl.js +1 -0
  61. package/build/assets/git-provider-icon-CaQ1yLPi.js +1 -0
  62. package/build/assets/{git-repo-dropdown-ByMzpNko.js → git-repo-dropdown-CgXR6M_E.js} +1 -1
  63. package/build/assets/git-repo-dropdown-D2Uei3CO.js +1 -0
  64. package/build/assets/{highlighted-source-view-C_sfncLZ.js → highlighted-source-view-C_YOp8Fo.js} +1 -1
  65. package/build/assets/home-DNzzJcMP.js +1 -0
  66. package/build/assets/home-aCos-5vc.js +1 -0
  67. package/build/assets/{home-store-CxqsY9Fi.js → home-store-DgzViC3f.js} +1 -1
  68. package/build/assets/index-home-DNzzJcMP.js +1 -0
  69. package/build/assets/info-CLoC1LRo.js +1 -0
  70. package/build/assets/install-server-modal-D7zIqNKz.js +1 -0
  71. package/build/assets/kebab-menu-item-content-DERMdnDv.js +1 -0
  72. package/build/assets/{launch-CkqiSCqi.js → launch-5PjKeLak.js} +1 -1
  73. package/build/assets/{list-todo-DNWlzfaM.js → list-todo-BF049YaY.js} +1 -1
  74. package/build/assets/llm-not-configured-banner-BK9z5eS0.js +27 -0
  75. package/build/assets/llm-settings-BLAMK2tR.js +1 -0
  76. package/build/assets/llm-settings-BWsbarGM.js +1 -0
  77. package/build/assets/{llm-subscription-service-BAdOl5Xx.js → llm-subscription-service-SfnEV9Uc.js} +1 -1
  78. package/build/assets/loader-circle-D7IagAyF.js +1 -0
  79. package/build/assets/{loading-spinner-xhnrGP4Y.js → loading-spinner-DBgXgra0.js} +1 -1
  80. package/build/assets/{manage-backends-modal-DhGk5mJt.js → manage-backends-modal-BTqNPhzc.js} +1 -1
  81. package/build/assets/manifest-abebca3c.js +1 -0
  82. package/build/assets/manifest-subpage-layout-Rn-glaxV.js +1 -0
  83. package/build/assets/{map-provider-Mx8mZuE-.js → map-provider-BK4HnqYz.js} +1 -1
  84. package/build/assets/markdown-renderer-Cp6DlHQN.js +8 -0
  85. package/build/assets/{mcp-DCkvl6K0.js → mcp-BC-Ixn4T.js} +2 -2
  86. package/build/assets/{mcp-marketplace-utils-DEbMXlQr.js → mcp-marketplace-utils-BJWJgbB6.js} +1 -1
  87. package/build/assets/{messages-DSXvyc21.js → messages-CzFKrzPG.js} +5 -5
  88. package/build/assets/{modal-body-gIe21fDv.js → modal-body-BdKfD3Hl.js} +1 -1
  89. package/build/assets/{modal-classes-D66dlgZ7.js → modal-classes-D5_b5vMi.js} +1 -1
  90. package/build/assets/{modal-close-button-B6iOGYpI.js → modal-close-button-objukxk_.js} +1 -1
  91. package/build/assets/{mouse-pointer-click-BYX1Pw5W.js → mouse-pointer-click-C_gXyLyD.js} +1 -1
  92. package/build/assets/{npm-DLckoeJc.js → npm-CHVHV1MC.js} +1 -1
  93. package/build/assets/{onboarding-D7WDG66N.js → onboarding-Diw0V51A.js} +1 -1
  94. package/build/assets/onboarding-modal-Da4yHzsA.js +1 -0
  95. package/build/assets/{organization-service.api-D-s9z18a.js → organization-service.api-BztSy69u.js} +1 -1
  96. package/build/assets/parse-git-remote-url-BkXN9jzl.js +1 -0
  97. package/build/assets/{pencil-BGOCPRyu.js → pencil-49avMHlD.js} +1 -1
  98. package/build/assets/{planner-tab-AKaXIIfg.js → planner-tab-CJiSpNax.js} +1 -1
  99. package/build/assets/{plugins-management-service-wtmY4QQw.js → plugins-management-service-lHdNKWNU.js} +1 -1
  100. package/build/assets/plus-C0BagBpV.js +1 -0
  101. package/build/assets/profiles-service.api-BLr7FXec.js +1 -0
  102. package/build/assets/providers-CWXnb7S3.js +1 -0
  103. package/build/assets/{proxy-9Z_WZggZ.js → proxy-DYDXxtje.js} +1 -1
  104. package/build/assets/{puzzle-BWLmN8z4.js → puzzle-Bt2B1rzf.js} +1 -1
  105. package/build/assets/recommended-automations-launcher-CcFMfJRR.js +1 -0
  106. package/build/assets/{refresh-cw-CXtFWpwv.js → refresh-cw-nmcesifB.js} +1 -1
  107. package/build/assets/root-CT4t7apy.css +1 -0
  108. package/build/assets/root-DnRgLKpU.js +2 -0
  109. package/build/assets/root-layout-2L9tr-BN.js +2 -0
  110. package/build/assets/{schema-field-OnM5Uob_.js → schema-field-C59lVZTA.js} +1 -1
  111. package/build/assets/{sdk-section-page-m5WQm2sy.js → sdk-section-page-BbBEQQjq.js} +1 -1
  112. package/build/assets/search-CYSDBczG.js +1 -0
  113. package/build/assets/secrets-service-BtsgYSlj.js +1 -0
  114. package/build/assets/secrets-settings-DJ0OKa4_.js +1 -0
  115. package/build/assets/{segmented-toggle-DCspm2U5.js → segmented-toggle-DiVfTZuN.js} +1 -1
  116. package/build/assets/{settings-BJQI_iBM.js → settings-CDqL_Uqh.js} +1 -1
  117. package/build/assets/{settings-CWFxymAf.js → settings-DcNPxz0v.js} +1 -1
  118. package/build/assets/{settings-dropdown-input-BI8V_Nov.js → settings-dropdown-input-Ba1UN5Du.js} +1 -1
  119. package/build/assets/{settings-index-BiTqJoH7.js → settings-index-Cz2cKt2K.js} +1 -1
  120. package/build/assets/{settings-input-Cz62hWVW.js → settings-input-CWUEHHvS.js} +1 -1
  121. package/build/assets/{settings-list-classes-z_3FW5H3.js → settings-list-classes-DdcLXDGn.js} +1 -1
  122. package/build/assets/{settings-modal-BIrIVn97.js → settings-modal-nEEK1Kh1.js} +1 -1
  123. package/build/assets/{settings-service.api--rJmnuLa.js → settings-service.api-3yAUFcaP.js} +1 -1
  124. package/build/assets/{settings-switch-BRsSI8Vs.js → settings-switch-Dk9hChx1.js} +1 -1
  125. package/build/assets/{settings-utils-Ba7vel6T.js → settings-utils-CxjtCSB3.js} +1 -1
  126. package/build/assets/{shared-conversation-CQK_PqHx.js → shared-conversation-DbAcrx3s.js} +1 -1
  127. package/build/assets/{shield-check-T3JsDJiM.js → shield-check-CiOTXxV2.js} +1 -1
  128. package/build/assets/{sidebar-layout-Bhi3hVcu.js → sidebar-layout-lrfPooIB.js} +1 -1
  129. package/build/assets/{sidebar-mobile-menu-toggle-YWJNRN4p.js → sidebar-mobile-menu-toggle-KERXfNu1.js} +1 -1
  130. package/build/assets/{sidebar-nav-link-BSUlY5Ml.js → sidebar-nav-link-B8lFD6Cb.js} +1 -1
  131. package/build/assets/{sidebar-store-Cl1cUv_F.js → sidebar-store-u6pUpxJ7.js} +1 -1
  132. package/build/assets/{skill-card-pill-row-BXz8L8Rn.js → skill-card-pill-row-dGIUzr_b.js} +1 -1
  133. package/build/assets/{skill-icon-badge-QgfKv31M.js → skill-icon-badge-kkOWZ89w.js} +1 -1
  134. package/build/assets/{skill-scope-Dc3JPW-8.js → skill-scope-DWN1PBPH.js} +1 -1
  135. package/build/assets/{skills-plugins-CpTV27n3.js → skills-plugins-DFjH2Nq6.js} +1 -1
  136. package/build/assets/{skills-settings-CSW__IW4.js → skills-settings-DIHpl3ol.js} +2 -2
  137. package/build/assets/{sparkles-TJ0mdECe.js → sparkles-ntyMLnbj.js} +1 -1
  138. package/build/assets/{styled-tooltip-BUMSbgrF.js → styled-tooltip-B6JXcsmL.js} +1 -1
  139. package/build/assets/{task-list-tab-mAHMOkUz.js → task-list-tab-aEJzEcHD.js} +1 -1
  140. package/build/assets/{terminal-BzxBaHx2.js → terminal-Dch7Ty5K.js} +1 -1
  141. package/build/assets/{toggle-switch-O5v1FgxW.js → toggle-switch-B2MLKsgt.js} +1 -1
  142. package/build/assets/{trash-2-C0xNVp9c.js → trash-2-yZnDM4Ji.js} +1 -1
  143. package/build/assets/{typography-NOKSk9_R.js → typography-DB5HoCk0.js} +1 -1
  144. package/build/assets/usage-tab-DrEtBmBT.js +1 -0
  145. package/build/assets/use-acp-credential-form-c8KXAa8A.js +1 -0
  146. package/build/assets/{use-activate-agent-profile-D9YRQPTF.js → use-activate-agent-profile-B0p34N3q.js} +1 -1
  147. package/build/assets/use-agent-profiles-CPIc6wLH.js +1 -0
  148. package/build/assets/{use-can-manage-org-profiles-Dxzq2AEd.js → use-can-manage-org-profiles-Dz_8Eqkv.js} +1 -1
  149. package/build/assets/{use-cloud-current-user-id-Co2eJk2A.js → use-cloud-current-user-id-DvUVqCle.js} +1 -1
  150. package/build/assets/use-config-C3PO4TBw.js +1 -0
  151. package/build/assets/{use-create-conversation-CoHTiCbI.js → use-create-conversation-DVrA_uLD.js} +1 -1
  152. package/build/assets/use-create-secret-DbBIpaCR.js +1 -0
  153. package/build/assets/use-get-secrets-6PBitf54.js +1 -0
  154. package/build/assets/use-has-permission-CQ31Cl8j.js +1 -0
  155. package/build/assets/use-is-authed-2UrDIziV.js +1 -0
  156. package/build/assets/use-is-creating-conversation-BvYpmb3v.js +1 -0
  157. package/build/assets/use-llm-profiles-diZS4FiN.js +1 -0
  158. package/build/assets/use-manifest-capabilities-HIWCtIUm.js +1 -0
  159. package/build/assets/{use-onboarding-completion-CCE8OQgV.js → use-onboarding-completion-Bs8PcXik.js} +1 -1
  160. package/build/assets/{use-plugins-marketplace-CEiak69h.js → use-plugins-marketplace-BCuNLFsr.js} +1 -1
  161. package/build/assets/use-save-agent-profile-BaMNSpBV.js +1 -0
  162. package/build/assets/{use-save-settings-DNmnbG6f.js → use-save-settings-BahvC2Gw.js} +1 -1
  163. package/build/assets/{use-settings-wCwPaSIv.js → use-settings-C6ZxpBDX.js} +1 -1
  164. package/build/assets/{use-settings-nav-items-BlFL7YhM.js → use-settings-nav-items-Bqn69Ggw.js} +2 -2
  165. package/build/assets/use-tracking-Bhu7gk2y.js +3 -0
  166. package/build/assets/{use-user-conversation-DVtfg0B_.js → use-user-conversation-BkNXpXrd.js} +1 -1
  167. package/build/assets/{useInfiniteQuery-p1xq35r2.js → useInfiniteQuery-c_OmS3lK.js} +1 -1
  168. package/build/assets/{useMutation-BFDQmgk9.js → useMutation-6ZsQCqAn.js} +1 -1
  169. package/build/assets/{useQueries-DF1NAAeC.js → useQueries-xDrGlTO_.js} +1 -1
  170. package/build/assets/{useQuery-DRv--6bK.js → useQuery-Bs5NFz2s.js} +1 -1
  171. package/build/assets/{utils-zxEjKE70.js → utils-DUD5ScdA.js} +1 -1
  172. package/build/assets/{vendor~entry.client-CgNUwtQL.js → vendor~entry.client-BFE7Llz9.js} +1 -1
  173. package/build/assets/{vendor~entry.client-zSIea5EO.js → vendor~entry.client-BaKt_PIp.js} +1 -1
  174. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kepq2zme-D87mAf6K.js} +1 -1
  175. package/build/assets/{vendor~files-tab-D9wR9yM2.js → vendor~files-tab-B6POTS66.js} +1 -1
  176. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js → vendor~index-home~home~conversation-panel~conversation-53Q_U6uP.js} +1 -1
  177. package/build/assets/{vendor~root-layout-C-IgVx6e.js → vendor~root-layout-DeQACFVA.js} +1 -1
  178. package/build/assets/{vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js → vendor~root-layout~conversation-panel~conversation-bv7ooVgH.js} +1 -1
  179. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-e8pX05xf.js} +1 -1
  180. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-BvS6PCK2.js} +1 -1
  181. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-DOPLJMH9.js} +1 -1
  182. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz8NQve5.js} +1 -1
  183. package/build/assets/{verification-settings-B8UMQ7MG.js → verification-settings-COueVXmM.js} +1 -1
  184. package/build/assets/{wrench-DIka3hCq.js → wrench-C95ujnYo.js} +1 -1
  185. package/build/assets/x-86ZCfxKY.js +1 -0
  186. package/build/assets/{zap-DHddTPc0.js → zap-DRa-r-Tf.js} +1 -1
  187. package/build/index.html +4 -4
  188. package/build/locales/ar/openhands.json +60 -2
  189. package/build/locales/ca/openhands.json +60 -2
  190. package/build/locales/de/openhands.json +60 -2
  191. package/build/locales/en/openhands.json +60 -2
  192. package/build/locales/es/openhands.json +60 -2
  193. package/build/locales/fr/openhands.json +60 -2
  194. package/build/locales/it/openhands.json +60 -2
  195. package/build/locales/ja/openhands.json +60 -2
  196. package/build/locales/ko-KR/openhands.json +60 -2
  197. package/build/locales/no/openhands.json +60 -2
  198. package/build/locales/pt/openhands.json +60 -2
  199. package/build/locales/tr/openhands.json +60 -2
  200. package/build/locales/uk/openhands.json +60 -2
  201. package/build/locales/zh-CN/openhands.json +60 -2
  202. package/build/locales/zh-TW/openhands.json +60 -2
  203. package/config/defaults.json +1 -1
  204. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  205. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  206. package/dist/api/automation-service/automation-service.api.d.ts +10 -0
  207. package/dist/api/automation-service/automation-service.api.js +42 -0
  208. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  209. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  210. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  211. package/dist/api/cloud/conversation-service.api.d.ts +9 -0
  212. package/dist/api/cloud/conversation-service.api.js +11 -1
  213. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  214. package/dist/api/profiles-service/profiles-service.api.cjs +1 -1
  215. package/dist/api/profiles-service/profiles-service.api.cjs.map +1 -1
  216. package/dist/api/profiles-service/profiles-service.api.d.ts +15 -2
  217. package/dist/api/profiles-service/profiles-service.api.js +25 -2
  218. package/dist/api/profiles-service/profiles-service.api.js.map +1 -1
  219. package/dist/api/secrets-service.cjs +1 -1
  220. package/dist/api/secrets-service.cjs.map +1 -1
  221. package/dist/api/secrets-service.d.ts +5 -0
  222. package/dist/api/secrets-service.js +12 -6
  223. package/dist/api/secrets-service.js.map +1 -1
  224. package/dist/components/conversation-events/chat/event-message-components/index.d.ts +0 -1
  225. package/dist/components/features/automations/git-sync/git-sync-activity-row.d.ts +15 -0
  226. package/dist/components/features/automations/git-sync/git-sync-config-form.d.ts +13 -0
  227. package/dist/components/features/automations/git-sync/git-sync-error-banner.d.ts +6 -0
  228. package/dist/components/features/automations/git-sync/git-sync-not-local-state.d.ts +1 -0
  229. package/dist/components/features/automations/git-sync/git-sync-overview-section.d.ts +12 -0
  230. package/dist/components/features/automations/git-sync/git-sync-skeleton.d.ts +1 -0
  231. package/dist/components/features/automations/git-sync/git-sync-status-pill.d.ts +7 -0
  232. package/dist/components/features/automations/git-sync/git-sync-unsupported-state.d.ts +7 -0
  233. package/dist/components/features/automations/responder-deployment-modal.d.ts +2 -1
  234. package/dist/components/features/chat/chat-interface.cjs +2 -2
  235. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  236. package/dist/components/features/chat/chat-interface.js +177 -176
  237. package/dist/components/features/chat/chat-interface.js.map +1 -1
  238. package/dist/components/features/chat/error-message-banner.cjs +1 -1
  239. package/dist/components/features/chat/error-message-banner.cjs.map +1 -1
  240. package/dist/components/features/chat/error-message-banner.d.ts +3 -1
  241. package/dist/components/features/chat/error-message-banner.js +64 -58
  242. package/dist/components/features/chat/error-message-banner.js.map +1 -1
  243. package/dist/components/features/conversation-panel/compact-conversation-row.cjs +1 -1
  244. package/dist/components/features/conversation-panel/compact-conversation-row.js +6 -6
  245. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  246. package/dist/components/features/conversation-panel/conversation-panel.js +19 -19
  247. package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +10 -7
  248. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  249. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
  250. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +1 -1
  251. package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
  252. package/dist/config/defaults.cjs +1 -1
  253. package/dist/config/defaults.cjs.map +1 -1
  254. package/dist/config/defaults.js +1 -1
  255. package/dist/config/defaults.js.map +1 -1
  256. package/dist/contexts/conversation-websocket-context.cjs +2 -2
  257. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  258. package/dist/contexts/conversation-websocket-context.js +12 -12
  259. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  260. package/dist/hooks/query/use-commit-changes.cjs +1 -1
  261. package/dist/hooks/query/use-commit-changes.js +4 -4
  262. package/dist/hooks/query/use-git-sync.d.ts +19 -0
  263. package/dist/hooks/query/use-task-polling.cjs +1 -1
  264. package/dist/hooks/query/use-task-polling.cjs.map +1 -1
  265. package/dist/hooks/query/use-task-polling.js +12 -10
  266. package/dist/hooks/query/use-task-polling.js.map +1 -1
  267. package/dist/hooks/query/use-unified-get-git-changes.cjs +1 -1
  268. package/dist/hooks/query/use-unified-get-git-changes.js +4 -4
  269. package/dist/hooks/query/use-unified-git-commits.cjs +1 -1
  270. package/dist/hooks/query/use-unified-git-commits.js +4 -4
  271. package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
  272. package/dist/hooks/query/use-unified-git-diff.js +4 -4
  273. package/dist/hooks/query/use-workspace-files.cjs +1 -1
  274. package/dist/hooks/query/use-workspace-files.cjs.map +1 -1
  275. package/dist/hooks/query/use-workspace-files.d.ts +14 -4
  276. package/dist/hooks/query/use-workspace-files.js +45 -32
  277. package/dist/hooks/query/use-workspace-files.js.map +1 -1
  278. package/dist/hooks/use-responder-url-secret.d.ts +5 -0
  279. package/dist/hooks/use-tracking.cjs +1 -1
  280. package/dist/hooks/use-tracking.cjs.map +1 -1
  281. package/dist/hooks/use-tracking.d.ts +6 -0
  282. package/dist/hooks/use-tracking.js +6 -0
  283. package/dist/hooks/use-tracking.js.map +1 -1
  284. package/dist/i18n/declaration.cjs +1 -1
  285. package/dist/i18n/declaration.cjs.map +1 -1
  286. package/dist/i18n/declaration.d.ts +59 -1
  287. package/dist/i18n/declaration.js +1 -1
  288. package/dist/i18n/declaration.js.map +1 -1
  289. package/dist/i18n/translation.cjs +1 -1
  290. package/dist/i18n/translation.cjs.map +1 -1
  291. package/dist/i18n/translation.js +1001 -15
  292. package/dist/i18n/translation.js.map +1 -1
  293. package/dist/locales/ar/openhands.json +60 -2
  294. package/dist/locales/ca/openhands.json +60 -2
  295. package/dist/locales/de/openhands.json +60 -2
  296. package/dist/locales/en/openhands.json +60 -2
  297. package/dist/locales/es/openhands.json +60 -2
  298. package/dist/locales/fr/openhands.json +60 -2
  299. package/dist/locales/it/openhands.json +60 -2
  300. package/dist/locales/ja/openhands.json +60 -2
  301. package/dist/locales/ko-KR/openhands.json +60 -2
  302. package/dist/locales/no/openhands.json +60 -2
  303. package/dist/locales/pt/openhands.json +60 -2
  304. package/dist/locales/tr/openhands.json +60 -2
  305. package/dist/locales/uk/openhands.json +60 -2
  306. package/dist/locales/zh-CN/openhands.json +60 -2
  307. package/dist/locales/zh-TW/openhands.json +60 -2
  308. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs +2 -0
  309. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs.map +1 -0
  310. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +27 -0
  311. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js.map +1 -0
  312. package/dist/package.cjs +1 -1
  313. package/dist/package.cjs.map +1 -1
  314. package/dist/package.js +1 -1
  315. package/dist/package.js.map +1 -1
  316. package/dist/routes/files-tab.cjs +1 -1
  317. package/dist/routes/files-tab.js +11 -11
  318. package/dist/routes/files-tab.js.map +1 -1
  319. package/dist/services/settings.cjs +1 -1
  320. package/dist/services/settings.cjs.map +1 -1
  321. package/dist/services/settings.js +2 -2
  322. package/dist/services/settings.js.map +1 -1
  323. package/dist/services/telemetry.cjs +1 -1
  324. package/dist/services/telemetry.cjs.map +1 -1
  325. package/dist/services/telemetry.js +47 -51
  326. package/dist/services/telemetry.js.map +1 -1
  327. package/dist/stores/error-message-store.cjs +1 -1
  328. package/dist/stores/error-message-store.cjs.map +1 -1
  329. package/dist/stores/error-message-store.d.ts +3 -1
  330. package/dist/stores/error-message-store.js +5 -3
  331. package/dist/stores/error-message-store.js.map +1 -1
  332. package/dist/types/git-sync.d.ts +51 -0
  333. package/dist/utils/error-handler.cjs +1 -1
  334. package/dist/utils/error-handler.cjs.map +1 -1
  335. package/dist/utils/error-handler.d.ts +3 -2
  336. package/dist/utils/error-handler.js +18 -5
  337. package/dist/utils/error-handler.js.map +1 -1
  338. package/dist/utils/format-model-name.cjs +1 -1
  339. package/dist/utils/format-model-name.cjs.map +1 -1
  340. package/dist/utils/format-model-name.d.ts +1 -0
  341. package/dist/utils/format-model-name.js +1 -0
  342. package/dist/utils/format-model-name.js.map +1 -1
  343. package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
  344. package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
  345. package/dist/utils/transcript-export/load-complete-events.js +24 -16
  346. package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
  347. package/package.json +1 -1
  348. package/scripts/check-translation-completeness.cjs +3 -0
  349. package/scripts/dev-with-automation.mjs +98 -9
  350. package/build/assets/active-backend-context-IqOjobNK.js +0 -2
  351. package/build/assets/agent-settings-COfJsQ1d.js +0 -1
  352. package/build/assets/automation-detail-B-jQ39Mm.js +0 -3
  353. package/build/assets/automation-export-B1dywoqk.js +0 -2
  354. package/build/assets/automation-setup-route-C-bWUZBi.js +0 -1
  355. package/build/assets/automations-list-DnMxlxsL.js +0 -1
  356. package/build/assets/browser-B9AbV6kG.js +0 -7
  357. package/build/assets/check-WAFXrrs_.js +0 -1
  358. package/build/assets/chevron-down-CifNWzme.js +0 -1
  359. package/build/assets/circle-check-CtnimJa8.js +0 -1
  360. package/build/assets/conversation-BPo8SvLN.js +0 -1
  361. package/build/assets/conversation-CPCVsCUY.js +0 -90
  362. package/build/assets/conversation-panel-BPo8SvLN.js +0 -1
  363. package/build/assets/conversation-state-store-C5YpjMNy.js +0 -1
  364. package/build/assets/files-tab-DV0L-lFE.js +0 -1
  365. package/build/assets/format-model-name-BN_rx1Y3.js +0 -1
  366. package/build/assets/format-relative-time-DSErAuVr.js +0 -1
  367. package/build/assets/git-provider-icon-BvlLAche.js +0 -1
  368. package/build/assets/git-repo-dropdown-C6R7hgM8.js +0 -1
  369. package/build/assets/home-BOrlwLqG.js +0 -1
  370. package/build/assets/home-BvMNC6E-.js +0 -1
  371. package/build/assets/index-home-BvMNC6E-.js +0 -1
  372. package/build/assets/info-BRVcJAUg.js +0 -1
  373. package/build/assets/install-server-modal-Bl4G1zF4.js +0 -1
  374. package/build/assets/kebab-menu-item-content-BGoGFEAg.js +0 -1
  375. package/build/assets/llm-not-configured-banner-DLw_tu-G.js +0 -27
  376. package/build/assets/llm-settings-B-pkVCrt.js +0 -1
  377. package/build/assets/llm-settings-DSC0-IQ7.js +0 -1
  378. package/build/assets/loader-circle-B47W9XqT.js +0 -1
  379. package/build/assets/manifest-653b89aa.js +0 -1
  380. package/build/assets/manifest-subpage-layout-CKWvL2ig.js +0 -1
  381. package/build/assets/markdown-renderer-DUmk7pFc.js +0 -8
  382. package/build/assets/onboarding-modal-C_xVrFNv.js +0 -1
  383. package/build/assets/plus-zNEL8rcX.js +0 -1
  384. package/build/assets/profiles-service.api-DCMYxHMi.js +0 -1
  385. package/build/assets/providers-BjrtjX4L.js +0 -1
  386. package/build/assets/recommended-automations-launcher-CFlzhu1o.js +0 -1
  387. package/build/assets/root-CanxKlNV.css +0 -1
  388. package/build/assets/root-DkfG_UWR.js +0 -2
  389. package/build/assets/root-layout-D75LHYhh.js +0 -2
  390. package/build/assets/search-CycosyjN.js +0 -1
  391. package/build/assets/secrets-service-B26R61C1.js +0 -1
  392. package/build/assets/secrets-settings-CbLYCKOX.js +0 -1
  393. package/build/assets/usage-tab-tEmVN0KD.js +0 -1
  394. package/build/assets/use-acp-credential-form-BPNi0Zbm.js +0 -1
  395. package/build/assets/use-agent-profiles-Cb2zUW3l.js +0 -1
  396. package/build/assets/use-config-DKAMiI5R.js +0 -1
  397. package/build/assets/use-create-secret-2zBlCDsF.js +0 -1
  398. package/build/assets/use-is-authed-C52-ivnB.js +0 -1
  399. package/build/assets/use-is-creating-conversation-DdaAE6jV.js +0 -1
  400. package/build/assets/use-llm-profiles-C_BHue65.js +0 -1
  401. package/build/assets/use-manifest-capabilities-DPrQsaPP.js +0 -1
  402. package/build/assets/use-save-agent-profile-DK9idD6a.js +0 -1
  403. package/build/assets/use-tracking-CVwPmhlX.js +0 -3
  404. package/build/assets/x-BWKA2Ver.js +0 -1
  405. package/dist/api/cloud/suggestions-service.api.d.ts +0 -8
  406. package/dist/api/suggestions-service/suggestions-service.api.d.ts +0 -11
  407. package/dist/components/conversation-events/chat/event-message-components/observation-pair-event-message.d.ts +0 -7
  408. package/dist/components/conversation-events/index.d.ts +0 -1
  409. package/dist/components/features/automations/metadata-chip.d.ts +0 -6
  410. package/dist/components/features/chat/task-tracking/status-badge.d.ts +0 -5
  411. package/dist/components/features/chat/task-tracking/status-icon.d.ts +0 -5
  412. package/dist/components/features/chat/task-tracking/task-list-section.d.ts +0 -10
  413. package/dist/components/features/controls/tools.d.ts +0 -2
  414. package/dist/components/features/conversation-panel/new-conversation-button.d.ts +0 -23
  415. package/dist/components/features/home/home-header/guide-message.d.ts +0 -1
  416. package/dist/components/features/home/home-header/home-header.d.ts +0 -1
  417. package/dist/components/features/home/new-conversation/create-conversation-button.d.ts +0 -1
  418. package/dist/components/features/home/new-conversation/new-conversation.d.ts +0 -1
  419. package/dist/components/features/home/new-conversation.d.ts +0 -1
  420. package/dist/components/features/home/tasks/task-card.d.ts +0 -6
  421. package/dist/components/features/home/tasks/task-group.d.ts +0 -7
  422. package/dist/components/features/home/tasks/task-issue-number.d.ts +0 -6
  423. package/dist/components/features/home/tasks/task-item-title.d.ts +0 -1
  424. package/dist/components/features/home/tasks/task-suggestions-skeleton.d.ts +0 -1
  425. package/dist/components/features/home/tasks/task-suggestions.d.ts +0 -6
  426. package/dist/components/features/settings/agent-server-onboarding.d.ts +0 -10
  427. package/dist/components/features/settings/mcp-settings/mcp-server-list-item.d.ts +0 -6
  428. package/dist/components/features/settings/mcp-settings/mcp-server-list.d.ts +0 -8
  429. package/dist/hooks/query/use-suggested-tasks.d.ts +0 -1
  430. package/dist/hooks/use-should-show-user-features.d.ts +0 -1
  431. package/dist/ui/card-title.d.ts +0 -16
  432. package/dist/ui/card.d.ts +0 -14
  433. package/dist/utils/group-suggested-tasks.d.ts +0 -7
  434. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dcc51rps-rfV8mQ9m.js} +0 -0
  435. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ox0jfsa0-cHFhpUBq.js} +0 -0
  436. /package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~9pstowjp-BOVIFA_g.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BOVIFA_g.js} +0 -0
  437. /package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C0JXQb_q.js} +0 -0
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor~module-DyG7x7JT.js","assets/rolldown-runtime-Cyuzqnbw.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,xt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{r as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{A as a,E as o,F as s,I as ee,L as te,N as ne,O as re,T as c,b as ie,f as ae,k as oe}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{R as se,t as ce,z as l}from"./utils-zxEjKE70.js";var u=e(t(),1),le=`__AGENT_CANVAS_BASE_PATH__`;function ue(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function de(){let e=ue(void 0);if(e)return e;if(typeof window<`u`){let e=window[le];if(typeof e==`string`)return ue(e)}return``}function fe(e){let t=de();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var d=`openhands`,pe=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],me=new WeakMap,he=e=>{if(!me.has(e)){let t=e.use(oe).use(re).use(i).init({fallbackLng:`en`,debug:!1,supportedLngs:pe.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[d],defaultNS:d,fallbackNS:d,backend:{loadPath:fe(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});me.set(e,t)}return e},ge=()=>he(ne()),_e=null,ve=null,f=()=>(_e||=ge(),_e),ye=()=>ve??f(),be=e=>(ve=e??f(),ve),xe=async(e=f())=>(await me.get(e),e),Se=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:d,...e}:e:{ns:d},p=new Proxy({},{get:(e,t)=>{let n=ye();if(t===`t`)return(e,t)=>n.t(e,Se(t));if(t===`exists`)return(e,t)=>n.exists(e,Se(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=ye();return Reflect.set(r,t,n,r)}}),Ce=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,we=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,Te=`Disconnected (check URL or network). Check that the backend URL is correct and the backend server is reachable. If the backend is on another origin, check that it allows this frontend origin.`,Ee=`Disconnected (request timed out). Check that the backend URL is correct and reachable.`,De=4;function Oe(e){return typeof e==`object`&&!!e}function ke(e){let t=[],n=new Set,r=e,i=0;for(;r!=null&&i<De&&!n.has(r);){if(n.add(r),r instanceof Error)r.message&&t.push(r.message),r=r.cause;else if(typeof r==`string`){r&&t.push(r);break}else if(Oe(r)){let e=r.message;typeof e==`string`&&e&&t.push(e),r=r.cause}else break;i+=1}return t}function m(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`disconnected (check cors or network)`)||t.includes(`disconnected (check url or network)`)||t.includes(`blocked by cors`)||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`load failed`)||t.includes(`networkerror when attempting to fetch resource`)||t.includes(`cors`)&&t.includes(`blocked`)}function Ae(e){return ke(e).some(m)}function je(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`request timeout`)||t.includes(`timeout after`)||t.includes(`backend request timed out`)}function Me(e){let t=ke(e);return t.some(m)?Te:t.some(je)?Ee:t[0]??null}function Ne(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var Pe=e=>{let t=null,n=!1;return Ne(e)?(n=!0,t=Ce(e)&&e.response?.data.error?e.response?.data.error:we(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,Me(n?t??e:e)??t??``},h=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},g=r(),Fe={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},_={position:`top-right`,style:Fe},Ie={...Fe,color:`var(--oh-muted)`};function Le({message:e}){let t=u.useRef(null),[n,r]=u.useState(!1);return u.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,g.jsxs)(`div`,{className:ce(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,g.jsx)(o,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:se}}),(0,g.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var Re={..._,icon:null,style:Ie},ze=e=>{let t=e||p.t(l.STATUS$ERROR);m(t)?t=p.t(l.ERROR$CORS_OR_NETWORK):je(t)&&(t=p.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=h(t,4e3);c((0,g.jsx)(Le,{message:t}),{...Re,duration:n})},Be=e=>{let t=h(e,5e3);c.success((0,g.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{..._,duration:t})},Ve=(e,t,n)=>{let r=h(`${e} ${t}`,5e3);c.success((0,g.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,g.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{..._,duration:r})},He=e=>{let t=h(e,6e3);c((0,g.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{..._,icon:`⚠️`,duration:t})},Ue=`openhands-backend-health`,We=500;function Ge(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function Ke(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Ue);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&Ge(r)&&(n[e]=r);return n}catch{return{}}}function qe(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(Ue);return}window.localStorage.setItem(Ue,JSON.stringify(e))}catch{}}function Je(e){let t=Me(e)??`Unknown error`;return t.length>We?`${t.slice(0,We)}…`:t}var v=Ke(),Ye=new Set;function Xe(){Ye.forEach(e=>e())}function y(e){v=e,qe(e),Xe()}function Ze(){return v}function Qe(e){return v[e]??null}function $e(e){return Ye.add(e),()=>{Ye.delete(e)}}function et(e,t){let n=v[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:Je(t),lastFailureAt:Date.now(),disabled:i};y({...v,[e]:a})}function tt(e){if(!(e in v))return;let{[e]:t,...n}=v;y(n)}function nt(e){if(!(e in v))return;let{[e]:t,...n}=v;y(n)}function rt(e){if(!(e in v))return;let{[e]:t,...n}=v;y(n)}var it=`workspace/project`,at=`__AGENT_CANVAS_LOCK_TO_CLOUD__`,ot=`all-hands.dev`,b=`openhands.dev`,st=`app.${ot}`,ct=b,lt=`app.${b}`;function ut(e){return e?.trim()||null}function dt(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 ft(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function pt(e){let t=e.toLowerCase();return t===st||t===lt?ct:t===ot?b:t.endsWith(`.${ot}`)?`${t.slice(0,-13)}${b}`:t}function mt(e){let t=ft(e);if(!t)return null;try{let e=new URL(t),n=e.port?`:${e.port}`:``;return`${e.protocol}//${pt(e.hostname)}${n}`}catch{return t.toLowerCase()}}function ht(){let e=x();return!e||typeof window>`u`||!yt(window.location.origin,e)?null:window.location.origin}function gt(){return dt(void 0)}function _t(){let e=ut(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return ut(e)}return null}function vt(){return{baseUrl:xt()??``,sessionApiKey:S()??``}}function x(){let e=ft(void 0);if(e)return e;if(typeof window<`u`){let e=window[at];if(typeof e==`string`)return ft(e)}return null}function yt(e,t){let n=mt(e),r=mt(t);return!n||!r?!1:n===r}function bt(){return ht()?`cookie`:`api-key`}function xt(){return gt()||(typeof window<`u`?window.location.origin:null)}function S(){return _t()}function St(){return it}function Ct(e){return`${St().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function wt(){let e=S();return e?{"X-Session-API-Key":e}:{}}function C(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function Tt(){return C()?!S():!1}var Et=`default-local`,Dt=`Local`,Ot=`locked-cloud`,kt=`OpenHands Cloud`;function At(){if(!x())return null;let e=ht();return e?{id:Ot,name:kt,host:e,apiKey:``,kind:`cloud`,authMode:`cookie`}:null}function w(){if(x())return null;let e=xt(),t=S();return!e||!t?null:{id:Et,name:Dt,host:e,apiKey:t,kind:`local`}}var jt=`openhands-backends`,T=`openhands-active-backend`;function Mt(e){return e===`local`||e===`cloud`}function Nt(e){return e===void 0||e===`api-key`||e===`cookie`}function Pt(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`&&Mt(t.kind)&&Nt(t.authMode)&&(t.connectionRevision===void 0||typeof t.connectionRevision==`number`&&Number.isSafeInteger(t.connectionRevision)&&t.connectionRevision>=0)}function Ft(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function It(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||Ft(e.host)&&Ft(t.host)}function Lt(e){let t=w();if(!t)return e;let n=!1,r=e.map(e=>!It(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(E(r),r):e}function E(e){if(!(typeof window>`u`))try{window.localStorage.setItem(jt,JSON.stringify(e))}catch{}}function Rt(){if(typeof window>`u`)return[];try{let e=At();if(e)return E([e]),Ut()?.backendId!==e.id&&D({backendId:e.id}),[e];let t=window.localStorage.getItem(jt);if(t===null){let e=w();return e?(E([e]),[e]):[]}let n=JSON.parse(t);if(!Array.isArray(n))return[];let r=n.filter(Pt);if(r.length===0){let e=w();return e?(E([e]),[e]):[]}return Lt(r)}catch{return[]}}function zt(e){if(!e)return null;try{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 Bt(e,t){try{return e?.getItem(t)??null}catch{return null}}function Vt(e,t,n){try{e?.setItem(t,n)}catch{}}function Ht(e,t){try{e?.removeItem(t)}catch{}}function Ut(){return typeof window>`u`?null:zt(Bt(window.sessionStorage,T))||zt(Bt(window.localStorage,T))}function D(e){if(typeof window>`u`)return;if(!e){Ht(window.sessionStorage,T),Ht(window.localStorage,T);return}let t=JSON.stringify({backendId:e.backendId,orgId:e.orgId??null});Vt(window.sessionStorage,T,t),Vt(window.localStorage,T,t)}var Wt=`backend`;function Gt(e,t){let{backend:n,orgId:r}=t;if(!n.id)return e;let[i,a=``]=e.split(`?`),o=new URLSearchParams(a);return o.set(Wt,n.id),r&&o.set(`org`,r),`${i}?${o.toString()}`}function Kt(e,t){if(!t)return null;let n;try{n=new URLSearchParams(t)}catch{return null}let r=n.get(Wt);return!r||!e.some(e=>e.id===r)?null:{backendId:r,orgId:n.get(`org`)||null}}function qt(){return typeof window>`u`?``:window.location.search}var Jt=`no-backend`,Yt={id:Jt,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function Xt(e){return e.id===Jt}function Zt(e){return e.find(e=>e.kind===`local`&&Qe(e.id)?.disabled!==!0)||(e.find(e=>e.kind===`local`)??e[0]??Yt)}function Qt(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=Zt(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}function $t(e){let t=Kt(e,qt());return t?(D(t),t):Ut()}var en=Rt(),O=Qt(en,$t(en)),tn=new Set;function nn(){tn.forEach(e=>e())}function rn(){return O.active}function k(){let e=O.active.backend;return e.kind===`local`&&!Xt(e)?e:null}function A(){return O.backends}function an(){return O.selection}function j(){return O}function on(e){D(e),O=Qt(O.backends,e),nn()}function sn(e){E(e);let t=O.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,D(null)),O=Qt(e,t),nn()}function cn(e){return tn.add(e),()=>{tn.delete(e)}}var ln=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},un=e=>{if(!(e instanceof a)||e.response?.status!==401&&e.status!==401)return!1;let t=rn().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},dn=new Set,fn=()=>{let e=new s({queryCache:new ee({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&tt(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||ln(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!un(t)){let e=Pe(t);dn.has(e||``)||(ze(e||p.t(l.ERROR$GENERIC)),dn.add(e||``),setTimeout(()=>{dn.delete(e||``)},3e3))}}}),mutationCache:new te({onError:(t,n,r,i)=>{ln(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!un(t)&&ze(Pe(t)||p.t(l.ERROR$GENERIC))}})});return e},pn=null,mn=null,hn=()=>(pn||=fn(),pn),gn=()=>mn??hn(),_n=e=>(mn=e??hn(),mn),vn=new Proxy({},{get:(e,t)=>{let n=gn(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=gn();return Reflect.set(r,t,n,r)}});function yn(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 bn(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function xn(e){let t=yn(e),n=bn(e),r=window.location.protocol===`https:`,i=Sn(e)===`https:`;return`${r||i?`https:`:`http:`}//${t}${n}`}function Sn(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function Cn(e){let t=yn(e),n=bn(e),r=window.location.protocol===`https:`,i=Sn(e)===`https:`;return`${r||i?`wss:`:`ws:`}//${t}${n}/sockets/bash-events`}function wn(e,t){if(!e)return null;let n=yn(t),r=bn(t),i=window.location.protocol===`https:`,a=Sn(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var Tn=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function En(e){return e.replace(/\/+$/,``)}function Dn(e,t){return e.host?En(e.host):e.conversationUrl?En(xn(e.conversationUrl)):En(t?.host??``)}function On(e={}){let t=k();if(!t&&!e.host&&!e.conversationUrl)throw new Tn;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:Dn(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??St(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function kn(e){let{host:t,apiKey:n,timeout:r}=On(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}var An={_comment:`Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.`,versions:{agentServer:`1.42.1`,agentCanvas:`1.13.0`,automation:`1.7.1`},compatibility:{minimumAgentServer:`1.28.0`},constraints:{_comment:`Temporary upper bound on the agent-client-protocol (acp) transitive dependency. openhands-sdk 1.35.0 requires agent-client-protocol>=0.10.1 with no upper bound, but acp 0.11.0 reordered the ACP prompt() arguments and breaks the SDK's ACP client (a PromptRequest validation error surfaces as 'ACP error: 2 validation errors for PromptRequest'). Pin acp <0.11 until a fixed openhands-sdk ships. Consumed by scripts/dev-safe.mjs (agent-server uvx install) and .github/workflows/mock-llm-e2e.yml (mock ACP server venv).`,agentClientProtocol:`agent-client-protocol<0.11`},images:{agentServer:`ghcr.io/openhands/agent-server`,agentCanvas:`ghcr.io/openhands/agent-canvas`},ports:{agentServer:18e3,automation:18001,proxy:8e3},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`},telemetry:{posthogApiKey:`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,posthogHost:`https://us.i.posthog.com`}},jn=5e3,Mn=`unknown`,M=An.compatibility.minimumAgentServer,Nn=`AGENT_SERVER_UNSUPPORTED_VERSION`,Pn=`AGENT_SERVER_UNKNOWN_VERSION`,N=null,Fn=null,In=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,P=class extends Error{details;noBackendConfigured;constructor(e,t){let n=t?.noBackendConfigured??!1;super(n?`No agent server backend is configured yet. Add a backend to get started.`:`Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null,this.noBackendConfigured=n}},Ln=e=>e instanceof P||typeof e==`object`&&!!e&&`name`in e&&(e.name===`AgentServerUnavailableError`||e.name===`AgentServerUnsupportedVersionError`||e.name===`AgentServerUnknownVersionError`),Rn=class extends P{code=Nn;actualVersion;requiredVersion=M;constructor(e){let t=`Agent Canvas requires agent-server ${M} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},zn=class extends P{code=Pn;actualVersion;requiredVersion=M;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${M} or newer, but this backend did not return a valid version from /server_info. Restart or rebuild the agent-server backend, then try again.`;super(t),this.name=`AgentServerUnknownVersionError`,this.message=t,this.actualVersion=e}},Bn=e=>C()&&I(e,401);function F(){N=null,Fn=null}function Vn(e){return e?.host&&e.host!==Fn?null:N}function Hn(e){let t=In(N);return Array.isArray(t)?t.includes(e):!0}function Un(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function I(e,t){return Un(e)&&e.status===t}function Wn(e){return typeof e==`string`&&e.trim()||null}function Gn(e){return Wn(e.sdk_version)}function Kn(e){return Wn(e.version)??Gn(e)}function qn(e){let t=Kn(e);return!t||t.toLowerCase()===Mn?null:t}function Jn(e){let t=qn(e);return!t||!Zn(t)?null:t}function Yn(e){return!N||e&&k()?.host!==e?null:Jn(N)}function Xn(e,t){let n=Zn(e),r=Zn(t);if(!n||!r)return null;for(let e of[`major`,`minor`,`patch`]){if(n[e]>r[e])return 1;if(n[e]<r[e])return-1}return n.prerelease&&!r.prerelease?-1:!n.prerelease&&r.prerelease?1:n.prerelease&&r.prerelease?n.prerelease.localeCompare(r.prerelease):0}function Zn(e){let[t]=e.trim().replace(/^v/,``).split(`+`),[n,r]=t.split(`-`,2),i=n.split(`.`);if(i.length!==3)return null;let[a,o,s]=i.map(e=>Number(e));return[a,o,s].every(e=>Number.isInteger(e)&&e>=0)?{major:a,minor:o,patch:s,prerelease:r}:null}function Qn(e){let t=qn(e);if(!t)throw F(),new zn(Kn(e));let n=Xn(t,M);if(n===null)throw F(),new zn(t);if(n<0)throw F(),new Rn(t)}async function $n(){let e=k();if(!e){if(F(),Xt(rn().backend))throw new P(`No backend configured`,{noBackendConfigured:!0});return null}let t=On({host:e.host,sessionApiKey:e.apiKey||null,timeout:jn}),n;try{n=await new ie(t).getServerInfo()}catch(e){throw F(),I(e,401)?e:new P(e instanceof Error?e.message:null)}if(Qn(n),C())try{await new ae(t).getSettings()}catch(e){if(I(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return N=n,Fn=t.host,n}var er={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},tr={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},nr={all:[`llm-profiles`]},rr={all:[`agent-profiles`]},ir={retry:!1},ar={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},or={all:[`local-workspaces`]},sr={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},cr={capabilities:()=>[`setup-capabilities`]},lr={latestVersion:[`agent-canvas-latest-version`]},ur={staleTime:1e3*60*5,gcTime:1e3*60*15},dr={name:`@openhands/agent-canvas`,version:`1.13.0`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/OpenHands`},homepage:`https://github.com/OpenHands/OpenHands#readme`,bugs:{url:`https://github.com/OpenHands/OpenHands/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.25`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`0.16.0`,"@openhands/typescript-client":`1.38.0`,"@react-router/node":`7.18.2`,"@react-router/serve":`7.18.2`,"@tailwindcss/vite":`4.3.3`,"@tanstack/react-query":`5.101.4`,"@types/shell-quote":`1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.18.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,httpxy:`0.5.3`,i18next:`26.3.6`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.1`,isbot:`5.1.39`,"lucide-react":`1.25.0`,"monaco-editor":`0.56.0`,"posthog-js":`1.380.0`,react:`19.2.8`,"react-dom":`19.2.8`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.11`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.18.2`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`1.9.0`,sirv:`3.0.2`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.6.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.16`,winston:`3.19.0`,"winston-daily-rotate-file":`5.0.0`,zustand:`5.0.14`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test:coverage":`npm run make-i18n && vitest run --coverage`,"test:mutation":`npm run make-i18n && stryker run`,"test:mutation:diff":`npm run make-i18n && node scripts/stryker-diff.mjs`,"test:mutation:incremental":`npm run make-i18n && stryker run --incremental`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,postinstall:`node -e "if (process.env.npm_config_global === 'true') { console.log('\\n\\x1b[32m\\x1b[1m\\u2713 @openhands/agent-canvas installed!\\x1b[0m\\n\\nTo start Agent Canvas, run:\\n\\n \\x1b[36m\\x1b[1magent-canvas\\x1b[0m\\n\\nThis launches the full stack at \\x1b[36mhttp://localhost:8000\\x1b[0m.\\n\\nDocs: https://docs.openhands.dev/openhands/usage/agent-canvas/setup\\n') }"`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`,"example:acp-docker:env":`node scripts/gen-acp-docker-env.mjs`,predesktop:`node scripts/brand-dev-electron.mjs`,desktop:`npm run build:app && electron electron`,"build:desktop":`npm run build:app && node scripts/download-uv.mjs && node scripts/download-node.mjs && electron-builder --config electron-builder.config.mjs --publish never`,"build:desktop:universal":`npm run build:app && node scripts/download-uv.mjs && node scripts/download-node.mjs && cross-env ELECTRON_ARCH=universal electron-builder --config electron-builder.config.mjs --publish never`,"download-uv":`node scripts/download-uv.mjs`,"download-node":`node scripts/download-node.mjs`,"generate-icons":`node scripts/generate-icons.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`node scripts/run-staged-typecheck.mjs`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.6`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.62.1`,"@react-router/dev":`7.18.2`,"@stryker-mutator/core":`9.6.1`,"@stryker-mutator/vitest-runner":`9.6.1`,"@tailwindcss/typography":`0.5.20`,"@tanstack/eslint-plugin-query":`5.101.4`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`7.0.0`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`26.1.2`,"@types/react":`19.2.18`,"@types/react-dom":`19.2.4`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.65.0`,"@typescript-eslint/parser":`8.65.0`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.10`,"cross-env":`10.1.0`,electron:`42.3.3`,"electron-builder":`26.15.3`,eslint:`9.39.5`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.5`,"eslint-plugin-i18next":`6.1.5`,"eslint-plugin-import-x":`4.17.1`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.6`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`30.0.1`,"lint-staged":`17.3.0`,msw:`2.15.0`,png2icons:`2.0.1`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.3.3`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.10`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.12`,"typed-rest-client":{qs:`6.15.3`}},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.8`,"react-dom":`19.2.8`,"react-router":`7.18.2`}},fr=`agent_canvas`,pr=dr.version,mr=`X-OpenHands-Client`,hr=`X-OpenHands-Client-Version`,gr=`X-OpenHands-Telemetry-Distinct-Id`,_r={[mr]:fr,[hr]:pr};function vr(e){return e?.trim()||`unknown`}function yr(e){return e?.trim()||null}function L({backendKind:e,agentServerVersion:t,automationSdkVersion:n,backendVersion:r,connectionMethod:i}){let a=vr(t??r),o=vr(n),s=vr(r??t);return{backend_kind:e??null,agent_server_version:a,automation_sdk_version:o,backend_version:s,...i?{connection_method:i}:{}}}function br(e=null){return{cloud_user_id:yr(e?.userId),cloud_user_email:yr(e?.email),cloud_org_id:yr(e?.orgId)}}var R=`openhands-telemetry-consent`,z=`openhands-telemetry-consent-pending-cloud-sync`,B=`openhands-telemetry-consent-pending-local-revocation`,xr=`openhands-telemetry-consent-change`,Sr=`openhands-telemetry-first-use`,Cr=`openhands-telemetry-session`,wr=`agent-canvas`,Tr=`history_change`,Er=`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,Dr=`https://z.openhands.dev`,Or=`https://us.posthog.com`,V=null,H=null,kr,U={},W=!1,G,K=0,q=-1,Ar=Object.freeze({client_source:fr,client_version:pr,package_name:dr.name,package_version:dr.version}),jr=L({}),Mr=br();function Nr(e){jr=L(e)}function Pr(e){Mr=br(e)}function Fr(e){return e?{...e,properties:{...jr,...Mr,...e.properties,...Ar}}:null}function Ir(e){W||Z()!==`granted`?e.opt_out_capturing():e.opt_in_capturing()}function Lr(e,t=!1){e.reset(t),q=-1,Ir(e)}function J(e){if(G===void 0||!$())return;let t=G?.distinctId,n=e.get_property(`$user_id`);if(n!=null&&n!==t&&Lr(e),G===null){q=K;return}(e.get_property(`$user_id`)!==G.distinctId||q!==K)&&(e.identify(G.distinctId,G.properties),q=K)}function Rr(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function zr(e){if(e===!1){if(W)return;W=!0,V?.opt_out_capturing(),Q();return}let t=W;if(W=!1,!V&&!H){let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0));U={...U,...t}}t&&(V&&(Ir(V),J(V)),Q())}function Br(){return W?null:{apiKey:U.apiKey||Er,apiHost:U.apiHost||Dr,uiHost:U.uiHost||Or}}function Y(){return typeof window<`u`&&typeof localStorage<`u`}async function Vr(){if(!Y())return null;if(V)return V;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~module-DyG7x7JT.js`).then(e=>e.t);return{default:e}},__vite__mapDeps([0,1]));return e}catch{return null}}function Hr(){return!!(W||typeof process<`u`&&{}.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`))}function Ur(e){V||(kr=e)}async function X(e=!1){if(V)return V;if(H)return H;H=(async()=>{let t=Br();if(!t)return null;let n=await Vr();if(!n)return null;let r=n.init(t.apiKey,{api_host:t.apiHost,ui_host:t.uiHost,opt_out_capturing_by_default:!e,persistence:`localStorage`,persistence_name:wr,consent_persistence_name:`${wr}-consent`,person_profiles:`always`,capture_pageview:Tr,autocapture:!0,disable_session_recording:!0,bootstrap:kr,before_send:Fr},wr);return r?(V=r,kr=void 0,W?V.opt_out_capturing():Z()===`granted`?(V.opt_in_capturing(),J(V)):e||V.opt_out_capturing(),V):null})();try{return await H}finally{V||(H=null)}}function Z(){if(!Y())return`pending`;if(Hr())return`denied`;if(bt()===`cookie`)return`granted`;try{let e=localStorage.getItem(R);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}function Wr(){if(!Y())return null;try{let e=localStorage.getItem(z);return e===`granted`||e===`denied`?e:null}catch{return null}}function Gr(){if(!Y())return null;try{return localStorage.getItem(B)}catch{return null}}function Kr(e){if(!Y())return()=>{};let t=t=>{(t.key===R||t.key===z)&&e()};return window.addEventListener(xr,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(xr,e),window.removeEventListener(`storage`,t)}}function Q(){Y()&&window.dispatchEvent(new Event(xr))}function qr(e){if(Y())try{localStorage.setItem(z,e)}catch{}}function Jr(e){if(!(!Y()||!e))try{localStorage.setItem(B,e)}catch{}}function Yr(e){if(Y())try{if(localStorage.getItem(B)!==e)return;localStorage.removeItem(B)}catch{}}function Xr(e){if(Y())try{if(e!==void 0&&localStorage.getItem(z)!==e)return;localStorage.removeItem(z),Q()}catch{}}async function Zr(e,{syncToCloud:t=!0}={}){if(Y())try{let t=Z()===e;if(localStorage.setItem(R,e),W||t)return;let n=V??await X();if(!n)return;e===`granted`?(n.opt_in_capturing(),J(n)):(Jr(n.get_distinct_id?.()??null),n.get_property?.(`$user_id`)==null?n.opt_out_capturing():Lr(n))}catch{}finally{t&&qr(e),Q()}}async function Qr(e,t={}){let n=e===null?null:{distinctId:e,properties:t};if(G===n||G!=null&&n!==null&&G.distinctId===n.distinctId&&Rr(G.properties,t)||(G=n,K+=1,q=-1,!$()))return;let r=V??await X();r&&$()&&J(r)}function $(){return Z()===`granted`}function $r(){if(!Y())return!1;try{return localStorage.getItem(Sr)===`true`}catch{return!1}}function ei(){if(Y())try{localStorage.setItem(Sr,`true`)}catch{}}async function ti(){if(Hr()||$r())return;let e=await X(!0);!e||Hr()||((e.has_opted_out_capturing?.()??!1)&&e.opt_in_capturing(),e.capture(`canvas_install`,{platform:typeof navigator<`u`?navigator.platform:`unknown`,user_agent:typeof navigator<`u`?navigator.userAgent:`unknown`,referrer:typeof document<`u`?document.referrer:``,url_origin:typeof window<`u`?window.location.origin:``,embedded:typeof window<`u`&&window.self!==window.top}),ei(),Z()!==`granted`&&e.opt_out_capturing())}function ni(){if(!Y())return!1;try{return sessionStorage.getItem(Cr)===`true`}catch{return!1}}function ri(){if(Y())try{sessionStorage.setItem(Cr,`true`)}catch{}}async function ii(){if(!$()||Z()!==`granted`)return null;let e=await X();return!e||!$()?null:(e.has_opted_out_capturing?.()&&e.opt_in_capturing(),J(e),e)}async function ai(){if(ni())return;let e=await ii();e&&(e.capture(`canvas_new_session`,{is_first_use:!$r()}),ri())}async function oi(){return(await ii())?.get_distinct_id?.()??null}async function si(){if(!Y())return null;if(Z()!==`granted`){let e=Gr();if(e)return e}return W||Hr()?null:(await X())?.get_distinct_id?.()??null}async function ci(e,t={}){let n=await ii();n&&n.capture(e,t)}async function li(e,t={}){let n=await ii();n&&n.captureException(e,t)}async function ui(){if(Y()){try{Jr(V?.get_distinct_id?.()??null),localStorage.removeItem(R),localStorage.removeItem(Sr)}catch{}Xr();try{sessionStorage.removeItem(Cr)}catch{}jr=L({}),Mr=br(),G=null,K+=1,q=-1;try{V&&Lr(V,!0)}catch{try{V?.opt_out_capturing()}catch{}}finally{Q()}}}var di=u.createContext(null);function fi(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function pi(e,t){let n=e.backend.kind===`cloud`,r=t.backend.kind===`cloud`;!n&&!r||(Pr(null),r&&(!n||e.backend.id!==t.backend.id)&&Qr(null))}function mi({children:e}){let t=u.useSyncExternalStore(cn,j,j),n=u.useCallback(()=>{F(),vn.invalidateQueries({queryKey:er.WEB_CLIENT_CONFIG})},[]),r=u.useCallback((e,t)=>{let r=j(),i=an()?.backendId??null,a=an()?.orgId??null,o=t??null;if(e===i&&o===a)return;let s=A(),ee=s.find(t=>t.id===e),te={backend:ee??s[0]??Yt,orgId:ee?o:null};pi(r.active,te),on({backendId:e,orgId:o}),n()},[n]),i=u.useCallback(e=>{let t=j().active,r={...e,id:fi()},i=[...A(),r];return pi(t,{backend:r,orgId:null}),sn(i),on({backendId:r.id}),n(),r},[n]),a=u.useCallback((e,t)=>{let r=A().find(t=>t.id===e),i=j().active.backend.id,a=t.host!==void 0&&r!==void 0&&t.host!==r.host,o=t.apiKey!==void 0&&r!==void 0&&t.apiKey!==r.apiKey;sn(A().map(n=>n.id===e?{...n,...t,connectionRevision:a||o?(n.connectionRevision??0)+1:n.connectionRevision}:n)),(a||o)&&(nt(e),i===e&&(r?.kind===`cloud`&&(Pr(null),Qr(null)),n()))},[n]),o=u.useCallback(e=>{let t=A().find(t=>t.id===e),r=t?.kind===`cloud`&&j().active.backend.id===t.id;sn(A().filter(t=>t.id!==e)),r&&(Pr(null),Qr(null)),rt(e),n()},[n]),s=u.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,g.jsx)(di.Provider,{value:s,children:e})}function hi(){let e=u.useContext(di);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function gi(){let e=u.useContext(di);return e?e.active:{backend:w()??Yt,orgId:null}}export{On as $,ir as A,ze as At,Qn as B,d as Bt,ai as C,Tt as Ct,pr as D,tt as Dt,fr as E,et as Et,or as F,Me as Ft,Jn as G,xe as Gt,Xn as H,ye as Ht,sr as I,je as It,Ln as J,Bn as K,fe as Kt,er as L,Ae as Lt,ur as M,Ve as Mt,nr as N,He as Nt,gr as O,$e as Ot,ar as P,Pe as Pt,Tn as Q,tr as R,m as Rt,ti as S,C as St,_r as T,Ze as Tt,Vn as U,p as Ut,F as V,f as Vt,Yn as W,be as Wt,I as X,Un as Y,$n as Z,Zr as _,vt as _t,Yr as a,gn as at,ci as b,bt,zr as c,rn as ct,Z as d,Xt as dt,kn as et,oi as f,Gt as ft,Pr as g,xt as gt,Nr as h,Ct as ht,Xr as i,hn as it,lr as j,Be as jt,rr as k,_ as kt,Wr as l,k as lt,X as m,it as mt,gi as n,xn as nt,ui as o,vn as ot,si as p,Dt as pt,Hn as q,hi as r,wn as rt,Ur as s,_n as st,mi as t,Cn as tt,Gr as u,A as ut,Qr as v,wt as vt,L as w,yt as wt,li as x,x as xt,Kr as y,St as yt,cr as z,pe as zt};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./agent-settings-BJVk92PU.js";export{e as default,t as handle};
@@ -1,3 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{B as r,H as i,U as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{M as s,y as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as l}from"./useQuery-DRv--6bK.js";import{$ as u,At as d,Y as f,ct as p,jt as m,n as h,nt as g}from"./active-backend-context-IqOjobNK.js";import{i as _,t as v,z as y}from"./utils-zxEjKE70.js";import{t as b}from"./back-nav-button-HHEneWMw.js";import{t as x}from"./zap-DHddTPc0.js";import{t as S}from"./proxy-9Z_WZggZ.js";import{m as C,n as w,t as T,x as E}from"./use-tracking-CVwPmhlX.js";import{t as ee}from"./use-settings-wCwPaSIv.js";import{r as D}from"./modal-classes-D66dlgZ7.js";import{t as O}from"./brand-button-swT1RyO0.js";import{n as k}from"./navigation-context-CQZwH_tC.js";import{n as A}from"./use-create-conversation-CoHTiCbI.js";import{t as j}from"./u-edit-DAkcF52u.js";import{t as M}from"./terminal-BUpID2wS.js";import{t as N}from"./use-user-conversation-DVtfg0B_.js";import{t as P}from"./toggle-switch-O5v1FgxW.js";import{t as F}from"./x-mark-BopmFoBq.js";import{n as I,t as te}from"./link-external-BNZzCM1I.js";import{_ as ne,a as re,d as ie,g as ae,h as oe,i as L,n as R,o as se,p as ce,r as z,s as le,u as ue}from"./kebab-menu-item-content-BGoGFEAg.js";import{t as B}from"./automation-C_eCrGyP.js";import{i as V}from"./use-manifest-capabilities-DPrQsaPP.js";import{i as de,n as fe,r as pe,t as me}from"./format-relative-time-DSErAuVr.js";import{a as he,c as ge,i as _e,l as ve,o as ye,r as be,s as xe,t as Se,u as Ce}from"./automation-export-B1dywoqk.js";var H=e(t()),U=n();function W(){let{t:e}=o(`openhands`);return(0,U.jsx)(b,{to:C(),children:E().detailBackLabel??e(y.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var G=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,U.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 we({active:e}){let{t}=o(`openhands`);return(0,U.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:v(`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?y.AUTOMATIONS$DETAIL$ACTIVE:y.AUTOMATIONS$DETAIL$INACTIVE)})}function Te({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:a,onRunNow:s,isRunningNow:c=!1}){let{t:l}=o(`openhands`),u=L(`manage_automations`),d=[...n?[{label:l(y.AUTOMATIONS$EDIT),icon:(0,U.jsx)(j,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?l(y.AUTOMATIONS$TURN_OFF):l(y.AUTOMATIONS$TURN_ON),icon:(0,U.jsx)(R,{className:`size-4`}),onClick:t},{label:l(y.AUTOMATIONS$EXPORT),icon:(0,U.jsx)(G,{className:`size-4`}),onClick:i},{label:l(y.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,U.jsx)(G,{className:`size-4`}),onClick:a},{label:l(y.AUTOMATIONS$DELETE),icon:(0,U.jsx)(ge,{className:`size-4`}),onClick:r}];return(0,U.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,U.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,U.jsx)(we,{active:e.enabled})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u&&s&&(0,U.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 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:c||!e.enabled,onClick:s,children:[(0,U.jsx)(z,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),l(c?y.AUTOMATIONS$STARTING:y.AUTOMATIONS$RUN_NOW)]}),u&&(0,U.jsx)(P,{enabled:e.enabled,label:e.enabled?l(y.AUTOMATIONS$TURN_OFF):l(y.AUTOMATIONS$TURN_ON),onToggle:t}),u&&(0,U.jsx)(Ce,{items:d})]})]})})}function K({icon:e,title:t,children:n}){return(0,U.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,U.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,U.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,U.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var Ee=240,De=`max-h-60`;function Oe({prompt:e}){let{t}=o(`openhands`),[n,r]=H.useState(!1),[i,a]=H.useState(!1),s=H.useRef(null),c=i&&!n;return H.useLayoutEffect(()=>{let e=s.current;if(!e)return;let t=()=>{a(e.scrollHeight>Ee)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,U.jsx)(K,{icon:(0,U.jsx)(M,{className:`size-4`}),title:t(y.AUTOMATIONS$DETAIL$PROMPT),children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`p`,{ref:s,className:v(`whitespace-pre-wrap text-sm leading-6 text-content`,c&&v(De,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),c?(0,U.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,U.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?y.COMMON$VIEW_LESS:y.COMMON$VIEW_MORE)}):null]})})}var ke=e=>(0,U.jsxs)(`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:`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,U.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),Ae=e=>(0,U.jsxs)(`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:`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,U.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,U.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,U.jsx)(`circle`,{cx:9,cy:18,r:2})]}),q=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:`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`})}),je=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:`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 J({icon:e,label:t,children:n}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,U.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,U.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function Me({branch:e}){return(0,U.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})}var Y=60;function Ne({filter:e}){let{t}=o(`openhands`),[n,r]=(0,H.useState)(!1),i=e.length>Y;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,Y)}…`:e}),i&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?y.SETTINGS$SKILLS_SHOW_LESS:y.SETTINGS$SKILLS_SHOW_MORE)})]})}function Pe({automation:e}){let{t}=o(`openhands`),n=e.trigger.type===`event`,r=e.trigger.schedule??``;e.trigger.schedule_human&&(r=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let i=t(n?y.AUTOMATIONS$DETAIL$TRIGGER_EVENT:y.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,U.jsx)(K,{icon:(0,U.jsx)(ke,{className:`size-4`}),title:t(y.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,U.jsx)(J,{icon:(0,U.jsx)(Ae,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,U.jsx)(Me,{branch:e.branch})]})}),(0,U.jsx)(J,{icon:(0,U.jsx)(de,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,U.jsx)(J,{icon:(0,U.jsx)(q,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,U.jsx)(J,{icon:(0,U.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),label:t(y.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,U.jsx)(J,{icon:(0,U.jsx)(te,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$EVENT_TYPE),children:le(e.trigger.on)}),n&&e.trigger.filter&&(0,U.jsx)(J,{icon:(0,U.jsx)(I,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,U.jsx)(Ne,{filter:e.trigger.filter})}),(0,U.jsx)(J,{icon:(0,U.jsx)(ve,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$MODEL),children:e.model??t(y.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,U.jsx)(J,{icon:(0,U.jsx)(je,{className:`size-3.5`}),label:t(y.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var Fe=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:`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 Ie({name:e}){return(0,U.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 Le({plugins:e}){let{t}=o(`openhands`);return(0,U.jsx)(K,{icon:(0,U.jsx)(Fe,{className:`size-4`}),title:t(y.AUTOMATIONS$DETAIL$PLUGINS),children:(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,U.jsx)(Ie,{name:e},e))})})}var X=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:`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 Re({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=o(`openhands`),i=r.language;return(0,U.jsx)(K,{icon:(0,U.jsx)(X,{className:`size-4`}),title:n(y.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,U.jsx)(J,{icon:(0,U.jsx)(q,{className:`size-3.5`}),label:n(y.AUTOMATIONS$DETAIL$CREATED),children:me(e,i)}),(0,U.jsx)(J,{icon:(0,U.jsx)(re,{className:`size-3.5`}),label:n(y.AUTOMATIONS$DETAIL$LAST_RUN),children:t?fe(t,i,n):n(y.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var ze=100,Z=[`run_id`,`automation_id`,`automation_name`,`trigger`,`start_time`,`end_time`,`duration_seconds`,`status`,`conversation_id`,`conversation_url`,`error`,`cost`];function Be(e,t){return`${e.name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||e.id}.activity-log.${t}`}function Ve(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function He(e){let t=[Z.join(`,`)];for(let n of e){let e=Z.map(e=>{let t=n[e];return t==null?``:Ve(e===`trigger`?JSON.stringify(t):String(t))});t.push(e.join(`,`))}return`${t.join(`
2
- `)}\n`}function Ue(e,t){if(!e)return null;let n=`/conversations/${e}`;return t?`${t.replace(/\/$/,``)}${n}`:n}function We(e,t,n){let r=e.started_at||null,i=e.completed_at,a=null;return r&&i&&(a=(new Date(i).getTime()-new Date(r).getTime())/1e3),{run_id:e.id,automation_id:t.id,automation_name:t.name,trigger:t.trigger,start_time:r,end_time:i,duration_seconds:a,status:e.status,conversation_id:e.conversation_id,conversation_url:Ue(e.conversation_id,n),error:e.error_detail,cost:e.cost??null}}async function Ge(e,t){let n=[],r=0,i=1/0;for(;r<i;){let a=await w.listAutomationRuns(e.id,{limit:ze,offset:r});for(let r of a.runs)n.push(We(r,e,t));if(i=a.total,r+=a.runs.length,a.runs.length===0)break}return n}async function Ke(e){let{automation:t,format:n,conversationBaseUrl:r}=e,i=await Ge(t,r);if(n===`json`){_(new Blob([`${JSON.stringify({runs:i,total:i.length},null,2)}\n`],{type:`application/json`}),Be(t,`json`));return}_(new Blob([He(i)],{type:`text/csv;charset=utf-8`}),Be(t,`csv`))}var qe=20;function Je(e){return e.kind===`BashOutput`}var Ye=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<qe;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=>{Je(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=p().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))}),S({backend:r,method:`GET`,hostOverride:g(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new c(u({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Xe=[`bash-command-logs`];function Ze(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 Qe(e){let t=s.isAxiosError(e)?e.response?.status:f(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(s.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function $e(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=h(),a=N(r?t??null:null),o=a.data,s=o?.conversation_url??null,c=o?.session_api_key??null,u=i.backend.kind===`cloud`,d=a.isFetched,f=null,p=!1;u&&d&&(o?f=Ze(o.sandbox_status)??(o.conversation_url?null:`missing`):p=!0);let m=r&&!!n&&(u?!!s:!0)&&!f&&!p,g=l({queryKey:[...Xe,n,s,c,i.backend.id,i.orgId],queryFn:()=>Ye.listOutputs(s,c,n),enabled:m,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Qe(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:p,sandboxIssue:v}}var et=4e3;function tt(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function nt({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?tt(a,et):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
3
- `)}function rt({run:e,automation:t,stderr:n}){let{t:r}=o(`openhands`),{navigate:i}=k(),a=A();return(0,U.jsx)(O,{testId:`debug-automation-button`,type:`button`,variant:`primary`,onClick:()=>{if(a.isPending)return;let r=nt({automationName:t?.name,automationPrompt:t?.prompt,errorDetail:e.error_detail,stderr:n,runId:e.id});a.mutate({query:r},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},isDisabled:a.isPending,"aria-busy":a.isPending,children:r(y.AUTOMATIONS$DETAIL$DEBUG_WITH_OPENHANDS)})}var it={missing:y.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:y.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:y.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:y.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:y.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function at(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 ot({conversationId:e,bashCommandId:t,isOpen:n,onClose:r,run:i,automation:a}){let{t:s}=o(`openhands`),[c,l]=(0,H.useState)(`stdout`),{data:u,isFetching:d,isResolvingConversation:f,sandboxIssue:p,conversationMissing:m,error:h}=$e({conversationId:e,bashCommandId:t,enabled:n});(0,H.useEffect)(()=>{n&&l(`stdout`)},[n,t]),(0,H.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:g,stderr:_}=(0,H.useMemo)(()=>u?{stdout:at(u,`stdout`),stderr:at(u,`stderr`)}:{stdout:``,stderr:``},[u]);if(!n)return null;let b=f||d&&!u,x=!t,S=c===`stdout`?g:_,C=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,w=`border-[var(--oh-primary)] text-white`,T=`border-transparent text-muted hover:text-content`;return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":s(y.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,U.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,U.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,U.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":s(y.AUTOMATIONS$CANCEL),children:(0,U.jsx)(F,{className:`size-5`})}),(0,U.jsx)(`h2`,{className:v(`pr-8`,D),children:s(y.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,U.jsxs)(`div`,{role:`tablist`,"aria-label":s(y.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,U.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:c===`stdout`?0:-1,onClick:()=>l(`stdout`),className:`${C} ${c===`stdout`?w:T}`,children:s(y.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,U.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:c===`stderr`?0:-1,onClick:()=>l(`stderr`),className:`${C} ${c===`stderr`?w:T}`,children:s(y.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,U.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${c}`,"aria-labelledby":`run-logs-tab-${c}`,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:[x&&(0,U.jsx)(`p`,{className:`text-muted italic`,children:s(y.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!x&&m&&(0,U.jsx)(`p`,{className:`text-muted italic`,children:s(y.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!x&&!m&&p&&(0,U.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${p}`,className:`text-muted italic`,children:s(it[p])}),!x&&!m&&!p&&b&&(0,U.jsx)(`p`,{className:`text-muted italic`,children:s(y.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!x&&!m&&!p&&!b&&h&&!u&&(0,U.jsxs)(`p`,{className:`text-danger`,children:[s(y.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(h)]}),!b&&!p&&u&&(0,U.jsx)(`pre`,{"data-testid":`run-logs-output-${c}`,className:`whitespace-pre-wrap break-words ${c===`stderr`?`text-danger`:`text-content`}`,children:S.length>0?S:(0,U.jsx)(`span`,{className:`text-muted italic`,children:s(y.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]}),i?.status===B.FAILED&&(0,U.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,U.jsx)(rt,{run:i,automation:a,stderr:_})})]})]})}function st(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function ct(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function lt(e){return`/conversations/${e}`}function ut(e){return typeof e!=`number`||!Number.isFinite(e)?null:`$${e.toFixed(4)}`}function dt({run:e,automation:t}){let{t:n,i18n:r}=o(`openhands`),i=!!e.conversation_id,a=!!e.bash_command_id,s=e.status===B.COMPLETED||e.status===B.FAILED,c=!i&&s,[l,u]=(0,H.useState)(!1),[d]=(0,H.useState)(()=>new Date().toISOString()),f=st(ct(e.started_at)?d:e.started_at,r.language),p=ut(e.cost),m=a?(0,U.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":n(y.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:f}),title:n(y.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,U.jsx)(M,{className:`size-4`})}):null,h=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`span`,{className:`text-sm text-content`,children:f}),c&&(0,U.jsx)(`span`,{className:`text-xs text-muted`,children:n(y.AUTOMATIONS$DETAIL$NO_CONVERSATION)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&(0,U.jsx)(`span`,{"data-testid":`run-cost`,title:n(y.AUTOMATIONS$DETAIL$RUN_COST),className:`text-xs tabular-nums text-muted`,children:p}),m,(0,U.jsx)(pe,{status:e.status})]})]});return(0,U.jsxs)(U.Fragment,{children:[i&&e.conversation_id?(0,U.jsx)(`a`,{href:lt(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:h}):(0,U.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:h}),a&&(0,U.jsx)(ot,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:l,onClose:()=>u(!1),run:e,automation:t})]})}var Q=20,ft=100;function pt({automation:e,highlightedRunId:t=null}){let{t:n}=o(`openhands`),r=h(),{trackAutomationActivityLogExported:i}=T(),[a,s]=(0,H.useState)(Q),c=(0,H.useRef)(null),[l,u]=(0,H.useState)(!1),{data:f,isLoading:p}=ae({id:e.id,limit:a,offset:0}),m=f?f.total>f.runs.length:!1,g=!p&&(f?.total??0)>0&&!l,_=async t=>{if(g){u(!0);try{await Ke({automation:e,format:t,conversationBaseUrl:window.location.origin}),i({backendKind:r.backend.kind,format:t})}catch(e){d(V(e,n(y.AUTOMATIONS$DETAIL$EXPORT_ACTIVITY_LOG_ERROR)))}finally{u(!1)}}};return(0,H.useEffect)(()=>{if(!(!t||!f?.runs.length)){if(f.runs.findIndex(e=>e.id===t)<0){m&&a<ft&&s(e=>e+Q);return}c.current?.scrollIntoView({behavior:`smooth`,block:`center`})}},[f?.runs,m,t,a]),(0,U.jsxs)(`div`,{"data-testid":`automation-activity-log`,className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,U.jsx)(`span`,{className:`size-4 text-muted`,children:(0,U.jsx)(X,{className:`size-4`})}),(0,U.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:n(y.AUTOMATIONS$DETAIL$ACTIVITY_LOG)}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,U.jsx)(`button`,{type:`button`,"data-testid":`activity-log-export-json`,disabled:!g,onClick:()=>void _(`json`),className:`text-sm text-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:n(y.AUTOMATIONS$DETAIL$EXPORT_JSON)}),(0,U.jsx)(`button`,{type:`button`,"data-testid":`activity-log-export-csv`,disabled:!g,onClick:()=>void _(`csv`),className:`text-sm text-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:n(y.AUTOMATIONS$DETAIL$EXPORT_CSV)})]})]}),p&&(0,U.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,U.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,U.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!p&&f?.runs.length===0&&(0,U.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:n(y.AUTOMATIONS$DETAIL$NO_RUNS)}),!p&&f&&f.runs.length>0&&(0,U.jsxs)(`div`,{children:[f.runs.map((n,r)=>{let i=n.id===t;return(0,U.jsx)(`div`,{ref:i?c:void 0,"data-testid":i?`automation-run-highlight-${n.id}`:void 0,className:v(r>0?`border-t border-[var(--oh-border)]`:``,i&&`bg-[var(--oh-focus)]/10`),children:(0,U.jsx)(dt,{run:n,automation:e})},n.id)}),m&&(0,U.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,U.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+Q),className:`text-sm text-muted hover:text-foreground`,children:n(y.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function $({className:e}){return(0,U.jsx)(`div`,{className:v(`animate-pulse rounded bg-surface-raised`,e)})}function mt(){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,U.jsx)($,{className:`h-5 w-40`}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)($,{className:`h-6 w-48`}),(0,U.jsx)($,{className:`h-6 w-16 rounded-full`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)($,{className:`h-6 w-11 rounded-full`}),(0,U.jsx)($,{className:`h-8 w-8`})]})]}),(0,U.jsx)($,{className:`h-5 w-96`}),(0,U.jsx)($,{className:`h-36 w-full rounded-2xl`}),(0,U.jsx)($,{className:`h-72 w-full rounded-2xl`}),(0,U.jsx)($,{className:`h-32 w-full rounded-2xl`}),(0,U.jsx)($,{className:`h-40 w-full rounded-2xl`})]})}function ht(){let{t:e}=o(`openhands`);return(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,U.jsx)(xe,{className:`size-12 text-muted`}),(0,U.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(y.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(y.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,U.jsx)(`div`,{className:`mt-6`,children:(0,U.jsx)(W,{})})]})}var gt=a(function(){let{t:e}=o(`openhands`),{automationId:t}=r(),[n]=i(),a=n.get(`run`),{navigate:s}=k(),[c,l]=(0,H.useState)(!1),[u,f]=(0,H.useState)(!1),{data:p,isLoading:g,refetch:v}=ne(),b=p?.status===`ok`,x=h(),S=(0,H.useRef)(x.backend.id).current!==x.backend.id,{data:E,isLoading:D,isError:O,error:A,refetch:j}=oe({id:t??``,enabled:b&&!S}),{trackPrebuiltAutomationEnabled:M,trackAutomationExported:N}=T(),P=ce(),F=ue(),I=ie(),te=O&&ee(A)===404;if(g)return(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,U.jsx)(mt,{})})});if(!b)return(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,U.jsx)(he,{onRetry:v})})});if(D)return(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,U.jsx)(mt,{})})});if(te)return(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,U.jsx)(ht,{})})});if(O||!E)return(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,U.jsx)(ye,{onRetry:()=>j()})})});let re=()=>{let e=!E.enabled;P.mutate({id:E.id,enabled:e}),e&&M({automationId:E.id,automationName:E.name})},ae=()=>{F.mutate(E.id,{onSuccess:()=>{s?.(C())}})},L=()=>{I.mutate(E.id,{onSuccess:()=>{m(e(y.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{d(V(t,e(y.AUTOMATIONS$RUN_NOW_ERROR)))}})},R=()=>{let e=`${JSON.stringify(be(E),null,2)}\n`;_(new Blob([e],{type:`application/json`}),Se(E)),N({backendKind:x.backend.kind})},z=x.backend.kind===`local`;return(0,U.jsx)(`div`,{className:`min-h-full`,children:(0,U.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(W,{}),(0,U.jsx)(Te,{automation:E,onToggle:re,onEdit:z?()=>f(!0):void 0,onDelete:()=>l(!0),onExport:R,onDownloadTarball:()=>w.downloadTarball(E.id,E.name),onRunNow:L,isRunningNow:I.isPending}),E.prompt&&(0,U.jsx)(Oe,{prompt:E.prompt}),(0,U.jsx)(Pe,{automation:E}),E.plugins&&E.plugins.length>0&&(0,U.jsx)(Le,{plugins:E.plugins}),(0,U.jsx)(Re,{createdAt:E.created_at,lastRunAt:E.last_triggered_at}),(0,U.jsx)(pt,{automation:E,highlightedRunId:a}),(0,U.jsx)(_e,{automationName:E.name,isOpen:c,onConfirm:ae,onCancel:()=>l(!1)}),z&&(0,U.jsx)(se,{automation:E,isOpen:u,onClose:()=>f(!1)})]})})})});export{gt as default};
@@ -1,2 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as a,z as o}from"./utils-zxEjKE70.js";import{b as s}from"./use-tracking-CVwPmhlX.js";import{r as c}from"./modal-classes-D66dlgZ7.js";import{t as l}from"./brand-button-swT1RyO0.js";import{r as u}from"./dropdown-classes-BIqQr5mx.js";import{n as d,t as f}from"./context-menu-list-item-Bq02tc-P.js";import{t as p}from"./x-mark-BopmFoBq.js";import{t as m}from"./kebab-menu-item-content-BGoGFEAg.js";var h=e(n(),1),g=e(t()),_=r(),v=e=>(0,_.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 20 20`,...e,children:(0,_.jsx)(`path`,{d:`M10 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z`})}),y=a(`inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,u),b=a(`inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 text-xs text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,u);function x({items:e}){let{t}=i(`openhands`),[n,r]=(0,g.useState)(!1),[a,s]=(0,g.useState)(),c=(0,g.useRef)(null),l=(0,g.useRef)(null);(0,g.useLayoutEffect)(()=>{if(!n||!c.current)return;let e=()=>{let e=c.current?.getBoundingClientRect();e&&s({position:`fixed`,zIndex:9999,top:e.bottom+4,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[n]),(0,g.useEffect)(()=>{if(!n)return;let e=e=>{let t=e.target;c.current?.contains(t)||l.current?.contains(t)||r(!1)},t=e=>{e.key===`Escape`&&r(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[n]);let u=n&&a?(0,_.jsx)(d,{ref:l,theme:`popover`,className:`min-w-[10rem]`,children:e.map(e=>(0,_.jsx)(`li`,{children:(0,_.jsx)(f,{onClick:t=>{t.stopPropagation(),e.onClick(),r(!1)},isDisabled:e.disabled,className:`group`,children:(0,_.jsx)(m,{icon:e.icon,label:e.label})})},e.label))}):null;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`button`,{ref:c,type:`button`,onClick:e=>{e.stopPropagation(),r(e=>!e)},className:y,"aria-label":t(o.AUTOMATIONS$ACTIONS_MENU),"aria-expanded":n,"aria-haspopup":`menu`,children:(0,_.jsx)(v,{className:`size-4`})}),n&&a&&typeof document<`u`?h.createPortal((0,_.jsx)(`div`,{style:a,children:u}),document.body):null]})}var S=e=>(0,_.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,_.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z`})}),C=e=>(0,_.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,_.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),w=e=>(0,_.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,...e,children:(0,_.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z`})});function T({onRetry:e}){let{t}=i(`openhands`);return(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,_.jsx)(w,{className:`size-12 text-danger`}),(0,_.jsx)(`p`,{className:`mt-4 text-sm text-muted`,children:t(o.AUTOMATIONS$ERROR_TITLE)}),(0,_.jsx)(`button`,{type:`button`,onClick:e,className:`mt-4 rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:t(o.AUTOMATIONS$ERROR_RETRY)})]})}function E({onRetry:e}){let{t}=i(`openhands`);return(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 px-4`,children:[(0,_.jsx)(w,{className:`size-12 text-[var(--oh-warning)]`}),(0,_.jsx)(`h2`,{className:`mt-4 text-lg font-medium text-content`,children:t(o.AUTOMATIONS$BACKEND_UNAVAILABLE_TITLE)}),(0,_.jsx)(`p`,{className:`mt-2 text-sm text-muted text-center max-w-md`,children:t(o.AUTOMATIONS$BACKEND_UNAVAILABLE_MESSAGE)}),(0,_.jsx)(l,{type:`button`,variant:`secondary`,className:`mt-6`,onClick:e,children:t(o.AUTOMATIONS$BACKEND_UNAVAILABLE_RETRY)})]})}function D({automationName:e,isOpen:t,onConfirm:n,onCancel:r}){let{t:a}=i(`openhands`);return t?(0,_.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,_.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,_.jsxs)(`div`,{className:`relative w-full max-w-sm rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":a(o.BUTTON$CLOSE),children:(0,_.jsx)(p,{className:`size-5`})}),(0,_.jsx)(`h2`,{className:c,children:a(o.AUTOMATIONS$DELETE_CONFIRM_TITLE)}),(0,_.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:a(o.AUTOMATIONS$DELETE_CONFIRM_MESSAGE,{name:e})}),(0,_.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:a(o.AUTOMATIONS$CANCEL)}),(0,_.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg bg-danger px-4 py-2 text-sm text-white hover:bg-danger/80`,children:a(o.AUTOMATIONS$DELETE)})]})]})]}):null}var O=new Set([`cron`,`schedule`,`event`]),k=class extends Error{issues;constructor(e){super(e.join(`
2
- `)),this.name=`AutomationFileValidationError`,this.issues=e}};function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j(e,t,n,r){let i=e[t];if(typeof i!=`string`||i.trim().length===0){r.push(`${n}: expected a non-empty string`);return}return i}function M(e,t,n,r){let i=e[t];if(i!==void 0){if(typeof i!=`string`){r.push(`${n}: expected a string`);return}return i}}function N(e,t){if(!A(e)){t.push(`spec.trigger: expected an object`);return}let n=j(e,`type`,`spec.trigger.type`,t);n&&!O.has(n)&&t.push(`spec.trigger.type: expected one of "cron", "schedule", or "event"`);let r=M(e,`schedule`,`spec.trigger.schedule`,t),i=M(e,`schedule_human`,`spec.trigger.schedule_human`,t),a=M(e,`timezone`,`spec.trigger.timezone`,t),o=M(e,`source`,`spec.trigger.source`,t),s=M(e,`filter`,`spec.trigger.filter`,t),c;if(e.on!==void 0&&(typeof e.on==`string`||Array.isArray(e.on)&&e.on.length>0&&e.on.every(e=>typeof e==`string`&&e.trim().length>0)?c=e.on:t.push(`spec.trigger.on: expected a string or a non-empty array of strings`)),(n===`cron`||n===`schedule`)&&!r?.trim()&&t.push(`spec.trigger.schedule: required for a scheduled trigger`),n===`event`&&(o?.trim()||t.push(`spec.trigger.source: required for an event trigger`),(c===void 0||typeof c==`string`&&c.trim().length===0)&&t.push(`spec.trigger.on: required for an event trigger`)),!(!n||!O.has(n)))return{type:n,...r!==void 0&&{schedule:r},...i!==void 0&&{schedule_human:i},...a!==void 0&&{timezone:a},...o!==void 0&&{source:o},...c!==void 0&&{on:c},...s!==void 0&&{filter:s}}}function P(e){let t=e.timezone??e.trigger.timezone,n={name:e.name,trigger:{...e.trigger},enabled:e.enabled,prompt:e.prompt,...e.repository!==void 0&&{repository:e.repository},...e.model!==void 0&&{model:e.model},...e.timeout!=null&&{timeout:e.timeout},...e.branch!==void 0&&{branch:e.branch},...e.plugins!==void 0&&{plugins:[...e.plugins]},...e.notification!==void 0&&{notification:e.notification},...t!==void 0&&{timezone:t}},r=s();return{version:r.fileVersion,kind:r.fileKind,spec:n}}function F(e){return`${e.name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||e.id}${s().filenameSuffix}`}function I(e){let t=[];if(!A(e))throw new k([`file: expected a JSON object`]);let n=s();if(e.version!==n.fileVersion&&t.push(`version: expected ${n.fileVersion}`),e.kind!==n.fileKind&&t.push(`kind: expected "${n.fileKind}"`),!A(e.spec))throw t.push(`spec: expected an object`),new k(t);let r=j(e.spec,`name`,`spec.name`,t),i=j(e.spec,`prompt`,`spec.prompt`,t),a=N(e.spec.trigger,t),o=e.spec.enabled;typeof o!=`boolean`&&t.push(`spec.enabled: expected a boolean`);let c=M(e.spec,`repository`,`spec.repository`,t),l=M(e.spec,`branch`,`spec.branch`,t),u=M(e.spec,`notification`,`spec.notification`,t),d=M(e.spec,`timezone`,`spec.timezone`,t),f;e.spec.model===null||e.spec.model===void 0||typeof e.spec.model==`string`&&e.spec.model.trim().length>0?f=e.spec.model:t.push(`spec.model: expected a non-empty string or null`);let p;e.spec.timeout===null||e.spec.timeout===void 0||typeof e.spec.timeout==`number`&&Number.isInteger(e.spec.timeout)&&e.spec.timeout>0?p=e.spec.timeout:t.push(`spec.timeout: expected a positive integer`);let m;if(e.spec.plugins!==void 0&&(Array.isArray(e.spec.plugins)&&e.spec.plugins.every(e=>typeof e==`string`&&e.trim().length>0)?m=[...e.spec.plugins]:t.push(`spec.plugins: expected an array of non-empty strings`)),t.length>0||!r||!i||!a)throw new k(t);return{name:r,prompt:i,trigger:a,enabled:o,...c!==void 0&&{repository:c},...f!==void 0&&{model:f},...p!==void 0&&{timeout:p},...l!==void 0&&{branch:l},...m!==void 0&&{plugins:m},...u!==void 0&&{notification:u},...d!==void 0&&{timezone:d}}}export{E as a,C as c,y as d,b as f,D as i,S as l,I as n,T as o,P as r,w as s,F as t,x as u};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{F as r,P as i,R as a,U as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{M as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{X as l,n as u}from"./active-backend-context-IqOjobNK.js";import{t as d,z as f}from"./utils-zxEjKE70.js";import{t as p}from"./loading-spinner-xhnrGP4Y.js";import{E as m,T as h,a as g,c as _,d as v,f as y,i as ee,l as te,m as ne,n as b,o as x,p as S,r as C,t as re,u as ie}from"./use-tracking-CVwPmhlX.js";import{l as w}from"./settings-service.api--rJmnuLa.js";import{n as T}from"./use-settings-wCwPaSIv.js";import{t as ae}from"./modal-backdrop-BSzNhM4r.js";import{n as oe}from"./modal-classes-D66dlgZ7.js";import{l as E}from"./form-control-classes-7yFSQJq_.js";import{t as D}from"./brand-button-swT1RyO0.js";import{t as O}from"./navigation-link-Bxo3-4vo.js";import{o as k,s as A,t as j}from"./conversation-store-Blc5xysY.js";import{t as se}from"./modal-close-button-B6iOGYpI.js";import{t as M}from"./settings-input-Cz62hWVW.js";import{n as N}from"./use-create-conversation-CoHTiCbI.js";import{t as P}from"./settings-dropdown-input-BI8V_Nov.js";import{f as F,n as I,o as L,s as R}from"./mcp-marketplace-utils-DEbMXlQr.js";import{t as z}from"./vendor~root-layout~index-home~home~mcp~automations-list~automation-templates~automation-set~bxsimjx0-D7IDevqN.js";import{n as ce,r as le}from"./use-manifest-capabilities-DPrQsaPP.js";import{t as B}from"./git-repo-dropdown-ByMzpNko.js";import"./git-repo-dropdown-C6R7hgM8.js";var V=e(t(),1);function ue(e){let t=e.requires.integrations,{data:n,isLoading:r}=T(),i=(0,V.useMemo)(()=>F(w(n?.agent_settings?.mcp_config)),[n?.agent_settings?.mcp_config]),a=(0,V.useMemo)(()=>{let e=R(z);return Object.entries(t).map(([t,n])=>({id:t,requirement:n,entry:L(t,e)??null})).filter(({entry:e})=>!e||!I(e,i))},[t,i]),o=a.filter(({requirement:e})=>e.required!==!1);return{blockingIntegrations:o,warningIntegrations:a.filter(({requirement:e})=>e.required===!1),isBlocked:o.length>0,isLoading:r}}var H={fieldErrors:{},formErrors:[]};function U(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function W(e,t){let n=e[0]===`body`?e.slice(1):e,r=[],i=t;return n.forEach(e=>{if(typeof e==`number`){Array.isArray(i)&&r.length>0&&(r[r.length-1]+=`[${e}]`,i=i[e]);return}U(i)&&e in i&&(r.push(e),i=i[e])}),r.join(`.`)}function G(e,t){if(!U(e))return[];if(Array.isArray(e.errors))return e.errors.flatMap(e=>!U(e)||typeof e.message!=`string`?[]:[{path:typeof e.field==`string`?e.field:``,message:e.message}]);let{detail:n}=e;return typeof n==`string`?[{path:``,message:n}]:Array.isArray(n)?n.flatMap(e=>!U(e)||typeof e.msg!=`string`?[]:[{path:W(Array.isArray(e.loc)?e.loc:[],t),message:e.msg}]):[]}function K(e,t){if(e.length===0)return H;let n={},r=[];return e.forEach(({path:e,message:i})=>{let a=e?t[e]:void 0;if(!a?.length){r.push(i);return}a.forEach(e=>{e in n||(n[e]=i)})}),{fieldErrors:n,formErrors:r}}var de={fieldErrors:{},formErrors:[]},q=[404,501];function J(e){return q.some(t=>l(e,t)||c.isAxiosError(e)&&e.response?.status===t)}function fe(e){let t=(0,V.useRef)(0),n=(0,V.useMemo)(()=>x(e),[e]);return(0,V.useCallback)(async r=>{let i=g(e,r);if(!i)return null;t.current+=1;let a=t.current;try{let e=await b.validateDraft(i);return a===t.current?e?.valid?de:K(G(e,i.draft),n):null}catch(e){return J(e)||console.warn(`Automation setup preflight failed:`,e),null}},[e,n])}function pe(){let e=N(),t=j(e=>e.setMessageToSend),n=(0,V.useCallback)(async n=>{let r=await e.mutateAsync({});return r.conversation_id.startsWith(`task-`)&&r.task_id?A(r.task_id,n):k(r.conversation_id,{draftMessage:n}),window.setTimeout(()=>t(n),0),{response:{...r}}},[e,t]);return(0,V.useCallback)(async(e,t,r)=>r?{response:await b.createAutomationDraft(r)}:n(C(e,t)),[n])}var Y=n();function me({name:e,field:t,value:n,error:r,options:i,repository:a,disabled:o,onChange:c,onRepositoryChange:l,onBlur:p}){let{t:m}=s(`openhands`),{backend:h}=u(),g=`setup-field-${e}`,_=(0,Y.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:t.help}),v=h.kind===`cloud`;if(t.type===`repo-picker`&&v)return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(he,{field:t}),(0,Y.jsx)(B,{provider:t.provider??`github`,value:a?.id??null,repositoryName:a?.full_name??n??null,placeholder:t.placeholder,disabled:o,onChange:e=>{l(e??null),c(e?.full_name??``),p()}}),(0,Y.jsx)(Z,{testId:g,error:r}),_]});if(t.type===`select`||t.type===`timezone`&&i.length>0)return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(P,{testId:g,name:e,label:(0,Y.jsx)(X,{field:t}),items:i.map(e=>({key:e.value,label:e.label})),selectedKey:n||void 0,placeholder:t.placeholder,isDisabled:o,required:t.required,onSelectionChange:e=>{c(e===null?``:String(e)),p()}}),(0,Y.jsx)(Z,{testId:g,error:r}),_]});if(t.type===`textarea`)return(0,Y.jsxs)(`label`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(X,{field:t}),(0,Y.jsx)(`textarea`,{"data-testid":g,name:e,rows:4,value:n,placeholder:t.placeholder,disabled:o,"aria-invalid":!!r,onChange:e=>c(e.target.value),onBlur:p,className:d(E,r&&`border-red-500`)}),(0,Y.jsx)(Z,{testId:g,error:r}),_]});let y=t.placeholder??(t.type===`repo-picker`?m(f.SETUP$REPOSITORY_PLACEHOLDER):void 0);return(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,Y.jsx)(M,{testId:g,name:e,type:`text`,label:t.label,value:n,placeholder:y,isDisabled:o,showRequiredTag:t.required,error:r,onChange:c,onBlur:p}),_]})}function X({field:e}){return(0,Y.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[e.label,e.required&&(0,Y.jsx)(`span`,{className:`text-sm leading-none text-red-400`,"aria-hidden":!0,children:`*`})]})}function he({field:e}){return(0,Y.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Y.jsx)(X,{field:e})})}function Z({testId:e,error:t}){return t?(0,Y.jsx)(`p`,{role:`alert`,"data-testid":`${e}-error`,className:`-mt-1 text-xs text-red-400`,children:t}):null}var ge=`/mcp`;function _e({prerequisites:e}){let{t}=s(`openhands`),{blockingIntegrations:n,warningIntegrations:r}=e;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`setup-prerequisites`,children:[[...n,...r].map(({id:e,requirement:t,entry:n})=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-sm`,children:n?.name??e}),(0,Y.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:t.message})]},e)),(0,Y.jsx)(O,{to:ge,className:`text-sm underline`,children:t(f.SETUP$MANAGE_INTEGRATIONS)})]})}function ve({setup:e,values:t}){let{t:n}=s(`openhands`);return(0,Y.jsx)(`div`,{className:`flex flex-col gap-4`,"data-testid":`setup-review`,children:(0,Y.jsx)(`dl`,{className:`flex flex-col gap-3`,children:Object.entries(_(e)).map(([e,r])=>(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`dt`,{className:`text-xs text-[var(--oh-muted)]`,children:r.label}),(0,Y.jsx)(`dd`,{className:`text-sm break-words`,children:(t[e]??``).trim()||n(f.SETUP$EMPTY_VALUE)})]},e))})})}var ye=400,be={fieldErrors:{},formErrors:[]};function xe(e){return e.formErrors.length>0||Object.keys(e.fieldErrors).length>0}function Se(e){return typeof e.conversation_id==`string`?`/conversations/${e.conversation_id}`:typeof e.id==`string`?S(e.id):null}function Ce({entry:e,onClose:t}){let{t:n}=s(`openhands`),r=a(),i=ce(e),o=ue(e),c=fe(e),l=pe(),{trackAutomationSetupOpened:u,trackAutomationSetupValidated:h,trackAutomationSetupCreated:g,trackAutomationSetupFailed:ne}=re(),[b,S]=(0,V.useState)(`prerequisites`),[C,w]=(0,V.useState)(()=>ie(e.setup)),[T,E]=(0,V.useState)({}),[O,k]=(0,V.useState)({}),[A,j]=(0,V.useState)(be),[M,N]=(0,V.useState)(!1),P=(0,V.useRef)(C),F=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]);let I=(0,V.useMemo)(()=>_(e.setup),[e]),L=(0,V.useMemo)(()=>v(e.setup,i.capabilities),[e,i.capabilities]),R=(0,V.useMemo)(()=>ee(e,C),[e,C]),z=(0,V.useMemo)(()=>x(e),[e]),B=(0,V.useRef)(!1);(0,V.useEffect)(()=>{B.current||(B.current=!0,u({automationId:e.id}))},[e.id,u]);let H=i.supported===!1,U=o.blockingIntegrations.length>0||o.warningIntegrations.length>0,W=b===`prerequisites`&&!U?`form`:b,de=(e,t)=>{P.current={...P.current,[e]:t},w(P.current),k(({[e]:t,...n})=>n),j(t=>{if(!(e in t.fieldErrors))return t;let{[e]:n,...r}=t.fieldErrors;return{...t,fieldErrors:r}})},q=()=>{F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>{c(P.current).then(e=>{e&&j(e)})},ye)},J=async()=>{if(W===`prerequisites`){S(`form`);return}let t=y(e.setup,C,L);if(Object.keys(t).length>0){k(t);return}k({});let n=await c(C);if(n&&xe(n)){j(n);return}j(be),h({automationId:e.id}),S(`review`)},X=async(i,a)=>{N(!0);try{let{response:n}=await l(e,C,i);g({automationId:e.id,setupMode:a});let o=Se(n);o?r(o,{replace:!0}):t()}catch(t){ne({automationId:e.id,setupMode:a});let r=K(G(le(t),i),z);j(xe(r)?r:{fieldErrors:{},formErrors:[n(f.SETUP$SUBMIT_FAILED)]}),S(`form`)}finally{N(!1)}},he=()=>X(R,e.setup.mode),Z=()=>X(null,`assisted`),ge=e.setup.mode===`direct`&&(m(e)!==null||e.setup.message!==void 0),Ce=e=>{let t=O[e];return t?we(t,n):A.fieldErrors[e]},Q=i.isLoading||o.isLoading,$=H?n(f.SETUP$UNAVAILABLE_TITLE):W===`prerequisites`?n(f.SETUP$PREREQUISITES_TITLE):W===`review`?n(f.SETUP$REVIEW_TITLE):e.name;return(0,Y.jsx)(ae,{onClose:t,"aria-label":e.name,children:(0,Y.jsxs)(`div`,{"data-testid":`setup-dialog`,className:`relative flex max-h-[85vh] w-[92vw] max-w-lg flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,Y.jsx)(se,{onClose:t,testId:`setup-dialog-close`,disabled:M}),(0,Y.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,Y.jsx)(`h2`,{className:d(`pr-6`,oe),children:$})}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6`,children:[Q&&(0,Y.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,Y.jsx)(p,{size:`small`})}),!Q&&H&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(f.SETUP$UNSUPPORTED_MESSAGE)}),i.unmet.length>0&&(0,Y.jsx)(`p`,{"data-testid":`setup-unmet-requirements`,className:`text-sm text-[var(--oh-muted)]`,children:i.unmet.join(`, `)})]}),!Q&&!H&&W===`prerequisites`&&(0,Y.jsx)(_e,{prerequisites:o}),!Q&&!H&&W===`form`&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e.description}),e.setup.form.note&&(0,Y.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e.setup.form.note}),Object.entries(I).map(([e,t])=>(0,Y.jsx)(me,{name:e,field:t,value:C[e]??``,error:Ce(e),options:te(e,t,L),repository:T[e]??null,disabled:M,onChange:t=>de(e,t),onRepositoryChange:t=>E(n=>({...n,[e]:t})),onBlur:q},e))]}),!Q&&!H&&W===`review`&&(0,Y.jsx)(ve,{setup:e.setup,values:C}),A.formErrors.map(e=>(0,Y.jsx)(`p`,{role:`alert`,"data-testid":`setup-form-error`,className:`pt-4 text-sm text-red-400`,children:e},e))]}),(0,Y.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[W===`review`&&(0,Y.jsx)(D,{testId:`setup-back-button`,type:`button`,variant:`secondary`,isDisabled:M,onClick:()=>S(`form`),children:n(f.BUTTON$BACK)}),H?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(D,{type:`button`,variant:`secondary`,isDisabled:M,onClick:t,children:n(f.BUTTON$CLOSE)}),ge&&(0,Y.jsx)(D,{testId:`setup-fallback-conversation`,type:`button`,variant:`primary`,isDisabled:M,onClick:Z,children:n(f.SETUP$FALLBACK_CONVERSATION)})]}):(0,Y.jsx)(D,{testId:`setup-continue-button`,type:`button`,variant:`primary`,isDisabled:Q||M||W===`prerequisites`&&o.isBlocked,onClick:W===`review`?he:J,children:n(W===`review`?f.SETUP$CONFIRM:f.BUTTON$CONTINUE)})]})]})})}function we(e,t){switch(e.code){case`required`:return t(f.SETUP$VALIDATION_REQUIRED);case`minLength`:return t(f.SETUP$VALIDATION_MIN_LENGTH,{length:e.length});case`maxLength`:return t(f.SETUP$VALIDATION_MAX_LENGTH,{length:e.length});case`invalidOption`:return t(f.SETUP$VALIDATION_INVALID_OPTION);case`unsafeExpressionLiteral`:return t(f.SETUP$VALIDATION_UNSAFE_VALUE);default:return e}}var Q=({params:e})=>{let t=h.findById(e.automationId??``);if(!t)throw new Response(null,{status:404,statusText:`Not Found`});return{automationId:t.id}},$=o(function(){let{automationId:e}=i(),t=r(),n=a(),o=h.findById(e);return o?(0,Y.jsx)(Ce,{entry:o,onClose:()=>{t.key==="default"?n(ne(),{replace:!0}):n(-1)}}):null});export{Q as clientLoader,$ as default};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{D as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as s}from"./useQueries-DF1NAAeC.js";import{t as c}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js";import{At as l,Mt as u,jt as d,n as f}from"./active-backend-context-IqOjobNK.js";import{i as p,t as m,z as h}from"./utils-zxEjKE70.js";import{i as g,n as _,r as v,t as ee}from"./manifest-subpage-layout-CKWvL2ig.js";import{t as te}from"./check-WAFXrrs_.js";import{n as y,t as ne}from"./recommended-automations-launcher-CFlzhu1o.js";import{t as re}from"./file-text-DEK4LSVw.js";import{t as b}from"./zap-DHddTPc0.js";import{_ as ie,n as x,p as ae,s as oe,t as se,v as ce,x as le}from"./use-tracking-CVwPmhlX.js";import{t as S}from"./modal-backdrop-BSzNhM4r.js";import{n as C}from"./modal-classes-D66dlgZ7.js";import{t as w}from"./brand-button-swT1RyO0.js";import{n as T}from"./navigation-context-CQZwH_tC.js";import{t as E}from"./styled-tooltip-BUMSbgrF.js";import{u as D}from"./dropdown-classes-BIqQr5mx.js";import{t as O}from"./modal-close-button-B6iOGYpI.js";import{t as ue}from"./format-time-delta-BIR5Os7T.js";import{n as de,t as fe}from"./context-menu-list-item-Bq02tc-P.js";import{t as k}from"./u-edit-DAkcF52u.js";import{t as A}from"./folder-C1ou4_DT.js";import{a as j,i as M,n as pe,o as me,r as he,t as ge}from"./extension-module-card-classes-Bo43vY5V.js";import{n as N}from"./skill-card-pill-row-BXz8L8Rn.js";import{_ as _e,a as P,c as ve,d as ye,f as be,i as F,m as I,n as xe,o as Se,p as Ce,r as L,s as R,u as we}from"./kebab-menu-item-content-BGoGFEAg.js";import{t as z}from"./automation-C_eCrGyP.js";import{i as Te}from"./use-manifest-capabilities-DPrQsaPP.js";import{n as Ee,t as De}from"./use-launch-skill-in-chat-COnDpxCQ.js";import{t as B}from"./enum-filter-dropdown-C_yV4_bo.js";import{a as Oe,c as V,d as H,f as U,i as ke,l as Ae,n as je,o as Me,r as Ne,t as Pe,u as W}from"./automation-export-B1dywoqk.js";var G=o(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Fe=o(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Ie=o(`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`}]]),Le=o(`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`}]]),K=e(t(),1),q=r();function J(e,t){let n=[];if(e.repository&&n.push({id:`repository`,node:(0,q.jsxs)(`span`,{className:m(M,`gap-1`),children:[(0,q.jsx)(A,{className:`size-3 shrink-0`}),e.repository]})}),e.trigger.type===`event`){let t=[e.trigger.on?R(e.trigger.on):``,e.trigger.source?`(${e.trigger.source})`:``].filter(Boolean).join(` `);n.push({id:`event-trigger`,node:(0,q.jsxs)(`span`,{className:m(M,`gap-1`),children:[(0,q.jsx)(b,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t]})})}else n.push({id:`schedule`,node:(0,q.jsxs)(`span`,{className:m(M,`gap-1`),children:[(0,q.jsx)(P,{className:`size-3 shrink-0`}),t]})});return e.model&&n.push({id:`model`,node:(0,q.jsxs)(`span`,{className:m(M,`gap-1`),children:[(0,q.jsx)(Ae,{className:`size-3 shrink-0`}),e.model]})}),n}function Re({automation:e,t,canManage:n,onRunNow:r,isRunPending:i,onView:a,onExport:o,onEdit:s,onToggle:c,onDelete:l}){return[...n?[{label:t(h.AUTOMATIONS$RUN_NOW),icon:(0,q.jsx)(L,{className:`size-4`}),onClick:()=>r(e.id),disabled:i||!e.enabled}]:[],{label:t(h.COMMON$VIEW),icon:(0,q.jsx)(re,{className:`size-4`,"aria-hidden":!0}),onClick:a},{label:t(h.AUTOMATIONS$EXPORT),icon:(0,q.jsx)(G,{className:`size-4`,"aria-hidden":!0}),onClick:()=>o(e)},...n&&s?[{label:t(h.AUTOMATIONS$EDIT),icon:(0,q.jsx)(k,{className:`size-4`}),onClick:()=>s(e.id)}]:[],...n?[{label:e.enabled?t(h.AUTOMATIONS$TURN_OFF):t(h.AUTOMATIONS$TURN_ON),icon:(0,q.jsx)(xe,{className:`size-4`}),onClick:()=>c(e.id,e.enabled)},{label:t(h.AUTOMATIONS$DELETE),icon:(0,q.jsx)(V,{className:`size-4`}),onClick:()=>l(e.id)}]:[]]}var ze={healthy:`healthy`,failing:`failing`,running:`running`,disabled:`disabled`,"never-run":`neverRun`,unknown:`checking`},Be=new Set([z.COMPLETED,z.FAILED]);function Ve(e){let t=e.runs.filter(e=>Be.has(e.status)),n=t.filter(e=>e.status===z.COMPLETED).length,r=t.flatMap(e=>{if(!e.completed_at)return[];let t=new Date(e.completed_at).getTime()-new Date(e.started_at).getTime();return Number.isFinite(t)&&t>=0?[t]:[]});return{total:e.total,latestRun:e.runs[0]??null,recentSuccessRate:t.length===0?null:n/t.length,averageDurationMs:r.length===0?null:r.reduce((e,t)=>e+t,0)/r.length}}function Y(e,t){if(!e.enabled)return`disabled`;if(!t||t.isError||t.isLoading||!t.summary)return`unknown`;let n=t.summary.latestRun;return n?n.status===z.FAILED?`failing`:n.status===z.PENDING||n.status===z.RUNNING?`running`:`healthy`:`never-run`}function He(e){return e===null||!Number.isFinite(e)?`—`:e<6e4?`${Math.max(1,Math.round(e/1e3))}s`:e<36e5?`${Math.max(1,Math.round(e/6e4))}m`:`${(e/36e5).toFixed(1)}h`}function Ue(e,t){let n=t.toLowerCase();return n?e.name.toLowerCase().includes(n)||(e.prompt??``).toLowerCase().includes(n)||e.repository?.toLowerCase().includes(n)===!0||e.model?.toLowerCase().includes(n)===!0:!0}var We={active:e=>e.enabled,failing:(e,t)=>t===`failing`,disabled:e=>!e.enabled},Ge={event:e=>e.trigger.type===`event`,schedule:e=>e.trigger.type!==`event`};function Ke(e,t){return t.get(e.id)?.summary?.total??0}function X(e,t){let n=t.get(e.id)?.summary?.latestRun?.started_at??e.last_triggered_at;if(!n)return 0;let r=new Date(n).getTime();return Number.isFinite(r)?r:0}var qe={"last-run":(e,t,n)=>X(t,n)-X(e,n),runs:(e,t,n)=>Ke(t,n)-Ke(e,n),name:(e,t)=>e.name.localeCompare(t.name)};function Je(e,t,n){return e.filter(e=>!(!Ue(e,t.search)||t.status!==`all`&&!We[t.status](e,Y(e,n.get(e.id)))||t.trigger!==`all`&&!Ge[t.trigger](e))).sort((e,r)=>qe[t.sort](e,r,n))}function Ye(e,t){return e.flatMap(e=>{let n=t.get(e.id);return n?.summary&&!n.isLoading&&!n.isError?[n.summary]:[]})}var Xe={automations:e=>({display:e.length.toLocaleString(),isZero:e.length===0,placeholderValues:{active:e.filter(e=>e.enabled).length}}),"needs-attention":(e,t)=>{let n=e.filter(e=>Y(e,t.get(e.id))===`failing`).length;return{display:n.toLocaleString(),isZero:n===0,placeholderValues:{}}},"total-runs":(e,t)=>{let n=Ye(e,t);if(n.length===0&&e.length>0)return{display:`—`,isZero:!1,placeholderValues:{}};let r=n.reduce((e,t)=>e+t.total,0);return{display:r.toLocaleString(),isZero:r===0,placeholderValues:{}}},"average-duration":(e,t)=>{let n=Ye(e,t).flatMap(e=>e.averageDurationMs===null?[]:[e.averageDurationMs]);return{display:He(n.length===0?null:n.reduce((e,t)=>e+t,0)/n.length),isZero:!1,placeholderValues:{}}}};function Ze(e,t,n){return Xe[e](t,n)}var Qe={healthy:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`,failing:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`,running:`border-[var(--oh-border)] bg-surface-raised text-muted`,disabled:`border-[var(--oh-border)] bg-surface-raised text-muted`,"never-run":`border-[var(--oh-warning)]/50 bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,unknown:`border-[var(--oh-border)] bg-surface-raised text-muted`};function $e({health:e,labels:t}){return(0,q.jsxs)(`span`,{"data-testid":`automation-health-badge`,className:m(`inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-medium`,Qe[e]),children:[(0,q.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`,"aria-hidden":!0}),t[ze[e]]]})}var et=/^\d+s$/;function tt(e,t,n){if(!e)return t.never;let r=ue(e);return et.test(r)?t.justNow:`${r} ${n}`}function nt(e){return e?.summary?e.summary.total.toLocaleString():!e||e.isLoading?`…`:`—`}function rt(e){let t=e?.summary?.recentSuccessRate;return t==null?`—`:`${Math.round(t*100)}%`}function it(e){return He(e?.summary?.averageDurationMs??null)}function at({state:e,copy:t}){return(0,q.jsx)(`dl`,{"data-testid":`automation-run-stats`,className:`grid grid-cols-3 gap-2 border-t border-[var(--oh-border)] pt-3 text-xs`,children:[{label:t.runs,value:nt(e)},{label:t.recentSuccess,value:rt(e)},{label:t.averageDuration,value:it(e)}].map(e=>(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`dt`,{className:`truncate text-muted`,children:e.label}),(0,q.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-content`,children:e.value})]},e.label))})}function ot({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onExport:o,onEdit:s,insights:c}){let{navigate:l}=T(),{t:u}=a(`openhands`),d=F(`manage_automations`),f=e.trigger.schedule_human||e.trigger.type,p=(0,K.useMemo)(()=>J(e,f),[e,f]),g=()=>{l?.(`/automations/${e.id}`)},_=Re({automation:e,t:u,canManage:d,onRunNow:n,isRunPending:r,onView:g,onExport:o,onEdit:s,onToggle:t,onDelete:i}),v=()=>{g()};return(0,q.jsxs)(`div`,{role:`link`,tabIndex:0,"data-testid":`automation-card-${e.id}`,onClick:v,onKeyDown:e=>{e.key===`Enter`&&v()},className:m(`flex min-w-0 flex-col gap-3 overflow-hidden p-4 text-left`,j,he),children:[(0,q.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,q.jsxs)(`h3`,{className:`flex items-center gap-2 truncate text-sm font-semibold text-white`,children:[e.trigger.type===`event`?(0,q.jsx)(b,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}):(0,q.jsx)(P,{className:`size-4 shrink-0 text-muted`}),(0,q.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.prompt?(0,q.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.prompt}):null]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[d?(0,q.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:U,children:[(0,q.jsx)(L,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),u(h.AUTOMATIONS$RUN_NOW)]}):null,(0,q.jsx)(W,{items:_})]})]}),c?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,q.jsx)($e,{health:Y(e,c.state),labels:c.spec.health}),(0,q.jsx)(`span`,{"data-testid":`automation-last-run-${e.id}`,children:`${c.spec.lastRun.label} ${tt(c.state?.summary?.latestRun?.started_at??e.last_triggered_at,c.spec.lastRun,u(h.CONVERSATION$AGO))}`})]}):null,p.length>0?(0,q.jsx)(N,{pills:p,testId:`automation-pills-${e.id}`}):null,c?(0,q.jsx)(at,{state:c.state,copy:c.spec.stats}):null]})}var st=`overflow-hidden rounded-md border border-[var(--oh-border)] bg-base-secondary`,ct=[`h-11`,`border-t border-[var(--oh-border)] transition-colors`].join(` `),lt=`hover:bg-interactive-hover-low outline-none focus:outline-none focus-visible:outline-none focus-visible:bg-interactive-hover-low`,Z=`px-3 align-middle`,ut=[ct,lt,`cursor-pointer`].join(` `),dt=`openhands-automations-view`;function ft(){return typeof window>`u`?`grid`:window.localStorage.getItem(`openhands-automations-view`)===`list`?`list`:`grid`}function pt(e){window.localStorage.setItem(dt,e)}function mt({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onExport:o,onEdit:s,insights:c}){let{navigate:l}=T(),{t:u}=a(`openhands`),d=F(`manage_automations`),f=e.trigger.schedule_human||e.trigger.type,p=(0,K.useMemo)(()=>J(e,f),[e,f]),g=()=>{l?.(`/automations/${e.id}`)},_=Re({automation:e,t:u,canManage:d,onRunNow:n,isRunPending:r,onView:g,onExport:o,onEdit:s,onToggle:t,onDelete:i}),v=()=>{g()};return(0,q.jsxs)(`tr`,{"data-testid":`automation-list-row-${e.id}`,onClick:v,onKeyDown:e=>{e.key===`Enter`&&v()},tabIndex:0,className:m(ut,`cursor-pointer`),children:[(0,q.jsx)(`td`,{className:Z,children:(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.trigger.type===`event`?(0,q.jsx)(b,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}):(0,q.jsx)(P,{className:`size-4 shrink-0 text-muted`}),(0,q.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate text-sm font-medium text-white`,title:e.name,children:e.name}),p.length>0?(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)(N,{pills:p,testId:`automation-pills-${e.id}`})}):null]})}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`td`,{"data-testid":`automation-health-${e.id}`,className:m(`hidden w-[110px] @min-[36rem]:table-cell`,Z),children:(0,q.jsx)($e,{health:Y(e,c.state),labels:c.spec.health})}),(0,q.jsx)(`td`,{"data-testid":`automation-last-run-${e.id}`,className:m(`hidden w-[84px] whitespace-nowrap text-xs text-muted @min-[44rem]:table-cell`,Z),children:tt(c.state?.summary?.latestRun?.started_at??e.last_triggered_at,c.spec.lastRun,u(h.CONVERSATION$AGO))}),(0,q.jsx)(`td`,{"data-testid":`automation-run-stats-${e.id}`,title:`${c.spec.stats.runs} · ${c.spec.stats.averageDuration}`,className:m(`hidden w-[140px] whitespace-nowrap text-right text-xs text-muted @min-[56rem]:table-cell`,Z),children:`${nt(c.state)} · ${it(c.state)}`})]}):null,(0,q.jsx)(`td`,{className:m(c?`w-[90px]`:`w-0`,`whitespace-nowrap`,Z),children:(0,q.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[d?(0,q.jsx)(E,{content:u(h.AUTOMATIONS$RUN_NOW),placement:`top`,children:(0,q.jsx)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-label":u(h.AUTOMATIONS$RUN_NOW),"aria-busy":r,disabled:r||!e.enabled,onClick:t=>{t.stopPropagation(),n(e.id)},className:H,children:(0,q.jsx)(L,{className:`size-4 shrink-0`,"aria-hidden":!0})})}):null,(0,q.jsx)(W,{items:_})]})})]})}function ht({title:e,count:t,automations:n,view:r,onToggle:i,onRunNow:a,runPendingId:o=null,onDelete:s,onExport:c,onEdit:l,insights:u}){return n.length===0?null:(0,q.jsxs)(`section`,{children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e}),(0,q.jsx)(y,{count:t})]}),r===`grid`?(0,q.jsx)(`div`,{className:m(`mt-3`,pe),children:(0,q.jsx)(`div`,{className:ge,children:n.map(e=>(0,q.jsx)(ot,{automation:e,onToggle:i,onRunNow:a,isRunPending:o===e.id,onDelete:s,onExport:c,onEdit:l,insights:u&&{spec:u.spec,state:u.byId.get(e.id)}},e.id))})}):(0,q.jsx)(`div`,{className:m(st,`mt-3`,u&&`@container`),children:(0,q.jsx)(`table`,{className:m(`w-full min-w-full [&>tbody>tr:first-child]:border-t-0`,u&&`table-fixed`),children:(0,q.jsx)(`tbody`,{children:n.map(e=>(0,q.jsx)(mt,{automation:e,onToggle:i,onRunNow:a,isRunPending:o===e.id,onDelete:s,onExport:c,onEdit:l,insights:u&&{spec:u.spec,state:u.byId.get(e.id)}},e.id))})})})]})}var gt=e(n(),1);function _t({icon:e,label:t,isSelected:n}){return(0,q.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,q.jsx)(`span`,{className:D,"aria-hidden":!0,children:(0,q.jsx)(e,{})}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,q.jsx)(te,{className:`size-4 shrink-0`,"aria-hidden":!0}):null]})}var vt=[{value:`grid`,icon:Ie,labelKey:h.AUTOMATIONS$VIEW_GRID,testId:`automations-view-toggle-grid`},{value:`list`,icon:Le,labelKey:h.AUTOMATIONS$VIEW_LIST,testId:`automations-view-toggle-list`}];function yt({view:e,onChange:t,disabled:n=!1}){let{t:r}=a(`openhands`),[i,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(vt.find(t=>t.value===e)??vt[0]).icon;(0,K.useLayoutEffect)(()=>{if(!i||!l.current)return;let e=()=>{let e=l.current?.getBoundingClientRect();e&&c({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,K.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;l.current?.contains(t)||u.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 f=i&&s?(0,q.jsx)(de,{ref:u,theme:`popover`,className:`min-w-[10rem]`,children:vt.map(n=>(0,q.jsx)(`li`,{children:(0,q.jsx)(fe,{testId:n.testId,onClick:()=>{t(n.value),o(!1)},className:`group`,children:(0,q.jsx)(_t,{icon:n.icon,label:r(n.labelKey),isSelected:e===n.value})})},n.value))}):null;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:l,type:`button`,"data-testid":`automations-view-toggle`,"aria-label":r(h.AUTOMATIONS$VIEW_MODE),"aria-haspopup":`menu`,"aria-expanded":i,"aria-disabled":n,disabled:n,onClick:()=>{n||o(e=>!e)},className:m(`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,q.jsx)(d,{className:`size-4`,"aria-hidden":!0})}),i&&s&&typeof document<`u`?gt.createPortal((0,q.jsx)(`div`,{style:s,children:f}),document.body):null]})}function bt(){return(0,q.jsxs)(`div`,{"data-testid":`automation-card-skeleton`,className:`${j} border border-transparent p-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,q.jsx)(`div`,{className:`h-5 w-40 animate-pulse rounded bg-surface-raised`}),(0,q.jsx)(`div`,{className:`h-5 w-10 animate-pulse rounded-full bg-surface-raised`})]}),(0,q.jsx)(`div`,{className:`mt-2 h-4 w-72 animate-pulse rounded bg-surface-raised`}),(0,q.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,q.jsx)(`div`,{className:`h-7 w-32 animate-pulse rounded-full bg-surface-raised`}),(0,q.jsx)(`div`,{className:`h-7 w-28 animate-pulse rounded-full bg-surface-raised`}),(0,q.jsx)(`div`,{className:`h-7 w-24 animate-pulse rounded-full bg-surface-raised`})]})]})}var xt=e=>(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m19.5 8.25-7.5 7.5-7.5-7.5`})}),St=ie();function Ct({children:e}){return(0,q.jsx)(`span`,{className:`whitespace-nowrap`,children:e})}function wt({children:e}){return(0,q.jsx)(`code`,{"data-testid":`automations-create-instructions-example`,className:m(`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 Tt({children:e}){return(0,q.jsx)(q.Fragment,{children:e})}var Et={example:(0,q.jsx)(Ct,{}),cmd:(0,q.jsx)(wt,{}),punct:(0,q.jsx)(Tt,{})};function Dt({onLaunch:e}={}){let{t}=a(`openhands`),n=De(),r=f(),{trackAutomationCreatedButton:i}=se();return(0,q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,q.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[(0,q.jsx)(c,{ns:`openhands`,i18nKey:h.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC,components:Et}),` `,t(h.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE)]}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,q.jsx)(`a`,{href:St,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-muted underline transition-colors hover:text-foreground`,children:t(h.AUTOMATIONS$EMPTY_LEARN_MORE)}),(0,q.jsx)(w,{type:`button`,variant:`primary`,testId:`automations-create-automation`,onClick:()=>{i({backendKind:r.backend.kind}),n(t(h.AUTOMATIONS$CREATE_AUTOMATION_PROMPT),e)},startContent:(0,q.jsx)(Ee,{className:`size-4`,"aria-hidden":!0}),children:t(h.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})]})]})}function Ot({collapsible:e=!1}){let{t}=a(`openhands`),[n,r]=(0,K.useState)(!e);return e?(0,q.jsxs)(`div`,{className:`w-full rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,q.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,q.jsx)(`span`,{className:`text-sm font-normal text-content`,children:t(h.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,q.jsx)(xt,{className:m(`size-5 text-muted transition-transform`,n&&`rotate-180`)})]}),n?(0,q.jsx)(`div`,{className:`px-4 pb-4`,children:(0,q.jsx)(Dt,{})}):null]}):(0,q.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[(0,q.jsx)(`h3`,{className:`text-center text-sm font-medium text-content`,children:t(h.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,q.jsx)(`div`,{className:`mt-4`,children:(0,q.jsx)(Dt,{})})]})}function kt(){let{t:e}=a(`openhands`);return(0,q.jsxs)(`div`,{"data-testid":`automations-empty`,className:me,children:[(0,q.jsx)(`p`,{className:`text-sm text-white`,children:e(h.AUTOMATIONS$EMPTY)}),(0,q.jsx)(`p`,{className:`mt-1 text-xs text-tertiary-light`,children:e(h.AUTOMATIONS$EMPTY_HINT)}),(0,q.jsx)(`div`,{className:`mt-8 flex justify-center border-t border-[var(--oh-border)] pt-8`,children:(0,q.jsx)(Ot,{})})]})}function At({isOpen:e,onClose:t}){let{t:n}=a(`openhands`);return e?(0,q.jsx)(S,{onClose:t,"aria-label":n(h.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE),children:(0,q.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,q.jsx)(O,{onClose:t,testId:`add-automation-modal-close`}),(0,q.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,q.jsx)(`h2`,{id:`add-automation-modal-title`,className:m(`pr-6`,C),children:n(h.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)})}),(0,q.jsx)(`div`,{className:`px-6 pb-6`,children:(0,q.jsx)(Dt,{onLaunch:t})})]})}):null}function Q({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted`,children:e}),(0,q.jsx)(`dd`,{className:`whitespace-pre-wrap break-words text-sm text-content`,children:t})]})}function jt({isOpen:e,spec:t,isImporting:n,onClose:r,onImport:i}){let{t:o}=a(`openhands`);if(!e||!t)return null;let s=t.trigger.type===`event`?[t.trigger.source,R(t.trigger.on)].filter(Boolean).join(`: `):[t.trigger.schedule_human??t.trigger.schedule,t.timezone??t.trigger.timezone].filter(Boolean).join(` · `);return(0,q.jsx)(S,{onClose:n?void 0:r,closeOnEscape:!n,closeOnBackdropClick:!n,"aria-label":o(h.AUTOMATIONS$IMPORT),children:(0,q.jsxs)(`div`,{"data-testid":`import-automation-modal`,className:`relative flex max-h-[85vh] w-[min(36rem,calc(100vw-2rem))] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,q.jsx)(O,{onClose:r,testId:`import-automation-modal-close`,disabled:n}),(0,q.jsxs)(`header`,{className:`px-6 pb-4 pt-6`,children:[(0,q.jsx)(`h2`,{className:m(`pr-6`,C),children:o(h.AUTOMATIONS$IMPORT)}),(0,q.jsx)(`p`,{className:`mt-2 text-sm text-tertiary-light`,children:o(h.AUTOMATIONS$IMPORT_PREVIEW_DESCRIPTION)})]}),(0,q.jsxs)(`dl`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto border-y border-[var(--oh-border)] px-6 py-5`,children:[(0,q.jsx)(Q,{label:o(h.AUTOMATIONS$NAME),value:t.name}),(0,q.jsx)(Q,{label:o(h.AUTOMATIONS$DETAIL$TRIGGER),value:s}),(0,q.jsx)(Q,{label:o(h.AUTOMATIONS$PROMPT),value:t.prompt??``}),t.plugins&&t.plugins.length>0?(0,q.jsx)(Q,{label:o(h.AUTOMATIONS$DETAIL$PLUGINS),value:t.plugins.join(`, `)}):null]}),(0,q.jsxs)(`footer`,{className:`px-6 py-5`,children:[(0,q.jsx)(`p`,{className:`mb-4 text-sm text-tertiary-light`,children:o(h.AUTOMATIONS$IMPORT_DISABLED_NOTICE)}),(0,q.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,q.jsx)(w,{testId:`import-automation-cancel`,type:`button`,variant:`secondary`,onClick:r,isDisabled:n,children:o(h.AUTOMATIONS$CANCEL)}),(0,q.jsx)(w,{testId:`import-automation-confirm`,type:`button`,variant:`primary`,onClick:i,isDisabled:n,"aria-busy":n,children:o(n?h.AUTOMATIONS$IMPORTING:h.AUTOMATIONS$IMPORT)})]})]})]})})}var Mt=20;function Nt(e,t={}){let{enabled:n=!0}=t,r=f();return s({queries:e.map(e=>({queryKey:[...I,e.id,{limit:Mt,offset:0},r.backend.id,r.orgId],queryFn:()=>x.getAutomationRuns(e.id,Mt,0),staleTime:60*1e3,enabled:n&&!!e.id})),combine:t=>{let n=new Map;return e.forEach((e,r)=>{let i=t[r];n.set(e.id,{summary:i.data?Ve(i.data):null,isLoading:i.isLoading,isError:i.isError})}),n}})}function $(e){return Object.fromEntries(e.map(e=>[e.value,e.label]))}function Pt({spec:e,status:t,trigger:n,sort:r,onStatusChange:i,onTriggerChange:a,onSortChange:o}){return(0,q.jsxs)(q.Fragment,{children:[e.filters.map(e=>e.id===`status`?(0,q.jsx)(B,{testId:`automations-filter-status`,value:t,onChange:i,options:e.options.map(e=>e.value),labelByValue:$(e.options),ariaLabel:e.label},e.id):(0,q.jsx)(B,{testId:`automations-filter-trigger`,value:n,onChange:a,options:e.options.map(e=>e.value),labelByValue:$(e.options),ariaLabel:e.label},e.id)),(0,q.jsx)(B,{testId:`automations-sort`,value:r,onChange:o,options:e.sort.options.map(e=>e.value),labelByValue:$(e.sort.options),ariaLabel:e.sort.label})]})}function Ft({onClear:e}){let{t}=a(`openhands`);return(0,q.jsxs)(`div`,{"data-testid":`automations-filtered-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-8 text-center`,children:[(0,q.jsx)(`p`,{className:`text-sm text-muted`,children:t(h.AUTOMATIONS$NO_FILTER_MATCHES)}),(0,q.jsx)(`button`,{type:`button`,"data-testid":`automations-clear-filters`,onClick:e,className:`mt-2 text-sm text-white underline-offset-2 hover:underline`,children:t(h.AUTOMATIONS$CLEAR_FILTERS)})]})}function It({label:e,tiles:t}){return(0,q.jsx)(`section`,{"aria-label":e,className:`grid grid-cols-2 gap-3 xl:grid-cols-4`,children:t.map(e=>(0,q.jsxs)(`div`,{"data-testid":`overview-tile-${e.key}`,className:m(j,`p-4`),children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.label}),(0,q.jsx)(e.Icon,{className:`size-4 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0})]}),(0,q.jsx)(`div`,{className:`mt-2 text-xl font-semibold text-content`,children:e.value}),(0,q.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted`,children:e.detail})]},e.key))})}var Lt=50,Rt=i(function(){let{t:e}=a(`openhands`),t=le(),n=(0,K.useMemo)(()=>ce(),[]),r=_(),i=n&&r?{spec:n,nav:r}:null,[o,s]=(0,K.useState)(``),[c,te]=(0,K.useState)(`all`),[y,re]=(0,K.useState)(`all`),[b,ie]=(0,K.useState)(n?.sort.default??`last-run`),[x,S]=(0,K.useState)(()=>ft()),[C,T]=(0,K.useState)(Lt),[E,D]=(0,K.useState)(null),[O,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null),j=(0,K.useRef)(null),M=f(),pe=M.backend.kind===`local`,{data:me,isLoading:he,refetch:ge}=_e(),N=me?.status===`ok`,{data:P,isLoading:F,isError:I,refetch:xe}=ve({limit:C,offset:0,enabled:N}),L=Nt(P?.automations??[],{enabled:N&&i!==null}),{trackPrebuiltAutomationEnabled:R,trackAutomationExported:z}=se(),Ee=Ce(),De=we(),B=ye(),V=be(),H=(0,K.useMemo)(()=>P?.automations?n?Je(P.automations,{search:o,status:c,trigger:y,sort:b},L):P.automations.filter(e=>Ue(e,o)):[],[P?.automations,n,o,c,y,b,L]),U=(0,K.useMemo)(()=>H.filter(e=>e.enabled),[H]),Ae=(0,K.useMemo)(()=>H.filter(e=>!e.enabled),[H]),W=(e,t)=>{let n=!t;if(Ee.mutate({id:e,enabled:n}),n){let t=P?.automations.find(t=>t.id===e);R({automationId:e,automationName:t?.name??e})}},G=t=>{B.mutate(t,{onSuccess:()=>{d(e(h.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{l(Te(t,e(h.AUTOMATIONS$RUN_NOW_ERROR)))}})},Ie=e=>{let t=P?.automations.find(t=>t.id===e);t&&D({id:e,name:t.name})},Le=e=>{let t=P?.automations.find(t=>t.id===e);t&&ue(t)},J=e=>{let t=`${JSON.stringify(Ne(e),null,2)}\n`;p(new Blob([t],{type:`application/json`}),Pe(e)),z({backendKind:M.backend.kind})},Re=async t=>{let n=t.currentTarget,r=n.files?.[0];if(n.value=``,r)try{let t;try{t=JSON.parse(await r.text())}catch{l(e(h.AUTOMATIONS$IMPORT_INVALID_JSON));return}A(je(t))}catch(t){l(t instanceof Error?t.message:e(h.ERROR$GENERIC))}},ze=()=>{k&&V.mutate({...k,enabled:!1},{onSuccess:t=>{A(null),u(e(h.AUTOMATIONS$IMPORT_SUCCESS,{name:t.name}),e(h.AUTOMATIONS$IMPORT_VIEW),ae(t.id))},onError:t=>{l(Te(t,e(h.ERROR$GENERIC)))}})},Be=()=>{E&&(De.mutate(E.id),D(null))},Ve=(0,K.useCallback)(e=>{S(e),pt(e)},[]),Y=()=>{s(``),te(`all`),re(`all`)},He=(0,K.useMemo)(()=>{if(!n)return[];let e=P?.automations??[];return n.overview.tiles.map(t=>{let n=Ze(t.metric,e,L),r=n.isZero&&t.zeroDetail?t.zeroDetail:t.detail;return{key:t.metric,label:t.label,value:n.display,detail:oe(r,n.placeholderValues),Icon:v[t.icon]}})},[n,P?.automations,L]),We=i?{spec:i.spec.insights,byId:L}:void 0,Ge=e=>i?(0,q.jsx)(ee,{heading:i.nav.heading,navTestIdBase:`automations-navbar`,items:i.nav.items,children:e}):(0,q.jsx)(`div`,{className:`min-h-full`,children:(0,q.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:e})}),Ke=P?P.total>P.automations.length:!1,X=!F&&!I&&P?.automations.length===0;return Ge(he?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:t.listTitle??e(h.AUTOMATIONS$TITLE)}),(0,q.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle??e(h.AUTOMATIONS$SUBTITLE)}),(0,q.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,q.jsx)(bt,{},`skeleton-${String(t)}`))})]}):N?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:t.listTitle??e(h.AUTOMATIONS$TITLE)}),(0,q.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle??e(h.AUTOMATIONS$SUBTITLE)})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2`,children:[(0,q.jsx)(w,{type:`button`,variant:`secondary`,testId:`automations-import-automation`,className:`whitespace-nowrap`,onClick:()=>j.current?.click(),startContent:(0,q.jsx)(Fe,{className:`size-4`,"aria-hidden":!0}),children:e(h.AUTOMATIONS$IMPORT)}),(0,q.jsx)(`input`,{ref:j,type:`file`,accept:`application/json,.json`,className:`hidden`,"data-testid":`automations-import-file`,onChange:Re}),(0,q.jsx)(w,{type:`button`,variant:`secondary`,testId:`automations-add-automation`,className:`whitespace-nowrap`,onClick:()=>fe(!0),children:e(h.AUTOMATIONS$ADD_AUTOMATION)})]})]}),i&&(0,q.jsx)(It,{label:i.spec.overview.label,tiles:He}),(0,q.jsxs)(`div`,{className:m(`flex items-stretch gap-2`,i?`flex-wrap`:`mt-6`),children:[(0,q.jsx)(g,{value:o,onChange:s}),i&&(0,q.jsx)(Pt,{spec:i.spec,status:c,trigger:y,sort:b,onStatusChange:te,onTriggerChange:re,onSortChange:ie}),(0,q.jsx)(yt,{view:x,onChange:Ve,disabled:X})]}),(0,q.jsxs)(`div`,{className:m(`flex flex-col gap-6`,!i&&`mt-6`),children:[F&&(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,q.jsx)(bt,{},`skeleton-${String(t)}`))}),I&&!F&&(0,q.jsx)(Me,{onRetry:xe}),X&&(0,q.jsx)(kt,{}),!F&&!I&&P&&P.automations.length>0&&(i&&H.length===0?(0,q.jsx)(Ft,{onClear:Y}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ht,{title:e(h.AUTOMATIONS$ACTIVE),count:U.length,automations:U,view:x,onToggle:W,onRunNow:G,runPendingId:B.isPending?B.variables??null:null,onDelete:Ie,onExport:J,onEdit:pe?Le:void 0,insights:We}),(0,q.jsx)(ht,{title:e(h.AUTOMATIONS$INACTIVE),count:Ae.length,automations:Ae,view:x,onToggle:W,onRunNow:G,runPendingId:B.isPending?B.variables??null:null,onDelete:Ie,onExport:J,onEdit:pe?Le:void 0,insights:We}),Ke&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>T(e=>e+Lt),className:`self-center rounded-lg border border-[var(--oh-border)] px-6 py-2 text-sm text-white hover:bg-surface-raised`,children:e(h.AUTOMATIONS$LOAD_MORE)})]}))]}),!i&&(0,q.jsx)(`div`,{className:`mt-6`,children:(0,q.jsx)(ne,{query:o})}),(0,q.jsx)(ke,{automationName:E?.name??``,isOpen:E!==null,onConfirm:Be,onCancel:()=>D(null)}),O&&(0,q.jsx)(Se,{automation:O,isOpen:O!==null,onClose:()=>ue(null)}),(0,q.jsx)(At,{isOpen:de,onClose:()=>fe(!1)}),(0,q.jsx)(jt,{isOpen:k!==null,spec:k,isImporting:V.isPending,onClose:()=>A(null),onImport:ze})]}):(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:t.listTitle??e(h.AUTOMATIONS$TITLE)}),(0,q.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle??e(h.AUTOMATIONS$SUBTITLE)}),(0,q.jsx)(Oe,{onRetry:ge})]}))});export{Rt as default};
@@ -1,7 +0,0 @@
1
- import{C as e,w as t}from"./utils-zxEjKE70.js";import{t as n}from"./settings-CWFxymAf.js";import{c as r,d as i,l as a,o,s,u as c}from"./llm-subscription-DTqtBCWz.js";import{t as l}from"./automation-C_eCrGyP.js";import{a as ee,i as u,n as d,o as f,r as p,t as m}from"./vendor~browser-B-fae1JU.js";var h=[`file1.txt`,`file2.txt`,`file3.txt`],g=[`reboot_skynet.exe`,`target_list.txt`,`terminator_blueprint.txt`],te={home:`/home/openhands`,favorites:[{label:`Downloads`,path:`/home/openhands/Downloads`}],locations:[]},ne={"/projects":[{name:`demo-app`,path:`/projects/demo-app`},{name:`sample-tools`,path:`/projects/sample-tools`},{name:`notes-service`,path:`/projects/notes-service`}],"/projects/demo-app":[{name:`web-client`,path:`/projects/demo-app/web-client`},{name:`api-service`,path:`/projects/demo-app/api-service`}],"/projects/demo-app/web-client":[]},re=[u.all(`*/api/bash/execute_bash_command`,async()=>f.json({command:``,exit_code:0,output:``})),u.get(`*/api/file/home`,async()=>f.json(te)),u.get(`*/api/file/search_subdirs`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`)??``,n=ne[t]??[];return f.json({path:t,items:n,subdirs:n,next_page_id:null})}),u.get(`*/api/file/:path`,async({params:e})=>f.json({path:`/${e.path?.toString()??`home`}`,subdirs:[]})),u.get(`/api/conversations/:conversationId/list-files`,async({params:e})=>{await p();let t=e.conversationId?.toString();return t?t===`test-conversation-id-2`?f.json(g):f.json(h):f.json(null,{status:400})}),u.get(`/api/conversations/:conversationId/select-file`,async({request:e})=>{await p();let t=new URL(e.url).searchParams.get(`file`)?.toString();return t?f.json({code:`Content of ${t}`}):f.json(null,{status:404})})],ie=[{issue_number:6968,title:`Fix merge conflicts`,repo:`octocat/hello-world`,task_type:`MERGE_CONFLICTS`,git_provider:`github`}],ae=[{issue_number:268,title:`Fix broken CI checks`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:281,title:`Fix issue`,repo:`octocat/earth`,task_type:`UNRESOLVED_COMMENTS`,git_provider:`github`},{issue_number:293,title:`Update documentation`,repo:`octocat/earth`,task_type:`OPEN_ISSUE`,git_provider:`github`},{issue_number:305,title:`Refactor user service`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:312,title:`Fix styling bug`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:327,title:`Add unit tests`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:331,title:`Implement dark mode`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:345,title:`Optimize build process`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:352,title:`Update dependencies`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`}],oe=[...ie,...ae],se=[u.get(`*/api/v1/git/suggested-tasks/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`limit`),r=t.searchParams.get(`page_id`),i=[...oe];if(r||n){let e=n?parseInt(n,10):30;i=i.slice(0,e)}return f.json({items:i,next_page_id:null})})],_=new Map([[`OpenAI_API_Key`,{value:`test-123`,description:`OpenAI API Key`}],[`Google_Maps_API_Key`,{value:`test-123`,description:`Google Maps API Key`}]]),ce=[u.get(`*/api/settings/secrets`,async({request:e})=>{if(new URL(e.url).pathname.split(`/`).filter(Boolean).length>3)return;let t=Array.from(_.entries()).map(([e,{description:t}])=>({name:e,description:t}));return f.json({secrets:t})}),u.get(`*/api/settings/secrets/:name`,async({params:e})=>{let{name:t}=e;if(typeof t!=`string`)return f.json({detail:`Invalid name`},{status:400});let n=_.get(t);return n?new f(n.value,{headers:{"Content-Type":`text/plain`}}):f.json({detail:`Secret not found`},{status:404})}),u.put(`*/api/settings/secrets`,async({request:e})=>{let t=await e.json();return!t?.name||!t?.value?f.json({detail:`name and value are required`},{status:400}):(_.set(t.name,{value:t.value,description:t.description}),f.json({name:t.name,description:t.description}))}),u.delete(`*/api/settings/secrets/:name`,async({params:e})=>{let{name:t}=e;return typeof t==`string`?_.delete(t)?f.json({deleted:!0}):f.json({detail:`Secret not found`},{status:404}):f.json({detail:`Invalid name`},{status:400})})],v=(e,t)=>Array.from({length:e},(e,n)=>({id:`${n+1}`,full_name:`user/repo-${n+1}`,git_provider:t,is_public:Math.random()>.3,stargazers_count:Math.floor(Math.random()*1e3),pushed_at:new Date(Date.now()-Math.random()*90*24*60*60*1e3).toISOString()})),le=e=>Array.from({length:e},(e,t)=>({name:t===0?`main`:t===1?`develop`:`feature/branch-${t}`,commit_sha:`abc123${t.toString().padStart(3,`0`)}`,protected:t===0,last_push_date:new Date(Date.now()-Math.random()*7*24*60*60*1e3).toISOString()})),y={github:v(120,`github`),gitlab:v(120,`gitlab`),bitbucket:v(120,`bitbucket`)},b=le(25),ue=[{path:`src/components/hello.tsx`,status:`UPDATED`},{path:`src/utils/new-helper.ts`,status:`ADDED`},{path:`src/old-module.py`,status:`DELETED`}],de=[u.get(`*/api/user/repositories`,async({request:e})=>{await p(500);let t=new URL(e.url),n=t.searchParams.get(`selected_provider`),r=parseInt(t.searchParams.get(`page`)||`1`,10),i=parseInt(t.searchParams.get(`per_page`)||`30`,10),a=t.searchParams.get(`sort`)||`pushed`,o=t.searchParams.get(`installation_id`);if(!n)return f.json(`Git provider token required. (such as GitHub).`,{status:401});let s=[...y[n]||[]];if(a===`pushed`?s.sort((e,t)=>new Date(t.pushed_at).getTime()-new Date(e.pushed_at).getTime()):a===`stars`&&s.sort((e,t)=>(t.stargazers_count||0)-(e.stargazers_count||0)),o&&n===`github`){let e=(parseInt(o,10)||0)*20;s=s.slice(e,e+20)}let c=(r-1)*i,l=c+i,ee=s.slice(c,l),u=l<s.length,d=r>1,m=Math.ceil(s.length/i),h=``;if(u||d){let e=[];d&&e.push(`</api/user/repositories?page=${r-1}&per_page=${i}>; rel="prev"`),u&&e.push(`</api/user/repositories?page=${r+1}&per_page=${i}>; rel="next"`),e.push(`</api/user/repositories?page=${m}&per_page=${i}>; rel="last"`),e.push(`</api/user/repositories?page=1&per_page=${i}>; rel="first"`),h=e.join(`, `)}let g=[...ee];return g.length>0&&h&&(g[0]={...g[0],link_header:h}),f.json(g)}),u.get(`*/api/user/search/repositories`,async({request:e})=>{await p(300);let t=new URL(e.url),n=t.searchParams.get(`query`)||``,r=t.searchParams.get(`selected_provider`),i=parseInt(t.searchParams.get(`per_page`)||`5`,10),a=t.searchParams.get(`sort`)||`stars`,o=t.searchParams.get(`order`)||`desc`;if(!r)return f.json(`Git provider token required.`,{status:401});let s=[...(y[r]||[]).filter(e=>e.full_name.toLowerCase().includes(n.toLowerCase()))];a===`stars`&&s.sort((e,t)=>{let n=e.stargazers_count||0,r=t.stargazers_count||0;return o===`desc`?r-n:n-r});let c=s.slice(0,i);return f.json(c)}),u.get(`*/api/user/repository/branches`,async({request:e})=>{await p(300);let t=new URL(e.url),n=t.searchParams.get(`repository`),r=parseInt(t.searchParams.get(`page`)||`1`,10),i=parseInt(t.searchParams.get(`per_page`)||`30`,10);if(!n)return f.json(`Repository parameter is required`,{status:400});let a=(r-1)*i,o=a+i,s={branches:b.slice(a,o),has_next_page:o<b.length,current_page:r,per_page:i,total_count:b.length};return f.json(s)}),u.get(`*/api/user/search/branches`,async({request:e})=>{await p(200);let t=new URL(e.url),n=t.searchParams.get(`repository`),r=t.searchParams.get(`query`)||``,i=parseInt(t.searchParams.get(`per_page`)||`30`,10);if(!n)return f.json(`Repository parameter is required`,{status:400});let a=b.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())).slice(0,i);return f.json(a)}),u.get(`*/api/git/changes`,async()=>f.json(ue)),u.get(`*/api/git/diff`,async()=>f.json({original:`def greet(name):
2
- return f"Hello, {name}!"
3
- `,modified:`def greet(name: str) -> str:
4
- return f"Hello, {name}! Welcome."
5
- `}))];function x(e,t){let n={...e};for(let[e,r]of Object.entries(t))typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!=null&&!Array.isArray(n[e])?n[e]=x(n[e],r):n[e]=r;return n}var fe=n.agent_settings??{},S=fe.llm,pe=typeof S?.model==`string`?S.model:`openhands/claude-opus-4-5-20251101`,C={model_name:`AgentSettings`,sections:[{key:`general`,label:`General`,fields:[{key:`enable_sub_agents`,label:`Enable sub-agents`,description:`Allow the agent to delegate work to specialized built-in sub-agents.`,section:`general`,section_label:`General`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1},{key:`tool_concurrency_limit`,label:`Parallel tool calls`,description:`Maximum number of tool calls to execute concurrently per agent step. 1 = sequential (default).`,section:`general`,section_label:`General`,value_type:`integer`,default:1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]},{key:`llm`,label:`LLM`,fields:[{key:`llm.model`,label:`Model`,description:`Select the model to use for this conversation.`,section:`llm`,section_label:`LLM`,value_type:`string`,default:pe,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{key:`llm.api_key`,label:`API Key`,description:`Provide the API key used to authenticate requests for the selected model.`,section:`llm`,section_label:`LLM`,value_type:`string`,default:null,choices:[],depends_on:[],prominence:`critical`,secret:!0,required:!1},{key:`llm.base_url`,description:`Override the model provider's default API base URL when needed.`,label:`Base URL`,section:`llm`,section_label:`LLM`,value_type:`string`,default:null,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!1},{key:`llm.temperature`,label:`Temperature`,description:`Adjust randomness for non-deterministic model outputs.`,section:`llm`,section_label:`LLM`,value_type:`number`,default:null,choices:[],depends_on:[],prominence:`minor`,secret:!1,required:!1}]},{key:`verification`,label:`Verification`,fields:[{key:`verification.critic_enabled`,label:`Enable Critic`,description:`Enable an additional critic pass to review the agent's work.`,section:`verification`,section_label:`Verification`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!1},{key:`verification.critic_mode`,label:`Critic Mode`,description:`Choose when the critic should review and intervene.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:`finish_and_message`,choices:[{label:`finish_and_message`,value:`finish_and_message`},{label:`all_actions`,value:`all_actions`}],depends_on:[`verification.critic_enabled`],prominence:`major`,secret:!1,required:!1},{key:`verification.enable_iterative_refinement`,label:`Enable Iterative Refinement`,description:`Let the critic send the agent back to refine its work when issues are found.`,section:`verification`,section_label:`Verification`,value_type:`boolean`,default:!1,choices:[],depends_on:[`verification.critic_enabled`],prominence:`critical`,secret:!1,required:!1},{key:`verification.critic_api_key`,label:`Critic API Key`,description:`If OpenHands is selected as your active LLM provider, leave this empty; the critic reuses the OpenHands Provider LLM Key.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:null,choices:[],depends_on:[`verification.critic_enabled`],prominence:`critical`,secret:!0,required:!1},{key:`verification.critic_threshold`,label:`Critic Threshold`,description:`Critic success threshold used for iterative refinement.`,section:`verification`,section_label:`Verification`,value_type:`number`,default:.6,choices:[],depends_on:[`verification.critic_enabled`,`verification.enable_iterative_refinement`],prominence:`minor`,secret:!1,required:!1},{key:`verification.max_refinement_iterations`,label:`Max Refinement Iterations`,description:`Maximum number of refinement attempts after critic feedback.`,section:`verification`,section_label:`Verification`,value_type:`integer`,default:3,choices:[],depends_on:[`verification.critic_enabled`,`verification.enable_iterative_refinement`],prominence:`minor`,secret:!1,required:!1},{key:`verification.critic_server_url`,label:`Critic Server URL`,description:`Override the critic service URL.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:null,choices:[],depends_on:[`verification.critic_enabled`],prominence:`minor`,secret:!1,required:!1},{key:`verification.critic_model_name`,label:`Critic Model Name`,description:`Override the critic model name.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:null,choices:[],depends_on:[`verification.critic_enabled`],prominence:`minor`,secret:!1,required:!1}]},{key:`condenser`,label:`Condenser`,fields:[{description:`Enable the default LLM-based condenser to summarize long conversation histories.`,key:`condenser.enable_default_condenser`,label:`Enable default condenser`,section:`condenser`,section_label:`Condenser`,value_type:`boolean`,default:!0,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{description:`Maximum number of tokens the condenser keeps after summarization. Leave blank for unlimited.`,key:`condenser.condenser_max_size`,label:`Condenser max size`,section:`condenser`,section_label:`Condenser`,value_type:`integer`,default:null,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]},{key:`agent_context`,label:`Memory`,fields:[{description:`The agent keeps notes under .openhands/memory/ and loads them at the start of each new conversation, learning your codebase and preferences over time.`,key:`agent_context.load_memory`,label:`Persistent memory`,section:`agent_context`,section_label:`Memory`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]}]},w={model_name:`ConversationSettings`,sections:[{key:`general`,label:`General`,fields:[{key:`max_iterations`,label:`Max iterations`,section:`general`,description:`Maximum number of agent steps allowed before the conversation stops.`,section_label:`General`,value_type:`integer`,default:500,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!0}]},{key:`verification`,label:`Verification`,fields:[{key:`confirmation_mode`,label:`Confirmation mode`,description:`Pause for confirmation before the agent performs high-risk actions.`,section:`verification`,section_label:`Verification`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!0},{key:`security_analyzer`,label:`Security analyzer`,description:`Choose how OpenHands should analyze actions before asking for confirmation.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:`llm`,choices:[{label:`llm`,value:`llm`},{label:`none`,value:`none`}],depends_on:[`confirmation_mode`],prominence:`major`,secret:!1,required:!1}]}]},T={...n,provider_tokens_set:{},agent_settings_schema:C,agent_settings:{...fe,verification:{critic_enabled:!1,enable_iterative_refinement:!1},llm:{...S??{},api_key:null,model:pe},condenser:{enable_default_condenser:!0,condenser_max_size:null},enable_sub_agents:!1,tool_concurrency_limit:1},conversation_settings_schema:w,conversation_settings:{...n.conversation_settings??{}}},E={settings:structuredClone(T)},D={profiles:new Map,activeProfile:null},O=!1,k=e=>decodeURIComponent(String(Array.isArray(e)?e[0]??``:e??``)),me=e=>({name:e.name,model:typeof e.config.model==`string`?e.config.model:null,base_url:typeof e.config.base_url==`string`?e.config.base_url:null,api_key_set:e.api_key_set}),A=e=>{let t=E.settings||structuredClone(T);E.settings={...t,agent_settings:{...t.agent_settings??{},llm:structuredClone(e.config)},llm_api_key_set:e.api_key_set}},he=(e,t)=>{let n=structuredClone(e.config);return e.api_key_set&&`api_key`in n&&(t===`encrypted`?n.api_key=`gAAAAA_mock_encrypted_${e.name}`:t===`plaintext`||(n.api_key=null)),{name:e.name,config:n,api_key_set:e.api_key_set}},ge=(e,t)=>{let n=structuredClone(t.llm??{});if(typeof n.model!=`string`||n.model.trim().length===0)return null;let r={name:e,config:n,api_key_set:typeof n.api_key==`string`&&n.api_key.trim().length>0};return D.profiles.set(e,r),D.activeProfile===e&&A(r),r},j=[`anthropic/claude-3.5`,`anthropic/claude-sonnet-4-20250514`,`anthropic/claude-sonnet-4-5-20250929`,`anthropic/claude-haiku-4-5-20251001`,`anthropic/claude-opus-4-5-20251101`,`anthropic/claude-opus-4-8`,`openai/gpt-3.5-turbo`,`openai/gpt-5.5`,`openai/gpt-4o`,`openai/gpt-4o-mini`,`openhands/claude-sonnet-4-20250514`,`openhands/claude-sonnet-4-5-20250929`,`openhands/claude-haiku-4-5-20251001`,`openhands/claude-opus-4-5-20251101`,`openhands/glm-5.2`,`sambanova/Meta-Llama-3.1-8B-Instruct`],_e=[`gpt-5.2`,`gpt-5.3-codex`],M=new Set([`anthropic/claude-opus-4-5-20251101`,`anthropic/claude-opus-4-8`,`anthropic/claude-sonnet-4-5-20250929`,`openai/gpt-5.5`,`openhands/claude-opus-4-5-20251101`,`openhands/claude-sonnet-4-5-20250929`,`openhands/glm-5.2`]),N=[`openhands`,`anthropic`,`openai`,`mistral`,`gemini`,`deepseek`,`moonshot`,`minimax`],ve=Array.from(new Set(j.map(e=>e.split(`/`)[0]).filter(e=>!!e))),ye=j.reduce((e,t)=>{if(!M.has(t))return e;let[n,...r]=t.split(`/`);return!n||r.length===0?e:(e[n]??=[],e[n].push(r.join(`/`)),e)},{}),be=`1.29.3`,xe=[u.get(`*/server_info`,async()=>f.json({uptime:0,idle_time:0,version:be,usable_tools:[`terminal`,`file_editor`,`task_tracker`,`browser_tool_set`],agents:[`CodeActAgent`],default_agent:`CodeActAgent`,models:j,security_analyzers:[`llm`,`none`]})),u.get(`*/api/llm/models`,async()=>f.json({models:j})),u.get(`*/api/llm/models/verified`,async()=>f.json({models:ye})),u.get(`*/api/llm/providers`,async()=>f.json({providers:ve})),u.get(`*${a}`,async()=>f.json({vendor:i,models:_e})),u.get(`*${c}`,async()=>f.json({connected:O,account_email:O?`mock-chatgpt@example.com`:null,expires_at:null})),u.post(`*${s}`,async()=>f.json({device_code:`mock-device-code`,user_code:`MOCK-CODE`,verification_uri:`https://auth.openai.com/activate`,verification_uri_complete:`https://auth.openai.com/activate?user_code=MOCK-CODE`,interval:1,expires_in:900})),u.post(`*${o}`,async()=>(O=!0,f.json({connected:!0,account_email:`mock-chatgpt@example.com`,expires_at:null}))),u.post(`*${r}`,async()=>(O=!1,f.json({connected:!1}))),u.get(`*/api/options/models`,async()=>f.json({models:j,verified_models:[`claude-opus-4-5-20251101`,`claude-sonnet-4-5-20250929`],verified_providers:N,default_model:`openhands/glm-5.2`})),u.get(`*/api/v1/config/providers/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`query`)?.toLowerCase(),r=t.searchParams.get(`verified__eq`),i=new Set,a=[];for(let e of j){let[t]=e.split(`/`);t&&!i.has(t)&&(i.add(t),a.push({name:t,verified:N.includes(t)}))}if(n&&(a=a.filter(e=>e.name.toLowerCase().includes(n))),r!=null){let e=r===`true`;a=a.filter(t=>t.verified===e)}return f.json({items:a,next_page_id:null})}),u.get(`*/api/v1/config/models/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`query`)?.toLowerCase(),r=t.searchParams.get(`verified__eq`),i=t.searchParams.get(`provider__eq`),a=j.map(e=>{let[t,...n]=e.split(`/`),r=n.join(`/`);return{provider:t||null,name:r,verified:M.has(e)}});if(i&&(a=a.filter(e=>e.provider===i)),n&&(a=a.filter(e=>e.name.toLowerCase().includes(n))),r!=null){let e=r===`true`;a=a.filter(t=>t.verified===e)}return f.json({items:a,next_page_id:null})}),u.get(`*/api/options/security-analyzers`,async()=>f.json([`llm`,`none`])),u.get(`*/api/profiles`,async()=>f.json({profiles:Array.from(D.profiles.values()).map(me),active_profile:D.activeProfile})),u.get(`*/api/profiles/:name`,async({params:e,request:t})=>{let n=k(e.name),r=D.profiles.get(n);return r?f.json(he(r,t.headers.get(`X-Expose-Secrets`))):f.json({detail:`Profile '${n}' not found`},{status:404})}),u.post(`*/api/profiles/:name`,async({params:e,request:t})=>{let n=k(e.name),r=await t.json();if(!r)return f.json({detail:`Empty body`},{status:400});let i=ge(n,r);return i?f.json({name:i.name,message:`Profile '${i.name}' saved`},{status:201}):f.json({detail:`Profile requires llm.model`},{status:400})}),u.delete(`*/api/profiles/:name`,async({params:e})=>{let t=k(e.name);return D.profiles.delete(t),D.activeProfile===t&&(D.activeProfile=null),f.json({name:t,message:`Profile '${t}' deleted`})}),u.post(`*/api/profiles/:name/rename`,async({params:e,request:t})=>{let n=k(e.name),r=(await t.json())?.new_name?.trim()??``,i=D.profiles.get(n);if(!i)return f.json({detail:`Profile '${n}' not found`},{status:404});if(!r)return f.json({detail:`new_name is required`},{status:400});if(r!==n&&D.profiles.has(r))return f.json({detail:`Profile '${r}' already exists`},{status:409});D.profiles.delete(n);let a={...i,name:r};return D.profiles.set(r,a),D.activeProfile===n&&(D.activeProfile=r,A(a)),f.json({name:r,message:`Profile '${n}' renamed to '${r}'`})}),u.post(`*/api/profiles/:name/activate`,async({params:e})=>{let t=k(e.name),n=D.profiles.get(t);return n?(D.activeProfile=t,A(n),f.json({name:t,message:`Profile '${t}' activated and applied to current settings`,llm_applied:!0})):f.json({detail:`Profile '${t}' not found`},{status:404})}),u.get(`*/api/v1/web-client/config`,()=>{let e={feature_flags:{hide_llm_settings:!1,hide_users_page:!1},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()};return f.json(e)}),u.get(`*/api/settings/conversation-schema`,async()=>(await p(),f.json(w))),u.get(`*/api/v1/settings/conversation-schema`,async()=>(await p(),f.json(w))),u.get(`*/api/v1/settings`,async()=>{await p();let{settings:e}=E;return e?f.json(e):f.json(null,{status:404})}),u.get(`*/api/settings`,async({request:e})=>{if(new URL(e.url).pathname.split(`/`).filter(Boolean).length>2)return;await p();let{settings:t}=E,n={language:null,user_consents_to_analytics:null,enable_sound_notifications:null,git_user_name:null,git_user_email:null,title_llm_profile:null,disabled_skills:[]};if(!t)return f.json({agent_settings:{},conversation_settings:{},llm_api_key_is_set:!1,misc_settings:{app_preferences:n}});let r=e.headers.get(`X-Expose-Secrets`),i=structuredClone(t.agent_settings??{}),a=i.llm;a?.api_key&&(r===`encrypted`?a.api_key=`gAAAAA_mock_encrypted_${String(a.api_key).slice(0,8)}`:r===`plaintext`||(a.api_key=`**********`));let o=!!t.llm_api_key_set||!!t.agent_settings?.llm&&!!t.agent_settings.llm?.api_key,s=t.misc_settings,c={...n,...s?.app_preferences??{}};return f.json({agent_settings:i,conversation_settings:t.conversation_settings??{},llm_api_key_is_set:o,misc_settings:{app_preferences:c}})}),u.patch(`*/api/settings`,async({request:e})=>{await p();let t=await e.json();if(!t)return f.json({error:`Empty body`},{status:400});if(!t.agent_settings_diff&&!t.conversation_settings_diff&&!t.misc_settings_diff)return f.json({error:`At least one of agent_settings_diff, conversation_settings_diff, or misc_settings_diff must be provided`},{status:400});let n=E.settings||structuredClone(T),r={...n};if(t.agent_settings_diff){let e=x(n.agent_settings??{},t.agent_settings_diff);r.agent_settings=e;let i=e.llm;i?.api_key&&typeof i.api_key==`string`&&i.api_key.trim().length>0&&(r.llm_api_key_set=!0)}if(t.conversation_settings_diff&&(r.conversation_settings={...n.conversation_settings??{},...t.conversation_settings_diff}),t.misc_settings_diff){let e=n.misc_settings,i={...e??{}};t.misc_settings_diff.app_preferences&&(i.app_preferences={...e?.app_preferences??{},...t.misc_settings_diff.app_preferences}),r.misc_settings=i}return E.settings=r,f.json({agent_settings:r.agent_settings??{},conversation_settings:r.conversation_settings??{},llm_api_key_is_set:r.llm_api_key_set??!1,misc_settings:r.misc_settings??{app_preferences:{}}})}),u.post(`*/api/mcp/test`,async()=>(await p(),f.json({ok:!0,tools:[`mock_tool`]}))),u.get(`*/api/settings/agent-schema`,async()=>(await p(),f.json(C))),u.get(`*/api/v1/settings/agent-schema`,async()=>(await p(),f.json(C))),u.post(`*/api/v1/settings`,async({request:e})=>{await p();let t=await e.json();if(t){let e=E.settings||structuredClone(T);if(`agent_settings`in t||`conversation_settings`in t)return f.json({error:`Use *_diff nested settings payloads`,keys:[`agent_settings`,`conversation_settings`].filter(e=>e in t)},{status:422});let n={...e},r=t.agent_settings_diff;r&&(n.agent_settings=x(e.agent_settings??{},r));let i=t.conversation_settings_diff;i&&(n.conversation_settings={...e.conversation_settings??{},...i});for(let[e,r]of Object.entries(t))e!==`agent_settings_diff`&&e!==`conversation_settings_diff`&&e!==`agent_settings_schema`&&e!==`conversation_settings_schema`&&(n[e]=r);return E.settings=n,f.json(null,{status:200})}return f.json(null,{status:400})}),u.post(`*/api/mcp/test`,async()=>(await p(),f.json({ok:!0,tools:[]})))],P=`table-demo`,Se=`Can you compare several coding agents in a wide table?`,Ce=[`Here is a wide comparison table. Scroll horizontally to read every column:`,``,`| Feature | OpenHands | Claude Code | Codex | Gemini CLI | Cursor | Windsurf | Cline | Aider | Devin | Continue |`,`| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |`,`| CLI | Yes | Yes | Yes | Yes | IDE | IDE | IDE | Terminal | Cloud | IDE |`,`| MCP support | Yes | Yes | Partial | Partial | Yes | Yes | Yes | No | Yes | Yes |`,`| Local models | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes |`,`| Browser tools | Yes | Yes | Yes | Limited | Yes | Yes | Yes | No | Yes | Yes |`,`| Git integration | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |`,`| Best for | General coding | Anthropic stack | OpenAI stack | Google stack | IDE users | IDE users | VS Code | Terminal | Autonomous | IDE users |`].join(`
6
- `),we=Date.UTC(2026,5,23,12,0,0);function F(e,t,n,r){return{id:e,timestamp:new Date(we+r*6e4).toISOString(),source:t===`user`?`user`:`agent`,llm_message:{role:t,content:[{type:`text`,text:n}]},activated_microagents:[],extended_content:[]}}var Te=[F(`table-demo-user-1`,`user`,Se,0),F(`table-demo-agent-1`,`assistant`,Ce,1)],I=`canvas-demo`,L=`canvas.md`,R=[`# Agent Canvas Demo`,``,`This report was generated by the agent and opened from the file chip in chat.`,``,`## Release snapshot`,``,`| Area | Status | Next step |`,`| --- | --- | --- |`,`| Conversation UX | Ready | Validate the drawer flow |`,`| Markdown preview | Ready | Review rich rendering |`,`| Accessibility | Ready | Confirm keyboard navigation |`,``,`## Highlights`,``,`- The artifact stays in the conversation workspace.`,`- The chat chip is the compact entry point.`,`- The Files drawer provides the full rich Markdown view.`].join(`
7
- `),Ee=Date.UTC(2026,6,29,12,0,0),z=e=>new Date(Ee+e*1e3).toISOString();function B(e,t,n,r){return{id:e,timestamp:z(r),source:t===`user`?`user`:`agent`,llm_message:{role:t,content:[{type:`text`,text:n}]},activated_microagents:[],extended_content:[]}}var V={id:`canvas-demo-action`,timestamp:z(1),source:`agent`,thought:[],thinking_blocks:[],action:{kind:`FileEditorAction`,command:`create`,path:L,file_text:R,old_str:null,new_str:null,insert_line:null,view_range:null},tool_name:`file_editor`,tool_call_id:`canvas-demo-tool-call`,tool_call:{id:`canvas-demo-tool-call`,type:`function`,function:{name:`file_editor`,arguments:JSON.stringify({command:`create`,path:L})}},llm_response_id:`canvas-demo-response`,security_risk:t.LOW},De={id:`canvas-demo-observation`,timestamp:z(2),source:`environment`,tool_name:`file_editor`,tool_call_id:`canvas-demo-tool-call`,action_id:V.id,observation:{kind:`FileEditorObservation`,command:`create`,output:`Created ${L}`,path:L,prev_exist:!1,old_content:null,new_content:R,error:null}},Oe=[B(`canvas-demo-user`,`user`,`Create a concise project canvas as a Markdown report.`,0),V,De,B(`canvas-demo-agent`,`assistant`,`I generated the project canvas. Open it from the file chip above.`,3)],ke={[P]:Te,[I]:Oe},H=Date.now(),Ae=`pagination-local`,U=`pagination-cloud`,je=100,Me=500,Ne=Date.UTC(2026,4,13,0,0,0),Pe=[{id:`1`,title:`My New Project`,created_at:new Date(H).toISOString(),updated_at:new Date(H).toISOString(),execution_status:`waiting_for_confirmation`},{id:`2`,title:`Repo Testing`,created_at:new Date(H-2880*60*1e3).toISOString(),updated_at:new Date(H-2880*60*1e3).toISOString(),execution_status:`idle`,selected_repository:`octocat/hello-world`,git_provider:`github`},{id:`3`,title:`Another Project`,created_at:new Date(H-7200*60*1e3).toISOString(),updated_at:new Date(H-7200*60*1e3).toISOString(),execution_status:`idle`,selected_repository:`octocat/earth`,selected_branch:`main`},{id:`4`,title:`Archived Project`,created_at:new Date(H-14400*60*1e3).toISOString(),updated_at:new Date(H-14400*60*1e3).toISOString(),execution_status:`idle`,sandbox_status:`MISSING`},{id:`5`,title:`Errored Project`,created_at:new Date(H-10080*60*1e3).toISOString(),updated_at:new Date(H-10080*60*1e3).toISOString(),execution_status:`idle`,sandbox_status:`ERROR`},{id:Ae,title:`Local pagination fixture`,created_at:new Date(H-8640*60*1e3).toISOString(),updated_at:new Date(H-8640*60*1e3).toISOString(),execution_status:`idle`,workspace:{working_dir:`/workspace/project`}},{id:P,title:`Wide table demo`,created_at:new Date(H-1440*60*1e3).toISOString(),updated_at:new Date(H-1440*60*1e3).toISOString(),execution_status:`idle`,workspace:{working_dir:`/workspace/project`}},{id:I,title:`Generated canvas demo`,created_at:new Date(H-720*60*1e3).toISOString(),updated_at:new Date(H-720*60*1e3).toISOString(),execution_status:`idle`,workspace:{working_dir:`/workspace/project`}}],W=new Map(Pe.map(e=>[e.id,e])),Fe=new Map([[Ae,Le(`Local pagination message`)],[U,Le(`Cloud pagination message`)]]);function Ie(e,t){return{id:`${t.toLowerCase().replaceAll(` `,`-`)}-${e}`,timestamp:new Date(Ne+e*6e4).toISOString(),source:`agent`,llm_message:{role:`assistant`,content:[{type:`text`,text:`${t} ${e}`}]},activated_microagents:[],extended_content:[]}}function Le(e){return Array.from({length:je},(t,n)=>Ie(n+1,e))}function Re(e,t){let n=Number(t.get(`limit`)??`100`),r=t.get(`timestamp__lt`),i=t.get(`sort_order`),a=[...r?e.filter(e=>(e.timestamp??``)<r):e].sort((e,t)=>i===`TIMESTAMP_DESC`?(t.timestamp??``).localeCompare(e.timestamp??``):(e.timestamp??``).localeCompare(t.timestamp??``));return{items:a.slice(0,n),next_page_id:a.length>n?`next-page`:null}}async function ze(e,t){let n=Fe.get(e);return n?(t.has(`timestamp__lt`)&&await p(Me),Re(n,t)):null}function Be(){let t=new Date(H-8640*60*1e3).toISOString();return{id:U,created_by_user_id:null,selected_repository:null,selected_branch:null,git_provider:null,title:`Cloud pagination fixture`,trigger:null,pr_number:[],llm_model:`openhands/claude-haiku-4-5-20251001`,metrics:null,created_at:t,updated_at:t,execution_status:e.IDLE,conversation_url:null,session_api_key:null,sandbox_id:null,workspace:{working_dir:`/workspace/project`},public:!1,sub_conversation_ids:[]}}var Ve=Be();function G(e){return{id:e.id,title:e.title??null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??`idle`,sandbox_status:e.sandbox_status??null,metrics:e.metrics??null,agent:e.agent??null,workspace:e.workspace??null}}function He(e){return!e||e.length===0?Array.from(W.values()).map(G):e.map(e=>{let t=W.get(e);return t?G(t):null})}var Ue=[u.get(`*/api/conversations/search`,async({request:e})=>{let t=new URL(e.url),n=Number(t.searchParams.get(`limit`)??`20`),r=Array.from(W.values()).sort((e,t)=>t.updated_at.localeCompare(e.updated_at)).slice(0,n).map(G);return f.json({items:r,next_page_id:null})}),u.get(`*/api/conversations`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.getAll(`ids[]`).length>0?t.searchParams.getAll(`ids[]`):t.searchParams.getAll(`ids`);return f.json(He(n))}),u.get(`*/api/conversations/:conversationId`,async({params:e})=>{let t=e.conversationId,n=W.get(t);return n?f.json(G(n)):f.json(null,{status:404})}),u.post(`*/api/conversations`,async()=>{await p();let e={id:`${Math.floor(Math.random()*1e5)}`,title:`New Conversation`,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),execution_status:`idle`};return W.set(e.id,e),f.json(G(e),{status:201})}),u.patch(`/api/conversations/:conversationId`,async({params:e,request:t})=>{let n=e.conversationId,r=W.get(n);if(r){let e=await t.json();if(e?.title)return W.set(n,{...r,title:e.title,updated_at:new Date().toISOString()}),f.json(null,{status:200})}return f.json(null,{status:404})}),u.delete(`*/api/conversations/:conversationId`,async({params:e})=>{let t=e.conversationId;return W.has(t)?(W.delete(t),f.json(null,{status:200})):f.json(null,{status:404})}),u.get(`*/api/conversations/:conversationId/events/count`,async()=>f.json(0)),u.get(`*/api/conversations/:conversationId/events/search`,async({params:e,request:t})=>{let n=e.conversationId,r=new URL(t.url).searchParams,i=await ze(n,r);if(i)return f.json(i);let a=ke[n];return a?f.json(Re(a,r)):f.json({items:[],next_page_id:null})}),u.post(`*/api/conversations/:conversationId/events`,async()=>f.json({ok:!0})),u.get(`*/api/conversations/:conversationId/workspace/*`,({params:e,request:t})=>{let n=e.conversationId?.toString(),r=new URL(t.url);return n===`canvas-demo`&&r.pathname.endsWith(`/canvas.md`)?f.text(R,{headers:{"Content-Type":`text/markdown; charset=utf-8`}}):d()}),u.post(`*/api/conversations/:conversationId/pause`,async()=>f.json({success:!0})),u.post(`*/api/conversations/:conversationId/interrupt`,async()=>f.json({success:!0})),u.post(`*/api/conversations/:conversationId/run`,async()=>f.json({success:!0})),u.post(`*/api/cloud-proxy`,async({request:e})=>{let t=(await e.json()).path??`/`,n=new URL(t,`https://mock-cloud.test`);if(n.pathname===`/api/v1/app-conversations`){let e=n.searchParams.getAll(`ids`);if(e.length>0)return f.json(e.map(e=>e===U?Ve:null))}if(n.pathname===`/api/v1/app-conversations/search`)return f.json({items:[Ve],next_page_id:null});if(n.pathname===`/api/v1/conversation/${U}/events/search`){let e=await ze(U,n.searchParams);return f.json(e)}return n.pathname===`/api/v1/settings`?f.json({llm_model:`openhands/claude-haiku-4-5-20251001`,llm_base_url:``,llm_api_key:null,llm_api_key_set:!1,search_api_key_set:!1,agent:`CodeActAgent`,language:`en`,user_consents_to_analytics:!1,provider_tokens_set:{github:``}}):n.pathname===`/api/keys/current`?f.json({id:`mock-key`,name:`Mock key`,org_id:`org-1`,user_id:`user-1`,auth_type:`api_key`}):n.pathname===`/api/organizations`?f.json({items:[{id:`org-1`,name:`Mock Org`,is_personal:!0}],current_org_id:`org-1`}):n.pathname===`/api/organizations/org-1/me`?f.json({org_id:`org-1`,user_id:`org-1`}):n.pathname===`/api/authenticate`?f.json({ok:!0}):f.json({})}),u.post(`*/api/conversations/:conversationId/ask_agent`,async()=>f.json({response:`Mock agent response`})),u.get(`*/api/vscode/url`,async()=>f.json({url:null})),u.post(`*/api/skills`,async()=>f.json({skills:[]})),u.post(`/api/v1/conversations/:conversationId/pending-messages`,async()=>f.json({id:`mock-pending-id`,position:0})),u.get(`*/api/conversations/:conversationId/microagents`,async()=>f.json({microagents:[{name:`init`,type:`agentskills`,content:`Initialize an AGENTS.md file for the repository`,triggers:[`/init`]},{name:`releasenotes`,type:`agentskills`,content:`Generate a changelog from the most recent release`,triggers:[`/releasenotes`]},{name:`test-runner`,type:`agentskills`,content:`Run the test suite and report results`,triggers:[`/test`]},{name:`code-search`,type:`knowledge`,content:`Search the codebase semantically`,triggers:[`/search`]},{name:`docker`,type:`agentskills`,content:`Docker usage guide for container environments`,triggers:[`docker`,`container`]},{name:`github`,type:`agentskills`,content:`GitHub API interaction guide`,triggers:[`github`,`git`]},{name:`work_hosts`,type:`repo`,content:`Available hosts for web applications`,triggers:[]}]}))],We=[u.post(`*/api/cloud-proxy`,()=>f.json({error:`cloud proxy not available in mock mode`},{status:503})),u.get(`*/api/user/info`,()=>f.json({id:`1`,login:`octocat`,avatar_url:`https://avatars.githubusercontent.com/u/583231?v=4`,company:`GitHub`,email:`placeholder@placeholder.placeholder`,name:`monalisa octocat`})),u.post(`*/api/authenticate`,async()=>f.json({message:`Authenticated`})),u.post(`*/api/logout`,()=>f.json(null,{status:200}))],Ge=[u.post(`*/api/submit-feedback`,async()=>(await p(1200),f.json({statusCode:200,body:{message:`Success`,link:`fake-url.com`,password:`abc123`}}))),u.post(`*/api/submit-feedback`,async()=>f.json({statusCode:200},{status:200}))],Ke=[u.post(`https://us.i.posthog.com/e`,async()=>f.json(null,{status:200})),u.post(`https://z.openhands.dev/*`,async()=>f.json(null,{status:200}))],K=new Date().toISOString(),q=e=>new Date(Date.now()-e*864e5).toISOString(),qe={automations:[{id:`a1000000-0000-0000-0000-000000000001`,name:`PR Triage Digest`,trigger:{type:`cron`,schedule:`0 9 * * 1-5`,schedule_human:`Weekdays at 09:00`},enabled:!0,repository:`acme/frontend-app`,model:`triage-fast`,timeout:600,created_at:q(90),updated_at:K,prompt:`Review newly opened pull requests in acme/frontend-app, identify risky changes, summarize likely impact, and prepare a concise digest with priority ordering for the engineering review channel.`,branch:`main`,plugins:[`GitHub`,`Slack`,`Linear`],notification:`Slack digest to #eng-reviews`,timezone:`America/Los_Angeles`,last_triggered_at:q(0)},{id:`a1000000-0000-0000-0000-000000000002`,name:`Nightly Security Pass`,trigger:{type:`cron`,schedule:`30 1 * * *`,schedule_human:`Daily at 01:30`},enabled:!0,repository:`acme/backend-api`,model:`security-careful`,timeout:900,created_at:q(60),updated_at:K,prompt:`Scan the acme/backend-api repository for known security vulnerabilities, outdated dependencies, and insecure code patterns. Produce a prioritized remediation summary.`,branch:`main`,plugins:[`GitHub`],notification:`Email to security-team@acme.com`,timezone:`UTC`,last_triggered_at:q(0)},{id:`a1000000-0000-0000-0000-000000000003`,name:`Docs Sync on Push`,trigger:{type:`cron`,schedule:`*/5 * * * *`,schedule_human:`Runs on every push`},enabled:!0,repository:`acme/docs`,model:`docs-fast`,created_at:q(45),updated_at:K,prompt:`Monitor acme/docs for new pushes. For each push, generate a changelog-ready summary of what changed and why.`,branch:`main`,plugins:[`GitHub`,`Slack`],notification:`Slack to #docs-updates`,timezone:`America/New_York`,last_triggered_at:q(1)},{id:`a1000000-0000-0000-0000-000000000004`,name:`Release Readiness Review`,trigger:{type:`cron`,schedule:`0 11 * * 5`,schedule_human:`Fridays at 11:00`},enabled:!1,repository:`acme/realtime-service`,model:`release-review`,created_at:q(80),updated_at:K,prompt:`Compile a release readiness report: list open blockers, active incidents, and pending approvals for acme/realtime-service.`,branch:`release`,plugins:[`GitHub`,`Linear`],notification:`Slack to #releases`,timezone:`America/Chicago`,last_triggered_at:q(14)},{id:`a1000000-0000-0000-0000-000000000005`,name:`Incident Webhook Summary`,trigger:{type:`cron`,schedule:`0 */2 * * *`,schedule_human:`On incident webhook`},enabled:!1,repository:`acme/incident-service`,model:`incident-summary`,created_at:q(30),updated_at:K,prompt:`Summarize incoming incident webhooks, categorize by severity, and post a digest to the on-call Slack channel.`,branch:`main`,plugins:[`Slack`],notification:`Slack to #oncall`,timezone:`UTC`,last_triggered_at:null},{id:`a1000000-0000-0000-0000-000000000006`,name:`PR Review on Open`,trigger:{type:`event`,source:`github`,on:`pull_request.opened`,filter:`repository.full_name == 'acme/frontend-app'`},enabled:!0,repository:`acme/frontend-app`,model:`review-fast`,timeout:1800,created_at:q(15),updated_at:K,prompt:`When a new PR is opened, perform a thorough code review focusing on correctness, security, and performance. Post findings as inline comments.`,branch:`main`,plugins:[`GitHub`],notification:`GitHub PR comment`,last_triggered_at:q(0)},{id:`a1000000-0000-0000-0000-000000000007`,name:`Release Notes Generator`,trigger:{type:`event`,source:`github`,on:`release.published`,filter:`glob(release.tag_name, 'v*') && !release.prerelease`},enabled:!0,repository:`acme/backend-api`,model:`docs-fast`,created_at:q(10),updated_at:K,prompt:`Generate comprehensive release notes from the commits since the last release. Include breaking changes, new features, and bug fixes.`,branch:`main`,plugins:[`GitHub`],notification:`GitHub release body update`,last_triggered_at:q(3)}],total:7},Je=(e,t=9)=>{let n=new Date(Date.now()-e*864e5);return n.setHours(t,0,0,0),n.toISOString()};function J(e,t,n,r=9,i=!0){let a=Je(n,r);return{id:e,status:t,conversation_id:i?`conv-${e}`:null,bash_command_id:i?`cmd-${e}`:null,error_detail:t===l.FAILED?`Process exited with code 1`:null,started_at:a,completed_at:new Date(new Date(a).getTime()+12e4).toISOString()}}var Ye={"a1000000-0000-0000-0000-000000000001":[J(`r1-01`,l.COMPLETED,0),J(`r1-02`,l.COMPLETED,1),J(`r1-03`,l.FAILED,2),J(`r1-04`,l.COMPLETED,3),J(`r1-05`,l.COMPLETED,4),J(`r1-06`,l.COMPLETED,7),J(`r1-07`,l.FAILED,8),J(`r1-08`,l.COMPLETED,9),J(`r1-09`,l.COMPLETED,10),J(`r1-10`,l.COMPLETED,11)],"a1000000-0000-0000-0000-000000000002":[J(`r2-01`,l.COMPLETED,0,1),J(`r2-02`,l.COMPLETED,1,1),J(`r2-03`,l.COMPLETED,2,1),J(`r2-04`,l.FAILED,3,1),J(`r2-05`,l.COMPLETED,4,1)],"a1000000-0000-0000-0000-000000000003":[J(`r3-01`,l.COMPLETED,1),J(`r3-02`,l.CANCELLED,2),J(`r3-03`,l.SKIPPED,3,9,!1)],"a1000000-0000-0000-0000-000000000004":[J(`r4-01`,l.FAILED,14,11,!1),J(`r4-02`,l.COMPLETED,21,11)],"a1000000-0000-0000-0000-000000000005":[],"a1000000-0000-0000-0000-000000000006":[J(`r6-01`,l.COMPLETED,0,14),J(`r6-02`,l.COMPLETED,0,11),J(`r6-03`,l.FAILED,1,16),J(`r6-04`,l.COMPLETED,2,10),J(`r6-05`,l.COMPLETED,3,9)],"a1000000-0000-0000-0000-000000000007":[J(`r7-01`,l.COMPLETED,3,15),J(`r7-02`,l.COMPLETED,10,12)]},Y=m.responses.supported.body,Xe=/^(?:\*|\*\/(\d+)) \* \* \* \*$/;function Ze(e){let t=Xe.exec(e.trim());return t?(t[1]?Number(t[1]):1)*60:null}var Qe=Y.eventTypes.filter(e=>e!==`pull_request_review_comment.created`);function $e(e){if(!e)return[];let t=Y.triggers.cron;if(e.type===`cron`&&e.schedule&&t){let n=Ze(e.schedule);if(n!==null&&n<t.minIntervalSeconds)return[{field:`trigger.schedule`,code:`interval_too_short`,message:`Minimum interval for this deployment is ${t.minIntervalSeconds/60} minutes.`}]}return e.type===`event`&&e.on&&!Qe.includes(e.on)?[{field:`trigger.on`,code:`event_type_not_delivered`,message:`No ${e.source===`github`?`GitHub`:e.source} webhook delivering ${e.on} is registered for this organization.`}]:[]}var X=new Map(qe.automations.map(e=>[e.id,{...e}])),et=[u.get(`*/api/automation/health`,async()=>(await p(100),f.json({status:`ok`}))),u.get(`*/api/automation/v1`,async({request:e})=>{await p(300);let t=new URL(e.url),n=Number(t.searchParams.get(`limit`)??`50`),r=Number(t.searchParams.get(`offset`)??`0`),i=Array.from(X.values()),a={automations:i.slice(r,r+n),total:i.length};return f.json(a)}),u.get(`*/api/automation/v1/capabilities`,async()=>(await p(200),f.json(Y))),u.post(`*/api/automation/v1/validate`,async({request:e})=>{await p(200);let t=$e((await e.clone().json()).draft?.trigger),n={valid:t.length===0,errors:t};return f.json(n)}),u.post(`*/api/automation/v1/preset/:kind`,async({params:e,request:t})=>{await p(200);let n=await t.clone().json(),r=new Date().toISOString(),i={id:crypto.randomUUID(),name:n.name,prompt:n.prompt,model:n.model??null,trigger:n.trigger,enabled:!0,created_at:r,updated_at:r,last_triggered_at:null,...n.repos?.[0]&&{repository:n.repos[0].url,branch:n.repos[0].ref},...n.plugins&&{plugins:n.plugins.map(e=>e.source)},...typeof n.timeout==`number`&&{timeout:n.timeout},...typeof n.trigger.timezone==`string`&&{timezone:n.trigger.timezone}};return e.kind!==`prompt`&&e.kind!==`plugin`?f.json({detail:`Unknown preset kind`},{status:404}):(X.set(i.id,i),f.json(i,{status:201}))}),u.get(`*/api/automation/v1/:id/runs`,async({params:e,request:t})=>{await p(200);let n=e.id;if(!X.has(n))return f.json({detail:`Automation not found`},{status:404});let r=new URL(t.url),i=Number(r.searchParams.get(`limit`)??`50`),a=Number(r.searchParams.get(`offset`)??`0`),o=Ye[n]??[],s={runs:o.slice(a,a+i),total:o.length};return f.json(s)}),u.get(`*/api/automation/v1/:id`,async({params:e})=>{await p(200);let t=X.get(e.id);return t?f.json(t):f.json({detail:`Automation not found`},{status:404})}),u.patch(`*/api/automation/v1/:id`,async({params:e,request:t})=>{await p(200);let n=e.id,r=await t.clone().json(),i=X.get(n);if(!i)return f.json({detail:`Automation not found`},{status:404});let a={...i,...r,updated_at:new Date().toISOString()};return X.set(n,a),f.json(a)}),u.post(`*/api/automation/v1/:id/dispatch`,async({params:e})=>{await p(200);let t=e.id;if(!X.get(t))return f.json({detail:`Automation not found`},{status:404});let n={id:crypto.randomUUID(),status:l.PENDING,conversation_id:null,bash_command_id:null,error_detail:null,started_at:new Date().toISOString(),completed_at:null};return f.json(n,{status:201})}),u.delete(`*/api/automation/v1/:id`,async({params:e})=>{await p(200);let t=e.id;return X.has(t)?(X.delete(t),new f(null,{status:204})):f.json({detail:`Automation not found`},{status:404})})],tt={ok:!0,tools:[]},nt=[u.post(`*/api/mcp/test`,async()=>f.json(tt))],Z=[],Q=[];function $(){return{workspaces:Z.map(e=>({...e})),workspaceParents:Q.map(e=>({...e}))}}var rt=[u.get(`*/api/workspaces`,async()=>f.json($())),u.post(`*/api/workspaces`,async({request:e})=>{let t=await e.json();for(let e of t.workspaces??[]){let t=Z.findIndex(t=>t.path===e.path);t>=0?Z[t]={...e}:Z.push({...e})}return f.json($())}),u.delete(`*/api/workspaces`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`),n=Z.length;return Z=Z.filter(e=>e.path!==t),f.json({deleted:Z.length!==n})}),u.post(`*/api/workspaces/parents`,async({request:e})=>{let t=await e.json();for(let e of t.parents??[]){let t=Q.findIndex(t=>t.path===e.path);t>=0?Q[t]={...e}:Q.push({...e})}return f.json($())}),u.delete(`*/api/workspaces/parents`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`),n=Q.length;return Q=Q.filter(e=>e.path!==t),f.json({deleted:Q.length!==n})}),u.post(`*/api/auth/workspace-session`,async()=>f.json({ok:!0})),u.delete(`*/api/auth/workspace-session`,async()=>new f(null,{status:204}))],it=ee(...re,...se,...ce,...de,...xe,...Ue,...We,...Ge,...Ke,...et,...nt,...rt);export{it as worker};
@@ -1 +0,0 @@
1
- import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -1 +0,0 @@
1
- import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./conversation-CPCVsCUY.js";export{e as default};