@openhands/agent-canvas 1.3.0 → 1.5.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 (674) hide show
  1. package/README.md +11 -12
  2. package/README.windows.md +4 -2
  3. package/build/assets/{Trans-DY6toRDu.js → Trans-DqF_OEZB.js} +1 -1
  4. package/build/assets/{acp-providers-Djl6vNn-.js → acp-providers-BQwoUBpe.js} +1 -1
  5. package/build/assets/active-backend-context-BCXRv5pm.js +1 -0
  6. package/build/assets/{add-backend-modal-DljoP9lc.js → add-backend-modal-BKHzq5no.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-BJMmTZgv.js → agent-profiles-settings-CEp5CIz8.js} +1 -1
  8. package/build/assets/agent-server-compatibility-D6DSanlx.js +1 -0
  9. package/build/assets/agent-server-conversation-service.api-cylugfDz.js +41 -0
  10. package/build/assets/{agent-settings-lUknCeaF.js → agent-settings-C-tann3x.js} +2 -2
  11. package/build/assets/agent-settings-DGUKNSnU.js +1 -0
  12. package/build/assets/{alert-banner-Bpf2NQJq.js → alert-banner-Dd4woGbm.js} +1 -1
  13. package/build/assets/api-key-entry-screen-Bll_CkuQ.js +1 -0
  14. package/build/assets/app-settings-BpViWwpC.js +1 -0
  15. package/build/assets/automation-detail-Z9dN2f5l.js +2 -0
  16. package/build/assets/automation-export-D5uL0Tf8.js +2 -0
  17. package/build/assets/automations-list-BMOWcqzZ.js +1 -0
  18. package/build/assets/{back-nav-button-CUS2mi-U.js → back-nav-button-ZUDTMOTB.js} +1 -1
  19. package/build/assets/backend-form-modal-DhBT8P4g.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-CanzmG12.js → backend-synced-settings-badge-Db_REKVw.js} +1 -1
  21. package/build/assets/{base-modal-BuF2f0YL.js → base-modal-Cb0C6m0Q.js} +1 -1
  22. package/build/assets/{bot-D7eUAuSB.js → bot-C-EA6685.js} +1 -1
  23. package/build/assets/{brand-button-vMVuyDXu.js → brand-button-2Tp3aXk1.js} +1 -1
  24. package/build/assets/{browser-BifzWIBd.js → browser-QYLVr1kS.js} +2 -2
  25. package/build/assets/browser-store-BGXOGo-R.js +1 -0
  26. package/build/assets/{browser-tab-CkkqJnqw.js → browser-tab-BTTP1OE2.js} +1 -1
  27. package/build/assets/canvas-ui-BhxjoA1f.js +1 -0
  28. package/build/assets/{chat-send-button-B_jc5z5C.js → chat-send-button-BZHG2hAW.js} +1 -1
  29. package/build/assets/check-TbOEtHKj.js +1 -0
  30. package/build/assets/{chevron-down-CI8A6tet.js → chevron-down-D7IvFMBM.js} +1 -1
  31. package/build/assets/{circle-plus-check-toggle-C5YxjxvI.js → circle-plus-check-toggle-QQJKUnF6.js} +1 -1
  32. package/build/assets/client-source-Biqarhgr.js +1 -0
  33. package/build/assets/cloud-funnel-analytics-D-27T5Ao.js +1 -0
  34. package/build/assets/{combobox-caret-DoObzqf4.js → combobox-caret-A5jMVHgE.js} +1 -1
  35. package/build/assets/{command-menu-D-JV3Wqm.js → command-menu-BMVEme4H.js} +1 -1
  36. package/build/assets/{command-store-D8J5LMW1.js → command-store-jrWX_CcW.js} +1 -1
  37. package/build/assets/condenser-settings-CIa6eyB4.js +1 -0
  38. package/build/assets/{confirmation-modal-BGLu6XJN.js → confirmation-modal-4n_944zq.js} +1 -1
  39. package/build/assets/{context-menu-list-item-BD5_EaKN.js → context-menu-list-item-DvfFic5I.js} +1 -1
  40. package/build/assets/conversation-CHnEXGRM.js +1 -0
  41. package/build/assets/conversation-D4o4dG2t.js +89 -0
  42. package/build/assets/conversation-panel-11FjLCId.js +1 -0
  43. package/build/assets/conversation-service.api-0JG_fF9d.js +1 -0
  44. package/build/assets/conversation-state-store-JiUQp02U.js +1 -0
  45. package/build/assets/{conversation-store-LptbOvKa.js → conversation-store-BCSpLuEf.js} +1 -1
  46. package/build/assets/{conversation-tab-empty-state-B2dDYEwf.js → conversation-tab-empty-state-BUhKVwoi.js} +1 -1
  47. package/build/assets/{copy-3JCw_XFB.js → copy-D1YGjP-C.js} +1 -1
  48. package/build/assets/{copy-to-clipboard-button-CaR52OnA.js → copy-to-clipboard-button-Dp4Q_hXi.js} +1 -1
  49. package/build/assets/declaration-BGsHjPEW.js +1 -0
  50. package/build/assets/{device-verify-BsznkV-a.js → device-verify-CM086oKs.js} +1 -1
  51. package/build/assets/{dropdown-classes-DJSXeLqc.js → dropdown-classes-DZq0BQjb.js} +1 -1
  52. package/build/assets/{ellipsis-button-C5Z-tPFp.js → ellipsis-button-TPJdyxnK.js} +1 -1
  53. package/build/assets/{entry.client-JixNvFrr.js → entry.client-DypYHsYm.js} +2 -2
  54. package/build/assets/{enum-filter-dropdown-DXbVwiNZ.js → enum-filter-dropdown-CW_mBg0e.js} +1 -1
  55. package/build/assets/{environment-switch-overlay-DZQfRGTx.js → environment-switch-overlay-6laJch-9.js} +1 -1
  56. package/build/assets/{extensions-hub-DfvgqzTc.js → extensions-hub-BJFbFfKS.js} +1 -1
  57. package/build/assets/{extensions-navigation-D9i0DL62.js → extensions-navigation-DqSl7CJw.js} +1 -1
  58. package/build/assets/{external-link-D2zJjE9G.js → external-link-lhdITPqq.js} +1 -1
  59. package/build/assets/files-tab-c316dKAq.js +1 -0
  60. package/build/assets/{files-tab-store-DJsPxYdg.js → files-tab-store-tfCav6bB.js} +1 -1
  61. package/build/assets/{form-control-classes-ChpNBe9n.js → form-control-classes-CvUaw8_L.js} +1 -1
  62. package/build/assets/format-time-delta-DhDbkD7V.js +1 -0
  63. package/build/assets/git-provider-icon-DUb2pEos.js +1 -0
  64. package/build/assets/home-BQ-DC06B.js +1 -0
  65. package/build/assets/home-D7ds4Jyw.js +1 -0
  66. package/build/assets/index-home-BRFDWs_4.js +1 -0
  67. package/build/assets/install-server-modal-CvHvzZj3.js +1 -0
  68. package/build/assets/{launch-BgIlZLSX.js → launch-A47TK2Me.js} +1 -1
  69. package/build/assets/lesson-plan-DSf95kQ2.js +4 -0
  70. package/build/assets/{list-todo-BfH6yYUK.js → list-todo-CAtvkzcy.js} +1 -1
  71. package/build/assets/llm-not-configured-banner-B7DR8SPs.js +27 -0
  72. package/build/assets/llm-settings-Ch4ZbW3c.js +1 -0
  73. package/build/assets/llm-settings-Cvi7q4ox.js +1 -0
  74. package/build/assets/llm-subscription-service-Cz1yBBvE.js +1 -0
  75. package/build/assets/loader-circle-CsAsfLIs.js +1 -0
  76. package/build/assets/{loading-spinner-BLdswi6q.js → loading-spinner-Txxx1I1p.js} +1 -1
  77. package/build/assets/manage-backends-modal-DAVhNUCe.js +1 -0
  78. package/build/assets/manifest-958c741a.js +1 -0
  79. package/build/assets/{markdown-renderer-DMT7Zkpd.js → markdown-renderer-B6cJJ_MN.js} +1 -1
  80. package/build/assets/{mcp-CHkklDMv.js → mcp-BwssgMpg.js} +2 -2
  81. package/build/assets/{messages-B3RugH7P.js → messages-D8MeG2ZQ.js} +26 -26
  82. package/build/assets/{modal-body-DouOE5KH.js → modal-body-CDZdZ-eT.js} +1 -1
  83. package/build/assets/{modal-classes-Cf-4tbHz.js → modal-classes-B4oit_4c.js} +1 -1
  84. package/build/assets/{modal-close-button-B6CfxxJj.js → modal-close-button-DQElFMPo.js} +1 -1
  85. package/build/assets/model-selector-BxTbbKub.js +1 -0
  86. package/build/assets/{navigation-link-D8hfwvxI.js → navigation-link-imH6S7h2.js} +1 -1
  87. package/build/assets/onboarding-CyicadGt.js +1 -0
  88. package/build/assets/onboarding-modal-DQwihcTz.js +1 -0
  89. package/build/assets/option-service.api-DAkg_F7p.js +1 -0
  90. package/build/assets/organization-service.api-QknzKDh3.js +1 -0
  91. package/build/assets/package-Dk_VtWJ4.js +1 -0
  92. package/build/assets/path-utils-BECGet7G.js +1 -0
  93. package/build/assets/{pencil-Dj2XjKmI.js → pencil-CWhApFIT.js} +1 -1
  94. package/build/assets/{plan-components-CcCBmCzW.js → plan-components-CgPHWz3E.js} +1 -1
  95. package/build/assets/{planner-tab-CCqdXxkL.js → planner-tab-DPKHmMAX.js} +1 -1
  96. package/build/assets/plugins-management-service-DuTTxquo.js +1 -0
  97. package/build/assets/profiles-service.api-D6jvZOWu.js +1 -0
  98. package/build/assets/providers-B8pxQK8x.js +1 -0
  99. package/build/assets/proxy-CuhhyjdX.js +1 -0
  100. package/build/assets/{recommended-automations-launcher-CVEF_1pc.js → recommended-automations-launcher-DA6DWS7V.js} +1 -1
  101. package/build/assets/{refresh-cw-DM82EIyx.js → refresh-cw-B9B7-vsy.js} +1 -1
  102. package/build/assets/root-BhP6bTBB.js +2 -0
  103. package/build/assets/root-CYWeTrWE.css +1 -0
  104. package/build/assets/root-layout-oBaHHW4s.js +2 -0
  105. package/build/assets/{runtime-waiting-state-BsXLElvN.js → runtime-waiting-state-DeD9G7yJ.js} +1 -1
  106. package/build/assets/schema-field-BOLdL_U7.js +1 -0
  107. package/build/assets/sdk-section-page-ZIltERxf.js +1 -0
  108. package/build/assets/{sdk-settings-schema-Cv7M9eSe.js → sdk-settings-schema-Ba_Pa9uf.js} +1 -1
  109. package/build/assets/search-dIQ09UY2.js +1 -0
  110. package/build/assets/secrets-service-50DElFny.js +1 -0
  111. package/build/assets/{secrets-settings-DxTx9HgU.js → secrets-settings-Digl7JLe.js} +1 -1
  112. package/build/assets/{segmented-toggle-DyQqPhoD.js → segmented-toggle-C1-ZVyr5.js} +1 -1
  113. package/build/assets/settings-BfgLHsgd.js +1 -0
  114. package/build/assets/{settings-dropdown-input-BjunGXJb.js → settings-dropdown-input-BD5C9fBn.js} +1 -1
  115. package/build/assets/{settings-index-BjeuYFFa.js → settings-index-CODBijya.js} +1 -1
  116. package/build/assets/{settings-input-bD6npsDm.js → settings-input-CzNOq-Pj.js} +1 -1
  117. package/build/assets/{settings-list-classes-Dp_OgzN0.js → settings-list-classes-CuxH9ZoR.js} +1 -1
  118. package/build/assets/settings-modal-BcSWpKI0.js +1 -0
  119. package/build/assets/settings-service.api-Bsu1PvYO.js +1 -0
  120. package/build/assets/{settings-switch-5cuxl8Dc.js → settings-switch-DqmHAfWJ.js} +1 -1
  121. package/build/assets/{settings-utils-BMdG65By.js → settings-utils-B1lBErvV.js} +1 -1
  122. package/build/assets/shared-conversation-CDskdmrb.js +1 -0
  123. package/build/assets/{sidebar-layout-DuzJMMw-.js → sidebar-layout-Cn6eQaEI.js} +1 -1
  124. package/build/assets/{sidebar-mobile-menu-toggle-CMmAYkh8.js → sidebar-mobile-menu-toggle-DmCmZgq1.js} +1 -1
  125. package/build/assets/{sidebar-nav-link-5AlTT5-j.js → sidebar-nav-link-DMc8AIe7.js} +1 -1
  126. package/build/assets/{sidebar-store-CZuE8AH5.js → sidebar-store-DXWSCFpa.js} +1 -1
  127. package/build/assets/{skill-card-pill-row-eTIkE4nz.js → skill-card-pill-row-DOIWjiMF.js} +1 -1
  128. package/build/assets/skills-plugins-DLgINYuY.js +1 -0
  129. package/build/assets/{skills-settings-BYn4-AQQ.js → skills-settings-DPiCWalR.js} +2 -2
  130. package/build/assets/{square-chevron-right-Czw3FFWc.js → square-chevron-right-DE-JN-2Z.js} +1 -1
  131. package/build/assets/{styled-tooltip-CgX2oRaK.js → styled-tooltip-CvsjHuIf.js} +1 -1
  132. package/build/assets/{suspense-X5dBsJzn.js → suspense-DmZ3MSSh.js} +1 -1
  133. package/build/assets/{task-list-tab-0k9PhuqO.js → task-list-tab-CuhcDycu.js} +1 -1
  134. package/build/assets/telemetry-DHiTRl5_.js +2 -0
  135. package/build/assets/{terminal-BsGcSpRS.js → terminal-CVqF-tCD.js} +1 -1
  136. package/build/assets/{toggle-switch-2j5wwR85.js → toggle-switch-CS0ClOy2.js} +1 -1
  137. package/build/assets/{trash-2-Be_7y3Mn.js → trash-2-BU6BlW4i.js} +1 -1
  138. package/build/assets/{typography-D8mHDeNG.js → typography-CQn9wyEX.js} +1 -1
  139. package/build/assets/use-acp-credential-form-LlfZO_DD.js +1 -0
  140. package/build/assets/{use-activate-agent-profile-WaAZYz4E.js → use-activate-agent-profile-DpQjsXM0.js} +1 -1
  141. package/build/assets/{use-active-agent-profile-CYY3vGar.js → use-active-agent-profile-Gw_uJujV.js} +1 -1
  142. package/build/assets/{use-active-conversation-D-r929nx.js → use-active-conversation-B0sttISF.js} +1 -1
  143. package/build/assets/use-agent-profiles-LHZEK0Gg.js +1 -0
  144. package/build/assets/{use-agent-state-DijdVAQ0.js → use-agent-state-C5uA0bRj.js} +1 -1
  145. package/build/assets/use-backends-health-DKt1SmiU.js +1 -0
  146. package/build/assets/{use-can-manage-org-profiles-BEo0peGn.js → use-can-manage-org-profiles-BAtqsbCi.js} +1 -1
  147. package/build/assets/use-cloud-current-user-id-C8m1oBy4.js +1 -0
  148. package/build/assets/use-config-CXy4vD0H.js +1 -0
  149. package/build/assets/use-create-conversation-CWQGNQ9J.js +1 -0
  150. package/build/assets/{use-create-secret-D5O5qdWC.js → use-create-secret-BIrsX3OB.js} +1 -1
  151. package/build/assets/{use-event-store-DjgU4wfO.js → use-event-store-CsD17BKu.js} +1 -1
  152. package/build/assets/{use-handle-plan-click-Mn_SNTCh.js → use-handle-plan-click-DEuO7Byo.js} +1 -1
  153. package/build/assets/use-is-authed-Dvbpiu3B.js +1 -0
  154. package/build/assets/{use-launch-skill-in-chat-BnoDgvAy.js → use-launch-skill-in-chat-CdHOoQGM.js} +1 -1
  155. package/build/assets/use-llm-profiles-DQpQxVOD.js +1 -0
  156. package/build/assets/use-plugins-marketplace-Bkk07W_M.js +1 -0
  157. package/build/assets/use-runtime-is-ready-D4pkGT6E.js +1 -0
  158. package/build/assets/use-save-agent-profile-BxEsjnW0.js +1 -0
  159. package/build/assets/{use-save-settings-D1HoCDbn.js → use-save-settings-ioSUMqbE.js} +1 -1
  160. package/build/assets/use-settings-DNJC4gqu.js +1 -0
  161. package/build/assets/use-settings-nav-items-BUsrDbVR.js +16 -0
  162. package/build/assets/use-skills-BsmKm23M.js +1 -0
  163. package/build/assets/{use-task-list-AVBLbbcR.js → use-task-list-rs7Xbzl8.js} +1 -1
  164. package/build/assets/{use-tracking-2ZwQwpg_.js → use-tracking-poxQHMwR.js} +1 -1
  165. package/build/assets/{use-user-conversation-OAfenBRG.js → use-user-conversation-B337kUKB.js} +1 -1
  166. package/build/assets/{useMutation-DCE9RcgK.js → useMutation-u8UgRgDK.js} +1 -1
  167. package/build/assets/{useMutationState-BUab8Kxr.js → useMutationState-OnAsCLA_.js} +1 -1
  168. package/build/assets/{useQueries-CRzaAqzH.js → useQueries-BpIlT8Mt.js} +1 -1
  169. package/build/assets/{useQuery-CpjHYtZc.js → useQuery-D5pEZbY0.js} +1 -1
  170. package/build/assets/{useTranslation-CDRCKC9-.js → useTranslation-Cbf5AGg_.js} +1 -1
  171. package/build/assets/{utils-D3U3rlqr.js → utils-DB9LsAzA.js} +1 -1
  172. package/build/assets/{vendor~browser-Cvg7jXCP.js → vendor~browser-5Njjw1Cl.js} +1 -1
  173. package/build/assets/{vendor~browser-tab-Di0kh5Zw.js → vendor~browser-tab-Xn94EtUo.js} +1 -1
  174. package/build/assets/{vendor~entry.client-9tWQ_Ugw.js → vendor~entry.client-DDuH4--y.js} +1 -1
  175. package/build/assets/{vendor~entry.client-D6BtSOtn.js → vendor~entry.client-DQGrNspu.js} +1 -1
  176. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-BIieS_OD.js +2 -0
  177. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js +185 -0
  178. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~nn5zty47-Zl0G1QCy.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ljq5gbus-B2XD4bi2.js} +1 -1
  179. package/build/assets/{vendor~files-tab-B02k3xvx.js → vendor~files-tab-CiC3-lGh.js} +1 -1
  180. package/build/assets/{vendor~home~conversation-panel~conversation-CYMF9JYB.js → vendor~index-home~home~conversation-panel~conversation-ChmYLVgz.js} +1 -1
  181. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9UMeuPV6.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B8XNNEQZ.js} +1 -1
  182. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CnJRLn5s.js} +1 -1
  183. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DWteoTyr.js +2 -0
  184. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D7EUmQ8Y.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dc5nKwLO.js} +1 -1
  185. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD0GaRGa.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-tlf6AnDe.js} +1 -1
  186. package/build/assets/{vendor~launch-CHXA9cJu.js → vendor~launch-28DK5Rsl.js} +1 -1
  187. package/build/assets/{vendor~root-layout~conversation-panel~conversation-CpiTHpHl.js → vendor~root-layout~conversation-panel~conversation-8tIsyrPj.js} +1 -1
  188. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-lYNG9C1U.js} +1 -1
  189. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-Cn2jwSga.js → vendor~root-layout~index-home~home~conversation-panel~conversation-Zhq6xAxR.js} +1 -1
  190. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CZM4hwUT.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-B81b08bw.js} +1 -1
  191. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~enjl5xdm-mMKDm94D.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-jpyLM1Nn.js} +2 -2
  192. package/build/assets/{verification-settings-DnXS6VWv.js → verification-settings-HRgEM-_3.js} +1 -1
  193. package/build/assets/x-ZE4iplpF.js +1 -0
  194. package/build/index.html +4 -4
  195. package/build/locales/ar/openhands.json +9 -0
  196. package/build/locales/ca/openhands.json +9 -0
  197. package/build/locales/de/openhands.json +9 -0
  198. package/build/locales/en/openhands.json +10 -1
  199. package/build/locales/es/openhands.json +9 -0
  200. package/build/locales/fr/openhands.json +9 -0
  201. package/build/locales/it/openhands.json +9 -0
  202. package/build/locales/ja/openhands.json +9 -0
  203. package/build/locales/ko-KR/openhands.json +9 -0
  204. package/build/locales/no/openhands.json +9 -0
  205. package/build/locales/pt/openhands.json +9 -0
  206. package/build/locales/tr/openhands.json +9 -0
  207. package/build/locales/uk/openhands.json +9 -0
  208. package/build/locales/zh-CN/openhands.json +9 -0
  209. package/build/locales/zh-TW/openhands.json +9 -0
  210. package/config/defaults.json +5 -4
  211. package/dist/api/agent-server-adapter.cjs +3 -3
  212. package/dist/api/agent-server-adapter.cjs.map +1 -1
  213. package/dist/api/agent-server-adapter.d.ts +9 -1
  214. package/dist/api/agent-server-adapter.js +105 -102
  215. package/dist/api/agent-server-adapter.js.map +1 -1
  216. package/dist/api/agent-server-config.cjs +1 -1
  217. package/dist/api/agent-server-config.cjs.map +1 -1
  218. package/dist/api/agent-server-config.d.ts +3 -0
  219. package/dist/api/agent-server-config.js +45 -23
  220. package/dist/api/agent-server-config.js.map +1 -1
  221. package/dist/api/backend-registry/auth.cjs +1 -1
  222. package/dist/api/backend-registry/auth.cjs.map +1 -1
  223. package/dist/api/backend-registry/auth.js +1 -1
  224. package/dist/api/backend-registry/auth.js.map +1 -1
  225. package/dist/api/backend-registry/default-backend.cjs +1 -1
  226. package/dist/api/backend-registry/default-backend.cjs.map +1 -1
  227. package/dist/api/backend-registry/default-backend.d.ts +3 -0
  228. package/dist/api/backend-registry/default-backend.js +22 -10
  229. package/dist/api/backend-registry/default-backend.js.map +1 -1
  230. package/dist/api/backend-registry/storage.cjs +1 -1
  231. package/dist/api/backend-registry/storage.cjs.map +1 -1
  232. package/dist/api/backend-registry/storage.js +38 -33
  233. package/dist/api/backend-registry/storage.js.map +1 -1
  234. package/dist/api/backend-registry/types.d.ts +2 -0
  235. package/dist/api/canvas-ui-client-tool.cjs +38 -0
  236. package/dist/api/canvas-ui-client-tool.cjs.map +1 -0
  237. package/dist/api/canvas-ui-client-tool.d.ts +14 -0
  238. package/dist/api/canvas-ui-client-tool.js +47 -0
  239. package/dist/api/canvas-ui-client-tool.js.map +1 -0
  240. package/dist/api/client-source.cjs +2 -0
  241. package/dist/api/client-source.cjs.map +1 -0
  242. package/dist/api/client-source.d.ts +9 -0
  243. package/dist/api/client-source.js +10 -0
  244. package/dist/api/client-source.js.map +1 -0
  245. package/dist/api/cloud/client.cjs +2 -0
  246. package/dist/api/cloud/client.cjs.map +1 -0
  247. package/dist/api/cloud/client.d.ts +4 -0
  248. package/dist/api/cloud/client.js +38 -0
  249. package/dist/api/cloud/client.js.map +1 -0
  250. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  251. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  252. package/dist/api/cloud/conversation-service.api.js +33 -31
  253. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  254. package/dist/api/cloud/organization-service.api.cjs +1 -1
  255. package/dist/api/cloud/organization-service.api.cjs.map +1 -1
  256. package/dist/api/cloud/organization-service.api.js +11 -10
  257. package/dist/api/cloud/organization-service.api.js.map +1 -1
  258. package/dist/api/cloud/proxy.cjs +1 -1
  259. package/dist/api/cloud/proxy.cjs.map +1 -1
  260. package/dist/api/cloud/proxy.d.ts +2 -40
  261. package/dist/api/cloud/proxy.js +14 -39
  262. package/dist/api/cloud/proxy.js.map +1 -1
  263. package/dist/api/conversation-metadata-store.cjs +1 -1
  264. package/dist/api/conversation-metadata-store.cjs.map +1 -1
  265. package/dist/api/conversation-metadata-store.d.ts +2 -9
  266. package/dist/api/conversation-metadata-store.js +13 -9
  267. package/dist/api/conversation-metadata-store.js.map +1 -1
  268. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  269. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  270. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +2 -1
  271. package/dist/api/conversation-service/agent-server-conversation-service.api.js +98 -88
  272. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  273. package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +5 -0
  274. package/dist/api/device-flow-client.cjs +1 -1
  275. package/dist/api/device-flow-client.cjs.map +1 -1
  276. package/dist/api/device-flow-client.d.ts +4 -58
  277. package/dist/api/device-flow-client.js +8 -98
  278. package/dist/api/device-flow-client.js.map +1 -1
  279. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  280. package/dist/api/git-service/agent-server-git-service.api.cjs.map +1 -1
  281. package/dist/api/git-service/agent-server-git-service.api.d.ts +10 -2
  282. package/dist/api/git-service/agent-server-git-service.api.js +107 -40
  283. package/dist/api/git-service/agent-server-git-service.api.js.map +1 -1
  284. package/dist/api/open-hands.types.d.ts +11 -0
  285. package/dist/api/secrets-service.cjs +1 -1
  286. package/dist/api/secrets-service.cjs.map +1 -1
  287. package/dist/api/secrets-service.js +15 -14
  288. package/dist/api/secrets-service.js.map +1 -1
  289. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  290. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  291. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +73 -64
  292. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  293. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.cjs +2 -2
  294. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.cjs.map +1 -1
  295. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.js +2 -0
  296. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.js.map +1 -1
  297. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  298. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  299. package/dist/components/features/backends/backend-form-modal.d.ts +7 -3
  300. package/dist/components/features/backends/backend-form-modal.js +216 -201
  301. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  302. package/dist/components/features/backends/backend-row.cjs +1 -1
  303. package/dist/components/features/backends/backend-row.cjs.map +1 -1
  304. package/dist/components/features/backends/backend-row.js +2 -1
  305. package/dist/components/features/backends/backend-row.js.map +1 -1
  306. package/dist/components/features/backends/backend-selector.cjs +1 -1
  307. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  308. package/dist/components/features/backends/backend-selector.js +51 -51
  309. package/dist/components/features/backends/backend-selector.js.map +1 -1
  310. package/dist/components/features/backends/device-flow-auth.cjs +1 -1
  311. package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
  312. package/dist/components/features/backends/device-flow-auth.d.ts +4 -1
  313. package/dist/components/features/backends/device-flow-auth.js +38 -38
  314. package/dist/components/features/backends/device-flow-auth.js.map +1 -1
  315. package/dist/components/features/chat/chat-interface.cjs +2 -2
  316. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  317. package/dist/components/features/chat/chat-interface.js +173 -165
  318. package/dist/components/features/chat/chat-interface.js.map +1 -1
  319. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  320. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  321. package/dist/components/features/chat/components/chat-input-actions.d.ts +2 -1
  322. package/dist/components/features/chat/components/chat-input-actions.js +44 -43
  323. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  324. package/dist/components/features/chat/components/chat-input-container.cjs +1 -1
  325. package/dist/components/features/chat/components/chat-input-container.cjs.map +1 -1
  326. package/dist/components/features/chat/components/chat-input-container.d.ts +2 -1
  327. package/dist/components/features/chat/components/chat-input-container.js +20 -19
  328. package/dist/components/features/chat/components/chat-input-container.js.map +1 -1
  329. package/dist/components/features/chat/components/chat-input-profile-picker.cjs +1 -1
  330. package/dist/components/features/chat/components/chat-input-profile-picker.cjs.map +1 -1
  331. package/dist/components/features/chat/components/chat-input-profile-picker.js +44 -32
  332. package/dist/components/features/chat/components/chat-input-profile-picker.js.map +1 -1
  333. package/dist/components/features/chat/components/resolve-picker-kind.cjs +1 -1
  334. package/dist/components/features/chat/components/resolve-picker-kind.cjs.map +1 -1
  335. package/dist/components/features/chat/components/resolve-picker-kind.d.ts +10 -22
  336. package/dist/components/features/chat/components/resolve-picker-kind.js +6 -3
  337. package/dist/components/features/chat/components/resolve-picker-kind.js.map +1 -1
  338. package/dist/components/features/chat/custom-chat-input.cjs +1 -1
  339. package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
  340. package/dist/components/features/chat/custom-chat-input.d.ts +2 -1
  341. package/dist/components/features/chat/custom-chat-input.js +52 -51
  342. package/dist/components/features/chat/custom-chat-input.js.map +1 -1
  343. package/dist/components/features/chat/interactive-chat-box.cjs +1 -1
  344. package/dist/components/features/chat/interactive-chat-box.cjs.map +1 -1
  345. package/dist/components/features/chat/interactive-chat-box.d.ts +2 -1
  346. package/dist/components/features/chat/interactive-chat-box.js +9 -8
  347. package/dist/components/features/chat/interactive-chat-box.js.map +1 -1
  348. package/dist/components/features/diff-viewer/commit-list.cjs +2 -0
  349. package/dist/components/features/diff-viewer/commit-list.cjs.map +1 -0
  350. package/dist/components/features/diff-viewer/commit-list.d.ts +13 -0
  351. package/dist/components/features/diff-viewer/commit-list.js +27 -0
  352. package/dist/components/features/diff-viewer/commit-list.js.map +1 -0
  353. package/dist/components/features/diff-viewer/commit-row.cjs +2 -0
  354. package/dist/components/features/diff-viewer/commit-row.cjs.map +1 -0
  355. package/dist/components/features/diff-viewer/commit-row.d.ts +14 -0
  356. package/dist/components/features/diff-viewer/commit-row.js +59 -0
  357. package/dist/components/features/diff-viewer/commit-row.js.map +1 -0
  358. package/dist/components/features/diff-viewer/file-diff-viewer.cjs +1 -1
  359. package/dist/components/features/diff-viewer/file-diff-viewer.cjs.map +1 -1
  360. package/dist/components/features/diff-viewer/file-diff-viewer.d.ts +7 -1
  361. package/dist/components/features/diff-viewer/file-diff-viewer.js +40 -39
  362. package/dist/components/features/diff-viewer/file-diff-viewer.js.map +1 -1
  363. package/dist/components/features/plugins/plugin-detail-modal.d.ts +2 -1
  364. package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
  365. package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
  366. package/dist/components/shared/modals/settings/settings-modal.js +23 -22
  367. package/dist/components/shared/modals/settings/settings-modal.js.map +1 -1
  368. package/dist/config/defaults.cjs +1 -1
  369. package/dist/config/defaults.cjs.map +1 -1
  370. package/dist/config/defaults.js +5 -4
  371. package/dist/config/defaults.js.map +1 -1
  372. package/dist/constants/acp-providers.cjs.map +1 -1
  373. package/dist/constants/acp-providers.d.ts +1 -1
  374. package/dist/constants/acp-providers.js.map +1 -1
  375. package/dist/constants/canvas-ui.cjs +2 -0
  376. package/dist/constants/canvas-ui.cjs.map +1 -0
  377. package/dist/constants/canvas-ui.d.ts +8 -0
  378. package/dist/constants/canvas-ui.js +6 -0
  379. package/dist/constants/canvas-ui.js.map +1 -0
  380. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  381. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  382. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  383. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  384. package/dist/hooks/mutation/use-create-conversation.d.ts +2 -1
  385. package/dist/hooks/mutation/use-create-conversation.js +52 -52
  386. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  387. package/dist/hooks/query/query-keys.cjs +1 -1
  388. package/dist/hooks/query/query-keys.cjs.map +1 -1
  389. package/dist/hooks/query/query-keys.d.ts +2 -0
  390. package/dist/hooks/query/query-keys.js +4 -1
  391. package/dist/hooks/query/query-keys.js.map +1 -1
  392. package/dist/hooks/query/use-backends-health.cjs +1 -1
  393. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  394. package/dist/hooks/query/use-backends-health.js +50 -48
  395. package/dist/hooks/query/use-backends-health.js.map +1 -1
  396. package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
  397. package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
  398. package/dist/hooks/query/use-cloud-organizations.d.ts +1 -0
  399. package/dist/hooks/query/use-cloud-organizations.js +5 -2
  400. package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
  401. package/dist/hooks/query/use-commit-changes.cjs +2 -0
  402. package/dist/hooks/query/use-commit-changes.cjs.map +1 -0
  403. package/dist/hooks/query/use-commit-changes.d.ts +5 -0
  404. package/dist/hooks/query/use-commit-changes.js +34 -0
  405. package/dist/hooks/query/use-commit-changes.js.map +1 -0
  406. package/dist/hooks/query/use-task-polling.cjs +1 -1
  407. package/dist/hooks/query/use-task-polling.cjs.map +1 -1
  408. package/dist/hooks/query/use-task-polling.d.ts +3 -2
  409. package/dist/hooks/query/use-task-polling.js +53 -40
  410. package/dist/hooks/query/use-task-polling.js.map +1 -1
  411. package/dist/hooks/query/use-unified-git-commits.cjs +2 -0
  412. package/dist/hooks/query/use-unified-git-commits.cjs.map +1 -0
  413. package/dist/hooks/query/use-unified-git-commits.d.ts +10 -0
  414. package/dist/hooks/query/use-unified-git-commits.js +41 -0
  415. package/dist/hooks/query/use-unified-git-commits.js.map +1 -0
  416. package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
  417. package/dist/hooks/query/use-unified-git-diff.cjs.map +1 -1
  418. package/dist/hooks/query/use-unified-git-diff.d.ts +5 -0
  419. package/dist/hooks/query/use-unified-git-diff.js +11 -4
  420. package/dist/hooks/query/use-unified-git-diff.js.map +1 -1
  421. package/dist/hooks/use-acp-model-context.cjs +1 -1
  422. package/dist/hooks/use-acp-model-context.cjs.map +1 -1
  423. package/dist/hooks/use-acp-model-context.d.ts +4 -1
  424. package/dist/hooks/use-acp-model-context.js +9 -8
  425. package/dist/hooks/use-acp-model-context.js.map +1 -1
  426. package/dist/hooks/use-auto-refresh-files-on-edit.cjs +1 -1
  427. package/dist/hooks/use-auto-refresh-files-on-edit.cjs.map +1 -1
  428. package/dist/hooks/use-auto-refresh-files-on-edit.js +1 -1
  429. package/dist/hooks/use-auto-refresh-files-on-edit.js.map +1 -1
  430. package/dist/hooks/use-chat-input-model-state.cjs.map +1 -1
  431. package/dist/hooks/use-chat-input-model-state.d.ts +2 -1
  432. package/dist/hooks/use-chat-input-model-state.js.map +1 -1
  433. package/dist/hooks/use-chat-input-profile-state.cjs +1 -1
  434. package/dist/hooks/use-chat-input-profile-state.cjs.map +1 -1
  435. package/dist/hooks/use-chat-input-profile-state.d.ts +1 -10
  436. package/dist/hooks/use-chat-input-profile-state.js +42 -15
  437. package/dist/hooks/use-chat-input-profile-state.js.map +1 -1
  438. package/dist/hooks/use-device-flow.cjs +1 -1
  439. package/dist/hooks/use-device-flow.cjs.map +1 -1
  440. package/dist/hooks/use-device-flow.d.ts +4 -1
  441. package/dist/hooks/use-device-flow.js +42 -40
  442. package/dist/hooks/use-device-flow.js.map +1 -1
  443. package/dist/hooks/use-tracking.cjs.map +1 -1
  444. package/dist/hooks/use-tracking.d.ts +2 -1
  445. package/dist/hooks/use-tracking.js.map +1 -1
  446. package/dist/i18n/declaration.cjs +1 -1
  447. package/dist/i18n/declaration.cjs.map +1 -1
  448. package/dist/i18n/declaration.d.ts +9 -0
  449. package/dist/i18n/declaration.js +1 -1
  450. package/dist/i18n/declaration.js.map +1 -1
  451. package/dist/i18n/index.cjs +1 -1
  452. package/dist/i18n/index.cjs.map +1 -1
  453. package/dist/i18n/index.js +19 -18
  454. package/dist/i18n/index.js.map +1 -1
  455. package/dist/i18n/translation.cjs +3 -3
  456. package/dist/i18n/translation.cjs.map +1 -1
  457. package/dist/i18n/translation.js +154 -1
  458. package/dist/i18n/translation.js.map +1 -1
  459. package/dist/index.cjs +1 -1
  460. package/dist/index.js +32 -32
  461. package/dist/lib/index.cjs +1 -1
  462. package/dist/lib/index.js +1 -1
  463. package/dist/locales/ar/openhands.json +9 -0
  464. package/dist/locales/ca/openhands.json +9 -0
  465. package/dist/locales/de/openhands.json +9 -0
  466. package/dist/locales/en/openhands.json +10 -1
  467. package/dist/locales/es/openhands.json +9 -0
  468. package/dist/locales/fr/openhands.json +9 -0
  469. package/dist/locales/it/openhands.json +9 -0
  470. package/dist/locales/ja/openhands.json +9 -0
  471. package/dist/locales/ko-KR/openhands.json +9 -0
  472. package/dist/locales/no/openhands.json +9 -0
  473. package/dist/locales/pt/openhands.json +9 -0
  474. package/dist/locales/tr/openhands.json +9 -0
  475. package/dist/locales/uk/openhands.json +9 -0
  476. package/dist/locales/zh-CN/openhands.json +9 -0
  477. package/dist/locales/zh-TW/openhands.json +9 -0
  478. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.cjs +2 -0
  479. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.cjs.map +1 -0
  480. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.js +351 -0
  481. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.js.map +1 -0
  482. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.cjs +2 -0
  483. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.cjs.map +1 -0
  484. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.js +106 -0
  485. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.js.map +1 -0
  486. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +2 -0
  487. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -0
  488. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +69 -0
  489. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -0
  490. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  491. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +3 -0
  492. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  493. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  494. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +18 -2
  495. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  496. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
  497. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js.map +1 -1
  498. package/dist/node_modules/axios/index.cjs +1 -1
  499. package/dist/node_modules/axios/index.js +1 -1
  500. package/dist/package.cjs +1 -1
  501. package/dist/package.cjs.map +1 -1
  502. package/dist/package.js +2 -2
  503. package/dist/package.js.map +1 -1
  504. package/dist/routes/app-settings.cjs +1 -1
  505. package/dist/routes/app-settings.cjs.map +1 -1
  506. package/dist/routes/app-settings.js +67 -66
  507. package/dist/routes/app-settings.js.map +1 -1
  508. package/dist/routes/commits-tab.cjs +2 -0
  509. package/dist/routes/commits-tab.cjs.map +1 -0
  510. package/dist/routes/commits-tab.d.ts +8 -0
  511. package/dist/routes/commits-tab.js +45 -0
  512. package/dist/routes/commits-tab.js.map +1 -0
  513. package/dist/routes/files-tab.cjs +1 -1
  514. package/dist/routes/files-tab.cjs.map +1 -1
  515. package/dist/routes/files-tab.js +148 -127
  516. package/dist/routes/files-tab.js.map +1 -1
  517. package/dist/services/cloud-funnel-analytics.cjs +2 -0
  518. package/dist/services/cloud-funnel-analytics.cjs.map +1 -0
  519. package/dist/services/cloud-funnel-analytics.d.ts +12 -0
  520. package/dist/services/cloud-funnel-analytics.js +53 -0
  521. package/dist/services/cloud-funnel-analytics.js.map +1 -0
  522. package/dist/services/telemetry.cjs +1 -1
  523. package/dist/services/telemetry.cjs.map +1 -1
  524. package/dist/services/telemetry.js +49 -47
  525. package/dist/services/telemetry.js.map +1 -1
  526. package/dist/types/agent-server/core/base/action.d.ts +5 -4
  527. package/dist/types/agent-server/core/base/base.d.ts +3 -2
  528. package/dist/types/agent-server/core/base/observation.d.ts +1 -1
  529. package/dist/types/agent-server/type-guards.cjs +1 -1
  530. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  531. package/dist/types/agent-server/type-guards.d.ts +3 -5
  532. package/dist/types/agent-server/type-guards.js +2 -1
  533. package/dist/types/agent-server/type-guards.js.map +1 -1
  534. package/dist/types/automation.d.ts +5 -0
  535. package/dist/utils/api-error-message.d.ts +11 -0
  536. package/dist/utils/automation-timeout.d.ts +19 -0
  537. package/dist/utils/base-path.cjs +2 -0
  538. package/dist/utils/base-path.cjs.map +1 -0
  539. package/dist/utils/base-path.d.ts +2 -0
  540. package/dist/utils/base-path.js +23 -0
  541. package/dist/utils/base-path.js.map +1 -0
  542. package/package.json +2 -2
  543. package/scripts/check-sdk-version-sync.mjs +6 -6
  544. package/scripts/dev-safe.mjs +7 -8
  545. package/scripts/dev-static.mjs +3 -0
  546. package/scripts/dev-with-automation.mjs +3 -0
  547. package/scripts/docker-build.mjs +4 -0
  548. package/scripts/static-server.mjs +93 -7
  549. package/tools/canvas_ui_tool.py +14 -8
  550. package/build/assets/active-backend-context-B3umL5R-.js +0 -1
  551. package/build/assets/agent-server-client-options-DVLRd9sw.js +0 -1
  552. package/build/assets/agent-server-conversation-service.api-D_ZvtJjG.js +0 -5
  553. package/build/assets/agent-settings-BVVFzBWS.js +0 -1
  554. package/build/assets/api-key-entry-screen-CWEHcPJA.js +0 -1
  555. package/build/assets/app-settings-Dj90qosy.js +0 -1
  556. package/build/assets/automation-detail-CXJU0_gF.js +0 -2
  557. package/build/assets/automation-export-FWY9LPsG.js +0 -2
  558. package/build/assets/automations-list-DDGBkWLC.js +0 -1
  559. package/build/assets/backend-form-modal-DSbrafX2.js +0 -1
  560. package/build/assets/browser-store-BI6uklCG.js +0 -1
  561. package/build/assets/check-Bvi71siz.js +0 -1
  562. package/build/assets/condenser-settings-30cX9SK6.js +0 -1
  563. package/build/assets/conversation-BltULtFA.js +0 -89
  564. package/build/assets/conversation-e0a0_X4S.js +0 -1
  565. package/build/assets/conversation-panel-Cr9_ZGI-.js +0 -1
  566. package/build/assets/conversation-service.api-DQaKzIRj.js +0 -1
  567. package/build/assets/conversation-state-store-B2Bp32XI.js +0 -1
  568. package/build/assets/declaration-gq8V5eTU.js +0 -1
  569. package/build/assets/files-tab-DDtEJcGE.js +0 -1
  570. package/build/assets/git-provider-icon-BjkecAuV.js +0 -1
  571. package/build/assets/home-BCKWpKpf.js +0 -1
  572. package/build/assets/index-redirect-CUUJiNki.js +0 -1
  573. package/build/assets/install-server-modal-BIugLhVB.js +0 -1
  574. package/build/assets/lesson-plan-DgpP80mJ.js +0 -4
  575. package/build/assets/llm-not-configured-banner-BlX8NifC.js +0 -27
  576. package/build/assets/llm-settings-DJmbryaE.js +0 -1
  577. package/build/assets/llm-settings-kU5v0H1Z.js +0 -1
  578. package/build/assets/llm-subscription-service-CKyaV24y.js +0 -1
  579. package/build/assets/loader-circle-BEykUKYG.js +0 -1
  580. package/build/assets/manage-backends-modal-C8FJQIZR.js +0 -1
  581. package/build/assets/manifest-56d40d7c.js +0 -1
  582. package/build/assets/model-selector-BOj1wBlq.js +0 -1
  583. package/build/assets/mouse-pointer-click-PdEQPL6v.js +0 -1
  584. package/build/assets/onboarding-DYhDxmI9.js +0 -1
  585. package/build/assets/onboarding-modal-CP_WxDC9.js +0 -1
  586. package/build/assets/option-service.api-C0tYT4-r.js +0 -1
  587. package/build/assets/organization-service.api-CnynNoT-.js +0 -1
  588. package/build/assets/path-utils-DWcgCGen.js +0 -1
  589. package/build/assets/plugins-management-service-BAp70KN7.js +0 -1
  590. package/build/assets/profiles-service.api-CeYEmSM3.js +0 -1
  591. package/build/assets/providers-BxCuC9bZ.js +0 -1
  592. package/build/assets/proxy-CHmFkV16.js +0 -1
  593. package/build/assets/root-V8fkplMy.css +0 -1
  594. package/build/assets/root-layout-CttG_lQi.js +0 -2
  595. package/build/assets/root-uJ2t9rCQ.js +0 -2
  596. package/build/assets/schema-field-xUr6rDd6.js +0 -1
  597. package/build/assets/sdk-section-page-CbLrVUa3.js +0 -1
  598. package/build/assets/search-4DHskuhE.js +0 -1
  599. package/build/assets/secrets-service-CZYjNxFw.js +0 -1
  600. package/build/assets/settings-DnlfS09K.js +0 -1
  601. package/build/assets/settings-modal-DfTcL-mV.js +0 -1
  602. package/build/assets/settings-service.api-K4ncGlBv.js +0 -1
  603. package/build/assets/shared-conversation-DWtBkJv7.js +0 -1
  604. package/build/assets/skills-plugins-BJ040luO.js +0 -1
  605. package/build/assets/use-acp-credential-form-EtnbtYt0.js +0 -1
  606. package/build/assets/use-agent-profiles-DEAMFp-W.js +0 -1
  607. package/build/assets/use-backends-health-DkC7tKkC.js +0 -1
  608. package/build/assets/use-cloud-current-user-id-Dm99wXp2.js +0 -1
  609. package/build/assets/use-config-CHzNIHpv.js +0 -1
  610. package/build/assets/use-create-conversation-CTsvZ96U.js +0 -1
  611. package/build/assets/use-is-authed-_dhQ2Xuj.js +0 -1
  612. package/build/assets/use-llm-profiles-BMhPDlwQ.js +0 -1
  613. package/build/assets/use-plugins-marketplace-BGb-KgfD.js +0 -1
  614. package/build/assets/use-runtime-is-ready-CC-KrLKe.js +0 -1
  615. package/build/assets/use-save-agent-profile-CLMmbx_X.js +0 -1
  616. package/build/assets/use-settings-BReAMxCG.js +0 -1
  617. package/build/assets/use-settings-nav-items-xe1YgLnE.js +0 -16
  618. package/build/assets/use-skills-Dqo-pDDx.js +0 -1
  619. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~d1e18dtv-5Q6lQJdE.js +0 -177
  620. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js +0 -10
  621. package/build/assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CqXiHwjU.js +0 -2
  622. package/build/assets/x-Cb0WAtak.js +0 -1
  623. /package/build/assets/{__vite-browser-external-4xJsU2-u.js → __vite-browser-external-DU-Cb_sT.js} +0 -0
  624. /package/build/assets/{automation-BU8zu-FP.js → automation-BVEmGghX.js} +0 -0
  625. /package/build/assets/{checkmark-h7udgXMM.js → checkmark-DhcMGwtO.js} +0 -0
  626. /package/build/assets/{close-p3Op5lxI.js → close-DO5Rq_CS.js} +0 -0
  627. /package/build/assets/{code-tag-DYlAhEQY.js → code-tag-BvjtzUsr.js} +0 -0
  628. /package/build/assets/{color-themes-DPBzNtVg.js → color-themes-bVMmJJG6.js} +0 -0
  629. /package/build/assets/{common-Dh7OqABE.js → common-CxbUL3nR.js} +0 -0
  630. /package/build/assets/{conversation-local-storage-F6zVMM--.js → conversation-local-storage-B31voBg7.js} +0 -0
  631. /package/build/assets/{copy-BLmGeJcd.js → copy-DLUw2us-.js} +0 -0
  632. /package/build/assets/{createLucideIcon-CVAsW2Yo.js → createLucideIcon-D4Tak8A1.js} +0 -0
  633. /package/build/assets/{dist-CodhvuAP.js → dist-Dj01FXbZ.js} +0 -0
  634. /package/build/assets/{environment-switch-store-DkjlKWzN.js → environment-switch-store-D9hB9PvY.js} +0 -0
  635. /package/build/assets/{extension-module-card-classes-9V3J9J_b.js → extension-module-card-classes-BlO4w702.js} +0 -0
  636. /package/build/assets/{folder-mMWFvaw0.js → folder-ynxP2EIL.js} +0 -0
  637. /package/build/assets/{get-language-from-path-CPNnuVhI.js → get-language-from-path-rWEQrOGU.js} +0 -0
  638. /package/build/assets/{git-status-mapper-BI8FyUVp.js → git-status-mapper-C3rfzUex.js} +0 -0
  639. /package/build/assets/{handle-capture-consent-CPMXU29K.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
  640. /package/build/assets/{iconBase-DaTRRUjy.js → iconBase-CuvxAQZ5.js} +0 -0
  641. /package/build/assets/{link-external-DfKQroKX.js → link-external-BVDiJfZt.js} +0 -0
  642. /package/build/assets/{llm-subscription-DtsX5Lhg.js → llm-subscription-BkdHwtQe.js} +0 -0
  643. /package/build/assets/{map-provider-BM2SJarp.js → map-provider-XSFHmdDs.js} +0 -0
  644. /package/build/assets/{middleware-DYHYNAnP.js → middleware-CWYDMVuG.js} +0 -0
  645. /package/build/assets/{modal-backdrop-zVwfOJZr.js → modal-backdrop-Dsmzgr5s.js} +0 -0
  646. /package/build/assets/{navigation-context-DPs2G0X8.js → navigation-context-SjzfpygH.js} +0 -0
  647. /package/build/assets/{objectWithoutPropertiesLoose-BgYIAs2y.js → objectWithoutPropertiesLoose-CQwg6tC0.js} +0 -0
  648. /package/build/assets/{openhands-logo-bcNw5bkY.js → openhands-logo-C-gDp1wr.js} +0 -0
  649. /package/build/assets/{react-DPDgL6du.js → react-ao3tWj6K.js} +0 -0
  650. /package/build/assets/{search-BsjCEFNf.js → search-pb4UKTfK.js} +0 -0
  651. /package/build/assets/{settings-mQUckT0g.js → settings-DksoDv5z.js} +0 -0
  652. /package/build/assets/{settings-gear-MXCyZW0x.js → settings-gear-D_HVvE5L.js} +0 -0
  653. /package/build/assets/{settings-like-page-layout-classes-DENKlZpD.js → settings-like-page-layout-classes-DLrsPCaI.js} +0 -0
  654. /package/build/assets/{settings-section-header-context-COMOIaxV.js → settings-section-header-context-C2MUIG88.js} +0 -0
  655. /package/build/assets/{skills-9cDZONKh.js → skills-CH4xgIh-.js} +0 -0
  656. /package/build/assets/{switch-skeleton-DqQwalyu.js → switch-skeleton-BpSOvZ-n.js} +0 -0
  657. /package/build/assets/{terminal-BuLtIrb9.js → terminal-Dokfkxn0.js} +0 -0
  658. /package/build/assets/{u-check-circle-BqoIxNz_.js → u-check-circle-DPWVO-9N.js} +0 -0
  659. /package/build/assets/{u-check-circle-half-LiwZkuFe.js → u-check-circle-half-BGNAAjOW.js} +0 -0
  660. /package/build/assets/{u-edit-DJ90xc8Z.js → u-edit-BIskOoEG.js} +0 -0
  661. /package/build/assets/{use-breakpoint-B-O0lQ84.js → use-breakpoint-OjLm94cF.js} +0 -0
  662. /package/build/assets/{use-click-outside-element-Bf4Omzot.js → use-click-outside-element-Jpt2WWd7.js} +0 -0
  663. /package/build/assets/{use-onboarding-completion-C_Swglzp.js → use-onboarding-completion-DkRpDTsD.js} +0 -0
  664. /package/build/assets/{v4-DbCkTSoU.js → v4-DPgam_jW.js} +0 -0
  665. /package/build/assets/{vendor~browser-Dqd33JyP.js → vendor~browser-BvEKaLBz.js} +0 -0
  666. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DHDkknt5.js → vendor~conversation-panel~conversation~alert-banner-CznX01nZ.js} +0 -0
  667. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js} +0 -0
  668. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~k6tszsdc-Bb-xMtbv.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g9hift2g-DmmpG9SI.js} +0 -0
  669. /package/build/assets/{vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js} +0 -0
  670. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DTzw2x50.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BuL5kjfS.js} +0 -0
  671. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js → vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-DUYl8gbZ.js} +0 -0
  672. /package/build/assets/{vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js → vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-pIgQDxTc.js} +0 -0
  673. /package/build/assets/{vendor~terminal-aeP3PnKf.js → vendor~terminal-jAaNQWS9.js} +0 -0
  674. /package/build/assets/{x-mark-Batp6gXa.js → x-mark-C5przfXl.js} +0 -0
