@openhands/agent-canvas 1.11.0 → 1.13.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 (766) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BkL3HWa3.js → acp-providers-D1PORKc0.js} +1 -1
  4. package/build/assets/active-backend-context-IqOjobNK.js +2 -0
  5. package/build/assets/{agent-context-settings-Bno1nwPL.js → agent-context-settings-DMrObcIS.js} +1 -1
  6. package/build/assets/agent-profiles-settings-DororXN5.js +1 -0
  7. package/build/assets/agent-server-conversation-service.api-DWBe0rbX.js +86 -0
  8. package/build/assets/{agent-settings-h8hQz-IU.js → agent-settings-BJVk92PU.js} +1 -1
  9. package/build/assets/agent-settings-COfJsQ1d.js +1 -0
  10. package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-CzZsm7ms.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-Qsb83VX1.js → api-key-entry-screen-D8Fade_-.js} +1 -1
  12. package/build/assets/app-settings-CpyGB3AT.js +1 -0
  13. package/build/assets/{automation-detail-7LkL91j9.js → automation-detail-B-jQ39Mm.js} +1 -1
  14. package/build/assets/{automation-export-U2QNyNy6.js → automation-export-B1dywoqk.js} +1 -1
  15. package/build/assets/{automation-setup-route-Bel9_Lue.js → automation-setup-route-C-bWUZBi.js} +1 -1
  16. package/build/assets/{automation-templates-CRLDssaI.js → automation-templates-DgpCGOJV.js} +1 -1
  17. package/build/assets/{automations-list-B2iV3ZKW.js → automations-list-DnMxlxsL.js} +1 -1
  18. package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-HHEneWMw.js} +1 -1
  19. package/build/assets/backend-form-modal-DiVrD4Cm.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-DB4717Iu.js → backend-synced-settings-badge-7MIjpr8M.js} +1 -1
  21. package/build/assets/{badge-yR53enbU.js → badge-CpYmcVZV.js} +1 -1
  22. package/build/assets/{base-modal-3NmIOKDm.js → base-modal-Fnh6Uln9.js} +1 -1
  23. package/build/assets/bot-BQZx8e2i.js +1 -0
  24. package/build/assets/{brand-button-CJcwjnfb.js → brand-button-swT1RyO0.js} +1 -1
  25. package/build/assets/browser-B9AbV6kG.js +7 -0
  26. package/build/assets/{browser-tab-A94o33Vn.js → browser-tab-zAY12m_i.js} +1 -1
  27. package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-DsJtivmL.js} +1 -1
  28. package/build/assets/check-WAFXrrs_.js +1 -0
  29. package/build/assets/chevron-down-CifNWzme.js +1 -0
  30. package/build/assets/circle-check-CtnimJa8.js +1 -0
  31. package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-Cuzx55bo.js} +1 -1
  32. package/build/assets/{cloud-funnel-analytics-CBQdPZl_.js → cloud-funnel-analytics-86CwNdSh.js} +1 -1
  33. package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-D0fRotFi.js} +1 -1
  34. package/build/assets/{command-menu-PsRXVBz2.js → command-menu-BXy03FBl.js} +1 -1
  35. package/build/assets/{condenser-settings-w7L3EFvm.js → condenser-settings-BmZa0ui_.js} +1 -1
  36. package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-BgoN6lbN.js} +1 -1
  37. package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-Bq02tc-P.js} +1 -1
  38. package/build/assets/conversation-BPo8SvLN.js +1 -0
  39. package/build/assets/conversation-CPCVsCUY.js +90 -0
  40. package/build/assets/conversation-panel-BPo8SvLN.js +1 -0
  41. package/build/assets/{conversation-state-store-Bs8gA263.js → conversation-state-store-C5YpjMNy.js} +1 -1
  42. package/build/assets/conversation-store-Blc5xysY.js +6 -0
  43. package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-CMqo_0Bd.js} +1 -1
  44. package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-Cg1pF0xn.js} +1 -1
  45. package/build/assets/{device-verify-BIjXeW9N.js → device-verify-BfQLgNyq.js} +1 -1
  46. package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-BIqQr5mx.js} +1 -1
  47. package/build/assets/{entry.client-DzbDyLkV.js → entry.client-CxFjRYqH.js} +2 -2
  48. package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-C_yV4_bo.js} +1 -1
  49. package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-Bi4qbh2g.js} +1 -1
  50. package/build/assets/{extensions-hub-DOmHPGTA.js → extensions-hub-BqUINAhp.js} +1 -1
  51. package/build/assets/{extensions-navigation-6zU5M1pa.js → extensions-navigation-lraj88Wk.js} +1 -1
  52. package/build/assets/external-link-CgtpA_a1.js +1 -0
  53. package/build/assets/{file-text-RecuaId_.js → file-text-DEK4LSVw.js} +1 -1
  54. package/build/assets/files-tab-DV0L-lFE.js +1 -0
  55. package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-7yFSQJq_.js} +1 -1
  56. package/build/assets/format-model-name-BN_rx1Y3.js +1 -0
  57. package/build/assets/{format-relative-time-DGPQlPx0.js → format-relative-time-DSErAuVr.js} +1 -1
  58. package/build/assets/git-provider-icon-BvlLAche.js +1 -0
  59. package/build/assets/{git-repo-dropdown-B7RvO70z.js → git-repo-dropdown-ByMzpNko.js} +1 -1
  60. package/build/assets/git-repo-dropdown-C6R7hgM8.js +1 -0
  61. package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_sfncLZ.js} +1 -1
  62. package/build/assets/{home-DEZaZqYv.js → home-BOrlwLqG.js} +1 -1
  63. package/build/assets/home-BvMNC6E-.js +1 -0
  64. package/build/assets/{home-store-D7CjMN_-.js → home-store-CxqsY9Fi.js} +1 -1
  65. package/build/assets/index-home-BvMNC6E-.js +1 -0
  66. package/build/assets/info-BRVcJAUg.js +1 -0
  67. package/build/assets/{install-server-modal-BTwK5lbi.js → install-server-modal-Bl4G1zF4.js} +1 -1
  68. package/build/assets/{kebab-menu-item-content-C4CkeiJO.js → kebab-menu-item-content-BGoGFEAg.js} +1 -1
  69. package/build/assets/{launch-DVlx4v9o.js → launch-CkqiSCqi.js} +1 -1
  70. package/build/assets/{list-todo-CheUtB7F.js → list-todo-DNWlzfaM.js} +1 -1
  71. package/build/assets/llm-not-configured-banner-DLw_tu-G.js +27 -0
  72. package/build/assets/llm-settings-B-pkVCrt.js +1 -0
  73. package/build/assets/llm-settings-DSC0-IQ7.js +1 -0
  74. package/build/assets/llm-subscription-service-BAdOl5Xx.js +1 -0
  75. package/build/assets/loader-circle-B47W9XqT.js +1 -0
  76. package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-xhnrGP4Y.js} +1 -1
  77. package/build/assets/{manage-backends-modal-HNWKLYhq.js → manage-backends-modal-DhGk5mJt.js} +1 -1
  78. package/build/assets/manifest-653b89aa.js +1 -0
  79. package/build/assets/{manifest-subpage-layout-D-m-h8_t.js → manifest-subpage-layout-CKWvL2ig.js} +1 -1
  80. package/build/assets/{map-provider-7Bp2aih5.js → map-provider-Mx8mZuE-.js} +1 -1
  81. package/build/assets/markdown-renderer-DUmk7pFc.js +8 -0
  82. package/build/assets/{mcp-gLgPP7AS.js → mcp-DCkvl6K0.js} +2 -2
  83. package/build/assets/mcp-marketplace-utils-DEbMXlQr.js +1 -0
  84. package/build/assets/messages-DSXvyc21.js +40 -0
  85. package/build/assets/{modal-body-duRaxj_K.js → modal-body-gIe21fDv.js} +1 -1
  86. package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D66dlgZ7.js} +1 -1
  87. package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-B6iOGYpI.js} +1 -1
  88. package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-BYX1Pw5W.js} +1 -1
  89. package/build/assets/{npm-DRzJF5Zn.js → npm-DLckoeJc.js} +1 -1
  90. package/build/assets/{onboarding-DSr8hOpk.js → onboarding-D7WDG66N.js} +1 -1
  91. package/build/assets/{onboarding-modal-C6Euf7N4.js → onboarding-modal-C_xVrFNv.js} +1 -1
  92. package/build/assets/{organization-service.api-C4GYWwj9.js → organization-service.api-D-s9z18a.js} +1 -1
  93. package/build/assets/pencil-BGOCPRyu.js +1 -0
  94. package/build/assets/{planner-tab-CZcguxTK.js → planner-tab-AKaXIIfg.js} +1 -1
  95. package/build/assets/{plugins-management-service-BmDzOQsd.js → plugins-management-service-wtmY4QQw.js} +1 -1
  96. package/build/assets/plus-zNEL8rcX.js +1 -0
  97. package/build/assets/{profiles-service.api-CoLTwjc1.js → profiles-service.api-DCMYxHMi.js} +1 -1
  98. package/build/assets/{providers-tBzTpz1w.js → providers-BjrtjX4L.js} +1 -1
  99. package/build/assets/{proxy-DCI9S-LA.js → proxy-9Z_WZggZ.js} +1 -1
  100. package/build/assets/{puzzle-B3v361yY.js → puzzle-BWLmN8z4.js} +1 -1
  101. package/build/assets/recommended-automations-launcher-CFlzhu1o.js +1 -0
  102. package/build/assets/refresh-cw-CXtFWpwv.js +1 -0
  103. package/build/assets/root-CanxKlNV.css +1 -0
  104. package/build/assets/root-DkfG_UWR.js +2 -0
  105. package/build/assets/root-layout-D75LHYhh.js +2 -0
  106. package/build/assets/{schema-field-zhsVDllR.js → schema-field-OnM5Uob_.js} +1 -1
  107. package/build/assets/{sdk-section-page-CS4GWn0y.js → sdk-section-page-m5WQm2sy.js} +1 -1
  108. package/build/assets/search-CycosyjN.js +1 -0
  109. package/build/assets/{secrets-service-DjgGduXk.js → secrets-service-B26R61C1.js} +1 -1
  110. package/build/assets/{secrets-settings-f-qahfbi.js → secrets-settings-CbLYCKOX.js} +1 -1
  111. package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DCspm2U5.js} +1 -1
  112. package/build/assets/{settings-DQd0xLEw.js → settings-BJQI_iBM.js} +1 -1
  113. package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-BI8V_Nov.js} +1 -1
  114. package/build/assets/{settings-index-BVwy9JEp.js → settings-index-BiTqJoH7.js} +1 -1
  115. package/build/assets/{settings-input-D61Vzp9e.js → settings-input-Cz62hWVW.js} +1 -1
  116. package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-z_3FW5H3.js} +1 -1
  117. package/build/assets/{settings-modal-D6D5ngET.js → settings-modal-BIrIVn97.js} +1 -1
  118. package/build/assets/{settings-service.api-DZp7E7A9.js → settings-service.api--rJmnuLa.js} +1 -1
  119. package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-BRsSI8Vs.js} +1 -1
  120. package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-Ba7vel6T.js} +1 -1
  121. package/build/assets/shared-conversation-CQK_PqHx.js +1 -0
  122. package/build/assets/shield-check-T3JsDJiM.js +1 -0
  123. package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-Bhi3hVcu.js} +1 -1
  124. package/build/assets/{sidebar-mobile-menu-toggle-OoZBHxaT.js → sidebar-mobile-menu-toggle-YWJNRN4p.js} +1 -1
  125. package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-BSUlY5Ml.js} +1 -1
  126. package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-Cl1cUv_F.js} +1 -1
  127. package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-BXz8L8Rn.js} +1 -1
  128. package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-QgfKv31M.js} +1 -1
  129. package/build/assets/{skill-scope-B1Per5XI.js → skill-scope-Dc3JPW-8.js} +1 -1
  130. package/build/assets/{skills-plugins-B3AO6sMz.js → skills-plugins-CpTV27n3.js} +1 -1
  131. package/build/assets/{skills-settings-DmmgJ6CT.js → skills-settings-CSW__IW4.js} +1 -1
  132. package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-TJ0mdECe.js} +1 -1
  133. package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-BUMSbgrF.js} +1 -1
  134. package/build/assets/{task-list-tab-C19Q_JNf.js → task-list-tab-mAHMOkUz.js} +1 -1
  135. package/build/assets/{terminal-CbuMRYal.js → terminal-BzxBaHx2.js} +1 -1
  136. package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-O5v1FgxW.js} +1 -1
  137. package/build/assets/trash-2-C0xNVp9c.js +1 -0
  138. package/build/assets/{typography-D9tiHct7.js → typography-NOKSk9_R.js} +1 -1
  139. package/build/assets/usage-tab-tEmVN0KD.js +1 -0
  140. package/build/assets/{use-acp-credential-form-DJmmJKMo.js → use-acp-credential-form-BPNi0Zbm.js} +1 -1
  141. package/build/assets/{use-activate-agent-profile-CeFfYwu_.js → use-activate-agent-profile-D9YRQPTF.js} +1 -1
  142. package/build/assets/{use-agent-profiles-BHLkLbRR.js → use-agent-profiles-Cb2zUW3l.js} +1 -1
  143. package/build/assets/{use-can-manage-org-profiles-Bu4y8gSx.js → use-can-manage-org-profiles-Dxzq2AEd.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-QD9x3ySO.js → use-cloud-current-user-id-Co2eJk2A.js} +1 -1
  145. package/build/assets/{use-config-CPwqciXN.js → use-config-DKAMiI5R.js} +1 -1
  146. package/build/assets/use-create-conversation-CoHTiCbI.js +1 -0
  147. package/build/assets/{use-create-secret-BsOfOLvg.js → use-create-secret-2zBlCDsF.js} +1 -1
  148. package/build/assets/use-is-authed-C52-ivnB.js +1 -0
  149. package/build/assets/{use-is-creating-conversation-CVefC9Ns.js → use-is-creating-conversation-DdaAE6jV.js} +1 -1
  150. package/build/assets/{use-launch-skill-in-chat-BcKNjxxd.js → use-launch-skill-in-chat-COnDpxCQ.js} +1 -1
  151. package/build/assets/use-llm-profiles-C_BHue65.js +1 -0
  152. package/build/assets/{use-manifest-capabilities-DBYPjyV6.js → use-manifest-capabilities-DPrQsaPP.js} +1 -1
  153. package/build/assets/{use-onboarding-completion-CtNJxkXG.js → use-onboarding-completion-CCE8OQgV.js} +1 -1
  154. package/build/assets/{use-plugins-marketplace-ZEA-gyM9.js → use-plugins-marketplace-CEiak69h.js} +1 -1
  155. package/build/assets/use-save-agent-profile-DK9idD6a.js +1 -0
  156. package/build/assets/{use-save-settings-pSjRhD_m.js → use-save-settings-DNmnbG6f.js} +1 -1
  157. package/build/assets/{use-settings-nav-items-CQgkxUbV.js → use-settings-nav-items-BlFL7YhM.js} +1 -1
  158. package/build/assets/{use-settings-BHWsOcIG.js → use-settings-wCwPaSIv.js} +1 -1
  159. package/build/assets/{use-tracking-CGCsBWhg.js → use-tracking-CVwPmhlX.js} +1 -1
  160. package/build/assets/{use-user-conversation-DRfEU8x0.js → use-user-conversation-DVtfg0B_.js} +1 -1
  161. package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-p1xq35r2.js} +1 -1
  162. package/build/assets/{useMutation-ChpkYxI5.js → useMutation-BFDQmgk9.js} +1 -1
  163. package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-DF1NAAeC.js} +1 -1
  164. package/build/assets/{useQuery-BCnzy4LX.js → useQuery-DRv--6bK.js} +1 -1
  165. package/build/assets/utils-zxEjKE70.js +1 -0
  166. package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
  167. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js} +3 -3
  168. package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-D9wR9yM2.js} +1 -1
  169. package/build/assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js +13 -0
  170. package/build/assets/vendor~root-layout-C-IgVx6e.js +1 -0
  171. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js} +1 -1
  172. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js} +1 -1
  173. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js} +1 -1
  174. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js} +1 -1
  175. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js} +2 -2
  176. package/build/assets/{verification-settings-BItwt998.js → verification-settings-B8UMQ7MG.js} +1 -1
  177. package/build/assets/{wrench-B1_H-tL1.js → wrench-DIka3hCq.js} +1 -1
  178. package/build/assets/x-BWKA2Ver.js +1 -0
  179. package/build/assets/zap-DHddTPc0.js +1 -0
  180. package/build/index.html +4 -4
  181. package/build/locales/ar/openhands.json +28 -1
  182. package/build/locales/ca/openhands.json +28 -1
  183. package/build/locales/de/openhands.json +28 -1
  184. package/build/locales/en/openhands.json +28 -1
  185. package/build/locales/es/openhands.json +28 -1
  186. package/build/locales/fr/openhands.json +28 -1
  187. package/build/locales/it/openhands.json +28 -1
  188. package/build/locales/ja/openhands.json +28 -1
  189. package/build/locales/ko-KR/openhands.json +28 -1
  190. package/build/locales/no/openhands.json +28 -1
  191. package/build/locales/pt/openhands.json +28 -1
  192. package/build/locales/tr/openhands.json +28 -1
  193. package/build/locales/uk/openhands.json +28 -1
  194. package/build/locales/zh-CN/openhands.json +28 -1
  195. package/build/locales/zh-TW/openhands.json +28 -1
  196. package/config/defaults.json +3 -3
  197. package/dist/api/agent-server-compatibility.cjs +1 -1
  198. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  199. package/dist/api/agent-server-compatibility.js +1 -1
  200. package/dist/api/agent-server-compatibility.js.map +1 -1
  201. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  202. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  203. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +24 -1
  204. package/dist/api/conversation-service/agent-server-conversation-service.api.js +116 -97
  205. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  206. package/dist/api/llm-balance-service.cjs +2 -0
  207. package/dist/api/llm-balance-service.cjs.map +1 -0
  208. package/dist/api/llm-balance-service.d.ts +33 -0
  209. package/dist/api/llm-balance-service.js +53 -0
  210. package/dist/api/llm-balance-service.js.map +1 -0
  211. package/dist/api/llm-subscription-service.cjs +1 -1
  212. package/dist/api/llm-subscription-service.cjs.map +1 -1
  213. package/dist/api/llm-subscription-service.js +42 -34
  214. package/dist/api/llm-subscription-service.js.map +1 -1
  215. package/dist/components/conversation/index.cjs +1 -1
  216. package/dist/components/conversation/index.d.ts +0 -1
  217. package/dist/components/conversation/index.js +0 -1
  218. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  219. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  220. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +1 -1
  221. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  222. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
  223. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
  224. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +24 -23
  225. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
  226. package/dist/components/conversation-events/chat/group-events.cjs +1 -1
  227. package/dist/components/conversation-events/chat/group-events.cjs.map +1 -1
  228. package/dist/components/conversation-events/chat/group-events.d.ts +3 -3
  229. package/dist/components/conversation-events/chat/group-events.js +27 -26
  230. package/dist/components/conversation-events/chat/group-events.js.map +1 -1
  231. package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
  232. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  233. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  234. package/dist/components/features/chat/components/chat-input-actions.js +123 -118
  235. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  236. package/dist/components/features/chat/components/chat-input-grip.cjs +1 -1
  237. package/dist/components/features/chat/components/chat-input-grip.cjs.map +1 -1
  238. package/dist/components/features/chat/components/chat-input-grip.d.ts +2 -1
  239. package/dist/components/features/chat/components/chat-input-grip.js +7 -7
  240. package/dist/components/features/chat/components/chat-input-grip.js.map +1 -1
  241. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
  242. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
  243. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +61 -60
  244. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
  245. package/dist/components/features/chat/components/context-window-meter.cjs +2 -0
  246. package/dist/components/features/chat/components/context-window-meter.cjs.map +1 -0
  247. package/dist/components/features/chat/components/context-window-meter.d.ts +2 -0
  248. package/dist/components/features/chat/components/context-window-meter.js +131 -0
  249. package/dist/components/features/chat/components/context-window-meter.js.map +1 -0
  250. package/dist/components/features/chat/components/context-window-ring.cjs +2 -0
  251. package/dist/components/features/chat/components/context-window-ring.cjs.map +1 -0
  252. package/dist/components/features/chat/components/context-window-ring.d.ts +26 -0
  253. package/dist/components/features/chat/components/context-window-ring.js +45 -0
  254. package/dist/components/features/chat/components/context-window-ring.js.map +1 -0
  255. package/dist/components/features/chat/custom-chat-input.cjs +1 -1
  256. package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
  257. package/dist/components/features/chat/custom-chat-input.js +68 -67
  258. package/dist/components/features/chat/custom-chat-input.js.map +1 -1
  259. package/dist/components/features/chat/model-messages.cjs +1 -1
  260. package/dist/components/features/chat/model-messages.cjs.map +1 -1
  261. package/dist/components/features/chat/model-messages.js +26 -25
  262. package/dist/components/features/chat/model-messages.js.map +1 -1
  263. package/dist/components/features/chat/path-component.cjs +1 -1
  264. package/dist/components/features/chat/path-component.cjs.map +1 -1
  265. package/dist/components/features/chat/path-component.js +9 -6
  266. package/dist/components/features/chat/path-component.js.map +1 -1
  267. package/dist/components/features/chat/plan-preview.cjs +1 -1
  268. package/dist/components/features/chat/plan-preview.js +4 -4
  269. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
  270. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
  271. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.d.ts +0 -8
  272. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +92 -50
  273. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
  274. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
  275. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
  276. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +7 -2
  277. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +15 -9
  278. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
  279. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs +2 -0
  280. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs.map +1 -0
  281. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.d.ts +20 -0
  282. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js +76 -0
  283. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js.map +1 -0
  284. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  285. package/dist/components/features/controls/server-status-context-menu.cjs.map +1 -1
  286. package/dist/components/features/controls/server-status-context-menu.d.ts +5 -3
  287. package/dist/components/features/controls/server-status-context-menu.js +8 -8
  288. package/dist/components/features/controls/server-status-context-menu.js.map +1 -1
  289. package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
  290. package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
  291. package/dist/components/features/conversation/conversation-name-context-menu.js +58 -61
  292. package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
  293. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  294. package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
  295. package/dist/components/features/conversation/conversation-name-with-status.js +74 -46
  296. package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
  297. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  298. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  299. package/dist/components/features/conversation/conversation-name.js +69 -71
  300. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  301. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs +1 -1
  302. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs.map +1 -1
  303. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js +7 -6
  304. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js.map +1 -1
  305. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  306. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  307. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +92 -86
  308. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  309. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  310. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  311. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +81 -71
  312. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  313. package/dist/components/features/conversation/metrics-modal/cost-section.cjs +1 -1
  314. package/dist/components/features/conversation/metrics-modal/cost-section.cjs.map +1 -1
  315. package/dist/components/features/conversation/metrics-modal/cost-section.js +6 -6
  316. package/dist/components/features/conversation/metrics-modal/cost-section.js.map +1 -1
  317. package/dist/components/features/conversation/metrics-modal/metric-row.cjs +1 -1
  318. package/dist/components/features/conversation/metrics-modal/metric-row.cjs.map +1 -1
  319. package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +2 -1
  320. package/dist/components/features/conversation/metrics-modal/metric-row.js +10 -9
  321. package/dist/components/features/conversation/metrics-modal/metric-row.js.map +1 -1
  322. package/dist/components/features/conversation/metrics-modal/usage-section.cjs +1 -1
  323. package/dist/components/features/conversation/metrics-modal/usage-section.cjs.map +1 -1
  324. package/dist/components/features/conversation/metrics-modal/usage-section.js +2 -1
  325. package/dist/components/features/conversation/metrics-modal/usage-section.js.map +1 -1
  326. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs +2 -0
  327. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs.map +1 -0
  328. package/dist/components/features/conversation/usage-panel/compact-context-button.d.ts +16 -0
  329. package/dist/components/features/conversation/usage-panel/compact-context-button.js +59 -0
  330. package/dist/components/features/conversation/usage-panel/compact-context-button.js.map +1 -0
  331. package/dist/components/features/conversation/usage-panel/context-meter.cjs +2 -0
  332. package/dist/components/features/conversation/usage-panel/context-meter.cjs.map +1 -0
  333. package/dist/components/features/conversation/usage-panel/context-meter.d.ts +19 -0
  334. package/dist/components/features/conversation/usage-panel/context-meter.js +46 -0
  335. package/dist/components/features/conversation/usage-panel/context-meter.js.map +1 -0
  336. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs +2 -0
  337. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs.map +1 -0
  338. package/dist/components/features/conversation/usage-panel/provider-balance-card.d.ts +7 -0
  339. package/dist/components/features/conversation/usage-panel/provider-balance-card.js +57 -0
  340. package/dist/components/features/conversation/usage-panel/provider-balance-card.js.map +1 -0
  341. package/dist/components/features/conversation/usage-panel/usage-panel.cjs +2 -0
  342. package/dist/components/features/conversation/usage-panel/usage-panel.cjs.map +1 -0
  343. package/dist/components/features/conversation/usage-panel/usage-panel.d.ts +9 -0
  344. package/dist/components/features/conversation/usage-panel/usage-panel.js +68 -0
  345. package/dist/components/features/conversation/usage-panel/usage-panel.js.map +1 -0
  346. package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
  347. package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
  348. package/dist/components/features/conversation-panel/budget-display.js +10 -13
  349. package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
  350. package/dist/components/features/conversation-panel/budget-progress-bar.cjs +1 -1
  351. package/dist/components/features/conversation-panel/budget-progress-bar.cjs.map +1 -1
  352. package/dist/components/features/conversation-panel/budget-progress-bar.js +2 -2
  353. package/dist/components/features/conversation-panel/budget-progress-bar.js.map +1 -1
  354. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs +2 -0
  355. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs.map +1 -0
  356. package/dist/components/features/conversation-panel/confirm-archive-modal.d.ts +8 -0
  357. package/dist/components/features/conversation-panel/confirm-archive-modal.js +48 -0
  358. package/dist/components/features/conversation-panel/confirm-archive-modal.js.map +1 -0
  359. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  360. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
  361. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +3 -1
  362. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +39 -34
  363. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
  364. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  365. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  366. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +3 -1
  367. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +104 -80
  368. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  369. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  370. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
  371. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +7 -1
  372. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +28 -20
  373. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
  374. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
  375. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
  376. package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +9 -1
  377. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +94 -84
  378. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
  379. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs +1 -1
  380. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs.map +1 -1
  381. package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +2 -1
  382. package/dist/components/features/conversation-panel/conversation-group-folder-list.js +32 -31
  383. package/dist/components/features/conversation-panel/conversation-group-folder-list.js.map +1 -1
  384. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs +1 -1
  385. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs.map +1 -1
  386. package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +2 -1
  387. package/dist/components/features/conversation-panel/conversation-group-folder-row.js +27 -26
  388. package/dist/components/features/conversation-panel/conversation-group-folder-row.js.map +1 -1
  389. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  390. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  391. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +3 -1
  392. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +116 -106
  393. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  394. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  395. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  396. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +27 -0
  397. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +69 -46
  398. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  399. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  400. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  401. package/dist/components/features/conversation-panel/conversation-panel.js +230 -165
  402. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  403. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  404. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  405. package/dist/components/features/files-tab/file-content-viewer.js +22 -25
  406. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  407. package/dist/components/features/markdown/markdown-table-scroll.cjs +1 -1
  408. package/dist/components/features/markdown/markdown-table-scroll.cjs.map +1 -1
  409. package/dist/components/features/markdown/markdown-table-scroll.js +2 -2
  410. package/dist/components/features/markdown/markdown-table-scroll.js.map +1 -1
  411. package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
  412. package/dist/components/features/settings/llm-profiles/profile-row.js +1 -0
  413. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  414. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
  415. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +2 -2
  416. package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
  417. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  418. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  419. package/dist/components/shared/modals/confirmation-modals/base-modal.js +1 -1
  420. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  421. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  422. package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
  423. package/dist/components/shared/modals/settings/model-selector.js +154 -98
  424. package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
  425. package/dist/config/defaults.cjs +1 -1
  426. package/dist/config/defaults.cjs.map +1 -1
  427. package/dist/config/defaults.js +3 -3
  428. package/dist/config/defaults.js.map +1 -1
  429. package/dist/constants/llm-balance.cjs +2 -0
  430. package/dist/constants/llm-balance.cjs.map +1 -0
  431. package/dist/constants/llm-balance.d.ts +13 -0
  432. package/dist/constants/llm-balance.js +6 -0
  433. package/dist/constants/llm-balance.js.map +1 -0
  434. package/dist/contexts/conversation-websocket-context.cjs +2 -2
  435. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  436. package/dist/contexts/conversation-websocket-context.js +217 -209
  437. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  438. package/dist/hooks/chat/use-grip-resize.cjs +1 -1
  439. package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
  440. package/dist/hooks/chat/use-grip-resize.d.ts +1 -0
  441. package/dist/hooks/chat/use-grip-resize.js +39 -30
  442. package/dist/hooks/chat/use-grip-resize.js.map +1 -1
  443. package/dist/hooks/chat/use-slash-command.cjs +1 -1
  444. package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
  445. package/dist/hooks/chat/use-slash-command.js +61 -60
  446. package/dist/hooks/chat/use-slash-command.js.map +1 -1
  447. package/dist/hooks/mutation/use-condense-conversation.cjs +2 -0
  448. package/dist/hooks/mutation/use-condense-conversation.cjs.map +1 -0
  449. package/dist/hooks/mutation/use-condense-conversation.d.ts +12 -0
  450. package/dist/hooks/mutation/use-condense-conversation.js +17 -0
  451. package/dist/hooks/mutation/use-condense-conversation.js.map +1 -0
  452. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  453. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  454. package/dist/hooks/mutation/use-create-conversation.js +30 -21
  455. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  456. package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
  457. package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
  458. package/dist/hooks/mutation/use-new-conversation-command.js +1 -1
  459. package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
  460. package/dist/hooks/query/use-conversation-metrics.cjs +1 -1
  461. package/dist/hooks/query/use-conversation-metrics.cjs.map +1 -1
  462. package/dist/hooks/query/use-conversation-metrics.js +1 -1
  463. package/dist/hooks/query/use-conversation-metrics.js.map +1 -1
  464. package/dist/hooks/query/use-llm-balance.cjs +2 -0
  465. package/dist/hooks/query/use-llm-balance.cjs.map +1 -0
  466. package/dist/hooks/query/use-llm-balance.d.ts +10 -0
  467. package/dist/hooks/query/use-llm-balance.js +24 -0
  468. package/dist/hooks/query/use-llm-balance.js.map +1 -0
  469. package/dist/hooks/query/use-search-providers.cjs +1 -1
  470. package/dist/hooks/query/use-search-providers.cjs.map +1 -1
  471. package/dist/hooks/query/use-search-providers.js +1 -1
  472. package/dist/hooks/query/use-search-providers.js.map +1 -1
  473. package/dist/hooks/use-await-context-compaction.cjs +2 -0
  474. package/dist/hooks/use-await-context-compaction.cjs.map +1 -0
  475. package/dist/hooks/use-await-context-compaction.d.ts +38 -0
  476. package/dist/hooks/use-await-context-compaction.js +61 -0
  477. package/dist/hooks/use-await-context-compaction.js.map +1 -0
  478. package/dist/hooks/use-compact-context-action.cjs +2 -0
  479. package/dist/hooks/use-compact-context-action.cjs.map +1 -0
  480. package/dist/hooks/use-compact-context-action.d.ts +10 -0
  481. package/dist/hooks/use-compact-context-action.js +61 -0
  482. package/dist/hooks/use-compact-context-action.js.map +1 -0
  483. package/dist/hooks/use-context-window-usage.cjs +2 -0
  484. package/dist/hooks/use-context-window-usage.cjs.map +1 -0
  485. package/dist/hooks/use-context-window-usage.d.ts +5 -0
  486. package/dist/hooks/use-context-window-usage.js +20 -0
  487. package/dist/hooks/use-context-window-usage.js.map +1 -0
  488. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  489. package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
  490. package/dist/hooks/use-conversation-name-context-menu.d.ts +0 -3
  491. package/dist/hooks/use-conversation-name-context-menu.js +54 -57
  492. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  493. package/dist/hooks/use-drag-resize.cjs +1 -1
  494. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  495. package/dist/hooks/use-drag-resize.d.ts +8 -0
  496. package/dist/hooks/use-drag-resize.js +21 -18
  497. package/dist/hooks/use-drag-resize.js.map +1 -1
  498. package/dist/hooks/use-live-conversation-metrics.cjs +2 -0
  499. package/dist/hooks/use-live-conversation-metrics.cjs.map +1 -0
  500. package/dist/hooks/use-live-conversation-metrics.d.ts +18 -0
  501. package/dist/hooks/use-live-conversation-metrics.js +37 -0
  502. package/dist/hooks/use-live-conversation-metrics.js.map +1 -0
  503. package/dist/hooks/use-select-conversation-tab.cjs +1 -1
  504. package/dist/hooks/use-select-conversation-tab.cjs.map +1 -1
  505. package/dist/hooks/use-select-conversation-tab.js +2 -2
  506. package/dist/hooks/use-select-conversation-tab.js.map +1 -1
  507. package/dist/i18n/declaration.cjs +1 -1
  508. package/dist/i18n/declaration.cjs.map +1 -1
  509. package/dist/i18n/declaration.d.ts +27 -0
  510. package/dist/i18n/declaration.js +1 -1
  511. package/dist/i18n/declaration.js.map +1 -1
  512. package/dist/i18n/translation.cjs +2 -2
  513. package/dist/i18n/translation.cjs.map +1 -1
  514. package/dist/i18n/translation.js +474 -15
  515. package/dist/i18n/translation.js.map +1 -1
  516. package/dist/index.cjs +1 -1
  517. package/dist/index.js +28 -29
  518. package/dist/lib/index.cjs +1 -1
  519. package/dist/lib/index.js +0 -1
  520. package/dist/locales/ar/openhands.json +28 -1
  521. package/dist/locales/ca/openhands.json +28 -1
  522. package/dist/locales/de/openhands.json +28 -1
  523. package/dist/locales/en/openhands.json +28 -1
  524. package/dist/locales/es/openhands.json +28 -1
  525. package/dist/locales/fr/openhands.json +28 -1
  526. package/dist/locales/it/openhands.json +28 -1
  527. package/dist/locales/ja/openhands.json +28 -1
  528. package/dist/locales/ko-KR/openhands.json +28 -1
  529. package/dist/locales/no/openhands.json +28 -1
  530. package/dist/locales/pt/openhands.json +28 -1
  531. package/dist/locales/tr/openhands.json +28 -1
  532. package/dist/locales/uk/openhands.json +28 -1
  533. package/dist/locales/zh-CN/openhands.json +28 -1
  534. package/dist/locales/zh-TW/openhands.json +28 -1
  535. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs +5 -5
  536. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs.map +1 -1
  537. package/dist/node_modules/@microlink/react-json-view/dist/main.js +5194 -5187
  538. package/dist/node_modules/@microlink/react-json-view/dist/main.js.map +1 -1
  539. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +2 -1
  540. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -0
  541. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +21 -1
  542. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -0
  543. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +2 -1
  544. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs.map +1 -0
  545. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +22 -1
  546. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js.map +1 -0
  547. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +2 -1
  548. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs.map +1 -0
  549. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +33 -1
  550. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js.map +1 -0
  551. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  552. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  553. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +56 -22
  554. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  555. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs +1 -1
  556. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs.map +1 -1
  557. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js +3 -0
  558. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js.map +1 -1
  559. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +2 -1
  560. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs.map +1 -0
  561. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +31 -1
  562. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js.map +1 -0
  563. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +2 -1
  564. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs.map +1 -0
  565. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +21 -1
  566. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js.map +1 -0
  567. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +2 -1
  568. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs.map +1 -0
  569. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +21 -1
  570. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js.map +1 -0
  571. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.cjs.map +1 -1
  572. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.js.map +1 -1
  573. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  574. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  575. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +9 -5
  576. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  577. package/dist/node_modules/i18next-http-backend/esm/index.cjs +1 -1
  578. package/dist/node_modules/i18next-http-backend/esm/index.cjs.map +1 -1
  579. package/dist/node_modules/i18next-http-backend/esm/index.js +2 -2
  580. package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
  581. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs +2 -0
  582. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs.map +1 -0
  583. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js +31 -0
  584. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js.map +1 -0
  585. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs +2 -0
  586. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs.map +1 -0
  587. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js +23 -0
  588. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js.map +1 -0
  589. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs +2 -0
  590. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs.map +1 -0
  591. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +12 -0
  592. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js.map +1 -0
  593. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs +2 -0
  594. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs.map +1 -0
  595. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js +23 -0
  596. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js.map +1 -0
  597. package/dist/node_modules/zustand/esm/middleware.cjs +3 -3
  598. package/dist/node_modules/zustand/esm/middleware.cjs.map +1 -1
  599. package/dist/node_modules/zustand/esm/middleware.js +33 -31
  600. package/dist/node_modules/zustand/esm/middleware.js.map +1 -1
  601. package/dist/package.cjs +1 -1
  602. package/dist/package.cjs.map +1 -1
  603. package/dist/package.js +17 -16
  604. package/dist/package.js.map +1 -1
  605. package/dist/routes/app-settings.cjs +1 -1
  606. package/dist/routes/app-settings.cjs.map +1 -1
  607. package/dist/routes/app-settings.js +94 -93
  608. package/dist/routes/app-settings.js.map +1 -1
  609. package/dist/routes/llm-settings.cjs +1 -1
  610. package/dist/routes/llm-settings.cjs.map +1 -1
  611. package/dist/routes/llm-settings.js +131 -119
  612. package/dist/routes/llm-settings.js.map +1 -1
  613. package/dist/routes/usage-tab.cjs +2 -0
  614. package/dist/routes/usage-tab.cjs.map +1 -0
  615. package/dist/routes/usage-tab.d.ts +2 -0
  616. package/dist/routes/usage-tab.js +10 -0
  617. package/dist/routes/usage-tab.js.map +1 -0
  618. package/dist/services/child-conversation-launch.cjs +1 -1
  619. package/dist/services/child-conversation-launch.cjs.map +1 -1
  620. package/dist/services/child-conversation-launch.js +11 -5
  621. package/dist/services/child-conversation-launch.js.map +1 -1
  622. package/dist/stores/archived-conversations-store.cjs +2 -0
  623. package/dist/stores/archived-conversations-store.cjs.map +1 -0
  624. package/dist/stores/archived-conversations-store.d.ts +24 -0
  625. package/dist/stores/archived-conversations-store.js +33 -0
  626. package/dist/stores/archived-conversations-store.js.map +1 -0
  627. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  628. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  629. package/dist/stores/conversation-panel-preferences-store.d.ts +3 -0
  630. package/dist/stores/conversation-panel-preferences-store.js +4 -0
  631. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  632. package/dist/stores/conversation-store.cjs.map +1 -1
  633. package/dist/stores/conversation-store.d.ts +1 -1
  634. package/dist/stores/conversation-store.js.map +1 -1
  635. package/dist/stores/metrics-store.cjs +1 -1
  636. package/dist/stores/metrics-store.cjs.map +1 -1
  637. package/dist/stores/metrics-store.d.ts +1 -0
  638. package/dist/stores/metrics-store.js +7 -4
  639. package/dist/stores/metrics-store.js.map +1 -1
  640. package/dist/types/agent-server/core/events/condensation-event.d.ts +3 -0
  641. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +4 -6
  642. package/dist/types/agent-server/type-guards.cjs +1 -1
  643. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  644. package/dist/types/agent-server/type-guards.d.ts +5 -0
  645. package/dist/types/agent-server/type-guards.js +3 -3
  646. package/dist/types/agent-server/type-guards.js.map +1 -1
  647. package/dist/utils/conversation-local-storage.cjs +1 -1
  648. package/dist/utils/conversation-local-storage.cjs.map +1 -1
  649. package/dist/utils/conversation-local-storage.js +2 -1
  650. package/dist/utils/conversation-local-storage.js.map +1 -1
  651. package/dist/utils/format-model-name.cjs +1 -1
  652. package/dist/utils/format-model-name.cjs.map +1 -1
  653. package/dist/utils/format-model-name.d.ts +11 -0
  654. package/dist/utils/format-model-name.js +11 -3
  655. package/dist/utils/format-model-name.js.map +1 -1
  656. package/dist/utils/format-token-count.cjs +2 -0
  657. package/dist/utils/format-token-count.cjs.map +1 -0
  658. package/dist/utils/format-token-count.d.ts +3 -0
  659. package/dist/utils/format-token-count.js +19 -0
  660. package/dist/utils/format-token-count.js.map +1 -0
  661. package/dist/utils/hover-reveal-classes.cjs +2 -0
  662. package/dist/utils/hover-reveal-classes.cjs.map +1 -0
  663. package/dist/utils/hover-reveal-classes.d.ts +34 -0
  664. package/dist/utils/hover-reveal-classes.js +41 -0
  665. package/dist/utils/hover-reveal-classes.js.map +1 -0
  666. package/dist/utils/is-markdown-file-path.cjs +2 -0
  667. package/dist/utils/is-markdown-file-path.cjs.map +1 -0
  668. package/dist/utils/is-markdown-file-path.d.ts +4 -0
  669. package/dist/utils/is-markdown-file-path.js +14 -0
  670. package/dist/utils/is-markdown-file-path.js.map +1 -0
  671. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  672. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  673. package/dist/utils/mcp-marketplace-utils.d.ts +7 -0
  674. package/dist/utils/mcp-marketplace-utils.js +19 -16
  675. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  676. package/dist/utils/transcript-export/index.cjs +3 -3
  677. package/dist/utils/transcript-export/index.cjs.map +1 -1
  678. package/dist/utils/transcript-export/index.js +12 -12
  679. package/dist/utils/transcript-export/index.js.map +1 -1
  680. package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
  681. package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
  682. package/dist/utils/transcript-export/load-complete-events.js +4 -4
  683. package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
  684. package/dist/utils/workspace-relative-path.cjs +2 -0
  685. package/dist/utils/workspace-relative-path.cjs.map +1 -0
  686. package/dist/utils/workspace-relative-path.d.ts +10 -0
  687. package/dist/utils/workspace-relative-path.js +22 -0
  688. package/dist/utils/workspace-relative-path.js.map +1 -0
  689. package/package.json +17 -16
  690. package/scripts/check-sdk-version-sync.mjs +6 -6
  691. package/scripts/dev-process-utils.mjs +6 -1
  692. package/scripts/dev-safe.mjs +57 -2
  693. package/build/assets/active-backend-context-BBvP-bI2.js +0 -2
  694. package/build/assets/agent-profiles-settings-DqoS7RL3.js +0 -1
  695. package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +0 -86
  696. package/build/assets/agent-settings-BJHryp65.js +0 -1
  697. package/build/assets/app-settings-r1RUbgGi.js +0 -1
  698. package/build/assets/backend-form-modal-OroTqnAv.js +0 -1
  699. package/build/assets/bot-DuN83i3p.js +0 -1
  700. package/build/assets/browser--eoQOo4M.js +0 -6
  701. package/build/assets/check-DLOKoFU9.js +0 -1
  702. package/build/assets/chevron-down-CnIbtM6i.js +0 -1
  703. package/build/assets/circle-check-CxCYJrpZ.js +0 -1
  704. package/build/assets/conversation-BUzBZAc-.js +0 -90
  705. package/build/assets/conversation-panel-pzAKsSDb.js +0 -1
  706. package/build/assets/conversation-pzAKsSDb.js +0 -1
  707. package/build/assets/conversation-store-B8Eahyeg.js +0 -6
  708. package/build/assets/external-link-zWbg5KXS.js +0 -1
  709. package/build/assets/files-tab-BzofBmF4.js +0 -1
  710. package/build/assets/git-provider-icon-BLMlwy02.js +0 -1
  711. package/build/assets/git-repo-dropdown-B_PTq4ol.js +0 -1
  712. package/build/assets/home-r89Vj2td.js +0 -1
  713. package/build/assets/index-home-r89Vj2td.js +0 -1
  714. package/build/assets/llm-not-configured-banner-CwKu8C6g.js +0 -27
  715. package/build/assets/llm-settings-BJotLQND.js +0 -1
  716. package/build/assets/llm-settings-CDM-5H2A.js +0 -1
  717. package/build/assets/llm-subscription-service-7eVfDIE1.js +0 -1
  718. package/build/assets/loader-circle-C5AnEN8r.js +0 -1
  719. package/build/assets/manifest-2a36a8f8.js +0 -1
  720. package/build/assets/markdown-renderer-BiiiIznl.js +0 -8
  721. package/build/assets/mcp-marketplace-utils-Dr_HG_ol.js +0 -1
  722. package/build/assets/messages-D1cbVhRK.js +0 -40
  723. package/build/assets/pencil-Bl3GWhgq.js +0 -1
  724. package/build/assets/plus-CtzlyAoF.js +0 -1
  725. package/build/assets/recommended-automations-launcher-BbJAJVED.js +0 -1
  726. package/build/assets/refresh-cw-B9GhC3QC.js +0 -1
  727. package/build/assets/root-BfM_kC_d.css +0 -1
  728. package/build/assets/root-gstBEjty.js +0 -2
  729. package/build/assets/root-layout-BIAFLP9p.js +0 -2
  730. package/build/assets/search-CYaiKHRp.js +0 -1
  731. package/build/assets/shared-conversation-DIxZjElr.js +0 -1
  732. package/build/assets/shield-check-D2cpEpv3.js +0 -1
  733. package/build/assets/trash-2-CzDVN-Iw.js +0 -1
  734. package/build/assets/use-create-conversation-DWaSVUOB.js +0 -1
  735. package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
  736. package/build/assets/use-llm-profiles-CU8ah1pz.js +0 -1
  737. package/build/assets/use-save-agent-profile-DgI_Uz9a.js +0 -1
  738. package/build/assets/utils-DPQfkd-7.js +0 -1
  739. package/build/assets/vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js +0 -13
  740. package/build/assets/x-RYDBg-e2.js +0 -1
  741. package/build/assets/zap-tbKDzCe3.js +0 -1
  742. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs +0 -2
  743. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs.map +0 -1
  744. package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +0 -6
  745. package/dist/components/features/conversation/metrics-modal/context-window-section.js +0 -46
  746. package/dist/components/features/conversation/metrics-modal/context-window-section.js.map +0 -1
  747. package/dist/components/features/conversation/metrics-modal/empty-state.cjs +0 -2
  748. package/dist/components/features/conversation/metrics-modal/empty-state.cjs.map +0 -1
  749. package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +0 -1
  750. package/dist/components/features/conversation/metrics-modal/empty-state.js +0 -18
  751. package/dist/components/features/conversation/metrics-modal/empty-state.js.map +0 -1
  752. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs +0 -2
  753. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs.map +0 -1
  754. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +0 -5
  755. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js +0 -20
  756. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js.map +0 -1
  757. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs +0 -2
  758. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs.map +0 -1
  759. package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +0 -6
  760. package/dist/components/features/conversation/metrics-modal/metrics-modal.js +0 -57
  761. package/dist/components/features/conversation/metrics-modal/metrics-modal.js.map +0 -1
  762. package/dist/icons/u-credit-card.cjs +0 -2
  763. package/dist/icons/u-credit-card.cjs.map +0 -1
  764. package/dist/icons/u-credit-card.js +0 -21
  765. package/dist/icons/u-credit-card.js.map +0 -1
  766. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js} +0 -0
