@openhands/agent-canvas 1.10.0 → 1.12.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 (531) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-DLe_gVDY.js → acp-providers-BkL3HWa3.js} +1 -1
  4. package/build/assets/{active-backend-context-B0wI7OzM.js → active-backend-context-B_bg5h9O.js} +1 -1
  5. package/build/assets/{agent-context-settings-CaQtdNA-.js → agent-context-settings-CzWS1DgR.js} +1 -1
  6. package/build/assets/{agent-profiles-settings-CvuErjp6.js → agent-profiles-settings-hd2cAIZM.js} +1 -1
  7. package/build/assets/agent-server-conversation-service.api-BheU4HX3.js +86 -0
  8. package/build/assets/{agent-settings-UE-U4Xii.js → agent-settings-D2J1dKVd.js} +1 -1
  9. package/build/assets/agent-settings-D_SVrWhI.js +1 -0
  10. package/build/assets/{alert-banner-BMaOtTCG.js → alert-banner-lrK-2_0Y.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-Cy66vT4D.js → api-key-entry-screen-D70oJj2c.js} +1 -1
  12. package/build/assets/app-settings-D0OKHB3M.js +1 -0
  13. package/build/assets/{automation-detail-fuITm6i3.js → automation-detail-C0SxWTnQ.js} +3 -3
  14. package/build/assets/{automation-export-CRq40mux.js → automation-export-BjQa_fT6.js} +1 -1
  15. package/build/assets/{automation-setup-route-EXDazOHW.js → automation-setup-route-BzCNpljP.js} +1 -1
  16. package/build/assets/{automation-templates-BArZsaxP.js → automation-templates-D9gs6ihu.js} +1 -1
  17. package/build/assets/{automations-list-CG4HKOTn.js → automations-list-dZg8zOCl.js} +1 -1
  18. package/build/assets/{back-nav-button-BZB6H7xz.js → back-nav-button-B3pYwmUJ.js} +1 -1
  19. package/build/assets/{backend-form-modal-B_lXjOGa.js → backend-form-modal-HwclKrUS.js} +1 -1
  20. package/build/assets/{backend-synced-settings-badge-B_NXJ3u1.js → backend-synced-settings-badge-YI3k09Wr.js} +1 -1
  21. package/build/assets/{badge-C64c-7PO.js → badge-Dpn3-LTV.js} +1 -1
  22. package/build/assets/{base-modal-C0RQPug5.js → base-modal-3NmIOKDm.js} +1 -1
  23. package/build/assets/{brand-button-DJmFCyMK.js → brand-button-CJcwjnfb.js} +1 -1
  24. package/build/assets/{browser-D3gd2n83.js → browser--eoQOo4M.js} +1 -1
  25. package/build/assets/{browser-tab-BicAWuJ1.js → browser-tab-4CPdj3J3.js} +1 -1
  26. package/build/assets/{chat-send-button-CCrH1E8u.js → chat-send-button-B8n6-DQA.js} +1 -1
  27. package/build/assets/{circle-plus-check-toggle-CB_sNERY.js → circle-plus-check-toggle-BVzv5EkZ.js} +1 -1
  28. package/build/assets/{cloud-funnel-analytics-XynamQGU.js → cloud-funnel-analytics-CcSez21r.js} +1 -1
  29. package/build/assets/{combobox-caret-Bwiifgjs.js → combobox-caret-BlmRwiM8.js} +1 -1
  30. package/build/assets/command-menu-BKOLj-TC.js +1 -0
  31. package/build/assets/{condenser-settings-cNGy75gq.js → condenser-settings-DLQogFnB.js} +1 -1
  32. package/build/assets/{confirmation-modal-BATFmFyP.js → confirmation-modal-DAH0XtOp.js} +1 -1
  33. package/build/assets/{context-menu-list-item-DhJCcBA0.js → context-menu-list-item-BQhmFVEK.js} +1 -1
  34. package/build/assets/{conversation-Csdxh9Xt.js → conversation-Cmyw9bFh.js} +4 -4
  35. package/build/assets/conversation-CvoGZ5vC.js +1 -0
  36. package/build/assets/conversation-panel-CvoGZ5vC.js +1 -0
  37. package/build/assets/{conversation-state-store-C2QzhPaK.js → conversation-state-store-CtgILxWF.js} +1 -1
  38. package/build/assets/{conversation-tab-empty-state-D3fb5xIA.js → conversation-tab-empty-state-C9sfDOlt.js} +1 -1
  39. package/build/assets/{copy-to-clipboard-button-c4MQwKGj.js → copy-to-clipboard-button-DatoElj8.js} +1 -1
  40. package/build/assets/{device-verify-oFpQoLgm.js → device-verify-BIjXeW9N.js} +1 -1
  41. package/build/assets/{dropdown-classes-f91ARMV1.js → dropdown-classes-zFW7qPSK.js} +1 -1
  42. package/build/assets/{entry.client-BCzY2Bf3.js → entry.client-EBn3ZtNP.js} +2 -2
  43. package/build/assets/{enum-filter-dropdown-HG3q3rkV.js → enum-filter-dropdown-CctILg5t.js} +1 -1
  44. package/build/assets/{environment-switch-overlay-CquZXolz.js → environment-switch-overlay-Cvmo6clk.js} +1 -1
  45. package/build/assets/{extensions-hub-BeweE0PW.js → extensions-hub-BZ3HYztk.js} +1 -1
  46. package/build/assets/{extensions-navigation-Dd58NlUF.js → extensions-navigation-Bnx32WAb.js} +1 -1
  47. package/build/assets/{files-tab-CLLG55-q.js → files-tab-D5zuU5TY.js} +1 -1
  48. package/build/assets/{form-control-classes-pHtZUI6K.js → form-control-classes-DLN3Qgub.js} +1 -1
  49. package/build/assets/format-model-name-BN_rx1Y3.js +1 -0
  50. package/build/assets/{format-relative-time-6-3uvOXe.js → format-relative-time-BerVamGl.js} +1 -1
  51. package/build/assets/{git-provider-icon-wg7ShB98.js → git-provider-icon-zuKz2cwo.js} +1 -1
  52. package/build/assets/{git-repo-dropdown-CWnaUyxL.js → git-repo-dropdown-B5VnMftu.js} +1 -1
  53. package/build/assets/git-repo-dropdown-Bo7ciSNX.js +1 -0
  54. package/build/assets/{highlighted-source-view-DBtI3por.js → highlighted-source-view-CgJfD5VT.js} +1 -1
  55. package/build/assets/home-DqyeeFA_.js +1 -0
  56. package/build/assets/{home-BpZQkDWM.js → home-Y0aDou-a.js} +1 -1
  57. package/build/assets/{home-store-DM4qw1lF.js → home-store-Cubdq0uP.js} +1 -1
  58. package/build/assets/index-home-DqyeeFA_.js +1 -0
  59. package/build/assets/install-server-modal-DW6dSyGr.js +1 -0
  60. package/build/assets/{kebab-menu-item-content-By16Tm_0.js → kebab-menu-item-content-CKydZrbH.js} +1 -1
  61. package/build/assets/{launch-C9uijypN.js → launch-c4GEP8oo.js} +1 -1
  62. package/build/assets/llm-not-configured-banner-DCE_0B4I.js +27 -0
  63. package/build/assets/llm-settings-8eWBF3Ij.js +1 -0
  64. package/build/assets/llm-settings-D9ko42Pi.js +1 -0
  65. package/build/assets/{llm-subscription-service-DwjJ8-_X.js → llm-subscription-service-B3K-97lP.js} +1 -1
  66. package/build/assets/{loading-spinner-6Yj-YyoS.js → loading-spinner-CN3riY7k.js} +1 -1
  67. package/build/assets/{manage-backends-modal-DrwErS0N.js → manage-backends-modal-DTCME_Pu.js} +1 -1
  68. package/build/assets/manifest-e1c3bc3b.js +1 -0
  69. package/build/assets/{manifest-subpage-layout-CtqVwIvJ.js → manifest-subpage-layout-Ds7G5GZ8.js} +1 -1
  70. package/build/assets/map-provider-7Bp2aih5.js +1 -0
  71. package/build/assets/markdown-renderer-DzvgdZey.js +8 -0
  72. package/build/assets/mcp-Da7wFU7A.js +9 -0
  73. package/build/assets/{mcp-marketplace-utils-BMnYz0Gc.js → mcp-marketplace-utils-DSLou4n7.js} +1 -1
  74. package/build/assets/messages-B2l0qLVk.js +40 -0
  75. package/build/assets/{modal-body-BHGCSAtj.js → modal-body-duRaxj_K.js} +1 -1
  76. package/build/assets/{modal-classes-DSTLuxkA.js → modal-classes-CLEXO6dj.js} +1 -1
  77. package/build/assets/{modal-close-button-dheWZ2ys.js → modal-close-button-D0aT02hs.js} +1 -1
  78. package/build/assets/npm-Cswluf6-.js +1 -0
  79. package/build/assets/{onboarding-5CZvRBbh.js → onboarding-BKbTYlW1.js} +1 -1
  80. package/build/assets/{onboarding-modal-CD2ehuxt.js → onboarding-modal-DrrGlEQq.js} +1 -1
  81. package/build/assets/{organization-service.api-Dsuoep0g.js → organization-service.api-DK8csGvK.js} +1 -1
  82. package/build/assets/{planner-tab-DeO7Thb0.js → planner-tab-D-mZ1I7n.js} +1 -1
  83. package/build/assets/{plugins-management-service-C9f75R6X.js → plugins-management-service-CywqyfLK.js} +1 -1
  84. package/build/assets/{profiles-service.api-Dl20_2IM.js → profiles-service.api-vcE_jJCe.js} +1 -1
  85. package/build/assets/{providers-CeuhK46N.js → providers-CdrPPm0z.js} +1 -1
  86. package/build/assets/{proxy-CIGI9zQC.js → proxy-b4aqL4SX.js} +1 -1
  87. package/build/assets/recommended-automations-launcher-DIYgUdMm.js +1 -0
  88. package/build/assets/{root-BQPNqNvD.js → root-CBBi6IAe.js} +2 -2
  89. package/build/assets/root-CRK9fOFd.css +1 -0
  90. package/build/assets/root-layout-BFN2rCOy.js +2 -0
  91. package/build/assets/{schema-field-z2vSLuLo.js → schema-field-Z-rMg9ti.js} +1 -1
  92. package/build/assets/{sdk-section-page-BnCXAytf.js → sdk-section-page-m_cjygxR.js} +1 -1
  93. package/build/assets/{secrets-service-DGUNlwQd.js → secrets-service-BHF4fxML.js} +1 -1
  94. package/build/assets/{secrets-settings-DUmML_dK.js → secrets-settings-aBGXtQhX.js} +1 -1
  95. package/build/assets/{segmented-toggle-eSofF7gn.js → segmented-toggle-SmvsR3jW.js} +1 -1
  96. package/build/assets/settings-CZPGNens.js +1 -0
  97. package/build/assets/{settings-dropdown-input-Cx4g7Xfl.js → settings-dropdown-input-TWIeiG02.js} +1 -1
  98. package/build/assets/{settings-index-BECdgecg.js → settings-index-Dtlegd6s.js} +1 -1
  99. package/build/assets/{settings-input-BQY115xH.js → settings-input-D61Vzp9e.js} +1 -1
  100. package/build/assets/{settings-list-classes-C9cLrrcc.js → settings-list-classes-sE0ASr1s.js} +1 -1
  101. package/build/assets/{settings-modal-ChBJNTdd.js → settings-modal-CalzJP2l.js} +1 -1
  102. package/build/assets/{settings-service.api-Dz9cZyvx.js → settings-service.api-DfPYaxZJ.js} +1 -1
  103. package/build/assets/{settings-switch-BIodMVz9.js → settings-switch-Drt-rF5s.js} +1 -1
  104. package/build/assets/{settings-utils-BL_Z9uIe.js → settings-utils-gw2ppAvw.js} +1 -1
  105. package/build/assets/{shared-conversation-CSF0aTuE.js → shared-conversation-BIAcuORk.js} +1 -1
  106. package/build/assets/{wrench-DRitTfwe.js → shield-check-D2cpEpv3.js} +1 -1
  107. package/build/assets/{sidebar-layout-DEycoFd_.js → sidebar-layout-Dxg6zc2K.js} +1 -1
  108. package/build/assets/{sidebar-mobile-menu-toggle-DeRvTupV.js → sidebar-mobile-menu-toggle-C6HpQ55l.js} +1 -1
  109. package/build/assets/{sidebar-nav-link-BjpQ-NVc.js → sidebar-nav-link-CxLoG-dG.js} +1 -1
  110. package/build/assets/sidebar-store-BJeYY-E9.js +1 -0
  111. package/build/assets/{skill-card-pill-row-BH6fPGba.js → skill-card-pill-row-B_BYBONu.js} +1 -1
  112. package/build/assets/{skill-icon-badge-D4uznfjU.js → skill-icon-badge-CN41Hy9l.js} +1 -1
  113. package/build/assets/{skill-scope-DH_AUUUP.js → skill-scope-Dt1V5X2p.js} +1 -1
  114. package/build/assets/{skills-plugins-vfvOk34h.js → skills-plugins-B-H0cCOP.js} +1 -1
  115. package/build/assets/skills-settings-DthdIDUb.js +2 -0
  116. package/build/assets/{styled-tooltip-CQ9JEFiO.js → styled-tooltip-C5C07RQC.js} +1 -1
  117. package/build/assets/{task-list-tab-DeF_uXdw.js → task-list-tab-BTde81Iu.js} +1 -1
  118. package/build/assets/{terminal-DRc4rup7.js → terminal-DRrJo-cR.js} +1 -1
  119. package/build/assets/{toggle-switch--8n8NeV_.js → toggle-switch-CIioisto.js} +1 -1
  120. package/build/assets/{typography-BSbUhJPn.js → typography-D9tiHct7.js} +1 -1
  121. package/build/assets/{use-acp-credential-form-BGKFi1VL.js → use-acp-credential-form-DGyo0QvL.js} +1 -1
  122. package/build/assets/{use-activate-agent-profile-2nvALjC-.js → use-activate-agent-profile-DrPzIKJF.js} +1 -1
  123. package/build/assets/{use-agent-profiles-BlQA67MW.js → use-agent-profiles-B37XWDLq.js} +1 -1
  124. package/build/assets/{use-can-manage-org-profiles-Clw5Dh1s.js → use-can-manage-org-profiles-BzE28H3x.js} +1 -1
  125. package/build/assets/{use-cloud-current-user-id-B8AQSQFM.js → use-cloud-current-user-id-U6HPjy50.js} +1 -1
  126. package/build/assets/{use-config-C3zGuUQI.js → use-config-DapX3pjC.js} +1 -1
  127. package/build/assets/{use-create-conversation-FaP0kUpg.js → use-create-conversation-CRf1dCm5.js} +1 -1
  128. package/build/assets/{use-create-secret-CgQ3pXd6.js → use-create-secret-DcpT3RPw.js} +1 -1
  129. package/build/assets/{use-llm-profiles-C-tDO6UB.js → use-llm-profiles-CHxqoHiN.js} +1 -1
  130. package/build/assets/{use-manifest-capabilities-DLP5wCxp.js → use-manifest-capabilities-zihHDbMW.js} +1 -1
  131. package/build/assets/{use-onboarding-completion-BiCdXvlU.js → use-onboarding-completion-6kWOW3ul.js} +1 -1
  132. package/build/assets/{use-plugins-marketplace-DRFNLBlr.js → use-plugins-marketplace-CqkR8kLE.js} +1 -1
  133. package/build/assets/{use-save-agent-profile-CaGVAudI.js → use-save-agent-profile-CH9_EXQG.js} +1 -1
  134. package/build/assets/{use-save-settings-C9B8Y-h3.js → use-save-settings-DIEurJ3D.js} +1 -1
  135. package/build/assets/{use-settings-3RcgdUuZ.js → use-settings-BmLzQjnC.js} +1 -1
  136. package/build/assets/use-settings-nav-items-DV9qgeu7.js +16 -0
  137. package/build/assets/{use-tracking-CTtkLAmx.js → use-tracking-salbPJxT.js} +1 -1
  138. package/build/assets/{use-user-conversation-Bei82QsZ.js → use-user-conversation-Dt-W6uNw.js} +1 -1
  139. package/build/assets/utils-DPQfkd-7.js +1 -0
  140. package/build/assets/{verification-settings-nD61Ijph.js → verification-settings-oi54wEc1.js} +1 -1
  141. package/build/assets/wrench-B1_H-tL1.js +1 -0
  142. package/build/index.html +4 -4
  143. package/build/locales/ar/openhands.json +39 -2
  144. package/build/locales/ca/openhands.json +39 -2
  145. package/build/locales/de/openhands.json +39 -2
  146. package/build/locales/en/openhands.json +39 -2
  147. package/build/locales/es/openhands.json +39 -2
  148. package/build/locales/fr/openhands.json +39 -2
  149. package/build/locales/it/openhands.json +39 -2
  150. package/build/locales/ja/openhands.json +39 -2
  151. package/build/locales/ko-KR/openhands.json +39 -2
  152. package/build/locales/no/openhands.json +39 -2
  153. package/build/locales/pt/openhands.json +39 -2
  154. package/build/locales/tr/openhands.json +39 -2
  155. package/build/locales/uk/openhands.json +39 -2
  156. package/build/locales/zh-CN/openhands.json +39 -2
  157. package/build/locales/zh-TW/openhands.json +39 -2
  158. package/config/defaults.json +1 -1
  159. package/dist/api/agent-server-adapter.cjs +3 -3
  160. package/dist/api/agent-server-adapter.cjs.map +1 -1
  161. package/dist/api/agent-server-adapter.d.ts +32 -5
  162. package/dist/api/agent-server-adapter.js +120 -91
  163. package/dist/api/agent-server-adapter.js.map +1 -1
  164. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  165. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  166. package/dist/api/cloud/conversation-service.api.d.ts +19 -2
  167. package/dist/api/cloud/conversation-service.api.js +51 -47
  168. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  169. package/dist/api/conversation-file-upload.api.cjs +1 -1
  170. package/dist/api/conversation-file-upload.api.js +10 -10
  171. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  172. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  173. package/dist/api/conversation-service/agent-server-conversation-service.api.js +55 -61
  174. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  175. package/dist/api/event-service/event-service.api.cjs +1 -1
  176. package/dist/api/event-service/event-service.api.js +12 -12
  177. package/dist/api/launch-child-conversation-client-tool.cjs +47 -0
  178. package/dist/api/launch-child-conversation-client-tool.cjs.map +1 -0
  179. package/dist/api/launch-child-conversation-client-tool.d.ts +3 -0
  180. package/dist/api/launch-child-conversation-client-tool.js +93 -0
  181. package/dist/api/launch-child-conversation-client-tool.js.map +1 -0
  182. package/dist/api/open-hands.types.d.ts +1 -1
  183. package/dist/api/workspace-upload-path.cjs +1 -1
  184. package/dist/api/workspace-upload-path.js +8 -8
  185. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +1 -1
  186. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -1
  187. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +24 -18
  188. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -1
  189. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  190. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  191. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +5 -0
  192. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  193. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +2 -2
  194. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  195. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +11 -7
  196. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  197. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
  198. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
  199. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +61 -60
  200. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
  201. package/dist/components/features/chat/model-messages.cjs +1 -1
  202. package/dist/components/features/chat/model-messages.cjs.map +1 -1
  203. package/dist/components/features/chat/model-messages.js +26 -25
  204. package/dist/components/features/chat/model-messages.js.map +1 -1
  205. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -2
  206. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
  207. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +2 -8
  208. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +50 -53
  209. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
  210. package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs +2 -0
  211. package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs.map +1 -0
  212. package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.d.ts +12 -0
  213. package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js +6 -0
  214. package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js.map +1 -0
  215. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs +1 -1
  216. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs.map +1 -1
  217. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.d.ts +16 -1
  218. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js +95 -78
  219. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js.map +1 -1
  220. package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs +1 -1
  221. package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs.map +1 -1
  222. package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js +40 -38
  223. package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js.map +1 -1
  224. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs +2 -0
  225. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs.map +1 -0
  226. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.d.ts +14 -0
  227. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js +167 -0
  228. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js.map +1 -0
  229. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs +2 -0
  230. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs.map +1 -0
  231. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.d.ts +63 -0
  232. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js +66 -0
  233. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js.map +1 -0
  234. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs +2 -0
  235. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs.map +1 -0
  236. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.d.ts +15 -0
  237. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js +117 -0
  238. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js.map +1 -0
  239. package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs +1 -1
  240. package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs.map +1 -1
  241. package/dist/components/features/conversation-panel/conversation-card/no-repository.js +30 -19
  242. package/dist/components/features/conversation-panel/conversation-card/no-repository.js.map +1 -1
  243. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  244. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  245. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +7 -2
  246. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +146 -104
  247. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  248. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  249. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  250. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +20 -0
  251. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +53 -27
  252. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  253. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  254. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  255. package/dist/components/features/conversation-panel/conversation-panel.js +226 -213
  256. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  257. package/dist/components/features/settings/agent-canvas-update-card.cjs +1 -1
  258. package/dist/components/features/settings/agent-canvas-update-card.cjs.map +1 -1
  259. package/dist/components/features/settings/agent-canvas-update-card.d.ts +10 -5
  260. package/dist/components/features/settings/agent-canvas-update-card.js +223 -149
  261. package/dist/components/features/settings/agent-canvas-update-card.js.map +1 -1
  262. package/dist/components/features/settings/agent-canvas-version-modal.cjs +2 -0
  263. package/dist/components/features/settings/agent-canvas-version-modal.cjs.map +1 -0
  264. package/dist/components/features/settings/agent-canvas-version-modal.d.ts +11 -0
  265. package/dist/components/features/settings/agent-canvas-version-modal.js +166 -0
  266. package/dist/components/features/settings/agent-canvas-version-modal.js.map +1 -0
  267. package/dist/components/features/settings/agent-canvas-version-tile.cjs +2 -0
  268. package/dist/components/features/settings/agent-canvas-version-tile.cjs.map +1 -0
  269. package/dist/components/features/settings/agent-canvas-version-tile.d.ts +13 -0
  270. package/dist/components/features/settings/agent-canvas-version-tile.js +60 -0
  271. package/dist/components/features/settings/agent-canvas-version-tile.js.map +1 -0
  272. package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
  273. package/dist/components/features/settings/llm-profiles/profile-row.js +1 -0
  274. package/dist/components/features/settings/settings-desktop-sidebar.cjs +1 -1
  275. package/dist/components/features/settings/settings-desktop-sidebar.cjs.map +1 -1
  276. package/dist/components/features/settings/settings-desktop-sidebar.js +1 -1
  277. package/dist/components/features/settings/settings-desktop-sidebar.js.map +1 -1
  278. package/dist/components/features/settings/settings-mobile-drawer.cjs +1 -1
  279. package/dist/components/features/settings/settings-mobile-drawer.cjs.map +1 -1
  280. package/dist/components/features/settings/settings-mobile-drawer.js +1 -1
  281. package/dist/components/features/settings/settings-mobile-drawer.js.map +1 -1
  282. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  283. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  284. package/dist/components/features/sidebar/sidebar-rail-body.js +109 -108
  285. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  286. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  287. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  288. package/dist/components/features/skills/extensions-navigation.js +9 -9
  289. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  290. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  291. package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
  292. package/dist/components/shared/modals/settings/model-selector.js +154 -98
  293. package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
  294. package/dist/config/defaults.cjs +1 -1
  295. package/dist/config/defaults.cjs.map +1 -1
  296. package/dist/config/defaults.js +1 -1
  297. package/dist/config/defaults.js.map +1 -1
  298. package/dist/constants/child-conversation.cjs +2 -0
  299. package/dist/constants/child-conversation.cjs.map +1 -0
  300. package/dist/constants/child-conversation.d.ts +29 -0
  301. package/dist/constants/child-conversation.js +6 -0
  302. package/dist/constants/child-conversation.js.map +1 -0
  303. package/dist/contexts/conversation-websocket-context.cjs +3 -3
  304. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  305. package/dist/contexts/conversation-websocket-context.js +189 -188
  306. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  307. package/dist/hooks/chat/use-model-interceptor.cjs +1 -1
  308. package/dist/hooks/chat/use-model-interceptor.js +6 -6
  309. package/dist/hooks/chat/use-slash-command.cjs +1 -1
  310. package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
  311. package/dist/hooks/chat/use-slash-command.js +61 -60
  312. package/dist/hooks/chat/use-slash-command.js.map +1 -1
  313. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  314. package/dist/hooks/mutation/use-create-conversation.js +6 -6
  315. package/dist/i18n/declaration.cjs +1 -1
  316. package/dist/i18n/declaration.cjs.map +1 -1
  317. package/dist/i18n/declaration.d.ts +38 -1
  318. package/dist/i18n/declaration.js +1 -1
  319. package/dist/i18n/declaration.js.map +1 -1
  320. package/dist/i18n/translation.cjs +2 -2
  321. package/dist/i18n/translation.cjs.map +1 -1
  322. package/dist/i18n/translation.js +644 -15
  323. package/dist/i18n/translation.js.map +1 -1
  324. package/dist/icons/docker.cjs +2 -0
  325. package/dist/icons/docker.cjs.map +1 -0
  326. package/dist/icons/docker.js +19 -0
  327. package/dist/icons/docker.js.map +1 -0
  328. package/dist/icons/npm.cjs +2 -0
  329. package/dist/icons/npm.cjs.map +1 -0
  330. package/dist/icons/npm.js +19 -0
  331. package/dist/icons/npm.js.map +1 -0
  332. package/dist/locales/ar/openhands.json +39 -2
  333. package/dist/locales/ca/openhands.json +39 -2
  334. package/dist/locales/de/openhands.json +39 -2
  335. package/dist/locales/en/openhands.json +39 -2
  336. package/dist/locales/es/openhands.json +39 -2
  337. package/dist/locales/fr/openhands.json +39 -2
  338. package/dist/locales/it/openhands.json +39 -2
  339. package/dist/locales/ja/openhands.json +39 -2
  340. package/dist/locales/ko-KR/openhands.json +39 -2
  341. package/dist/locales/no/openhands.json +39 -2
  342. package/dist/locales/pt/openhands.json +39 -2
  343. package/dist/locales/tr/openhands.json +39 -2
  344. package/dist/locales/uk/openhands.json +39 -2
  345. package/dist/locales/zh-CN/openhands.json +39 -2
  346. package/dist/locales/zh-TW/openhands.json +39 -2
  347. package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
  348. package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -1
  349. package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs +2 -0
  350. package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs.map +1 -0
  351. package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js +16 -0
  352. package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js.map +1 -0
  353. package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs +2 -0
  354. package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs.map +1 -0
  355. package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js +27 -0
  356. package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js.map +1 -0
  357. package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs +2 -0
  358. package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs.map +1 -0
  359. package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js +21 -0
  360. package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js.map +1 -0
  361. package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs +2 -0
  362. package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs.map +1 -0
  363. package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js +23 -0
  364. package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js.map +1 -0
  365. package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs +2 -0
  366. package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs.map +1 -0
  367. package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js +43 -0
  368. package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js.map +1 -0
  369. package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs +2 -0
  370. package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs.map +1 -0
  371. package/dist/node_modules/lucide-react/dist/esm/icons/earth.js +25 -0
  372. package/dist/node_modules/lucide-react/dist/esm/icons/earth.js.map +1 -0
  373. package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs +2 -0
  374. package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs.map +1 -0
  375. package/dist/node_modules/lucide-react/dist/esm/icons/flag.js +9 -0
  376. package/dist/node_modules/lucide-react/dist/esm/icons/flag.js.map +1 -0
  377. package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs +2 -0
  378. package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs.map +1 -0
  379. package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js +27 -0
  380. package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js.map +1 -0
  381. package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs +2 -0
  382. package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs.map +1 -0
  383. package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js +25 -0
  384. package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js.map +1 -0
  385. package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs +2 -0
  386. package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs.map +1 -0
  387. package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js +30 -0
  388. package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js.map +1 -0
  389. package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs +2 -0
  390. package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs.map +1 -0
  391. package/dist/node_modules/lucide-react/dist/esm/icons/hash.js +35 -0
  392. package/dist/node_modules/lucide-react/dist/esm/icons/hash.js.map +1 -0
  393. package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs +2 -0
  394. package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs.map +1 -0
  395. package/dist/node_modules/lucide-react/dist/esm/icons/house.js +12 -0
  396. package/dist/node_modules/lucide-react/dist/esm/icons/house.js.map +1 -0
  397. package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs +2 -0
  398. package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs.map +1 -0
  399. package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js +33 -0
  400. package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js.map +1 -0
  401. package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs +2 -0
  402. package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs.map +1 -0
  403. package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +15 -0
  404. package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js.map +1 -0
  405. package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs +2 -0
  406. package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs.map +1 -0
  407. package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +19 -0
  408. package/dist/node_modules/lucide-react/dist/esm/icons/layers.js.map +1 -0
  409. package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs +2 -0
  410. package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs.map +1 -0
  411. package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js +22 -0
  412. package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js.map +1 -0
  413. package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs +2 -0
  414. package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs.map +1 -0
  415. package/dist/node_modules/lucide-react/dist/esm/icons/mails.js +23 -0
  416. package/dist/node_modules/lucide-react/dist/esm/icons/mails.js.map +1 -0
  417. package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs +2 -0
  418. package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs.map +1 -0
  419. package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js +12 -0
  420. package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js.map +1 -0
  421. package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs +2 -0
  422. package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs.map +1 -0
  423. package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +23 -0
  424. package/dist/node_modules/lucide-react/dist/esm/icons/plug.js.map +1 -0
  425. package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs +2 -0
  426. package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs.map +1 -0
  427. package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js +27 -0
  428. package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js.map +1 -0
  429. package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs +2 -0
  430. package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs.map +1 -0
  431. package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js +23 -0
  432. package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js.map +1 -0
  433. package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs +2 -0
  434. package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs.map +1 -0
  435. package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js +21 -0
  436. package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js.map +1 -0
  437. package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs +2 -0
  438. package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs.map +1 -0
  439. package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js +43 -0
  440. package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js.map +1 -0
  441. package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs +2 -0
  442. package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs.map +1 -0
  443. package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js +19 -0
  444. package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js.map +1 -0
  445. package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs +2 -0
  446. package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs.map +1 -0
  447. package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js +27 -0
  448. package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js.map +1 -0
  449. package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs +2 -0
  450. package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs.map +1 -0
  451. package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js +9 -0
  452. package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js.map +1 -0
  453. package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs +2 -0
  454. package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs.map +1 -0
  455. package/dist/node_modules/lucide-react/dist/esm/icons/zap.js +9 -0
  456. package/dist/node_modules/lucide-react/dist/esm/icons/zap.js.map +1 -0
  457. package/dist/package.cjs +1 -1
  458. package/dist/package.cjs.map +1 -1
  459. package/dist/package.js +6 -3
  460. package/dist/package.js.map +1 -1
  461. package/dist/routes/app-settings.cjs +1 -1
  462. package/dist/routes/app-settings.cjs.map +1 -1
  463. package/dist/routes/app-settings.js +94 -93
  464. package/dist/routes/app-settings.js.map +1 -1
  465. package/dist/routes/llm-settings.cjs +1 -1
  466. package/dist/routes/llm-settings.cjs.map +1 -1
  467. package/dist/routes/llm-settings.js +131 -119
  468. package/dist/routes/llm-settings.js.map +1 -1
  469. package/dist/services/child-conversation-launch.cjs +2 -0
  470. package/dist/services/child-conversation-launch.cjs.map +1 -0
  471. package/dist/services/child-conversation-launch.d.ts +41 -0
  472. package/dist/services/child-conversation-launch.js +182 -0
  473. package/dist/services/child-conversation-launch.js.map +1 -0
  474. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  475. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  476. package/dist/stores/conversation-panel-preferences-store.d.ts +5 -1
  477. package/dist/stores/conversation-panel-preferences-store.js +8 -2
  478. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  479. package/dist/types/agent-server/core/base/action.d.ts +17 -1
  480. package/dist/types/agent-server/core/base/base.d.ts +2 -1
  481. package/dist/types/agent-server/type-guards.cjs +1 -1
  482. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  483. package/dist/types/agent-server/type-guards.d.ts +8 -1
  484. package/dist/types/agent-server/type-guards.js +4 -3
  485. package/dist/types/agent-server/type-guards.js.map +1 -1
  486. package/dist/types/automation.d.ts +14 -0
  487. package/dist/utils/custom-toast-handlers.cjs +1 -1
  488. package/dist/utils/custom-toast-handlers.cjs.map +1 -1
  489. package/dist/utils/custom-toast-handlers.js +18 -1
  490. package/dist/utils/custom-toast-handlers.js.map +1 -1
  491. package/dist/utils/format-model-name.cjs +1 -1
  492. package/dist/utils/format-model-name.cjs.map +1 -1
  493. package/dist/utils/format-model-name.d.ts +11 -0
  494. package/dist/utils/format-model-name.js +11 -3
  495. package/dist/utils/format-model-name.js.map +1 -1
  496. package/package.json +6 -3
  497. package/scripts/brand-dev-electron.mjs +244 -0
  498. package/scripts/check-translation-completeness.cjs +4 -0
  499. package/scripts/generate-icons.mjs +109 -0
  500. package/build/assets/agent-server-conversation-service.api-km_8sOVf.js +0 -41
  501. package/build/assets/agent-settings-nmO-KSXr.js +0 -1
  502. package/build/assets/app-settings-9ok42bV6.js +0 -1
  503. package/build/assets/command-menu-CA3IjGNc.js +0 -1
  504. package/build/assets/conversation-B6t6EiVp.js +0 -1
  505. package/build/assets/conversation-panel-B6t6EiVp.js +0 -1
  506. package/build/assets/copy-DaHuDtG4.js +0 -1
  507. package/build/assets/git-repo-dropdown-TzOuG5Ef.js +0 -1
  508. package/build/assets/home-OEx0XtfP.js +0 -1
  509. package/build/assets/index-home-OEx0XtfP.js +0 -1
  510. package/build/assets/install-server-modal-DnjZrJUy.js +0 -1
  511. package/build/assets/list-filter-C86CBRDE.js +0 -1
  512. package/build/assets/llm-not-configured-banner-DrBrhfN0.js +0 -27
  513. package/build/assets/llm-settings-CRsLqxgu.js +0 -1
  514. package/build/assets/llm-settings-RBm_3kNm.js +0 -1
  515. package/build/assets/manifest-c352d453.js +0 -1
  516. package/build/assets/map-provider-CXU6issd.js +0 -1
  517. package/build/assets/markdown-renderer-lsvsp7jn.js +0 -8
  518. package/build/assets/mcp-DD4hPTRE.js +0 -9
  519. package/build/assets/messages-Dt77e0qi.js +0 -40
  520. package/build/assets/recommended-automations-launcher-6xmbf7lh.js +0 -1
  521. package/build/assets/root-BeuHFY2s.css +0 -1
  522. package/build/assets/root-layout-Dl_2CDoq.js +0 -3
  523. package/build/assets/settings-Co-M5bK9.js +0 -1
  524. package/build/assets/sidebar-store-B04sX8aP.js +0 -1
  525. package/build/assets/skills-settings-DnbIu2eO.js +0 -2
  526. package/build/assets/use-settings-nav-items-y-Oyc93G.js +0 -16
  527. package/build/assets/utils-BX9XJ0IE.js +0 -1
  528. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +0 -2
  529. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.map +0 -1
  530. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -9
  531. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"should-render-event.cjs","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { MessageEvent, OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isGoalConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\n\n// Prefixes of the SDK goal-loop re-prompts (FOLLOWUP_PROMPT / RESUME_PROMPT in\n// openhands.sdk .../conversation/goal/prompts.py). The goal loop injects these\n// as `user` messages each round to steer the agent, and FOLLOWUP_PROMPT embeds\n// the judge's verdict — which the goal banner already surfaces. The persisted\n// event carries no marker distinguishing them from real user input, so we match\n// the prompt text to keep this machinery out of the chat. Brittle by design;\n// keep in sync with the SDK prompts (the durable fix is a persisted goal-loop\n// flag on the event).\nconst GOAL_REPROMPT_PREFIXES = [\n \"The goal is NOT yet complete (audit iteration\",\n \"Resuming a goal that was paused or interrupted.\",\n];\n\nconst isGoalLoopReprompt = (event: MessageEvent): boolean => {\n if (event.llm_message?.role !== \"user\") return false;\n const content = event.llm_message.content;\n const text = Array.isArray(content)\n ? content\n .filter((c) => c.type === \"text\")\n .map((c) => c.text)\n .join(\"\\n\")\n : \"\";\n return GOAL_REPROMPT_PREFIXES.some((prefix) => text.startsWith(prefix));\n};\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n if (isConversationStateUpdateEvent(event)) {\n // A finished `/goal` loop renders inline so it settles into the\n // conversation; the live (active) banner is shown separately by\n // GoalStatusBanner, and all other state updates (and the in-progress goal\n // events) stay hidden.\n return isGoalConversationStateUpdateEvent(event) && !event.value.active;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages), except the goal loop's\n // injected re-prompts — the judge feedback they carry is shown in the goal\n // banner, so otherwise they leak into the chat as fake user turns.\n if (isMessageEvent(event)) {\n return !isGoalLoopReprompt(event);\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n if (isStreamingDeltaEvent(event)) {\n return event.content !== null || event.reasoning_content !== null;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":"wHAqBA,IAAM,EAAyB,CAC7B,gDACA,iDACF,EAEM,EAAsB,GAAiC,CAC3D,GAAI,EAAM,aAAa,OAAS,OAAQ,MAAO,GAC/C,IAAM,EAAU,EAAM,YAAY,QAC5B,EAAO,MAAM,QAAQ,CAAO,EAC9B,EACG,OAAQ,GAAM,EAAE,OAAS,MAAM,EAC/B,IAAK,GAAM,EAAE,IAAI,EACjB,KAAK;CAAI,EACZ,GACJ,OAAO,EAAuB,KAAM,GAAW,EAAK,WAAW,CAAM,CAAC,CACxE,EAEa,EAAqB,GAA0B,CAC1D,GAAI,EAAA,+BAA+B,CAAK,EAKtC,OAAO,EAAA,mCAAmC,CAAK,GAAK,CAAC,EAAM,MAAM,OAInE,GAAI,EAAA,cAAc,CAAK,EAAG,CAExB,IAAM,EAAa,EAAM,OAAO,KAsBhC,MAJA,EAhBI,CAAC,GAKD,IAAe,qBAAuB,EAAM,SAAW,QAKvD,IAAe,4BAMf,IAAe,kBAKrB,CAsDA,OAnDI,EAAA,mBAAmB,CAAK,EAI1B,EACE,EAAM,YAAY,OAAS,wBAC3B,CAAC,EAAM,YAAY,UAWnB,EAAA,eAAe,CAAK,EACf,CAAC,EAAmB,CAAK,EAI9B,EAAA,kBAAkB,CAAK,GAKvB,EAAA,qBAAqB,CAAK,GAe1B,EAAA,mBAAmB,CAAK,EACnB,GAGL,EAAA,sBAAsB,CAAK,EACtB,EAAM,UAAY,MAAQ,EAAM,oBAAsB,KAIxD,EACT,EAEa,EAAgB,GAC3B,EAAO,KAAM,GAAU,EAAM,SAAW,MAAM"}
