@openhands/agent-canvas 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BkL3HWa3.js → acp-providers-D1PORKc0.js} +1 -1
  4. package/build/assets/active-backend-context-IqOjobNK.js +2 -0
  5. package/build/assets/{agent-context-settings-Bno1nwPL.js → agent-context-settings-DMrObcIS.js} +1 -1
  6. package/build/assets/agent-profiles-settings-DororXN5.js +1 -0
  7. package/build/assets/agent-server-conversation-service.api-DWBe0rbX.js +86 -0
  8. package/build/assets/{agent-settings-h8hQz-IU.js → agent-settings-BJVk92PU.js} +1 -1
  9. package/build/assets/agent-settings-COfJsQ1d.js +1 -0
  10. package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-CzZsm7ms.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-Qsb83VX1.js → api-key-entry-screen-D8Fade_-.js} +1 -1
  12. package/build/assets/app-settings-CpyGB3AT.js +1 -0
  13. package/build/assets/{automation-detail-7LkL91j9.js → automation-detail-B-jQ39Mm.js} +1 -1
  14. package/build/assets/{automation-export-U2QNyNy6.js → automation-export-B1dywoqk.js} +1 -1
  15. package/build/assets/{automation-setup-route-Bel9_Lue.js → automation-setup-route-C-bWUZBi.js} +1 -1
  16. package/build/assets/{automation-templates-CRLDssaI.js → automation-templates-DgpCGOJV.js} +1 -1
  17. package/build/assets/{automations-list-B2iV3ZKW.js → automations-list-DnMxlxsL.js} +1 -1
  18. package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-HHEneWMw.js} +1 -1
  19. package/build/assets/backend-form-modal-DiVrD4Cm.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-DB4717Iu.js → backend-synced-settings-badge-7MIjpr8M.js} +1 -1
  21. package/build/assets/{badge-yR53enbU.js → badge-CpYmcVZV.js} +1 -1
  22. package/build/assets/{base-modal-3NmIOKDm.js → base-modal-Fnh6Uln9.js} +1 -1
  23. package/build/assets/bot-BQZx8e2i.js +1 -0
  24. package/build/assets/{brand-button-CJcwjnfb.js → brand-button-swT1RyO0.js} +1 -1
  25. package/build/assets/browser-B9AbV6kG.js +7 -0
  26. package/build/assets/{browser-tab-A94o33Vn.js → browser-tab-zAY12m_i.js} +1 -1
  27. package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-DsJtivmL.js} +1 -1
  28. package/build/assets/check-WAFXrrs_.js +1 -0
  29. package/build/assets/chevron-down-CifNWzme.js +1 -0
  30. package/build/assets/circle-check-CtnimJa8.js +1 -0
  31. package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-Cuzx55bo.js} +1 -1
  32. package/build/assets/{cloud-funnel-analytics-CBQdPZl_.js → cloud-funnel-analytics-86CwNdSh.js} +1 -1
  33. package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-D0fRotFi.js} +1 -1
  34. package/build/assets/{command-menu-PsRXVBz2.js → command-menu-BXy03FBl.js} +1 -1
  35. package/build/assets/{condenser-settings-w7L3EFvm.js → condenser-settings-BmZa0ui_.js} +1 -1
  36. package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-BgoN6lbN.js} +1 -1
  37. package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-Bq02tc-P.js} +1 -1
  38. package/build/assets/conversation-BPo8SvLN.js +1 -0
  39. package/build/assets/conversation-CPCVsCUY.js +90 -0
  40. package/build/assets/conversation-panel-BPo8SvLN.js +1 -0
  41. package/build/assets/{conversation-state-store-Bs8gA263.js → conversation-state-store-C5YpjMNy.js} +1 -1
  42. package/build/assets/conversation-store-Blc5xysY.js +6 -0
  43. package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-CMqo_0Bd.js} +1 -1
  44. package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-Cg1pF0xn.js} +1 -1
  45. package/build/assets/{device-verify-BIjXeW9N.js → device-verify-BfQLgNyq.js} +1 -1
  46. package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-BIqQr5mx.js} +1 -1
  47. package/build/assets/{entry.client-DzbDyLkV.js → entry.client-CxFjRYqH.js} +2 -2
  48. package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-C_yV4_bo.js} +1 -1
  49. package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-Bi4qbh2g.js} +1 -1
  50. package/build/assets/{extensions-hub-DOmHPGTA.js → extensions-hub-BqUINAhp.js} +1 -1
  51. package/build/assets/{extensions-navigation-6zU5M1pa.js → extensions-navigation-lraj88Wk.js} +1 -1
  52. package/build/assets/external-link-CgtpA_a1.js +1 -0
  53. package/build/assets/{file-text-RecuaId_.js → file-text-DEK4LSVw.js} +1 -1
  54. package/build/assets/files-tab-DV0L-lFE.js +1 -0
  55. package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-7yFSQJq_.js} +1 -1
  56. package/build/assets/format-model-name-BN_rx1Y3.js +1 -0
  57. package/build/assets/{format-relative-time-DGPQlPx0.js → format-relative-time-DSErAuVr.js} +1 -1
  58. package/build/assets/git-provider-icon-BvlLAche.js +1 -0
  59. package/build/assets/{git-repo-dropdown-B7RvO70z.js → git-repo-dropdown-ByMzpNko.js} +1 -1
  60. package/build/assets/git-repo-dropdown-C6R7hgM8.js +1 -0
  61. package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_sfncLZ.js} +1 -1
  62. package/build/assets/{home-DEZaZqYv.js → home-BOrlwLqG.js} +1 -1
  63. package/build/assets/home-BvMNC6E-.js +1 -0
  64. package/build/assets/{home-store-D7CjMN_-.js → home-store-CxqsY9Fi.js} +1 -1
  65. package/build/assets/index-home-BvMNC6E-.js +1 -0
  66. package/build/assets/info-BRVcJAUg.js +1 -0
  67. package/build/assets/{install-server-modal-BTwK5lbi.js → install-server-modal-Bl4G1zF4.js} +1 -1
  68. package/build/assets/{kebab-menu-item-content-C4CkeiJO.js → kebab-menu-item-content-BGoGFEAg.js} +1 -1
  69. package/build/assets/{launch-DVlx4v9o.js → launch-CkqiSCqi.js} +1 -1
  70. package/build/assets/{list-todo-CheUtB7F.js → list-todo-DNWlzfaM.js} +1 -1
  71. package/build/assets/llm-not-configured-banner-DLw_tu-G.js +27 -0
  72. package/build/assets/llm-settings-B-pkVCrt.js +1 -0
  73. package/build/assets/llm-settings-DSC0-IQ7.js +1 -0
  74. package/build/assets/llm-subscription-service-BAdOl5Xx.js +1 -0
  75. package/build/assets/loader-circle-B47W9XqT.js +1 -0
  76. package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-xhnrGP4Y.js} +1 -1
  77. package/build/assets/{manage-backends-modal-HNWKLYhq.js → manage-backends-modal-DhGk5mJt.js} +1 -1
  78. package/build/assets/manifest-653b89aa.js +1 -0
  79. package/build/assets/{manifest-subpage-layout-D-m-h8_t.js → manifest-subpage-layout-CKWvL2ig.js} +1 -1
  80. package/build/assets/{map-provider-7Bp2aih5.js → map-provider-Mx8mZuE-.js} +1 -1
  81. package/build/assets/markdown-renderer-DUmk7pFc.js +8 -0
  82. package/build/assets/{mcp-gLgPP7AS.js → mcp-DCkvl6K0.js} +2 -2
  83. package/build/assets/mcp-marketplace-utils-DEbMXlQr.js +1 -0
  84. package/build/assets/messages-DSXvyc21.js +40 -0
  85. package/build/assets/{modal-body-duRaxj_K.js → modal-body-gIe21fDv.js} +1 -1
  86. package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D66dlgZ7.js} +1 -1
  87. package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-B6iOGYpI.js} +1 -1
  88. package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-BYX1Pw5W.js} +1 -1
  89. package/build/assets/{npm-DRzJF5Zn.js → npm-DLckoeJc.js} +1 -1
  90. package/build/assets/{onboarding-DSr8hOpk.js → onboarding-D7WDG66N.js} +1 -1
  91. package/build/assets/{onboarding-modal-C6Euf7N4.js → onboarding-modal-C_xVrFNv.js} +1 -1
  92. package/build/assets/{organization-service.api-C4GYWwj9.js → organization-service.api-D-s9z18a.js} +1 -1
  93. package/build/assets/pencil-BGOCPRyu.js +1 -0
  94. package/build/assets/{planner-tab-CZcguxTK.js → planner-tab-AKaXIIfg.js} +1 -1
  95. package/build/assets/{plugins-management-service-BmDzOQsd.js → plugins-management-service-wtmY4QQw.js} +1 -1
  96. package/build/assets/plus-zNEL8rcX.js +1 -0
  97. package/build/assets/{profiles-service.api-CoLTwjc1.js → profiles-service.api-DCMYxHMi.js} +1 -1
  98. package/build/assets/{providers-tBzTpz1w.js → providers-BjrtjX4L.js} +1 -1
  99. package/build/assets/{proxy-DCI9S-LA.js → proxy-9Z_WZggZ.js} +1 -1
  100. package/build/assets/{puzzle-B3v361yY.js → puzzle-BWLmN8z4.js} +1 -1
  101. package/build/assets/recommended-automations-launcher-CFlzhu1o.js +1 -0
  102. package/build/assets/refresh-cw-CXtFWpwv.js +1 -0
  103. package/build/assets/root-CanxKlNV.css +1 -0
  104. package/build/assets/root-DkfG_UWR.js +2 -0
  105. package/build/assets/root-layout-D75LHYhh.js +2 -0
  106. package/build/assets/{schema-field-zhsVDllR.js → schema-field-OnM5Uob_.js} +1 -1
  107. package/build/assets/{sdk-section-page-CS4GWn0y.js → sdk-section-page-m5WQm2sy.js} +1 -1
  108. package/build/assets/search-CycosyjN.js +1 -0
  109. package/build/assets/{secrets-service-DjgGduXk.js → secrets-service-B26R61C1.js} +1 -1
  110. package/build/assets/{secrets-settings-f-qahfbi.js → secrets-settings-CbLYCKOX.js} +1 -1
  111. package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DCspm2U5.js} +1 -1
  112. package/build/assets/{settings-DQd0xLEw.js → settings-BJQI_iBM.js} +1 -1
  113. package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-BI8V_Nov.js} +1 -1
  114. package/build/assets/{settings-index-BVwy9JEp.js → settings-index-BiTqJoH7.js} +1 -1
  115. package/build/assets/{settings-input-D61Vzp9e.js → settings-input-Cz62hWVW.js} +1 -1
  116. package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-z_3FW5H3.js} +1 -1
  117. package/build/assets/{settings-modal-D6D5ngET.js → settings-modal-BIrIVn97.js} +1 -1
  118. package/build/assets/{settings-service.api-DZp7E7A9.js → settings-service.api--rJmnuLa.js} +1 -1
  119. package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-BRsSI8Vs.js} +1 -1
  120. package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-Ba7vel6T.js} +1 -1
  121. package/build/assets/shared-conversation-CQK_PqHx.js +1 -0
  122. package/build/assets/shield-check-T3JsDJiM.js +1 -0
  123. package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-Bhi3hVcu.js} +1 -1
  124. package/build/assets/{sidebar-mobile-menu-toggle-OoZBHxaT.js → sidebar-mobile-menu-toggle-YWJNRN4p.js} +1 -1
  125. package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-BSUlY5Ml.js} +1 -1
  126. package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-Cl1cUv_F.js} +1 -1
  127. package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-BXz8L8Rn.js} +1 -1
  128. package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-QgfKv31M.js} +1 -1
  129. package/build/assets/{skill-scope-B1Per5XI.js → skill-scope-Dc3JPW-8.js} +1 -1
  130. package/build/assets/{skills-plugins-B3AO6sMz.js → skills-plugins-CpTV27n3.js} +1 -1
  131. package/build/assets/{skills-settings-DmmgJ6CT.js → skills-settings-CSW__IW4.js} +1 -1
  132. package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-TJ0mdECe.js} +1 -1
  133. package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-BUMSbgrF.js} +1 -1
  134. package/build/assets/{task-list-tab-C19Q_JNf.js → task-list-tab-mAHMOkUz.js} +1 -1
  135. package/build/assets/{terminal-CbuMRYal.js → terminal-BzxBaHx2.js} +1 -1
  136. package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-O5v1FgxW.js} +1 -1
  137. package/build/assets/trash-2-C0xNVp9c.js +1 -0
  138. package/build/assets/{typography-D9tiHct7.js → typography-NOKSk9_R.js} +1 -1
  139. package/build/assets/usage-tab-tEmVN0KD.js +1 -0
  140. package/build/assets/{use-acp-credential-form-DJmmJKMo.js → use-acp-credential-form-BPNi0Zbm.js} +1 -1
  141. package/build/assets/{use-activate-agent-profile-CeFfYwu_.js → use-activate-agent-profile-D9YRQPTF.js} +1 -1
  142. package/build/assets/{use-agent-profiles-BHLkLbRR.js → use-agent-profiles-Cb2zUW3l.js} +1 -1
  143. package/build/assets/{use-can-manage-org-profiles-Bu4y8gSx.js → use-can-manage-org-profiles-Dxzq2AEd.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-QD9x3ySO.js → use-cloud-current-user-id-Co2eJk2A.js} +1 -1
  145. package/build/assets/{use-config-CPwqciXN.js → use-config-DKAMiI5R.js} +1 -1
  146. package/build/assets/use-create-conversation-CoHTiCbI.js +1 -0
  147. package/build/assets/{use-create-secret-BsOfOLvg.js → use-create-secret-2zBlCDsF.js} +1 -1
  148. package/build/assets/use-is-authed-C52-ivnB.js +1 -0
  149. package/build/assets/{use-is-creating-conversation-CVefC9Ns.js → use-is-creating-conversation-DdaAE6jV.js} +1 -1
  150. package/build/assets/{use-launch-skill-in-chat-BcKNjxxd.js → use-launch-skill-in-chat-COnDpxCQ.js} +1 -1
  151. package/build/assets/use-llm-profiles-C_BHue65.js +1 -0
  152. package/build/assets/{use-manifest-capabilities-DBYPjyV6.js → use-manifest-capabilities-DPrQsaPP.js} +1 -1
  153. package/build/assets/{use-onboarding-completion-CtNJxkXG.js → use-onboarding-completion-CCE8OQgV.js} +1 -1
  154. package/build/assets/{use-plugins-marketplace-ZEA-gyM9.js → use-plugins-marketplace-CEiak69h.js} +1 -1
  155. package/build/assets/use-save-agent-profile-DK9idD6a.js +1 -0
  156. package/build/assets/{use-save-settings-pSjRhD_m.js → use-save-settings-DNmnbG6f.js} +1 -1
  157. package/build/assets/{use-settings-nav-items-CQgkxUbV.js → use-settings-nav-items-BlFL7YhM.js} +1 -1
  158. package/build/assets/{use-settings-BHWsOcIG.js → use-settings-wCwPaSIv.js} +1 -1
  159. package/build/assets/{use-tracking-CGCsBWhg.js → use-tracking-CVwPmhlX.js} +1 -1
  160. package/build/assets/{use-user-conversation-DRfEU8x0.js → use-user-conversation-DVtfg0B_.js} +1 -1
  161. package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-p1xq35r2.js} +1 -1
  162. package/build/assets/{useMutation-ChpkYxI5.js → useMutation-BFDQmgk9.js} +1 -1
  163. package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-DF1NAAeC.js} +1 -1
  164. package/build/assets/{useQuery-BCnzy4LX.js → useQuery-DRv--6bK.js} +1 -1
  165. package/build/assets/utils-zxEjKE70.js +1 -0
  166. package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
  167. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js} +3 -3
  168. package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-D9wR9yM2.js} +1 -1
  169. package/build/assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js +13 -0
  170. package/build/assets/vendor~root-layout-C-IgVx6e.js +1 -0
  171. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js} +1 -1
  172. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js} +1 -1
  173. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js} +1 -1
  174. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js} +1 -1
  175. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js} +2 -2
  176. package/build/assets/{verification-settings-BItwt998.js → verification-settings-B8UMQ7MG.js} +1 -1
  177. package/build/assets/{wrench-B1_H-tL1.js → wrench-DIka3hCq.js} +1 -1
  178. package/build/assets/x-BWKA2Ver.js +1 -0
  179. package/build/assets/zap-DHddTPc0.js +1 -0
  180. package/build/index.html +4 -4
  181. package/build/locales/ar/openhands.json +28 -1
  182. package/build/locales/ca/openhands.json +28 -1
  183. package/build/locales/de/openhands.json +28 -1
  184. package/build/locales/en/openhands.json +28 -1
  185. package/build/locales/es/openhands.json +28 -1
  186. package/build/locales/fr/openhands.json +28 -1
  187. package/build/locales/it/openhands.json +28 -1
  188. package/build/locales/ja/openhands.json +28 -1
  189. package/build/locales/ko-KR/openhands.json +28 -1
  190. package/build/locales/no/openhands.json +28 -1
  191. package/build/locales/pt/openhands.json +28 -1
  192. package/build/locales/tr/openhands.json +28 -1
  193. package/build/locales/uk/openhands.json +28 -1
  194. package/build/locales/zh-CN/openhands.json +28 -1
  195. package/build/locales/zh-TW/openhands.json +28 -1
  196. package/config/defaults.json +3 -3
  197. package/dist/api/agent-server-compatibility.cjs +1 -1
  198. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  199. package/dist/api/agent-server-compatibility.js +1 -1
  200. package/dist/api/agent-server-compatibility.js.map +1 -1
  201. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  202. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  203. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +24 -1
  204. package/dist/api/conversation-service/agent-server-conversation-service.api.js +116 -97
  205. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  206. package/dist/api/llm-balance-service.cjs +2 -0
  207. package/dist/api/llm-balance-service.cjs.map +1 -0
  208. package/dist/api/llm-balance-service.d.ts +33 -0
  209. package/dist/api/llm-balance-service.js +53 -0
  210. package/dist/api/llm-balance-service.js.map +1 -0
  211. package/dist/api/llm-subscription-service.cjs +1 -1
  212. package/dist/api/llm-subscription-service.cjs.map +1 -1
  213. package/dist/api/llm-subscription-service.js +42 -34
  214. package/dist/api/llm-subscription-service.js.map +1 -1
  215. package/dist/components/conversation/index.cjs +1 -1
  216. package/dist/components/conversation/index.d.ts +0 -1
  217. package/dist/components/conversation/index.js +0 -1
  218. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  219. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  220. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +1 -1
  221. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  222. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
  223. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
  224. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +24 -23
  225. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
  226. package/dist/components/conversation-events/chat/group-events.cjs +1 -1
  227. package/dist/components/conversation-events/chat/group-events.cjs.map +1 -1
  228. package/dist/components/conversation-events/chat/group-events.d.ts +3 -3
  229. package/dist/components/conversation-events/chat/group-events.js +27 -26
  230. package/dist/components/conversation-events/chat/group-events.js.map +1 -1
  231. package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
  232. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  233. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  234. package/dist/components/features/chat/components/chat-input-actions.js +123 -118
  235. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  236. package/dist/components/features/chat/components/chat-input-grip.cjs +1 -1
  237. package/dist/components/features/chat/components/chat-input-grip.cjs.map +1 -1
  238. package/dist/components/features/chat/components/chat-input-grip.d.ts +2 -1
  239. package/dist/components/features/chat/components/chat-input-grip.js +7 -7
  240. package/dist/components/features/chat/components/chat-input-grip.js.map +1 -1
  241. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
  242. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
  243. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +61 -60
  244. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
  245. package/dist/components/features/chat/components/context-window-meter.cjs +2 -0
  246. package/dist/components/features/chat/components/context-window-meter.cjs.map +1 -0
  247. package/dist/components/features/chat/components/context-window-meter.d.ts +2 -0
  248. package/dist/components/features/chat/components/context-window-meter.js +131 -0
  249. package/dist/components/features/chat/components/context-window-meter.js.map +1 -0
  250. package/dist/components/features/chat/components/context-window-ring.cjs +2 -0
  251. package/dist/components/features/chat/components/context-window-ring.cjs.map +1 -0
  252. package/dist/components/features/chat/components/context-window-ring.d.ts +26 -0
  253. package/dist/components/features/chat/components/context-window-ring.js +45 -0
  254. package/dist/components/features/chat/components/context-window-ring.js.map +1 -0
  255. package/dist/components/features/chat/custom-chat-input.cjs +1 -1
  256. package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
  257. package/dist/components/features/chat/custom-chat-input.js +68 -67
  258. package/dist/components/features/chat/custom-chat-input.js.map +1 -1
  259. package/dist/components/features/chat/model-messages.cjs +1 -1
  260. package/dist/components/features/chat/model-messages.cjs.map +1 -1
  261. package/dist/components/features/chat/model-messages.js +26 -25
  262. package/dist/components/features/chat/model-messages.js.map +1 -1
  263. package/dist/components/features/chat/path-component.cjs +1 -1
  264. package/dist/components/features/chat/path-component.cjs.map +1 -1
  265. package/dist/components/features/chat/path-component.js +9 -6
  266. package/dist/components/features/chat/path-component.js.map +1 -1
  267. package/dist/components/features/chat/plan-preview.cjs +1 -1
  268. package/dist/components/features/chat/plan-preview.js +4 -4
  269. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
  270. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
  271. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.d.ts +0 -8
  272. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +92 -50
  273. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
  274. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
  275. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
  276. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +7 -2
  277. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +15 -9
  278. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
  279. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs +2 -0
  280. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs.map +1 -0
  281. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.d.ts +20 -0
  282. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js +76 -0
  283. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js.map +1 -0
  284. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  285. package/dist/components/features/controls/server-status-context-menu.cjs.map +1 -1
  286. package/dist/components/features/controls/server-status-context-menu.d.ts +5 -3
  287. package/dist/components/features/controls/server-status-context-menu.js +8 -8
  288. package/dist/components/features/controls/server-status-context-menu.js.map +1 -1
  289. package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
  290. package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
  291. package/dist/components/features/conversation/conversation-name-context-menu.js +58 -61
  292. package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
  293. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  294. package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
  295. package/dist/components/features/conversation/conversation-name-with-status.js +74 -46
  296. package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
  297. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  298. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  299. package/dist/components/features/conversation/conversation-name.js +69 -71
  300. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  301. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs +1 -1
  302. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs.map +1 -1
  303. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js +7 -6
  304. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js.map +1 -1
  305. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  306. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  307. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +92 -86
  308. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  309. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  310. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  311. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +81 -71
  312. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  313. package/dist/components/features/conversation/metrics-modal/cost-section.cjs +1 -1
  314. package/dist/components/features/conversation/metrics-modal/cost-section.cjs.map +1 -1
  315. package/dist/components/features/conversation/metrics-modal/cost-section.js +6 -6
  316. package/dist/components/features/conversation/metrics-modal/cost-section.js.map +1 -1
  317. package/dist/components/features/conversation/metrics-modal/metric-row.cjs +1 -1
  318. package/dist/components/features/conversation/metrics-modal/metric-row.cjs.map +1 -1
  319. package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +2 -1
  320. package/dist/components/features/conversation/metrics-modal/metric-row.js +10 -9
  321. package/dist/components/features/conversation/metrics-modal/metric-row.js.map +1 -1
  322. package/dist/components/features/conversation/metrics-modal/usage-section.cjs +1 -1
  323. package/dist/components/features/conversation/metrics-modal/usage-section.cjs.map +1 -1
  324. package/dist/components/features/conversation/metrics-modal/usage-section.js +2 -1
  325. package/dist/components/features/conversation/metrics-modal/usage-section.js.map +1 -1
  326. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs +2 -0
  327. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs.map +1 -0
  328. package/dist/components/features/conversation/usage-panel/compact-context-button.d.ts +16 -0
  329. package/dist/components/features/conversation/usage-panel/compact-context-button.js +59 -0
  330. package/dist/components/features/conversation/usage-panel/compact-context-button.js.map +1 -0
  331. package/dist/components/features/conversation/usage-panel/context-meter.cjs +2 -0
  332. package/dist/components/features/conversation/usage-panel/context-meter.cjs.map +1 -0
  333. package/dist/components/features/conversation/usage-panel/context-meter.d.ts +19 -0
  334. package/dist/components/features/conversation/usage-panel/context-meter.js +46 -0
  335. package/dist/components/features/conversation/usage-panel/context-meter.js.map +1 -0
  336. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs +2 -0
  337. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs.map +1 -0
  338. package/dist/components/features/conversation/usage-panel/provider-balance-card.d.ts +7 -0
  339. package/dist/components/features/conversation/usage-panel/provider-balance-card.js +57 -0
  340. package/dist/components/features/conversation/usage-panel/provider-balance-card.js.map +1 -0
  341. package/dist/components/features/conversation/usage-panel/usage-panel.cjs +2 -0
  342. package/dist/components/features/conversation/usage-panel/usage-panel.cjs.map +1 -0
  343. package/dist/components/features/conversation/usage-panel/usage-panel.d.ts +9 -0
  344. package/dist/components/features/conversation/usage-panel/usage-panel.js +68 -0
  345. package/dist/components/features/conversation/usage-panel/usage-panel.js.map +1 -0
  346. package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
  347. package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
  348. package/dist/components/features/conversation-panel/budget-display.js +10 -13
  349. package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
  350. package/dist/components/features/conversation-panel/budget-progress-bar.cjs +1 -1
  351. package/dist/components/features/conversation-panel/budget-progress-bar.cjs.map +1 -1
  352. package/dist/components/features/conversation-panel/budget-progress-bar.js +2 -2
  353. package/dist/components/features/conversation-panel/budget-progress-bar.js.map +1 -1
  354. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs +2 -0
  355. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs.map +1 -0
  356. package/dist/components/features/conversation-panel/confirm-archive-modal.d.ts +8 -0
  357. package/dist/components/features/conversation-panel/confirm-archive-modal.js +48 -0
  358. package/dist/components/features/conversation-panel/confirm-archive-modal.js.map +1 -0
  359. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  360. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
  361. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +3 -1
  362. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +39 -34
  363. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
  364. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  365. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  366. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +3 -1
  367. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +104 -80
  368. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  369. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  370. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
  371. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +7 -1
  372. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +28 -20
  373. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
  374. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
  375. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
  376. package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +9 -1
  377. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +94 -84
  378. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
  379. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs +1 -1
  380. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs.map +1 -1
  381. package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +2 -1
  382. package/dist/components/features/conversation-panel/conversation-group-folder-list.js +32 -31
  383. package/dist/components/features/conversation-panel/conversation-group-folder-list.js.map +1 -1
  384. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs +1 -1
  385. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs.map +1 -1
  386. package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +2 -1
  387. package/dist/components/features/conversation-panel/conversation-group-folder-row.js +27 -26
  388. package/dist/components/features/conversation-panel/conversation-group-folder-row.js.map +1 -1
  389. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  390. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  391. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +3 -1
  392. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +116 -106
  393. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  394. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  395. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  396. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +27 -0
  397. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +69 -46
  398. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  399. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  400. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  401. package/dist/components/features/conversation-panel/conversation-panel.js +230 -165
  402. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  403. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  404. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  405. package/dist/components/features/files-tab/file-content-viewer.js +22 -25
  406. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  407. package/dist/components/features/markdown/markdown-table-scroll.cjs +1 -1
  408. package/dist/components/features/markdown/markdown-table-scroll.cjs.map +1 -1
  409. package/dist/components/features/markdown/markdown-table-scroll.js +2 -2
  410. package/dist/components/features/markdown/markdown-table-scroll.js.map +1 -1
  411. package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
  412. package/dist/components/features/settings/llm-profiles/profile-row.js +1 -0
  413. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  414. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
  415. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +2 -2
  416. package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
  417. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  418. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  419. package/dist/components/shared/modals/confirmation-modals/base-modal.js +1 -1
  420. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  421. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  422. package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
  423. package/dist/components/shared/modals/settings/model-selector.js +154 -98
  424. package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
  425. package/dist/config/defaults.cjs +1 -1
  426. package/dist/config/defaults.cjs.map +1 -1
  427. package/dist/config/defaults.js +3 -3
  428. package/dist/config/defaults.js.map +1 -1
  429. package/dist/constants/llm-balance.cjs +2 -0
  430. package/dist/constants/llm-balance.cjs.map +1 -0
  431. package/dist/constants/llm-balance.d.ts +13 -0
  432. package/dist/constants/llm-balance.js +6 -0
  433. package/dist/constants/llm-balance.js.map +1 -0
  434. package/dist/contexts/conversation-websocket-context.cjs +2 -2
  435. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  436. package/dist/contexts/conversation-websocket-context.js +217 -209
  437. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  438. package/dist/hooks/chat/use-grip-resize.cjs +1 -1
  439. package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
  440. package/dist/hooks/chat/use-grip-resize.d.ts +1 -0
  441. package/dist/hooks/chat/use-grip-resize.js +39 -30
  442. package/dist/hooks/chat/use-grip-resize.js.map +1 -1
  443. package/dist/hooks/chat/use-slash-command.cjs +1 -1
  444. package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
  445. package/dist/hooks/chat/use-slash-command.js +61 -60
  446. package/dist/hooks/chat/use-slash-command.js.map +1 -1
  447. package/dist/hooks/mutation/use-condense-conversation.cjs +2 -0
  448. package/dist/hooks/mutation/use-condense-conversation.cjs.map +1 -0
  449. package/dist/hooks/mutation/use-condense-conversation.d.ts +12 -0
  450. package/dist/hooks/mutation/use-condense-conversation.js +17 -0
  451. package/dist/hooks/mutation/use-condense-conversation.js.map +1 -0
  452. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  453. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  454. package/dist/hooks/mutation/use-create-conversation.js +30 -21
  455. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  456. package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
  457. package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
  458. package/dist/hooks/mutation/use-new-conversation-command.js +1 -1
  459. package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
  460. package/dist/hooks/query/use-conversation-metrics.cjs +1 -1
  461. package/dist/hooks/query/use-conversation-metrics.cjs.map +1 -1
  462. package/dist/hooks/query/use-conversation-metrics.js +1 -1
  463. package/dist/hooks/query/use-conversation-metrics.js.map +1 -1
  464. package/dist/hooks/query/use-llm-balance.cjs +2 -0
  465. package/dist/hooks/query/use-llm-balance.cjs.map +1 -0
  466. package/dist/hooks/query/use-llm-balance.d.ts +10 -0
  467. package/dist/hooks/query/use-llm-balance.js +24 -0
  468. package/dist/hooks/query/use-llm-balance.js.map +1 -0
  469. package/dist/hooks/query/use-search-providers.cjs +1 -1
  470. package/dist/hooks/query/use-search-providers.cjs.map +1 -1
  471. package/dist/hooks/query/use-search-providers.js +1 -1
  472. package/dist/hooks/query/use-search-providers.js.map +1 -1
  473. package/dist/hooks/use-await-context-compaction.cjs +2 -0
  474. package/dist/hooks/use-await-context-compaction.cjs.map +1 -0
  475. package/dist/hooks/use-await-context-compaction.d.ts +38 -0
  476. package/dist/hooks/use-await-context-compaction.js +61 -0
  477. package/dist/hooks/use-await-context-compaction.js.map +1 -0
  478. package/dist/hooks/use-compact-context-action.cjs +2 -0
  479. package/dist/hooks/use-compact-context-action.cjs.map +1 -0
  480. package/dist/hooks/use-compact-context-action.d.ts +10 -0
  481. package/dist/hooks/use-compact-context-action.js +61 -0
  482. package/dist/hooks/use-compact-context-action.js.map +1 -0
  483. package/dist/hooks/use-context-window-usage.cjs +2 -0
  484. package/dist/hooks/use-context-window-usage.cjs.map +1 -0
  485. package/dist/hooks/use-context-window-usage.d.ts +5 -0
  486. package/dist/hooks/use-context-window-usage.js +20 -0
  487. package/dist/hooks/use-context-window-usage.js.map +1 -0
  488. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  489. package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
  490. package/dist/hooks/use-conversation-name-context-menu.d.ts +0 -3
  491. package/dist/hooks/use-conversation-name-context-menu.js +54 -57
  492. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  493. package/dist/hooks/use-drag-resize.cjs +1 -1
  494. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  495. package/dist/hooks/use-drag-resize.d.ts +8 -0
  496. package/dist/hooks/use-drag-resize.js +21 -18
  497. package/dist/hooks/use-drag-resize.js.map +1 -1
  498. package/dist/hooks/use-live-conversation-metrics.cjs +2 -0
  499. package/dist/hooks/use-live-conversation-metrics.cjs.map +1 -0
  500. package/dist/hooks/use-live-conversation-metrics.d.ts +18 -0
  501. package/dist/hooks/use-live-conversation-metrics.js +37 -0
  502. package/dist/hooks/use-live-conversation-metrics.js.map +1 -0
  503. package/dist/hooks/use-select-conversation-tab.cjs +1 -1
  504. package/dist/hooks/use-select-conversation-tab.cjs.map +1 -1
  505. package/dist/hooks/use-select-conversation-tab.js +2 -2
  506. package/dist/hooks/use-select-conversation-tab.js.map +1 -1
  507. package/dist/i18n/declaration.cjs +1 -1
  508. package/dist/i18n/declaration.cjs.map +1 -1
  509. package/dist/i18n/declaration.d.ts +27 -0
  510. package/dist/i18n/declaration.js +1 -1
  511. package/dist/i18n/declaration.js.map +1 -1
  512. package/dist/i18n/translation.cjs +2 -2
  513. package/dist/i18n/translation.cjs.map +1 -1
  514. package/dist/i18n/translation.js +474 -15
  515. package/dist/i18n/translation.js.map +1 -1
  516. package/dist/index.cjs +1 -1
  517. package/dist/index.js +28 -29
  518. package/dist/lib/index.cjs +1 -1
  519. package/dist/lib/index.js +0 -1
  520. package/dist/locales/ar/openhands.json +28 -1
  521. package/dist/locales/ca/openhands.json +28 -1
  522. package/dist/locales/de/openhands.json +28 -1
  523. package/dist/locales/en/openhands.json +28 -1
  524. package/dist/locales/es/openhands.json +28 -1
  525. package/dist/locales/fr/openhands.json +28 -1
  526. package/dist/locales/it/openhands.json +28 -1
  527. package/dist/locales/ja/openhands.json +28 -1
  528. package/dist/locales/ko-KR/openhands.json +28 -1
  529. package/dist/locales/no/openhands.json +28 -1
  530. package/dist/locales/pt/openhands.json +28 -1
  531. package/dist/locales/tr/openhands.json +28 -1
  532. package/dist/locales/uk/openhands.json +28 -1
  533. package/dist/locales/zh-CN/openhands.json +28 -1
  534. package/dist/locales/zh-TW/openhands.json +28 -1
  535. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs +5 -5
  536. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs.map +1 -1
  537. package/dist/node_modules/@microlink/react-json-view/dist/main.js +5194 -5187
  538. package/dist/node_modules/@microlink/react-json-view/dist/main.js.map +1 -1
  539. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +2 -1
  540. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -0
  541. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +21 -1
  542. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -0
  543. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +2 -1
  544. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs.map +1 -0
  545. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +22 -1
  546. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js.map +1 -0
  547. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +2 -1
  548. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs.map +1 -0
  549. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +33 -1
  550. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js.map +1 -0
  551. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  552. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  553. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +56 -22
  554. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  555. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs +1 -1
  556. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs.map +1 -1
  557. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js +3 -0
  558. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js.map +1 -1
  559. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +2 -1
  560. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs.map +1 -0
  561. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +31 -1
  562. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js.map +1 -0
  563. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +2 -1
  564. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs.map +1 -0
  565. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +21 -1
  566. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js.map +1 -0
  567. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +2 -1
  568. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs.map +1 -0
  569. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +21 -1
  570. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js.map +1 -0
  571. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.cjs.map +1 -1
  572. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.js.map +1 -1
  573. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  574. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  575. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +9 -5
  576. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  577. package/dist/node_modules/i18next-http-backend/esm/index.cjs +1 -1
  578. package/dist/node_modules/i18next-http-backend/esm/index.cjs.map +1 -1
  579. package/dist/node_modules/i18next-http-backend/esm/index.js +2 -2
  580. package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
  581. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs +2 -0
  582. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs.map +1 -0
  583. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js +31 -0
  584. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js.map +1 -0
  585. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs +2 -0
  586. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs.map +1 -0
  587. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js +23 -0
  588. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js.map +1 -0
  589. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs +2 -0
  590. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs.map +1 -0
  591. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +12 -0
  592. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js.map +1 -0
  593. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs +2 -0
  594. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs.map +1 -0
  595. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js +23 -0
  596. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js.map +1 -0
  597. package/dist/node_modules/zustand/esm/middleware.cjs +3 -3
  598. package/dist/node_modules/zustand/esm/middleware.cjs.map +1 -1
  599. package/dist/node_modules/zustand/esm/middleware.js +33 -31
  600. package/dist/node_modules/zustand/esm/middleware.js.map +1 -1
  601. package/dist/package.cjs +1 -1
  602. package/dist/package.cjs.map +1 -1
  603. package/dist/package.js +17 -16
  604. package/dist/package.js.map +1 -1
  605. package/dist/routes/app-settings.cjs +1 -1
  606. package/dist/routes/app-settings.cjs.map +1 -1
  607. package/dist/routes/app-settings.js +94 -93
  608. package/dist/routes/app-settings.js.map +1 -1
  609. package/dist/routes/llm-settings.cjs +1 -1
  610. package/dist/routes/llm-settings.cjs.map +1 -1
  611. package/dist/routes/llm-settings.js +131 -119
  612. package/dist/routes/llm-settings.js.map +1 -1
  613. package/dist/routes/usage-tab.cjs +2 -0
  614. package/dist/routes/usage-tab.cjs.map +1 -0
  615. package/dist/routes/usage-tab.d.ts +2 -0
  616. package/dist/routes/usage-tab.js +10 -0
  617. package/dist/routes/usage-tab.js.map +1 -0
  618. package/dist/services/child-conversation-launch.cjs +1 -1
  619. package/dist/services/child-conversation-launch.cjs.map +1 -1
  620. package/dist/services/child-conversation-launch.js +11 -5
  621. package/dist/services/child-conversation-launch.js.map +1 -1
  622. package/dist/stores/archived-conversations-store.cjs +2 -0
  623. package/dist/stores/archived-conversations-store.cjs.map +1 -0
  624. package/dist/stores/archived-conversations-store.d.ts +24 -0
  625. package/dist/stores/archived-conversations-store.js +33 -0
  626. package/dist/stores/archived-conversations-store.js.map +1 -0
  627. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  628. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  629. package/dist/stores/conversation-panel-preferences-store.d.ts +3 -0
  630. package/dist/stores/conversation-panel-preferences-store.js +4 -0
  631. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  632. package/dist/stores/conversation-store.cjs.map +1 -1
  633. package/dist/stores/conversation-store.d.ts +1 -1
  634. package/dist/stores/conversation-store.js.map +1 -1
  635. package/dist/stores/metrics-store.cjs +1 -1
  636. package/dist/stores/metrics-store.cjs.map +1 -1
  637. package/dist/stores/metrics-store.d.ts +1 -0
  638. package/dist/stores/metrics-store.js +7 -4
  639. package/dist/stores/metrics-store.js.map +1 -1
  640. package/dist/types/agent-server/core/events/condensation-event.d.ts +3 -0
  641. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +4 -6
  642. package/dist/types/agent-server/type-guards.cjs +1 -1
  643. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  644. package/dist/types/agent-server/type-guards.d.ts +5 -0
  645. package/dist/types/agent-server/type-guards.js +3 -3
  646. package/dist/types/agent-server/type-guards.js.map +1 -1
  647. package/dist/utils/conversation-local-storage.cjs +1 -1
  648. package/dist/utils/conversation-local-storage.cjs.map +1 -1
  649. package/dist/utils/conversation-local-storage.js +2 -1
  650. package/dist/utils/conversation-local-storage.js.map +1 -1
  651. package/dist/utils/format-model-name.cjs +1 -1
  652. package/dist/utils/format-model-name.cjs.map +1 -1
  653. package/dist/utils/format-model-name.d.ts +11 -0
  654. package/dist/utils/format-model-name.js +11 -3
  655. package/dist/utils/format-model-name.js.map +1 -1
  656. package/dist/utils/format-token-count.cjs +2 -0
  657. package/dist/utils/format-token-count.cjs.map +1 -0
  658. package/dist/utils/format-token-count.d.ts +3 -0
  659. package/dist/utils/format-token-count.js +19 -0
  660. package/dist/utils/format-token-count.js.map +1 -0
  661. package/dist/utils/hover-reveal-classes.cjs +2 -0
  662. package/dist/utils/hover-reveal-classes.cjs.map +1 -0
  663. package/dist/utils/hover-reveal-classes.d.ts +34 -0
  664. package/dist/utils/hover-reveal-classes.js +41 -0
  665. package/dist/utils/hover-reveal-classes.js.map +1 -0
  666. package/dist/utils/is-markdown-file-path.cjs +2 -0
  667. package/dist/utils/is-markdown-file-path.cjs.map +1 -0
  668. package/dist/utils/is-markdown-file-path.d.ts +4 -0
  669. package/dist/utils/is-markdown-file-path.js +14 -0
  670. package/dist/utils/is-markdown-file-path.js.map +1 -0
  671. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  672. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  673. package/dist/utils/mcp-marketplace-utils.d.ts +7 -0
  674. package/dist/utils/mcp-marketplace-utils.js +19 -16
  675. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  676. package/dist/utils/transcript-export/index.cjs +3 -3
  677. package/dist/utils/transcript-export/index.cjs.map +1 -1
  678. package/dist/utils/transcript-export/index.js +12 -12
  679. package/dist/utils/transcript-export/index.js.map +1 -1
  680. package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
  681. package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
  682. package/dist/utils/transcript-export/load-complete-events.js +4 -4
  683. package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
  684. package/dist/utils/workspace-relative-path.cjs +2 -0
  685. package/dist/utils/workspace-relative-path.cjs.map +1 -0
  686. package/dist/utils/workspace-relative-path.d.ts +10 -0
  687. package/dist/utils/workspace-relative-path.js +22 -0
  688. package/dist/utils/workspace-relative-path.js.map +1 -0
  689. package/package.json +17 -16
  690. package/scripts/check-sdk-version-sync.mjs +6 -6
  691. package/scripts/dev-process-utils.mjs +6 -1
  692. package/scripts/dev-safe.mjs +57 -2
  693. package/build/assets/active-backend-context-BBvP-bI2.js +0 -2
  694. package/build/assets/agent-profiles-settings-DqoS7RL3.js +0 -1
  695. package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +0 -86
  696. package/build/assets/agent-settings-BJHryp65.js +0 -1
  697. package/build/assets/app-settings-r1RUbgGi.js +0 -1
  698. package/build/assets/backend-form-modal-OroTqnAv.js +0 -1
  699. package/build/assets/bot-DuN83i3p.js +0 -1
  700. package/build/assets/browser--eoQOo4M.js +0 -6
  701. package/build/assets/check-DLOKoFU9.js +0 -1
  702. package/build/assets/chevron-down-CnIbtM6i.js +0 -1
  703. package/build/assets/circle-check-CxCYJrpZ.js +0 -1
  704. package/build/assets/conversation-BUzBZAc-.js +0 -90
  705. package/build/assets/conversation-panel-pzAKsSDb.js +0 -1
  706. package/build/assets/conversation-pzAKsSDb.js +0 -1
  707. package/build/assets/conversation-store-B8Eahyeg.js +0 -6
  708. package/build/assets/external-link-zWbg5KXS.js +0 -1
  709. package/build/assets/files-tab-BzofBmF4.js +0 -1
  710. package/build/assets/git-provider-icon-BLMlwy02.js +0 -1
  711. package/build/assets/git-repo-dropdown-B_PTq4ol.js +0 -1
  712. package/build/assets/home-r89Vj2td.js +0 -1
  713. package/build/assets/index-home-r89Vj2td.js +0 -1
  714. package/build/assets/llm-not-configured-banner-CwKu8C6g.js +0 -27
  715. package/build/assets/llm-settings-BJotLQND.js +0 -1
  716. package/build/assets/llm-settings-CDM-5H2A.js +0 -1
  717. package/build/assets/llm-subscription-service-7eVfDIE1.js +0 -1
  718. package/build/assets/loader-circle-C5AnEN8r.js +0 -1
  719. package/build/assets/manifest-2a36a8f8.js +0 -1
  720. package/build/assets/markdown-renderer-BiiiIznl.js +0 -8
  721. package/build/assets/mcp-marketplace-utils-Dr_HG_ol.js +0 -1
  722. package/build/assets/messages-D1cbVhRK.js +0 -40
  723. package/build/assets/pencil-Bl3GWhgq.js +0 -1
  724. package/build/assets/plus-CtzlyAoF.js +0 -1
  725. package/build/assets/recommended-automations-launcher-BbJAJVED.js +0 -1
  726. package/build/assets/refresh-cw-B9GhC3QC.js +0 -1
  727. package/build/assets/root-BfM_kC_d.css +0 -1
  728. package/build/assets/root-gstBEjty.js +0 -2
  729. package/build/assets/root-layout-BIAFLP9p.js +0 -2
  730. package/build/assets/search-CYaiKHRp.js +0 -1
  731. package/build/assets/shared-conversation-DIxZjElr.js +0 -1
  732. package/build/assets/shield-check-D2cpEpv3.js +0 -1
  733. package/build/assets/trash-2-CzDVN-Iw.js +0 -1
  734. package/build/assets/use-create-conversation-DWaSVUOB.js +0 -1
  735. package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
  736. package/build/assets/use-llm-profiles-CU8ah1pz.js +0 -1
  737. package/build/assets/use-save-agent-profile-DgI_Uz9a.js +0 -1
  738. package/build/assets/utils-DPQfkd-7.js +0 -1
  739. package/build/assets/vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js +0 -13
  740. package/build/assets/x-RYDBg-e2.js +0 -1
  741. package/build/assets/zap-tbKDzCe3.js +0 -1
  742. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs +0 -2
  743. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs.map +0 -1
  744. package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +0 -6
  745. package/dist/components/features/conversation/metrics-modal/context-window-section.js +0 -46
  746. package/dist/components/features/conversation/metrics-modal/context-window-section.js.map +0 -1
  747. package/dist/components/features/conversation/metrics-modal/empty-state.cjs +0 -2
  748. package/dist/components/features/conversation/metrics-modal/empty-state.cjs.map +0 -1
  749. package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +0 -1
  750. package/dist/components/features/conversation/metrics-modal/empty-state.js +0 -18
  751. package/dist/components/features/conversation/metrics-modal/empty-state.js.map +0 -1
  752. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs +0 -2
  753. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs.map +0 -1
  754. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +0 -5
  755. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js +0 -20
  756. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js.map +0 -1
  757. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs +0 -2
  758. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs.map +0 -1
  759. package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +0 -6
  760. package/dist/components/features/conversation/metrics-modal/metrics-modal.js +0 -57
  761. package/dist/components/features/conversation/metrics-modal/metrics-modal.js.map +0 -1
  762. package/dist/icons/u-credit-card.cjs +0 -2
  763. package/dist/icons/u-credit-card.cjs.map +0 -1
  764. package/dist/icons/u-credit-card.js +0 -21
  765. package/dist/icons/u-credit-card.js.map +0 -1
  766. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js} +0 -0