@@ -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 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 // Agent-profile switching lives in the \"+\" tools menu while the conversation\n // hasn't started (OSS-5735) — the pill itself is always an LLM selector. The\n // gate is computed here (not in the menu) so ToolsContextMenu only mounts the\n // profile submenu when it can actually be used: pre-start, not on a task\n // route, and only when the backend has profiles (#1571 fallback). Fetch is\n // limited to the pre-start window.\n const isPreStart = !conversationId || hasStartedConversation === false;\n const agentProfilesForStart = useAgentProfiles({ enabled: isPreStart });\n const showAgentProfileSwitch =\n isPreStart &&\n !(conversationId?.startsWith(\"task-\") ?? false) &&\n (agentProfilesForStart.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 LLM picker to show — the constrained ACP model picker or\n // the LLM-profile picker (unit-tested in `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({ isAcp: modelState.isAcpContext });\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 ) : (\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 showAgentProfileSwitch={showAgentProfileSwitch}\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 + ACP context; see the `pickerKind`\n cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgB,EAAiB,EAC/B,aACA,gBAAY,IACZ,4BACA,2BAAuB,CAAC,GACxB,iBAAa,IACb,sBAAkB,IAClB,yBAAqB,CAAC,KACE;CACxB,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K,OAAO;iBAAsB;MAAkB,CAAA,GACpD,SAAS,IACX,CACC;;IAEJ;;EACF,CAAA,GACL,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;aAFZ,CAIG,MAAyB,KACxB,kBAAC,IAAD;IACE,YAAY;IACZ,mBAAmB;IACT;IACC;GACZ,CAAA,GAEF,MACC,kBAAC,IAAD;IACmB;IACH;IACd,UAAU,KAAY,CAAC;GACxB,CAAA,CAEA;IACF;;AAET"}
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 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 { ContextWindowMeter } from \"./context-window-meter\";\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 // Agent-profile switching lives in the \"+\" tools menu while the conversation\n // hasn't started (OSS-5735) — the pill itself is always an LLM selector. The\n // gate is computed here (not in the menu) so ToolsContextMenu only mounts the\n // profile submenu when it can actually be used: pre-start, not on a task\n // route, and only when the backend has profiles (#1571 fallback). Fetch is\n // limited to the pre-start window.\n const isPreStart = !conversationId || hasStartedConversation === false;\n const agentProfilesForStart = useAgentProfiles({ enabled: isPreStart });\n const showAgentProfileSwitch =\n isPreStart &&\n !(conversationId?.startsWith(\"task-\") ?? false) &&\n (agentProfilesForStart.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 LLM picker to show — the constrained ACP model picker or\n // the LLM-profile picker (unit-tested in `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({ isAcp: modelState.isAcpContext });\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 ) : (\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 showAgentProfileSwitch={showAgentProfileSwitch}\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 + ACP context; see the `pickerKind`\n cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\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 <ContextWindowMeter />\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SA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ACE,OAAO;QACP,QAAQ;QACR,OAAM;OACP,CAAA;MACK,CAAA,GAEP,KACC,OAAO,WAAa,OACpB,KACA,GAAS,aACP,kBAAC,OAAD;OAAK,OAAO;iBAAsB;MAAkB,CAAA,GACpD,SAAS,IACX,CACC;;IAEJ;;EACF,CAAA,GACL,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;aAFZ;IAIG,MAAyB,KACxB,kBAAC,IAAD;KACE,YAAY;KACZ,mBAAmB;KACT;KACC;IACZ,CAAA;IAEH,kBAAC,IAAD,CAAqB,CAAA;IACpB,MACC,kBAAC,IAAD;KACmB;KACH;KACd,UAAU,KAAY,CAAC;IACxB,CAAA;GAEA;IACF;;AAET"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../utils/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({gripRef:e,isGripVisible:n,isGripDragging:i,handleTopEdgeClick:a,handleGripMouseDown:o,handleGripTouchStart:s}){return(0,r.jsxs)(`div`,{className:`absolute top-0 left-0 w-full h-3 z-20 group`,id:`resize-grip`,onClick:a,children:[(0,r.jsx)(`div`,{className:`absolute inset-0 z-[1] cursor-ns-resize select-none`,onMouseDown:o,onTouchStart:s,"aria-hidden":!0}),(0,r.jsx)(`div`,{ref:e,className:t.cn(`pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200`,n||i?`opacity-100`:`opacity-0 group-hover:opacity-100`)})]})}exports.ChatInputGrip=i;
1
+ const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../utils/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({gripRef:e,isGripVisible:n,isGripDragging:i,canResize:a,handleTopEdgeClick:o,handleGripMouseDown:s,handleGripTouchStart:c}){return(0,r.jsxs)(`div`,{className:t.cn(`absolute top-0 left-0 w-full h-3 z-20 group`,!a&&`pointer-events-none`),id:`resize-grip`,onClick:a?o:void 0,children:[a&&(0,r.jsx)(`div`,{className:`absolute inset-0 z-[1] cursor-ns-resize select-none`,onMouseDown:s,onTouchStart:c,"aria-hidden":!0}),(0,r.jsx)(`div`,{ref:e,className:t.cn(`pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200`,!a&&`opacity-0`,a&&(n||i?`opacity-100`:`opacity-0 group-hover:opacity-100`))})]})}exports.ChatInputGrip=i;
2
2
  //# sourceMappingURL=chat-input-grip.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-grip.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-grip.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"#/utils/utils\";\n\ninterface ChatInputGripProps {\n gripRef: React.RefObject<HTMLDivElement | null>;\n isGripVisible: boolean;\n isGripDragging: boolean;\n handleTopEdgeClick: (e: React.MouseEvent) => void;\n handleGripMouseDown: (e: React.MouseEvent) => void;\n handleGripTouchStart: (e: React.TouchEvent) => void;\n}\n\nexport function ChatInputGrip({\n gripRef,\n isGripVisible,\n isGripDragging,\n handleTopEdgeClick,\n handleGripMouseDown,\n handleGripTouchStart,\n}: ChatInputGripProps) {\n return (\n <div\n className=\"absolute top-0 left-0 w-full h-3 z-20 group\"\n id=\"resize-grip\"\n onClick={handleTopEdgeClick}\n >\n {/* Resize hit target; 1px line is drawn at top-0 (flush with chat input box) */}\n <div\n className=\"absolute inset-0 z-[1] cursor-ns-resize select-none\"\n onMouseDown={handleGripMouseDown}\n onTouchStart={handleGripTouchStart}\n aria-hidden\n />\n <div\n ref={gripRef}\n className={cn(\n \"pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200\",\n isGripVisible || isGripDragging\n ? \"opacity-100\"\n : \"opacity-0 group-hover:opacity-100\",\n )}\n />\n </div>\n );\n}\n"],"mappings":"kLAYA,SAAgB,EAAc,CAC5B,UACA,gBACA,iBACA,qBACA,sBACA,wBACqB,CACrB,OACE,EAAA,EAAA,MAAC,MAAD,CACE,UAAU,8CACV,GAAG,cACH,QAAS,WAHX,EAME,EAAA,EAAA,KAAC,MAAD,CACE,UAAU,sDACV,YAAa,EACb,aAAc,EACd,cAAA,EACD,CAAA,GACD,EAAA,EAAA,KAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAA,GACT,uGACA,GAAiB,EACb,cACA,mCACN,CACD,CAAA,CACE,GAET"}