1
+ {"version":3,"file":"should-render-event.cjs","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { CHILD_CONVERSATION_RESULT_PREFIX } from \"#/constants/child-conversation\";\nimport { MessageEvent, OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isGoalConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\n\n// Prefixes of the SDK goal-loop re-prompts (FOLLOWUP_PROMPT / RESUME_PROMPT in\n// openhands.sdk .../conversation/goal/prompts.py). The goal loop injects these\n// as `user` messages each round to steer the agent, and FOLLOWUP_PROMPT embeds\n// the judge's verdict — which the goal banner already surfaces. The persisted\n// event carries no marker distinguishing them from real user input, so we match\n// the prompt text to keep this machinery out of the chat. Brittle by design;\n// keep in sync with the SDK prompts (the durable fix is a persisted goal-loop\n// flag on the event).\nconst GOAL_REPROMPT_PREFIXES = [\n \"The goal is NOT yet complete (audit iteration\",\n \"Resuming a goal that was paused or interrupted.\",\n];\n\nconst userMessageText = (event: MessageEvent): string | null => {\n if (event.llm_message?.role !== \"user\") return null;\n const content = event.llm_message.content;\n return Array.isArray(content)\n ? content\n .filter((c) => c.type === \"text\")\n .map((c) => c.text)\n .join(\"\\n\")\n : \"\";\n};\n\nconst isGoalLoopReprompt = (event: MessageEvent): boolean => {\n const text = userMessageText(event);\n if (text === null) return false;\n return GOAL_REPROMPT_PREFIXES.some((prefix) => text.startsWith(prefix));\n};\n\n// The frontend posts the outcome of a `launch_child_conversation` call back as\n// a `user` message because client tools have no result channel (see\n// `services/child-conversation-launch.ts`). It is a JSON payload addressed to\n// the agent, which reports the child's id and link in its own reply, so the\n// raw message does not belong in the chat.\nconst isChildConversationResult = (event: MessageEvent): boolean =>\n userMessageText(event)?.startsWith(CHILD_CONVERSATION_RESULT_PREFIX) ?? false;\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n if (isConversationStateUpdateEvent(event)) {\n // A finished `/goal` loop renders inline so it settles into the\n // conversation; the live (active) banner is shown separately by\n // GoalStatusBanner, and all other state updates (and the in-progress goal\n // events) stay hidden.\n return isGoalConversationStateUpdateEvent(event) && !event.value.active;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages), except the goal loop's\n // injected re-prompts — the judge feedback they carry is shown in the goal\n // banner, so otherwise they leak into the chat as fake user turns — and the\n // child-conversation launch results, which are machine payloads the agent\n // relays in its own reply.\n if (isMessageEvent(event)) {\n return !isGoalLoopReprompt(event) && !isChildConversationResult(event);\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n if (isStreamingDeltaEvent(event)) {\n return event.content !== null || event.reasoning_content !== null;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":"gLAsBA,IAAM,EAAyB,CAC7B,gDACA,iDACF,EAEM,EAAmB,GAAuC,CAC9D,GAAI,EAAM,aAAa,OAAS,OAAQ,OAAO,KAC/C,IAAM,EAAU,EAAM,YAAY,QAClC,OAAO,MAAM,QAAQ,CAAO,EACxB,EACG,OAAQ,GAAM,EAAE,OAAS,MAAM,EAC/B,IAAK,GAAM,EAAE,IAAI,EACjB,KAAK;CAAI,EACZ,EACN,EAEM,EAAsB,GAAiC,CAC3D,IAAM,EAAO,EAAgB,CAAK,EAElC,OADI,IAAS,KAAa,GACnB,EAAuB,KAAM,GAAW,EAAK,WAAW,CAAM,CAAC,CACxE,EAOM,EAA6B,GACjC,EAAgB,CAAK,GAAG,WAAA,uBAA2C,GAAK,GAE7D,EAAqB,GAA0B,CAC1D,GAAI,EAAA,+BAA+B,CAAK,EAKtC,OAAO,EAAA,mCAAmC,CAAK,GAAK,CAAC,EAAM,MAAM,OAInE,GAAI,EAAA,cAAc,CAAK,EAAG,CAExB,IAAM,EAAa,EAAM,OAAO,KAsBhC,MAJA,EAhBI,CAAC,GAKD,IAAe,qBAAuB,EAAM,SAAW,QAKvD,IAAe,4BAMf,IAAe,kBAKrB,CAwDA,OArDI,EAAA,mBAAmB,CAAK,EAI1B,EACE,EAAM,YAAY,OAAS,wBAC3B,CAAC,EAAM,YAAY,UAanB,EAAA,eAAe,CAAK,EACf,CAAC,EAAmB,CAAK,GAAK,CAAC,EAA0B,CAAK,EAInE,EAAA,kBAAkB,CAAK,GAKvB,EAAA,qBAAqB,CAAK,GAe1B,EAAA,mBAAmB,CAAK,EACnB,GAGL,EAAA,sBAAsB,CAAK,EACtB,EAAM,UAAY,MAAQ,EAAM,oBAAsB,KAIxD,EACT,EAEa,EAAgB,GAC3B,EAAO,KAAM,GAAU,EAAM,SAAW,MAAM"}
@@ -1,18 +1,22 @@
1
+ import "../../../../constants/child-conversation.js";
1
2
  import { isACPToolCallEvent as e, isActionEvent as t, isAgentErrorEvent as n, isConversationStateUpdateEvent as r, isGoalConversationStateUpdateEvent as i, isHookExecutionEvent as a, isMessageEvent as o, isObservationEvent as s, isStreamingDeltaEvent as c } from "../../../../types/agent-server/type-guards.js";