@@ -1,2 +1,2 @@
1
- const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../../../../i18n/declaration.cjs`),r=require(`../../../../node_modules/lucide-react/dist/esm/icons/cpu.cjs`),i=require(`../../../../types/agent-state.cjs`),a=require(`../../../../utils/utils.cjs`),o=require(`../../../../hooks/use-conversation-id.cjs`),s=require(`../../../../stores/conversation-store.cjs`),c=require(`../../../../contexts/active-backend-context.cjs`),ee=require(`../../../../hooks/use-agent-state.cjs`),l=require(`../../../../utils/form-control-classes.cjs`),te=require(`../../../../hooks/use-unified-websocket-status.cjs`),ne=require(`../../controls/agent-status.cjs`),re=require(`../../../../icons/lesson-plan.cjs`),u=require(`../../../../icons/code-pill.cjs`),d=require(`../../../../ui/context-menu.cjs`),f=require(`../../context-menu/context-menu-list-item.cjs`),ie=require(`../../../../hooks/use-click-outside-element.cjs`),ae=require(`../../../../hooks/query/use-agent-profiles.cjs`),oe=require(`../../../../hooks/use-handle-plan-click.cjs`),se=require(`../change-agent-button.cjs`),ce=require(`../../../../hooks/use-chat-input-model-state.cjs`),p=require(`./chat-input-model.cjs`),m=require(`./chat-input-profile-picker.cjs`),h=require(`./chat-input-llm-profile-picker.cjs`),le=require(`./resolve-picker-kind.cjs`),ue=require(`../../../../hooks/mutation/use-unified-stop-conversation.cjs`),g=require(`../../../../icons/carret-right-fill.cjs`),_=require(`../../controls/tools-context-menu-icon-text.cjs`),de=require(`../chat-add-file-button.cjs`),fe=require(`../chat-send-button.cjs`),pe=require(`../../../../icons/three-dots-vertical.cjs`),me=require(`../../../../hooks/mutation/use-pause-conversation.cjs`),he=require(`../../../../hooks/mutation/use-resume-conversation.cjs`);let v=require(`react`);v=e.__toESM(v,1);let y=require(`react/jsx-runtime`),b=require(`react-dom`);b=e.__toESM(b,1);function x({disabled:e,canSubmit:x=!0,onAddFileClick:ge=()=>{},showButton:_e=!0,buttonClassName:ve=``,handleSubmit:ye=()=>{}}){let{t:S}=t.useTranslation(`openhands`),be=ue.useUnifiedPauseConversation(),C=me.usePauseConversation(),xe=he.useResumeConversation(),{conversationId:w}=o.useOptionalConversationId(),{backend:Se}=c.useActiveBackend(),T=Se.kind===`cloud`,E=ce.useChatInputModelState(),D=ae.useAgentProfiles({enabled:!w}),Ce=D.isFetched&&(D.data?.profiles?.length??0)===0,O=T&&!E.isAcpContext,we=te.useUnifiedWebSocketStatus(),{curAgentState:Te}=ee.useAgentState(),{conversationMode:Ee,setConversationMode:De}=s.useConversationStore(),{handlePlanClick:Oe,isCreatingConversation:ke}=oe.useHandlePlanClick(),k=v.default.useRef(null),A=v.default.useRef(null),j=v.default.useRef(null),M=v.default.useRef(null),N=v.default.useRef(null),P=v.default.useRef(null),[F,Ae]=v.default.useState(1/0),[je,Me]=v.default.useState(0),[Ne,Pe]=v.default.useState(32),[I,Fe]=v.default.useState(96),[L,Ie]=v.default.useState(120),[R,z]=v.default.useState(!1),[B,V]=v.default.useState(null),[H,Le]=v.default.useState();v.default.useEffect(()=>{let e=k.current,t=A.current,n=j.current,r=M.current,i=N.current;if(!e||!t||!n||!i||O&&!r||typeof ResizeObserver>`u`)return;let a=()=>{let a=e.getBoundingClientRect().width,o=t.getBoundingClientRect().width,s=n.getBoundingClientRect().width,c=i.getBoundingClientRect().width;if(a>0&&Ae(a),o>0&&Me(o),s>0&&Pe(s),c>0&&Ie(c),r){let e=r.getBoundingClientRect().width;e>0&&Fe(e)}},o=new ResizeObserver(()=>{a()});return o.observe(e),o.observe(t),o.observe(n),o.observe(i),r&&o.observe(r),a(),()=>o.disconnect()},[O]);let Re=()=>{w&&C.mutate({conversationId:w})},ze=()=>{w&&xe.mutate({conversationId:w})},Be=be.isPending||C.isPending,U=v.default.useCallback(e=>{let t=e,n={showCodeInline:!1,showModelInline:!1};return O&&t>=I&&(n.showCodeInline=!0,t-=I+12),t>=L&&(n.showModelInline=!0),n},[O,I,L]),W=F-je-8-Ne-12,G=U(W),K=(!O||G.showCodeInline)&&G.showModelInline?G:U(W-28-12),q=O?K.showCodeInline:!1,J=K.showModelInline,Ve=F>=360,Y=O&&!q||!J;v.default.useEffect(()=>{Y||(z(!1),V(null))},[Y]);let He=ie.useClickOutsideElement(()=>{z(!1),V(null)}),Ue=Te===i.AgentState.RUNNING||ke||we!==`OPEN`,X=()=>{V(null),z(!1)},Z=le.resolvePickerKind({hasConversation:!!w,isCloud:T,isAcp:E.isAcpContext,profilesAvailable:!Ce}),Q=a.cn(`group`,l.formControlTransitionClassName),$=a.cn(`text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]`,l.formControlTransitionClassName);v.default.useLayoutEffect(()=>{if(!R||!P.current)return;let e=P.current,t=()=>{let t=e.getBoundingClientRect();Le({position:`fixed`,top:t.top-8,left:t.left,transform:`translateY(-100%)`,zIndex:9999})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[R]);let We=(0,y.jsxs)(d.ContextMenu,{ref:He,testId:`chat-input-overflow-menu`,position:`top`,alignment:`left`,className:`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]`,children:[O&&!q&&(0,y.jsxs)(`div`,{className:`relative group/overflow-agent`,children:[(0,y.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-button`,onClick:()=>V(e=>e===`agent`?null:`agent`),isDisabled:Ue,children:(0,y.jsx)(_.ToolsContextMenuIconText,{icon:(0,y.jsx)(u.CodePillIcon,{className:`h-[11px] w-[11px]`}),text:S(Ee===`code`?n.I18nKey.COMMON$CODE:n.I18nKey.COMMON$PLAN),rightIcon:(0,y.jsx)(g.default,{width:10,height:10})})}),!Ue&&(0,y.jsx)(`div`,{className:a.cn(`absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]`,`group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto`,`hover:opacity-100 hover:visible hover:pointer-events-auto`,B===`agent`&&`opacity-100 visible pointer-events-auto`),children:(0,y.jsxs)(d.ContextMenu,{testId:`overflow-agent-submenu`,className:`overflow-visible min-w-[195px]`,children:[(0,y.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-code`,onClick:e=>{e.preventDefault(),e.stopPropagation(),De(`code`),X()},children:(0,y.jsx)(_.ToolsContextMenuIconText,{icon:(0,y.jsx)(u.CodePillIcon,{className:`h-[11px] w-[11px]`}),text:S(n.I18nKey.COMMON$CODE)})}),(0,y.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-plan`,onClick:e=>{Oe(e),X()},children:(0,y.jsx)(_.ToolsContextMenuIconText,{icon:(0,y.jsx)(re.default,{width:16,height:16,color:`currentColor`}),text:S(n.I18nKey.COMMON$PLAN)})})]})})]}),!J&&(0,y.jsxs)(`div`,{className:`relative group/overflow-model`,children:[(0,y.jsx)(f.ContextMenuListItem,{testId:`overflow-model-button`,onClick:()=>V(e=>e===`model`?null:`model`),children:(0,y.jsx)(_.ToolsContextMenuIconText,{icon:(0,y.jsx)(r.Cpu,{width:16,height:16,strokeWidth:2,"aria-hidden":!0}),text:S(n.I18nKey.SETTINGS$AGENT_MODEL),rightIcon:(0,y.jsx)(g.default,{width:10,height:10})})}),(0,y.jsx)(`div`,{className:a.cn(`absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]`,`group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto`,`hover:opacity-100 hover:visible hover:pointer-events-auto`,B===`model`&&`opacity-100 visible pointer-events-auto`),children:(0,y.jsx)(d.ContextMenu,{testId:`overflow-model-submenu`,className:`min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0`,children:Z===`model`?(0,y.jsx)(p.ChatInputModelMenuContent,{model:E,onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$}):Z===`agent-profile`?(0,y.jsx)(m.ChatInputProfileMenuContent,{onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$}):(0,y.jsx)(h.ChatInputLlmProfileMenuContent,{onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$})})})]})]});return(0,y.jsxs)(`div`,{ref:k,className:`w-full min-w-0 flex items-center justify-between gap-2`,children:[(0,y.jsx)(`div`,{className:`flex min-w-0 items-center gap-1`,children:(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,y.jsx)(`div`,{ref:j,className:a.cn(!1),children:(0,y.jsx)(de.ChatAddFileButton,{disabled:e,handleFileIconClick:ge})}),O&&(0,y.jsx)(`div`,{ref:M,className:a.cn(!q&&`hidden`),children:(0,y.jsx)(se.ChangeAgentButton,{})}),(0,y.jsx)(`div`,{ref:N,className:a.cn(!J&&`hidden`),children:Z===`model`?(0,y.jsx)(p.ChatInputModel,{}):Z===`agent-profile`?(0,y.jsx)(m.ChatInputProfilePicker,{}):(0,y.jsx)(h.ChatInputLlmProfilePicker,{})}),Y&&(0,y.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,y.jsx)(`button`,{ref:P,type:`button`,className:a.cn(l.chatInputIconButtonClassName,`size-6`),"aria-label":S(n.I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS),"aria-expanded":R,"aria-haspopup":`menu`,onClick:e=>{e.preventDefault(),e.stopPropagation(),z(e=>!e)},children:(0,y.jsx)(pe.default,{width:16,height:16,color:`currentColor`})}),R&&typeof document<`u`&&H&&b.default.createPortal((0,y.jsx)(`div`,{style:H,children:We}),document.body)]})]})}),(0,y.jsxs)(`div`,{ref:A,className:`ml-auto flex shrink-0 items-center gap-2`,children:[Ve&&w&&(0,y.jsx)(ne.default,{handleStop:Re,handleResumeAgent:ze,disabled:e,isPausing:Be}),_e&&(0,y.jsx)(fe.ChatSendButton,{buttonClassName:ve,handleSubmit:ye,disabled:e||!x})]})]})}exports.ChatInputActions=x;
1
+ const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../../../../i18n/declaration.cjs`),r=require(`../../../../node_modules/lucide-react/dist/esm/icons/cpu.cjs`),i=require(`../../../../types/agent-state.cjs`),a=require(`../../../../utils/utils.cjs`),o=require(`../../../../hooks/use-conversation-id.cjs`),s=require(`../../../../stores/conversation-store.cjs`),c=require(`../../../../contexts/active-backend-context.cjs`),ee=require(`../../../../hooks/use-agent-state.cjs`),l=require(`../../../../utils/form-control-classes.cjs`),te=require(`../../../../hooks/use-unified-websocket-status.cjs`),ne=require(`../../controls/agent-status.cjs`),re=require(`../../../../icons/lesson-plan.cjs`),u=require(`../../../../icons/code-pill.cjs`),d=require(`../../../../ui/context-menu.cjs`),f=require(`../../context-menu/context-menu-list-item.cjs`),ie=require(`../../../../hooks/use-click-outside-element.cjs`),ae=require(`../../../../hooks/query/use-agent-profiles.cjs`),oe=require(`../../../../hooks/use-handle-plan-click.cjs`),se=require(`../change-agent-button.cjs`),ce=require(`../../../../hooks/use-chat-input-model-state.cjs`),p=require(`./chat-input-model.cjs`),m=require(`./chat-input-profile-picker.cjs`),le=require(`./chat-input-llm-profile-picker.cjs`),ue=require(`./resolve-picker-kind.cjs`),de=require(`../../../../hooks/mutation/use-unified-stop-conversation.cjs`),h=require(`../../../../icons/carret-right-fill.cjs`),g=require(`../../controls/tools-context-menu-icon-text.cjs`),fe=require(`../chat-add-file-button.cjs`),pe=require(`../chat-send-button.cjs`),me=require(`../../../../icons/three-dots-vertical.cjs`),he=require(`../../../../hooks/mutation/use-pause-conversation.cjs`),ge=require(`../../../../hooks/mutation/use-resume-conversation.cjs`);let _=require(`react`);_=e.__toESM(_,1);let v=require(`react/jsx-runtime`),y=require(`react-dom`);y=e.__toESM(y,1);function b({disabled:e,canSubmit:b=!0,hasStartedConversation:_e,onAddFileClick:ve=()=>{},showButton:ye=!0,buttonClassName:be=``,handleSubmit:xe=()=>{}}){let{t:x}=t.useTranslation(`openhands`),Se=de.useUnifiedPauseConversation(),S=he.usePauseConversation(),Ce=ge.useResumeConversation(),{conversationId:C}=o.useOptionalConversationId(),{backend:we}=c.useActiveBackend(),w=we.kind===`cloud`,T=ce.useChatInputModelState(),E=ae.useAgentProfiles({enabled:!C}),Te=E.isFetched&&(E.data?.profiles?.length??0)===0,D=w&&!T.isAcpContext,Ee=te.useUnifiedWebSocketStatus(),{curAgentState:De}=ee.useAgentState(),{conversationMode:Oe,setConversationMode:ke}=s.useConversationStore(),{handlePlanClick:Ae,isCreatingConversation:je}=oe.useHandlePlanClick(),O=_.default.useRef(null),k=_.default.useRef(null),A=_.default.useRef(null),j=_.default.useRef(null),M=_.default.useRef(null),N=_.default.useRef(null),[P,Me]=_.default.useState(1/0),[Ne,Pe]=_.default.useState(0),[Fe,Ie]=_.default.useState(32),[F,Le]=_.default.useState(96),[I,Re]=_.default.useState(120),[L,R]=_.default.useState(!1),[z,B]=_.default.useState(null),[V,ze]=_.default.useState();_.default.useEffect(()=>{let e=O.current,t=k.current,n=A.current,r=j.current,i=M.current;if(!e||!t||!n||!i||D&&!r||typeof ResizeObserver>`u`)return;let a=()=>{let a=e.getBoundingClientRect().width,o=t.getBoundingClientRect().width,s=n.getBoundingClientRect().width,c=i.getBoundingClientRect().width;if(a>0&&Me(a),o>0&&Pe(o),s>0&&Ie(s),c>0&&Re(c),r){let e=r.getBoundingClientRect().width;e>0&&Le(e)}},o=new ResizeObserver(()=>{a()});return o.observe(e),o.observe(t),o.observe(n),o.observe(i),r&&o.observe(r),a(),()=>o.disconnect()},[D]);let Be=()=>{C&&S.mutate({conversationId:C})},Ve=()=>{C&&Ce.mutate({conversationId:C})},He=Se.isPending||S.isPending,H=_.default.useCallback(e=>{let t=e,n={showCodeInline:!1,showModelInline:!1};return D&&t>=F&&(n.showCodeInline=!0,t-=F+12),t>=I&&(n.showModelInline=!0),n},[D,F,I]),U=P-Ne-8-Fe-12,W=H(U),G=(!D||W.showCodeInline)&&W.showModelInline?W:H(U-28-12),K=D?G.showCodeInline:!1,q=G.showModelInline,Ue=P>=360,J=D&&!K||!q;_.default.useEffect(()=>{J||(R(!1),B(null))},[J]);let We=ie.useClickOutsideElement(()=>{R(!1),B(null)}),Y=De===i.AgentState.RUNNING||je||Ee!==`OPEN`,X=()=>{B(null),R(!1)},Z=ue.resolvePickerKind({hasConversation:!!C,hasStartedConversation:_e,isCloud:w,isAcp:T.isAcpContext,profilesAvailable:!Te}),Q=a.cn(`group`,l.formControlTransitionClassName),$=a.cn(`text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]`,l.formControlTransitionClassName);_.default.useLayoutEffect(()=>{if(!L||!N.current)return;let e=N.current,t=()=>{let t=e.getBoundingClientRect();ze({position:`fixed`,top:t.top-8,left:t.left,transform:`translateY(-100%)`,zIndex:9999})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[L]);let Ge=(0,v.jsxs)(d.ContextMenu,{ref:We,testId:`chat-input-overflow-menu`,position:`top`,alignment:`left`,className:`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]`,children:[D&&!K&&(0,v.jsxs)(`div`,{className:`relative group/overflow-agent`,children:[(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-button`,onClick:()=>B(e=>e===`agent`?null:`agent`),isDisabled:Y,children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(u.CodePillIcon,{className:`h-[11px] w-[11px]`}),text:x(Oe===`code`?n.I18nKey.COMMON$CODE:n.I18nKey.COMMON$PLAN),rightIcon:(0,v.jsx)(h.default,{width:10,height:10})})}),!Y&&(0,v.jsx)(`div`,{className:a.cn(`absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]`,`group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto`,`hover:opacity-100 hover:visible hover:pointer-events-auto`,z===`agent`&&`opacity-100 visible pointer-events-auto`),children:(0,v.jsxs)(d.ContextMenu,{testId:`overflow-agent-submenu`,className:`overflow-visible min-w-[195px]`,children:[(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-code`,onClick:e=>{e.preventDefault(),e.stopPropagation(),ke(`code`),X()},children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(u.CodePillIcon,{className:`h-[11px] w-[11px]`}),text:x(n.I18nKey.COMMON$CODE)})}),(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-plan`,onClick:e=>{Ae(e),X()},children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(re.default,{width:16,height:16,color:`currentColor`}),text:x(n.I18nKey.COMMON$PLAN)})})]})})]}),!q&&(0,v.jsxs)(`div`,{className:`relative group/overflow-model`,children:[(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-model-button`,onClick:()=>B(e=>e===`model`?null:`model`),children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(r.Cpu,{width:16,height:16,strokeWidth:2,"aria-hidden":!0}),text:x(n.I18nKey.SETTINGS$AGENT_MODEL),rightIcon:(0,v.jsx)(h.default,{width:10,height:10})})}),(0,v.jsx)(`div`,{className:a.cn(`absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]`,`group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto`,`hover:opacity-100 hover:visible hover:pointer-events-auto`,z===`model`&&`opacity-100 visible pointer-events-auto`),children:(0,v.jsx)(d.ContextMenu,{testId:`overflow-model-submenu`,className:`min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0`,children:Z===`model`?(0,v.jsx)(p.ChatInputModelMenuContent,{model:T,onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$}):Z===`agent-profile`?(0,v.jsx)(m.ChatInputProfileMenuContent,{onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$}):(0,v.jsx)(le.ChatInputLlmProfileMenuContent,{onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$})})})]})]});return(0,v.jsxs)(`div`,{ref:O,className:`w-full min-w-0 flex items-center justify-between gap-2`,children:[(0,v.jsx)(`div`,{className:`flex min-w-0 items-center gap-1`,children:(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,v.jsx)(`div`,{ref:A,className:a.cn(!1),children:(0,v.jsx)(fe.ChatAddFileButton,{disabled:e,handleFileIconClick:ve})}),D&&(0,v.jsx)(`div`,{ref:j,className:a.cn(!K&&`hidden`),children:(0,v.jsx)(se.ChangeAgentButton,{})}),(0,v.jsx)(`div`,{ref:M,className:a.cn(!q&&`hidden`),children:Z===`model`?(0,v.jsx)(p.ChatInputModel,{}):Z===`agent-profile`?(0,v.jsx)(m.ChatInputProfilePicker,{}):(0,v.jsx)(le.ChatInputLlmProfilePicker,{})}),J&&(0,v.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,v.jsx)(`button`,{ref:N,type:`button`,className:a.cn(l.chatInputIconButtonClassName,`size-6`),"aria-label":x(n.I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS),"aria-expanded":L,"aria-haspopup":`menu`,onClick:e=>{e.preventDefault(),e.stopPropagation(),R(e=>!e)},children:(0,v.jsx)(me.default,{width:16,height:16,color:`currentColor`})}),L&&typeof document<`u`&&V&&y.default.createPortal((0,v.jsx)(`div`,{style:V,children:Ge}),document.body)]})]})}),(0,v.jsxs)(`div`,{ref:k,className:`ml-auto flex shrink-0 items-center gap-2`,children:[Ue&&C&&(0,v.jsx)(ne.default,{handleStop:Be,handleResumeAgent:Ve,disabled:e,isPausing:He}),ye&&(0,v.jsx)(pe.ChatSendButton,{buttonClassName:be,handleSubmit:xe,disabled:e||!b})]})]})}exports.ChatInputActions=b;
2
2
  //# sourceMappingURL=chat-input-actions.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-actions.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":"g7DAsDA,SAAgB,EAAiB,CAC/B,WACA,YAAY,GACZ,sBAAuB,GACvB,cAAa,GACb,mBAAkB,GAClB,oBAAqB,IACG,CACxB,GAAM,CAAE,KAA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EACvB,CAAA,CAEA,GACF"}
1
+ {"version":3,"file":"chat-input-actions.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n hasStartedConversation?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n hasStartedConversation,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n hasStartedConversation,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":"i7DAuDA,SAAgB,EAAiB,CAC/B,WACA,YAAY,GACZ,0BACA,sBAAuB,GACvB,cAAa,GACb,mBAAkB,GAClB,oBAAqB,IACG,CACxB,GAAM,CAAE,KAAM,EAAA,eAAe,YAAY,CACnC,GAAuB,GAAA,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 +1,11 @@
1
1
  interface ChatInputActionsProps {
2
2
  disabled: boolean;
3
3
  canSubmit?: boolean;
4
+ hasStartedConversation?: boolean;
4
5
  onAddFileClick?: () => void;
5
6
  showButton?: boolean;
6
7
  buttonClassName?: string;
7
8
  handleSubmit?: () => void;
8
9
  }
9
- export declare function ChatInputActions({ disabled, canSubmit, onAddFileClick, showButton, buttonClassName, handleSubmit, }: ChatInputActionsProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ChatInputActions({ disabled, canSubmit, hasStartedConversation, onAddFileClick, showButton, buttonClassName, handleSubmit, }: ChatInputActionsProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
@@ -9,13 +9,13 @@ import { useActiveBackend as s } from "../../../../contexts/active-backend-conte
9
9
  import { useAgentState as c } from "../../../../hooks/use-agent-state.js";
10
10
  import { chatInputIconButtonClassName as ee, formControlTransitionClassName as l } from "../../../../utils/form-control-classes.js";
11
11
  import { useUnifiedWebSocketStatus as te } from "../../../../hooks/use-unified-websocket-status.js";
12
- import ne from "../../controls/agent-status.js";
13
- import re from "../../../../icons/lesson-plan.js";
14
- import { CodePillIcon as u } from "../../../../icons/code-pill.js";
15
- import { ContextMenu as d } from "../../../../ui/context-menu.js";
16
- import { ContextMenuListItem as f } from "../../context-menu/context-menu-list-item.js";
17
- import { useClickOutsideElement as ie } from "../../../../hooks/use-click-outside-element.js";
18
- import { useAgentProfiles as p } from "../../../../hooks/query/use-agent-profiles.js";
12
+ import u from "../../controls/agent-status.js";
13
+ import ne from "../../../../icons/lesson-plan.js";
14
+ import { CodePillIcon as d } from "../../../../icons/code-pill.js";
15
+ import { ContextMenu as f } from "../../../../ui/context-menu.js";
16
+ import { ContextMenuListItem as p } from "../../context-menu/context-menu-list-item.js";
17
+ import { useClickOutsideElement as re } from "../../../../hooks/use-click-outside-element.js";
18
+ import { useAgentProfiles as ie } from "../../../../hooks/query/use-agent-profiles.js";
19
19
  import { useHandlePlanClick as ae } from "../../../../hooks/use-handle-plan-click.js";
20
20
  import { ChangeAgentButton as oe } from "../change-agent-button.js";
21
21
  import { useChatInputModelState as se } from "../../../../hooks/use-chat-input-model-state.js";
@@ -35,27 +35,27 @@ import g from "react";
35
35
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
36
36
  import xe from "react-dom";
37
37
  //#region src/components/features/chat/components/chat-input-actions.tsx
38
- function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, showButton: we = !0, buttonClassName: Te = "", handleSubmit: Ee = () => {} }) {
39
- let { t: b } = e("openhands"), De = he(), x = ye(), Oe = be(), { conversationId: S } = a(), { backend: ke } = s(), C = ke.kind === "cloud", w = se(), T = p({ enabled: !S }), Ae = T.isFetched && (T.data?.profiles?.length ?? 0) === 0, E = C && !w.isAcpContext, je = te(), { curAgentState: Me } = c(), { conversationMode: Ne, setConversationMode: Pe } = o(), { handlePlanClick: Fe, isCreatingConversation: Ie } = ae(), D = g.useRef(null), O = g.useRef(null), k = g.useRef(null), A = g.useRef(null), j = g.useRef(null), M = g.useRef(null), [N, Le] = g.useState(Infinity), [Re, ze] = g.useState(0), [Be, P] = g.useState(32), [F, Ve] = g.useState(96), [I, He] = g.useState(120), [L, R] = g.useState(!1), [z, B] = g.useState(null), [V, Ue] = g.useState();
38
+ function y({ disabled: y, canSubmit: Se = !0, hasStartedConversation: Ce, onAddFileClick: we = () => {}, showButton: Te = !0, buttonClassName: Ee = "", handleSubmit: De = () => {} }) {
39
+ let { t: b } = e("openhands"), Oe = he(), x = ye(), ke = be(), { conversationId: S } = a(), { backend: Ae } = s(), C = Ae.kind === "cloud", w = se(), T = ie({ enabled: !S }), je = T.isFetched && (T.data?.profiles?.length ?? 0) === 0, E = C && !w.isAcpContext, Me = te(), { curAgentState: Ne } = c(), { conversationMode: Pe, setConversationMode: Fe } = o(), { handlePlanClick: Ie, isCreatingConversation: Le } = ae(), D = g.useRef(null), O = g.useRef(null), k = g.useRef(null), A = g.useRef(null), j = g.useRef(null), M = g.useRef(null), [N, Re] = g.useState(Infinity), [ze, Be] = g.useState(0), [P, Ve] = g.useState(32), [F, He] = g.useState(96), [I, Ue] = g.useState(120), [L, R] = g.useState(!1), [z, B] = g.useState(null), [V, We] = g.useState();
40
40
  g.useEffect(() => {
41
41
  let e = D.current, t = O.current, n = k.current, r = A.current, i = j.current;
42
42
  if (!e || !t || !n || !i || E && !r || typeof ResizeObserver > "u") return;
43
43
  let a = () => {
44
44
  let a = e.getBoundingClientRect().width, o = t.getBoundingClientRect().width, s = n.getBoundingClientRect().width, c = i.getBoundingClientRect().width;
45
- if (a > 0 && Le(a), o > 0 && ze(o), s > 0 && P(s), c > 0 && He(c), r) {
45
+ if (a > 0 && Re(a), o > 0 && Be(o), s > 0 && Ve(s), c > 0 && Ue(c), r) {
46
46
  let e = r.getBoundingClientRect().width;
47
- e > 0 && Ve(e);
47
+ e > 0 && He(e);
48
48
  }
49
49
  }, o = new ResizeObserver(() => {
50
50
  a();
51
51
  });
52
52
  return o.observe(e), o.observe(t), o.observe(n), o.observe(i), r && o.observe(r), a(), () => o.disconnect();
53
53
  }, [E]);
54
- let We = () => {
54
+ let Ge = () => {
55
55
  S && x.mutate({ conversationId: S });
56
- }, Ge = () => {
57
- S && Oe.mutate({ conversationId: S });
58
- }, Ke = De.isPending || x.isPending, H = g.useCallback((e) => {
56
+ }, Ke = () => {
57
+ S && ke.mutate({ conversationId: S });
58
+ }, qe = Oe.isPending || x.isPending, H = g.useCallback((e) => {
59
59
  let t = e, n = {
60
60
  showCodeInline: !1,
61
61
  showModelInline: !1
@@ -65,25 +65,26 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
65
65
  E,
66
66
  F,
67
67
  I
68
- ]), U = N - Re - 8 - Be - 12, W = H(U), G = (!E || W.showCodeInline) && W.showModelInline ? W : H(U - 28 - 12), K = E ? G.showCodeInline : !1, q = G.showModelInline, qe = N >= 360, J = E && !K || !q;
68
+ ]), U = N - ze - 8 - P - 12, W = H(U), G = (!E || W.showCodeInline) && W.showModelInline ? W : H(U - 28 - 12), K = E ? G.showCodeInline : !1, q = G.showModelInline, Je = N >= 360, J = E && !K || !q;
69
69
  g.useEffect(() => {
70
70
  J || (R(!1), B(null));
71
71
  }, [J]);
72
- let Je = ie(() => {
72
+ let Ye = re(() => {
73
73
  R(!1), B(null);
74
- }), Y = Me === r.RUNNING || Ie || je !== "OPEN", X = () => {
74
+ }), Y = Ne === r.RUNNING || Le || Me !== "OPEN", X = () => {
75
75
  B(null), R(!1);
76
76
  }, Z = me({
77
77
  hasConversation: !!S,
78
+ hasStartedConversation: Ce,
78
79
  isCloud: C,
79
80
  isAcp: w.isAcpContext,
80
- profilesAvailable: !Ae
81
+ profilesAvailable: !je
81
82
  }), Q = i("group", l), $ = i("text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]", l);
82
83
  g.useLayoutEffect(() => {
83
84
  if (!L || !M.current) return;
84
85
  let e = M.current, t = () => {
85
86
  let t = e.getBoundingClientRect();
86
- Ue({
87
+ We({
87
88
  position: "fixed",
88
89
  top: t.top - 8,
89
90
  left: t.left,
@@ -95,21 +96,21 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
95
96
  window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
96
97
  };
97
98
  }, [L]);
98
- let Ye = /* @__PURE__ */ v(d, {
99
- ref: Je,
99
+ let Xe = /* @__PURE__ */ v(f, {
100
+ ref: Ye,
100
101
  testId: "chat-input-overflow-menu",
101
102
  position: "top",
102
103
  alignment: "left",
103
104
  className: "!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]",
104
105
  children: [E && !K && /* @__PURE__ */ v("div", {
105
106
  className: "relative group/overflow-agent",
106
- children: [/* @__PURE__ */ _(f, {
107
+ children: [/* @__PURE__ */ _(p, {
107
108
  testId: "overflow-agent-button",
108
109
  onClick: () => B((e) => e === "agent" ? null : "agent"),
109
110
  isDisabled: Y,
110
111
  children: /* @__PURE__ */ _(h, {
111
- icon: /* @__PURE__ */ _(u, { className: "h-[11px] w-[11px]" }),
112
- text: b(Ne === "code" ? t.COMMON$CODE : t.COMMON$PLAN),
112
+ icon: /* @__PURE__ */ _(d, { className: "h-[11px] w-[11px]" }),
113
+ text: b(Pe === "code" ? t.COMMON$CODE : t.COMMON$PLAN),
113
114
  rightIcon: /* @__PURE__ */ _(m, {
114
115
  width: 10,
115
116
  height: 10
@@ -117,25 +118,25 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
117
118
  })
118
119
  }), !Y && /* @__PURE__ */ _("div", {
119
120
  className: i("absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]", "group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto", "hover:opacity-100 hover:visible hover:pointer-events-auto", z === "agent" && "opacity-100 visible pointer-events-auto"),
120
- children: /* @__PURE__ */ v(d, {
121
+ children: /* @__PURE__ */ v(f, {
121
122
  testId: "overflow-agent-submenu",
122
123
  className: "overflow-visible min-w-[195px]",
123
- children: [/* @__PURE__ */ _(f, {
124
+ children: [/* @__PURE__ */ _(p, {
124
125
  testId: "overflow-agent-code",
125
126
  onClick: (e) => {
126
- e.preventDefault(), e.stopPropagation(), Pe("code"), X();
127
+ e.preventDefault(), e.stopPropagation(), Fe("code"), X();
127
128
  },
128
129
  children: /* @__PURE__ */ _(h, {
129
- icon: /* @__PURE__ */ _(u, { className: "h-[11px] w-[11px]" }),
130
+ icon: /* @__PURE__ */ _(d, { className: "h-[11px] w-[11px]" }),
130
131
  text: b(t.COMMON$CODE)
131
132
  })
132
- }), /* @__PURE__ */ _(f, {
133
+ }), /* @__PURE__ */ _(p, {
133
134
  testId: "overflow-agent-plan",
134
135
  onClick: (e) => {
135
- Fe(e), X();
136
+ Ie(e), X();
136
137
  },
137
138
  children: /* @__PURE__ */ _(h, {
138
- icon: /* @__PURE__ */ _(re, {
139
+ icon: /* @__PURE__ */ _(ne, {
139
140
  width: 16,
140
141
  height: 16,
141
142
  color: "currentColor"
@@ -147,7 +148,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
147
148
  })]
148
149
  }), !q && /* @__PURE__ */ v("div", {
149
150
  className: "relative group/overflow-model",
150
- children: [/* @__PURE__ */ _(f, {
151
+ children: [/* @__PURE__ */ _(p, {
151
152
  testId: "overflow-model-button",
152
153
  onClick: () => B((e) => e === "model" ? null : "model"),
153
154
  children: /* @__PURE__ */ _(h, {
@@ -165,7 +166,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
165
166
  })
166
167
  }), /* @__PURE__ */ _("div", {
167
168
  className: i("absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]", "group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto", "hover:opacity-100 hover:visible hover:pointer-events-auto", z === "model" && "opacity-100 visible pointer-events-auto"),
168
- children: /* @__PURE__ */ _(d, {
169
+ children: /* @__PURE__ */ _(f, {
169
170
  testId: "overflow-model-submenu",
170
171
  className: "min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0",
171
172
  children: Z === "model" ? /* @__PURE__ */ _(le, {
@@ -197,7 +198,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
197
198
  className: i(!1),
198
199
  children: /* @__PURE__ */ _(ge, {
199
200
  disabled: y,
200
- handleFileIconClick: Ce
201
+ handleFileIconClick: we
201
202
  })
202
203
  }),
203
204
  E && /* @__PURE__ */ _("div", {
@@ -229,7 +230,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
229
230
  })
230
231
  }), L && typeof document < "u" && V && xe.createPortal(/* @__PURE__ */ _("div", {
231
232
  style: V,
232
- children: Ye
233
+ children: Xe
233
234
  }), document.body)]
234
235
  })
235
236
  ]
@@ -237,14 +238,14 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
237
238
  }), /* @__PURE__ */ v("div", {
238
239
  ref: O,
239
240
  className: "ml-auto flex shrink-0 items-center gap-2",
240
- children: [qe && S && /* @__PURE__ */ _(ne, {
241
- handleStop: We,
242
- handleResumeAgent: Ge,
241
+ children: [Je && S && /* @__PURE__ */ _(u, {
242
+ handleStop: Ge,
243
+ handleResumeAgent: Ke,
243
244
  disabled: y,
244
- isPausing: Ke
245
- }), we && /* @__PURE__ */ _(_e, {
246
- buttonClassName: Te,
247
- handleSubmit: Ee,
245
+ isPausing: qe
246
+ }), Te && /* @__PURE__ */ _(_e, {
247
+ buttonClassName: Ee,
248
+ handleSubmit: De,
248
249
  disabled: y || !Se
249
250
  })]
250
251
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-actions.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,EAAiB,EAC/B,aACA,gBAAY,IACZ,2BAAuB,IACvB,iBAAa,IACb,sBAAkB,IAClB,yBAAqB,MACG;CACxB,IAAM,EAAE,SAAM,EAAe,YAAY,EACnC,KAAuB,IAA6B,EACpD,IAA4B,IAAsB,EAClD,KAA6B,IAAuB,EACpD,EAAE,sBAAmB,GAA2B,EAChD,EAAE,gBAAY,GAAkB,EAChC,IAAU,GAAQ,SAAS,SAC3B,IAAa,IAAwB,EAKrC,IAAoB,EAAiB,EACzC,SAAS,CAAC,GACX,CAAC,EACI,KACJ,EAAkB,cACjB,EAAkB,MAAM,UAAU,UAAU,OAAO,GAGhD,IAAwB,KAAW,CAAC,EAAW,cAC/C,KAAkB,IAA2B,EAC7C,EAAE,sBAAkB,GAAe,EACnC,EAAE,sBAAkB,4BAAwB,GAAsB,EAClE,EAAE,qBAAiB,+BAA2B,IAAoB,EAElE,IAAgB,EAAM,OAAuB,KAAK,EAClD,IAAkB,EAAM,OAAuB,KAAK,EACpD,IAAa,EAAM,OAAuB,KAAK,EAC/C,IAAU,EAAM,OAAuB,KAAK,EAC5C,IAAW,EAAM,OAAuB,KAAK,EAC7C,IAAqB,EAAM,OAA0B,KAAK,EAC1D,CAAC,GAAiB,MAAsB,EAAM,SAClD,SACD,EACK,CAAC,IAAmB,MAAwB,EAAM,SAAS,EAAE,EAC7D,CAAC,IAAc,KAAmB,EAAM,SAAS,GAAG,EACpD,CAAC,GAAW,M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AAK,WAAU;gBAAf,CACE,kBAAC,UAAD;OACE,KAAK;OACL,MAAK;OACL,WAAW,EAAG,IAA8B,SAAS;OACrD,cAAY,EAAE,EAAQ,kCAAkC;OACxD,iBAAe;OACf,iBAAc;OACd,UAAU,MAAU;AAGlB,QAFA,EAAM,gBAAgB,EACtB,EAAM,iBAAiB,EACvB,GAAmB,MAAS,CAAC,EAAK;;iBAGpC,kBAAC,IAAD;QACE,OAAO;QACP,QAAQ;QACR,OAAM;QACN,CAAA;OACK,CAAA,EAER,KACC,OAAO,WAAa,OACpB,KACA,GAAS,aACP,kBAAC,OAAD;OAAK,OAAO;iBAAsB;OAAmB,CAAA,EACrD,SAAS,KACV,CACC;;KAEJ;;GACF,CAAA,EACN,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;aAFZ,CAIG,MAAyB,KACxB,kBAAC,IAAD;IACE,YAAY;IACZ,mBAAmB;IACT;IACC;IACX,CAAA,EAEH,MACC,kBAAC,IAAD;IACmB;IACH;IACd,UAAU,KAAY,CAAC;IACvB,CAAA,CAEA;KACF"}
1
+ {"version":3,"file":"chat-input-actions.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n hasStartedConversation?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n hasStartedConversation,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n hasStartedConversation,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,EAAiB,EAC/B,aACA,gBAAY,IACZ,4BACA,2BAAuB,IACvB,iBAAa,IACb,sBAAkB,IAClB,yBAAqB,MACG;CACxB,IAAM,EAAE,SAAM,EAAe,YAAY,EACnC,KAAuB,IAA6B,EACpD,IAA4B,IAAsB,EAClD,KAA6B,IAAuB,EACpD,EAAE,sBAAmB,GAA2B,EAChD,EAAE,gBAAY,GAAkB,EAChC,IAAU,GAAQ,SAAS,SAC3B,IAAa,IAAwB,EAKrC,IAAoB,GAAiB,EACzC,SAAS,CAAC,GACX,CAAC,EACI,KACJ,EAAkB,cACjB,EAAkB,MAAM,UAAU,UAAU,OAAO,GAGhD,IAAwB,KAAW,CAAC,EAAW,cAC/C,KAAkB,IAA2B,EAC7C,EAAE,sBAAkB,GAAe,EACnC,EAAE,sBAAkB,4BAAwB,GAAsB,EAClE,EAAE,qBAAiB,+BAA2B,IAAoB,EAElE,IAAgB,EAAM,OAAuB,KAAK,EAClD,IAAkB,EAAM,OAAuB,KAAK,EACpD,IAAa,EAAM,OAAuB,KAAK,EAC/C,IAAU,EAAM,OAAuB,KAAK,EAC5C,IAAW,EAAM,OAAuB,KAA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,CAAA;MACjB,CAAA;KAER,kBAAC,OAAD;MAAK,KAAK;MAAU,WAAW,EAAG,CAAC,KAAmB,SAAS;gBAI3D,EADD,MAAe,UACb,KACC,MAAe,kBAChB,KAEA,IAJD,EAAkB,CAIW;MAE3B,CAAA;KAEL,KACC,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,UAAD;OACE,KAAK;OACL,MAAK;OACL,WAAW,EAAG,IAA8B,SAAS;OACrD,cAAY,EAAE,EAAQ,kCAAkC;OACxD,iBAAe;OACf,iBAAc;OACd,UAAU,MAAU;AAGlB,QAFA,EAAM,gBAAgB,EACtB,EAAM,iBAAiB,EACvB,GAAmB,MAAS,CAAC,EAAK;;iBAGpC,kBAAC,IAAD;QACE,OAAO;QACP,QAAQ;QACR,OAAM;QACN,CAAA;OACK,CAAA,EAER,KACC,OAAO,WAAa,OACpB,KACA,GAAS,aACP,kBAAC,OAAD;OAAK,OAAO;iBAAsB;OAAmB,CAAA,EACrD,SAAS,KACV,CACC;;KAEJ;;GACF,CAAA,EACN,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;aAFZ,CAIG,MAAyB,KACxB,kBAAC,GAAD;IACE,YAAY;IACZ,mBAAmB;IACT;IACC;IACX,CAAA,EAEH,MACC,kBAAC,IAAD;IACmB;IACH;IACd,UAAU,KAAY,CAAC;IACvB,CAAA,CAEA;KACF"}
@@ -1,2 +1,2 @@
1
- const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../utils/utils.cjs`),n=require(`../../../../stores/conversation-store.cjs`),r=require(`../drag-over.cjs`),i=require(`../uploaded-files.cjs`),a=require(`./chat-input-row.cjs`),o=require(`./chat-input-actions.cjs`),s=require(`./slash-command-menu.cjs`);let c=require(`react`);c=e.__toESM(c,1);let l=require(`react/jsx-runtime`);function u({chatContainerRef:e,isDragOver:c,disabled:u,canSubmit:d,isNewConversationPending:f=!1,showButton:p,buttonClassName:m,chatInputRef:h,handleFileIconClick:g,handleSubmit:_,onDragOver:v,onDragLeave:y,onDrop:b,onInput:x,onPaste:S,onKeyDown:C,onFocus:w,onBlur:T,isSlashMenuOpen:E=!1,slashItems:D=[],slashSelectedIndex:O=0,onSlashSelect:k}){return(0,l.jsxs)(`div`,{ref:e,className:t.cn(`bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full`,n.useConversationStore(e=>e.conversationMode)===`plan`&&`border border-[#597FF4]`),onDragOver:e=>v(e,u),onDragLeave:e=>y(e,u),onDrop:e=>b(e,u),children:[c&&(0,l.jsx)(r.DragOver,{}),(0,l.jsx)(i.UploadedFiles,{}),(0,l.jsxs)(`div`,{className:`relative w-full`,children:[E&&k&&(0,l.jsx)(s.SlashCommandMenu,{items:D,selectedIndex:O,onSelect:k}),(0,l.jsx)(a.ChatInputRow,{chatInputRef:h,isNewConversationPending:f,onInput:x,onPaste:S,onKeyDown:C,onFocus:w,onBlur:T})]}),(0,l.jsx)(o.ChatInputActions,{disabled:u,canSubmit:d,onAddFileClick:()=>g(u),showButton:p,buttonClassName:m,handleSubmit:_})]})}exports.ChatInputContainer=u;
1
+ const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../utils/utils.cjs`),n=require(`../../../../stores/conversation-store.cjs`),r=require(`../drag-over.cjs`),i=require(`../uploaded-files.cjs`),a=require(`./chat-input-row.cjs`),o=require(`./chat-input-actions.cjs`),s=require(`./slash-command-menu.cjs`);let c=require(`react`);c=e.__toESM(c,1);let l=require(`react/jsx-runtime`);function u({chatContainerRef:e,isDragOver:c,disabled:u,canSubmit:d,hasStartedConversation:f,isNewConversationPending:p=!1,showButton:m,buttonClassName:h,chatInputRef:g,handleFileIconClick:_,handleSubmit:v,onDragOver:y,onDragLeave:b,onDrop:x,onInput:S,onPaste:C,onKeyDown:w,onFocus:T,onBlur:E,isSlashMenuOpen:D=!1,slashItems:O=[],slashSelectedIndex:k=0,onSlashSelect:A}){return(0,l.jsxs)(`div`,{ref:e,className:t.cn(`bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full`,n.useConversationStore(e=>e.conversationMode)===`plan`&&`border border-[#597FF4]`),onDragOver:e=>y(e,u),onDragLeave:e=>b(e,u),onDrop:e=>x(e,u),children:[c&&(0,l.jsx)(r.DragOver,{}),(0,l.jsx)(i.UploadedFiles,{}),(0,l.jsxs)(`div`,{className:`relative w-full`,children:[D&&A&&(0,l.jsx)(s.SlashCommandMenu,{items:O,selectedIndex:k,onSelect:A}),(0,l.jsx)(a.ChatInputRow,{chatInputRef:g,isNewConversationPending:p,onInput:S,onPaste:C,onKeyDown:w,onFocus:T,onBlur:E})]}),(0,l.jsx)(o.ChatInputActions,{disabled:u,canSubmit:d,hasStartedConversation:f,onAddFileClick:()=>_(u),showButton:m,buttonClassName:h,handleSubmit:v})]})}exports.ChatInputContainer=u;
2
2
  //# sourceMappingURL=chat-input-container.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-container.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-container.tsx"],"sourcesContent":["import React from \"react\";\nimport { DragOver } from \"../drag-over\";\nimport { UploadedFiles } from \"../uploaded-files\";\nimport { ChatInputRow } from \"./chat-input-row\";\nimport { ChatInputActions } from \"./chat-input-actions\";\nimport { SlashCommandMenu } from \"./slash-command-menu\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\nimport { SlashCommandItem } from \"#/hooks/chat/use-slash-command\";\n\ninterface ChatInputContainerProps {\n chatContainerRef: React.RefObject<HTMLDivElement | null>;\n isDragOver: boolean;\n disabled: boolean;\n canSubmit: boolean;\n isNewConversationPending?: boolean;\n showButton: boolean;\n buttonClassName: string;\n chatInputRef: React.RefObject<HTMLDivElement | null>;\n handleFileIconClick: (isDisabled: boolean) => void;\n handleSubmit: () => void;\n onDragOver: (e: React.DragEvent, isDisabled: boolean) => void;\n onDragLeave: (e: React.DragEvent, isDisabled: boolean) => void;\n onDrop: (e: React.DragEvent, isDisabled: boolean) => void;\n onInput: () => void;\n onPaste: (e: React.ClipboardEvent) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n isSlashMenuOpen?: boolean;\n slashItems?: SlashCommandItem[];\n slashSelectedIndex?: number;\n onSlashSelect?: (item: SlashCommandItem) => void;\n}\n\nexport function ChatInputContainer({\n chatContainerRef,\n isDragOver,\n disabled,\n canSubmit,\n isNewConversationPending = false,\n showButton,\n buttonClassName,\n chatInputRef,\n handleFileIconClick,\n handleSubmit,\n onDragOver,\n onDragLeave,\n onDrop,\n onInput,\n onPaste,\n onKeyDown,\n onFocus,\n onBlur,\n isSlashMenuOpen = false,\n slashItems = [],\n slashSelectedIndex = 0,\n onSlashSelect,\n}: ChatInputContainerProps) {\n const conversationMode = useConversationStore(\n (state) => state.conversationMode,\n );\n\n return (\n <div\n ref={chatContainerRef}\n className={cn(\n \"bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full\",\n conversationMode === \"plan\" && \"border border-[#597FF4]\",\n )}\n onDragOver={(e) => onDragOver(e, disabled)}\n onDragLeave={(e) => onDragLeave(e, disabled)}\n onDrop={(e) => onDrop(e, disabled)}\n >\n {/* Drag Over UI */}\n {isDragOver && <DragOver />}\n\n <UploadedFiles />\n\n {/* Wrapper so the slash menu anchors just above the input row,\n not above the entire (possibly resized) container */}\n <div className=\"relative w-full\">\n {isSlashMenuOpen && onSlashSelect && (\n <SlashCommandMenu\n items={slashItems}\n selectedIndex={slashSelectedIndex}\n onSelect={onSlashSelect}\n />\n )}\n\n <ChatInputRow\n chatInputRef={chatInputRef}\n isNewConversationPending={isNewConversationPending}\n onInput={onInput}\n onPaste={onPaste}\n onKeyDown={onKeyDown}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </div>\n\n <ChatInputActions\n disabled={disabled}\n canSubmit={canSubmit}\n onAddFileClick={() => handleFileIconClick(disabled)}\n showButton={showButton}\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n />\n </div>\n );\n}\n"],"mappings":"wZAmCA,SAAgB,EAAmB,CACjC,mBACA,aACA,WACA,YACA,2BAA2B,GAC3B,aACA,kBACA,eACA,sBACA,eACA,aACA,cACA,SACA,UACA,UACA,YACA,UACA,SACA,kBAAkB,GAClB,aAAa,EAAE,CACf,qBAAqB,EACrB,iBAC0B,CAK1B,OACE,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAA,GACT,gIARmB,EAAA,qBACtB,GAAU,EAAM,iBAQb,GAAqB,QAAU,0BAChC,CACD,WAAa,GAAM,EAAW,EAAG,EAAS,CAC1C,YAAc,GAAM,EAAY,EAAG,EAAS,CAC5C,OAAS,GAAM,EAAO,EAAG,EAAS,UARpC,CAWG,IAAc,EAAA,EAAA,KAAC,EAAA,SAAD,EAAY,CAAA,EAE3B,EAAA,EAAA,KAAC,EAAA,cAAD,EAAiB,CAAA,EAIjB,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,2BAAf,CACG,GAAmB,IAClB,EAAA,EAAA,KAAC,EAAA,iBAAD,CACE,MAAO,EACP,cAAe,EACf,SAAU,EACV,CAAA,EAGJ,EAAA,EAAA,KAAC,EAAA,aAAD,CACgB,eACY,2BACjB,UACA,UACE,YACF,UACD,SACR,CAAA,CACE,IAEN,EAAA,EAAA,KAAC,EAAA,iBAAD,CACY,WACC,YACX,mBAAsB,EAAoB,EAAS,CACvC,aACK,kBACH,eACd,CAAA,CACE"}
1
+ {"version":3,"file":"chat-input-container.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-container.tsx"],"sourcesContent":["import React from \"react\";\nimport { DragOver } from \"../drag-over\";\nimport { UploadedFiles } from \"../uploaded-files\";\nimport { ChatInputRow } from \"./chat-input-row\";\nimport { ChatInputActions } from \"./chat-input-actions\";\nimport { SlashCommandMenu } from \"./slash-command-menu\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\nimport { SlashCommandItem } from \"#/hooks/chat/use-slash-command\";\n\ninterface ChatInputContainerProps {\n chatContainerRef: React.RefObject<HTMLDivElement | null>;\n isDragOver: boolean;\n disabled: boolean;\n canSubmit: boolean;\n hasStartedConversation?: boolean;\n isNewConversationPending?: boolean;\n showButton: boolean;\n buttonClassName: string;\n chatInputRef: React.RefObject<HTMLDivElement | null>;\n handleFileIconClick: (isDisabled: boolean) => void;\n handleSubmit: () => void;\n onDragOver: (e: React.DragEvent, isDisabled: boolean) => void;\n onDragLeave: (e: React.DragEvent, isDisabled: boolean) => void;\n onDrop: (e: React.DragEvent, isDisabled: boolean) => void;\n onInput: () => void;\n onPaste: (e: React.ClipboardEvent) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n isSlashMenuOpen?: boolean;\n slashItems?: SlashCommandItem[];\n slashSelectedIndex?: number;\n onSlashSelect?: (item: SlashCommandItem) => void;\n}\n\nexport function ChatInputContainer({\n chatContainerRef,\n isDragOver,\n disabled,\n canSubmit,\n hasStartedConversation,\n isNewConversationPending = false,\n showButton,\n buttonClassName,\n chatInputRef,\n handleFileIconClick,\n handleSubmit,\n onDragOver,\n onDragLeave,\n onDrop,\n onInput,\n onPaste,\n onKeyDown,\n onFocus,\n onBlur,\n isSlashMenuOpen = false,\n slashItems = [],\n slashSelectedIndex = 0,\n onSlashSelect,\n}: ChatInputContainerProps) {\n const conversationMode = useConversationStore(\n (state) => state.conversationMode,\n );\n\n return (\n <div\n ref={chatContainerRef}\n className={cn(\n \"bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full\",\n conversationMode === \"plan\" && \"border border-[#597FF4]\",\n )}\n onDragOver={(e) => onDragOver(e, disabled)}\n onDragLeave={(e) => onDragLeave(e, disabled)}\n onDrop={(e) => onDrop(e, disabled)}\n >\n {/* Drag Over UI */}\n {isDragOver && <DragOver />}\n\n <UploadedFiles />\n\n {/* Wrapper so the slash menu anchors just above the input row,\n not above the entire (possibly resized) container */}\n <div className=\"relative w-full\">\n {isSlashMenuOpen && onSlashSelect && (\n <SlashCommandMenu\n items={slashItems}\n selectedIndex={slashSelectedIndex}\n onSelect={onSlashSelect}\n />\n )}\n\n <ChatInputRow\n chatInputRef={chatInputRef}\n isNewConversationPending={isNewConversationPending}\n onInput={onInput}\n onPaste={onPaste}\n onKeyDown={onKeyDown}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </div>\n\n <ChatInputActions\n disabled={disabled}\n canSubmit={canSubmit}\n hasStartedConversation={hasStartedConversation}\n onAddFileClick={() => handleFileIconClick(disabled)}\n showButton={showButton}\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n />\n </div>\n );\n}\n"],"mappings":"wZAoCA,SAAgB,EAAmB,CACjC,mBACA,aACA,WACA,YACA,yBACA,2BAA2B,GAC3B,aACA,kBACA,eACA,sBACA,eACA,aACA,cACA,SACA,UACA,UACA,YACA,UACA,SACA,kBAAkB,GAClB,aAAa,EAAE,CACf,qBAAqB,EACrB,iBAC0B,CAK1B,OACE,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAA,GACT,gIARmB,EAAA,qBACtB,GAAU,EAAM,iBAQb,GAAqB,QAAU,0BAChC,CACD,WAAa,GAAM,EAAW,EAAG,EAAS,CAC1C,YAAc,GAAM,EAAY,EAAG,EAAS,CAC5C,OAAS,GAAM,EAAO,EAAG,EAAS,UARpC,CAWG,IAAc,EAAA,EAAA,KAAC,EAAA,SAAD,EAAY,CAAA,EAE3B,EAAA,EAAA,KAAC,EAAA,cAAD,EAAiB,CAAA,EAIjB,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,2BAAf,CACG,GAAmB,IAClB,EAAA,EAAA,KAAC,EAAA,iBAAD,CACE,MAAO,EACP,cAAe,EACf,SAAU,EACV,CAAA,EAGJ,EAAA,EAAA,KAAC,EAAA,aAAD,CACgB,eACY,2BACjB,UACA,UACE,YACF,UACD,SACR,CAAA,CACE,IAEN,EAAA,EAAA,KAAC,EAAA,iBAAD,CACY,WACC,YACa,yBACxB,mBAAsB,EAAoB,EAAS,CACvC,aACK,kBACH,eACd,CAAA,CACE"}