1
+ {"version":3,"file":"chat-input-grip.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-grip.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"#/utils/utils\";\n\ninterface ChatInputGripProps {\n gripRef: React.RefObject<HTMLDivElement | null>;\n isGripVisible: boolean;\n isGripDragging: boolean;\n canResize: boolean;\n handleTopEdgeClick: (e: React.MouseEvent) => void;\n handleGripMouseDown: (e: React.MouseEvent) => void;\n handleGripTouchStart: (e: React.TouchEvent) => void;\n}\n\nexport function ChatInputGrip({\n gripRef,\n isGripVisible,\n isGripDragging,\n canResize,\n handleTopEdgeClick,\n handleGripMouseDown,\n handleGripTouchStart,\n}: ChatInputGripProps) {\n return (\n <div\n className={cn(\n \"absolute top-0 left-0 w-full h-3 z-20 group\",\n !canResize && \"pointer-events-none\",\n )}\n id=\"resize-grip\"\n onClick={canResize ? handleTopEdgeClick : undefined}\n >\n {/* Resize hit target; 1px line is drawn at top-0 (flush with chat input box) */}\n {canResize && (\n <div\n className=\"absolute inset-0 z-[1] cursor-ns-resize select-none\"\n onMouseDown={handleGripMouseDown}\n onTouchStart={handleGripTouchStart}\n aria-hidden\n />\n )}\n <div\n ref={gripRef}\n className={cn(\n \"pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200\",\n !canResize && \"opacity-0\",\n canResize &&\n (isGripVisible || isGripDragging\n ? \"opacity-100\"\n : \"opacity-0 group-hover:opacity-100\"),\n )}\n />\n </div>\n );\n}\n"],"mappings":"kLAaA,SAAgB,EAAc,CAC5B,UACA,gBACA,iBACA,YACA,qBACA,sBACA,wBACqB,CACrB,OACE,EAAA,EAAA,MAAC,MAAD,CACE,UAAW,EAAA,GACT,8CACA,CAAC,GAAa,qBAChB,EACA,GAAG,cACH,QAAS,EAAY,EAAqB,IAAA,YAN5C,CASG,IACC,EAAA,EAAA,KAAC,MAAD,CACE,UAAU,sDACV,YAAa,EACb,aAAc,EACd,cAAA,EACD,CAAA,GAEH,EAAA,EAAA,KAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAA,GACT,uGACA,CAAC,GAAa,YACd,IACG,GAAiB,EACd,cACA,oCACR,CACD,CAAA,CACE,GAET"}
@@ -3,9 +3,10 @@ interface ChatInputGripProps {
3
3
  gripRef: React.RefObject<HTMLDivElement | null>;
4
4
  isGripVisible: boolean;
5
5
  isGripDragging: boolean;
6
+ canResize: boolean;
6
7
  handleTopEdgeClick: (e: React.MouseEvent) => void;
7
8
  handleGripMouseDown: (e: React.MouseEvent) => void;
8
9
  handleGripTouchStart: (e: React.TouchEvent) => void;
9
10
  }
10
- export declare function ChatInputGrip({ gripRef, isGripVisible, isGripDragging, handleTopEdgeClick, handleGripMouseDown, handleGripTouchStart, }: ChatInputGripProps): React.JSX.Element;
11
+ export declare function ChatInputGrip({ gripRef, isGripVisible, isGripDragging, canResize, handleTopEdgeClick, handleGripMouseDown, handleGripTouchStart, }: ChatInputGripProps): React.JSX.Element;
11
12
  export {};
@@ -2,19 +2,19 @@ import { cn as e } from "../../../../utils/utils.js";
2
2
  import "react";
3
3
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
4
  //#region src/components/features/chat/components/chat-input-grip.tsx
5
- function r({ gripRef: r, isGripVisible: i, isGripDragging: a, handleTopEdgeClick: o, handleGripMouseDown: s, handleGripTouchStart: c }) {
5
+ function r({ gripRef: r, isGripVisible: i, isGripDragging: a, canResize: o, handleTopEdgeClick: s, handleGripMouseDown: c, handleGripTouchStart: l }) {
6
6
  return /* @__PURE__ */ n("div", {
7
- className: "absolute top-0 left-0 w-full h-3 z-20 group",
7
+ className: e("absolute top-0 left-0 w-full h-3 z-20 group", !o && "pointer-events-none"),
8
8
  id: "resize-grip",
9
- onClick: o,
10
- children: [/* @__PURE__ */ t("div", {
9
+ onClick: o ? s : void 0,
10
+ children: [o && /* @__PURE__ */ t("div", {
11
11
  className: "absolute inset-0 z-[1] cursor-ns-resize select-none",
12
- onMouseDown: s,
13
- onTouchStart: c,
12
+ onMouseDown: c,
13
+ onTouchStart: l,
14
14
  "aria-hidden": !0
15
15
  }), /* @__PURE__ */ t("div", {
16
16
  ref: r,
17
- className: e("pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200", i || a ? "opacity-100" : "opacity-0 group-hover:opacity-100")
17
+ className: e("pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200", !o && "opacity-0", o && (i || a ? "opacity-100" : "opacity-0 group-hover:opacity-100"))
18
18
  })]
19
19
  });
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-grip.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-grip.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"#/utils/utils\";\n\ninterface ChatInputGripProps {\n gripRef: React.RefObject<HTMLDivElement | null>;\n isGripVisible: boolean;\n isGripDragging: boolean;\n handleTopEdgeClick: (e: React.MouseEvent) => void;\n handleGripMouseDown: (e: React.MouseEvent) => void;\n handleGripTouchStart: (e: React.TouchEvent) => void;\n}\n\nexport function ChatInputGrip({\n gripRef,\n isGripVisible,\n isGripDragging,\n handleTopEdgeClick,\n handleGripMouseDown,\n handleGripTouchStart,\n}: ChatInputGripProps) {\n return (\n <div\n className=\"absolute top-0 left-0 w-full h-3 z-20 group\"\n id=\"resize-grip\"\n onClick={handleTopEdgeClick}\n >\n {/* Resize hit target; 1px line is drawn at top-0 (flush with chat input box) */}\n <div\n className=\"absolute inset-0 z-[1] cursor-ns-resize select-none\"\n onMouseDown={handleGripMouseDown}\n onTouchStart={handleGripTouchStart}\n aria-hidden\n />\n <div\n ref={gripRef}\n className={cn(\n \"pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200\",\n isGripVisible || isGripDragging\n ? \"opacity-100\"\n : \"opacity-0 group-hover:opacity-100\",\n )}\n />\n </div>\n );\n}\n"],"mappings":";;;;AAYA,SAAgB,EAAc,EAC5B,YACA,kBACA,mBACA,uBACA,wBACA,2BACqB;CACrB,OACE,kBAAC,OAAD;EACE,WAAU;EACV,IAAG;EACH,SAAS;YAHX,CAME,kBAAC,OAAD;GACE,WAAU;GACV,aAAa;GACb,cAAc;GACd,eAAA;EACD,CAAA,GACD,kBAAC,OAAD;GACE,KAAK;GACL,WAAW,EACT,wGACA,KAAiB,IACb,gBACA,mCACN;EACD,CAAA,CACE;;AAET"}
1
+ {"version":3,"file":"chat-input-grip.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-grip.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"#/utils/utils\";\n\ninterface ChatInputGripProps {\n gripRef: React.RefObject<HTMLDivElement | null>;\n isGripVisible: boolean;\n isGripDragging: boolean;\n canResize: boolean;\n handleTopEdgeClick: (e: React.MouseEvent) => void;\n handleGripMouseDown: (e: React.MouseEvent) => void;\n handleGripTouchStart: (e: React.TouchEvent) => void;\n}\n\nexport function ChatInputGrip({\n gripRef,\n isGripVisible,\n isGripDragging,\n canResize,\n handleTopEdgeClick,\n handleGripMouseDown,\n handleGripTouchStart,\n}: ChatInputGripProps) {\n return (\n <div\n className={cn(\n \"absolute top-0 left-0 w-full h-3 z-20 group\",\n !canResize && \"pointer-events-none\",\n )}\n id=\"resize-grip\"\n onClick={canResize ? handleTopEdgeClick : undefined}\n >\n {/* Resize hit target; 1px line is drawn at top-0 (flush with chat input box) */}\n {canResize && (\n <div\n className=\"absolute inset-0 z-[1] cursor-ns-resize select-none\"\n onMouseDown={handleGripMouseDown}\n onTouchStart={handleGripTouchStart}\n aria-hidden\n />\n )}\n <div\n ref={gripRef}\n className={cn(\n \"pointer-events-none absolute top-0 left-0 w-full h-px bg-white z-[2] transition-opacity duration-200\",\n !canResize && \"opacity-0\",\n canResize &&\n (isGripVisible || isGripDragging\n ? \"opacity-100\"\n : \"opacity-0 group-hover:opacity-100\"),\n )}\n />\n </div>\n );\n}\n"],"mappings":";;;;AAaA,SAAgB,EAAc,EAC5B,YACA,kBACA,mBACA,cACA,uBACA,wBACA,2BACqB;CACrB,OACE,kBAAC,OAAD;EACE,WAAW,EACT,+CACA,CAAC,KAAa,qBAChB;EACA,IAAG;EACH,SAAS,IAAY,IAAqB,KAAA;YAN5C,CASG,KACC,kBAAC,OAAD;GACE,WAAU;GACV,aAAa;GACb,cAAc;GACd,eAAA;EACD,CAAA,GAEH,kBAAC,OAAD;GACE,KAAK;GACL,WAAW,EACT,wGACA,CAAC,KAAa,aACd,MACG,KAAiB,IACd,gBACA,oCACR;EACD,CAAA,CACE;;AAET"}
@@ -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("../../../../utils/utils.cjs"),i=require("../../../../icons/checkmark.cjs"),a=require("../../../../utils/form-control-classes.cjs"),o=require("../../../../ui/typography.cjs"),s=require("../../../../ui/combobox-caret.cjs"),c=require("../../../../ui/context-menu.cjs"),l=require("../../context-menu/context-menu-list-item.cjs"),u=require("../../../../hooks/use-click-outside-element.cjs"),d=require("../../../../icons/settings-gear.cjs"),f=require("../../../shared/navigation-link.cjs"),p=require("../../../../ui/divider.cjs"),m=require("../../../../hooks/use-chat-input-llm-profile-state.cjs");let h=require("react");h=e.__toESM(h,1);let g=require("react/jsx-runtime");var _=18;function v(e){return e.length<=_?e:`${e.slice(0,_)}…`}function y({onClose:e,dividerInset:a,settingsLinkClassName:s,settingsIconClassName:c}){let{t:u}=t.useTranslation(`openhands`),{profiles:h,currentProfileName:_,currentProfileModel:v,canSwitchProfile:y,selectProfile:b}=m.useChatInputLlmProfileState(),x=y&&h.length>0,S=y?null:_,C=t=>{b(t),e()};return(0,g.jsxs)(g.Fragment,{children:[x&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`li`,{role:`presentation`,className:`px-2 pt-1 pb-0.5`,children:(0,g.jsx)(o.Typography.Text,{className:`text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4`,children:u(n.I18nKey.SETTINGS$AVAILABLE_PROFILES)})}),h.map(t=>{let n=t.name===_;return(0,g.jsxs)(l.ContextMenuListItem,{testId:`chat-input-llm-profile-option-${t.name}`,onClick:r=>{if(r.preventDefault(),r.stopPropagation(),n){e();return}C(t.name)},className:r.cn(`flex flex-col items-stretch gap-0.5`,n&&`bg-[var(--oh-interactive-hover)]`),children:[(0,g.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`flex-1 truncate text-sm leading-5`,title:t.model??t.name,children:t.name}),n&&(0,g.jsx)(i.default,{width:14,height:14,className:`shrink-0`,"aria-hidden":!0})]}),t.model&&(0,g.jsx)(`span`,{className:`block truncate text-xs leading-4 text-[var(--oh-muted)]`,children:t.model})]},t.name)})]}),S&&(0,g.jsx)(`li`,{className:`text-sm`,"data-testid":`chat-input-llm-profile-current`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]`,children:[(0,g.jsx)(`span`,{className:`truncate`,title:S,children:S}),v&&(0,g.jsx)(`span`,{className:`truncate text-xs leading-4 text-[var(--oh-muted)]`,children:v})]})}),(x||S)&&(0,g.jsx)(p.Divider,{inset:a}),(0,g.jsx)(`li`,{className:`text-sm`,children:(0,g.jsxs)(f.NavigationLink,{to:`/settings/llm`,onClick:e,className:r.cn(`flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors`,s),children:[(0,g.jsx)(d.default,{width:16,height:16,className:r.cn(`shrink-0`,c),"aria-hidden":!0}),(0,g.jsx)(`span`,{children:u(n.I18nKey.SETTINGS$LLM_PROFILES)})]})})]})}function b(){let{t:e}=t.useTranslation(`openhands`),{profiles:i,currentProfileName:o,isLoading:l,isSwitching:d}=m.useChatInputLlmProfileState(),[f,p]=h.default.useState(!1),_=h.default.useRef(null),b=u.useClickOutsideElement(()=>p(!1),_);if(l||i.length===0)return null;let x=o??e(n.I18nKey.LLM$SELECT_MODEL_PLACEHOLDER);return(0,g.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,g.jsxs)(`button`,{ref:_,type:`button`,className:r.cn(a.chatInputPillButtonClassName,`max-w-[200px]`),title:o??void 0,"data-testid":`chat-input-llm-profile`,"aria-expanded":f,"aria-haspopup":`dialog`,disabled:d,"aria-busy":d,onClick:e=>{e.preventDefault(),e.stopPropagation(),p(e=>!e)},children:[(0,g.jsx)(`span`,{className:`truncate`,children:v(x)}),(0,g.jsx)(s.ComboboxCaretInline,{isOpen:f})]}),f&&(0,g.jsx)(c.ContextMenu,{ref:b,testId:`chat-input-llm-profile-popover`,position:`top`,alignment:`left`,spacing:`none`,className:`z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto`,children:(0,g.jsx)(y,{onClose:()=>p(!1)})})]})}exports.ChatInputLlmProfileMenuContent=y,exports.ChatInputLlmProfilePicker=b;
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("../../../../utils/utils.cjs"),i=require("../../../../icons/checkmark.cjs"),a=require("../../../../utils/form-control-classes.cjs"),o=require("../../../../utils/format-model-name.cjs"),s=require("../../../../ui/typography.cjs"),c=require("../../../../ui/combobox-caret.cjs"),l=require("../../../../ui/context-menu.cjs"),u=require("../../context-menu/context-menu-list-item.cjs"),d=require("../../../../hooks/use-click-outside-element.cjs"),f=require("../../../../icons/settings-gear.cjs"),p=require("../../../shared/navigation-link.cjs"),m=require("../../../../ui/divider.cjs"),h=require("../../../../hooks/use-chat-input-llm-profile-state.cjs");let g=require("react");g=e.__toESM(g,1);let _=require("react/jsx-runtime");var v=18;function y(e){return e.length<=v?e:`${e.slice(0,v)}…`}function b({onClose:e,dividerInset:a,settingsLinkClassName:c,settingsIconClassName:l}){let{t:d}=t.useTranslation(`openhands`),{profiles:g,currentProfileName:v,currentProfileModel:y,canSwitchProfile:b,selectProfile:x}=h.useChatInputLlmProfileState(),S=b&&g.length>0,C=b?null:v,w=t=>{x(t),e()};return(0,_.jsxs)(_.Fragment,{children:[S&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`li`,{role:`presentation`,className:`px-2 pt-1 pb-0.5`,children:(0,_.jsx)(s.Typography.Text,{className:`text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4`,children:d(n.I18nKey.SETTINGS$AVAILABLE_PROFILES)})}),g.map(t=>{let n=t.name===v,a=o.formatModelNameForDisplay(t.model);return(0,_.jsxs)(u.ContextMenuListItem,{testId:`chat-input-llm-profile-option-${t.name}`,onClick:r=>{if(r.preventDefault(),r.stopPropagation(),n){e();return}w(t.name)},className:r.cn(`flex flex-col items-stretch gap-0.5`,n&&`bg-[var(--oh-interactive-hover)]`),children:[(0,_.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`span`,{className:`flex-1 truncate text-sm leading-5`,title:t.model??t.name,children:t.name}),n&&(0,_.jsx)(i.default,{width:14,height:14,className:`shrink-0`,"aria-hidden":!0})]}),a&&(0,_.jsx)(`span`,{className:`block truncate text-xs leading-4 text-[var(--oh-muted)]`,children:a})]},t.name)})]}),C&&(0,_.jsx)(`li`,{className:`text-sm`,"data-testid":`chat-input-llm-profile-current`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]`,children:[(0,_.jsx)(`span`,{className:`truncate`,title:C,children:C}),y&&(0,_.jsx)(`span`,{className:`truncate text-xs leading-4 text-[var(--oh-muted)]`,children:o.formatModelNameForDisplay(y)})]})}),(S||C)&&(0,_.jsx)(m.Divider,{inset:a}),(0,_.jsx)(`li`,{className:`text-sm`,children:(0,_.jsxs)(p.NavigationLink,{to:`/settings/llm`,onClick:e,className:r.cn(`flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors`,c),children:[(0,_.jsx)(f.default,{width:16,height:16,className:r.cn(`shrink-0`,l),"aria-hidden":!0}),(0,_.jsx)(`span`,{children:d(n.I18nKey.SETTINGS$LLM_PROFILES)})]})})]})}function x(){let{t:e}=t.useTranslation(`openhands`),{profiles:i,currentProfileName:o,isLoading:s,isSwitching:u}=h.useChatInputLlmProfileState(),[f,p]=g.default.useState(!1),m=g.default.useRef(null),v=d.useClickOutsideElement(()=>p(!1),m);if(s||i.length===0)return null;let x=o??e(n.I18nKey.LLM$SELECT_MODEL_PLACEHOLDER);return(0,_.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,_.jsxs)(`button`,{ref:m,type:`button`,className:r.cn(a.chatInputPillButtonClassName,`max-w-[200px]`),title:o??void 0,"data-testid":`chat-input-llm-profile`,"aria-expanded":f,"aria-haspopup":`dialog`,disabled:u,"aria-busy":u,onClick:e=>{e.preventDefault(),e.stopPropagation(),p(e=>!e)},children:[(0,_.jsx)(`span`,{className:`truncate`,children:y(x)}),(0,_.jsx)(c.ComboboxCaretInline,{isOpen:f})]}),f&&(0,_.jsx)(l.ContextMenu,{ref:v,testId:`chat-input-llm-profile-popover`,position:`top`,alignment:`left`,spacing:`none`,className:`z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto`,children:(0,_.jsx)(b,{onClose:()=>p(!1)})})]})}exports.ChatInputLlmProfileMenuContent=b,exports.ChatInputLlmProfilePicker=x;
2
2
  //# sourceMappingURL=chat-input-llm-profile-picker.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-llm-profile-picker.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-llm-profile-picker.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useChatInputLlmProfileState } from \"#/hooks/use-chat-input-llm-profile-state\";\nimport { ComboboxCaretInline } from \"#/ui/combobox-caret\";\nimport SettingsGearIcon from \"#/icons/settings-gear.svg?react\";\nimport CheckIcon from \"#/icons/checkmark.svg?react\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { NavigationLink } from \"#/components/shared/navigation-link\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { ContextMenuListItem } from \"#/components/features/context-menu/context-menu-list-item\";\nimport { Divider } from \"#/ui/divider\";\nimport { Typography } from \"#/ui/typography\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { cn } from \"#/utils/utils\";\nimport { chatInputPillButtonClassName } from \"#/utils/form-control-classes\";\n\nconst PROFILE_LABEL_MAX_CHARS = 18;\n\nfunction truncateLabel(label: string): string {\n return label.length <= PROFILE_LABEL_MAX_CHARS\n ? label\n : `${label.slice(0, PROFILE_LABEL_MAX_CHARS)}…`;\n}\n\ninterface ChatInputLlmProfileMenuContentProps {\n onClose: () => void;\n dividerInset?: \"menu\";\n settingsLinkClassName?: string;\n settingsIconClassName?: string;\n}\n\n/**\n * The in-conversation OpenHands LLM-profile switcher list. Selecting a profile\n * live-swaps the running conversation's LLM via `/switch_profile` (the ACP\n * analog is {@link ChatInputModelMenuContent}). Shared by the inline pill and\n * the chat-input overflow submenu.\n */\nexport function ChatInputLlmProfileMenuContent({\n onClose,\n dividerInset,\n settingsLinkClassName,\n settingsIconClassName,\n}: ChatInputLlmProfileMenuContentProps) {\n const { t } = useTranslation(\"openhands\");\n const {\n profiles,\n currentProfileName,\n currentProfileModel,\n canSwitchProfile,\n selectProfile,\n } = useChatInputLlmProfileState();\n // Read-only surfaces (a cloud member on the home page, or a start-task route)\n // still name the active profile — the same shape ChatInputModelMenuContent\n // uses when the ACP picker is gated off.\n const showProfileList = canSwitchProfile && profiles.length > 0;\n const readOnlyProfileName = canSwitchProfile ? null : currentProfileName;\n\n const handleSelect = (profileName: string) => {\n selectProfile(profileName);\n onClose();\n };\n\n return (\n <>\n {showProfileList && (\n <>\n {/* role=\"presentation\" keeps this a valid <li> child of the\n ContextMenu <ul> without exposing the label as a menu item. */}\n <li role=\"presentation\" className=\"px-2 pt-1 pb-0.5\">\n <Typography.Text className=\"text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4\">\n {t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}\n </Typography.Text>\n </li>\n {profiles.map((profile) => {\n const isCurrent = profile.name === currentProfileName;\n return (\n <ContextMenuListItem\n key={profile.name}\n testId={`chat-input-llm-profile-option-${profile.name}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (isCurrent) {\n onClose();\n return;\n }\n handleSelect(profile.name);\n }}\n className={cn(\n \"flex flex-col items-stretch gap-0.5\",\n isCurrent && \"bg-[var(--oh-interactive-hover)]\",\n )}\n >\n <span className=\"flex items-center gap-2\">\n <span\n className=\"flex-1 truncate text-sm leading-5\"\n title={profile.model ?? profile.name}\n >\n {profile.name}\n </span>\n {isCurrent && (\n <CheckIcon\n width={14}\n height={14}\n className=\"shrink-0\"\n aria-hidden\n />\n )}\n </span>\n {profile.model && (\n <span className=\"block truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {profile.model}\n </span>\n )}\n </ContextMenuListItem>\n );\n })}\n </>\n )}\n {readOnlyProfileName && (\n <li className=\"text-sm\" data-testid=\"chat-input-llm-profile-current\">\n <div className=\"flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]\">\n <span className=\"truncate\" title={readOnlyProfileName}>\n {readOnlyProfileName}\n </span>\n {currentProfileModel && (\n <span className=\"truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {currentProfileModel}\n </span>\n )}\n </div>\n </li>\n )}\n {(showProfileList || readOnlyProfileName) && (\n <Divider inset={dividerInset} />\n )}\n <li className=\"text-sm\">\n <NavigationLink\n to=\"/settings/llm\"\n onClick={onClose}\n className={cn(\n \"flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors\",\n settingsLinkClassName,\n )}\n >\n <SettingsGearIcon\n width={16}\n height={16}\n className={cn(\"shrink-0\", settingsIconClassName)}\n aria-hidden\n />\n <span>{t(I18nKey.SETTINGS$LLM_PROFILES)}</span>\n </NavigationLink>\n </li>\n </>\n );\n}\n\nexport function ChatInputLlmProfilePicker() {\n const { t } = useTranslation(\"openhands\");\n const { profiles, currentProfileName, isLoading, isSwitching } =\n useChatInputLlmProfileState();\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const popoverRef = useClickOutsideElement<HTMLUListElement>(\n () => setIsPopoverOpen(false),\n triggerRef,\n );\n\n // No LLM profiles yet (or the agent-server lacks the surface): stay out of\n // the way, exactly like the ACP/AgentProfile pickers.\n if (isLoading || profiles.length === 0) {\n return null;\n }\n\n const label = currentProfileName ?? t(I18nKey.LLM$SELECT_MODEL_PLACEHOLDER);\n\n return (\n <div className=\"relative min-w-0\">\n <button\n ref={triggerRef}\n type=\"button\"\n className={cn(chatInputPillButtonClassName, \"max-w-[200px]\")}\n title={currentProfileName ?? undefined}\n data-testid=\"chat-input-llm-profile\"\n aria-expanded={isPopoverOpen}\n aria-haspopup=\"dialog\"\n // Disabled mid-switch so re-opening can't fire a second /switch_profile.\n disabled={isSwitching}\n aria-busy={isSwitching}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsPopoverOpen((open) => !open);\n }}\n >\n <span className=\"truncate\">{truncateLabel(label)}</span>\n <ComboboxCaretInline isOpen={isPopoverOpen} />\n </button>\n\n {isPopoverOpen && (\n <ContextMenu\n ref={popoverRef}\n testId=\"chat-input-llm-profile-popover\"\n position=\"top\"\n alignment=\"left\"\n spacing=\"none\"\n className=\"z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto\"\n >\n <ChatInputLlmProfileMenuContent\n onClose={() => setIsPopoverOpen(false)}\n />\n </ContextMenu>\n )}\n </div>\n );\n}\n"],"mappings":"i2BAgBA,IAAM,EAA0B,GAEhC,SAAS,EAAc,EAAuB,CAC5C,OAAO,EAAM,QAAU,EACnB,EACA,GAAG,EAAM,MAAM,EAAG,CAAuB,EAAE,EACjD,CAeA,SAAgB,EAA+B,CAC7C,UACA,eACA,wBACA,yBACsC,CACtC,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,CACJ,WACA,qBACA,sBACA,mBACA,iBACE,EAAA,4BAA4B,EAI1B,EAAkB,GAAoB,EAAS,OAAS,EACxD,EAAsB,EAAmB,KAAO,EAEhD,EAAgB,GAAwB,CAC5C,EAAc,CAAW,EACzB,EAAQ,CACV,EAEA,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EAGE,EAAA,EAAA,KAAC,KAAD,CAAI,KAAK,eAAe,UAAU,6BAChC,EAAA,EAAA,KAAC,EAAA,WAAW,KAAZ,CAAiB,UAAU,+FACxB,EAAE,EAAA,QAAQ,2BAA2B,CACvB,CAAA,CACf,CAAA,EACH,EAAS,IAAK,GAAY,CACzB,IAAM,EAAY,EAAQ,OAAS,EACnC,OACE,EAAA,EAAA,MAAC,EAAA,oBAAD,CAEE,OAAQ,iCAAiC,EAAQ,OACjD,QAAU,GAAU,CAGlB,GAFA,EAAM,eAAe,EACrB,EAAM,gBAAgB,EAClB,EAAW,CACb,EAAQ,EACR,MACF,CACA,EAAa,EAAQ,IAAI,CAC3B,EACA,UAAW,EAAA,GACT,sCACA,GAAa,kCACf,WAfF,EAiBE,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,mCAAhB,EAC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QAAM,OAA0B,IAAI,EACjD,EAAa,EAAA,2BACX,EAAiB,EAAK,EAC5B,CACF,EAIA,GAAI,GAAa,EAAS,SAAW,EACnC,OAAO,KAGT,IAAM,EAAQ,GAAsB,EAAE,EAAA,QAAQ,4BAA4B,EAE1E,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,4BAAf,EACE,EAAA,EAAA,MAAC,SAAD,CACE,IAAK,EACL,KAAK,SACL,UAAW,EAAA,GAAG,EAAA,6BAA8B,eAAe,EAC3D,MAAO,GAAsB,IAAA,GAC7B,cAAY,yBACZ,gBAAe,EACf,gBAAc,SAEd,SAAU,EACV,YAAW,EACX,QAAU,GAAU,CAClB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,EAAkB,GAAS,CAAC,CAAI,CAClC,WAfF,EAiBE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,oBAAY,EAAc,CAAK,CAAQ,CAAA,GACvD,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,OAAQ,CAAgB,CAAA,CACvC,IAEP,IACC,EAAA,EAAA,KAAC,EAAA,YAAD,CACE,IAAK,EACL,OAAO,iCACP,SAAS,MACT,UAAU,OACV,QAAQ,OACR,UAAU,iFAEV,EAAA,EAAA,KAAC,EAAD,CACE,YAAe,EAAiB,EAAK,CACtC,CAAA,CACU,CAAA,CAEZ,GAET"}