2
3
  //#region src/components/conversation-events/chat/event-content-helpers/should-render-event.ts
3
4
  var l = ["The goal is NOT yet complete (audit iteration", "Resuming a goal that was paused or interrupted."], u = (e) => {
4
- if (e.llm_message?.role !== "user") return !1;
5
- let t = e.llm_message.content, n = Array.isArray(t) ? t.filter((e) => e.type === "text").map((e) => e.text).join("\n") : "";
6
- return l.some((e) => n.startsWith(e));
7
- }, d = (l) => {
5
+ if (e.llm_message?.role !== "user") return null;
6
+ let t = e.llm_message.content;
7
+ return Array.isArray(t) ? t.filter((e) => e.type === "text").map((e) => e.text).join("\n") : "";
8
+ }, d = (e) => {
9
+ let t = u(e);
10
+ return t === null ? !1 : l.some((e) => t.startsWith(e));
11
+ }, f = (e) => u(e)?.startsWith("[child-conversation] ") ?? !1, p = (l) => {
8
12
  if (r(l)) return i(l) && !l.value.active;
9
13
  if (t(l)) {
10
14
  let e = l.action.kind;
11
15
  return !(!e || e === "ExecuteBashAction" && l.source === "user" || e === "PlanningFileEditorAction" || e === "SwitchLLMAction");
12
16
  }
13
- return s(l) ? !(l.observation.kind === "SwitchLLMObservation" && !l.observation.is_error) : o(l) ? !u(l) : n(l) || a(l) || e(l) ? !0 : c(l) ? l.content !== null || l.reasoning_content !== null : !1;
14
- }, f = (e) => e.some((e) => e.source === "user");
17
+ return s(l) ? !(l.observation.kind === "SwitchLLMObservation" && !l.observation.is_error) : o(l) ? !d(l) && !f(l) : n(l) || a(l) || e(l) ? !0 : c(l) ? l.content !== null || l.reasoning_content !== null : !1;
18
+ }, m = (e) => e.some((e) => e.source === "user");
15
19
  //#endregion
