@openhands/agent-canvas 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (766) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BkL3HWa3.js → acp-providers-D1PORKc0.js} +1 -1
  4. package/build/assets/active-backend-context-IqOjobNK.js +2 -0
  5. package/build/assets/{agent-context-settings-Bno1nwPL.js → agent-context-settings-DMrObcIS.js} +1 -1
  6. package/build/assets/agent-profiles-settings-DororXN5.js +1 -0
  7. package/build/assets/agent-server-conversation-service.api-DWBe0rbX.js +86 -0
  8. package/build/assets/{agent-settings-h8hQz-IU.js → agent-settings-BJVk92PU.js} +1 -1
  9. package/build/assets/agent-settings-COfJsQ1d.js +1 -0
  10. package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-CzZsm7ms.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-Qsb83VX1.js → api-key-entry-screen-D8Fade_-.js} +1 -1
  12. package/build/assets/app-settings-CpyGB3AT.js +1 -0
  13. package/build/assets/{automation-detail-7LkL91j9.js → automation-detail-B-jQ39Mm.js} +1 -1
  14. package/build/assets/{automation-export-U2QNyNy6.js → automation-export-B1dywoqk.js} +1 -1
  15. package/build/assets/{automation-setup-route-Bel9_Lue.js → automation-setup-route-C-bWUZBi.js} +1 -1
  16. package/build/assets/{automation-templates-CRLDssaI.js → automation-templates-DgpCGOJV.js} +1 -1
  17. package/build/assets/{automations-list-B2iV3ZKW.js → automations-list-DnMxlxsL.js} +1 -1
  18. package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-HHEneWMw.js} +1 -1
  19. package/build/assets/backend-form-modal-DiVrD4Cm.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-DB4717Iu.js → backend-synced-settings-badge-7MIjpr8M.js} +1 -1
  21. package/build/assets/{badge-yR53enbU.js → badge-CpYmcVZV.js} +1 -1
  22. package/build/assets/{base-modal-3NmIOKDm.js → base-modal-Fnh6Uln9.js} +1 -1
  23. package/build/assets/bot-BQZx8e2i.js +1 -0
  24. package/build/assets/{brand-button-CJcwjnfb.js → brand-button-swT1RyO0.js} +1 -1
  25. package/build/assets/browser-B9AbV6kG.js +7 -0
  26. package/build/assets/{browser-tab-A94o33Vn.js → browser-tab-zAY12m_i.js} +1 -1
  27. package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-DsJtivmL.js} +1 -1
  28. package/build/assets/check-WAFXrrs_.js +1 -0
  29. package/build/assets/chevron-down-CifNWzme.js +1 -0
  30. package/build/assets/circle-check-CtnimJa8.js +1 -0
  31. package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-Cuzx55bo.js} +1 -1
  32. package/build/assets/{cloud-funnel-analytics-CBQdPZl_.js → cloud-funnel-analytics-86CwNdSh.js} +1 -1
  33. package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-D0fRotFi.js} +1 -1
  34. package/build/assets/{command-menu-PsRXVBz2.js → command-menu-BXy03FBl.js} +1 -1
  35. package/build/assets/{condenser-settings-w7L3EFvm.js → condenser-settings-BmZa0ui_.js} +1 -1
  36. package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-BgoN6lbN.js} +1 -1
  37. package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-Bq02tc-P.js} +1 -1
  38. package/build/assets/conversation-BPo8SvLN.js +1 -0
  39. package/build/assets/conversation-CPCVsCUY.js +90 -0
  40. package/build/assets/conversation-panel-BPo8SvLN.js +1 -0
  41. package/build/assets/{conversation-state-store-Bs8gA263.js → conversation-state-store-C5YpjMNy.js} +1 -1
  42. package/build/assets/conversation-store-Blc5xysY.js +6 -0
  43. package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-CMqo_0Bd.js} +1 -1
  44. package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-Cg1pF0xn.js} +1 -1
  45. package/build/assets/{device-verify-BIjXeW9N.js → device-verify-BfQLgNyq.js} +1 -1
  46. package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-BIqQr5mx.js} +1 -1
  47. package/build/assets/{entry.client-DzbDyLkV.js → entry.client-CxFjRYqH.js} +2 -2
  48. package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-C_yV4_bo.js} +1 -1
  49. package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-Bi4qbh2g.js} +1 -1
  50. package/build/assets/{extensions-hub-DOmHPGTA.js → extensions-hub-BqUINAhp.js} +1 -1
  51. package/build/assets/{extensions-navigation-6zU5M1pa.js → extensions-navigation-lraj88Wk.js} +1 -1
  52. package/build/assets/external-link-CgtpA_a1.js +1 -0
  53. package/build/assets/{file-text-RecuaId_.js → file-text-DEK4LSVw.js} +1 -1
  54. package/build/assets/files-tab-DV0L-lFE.js +1 -0
  55. package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-7yFSQJq_.js} +1 -1
  56. package/build/assets/format-model-name-BN_rx1Y3.js +1 -0
  57. package/build/assets/{format-relative-time-DGPQlPx0.js → format-relative-time-DSErAuVr.js} +1 -1
  58. package/build/assets/git-provider-icon-BvlLAche.js +1 -0
  59. package/build/assets/{git-repo-dropdown-B7RvO70z.js → git-repo-dropdown-ByMzpNko.js} +1 -1
  60. package/build/assets/git-repo-dropdown-C6R7hgM8.js +1 -0
  61. package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_sfncLZ.js} +1 -1
  62. package/build/assets/{home-DEZaZqYv.js → home-BOrlwLqG.js} +1 -1
  63. package/build/assets/home-BvMNC6E-.js +1 -0
  64. package/build/assets/{home-store-D7CjMN_-.js → home-store-CxqsY9Fi.js} +1 -1
  65. package/build/assets/index-home-BvMNC6E-.js +1 -0
  66. package/build/assets/info-BRVcJAUg.js +1 -0
  67. package/build/assets/{install-server-modal-BTwK5lbi.js → install-server-modal-Bl4G1zF4.js} +1 -1
  68. package/build/assets/{kebab-menu-item-content-C4CkeiJO.js → kebab-menu-item-content-BGoGFEAg.js} +1 -1
  69. package/build/assets/{launch-DVlx4v9o.js → launch-CkqiSCqi.js} +1 -1
  70. package/build/assets/{list-todo-CheUtB7F.js → list-todo-DNWlzfaM.js} +1 -1
  71. package/build/assets/llm-not-configured-banner-DLw_tu-G.js +27 -0
  72. package/build/assets/llm-settings-B-pkVCrt.js +1 -0
  73. package/build/assets/llm-settings-DSC0-IQ7.js +1 -0
  74. package/build/assets/llm-subscription-service-BAdOl5Xx.js +1 -0
  75. package/build/assets/loader-circle-B47W9XqT.js +1 -0
  76. package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-xhnrGP4Y.js} +1 -1
  77. package/build/assets/{manage-backends-modal-HNWKLYhq.js → manage-backends-modal-DhGk5mJt.js} +1 -1
  78. package/build/assets/manifest-653b89aa.js +1 -0
  79. package/build/assets/{manifest-subpage-layout-D-m-h8_t.js → manifest-subpage-layout-CKWvL2ig.js} +1 -1
  80. package/build/assets/{map-provider-7Bp2aih5.js → map-provider-Mx8mZuE-.js} +1 -1
  81. package/build/assets/markdown-renderer-DUmk7pFc.js +8 -0
  82. package/build/assets/{mcp-gLgPP7AS.js → mcp-DCkvl6K0.js} +2 -2
  83. package/build/assets/mcp-marketplace-utils-DEbMXlQr.js +1 -0
  84. package/build/assets/messages-DSXvyc21.js +40 -0
  85. package/build/assets/{modal-body-duRaxj_K.js → modal-body-gIe21fDv.js} +1 -1
  86. package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D66dlgZ7.js} +1 -1
  87. package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-B6iOGYpI.js} +1 -1
  88. package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-BYX1Pw5W.js} +1 -1
  89. package/build/assets/{npm-DRzJF5Zn.js → npm-DLckoeJc.js} +1 -1
  90. package/build/assets/{onboarding-DSr8hOpk.js → onboarding-D7WDG66N.js} +1 -1
  91. package/build/assets/{onboarding-modal-C6Euf7N4.js → onboarding-modal-C_xVrFNv.js} +1 -1
  92. package/build/assets/{organization-service.api-C4GYWwj9.js → organization-service.api-D-s9z18a.js} +1 -1
  93. package/build/assets/pencil-BGOCPRyu.js +1 -0
  94. package/build/assets/{planner-tab-CZcguxTK.js → planner-tab-AKaXIIfg.js} +1 -1
  95. package/build/assets/{plugins-management-service-BmDzOQsd.js → plugins-management-service-wtmY4QQw.js} +1 -1
  96. package/build/assets/plus-zNEL8rcX.js +1 -0
  97. package/build/assets/{profiles-service.api-CoLTwjc1.js → profiles-service.api-DCMYxHMi.js} +1 -1
  98. package/build/assets/{providers-tBzTpz1w.js → providers-BjrtjX4L.js} +1 -1
  99. package/build/assets/{proxy-DCI9S-LA.js → proxy-9Z_WZggZ.js} +1 -1
  100. package/build/assets/{puzzle-B3v361yY.js → puzzle-BWLmN8z4.js} +1 -1
  101. package/build/assets/recommended-automations-launcher-CFlzhu1o.js +1 -0
  102. package/build/assets/refresh-cw-CXtFWpwv.js +1 -0
  103. package/build/assets/root-CanxKlNV.css +1 -0
  104. package/build/assets/root-DkfG_UWR.js +2 -0
  105. package/build/assets/root-layout-D75LHYhh.js +2 -0
  106. package/build/assets/{schema-field-zhsVDllR.js → schema-field-OnM5Uob_.js} +1 -1
  107. package/build/assets/{sdk-section-page-CS4GWn0y.js → sdk-section-page-m5WQm2sy.js} +1 -1
  108. package/build/assets/search-CycosyjN.js +1 -0
  109. package/build/assets/{secrets-service-DjgGduXk.js → secrets-service-B26R61C1.js} +1 -1
  110. package/build/assets/{secrets-settings-f-qahfbi.js → secrets-settings-CbLYCKOX.js} +1 -1
  111. package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DCspm2U5.js} +1 -1
  112. package/build/assets/{settings-DQd0xLEw.js → settings-BJQI_iBM.js} +1 -1
  113. package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-BI8V_Nov.js} +1 -1
  114. package/build/assets/{settings-index-BVwy9JEp.js → settings-index-BiTqJoH7.js} +1 -1
  115. package/build/assets/{settings-input-D61Vzp9e.js → settings-input-Cz62hWVW.js} +1 -1
  116. package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-z_3FW5H3.js} +1 -1
  117. package/build/assets/{settings-modal-D6D5ngET.js → settings-modal-BIrIVn97.js} +1 -1
  118. package/build/assets/{settings-service.api-DZp7E7A9.js → settings-service.api--rJmnuLa.js} +1 -1
  119. package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-BRsSI8Vs.js} +1 -1
  120. package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-Ba7vel6T.js} +1 -1
  121. package/build/assets/shared-conversation-CQK_PqHx.js +1 -0
  122. package/build/assets/shield-check-T3JsDJiM.js +1 -0
  123. package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-Bhi3hVcu.js} +1 -1
  124. package/build/assets/{sidebar-mobile-menu-toggle-OoZBHxaT.js → sidebar-mobile-menu-toggle-YWJNRN4p.js} +1 -1
  125. package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-BSUlY5Ml.js} +1 -1
  126. package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-Cl1cUv_F.js} +1 -1
  127. package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-BXz8L8Rn.js} +1 -1
  128. package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-QgfKv31M.js} +1 -1
  129. package/build/assets/{skill-scope-B1Per5XI.js → skill-scope-Dc3JPW-8.js} +1 -1
  130. package/build/assets/{skills-plugins-B3AO6sMz.js → skills-plugins-CpTV27n3.js} +1 -1
  131. package/build/assets/{skills-settings-DmmgJ6CT.js → skills-settings-CSW__IW4.js} +1 -1
  132. package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-TJ0mdECe.js} +1 -1
  133. package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-BUMSbgrF.js} +1 -1
  134. package/build/assets/{task-list-tab-C19Q_JNf.js → task-list-tab-mAHMOkUz.js} +1 -1
  135. package/build/assets/{terminal-CbuMRYal.js → terminal-BzxBaHx2.js} +1 -1
  136. package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-O5v1FgxW.js} +1 -1
  137. package/build/assets/trash-2-C0xNVp9c.js +1 -0
  138. package/build/assets/{typography-D9tiHct7.js → typography-NOKSk9_R.js} +1 -1
  139. package/build/assets/usage-tab-tEmVN0KD.js +1 -0
  140. package/build/assets/{use-acp-credential-form-DJmmJKMo.js → use-acp-credential-form-BPNi0Zbm.js} +1 -1
  141. package/build/assets/{use-activate-agent-profile-CeFfYwu_.js → use-activate-agent-profile-D9YRQPTF.js} +1 -1
  142. package/build/assets/{use-agent-profiles-BHLkLbRR.js → use-agent-profiles-Cb2zUW3l.js} +1 -1
  143. package/build/assets/{use-can-manage-org-profiles-Bu4y8gSx.js → use-can-manage-org-profiles-Dxzq2AEd.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-QD9x3ySO.js → use-cloud-current-user-id-Co2eJk2A.js} +1 -1
  145. package/build/assets/{use-config-CPwqciXN.js → use-config-DKAMiI5R.js} +1 -1
  146. package/build/assets/use-create-conversation-CoHTiCbI.js +1 -0
  147. package/build/assets/{use-create-secret-BsOfOLvg.js → use-create-secret-2zBlCDsF.js} +1 -1
  148. package/build/assets/use-is-authed-C52-ivnB.js +1 -0
  149. package/build/assets/{use-is-creating-conversation-CVefC9Ns.js → use-is-creating-conversation-DdaAE6jV.js} +1 -1
  150. package/build/assets/{use-launch-skill-in-chat-BcKNjxxd.js → use-launch-skill-in-chat-COnDpxCQ.js} +1 -1
  151. package/build/assets/use-llm-profiles-C_BHue65.js +1 -0
  152. package/build/assets/{use-manifest-capabilities-DBYPjyV6.js → use-manifest-capabilities-DPrQsaPP.js} +1 -1
  153. package/build/assets/{use-onboarding-completion-CtNJxkXG.js → use-onboarding-completion-CCE8OQgV.js} +1 -1
  154. package/build/assets/{use-plugins-marketplace-ZEA-gyM9.js → use-plugins-marketplace-CEiak69h.js} +1 -1
  155. package/build/assets/use-save-agent-profile-DK9idD6a.js +1 -0
  156. package/build/assets/{use-save-settings-pSjRhD_m.js → use-save-settings-DNmnbG6f.js} +1 -1
  157. package/build/assets/{use-settings-nav-items-CQgkxUbV.js → use-settings-nav-items-BlFL7YhM.js} +1 -1
  158. package/build/assets/{use-settings-BHWsOcIG.js → use-settings-wCwPaSIv.js} +1 -1
  159. package/build/assets/{use-tracking-CGCsBWhg.js → use-tracking-CVwPmhlX.js} +1 -1
  160. package/build/assets/{use-user-conversation-DRfEU8x0.js → use-user-conversation-DVtfg0B_.js} +1 -1
  161. package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-p1xq35r2.js} +1 -1
  162. package/build/assets/{useMutation-ChpkYxI5.js → useMutation-BFDQmgk9.js} +1 -1
  163. package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-DF1NAAeC.js} +1 -1
  164. package/build/assets/{useQuery-BCnzy4LX.js → useQuery-DRv--6bK.js} +1 -1
  165. package/build/assets/utils-zxEjKE70.js +1 -0
  166. package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
  167. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js} +3 -3
  168. package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-D9wR9yM2.js} +1 -1
  169. package/build/assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js +13 -0
  170. package/build/assets/vendor~root-layout-C-IgVx6e.js +1 -0
  171. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js} +1 -1
  172. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js} +1 -1
  173. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js} +1 -1
  174. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js} +1 -1
  175. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js} +2 -2
  176. package/build/assets/{verification-settings-BItwt998.js → verification-settings-B8UMQ7MG.js} +1 -1
  177. package/build/assets/{wrench-B1_H-tL1.js → wrench-DIka3hCq.js} +1 -1
  178. package/build/assets/x-BWKA2Ver.js +1 -0
  179. package/build/assets/zap-DHddTPc0.js +1 -0
  180. package/build/index.html +4 -4
  181. package/build/locales/ar/openhands.json +28 -1
  182. package/build/locales/ca/openhands.json +28 -1
  183. package/build/locales/de/openhands.json +28 -1
  184. package/build/locales/en/openhands.json +28 -1
  185. package/build/locales/es/openhands.json +28 -1
  186. package/build/locales/fr/openhands.json +28 -1
  187. package/build/locales/it/openhands.json +28 -1
  188. package/build/locales/ja/openhands.json +28 -1
  189. package/build/locales/ko-KR/openhands.json +28 -1
  190. package/build/locales/no/openhands.json +28 -1
  191. package/build/locales/pt/openhands.json +28 -1
  192. package/build/locales/tr/openhands.json +28 -1
  193. package/build/locales/uk/openhands.json +28 -1
  194. package/build/locales/zh-CN/openhands.json +28 -1
  195. package/build/locales/zh-TW/openhands.json +28 -1
  196. package/config/defaults.json +3 -3
  197. package/dist/api/agent-server-compatibility.cjs +1 -1
  198. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  199. package/dist/api/agent-server-compatibility.js +1 -1
  200. package/dist/api/agent-server-compatibility.js.map +1 -1
  201. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  202. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  203. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +24 -1
  204. package/dist/api/conversation-service/agent-server-conversation-service.api.js +116 -97
  205. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  206. package/dist/api/llm-balance-service.cjs +2 -0
  207. package/dist/api/llm-balance-service.cjs.map +1 -0
  208. package/dist/api/llm-balance-service.d.ts +33 -0
  209. package/dist/api/llm-balance-service.js +53 -0
  210. package/dist/api/llm-balance-service.js.map +1 -0
  211. package/dist/api/llm-subscription-service.cjs +1 -1
  212. package/dist/api/llm-subscription-service.cjs.map +1 -1
  213. package/dist/api/llm-subscription-service.js +42 -34
  214. package/dist/api/llm-subscription-service.js.map +1 -1
  215. package/dist/components/conversation/index.cjs +1 -1
  216. package/dist/components/conversation/index.d.ts +0 -1
  217. package/dist/components/conversation/index.js +0 -1
  218. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  219. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  220. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +1 -1
  221. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  222. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
  223. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
  224. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +24 -23
  225. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
  226. package/dist/components/conversation-events/chat/group-events.cjs +1 -1
  227. package/dist/components/conversation-events/chat/group-events.cjs.map +1 -1
  228. package/dist/components/conversation-events/chat/group-events.d.ts +3 -3
  229. package/dist/components/conversation-events/chat/group-events.js +27 -26
  230. package/dist/components/conversation-events/chat/group-events.js.map +1 -1
  231. package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
  232. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  233. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  234. package/dist/components/features/chat/components/chat-input-actions.js +123 -118
  235. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  236. package/dist/components/features/chat/components/chat-input-grip.cjs +1 -1
  237. package/dist/components/features/chat/components/chat-input-grip.cjs.map +1 -1
  238. package/dist/components/features/chat/components/chat-input-grip.d.ts +2 -1
  239. package/dist/components/features/chat/components/chat-input-grip.js +7 -7
  240. package/dist/components/features/chat/components/chat-input-grip.js.map +1 -1
  241. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
  242. package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
  243. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +61 -60
  244. package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
  245. package/dist/components/features/chat/components/context-window-meter.cjs +2 -0
  246. package/dist/components/features/chat/components/context-window-meter.cjs.map +1 -0
  247. package/dist/components/features/chat/components/context-window-meter.d.ts +2 -0
  248. package/dist/components/features/chat/components/context-window-meter.js +131 -0
  249. package/dist/components/features/chat/components/context-window-meter.js.map +1 -0
  250. package/dist/components/features/chat/components/context-window-ring.cjs +2 -0
  251. package/dist/components/features/chat/components/context-window-ring.cjs.map +1 -0
  252. package/dist/components/features/chat/components/context-window-ring.d.ts +26 -0
  253. package/dist/components/features/chat/components/context-window-ring.js +45 -0
  254. package/dist/components/features/chat/components/context-window-ring.js.map +1 -0
  255. package/dist/components/features/chat/custom-chat-input.cjs +1 -1
  256. package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
  257. package/dist/components/features/chat/custom-chat-input.js +68 -67
  258. package/dist/components/features/chat/custom-chat-input.js.map +1 -1
  259. package/dist/components/features/chat/model-messages.cjs +1 -1
  260. package/dist/components/features/chat/model-messages.cjs.map +1 -1
  261. package/dist/components/features/chat/model-messages.js +26 -25
  262. package/dist/components/features/chat/model-messages.js.map +1 -1
  263. package/dist/components/features/chat/path-component.cjs +1 -1
  264. package/dist/components/features/chat/path-component.cjs.map +1 -1
  265. package/dist/components/features/chat/path-component.js +9 -6
  266. package/dist/components/features/chat/path-component.js.map +1 -1
  267. package/dist/components/features/chat/plan-preview.cjs +1 -1
  268. package/dist/components/features/chat/plan-preview.js +4 -4
  269. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
  270. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
  271. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.d.ts +0 -8
  272. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +92 -50
  273. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
  274. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
  275. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
  276. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +7 -2
  277. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +15 -9
  278. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
  279. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs +2 -0
  280. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs.map +1 -0
  281. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.d.ts +20 -0
  282. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js +76 -0
  283. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js.map +1 -0
  284. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  285. package/dist/components/features/controls/server-status-context-menu.cjs.map +1 -1
  286. package/dist/components/features/controls/server-status-context-menu.d.ts +5 -3
  287. package/dist/components/features/controls/server-status-context-menu.js +8 -8
  288. package/dist/components/features/controls/server-status-context-menu.js.map +1 -1
  289. package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
  290. package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
  291. package/dist/components/features/conversation/conversation-name-context-menu.js +58 -61
  292. package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
  293. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  294. package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
  295. package/dist/components/features/conversation/conversation-name-with-status.js +74 -46
  296. package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
  297. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  298. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  299. package/dist/components/features/conversation/conversation-name.js +69 -71
  300. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  301. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs +1 -1
  302. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs.map +1 -1
  303. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js +7 -6
  304. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js.map +1 -1
  305. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  306. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  307. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +92 -86
  308. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  309. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  310. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  311. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +81 -71
  312. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  313. package/dist/components/features/conversation/metrics-modal/cost-section.cjs +1 -1
  314. package/dist/components/features/conversation/metrics-modal/cost-section.cjs.map +1 -1
  315. package/dist/components/features/conversation/metrics-modal/cost-section.js +6 -6
  316. package/dist/components/features/conversation/metrics-modal/cost-section.js.map +1 -1
  317. package/dist/components/features/conversation/metrics-modal/metric-row.cjs +1 -1
  318. package/dist/components/features/conversation/metrics-modal/metric-row.cjs.map +1 -1
  319. package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +2 -1
  320. package/dist/components/features/conversation/metrics-modal/metric-row.js +10 -9
  321. package/dist/components/features/conversation/metrics-modal/metric-row.js.map +1 -1
  322. package/dist/components/features/conversation/metrics-modal/usage-section.cjs +1 -1
  323. package/dist/components/features/conversation/metrics-modal/usage-section.cjs.map +1 -1
  324. package/dist/components/features/conversation/metrics-modal/usage-section.js +2 -1
  325. package/dist/components/features/conversation/metrics-modal/usage-section.js.map +1 -1
  326. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs +2 -0
  327. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs.map +1 -0
  328. package/dist/components/features/conversation/usage-panel/compact-context-button.d.ts +16 -0
  329. package/dist/components/features/conversation/usage-panel/compact-context-button.js +59 -0
  330. package/dist/components/features/conversation/usage-panel/compact-context-button.js.map +1 -0
  331. package/dist/components/features/conversation/usage-panel/context-meter.cjs +2 -0
  332. package/dist/components/features/conversation/usage-panel/context-meter.cjs.map +1 -0
  333. package/dist/components/features/conversation/usage-panel/context-meter.d.ts +19 -0
  334. package/dist/components/features/conversation/usage-panel/context-meter.js +46 -0
  335. package/dist/components/features/conversation/usage-panel/context-meter.js.map +1 -0
  336. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs +2 -0
  337. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs.map +1 -0
  338. package/dist/components/features/conversation/usage-panel/provider-balance-card.d.ts +7 -0
  339. package/dist/components/features/conversation/usage-panel/provider-balance-card.js +57 -0
  340. package/dist/components/features/conversation/usage-panel/provider-balance-card.js.map +1 -0
  341. package/dist/components/features/conversation/usage-panel/usage-panel.cjs +2 -0
  342. package/dist/components/features/conversation/usage-panel/usage-panel.cjs.map +1 -0
  343. package/dist/components/features/conversation/usage-panel/usage-panel.d.ts +9 -0
  344. package/dist/components/features/conversation/usage-panel/usage-panel.js +68 -0
  345. package/dist/components/features/conversation/usage-panel/usage-panel.js.map +1 -0
  346. package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
  347. package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
  348. package/dist/components/features/conversation-panel/budget-display.js +10 -13
  349. package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
  350. package/dist/components/features/conversation-panel/budget-progress-bar.cjs +1 -1
  351. package/dist/components/features/conversation-panel/budget-progress-bar.cjs.map +1 -1
  352. package/dist/components/features/conversation-panel/budget-progress-bar.js +2 -2
  353. package/dist/components/features/conversation-panel/budget-progress-bar.js.map +1 -1
  354. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs +2 -0
  355. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs.map +1 -0
  356. package/dist/components/features/conversation-panel/confirm-archive-modal.d.ts +8 -0
  357. package/dist/components/features/conversation-panel/confirm-archive-modal.js +48 -0
  358. package/dist/components/features/conversation-panel/confirm-archive-modal.js.map +1 -0
  359. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  360. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
  361. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +3 -1
  362. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +39 -34
  363. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
  364. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  365. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  366. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +3 -1
  367. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +104 -80
  368. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  369. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  370. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
  371. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +7 -1
  372. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +28 -20
  373. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
  374. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
  375. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
  376. package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +9 -1
  377. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +94 -84
  378. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
  379. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs +1 -1
  380. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs.map +1 -1
  381. package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +2 -1
  382. package/dist/components/features/conversation-panel/conversation-group-folder-list.js +32 -31
  383. package/dist/components/features/conversation-panel/conversation-group-folder-list.js.map +1 -1
  384. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs +1 -1
  385. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs.map +1 -1
  386. package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +2 -1
  387. package/dist/components/features/conversation-panel/conversation-group-folder-row.js +27 -26
  388. package/dist/components/features/conversation-panel/conversation-group-folder-row.js.map +1 -1
  389. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  390. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  391. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +3 -1
  392. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +116 -106
  393. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  394. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  395. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  396. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +27 -0
  397. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +69 -46
  398. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  399. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  400. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  401. package/dist/components/features/conversation-panel/conversation-panel.js +230 -165
  402. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  403. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  404. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  405. package/dist/components/features/files-tab/file-content-viewer.js +22 -25
  406. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  407. package/dist/components/features/markdown/markdown-table-scroll.cjs +1 -1
  408. package/dist/components/features/markdown/markdown-table-scroll.cjs.map +1 -1
  409. package/dist/components/features/markdown/markdown-table-scroll.js +2 -2
  410. package/dist/components/features/markdown/markdown-table-scroll.js.map +1 -1
  411. package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
  412. package/dist/components/features/settings/llm-profiles/profile-row.js +1 -0
  413. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  414. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
  415. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +2 -2
  416. package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
  417. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  418. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  419. package/dist/components/shared/modals/confirmation-modals/base-modal.js +1 -1
  420. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  421. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  422. package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
  423. package/dist/components/shared/modals/settings/model-selector.js +154 -98
  424. package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
  425. package/dist/config/defaults.cjs +1 -1
  426. package/dist/config/defaults.cjs.map +1 -1
  427. package/dist/config/defaults.js +3 -3
  428. package/dist/config/defaults.js.map +1 -1
  429. package/dist/constants/llm-balance.cjs +2 -0
  430. package/dist/constants/llm-balance.cjs.map +1 -0
  431. package/dist/constants/llm-balance.d.ts +13 -0
  432. package/dist/constants/llm-balance.js +6 -0
  433. package/dist/constants/llm-balance.js.map +1 -0
  434. package/dist/contexts/conversation-websocket-context.cjs +2 -2
  435. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  436. package/dist/contexts/conversation-websocket-context.js +217 -209
  437. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  438. package/dist/hooks/chat/use-grip-resize.cjs +1 -1
  439. package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
  440. package/dist/hooks/chat/use-grip-resize.d.ts +1 -0
  441. package/dist/hooks/chat/use-grip-resize.js +39 -30
  442. package/dist/hooks/chat/use-grip-resize.js.map +1 -1
  443. package/dist/hooks/chat/use-slash-command.cjs +1 -1
  444. package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
  445. package/dist/hooks/chat/use-slash-command.js +61 -60
  446. package/dist/hooks/chat/use-slash-command.js.map +1 -1
  447. package/dist/hooks/mutation/use-condense-conversation.cjs +2 -0
  448. package/dist/hooks/mutation/use-condense-conversation.cjs.map +1 -0
  449. package/dist/hooks/mutation/use-condense-conversation.d.ts +12 -0
  450. package/dist/hooks/mutation/use-condense-conversation.js +17 -0
  451. package/dist/hooks/mutation/use-condense-conversation.js.map +1 -0
  452. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  453. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  454. package/dist/hooks/mutation/use-create-conversation.js +30 -21
  455. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  456. package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
  457. package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
  458. package/dist/hooks/mutation/use-new-conversation-command.js +1 -1
  459. package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
  460. package/dist/hooks/query/use-conversation-metrics.cjs +1 -1
  461. package/dist/hooks/query/use-conversation-metrics.cjs.map +1 -1
  462. package/dist/hooks/query/use-conversation-metrics.js +1 -1
  463. package/dist/hooks/query/use-conversation-metrics.js.map +1 -1
  464. package/dist/hooks/query/use-llm-balance.cjs +2 -0
  465. package/dist/hooks/query/use-llm-balance.cjs.map +1 -0
  466. package/dist/hooks/query/use-llm-balance.d.ts +10 -0
  467. package/dist/hooks/query/use-llm-balance.js +24 -0
  468. package/dist/hooks/query/use-llm-balance.js.map +1 -0
  469. package/dist/hooks/query/use-search-providers.cjs +1 -1
  470. package/dist/hooks/query/use-search-providers.cjs.map +1 -1
  471. package/dist/hooks/query/use-search-providers.js +1 -1
  472. package/dist/hooks/query/use-search-providers.js.map +1 -1
  473. package/dist/hooks/use-await-context-compaction.cjs +2 -0
  474. package/dist/hooks/use-await-context-compaction.cjs.map +1 -0
  475. package/dist/hooks/use-await-context-compaction.d.ts +38 -0
  476. package/dist/hooks/use-await-context-compaction.js +61 -0
  477. package/dist/hooks/use-await-context-compaction.js.map +1 -0
  478. package/dist/hooks/use-compact-context-action.cjs +2 -0
  479. package/dist/hooks/use-compact-context-action.cjs.map +1 -0
  480. package/dist/hooks/use-compact-context-action.d.ts +10 -0
  481. package/dist/hooks/use-compact-context-action.js +61 -0
  482. package/dist/hooks/use-compact-context-action.js.map +1 -0
  483. package/dist/hooks/use-context-window-usage.cjs +2 -0
  484. package/dist/hooks/use-context-window-usage.cjs.map +1 -0
  485. package/dist/hooks/use-context-window-usage.d.ts +5 -0
  486. package/dist/hooks/use-context-window-usage.js +20 -0
  487. package/dist/hooks/use-context-window-usage.js.map +1 -0
  488. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  489. package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
  490. package/dist/hooks/use-conversation-name-context-menu.d.ts +0 -3
  491. package/dist/hooks/use-conversation-name-context-menu.js +54 -57
  492. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  493. package/dist/hooks/use-drag-resize.cjs +1 -1
  494. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  495. package/dist/hooks/use-drag-resize.d.ts +8 -0
  496. package/dist/hooks/use-drag-resize.js +21 -18
  497. package/dist/hooks/use-drag-resize.js.map +1 -1
  498. package/dist/hooks/use-live-conversation-metrics.cjs +2 -0
  499. package/dist/hooks/use-live-conversation-metrics.cjs.map +1 -0
  500. package/dist/hooks/use-live-conversation-metrics.d.ts +18 -0
  501. package/dist/hooks/use-live-conversation-metrics.js +37 -0
  502. package/dist/hooks/use-live-conversation-metrics.js.map +1 -0
  503. package/dist/hooks/use-select-conversation-tab.cjs +1 -1
  504. package/dist/hooks/use-select-conversation-tab.cjs.map +1 -1
  505. package/dist/hooks/use-select-conversation-tab.js +2 -2
  506. package/dist/hooks/use-select-conversation-tab.js.map +1 -1
  507. package/dist/i18n/declaration.cjs +1 -1
  508. package/dist/i18n/declaration.cjs.map +1 -1
  509. package/dist/i18n/declaration.d.ts +27 -0
  510. package/dist/i18n/declaration.js +1 -1
  511. package/dist/i18n/declaration.js.map +1 -1
  512. package/dist/i18n/translation.cjs +2 -2
  513. package/dist/i18n/translation.cjs.map +1 -1
  514. package/dist/i18n/translation.js +474 -15
  515. package/dist/i18n/translation.js.map +1 -1
  516. package/dist/index.cjs +1 -1
  517. package/dist/index.js +28 -29
  518. package/dist/lib/index.cjs +1 -1
  519. package/dist/lib/index.js +0 -1
  520. package/dist/locales/ar/openhands.json +28 -1
  521. package/dist/locales/ca/openhands.json +28 -1
  522. package/dist/locales/de/openhands.json +28 -1
  523. package/dist/locales/en/openhands.json +28 -1
  524. package/dist/locales/es/openhands.json +28 -1
  525. package/dist/locales/fr/openhands.json +28 -1
  526. package/dist/locales/it/openhands.json +28 -1
  527. package/dist/locales/ja/openhands.json +28 -1
  528. package/dist/locales/ko-KR/openhands.json +28 -1
  529. package/dist/locales/no/openhands.json +28 -1
  530. package/dist/locales/pt/openhands.json +28 -1
  531. package/dist/locales/tr/openhands.json +28 -1
  532. package/dist/locales/uk/openhands.json +28 -1
  533. package/dist/locales/zh-CN/openhands.json +28 -1
  534. package/dist/locales/zh-TW/openhands.json +28 -1
  535. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs +5 -5
  536. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs.map +1 -1
  537. package/dist/node_modules/@microlink/react-json-view/dist/main.js +5194 -5187
  538. package/dist/node_modules/@microlink/react-json-view/dist/main.js.map +1 -1
  539. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +2 -1
  540. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -0
  541. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +21 -1
  542. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -0
  543. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +2 -1
  544. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs.map +1 -0
  545. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +22 -1
  546. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js.map +1 -0
  547. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +2 -1
  548. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs.map +1 -0
  549. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +33 -1
  550. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js.map +1 -0
  551. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  552. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  553. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +56 -22
  554. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  555. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs +1 -1
  556. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs.map +1 -1
  557. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js +3 -0
  558. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js.map +1 -1
  559. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +2 -1
  560. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs.map +1 -0
  561. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +31 -1
  562. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js.map +1 -0
  563. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +2 -1
  564. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs.map +1 -0
  565. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +21 -1
  566. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js.map +1 -0
  567. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +2 -1
  568. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs.map +1 -0
  569. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +21 -1
  570. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js.map +1 -0
  571. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.cjs.map +1 -1
  572. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.js.map +1 -1
  573. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  574. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  575. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +9 -5
  576. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  577. package/dist/node_modules/i18next-http-backend/esm/index.cjs +1 -1
  578. package/dist/node_modules/i18next-http-backend/esm/index.cjs.map +1 -1
  579. package/dist/node_modules/i18next-http-backend/esm/index.js +2 -2
  580. package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
  581. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs +2 -0
  582. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs.map +1 -0
  583. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js +31 -0
  584. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js.map +1 -0
  585. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs +2 -0
  586. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs.map +1 -0
  587. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js +23 -0
  588. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js.map +1 -0
  589. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs +2 -0
  590. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs.map +1 -0
  591. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +12 -0
  592. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js.map +1 -0
  593. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs +2 -0
  594. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs.map +1 -0
  595. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js +23 -0
  596. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js.map +1 -0
  597. package/dist/node_modules/zustand/esm/middleware.cjs +3 -3
  598. package/dist/node_modules/zustand/esm/middleware.cjs.map +1 -1
  599. package/dist/node_modules/zustand/esm/middleware.js +33 -31
  600. package/dist/node_modules/zustand/esm/middleware.js.map +1 -1
  601. package/dist/package.cjs +1 -1
  602. package/dist/package.cjs.map +1 -1
  603. package/dist/package.js +17 -16
  604. package/dist/package.js.map +1 -1
  605. package/dist/routes/app-settings.cjs +1 -1
  606. package/dist/routes/app-settings.cjs.map +1 -1
  607. package/dist/routes/app-settings.js +94 -93
  608. package/dist/routes/app-settings.js.map +1 -1
  609. package/dist/routes/llm-settings.cjs +1 -1
  610. package/dist/routes/llm-settings.cjs.map +1 -1
  611. package/dist/routes/llm-settings.js +131 -119
  612. package/dist/routes/llm-settings.js.map +1 -1
  613. package/dist/routes/usage-tab.cjs +2 -0
  614. package/dist/routes/usage-tab.cjs.map +1 -0
  615. package/dist/routes/usage-tab.d.ts +2 -0
  616. package/dist/routes/usage-tab.js +10 -0
  617. package/dist/routes/usage-tab.js.map +1 -0
  618. package/dist/services/child-conversation-launch.cjs +1 -1
  619. package/dist/services/child-conversation-launch.cjs.map +1 -1
  620. package/dist/services/child-conversation-launch.js +11 -5
  621. package/dist/services/child-conversation-launch.js.map +1 -1
  622. package/dist/stores/archived-conversations-store.cjs +2 -0
  623. package/dist/stores/archived-conversations-store.cjs.map +1 -0
  624. package/dist/stores/archived-conversations-store.d.ts +24 -0
  625. package/dist/stores/archived-conversations-store.js +33 -0
  626. package/dist/stores/archived-conversations-store.js.map +1 -0
  627. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  628. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  629. package/dist/stores/conversation-panel-preferences-store.d.ts +3 -0
  630. package/dist/stores/conversation-panel-preferences-store.js +4 -0
  631. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  632. package/dist/stores/conversation-store.cjs.map +1 -1
  633. package/dist/stores/conversation-store.d.ts +1 -1
  634. package/dist/stores/conversation-store.js.map +1 -1
  635. package/dist/stores/metrics-store.cjs +1 -1
  636. package/dist/stores/metrics-store.cjs.map +1 -1
  637. package/dist/stores/metrics-store.d.ts +1 -0
  638. package/dist/stores/metrics-store.js +7 -4
  639. package/dist/stores/metrics-store.js.map +1 -1
  640. package/dist/types/agent-server/core/events/condensation-event.d.ts +3 -0
  641. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +4 -6
  642. package/dist/types/agent-server/type-guards.cjs +1 -1
  643. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  644. package/dist/types/agent-server/type-guards.d.ts +5 -0
  645. package/dist/types/agent-server/type-guards.js +3 -3
  646. package/dist/types/agent-server/type-guards.js.map +1 -1
  647. package/dist/utils/conversation-local-storage.cjs +1 -1
  648. package/dist/utils/conversation-local-storage.cjs.map +1 -1
  649. package/dist/utils/conversation-local-storage.js +2 -1
  650. package/dist/utils/conversation-local-storage.js.map +1 -1
  651. package/dist/utils/format-model-name.cjs +1 -1
  652. package/dist/utils/format-model-name.cjs.map +1 -1
  653. package/dist/utils/format-model-name.d.ts +11 -0
  654. package/dist/utils/format-model-name.js +11 -3
  655. package/dist/utils/format-model-name.js.map +1 -1
  656. package/dist/utils/format-token-count.cjs +2 -0
  657. package/dist/utils/format-token-count.cjs.map +1 -0
  658. package/dist/utils/format-token-count.d.ts +3 -0
  659. package/dist/utils/format-token-count.js +19 -0
  660. package/dist/utils/format-token-count.js.map +1 -0
  661. package/dist/utils/hover-reveal-classes.cjs +2 -0
  662. package/dist/utils/hover-reveal-classes.cjs.map +1 -0
  663. package/dist/utils/hover-reveal-classes.d.ts +34 -0
  664. package/dist/utils/hover-reveal-classes.js +41 -0
  665. package/dist/utils/hover-reveal-classes.js.map +1 -0
  666. package/dist/utils/is-markdown-file-path.cjs +2 -0
  667. package/dist/utils/is-markdown-file-path.cjs.map +1 -0
  668. package/dist/utils/is-markdown-file-path.d.ts +4 -0
  669. package/dist/utils/is-markdown-file-path.js +14 -0
  670. package/dist/utils/is-markdown-file-path.js.map +1 -0
  671. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  672. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  673. package/dist/utils/mcp-marketplace-utils.d.ts +7 -0
  674. package/dist/utils/mcp-marketplace-utils.js +19 -16
  675. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  676. package/dist/utils/transcript-export/index.cjs +3 -3
  677. package/dist/utils/transcript-export/index.cjs.map +1 -1
  678. package/dist/utils/transcript-export/index.js +12 -12
  679. package/dist/utils/transcript-export/index.js.map +1 -1
  680. package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
  681. package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
  682. package/dist/utils/transcript-export/load-complete-events.js +4 -4
  683. package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
  684. package/dist/utils/workspace-relative-path.cjs +2 -0
  685. package/dist/utils/workspace-relative-path.cjs.map +1 -0
  686. package/dist/utils/workspace-relative-path.d.ts +10 -0
  687. package/dist/utils/workspace-relative-path.js +22 -0
  688. package/dist/utils/workspace-relative-path.js.map +1 -0
  689. package/package.json +17 -16
  690. package/scripts/check-sdk-version-sync.mjs +6 -6
  691. package/scripts/dev-process-utils.mjs +6 -1
  692. package/scripts/dev-safe.mjs +57 -2
  693. package/build/assets/active-backend-context-BBvP-bI2.js +0 -2
  694. package/build/assets/agent-profiles-settings-DqoS7RL3.js +0 -1
  695. package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +0 -86
  696. package/build/assets/agent-settings-BJHryp65.js +0 -1
  697. package/build/assets/app-settings-r1RUbgGi.js +0 -1
  698. package/build/assets/backend-form-modal-OroTqnAv.js +0 -1
  699. package/build/assets/bot-DuN83i3p.js +0 -1
  700. package/build/assets/browser--eoQOo4M.js +0 -6
  701. package/build/assets/check-DLOKoFU9.js +0 -1
  702. package/build/assets/chevron-down-CnIbtM6i.js +0 -1
  703. package/build/assets/circle-check-CxCYJrpZ.js +0 -1
  704. package/build/assets/conversation-BUzBZAc-.js +0 -90
  705. package/build/assets/conversation-panel-pzAKsSDb.js +0 -1
  706. package/build/assets/conversation-pzAKsSDb.js +0 -1
  707. package/build/assets/conversation-store-B8Eahyeg.js +0 -6
  708. package/build/assets/external-link-zWbg5KXS.js +0 -1
  709. package/build/assets/files-tab-BzofBmF4.js +0 -1
  710. package/build/assets/git-provider-icon-BLMlwy02.js +0 -1
  711. package/build/assets/git-repo-dropdown-B_PTq4ol.js +0 -1
  712. package/build/assets/home-r89Vj2td.js +0 -1
  713. package/build/assets/index-home-r89Vj2td.js +0 -1
  714. package/build/assets/llm-not-configured-banner-CwKu8C6g.js +0 -27
  715. package/build/assets/llm-settings-BJotLQND.js +0 -1
  716. package/build/assets/llm-settings-CDM-5H2A.js +0 -1
  717. package/build/assets/llm-subscription-service-7eVfDIE1.js +0 -1
  718. package/build/assets/loader-circle-C5AnEN8r.js +0 -1
  719. package/build/assets/manifest-2a36a8f8.js +0 -1
  720. package/build/assets/markdown-renderer-BiiiIznl.js +0 -8
  721. package/build/assets/mcp-marketplace-utils-Dr_HG_ol.js +0 -1
  722. package/build/assets/messages-D1cbVhRK.js +0 -40
  723. package/build/assets/pencil-Bl3GWhgq.js +0 -1
  724. package/build/assets/plus-CtzlyAoF.js +0 -1
  725. package/build/assets/recommended-automations-launcher-BbJAJVED.js +0 -1
  726. package/build/assets/refresh-cw-B9GhC3QC.js +0 -1
  727. package/build/assets/root-BfM_kC_d.css +0 -1
  728. package/build/assets/root-gstBEjty.js +0 -2
  729. package/build/assets/root-layout-BIAFLP9p.js +0 -2
  730. package/build/assets/search-CYaiKHRp.js +0 -1
  731. package/build/assets/shared-conversation-DIxZjElr.js +0 -1
  732. package/build/assets/shield-check-D2cpEpv3.js +0 -1
  733. package/build/assets/trash-2-CzDVN-Iw.js +0 -1
  734. package/build/assets/use-create-conversation-DWaSVUOB.js +0 -1
  735. package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
  736. package/build/assets/use-llm-profiles-CU8ah1pz.js +0 -1
  737. package/build/assets/use-save-agent-profile-DgI_Uz9a.js +0 -1
  738. package/build/assets/utils-DPQfkd-7.js +0 -1
  739. package/build/assets/vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js +0 -13
  740. package/build/assets/x-RYDBg-e2.js +0 -1
  741. package/build/assets/zap-tbKDzCe3.js +0 -1
  742. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs +0 -2
  743. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs.map +0 -1
  744. package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +0 -6
  745. package/dist/components/features/conversation/metrics-modal/context-window-section.js +0 -46
  746. package/dist/components/features/conversation/metrics-modal/context-window-section.js.map +0 -1
  747. package/dist/components/features/conversation/metrics-modal/empty-state.cjs +0 -2
  748. package/dist/components/features/conversation/metrics-modal/empty-state.cjs.map +0 -1
  749. package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +0 -1
  750. package/dist/components/features/conversation/metrics-modal/empty-state.js +0 -18
  751. package/dist/components/features/conversation/metrics-modal/empty-state.js.map +0 -1
  752. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs +0 -2
  753. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs.map +0 -1
  754. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +0 -5
  755. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js +0 -20
  756. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js.map +0 -1
  757. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs +0 -2
  758. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs.map +0 -1
  759. package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +0 -6
  760. package/dist/components/features/conversation/metrics-modal/metrics-modal.js +0 -57
  761. package/dist/components/features/conversation/metrics-modal/metrics-modal.js.map +0 -1
  762. package/dist/icons/u-credit-card.cjs +0 -2
  763. package/dist/icons/u-credit-card.cjs.map +0 -1
  764. package/dist/icons/u-credit-card.js +0 -21
  765. package/dist/icons/u-credit-card.js.map +0 -1
  766. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"model-messages.cjs","names":[],"sources":["../../../../src/components/features/chat/model-messages.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans } from \"react-i18next\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useModelStore } from \"#/stores/model-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport InfoCircleIcon from \"#/icons/info-circle.svg?react\";\nimport type { ProfileInfo } from \"#/api/profiles-service/profiles-service.api\";\nimport { GenericEventMessage } from \"./generic-event-message\";\n\ninterface ProfileRowProps {\n profile: ProfileInfo;\n}\n\nfunction ProfileRow({ profile }: ProfileRowProps) {\n const [expanded, setExpanded] = React.useState(false);\n\n return (\n <div className=\"border border-neutral-700 rounded-md overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n aria-expanded={expanded}\n aria-label={`Toggle details for ${profile.name}`}\n className=\"w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer\"\n >\n <span className=\"text-neutral-300\">\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </span>\n <span className=\"font-normal text-neutral-200 text-sm\">\n {profile.name}\n </span>\n </button>\n {expanded && (\n <>\n <hr className=\"border-neutral-700\" />\n <div className=\"px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap\">\n {`model: ${profile.model ?? \"—\"}\\n` +\n `base_url: ${profile.base_url ?? \"—\"}\\n` +\n // eslint-disable-next-line i18next/no-literal-string -- diagnostic readout; field labels are intentionally untranslated\n `api_key: ${profile.api_key_set ? \"set\" : \"not set\"}`}\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport interface ModelMessagesProps {\n conversationId: string | null | undefined;\n /**\n * Render only entries anchored to this event id. Use `null` to render the\n * \"no events at the time of /model\" entries (top of the chat history).\n */\n anchorEventId: string | null;\n}\n\nexport function ModelMessages({\n conversationId,\n anchorEventId,\n}: ModelMessagesProps) {\n const entriesById = useModelStore((s) => s.entriesByConversation);\n const allEntries = conversationId ? (entriesById[conversationId] ?? []) : [];\n const entries = allEntries.filter((e) => e.anchorEventId === anchorEventId);\n\n if (!conversationId || entries.length === 0) return null;\n\n return (\n <div data-testid=\"model-messages\" className=\"flex flex-col w-full\">\n {entries.map((entry) => {\n if (entry.switchedTo) {\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span className=\"inline-flex items-center gap-1.5\">\n <InfoCircleIcon\n width={14}\n height={14}\n className=\"shrink-0 text-neutral-400\"\n aria-hidden\n />\n <Trans\n i18nKey={I18nKey.MODEL$SWITCHED_TO_PROFILE}\n values={{ name: entry.switchedTo }}\n components={{\n cmd: (\n <span className=\"font-mono text-neutral-200 bg-neutral-800 px-1 rounded\" />\n ),\n }}\n />\n </span>\n }\n details=\"\"\n />\n );\n }\n\n const isEmpty = entry.profiles.length === 0;\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span>\n {isEmpty ? (\n <Trans i18nKey={I18nKey.MODEL$NO_SAVED_PROFILES} />\n ) : (\n <Trans\n i18nKey={I18nKey.MODEL$AVAILABLE_PROFILES}\n values={{ count: entry.profiles.length }}\n />\n )}\n </span>\n }\n details={\n isEmpty ? (\n <span className=\"text-neutral-300 text-sm px-2 py-1 block\">\n <Trans i18nKey={I18nKey.MODEL$NO_PROFILES_HINT} />\n </span>\n ) : (\n <div className=\"flex flex-col gap-1 mt-1\">\n {entry.profiles.map((p) => (\n <ProfileRow key={p.name} profile={p} />\n ))}\n </div>\n )\n }\n initiallyExpanded={isEmpty}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"uhBAaA,SAAS,EAAW,CAAE,WAA4B,CAChD,GAAM,CAAC,EAAU,GAAe,EAAA,QAAM,SAAS,EAAK,EAEpD,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gEAAf,EACE,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,YAAe,EAAa,GAAM,CAAC,CAAC,EACpC,gBAAe,EACf,aAAY,sBAAsB,EAAQ,OAC1C,UAAU,sHALZ,EAOE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4BACb,GAAW,EAAA,EAAA,KAAC,EAAA,YAAD,CAAa,KAAM,EAAK,CAAA,GAAI,EAAA,EAAA,KAAC,EAAA,aAAD,CAAc,KAAM,EAAK,CAAA,CAC7D,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,gDACb,EAAQ,IACL,CAAA,CACA,IACP,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,oBAAsB,CAAA,GACpC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,4EACZ,aAAa,EAAQ,OAAS,IAAI,cACpB,EAAQ,UAAY,IAAI,cAExB,EAAQ,YAAc,MAAQ,WAC1C,CAAA,CACL,CAAA,CAAA,CAED,GAET,CAWA,SAAgB,EAAc,CAC5B,iBACA,iBACqB,CACrB,IAAM,EAAc,EAAA,cAAe,GAAM,EAAE,qBAAqB,EAE1D,GADa,EAAkB,EAAY,IAAmB,CAAC,EAAK,CAAC,GAChD,OAAQ,GAAM,EAAE,gBAAkB,CAAa,EAI1E,MAFI,CAAC,GAAkB,EAAQ,SAAW,EAAU,MAGlD,EAAA,EAAA,KAAC,MAAD,CAAK,cAAY,iBAAiB,UAAU,gCACzC,EAAQ,IAAK,GAAU,CACtB,GAAI,EAAM,WACR,OACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CAEE,OACE,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,4CAAhB,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CACE,MAAO,GACP,OAAQ,GACR,UAAU,4BACV,cAAA,EACD,CAAA,GACD,EAAA,EAAA,KAAC,EAAA,MAAD,CACE,QAAS,EAAA,QAAQ,0BACjB,OAAQ,CAAE,KAAM,EAAM,UAAW,EACjC,WAAY,CACV,KACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,wDAA0D,CAAA,CAE9E,CACD,CAAA,CACG,IAER,QAAQ,EACT,EArBM,EAAM,EAqBZ,EAIL,IAAM,EAAU,EAAM,SAAS,SAAW,EAC1C,OACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CAEE,OACE,EAAA,EAAA,KAAC,OAAD,CAAA,SACG,GACC,EAAA,EAAA,KAAC,EAAA,MAAD,CAAO,QAAS,EAAA,QAAQ,uBAA0B,CAAA,GAElD,EAAA,EAAA,KAAC,EAAA,MAAD,CACE,QAAS,EAAA,QAAQ,yBACjB,OAAQ,CAAE,MAAO,EAAM,SAAS,MAAO,CACxC,CAAA,CAEC,CAAA,EAER,QACE,GACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,qDACd,EAAA,EAAA,KAAC,EAAA,MAAD,CAAO,QAAS,EAAA,QAAQ,sBAAyB,CAAA,CAC7C,CAAA,GAEN,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,oCACZ,EAAM,SAAS,IAAK,IACnB,EAAA,EAAA,KAAC,EAAD,CAAyB,QAAS,CAAI,EAArB,EAAE,IAAmB,CACvC,CACE,CAAA,EAGT,kBAAmB,CACpB,EA3BM,EAAM,EA2BZ,CAEL,CAAC,CACE,CAAA,CAET"}
1
+ {"version":3,"file":"model-messages.cjs","names":[],"sources":["../../../../src/components/features/chat/model-messages.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans } from \"react-i18next\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useModelStore } from \"#/stores/model-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport InfoCircleIcon from \"#/icons/info-circle.svg?react\";\nimport type { ProfileInfo } from \"#/api/profiles-service/profiles-service.api\";\nimport { formatModelNameForDisplay } from \"#/utils/format-model-name\";\nimport { GenericEventMessage } from \"./generic-event-message\";\n\ninterface ProfileRowProps {\n profile: ProfileInfo;\n}\n\nfunction ProfileRow({ profile }: ProfileRowProps) {\n const [expanded, setExpanded] = React.useState(false);\n const displayModel = formatModelNameForDisplay(profile.model);\n\n return (\n <div className=\"border border-neutral-700 rounded-md overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n aria-expanded={expanded}\n aria-label={`Toggle details for ${profile.name}`}\n className=\"w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer\"\n >\n <span className=\"text-neutral-300\">\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </span>\n <span className=\"font-normal text-neutral-200 text-sm\">\n {profile.name}\n </span>\n </button>\n {expanded && (\n <>\n <hr className=\"border-neutral-700\" />\n <div className=\"px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap\">\n {`model: ${displayModel ?? \"—\"}\\n` +\n `base_url: ${profile.base_url ?? \"—\"}\\n` +\n // eslint-disable-next-line i18next/no-literal-string -- diagnostic readout; field labels are intentionally untranslated\n `api_key: ${profile.api_key_set ? \"set\" : \"not set\"}`}\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport interface ModelMessagesProps {\n conversationId: string | null | undefined;\n /**\n * Render only entries anchored to this event id. Use `null` to render the\n * \"no events at the time of /model\" entries (top of the chat history).\n */\n anchorEventId: string | null;\n}\n\nexport function ModelMessages({\n conversationId,\n anchorEventId,\n}: ModelMessagesProps) {\n const entriesById = useModelStore((s) => s.entriesByConversation);\n const allEntries = conversationId ? (entriesById[conversationId] ?? []) : [];\n const entries = allEntries.filter((e) => e.anchorEventId === anchorEventId);\n\n if (!conversationId || entries.length === 0) return null;\n\n return (\n <div data-testid=\"model-messages\" className=\"flex flex-col w-full\">\n {entries.map((entry) => {\n if (entry.switchedTo) {\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span className=\"inline-flex items-center gap-1.5\">\n <InfoCircleIcon\n width={14}\n height={14}\n className=\"shrink-0 text-neutral-400\"\n aria-hidden\n />\n <Trans\n i18nKey={I18nKey.MODEL$SWITCHED_TO_PROFILE}\n values={{ name: entry.switchedTo }}\n components={{\n cmd: (\n <span className=\"font-mono text-neutral-200 bg-neutral-800 px-1 rounded\" />\n ),\n }}\n />\n </span>\n }\n details=\"\"\n />\n );\n }\n\n const isEmpty = entry.profiles.length === 0;\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span>\n {isEmpty ? (\n <Trans i18nKey={I18nKey.MODEL$NO_SAVED_PROFILES} />\n ) : (\n <Trans\n i18nKey={I18nKey.MODEL$AVAILABLE_PROFILES}\n values={{ count: entry.profiles.length }}\n />\n )}\n </span>\n }\n details={\n isEmpty ? (\n <span className=\"text-neutral-300 text-sm px-2 py-1 block\">\n <Trans i18nKey={I18nKey.MODEL$NO_PROFILES_HINT} />\n </span>\n ) : (\n <div className=\"flex flex-col gap-1 mt-1\">\n {entry.profiles.map((p) => (\n <ProfileRow key={p.name} profile={p} />\n ))}\n </div>\n )\n }\n initiallyExpanded={isEmpty}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":"ykBAcA,SAAS,EAAW,CAAE,WAA4B,CAChD,GAAM,CAAC,EAAU,GAAe,EAAA,QAAM,SAAS,EAAK,EAC9C,EAAe,EAAA,0BAA0B,EAAQ,KAAK,EAE5D,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,gEAAf,EACE,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,YAAe,EAAa,GAAM,CAAC,CAAC,EACpC,gBAAe,EACf,aAAY,sBAAsB,EAAQ,OAC1C,UAAU,sHALZ,EAOE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4BACb,GAAW,EAAA,EAAA,KAAC,EAAA,YAAD,CAAa,KAAM,EAAK,CAAA,GAAI,EAAA,EAAA,KAAC,EAAA,aAAD,CAAc,KAAM,EAAK,CAAA,CAC7D,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,gDACb,EAAQ,IACL,CAAA,CACA,IACP,IACC,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,oBAAsB,CAAA,GACpC,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,4EACZ,aAAa,GAAgB,IAAI,cACnB,EAAQ,UAAY,IAAI,cAExB,EAAQ,YAAc,MAAQ,WAC1C,CAAA,CACL,CAAA,CAAA,CAED,GAET,CAWA,SAAgB,EAAc,CAC5B,iBACA,iBACqB,CACrB,IAAM,EAAc,EAAA,cAAe,GAAM,EAAE,qBAAqB,EAE1D,GADa,EAAkB,EAAY,IAAmB,CAAC,EAAK,CAAC,GAChD,OAAQ,GAAM,EAAE,gBAAkB,CAAa,EAI1E,MAFI,CAAC,GAAkB,EAAQ,SAAW,EAAU,MAGlD,EAAA,EAAA,KAAC,MAAD,CAAK,cAAY,iBAAiB,UAAU,gCACzC,EAAQ,IAAK,GAAU,CACtB,GAAI,EAAM,WACR,OACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CAEE,OACE,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,4CAAhB,EACE,EAAA,EAAA,KAAC,EAAA,QAAD,CACE,MAAO,GACP,OAAQ,GACR,UAAU,4BACV,cAAA,EACD,CAAA,GACD,EAAA,EAAA,KAAC,EAAA,MAAD,CACE,QAAS,EAAA,QAAQ,0BACjB,OAAQ,CAAE,KAAM,EAAM,UAAW,EACjC,WAAY,CACV,KACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,wDAA0D,CAAA,CAE9E,CACD,CAAA,CACG,IAER,QAAQ,EACT,EArBM,EAAM,EAqBZ,EAIL,IAAM,EAAU,EAAM,SAAS,SAAW,EAC1C,OACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CAEE,OACE,EAAA,EAAA,KAAC,OAAD,CAAA,SACG,GACC,EAAA,EAAA,KAAC,EAAA,MAAD,CAAO,QAAS,EAAA,QAAQ,uBAA0B,CAAA,GAElD,EAAA,EAAA,KAAC,EAAA,MAAD,CACE,QAAS,EAAA,QAAQ,yBACjB,OAAQ,CAAE,MAAO,EAAM,SAAS,MAAO,CACxC,CAAA,CAEC,CAAA,EAER,QACE,GACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,qDACd,EAAA,EAAA,KAAC,EAAA,MAAD,CAAO,QAAS,EAAA,QAAQ,sBAAyB,CAAA,CAC7C,CAAA,GAEN,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,oCACZ,EAAM,SAAS,IAAK,IACnB,EAAA,EAAA,KAAC,EAAD,CAAyB,QAAS,CAAI,EAArB,EAAE,IAAmB,CACvC,CACE,CAAA,EAGT,kBAAmB,CACpB,EA3BM,EAAM,EA2BZ,CAEL,CAAC,CACE,CAAA,CAET"}
@@ -5,66 +5,67 @@ import { ChevronRight as r } from "../../../node_modules/lucide-react/dist/esm/i
5
5
  import { useModelStore as i } from "../../../stores/model-store.js";
6
6
  import { GenericEventMessage as a } from "./generic-event-message.js";
7
7
  import o from "../../../icons/info-circle.js";
8
- import s from "react";
9
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import { formatModelNameForDisplay as s } from "../../../utils/format-model-name.js";
9
+ import c from "react";
10
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
10
11
  //#region src/components/features/chat/model-messages.tsx
11
- function d({ profile: e }) {
12
- let [t, i] = s.useState(!1);
13
- return /* @__PURE__ */ u("div", {
12
+ function f({ profile: e }) {
13
+ let [t, i] = c.useState(!1), a = s(e.model);
14
+ return /* @__PURE__ */ d("div", {
14
15
  className: "border border-neutral-700 rounded-md overflow-hidden",
15
- children: [/* @__PURE__ */ u("button", {
16
+ children: [/* @__PURE__ */ d("button", {
16
17
  type: "button",
17
18
  onClick: () => i((e) => !e),
18
19
  "aria-expanded": t,
19
20
  "aria-label": `Toggle details for ${e.name}`,
20
21
  className: "w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer",
21
- children: [/* @__PURE__ */ l("span", {
22
+ children: [/* @__PURE__ */ u("span", {
22
23
  className: "text-neutral-300",
23
- children: l(t ? n : r, { size: 14 })
24
- }), /* @__PURE__ */ l("span", {
24
+ children: u(t ? n : r, { size: 14 })
25
+ }), /* @__PURE__ */ u("span", {
25
26
  className: "font-normal text-neutral-200 text-sm",
26
27
  children: e.name
27
28
  })]
28
- }), t && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("hr", { className: "border-neutral-700" }), /* @__PURE__ */ l("div", {
29
+ }), t && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("hr", { className: "border-neutral-700" }), /* @__PURE__ */ u("div", {
29
30
  className: "px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap",
30
- children: `model: ${e.model ?? "—"}\nbase_url: ${e.base_url ?? "—"}\napi_key: ${e.api_key_set ? "set" : "not set"}`
31
+ children: `model: ${a ?? "—"}\nbase_url: ${e.base_url ?? "—"}\napi_key: ${e.api_key_set ? "set" : "not set"}`
31
32
  })] })]
32
33
  });
33
34
  }
34
- function f({ conversationId: n, anchorEventId: r }) {
35
+ function p({ conversationId: n, anchorEventId: r }) {
35
36
  let s = i((e) => e.entriesByConversation), c = (n ? s[n] ?? [] : []).filter((e) => e.anchorEventId === r);
36
- return !n || c.length === 0 ? null : /* @__PURE__ */ l("div", {
37
+ return !n || c.length === 0 ? null : /* @__PURE__ */ u("div", {
37
38
  "data-testid": "model-messages",
38
39
  className: "flex flex-col w-full",
39
40
  children: c.map((n) => {
40
- if (n.switchedTo) return /* @__PURE__ */ l(a, {
41
- title: /* @__PURE__ */ u("span", {
41
+ if (n.switchedTo) return /* @__PURE__ */ u(a, {
42
+ title: /* @__PURE__ */ d("span", {
42
43
  className: "inline-flex items-center gap-1.5",
43
- children: [/* @__PURE__ */ l(o, {
44
+ children: [/* @__PURE__ */ u(o, {
44
45
  width: 14,
45
46
  height: 14,
46
47
  className: "shrink-0 text-neutral-400",
47
48
  "aria-hidden": !0
48
- }), /* @__PURE__ */ l(e, {
49
+ }), /* @__PURE__ */ u(e, {
49
50
  i18nKey: t.MODEL$SWITCHED_TO_PROFILE,
50
51
  values: { name: n.switchedTo },
51
- components: { cmd: /* @__PURE__ */ l("span", { className: "font-mono text-neutral-200 bg-neutral-800 px-1 rounded" }) }
52
+ components: { cmd: /* @__PURE__ */ u("span", { className: "font-mono text-neutral-200 bg-neutral-800 px-1 rounded" }) }
52
53
  })]
53
54
  }),
54
55
  details: ""
55
56
  }, n.id);
56
57
  let r = n.profiles.length === 0;
57
- return /* @__PURE__ */ l(a, {
58
- title: /* @__PURE__ */ l("span", { children: r ? /* @__PURE__ */ l(e, { i18nKey: t.MODEL$NO_SAVED_PROFILES }) : /* @__PURE__ */ l(e, {
58
+ return /* @__PURE__ */ u(a, {
59
+ title: /* @__PURE__ */ u("span", { children: r ? /* @__PURE__ */ u(e, { i18nKey: t.MODEL$NO_SAVED_PROFILES }) : /* @__PURE__ */ u(e, {
59
60
  i18nKey: t.MODEL$AVAILABLE_PROFILES,
60
61
  values: { count: n.profiles.length }
61
62
  }) }),
62
- details: r ? /* @__PURE__ */ l("span", {
63
+ details: r ? /* @__PURE__ */ u("span", {
63
64
  className: "text-neutral-300 text-sm px-2 py-1 block",
64
- children: /* @__PURE__ */ l(e, { i18nKey: t.MODEL$NO_PROFILES_HINT })
65
- }) : /* @__PURE__ */ l("div", {
65
+ children: /* @__PURE__ */ u(e, { i18nKey: t.MODEL$NO_PROFILES_HINT })
66
+ }) : /* @__PURE__ */ u("div", {
66
67
  className: "flex flex-col gap-1 mt-1",
67
- children: n.profiles.map((e) => /* @__PURE__ */ l(d, { profile: e }, e.name))
68
+ children: n.profiles.map((e) => /* @__PURE__ */ u(f, { profile: e }, e.name))
68
69
  }),
69
70
  initiallyExpanded: r
70
71
  }, n.id);
@@ -72,6 +73,6 @@ function f({ conversationId: n, anchorEventId: r }) {
72
73
  });
73
74
  }
74
75
  //#endregion
75
- export { f as ModelMessages };
76
+ export { p as ModelMessages };
76
77
 
77
78
  //# sourceMappingURL=model-messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-messages.js","names":[],"sources":["../../../../src/components/features/chat/model-messages.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans } from \"react-i18next\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useModelStore } from \"#/stores/model-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport InfoCircleIcon from \"#/icons/info-circle.svg?react\";\nimport type { ProfileInfo } from \"#/api/profiles-service/profiles-service.api\";\nimport { GenericEventMessage } from \"./generic-event-message\";\n\ninterface ProfileRowProps {\n profile: ProfileInfo;\n}\n\nfunction ProfileRow({ profile }: ProfileRowProps) {\n const [expanded, setExpanded] = React.useState(false);\n\n return (\n <div className=\"border border-neutral-700 rounded-md overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n aria-expanded={expanded}\n aria-label={`Toggle details for ${profile.name}`}\n className=\"w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer\"\n >\n <span className=\"text-neutral-300\">\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </span>\n <span className=\"font-normal text-neutral-200 text-sm\">\n {profile.name}\n </span>\n </button>\n {expanded && (\n <>\n <hr className=\"border-neutral-700\" />\n <div className=\"px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap\">\n {`model: ${profile.model ?? \"—\"}\\n` +\n `base_url: ${profile.base_url ?? \"—\"}\\n` +\n // eslint-disable-next-line i18next/no-literal-string -- diagnostic readout; field labels are intentionally untranslated\n `api_key: ${profile.api_key_set ? \"set\" : \"not set\"}`}\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport interface ModelMessagesProps {\n conversationId: string | null | undefined;\n /**\n * Render only entries anchored to this event id. Use `null` to render the\n * \"no events at the time of /model\" entries (top of the chat history).\n */\n anchorEventId: string | null;\n}\n\nexport function ModelMessages({\n conversationId,\n anchorEventId,\n}: ModelMessagesProps) {\n const entriesById = useModelStore((s) => s.entriesByConversation);\n const allEntries = conversationId ? (entriesById[conversationId] ?? []) : [];\n const entries = allEntries.filter((e) => e.anchorEventId === anchorEventId);\n\n if (!conversationId || entries.length === 0) return null;\n\n return (\n <div data-testid=\"model-messages\" className=\"flex flex-col w-full\">\n {entries.map((entry) => {\n if (entry.switchedTo) {\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span className=\"inline-flex items-center gap-1.5\">\n <InfoCircleIcon\n width={14}\n height={14}\n className=\"shrink-0 text-neutral-400\"\n aria-hidden\n />\n <Trans\n i18nKey={I18nKey.MODEL$SWITCHED_TO_PROFILE}\n values={{ name: entry.switchedTo }}\n components={{\n cmd: (\n <span className=\"font-mono text-neutral-200 bg-neutral-800 px-1 rounded\" />\n ),\n }}\n />\n </span>\n }\n details=\"\"\n />\n );\n }\n\n const isEmpty = entry.profiles.length === 0;\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span>\n {isEmpty ? (\n <Trans i18nKey={I18nKey.MODEL$NO_SAVED_PROFILES} />\n ) : (\n <Trans\n i18nKey={I18nKey.MODEL$AVAILABLE_PROFILES}\n values={{ count: entry.profiles.length }}\n />\n )}\n </span>\n }\n details={\n isEmpty ? (\n <span className=\"text-neutral-300 text-sm px-2 py-1 block\">\n <Trans i18nKey={I18nKey.MODEL$NO_PROFILES_HINT} />\n </span>\n ) : (\n <div className=\"flex flex-col gap-1 mt-1\">\n {entry.profiles.map((p) => (\n <ProfileRow key={p.name} profile={p} />\n ))}\n </div>\n )\n }\n initiallyExpanded={isEmpty}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAS,EAAW,EAAE,cAA4B;CAChD,IAAM,CAAC,GAAU,KAAe,EAAM,SAAS,EAAK;CAEpD,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,GAAa,MAAM,CAAC,CAAC;GACpC,iBAAe;GACf,cAAY,sBAAsB,EAAQ;GAC1C,WAAU;aALZ,CAOE,kBAAC,QAAD;IAAM,WAAU;cACF,EAAX,IAAY,IAA4B,GAA7B,EAAa,MAAM,GAAK,CAA6B;GAC7D,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;cACb,EAAQ;GACL,CAAA,CACA;MACP,KACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,MAAD,EAAI,WAAU,qBAAsB,CAAA,GACpC,kBAAC,OAAD;GAAK,WAAU;aACZ,aAAa,EAAQ,SAAS,IAAI,cACpB,EAAQ,YAAY,IAAI,cAExB,EAAQ,cAAc,QAAQ;EAC1C,CAAA,CACL,EAAA,CAAA,CAED;;AAET;AAWA,SAAgB,EAAc,EAC5B,mBACA,oBACqB;CACrB,IAAM,IAAc,GAAe,MAAM,EAAE,qBAAqB,GAE1D,KADa,IAAkB,EAAY,MAAmB,CAAC,IAAK,CAAC,GAChD,QAAQ,MAAM,EAAE,kBAAkB,CAAa;CAI1E,OAFI,CAAC,KAAkB,EAAQ,WAAW,IAAU,OAGlD,kBAAC,OAAD;EAAK,eAAY;EAAiB,WAAU;YACzC,EAAQ,KAAK,MAAU;GACtB,IAAI,EAAM,YACR,OACE,kBAAC,GAAD;IAEE,OACE,kBAAC,QAAD;KAAM,WAAU;eAAhB,CACE,kBAAC,GAAD;MACE,OAAO;MACP,QAAQ;MACR,WAAU;MACV,eAAA;KACD,CAAA,GACD,kBAAC,GAAD;MACE,SAAS,EAAQ;MACjB,QAAQ,EAAE,MAAM,EAAM,WAAW;MACjC,YAAY,EACV,KACE,kBAAC,QAAD,EAAM,WAAU,yDAA0D,CAAA,EAE9E;KACD,CAAA,CACG;;IAER,SAAQ;GACT,GArBM,EAAM,EAqBZ;GAIL,IAAM,IAAU,EAAM,SAAS,WAAW;GAC1C,OACE,kBAAC,GAAD;IAEE,OACE,kBAAC,QAAD,EAAA,UACG,IACC,kBAAC,GAAD,EAAO,SAAS,EAAQ,wBAA0B,CAAA,IAElD,kBAAC,GAAD;KACE,SAAS,EAAQ;KACjB,QAAQ,EAAE,OAAO,EAAM,SAAS,OAAO;IACxC,CAAA,EAEC,CAAA;IAER,SACE,IACE,kBAAC,QAAD;KAAM,WAAU;eACd,kBAAC,GAAD,EAAO,SAAS,EAAQ,uBAAyB,CAAA;IAC7C,CAAA,IAEN,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAM,SAAS,KAAK,MACnB,kBAAC,GAAD,EAAyB,SAAS,EAAI,GAArB,EAAE,IAAmB,CACvC;IACE,CAAA;IAGT,mBAAmB;GACpB,GA3BM,EAAM,EA2BZ;EAEL,CAAC;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"model-messages.js","names":[],"sources":["../../../../src/components/features/chat/model-messages.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans } from \"react-i18next\";\nimport { ChevronDown, ChevronRight } from \"lucide-react\";\nimport { useModelStore } from \"#/stores/model-store\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport InfoCircleIcon from \"#/icons/info-circle.svg?react\";\nimport type { ProfileInfo } from \"#/api/profiles-service/profiles-service.api\";\nimport { formatModelNameForDisplay } from \"#/utils/format-model-name\";\nimport { GenericEventMessage } from \"./generic-event-message\";\n\ninterface ProfileRowProps {\n profile: ProfileInfo;\n}\n\nfunction ProfileRow({ profile }: ProfileRowProps) {\n const [expanded, setExpanded] = React.useState(false);\n const displayModel = formatModelNameForDisplay(profile.model);\n\n return (\n <div className=\"border border-neutral-700 rounded-md overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n aria-expanded={expanded}\n aria-label={`Toggle details for ${profile.name}`}\n className=\"w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer\"\n >\n <span className=\"text-neutral-300\">\n {expanded ? <ChevronDown size={14} /> : <ChevronRight size={14} />}\n </span>\n <span className=\"font-normal text-neutral-200 text-sm\">\n {profile.name}\n </span>\n </button>\n {expanded && (\n <>\n <hr className=\"border-neutral-700\" />\n <div className=\"px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap\">\n {`model: ${displayModel ?? \"—\"}\\n` +\n `base_url: ${profile.base_url ?? \"—\"}\\n` +\n // eslint-disable-next-line i18next/no-literal-string -- diagnostic readout; field labels are intentionally untranslated\n `api_key: ${profile.api_key_set ? \"set\" : \"not set\"}`}\n </div>\n </>\n )}\n </div>\n );\n}\n\nexport interface ModelMessagesProps {\n conversationId: string | null | undefined;\n /**\n * Render only entries anchored to this event id. Use `null` to render the\n * \"no events at the time of /model\" entries (top of the chat history).\n */\n anchorEventId: string | null;\n}\n\nexport function ModelMessages({\n conversationId,\n anchorEventId,\n}: ModelMessagesProps) {\n const entriesById = useModelStore((s) => s.entriesByConversation);\n const allEntries = conversationId ? (entriesById[conversationId] ?? []) : [];\n const entries = allEntries.filter((e) => e.anchorEventId === anchorEventId);\n\n if (!conversationId || entries.length === 0) return null;\n\n return (\n <div data-testid=\"model-messages\" className=\"flex flex-col w-full\">\n {entries.map((entry) => {\n if (entry.switchedTo) {\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span className=\"inline-flex items-center gap-1.5\">\n <InfoCircleIcon\n width={14}\n height={14}\n className=\"shrink-0 text-neutral-400\"\n aria-hidden\n />\n <Trans\n i18nKey={I18nKey.MODEL$SWITCHED_TO_PROFILE}\n values={{ name: entry.switchedTo }}\n components={{\n cmd: (\n <span className=\"font-mono text-neutral-200 bg-neutral-800 px-1 rounded\" />\n ),\n }}\n />\n </span>\n }\n details=\"\"\n />\n );\n }\n\n const isEmpty = entry.profiles.length === 0;\n return (\n <GenericEventMessage\n key={entry.id}\n title={\n <span>\n {isEmpty ? (\n <Trans i18nKey={I18nKey.MODEL$NO_SAVED_PROFILES} />\n ) : (\n <Trans\n i18nKey={I18nKey.MODEL$AVAILABLE_PROFILES}\n values={{ count: entry.profiles.length }}\n />\n )}\n </span>\n }\n details={\n isEmpty ? (\n <span className=\"text-neutral-300 text-sm px-2 py-1 block\">\n <Trans i18nKey={I18nKey.MODEL$NO_PROFILES_HINT} />\n </span>\n ) : (\n <div className=\"flex flex-col gap-1 mt-1\">\n {entry.profiles.map((p) => (\n <ProfileRow key={p.name} profile={p} />\n ))}\n </div>\n )\n }\n initiallyExpanded={isEmpty}\n />\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAcA,SAAS,EAAW,EAAE,cAA4B;CAChD,IAAM,CAAC,GAAU,KAAe,EAAM,SAAS,EAAK,GAC9C,IAAe,EAA0B,EAAQ,KAAK;CAE5D,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,GAAa,MAAM,CAAC,CAAC;GACpC,iBAAe;GACf,cAAY,sBAAsB,EAAQ;GAC1C,WAAU;aALZ,CAOE,kBAAC,QAAD;IAAM,WAAU;cACF,EAAX,IAAY,IAA4B,GAA7B,EAAa,MAAM,GAAK,CAA6B;GAC7D,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;cACb,EAAQ;GACL,CAAA,CACA;MACP,KACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,MAAD,EAAI,WAAU,qBAAsB,CAAA,GACpC,kBAAC,OAAD;GAAK,WAAU;aACZ,aAAa,KAAgB,IAAI,cACnB,EAAQ,YAAY,IAAI,cAExB,EAAQ,cAAc,QAAQ;EAC1C,CAAA,CACL,EAAA,CAAA,CAED;;AAET;AAWA,SAAgB,EAAc,EAC5B,mBACA,oBACqB;CACrB,IAAM,IAAc,GAAe,MAAM,EAAE,qBAAqB,GAE1D,KADa,IAAkB,EAAY,MAAmB,CAAC,IAAK,CAAC,GAChD,QAAQ,MAAM,EAAE,kBAAkB,CAAa;CAI1E,OAFI,CAAC,KAAkB,EAAQ,WAAW,IAAU,OAGlD,kBAAC,OAAD;EAAK,eAAY;EAAiB,WAAU;YACzC,EAAQ,KAAK,MAAU;GACtB,IAAI,EAAM,YACR,OACE,kBAAC,GAAD;IAEE,OACE,kBAAC,QAAD;KAAM,WAAU;eAAhB,CACE,kBAAC,GAAD;MACE,OAAO;MACP,QAAQ;MACR,WAAU;MACV,eAAA;KACD,CAAA,GACD,kBAAC,GAAD;MACE,SAAS,EAAQ;MACjB,QAAQ,EAAE,MAAM,EAAM,WAAW;MACjC,YAAY,EACV,KACE,kBAAC,QAAD,EAAM,WAAU,yDAA0D,CAAA,EAE9E;KACD,CAAA,CACG;;IAER,SAAQ;GACT,GArBM,EAAM,EAqBZ;GAIL,IAAM,IAAU,EAAM,SAAS,WAAW;GAC1C,OACE,kBAAC,GAAD;IAEE,OACE,kBAAC,QAAD,EAAA,UACG,IACC,kBAAC,GAAD,EAAO,SAAS,EAAQ,wBAA0B,CAAA,IAElD,kBAAC,GAAD;KACE,SAAS,EAAQ;KACjB,QAAQ,EAAE,OAAO,EAAM,SAAS,OAAO;IACxC,CAAA,EAEC,CAAA;IAER,SACE,IACE,kBAAC,QAAD;KAAM,WAAU;eACd,kBAAC,GAAD,EAAO,SAAS,EAAQ,uBAAyB,CAAA;IAC7C,CAAA,IAEN,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAM,SAAS,KAAK,MACnB,kBAAC,GAAD,EAAyB,SAAS,EAAI,GAArB,EAAE,IAAmB,CACvC;IACE,CAAA;IAGT,mBAAmB;GACpB,GA3BM,EAAM,EA2BZ;EAEL,CAAC;CACE,CAAA;AAET"}
@@ -1,2 +1,2 @@
1
- require("../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../utils/event-logger.cjs");let t=require("react/jsx-runtime");var n=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},r=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,i=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return r(e)&&!n.endsWith(`/`)?`${n}/`:n};function a(r){let{children:a}=r,o=r=>{try{let e=n(r);return(0,t.jsx)(`span`,{className:`font-mono`,title:e,children:i(e)})}catch(n){return e.default.error(String(n)),(0,t.jsx)(`span`,{className:`font-mono`,children:r})}};return Array.isArray(a)?(0,t.jsx)(`strong`,{className:`font-mono`,children:a.map((e,n)=>typeof e==`string`?(0,t.jsx)(`span`,{children:o(e)},`${e}-${n}`):e)}):typeof a==`string`?(0,t.jsx)(`strong`,{children:o(a)}):(0,t.jsx)(`strong`,{className:`font-mono`,children:a})}exports.PathComponent=a;
1
+ require("../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../utils/event-logger.cjs");let t=require("react/jsx-runtime");var n=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},r=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,i=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return r(e)&&!n.endsWith(`/`)?`${n}/`:n};function a(r){let{children:a}=r,o=r=>{try{let e=n(r);return(0,t.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,title:e,children:i(e)})}catch(n){return e.default.error(String(n)),(0,t.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:r})}};return Array.isArray(a)?(0,t.jsx)(`span`,{className:`font-normal tracking-tight`,children:a.map((e,n)=>typeof e==`string`?(0,t.jsx)(`span`,{children:o(e)},`${e}-${n}`):e)}):typeof a==`string`?(0,t.jsx)(`span`,{className:`font-normal tracking-tight`,children:o(a)}):(0,t.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:a})}exports.PathComponent=a;
2
2
  //# sourceMappingURL=path-component.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"path-component.cjs","names":[],"sources":["../../../../src/components/features/chat/path-component.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport EventLogger from \"#/utils/event-logger\";\n\n/**\n * Decodes HTML entities in a string\n * @param text The text to decode\n * @returns The decoded text\n */\nconst decodeHtmlEntities = (text: string): string => {\n const textarea = document.createElement(\"textarea\");\n textarea.innerHTML = text;\n return textarea.value;\n};\n\n/**\n * Checks if a path is likely a directory\n * @param path The full path\n * @returns True if the path is likely a directory\n */\nconst isLikelyDirectory = (path: string): boolean => {\n if (!path) return false;\n // Check if path already ends with a slash\n if (path.endsWith(\"/\") || path.endsWith(\"\\\\\")) return true;\n // Check if path has no extension (simple heuristic)\n const lastPart = path.split(/[/\\\\]/).pop() || \"\";\n // If the last part has no dots, it's likely a directory\n return !lastPart.includes(\".\");\n};\n\n/**\n * Extracts the filename from a path\n * @param path The full path\n * @returns The filename (last part of the path)\n */\nconst extractFilename = (path: string): string => {\n if (!path) return \"\";\n // Handle both Unix and Windows paths\n const parts = path.split(/[/\\\\]/);\n const filename = parts[parts.length - 1];\n\n // Add trailing slash for directories\n if (isLikelyDirectory(path) && !filename.endsWith(\"/\")) {\n return `${filename}/`;\n }\n\n return filename;\n};\n\n/**\n * Component that displays only the filename in the text but shows the full path on hover\n * Similar to MonoComponent but with path-specific functionality\n */\nfunction PathComponent(props: { children?: ReactNode }) {\n const { children } = props;\n\n const processPath = (path: string) => {\n try {\n // First decode any HTML entities in the path\n const decodedPath = decodeHtmlEntities(path);\n // Extract the filename from the decoded path\n const filename = extractFilename(decodedPath);\n return (\n <span className=\"font-mono\" title={decodedPath}>\n {filename}\n </span>\n );\n } catch (e) {\n // Just log the error without any message to avoid localization issues\n EventLogger.error(String(e));\n return <span className=\"font-mono\">{path}</span>;\n }\n };\n\n if (Array.isArray(children)) {\n const processedChildren = children.map((child, index) =>\n typeof child === \"string\" ? (\n <span key={`${child}-${index}`}>{processPath(child)}</span>\n ) : (\n child\n ),\n );\n\n return <strong className=\"font-mono\">{processedChildren}</strong>;\n }\n\n if (typeof children === \"string\") {\n return <strong>{processPath(children)}</strong>;\n }\n\n return <strong className=\"font-mono\">{children}</strong>;\n}\n\nexport { PathComponent, isLikelyDirectory };\n"],"mappings":"yIAQA,IAAM,EAAsB,GAAyB,CACnD,IAAM,EAAW,SAAS,cAAc,UAAU,EAElD,MADA,GAAS,UAAY,EACd,EAAS,KAClB,EAOM,EAAqB,GACpB,EAED,EAAK,SAAS,GAAG,GAAK,EAAK,SAAS,IAAI,EAAU,GAI/C,EAFU,EAAK,MAAM,OAAO,EAAE,IAAI,GAAK,IAE7B,SAAS,GAAG,EANX,GAcd,EAAmB,GAAyB,CAChD,GAAI,CAAC,EAAM,MAAO,GAElB,IAAM,EAAQ,EAAK,MAAM,OAAO,EAC1B,EAAW,EAAM,EAAM,OAAS,GAOtC,OAJI,EAAkB,CAAI,GAAK,CAAC,EAAS,SAAS,GAAG,EAC5C,GAAG,EAAS,GAGd,CACT,EAMA,SAAS,EAAc,EAAiC,CACtD,GAAM,CAAE,YAAa,EAEf,EAAe,GAAiB,CACpC,GAAI,CAEF,IAAM,EAAc,EAAmB,CAAI,EAG3C,OACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,YAAY,MAAO,WAFpB,EAAgB,CAG5B,CACG,CAAA,CAEV,OAAS,EAAG,CAGV,OADA,EAAA,QAAY,MAAM,OAAO,CAAC,CAAC,GACpB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,qBAAa,CAAW,CAAA,CACjD,CACF,EAkBA,OAhBI,MAAM,QAAQ,CAAQ,GASjB,EAAA,EAAA,KAAC,SAAD,CAAQ,UAAU,qBARC,EAAS,KAAK,EAAO,IAC7C,OAAO,GAAU,UACf,EAAA,EAAA,KAAC,OAAD,CAAA,SAAiC,EAAY,CAAK,CAAQ,EAA/C,GAAG,EAAM,GAAG,GAAmC,EAE1D,CAIkC,CAA0B,CAAA,EAG9D,OAAO,GAAa,UACf,EAAA,EAAA,KAAC,SAAD,CAAA,SAAS,EAAY,CAAQ,CAAU,CAAA,GAGzC,EAAA,EAAA,KAAC,SAAD,CAAQ,UAAU,YAAa,UAAiB,CAAA,CACzD"}
1
+ {"version":3,"file":"path-component.cjs","names":[],"sources":["../../../../src/components/features/chat/path-component.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport EventLogger from \"#/utils/event-logger\";\n\n/**\n * Decodes HTML entities in a string\n * @param text The text to decode\n * @returns The decoded text\n */\nconst decodeHtmlEntities = (text: string): string => {\n const textarea = document.createElement(\"textarea\");\n textarea.innerHTML = text;\n return textarea.value;\n};\n\n/**\n * Checks if a path is likely a directory\n * @param path The full path\n * @returns True if the path is likely a directory\n */\nconst isLikelyDirectory = (path: string): boolean => {\n if (!path) return false;\n // Check if path already ends with a slash\n if (path.endsWith(\"/\") || path.endsWith(\"\\\\\")) return true;\n // Check if path has no extension (simple heuristic)\n const lastPart = path.split(/[/\\\\]/).pop() || \"\";\n // If the last part has no dots, it's likely a directory\n return !lastPart.includes(\".\");\n};\n\n/**\n * Extracts the filename from a path\n * @param path The full path\n * @returns The filename (last part of the path)\n */\nconst extractFilename = (path: string): string => {\n if (!path) return \"\";\n // Handle both Unix and Windows paths\n const parts = path.split(/[/\\\\]/);\n const filename = parts[parts.length - 1];\n\n // Add trailing slash for directories\n if (isLikelyDirectory(path) && !filename.endsWith(\"/\")) {\n return `${filename}/`;\n }\n\n return filename;\n};\n\n/**\n * Component that displays only the filename in the text but shows the full path on hover\n * Similar to MonoComponent but with path-specific functionality\n */\nfunction PathComponent(props: { children?: ReactNode }) {\n const { children } = props;\n\n const processPath = (path: string) => {\n try {\n // First decode any HTML entities in the path\n const decodedPath = decodeHtmlEntities(path);\n // Extract the filename from the decoded path\n const filename = extractFilename(decodedPath);\n return (\n <span\n className=\"font-mono font-normal tracking-tight\"\n title={decodedPath}\n >\n {filename}\n </span>\n );\n } catch (e) {\n // Just log the error without any message to avoid localization issues\n EventLogger.error(String(e));\n return (\n <span className=\"font-mono font-normal tracking-tight\">{path}</span>\n );\n }\n };\n\n if (Array.isArray(children)) {\n const processedChildren = children.map((child, index) =>\n typeof child === \"string\" ? (\n <span key={`${child}-${index}`}>{processPath(child)}</span>\n ) : (\n child\n ),\n );\n\n return (\n <span className=\"font-normal tracking-tight\">{processedChildren}</span>\n );\n }\n\n if (typeof children === \"string\") {\n return (\n <span className=\"font-normal tracking-tight\">\n {processPath(children)}\n </span>\n );\n }\n\n return (\n <span className=\"font-mono font-normal tracking-tight\">{children}</span>\n );\n}\n\nexport { PathComponent, isLikelyDirectory };\n"],"mappings":"yIAQA,IAAM,EAAsB,GAAyB,CACnD,IAAM,EAAW,SAAS,cAAc,UAAU,EAElD,MADA,GAAS,UAAY,EACd,EAAS,KAClB,EAOM,EAAqB,GACpB,EAED,EAAK,SAAS,GAAG,GAAK,EAAK,SAAS,IAAI,EAAU,GAI/C,EAFU,EAAK,MAAM,OAAO,EAAE,IAAI,GAAK,IAE7B,SAAS,GAAG,EANX,GAcd,EAAmB,GAAyB,CAChD,GAAI,CAAC,EAAM,MAAO,GAElB,IAAM,EAAQ,EAAK,MAAM,OAAO,EAC1B,EAAW,EAAM,EAAM,OAAS,GAOtC,OAJI,EAAkB,CAAI,GAAK,CAAC,EAAS,SAAS,GAAG,EAC5C,GAAG,EAAS,GAGd,CACT,EAMA,SAAS,EAAc,EAAiC,CACtD,GAAM,CAAE,YAAa,EAEf,EAAe,GAAiB,CACpC,GAAI,CAEF,IAAM,EAAc,EAAmB,CAAI,EAG3C,OACE,EAAA,EAAA,KAAC,OAAD,CACE,UAAU,uCACV,MAAO,WAJM,EAAgB,CAM5B,CACG,CAAA,CAEV,OAAS,EAAG,CAGV,OADA,EAAA,QAAY,MAAM,OAAO,CAAC,CAAC,GAEzB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,gDAAwC,CAAW,CAAA,CAEvE,CACF,EAwBA,OAtBI,MAAM,QAAQ,CAAQ,GAUtB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,sCATQ,EAAS,KAAK,EAAO,IAC7C,OAAO,GAAU,UACf,EAAA,EAAA,KAAC,OAAD,CAAA,SAAiC,EAAY,CAAK,CAAQ,EAA/C,GAAG,EAAM,GAAG,GAAmC,EAE1D,CAK4C,CAAwB,CAAA,EAItE,OAAO,GAAa,UAEpB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,sCACb,EAAY,CAAQ,CACjB,CAAA,GAKR,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,uCAAwC,UAAe,CAAA,CAE3E"}
@@ -14,22 +14,25 @@ function a(r) {
14
14
  try {
15
15
  let e = n(r);
16
16
  return /* @__PURE__ */ t("span", {
17
- className: "font-mono",
17
+ className: "font-mono font-normal tracking-tight",
18
18
  title: e,
19
19
  children: i(e)
20
20
  });
21
21
  } catch (n) {
22
22
  return e.error(String(n)), /* @__PURE__ */ t("span", {
23
- className: "font-mono",
23
+ className: "font-mono font-normal tracking-tight",
24
24
  children: r
25
25
  });
26
26
  }
27
27
  };
28
- return Array.isArray(a) ? /* @__PURE__ */ t("strong", {
29
- className: "font-mono",
28
+ return Array.isArray(a) ? /* @__PURE__ */ t("span", {
29
+ className: "font-normal tracking-tight",
30
30
  children: a.map((e, n) => typeof e == "string" ? /* @__PURE__ */ t("span", { children: o(e) }, `${e}-${n}`) : e)
31
- }) : typeof a == "string" ? /* @__PURE__ */ t("strong", { children: o(a) }) : /* @__PURE__ */ t("strong", {
32
- className: "font-mono",
31
+ }) : typeof a == "string" ? /* @__PURE__ */ t("span", {
32
+ className: "font-normal tracking-tight",
33
+ children: o(a)
34
+ }) : /* @__PURE__ */ t("span", {
35
+ className: "font-mono font-normal tracking-tight",
33
36
  children: a
34
37
  });
35
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"path-component.js","names":[],"sources":["../../../../src/components/features/chat/path-component.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport EventLogger from \"#/utils/event-logger\";\n\n/**\n * Decodes HTML entities in a string\n * @param text The text to decode\n * @returns The decoded text\n */\nconst decodeHtmlEntities = (text: string): string => {\n const textarea = document.createElement(\"textarea\");\n textarea.innerHTML = text;\n return textarea.value;\n};\n\n/**\n * Checks if a path is likely a directory\n * @param path The full path\n * @returns True if the path is likely a directory\n */\nconst isLikelyDirectory = (path: string): boolean => {\n if (!path) return false;\n // Check if path already ends with a slash\n if (path.endsWith(\"/\") || path.endsWith(\"\\\\\")) return true;\n // Check if path has no extension (simple heuristic)\n const lastPart = path.split(/[/\\\\]/).pop() || \"\";\n // If the last part has no dots, it's likely a directory\n return !lastPart.includes(\".\");\n};\n\n/**\n * Extracts the filename from a path\n * @param path The full path\n * @returns The filename (last part of the path)\n */\nconst extractFilename = (path: string): string => {\n if (!path) return \"\";\n // Handle both Unix and Windows paths\n const parts = path.split(/[/\\\\]/);\n const filename = parts[parts.length - 1];\n\n // Add trailing slash for directories\n if (isLikelyDirectory(path) && !filename.endsWith(\"/\")) {\n return `${filename}/`;\n }\n\n return filename;\n};\n\n/**\n * Component that displays only the filename in the text but shows the full path on hover\n * Similar to MonoComponent but with path-specific functionality\n */\nfunction PathComponent(props: { children?: ReactNode }) {\n const { children } = props;\n\n const processPath = (path: string) => {\n try {\n // First decode any HTML entities in the path\n const decodedPath = decodeHtmlEntities(path);\n // Extract the filename from the decoded path\n const filename = extractFilename(decodedPath);\n return (\n <span className=\"font-mono\" title={decodedPath}>\n {filename}\n </span>\n );\n } catch (e) {\n // Just log the error without any message to avoid localization issues\n EventLogger.error(String(e));\n return <span className=\"font-mono\">{path}</span>;\n }\n };\n\n if (Array.isArray(children)) {\n const processedChildren = children.map((child, index) =>\n typeof child === \"string\" ? (\n <span key={`${child}-${index}`}>{processPath(child)}</span>\n ) : (\n child\n ),\n );\n\n return <strong className=\"font-mono\">{processedChildren}</strong>;\n }\n\n if (typeof children === \"string\") {\n return <strong>{processPath(children)}</strong>;\n }\n\n return <strong className=\"font-mono\">{children}</strong>;\n}\n\nexport { PathComponent, isLikelyDirectory };\n"],"mappings":";;;AAQA,IAAM,KAAsB,MAAyB;CACnD,IAAM,IAAW,SAAS,cAAc,UAAU;CAElD,OADA,EAAS,YAAY,GACd,EAAS;AAClB,GAOM,KAAqB,MACpB,IAED,EAAK,SAAS,GAAG,KAAK,EAAK,SAAS,IAAI,IAAU,KAI/C,EAFU,EAAK,MAAM,OAAO,EAAE,IAAI,KAAK,IAE7B,SAAS,GAAG,IANX,IAcd,KAAmB,MAAyB;CAChD,IAAI,CAAC,GAAM,OAAO;CAElB,IAAM,IAAQ,EAAK,MAAM,OAAO,GAC1B,IAAW,EAAM,EAAM,SAAS;CAOtC,OAJI,EAAkB,CAAI,KAAK,CAAC,EAAS,SAAS,GAAG,IAC5C,GAAG,EAAS,KAGd;AACT;AAMA,SAAS,EAAc,GAAiC;CACtD,IAAM,EAAE,gBAAa,GAEf,KAAe,MAAiB;EACpC,IAAI;GAEF,IAAM,IAAc,EAAmB,CAAI;GAG3C,OACE,kBAAC,QAAD;IAAM,WAAU;IAAY,OAAO;cAFpB,EAAgB,CAG5B;GACG,CAAA;EAEV,SAAS,GAAG;GAGV,OADA,EAAY,MAAM,OAAO,CAAC,CAAC,GACpB,kBAAC,QAAD;IAAM,WAAU;cAAa;GAAW,CAAA;EACjD;CACF;CAkBA,OAhBI,MAAM,QAAQ,CAAQ,IASjB,kBAAC,UAAD;EAAQ,WAAU;YARC,EAAS,KAAK,GAAO,MAC7C,OAAO,KAAU,WACf,kBAAC,QAAD,EAAA,UAAiC,EAAY,CAAK,EAAQ,GAA/C,GAAG,EAAM,GAAG,GAAmC,IAE1D,CAIkC;CAA0B,CAAA,IAG9D,OAAO,KAAa,WACf,kBAAC,UAAD,EAAA,UAAS,EAAY,CAAQ,EAAU,CAAA,IAGzC,kBAAC,UAAD;EAAQ,WAAU;EAAa;CAAiB,CAAA;AACzD"}
1
+ {"version":3,"file":"path-component.js","names":[],"sources":["../../../../src/components/features/chat/path-component.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport EventLogger from \"#/utils/event-logger\";\n\n/**\n * Decodes HTML entities in a string\n * @param text The text to decode\n * @returns The decoded text\n */\nconst decodeHtmlEntities = (text: string): string => {\n const textarea = document.createElement(\"textarea\");\n textarea.innerHTML = text;\n return textarea.value;\n};\n\n/**\n * Checks if a path is likely a directory\n * @param path The full path\n * @returns True if the path is likely a directory\n */\nconst isLikelyDirectory = (path: string): boolean => {\n if (!path) return false;\n // Check if path already ends with a slash\n if (path.endsWith(\"/\") || path.endsWith(\"\\\\\")) return true;\n // Check if path has no extension (simple heuristic)\n const lastPart = path.split(/[/\\\\]/).pop() || \"\";\n // If the last part has no dots, it's likely a directory\n return !lastPart.includes(\".\");\n};\n\n/**\n * Extracts the filename from a path\n * @param path The full path\n * @returns The filename (last part of the path)\n */\nconst extractFilename = (path: string): string => {\n if (!path) return \"\";\n // Handle both Unix and Windows paths\n const parts = path.split(/[/\\\\]/);\n const filename = parts[parts.length - 1];\n\n // Add trailing slash for directories\n if (isLikelyDirectory(path) && !filename.endsWith(\"/\")) {\n return `${filename}/`;\n }\n\n return filename;\n};\n\n/**\n * Component that displays only the filename in the text but shows the full path on hover\n * Similar to MonoComponent but with path-specific functionality\n */\nfunction PathComponent(props: { children?: ReactNode }) {\n const { children } = props;\n\n const processPath = (path: string) => {\n try {\n // First decode any HTML entities in the path\n const decodedPath = decodeHtmlEntities(path);\n // Extract the filename from the decoded path\n const filename = extractFilename(decodedPath);\n return (\n <span\n className=\"font-mono font-normal tracking-tight\"\n title={decodedPath}\n >\n {filename}\n </span>\n );\n } catch (e) {\n // Just log the error without any message to avoid localization issues\n EventLogger.error(String(e));\n return (\n <span className=\"font-mono font-normal tracking-tight\">{path}</span>\n );\n }\n };\n\n if (Array.isArray(children)) {\n const processedChildren = children.map((child, index) =>\n typeof child === \"string\" ? (\n <span key={`${child}-${index}`}>{processPath(child)}</span>\n ) : (\n child\n ),\n );\n\n return (\n <span className=\"font-normal tracking-tight\">{processedChildren}</span>\n );\n }\n\n if (typeof children === \"string\") {\n return (\n <span className=\"font-normal tracking-tight\">\n {processPath(children)}\n </span>\n );\n }\n\n return (\n <span className=\"font-mono font-normal tracking-tight\">{children}</span>\n );\n}\n\nexport { PathComponent, isLikelyDirectory };\n"],"mappings":";;;AAQA,IAAM,KAAsB,MAAyB;CACnD,IAAM,IAAW,SAAS,cAAc,UAAU;CAElD,OADA,EAAS,YAAY,GACd,EAAS;AAClB,GAOM,KAAqB,MACpB,IAED,EAAK,SAAS,GAAG,KAAK,EAAK,SAAS,IAAI,IAAU,KAI/C,EAFU,EAAK,MAAM,OAAO,EAAE,IAAI,KAAK,IAE7B,SAAS,GAAG,IANX,IAcd,KAAmB,MAAyB;CAChD,IAAI,CAAC,GAAM,OAAO;CAElB,IAAM,IAAQ,EAAK,MAAM,OAAO,GAC1B,IAAW,EAAM,EAAM,SAAS;CAOtC,OAJI,EAAkB,CAAI,KAAK,CAAC,EAAS,SAAS,GAAG,IAC5C,GAAG,EAAS,KAGd;AACT;AAMA,SAAS,EAAc,GAAiC;CACtD,IAAM,EAAE,gBAAa,GAEf,KAAe,MAAiB;EACpC,IAAI;GAEF,IAAM,IAAc,EAAmB,CAAI;GAG3C,OACE,kBAAC,QAAD;IACE,WAAU;IACV,OAAO;cAJM,EAAgB,CAM5B;GACG,CAAA;EAEV,SAAS,GAAG;GAGV,OADA,EAAY,MAAM,OAAO,CAAC,CAAC,GAEzB,kBAAC,QAAD;IAAM,WAAU;cAAwC;GAAW,CAAA;EAEvE;CACF;CAwBA,OAtBI,MAAM,QAAQ,CAAQ,IAUtB,kBAAC,QAAD;EAAM,WAAU;YATQ,EAAS,KAAK,GAAO,MAC7C,OAAO,KAAU,WACf,kBAAC,QAAD,EAAA,UAAiC,EAAY,CAAK,EAAQ,GAA/C,GAAG,EAAM,GAAG,GAAmC,IAE1D,CAK4C;CAAwB,CAAA,IAItE,OAAO,KAAa,WAEpB,kBAAC,QAAD;EAAM,WAAU;YACb,EAAY,CAAQ;CACjB,CAAA,IAKR,kBAAC,QAAD;EAAM,WAAU;EAAwC;CAAe,CAAA;AAE3E"}
@@ -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("../../../node_modules/lucide-react/dist/esm/icons/arrow-up-right.cjs"),r=require("../../../utils/utils.cjs"),i=require("../markdown/markdown-renderer.cjs"),a=require("../../../ui/typography.cjs"),o=require("../../../icons/lesson-plan.cjs"),s=require("../../../context/scroll-context.cjs"),c=require("../../../hooks/use-handle-build-plan-click.cjs"),l=require("../../../hooks/use-select-conversation-tab.cjs"),u=require("../markdown/plan-components.cjs");let d=require("react"),f=require("react/jsx-runtime");var p=300,m=u.createPlanComponents(`shine-text`);function h({planContent:h,isStreaming:g,isBuildDisabled:_}){let{t:v}=e.useTranslation(`openhands`),{navigateToTab:y}=l.useSelectConversationTab(),{handleBuildPlanClick:b}=c.useHandleBuildPlanClick(),{scrollDomToBottom:x}=s.useScrollContext(),S=()=>{y(`planner`)},C=(0,d.useCallback)(e=>{b(e),x()},[b,x]),w=(0,d.useMemo)(()=>h?h.length<=p?h:`${h.slice(0,p)}...`:``,[h]);return h?(0,f.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,f.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,f.jsx)(o.default,{width:18,height:18,color:`var(--oh-muted)`}),(0,f.jsx)(a.Typography.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:v(t.I18nKey.COMMON$PLAN_MD)}),(0,f.jsx)(`div`,{className:`flex-1`}),(0,f.jsxs)(`button`,{type:`button`,onClick:S,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,f.jsx)(a.Typography.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:v(t.I18nKey.COMMON$VIEW)}),(0,f.jsx)(n.ArrowUpRight,{className:`text-white`,size:18})]})]}),(0,f.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:w&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(i.MarkdownRenderer,{includeStandard:!0,components:g?m:u.planComponents,children:w}),h&&h.length>p&&(0,f.jsx)(`button`,{type:`button`,onClick:S,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:v(t.I18nKey.COMMON$READ_MORE)})]})}),(0,f.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,f.jsx)(`button`,{type:`button`,onClick:C,disabled:_,className:r.cn(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,_?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,f.jsxs)(a.Typography.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[v(t.I18nKey.COMMON$BUILD),` `,(0,f.jsx)(a.Typography.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}exports.PlanPreview=h;
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("../../../utils/utils.cjs"),i=require("../markdown/markdown-renderer.cjs"),a=require("../../../ui/typography.cjs"),o=require("../../../icons/lesson-plan.cjs"),s=require("../../../hooks/use-select-conversation-tab.cjs"),c=require("../../../context/scroll-context.cjs"),l=require("../../../hooks/use-handle-build-plan-click.cjs"),u=require("../markdown/plan-components.cjs");let d=require("react"),f=require("react/jsx-runtime");var p=300,m=u.createPlanComponents(`shine-text`);function h({planContent:h,isStreaming:g,isBuildDisabled:_}){let{t:v}=e.useTranslation(`openhands`),{navigateToTab:y}=s.useSelectConversationTab(),{handleBuildPlanClick:b}=l.useHandleBuildPlanClick(),{scrollDomToBottom:x}=c.useScrollContext(),S=()=>{y(`planner`)},C=(0,d.useCallback)(e=>{b(e),x()},[b,x]),w=(0,d.useMemo)(()=>h?h.length<=p?h:`${h.slice(0,p)}...`:``,[h]);return h?(0,f.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,f.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,f.jsx)(o.default,{width:18,height:18,color:`var(--oh-muted)`}),(0,f.jsx)(a.Typography.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:v(t.I18nKey.COMMON$PLAN_MD)}),(0,f.jsx)(`div`,{className:`flex-1`}),(0,f.jsxs)(`button`,{type:`button`,onClick:S,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,f.jsx)(a.Typography.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:v(t.I18nKey.COMMON$VIEW)}),(0,f.jsx)(n.ArrowUpRight,{className:`text-white`,size:18})]})]}),(0,f.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:w&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(i.MarkdownRenderer,{includeStandard:!0,components:g?m:u.planComponents,children:w}),h&&h.length>p&&(0,f.jsx)(`button`,{type:`button`,onClick:S,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:v(t.I18nKey.COMMON$READ_MORE)})]})}),(0,f.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,f.jsx)(`button`,{type:`button`,onClick:C,disabled:_,className:r.cn(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,_?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,f.jsxs)(a.Typography.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[v(t.I18nKey.COMMON$BUILD),` `,(0,f.jsx)(a.Typography.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}exports.PlanPreview=h;
2
2
  //# sourceMappingURL=plan-preview.cjs.map
@@ -5,16 +5,16 @@ import { cn as r } from "../../../utils/utils.js";
5
5
  import { MarkdownRenderer as i } from "../markdown/markdown-renderer.js";
6
6
  import { Typography as a } from "../../../ui/typography.js";
7
7
  import o from "../../../icons/lesson-plan.js";
8
- import { useScrollContext as s } from "../../../context/scroll-context.js";
9
- import { useHandleBuildPlanClick as c } from "../../../hooks/use-handle-build-plan-click.js";
10
- import { useSelectConversationTab as l } from "../../../hooks/use-select-conversation-tab.js";
8
+ import { useSelectConversationTab as s } from "../../../hooks/use-select-conversation-tab.js";
9
+ import { useScrollContext as c } from "../../../context/scroll-context.js";
10
+ import { useHandleBuildPlanClick as l } from "../../../hooks/use-handle-build-plan-click.js";
11
11
  import { createPlanComponents as u, planComponents as d } from "../markdown/plan-components.js";
12
12
  import { useCallback as f, useMemo as p } from "react";
13
13
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
14
14
  //#region src/components/features/chat/plan-preview.tsx
15
15
  var _ = 300, v = u("shine-text");
16
16
  function y({ planContent: u, isStreaming: y, isBuildDisabled: b }) {
17
- let { t: x } = e("openhands"), { navigateToTab: S } = l(), { handleBuildPlanClick: C } = c(), { scrollDomToBottom: w } = s(), T = () => {
17
+ let { t: x } = e("openhands"), { navigateToTab: S } = s(), { handleBuildPlanClick: C } = l(), { scrollDomToBottom: w } = c(), T = () => {
18
18
  S("planner");
19
19
  }, E = f((e) => {
20
20
  C(e), w();
@@ -1,2 +1,2 @@
1
- const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("../define.cjs"),n=require("../text-content.cjs"),r=require("../primitives/code-block.cjs"),i=require("../../../../../utils/get-language-from-path.cjs"),a=require("../primitives/diff-view.cjs"),o=require("../primitives/file-path-chip.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=t.defineVisualizer({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function({action:e,observation:t}){let s=t?.observation.path??e?.action.path??``,l=t?.observation.command??e?.action.command,u=i.getLanguageFromPath(s),d=e?.action.view_range,f=l===`view`&&d?`${d[0]}-${d[1]}`:void 0,p=s?(0,c.jsx)(o.FilePathChip,{path:s,range:f}):null;if(t){let e=t.observation,i=null;if(e.error)i=(0,c.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:e.error});else if(e.old_content!=null&&e.new_content!=null)i=(0,c.jsx)(a.DiffView,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?n.textFromContent(e.content):``);i=t?(0,c.jsx)(r.CodeBlock,{code:t,language:u}):null}return(0,c.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[p,i]})}if(e){let t=e.action,n=null;return t.command===`create`&&t.file_text?n=(0,c.jsx)(r.CodeBlock,{code:t.file_text,language:u}):(t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,c.jsx)(a.DiffView,{oldText:t.old_str??``,newText:t.new_str})),(0,c.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[p,n]})}return null}});exports.fileEditorVisualizer=l;
1
+ const e=require("../../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../../../hooks/use-conversation-id.cjs"),n=require("../../../../../stores/files-tab-store.cjs"),r=require("../../../../../hooks/query/use-active-conversation.cjs"),i=require("../../../../../hooks/use-select-conversation-tab.cjs"),a=require("../define.cjs"),o=require("../text-content.cjs"),s=require("../primitives/code-block.cjs"),c=require("../../../../../utils/get-language-from-path.cjs"),l=require("../../../../../utils/workspace-relative-path.cjs"),u=require("../primitives/diff-view.cjs"),d=require("../primitives/file-path-chip.cjs"),f=require("../../../../../utils/is-markdown-file-path.cjs"),p=require("../primitives/markdown-file-preview.cjs");let m=require("react");m=e.__toESM(m,1);let h=require("react/jsx-runtime");var g=({action:e,observation:t})=>t?.observation.path??e?.action.path??``;function _({action:e,observation:t,onOpenFile:n}){let r=g({action:e,observation:t}),i=t?.observation.command??e?.action.command,a=c.getLanguageFromPath(r),l=e?.action.view_range,m=i===`view`&&l?`${l[0]}-${l[1]}`:void 0,_=r?(0,h.jsx)(d.FilePathChip,{path:r,range:m,onClick:n}):null,v=e=>r&&i===`create`&&f.isMarkdownFilePath(r)?{chip:null,body:(0,h.jsx)(p.MarkdownFilePreview,{content:e,path:r,onView:n})}:{chip:_,body:(0,h.jsx)(s.CodeBlock,{code:e,language:a})};if(t){let e=t.observation,n=null,r=_;if(e.error)n=(0,h.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:e.error});else if(e.old_content!=null&&e.new_content!=null)n=(0,h.jsx)(u.DiffView,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?o.textFromContent(e.content):``);if(t){let e=v(t);r=e.chip,n=e.body}}return(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}if(e){let t=e.action,n=null,r=_;if(t.command===`create`&&t.file_text){let e=v(t.file_text);r=e.chip,n=e.body}else (t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,h.jsx)(u.DiffView,{oldText:t.old_str??``,newText:t.new_str}));return(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}return null}function v({conversationId:e,...t}){let{navigateToTab:a}=i.useSelectConversationTab(),o=n.useFilesTabStore(e=>e.setSelectedPath),{data:s}=r.useActiveConversation(),c=g(t),u=s?.workspace?.working_dir,d=c&&t.observation?()=>{o(l.toWorkspaceRelativePath(c,u),e),a(`files`)}:void 0;return(0,h.jsx)(_,{...t,onOpenFile:d})}var y=a.defineVisualizer({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function(e){let{conversationId:n}=t.useOptionalConversationId();return n?(0,h.jsx)(v,{...e,conversationId:n}):(0,h.jsx)(_,{...e})}});exports.fileEditorVisualizer=y;
2
2
  //# sourceMappingURL=file-editor.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-editor.cjs","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/file-editor/file-editor.tsx"],"sourcesContent":["import React from \"react\";\nimport { getLanguageFromPath } from \"#/utils/get-language-from-path\";\nimport { defineVisualizer } from \"../define\";\nimport { textFromContent } from \"../text-content\";\nimport { CodeBlock } from \"../primitives/code-block\";\nimport { DiffView } from \"../primitives/diff-view\";\nimport { FilePathChip } from \"../primitives/file-path-chip\";\n\n/**\n * File-editor visualizer for `file_editor` / `str_replace_editor` tools.\n *\n * Observation card: error → message; `str_replace`/`insert` diff of the file\n * before vs after; `create`/`view` the file content. Action card (shown while\n * the edit is in flight): `create` new content; `str_replace` diff of the\n * replaced snippet; `view`/`undo_edit` just the path + range.\n */\nexport const fileEditorVisualizer = defineVisualizer({\n actionKinds: [\"FileEditorAction\", \"StrReplaceEditorAction\"],\n observationKinds: [\"FileEditorObservation\", \"StrReplaceEditorObservation\"],\n Body: function FileEditorBody({ action, observation }) {\n const path = observation?.observation.path ?? action?.action.path ?? \"\";\n const command = observation?.observation.command ?? action?.action.command;\n const language = getLanguageFromPath(path);\n\n const viewRange = action?.action.view_range;\n const range =\n command === \"view\" && viewRange\n ? `${viewRange[0]}-${viewRange[1]}`\n : undefined;\n const chip = path ? <FilePathChip path={path} range={range} /> : null;\n\n if (observation) {\n const obs = observation.observation;\n let body: React.ReactNode = null;\n if (obs.error) {\n body = (\n <span className=\"whitespace-pre-wrap text-xs text-danger\">\n {obs.error}\n </span>\n );\n } else if (obs.old_content != null && obs.new_content != null) {\n // Nullish, not truthy: an empty string is a valid side of the diff —\n // clearing a file or inserting into an empty file must still render it.\n body = <DiffView oldText={obs.old_content} newText={obs.new_content} />;\n } else {\n // `view` returns the snippet the agent saw in `content` (the `cat -n`\n // output) rather than `output`/`new_content`, so fall back to it.\n // Mirrors the markdown path's \"prefer content for view\" handling.\n const content =\n obs.new_content ||\n obs.output ||\n (obs.content ? textFromContent(obs.content) : \"\");\n body = content ? (\n <CodeBlock code={content} language={language} />\n ) : null;\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {chip}\n {body}\n </div>\n );\n }\n\n if (action) {\n const act = action.action;\n let body: React.ReactNode = null;\n if (act.command === \"create\" && act.file_text) {\n body = <CodeBlock code={act.file_text} language={language} />;\n } else if (\n (act.command === \"str_replace\" || act.command === \"insert\") &&\n act.new_str != null\n ) {\n // `insert` carries only `new_str`, no `old_str`. Key on `new_str` and\n // default `old_str` to \"\" so an in-flight insert shows an addition diff\n // instead of nothing.\n body = <DiffView oldText={act.old_str ?? \"\"} newText={act.new_str} />;\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {chip}\n {body}\n </div>\n );\n }\n\n return null;\n },\n});\n"],"mappings":"sYAgBA,IAAa,EAAuB,EAAA,iBAAiB,CACnD,YAAa,CAAC,mBAAoB,wBAAwB,EAC1D,iBAAkB,CAAC,wBAAyB,6BAA6B,EACzE,KAAM,SAAwB,CAAE,SAAQ,eAAe,CACrD,IAAM,EAAO,GAAa,YAAY,MAAQ,GAAQ,OAAO,MAAQ,GAC/D,EAAU,GAAa,YAAY,SAAW,GAAQ,OAAO,QAC7D,EAAW,EAAA,oBAAoB,CAAI,EAEnC,EAAY,GAAQ,OAAO,WAC3B,EACJ,IAAY,QAAU,EAClB,GAAG,EAAU,GAAG,GAAG,EAAU,KAC7B,IAAA,GACA,EAAO,GAAO,EAAA,EAAA,KAAC,EAAA,aAAD,CAAoB,OAAa,OAAQ,CAAA,EAAI,KAEjE,GAAI,EAAa,CACf,IAAM,EAAM,EAAY,YACpB,EAAwB,KAC5B,GAAI,EAAI,MACN,GACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mDACb,EAAI,KACD,CAAA,OAEH,GAAI,EAAI,aAAe,MAAQ,EAAI,aAAe,KAGvD,GAAO,EAAA,EAAA,KAAC,EAAA,SAAD,CAAU,QAAS,EAAI,YAAa,QAAS,EAAI,WAAc,CAAA,MACjE,CAIL,IAAM,EACJ,EAAI,aACJ,EAAI,SACH,EAAI,QAAU,EAAA,gBAAgB,EAAI,OAAO,EAAI,IAChD,EAAO,GACL,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,KAAM,EAAmB,UAAW,CAAA,EAC7C,IACN,CACA,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,CACG,EACA,CACE,GAET,CAEA,GAAI,EAAQ,CACV,IAAM,EAAM,EAAO,OACf,EAAwB,KAY5B,OAXI,EAAI,UAAY,UAAY,EAAI,UAClC,GAAO,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,KAAM,EAAI,UAAqB,UAAW,CAAA,GAE3D,EAAI,UAAY,eAAiB,EAAI,UAAY,WAClD,EAAI,SAAW,OAKf,GAAO,EAAA,EAAA,KAAC,EAAA,SAAD,CAAU,QAAS,EAAI,SAAW,GAAI,QAAS,EAAI,OAAU,CAAA,IAGpE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,CACG,EACA,CACE,GAET,CAEA,OAAO,IACT,CACF,CAAC"}
1
+ {"version":3,"file":"file-editor.cjs","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/file-editor/file-editor.tsx"],"sourcesContent":["/**\n * File-editor visualizer for `file_editor` / `str_replace_editor` tools.\n *\n * Observation card: error → message; `str_replace`/`insert` → diff of the file\n * before vs after; `create`/`view` → the file content. Action card (shown while\n * the edit is in flight): `create` → new content; `str_replace` → diff of the\n * replaced snippet; `view`/`undo_edit` → just the path + range.\n *\n * Created Markdown artifacts get a height-clipped rich preview with a View bar\n * that opens the Files drawer, instead of dumping the full source into a code\n * block. Reads/edits of `.md` files keep the normal CodeBlock / DiffView path.\n */\nimport React from \"react\";\nimport { getLanguageFromPath } from \"#/utils/get-language-from-path\";\nimport { toWorkspaceRelativePath } from \"#/utils/workspace-relative-path\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useSelectConversationTab } from \"#/hooks/use-select-conversation-tab\";\nimport { useFilesTabStore } from \"#/stores/files-tab-store\";\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\";\nimport { defineVisualizer, VisualizerProps } from \"../define\";\nimport { textFromContent } from \"../text-content\";\nimport { CodeBlock } from \"../primitives/code-block\";\nimport { DiffView } from \"../primitives/diff-view\";\nimport { FilePathChip } from \"../primitives/file-path-chip\";\nimport {\n isMarkdownFilePath,\n MarkdownFilePreview,\n} from \"../primitives/markdown-file-preview\";\n\ntype FileEditorCardProps = VisualizerProps<\n FileEditorAction | StrReplaceEditorAction,\n FileEditorObservation | StrReplaceEditorObservation\n>;\n\n/** The path the event touched; observations win because they are authoritative. */\nconst resolvePath = ({ action, observation }: FileEditorCardProps): string =>\n observation?.observation.path ?? action?.action.path ?? \"\";\n\ninterface FileEditorCardBodyProps extends FileEditorCardProps {\n /**\n * Deep-links the file into the Files drawer. Absent outside a conversation\n * route, where there is no drawer to open; the card then stays read-only.\n * Also omitted for in-flight creates so View does not open a missing file.\n */\n onOpenFile?: () => void;\n}\n\nfunction FileEditorCardBody({\n action,\n observation,\n onOpenFile,\n}: FileEditorCardBodyProps) {\n const path = resolvePath({ action, observation });\n const command = observation?.observation.command ?? action?.action.command;\n const language = getLanguageFromPath(path);\n\n const viewRange = action?.action.view_range;\n const range =\n command === \"view\" && viewRange\n ? `${viewRange[0]}-${viewRange[1]}`\n : undefined;\n const chip = path ? (\n <FilePathChip path={path} range={range} onClick={onOpenFile} />\n ) : null;\n\n const renderFileContent = (content: string) => {\n // Only created Markdown artifacts get the rich preview — `view` returns\n // `cat -n` numbered snippets that must stay in a CodeBlock.\n if (path && command === \"create\" && isMarkdownFilePath(path)) {\n // Markdown artifacts own their card (clipped preview + optional View),\n // so skip the separate path chip to avoid a duplicate filename affordance.\n return {\n chip: null as React.ReactNode,\n body: (\n <MarkdownFilePreview\n content={content}\n path={path}\n onView={onOpenFile}\n />\n ),\n };\n }\n return {\n chip,\n body: <CodeBlock code={content} language={language} />,\n };\n };\n\n if (observation) {\n const obs = observation.observation;\n let body: React.ReactNode = null;\n let leadingChip: React.ReactNode = chip;\n if (obs.error) {\n body = (\n <span className=\"whitespace-pre-wrap text-xs text-danger\">\n {obs.error}\n </span>\n );\n } else if (obs.old_content != null && obs.new_content != null) {\n // Nullish, not truthy: an empty string is a valid side of the diff —\n // clearing a file or inserting into an empty file must still render it.\n body = <DiffView oldText={obs.old_content} newText={obs.new_content} />;\n } else {\n // `view` returns the snippet the agent saw in `content` (the `cat -n`\n // output) rather than `output`/`new_content`, so fall back to it.\n // Mirrors the markdown path's \"prefer content for view\" handling.\n const content =\n obs.new_content ||\n obs.output ||\n (obs.content ? textFromContent(obs.content) : \"\");\n if (content) {\n const rendered = renderFileContent(content);\n leadingChip = rendered.chip;\n body = rendered.body;\n }\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {leadingChip}\n {body}\n </div>\n );\n }\n\n if (action) {\n const act = action.action;\n let body: React.ReactNode = null;\n let leadingChip: React.ReactNode = chip;\n if (act.command === \"create\" && act.file_text) {\n const rendered = renderFileContent(act.file_text);\n leadingChip = rendered.chip;\n body = rendered.body;\n } else if (\n (act.command === \"str_replace\" || act.command === \"insert\") &&\n act.new_str != null\n ) {\n // `insert` carries only `new_str`, no `old_str`. Key on `new_str` and\n // default `old_str` to \"\" so an in-flight insert shows an addition diff\n // instead of nothing.\n body = <DiffView oldText={act.old_str ?? \"\"} newText={act.new_str} />;\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {leadingChip}\n {body}\n </div>\n );\n }\n\n return null;\n}\n\n/**\n * Conversation-scoped wrapper: owns the Files-drawer deep link. Split from the\n * card so the conversation-only hooks below never run outside a conversation\n * route (they throw on a missing conversation id).\n */\nfunction FileEditorCardWithDrawerLink({\n conversationId,\n ...props\n}: FileEditorCardProps & { conversationId: string }) {\n const { navigateToTab } = useSelectConversationTab();\n const setSelectedPath = useFilesTabStore((state) => state.setSelectedPath);\n const { data: conversation } = useActiveConversation();\n const path = resolvePath(props);\n const workingDir = conversation?.workspace?.working_dir;\n\n // Only deep-link once the observation exists — the file is not guaranteed\n // to be on disk while the create action is still in flight.\n const onOpenFile =\n path && props.observation\n ? () => {\n setSelectedPath(\n toWorkspaceRelativePath(path, workingDir),\n conversationId,\n );\n navigateToTab(\"files\");\n }\n : undefined;\n\n return <FileEditorCardBody {...props} onOpenFile={onOpenFile} />;\n}\n\nexport const fileEditorVisualizer = defineVisualizer({\n actionKinds: [\"FileEditorAction\", \"StrReplaceEditorAction\"],\n observationKinds: [\"FileEditorObservation\", \"StrReplaceEditorObservation\"],\n Body: function FileEditorBody(props) {\n const { conversationId } = useOptionalConversationId();\n\n return conversationId ? (\n <FileEditorCardWithDrawerLink\n {...props}\n conversationId={conversationId}\n />\n ) : (\n <FileEditorCardBody {...props} />\n );\n },\n});\n"],"mappings":"4yBA2CA,IAAM,GAAe,CAAE,SAAQ,iBAC7B,GAAa,YAAY,MAAQ,GAAQ,OAAO,MAAQ,GAW1D,SAAS,EAAmB,CAC1B,SACA,cACA,cAC0B,CAC1B,IAAM,EAAO,EAAY,CAAE,SAAQ,aAAY,CAAC,EAC1C,EAAU,GAAa,YAAY,SAAW,GAAQ,OAAO,QAC7D,EAAW,EAAA,oBAAoB,CAAI,EAEnC,EAAY,GAAQ,OAAO,WAC3B,EACJ,IAAY,QAAU,EAClB,GAAG,EAAU,GAAG,GAAG,EAAU,KAC7B,IAAA,GACA,EAAO,GACX,EAAA,EAAA,KAAC,EAAA,aAAD,CAAoB,OAAa,QAAO,QAAS,CAAa,CAAA,EAC5D,KAEE,EAAqB,GAGrB,GAAQ,IAAY,UAAY,EAAA,mBAAmB,CAAI,EAGlD,CACL,KAAM,KACN,MACE,EAAA,EAAA,KAAC,EAAA,oBAAD,CACW,UACH,OACN,OAAQ,CACT,CAAA,CAEL,EAEK,CACL,OACA,MAAM,EAAA,EAAA,KAAC,EAAA,UAAD,CAAW,KAAM,EAAmB,UAAW,CAAA,CACvD,EAGF,GAAI,EAAa,CACf,IAAM,EAAM,EAAY,YACpB,EAAwB,KACxB,EAA+B,EACnC,GAAI,EAAI,MACN,GACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mDACb,EAAI,KACD,CAAA,OAEH,GAAI,EAAI,aAAe,MAAQ,EAAI,aAAe,KAGvD,GAAO,EAAA,EAAA,KAAC,EAAA,SAAD,CAAU,QAAS,EAAI,YAAa,QAAS,EAAI,WAAc,CAAA,MACjE,CAIL,IAAM,EACJ,EAAI,aACJ,EAAI,SACH,EAAI,QAAU,EAAA,gBAAgB,EAAI,OAAO,EAAI,IAChD,GAAI,EAAS,CACX,IAAM,EAAW,EAAkB,CAAO,EAC1C,EAAc,EAAS,KACvB,EAAO,EAAS,IAClB,CACF,CACA,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,CACG,EACA,CACE,GAET,CAEA,GAAI,EAAQ,CACV,IAAM,EAAM,EAAO,OACf,EAAwB,KACxB,EAA+B,EACnC,GAAI,EAAI,UAAY,UAAY,EAAI,UAAW,CAC7C,IAAM,EAAW,EAAkB,EAAI,SAAS,EAChD,EAAc,EAAS,KACvB,EAAO,EAAS,IAClB,OACG,EAAI,UAAY,eAAiB,EAAI,UAAY,WAClD,EAAI,SAAW,OAKf,GAAO,EAAA,EAAA,KAAC,EAAA,SAAD,CAAU,QAAS,EAAI,SAAW,GAAI,QAAS,EAAI,OAAU,CAAA,GAEtE,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,CACG,EACA,CACE,GAET,CAEA,OAAO,IACT,CAOA,SAAS,EAA6B,CACpC,iBACA,GAAG,GACgD,CACnD,GAAM,CAAE,iBAAkB,EAAA,yBAAyB,EAC7C,EAAkB,EAAA,iBAAkB,GAAU,EAAM,eAAe,EACnE,CAAE,KAAM,GAAiB,EAAA,sBAAsB,EAC/C,EAAO,EAAY,CAAK,EACxB,EAAa,GAAc,WAAW,YAItC,EACJ,GAAQ,EAAM,gBACJ,CACJ,EACE,EAAA,wBAAwB,EAAM,CAAU,EACxC,CACF,EACA,EAAc,OAAO,CACvB,EACA,IAAA,GAEN,OAAO,EAAA,EAAA,KAAC,EAAD,CAAoB,GAAI,EAAmB,YAAa,CAAA,CACjE,CAEA,IAAa,EAAuB,EAAA,iBAAiB,CACnD,YAAa,CAAC,mBAAoB,wBAAwB,EAC1D,iBAAkB,CAAC,wBAAyB,6BAA6B,EACzE,KAAM,SAAwB,EAAO,CACnC,GAAM,CAAE,kBAAmB,EAAA,0BAA0B,EAErD,OAAO,GACL,EAAA,EAAA,KAAC,EAAD,CACE,GAAI,EACY,gBACjB,CAAA,GAED,EAAA,EAAA,KAAC,EAAD,CAAoB,GAAI,CAAQ,CAAA,CAEpC,CACF,CAAC"}
@@ -1,9 +1 @@
1
- /**
2
- * File-editor visualizer for `file_editor` / `str_replace_editor` tools.
3
- *
4
- * Observation card: error → message; `str_replace`/`insert` → diff of the file
5
- * before vs after; `create`/`view` → the file content. Action card (shown while
6
- * the edit is in flight): `create` → new content; `str_replace` → diff of the
7
- * replaced snippet; `view`/`undo_edit` → just the path + range.
8
- */
9
1
  export declare const fileEditorVisualizer: import("../define").RegisteredVisualizer;
@@ -1,59 +1,101 @@
1
- import { defineVisualizer as e } from "../define.js";
2
- import { textFromContent as t } from "../text-content.js";
3
- import { CodeBlock as n } from "../primitives/code-block.js";
4
- import { getLanguageFromPath as r } from "../../../../../utils/get-language-from-path.js";
5
- import { DiffView as i } from "../primitives/diff-view.js";
6
- import { FilePathChip as a } from "../primitives/file-path-chip.js";
1
+ import { useOptionalConversationId as e } from "../../../../../hooks/use-conversation-id.js";
2
+ import { useFilesTabStore as t } from "../../../../../stores/files-tab-store.js";
3
+ import { useActiveConversation as n } from "../../../../../hooks/query/use-active-conversation.js";
4
+ import { useSelectConversationTab as r } from "../../../../../hooks/use-select-conversation-tab.js";
5
+ import { defineVisualizer as i } from "../define.js";
6
+ import { textFromContent as a } from "../text-content.js";
7
+ import { CodeBlock as o } from "../primitives/code-block.js";
8
+ import { getLanguageFromPath as s } from "../../../../../utils/get-language-from-path.js";
9
+ import { toWorkspaceRelativePath as c } from "../../../../../utils/workspace-relative-path.js";
10
+ import { DiffView as l } from "../primitives/diff-view.js";
11
+ import { FilePathChip as u } from "../primitives/file-path-chip.js";
12
+ import { isMarkdownFilePath as d } from "../../../../../utils/is-markdown-file-path.js";
13
+ import { MarkdownFilePreview as f } from "../primitives/markdown-file-preview.js";
7
14
  import "react";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
15
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
16
  //#region src/components/features/chat/tool-visualizers/file-editor/file-editor.tsx
10
- var c = e({
11
- actionKinds: ["FileEditorAction", "StrReplaceEditorAction"],
12
- observationKinds: ["FileEditorObservation", "StrReplaceEditorObservation"],
13
- Body: function({ action: e, observation: c }) {
14
- let l = c?.observation.path ?? e?.action.path ?? "", u = c?.observation.command ?? e?.action.command, d = r(l), f = e?.action.view_range, p = u === "view" && f ? `${f[0]}-${f[1]}` : void 0, m = l ? /* @__PURE__ */ o(a, {
15
- path: l,
16
- range: p
17
- }) : null;
18
- if (c) {
19
- let e = c.observation, r = null;
20
- if (e.error) r = /* @__PURE__ */ o("span", {
21
- className: "whitespace-pre-wrap text-xs text-danger",
22
- children: e.error
23
- });
24
- else if (e.old_content != null && e.new_content != null) r = /* @__PURE__ */ o(i, {
25
- oldText: e.old_content,
26
- newText: e.new_content
27
- });
28
- else {
29
- let i = e.new_content || e.output || (e.content ? t(e.content) : "");
30
- r = i ? /* @__PURE__ */ o(n, {
31
- code: i,
32
- language: d
33
- }) : null;
17
+ var h = ({ action: e, observation: t }) => t?.observation.path ?? e?.action.path ?? "";
18
+ function g({ action: e, observation: t, onOpenFile: n }) {
19
+ let r = h({
20
+ action: e,
21
+ observation: t
22
+ }), i = t?.observation.command ?? e?.action.command, c = s(r), g = e?.action.view_range, _ = i === "view" && g ? `${g[0]}-${g[1]}` : void 0, v = r ? /* @__PURE__ */ p(u, {
23
+ path: r,
24
+ range: _,
25
+ onClick: n
26
+ }) : null, y = (e) => r && i === "create" && d(r) ? {
27
+ chip: null,
28
+ body: /* @__PURE__ */ p(f, {
29
+ content: e,
30
+ path: r,
31
+ onView: n
32
+ })
33
+ } : {
34
+ chip: v,
35
+ body: /* @__PURE__ */ p(o, {
36
+ code: e,
37
+ language: c
38
+ })
39
+ };
40
+ if (t) {
41
+ let e = t.observation, n = null, r = v;
42
+ if (e.error) n = /* @__PURE__ */ p("span", {
43
+ className: "whitespace-pre-wrap text-xs text-danger",
44
+ children: e.error
45
+ });
46
+ else if (e.old_content != null && e.new_content != null) n = /* @__PURE__ */ p(l, {
47
+ oldText: e.old_content,
48
+ newText: e.new_content
49
+ });
50
+ else {
51
+ let t = e.new_content || e.output || (e.content ? a(e.content) : "");
52
+ if (t) {
53
+ let e = y(t);
54
+ r = e.chip, n = e.body;
34
55
  }
35
- return /* @__PURE__ */ s("div", {
36
- className: "flex flex-col gap-2",
37
- children: [m, r]
38
- });
39
56
  }
40
- if (e) {
41
- let t = e.action, r = null;
42
- return t.command === "create" && t.file_text ? r = /* @__PURE__ */ o(n, {
43
- code: t.file_text,
44
- language: d
45
- }) : (t.command === "str_replace" || t.command === "insert") && t.new_str != null && (r = /* @__PURE__ */ o(i, {
46
- oldText: t.old_str ?? "",
47
- newText: t.new_str
48
- })), /* @__PURE__ */ s("div", {
49
- className: "flex flex-col gap-2",
50
- children: [m, r]
51
- });
52
- }
53
- return null;
57
+ return /* @__PURE__ */ m("div", {
58
+ className: "flex flex-col gap-2",
59
+ children: [r, n]
60
+ });
61
+ }
62
+ if (e) {
63
+ let t = e.action, n = null, r = v;
64
+ if (t.command === "create" && t.file_text) {
65
+ let e = y(t.file_text);
66
+ r = e.chip, n = e.body;
67
+ } else (t.command === "str_replace" || t.command === "insert") && t.new_str != null && (n = /* @__PURE__ */ p(l, {
68
+ oldText: t.old_str ?? "",
69
+ newText: t.new_str
70
+ }));
71
+ return /* @__PURE__ */ m("div", {
72
+ className: "flex flex-col gap-2",
73
+ children: [r, n]
74
+ });
75
+ }
76
+ return null;
77
+ }
78
+ function _({ conversationId: e, ...i }) {
79
+ let { navigateToTab: a } = r(), o = t((e) => e.setSelectedPath), { data: s } = n(), l = h(i), u = s?.workspace?.working_dir, d = l && i.observation ? () => {
80
+ o(c(l, u), e), a("files");
81
+ } : void 0;
82
+ return /* @__PURE__ */ p(g, {
83
+ ...i,
84
+ onOpenFile: d
85
+ });
86
+ }
87
+ var v = i({
88
+ actionKinds: ["FileEditorAction", "StrReplaceEditorAction"],
89
+ observationKinds: ["FileEditorObservation", "StrReplaceEditorObservation"],
90
+ Body: function(t) {
91
+ let { conversationId: n } = e();
92
+ return n ? /* @__PURE__ */ p(_, {
93
+ ...t,
94
+ conversationId: n
95
+ }) : /* @__PURE__ */ p(g, { ...t });
54
96
  }
55
97
  });
56
98
  //#endregion
57
- export { c as fileEditorVisualizer };
99
+ export { v as fileEditorVisualizer };
58
100
 
59
101
  //# sourceMappingURL=file-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-editor.js","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/file-editor/file-editor.tsx"],"sourcesContent":["import React from \"react\";\nimport { getLanguageFromPath } from \"#/utils/get-language-from-path\";\nimport { defineVisualizer } from \"../define\";\nimport { textFromContent } from \"../text-content\";\nimport { CodeBlock } from \"../primitives/code-block\";\nimport { DiffView } from \"../primitives/diff-view\";\nimport { FilePathChip } from \"../primitives/file-path-chip\";\n\n/**\n * File-editor visualizer for `file_editor` / `str_replace_editor` tools.\n *\n * Observation card: error → message; `str_replace`/`insert` diff of the file\n * before vs after; `create`/`view` the file content. Action card (shown while\n * the edit is in flight): `create` new content; `str_replace` diff of the\n * replaced snippet; `view`/`undo_edit` just the path + range.\n */\nexport const fileEditorVisualizer = defineVisualizer({\n actionKinds: [\"FileEditorAction\", \"StrReplaceEditorAction\"],\n observationKinds: [\"FileEditorObservation\", \"StrReplaceEditorObservation\"],\n Body: function FileEditorBody({ action, observation }) {\n const path = observation?.observation.path ?? action?.action.path ?? \"\";\n const command = observation?.observation.command ?? action?.action.command;\n const language = getLanguageFromPath(path);\n\n const viewRange = action?.action.view_range;\n const range =\n command === \"view\" && viewRange\n ? `${viewRange[0]}-${viewRange[1]}`\n : undefined;\n const chip = path ? <FilePathChip path={path} range={range} /> : null;\n\n if (observation) {\n const obs = observation.observation;\n let body: React.ReactNode = null;\n if (obs.error) {\n body = (\n <span className=\"whitespace-pre-wrap text-xs text-danger\">\n {obs.error}\n </span>\n );\n } else if (obs.old_content != null && obs.new_content != null) {\n // Nullish, not truthy: an empty string is a valid side of the diff —\n // clearing a file or inserting into an empty file must still render it.\n body = <DiffView oldText={obs.old_content} newText={obs.new_content} />;\n } else {\n // `view` returns the snippet the agent saw in `content` (the `cat -n`\n // output) rather than `output`/`new_content`, so fall back to it.\n // Mirrors the markdown path's \"prefer content for view\" handling.\n const content =\n obs.new_content ||\n obs.output ||\n (obs.content ? textFromContent(obs.content) : \"\");\n body = content ? (\n <CodeBlock code={content} language={language} />\n ) : null;\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {chip}\n {body}\n </div>\n );\n }\n\n if (action) {\n const act = action.action;\n let body: React.ReactNode = null;\n if (act.command === \"create\" && act.file_text) {\n body = <CodeBlock code={act.file_text} language={language} />;\n } else if (\n (act.command === \"str_replace\" || act.command === \"insert\") &&\n act.new_str != null\n ) {\n // `insert` carries only `new_str`, no `old_str`. Key on `new_str` and\n // default `old_str` to \"\" so an in-flight insert shows an addition diff\n // instead of nothing.\n body = <DiffView oldText={act.old_str ?? \"\"} newText={act.new_str} />;\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {chip}\n {body}\n </div>\n );\n }\n\n return null;\n },\n});\n"],"mappings":";;;;;;;;;AAgBA,IAAa,IAAuB,EAAiB;CACnD,aAAa,CAAC,oBAAoB,wBAAwB;CAC1D,kBAAkB,CAAC,yBAAyB,6BAA6B;CACzE,MAAM,SAAwB,EAAE,WAAQ,kBAAe;EACrD,IAAM,IAAO,GAAa,YAAY,QAAQ,GAAQ,OAAO,QAAQ,IAC/D,IAAU,GAAa,YAAY,WAAW,GAAQ,OAAO,SAC7D,IAAW,EAAoB,CAAI,GAEnC,IAAY,GAAQ,OAAO,YAC3B,IACJ,MAAY,UAAU,IAClB,GAAG,EAAU,GAAG,GAAG,EAAU,OAC7B,KAAA,GACA,IAAO,IAAO,kBAAC,GAAD;GAAoB;GAAa;EAAQ,CAAA,IAAI;EAEjE,IAAI,GAAa;GACf,IAAM,IAAM,EAAY,aACpB,IAAwB;GAC5B,IAAI,EAAI,OACN,IACE,kBAAC,QAAD;IAAM,WAAU;cACb,EAAI;GACD,CAAA;QAEH,IAAI,EAAI,eAAe,QAAQ,EAAI,eAAe,MAGvD,IAAO,kBAAC,GAAD;IAAU,SAAS,EAAI;IAAa,SAAS,EAAI;GAAc,CAAA;QACjE;IAIL,IAAM,IACJ,EAAI,eACJ,EAAI,WACH,EAAI,UAAU,EAAgB,EAAI,OAAO,IAAI;IAChD,IAAO,IACL,kBAAC,GAAD;KAAW,MAAM;KAAmB;IAAW,CAAA,IAC7C;GACN;GACA,OACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,GACA,CACE;;EAET;EAEA,IAAI,GAAQ;GACV,IAAM,IAAM,EAAO,QACf,IAAwB;GAY5B,OAXI,EAAI,YAAY,YAAY,EAAI,YAClC,IAAO,kBAAC,GAAD;IAAW,MAAM,EAAI;IAAqB;GAAW,CAAA,KAE3D,EAAI,YAAY,iBAAiB,EAAI,YAAY,aAClD,EAAI,WAAW,SAKf,IAAO,kBAAC,GAAD;IAAU,SAAS,EAAI,WAAW;IAAI,SAAS,EAAI;GAAU,CAAA,IAGpE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,GACA,CACE;;EAET;EAEA,OAAO;CACT;AACF,CAAC"}
1
+ {"version":3,"file":"file-editor.js","names":[],"sources":["../../../../../../src/components/features/chat/tool-visualizers/file-editor/file-editor.tsx"],"sourcesContent":["/**\n * File-editor visualizer for `file_editor` / `str_replace_editor` tools.\n *\n * Observation card: error → message; `str_replace`/`insert` → diff of the file\n * before vs after; `create`/`view` → the file content. Action card (shown while\n * the edit is in flight): `create` → new content; `str_replace` → diff of the\n * replaced snippet; `view`/`undo_edit` → just the path + range.\n *\n * Created Markdown artifacts get a height-clipped rich preview with a View bar\n * that opens the Files drawer, instead of dumping the full source into a code\n * block. Reads/edits of `.md` files keep the normal CodeBlock / DiffView path.\n */\nimport React from \"react\";\nimport { getLanguageFromPath } from \"#/utils/get-language-from-path\";\nimport { toWorkspaceRelativePath } from \"#/utils/workspace-relative-path\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useSelectConversationTab } from \"#/hooks/use-select-conversation-tab\";\nimport { useFilesTabStore } from \"#/stores/files-tab-store\";\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\";\nimport { defineVisualizer, VisualizerProps } from \"../define\";\nimport { textFromContent } from \"../text-content\";\nimport { CodeBlock } from \"../primitives/code-block\";\nimport { DiffView } from \"../primitives/diff-view\";\nimport { FilePathChip } from \"../primitives/file-path-chip\";\nimport {\n isMarkdownFilePath,\n MarkdownFilePreview,\n} from \"../primitives/markdown-file-preview\";\n\ntype FileEditorCardProps = VisualizerProps<\n FileEditorAction | StrReplaceEditorAction,\n FileEditorObservation | StrReplaceEditorObservation\n>;\n\n/** The path the event touched; observations win because they are authoritative. */\nconst resolvePath = ({ action, observation }: FileEditorCardProps): string =>\n observation?.observation.path ?? action?.action.path ?? \"\";\n\ninterface FileEditorCardBodyProps extends FileEditorCardProps {\n /**\n * Deep-links the file into the Files drawer. Absent outside a conversation\n * route, where there is no drawer to open; the card then stays read-only.\n * Also omitted for in-flight creates so View does not open a missing file.\n */\n onOpenFile?: () => void;\n}\n\nfunction FileEditorCardBody({\n action,\n observation,\n onOpenFile,\n}: FileEditorCardBodyProps) {\n const path = resolvePath({ action, observation });\n const command = observation?.observation.command ?? action?.action.command;\n const language = getLanguageFromPath(path);\n\n const viewRange = action?.action.view_range;\n const range =\n command === \"view\" && viewRange\n ? `${viewRange[0]}-${viewRange[1]}`\n : undefined;\n const chip = path ? (\n <FilePathChip path={path} range={range} onClick={onOpenFile} />\n ) : null;\n\n const renderFileContent = (content: string) => {\n // Only created Markdown artifacts get the rich preview — `view` returns\n // `cat -n` numbered snippets that must stay in a CodeBlock.\n if (path && command === \"create\" && isMarkdownFilePath(path)) {\n // Markdown artifacts own their card (clipped preview + optional View),\n // so skip the separate path chip to avoid a duplicate filename affordance.\n return {\n chip: null as React.ReactNode,\n body: (\n <MarkdownFilePreview\n content={content}\n path={path}\n onView={onOpenFile}\n />\n ),\n };\n }\n return {\n chip,\n body: <CodeBlock code={content} language={language} />,\n };\n };\n\n if (observation) {\n const obs = observation.observation;\n let body: React.ReactNode = null;\n let leadingChip: React.ReactNode = chip;\n if (obs.error) {\n body = (\n <span className=\"whitespace-pre-wrap text-xs text-danger\">\n {obs.error}\n </span>\n );\n } else if (obs.old_content != null && obs.new_content != null) {\n // Nullish, not truthy: an empty string is a valid side of the diff —\n // clearing a file or inserting into an empty file must still render it.\n body = <DiffView oldText={obs.old_content} newText={obs.new_content} />;\n } else {\n // `view` returns the snippet the agent saw in `content` (the `cat -n`\n // output) rather than `output`/`new_content`, so fall back to it.\n // Mirrors the markdown path's \"prefer content for view\" handling.\n const content =\n obs.new_content ||\n obs.output ||\n (obs.content ? textFromContent(obs.content) : \"\");\n if (content) {\n const rendered = renderFileContent(content);\n leadingChip = rendered.chip;\n body = rendered.body;\n }\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {leadingChip}\n {body}\n </div>\n );\n }\n\n if (action) {\n const act = action.action;\n let body: React.ReactNode = null;\n let leadingChip: React.ReactNode = chip;\n if (act.command === \"create\" && act.file_text) {\n const rendered = renderFileContent(act.file_text);\n leadingChip = rendered.chip;\n body = rendered.body;\n } else if (\n (act.command === \"str_replace\" || act.command === \"insert\") &&\n act.new_str != null\n ) {\n // `insert` carries only `new_str`, no `old_str`. Key on `new_str` and\n // default `old_str` to \"\" so an in-flight insert shows an addition diff\n // instead of nothing.\n body = <DiffView oldText={act.old_str ?? \"\"} newText={act.new_str} />;\n }\n return (\n <div className=\"flex flex-col gap-2\">\n {leadingChip}\n {body}\n </div>\n );\n }\n\n return null;\n}\n\n/**\n * Conversation-scoped wrapper: owns the Files-drawer deep link. Split from the\n * card so the conversation-only hooks below never run outside a conversation\n * route (they throw on a missing conversation id).\n */\nfunction FileEditorCardWithDrawerLink({\n conversationId,\n ...props\n}: FileEditorCardProps & { conversationId: string }) {\n const { navigateToTab } = useSelectConversationTab();\n const setSelectedPath = useFilesTabStore((state) => state.setSelectedPath);\n const { data: conversation } = useActiveConversation();\n const path = resolvePath(props);\n const workingDir = conversation?.workspace?.working_dir;\n\n // Only deep-link once the observation exists — the file is not guaranteed\n // to be on disk while the create action is still in flight.\n const onOpenFile =\n path && props.observation\n ? () => {\n setSelectedPath(\n toWorkspaceRelativePath(path, workingDir),\n conversationId,\n );\n navigateToTab(\"files\");\n }\n : undefined;\n\n return <FileEditorCardBody {...props} onOpenFile={onOpenFile} />;\n}\n\nexport const fileEditorVisualizer = defineVisualizer({\n actionKinds: [\"FileEditorAction\", \"StrReplaceEditorAction\"],\n observationKinds: [\"FileEditorObservation\", \"StrReplaceEditorObservation\"],\n Body: function FileEditorBody(props) {\n const { conversationId } = useOptionalConversationId();\n\n return conversationId ? (\n <FileEditorCardWithDrawerLink\n {...props}\n conversationId={conversationId}\n />\n ) : (\n <FileEditorCardBody {...props} />\n );\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,IAAM,KAAe,EAAE,WAAQ,qBAC7B,GAAa,YAAY,QAAQ,GAAQ,OAAO,QAAQ;AAW1D,SAAS,EAAmB,EAC1B,WACA,gBACA,iBAC0B;CAC1B,IAAM,IAAO,EAAY;EAAE;EAAQ;CAAY,CAAC,GAC1C,IAAU,GAAa,YAAY,WAAW,GAAQ,OAAO,SAC7D,IAAW,EAAoB,CAAI,GAEnC,IAAY,GAAQ,OAAO,YAC3B,IACJ,MAAY,UAAU,IAClB,GAAG,EAAU,GAAG,GAAG,EAAU,OAC7B,KAAA,GACA,IAAO,IACX,kBAAC,GAAD;EAAoB;EAAa;EAAO,SAAS;CAAa,CAAA,IAC5D,MAEE,KAAqB,MAGrB,KAAQ,MAAY,YAAY,EAAmB,CAAI,IAGlD;EACL,MAAM;EACN,MACE,kBAAC,GAAD;GACW;GACH;GACN,QAAQ;EACT,CAAA;CAEL,IAEK;EACL;EACA,MAAM,kBAAC,GAAD;GAAW,MAAM;GAAmB;EAAW,CAAA;CACvD;CAGF,IAAI,GAAa;EACf,IAAM,IAAM,EAAY,aACpB,IAAwB,MACxB,IAA+B;EACnC,IAAI,EAAI,OACN,IACE,kBAAC,QAAD;GAAM,WAAU;aACb,EAAI;EACD,CAAA;OAEH,IAAI,EAAI,eAAe,QAAQ,EAAI,eAAe,MAGvD,IAAO,kBAAC,GAAD;GAAU,SAAS,EAAI;GAAa,SAAS,EAAI;EAAc,CAAA;OACjE;GAIL,IAAM,IACJ,EAAI,eACJ,EAAI,WACH,EAAI,UAAU,EAAgB,EAAI,OAAO,IAAI;GAChD,IAAI,GAAS;IACX,IAAM,IAAW,EAAkB,CAAO;IAE1C,AADA,IAAc,EAAS,MACvB,IAAO,EAAS;GAClB;EACF;EACA,OACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,GACA,CACE;;CAET;CAEA,IAAI,GAAQ;EACV,IAAM,IAAM,EAAO,QACf,IAAwB,MACxB,IAA+B;EACnC,IAAI,EAAI,YAAY,YAAY,EAAI,WAAW;GAC7C,IAAM,IAAW,EAAkB,EAAI,SAAS;GAEhD,AADA,IAAc,EAAS,MACvB,IAAO,EAAS;EAClB,OAAO,CACJ,EAAI,YAAY,iBAAiB,EAAI,YAAY,aAClD,EAAI,WAAW,SAKf,IAAO,kBAAC,GAAD;GAAU,SAAS,EAAI,WAAW;GAAI,SAAS,EAAI;EAAU,CAAA;EAEtE,OACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,GACA,CACE;;CAET;CAEA,OAAO;AACT;AAOA,SAAS,EAA6B,EACpC,mBACA,GAAG,KACgD;CACnD,IAAM,EAAE,qBAAkB,EAAyB,GAC7C,IAAkB,GAAkB,MAAU,EAAM,eAAe,GACnE,EAAE,MAAM,MAAiB,EAAsB,GAC/C,IAAO,EAAY,CAAK,GACxB,IAAa,GAAc,WAAW,aAItC,IACJ,KAAQ,EAAM,oBACJ;EAKJ,AAJA,EACE,EAAwB,GAAM,CAAU,GACxC,CACF,GACA,EAAc,OAAO;CACvB,IACA,KAAA;CAEN,OAAO,kBAAC,GAAD;EAAoB,GAAI;EAAmB;CAAa,CAAA;AACjE;AAEA,IAAa,IAAuB,EAAiB;CACnD,aAAa,CAAC,oBAAoB,wBAAwB;CAC1D,kBAAkB,CAAC,yBAAyB,6BAA6B;CACzE,MAAM,SAAwB,GAAO;EACnC,IAAM,EAAE,sBAAmB,EAA0B;EAErD,OAAO,IACL,kBAAC,GAAD;GACE,GAAI;GACY;EACjB,CAAA,IAED,kBAAC,GAAD,EAAoB,GAAI,EAAQ,CAAA;CAEpC;AACF,CAAC"}