1
+ {"version":3,"file":"chat-input-llm-profile-picker.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-llm-profile-picker.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useChatInputLlmProfileState } from \"#/hooks/use-chat-input-llm-profile-state\";\nimport { ComboboxCaretInline } from \"#/ui/combobox-caret\";\nimport SettingsGearIcon from \"#/icons/settings-gear.svg?react\";\nimport CheckIcon from \"#/icons/checkmark.svg?react\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { NavigationLink } from \"#/components/shared/navigation-link\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { ContextMenuListItem } from \"#/components/features/context-menu/context-menu-list-item\";\nimport { Divider } from \"#/ui/divider\";\nimport { Typography } from \"#/ui/typography\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { cn } from \"#/utils/utils\";\nimport { chatInputPillButtonClassName } from \"#/utils/form-control-classes\";\nimport { formatModelNameForDisplay } from \"#/utils/format-model-name\";\n\nconst PROFILE_LABEL_MAX_CHARS = 18;\n\nfunction truncateLabel(label: string): string {\n return label.length <= PROFILE_LABEL_MAX_CHARS\n ? label\n : `${label.slice(0, PROFILE_LABEL_MAX_CHARS)}…`;\n}\n\ninterface ChatInputLlmProfileMenuContentProps {\n onClose: () => void;\n dividerInset?: \"menu\";\n settingsLinkClassName?: string;\n settingsIconClassName?: string;\n}\n\n/**\n * The in-conversation OpenHands LLM-profile switcher list. Selecting a profile\n * live-swaps the running conversation's LLM via `/switch_profile` (the ACP\n * analog is {@link ChatInputModelMenuContent}). Shared by the inline pill and\n * the chat-input overflow submenu.\n */\nexport function ChatInputLlmProfileMenuContent({\n onClose,\n dividerInset,\n settingsLinkClassName,\n settingsIconClassName,\n}: ChatInputLlmProfileMenuContentProps) {\n const { t } = useTranslation(\"openhands\");\n const {\n profiles,\n currentProfileName,\n currentProfileModel,\n canSwitchProfile,\n selectProfile,\n } = useChatInputLlmProfileState();\n // Read-only surfaces (a cloud member on the home page, or a start-task route)\n // still name the active profile — the same shape ChatInputModelMenuContent\n // uses when the ACP picker is gated off.\n const showProfileList = canSwitchProfile && profiles.length > 0;\n const readOnlyProfileName = canSwitchProfile ? null : currentProfileName;\n\n const handleSelect = (profileName: string) => {\n selectProfile(profileName);\n onClose();\n };\n\n return (\n <>\n {showProfileList && (\n <>\n {/* role=\"presentation\" keeps this a valid <li> child of the\n ContextMenu <ul> without exposing the label as a menu item. */}\n <li role=\"presentation\" className=\"px-2 pt-1 pb-0.5\">\n <Typography.Text className=\"text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4\">\n {t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}\n </Typography.Text>\n </li>\n {profiles.map((profile) => {\n const isCurrent = profile.name === currentProfileName;\n const displayModel = formatModelNameForDisplay(profile.model);\n return (\n <ContextMenuListItem\n key={profile.name}\n testId={`chat-input-llm-profile-option-${profile.name}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (isCurrent) {\n onClose();\n return;\n }\n handleSelect(profile.name);\n }}\n className={cn(\n \"flex flex-col items-stretch gap-0.5\",\n isCurrent && \"bg-[var(--oh-interactive-hover)]\",\n )}\n >\n <span className=\"flex items-center gap-2\">\n <span\n className=\"flex-1 truncate text-sm leading-5\"\n title={profile.model ?? profile.name}\n >\n {profile.name}\n </span>\n {isCurrent && (\n <CheckIcon\n width={14}\n height={14}\n className=\"shrink-0\"\n aria-hidden\n />\n )}\n </span>\n {displayModel && (\n <span className=\"block truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {displayModel}\n </span>\n )}\n </ContextMenuListItem>\n );\n })}\n </>\n )}\n {readOnlyProfileName && (\n <li className=\"text-sm\" data-testid=\"chat-input-llm-profile-current\">\n <div className=\"flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]\">\n <span className=\"truncate\" title={readOnlyProfileName}>\n {readOnlyProfileName}\n </span>\n {currentProfileModel && (\n <span className=\"truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {formatModelNameForDisplay(currentProfileModel)}\n </span>\n )}\n </div>\n </li>\n )}\n {(showProfileList || readOnlyProfileName) && (\n <Divider inset={dividerInset} />\n )}\n <li className=\"text-sm\">\n <NavigationLink\n to=\"/settings/llm\"\n onClick={onClose}\n className={cn(\n \"flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors\",\n settingsLinkClassName,\n )}\n >\n <SettingsGearIcon\n width={16}\n height={16}\n className={cn(\"shrink-0\", settingsIconClassName)}\n aria-hidden\n />\n <span>{t(I18nKey.SETTINGS$LLM_PROFILES)}</span>\n </NavigationLink>\n </li>\n </>\n );\n}\n\nexport function ChatInputLlmProfilePicker() {\n const { t } = useTranslation(\"openhands\");\n const { profiles, currentProfileName, isLoading, isSwitching } =\n useChatInputLlmProfileState();\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const popoverRef = useClickOutsideElement<HTMLUListElement>(\n () => setIsPopoverOpen(false),\n triggerRef,\n );\n\n // No LLM profiles yet (or the agent-server lacks the surface): stay out of\n // the way, exactly like the ACP/AgentProfile pickers.\n if (isLoading || profiles.length === 0) {\n return null;\n }\n\n const label = currentProfileName ?? t(I18nKey.LLM$SELECT_MODEL_PLACEHOLDER);\n\n return (\n <div className=\"relative min-w-0\">\n <button\n ref={triggerRef}\n type=\"button\"\n className={cn(chatInputPillButtonClassName, \"max-w-[200px]\")}\n title={currentProfileName ?? undefined}\n data-testid=\"chat-input-llm-profile\"\n aria-expanded={isPopoverOpen}\n aria-haspopup=\"dialog\"\n // Disabled mid-switch so re-opening can't fire a second /switch_profile.\n disabled={isSwitching}\n aria-busy={isSwitching}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsPopoverOpen((open) => !open);\n }}\n >\n <span className=\"truncate\">{truncateLabel(label)}</span>\n <ComboboxCaretInline isOpen={isPopoverOpen} />\n </button>\n\n {isPopoverOpen && (\n <ContextMenu\n ref={popoverRef}\n testId=\"chat-input-llm-profile-popover\"\n position=\"top\"\n alignment=\"left\"\n spacing=\"none\"\n className=\"z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto\"\n >\n <ChatInputLlmProfileMenuContent\n onClose={() => setIsPopoverOpen(false)}\n />\n </ContextMenu>\n )}\n </div>\n );\n}\n"],"mappings":"s5BAiBA,IAAM,EAA0B,GAEhC,SAAS,EAAc,EAAuB,CAC5C,OAAO,EAAM,QAAU,EACnB,EACA,G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SAAD,CACE,IAAK,EACL,KAAK,SACL,UAAW,EAAA,GAAG,EAAA,6BAA8B,eAAe,EAC3D,MAAO,GAAsB,IAAA,GAC7B,cAAY,yBACZ,gBAAe,EACf,gBAAc,SAEd,SAAU,EACV,YAAW,EACX,QAAU,GAAU,CAClB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,EAAkB,GAAS,CAAC,CAAI,CAClC,WAfF,EAiBE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,oBAAY,EAAc,CAAK,CAAQ,CAAA,GACvD,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,OAAQ,CAAgB,CAAA,CACvC,IAEP,IACC,EAAA,EAAA,KAAC,EAAA,YAAD,CACE,IAAK,EACL,OAAO,iCACP,SAAS,MACT,UAAU,OACV,QAAQ,OACR,UAAU,iFAEV,EAAA,EAAA,KAAC,EAAD,CACE,YAAe,EAAiB,EAAK,CACtC,CAAA,CACU,CAAA,CAEZ,GAET"}
@@ -3,131 +3,132 @@ import { I18nKey as t } from "../../../../i18n/declaration.js";
3
3
  import { cn as n } from "../../../../utils/utils.js";