16
- export { f as hasUserEvent, d as shouldRenderEvent };
20
+ export { m as hasUserEvent, p as shouldRenderEvent };
17
21
 
18
22
  //# sourceMappingURL=should-render-event.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"should-render-event.js","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { MessageEvent, OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isGoalConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\n\n// Prefixes of the SDK goal-loop re-prompts (FOLLOWUP_PROMPT / RESUME_PROMPT in\n// openhands.sdk .../conversation/goal/prompts.py). The goal loop injects these\n// as `user` messages each round to steer the agent, and FOLLOWUP_PROMPT embeds\n// the judge's verdict — which the goal banner already surfaces. The persisted\n// event carries no marker distinguishing them from real user input, so we match\n// the prompt text to keep this machinery out of the chat. Brittle by design;\n// keep in sync with the SDK prompts (the durable fix is a persisted goal-loop\n// flag on the event).\nconst GOAL_REPROMPT_PREFIXES = [\n \"The goal is NOT yet complete (audit iteration\",\n \"Resuming a goal that was paused or interrupted.\",\n];\n\nconst isGoalLoopReprompt = (event: MessageEvent): boolean => {\n if (event.llm_message?.role !== \"user\") return false;\n const content = event.llm_message.content;\n const text = Array.isArray(content)\n ? content\n .filter((c) => c.type === \"text\")\n .map((c) => c.text)\n .join(\"\\n\")\n : \"\";\n return GOAL_REPROMPT_PREFIXES.some((prefix) => text.startsWith(prefix));\n};\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n if (isConversationStateUpdateEvent(event)) {\n // A finished `/goal` loop renders inline so it settles into the\n // conversation; the live (active) banner is shown separately by\n // GoalStatusBanner, and all other state updates (and the in-progress goal\n // events) stay hidden.\n return isGoalConversationStateUpdateEvent(event) && !event.value.active;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages), except the goal loop's\n // injected re-prompts — the judge feedback they carry is shown in the goal\n // banner, so otherwise they leak into the chat as fake user turns.\n if (isMessageEvent(event)) {\n return !isGoalLoopReprompt(event);\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n if (isStreamingDeltaEvent(event)) {\n return event.content !== null || event.reasoning_content !== null;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":";;AAqBA,IAAM,IAAyB,CAC7B,iDACA,iDACF,GAEM,KAAsB,MAAiC;CAC3D,IAAI,EAAM,aAAa,SAAS,QAAQ,OAAO;CAC/C,IAAM,IAAU,EAAM,YAAY,SAC5B,IAAO,MAAM,QAAQ,CAAO,IAC9B,EACG,QAAQ,MAAM,EAAE,SAAS,MAAM,EAC/B,KAAK,MAAM,EAAE,IAAI,EACjB,KAAK,IAAI,IACZ;CACJ,OAAO,EAAuB,MAAM,MAAW,EAAK,WAAW,CAAM,CAAC;AACxE,GAEa,KAAqB,MAA0B;CAC1D,IAAI,EAA+B,CAAK,GAKtC,OAAO,EAAmC,CAAK,KAAK,CAAC,EAAM,MAAM;CAInE,IAAI,EAAc,CAAK,GAAG;EAExB,IAAM,IAAa,EAAM,OAAO;EAsBhC,OAJA,EAhBI,CAAC,KAKD,MAAe,uBAAuB,EAAM,WAAW,UAKvD,MAAe,8BAMf,MAAe;CAKrB;CAsDA,OAnDI,EAAmB,CAAK,IAI1B,EACE,EAAM,YAAY,SAAS,0BAC3B,CAAC,EAAM,YAAY,YAWnB,EAAe,CAAK,IACf,CAAC,EAAmB,CAAK,IAI9B,EAAkB,CAAK,KAKvB,EAAqB,CAAK,KAe1B,EAAmB,CAAK,IACnB,KAGL,EAAsB,CAAK,IACtB,EAAM,YAAY,QAAQ,EAAM,sBAAsB,OAIxD;AACT,GAEa,KAAgB,MAC3B,EAAO,MAAM,MAAU,EAAM,WAAW,MAAM"}