@@ -1,2 +1,2 @@
1
- const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../../icons/file.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({path:e,range:n}){return(0,r.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground`,children:[(0,r.jsx)(t.default,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,r.jsx)(`span`,{className:`break-all`,children:n?`${e}:${n}`:e})]})}exports.FilePathChip=i;
1
+ const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../../icons/file.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({path:e,range:n,onClick:i}){let a=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.default,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,r.jsx)(`span`,{className:`break-all`,children:n?`${e}:${n}`:e})]}),o=`inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground`;return i?(0,r.jsx)(`button`,{type:`button`,className:`${o} cursor-pointer hover:bg-[var(--oh-interactive-hover)]`,onClick:i,children:a}):(0,r.jsx)(`span`,{className:o,children:a})}exports.FilePathChip=i;
2
2
  //# sourceMappingURL=file-path-chip.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-path-chip.cjs","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/primitives/file-path-chip.tsx"],"sourcesContent":["import React from \"react\";\nimport FileIcon from \"#/icons/file.svg?react\";\n\ninterface FilePathChipProps {\n path: string;\n /** Optional line-range suffix, e.g. \"12-48\". */\n range?: string;\n}\n\n/**\n * Monospace file-path pill with a file icon and an optional line-range suffix.\n */\nexport function FilePathChip({ path, range }: FilePathChipProps) {\n return (\n <span className=\"inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground\">\n <FileIcon className=\"h-3.5 w-3.5 flex-shrink-0 text-muted\" />\n <span className=\"break-all\">{range ? `${path}:${range}` : path}</span>\n </span>\n );\n}\n"],"mappings":"uLAYA,SAAgB,EAAa,CAAE,OAAM,SAA4B,CAC/D,OACE,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,0IAAhB,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAAU,UAAU,sCAAwC,CAAA,GAC5D,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,qBAAa,EAAQ,GAAG,EAAK,GAAG,IAAU,CAAW,CAAA,CACjE,GAEV"}
1
+ {"version":3,"file":"file-path-chip.cjs","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/primitives/file-path-chip.tsx"],"sourcesContent":["import React from \"react\";\nimport FileIcon from \"#/icons/file.svg?react\";\n\ninterface FilePathChipProps {\n path: string;\n /** Optional line-range suffix, e.g. \"12-48\". */\n range?: string;\n /** Opens the referenced file when the surrounding visualizer can navigate. */\n onClick?: () => void;\n}\n\n/**\n * Monospace file-path pill with an optional navigation affordance.\n *\n * The static variant remains available for visualizers without a workspace\n * target; passing `onClick` upgrades the same visual language to a button.\n */\nexport function FilePathChip({ path, range, onClick }: FilePathChipProps) {\n const content = (\n <>\n <FileIcon className=\"h-3.5 w-3.5 flex-shrink-0 text-muted\" />\n <span className=\"break-all\">{range ? `${path}:${range}` : path}</span>\n </>\n );\n const className =\n \"inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground\";\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n className={`${className} cursor-pointer hover:bg-[var(--oh-interactive-hover)]`}\n onClick={onClick}\n >\n {content}\n </button>\n );\n }\n\n return <span className={className}>{content}</span>;\n}\n"],"mappings":"uLAiBA,SAAgB,EAAa,CAAE,OAAM,QAAO,WAA8B,CACxE,IAAM,GACJ,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAAU,UAAU,sCAAwC,CAAA,GAC5D,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,qBAAa,EAAQ,GAAG,EAAK,GAAG,IAAU,CAAW,CAAA,CACrE,CAAA,CAAA,EAEE,EACJ,iIAcF,OAZI,GAEA,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,UAAW,GAAG,EAAU,wDACf,mBAER,CACK,CAAA,GAIL,EAAA,EAAA,KAAC,OAAD,CAAiB,qBAAY,CAAc,CAAA,CACpD"}
@@ -3,9 +3,14 @@ interface FilePathChipProps {
3
3
  path: string;
4
4
  /** Optional line-range suffix, e.g. "12-48". */
5
5
  range?: string;
6
+ /** Opens the referenced file when the surrounding visualizer can navigate. */
7
+ onClick?: () => void;
6
8
  }
7
9
  /**
8
- * Monospace file-path pill with a file icon and an optional line-range suffix.
10
+ * Monospace file-path pill with an optional navigation affordance.
11
+ *
12
+ * The static variant remains available for visualizers without a workspace
13
+ * target; passing `onClick` upgrades the same visual language to a button.
9
14
  */
10
- export declare function FilePathChip({ path, range }: FilePathChipProps): React.JSX.Element;
15
+ export declare function FilePathChip({ path, range, onClick }: FilePathChipProps): React.JSX.Element;
11
16
  export {};
@@ -1,17 +1,23 @@
1
1
  import e from "../../../../../icons/file.js";
2
2
  import "react";
3
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region src/components/features/chat/tool-visualizers/primitives/file-path-chip.tsx
5
- function r({ path: r, range: i }) {
6
- return /* @__PURE__ */ n("span", {
7
- className: "inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground",
8
- children: [/* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 flex-shrink-0 text-muted" }), /* @__PURE__ */ t("span", {
9
- className: "break-all",
10
- children: i ? `${r}:${i}` : r
11
- })]
5
+ function i({ path: i, range: a, onClick: o }) {
6
+ let s = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(e, { className: "h-3.5 w-3.5 flex-shrink-0 text-muted" }), /* @__PURE__ */ n("span", {
7
+ className: "break-all",
8
+ children: a ? `${i}:${a}` : i
9
+ })] }), c = "inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground";
10
+ return o ? /* @__PURE__ */ n("button", {
11
+ type: "button",
12
+ className: `${c} cursor-pointer hover:bg-[var(--oh-interactive-hover)]`,
13
+ onClick: o,
14
+ children: s
15
+ }) : /* @__PURE__ */ n("span", {
16
+ className: c,
17
+ children: s
12
18
  });
13
19
  }
14
20
  //#endregion
15
- export { r as FilePathChip };
21
+ export { i as FilePathChip };
16
22
 
17
23
  //# sourceMappingURL=file-path-chip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-path-chip.js","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/primitives/file-path-chip.tsx"],"sourcesContent":["import React from \"react\";\nimport FileIcon from \"#/icons/file.svg?react\";\n\ninterface FilePathChipProps {\n path: string;\n /** Optional line-range suffix, e.g. \"12-48\". */\n range?: string;\n}\n\n/**\n * Monospace file-path pill with a file icon and an optional line-range suffix.\n */\nexport function FilePathChip({ path, range }: FilePathChipProps) {\n return (\n <span className=\"inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground\">\n <FileIcon className=\"h-3.5 w-3.5 flex-shrink-0 text-muted\" />\n <span className=\"break-all\">{range ? `${path}:${range}` : path}</span>\n </span>\n );\n}\n"],"mappings":";;;;AAYA,SAAgB,EAAa,EAAE,SAAM,YAA4B;CAC/D,OACE,kBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,kBAAC,GAAD,EAAU,WAAU,uCAAwC,CAAA,GAC5D,kBAAC,QAAD;GAAM,WAAU;aAAa,IAAQ,GAAG,EAAK,GAAG,MAAU;EAAW,CAAA,CACjE;;AAEV"}
1
+ {"version":3,"file":"file-path-chip.js","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/primitives/file-path-chip.tsx"],"sourcesContent":["import React from \"react\";\nimport FileIcon from \"#/icons/file.svg?react\";\n\ninterface FilePathChipProps {\n path: string;\n /** Optional line-range suffix, e.g. \"12-48\". */\n range?: string;\n /** Opens the referenced file when the surrounding visualizer can navigate. */\n onClick?: () => void;\n}\n\n/**\n * Monospace file-path pill with an optional navigation affordance.\n *\n * The static variant remains available for visualizers without a workspace\n * target; passing `onClick` upgrades the same visual language to a button.\n */\nexport function FilePathChip({ path, range, onClick }: FilePathChipProps) {\n const content = (\n <>\n <FileIcon className=\"h-3.5 w-3.5 flex-shrink-0 text-muted\" />\n <span className=\"break-all\">{range ? `${path}:${range}` : path}</span>\n </>\n );\n const className =\n \"inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground\";\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n className={`${className} cursor-pointer hover:bg-[var(--oh-interactive-hover)]`}\n onClick={onClick}\n >\n {content}\n </button>\n );\n }\n\n return <span className={className}>{content}</span>;\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAa,EAAE,SAAM,UAAO,cAA8B;CACxE,IAAM,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,EAAU,WAAU,uCAAwC,CAAA,GAC5D,kBAAC,QAAD;EAAM,WAAU;YAAa,IAAQ,GAAG,EAAK,GAAG,MAAU;CAAW,CAAA,CACrE,EAAA,CAAA,GAEE,IACJ;CAcF,OAZI,IAEA,kBAAC,UAAD;EACE,MAAK;EACL,WAAW,GAAG,EAAU;EACf;YAER;CACK,CAAA,IAIL,kBAAC,QAAD;EAAiB;YAAY;CAAc,CAAA;AACpD"}
@@ -0,0 +1,2 @@
1
+ require("../../../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),t=require("../../../../../i18n/declaration.cjs"),n=require("../../../../../node_modules/lucide-react/dist/esm/icons/arrow-up-right.cjs"),r=require("../../../../../types/agent-server/type-guards.cjs"),i=require("../../../markdown/markdown-renderer.cjs"),a=require("../../../../../icons/file.cjs"),o=require("../../../../../ui/typography.cjs"),s=require("../../../markdown/plan-components.cjs"),c=require("../../../../../utils/is-markdown-file-path.cjs");let l=require("react/jsx-runtime");var u=new Set([`FileEditorAction`,`StrReplaceEditorAction`]),d=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`]);function f(e,t){if(r.isActionEvent(e)&&u.has(e.action.kind))return e.action.path||null;if(r.isObservationEvent(e)&&d.has(e.observation.kind)){let n=e.observation.path;if(n)return n;if(t&&u.has(t.action.kind))return t.action.path||null}return null}function p(e,t){if(r.isActionEvent(e)&&u.has(e.action.kind))return e.action.command||null;if(r.isObservationEvent(e)&&d.has(e.observation.kind)){let n=e.observation.command;if(n)return n;if(t&&u.has(t.action.kind))return t.action.command||null}return null}function m(e,t){let n=f(e,t),r=p(e,t);return!!(n&&r===`create`&&c.isMarkdownFilePath(n))}function h({content:r,path:c,onView:u}){let{t:d}=e.useTranslation(`openhands`),f=c.split(`/`).pop()||c;return(0,l.jsxs)(`div`,{className:`w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]`,"data-testid":`markdown-file-preview`,children:[(0,l.jsx)(`div`,{"data-testid":`markdown-file-preview-content`,className:`max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]`,children:(0,l.jsx)(i.MarkdownRenderer,{content:r,includeStandard:!0,includeHeadings:!0,components:s.planComponents})}),(0,l.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3`,children:[(0,l.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,l.jsx)(a.default,{className:`h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]`}),(0,l.jsx)(o.Typography.Text,{className:`truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]`,children:f})]}),u?(0,l.jsxs)(`button`,{type:`button`,onClick:u,className:`flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80`,"data-testid":`markdown-file-preview-view`,children:[(0,l.jsx)(o.Typography.Text,{className:`text-[11px] leading-4 tracking-[0.11px] text-white`,children:d(t.I18nKey.COMMON$VIEW)}),(0,l.jsx)(n.ArrowUpRight,{className:`text-white`,size:16})]}):null]})]})}exports.MarkdownFilePreview=h,exports.isMarkdownFileEditorEvent=m;
2
+ //# sourceMappingURL=markdown-file-preview.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-file-preview.cjs","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx"],"sourcesContent":["/**\n * Inline markdown artifact preview for chat tool cards.\n *\n * Shows a height-limited scrollable rich preview so long reports stay compact\n * in the stream; the footer View action deep-links into the Files drawer for\n * the full document. Markdown *create* file-editor events stay expanded and\n * ungrouped so the preview is visible without an extra click.\n */\nimport { useTranslation } from \"react-i18next\";\nimport { ArrowUpRight } from \"lucide-react\";\nimport FileIcon from \"#/icons/file.svg?react\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { MarkdownRenderer } from \"#/components/features/markdown/markdown-renderer\";\nimport { planComponents } from \"#/components/features/markdown/plan-components\";\nimport { Typography } from \"#/ui/typography\";\nimport { isMarkdownFilePath } from \"#/utils/is-markdown-file-path\";\nimport type {\n ActionEvent,\n ObservationEvent,\n OpenHandsEvent,\n} from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n} from \"#/types/agent-server/type-guards\";\nimport type {\n FileEditorAction,\n StrReplaceEditorAction,\n} from \"#/types/agent-server/core/base/action\";\nimport type {\n FileEditorObservation,\n StrReplaceEditorObservation,\n} from \"#/types/agent-server/core/base/observation\";\n\nexport { isMarkdownFilePath } from \"#/utils/is-markdown-file-path\";\n\nconst FILE_EDITOR_ACTION_KINDS = new Set([\n \"FileEditorAction\",\n \"StrReplaceEditorAction\",\n]);\nconst FILE_EDITOR_OBSERVATION_KINDS = new Set([\n \"FileEditorObservation\",\n \"StrReplaceEditorObservation\",\n]);\n\ninterface MarkdownFilePreviewProps {\n content: string;\n path: string;\n /** When omitted (e.g. in-flight create), the View affordance is hidden. */\n onView?: () => void;\n}\n\n/**\n * Resolves the file path for a file-editor action/observation, including the\n * observation's originating action when the observation omits `path`.\n */\nfunction getFileEditorEventPath(\n event: OpenHandsEvent,\n correspondingAction?: ActionEvent,\n): string | null {\n if (isActionEvent(event) && FILE_EDITOR_ACTION_KINDS.has(event.action.kind)) {\n return (\n (event as ActionEvent<FileEditorAction | StrReplaceEditorAction>).action\n .path || null\n );\n }\n\n if (\n isObservationEvent(event) &&\n FILE_EDITOR_OBSERVATION_KINDS.has(event.observation.kind)\n ) {\n const path = (\n event as ObservationEvent<\n FileEditorObservation | StrReplaceEditorObservation\n >\n ).observation.path;\n if (path) return path;\n if (\n correspondingAction &&\n FILE_EDITOR_ACTION_KINDS.has(correspondingAction.action.kind)\n ) {\n return (\n (\n correspondingAction as ActionEvent<\n FileEditorAction | StrReplaceEditorAction\n >\n ).action.path || null\n );\n }\n }\n\n return null;\n}\n\n/**\n * Resolves the file-editor command (`create` / `view` / …), including the\n * observation's originating action when the observation omits `command`.\n */\nfunction getFileEditorEventCommand(\n event: OpenHandsEvent,\n correspondingAction?: ActionEvent,\n): string | null {\n if (isActionEvent(event) && FILE_EDITOR_ACTION_KINDS.has(event.action.kind)) {\n return (\n (event as ActionEvent<FileEditorAction | StrReplaceEditorAction>).action\n .command || null\n );\n }\n\n if (\n isObservationEvent(event) &&\n FILE_EDITOR_OBSERVATION_KINDS.has(event.observation.kind)\n ) {\n const command = (\n event as ObservationEvent<\n FileEditorObservation | StrReplaceEditorObservation\n >\n ).observation.command;\n if (command) return command;\n if (\n correspondingAction &&\n FILE_EDITOR_ACTION_KINDS.has(correspondingAction.action.kind)\n ) {\n return (\n (\n correspondingAction as ActionEvent<\n FileEditorAction | StrReplaceEditorAction\n >\n ).action.command || null\n );\n }\n }\n\n return null;\n}\n\n/**\n * True for file-editor *create* events whose path is a markdown artifact.\n *\n * Used to keep those cards expanded and outside collapsed action groups so\n * the clipped preview is visible by default. Reads/edits of `.md` files stay\n * on the normal groupable path.\n */\nexport function isMarkdownFileEditorEvent(\n event: OpenHandsEvent,\n correspondingAction?: ActionEvent,\n): boolean {\n const path = getFileEditorEventPath(event, correspondingAction);\n const command = getFileEditorEventCommand(event, correspondingAction);\n return Boolean(path && command === \"create\" && isMarkdownFilePath(path));\n}\n\n/**\n * Height-clipped markdown card with an optional View bar that opens the file.\n */\nexport function MarkdownFilePreview({\n content,\n path,\n onView,\n}: MarkdownFilePreviewProps) {\n const { t } = useTranslation(\"openhands\");\n const fileName = path.split(\"/\").pop() || path;\n\n return (\n <div\n className=\"w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]\"\n data-testid=\"markdown-file-preview\"\n >\n <div\n data-testid=\"markdown-file-preview-content\"\n className=\"max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]\"\n >\n {/* Deliberately compact: the clipped in-stream card reuses the plan\n preview's small typography; the Files drawer renders the same\n artifact full-size with the default components. */}\n <MarkdownRenderer\n content={content}\n includeStandard\n includeHeadings\n components={planComponents}\n />\n </div>\n <div className=\"flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3\">\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <FileIcon className=\"h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]\" />\n <Typography.Text className=\"truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]\">\n {fileName}\n </Typography.Text>\n </div>\n {onView ? (\n <button\n type=\"button\"\n onClick={onView}\n className=\"flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80\"\n data-testid=\"markdown-file-preview-view\"\n >\n <Typography.Text className=\"text-[11px] leading-4 tracking-[0.11px] text-white\">\n {t(I18nKey.COMMON$VIEW)}\n </Typography.Text>\n <ArrowUpRight className=\"text-white\" size={16} />\n </button>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":"ynBAoCA,IAAM,EAA2B,IAAI,IAAI,CACvC,mBACA,wBACF,CAAC,EACK,EAAgC,IAAI,IAAI,CAC5C,wBACA,6BACF,CAAC,EAaD,SAAS,EACP,EACA,EACe,CACf,GAAI,EAAA,cAAc,CAAK,GAAK,EAAyB,IAAI,EAAM,OAAO,IAAI,EACxE,OACG,EAAiE,OAC/D,MAAQ,KAIf,GACE,EAAA,mBAAmB,CAAK,GACxB,EAA8B,IAAI,EAAM,YAAY,IAAI,EACxD,CACA,IAAM,EACJ,EAGA,YAAY,KACd,GAAI,EAAM,OAAO,EACjB,GACE,GACA,EAAyB,IAAI,EAAoB,OAAO,IAAI,EAE5D,OAEI,EAGA,OAAO,MAAQ,IAGvB,CAEA,OAAO,IACT,CAMA,SAAS,EACP,EACA,EACe,CACf,GAAI,EAAA,cAAc,CAAK,GAAK,EAAyB,IAAI,EAAM,OAAO,IAAI,EACxE,OACG,EAAiE,OAC/D,SAAW,KAIlB,GACE,EAAA,mBAAmB,CAAK,GACxB,EAA8B,IAAI,EAAM,YAAY,IAAI,EACxD,CACA,IAAM,EACJ,EAGA,YAAY,QACd,GAAI,EAAS,OAAO,EACpB,GACE,GACA,EAAyB,IAAI,EAAoB,OAAO,IAAI,EAE5D,OAEI,EAGA,OAAO,SAAW,IAG1B,CAEA,OAAO,IACT,CASA,SAAgB,EACd,EACA,EACS,CACT,IAAM,EAAO,EAAuB,EAAO,CAAmB,EACxD,EAAU,EAA0B,EAAO,CAAmB,EACpE,MAAO,GAAQ,GAAQ,IAAY,UAAY,EAAA,mBAAmB,CAAI,EACxE,CAKA,SAAgB,EAAoB,CAClC,UACA,OACA,UAC2B,CAC3B,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,EAAW,EAAK,MAAM,GAAG,EAAE,IAAI,GAAK,EAE1C,OACE,EAAA,EAAA,MAAC,MAAD,CACE,UAAU,gGACV,cAAY,iCAFd,EAIE,EAAA,EAAA,KAAC,MAAD,CACE,cAAY,gCACZ,UAAU,4HAKV,EAAA,EAAA,KAAC,EAAA,iBAAD,CACW,UACT,gBAAA,GACA,gBAAA,GACA,WAAY,EAAA,cACb,CAAA,CACE,CAAA,GACL,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gGAAf,EACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,6CAAf,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAAU,UAAU,kDAAoD,CAAA,GACxE,EAAA,EAAA,KAAC,EAAA,WAAW,KAAZ,CAAiB,UAAU,6FACxB,CACc,CAAA,CACd,IACJ,GACC,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,QAAS,EACT,UAAU,sFACV,cAAY,sCAJd,EAME,EAAA,EAAA,KAAC,EAAA,WAAW,KAAZ,CAAiB,UAAU,8DACxB,EAAE,EAAA,QAAQ,WAAW,CACP,CAAA,GACjB,EAAA,EAAA,KAAC,EAAA,aAAD,CAAc,UAAU,aAAa,KAAM,EAAK,CAAA,CAC1C,IACN,IACD,GACF,GAET"}
@@ -0,0 +1,20 @@
1
+ import type { ActionEvent, OpenHandsEvent } from "#/types/agent-server/core";
2
+ export { isMarkdownFilePath } from "#/utils/is-markdown-file-path";
3
+ interface MarkdownFilePreviewProps {
4
+ content: string;
5
+ path: string;
6
+ /** When omitted (e.g. in-flight create), the View affordance is hidden. */
7
+ onView?: () => void;
8
+ }
9
+ /**
10
+ * True for file-editor *create* events whose path is a markdown artifact.
11
+ *
12
+ * Used to keep those cards expanded and outside collapsed action groups so
13
+ * the clipped preview is visible by default. Reads/edits of `.md` files stay
14
+ * on the normal groupable path.
15
+ */
16
+ export declare function isMarkdownFileEditorEvent(event: OpenHandsEvent, correspondingAction?: ActionEvent): boolean;
17
+ /**
18
+ * Height-clipped markdown card with an optional View bar that opens the file.
19
+ */
20
+ export declare function MarkdownFilePreview({ content, path, onView, }: MarkdownFilePreviewProps): import("react").JSX.Element;
@@ -0,0 +1,76 @@
1
+ import { useTranslation as e } from "../../../../../node_modules/react-i18next/dist/es/useTranslation.js";
2
+ import { I18nKey as t } from "../../../../../i18n/declaration.js";
3
+ import { ArrowUpRight as n } from "../../../../../node_modules/lucide-react/dist/esm/icons/arrow-up-right.js";
4
+ import { isActionEvent as r, isObservationEvent as i } from "../../../../../types/agent-server/type-guards.js";
5
+ import { MarkdownRenderer as a } from "../../../markdown/markdown-renderer.js";
6
+ import o from "../../../../../icons/file.js";
7
+ import { Typography as s } from "../../../../../ui/typography.js";
8
+ import { planComponents as c } from "../../../markdown/plan-components.js";
9
+ import { isMarkdownFilePath as l } from "../../../../../utils/is-markdown-file-path.js";
10
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
+ //#region src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx
12
+ var f = new Set(["FileEditorAction", "StrReplaceEditorAction"]), p = new Set(["FileEditorObservation", "StrReplaceEditorObservation"]);
13
+ function m(e, t) {
14
+ if (r(e) && f.has(e.action.kind)) return e.action.path || null;
15
+ if (i(e) && p.has(e.observation.kind)) {
16
+ let n = e.observation.path;
17
+ if (n) return n;
18
+ if (t && f.has(t.action.kind)) return t.action.path || null;
19
+ }
20
+ return null;
21
+ }
22
+ function h(e, t) {
23
+ if (r(e) && f.has(e.action.kind)) return e.action.command || null;
24
+ if (i(e) && p.has(e.observation.kind)) {
25
+ let n = e.observation.command;
26
+ if (n) return n;
27
+ if (t && f.has(t.action.kind)) return t.action.command || null;
28
+ }
29
+ return null;
30
+ }
31
+ function g(e, t) {
32
+ let n = m(e, t), r = h(e, t);
33
+ return !!(n && r === "create" && l(n));
34
+ }
35
+ function _({ content: r, path: i, onView: l }) {
36
+ let { t: f } = e("openhands"), p = i.split("/").pop() || i;
37
+ return /* @__PURE__ */ d("div", {
38
+ className: "w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]",
39
+ "data-testid": "markdown-file-preview",
40
+ children: [/* @__PURE__ */ u("div", {
41
+ "data-testid": "markdown-file-preview-content",
42
+ className: "max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]",
43
+ children: /* @__PURE__ */ u(a, {
44
+ content: r,
45
+ includeStandard: !0,
46
+ includeHeadings: !0,
47
+ components: c
48
+ })
49
+ }), /* @__PURE__ */ d("div", {
50
+ className: "flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3",
51
+ children: [/* @__PURE__ */ d("div", {
52
+ className: "flex min-w-0 items-center gap-1.5",
53
+ children: [/* @__PURE__ */ u(o, { className: "h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]" }), /* @__PURE__ */ u(s.Text, {
54
+ className: "truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]",
55
+ children: p
56
+ })]
57
+ }), l ? /* @__PURE__ */ d("button", {
58
+ type: "button",
59
+ onClick: l,
60
+ className: "flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80",
61
+ "data-testid": "markdown-file-preview-view",
62
+ children: [/* @__PURE__ */ u(s.Text, {
63
+ className: "text-[11px] leading-4 tracking-[0.11px] text-white",
64
+ children: f(t.COMMON$VIEW)
65
+ }), /* @__PURE__ */ u(n, {
66
+ className: "text-white",
67
+ size: 16
68
+ })]
69
+ }) : null]
70
+ })]
71
+ });
72
+ }
73
+ //#endregion
74
+ export { _ as MarkdownFilePreview, g as isMarkdownFileEditorEvent };
75
+
76
+ //# sourceMappingURL=markdown-file-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-file-preview.js","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/primitives/markdown-file-preview.tsx"],"sourcesContent":["/**\n * Inline markdown artifact preview for chat tool cards.\n *\n * Shows a height-limited scrollable rich preview so long reports stay compact\n * in the stream; the footer View action deep-links into the Files drawer for\n * the full document. Markdown *create* file-editor events stay expanded and\n * ungrouped so the preview is visible without an extra click.\n */\nimport { useTranslation } from \"react-i18next\";\nimport { ArrowUpRight } from \"lucide-react\";\nimport FileIcon from \"#/icons/file.svg?react\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { MarkdownRenderer } from \"#/components/features/markdown/markdown-renderer\";\nimport { planComponents } from \"#/components/features/markdown/plan-components\";\nimport { Typography } from \"#/ui/typography\";\nimport { isMarkdownFilePath } from \"#/utils/is-markdown-file-path\";\nimport type {\n ActionEvent,\n ObservationEvent,\n OpenHandsEvent,\n} from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n} from \"#/types/agent-server/type-guards\";\nimport type {\n FileEditorAction,\n StrReplaceEditorAction,\n} from \"#/types/agent-server/core/base/action\";\nimport type {\n FileEditorObservation,\n StrReplaceEditorObservation,\n} from \"#/types/agent-server/core/base/observation\";\n\nexport { isMarkdownFilePath } from \"#/utils/is-markdown-file-path\";\n\nconst FILE_EDITOR_ACTION_KINDS = new Set([\n \"FileEditorAction\",\n \"StrReplaceEditorAction\",\n]);\nconst FILE_EDITOR_OBSERVATION_KINDS = new Set([\n \"FileEditorObservation\",\n \"StrReplaceEditorObservation\",\n]);\n\ninterface MarkdownFilePreviewProps {\n content: string;\n path: string;\n /** When omitted (e.g. in-flight create), the View affordance is hidden. */\n onView?: () => void;\n}\n\n/**\n * Resolves the file path for a file-editor action/observation, including the\n * observation's originating action when the observation omits `path`.\n */\nfunction getFileEditorEventPath(\n event: OpenHandsEvent,\n correspondingAction?: ActionEvent,\n): string | null {\n if (isActionEvent(event) && FILE_EDITOR_ACTION_KINDS.has(event.action.kind)) {\n return (\n (event as ActionEvent<FileEditorAction | StrReplaceEditorAction>).action\n .path || null\n );\n }\n\n if (\n isObservationEvent(event) &&\n FILE_EDITOR_OBSERVATION_KINDS.has(event.observation.kind)\n ) {\n const path = (\n event as ObservationEvent<\n FileEditorObservation | StrReplaceEditorObservation\n >\n ).observation.path;\n if (path) return path;\n if (\n correspondingAction &&\n FILE_EDITOR_ACTION_KINDS.has(correspondingAction.action.kind)\n ) {\n return (\n (\n correspondingAction as ActionEvent<\n FileEditorAction | StrReplaceEditorAction\n >\n ).action.path || null\n );\n }\n }\n\n return null;\n}\n\n/**\n * Resolves the file-editor command (`create` / `view` / …), including the\n * observation's originating action when the observation omits `command`.\n */\nfunction getFileEditorEventCommand(\n event: OpenHandsEvent,\n correspondingAction?: ActionEvent,\n): string | null {\n if (isActionEvent(event) && FILE_EDITOR_ACTION_KINDS.has(event.action.kind)) {\n return (\n (event as ActionEvent<FileEditorAction | StrReplaceEditorAction>).action\n .command || null\n );\n }\n\n if (\n isObservationEvent(event) &&\n FILE_EDITOR_OBSERVATION_KINDS.has(event.observation.kind)\n ) {\n const command = (\n event as ObservationEvent<\n FileEditorObservation | StrReplaceEditorObservation\n >\n ).observation.command;\n if (command) return command;\n if (\n correspondingAction &&\n FILE_EDITOR_ACTION_KINDS.has(correspondingAction.action.kind)\n ) {\n return (\n (\n correspondingAction as ActionEvent<\n FileEditorAction | StrReplaceEditorAction\n >\n ).action.command || null\n );\n }\n }\n\n return null;\n}\n\n/**\n * True for file-editor *create* events whose path is a markdown artifact.\n *\n * Used to keep those cards expanded and outside collapsed action groups so\n * the clipped preview is visible by default. Reads/edits of `.md` files stay\n * on the normal groupable path.\n */\nexport function isMarkdownFileEditorEvent(\n event: OpenHandsEvent,\n correspondingAction?: ActionEvent,\n): boolean {\n const path = getFileEditorEventPath(event, correspondingAction);\n const command = getFileEditorEventCommand(event, correspondingAction);\n return Boolean(path && command === \"create\" && isMarkdownFilePath(path));\n}\n\n/**\n * Height-clipped markdown card with an optional View bar that opens the file.\n */\nexport function MarkdownFilePreview({\n content,\n path,\n onView,\n}: MarkdownFilePreviewProps) {\n const { t } = useTranslation(\"openhands\");\n const fileName = path.split(\"/\").pop() || path;\n\n return (\n <div\n className=\"w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]\"\n data-testid=\"markdown-file-preview\"\n >\n <div\n data-testid=\"markdown-file-preview-content\"\n className=\"max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]\"\n >\n {/* Deliberately compact: the clipped in-stream card reuses the plan\n preview's small typography; the Files drawer renders the same\n artifact full-size with the default components. */}\n <MarkdownRenderer\n content={content}\n includeStandard\n includeHeadings\n components={planComponents}\n />\n </div>\n <div className=\"flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3\">\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <FileIcon className=\"h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]\" />\n <Typography.Text className=\"truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]\">\n {fileName}\n </Typography.Text>\n </div>\n {onView ? (\n <button\n type=\"button\"\n onClick={onView}\n className=\"flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80\"\n data-testid=\"markdown-file-preview-view\"\n >\n <Typography.Text className=\"text-[11px] leading-4 tracking-[0.11px] text-white\">\n {t(I18nKey.COMMON$VIEW)}\n </Typography.Text>\n <ArrowUpRight className=\"text-white\" size={16} />\n </button>\n ) : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAoCA,IAAM,IAA2B,IAAI,IAAI,CACvC,oBACA,wBACF,CAAC,GACK,IAAgC,IAAI,IAAI,CAC5C,yBACA,6BACF,CAAC;AAaD,SAAS,EACP,GACA,GACe;CACf,IAAI,EAAc,CAAK,KAAK,EAAyB,IAAI,EAAM,OAAO,IAAI,GACxE,OACG,EAAiE,OAC/D,QAAQ;CAIf,IACE,EAAmB,CAAK,KACxB,EAA8B,IAAI,EAAM,YAAY,IAAI,GACxD;EACA,IAAM,IACJ,EAGA,YAAY;EACd,IAAI,GAAM,OAAO;EACjB,IACE,KACA,EAAyB,IAAI,EAAoB,OAAO,IAAI,GAE5D,OAEI,EAGA,OAAO,QAAQ;CAGvB;CAEA,OAAO;AACT;AAMA,SAAS,EACP,GACA,GACe;CACf,IAAI,EAAc,CAAK,KAAK,EAAyB,IAAI,EAAM,OAAO,IAAI,GACxE,OACG,EAAiE,OAC/D,WAAW;CAIlB,IACE,EAAmB,CAAK,KACxB,EAA8B,IAAI,EAAM,YAAY,IAAI,GACxD;EACA,IAAM,IACJ,EAGA,YAAY;EACd,IAAI,GAAS,OAAO;EACpB,IACE,KACA,EAAyB,IAAI,EAAoB,OAAO,IAAI,GAE5D,OAEI,EAGA,OAAO,WAAW;CAG1B;CAEA,OAAO;AACT;AASA,SAAgB,EACd,GACA,GACS;CACT,IAAM,IAAO,EAAuB,GAAO,CAAmB,GACxD,IAAU,EAA0B,GAAO,CAAmB;CACpE,OAAO,GAAQ,KAAQ,MAAY,YAAY,EAAmB,CAAI;AACxE;AAKA,SAAgB,EAAoB,EAClC,YACA,SACA,aAC2B;CAC3B,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,IAAW,EAAK,MAAM,GAAG,EAAE,IAAI,KAAK;CAE1C,OACE,kBAAC,OAAD;EACE,WAAU;EACV,eAAY;YAFd,CAIE,kBAAC,OAAD;GACE,eAAY;GACZ,WAAU;aAKV,kBAAC,GAAD;IACW;IACT,iBAAA;IACA,iBAAA;IACA,YAAY;GACb,CAAA;EACE,CAAA,GACL,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAU,WAAU,mDAAoD,CAAA,GACxE,kBAAC,EAAW,MAAZ;KAAiB,WAAU;eACxB;IACc,CAAA,CACd;OACJ,IACC,kBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,WAAU;IACV,eAAY;cAJd,CAME,kBAAC,EAAW,MAAZ;KAAiB,WAAU;eACxB,EAAE,EAAQ,WAAW;IACP,CAAA,GACjB,kBAAC,GAAD;KAAc,WAAU;KAAa,MAAM;IAAK,CAAA,CAC1C;QACN,IACD;IACF;;AAET"}
@@ -1,2 +1,2 @@
1
- require("../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),t=require("../../../i18n/declaration.cjs"),n=require("../../../utils/status.cjs"),r=require("../../../utils/utils.cjs"),i=require("../../../ui/context-menu.cjs"),a=require("../../../hooks/use-click-outside-element.cjs"),o=require("../../../ui/divider.cjs"),s=require("../../../icons/stop-circle.cjs"),c=require("../../../icons/play-circle.cjs"),l=require("./server-status-context-menu-icon-text.cjs"),u=require("./server-status.cjs");let d=require("react/jsx-runtime");function f({onClose:f,onStopServer:p,onStartServer:m,executionStatus:h,position:g=`top`,className:_=``,isPausing:v=!1}){let{t:y}=e.useTranslation(`openhands`),b=a.useClickOutsideElement(f),x=n.isExecutionActive(h),S=n.isExecutionPaused(h),C=x||S;return(0,d.jsxs)(i.ContextMenu,{ref:b,testId:`server-status-context-menu`,position:g,alignment:`left`,size:`default`,className:r.cn(`left-2 w-fit min-w-42`,_),children:[(0,d.jsx)(u.default,{executionStatus:h,isPausing:v,className:`pl-0 pr-2 py-1`}),C&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Divider,{inset:`menu`}),x&&p&&(0,d.jsx)(l.ServerStatusContextMenuIconText,{icon:(0,d.jsx)(s.default,{width:18,height:18}),text:y(t.I18nKey.COMMON$STOP_RUNTIME),onClick:p,testId:`stop-server-button`}),S&&m&&(0,d.jsx)(l.ServerStatusContextMenuIconText,{icon:(0,d.jsx)(c.default,{width:18,height:18}),text:y(t.I18nKey.COMMON$START_RUNTIME),onClick:m,testId:`start-server-button`})]})]})}exports.ServerStatusContextMenu=f;
1
+ require("../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),t=require("../../../i18n/declaration.cjs"),n=require("../../../utils/status.cjs"),r=require("../../../utils/utils.cjs"),i=require("../../../ui/context-menu.cjs"),a=require("../../../hooks/use-click-outside-element.cjs"),o=require("../../../ui/divider.cjs"),s=require("../../../icons/stop-circle.cjs"),c=require("../../../icons/play-circle.cjs"),l=require("./server-status-context-menu-icon-text.cjs"),u=require("./server-status.cjs");let d=require("react/jsx-runtime");function f({onClose:f,onStopServer:p,onStartServer:m,executionStatus:h,position:g=`top`,className:_=``,isPausing:v=!1,ignoreOutsideClickRef:y}){let{t:b}=e.useTranslation(`openhands`),x=a.useClickOutsideElement(f,y),S=n.isExecutionActive(h),C=n.isExecutionPaused(h),w=S||C;return(0,d.jsxs)(i.ContextMenu,{ref:x,testId:`server-status-context-menu`,position:g,alignment:`left`,size:`default`,className:r.cn(`left-2 w-fit min-w-42`,_),children:[(0,d.jsx)(u.default,{executionStatus:h,isPausing:v,className:`pl-0 pr-2 py-1`}),w&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.Divider,{inset:`menu`}),S&&p&&(0,d.jsx)(l.ServerStatusContextMenuIconText,{icon:(0,d.jsx)(s.default,{width:18,height:18}),text:b(t.I18nKey.COMMON$STOP_RUNTIME),onClick:p,testId:`stop-server-button`}),C&&m&&(0,d.jsx)(l.ServerStatusContextMenuIconText,{icon:(0,d.jsx)(c.default,{width:18,height:18}),text:b(t.I18nKey.COMMON$START_RUNTIME),onClick:m,testId:`start-server-button`})]})]})}exports.ServerStatusContextMenu=f;
2
2
  //# sourceMappingURL=server-status-context-menu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-status-context-menu.cjs","names":[],"sources":["../../../../src/components/features/controls/server-status-context-menu.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport StopCircleIcon from \"#/icons/stop-circle.svg?react\";\nimport PlayCircleIcon from \"#/icons/play-circle.svg?react\";\nimport { ServerStatusContextMenuIconText } from \"./server-status-context-menu-icon-text\";\nimport { ServerStatus } from \"./server-status\";\nimport { Divider } from \"#/ui/divider\";\nimport { cn } from \"#/utils/utils\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { isExecutionActive, isExecutionPaused } from \"#/utils/status\";\n\ninterface ServerStatusContextMenuProps {\n onClose: () => void;\n onStopServer?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onStartServer?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n executionStatus: ExecutionStatus | null;\n position?: \"top\" | \"bottom\";\n className?: string;\n isPausing?: boolean;\n}\n\nexport function ServerStatusContextMenu({\n onClose,\n onStopServer,\n onStartServer,\n executionStatus,\n position = \"top\",\n className = \"\",\n isPausing = false,\n}: ServerStatusContextMenuProps) {\n const { t } = useTranslation(\"openhands\");\n const ref = useClickOutsideElement<HTMLUListElement>(onClose);\n\n const isActive = isExecutionActive(executionStatus);\n const isPaused = isExecutionPaused(executionStatus);\n const shouldActionShown = isActive || isPaused;\n\n return (\n <ContextMenu\n ref={ref}\n testId=\"server-status-context-menu\"\n position={position}\n alignment=\"left\"\n size=\"default\"\n className={cn(\"left-2 w-fit min-w-42\", className)}\n >\n <ServerStatus\n executionStatus={executionStatus}\n isPausing={isPausing}\n className=\"pl-0 pr-2 py-1\"\n />\n\n {shouldActionShown && (\n <>\n <Divider inset=\"menu\" />\n\n {isActive && onStopServer && (\n <ServerStatusContextMenuIconText\n icon={<StopCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$STOP_RUNTIME)}\n onClick={onStopServer}\n testId=\"stop-server-button\"\n />\n )}\n\n {isPaused && onStartServer && (\n <ServerStatusContextMenuIconText\n icon={<PlayCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$START_RUNTIME)}\n onClick={onStartServer}\n testId=\"start-server-button\"\n />\n )}\n </>\n )}\n </ContextMenu>\n );\n}\n"],"mappings":"0lBAuBA,SAAgB,EAAwB,CACtC,UACA,eACA,gBACA,kBACA,WAAW,MACX,YAAY,GACZ,YAAY,IACmB,CAC/B,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,EAAM,EAAA,uBAAyC,CAAO,EAEtD,EAAW,EAAA,kBAAkB,CAAe,EAC5C,EAAW,EAAA,kBAAkB,CAAe,EAC5C,EAAoB,GAAY,EAEtC,OACE,EAAA,EAAA,MAAC,EAAA,YAAD,CACO,MACL,OAAO,6BACG,WACV,UAAU,OACV,KAAK,UACL,UAAW,EAAA,GAAG,wBAAyB,CAAS,WANlD,EAQE,EAAA,EAAA,KAAC,EAAA,QAAD,CACmB,kBACN,YACX,UAAU,gBACX,CAAA,EAEA,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAM,MAAQ,CAAA,EAEtB,GAAY,IACX,EAAA,EAAA,KAAC,EAAA,gCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAgB,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC9C,KAAM,EAAE,EAAA,QAAQ,mBAAmB,EACnC,QAAS,EACT,OAAO,oBACR,CAAA,EAGF,GAAY,IACX,EAAA,EAAA,KAAC,EAAA,gCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAgB,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC9C,KAAM,EAAE,EAAA,QAAQ,oBAAoB,EACpC,QAAS,EACT,OAAO,qBACR,CAAA,CAEH,CAAA,CAAA,CAEO,GAEjB"}
1
+ {"version":3,"file":"server-status-context-menu.cjs","names":[],"sources":["../../../../src/components/features/controls/server-status-context-menu.tsx"],"sourcesContent":["import type { MouseEvent, RefObject } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport StopCircleIcon from \"#/icons/stop-circle.svg?react\";\nimport PlayCircleIcon from \"#/icons/play-circle.svg?react\";\nimport { ServerStatusContextMenuIconText } from \"./server-status-context-menu-icon-text\";\nimport { ServerStatus } from \"./server-status\";\nimport { Divider } from \"#/ui/divider\";\nimport { cn } from \"#/utils/utils\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { isExecutionActive, isExecutionPaused } from \"#/utils/status\";\n\ninterface ServerStatusContextMenuProps {\n onClose: () => void;\n onStopServer?: (event: MouseEvent<HTMLButtonElement>) => void;\n onStartServer?: (event: MouseEvent<HTMLButtonElement>) => void;\n executionStatus: ExecutionStatus | null;\n position?: \"top\" | \"bottom\";\n className?: string;\n isPausing?: boolean;\n ignoreOutsideClickRef?: RefObject<HTMLElement | null>;\n}\n\nexport function ServerStatusContextMenu({\n onClose,\n onStopServer,\n onStartServer,\n executionStatus,\n position = \"top\",\n className = \"\",\n isPausing = false,\n ignoreOutsideClickRef,\n}: ServerStatusContextMenuProps) {\n const { t } = useTranslation(\"openhands\");\n const ref = useClickOutsideElement<HTMLUListElement>(\n onClose,\n ignoreOutsideClickRef,\n );\n\n const isActive = isExecutionActive(executionStatus);\n const isPaused = isExecutionPaused(executionStatus);\n const shouldActionShown = isActive || isPaused;\n\n return (\n <ContextMenu\n ref={ref}\n testId=\"server-status-context-menu\"\n position={position}\n alignment=\"left\"\n size=\"default\"\n className={cn(\"left-2 w-fit min-w-42\", className)}\n >\n <ServerStatus\n executionStatus={executionStatus}\n isPausing={isPausing}\n className=\"pl-0 pr-2 py-1\"\n />\n\n {shouldActionShown && (\n <>\n <Divider inset=\"menu\" />\n\n {isActive && onStopServer && (\n <ServerStatusContextMenuIconText\n icon={<StopCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$STOP_RUNTIME)}\n onClick={onStopServer}\n testId=\"stop-server-button\"\n />\n )}\n\n {isPaused && onStartServer && (\n <ServerStatusContextMenuIconText\n icon={<PlayCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$START_RUNTIME)}\n onClick={onStartServer}\n testId=\"start-server-button\"\n />\n )}\n </>\n )}\n </ContextMenu>\n );\n}\n"],"mappings":"0lBAyBA,SAAgB,EAAwB,CACtC,UACA,eACA,gBACA,kBACA,WAAW,MACX,YAAY,GACZ,YAAY,GACZ,yBAC+B,CAC/B,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,EAAM,EAAA,uBACV,EACA,CACF,EAEM,EAAW,EAAA,kBAAkB,CAAe,EAC5C,EAAW,EAAA,kBAAkB,CAAe,EAC5C,EAAoB,GAAY,EAEtC,OACE,EAAA,EAAA,MAAC,EAAA,YAAD,CACO,MACL,OAAO,6BACG,WACV,UAAU,OACV,KAAK,UACL,UAAW,EAAA,GAAG,wBAAyB,CAAS,WANlD,EAQE,EAAA,EAAA,KAAC,EAAA,QAAD,CACmB,kBACN,YACX,UAAU,gBACX,CAAA,EAEA,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAM,MAAQ,CAAA,EAEtB,GAAY,IACX,EAAA,EAAA,KAAC,EAAA,gCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAgB,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC9C,KAAM,EAAE,EAAA,QAAQ,mBAAmB,EACnC,QAAS,EACT,OAAO,oBACR,CAAA,EAGF,GAAY,IACX,EAAA,EAAA,KAAC,EAAA,gCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAgB,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC9C,KAAM,EAAE,EAAA,QAAQ,oBAAoB,EACpC,QAAS,EACT,OAAO,qBACR,CAAA,CAEH,CAAA,CAAA,CAEO,GAEjB"}
@@ -1,12 +1,14 @@
1
+ import type { MouseEvent, RefObject } from "react";
1
2
  import { ExecutionStatus } from "#/types/agent-server/core/base/common";
2
3
  interface ServerStatusContextMenuProps {
3
4
  onClose: () => void;
4
- onStopServer?: (event: React.MouseEvent<HTMLButtonElement>) => void;
5
- onStartServer?: (event: React.MouseEvent<HTMLButtonElement>) => void;
5
+ onStopServer?: (event: MouseEvent<HTMLButtonElement>) => void;
6
+ onStartServer?: (event: MouseEvent<HTMLButtonElement>) => void;
6
7
  executionStatus: ExecutionStatus | null;
7
8
  position?: "top" | "bottom";
8
9
  className?: string;
9
10
  isPausing?: boolean;
11
+ ignoreOutsideClickRef?: RefObject<HTMLElement | null>;
10
12
  }
11
- export declare function ServerStatusContextMenu({ onClose, onStopServer, onStartServer, executionStatus, position, className, isPausing, }: ServerStatusContextMenuProps): import("react").JSX.Element;
13
+ export declare function ServerStatusContextMenu({ onClose, onStopServer, onStartServer, executionStatus, position, className, isPausing, ignoreOutsideClickRef, }: ServerStatusContextMenuProps): import("react").JSX.Element;
12
14
  export {};
@@ -11,10 +11,10 @@ import { ServerStatusContextMenuIconText as u } from "./server-status-context-me
11
11
  import d from "./server-status.js";
12
12
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
13
13
  //#region src/components/features/controls/server-status-context-menu.tsx
14
- function h({ onClose: h, onStopServer: g, onStartServer: _, executionStatus: v, position: y = "top", className: b = "", isPausing: x = !1 }) {
15
- let { t: S } = e("openhands"), C = o(h), w = n(v), T = r(v), E = w || T;
14
+ function h({ onClose: h, onStopServer: g, onStartServer: _, executionStatus: v, position: y = "top", className: b = "", isPausing: x = !1, ignoreOutsideClickRef: S }) {
15
+ let { t: C } = e("openhands"), w = o(h, S), T = n(v), E = r(v), D = T || E;
16
16
  return /* @__PURE__ */ m(a, {
17
- ref: C,
17
+ ref: w,
18
18
  testId: "server-status-context-menu",
19
19
  position: y,
20
20
  alignment: "left",
@@ -24,23 +24,23 @@ function h({ onClose: h, onStopServer: g, onStartServer: _, executionStatus: v,
24
24
  executionStatus: v,
25
25
  isPausing: x,
26
26
  className: "pl-0 pr-2 py-1"
27
- }), E && /* @__PURE__ */ m(f, { children: [
27
+ }), D && /* @__PURE__ */ m(f, { children: [
28
28
  /* @__PURE__ */ p(s, { inset: "menu" }),
29
- w && g && /* @__PURE__ */ p(u, {
29
+ T && g && /* @__PURE__ */ p(u, {
30
30
  icon: /* @__PURE__ */ p(c, {
31
31
  width: 18,
32
32
  height: 18
33
33
  }),
34
- text: S(t.COMMON$STOP_RUNTIME),
34
+ text: C(t.COMMON$STOP_RUNTIME),
35
35
  onClick: g,
36
36
  testId: "stop-server-button"
37
37
  }),
38
- T && _ && /* @__PURE__ */ p(u, {
38
+ E && _ && /* @__PURE__ */ p(u, {
39
39
  icon: /* @__PURE__ */ p(l, {
40
40
  width: 18,
41
41
  height: 18
42
42
  }),
43
- text: S(t.COMMON$START_RUNTIME),
43
+ text: C(t.COMMON$START_RUNTIME),
44
44
  onClick: _,
45
45
  testId: "start-server-button"
46
46
  })
@@ -1 +1 @@
1
- {"version":3,"file":"server-status-context-menu.js","names":[],"sources":["../../../../src/components/features/controls/server-status-context-menu.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport StopCircleIcon from \"#/icons/stop-circle.svg?react\";\nimport PlayCircleIcon from \"#/icons/play-circle.svg?react\";\nimport { ServerStatusContextMenuIconText } from \"./server-status-context-menu-icon-text\";\nimport { ServerStatus } from \"./server-status\";\nimport { Divider } from \"#/ui/divider\";\nimport { cn } from \"#/utils/utils\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { isExecutionActive, isExecutionPaused } from \"#/utils/status\";\n\ninterface ServerStatusContextMenuProps {\n onClose: () => void;\n onStopServer?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onStartServer?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n executionStatus: ExecutionStatus | null;\n position?: \"top\" | \"bottom\";\n className?: string;\n isPausing?: boolean;\n}\n\nexport function ServerStatusContextMenu({\n onClose,\n onStopServer,\n onStartServer,\n executionStatus,\n position = \"top\",\n className = \"\",\n isPausing = false,\n}: ServerStatusContextMenuProps) {\n const { t } = useTranslation(\"openhands\");\n const ref = useClickOutsideElement<HTMLUListElement>(onClose);\n\n const isActive = isExecutionActive(executionStatus);\n const isPaused = isExecutionPaused(executionStatus);\n const shouldActionShown = isActive || isPaused;\n\n return (\n <ContextMenu\n ref={ref}\n testId=\"server-status-context-menu\"\n position={position}\n alignment=\"left\"\n size=\"default\"\n className={cn(\"left-2 w-fit min-w-42\", className)}\n >\n <ServerStatus\n executionStatus={executionStatus}\n isPausing={isPausing}\n className=\"pl-0 pr-2 py-1\"\n />\n\n {shouldActionShown && (\n <>\n <Divider inset=\"menu\" />\n\n {isActive && onStopServer && (\n <ServerStatusContextMenuIconText\n icon={<StopCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$STOP_RUNTIME)}\n onClick={onStopServer}\n testId=\"stop-server-button\"\n />\n )}\n\n {isPaused && onStartServer && (\n <ServerStatusContextMenuIconText\n icon={<PlayCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$START_RUNTIME)}\n onClick={onStartServer}\n testId=\"start-server-button\"\n />\n )}\n </>\n )}\n </ContextMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAuBA,SAAgB,EAAwB,EACtC,YACA,iBACA,kBACA,oBACA,cAAW,OACX,eAAY,IACZ,eAAY,MACmB;CAC/B,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,IAAM,EAAyC,CAAO,GAEtD,IAAW,EAAkB,CAAe,GAC5C,IAAW,EAAkB,CAAe,GAC5C,IAAoB,KAAY;CAEtC,OACE,kBAAC,GAAD;EACO;EACL,QAAO;EACG;EACV,WAAU;EACV,MAAK;EACL,WAAW,EAAG,yBAAyB,CAAS;YANlD,CAQE,kBAAC,GAAD;GACmB;GACN;GACX,WAAU;EACX,CAAA,GAEA,KACC,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD,EAAS,OAAM,OAAQ,CAAA;GAEtB,KAAY,KACX,kBAAC,GAAD;IACE,MAAM,kBAAC,GAAD;KAAgB,OAAO;KAAI,QAAQ;IAAK,CAAA;IAC9C,MAAM,EAAE,EAAQ,mBAAmB;IACnC,SAAS;IACT,QAAO;GACR,CAAA;GAGF,KAAY,KACX,kBAAC,GAAD;IACE,MAAM,kBAAC,GAAD;KAAgB,OAAO;KAAI,QAAQ;IAAK,CAAA;IAC9C,MAAM,EAAE,EAAQ,oBAAoB;IACpC,SAAS;IACT,QAAO;GACR,CAAA;EAEH,EAAA,CAAA,CAEO;;AAEjB"}
1
+ {"version":3,"file":"server-status-context-menu.js","names":[],"sources":["../../../../src/components/features/controls/server-status-context-menu.tsx"],"sourcesContent":["import type { MouseEvent, RefObject } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport StopCircleIcon from \"#/icons/stop-circle.svg?react\";\nimport PlayCircleIcon from \"#/icons/play-circle.svg?react\";\nimport { ServerStatusContextMenuIconText } from \"./server-status-context-menu-icon-text\";\nimport { ServerStatus } from \"./server-status\";\nimport { Divider } from \"#/ui/divider\";\nimport { cn } from \"#/utils/utils\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { isExecutionActive, isExecutionPaused } from \"#/utils/status\";\n\ninterface ServerStatusContextMenuProps {\n onClose: () => void;\n onStopServer?: (event: MouseEvent<HTMLButtonElement>) => void;\n onStartServer?: (event: MouseEvent<HTMLButtonElement>) => void;\n executionStatus: ExecutionStatus | null;\n position?: \"top\" | \"bottom\";\n className?: string;\n isPausing?: boolean;\n ignoreOutsideClickRef?: RefObject<HTMLElement | null>;\n}\n\nexport function ServerStatusContextMenu({\n onClose,\n onStopServer,\n onStartServer,\n executionStatus,\n position = \"top\",\n className = \"\",\n isPausing = false,\n ignoreOutsideClickRef,\n}: ServerStatusContextMenuProps) {\n const { t } = useTranslation(\"openhands\");\n const ref = useClickOutsideElement<HTMLUListElement>(\n onClose,\n ignoreOutsideClickRef,\n );\n\n const isActive = isExecutionActive(executionStatus);\n const isPaused = isExecutionPaused(executionStatus);\n const shouldActionShown = isActive || isPaused;\n\n return (\n <ContextMenu\n ref={ref}\n testId=\"server-status-context-menu\"\n position={position}\n alignment=\"left\"\n size=\"default\"\n className={cn(\"left-2 w-fit min-w-42\", className)}\n >\n <ServerStatus\n executionStatus={executionStatus}\n isPausing={isPausing}\n className=\"pl-0 pr-2 py-1\"\n />\n\n {shouldActionShown && (\n <>\n <Divider inset=\"menu\" />\n\n {isActive && onStopServer && (\n <ServerStatusContextMenuIconText\n icon={<StopCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$STOP_RUNTIME)}\n onClick={onStopServer}\n testId=\"stop-server-button\"\n />\n )}\n\n {isPaused && onStartServer && (\n <ServerStatusContextMenuIconText\n icon={<PlayCircleIcon width={18} height={18} />}\n text={t(I18nKey.COMMON$START_RUNTIME)}\n onClick={onStartServer}\n testId=\"start-server-button\"\n />\n )}\n </>\n )}\n </ContextMenu>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAyBA,SAAgB,EAAwB,EACtC,YACA,iBACA,kBACA,oBACA,cAAW,OACX,eAAY,IACZ,eAAY,IACZ,4BAC+B;CAC/B,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,IAAM,EACV,GACA,CACF,GAEM,IAAW,EAAkB,CAAe,GAC5C,IAAW,EAAkB,CAAe,GAC5C,IAAoB,KAAY;CAEtC,OACE,kBAAC,GAAD;EACO;EACL,QAAO;EACG;EACV,WAAU;EACV,MAAK;EACL,WAAW,EAAG,yBAAyB,CAAS;YANlD,CAQE,kBAAC,GAAD;GACmB;GACN;GACX,WAAU;EACX,CAAA,GAEA,KACC,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD,EAAS,OAAM,OAAQ,CAAA;GAEtB,KAAY,KACX,kBAAC,GAAD;IACE,MAAM,kBAAC,GAAD;KAAgB,OAAO;KAAI,QAAQ;IAAK,CAAA;IAC9C,MAAM,EAAE,EAAQ,mBAAmB;IACnC,SAAS;IACT,QAAO;GACR,CAAA;GAGF,KAAY,KACX,kBAAC,GAAD;IACE,MAAM,kBAAC,GAAD;KAAgB,OAAO;KAAI,QAAQ;IAAK,CAAA;IAC9C,MAAM,EAAE,EAAQ,oBAAoB;IACpC,SAAS;IACT,QAAO;GACR,CAAA;EAEH,EAAA,CAAA,CAEO;;AAEjB"}
@@ -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"),ee=require("../../../node_modules/lucide-react/dist/esm/icons/external-link.cjs"),r=require("../../../node_modules/lucide-react/dist/esm/icons/share-2.cjs"),i=require("../../../utils/utils.cjs"),a=require("../../../contexts/active-backend-context.cjs"),o=require("../../../hooks/query/use-active-conversation.cjs"),s=require("../../../icons/copy.cjs"),c=require("../../../icons/u-close.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("../../../ui/divider.cjs"),p=require("../../../icons/skills.cjs"),m=require("../../../icons/fishing-hook.cjs"),h=require("../../../icons/u-tools.cjs"),g=require("../context-menu/archived-disabled-tooltip.cjs"),_=require("../../../hooks/use-is-archived-conversation.cjs"),v=require("../../../hooks/use-breakpoint.cjs"),te=require("../../../icons/u-edit.cjs"),y=require("../../../icons/u-download.cjs"),ne=require("../../../icons/u-credit-card.cjs"),b=require("../../../icons/u-delete.cjs"),x=require("./conversation-name-context-menu-icon-text.cjs");let S=require("react");S=e.__toESM(S,1);let C=require("react/jsx-runtime"),w=require("react-dom");w=e.__toESM(w,1);function T({isPublic:e,onToggle:t,ariaLabel:n}){return(0,C.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,C.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,C.jsx)(`span`,{"aria-hidden":!0,className:i.cn(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,C.jsx)(`span`,{className:i.cn(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function E({onClose:e,onRename:E,onDelete:D,onStop:O,onDisplayCost:k,onShowAgentTools:A,onShowSkills:j,onShowHooks:M,onTogglePublic:N,onCopyShareLink:P,onExportTranscript:F,onDownloadConversation:I,shareUrl:L,position:R=`bottom`,anchorRef:z}){let B=v.useBreakpoint(),{t:V}=t.useTranslation(`openhands`),{backend:H}=a.useActiveBackend(),{data:U}=o.useActiveConversation(),W=_.useIsArchivedConversation(),G=d.useClickOutsideElement(e),K=z?.current??null,[q,J]=S.default.useState();S.default.useLayoutEffect(()=>{if(!K)return;let e=()=>{let e=K.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};R===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,J(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[K,R]);let Y=!!(A||j||M),X=!!k,re=!!(O||D),ie=H.kind===`cloud`?n.I18nKey.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:n.I18nKey.COMMON$STOP_CONVERSATION,ae=H.kind===`cloud`&&!!N,Z=U?.public||!1,Q=!!K,$=(0,C.jsxs)(l.ContextMenu,{ref:G,testId:`conversation-name-context-menu`,position:R,alignment:`left`,className:i.cn(B?`right-0 translate-x-[34%] left-auto`:``,Q?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[E&&(0,C.jsx)(u.ContextMenuListItem,{testId:`rename-button`,onClick:E,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(te.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$RENAME)})}),Y&&(0,C.jsx)(f.Divider,{testId:`separator-tools`,inset:`menu`}),j&&(0,C.jsx)(g.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(u.ContextMenuListItem,{testId:`show-skills-button`,onClick:j,isDisabled:W,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(p.default,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:V(n.I18nKey.CONVERSATION$SHOW_SKILLS)})})}),M&&(0,C.jsx)(g.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(u.ContextMenuListItem,{testId:`show-hooks-button`,onClick:M,isDisabled:W,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(m.default,{width:16,height:16,"aria-hidden":!0}),text:V(n.I18nKey.CONVERSATION$SHOW_HOOKS)})})}),A&&(0,C.jsx)(g.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(u.ContextMenuListItem,{testId:`show-agent-tools-button`,onClick:A,isDisabled:W,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(h.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),F&&(0,C.jsx)(u.ContextMenuListItem,{testId:`export-transcript-button`,onClick:F,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(y.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$EXPORT_TRANSCRIPT)})}),I&&(0,C.jsx)(u.ContextMenuListItem,{testId:`download-trajectory-button`,onClick:I,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(y.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(X||re)&&(0,C.jsx)(f.Divider,{testId:`separator-info-control`,inset:`menu`}),k&&(0,C.jsx)(u.ContextMenuListItem,{testId:`display-cost-button`,onClick:k,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(ne.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$DISPLAY_COST)})}),ae&&N&&(0,C.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,C.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,C.jsx)(r.Share2,{size:16})}),(0,C.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:V(n.I18nKey.CONVERSATION$SHARE_PUBLICLY)}),(0,C.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[Z&&L&&P&&(0,C.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,C.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:P,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:V(n.I18nKey.BUTTON$COPY_TO_CLIPBOARD),children:(0,C.jsx)(s.default,{width:14,height:14})}),(0,C.jsx)(`a`,{"data-testid":`open-share-link-button`,href:L,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:V(n.I18nKey.BUTTON$OPEN_IN_NEW_TAB),children:(0,C.jsx)(ee.ExternalLink,{size:14,"aria-hidden":!0})})]}),(0,C.jsx)(T,{isPublic:Z,onToggle:N,ariaLabel:V(n.I18nKey.CONVERSATION$SHARE_PUBLICLY)})]})]}),O&&(0,C.jsx)(g.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(u.ContextMenuListItem,{testId:`stop-button`,onClick:O,isDisabled:W,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(c.default,{width:16,height:16}),text:V(ie)})})}),D&&(0,C.jsx)(u.ContextMenuListItem,{testId:`delete-button`,onClick:D,children:(0,C.jsx)(x.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(b.default,{width:16,height:16}),text:V(n.I18nKey.COMMON$DELETE_CONVERSATION)})})]});return Q?typeof document>`u`||!q?null:w.default.createPortal((0,C.jsx)(`div`,{style:q,children:$}),document.body):$}exports.ConversationNameContextMenu=E;
1
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),n=require("../../../i18n/declaration.cjs"),r=require("../../../node_modules/lucide-react/dist/esm/icons/external-link.cjs"),ee=require("../../../node_modules/lucide-react/dist/esm/icons/gauge.cjs"),i=require("../../../node_modules/lucide-react/dist/esm/icons/share-2.cjs"),a=require("../../../utils/utils.cjs"),o=require("../../../contexts/active-backend-context.cjs"),s=require("../../../hooks/query/use-active-conversation.cjs"),c=require("../../../icons/copy.cjs"),l=require("../../../icons/u-close.cjs"),u=require("../../../ui/context-menu.cjs"),d=require("../context-menu/context-menu-list-item.cjs"),f=require("../../../hooks/use-click-outside-element.cjs"),p=require("../../../ui/divider.cjs"),m=require("../../../icons/skills.cjs"),h=require("../../../icons/fishing-hook.cjs"),g=require("../../../icons/u-tools.cjs"),_=require("../context-menu/archived-disabled-tooltip.cjs"),v=require("../../../hooks/use-is-archived-conversation.cjs"),y=require("./conversation-name-context-menu-icon-text.cjs"),te=require("../../../hooks/use-breakpoint.cjs"),ne=require("../../../icons/u-edit.cjs"),b=require("../../../icons/u-download.cjs"),x=require("../../../icons/u-delete.cjs");let S=require("react");S=e.__toESM(S,1);let C=require("react/jsx-runtime"),w=require("react-dom");w=e.__toESM(w,1);function T({isPublic:e,onToggle:t,ariaLabel:n}){return(0,C.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,C.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,C.jsx)(`span`,{"aria-hidden":!0,className:a.cn(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,C.jsx)(`span`,{className:a.cn(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function E({onClose:e,onRename:E,onDelete:D,onStop:O,onDisplayCost:k,onShowAgentTools:A,onShowSkills:j,onShowHooks:M,onTogglePublic:N,onCopyShareLink:P,onExportTranscript:F,onDownloadConversation:I,shareUrl:L,position:R=`bottom`,anchorRef:z}){let B=te.useBreakpoint(),{t:V}=t.useTranslation(`openhands`),{backend:H}=o.useActiveBackend(),{data:U}=s.useActiveConversation(),W=v.useIsArchivedConversation(),G=f.useClickOutsideElement(e,z),K=z?.current??null,[q,J]=S.default.useState();S.default.useLayoutEffect(()=>{if(!K)return;let e=()=>{let e=K.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};R===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,J(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[K,R]);let Y=!!(A||j||M),X=!!k,re=!!(O||D),ie=H.kind===`cloud`?n.I18nKey.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:n.I18nKey.COMMON$STOP_CONVERSATION,ae=H.kind===`cloud`&&!!N,Z=U?.public||!1,Q=!!K,$=(0,C.jsxs)(u.ContextMenu,{ref:G,testId:`conversation-name-context-menu`,position:R,alignment:`left`,className:a.cn(B?`right-0 translate-x-[34%] left-auto`:``,Q?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[E&&(0,C.jsx)(d.ContextMenuListItem,{testId:`rename-button`,onClick:E,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(ne.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$RENAME)})}),Y&&(0,C.jsx)(p.Divider,{testId:`separator-tools`,inset:`menu`}),j&&(0,C.jsx)(_.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(d.ContextMenuListItem,{testId:`show-skills-button`,onClick:j,isDisabled:W,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(m.default,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:V(n.I18nKey.CONVERSATION$SHOW_SKILLS)})})}),M&&(0,C.jsx)(_.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(d.ContextMenuListItem,{testId:`show-hooks-button`,onClick:M,isDisabled:W,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(h.default,{width:16,height:16,"aria-hidden":!0}),text:V(n.I18nKey.CONVERSATION$SHOW_HOOKS)})})}),A&&(0,C.jsx)(_.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(d.ContextMenuListItem,{testId:`show-agent-tools-button`,onClick:A,isDisabled:W,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(g.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),F&&(0,C.jsx)(d.ContextMenuListItem,{testId:`export-transcript-button`,onClick:F,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(b.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$EXPORT_TRANSCRIPT)})}),I&&(0,C.jsx)(d.ContextMenuListItem,{testId:`download-trajectory-button`,onClick:I,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(b.default,{width:16,height:16}),text:V(n.I18nKey.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(X||re)&&(0,C.jsx)(p.Divider,{testId:`separator-info-control`,inset:`menu`}),k&&(0,C.jsx)(d.ContextMenuListItem,{testId:`display-cost-button`,onClick:k,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(ee.Gauge,{size:16}),text:V(n.I18nKey.BUTTON$DISPLAY_COST)})}),ae&&N&&(0,C.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,C.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,C.jsx)(i.Share2,{size:16})}),(0,C.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:V(n.I18nKey.CONVERSATION$SHARE_PUBLICLY)}),(0,C.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[Z&&L&&P&&(0,C.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,C.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:P,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:V(n.I18nKey.BUTTON$COPY_TO_CLIPBOARD),children:(0,C.jsx)(c.default,{width:14,height:14})}),(0,C.jsx)(`a`,{"data-testid":`open-share-link-button`,href:L,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:V(n.I18nKey.BUTTON$OPEN_IN_NEW_TAB),children:(0,C.jsx)(r.ExternalLink,{size:14,"aria-hidden":!0})})]}),(0,C.jsx)(T,{isPublic:Z,onToggle:N,ariaLabel:V(n.I18nKey.CONVERSATION$SHARE_PUBLICLY)})]})]}),O&&(0,C.jsx)(_.ArchivedDisabledTooltip,{isDisabled:W,children:(0,C.jsx)(d.ContextMenuListItem,{testId:`stop-button`,onClick:O,isDisabled:W,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(l.default,{width:16,height:16}),text:V(ie)})})}),D&&(0,C.jsx)(d.ContextMenuListItem,{testId:`delete-button`,onClick:D,children:(0,C.jsx)(y.ConversationNameContextMenuIconText,{icon:(0,C.jsx)(x.default,{width:16,height:16}),text:V(n.I18nKey.COMMON$DELETE_CONVERSATION)})})]});return Q?typeof document>`u`||!q?null:w.default.createPortal((0,C.jsx)(`div`,{style:q,children:$}),document.body):$}exports.ConversationNameContextMenu=E;
2
2
  //# sourceMappingURL=conversation-name-context-menu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-name-context-menu.cjs","names":[],"sources":["../../../../src/components/features/conversation/conversation-name-context-menu.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { ExternalLink, Share2 } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { useBreakpoint } from \"#/hooks/use-breakpoint\";\nimport { cn } from \"#/utils/utils\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { ContextMenuListItem } from \"../context-menu/context-menu-list-item\";\nimport { Divider } from \"#/ui/divider\";\nimport { I18nKey } from \"#/i18n/declaration\";\n\nimport EditIcon from \"#/icons/u-edit.svg?react\";\nimport SkillsIcon from \"#/icons/skills.svg?react\";\nimport FishingHookIcon from \"#/icons/fishing-hook.svg?react\";\nimport ToolsIcon from \"#/icons/u-tools.svg?react\";\nimport DownloadIcon from \"#/icons/u-download.svg?react\";\nimport CreditCardIcon from \"#/icons/u-credit-card.svg?react\";\nimport CloseIcon from \"#/icons/u-close.svg?react\";\nimport DeleteIcon from \"#/icons/u-delete.svg?react\";\nimport CopyIcon from \"#/icons/copy.svg?react\";\nimport { ConversationNameContextMenuIconText } from \"./conversation-name-context-menu-icon-text\";\nimport { ArchivedDisabledTooltip } from \"../context-menu/archived-disabled-tooltip\";\nimport { useIsArchivedConversation } from \"#/hooks/use-is-archived-conversation\";\n\ninterface ConversationNameContextMenuProps {\n onClose: () => void;\n onRename?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onDelete?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onStop?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onDisplayCost?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onShowAgentTools?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onShowSkills?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onShowHooks?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onTogglePublic?: (nextIsPublic: boolean) => void;\n onCopyShareLink?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onExportTranscript?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onDownloadConversation?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n shareUrl?: string;\n position?: \"top\" | \"bottom\";\n /**\n * Element the menu should anchor against. When provided, the menu renders\n * into a portal at the document body using fixed positioning so it cannot be\n * clipped by ancestors with `overflow: hidden` (e.g. the chat panel that\n * sits next to the right-side tabs panel).\n */\n anchorRef?: React.RefObject<HTMLElement | null>;\n}\n\nfunction PublicShareToggle({\n isPublic,\n onToggle,\n ariaLabel,\n}: {\n isPublic: boolean;\n onToggle: (nextIsPublic: boolean) => void;\n ariaLabel: string;\n}) {\n return (\n <label className=\"relative inline-flex shrink-0 cursor-pointer items-center\">\n <input\n hidden\n type=\"checkbox\"\n data-testid=\"share-publicly-button\"\n checked={isPublic}\n aria-label={ariaLabel}\n onChange={(event) => onToggle(event.target.checked)}\n />\n <span\n aria-hidden\n className={cn(\n \"inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out\",\n isPublic ? \"bg-white\" : \"bg-base-secondary\",\n )}\n >\n <span\n className={cn(\n \"block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out\",\n isPublic\n ? \"translate-x-[calc(1rem-1px)] bg-base-secondary\"\n : \"translate-x-px bg-tertiary-light\",\n )}\n />\n </span>\n </label>\n );\n}\n\nexport function ConversationNameContextMenu({\n onClose,\n onRename,\n onDelete,\n onStop,\n onDisplayCost,\n onShowAgentTools,\n onShowSkills,\n onShowHooks,\n onTogglePublic,\n onCopyShareLink,\n onExportTranscript,\n onDownloadConversation,\n shareUrl,\n position = \"bottom\",\n anchorRef,\n}: ConversationNameContextMenuProps) {\n const isMobile = useBreakpoint();\n\n const { t } = useTranslation(\"openhands\");\n const { backend } = useActiveBackend();\n const { data: conversation } = useActiveConversation();\n const isArchivedConversation = useIsArchivedConversation();\n const ref = useClickOutsideElement<HTMLUListElement>(onClose);\n\n const anchorElement = anchorRef?.current ?? null;\n const [portalStyle, setPortalStyle] = React.useState<React.CSSProperties>();\n React.useLayoutEffect(() => {\n if (!anchorElement) return undefined;\n\n const updatePosition = () => {\n const rect = anchorElement.getBoundingClientRect();\n if (!rect) return;\n const gap = 8;\n const style: React.CSSProperties = {\n position: \"fixed\",\n zIndex: 9999,\n };\n if (position === \"top\") {\n style.bottom = window.innerHeight - rect.top + gap;\n } else {\n style.top = rect.bottom + gap;\n }\n style.left = rect.left;\n setPortalStyle(style);\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [anchorElement, position]);\n const hasTools = Boolean(onShowAgentTools || onShowSkills || onShowHooks);\n const hasInfo = Boolean(onDisplayCost);\n const hasControl = Boolean(onStop || onDelete);\n const stopLabelKey =\n backend.kind === \"cloud\"\n ? I18nKey.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME\n : I18nKey.COMMON$STOP_CONVERSATION;\n const shouldShowPublicSharing =\n backend.kind === \"cloud\" && Boolean(onTogglePublic);\n const isPublic = conversation?.public || false;\n\n const isPortaled = Boolean(anchorElement);\n const portalClassName = isPortaled\n ? \"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0\"\n : \"\";\n\n const menu = (\n <ContextMenu\n ref={ref}\n testId=\"conversation-name-context-menu\"\n position={position}\n alignment=\"left\"\n className={cn(\n isMobile ? \"right-0 translate-x-[34%] left-auto\" : \"\",\n portalClassName,\n )}\n >\n {onRename && (\n <ContextMenuListItem testId=\"rename-button\" onClick={onRename}>\n <ConversationNameContextMenuIconText\n icon={<EditIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$RENAME)}\n />\n </ContextMenuListItem>\n )}\n\n {hasTools && <Divider testId=\"separator-tools\" inset=\"menu\" />}\n\n {onShowSkills && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"show-skills-button\"\n onClick={onShowSkills}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={\n <SkillsIcon\n width={16}\n height={16}\n className=\"stroke-[1.75]\"\n aria-hidden\n />\n }\n text={t(I18nKey.CONVERSATION$SHOW_SKILLS)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onShowHooks && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"show-hooks-button\"\n onClick={onShowHooks}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<FishingHookIcon width={16} height={16} aria-hidden />}\n text={t(I18nKey.CONVERSATION$SHOW_HOOKS)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onShowAgentTools && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"show-agent-tools-button\"\n onClick={onShowAgentTools}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<ToolsIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onExportTranscript && (\n <ContextMenuListItem\n testId=\"export-transcript-button\"\n onClick={onExportTranscript}\n >\n <ConversationNameContextMenuIconText\n icon={<DownloadIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$EXPORT_TRANSCRIPT)}\n />\n </ContextMenuListItem>\n )}\n\n {onDownloadConversation && (\n <ContextMenuListItem\n testId=\"download-trajectory-button\"\n onClick={onDownloadConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<DownloadIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$DOWNLOAD_CONVERSATION_DATA)}\n />\n </ContextMenuListItem>\n )}\n\n {(hasInfo || hasControl) && (\n <Divider testId=\"separator-info-control\" inset=\"menu\" />\n )}\n\n {onDisplayCost && (\n <ContextMenuListItem\n testId=\"display-cost-button\"\n onClick={onDisplayCost}\n >\n <ConversationNameContextMenuIconText\n icon={<CreditCardIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$DISPLAY_COST)}\n />\n </ContextMenuListItem>\n )}\n\n {shouldShowPublicSharing && onTogglePublic && (\n <li className=\"flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]\">\n <span\n className=\"flex shrink-0 items-center text-[var(--oh-muted)]\"\n aria-hidden\n >\n <Share2 size={16} />\n </span>\n <span className=\"min-w-0 flex-1 truncate text-sm\">\n {t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}\n </span>\n <div className=\"flex shrink-0 items-center\">\n {isPublic && shareUrl && onCopyShareLink && (\n <div className=\"mr-2 flex items-center gap-0.5\">\n <button\n type=\"button\"\n data-testid=\"copy-share-link-button\"\n onClick={onCopyShareLink}\n className=\"rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current\"\n title={t(I18nKey.BUTTON$COPY_TO_CLIPBOARD)}\n >\n <CopyIcon width={14} height={14} />\n </button>\n <a\n data-testid=\"open-share-link-button\"\n href={shareUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(event) => event.stopPropagation()}\n className=\"rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current\"\n title={t(I18nKey.BUTTON$OPEN_IN_NEW_TAB)}\n >\n <ExternalLink size={14} aria-hidden />\n </a>\n </div>\n )}\n <PublicShareToggle\n isPublic={isPublic}\n onToggle={onTogglePublic}\n ariaLabel={t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}\n />\n </div>\n </li>\n )}\n\n {onStop && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"stop-button\"\n onClick={onStop}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<CloseIcon width={16} height={16} />}\n text={t(stopLabelKey)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onDelete && (\n <ContextMenuListItem testId=\"delete-button\" onClick={onDelete}>\n <ConversationNameContextMenuIconText\n icon={<DeleteIcon width={16} height={16} />}\n text={t(I18nKey.COMMON$DELETE_CONVERSATION)}\n />\n </ContextMenuListItem>\n )}\n </ContextMenu>\n );\n\n if (isPortaled) {\n if (typeof document === \"undefined\" || !portalStyle) {\n return null;\n }\n return ReactDOM.createPortal(\n <div style={portalStyle}>{menu}</div>,\n document.body,\n );\n }\n\n return menu;\n}\n"],"mappings":"w3CAmDA,SAAS,EAAkB,CACzB,WACA,WACA,aAKC,CACD,OACE,EAAA,EAAA,MAAC,QAAD,CAAO,UAAU,qEAAjB,EACE,EAAA,EAAA,KAAC,QAAD,CACE,OAAA,GACA,KAAK,WACL,cAAY,wBACZ,QAAS,EACT,aAAY,EACZ,SAAW,GAAU,EAAS,EAAM,OAAO,OAAO,CACnD,CAAA,GACD,EAAA,EAAA,KAAC,OAAD,CACE,cAAA,GACA,UAAW,EAAA,GACT,0GACA,EAAW,WAAa,mBAC1B,YAEA,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,EAAA,GACT,oFACA,EACI,iDACA,kCACN,CACD,CAAA,CACG,CAAA,CACD,GAEX,CAEA,SAAgB,EAA4B,CAC1C,UACA,WACA,WACA,SACA,gBACA,mBACA,eACA,cACA,iBACA,kBACA,qBACA,yBACA,WACA,WAAW,SACX,aACmC,CACnC,IAAM,EAAW,EAAA,cAAc,EAEzB,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,CAAE,WAAY,EAAA,iBAAiB,EAC/B,CAAE,KAAM,GAAiB,EAAA,sBAAsB,EAC/C,EAAyB,EAAA,0BAA0B,EACnD,EAAM,EAAA,uBAAyC,CAAO,EAEtD,EAAgB,GAAW,SAAW,KACtC,CAAC,EAAa,GAAkB,EAAA,QAAM,SAA8B,EAC1E,EAAA,QAAM,oBAAsB,CAC1B,GAAI,CAAC,EAAe,OAEpB,IAAM,MAAuB,CAC3B,IAAM,EAAO,EAAc,sBAAsB,EACjD,GAAI,CAAC,EAAM,OACX,IACM,EAA6B,CACjC,SAAU,QACV,OAAQ,IACV,EACI,IAAa,MACf,EAAM,OAAS,OAAO,YAAc,EAAK,IAAM,EAE/C,EAAM,IAAM,EAAK,OAAS,EAE5B,EAAM,KAAO,EAAK,KAClB,EAAe,CAAK,CACtB,EAKA,OAHA,EAAe,EACf,OAAO,iBAAiB,SAAU,CAAc,EAChD,OAAO,iBAAiB,SAAU,EAAgB,EAAI,MACzC,CACX,OAAO,oBAAoB,SAAU,CAAc,EACnD,OAAO,oBAAoB,SAAU,EAAgB,EAAI,CAC3D,CACF,EAAG,CAAC,EAAe,CAAQ,CAAC,EAC5B,IAAM,EAAW,GAAQ,GAAoB,GAAgB,GACvD,EAAU,EAAQ,EAClB,GAAa,GAAQ,GAAU,GAC/B,GACJ,EAAQ,OAAS,QACb,EAAA,QAAQ,uCACR,EAAA,QAAQ,yBACR,GACJ,EAAQ,OAAS,SAAW,EAAQ,EAChC,EAAW,GAAc,QAAU,GAEnC,EAAa,EAAQ,EAKrB,GACJ,EAAA,EAAA,MAAC,EAAA,YAAD,CACO,MACL,OAAO,iCACG,WACV,UAAU,OACV,UAAW,EAAA,GACT,EAAW,sCAAwC,GAXjC,EACpB,8DACA,EAWA,WARF,CAUG,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,OAAO,gBAAgB,QAAS,YACnD,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,GAAA,QAAD,CAAU,MAAO,GAAI,OAAQ,EAAK,CAAA,EACxC,KAAM,EAAE,EAAA,QAAQ,aAAa,CAC9B,CAAA,CACkB,CAAA,EAGtB,IAAY,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,OAAO,kBAAkB,MAAM,MAAQ,CAAA,EAE5D,IACC,EAAA,EAAA,KAAC,EAAA,wBAAD,CAAyB,WAAY,YACnC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,qBACP,QAAS,EACT,WAAY,YAEZ,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MACE,EAAA,EAAA,KAAC,EAAA,QAAD,CACE,MAAO,GACP,OAAQ,GACR,UAAU,gBACV,cAAA,EACD,CAAA,EAEH,KAAM,EAAE,EAAA,QAAQ,wBAAwB,CACzC,CAAA,CACkB,CAAA,CACE,CAAA,EAG1B,IACC,EAAA,EAAA,KAAC,EAAA,wBAAD,CAAyB,WAAY,YACnC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,oBACP,QAAS,EACT,WAAY,YAEZ,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAiB,MAAO,GAAI,OAAQ,GAAI,cAAA,EAAa,CAAA,EAC3D,KAAM,EAAE,EAAA,QAAQ,uBAAuB,CACxC,CAAA,CACkB,CAAA,CACE,CAAA,EAG1B,IACC,EAAA,EAAA,KAAC,EAAA,wBAAD,CAAyB,WAAY,YACnC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,0BACP,QAAS,EACT,WAAY,YAEZ,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAW,MAAO,GAAI,OAAQ,EAAK,CAAA,EACzC,KAAM,EAAE,EAAA,QAAQ,oCAAoC,CACrD,CAAA,CACkB,CAAA,CACE,CAAA,EAG1B,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,2BACP,QAAS,YAET,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAc,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC5C,KAAM,EAAE,EAAA,QAAQ,wBAAwB,CACzC,CAAA,CACkB,CAAA,EAGtB,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,6BACP,QAAS,YAET,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAc,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC5C,KAAM,EAAE,EAAA,QAAQ,iCAAiC,CAClD,CAAA,CACkB,CAAA,GAGrB,GAAW,MACX,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,OAAO,yBAAyB,MAAM,MAAQ,CAAA,EAGxD,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,sBACP,QAAS,YAET,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,GAAA,QAAD,CAAgB,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC9C,KAAM,EAAE,EAAA,QAAQ,mBAAmB,CACpC,CAAA,CACkB,CAAA,EAGtB,IAA2B,IAC1B,EAAA,EAAA,MAAC,KAAD,CAAI,UAAU,mGAAd,EACE,EAAA,EAAA,KAAC,OAAD,CACE,UAAU,oDACV,cAAA,aAEA,EAAA,EAAA,KAAC,EAAA,OAAD,CAAQ,KAAM,EAAK,CAAA,CACf,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,2CACb,EAAE,EAAA,QAAQ,2BAA2B,CAClC,CAAA,GACN,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sCAAf,CACG,GAAY,GAAY,IACvB,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,0CAAf,EACE,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,cAAY,yBACZ,QAAS,EACT,UAAU,uJACV,MAAO,EAAE,EAAA,QAAQ,wBAAwB,YAEzC,EAAA,EAAA,KAAC,EAAA,QAAD,CAAU,MAAO,GAAI,OAAQ,EAAK,CAAA,CAC5B,CAAA,GACR,EAAA,EAAA,KAAC,IAAD,CACE,cAAY,yBACZ,KAAM,EACN,OAAO,SACP,IAAI,sBACJ,QAAU,GAAU,EAAM,gBAAgB,EAC1C,UAAU,mMACV,MAAO,EAAE,EAAA,QAAQ,sBAAsB,YAEvC,EAAA,EAAA,KAAC,GAAA,aAAD,CAAc,KAAM,GAAI,cAAA,EAAa,CAAA,CACpC,CAAA,CACA,KAEP,EAAA,EAAA,KAAC,EAAD,CACY,WACV,SAAU,EACV,UAAW,EAAE,EAAA,QAAQ,2BAA2B,CACjD,CAAA,CACE,GACH,IAGL,IACC,EAAA,EAAA,KAAC,EAAA,wBAAD,CAAyB,WAAY,YACnC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,cACP,QAAS,EACT,WAAY,YAEZ,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAW,MAAO,GAAI,OAAQ,EAAK,CAAA,EACzC,KAAM,EAAE,EAAY,CACrB,CAAA,CACkB,CAAA,CACE,CAAA,EAG1B,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,OAAO,gBAAgB,QAAS,YACnD,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,QAAD,CAAY,MAAO,GAAI,OAAQ,EAAK,CAAA,EAC1C,KAAM,EAAE,EAAA,QAAQ,0BAA0B,CAC3C,CAAA,CACkB,CAAA,CAEZ,IAaf,OAVI,EACE,OAAO,SAAa,KAAe,CAAC,EAC/B,KAEF,EAAA,QAAS,cACd,EAAA,EAAA,KAAC,MAAD,CAAK,MAAO,WAAc,CAAU,CAAA,EACpC,SAAS,IACX,EAGK,CACT"}
1
+ {"version":3,"file":"conversation-name-context-menu.cjs","names":[],"sources":["../../../../src/components/features/conversation/conversation-name-context-menu.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { ExternalLink, Gauge, Share2 } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { useBreakpoint } from \"#/hooks/use-breakpoint\";\nimport { cn } from \"#/utils/utils\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { ContextMenuListItem } from \"../context-menu/context-menu-list-item\";\nimport { Divider } from \"#/ui/divider\";\nimport { I18nKey } from \"#/i18n/declaration\";\n\nimport EditIcon from \"#/icons/u-edit.svg?react\";\nimport SkillsIcon from \"#/icons/skills.svg?react\";\nimport FishingHookIcon from \"#/icons/fishing-hook.svg?react\";\nimport ToolsIcon from \"#/icons/u-tools.svg?react\";\nimport DownloadIcon from \"#/icons/u-download.svg?react\";\nimport CloseIcon from \"#/icons/u-close.svg?react\";\nimport DeleteIcon from \"#/icons/u-delete.svg?react\";\nimport CopyIcon from \"#/icons/copy.svg?react\";\nimport { ConversationNameContextMenuIconText } from \"./conversation-name-context-menu-icon-text\";\nimport { ArchivedDisabledTooltip } from \"../context-menu/archived-disabled-tooltip\";\nimport { useIsArchivedConversation } from \"#/hooks/use-is-archived-conversation\";\n\ninterface ConversationNameContextMenuProps {\n onClose: () => void;\n onRename?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onDelete?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onStop?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onDisplayCost?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onShowAgentTools?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onShowSkills?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onShowHooks?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onTogglePublic?: (nextIsPublic: boolean) => void;\n onCopyShareLink?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onExportTranscript?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onDownloadConversation?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n shareUrl?: string;\n position?: \"top\" | \"bottom\";\n /**\n * Element the menu should anchor against. When provided, the menu renders\n * into a portal at the document body using fixed positioning so it cannot be\n * clipped by ancestors with `overflow: hidden` (e.g. the chat panel that\n * sits next to the right-side tabs panel).\n */\n anchorRef?: React.RefObject<HTMLElement | null>;\n}\n\nfunction PublicShareToggle({\n isPublic,\n onToggle,\n ariaLabel,\n}: {\n isPublic: boolean;\n onToggle: (nextIsPublic: boolean) => void;\n ariaLabel: string;\n}) {\n return (\n <label className=\"relative inline-flex shrink-0 cursor-pointer items-center\">\n <input\n hidden\n type=\"checkbox\"\n data-testid=\"share-publicly-button\"\n checked={isPublic}\n aria-label={ariaLabel}\n onChange={(event) => onToggle(event.target.checked)}\n />\n <span\n aria-hidden\n className={cn(\n \"inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out\",\n isPublic ? \"bg-white\" : \"bg-base-secondary\",\n )}\n >\n <span\n className={cn(\n \"block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out\",\n isPublic\n ? \"translate-x-[calc(1rem-1px)] bg-base-secondary\"\n : \"translate-x-px bg-tertiary-light\",\n )}\n />\n </span>\n </label>\n );\n}\n\nexport function ConversationNameContextMenu({\n onClose,\n onRename,\n onDelete,\n onStop,\n onDisplayCost,\n onShowAgentTools,\n onShowSkills,\n onShowHooks,\n onTogglePublic,\n onCopyShareLink,\n onExportTranscript,\n onDownloadConversation,\n shareUrl,\n position = \"bottom\",\n anchorRef,\n}: ConversationNameContextMenuProps) {\n const isMobile = useBreakpoint();\n\n const { t } = useTranslation(\"openhands\");\n const { backend } = useActiveBackend();\n const { data: conversation } = useActiveConversation();\n const isArchivedConversation = useIsArchivedConversation();\n const ref = useClickOutsideElement<HTMLUListElement>(onClose, anchorRef);\n\n const anchorElement = anchorRef?.current ?? null;\n const [portalStyle, setPortalStyle] = React.useState<React.CSSProperties>();\n React.useLayoutEffect(() => {\n if (!anchorElement) return undefined;\n\n const updatePosition = () => {\n const rect = anchorElement.getBoundingClientRect();\n if (!rect) return;\n const gap = 8;\n const style: React.CSSProperties = {\n position: \"fixed\",\n zIndex: 9999,\n };\n if (position === \"top\") {\n style.bottom = window.innerHeight - rect.top + gap;\n } else {\n style.top = rect.bottom + gap;\n }\n style.left = rect.left;\n setPortalStyle(style);\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [anchorElement, position]);\n const hasTools = Boolean(onShowAgentTools || onShowSkills || onShowHooks);\n const hasInfo = Boolean(onDisplayCost);\n const hasControl = Boolean(onStop || onDelete);\n const stopLabelKey =\n backend.kind === \"cloud\"\n ? I18nKey.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME\n : I18nKey.COMMON$STOP_CONVERSATION;\n const shouldShowPublicSharing =\n backend.kind === \"cloud\" && Boolean(onTogglePublic);\n const isPublic = conversation?.public || false;\n\n const isPortaled = Boolean(anchorElement);\n const portalClassName = isPortaled\n ? \"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0\"\n : \"\";\n\n const menu = (\n <ContextMenu\n ref={ref}\n testId=\"conversation-name-context-menu\"\n position={position}\n alignment=\"left\"\n className={cn(\n isMobile ? \"right-0 translate-x-[34%] left-auto\" : \"\",\n portalClassName,\n )}\n >\n {onRename && (\n <ContextMenuListItem testId=\"rename-button\" onClick={onRename}>\n <ConversationNameContextMenuIconText\n icon={<EditIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$RENAME)}\n />\n </ContextMenuListItem>\n )}\n\n {hasTools && <Divider testId=\"separator-tools\" inset=\"menu\" />}\n\n {onShowSkills && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"show-skills-button\"\n onClick={onShowSkills}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={\n <SkillsIcon\n width={16}\n height={16}\n className=\"stroke-[1.75]\"\n aria-hidden\n />\n }\n text={t(I18nKey.CONVERSATION$SHOW_SKILLS)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onShowHooks && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"show-hooks-button\"\n onClick={onShowHooks}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<FishingHookIcon width={16} height={16} aria-hidden />}\n text={t(I18nKey.CONVERSATION$SHOW_HOOKS)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onShowAgentTools && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"show-agent-tools-button\"\n onClick={onShowAgentTools}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<ToolsIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onExportTranscript && (\n <ContextMenuListItem\n testId=\"export-transcript-button\"\n onClick={onExportTranscript}\n >\n <ConversationNameContextMenuIconText\n icon={<DownloadIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$EXPORT_TRANSCRIPT)}\n />\n </ContextMenuListItem>\n )}\n\n {onDownloadConversation && (\n <ContextMenuListItem\n testId=\"download-trajectory-button\"\n onClick={onDownloadConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<DownloadIcon width={16} height={16} />}\n text={t(I18nKey.BUTTON$DOWNLOAD_CONVERSATION_DATA)}\n />\n </ContextMenuListItem>\n )}\n\n {(hasInfo || hasControl) && (\n <Divider testId=\"separator-info-control\" inset=\"menu\" />\n )}\n\n {onDisplayCost && (\n <ContextMenuListItem\n testId=\"display-cost-button\"\n onClick={onDisplayCost}\n >\n <ConversationNameContextMenuIconText\n icon={<Gauge size={16} />}\n text={t(I18nKey.BUTTON$DISPLAY_COST)}\n />\n </ContextMenuListItem>\n )}\n\n {shouldShowPublicSharing && onTogglePublic && (\n <li className=\"flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]\">\n <span\n className=\"flex shrink-0 items-center text-[var(--oh-muted)]\"\n aria-hidden\n >\n <Share2 size={16} />\n </span>\n <span className=\"min-w-0 flex-1 truncate text-sm\">\n {t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}\n </span>\n <div className=\"flex shrink-0 items-center\">\n {isPublic && shareUrl && onCopyShareLink && (\n <div className=\"mr-2 flex items-center gap-0.5\">\n <button\n type=\"button\"\n data-testid=\"copy-share-link-button\"\n onClick={onCopyShareLink}\n className=\"rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current\"\n title={t(I18nKey.BUTTON$COPY_TO_CLIPBOARD)}\n >\n <CopyIcon width={14} height={14} />\n </button>\n <a\n data-testid=\"open-share-link-button\"\n href={shareUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n onClick={(event) => event.stopPropagation()}\n className=\"rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current\"\n title={t(I18nKey.BUTTON$OPEN_IN_NEW_TAB)}\n >\n <ExternalLink size={14} aria-hidden />\n </a>\n </div>\n )}\n <PublicShareToggle\n isPublic={isPublic}\n onToggle={onTogglePublic}\n ariaLabel={t(I18nKey.CONVERSATION$SHARE_PUBLICLY)}\n />\n </div>\n </li>\n )}\n\n {onStop && (\n <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>\n <ContextMenuListItem\n testId=\"stop-button\"\n onClick={onStop}\n isDisabled={isArchivedConversation}\n >\n <ConversationNameContextMenuIconText\n icon={<CloseIcon width={16} height={16} />}\n text={t(stopLabelKey)}\n />\n </ContextMenuListItem>\n </ArchivedDisabledTooltip>\n )}\n\n {onDelete && (\n <ContextMenuListItem testId=\"delete-button\" onClick={onDelete}>\n <ConversationNameContextMenuIconText\n icon={<DeleteIcon width={16} height={16} />}\n text={t(I18nKey.COMMON$DELETE_CONVERSATION)}\n />\n </ContextMenuListItem>\n )}\n </ContextMenu>\n );\n\n if (isPortaled) {\n if (typeof document === \"undefined\" || !portalStyle) {\n return null;\n }\n return ReactDOM.createPortal(\n <div style={portalStyle}>{menu}</div>,\n document.body,\n );\n }\n\n return menu;\n}\n"],"mappings":"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"}