4
4
  import r from "../../../../icons/checkmark.js";
5
5
  import { chatInputPillButtonClassName as i } from "../../../../utils/form-control-classes.js";
6
- import { Typography as a } from "../../../../ui/typography.js";
7
- import { ComboboxCaretInline as o } from "../../../../ui/combobox-caret.js";
8
- import { ContextMenu as s } from "../../../../ui/context-menu.js";
9
- import { ContextMenuListItem as c } from "../../context-menu/context-menu-list-item.js";
10
- import { useClickOutsideElement as l } from "../../../../hooks/use-click-outside-element.js";
11
- import u from "../../../../icons/settings-gear.js";
12
- import { NavigationLink as d } from "../../../shared/navigation-link.js";
13
- import { Divider as f } from "../../../../ui/divider.js";
14
- import { useChatInputLlmProfileState as p } from "../../../../hooks/use-chat-input-llm-profile-state.js";
15
- import m from "react";
16
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
6
+ import { formatModelNameForDisplay as a } from "../../../../utils/format-model-name.js";
7
+ import { Typography as o } from "../../../../ui/typography.js";
8
+ import { ComboboxCaretInline as s } from "../../../../ui/combobox-caret.js";
9
+ import { ContextMenu as c } from "../../../../ui/context-menu.js";
10
+ import { ContextMenuListItem as l } from "../../context-menu/context-menu-list-item.js";
11
+ import { useClickOutsideElement as u } from "../../../../hooks/use-click-outside-element.js";
12
+ import d from "../../../../icons/settings-gear.js";
13
+ import { NavigationLink as f } from "../../../shared/navigation-link.js";
14
+ import { Divider as p } from "../../../../ui/divider.js";
15
+ import { useChatInputLlmProfileState as m } from "../../../../hooks/use-chat-input-llm-profile-state.js";
16
+ import h from "react";
17
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
17
18
  //#region src/components/features/chat/components/chat-input-llm-profile-picker.tsx