1
+ {"version":3,"file":"should-render-event.js","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { CHILD_CONVERSATION_RESULT_PREFIX } from \"#/constants/child-conversation\";\nimport { MessageEvent, OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isGoalConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\n\n// Prefixes of the SDK goal-loop re-prompts (FOLLOWUP_PROMPT / RESUME_PROMPT in\n// openhands.sdk .../conversation/goal/prompts.py). The goal loop injects these\n// as `user` messages each round to steer the agent, and FOLLOWUP_PROMPT embeds\n// the judge's verdict — which the goal banner already surfaces. The persisted\n// event carries no marker distinguishing them from real user input, so we match\n// the prompt text to keep this machinery out of the chat. Brittle by design;\n// keep in sync with the SDK prompts (the durable fix is a persisted goal-loop\n// flag on the event).\nconst GOAL_REPROMPT_PREFIXES = [\n \"The goal is NOT yet complete (audit iteration\",\n \"Resuming a goal that was paused or interrupted.\",\n];\n\nconst userMessageText = (event: MessageEvent): string | null => {\n if (event.llm_message?.role !== \"user\") return null;\n const content = event.llm_message.content;\n return Array.isArray(content)\n ? content\n .filter((c) => c.type === \"text\")\n .map((c) => c.text)\n .join(\"\\n\")\n : \"\";\n};\n\nconst isGoalLoopReprompt = (event: MessageEvent): boolean => {\n const text = userMessageText(event);\n if (text === null) return false;\n return GOAL_REPROMPT_PREFIXES.some((prefix) => text.startsWith(prefix));\n};\n\n// The frontend posts the outcome of a `launch_child_conversation` call back as\n// a `user` message because client tools have no result channel (see\n// `services/child-conversation-launch.ts`). It is a JSON payload addressed to\n// the agent, which reports the child's id and link in its own reply, so the\n// raw message does not belong in the chat.\nconst isChildConversationResult = (event: MessageEvent): boolean =>\n userMessageText(event)?.startsWith(CHILD_CONVERSATION_RESULT_PREFIX) ?? false;\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n if (isConversationStateUpdateEvent(event)) {\n // A finished `/goal` loop renders inline so it settles into the\n // conversation; the live (active) banner is shown separately by\n // GoalStatusBanner, and all other state updates (and the in-progress goal\n // events) stay hidden.\n return isGoalConversationStateUpdateEvent(event) && !event.value.active;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages), except the goal loop's\n // injected re-prompts — the judge feedback they carry is shown in the goal\n // banner, so otherwise they leak into the chat as fake user turns — and the\n // child-conversation launch results, which are machine payloads the agent\n // relays in its own reply.\n if (isMessageEvent(event)) {\n return !isGoalLoopReprompt(event) && !isChildConversationResult(event);\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n if (isStreamingDeltaEvent(event)) {\n return event.content !== null || event.reasoning_content !== null;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":";;;AAsBA,IAAM,IAAyB,CAC7B,iDACA,iDACF,GAEM,KAAmB,MAAuC;CAC9D,IAAI,EAAM,aAAa,SAAS,QAAQ,OAAO;CAC/C,IAAM,IAAU,EAAM,YAAY;CAClC,OAAO,MAAM,QAAQ,CAAO,IACxB,EACG,QAAQ,MAAM,EAAE,SAAS,MAAM,EAC/B,KAAK,MAAM,EAAE,IAAI,EACjB,KAAK,IAAI,IACZ;AACN,GAEM,KAAsB,MAAiC;CAC3D,IAAM,IAAO,EAAgB,CAAK;CAElC,OADI,MAAS,OAAa,KACnB,EAAuB,MAAM,MAAW,EAAK,WAAW,CAAM,CAAC;AACxE,GAOM,KAA6B,MACjC,EAAgB,CAAK,GAAG,WAAA,uBAA2C,KAAK,IAE7D,KAAqB,MAA0B;CAC1D,IAAI,EAA+B,CAAK,GAKtC,OAAO,EAAmC,CAAK,KAAK,CAAC,EAAM,MAAM;CAInE,IAAI,EAAc,CAAK,GAAG;EAExB,IAAM,IAAa,EAAM,OAAO;EAsBhC,OAJA,EAhBI,CAAC,KAKD,MAAe,uBAAuB,EAAM,WAAW,UAKvD,MAAe,8BAMf,MAAe;CAKrB;CAwDA,OArDI,EAAmB,CAAK,IAI1B,EACE,EAAM,YAAY,SAAS,0BAC3B,CAAC,EAAM,YAAY,YAanB,EAAe,CAAK,IACf,CAAC,EAAmB,CAAK,KAAK,CAAC,EAA0B,CAAK,IAInE,EAAkB,CAAK,KAKvB,EAAqB,CAAK,KAe1B,EAAmB,CAAK,IACnB,KAGL,EAAsB,CAAK,IACtB,EAAM,YAAY,QAAQ,EAAM,sBAAsB,OAIxD;AACT,GAEa,KAAgB,MAC3B,EAAO,MAAM,MAAU,EAAM,WAAW,MAAM"}
@@ -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,EAAs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AD,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,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,+FAC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AA,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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,EACT,+IACA,CACF;cANF,CAQE,kBAAC,GAAD;KACE,OAAO;KACP,QAAQ;KACR,WAAW,EAAG,YAAY,CAAqB;KAC/C,eAAA;IACD,CAAA,GACD,kBAAC,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"}
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;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,GAC7B,IAAe,EAA0B,EAAQ,KAAK;GAC5D,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;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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"}
@@ -1,2 +1,2 @@
1
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/Trans.cjs"),n=require("../../../i18n/declaration.cjs"),r=require("../../../node_modules/lucide-react/dist/esm/icons/chevron-down.cjs"),i=require("../../../node_modules/lucide-react/dist/esm/icons/chevron-right.cjs"),a=require("../../../stores/model-store.cjs"),o=require("./generic-event-message.cjs"),s=require("../../../icons/info-circle.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("react/jsx-runtime");function u({profile:e}){let[t,n]=c.default.useState(!1);return(0,l.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,l.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,l.jsx)(r.ChevronDown,{size:14}):(0,l.jsx)(i.ChevronRight,{size:14})}),(0,l.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`hr`,{className:`border-neutral-700`}),(0,l.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function d({conversationId:e,anchorEventId:r}){let i=a.useModelStore(e=>e.entriesByConversation),c=(e?i[e]??[]:[]).filter(e=>e.anchorEventId===r);return!e||c.length===0?null:(0,l.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:c.map(e=>{if(e.switchedTo)return(0,l.jsx)(o.GenericEventMessage,{title:(0,l.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,l.jsx)(s.default,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,l.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,l.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let r=e.profiles.length===0;return(0,l.jsx)(o.GenericEventMessage,{title:(0,l.jsx)(`span`,{children:r?(0,l.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$NO_SAVED_PROFILES}):(0,l.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:r?(0,l.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,l.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$NO_PROFILES_HINT})}):(0,l.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,l.jsx)(u,{profile:e},e.name))}),initiallyExpanded:r},e.id)})})}exports.ModelMessages=d;
1
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/Trans.cjs"),n=require("../../../i18n/declaration.cjs"),r=require("../../../node_modules/lucide-react/dist/esm/icons/chevron-down.cjs"),i=require("../../../node_modules/lucide-react/dist/esm/icons/chevron-right.cjs"),a=require("../../../stores/model-store.cjs"),o=require("./generic-event-message.cjs"),s=require("../../../icons/info-circle.cjs"),c=require("../../../utils/format-model-name.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("react/jsx-runtime");function d({profile:e}){let[t,n]=l.default.useState(!1),a=c.formatModelNameForDisplay(e.model);return(0,u.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,u.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,u.jsx)(r.ChevronDown,{size:14}):(0,u.jsx)(i.ChevronRight,{size:14})}),(0,u.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`hr`,{className:`border-neutral-700`}),(0,u.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${a??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function f({conversationId:e,anchorEventId:r}){let i=a.useModelStore(e=>e.entriesByConversation),c=(e?i[e]??[]:[]).filter(e=>e.anchorEventId===r);return!e||c.length===0?null:(0,u.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:c.map(e=>{if(e.switchedTo)return(0,u.jsx)(o.GenericEventMessage,{title:(0,u.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,u.jsx)(s.default,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,u.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,u.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let r=e.profiles.length===0;return(0,u.jsx)(o.GenericEventMessage,{title:(0,u.jsx)(`span`,{children:r?(0,u.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$NO_SAVED_PROFILES}):(0,u.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:r?(0,u.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,u.jsx)(t.Trans,{i18nKey:n.I18nKey.MODEL$NO_PROFILES_HINT})}):(0,u.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,u.jsx)(d,{profile:e},e.name))}),initiallyExpanded:r},e.id)})})}exports.ModelMessages=f;
2
2
  //# sourceMappingURL=model-messages.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-messages.cjs","names":[],"sources":["../../../../src/components/features/chat/model-messages.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans } from \"react-i18next\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useModelStore } from \"#/stores/model-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport InfoCircleIcon from \"#/icons/info-circle.svg?react\";\nimport type { ProfileInfo } from \"#/api/profiles-service/profiles-service.api\";\nimport { GenericEventMessage } from \"./generic-event-message\";\n\ninterface ProfileRowProps {\n profile: ProfileInfo;\n}\n\nfunction ProfileRow({ profile }: ProfileRowProps) {\n const [expanded, setExpanded] = React.useState(false);\n\n return (\n <div className=\"border border-neutral-700 rounded-md overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n aria-expanded={expanded}\n aria-label={`Toggle details for ${profile.name}`}\n className=\"w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer\"\n >\n <span className=\"text-neutral-300\">\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </span>\n <span className=\"font-normal text-neutral-200 text-sm\">\n {profile.name}\n </span>\n </button>\n {expanded && (\n <>\n <hr className=\"border-neutral-700\" />\n <div className=\"px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap\">\n {`model: ${profile.model ?? \"—\"}\\n` +\n `base_url: ${profile.base_url ?? \"—\"}\\n` +\n // eslint-disable-next-line i18next/no-literal-string -- diagnostic readout; field labels are intentionally untranslated\n `api_key: ${profile.api_key_set ? \"set\" : \"not set\"}`}\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport interface ModelMessagesProps {\n conversationId: string | null | undefined;\n /**\n * Render only entries anchored to this event id. Use `null` to render the\n * \"no events at the time of /model\" entries (top of the chat history).\n */\n anchorEventId: string | null;\n}\n\nexport function ModelMessages({\n conversationId,\n anchorEventId,\n}: ModelMessagesProps) {\n const entriesById = useModelStore((s) => s.entriesByConversation);\n const allEntries = conversationId ? (entriesById[conversationId] ?? []) : [];\n const entries = allEntries.filter((e) => e.anchorEventId === anchorEventId);\n\n if (!conversationId || entries.length === 0) return null;\n\n return (\n <div data-testid=\"model-messages\" className=\"flex flex-col w-full\">\n {entries.map((entry) => {\n if (entry.switchedTo) {\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span className=\"inline-flex items-center gap-1.5\">\n <InfoCircleIcon\n width={14}\n height={14}\n className=\"shrink-0 text-neutral-400\"\n aria-hidden\n />\n <Trans\n i18nKey={I18nKey.MODEL$SWITCHED_TO_PROFILE}\n values={{ name: entry.switchedTo }}\n components={{\n cmd: (\n <span className=\"font-mono text-neutral-200 bg-neutral-800 px-1 rounded\" />\n ),\n }}\n />\n </span>\n }\n details=\"\"\n />\n );\n }\n\n const isEmpty = entry.profiles.length === 0;\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span>\n {isEmpty ? (\n <Trans i18nKey={I18nKey.MODEL$NO_SAVED_PROFILES} />\n ) : (\n <Trans\n i18nKey={I18nKey.MODEL$AVAILABLE_PROFILES}\n values={{ count: entry.profiles.length }}\n />\n )}\n </span>\n }\n details={\n isEmpty ? (\n <span className=\"text-neutral-300 text-sm px-2 py-1 block\">\n <Trans i18nKey={I18nKey.MODEL$NO_PROFILES_HINT} />\n </span>\n ) : (\n <div className=\"flex flex-col gap-1 mt-1\">\n {entry.profiles.map((p) => (\n <ProfileRow key={p.name} profile={p} />\n ))}\n </div>\n )\n }\n initiallyExpanded={isEmpty}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"uhBAaA,SAAS,EAAW,CAAE,WAA4B,CAChD,GAAM,CAAC,EAAU,GAAe,EAAA,QAAM,SAAS,EAAK,EAEpD,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gEAAf,EACE,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,YAAe,EAAa,GAAM,CAAC,CAAC,EACpC,gBAAe,EACf,aAAY,sBAAsB,EAAQ,OAC1C,UAAU,sHALZ,EAOE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4BACb,GAAW,EAAA,EAAA,KAAC,EAAA,YAAD,CAAa,KAAM,EAAK,CAAA,GAAI,EAAA,EAAA,KAAC,EAAA,aAAD,CAAc,KAAM,EAAK,CAAA,CAC7D,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,gDACb,EAAQ,IACL,CAAA,CACA,IACP,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,oBAAsB,CAAA,GACpC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,4EACZ,aAAa,EAAQ,OAAS,IAAI,cACpB,EAAQ,UAAY,IAAI,cAExB,EAAQ,YAAc,MAAQ,WAC1C,CAAA,CACL,CAAA,CAAA,CAED,GAET,CAWA,SAAgB,EAAc,CAC5B,iBACA,iBACqB,CACrB,IAAM,EAAc,EAAA,cAAe,GAAM,EAAE,qBAAqB,EAE1D,GADa,EAAkB,EAAY,IAAmB,CA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ACE,CAAA,EAGT,kBAAmB,CACpB,EA3BM,EAAM,EA2BZ,CAEL,CAAC,CACE,CAAA,CAET"}
1
+ {"version":3,"file":"model-messages.cjs","names":[],"sources":["../../../../src/components/features/chat/model-messages.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans } from \"react-i18next\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useModelStore } from \"#/stores/model-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport InfoCircleIcon from \"#/icons/info-circle.svg?react\";\nimport type { ProfileInfo } from \"#/api/profiles-service/profiles-service.api\";\nimport { formatModelNameForDisplay } from \"#/utils/format-model-name\";\nimport { GenericEventMessage } from \"./generic-event-message\";\n\ninterface ProfileRowProps {\n profile: ProfileInfo;\n}\n\nfunction ProfileRow({ profile }: ProfileRowProps) {\n const [expanded, setExpanded] = React.useState(false);\n const displayModel = formatModelNameForDisplay(profile.model);\n\n return (\n <div className=\"border border-neutral-700 rounded-md overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n aria-expanded={expanded}\n aria-label={`Toggle details for ${profile.name}`}\n className=\"w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer\"\n >\n <span className=\"text-neutral-300\">\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </span>\n <span className=\"font-normal text-neutral-200 text-sm\">\n {profile.name}\n </span>\n </button>\n {expanded && (\n <>\n <hr className=\"border-neutral-700\" />\n <div className=\"px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap\">\n {`model: ${displayModel ?? \"—\"}\\n` +\n `base_url: ${profile.base_url ?? \"—\"}\\n` +\n // eslint-disable-next-line i18next/no-literal-string -- diagnostic readout; field labels are intentionally untranslated\n `api_key: ${profile.api_key_set ? \"set\" : \"not set\"}`}\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport interface ModelMessagesProps {\n conversationId: string | null | undefined;\n /**\n * Render only entries anchored to this event id. Use `null` to render the\n * \"no events at the time of /model\" entries (top of the chat history).\n */\n anchorEventId: string | null;\n}\n\nexport function ModelMessages({\n conversationId,\n anchorEventId,\n}: ModelMessagesProps) {\n const entriesById = useModelStore((s) => s.entriesByConversation);\n const allEntries = conversationId ? (entriesById[conversationId] ?? []) : [];\n const entries = allEntries.filter((e) => e.anchorEventId === anchorEventId);\n\n if (!conversationId || entries.length === 0) return null;\n\n return (\n <div data-testid=\"model-messages\" className=\"flex flex-col w-full\">\n {entries.map((entry) => {\n if (entry.switchedTo) {\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span className=\"inline-flex items-center gap-1.5\">\n <InfoCircleIcon\n width={14}\n height={14}\n className=\"shrink-0 text-neutral-400\"\n aria-hidden\n />\n <Trans\n i18nKey={I18nKey.MODEL$SWITCHED_TO_PROFILE}\n values={{ name: entry.switchedTo }}\n components={{\n cmd: (\n <span className=\"font-mono text-neutral-200 bg-neutral-800 px-1 rounded\" />\n ),\n }}\n />\n </span>\n }\n details=\"\"\n />\n );\n }\n\n const isEmpty = entry.profiles.length === 0;\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span>\n {isEmpty ? (\n <Trans i18nKey={I18nKey.MODEL$NO_SAVED_PROFILES} />\n ) : (\n <Trans\n i18nKey={I18nKey.MODEL$AVAILABLE_PROFILES}\n values={{ count: entry.profiles.length }}\n />\n )}\n </span>\n }\n details={\n isEmpty ? (\n <span className=\"text-neutral-300 text-sm px-2 py-1 block\">\n <Trans i18nKey={I18nKey.MODEL$NO_PROFILES_HINT} />\n </span>\n ) : (\n <div className=\"flex flex-col gap-1 mt-1\">\n {entry.profiles.map((p) => (\n <ProfileRow key={p.name} profile={p} />\n ))}\n </div>\n )\n }\n initiallyExpanded={isEmpty}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"ykBAcA,SAAS,EAAW,CAAE,WAA4B,CAChD,GAAM,CAAC,EAAU,GAAe,EAAA,QAAM,SAAS,EAAK,EAC9C,EAAe,EAA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