18
- var v = 18;
19
- function y(e) {
20
- return e.length <= v ? e : `${e.slice(0, v)}…`;
19
+ var y = 18;
20
+ function b(e) {
21
+ return e.length <= y ? e : `${e.slice(0, y)}…`;
21
22
  }
22
- function b({ onClose: i, dividerInset: o, settingsLinkClassName: s, settingsIconClassName: l }) {
23
- let { t: m } = e("openhands"), { profiles: v, currentProfileName: y, currentProfileModel: b, canSwitchProfile: x, selectProfile: S } = p(), C = x && v.length > 0, w = x ? null : y, T = (e) => {
24
- S(e), i();
23
+ function x({ onClose: i, dividerInset: s, settingsLinkClassName: c, settingsIconClassName: u }) {
24
+ let { t: h } = e("openhands"), { profiles: y, currentProfileName: b, currentProfileModel: x, canSwitchProfile: S, selectProfile: C } = m(), w = S && y.length > 0, T = S ? null : b, E = (e) => {
25
+ C(e), i();
25
26
  };
26
- return /* @__PURE__ */ _(h, { children: [
27
- C && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("li", {
27
+ return /* @__PURE__ */ v(g, { children: [
28
+ w && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("li", {
28
29
  role: "presentation",
29
30
  className: "px-2 pt-1 pb-0.5",
30
- children: /* @__PURE__ */ g(a.Text, {
31
+ children: /* @__PURE__ */ _(o.Text, {
31
32
  className: "text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4",
32
- children: m(t.SETTINGS$AVAILABLE_PROFILES)
33
+ children: h(t.SETTINGS$AVAILABLE_PROFILES)
33
34
  })
34
- }), v.map((e) => {
35
- let t = e.name === y;
36
- return /* @__PURE__ */ _(c, {
35
+ }), y.map((e) => {
36
+ let t = e.name === b, o = a(e.model);
37
+ return /* @__PURE__ */ v(l, {
37
38
  testId: `chat-input-llm-profile-option-${e.name}`,
38
39
  onClick: (n) => {
39
40
  if (n.preventDefault(), n.stopPropagation(), t) {
40
41
  i();
41
42
  return;
42
43
  }
43
- T(e.name);
44
+ E(e.name);
44
45
  },
45
46
  className: n("flex flex-col items-stretch gap-0.5", t && "bg-[var(--oh-interactive-hover)]"),
46
- children: [/* @__PURE__ */ _("span", {
47
+ children: [/* @__PURE__ */ v("span", {
47
48
  className: "flex items-center gap-2",
48
- children: [/* @__PURE__ */ g("span", {
49
+ children: [/* @__PURE__ */ _("span", {
49
50
  className: "flex-1 truncate text-sm leading-5",
50
51
  title: e.model ?? e.name,
51
52
  children: e.name
52
- }), t && /* @__PURE__ */ g(r, {
53
+ }), t && /* @__PURE__ */ _(r, {
53
54
  width: 14,
54
55
  height: 14,
55
56
  className: "shrink-0",
56
57
  "aria-hidden": !0
57
58
  })]
58
- }), e.model && /* @__PURE__ */ g("span", {
59
+ }), o && /* @__PURE__ */ _("span", {
59
60
  className: "block truncate text-xs leading-4 text-[var(--oh-muted)]",
60
- children: e.model
61
+ children: o
61
62
  })]
62
63
  }, e.name);
63
64
  })] }),
64
- w && /* @__PURE__ */ g("li", {
65
+ T && /* @__PURE__ */ _("li", {
65
66
  className: "text-sm",
66
67
  "data-testid": "chat-input-llm-profile-current",
67
- children: /* @__PURE__ */ _("div", {
68
+ children: /* @__PURE__ */ v("div", {
68
69
  className: "flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]",
69
- children: [/* @__PURE__ */ g("span", {
70
+ children: [/* @__PURE__ */ _("span", {
70
71
  className: "truncate",
71
- title: w,
72
- children: w
73
- }), b && /* @__PURE__ */ g("span", {
72
+ title: T,
73
+ children: T
74
+ }), x && /* @__PURE__ */ _("span", {
74
75
  className: "truncate text-xs leading-4 text-[var(--oh-muted)]",
75
- children: b
76
+ children: a(x)
76
77
  })]
77
78
  })
78
79
  }),
79
- (C || w) && /* @__PURE__ */ g(f, { inset: o }),
80
- /* @__PURE__ */ g("li", {
80
+ (w || T) && /* @__PURE__ */ _(p, { inset: s }),
81
+ /* @__PURE__ */ _("li", {
81
82
  className: "text-sm",
82
- children: /* @__PURE__ */ _(d, {
83
+ children: /* @__PURE__ */ v(f, {
83
84
  to: "/settings/llm",
84
85
  onClick: i,
85
- className: n("flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors", s),
86
- children: [/* @__PURE__ */ g(u, {
86
+ className: n("flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors", c),
87
+ children: [/* @__PURE__ */ _(d, {
87
88
  width: 16,
88
89
  height: 16,
89
- className: n("shrink-0", l),
90
+ className: n("shrink-0", u),
90
91
  "aria-hidden": !0
91
- }), /* @__PURE__ */ g("span", { children: m(t.SETTINGS$LLM_PROFILES) })]
92
+ }), /* @__PURE__ */ _("span", { children: h(t.SETTINGS$LLM_PROFILES) })]
92
93
  })
93
94
  })
94
95
  ] });
95
96
  }
96
- function x() {
97
- let { t: r } = e("openhands"), { profiles: a, currentProfileName: c, isLoading: u, isSwitching: d } = p(), [f, h] = m.useState(!1), v = m.useRef(null), x = l(() => h(!1), v);
98
- if (u || a.length === 0) return null;
99
- let S = c ?? r(t.LLM$SELECT_MODEL_PLACEHOLDER);
100
- return /* @__PURE__ */ _("div", {
97
+ function S() {
98
+ let { t: r } = e("openhands"), { profiles: a, currentProfileName: o, isLoading: l, isSwitching: d } = m(), [f, p] = h.useState(!1), g = h.useRef(null), y = u(() => p(!1), g);
99
+ if (l || a.length === 0) return null;
100
+ let S = o ?? r(t.LLM$SELECT_MODEL_PLACEHOLDER);
101
+ return /* @__PURE__ */ v("div", {
101
102
  className: "relative min-w-0",
102
- children: [/* @__PURE__ */ _("button", {
103
- ref: v,
103
+ children: [/* @__PURE__ */ v("button", {
104
+ ref: g,
104
105
  type: "button",
105
106
  className: n(i, "max-w-[200px]"),
106
- title: c ?? void 0,
107
+ title: o ?? void 0,
107
108
  "data-testid": "chat-input-llm-profile",
108
109
  "aria-expanded": f,
109
110
  "aria-haspopup": "dialog",
110
111
  disabled: d,
111
112
  "aria-busy": d,
112
113
  onClick: (e) => {
113
- e.preventDefault(), e.stopPropagation(), h((e) => !e);
114
+ e.preventDefault(), e.stopPropagation(), p((e) => !e);
114
115
  },
115
- children: [/* @__PURE__ */ g("span", {
116
+ children: [/* @__PURE__ */ _("span", {
116
117
  className: "truncate",
117
- children: y(S)
118
- }), /* @__PURE__ */ g(o, { isOpen: f })]
119
- }), f && /* @__PURE__ */ g(s, {
120
- ref: x,
118
+ children: b(S)
119
+ }), /* @__PURE__ */ _(s, { isOpen: f })]
120
+ }), f && /* @__PURE__ */ _(c, {
121
+ ref: y,
121
122
  testId: "chat-input-llm-profile-popover",
122
123
  position: "top",
123
124
  alignment: "left",
124
125
  spacing: "none",
125
126
  className: "z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto",
126
- children: /* @__PURE__ */ g(b, { onClose: () => h(!1) })
127
+ children: /* @__PURE__ */ _(x, { onClose: () => p(!1) })
127
128
  })]
128
129
  });
129
130
  }
130
131
  //#endregion
131
- export { b as ChatInputLlmProfileMenuContent, x as ChatInputLlmProfilePicker };
132
+ export { x as ChatInputLlmProfileMenuContent, S as ChatInputLlmProfilePicker };
132
133
 
133
134
  //# sourceMappingURL=chat-input-llm-profile-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-llm-profile-picker.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-llm-profile-picker.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useChatInputLlmProfileState } from \"#/hooks/use-chat-input-llm-profile-state\";\nimport { ComboboxCaretInline } from \"#/ui/combobox-caret\";\nimport SettingsGearIcon from \"#/icons/settings-gear.svg?react\";\nimport CheckIcon from \"#/icons/checkmark.svg?react\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { NavigationLink } from \"#/components/shared/navigation-link\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { ContextMenuListItem } from \"#/components/features/context-menu/context-menu-list-item\";\nimport { Divider } from \"#/ui/divider\";\nimport { Typography } from \"#/ui/typography\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { cn } from \"#/utils/utils\";\nimport { chatInputPillButtonClassName } from \"#/utils/form-control-classes\";\n\nconst PROFILE_LABEL_MAX_CHARS = 18;\n\nfunction truncateLabel(label: string): string {\n return label.length <= PROFILE_LABEL_MAX_CHARS\n ? label\n : `${label.slice(0, PROFILE_LABEL_MAX_CHARS)}…`;\n}\n\ninterface ChatInputLlmProfileMenuContentProps {\n onClose: () => void;\n dividerInset?: \"menu\";\n settingsLinkClassName?: string;\n settingsIconClassName?: string;\n}\n\n/**\n * The in-conversation OpenHands LLM-profile switcher list. Selecting a profile\n * live-swaps the running conversation's LLM via `/switch_profile` (the ACP\n * analog is {@link ChatInputModelMenuContent}). Shared by the inline pill and\n * the chat-input overflow submenu.\n */\nexport function ChatInputLlmProfileMenuContent({\n onClose,\n dividerInset,\n settingsLinkClassName,\n settingsIconClassName,\n}: ChatInputLlmProfileMenuContentProps) {\n const { t } = useTranslation(\"openhands\");\n const {\n profiles,\n currentProfileName,\n currentProfileModel,\n canSwitchProfile,\n selectProfile,\n } = useChatInputLlmProfileState();\n // Read-only surfaces (a cloud member on the home page, or a start-task route)\n // still name the active profile — the same shape ChatInputModelMenuContent\n // uses when the ACP picker is gated off.\n const showProfileList = canSwitchProfile && profiles.length > 0;\n const readOnlyProfileName = canSwitchProfile ? null : currentProfileName;\n\n const handleSelect = (profileName: string) => {\n selectProfile(profileName);\n onClose();\n };\n\n return (\n <>\n {showProfileList && (\n <>\n {/* role=\"presentation\" keeps this a valid <li> child of the\n ContextMenu <ul> without exposing the label as a menu item. */}\n <li role=\"presentation\" className=\"px-2 pt-1 pb-0.5\">\n <Typography.Text className=\"text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4\">\n {t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}\n </Typography.Text>\n </li>\n {profiles.map((profile) => {\n const isCurrent = profile.name === currentProfileName;\n return (\n <ContextMenuListItem\n key={profile.name}\n testId={`chat-input-llm-profile-option-${profile.name}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (isCurrent) {\n onClose();\n return;\n }\n handleSelect(profile.name);\n }}\n className={cn(\n \"flex flex-col items-stretch gap-0.5\",\n isCurrent && \"bg-[var(--oh-interactive-hover)]\",\n )}\n >\n <span className=\"flex items-center gap-2\">\n <span\n className=\"flex-1 truncate text-sm leading-5\"\n title={profile.model ?? profile.name}\n >\n {profile.name}\n </span>\n {isCurrent && (\n <CheckIcon\n width={14}\n height={14}\n className=\"shrink-0\"\n aria-hidden\n />\n )}\n </span>\n {profile.model && (\n <span className=\"block truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {profile.model}\n </span>\n )}\n </ContextMenuListItem>\n );\n })}\n </>\n )}\n {readOnlyProfileName && (\n <li className=\"text-sm\" data-testid=\"chat-input-llm-profile-current\">\n <div className=\"flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]\">\n <span className=\"truncate\" title={readOnlyProfileName}>\n {readOnlyProfileName}\n </span>\n {currentProfileModel && (\n <span className=\"truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {currentProfileModel}\n </span>\n )}\n </div>\n </li>\n )}\n {(showProfileList || readOnlyProfileName) && (\n <Divider inset={dividerInset} />\n )}\n <li className=\"text-sm\">\n <NavigationLink\n to=\"/settings/llm\"\n onClick={onClose}\n className={cn(\n \"flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors\",\n settingsLinkClassName,\n )}\n >\n <SettingsGearIcon\n width={16}\n height={16}\n className={cn(\"shrink-0\", settingsIconClassName)}\n aria-hidden\n />\n <span>{t(I18nKey.SETTINGS$LLM_PROFILES)}</span>\n </NavigationLink>\n </li>\n </>\n );\n}\n\nexport function ChatInputLlmProfilePicker() {\n const { t } = useTranslation(\"openhands\");\n const { profiles, currentProfileName, isLoading, isSwitching } =\n useChatInputLlmProfileState();\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const popoverRef = useClickOutsideElement<HTMLUListElement>(\n () => setIsPopoverOpen(false),\n triggerRef,\n );\n\n // No LLM profiles yet (or the agent-server lacks the surface): stay out of\n // the way, exactly like the ACP/AgentProfile pickers.\n if (isLoading || profiles.length === 0) {\n return null;\n }\n\n const label = currentProfileName ?? t(I18nKey.LLM$SELECT_MODEL_PLACEHOLDER);\n\n return (\n <div className=\"relative min-w-0\">\n <button\n ref={triggerRef}\n type=\"button\"\n className={cn(chatInputPillButtonClassName, \"max-w-[200px]\")}\n title={currentProfileName ?? undefined}\n data-testid=\"chat-input-llm-profile\"\n aria-expanded={isPopoverOpen}\n aria-haspopup=\"dialog\"\n // Disabled mid-switch so re-opening can't fire a second /switch_profile.\n disabled={isSwitching}\n aria-busy={isSwitching}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsPopoverOpen((open) => !open);\n }}\n >\n <span className=\"truncate\">{truncateLabel(label)}</span>\n <ComboboxCaretInline isOpen={isPopoverOpen} />\n </button>\n\n {isPopoverOpen && (\n <ContextMenu\n ref={popoverRef}\n testId=\"chat-input-llm-profile-popover\"\n position=\"top\"\n alignment=\"left\"\n spacing=\"none\"\n className=\"z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto\"\n >\n <ChatInputLlmProfileMenuContent\n onClose={() => setIsPopoverOpen(false)}\n />\n </ContextMenu>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAM,IAA0B;AAEhC,SAAS,EAAc,GAAuB;CAC5C,OAAO,EAAM,UAAU,IACnB,IACA,GAAG,EAAM,MAAM,GAAG,CAAuB,EAAE;AACjD;AAeA,SAAgB,EAA+B,EAC7C,YACA,iBACA,0BACA,4BACsC;CACtC,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,EACJ,aACA,uBACA,wBACA,qBACA,qBACE,EAA4B,GAI1B,IAAkB,KAAoB,EAAS,SAAS,GACxD,IAAsB,IAAmB,OAAO,GAEhD,KAAgB,MAAwB;EAE5C,AADA,EAAc,CAAW,GACzB,EAAQ;CACV;CAEA,OACE,kBAAA,GAAA,EAAA,UAAA;EACG,KACC,kBAAA,GAAA,EAAA,UAAA,CAGE,kBAAC,MAAD;GAAI,MAAK;GAAe,WAAU;aAChC,kBAAC,EAAW,MAAZ;IAAiB,WAAU;cACxB,EAAE,EAAQ,2BAA2B;GACvB,CAAA;EACf,CAAA,GACH,EAAS,KAAK,MAAY;GACzB,IAAM,IAAY,EAAQ,SAAS;GACnC,OACE,kBAAC,GAAD;IAEE,QAAQ,iCAAiC,EAAQ;IACjD,UAAU,MAAU;KAGlB,IAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GAClB,GAAW;MACb,EAAQ;MACR;KACF;KACA,EAAa,EAAQ,IAAI;IAC3B;IACA,WAAW,EACT,uCACA,KAAa,kCACf;cAfF,CAiBE,kBAAC,QAAD;KAAM,WAAU;eAAhB,CACE,kBAAC,QAAD;MACE,WAAU;MACV,OAAO,EAAQ,SAAS,EAAQ;gBAE/B,EAAQ;KACL,CAAA,GACL,KACC,kBAAC,GAAD;MACE,OAA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;GACf,iBAAc;GAEd,UAAU;GACV,aAAW;GACX,UAAU,MAAU;IAGlB,AAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,GAAkB,MAAS,CAAC,CAAI;GAClC;aAfF,CAiBE,kBAAC,QAAD;IAAM,WAAU;cAAY,EAAc,CAAK;GAAQ,CAAA,GACvD,kBAAC,GAAD,EAAqB,QAAQ,EAAgB,CAAA,CACvC;MAEP,KACC,kBAAC,GAAD;GACE,KAAK;GACL,QAAO;GACP,UAAS;GACT,WAAU;GACV,SAAQ;GACR,WAAU;aAEV,kBAAC,GAAD,EACE,eAAe,EAAiB,EAAK,EACtC,CAAA;EACU,CAAA,CAEZ;;AAET"}
1
+ {"version":3,"file":"chat-input-llm-profile-picker.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-llm-profile-picker.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useChatInputLlmProfileState } from \"#/hooks/use-chat-input-llm-profile-state\";\nimport { ComboboxCaretInline } from \"#/ui/combobox-caret\";\nimport SettingsGearIcon from \"#/icons/settings-gear.svg?react\";\nimport CheckIcon from \"#/icons/checkmark.svg?react\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { NavigationLink } from \"#/components/shared/navigation-link\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { ContextMenuListItem } from \"#/components/features/context-menu/context-menu-list-item\";\nimport { Divider } from \"#/ui/divider\";\nimport { Typography } from \"#/ui/typography\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { cn } from \"#/utils/utils\";\nimport { chatInputPillButtonClassName } from \"#/utils/form-control-classes\";\nimport { formatModelNameForDisplay } from \"#/utils/format-model-name\";\n\nconst PROFILE_LABEL_MAX_CHARS = 18;\n\nfunction truncateLabel(label: string): string {\n return label.length <= PROFILE_LABEL_MAX_CHARS\n ? label\n : `${label.slice(0, PROFILE_LABEL_MAX_CHARS)}…`;\n}\n\ninterface ChatInputLlmProfileMenuContentProps {\n onClose: () => void;\n dividerInset?: \"menu\";\n settingsLinkClassName?: string;\n settingsIconClassName?: string;\n}\n\n/**\n * The in-conversation OpenHands LLM-profile switcher list. Selecting a profile\n * live-swaps the running conversation's LLM via `/switch_profile` (the ACP\n * analog is {@link ChatInputModelMenuContent}). Shared by the inline pill and\n * the chat-input overflow submenu.\n */\nexport function ChatInputLlmProfileMenuContent({\n onClose,\n dividerInset,\n settingsLinkClassName,\n settingsIconClassName,\n}: ChatInputLlmProfileMenuContentProps) {\n const { t } = useTranslation(\"openhands\");\n const {\n profiles,\n currentProfileName,\n currentProfileModel,\n canSwitchProfile,\n selectProfile,\n } = useChatInputLlmProfileState();\n // Read-only surfaces (a cloud member on the home page, or a start-task route)\n // still name the active profile — the same shape ChatInputModelMenuContent\n // uses when the ACP picker is gated off.\n const showProfileList = canSwitchProfile && profiles.length > 0;\n const readOnlyProfileName = canSwitchProfile ? null : currentProfileName;\n\n const handleSelect = (profileName: string) => {\n selectProfile(profileName);\n onClose();\n };\n\n return (\n <>\n {showProfileList && (\n <>\n {/* role=\"presentation\" keeps this a valid <li> child of the\n ContextMenu <ul> without exposing the label as a menu item. */}\n <li role=\"presentation\" className=\"px-2 pt-1 pb-0.5\">\n <Typography.Text className=\"text-[11px] font-medium text-[var(--oh-text-dim)] uppercase tracking-wide leading-4\">\n {t(I18nKey.SETTINGS$AVAILABLE_PROFILES)}\n </Typography.Text>\n </li>\n {profiles.map((profile) => {\n const isCurrent = profile.name === currentProfileName;\n const displayModel = formatModelNameForDisplay(profile.model);\n return (\n <ContextMenuListItem\n key={profile.name}\n testId={`chat-input-llm-profile-option-${profile.name}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (isCurrent) {\n onClose();\n return;\n }\n handleSelect(profile.name);\n }}\n className={cn(\n \"flex flex-col items-stretch gap-0.5\",\n isCurrent && \"bg-[var(--oh-interactive-hover)]\",\n )}\n >\n <span className=\"flex items-center gap-2\">\n <span\n className=\"flex-1 truncate text-sm leading-5\"\n title={profile.model ?? profile.name}\n >\n {profile.name}\n </span>\n {isCurrent && (\n <CheckIcon\n width={14}\n height={14}\n className=\"shrink-0\"\n aria-hidden\n />\n )}\n </span>\n {displayModel && (\n <span className=\"block truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {displayModel}\n </span>\n )}\n </ContextMenuListItem>\n );\n })}\n </>\n )}\n {readOnlyProfileName && (\n <li className=\"text-sm\" data-testid=\"chat-input-llm-profile-current\">\n <div className=\"flex flex-col gap-0.5 p-2 leading-5 text-[var(--oh-foreground)]\">\n <span className=\"truncate\" title={readOnlyProfileName}>\n {readOnlyProfileName}\n </span>\n {currentProfileModel && (\n <span className=\"truncate text-xs leading-4 text-[var(--oh-muted)]\">\n {formatModelNameForDisplay(currentProfileModel)}\n </span>\n )}\n </div>\n </li>\n )}\n {(showProfileList || readOnlyProfileName) && (\n <Divider inset={dividerInset} />\n )}\n <li className=\"text-sm\">\n <NavigationLink\n to=\"/settings/llm\"\n onClick={onClose}\n className={cn(\n \"flex h-[30px] items-center gap-2 rounded p-2 leading-5 text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)] transition-colors\",\n settingsLinkClassName,\n )}\n >\n <SettingsGearIcon\n width={16}\n height={16}\n className={cn(\"shrink-0\", settingsIconClassName)}\n aria-hidden\n />\n <span>{t(I18nKey.SETTINGS$LLM_PROFILES)}</span>\n </NavigationLink>\n </li>\n </>\n );\n}\n\nexport function ChatInputLlmProfilePicker() {\n const { t } = useTranslation(\"openhands\");\n const { profiles, currentProfileName, isLoading, isSwitching } =\n useChatInputLlmProfileState();\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const popoverRef = useClickOutsideElement<HTMLUListElement>(\n () => setIsPopoverOpen(false),\n triggerRef,\n );\n\n // No LLM profiles yet (or the agent-server lacks the surface): stay out of\n // the way, exactly like the ACP/AgentProfile pickers.\n if (isLoading || profiles.length === 0) {\n return null;\n }\n\n const label = currentProfileName ?? t(I18nKey.LLM$SELECT_MODEL_PLACEHOLDER);\n\n return (\n <div className=\"relative min-w-0\">\n <button\n ref={triggerRef}\n type=\"button\"\n className={cn(chatInputPillButtonClassName, \"max-w-[200px]\")}\n title={currentProfileName ?? undefined}\n data-testid=\"chat-input-llm-profile\"\n aria-expanded={isPopoverOpen}\n aria-haspopup=\"dialog\"\n // Disabled mid-switch so re-opening can't fire a second /switch_profile.\n disabled={isSwitching}\n aria-busy={isSwitching}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsPopoverOpen((open) => !open);\n }}\n >\n <span className=\"truncate\">{truncateLabel(label)}</span>\n <ComboboxCaretInline isOpen={isPopoverOpen} />\n </button>\n\n {isPopoverOpen && (\n <ContextMenu\n ref={popoverRef}\n testId=\"chat-input-llm-profile-popover\"\n position=\"top\"\n alignment=\"left\"\n spacing=\"none\"\n className=\"z-[60] mb-2 min-w-[200px] max-w-[320px] max-h-[60vh] overflow-y-auto\"\n >\n <ChatInputLlmProfileMenuContent\n onClose={() => setIsPopoverOpen(false)}\n />\n </ContextMenu>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAM,IAA0B;AAEhC,SAAS,EAAc,GAAuB;CAC5C,OAAO,EAAM,UAAU,IACnB,IACA,GAAG,EAAM,MAAM,GAAG,CAAuB,EAAE;AACjD;AAeA,SAAgB,EAA+B,EAC7C,YACA,iBACA,0BACA,4BACsC;CACtC,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,EACJ,aACA,uBACA,wBACA,qBACA,qBACE,EAA4B,GAI1B,IAAkB,KAAoB,EAAS,SAAS,GACxD,IAAsB,IAAmB,OAAO,GAEhD,KAAgB,MAAwB;EAE5C,AADA,EAAc,CAAW,GACzB,EAAQ;CACV;CAEA,OACE,kBAAA,GAAA,EAAA,UAAA;EACG,KACC,kBAAA,GAAA,EAAA,UAAA,CAGE,kBAAC,MAAD;GAAI,MAAK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,QAAD,EAAA,UAAO,EAAE,EAAQ,qBAAqB,EAAQ,CAAA,CAChC;;EACd,CAAA;CACJ,EAAA,CAAA;AAEN;AAEA,SAAgB,IAA4B;CAC1C,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,EAAE,aAAU,uBAAoB,cAAW,mBAC/C,EAA4B,GACxB,CAAC,GAAe,KAAoB,EAAM,SAAS,EAAK,GACxD,IAAa,EAAM,OAA0B,IAAI,GACjD,IAAa,QACX,EAAiB,EAAK,GAC5B,CACF;CAIA,IAAI,KAAa,EAAS,WAAW,GACnC,OAAO;CAGT,IAAM,IAAQ,KAAsB,EAAE,EAAQ,4BAA4B;CAE1E,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,UAAD;GACE,KAAK;GACL,MAAK;GACL,WAAW,EAAG,GAA8B,eAAe;GAC3D,OAAO,KAAsB,KAAA;GAC7B,eAAY;GACZ,iBAAe;GACf,iBAAc;GAEd,UAAU;GACV,aAAW;GACX,UAAU,MAAU;IAGlB,AAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,GAAkB,MAAS,CAAC,CAAI;GAClC;aAfF,CAiBE,kBAAC,QAAD;IAAM,WAAU;cAAY,EAAc,CAAK;GAAQ,CAAA,GACvD,kBAAC,GAAD,EAAqB,QAAQ,EAAgB,CAAA,CACvC;MAEP,KACC,kBAAC,GAAD;GACE,KAAK;GACL,QAAO;GACP,UAAS;GACT,WAAU;GACV,SAAQ;GACR,WAAU;aAEV,kBAAC,GAAD,EACE,eAAe,EAAiB,EAAK,EACtC,CAAA;EACU,CAAA,CAEZ;;AAET"}
@@ -0,0 +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/gauge.cjs"),i=require("../../../../node_modules/lucide-react/dist/esm/icons/loader-circle.cjs"),a=require("../../../../node_modules/lucide-react/dist/esm/icons/minimize.cjs"),o=require("../../../../utils/utils.cjs"),s=require("../../../../utils/form-control-classes.cjs"),c=require("../../../shared/buttons/styled-tooltip.cjs"),l=require("../../context-menu/context-menu-list-item.cjs"),u=require("../../../../hooks/use-click-outside-element.cjs"),d=require("../../../../ui/divider.cjs"),f=require("../../../../hooks/use-select-conversation-tab.cjs"),p=require("../../../../hooks/use-context-window-usage.cjs"),m=require("../../../../utils/format-token-count.cjs"),h=require("../../../../hooks/use-compact-context-action.cjs"),g=require("../../conversation/conversation-name-context-menu-icon-text.cjs"),_=require("../../conversation/usage-panel/context-meter.cjs"),v=require("./context-window-ring.cjs");let y=require("react");y=e.__toESM(y,1);let b=require("react/jsx-runtime");var x={neutral:`bg-foreground`,warning:`bg-amber-500`,danger:`bg-red-500`},S={neutral:`text-[var(--oh-muted)]`,warning:`text-amber-500`,danger:`text-red-500`};function C(){let{t:e}=t.useTranslation(`openhands`),C=p.useContextWindowUsage(),{navigateToTab:w}=f.useSelectConversationTab(),[T,E]=y.default.useState(!1),D=y.default.useRef(null),O=u.useClickOutsideElement(()=>E(!1),D),{handleCompact:k,isCompacting:A,isDisabled:j}=h.useCompactContextAction(C?.perTurnToken??0);if(!C)return null;let M=m.getContextWindowUsagePercentage(C.perTurnToken,C.contextWindow),N=Math.round(M),P=Math.max(0,100-N),F=`${N}% ${e(n.I18nKey.CONVERSATION$USED)} (${P}% ${e(n.I18nKey.CONVERSATION$LEFT)})`,I=`${m.formatCompactTokenCount(C.perTurnToken)} / ${m.formatCompactTokenCount(C.contextWindow)}`,L=_.getContextFillTone(M),R=()=>{E(!1),w(`usage`)};return(0,b.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,b.jsx)(c.StyledTooltip,{content:e(n.I18nKey.CHAT_INTERFACE$SHOW_CONTEXT),placement:`top`,children:(0,b.jsx)(`button`,{ref:D,type:`button`,className:o.cn(s.chatInputIconButtonClassName,`size-8`),"aria-label":`${e(n.I18nKey.CHAT_INTERFACE$CONTEXT_WINDOW_METER_LABEL)}: ${F}`,"aria-expanded":T,"aria-haspopup":`dialog`,"data-testid":`context-window-meter`,onClick:e=>{e.preventDefault(),e.stopPropagation(),E(e=>!e)},children:(0,b.jsx)(v.ContextWindowRing,{percentage:M})})}),T&&(0,b.jsxs)(`div`,{ref:O,"data-testid":`context-window-meter-popover`,className:o.cn(`absolute bottom-full right-0 z-[60] mb-2 w-[280px]`,`flex flex-col gap-0.5 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`),children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 px-2 py-1.5`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,b.jsx)(`span`,{className:`font-semibold text-[var(--oh-foreground)]`,children:e(n.I18nKey.CONVERSATION$CONTEXT_WINDOW)}),(0,b.jsx)(`span`,{className:o.cn(`shrink-0 text-xs`,S[L]),children:F})]}),(0,b.jsx)(`button`,{type:`button`,"data-testid":`context-window-meter-bar-button`,className:`relative h-1.5 w-full rounded-full cursor-pointer`,style:{backgroundColor:v.CONTEXT_WINDOW_TRACK_COLOR},"aria-label":e(n.I18nKey.COMMON$USAGE),onClick:e=>{e.preventDefault(),e.stopPropagation(),R()},children:(0,b.jsx)(`span`,{className:o.cn(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,x[L]),style:{width:`${Math.min(100,M)}%`}})}),(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,b.jsxs)(`button`,{type:`button`,"data-testid":`context-window-compact-button`,disabled:j,"aria-busy":A,"aria-label":e(n.I18nKey.CONVERSATION$COMPACT_CONTEXT),className:o.cn(`inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs`,`text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,`transition-colors disabled:cursor-not-allowed disabled:opacity-50`),onClick:e=>{e.preventDefault(),e.stopPropagation(),k()},children:[A?(0,b.jsx)(i.LoaderCircle,{className:`size-3 animate-spin`,"aria-hidden":!0}):(0,b.jsx)(a.Minimize,{className:`size-3`,"aria-hidden":!0}),(0,b.jsx)(`span`,{children:e(n.I18nKey.CONVERSATION$COMPACT_CONTEXT)})]}),(0,b.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:I})]})]}),(0,b.jsx)(d.Divider,{inset:`menu`}),(0,b.jsx)(l.ContextMenuListItem,{testId:`context-window-plan-usage`,onClick:e=>{e.preventDefault(),e.stopPropagation(),R()},children:(0,b.jsx)(g.ConversationNameContextMenuIconText,{icon:(0,b.jsx)(r.Gauge,{size:16}),text:e(n.I18nKey.COMMON$USAGE)})})]})]})}exports.ContextWindowMeter=C;
2
+ //# sourceMappingURL=context-window-meter.cjs.map