@openhands/agent-canvas 1.12.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.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-BkL3HWa3.js → acp-providers-D1PORKc0.js} +1 -1
- package/build/assets/active-backend-context-IqOjobNK.js +2 -0
- package/build/assets/{agent-context-settings-CzWS1DgR.js → agent-context-settings-DMrObcIS.js} +1 -1
- package/build/assets/agent-profiles-settings-DororXN5.js +1 -0
- package/build/assets/agent-server-conversation-service.api-DWBe0rbX.js +86 -0
- package/build/assets/{agent-settings-D2J1dKVd.js → agent-settings-BJVk92PU.js} +1 -1
- package/build/assets/agent-settings-COfJsQ1d.js +1 -0
- package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-CzZsm7ms.js} +1 -1
- package/build/assets/{api-key-entry-screen-D70oJj2c.js → api-key-entry-screen-D8Fade_-.js} +1 -1
- package/build/assets/{app-settings-D0OKHB3M.js → app-settings-CpyGB3AT.js} +1 -1
- package/build/assets/{automation-detail-C0SxWTnQ.js → automation-detail-B-jQ39Mm.js} +1 -1
- package/build/assets/{automation-export-BjQa_fT6.js → automation-export-B1dywoqk.js} +1 -1
- package/build/assets/{automation-setup-route-BzCNpljP.js → automation-setup-route-C-bWUZBi.js} +1 -1
- package/build/assets/{automation-templates-D9gs6ihu.js → automation-templates-DgpCGOJV.js} +1 -1
- package/build/assets/{automations-list-dZg8zOCl.js → automations-list-DnMxlxsL.js} +1 -1
- package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-HHEneWMw.js} +1 -1
- package/build/assets/{backend-form-modal-HwclKrUS.js → backend-form-modal-DiVrD4Cm.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-YI3k09Wr.js → backend-synced-settings-badge-7MIjpr8M.js} +1 -1
- package/build/assets/{badge-Dpn3-LTV.js → badge-CpYmcVZV.js} +1 -1
- package/build/assets/{base-modal-3NmIOKDm.js → base-modal-Fnh6Uln9.js} +1 -1
- package/build/assets/bot-BQZx8e2i.js +1 -0
- package/build/assets/{brand-button-CJcwjnfb.js → brand-button-swT1RyO0.js} +1 -1
- package/build/assets/browser-B9AbV6kG.js +7 -0
- package/build/assets/{browser-tab-4CPdj3J3.js → browser-tab-zAY12m_i.js} +1 -1
- package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-DsJtivmL.js} +1 -1
- package/build/assets/check-WAFXrrs_.js +1 -0
- package/build/assets/chevron-down-CifNWzme.js +1 -0
- package/build/assets/circle-check-CtnimJa8.js +1 -0
- package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-Cuzx55bo.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-CcSez21r.js → cloud-funnel-analytics-86CwNdSh.js} +1 -1
- package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-D0fRotFi.js} +1 -1
- package/build/assets/{command-menu-BKOLj-TC.js → command-menu-BXy03FBl.js} +1 -1
- package/build/assets/{condenser-settings-DLQogFnB.js → condenser-settings-BmZa0ui_.js} +1 -1
- package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-BgoN6lbN.js} +1 -1
- package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-Bq02tc-P.js} +1 -1
- package/build/assets/conversation-BPo8SvLN.js +1 -0
- package/build/assets/conversation-CPCVsCUY.js +90 -0
- package/build/assets/conversation-panel-BPo8SvLN.js +1 -0
- package/build/assets/{conversation-state-store-CtgILxWF.js → conversation-state-store-C5YpjMNy.js} +1 -1
- package/build/assets/conversation-store-Blc5xysY.js +6 -0
- package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-CMqo_0Bd.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-Cg1pF0xn.js} +1 -1
- package/build/assets/{device-verify-BIjXeW9N.js → device-verify-BfQLgNyq.js} +1 -1
- package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-BIqQr5mx.js} +1 -1
- package/build/assets/{entry.client-EBn3ZtNP.js → entry.client-CxFjRYqH.js} +2 -2
- package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-C_yV4_bo.js} +1 -1
- package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-Bi4qbh2g.js} +1 -1
- package/build/assets/{extensions-hub-BZ3HYztk.js → extensions-hub-BqUINAhp.js} +1 -1
- package/build/assets/{extensions-navigation-Bnx32WAb.js → extensions-navigation-lraj88Wk.js} +1 -1
- package/build/assets/external-link-CgtpA_a1.js +1 -0
- package/build/assets/{file-text-RecuaId_.js → file-text-DEK4LSVw.js} +1 -1
- package/build/assets/files-tab-DV0L-lFE.js +1 -0
- package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-7yFSQJq_.js} +1 -1
- package/build/assets/{format-relative-time-BerVamGl.js → format-relative-time-DSErAuVr.js} +1 -1
- package/build/assets/git-provider-icon-BvlLAche.js +1 -0
- package/build/assets/{git-repo-dropdown-B5VnMftu.js → git-repo-dropdown-ByMzpNko.js} +1 -1
- package/build/assets/git-repo-dropdown-C6R7hgM8.js +1 -0
- package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_sfncLZ.js} +1 -1
- package/build/assets/{home-Y0aDou-a.js → home-BOrlwLqG.js} +1 -1
- package/build/assets/home-BvMNC6E-.js +1 -0
- package/build/assets/{home-store-Cubdq0uP.js → home-store-CxqsY9Fi.js} +1 -1
- package/build/assets/index-home-BvMNC6E-.js +1 -0
- package/build/assets/info-BRVcJAUg.js +1 -0
- package/build/assets/{install-server-modal-DW6dSyGr.js → install-server-modal-Bl4G1zF4.js} +1 -1
- package/build/assets/{kebab-menu-item-content-CKydZrbH.js → kebab-menu-item-content-BGoGFEAg.js} +1 -1
- package/build/assets/{launch-c4GEP8oo.js → launch-CkqiSCqi.js} +1 -1
- package/build/assets/{list-todo-CheUtB7F.js → list-todo-DNWlzfaM.js} +1 -1
- package/build/assets/llm-not-configured-banner-DLw_tu-G.js +27 -0
- package/build/assets/llm-settings-B-pkVCrt.js +1 -0
- package/build/assets/llm-settings-DSC0-IQ7.js +1 -0
- package/build/assets/llm-subscription-service-BAdOl5Xx.js +1 -0
- package/build/assets/loader-circle-B47W9XqT.js +1 -0
- package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-xhnrGP4Y.js} +1 -1
- package/build/assets/{manage-backends-modal-DTCME_Pu.js → manage-backends-modal-DhGk5mJt.js} +1 -1
- package/build/assets/manifest-653b89aa.js +1 -0
- package/build/assets/{manifest-subpage-layout-Ds7G5GZ8.js → manifest-subpage-layout-CKWvL2ig.js} +1 -1
- package/build/assets/{map-provider-7Bp2aih5.js → map-provider-Mx8mZuE-.js} +1 -1
- package/build/assets/markdown-renderer-DUmk7pFc.js +8 -0
- package/build/assets/{mcp-Da7wFU7A.js → mcp-DCkvl6K0.js} +2 -2
- package/build/assets/mcp-marketplace-utils-DEbMXlQr.js +1 -0
- package/build/assets/messages-DSXvyc21.js +40 -0
- package/build/assets/{modal-body-duRaxj_K.js → modal-body-gIe21fDv.js} +1 -1
- package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D66dlgZ7.js} +1 -1
- package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-B6iOGYpI.js} +1 -1
- package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-BYX1Pw5W.js} +1 -1
- package/build/assets/{npm-Cswluf6-.js → npm-DLckoeJc.js} +1 -1
- package/build/assets/{onboarding-BKbTYlW1.js → onboarding-D7WDG66N.js} +1 -1
- package/build/assets/{onboarding-modal-DrrGlEQq.js → onboarding-modal-C_xVrFNv.js} +1 -1
- package/build/assets/{organization-service.api-DK8csGvK.js → organization-service.api-D-s9z18a.js} +1 -1
- package/build/assets/pencil-BGOCPRyu.js +1 -0
- package/build/assets/{planner-tab-D-mZ1I7n.js → planner-tab-AKaXIIfg.js} +1 -1
- package/build/assets/{plugins-management-service-CywqyfLK.js → plugins-management-service-wtmY4QQw.js} +1 -1
- package/build/assets/plus-zNEL8rcX.js +1 -0
- package/build/assets/{profiles-service.api-vcE_jJCe.js → profiles-service.api-DCMYxHMi.js} +1 -1
- package/build/assets/{providers-CdrPPm0z.js → providers-BjrtjX4L.js} +1 -1
- package/build/assets/{proxy-b4aqL4SX.js → proxy-9Z_WZggZ.js} +1 -1
- package/build/assets/{puzzle-B3v361yY.js → puzzle-BWLmN8z4.js} +1 -1
- package/build/assets/recommended-automations-launcher-CFlzhu1o.js +1 -0
- package/build/assets/refresh-cw-CXtFWpwv.js +1 -0
- package/build/assets/root-CanxKlNV.css +1 -0
- package/build/assets/{root-CBBi6IAe.js → root-DkfG_UWR.js} +2 -2
- package/build/assets/root-layout-D75LHYhh.js +2 -0
- package/build/assets/{schema-field-Z-rMg9ti.js → schema-field-OnM5Uob_.js} +1 -1
- package/build/assets/{sdk-section-page-m_cjygxR.js → sdk-section-page-m5WQm2sy.js} +1 -1
- package/build/assets/search-CycosyjN.js +1 -0
- package/build/assets/{secrets-service-BHF4fxML.js → secrets-service-B26R61C1.js} +1 -1
- package/build/assets/{secrets-settings-aBGXtQhX.js → secrets-settings-CbLYCKOX.js} +1 -1
- package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DCspm2U5.js} +1 -1
- package/build/assets/{settings-CZPGNens.js → settings-BJQI_iBM.js} +1 -1
- package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-BI8V_Nov.js} +1 -1
- package/build/assets/{settings-index-Dtlegd6s.js → settings-index-BiTqJoH7.js} +1 -1
- package/build/assets/{settings-input-D61Vzp9e.js → settings-input-Cz62hWVW.js} +1 -1
- package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-z_3FW5H3.js} +1 -1
- package/build/assets/{settings-modal-CalzJP2l.js → settings-modal-BIrIVn97.js} +1 -1
- package/build/assets/{settings-service.api-DfPYaxZJ.js → settings-service.api--rJmnuLa.js} +1 -1
- package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-BRsSI8Vs.js} +1 -1
- package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-Ba7vel6T.js} +1 -1
- package/build/assets/shared-conversation-CQK_PqHx.js +1 -0
- package/build/assets/shield-check-T3JsDJiM.js +1 -0
- package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-Bhi3hVcu.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-C6HpQ55l.js → sidebar-mobile-menu-toggle-YWJNRN4p.js} +1 -1
- package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-BSUlY5Ml.js} +1 -1
- package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-Cl1cUv_F.js} +1 -1
- package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-BXz8L8Rn.js} +1 -1
- package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-QgfKv31M.js} +1 -1
- package/build/assets/{skill-scope-Dt1V5X2p.js → skill-scope-Dc3JPW-8.js} +1 -1
- package/build/assets/{skills-plugins-B-H0cCOP.js → skills-plugins-CpTV27n3.js} +1 -1
- package/build/assets/{skills-settings-DthdIDUb.js → skills-settings-CSW__IW4.js} +1 -1
- package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-TJ0mdECe.js} +1 -1
- package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-BUMSbgrF.js} +1 -1
- package/build/assets/{task-list-tab-BTde81Iu.js → task-list-tab-mAHMOkUz.js} +1 -1
- package/build/assets/{terminal-DRrJo-cR.js → terminal-BzxBaHx2.js} +1 -1
- package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-O5v1FgxW.js} +1 -1
- package/build/assets/trash-2-C0xNVp9c.js +1 -0
- package/build/assets/{typography-D9tiHct7.js → typography-NOKSk9_R.js} +1 -1
- package/build/assets/usage-tab-tEmVN0KD.js +1 -0
- package/build/assets/{use-acp-credential-form-DGyo0QvL.js → use-acp-credential-form-BPNi0Zbm.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DrPzIKJF.js → use-activate-agent-profile-D9YRQPTF.js} +1 -1
- package/build/assets/{use-agent-profiles-B37XWDLq.js → use-agent-profiles-Cb2zUW3l.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BzE28H3x.js → use-can-manage-org-profiles-Dxzq2AEd.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-U6HPjy50.js → use-cloud-current-user-id-Co2eJk2A.js} +1 -1
- package/build/assets/{use-config-DapX3pjC.js → use-config-DKAMiI5R.js} +1 -1
- package/build/assets/use-create-conversation-CoHTiCbI.js +1 -0
- package/build/assets/{use-create-secret-DcpT3RPw.js → use-create-secret-2zBlCDsF.js} +1 -1
- package/build/assets/use-is-authed-C52-ivnB.js +1 -0
- package/build/assets/{use-is-creating-conversation-CVefC9Ns.js → use-is-creating-conversation-DdaAE6jV.js} +1 -1
- package/build/assets/{use-launch-skill-in-chat-BcKNjxxd.js → use-launch-skill-in-chat-COnDpxCQ.js} +1 -1
- package/build/assets/use-llm-profiles-C_BHue65.js +1 -0
- package/build/assets/{use-manifest-capabilities-zihHDbMW.js → use-manifest-capabilities-DPrQsaPP.js} +1 -1
- package/build/assets/{use-onboarding-completion-6kWOW3ul.js → use-onboarding-completion-CCE8OQgV.js} +1 -1
- package/build/assets/{use-plugins-marketplace-CqkR8kLE.js → use-plugins-marketplace-CEiak69h.js} +1 -1
- package/build/assets/use-save-agent-profile-DK9idD6a.js +1 -0
- package/build/assets/{use-save-settings-DIEurJ3D.js → use-save-settings-DNmnbG6f.js} +1 -1
- package/build/assets/{use-settings-nav-items-DV9qgeu7.js → use-settings-nav-items-BlFL7YhM.js} +1 -1
- package/build/assets/{use-settings-BmLzQjnC.js → use-settings-wCwPaSIv.js} +1 -1
- package/build/assets/{use-tracking-salbPJxT.js → use-tracking-CVwPmhlX.js} +1 -1
- package/build/assets/{use-user-conversation-Dt-W6uNw.js → use-user-conversation-DVtfg0B_.js} +1 -1
- package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-p1xq35r2.js} +1 -1
- package/build/assets/{useMutation-ChpkYxI5.js → useMutation-BFDQmgk9.js} +1 -1
- package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-DF1NAAeC.js} +1 -1
- package/build/assets/{useQuery-BCnzy4LX.js → useQuery-DRv--6bK.js} +1 -1
- package/build/assets/utils-zxEjKE70.js +1 -0
- package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
- 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
- package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-D9wR9yM2.js} +1 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js +13 -0
- package/build/assets/vendor~root-layout-C-IgVx6e.js +1 -0
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js} +1 -1
- 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
- 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
- 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
- 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
- package/build/assets/{verification-settings-oi54wEc1.js → verification-settings-B8UMQ7MG.js} +1 -1
- package/build/assets/{wrench-B1_H-tL1.js → wrench-DIka3hCq.js} +1 -1
- package/build/assets/x-BWKA2Ver.js +1 -0
- package/build/assets/zap-DHddTPc0.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +28 -1
- package/build/locales/ca/openhands.json +28 -1
- package/build/locales/de/openhands.json +28 -1
- package/build/locales/en/openhands.json +28 -1
- package/build/locales/es/openhands.json +28 -1
- package/build/locales/fr/openhands.json +28 -1
- package/build/locales/it/openhands.json +28 -1
- package/build/locales/ja/openhands.json +28 -1
- package/build/locales/ko-KR/openhands.json +28 -1
- package/build/locales/no/openhands.json +28 -1
- package/build/locales/pt/openhands.json +28 -1
- package/build/locales/tr/openhands.json +28 -1
- package/build/locales/uk/openhands.json +28 -1
- package/build/locales/zh-CN/openhands.json +28 -1
- package/build/locales/zh-TW/openhands.json +28 -1
- package/config/defaults.json +3 -3
- package/dist/api/agent-server-compatibility.cjs +1 -1
- package/dist/api/agent-server-compatibility.cjs.map +1 -1
- package/dist/api/agent-server-compatibility.js +1 -1
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +24 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +116 -97
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/llm-balance-service.cjs +2 -0
- package/dist/api/llm-balance-service.cjs.map +1 -0
- package/dist/api/llm-balance-service.d.ts +33 -0
- package/dist/api/llm-balance-service.js +53 -0
- package/dist/api/llm-balance-service.js.map +1 -0
- package/dist/api/llm-subscription-service.cjs +1 -1
- package/dist/api/llm-subscription-service.cjs.map +1 -1
- package/dist/api/llm-subscription-service.js +42 -34
- package/dist/api/llm-subscription-service.js.map +1 -1
- package/dist/components/conversation/index.cjs +1 -1
- package/dist/components/conversation/index.d.ts +0 -1
- package/dist/components/conversation/index.js +0 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +24 -23
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
- package/dist/components/conversation-events/chat/group-events.cjs +1 -1
- package/dist/components/conversation-events/chat/group-events.cjs.map +1 -1
- package/dist/components/conversation-events/chat/group-events.d.ts +3 -3
- package/dist/components/conversation-events/chat/group-events.js +27 -26
- package/dist/components/conversation-events/chat/group-events.js.map +1 -1
- package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +123 -118
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-grip.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-grip.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-grip.d.ts +2 -1
- package/dist/components/features/chat/components/chat-input-grip.js +7 -7
- package/dist/components/features/chat/components/chat-input-grip.js.map +1 -1
- package/dist/components/features/chat/components/context-window-meter.cjs +2 -0
- package/dist/components/features/chat/components/context-window-meter.cjs.map +1 -0
- package/dist/components/features/chat/components/context-window-meter.d.ts +2 -0
- package/dist/components/features/chat/components/context-window-meter.js +131 -0
- package/dist/components/features/chat/components/context-window-meter.js.map +1 -0
- package/dist/components/features/chat/components/context-window-ring.cjs +2 -0
- package/dist/components/features/chat/components/context-window-ring.cjs.map +1 -0
- package/dist/components/features/chat/components/context-window-ring.d.ts +26 -0
- package/dist/components/features/chat/components/context-window-ring.js +45 -0
- package/dist/components/features/chat/components/context-window-ring.js.map +1 -0
- package/dist/components/features/chat/custom-chat-input.cjs +1 -1
- package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
- package/dist/components/features/chat/custom-chat-input.js +68 -67
- package/dist/components/features/chat/custom-chat-input.js.map +1 -1
- package/dist/components/features/chat/path-component.cjs +1 -1
- package/dist/components/features/chat/path-component.cjs.map +1 -1
- package/dist/components/features/chat/path-component.js +9 -6
- package/dist/components/features/chat/path-component.js.map +1 -1
- package/dist/components/features/chat/plan-preview.cjs +1 -1
- package/dist/components/features/chat/plan-preview.js +4 -4
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.d.ts +0 -8
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +92 -50
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +7 -2
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +15 -9
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs +2 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs.map +1 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.d.ts +20 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js +76 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js.map +1 -0
- package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
- package/dist/components/features/controls/server-status-context-menu.cjs.map +1 -1
- package/dist/components/features/controls/server-status-context-menu.d.ts +5 -3
- package/dist/components/features/controls/server-status-context-menu.js +8 -8
- package/dist/components/features/controls/server-status-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.js +58 -61
- package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.js +74 -46
- package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
- package/dist/components/features/conversation/conversation-name.cjs +1 -1
- package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name.js +69 -71
- package/dist/components/features/conversation/conversation-name.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js +7 -6
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +92 -86
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +81 -71
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.cjs +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.cjs.map +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.js +6 -6
- package/dist/components/features/conversation/metrics-modal/cost-section.js.map +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.cjs +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.cjs.map +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +2 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.js +10 -9
- package/dist/components/features/conversation/metrics-modal/metric-row.js.map +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.cjs +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.cjs.map +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.js +2 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.js.map +1 -1
- package/dist/components/features/conversation/usage-panel/compact-context-button.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.d.ts +16 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.js +59 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.js.map +1 -0
- package/dist/components/features/conversation/usage-panel/context-meter.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/context-meter.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/context-meter.d.ts +19 -0
- package/dist/components/features/conversation/usage-panel/context-meter.js +46 -0
- package/dist/components/features/conversation/usage-panel/context-meter.js.map +1 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.d.ts +7 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.js +57 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.js.map +1 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.d.ts +9 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.js +68 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.js.map +1 -0
- package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.js +10 -13
- package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.js +2 -2
- package/dist/components/features/conversation-panel/budget-progress-bar.js.map +1 -1
- package/dist/components/features/conversation-panel/confirm-archive-modal.cjs +2 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.cjs.map +1 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.d.ts +8 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.js +48 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +3 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +39 -34
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +3 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +104 -80
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +7 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +25 -17
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +9 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +94 -84
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +2 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.js +32 -31
- package/dist/components/features/conversation-panel/conversation-group-folder-list.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +2 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.js +27 -26
- package/dist/components/features/conversation-panel/conversation-group-folder-row.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +3 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +116 -106
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +27 -0
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +69 -46
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +230 -165
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.js +22 -25
- package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.cjs +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.cjs.map +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.js +2 -2
- package/dist/components/features/markdown/markdown-table-scroll.js.map +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.js +2 -2
- package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.js +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/llm-balance.cjs +2 -0
- package/dist/constants/llm-balance.cjs.map +1 -0
- package/dist/constants/llm-balance.d.ts +13 -0
- package/dist/constants/llm-balance.js +6 -0
- package/dist/constants/llm-balance.js.map +1 -0
- package/dist/contexts/conversation-websocket-context.cjs +2 -2
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +217 -209
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/chat/use-grip-resize.cjs +1 -1
- package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
- package/dist/hooks/chat/use-grip-resize.d.ts +1 -0
- package/dist/hooks/chat/use-grip-resize.js +39 -30
- package/dist/hooks/chat/use-grip-resize.js.map +1 -1
- package/dist/hooks/mutation/use-condense-conversation.cjs +2 -0
- package/dist/hooks/mutation/use-condense-conversation.cjs.map +1 -0
- package/dist/hooks/mutation/use-condense-conversation.d.ts +12 -0
- package/dist/hooks/mutation/use-condense-conversation.js +17 -0
- package/dist/hooks/mutation/use-condense-conversation.js.map +1 -0
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +30 -21
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.js +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
- package/dist/hooks/query/use-conversation-metrics.cjs +1 -1
- package/dist/hooks/query/use-conversation-metrics.cjs.map +1 -1
- package/dist/hooks/query/use-conversation-metrics.js +1 -1
- package/dist/hooks/query/use-conversation-metrics.js.map +1 -1
- package/dist/hooks/query/use-llm-balance.cjs +2 -0
- package/dist/hooks/query/use-llm-balance.cjs.map +1 -0
- package/dist/hooks/query/use-llm-balance.d.ts +10 -0
- package/dist/hooks/query/use-llm-balance.js +24 -0
- package/dist/hooks/query/use-llm-balance.js.map +1 -0
- package/dist/hooks/query/use-search-providers.cjs +1 -1
- package/dist/hooks/query/use-search-providers.cjs.map +1 -1
- package/dist/hooks/query/use-search-providers.js +1 -1
- package/dist/hooks/query/use-search-providers.js.map +1 -1
- package/dist/hooks/use-await-context-compaction.cjs +2 -0
- package/dist/hooks/use-await-context-compaction.cjs.map +1 -0
- package/dist/hooks/use-await-context-compaction.d.ts +38 -0
- package/dist/hooks/use-await-context-compaction.js +61 -0
- package/dist/hooks/use-await-context-compaction.js.map +1 -0
- package/dist/hooks/use-compact-context-action.cjs +2 -0
- package/dist/hooks/use-compact-context-action.cjs.map +1 -0
- package/dist/hooks/use-compact-context-action.d.ts +10 -0
- package/dist/hooks/use-compact-context-action.js +61 -0
- package/dist/hooks/use-compact-context-action.js.map +1 -0
- package/dist/hooks/use-context-window-usage.cjs +2 -0
- package/dist/hooks/use-context-window-usage.cjs.map +1 -0
- package/dist/hooks/use-context-window-usage.d.ts +5 -0
- package/dist/hooks/use-context-window-usage.js +20 -0
- package/dist/hooks/use-context-window-usage.js.map +1 -0
- package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
- package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
- package/dist/hooks/use-conversation-name-context-menu.d.ts +0 -3
- package/dist/hooks/use-conversation-name-context-menu.js +54 -57
- package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
- package/dist/hooks/use-drag-resize.cjs +1 -1
- package/dist/hooks/use-drag-resize.cjs.map +1 -1
- package/dist/hooks/use-drag-resize.d.ts +8 -0
- package/dist/hooks/use-drag-resize.js +21 -18
- package/dist/hooks/use-drag-resize.js.map +1 -1
- package/dist/hooks/use-live-conversation-metrics.cjs +2 -0
- package/dist/hooks/use-live-conversation-metrics.cjs.map +1 -0
- package/dist/hooks/use-live-conversation-metrics.d.ts +18 -0
- package/dist/hooks/use-live-conversation-metrics.js +37 -0
- package/dist/hooks/use-live-conversation-metrics.js.map +1 -0
- package/dist/hooks/use-select-conversation-tab.cjs +1 -1
- package/dist/hooks/use-select-conversation-tab.cjs.map +1 -1
- package/dist/hooks/use-select-conversation-tab.js +2 -2
- package/dist/hooks/use-select-conversation-tab.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +27 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +474 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +28 -29
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.js +0 -1
- package/dist/locales/ar/openhands.json +28 -1
- package/dist/locales/ca/openhands.json +28 -1
- package/dist/locales/de/openhands.json +28 -1
- package/dist/locales/en/openhands.json +28 -1
- package/dist/locales/es/openhands.json +28 -1
- package/dist/locales/fr/openhands.json +28 -1
- package/dist/locales/it/openhands.json +28 -1
- package/dist/locales/ja/openhands.json +28 -1
- package/dist/locales/ko-KR/openhands.json +28 -1
- package/dist/locales/no/openhands.json +28 -1
- package/dist/locales/pt/openhands.json +28 -1
- package/dist/locales/tr/openhands.json +28 -1
- package/dist/locales/uk/openhands.json +28 -1
- package/dist/locales/zh-CN/openhands.json +28 -1
- package/dist/locales/zh-TW/openhands.json +28 -1
- package/dist/node_modules/@microlink/react-json-view/dist/main.cjs +5 -5
- package/dist/node_modules/@microlink/react-json-view/dist/main.cjs.map +1 -1
- package/dist/node_modules/@microlink/react-json-view/dist/main.js +5194 -5187
- package/dist/node_modules/@microlink/react-json-view/dist/main.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +21 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +22 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +33 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +56 -22
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +31 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +21 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +21 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +9 -5
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/i18next-http-backend/esm/index.cjs +1 -1
- package/dist/node_modules/i18next-http-backend/esm/index.cjs.map +1 -1
- package/dist/node_modules/i18next-http-backend/esm/index.js +2 -2
- package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js +31 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js.map +1 -0
- package/dist/node_modules/zustand/esm/middleware.cjs +3 -3
- package/dist/node_modules/zustand/esm/middleware.cjs.map +1 -1
- package/dist/node_modules/zustand/esm/middleware.js +33 -31
- package/dist/node_modules/zustand/esm/middleware.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +17 -16
- package/dist/package.js.map +1 -1
- package/dist/routes/usage-tab.cjs +2 -0
- package/dist/routes/usage-tab.cjs.map +1 -0
- package/dist/routes/usage-tab.d.ts +2 -0
- package/dist/routes/usage-tab.js +10 -0
- package/dist/routes/usage-tab.js.map +1 -0
- package/dist/services/child-conversation-launch.cjs +1 -1
- package/dist/services/child-conversation-launch.cjs.map +1 -1
- package/dist/services/child-conversation-launch.js +11 -5
- package/dist/services/child-conversation-launch.js.map +1 -1
- package/dist/stores/archived-conversations-store.cjs +2 -0
- package/dist/stores/archived-conversations-store.cjs.map +1 -0
- package/dist/stores/archived-conversations-store.d.ts +24 -0
- package/dist/stores/archived-conversations-store.js +33 -0
- package/dist/stores/archived-conversations-store.js.map +1 -0
- package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
- package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
- package/dist/stores/conversation-panel-preferences-store.d.ts +3 -0
- package/dist/stores/conversation-panel-preferences-store.js +4 -0
- package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
- package/dist/stores/conversation-store.cjs.map +1 -1
- package/dist/stores/conversation-store.d.ts +1 -1
- package/dist/stores/conversation-store.js.map +1 -1
- package/dist/stores/metrics-store.cjs +1 -1
- package/dist/stores/metrics-store.cjs.map +1 -1
- package/dist/stores/metrics-store.d.ts +1 -0
- package/dist/stores/metrics-store.js +7 -4
- package/dist/stores/metrics-store.js.map +1 -1
- package/dist/types/agent-server/core/events/condensation-event.d.ts +3 -0
- package/dist/types/agent-server/core/events/conversation-state-event.d.ts +4 -6
- package/dist/types/agent-server/type-guards.cjs +1 -1
- package/dist/types/agent-server/type-guards.cjs.map +1 -1
- package/dist/types/agent-server/type-guards.d.ts +5 -0
- package/dist/types/agent-server/type-guards.js +3 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/utils/conversation-local-storage.cjs +1 -1
- package/dist/utils/conversation-local-storage.cjs.map +1 -1
- package/dist/utils/conversation-local-storage.js +2 -1
- package/dist/utils/conversation-local-storage.js.map +1 -1
- package/dist/utils/format-token-count.cjs +2 -0
- package/dist/utils/format-token-count.cjs.map +1 -0
- package/dist/utils/format-token-count.d.ts +3 -0
- package/dist/utils/format-token-count.js +19 -0
- package/dist/utils/format-token-count.js.map +1 -0
- package/dist/utils/hover-reveal-classes.cjs +2 -0
- package/dist/utils/hover-reveal-classes.cjs.map +1 -0
- package/dist/utils/hover-reveal-classes.d.ts +34 -0
- package/dist/utils/hover-reveal-classes.js +41 -0
- package/dist/utils/hover-reveal-classes.js.map +1 -0
- package/dist/utils/is-markdown-file-path.cjs +2 -0
- package/dist/utils/is-markdown-file-path.cjs.map +1 -0
- package/dist/utils/is-markdown-file-path.d.ts +4 -0
- package/dist/utils/is-markdown-file-path.js +14 -0
- package/dist/utils/is-markdown-file-path.js.map +1 -0
- package/dist/utils/mcp-marketplace-utils.cjs +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
- package/dist/utils/mcp-marketplace-utils.d.ts +7 -0
- package/dist/utils/mcp-marketplace-utils.js +19 -16
- package/dist/utils/mcp-marketplace-utils.js.map +1 -1
- package/dist/utils/transcript-export/index.cjs +3 -3
- package/dist/utils/transcript-export/index.cjs.map +1 -1
- package/dist/utils/transcript-export/index.js +12 -12
- package/dist/utils/transcript-export/index.js.map +1 -1
- package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
- package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
- package/dist/utils/transcript-export/load-complete-events.js +4 -4
- package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
- package/dist/utils/workspace-relative-path.cjs +2 -0
- package/dist/utils/workspace-relative-path.cjs.map +1 -0
- package/dist/utils/workspace-relative-path.d.ts +10 -0
- package/dist/utils/workspace-relative-path.js +22 -0
- package/dist/utils/workspace-relative-path.js.map +1 -0
- package/package.json +17 -16
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-process-utils.mjs +6 -1
- package/scripts/dev-safe.mjs +57 -2
- package/build/assets/active-backend-context-B_bg5h9O.js +0 -2
- package/build/assets/agent-profiles-settings-hd2cAIZM.js +0 -1
- package/build/assets/agent-server-conversation-service.api-BheU4HX3.js +0 -86
- package/build/assets/agent-settings-D_SVrWhI.js +0 -1
- package/build/assets/bot-DuN83i3p.js +0 -1
- package/build/assets/browser--eoQOo4M.js +0 -6
- package/build/assets/check-DLOKoFU9.js +0 -1
- package/build/assets/chevron-down-CnIbtM6i.js +0 -1
- package/build/assets/circle-check-CxCYJrpZ.js +0 -1
- package/build/assets/conversation-Cmyw9bFh.js +0 -90
- package/build/assets/conversation-CvoGZ5vC.js +0 -1
- package/build/assets/conversation-panel-CvoGZ5vC.js +0 -1
- package/build/assets/conversation-store-B8Eahyeg.js +0 -6
- package/build/assets/external-link-zWbg5KXS.js +0 -1
- package/build/assets/files-tab-D5zuU5TY.js +0 -1
- package/build/assets/git-provider-icon-zuKz2cwo.js +0 -1
- package/build/assets/git-repo-dropdown-Bo7ciSNX.js +0 -1
- package/build/assets/home-DqyeeFA_.js +0 -1
- package/build/assets/index-home-DqyeeFA_.js +0 -1
- package/build/assets/info-C9lpK5pw.js +0 -1
- package/build/assets/llm-not-configured-banner-DCE_0B4I.js +0 -27
- package/build/assets/llm-settings-8eWBF3Ij.js +0 -1
- package/build/assets/llm-settings-D9ko42Pi.js +0 -1
- package/build/assets/llm-subscription-service-B3K-97lP.js +0 -1
- package/build/assets/loader-circle-C5AnEN8r.js +0 -1
- package/build/assets/manifest-e1c3bc3b.js +0 -1
- package/build/assets/markdown-renderer-DzvgdZey.js +0 -8
- package/build/assets/mcp-marketplace-utils-DSLou4n7.js +0 -1
- package/build/assets/messages-B2l0qLVk.js +0 -40
- package/build/assets/pencil-Bl3GWhgq.js +0 -1
- package/build/assets/plus-CtzlyAoF.js +0 -1
- package/build/assets/recommended-automations-launcher-DIYgUdMm.js +0 -1
- package/build/assets/refresh-cw-B9GhC3QC.js +0 -1
- package/build/assets/root-CRK9fOFd.css +0 -1
- package/build/assets/root-layout-BFN2rCOy.js +0 -2
- package/build/assets/search-CYaiKHRp.js +0 -1
- package/build/assets/shared-conversation-BIAcuORk.js +0 -1
- package/build/assets/shield-check-D2cpEpv3.js +0 -1
- package/build/assets/trash-2-CzDVN-Iw.js +0 -1
- package/build/assets/use-create-conversation-CRf1dCm5.js +0 -1
- package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
- package/build/assets/use-llm-profiles-CHxqoHiN.js +0 -1
- package/build/assets/use-save-agent-profile-CH9_EXQG.js +0 -1
- package/build/assets/utils-DPQfkd-7.js +0 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js +0 -13
- package/build/assets/x-RYDBg-e2.js +0 -1
- package/build/assets/zap-tbKDzCe3.js +0 -1
- package/dist/components/features/conversation/metrics-modal/context-window-section.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/context-window-section.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +0 -6
- package/dist/components/features/conversation/metrics-modal/context-window-section.js +0 -46
- package/dist/components/features/conversation/metrics-modal/context-window-section.js.map +0 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/empty-state.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +0 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.js +0 -18
- package/dist/components/features/conversation/metrics-modal/empty-state.js.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +0 -5
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js +0 -20
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +0 -6
- package/dist/components/features/conversation/metrics-modal/metrics-modal.js +0 -57
- package/dist/components/features/conversation/metrics-modal/metrics-modal.js.map +0 -1
- package/dist/icons/u-credit-card.cjs +0 -2
- package/dist/icons/u-credit-card.cjs.map +0 -1
- package/dist/icons/u-credit-card.js +0 -21
- package/dist/icons/u-credit-card.js.map +0 -1
- /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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useTranslation as e } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
2
|
+
import { I18nKey as t } from "../../../../i18n/declaration.js";
|
|
3
|
+
import { Info as n } from "../../../../node_modules/lucide-react/dist/esm/icons/info.js";
|
|
4
|
+
import { LoaderCircle as r } from "../../../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
5
|
+
import { Minimize as i } from "../../../../node_modules/lucide-react/dist/esm/icons/minimize.js";
|
|
6
|
+
import { StyledTooltip as a } from "../../../shared/buttons/styled-tooltip.js";
|
|
7
|
+
import { useCompactContextAction as o } from "../../../../hooks/use-compact-context-action.js";
|
|
8
|
+
import "./context-meter.js";
|
|
9
|
+
import { BrandButton as s } from "../../settings/brand-button.js";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/features/conversation/usage-panel/compact-context-button.tsx
|
|
12
|
+
function u({ fillPercent: u, perTurnToken: d = 0 }) {
|
|
13
|
+
let { t: f } = e("openhands"), { handleCompact: p, isCompacting: m, isDisabled: h, description: g } = o(d), _ = u > 70;
|
|
14
|
+
return /* @__PURE__ */ l("div", {
|
|
15
|
+
"data-testid": "compact-context-section",
|
|
16
|
+
className: "flex flex-col gap-2 border-t border-[var(--oh-border-subtle)] pt-3",
|
|
17
|
+
children: [_ && /* @__PURE__ */ c("span", {
|
|
18
|
+
className: "text-xs text-amber-500",
|
|
19
|
+
children: f(t.CONVERSATION$CONTEXT_FILLING_UP)
|
|
20
|
+
}), /* @__PURE__ */ l("div", {
|
|
21
|
+
className: "flex items-center gap-2",
|
|
22
|
+
children: [/* @__PURE__ */ c(s, {
|
|
23
|
+
testId: "compact-context-button",
|
|
24
|
+
type: "button",
|
|
25
|
+
variant: _ ? "primary" : "secondary",
|
|
26
|
+
isDisabled: h,
|
|
27
|
+
"aria-busy": m,
|
|
28
|
+
onClick: p,
|
|
29
|
+
startContent: m ? /* @__PURE__ */ c(r, {
|
|
30
|
+
className: "h-4 w-4 animate-spin",
|
|
31
|
+
"aria-hidden": !0
|
|
32
|
+
}) : /* @__PURE__ */ c(i, {
|
|
33
|
+
className: "h-4 w-4",
|
|
34
|
+
"aria-hidden": !0
|
|
35
|
+
}),
|
|
36
|
+
className: "w-fit",
|
|
37
|
+
children: f(t.CONVERSATION$COMPACT_CONTEXT)
|
|
38
|
+
}), /* @__PURE__ */ c(a, {
|
|
39
|
+
content: g,
|
|
40
|
+
placement: "top",
|
|
41
|
+
tooltipClassName: "max-w-[220px] text-xs font-normal leading-relaxed whitespace-normal",
|
|
42
|
+
children: /* @__PURE__ */ c("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
"data-testid": "compact-context-info",
|
|
45
|
+
"aria-label": g,
|
|
46
|
+
className: "flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] transition-colors cursor-help",
|
|
47
|
+
children: /* @__PURE__ */ c(n, {
|
|
48
|
+
className: "size-3.5",
|
|
49
|
+
"aria-hidden": !0
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { u as CompactContextButton };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=compact-context-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact-context-button.js","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/compact-context-button.tsx"],"sourcesContent":["import { Info, Loader2, Minimize } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { BrandButton } from \"#/components/features/settings/brand-button\";\nimport { StyledTooltip } from \"#/components/shared/buttons/styled-tooltip\";\nimport { useCompactContextAction } from \"#/hooks/use-compact-context-action\";\nimport { CONTEXT_FILL_WARNING_PERCENT } from \"./context-meter\";\n\ninterface CompactContextButtonProps {\n /** Current context fill percentage; past the warning threshold the button becomes a prominent CTA. */\n fillPercent: number;\n /** Optional live per-turn token count used as a fallback snapshot before compaction. */\n perTurnToken?: number;\n}\n\n/**\n * \"Compact context\" action: POSTs `/api/conversations/{id}/condense` with a\n * spinner while in flight and toasts for start, completion (with tokens\n * freed), and failure. Disabled while the agent is actively running (the\n * server would race the active step) and promoted to a primary\n * call-to-action once the context fill passes\n * {@link CONTEXT_FILL_WARNING_PERCENT}.\n */\nexport function CompactContextButton({\n fillPercent,\n perTurnToken = 0,\n}: CompactContextButtonProps) {\n const { t } = useTranslation(\"openhands\");\n const { handleCompact, isCompacting, isDisabled, description } =\n useCompactContextAction(perTurnToken);\n const isHighFill = fillPercent > CONTEXT_FILL_WARNING_PERCENT;\n\n return (\n <div\n data-testid=\"compact-context-section\"\n className=\"flex flex-col gap-2 border-t border-[var(--oh-border-subtle)] pt-3\"\n >\n {isHighFill && (\n <span className=\"text-xs text-amber-500\">\n {t(I18nKey.CONVERSATION$CONTEXT_FILLING_UP)}\n </span>\n )}\n <div className=\"flex items-center gap-2\">\n <BrandButton\n testId=\"compact-context-button\"\n type=\"button\"\n variant={isHighFill ? \"primary\" : \"secondary\"}\n isDisabled={isDisabled}\n aria-busy={isCompacting}\n onClick={handleCompact}\n startContent={\n isCompacting ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" aria-hidden />\n ) : (\n <Minimize className=\"h-4 w-4\" aria-hidden />\n )\n }\n className=\"w-fit\"\n >\n {t(I18nKey.CONVERSATION$COMPACT_CONTEXT)}\n </BrandButton>\n <StyledTooltip\n content={description}\n placement=\"top\"\n tooltipClassName=\"max-w-[220px] text-xs font-normal leading-relaxed whitespace-normal\"\n >\n <button\n type=\"button\"\n data-testid=\"compact-context-info\"\n aria-label={description}\n className=\"flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] transition-colors cursor-help\"\n >\n <Info className=\"size-3.5\" aria-hidden />\n </button>\n </StyledTooltip>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAuBA,SAAgB,EAAqB,EACnC,gBACA,kBAAe,KACa;CAC5B,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,EAAE,kBAAe,iBAAc,eAAY,mBAC/C,EAAwB,CAAY,GAChC,IAAa,IAAA;CAEnB,OACE,kBAAC,OAAD;EACE,eAAY;EACZ,WAAU;YAFZ,CAIG,KACC,kBAAC,QAAD;GAAM,WAAU;aACb,EAAE,EAAQ,+BAA+B;EACtC,CAAA,GAER,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,GAAD;IACE,QAAO;IACP,MAAK;IACL,SAAS,IAAa,YAAY;IACtB;IACZ,aAAW;IACX,SAAS;IACT,cACE,IACE,kBAAC,GAAD;KAAS,WAAU;KAAuB,eAAA;IAAa,CAAA,IAEvD,kBAAC,GAAD;KAAU,WAAU;KAAU,eAAA;IAAa,CAAA;IAG/C,WAAU;cAET,EAAE,EAAQ,4BAA4B;GAC5B,CAAA,GACb,kBAAC,GAAD;IACE,SAAS;IACT,WAAU;IACV,kBAAiB;cAEjB,kBAAC,UAAD;KACE,MAAK;KACL,eAAY;KACZ,cAAY;KACZ,WAAU;eAEV,kBAAC,GAAD;MAAM,WAAU;MAAW,eAAA;KAAa,CAAA;IAClC,CAAA;GACK,CAAA,CACZ;IACF;;AAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("../../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),t=require("../../../../i18n/declaration.cjs"),n=require("../../../../utils/utils.cjs"),r=require("../../../../utils/format-token-count.cjs");let i=require("react/jsx-runtime");function a(e){return e>90?`danger`:e>70?`warning`:`neutral`}function o({perTurnToken:o,contextWindow:s}){let{t:c}=e.useTranslation(`openhands`),l=s<=0,u=r.getContextWindowUsagePercentage(o,s),d=a(u),f=d===`warning`,p=d===`danger`,m=Math.round(u),h=Math.max(0,100-m),g=l?c(t.I18nKey.CONVERSATION$CONTEXT_WINDOW_UNKNOWN):`${m}% ${c(t.I18nKey.CONVERSATION$USED)} (${h}% ${c(t.I18nKey.CONVERSATION$LEFT)})`;return(0,i.jsxs)(`div`,{"data-testid":`context-meter`,className:`flex flex-col gap-2`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,i.jsx)(`span`,{className:`font-semibold`,children:c(t.I18nKey.CONVERSATION$CONTEXT_WINDOW)}),(0,i.jsx)(`span`,{className:n.cn(`shrink-0 text-xs`,p?`text-red-500`:f?`text-amber-500`:`text-[var(--oh-muted)]`),children:g})]}),(0,i.jsx)(`div`,{className:`relative h-1.5 w-full rounded-full bg-tertiary`,children:(0,i.jsx)(`div`,{"data-testid":`context-meter-bar`,className:n.cn(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,p?`bg-red-500`:f?`bg-amber-500`:`bg-foreground`),style:{width:`${u}%`}})}),(0,i.jsx)(`div`,{className:`flex justify-end`,children:(0,i.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:l?o.toLocaleString():`${o.toLocaleString()} / ${s.toLocaleString()}`})})]})}exports.ContextMeter=o,exports.getContextFillTone=a;
|
|
2
|
+
//# sourceMappingURL=context-meter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-meter.cjs","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/context-meter.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { cn } from \"#/utils/utils\";\nimport { getContextWindowUsagePercentage } from \"#/utils/format-token-count\";\n\n/** Context fill percentage above which the meter warns and the compact CTA becomes prominent. */\nexport const CONTEXT_FILL_WARNING_PERCENT = 70;\n/** Context fill percentage above which the meter signals danger. */\nexport const CONTEXT_FILL_DANGER_PERCENT = 90;\n\nexport type ContextFillTone = \"neutral\" | \"warning\" | \"danger\";\n\nexport function getContextFillTone(usagePercentage: number): ContextFillTone {\n if (usagePercentage > CONTEXT_FILL_DANGER_PERCENT) {\n return \"danger\";\n }\n if (usagePercentage > CONTEXT_FILL_WARNING_PERCENT) {\n return \"warning\";\n }\n return \"neutral\";\n}\n\ninterface ContextMeterProps {\n /** Tokens currently held in the agent's context (`per_turn_token`). */\n perTurnToken: number;\n /** Model context window size in tokens. */\n contextWindow: number;\n}\n\n/**\n * Context-fill progress bar: neutral below\n * {@link CONTEXT_FILL_WARNING_PERCENT}, amber above it, red above\n * {@link CONTEXT_FILL_DANGER_PERCENT}. Shows the raw token numbers underneath.\n */\nexport function ContextMeter({\n perTurnToken,\n contextWindow,\n}: ContextMeterProps) {\n const { t } = useTranslation(\"openhands\");\n\n // Some models (e.g. via OpenRouter) report no context window size; show the\n // raw token count without a misleading \"x / 0\" or \"0.0% used\" readout.\n const isWindowUnknown = contextWindow <= 0;\n\n // Capped at 100 by getContextWindowUsagePercentage, so the bar width and\n // the label never read above a full window.\n const usagePercentage = getContextWindowUsagePercentage(\n perTurnToken,\n contextWindow,\n );\n const tone = getContextFillTone(usagePercentage);\n const isWarning = tone === \"warning\";\n const isDanger = tone === \"danger\";\n const roundedPercentage = Math.round(usagePercentage);\n const remainingPercentage = Math.max(0, 100 - roundedPercentage);\n const usagePercentLabel = isWindowUnknown\n ? t(I18nKey.CONVERSATION$CONTEXT_WINDOW_UNKNOWN)\n : `${roundedPercentage}% ${t(I18nKey.CONVERSATION$USED)} (${remainingPercentage}% ${t(I18nKey.CONVERSATION$LEFT)})`;\n\n return (\n <div data-testid=\"context-meter\" className=\"flex flex-col gap-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"font-semibold\">\n {t(I18nKey.CONVERSATION$CONTEXT_WINDOW)}\n </span>\n <span\n className={cn(\n \"shrink-0 text-xs\",\n isDanger\n ? \"text-red-500\"\n : isWarning\n ? \"text-amber-500\"\n : \"text-[var(--oh-muted)]\",\n )}\n >\n {usagePercentLabel}\n </span>\n </div>\n <div className=\"relative h-1.5 w-full rounded-full bg-tertiary\">\n <div\n data-testid=\"context-meter-bar\"\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full transition-all duration-300\",\n isDanger\n ? \"bg-red-500\"\n : isWarning\n ? \"bg-amber-500\"\n : \"bg-foreground\",\n )}\n // runtime usage-percentage width\n style={{ width: `${usagePercentage}%` }}\n />\n </div>\n <div className=\"flex justify-end\">\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {isWindowUnknown\n ? perTurnToken.toLocaleString()\n : `${perTurnToken.toLocaleString()} / ${contextWindow.toLocaleString()}`}\n </span>\n </div>\n </div>\n );\n}\n"],"mappings":"2TAYA,SAAgB,EAAmB,EAA0C,CAO3E,OANI,EAAA,GACK,SAEL,EAAA,GACK,UAEF,SACT,CAcA,SAAgB,EAAa,CAC3B,eACA,iBACoB,CACpB,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAIlC,EAAkB,GAAiB,EAInC,EAAkB,EAAA,gCACtB,EACA,CACF,EACM,EAAO,EAAmB,CAAe,EACzC,EAAY,IAAS,UACrB,EAAW,IAAS,SACpB,EAAoB,KAAK,MAAM,CAAe,EAC9C,EAAsB,KAAK,IAAI,EAAG,IAAM,CAAiB,EACzD,EAAoB,EACtB,EAAE,EAAA,QAAQ,mCAAmC,EAC7C,GAAG,EAAkB,IAAI,EAAE,EAAA,QAAQ,iBAAiB,EAAE,IAAI,EAAoB,IAAI,EAAE,EAAA,QAAQ,iBAAiB,EAAE,GAEnH,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,cAAY,gBAAgB,UAAU,+BAA3C,EACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,mDAAf,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,yBACb,EAAE,EAAA,QAAQ,2BAA2B,CAClC,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,EAAA,GACT,mBACA,EACI,eACA,EACE,iBACA,wBACR,WAEC,CACG,CAAA,CACH,KACL,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,2DACb,EAAA,EAAA,KAAC,MAAD,CACE,cAAY,oBACZ,UAAW,EAAA,GACT,qEACA,EACI,aACA,EACE,eACA,eACR,EAEA,MAAO,CAAE,MAAO,GAAG,EAAgB,EAAG,CACvC,CAAA,CACE,CAAA,GACL,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,6BACb,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0CACb,EACG,EAAa,eAAe,EAC5B,GAAG,EAAa,eAAe,EAAE,KAAK,EAAc,eAAe,GACnE,CAAA,CACH,CAAA,CACF,GAET"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Context fill percentage above which the meter warns and the compact CTA becomes prominent. */
|
|
2
|
+
export declare const CONTEXT_FILL_WARNING_PERCENT = 70;
|
|
3
|
+
/** Context fill percentage above which the meter signals danger. */
|
|
4
|
+
export declare const CONTEXT_FILL_DANGER_PERCENT = 90;
|
|
5
|
+
export type ContextFillTone = "neutral" | "warning" | "danger";
|
|
6
|
+
export declare function getContextFillTone(usagePercentage: number): ContextFillTone;
|
|
7
|
+
interface ContextMeterProps {
|
|
8
|
+
/** Tokens currently held in the agent's context (`per_turn_token`). */
|
|
9
|
+
perTurnToken: number;
|
|
10
|
+
/** Model context window size in tokens. */
|
|
11
|
+
contextWindow: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Context-fill progress bar: neutral below
|
|
15
|
+
* {@link CONTEXT_FILL_WARNING_PERCENT}, amber above it, red above
|
|
16
|
+
* {@link CONTEXT_FILL_DANGER_PERCENT}. Shows the raw token numbers underneath.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ContextMeter({ perTurnToken, contextWindow, }: ContextMeterProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useTranslation as e } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
2
|
+
import { I18nKey as t } from "../../../../i18n/declaration.js";
|
|
3
|
+
import { cn as n } from "../../../../utils/utils.js";
|
|
4
|
+
import { getContextWindowUsagePercentage as r } from "../../../../utils/format-token-count.js";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
function o(e) {
|
|
7
|
+
return e > 90 ? "danger" : e > 70 ? "warning" : "neutral";
|
|
8
|
+
}
|
|
9
|
+
function s({ perTurnToken: s, contextWindow: c }) {
|
|
10
|
+
let { t: l } = e("openhands"), u = c <= 0, d = r(s, c), f = o(d), p = f === "warning", m = f === "danger", h = Math.round(d), g = Math.max(0, 100 - h), _ = u ? l(t.CONVERSATION$CONTEXT_WINDOW_UNKNOWN) : `${h}% ${l(t.CONVERSATION$USED)} (${g}% ${l(t.CONVERSATION$LEFT)})`;
|
|
11
|
+
return /* @__PURE__ */ a("div", {
|
|
12
|
+
"data-testid": "context-meter",
|
|
13
|
+
className: "flex flex-col gap-2",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ a("div", {
|
|
16
|
+
className: "flex items-center justify-between gap-2",
|
|
17
|
+
children: [/* @__PURE__ */ i("span", {
|
|
18
|
+
className: "font-semibold",
|
|
19
|
+
children: l(t.CONVERSATION$CONTEXT_WINDOW)
|
|
20
|
+
}), /* @__PURE__ */ i("span", {
|
|
21
|
+
className: n("shrink-0 text-xs", m ? "text-red-500" : p ? "text-amber-500" : "text-[var(--oh-muted)]"),
|
|
22
|
+
children: _
|
|
23
|
+
})]
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ i("div", {
|
|
26
|
+
className: "relative h-1.5 w-full rounded-full bg-tertiary",
|
|
27
|
+
children: /* @__PURE__ */ i("div", {
|
|
28
|
+
"data-testid": "context-meter-bar",
|
|
29
|
+
className: n("absolute inset-y-0 left-0 rounded-full transition-all duration-300", m ? "bg-red-500" : p ? "bg-amber-500" : "bg-foreground"),
|
|
30
|
+
style: { width: `${d}%` }
|
|
31
|
+
})
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ i("div", {
|
|
34
|
+
className: "flex justify-end",
|
|
35
|
+
children: /* @__PURE__ */ i("span", {
|
|
36
|
+
className: "text-xs text-[var(--oh-muted)]",
|
|
37
|
+
children: u ? s.toLocaleString() : `${s.toLocaleString()} / ${c.toLocaleString()}`
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as ContextMeter, o as getContextFillTone };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=context-meter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-meter.js","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/context-meter.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { cn } from \"#/utils/utils\";\nimport { getContextWindowUsagePercentage } from \"#/utils/format-token-count\";\n\n/** Context fill percentage above which the meter warns and the compact CTA becomes prominent. */\nexport const CONTEXT_FILL_WARNING_PERCENT = 70;\n/** Context fill percentage above which the meter signals danger. */\nexport const CONTEXT_FILL_DANGER_PERCENT = 90;\n\nexport type ContextFillTone = \"neutral\" | \"warning\" | \"danger\";\n\nexport function getContextFillTone(usagePercentage: number): ContextFillTone {\n if (usagePercentage > CONTEXT_FILL_DANGER_PERCENT) {\n return \"danger\";\n }\n if (usagePercentage > CONTEXT_FILL_WARNING_PERCENT) {\n return \"warning\";\n }\n return \"neutral\";\n}\n\ninterface ContextMeterProps {\n /** Tokens currently held in the agent's context (`per_turn_token`). */\n perTurnToken: number;\n /** Model context window size in tokens. */\n contextWindow: number;\n}\n\n/**\n * Context-fill progress bar: neutral below\n * {@link CONTEXT_FILL_WARNING_PERCENT}, amber above it, red above\n * {@link CONTEXT_FILL_DANGER_PERCENT}. Shows the raw token numbers underneath.\n */\nexport function ContextMeter({\n perTurnToken,\n contextWindow,\n}: ContextMeterProps) {\n const { t } = useTranslation(\"openhands\");\n\n // Some models (e.g. via OpenRouter) report no context window size; show the\n // raw token count without a misleading \"x / 0\" or \"0.0% used\" readout.\n const isWindowUnknown = contextWindow <= 0;\n\n // Capped at 100 by getContextWindowUsagePercentage, so the bar width and\n // the label never read above a full window.\n const usagePercentage = getContextWindowUsagePercentage(\n perTurnToken,\n contextWindow,\n );\n const tone = getContextFillTone(usagePercentage);\n const isWarning = tone === \"warning\";\n const isDanger = tone === \"danger\";\n const roundedPercentage = Math.round(usagePercentage);\n const remainingPercentage = Math.max(0, 100 - roundedPercentage);\n const usagePercentLabel = isWindowUnknown\n ? t(I18nKey.CONVERSATION$CONTEXT_WINDOW_UNKNOWN)\n : `${roundedPercentage}% ${t(I18nKey.CONVERSATION$USED)} (${remainingPercentage}% ${t(I18nKey.CONVERSATION$LEFT)})`;\n\n return (\n <div data-testid=\"context-meter\" className=\"flex flex-col gap-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"font-semibold\">\n {t(I18nKey.CONVERSATION$CONTEXT_WINDOW)}\n </span>\n <span\n className={cn(\n \"shrink-0 text-xs\",\n isDanger\n ? \"text-red-500\"\n : isWarning\n ? \"text-amber-500\"\n : \"text-[var(--oh-muted)]\",\n )}\n >\n {usagePercentLabel}\n </span>\n </div>\n <div className=\"relative h-1.5 w-full rounded-full bg-tertiary\">\n <div\n data-testid=\"context-meter-bar\"\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full transition-all duration-300\",\n isDanger\n ? \"bg-red-500\"\n : isWarning\n ? \"bg-amber-500\"\n : \"bg-foreground\",\n )}\n // runtime usage-percentage width\n style={{ width: `${usagePercentage}%` }}\n />\n </div>\n <div className=\"flex justify-end\">\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {isWindowUnknown\n ? perTurnToken.toLocaleString()\n : `${perTurnToken.toLocaleString()} / ${contextWindow.toLocaleString()}`}\n </span>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAYA,SAAgB,EAAmB,GAA0C;CAO3E,OANI,IAAA,KACK,WAEL,IAAA,KACK,YAEF;AACT;AAcA,SAAgB,EAAa,EAC3B,iBACA,oBACoB;CACpB,IAAM,EAAE,SAAM,EAAe,WAAW,GAIlC,IAAkB,KAAiB,GAInC,IAAkB,EACtB,GACA,CACF,GACM,IAAO,EAAmB,CAAe,GACzC,IAAY,MAAS,WACrB,IAAW,MAAS,UACpB,IAAoB,KAAK,MAAM,CAAe,GAC9C,IAAsB,KAAK,IAAI,GAAG,MAAM,CAAiB,GACzD,IAAoB,IACtB,EAAE,EAAQ,mCAAmC,IAC7C,GAAG,EAAkB,IAAI,EAAE,EAAQ,iBAAiB,EAAE,IAAI,EAAoB,IAAI,EAAE,EAAQ,iBAAiB,EAAE;CAEnH,OACE,kBAAC,OAAD;EAAK,eAAY;EAAgB,WAAU;YAA3C;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAE,EAAQ,2BAA2B;IAClC,CAAA,GACN,kBAAC,QAAD;KACE,WAAW,EACT,oBACA,IACI,iBACA,IACE,mBACA,wBACR;eAEC;IACG,CAAA,CACH;;GACL,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KACE,eAAY;KACZ,WAAW,EACT,sEACA,IACI,eACA,IACE,iBACA,eACR;KAEA,OAAO,EAAE,OAAO,GAAG,EAAgB,GAAG;IACvC,CAAA;GACE,CAAA;GACL,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,QAAD;KAAM,WAAU;eACb,IACG,EAAa,eAAe,IAC5B,GAAG,EAAa,eAAe,EAAE,KAAK,EAAc,eAAe;IACnE,CAAA;GACH,CAAA;EACF;;AAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("../../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),t=require("../../../../i18n/declaration.cjs"),n=require("../../../../node_modules/lucide-react/dist/esm/icons/refresh-cw.cjs"),r=require("../../../../utils/utils.cjs"),i=require("../../../../hooks/query/use-active-conversation.cjs"),a=require("../metrics-modal/metric-row.cjs"),o=require("../../../../hooks/query/use-llm-balance.cjs");let s=require("react/jsx-runtime");function c(e){return`$${e.toFixed(2)}`}function l(){let{t:l}=e.useTranslation(`openhands`),{data:u}=i.useActiveConversation(),{data:d,isError:f,isFetching:p,refetch:m}=o.useLLMBalance(u?.id);if(!d||f)return null;let h=d.limit!==null&&d.limitRemaining!==null;return(0,s.jsxs)(`div`,{"data-testid":`provider-balance-card`,className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between pb-2`,children:[(0,s.jsx)(`span`,{className:`font-semibold`,children:l(t.I18nKey.CONVERSATION$PROVIDER_BALANCE)}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[d.provider,d.isFreeTier?` · ${l(t.I18nKey.CONVERSATION$FREE_TIER)}`:null]}),(0,s.jsx)(`button`,{type:`button`,"data-testid":`provider-balance-refresh`,"aria-label":l(t.I18nKey.BUTTON$REFRESH),disabled:p,onClick:()=>m(),className:`cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default`,children:(0,s.jsx)(n.RefreshCw,{className:r.cn(`h-3.5 w-3.5`,p&&`animate-spin`)})})]})]}),(0,s.jsxs)(`div`,{className:`grid gap-3`,children:[h?(0,s.jsx)(a.MetricRow,{label:l(t.I18nKey.CONVERSATION$CREDITS_REMAINING),value:c(d.limitRemaining??0)}):null,(0,s.jsx)(a.MetricRow,{label:l(t.I18nKey.CONVERSATION$CREDITS_USED),value:c(d.usage),valueClassName:h?``:`font-semibold`,labelClassName:h?`text-[var(--oh-muted)]`:``})]})]})}exports.ProviderBalanceCard=l;
|
|
2
|
+
//# sourceMappingURL=provider-balance-card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-balance-card.cjs","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/provider-balance-card.tsx"],"sourcesContent":["import { RefreshCw } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useLLMBalance } from \"#/hooks/query/use-llm-balance\";\nimport { MetricRow } from \"../metrics-modal/metric-row\";\nimport { cn } from \"#/utils/utils\";\n\nfunction formatCredits(amount: number): string {\n return `$${amount.toFixed(2)}`;\n}\n\n/**\n * Remaining credits for the active LLM provider (OpenRouter). Fetched once\n * per conversation load with a manual refresh icon; hidden entirely when the\n * agent server has no `/api/llm/balance` endpoint (404) or the request\n * fails, so older servers degrade gracefully.\n */\nexport function ProviderBalanceCard() {\n const { t } = useTranslation(\"openhands\");\n const { data: conversation } = useActiveConversation();\n const {\n data: balance,\n isError,\n isFetching,\n refetch,\n } = useLLMBalance(conversation?.id);\n\n if (!balance || isError) return null;\n\n const hasCap = balance.limit !== null && balance.limitRemaining !== null;\n\n return (\n <div\n data-testid=\"provider-balance-card\"\n className=\"rounded-md border border-[var(--oh-border)] bg-surface-raised p-3\"\n >\n <div className=\"flex items-center justify-between pb-2\">\n <span className=\"font-semibold\">\n {t(I18nKey.CONVERSATION$PROVIDER_BALANCE)}\n </span>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {balance.provider}\n {balance.isFreeTier\n ? ` · ${t(I18nKey.CONVERSATION$FREE_TIER)}`\n : null}\n </span>\n <button\n type=\"button\"\n data-testid=\"provider-balance-refresh\"\n aria-label={t(I18nKey.BUTTON$REFRESH)}\n disabled={isFetching}\n onClick={() => refetch()}\n className=\"cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default\"\n >\n <RefreshCw\n className={cn(\"h-3.5 w-3.5\", isFetching && \"animate-spin\")}\n />\n </button>\n </div>\n </div>\n <div className=\"grid gap-3\">\n {hasCap ? (\n <MetricRow\n label={t(I18nKey.CONVERSATION$CREDITS_REMAINING)}\n value={formatCredits(balance.limitRemaining ?? 0)}\n />\n ) : null}\n <MetricRow\n label={t(I18nKey.CONVERSATION$CREDITS_USED)}\n value={formatCredits(balance.usage)}\n valueClassName={hasCap ? \"\" : \"font-semibold\"}\n labelClassName={hasCap ? \"text-[var(--oh-muted)]\" : \"\"}\n />\n </div>\n </div>\n );\n}\n"],"mappings":"6fAQA,SAAS,EAAc,EAAwB,CAC7C,MAAO,IAAI,EAAO,QAAQ,CAAC,GAC7B,CAQA,SAAgB,GAAsB,CACpC,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,CAAE,KAAM,GAAiB,EAAA,sBAAsB,EAC/C,CACJ,KAAM,EACN,UACA,aACA,WACE,EAAA,cAAc,GAAc,EAAE,EAElC,GAAI,CAAC,GAAW,EAAS,OAAO,KAEhC,IAAM,EAAS,EAAQ,QAAU,MAAQ,EAAQ,iBAAmB,KAEpE,OACE,EAAA,EAAA,MAAC,MAAD,CACE,cAAY,wBACZ,UAAU,6EAFZ,EAIE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,kDAAf,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,yBACb,EAAE,EAAA,QAAQ,6BAA6B,CACpC,CAAA,GACN,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,mCAAf,EACE,EAAA,EAAA,MAAC,OAAD,CAAM,UAAU,0CAAhB,CACG,EAAQ,SACR,EAAQ,WACL,MAAM,EAAE,EAAA,QAAQ,sBAAsB,IACtC,IACA,KACN,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,cAAY,2BACZ,aAAY,EAAE,EAAA,QAAQ,cAAc,EACpC,SAAU,EACV,YAAe,EAAQ,EACvB,UAAU,4GAEV,EAAA,EAAA,KAAC,EAAA,UAAD,CACE,UAAW,EAAA,GAAG,cAAe,GAAc,cAAc,CAC1D,CAAA,CACK,CAAA,CACL,GACF,KACL,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sBAAf,CACG,GACC,EAAA,EAAA,KAAC,EAAA,UAAD,CACE,MAAO,EAAE,EAAA,QAAQ,8BAA8B,EAC/C,MAAO,EAAc,EAAQ,gBAAkB,CAAC,CACjD,CAAA,EACC,MACJ,EAAA,EAAA,KAAC,EAAA,UAAD,CACE,MAAO,EAAE,EAAA,QAAQ,yBAAyB,EAC1C,MAAO,EAAc,EAAQ,KAAK,EAClC,eAAgB,EAAS,GAAK,gBAC9B,eAAgB,EAAS,yBAA2B,EACrD,CAAA,CACE,GACF,GAET"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remaining credits for the active LLM provider (OpenRouter). Fetched once
|
|
3
|
+
* per conversation load with a manual refresh icon; hidden entirely when the
|
|
4
|
+
* agent server has no `/api/llm/balance` endpoint (404) or the request
|
|
5
|
+
* fails, so older servers degrade gracefully.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ProviderBalanceCard(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useTranslation as e } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
2
|
+
import { I18nKey as t } from "../../../../i18n/declaration.js";
|
|
3
|
+
import { RefreshCw as n } from "../../../../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
4
|
+
import { cn as r } from "../../../../utils/utils.js";
|
|
5
|
+
import { useActiveConversation as i } from "../../../../hooks/query/use-active-conversation.js";
|
|
6
|
+
import { MetricRow as a } from "../metrics-modal/metric-row.js";
|
|
7
|
+
import { useLLMBalance as o } from "../../../../hooks/query/use-llm-balance.js";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/features/conversation/usage-panel/provider-balance-card.tsx
|
|
10
|
+
function l(e) {
|
|
11
|
+
return `$${e.toFixed(2)}`;
|
|
12
|
+
}
|
|
13
|
+
function u() {
|
|
14
|
+
let { t: u } = e("openhands"), { data: d } = i(), { data: f, isError: p, isFetching: m, refetch: h } = o(d?.id);
|
|
15
|
+
if (!f || p) return null;
|
|
16
|
+
let g = f.limit !== null && f.limitRemaining !== null;
|
|
17
|
+
return /* @__PURE__ */ c("div", {
|
|
18
|
+
"data-testid": "provider-balance-card",
|
|
19
|
+
className: "rounded-md border border-[var(--oh-border)] bg-surface-raised p-3",
|
|
20
|
+
children: [/* @__PURE__ */ c("div", {
|
|
21
|
+
className: "flex items-center justify-between pb-2",
|
|
22
|
+
children: [/* @__PURE__ */ s("span", {
|
|
23
|
+
className: "font-semibold",
|
|
24
|
+
children: u(t.CONVERSATION$PROVIDER_BALANCE)
|
|
25
|
+
}), /* @__PURE__ */ c("div", {
|
|
26
|
+
className: "flex items-center gap-2",
|
|
27
|
+
children: [/* @__PURE__ */ c("span", {
|
|
28
|
+
className: "text-xs text-[var(--oh-muted)]",
|
|
29
|
+
children: [f.provider, f.isFreeTier ? ` · ${u(t.CONVERSATION$FREE_TIER)}` : null]
|
|
30
|
+
}), /* @__PURE__ */ s("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"data-testid": "provider-balance-refresh",
|
|
33
|
+
"aria-label": u(t.BUTTON$REFRESH),
|
|
34
|
+
disabled: m,
|
|
35
|
+
onClick: () => h(),
|
|
36
|
+
className: "cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default",
|
|
37
|
+
children: /* @__PURE__ */ s(n, { className: r("h-3.5 w-3.5", m && "animate-spin") })
|
|
38
|
+
})]
|
|
39
|
+
})]
|
|
40
|
+
}), /* @__PURE__ */ c("div", {
|
|
41
|
+
className: "grid gap-3",
|
|
42
|
+
children: [g ? /* @__PURE__ */ s(a, {
|
|
43
|
+
label: u(t.CONVERSATION$CREDITS_REMAINING),
|
|
44
|
+
value: l(f.limitRemaining ?? 0)
|
|
45
|
+
}) : null, /* @__PURE__ */ s(a, {
|
|
46
|
+
label: u(t.CONVERSATION$CREDITS_USED),
|
|
47
|
+
value: l(f.usage),
|
|
48
|
+
valueClassName: g ? "" : "font-semibold",
|
|
49
|
+
labelClassName: g ? "text-[var(--oh-muted)]" : ""
|
|
50
|
+
})]
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { u as ProviderBalanceCard };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=provider-balance-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider-balance-card.js","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/provider-balance-card.tsx"],"sourcesContent":["import { RefreshCw } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { useLLMBalance } from \"#/hooks/query/use-llm-balance\";\nimport { MetricRow } from \"../metrics-modal/metric-row\";\nimport { cn } from \"#/utils/utils\";\n\nfunction formatCredits(amount: number): string {\n return `$${amount.toFixed(2)}`;\n}\n\n/**\n * Remaining credits for the active LLM provider (OpenRouter). Fetched once\n * per conversation load with a manual refresh icon; hidden entirely when the\n * agent server has no `/api/llm/balance` endpoint (404) or the request\n * fails, so older servers degrade gracefully.\n */\nexport function ProviderBalanceCard() {\n const { t } = useTranslation(\"openhands\");\n const { data: conversation } = useActiveConversation();\n const {\n data: balance,\n isError,\n isFetching,\n refetch,\n } = useLLMBalance(conversation?.id);\n\n if (!balance || isError) return null;\n\n const hasCap = balance.limit !== null && balance.limitRemaining !== null;\n\n return (\n <div\n data-testid=\"provider-balance-card\"\n className=\"rounded-md border border-[var(--oh-border)] bg-surface-raised p-3\"\n >\n <div className=\"flex items-center justify-between pb-2\">\n <span className=\"font-semibold\">\n {t(I18nKey.CONVERSATION$PROVIDER_BALANCE)}\n </span>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {balance.provider}\n {balance.isFreeTier\n ? ` · ${t(I18nKey.CONVERSATION$FREE_TIER)}`\n : null}\n </span>\n <button\n type=\"button\"\n data-testid=\"provider-balance-refresh\"\n aria-label={t(I18nKey.BUTTON$REFRESH)}\n disabled={isFetching}\n onClick={() => refetch()}\n className=\"cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default\"\n >\n <RefreshCw\n className={cn(\"h-3.5 w-3.5\", isFetching && \"animate-spin\")}\n />\n </button>\n </div>\n </div>\n <div className=\"grid gap-3\">\n {hasCap ? (\n <MetricRow\n label={t(I18nKey.CONVERSATION$CREDITS_REMAINING)}\n value={formatCredits(balance.limitRemaining ?? 0)}\n />\n ) : null}\n <MetricRow\n label={t(I18nKey.CONVERSATION$CREDITS_USED)}\n value={formatCredits(balance.usage)}\n valueClassName={hasCap ? \"\" : \"font-semibold\"}\n labelClassName={hasCap ? \"text-[var(--oh-muted)]\" : \"\"}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,SAAS,EAAc,GAAwB;CAC7C,OAAO,IAAI,EAAO,QAAQ,CAAC;AAC7B;AAQA,SAAgB,IAAsB;CACpC,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,EAAE,MAAM,MAAiB,EAAsB,GAC/C,EACJ,MAAM,GACN,YACA,eACA,eACE,EAAc,GAAc,EAAE;CAElC,IAAI,CAAC,KAAW,GAAS,OAAO;CAEhC,IAAM,IAAS,EAAQ,UAAU,QAAQ,EAAQ,mBAAmB;CAEpE,OACE,kBAAC,OAAD;EACE,eAAY;EACZ,WAAU;YAFZ,CAIE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cACb,EAAE,EAAQ,6BAA6B;GACpC,CAAA,GACN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAhB,CACG,EAAQ,UACR,EAAQ,aACL,MAAM,EAAE,EAAQ,sBAAsB,MACtC,IACA;QACN,kBAAC,UAAD;KACE,MAAK;KACL,eAAY;KACZ,cAAY,EAAE,EAAQ,cAAc;KACpC,UAAU;KACV,eAAe,EAAQ;KACvB,WAAU;eAEV,kBAAC,GAAD,EACE,WAAW,EAAG,eAAe,KAAc,cAAc,EAC1D,CAAA;IACK,CAAA,CACL;KACF;MACL,kBAAC,OAAD;GAAK,WAAU;aAAf,CACG,IACC,kBAAC,GAAD;IACE,OAAO,EAAE,EAAQ,8BAA8B;IAC/C,OAAO,EAAc,EAAQ,kBAAkB,CAAC;GACjD,CAAA,IACC,MACJ,kBAAC,GAAD;IACE,OAAO,EAAE,EAAQ,yBAAyB;IAC1C,OAAO,EAAc,EAAQ,KAAK;IAClC,gBAAgB,IAAS,KAAK;IAC9B,gBAAgB,IAAS,2BAA2B;GACrD,CAAA,CACE;IACF;;AAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("../../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),t=require("../../../../i18n/declaration.cjs"),n=require("../../../../node_modules/lucide-react/dist/esm/icons/gauge.cjs"),r=require("../conversation-tab-empty-state.cjs"),i=require("../../../../hooks/query/use-active-conversation.cjs"),a=require("../../../../utils/format-token-count.cjs"),o=require("./context-meter.cjs"),s=require("../../../../hooks/use-live-conversation-metrics.cjs"),c=require("../metrics-modal/cost-section.cjs"),l=require("../metrics-modal/usage-section.cjs"),u=require("./compact-context-button.cjs"),d=require("./provider-balance-card.cjs");let f=require("react/jsx-runtime");function p(){let{t:p}=e.useTranslation(`openhands`),m=s.useLiveConversationMetrics(),{data:h}=i.useActiveConversation(),g=h?.agent_kind===`acp`,{usage:_}=m;return m.cost!==null||_!==null?(0,f.jsxs)(`main`,{"data-testid":`usage-panel`,className:`h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3`,children:[_!==null&&(0,f.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,f.jsxs)(`div`,{className:`grid gap-3`,children:[(0,f.jsx)(o.ContextMeter,{perTurnToken:_.per_turn_token,contextWindow:_.context_window}),(0,f.jsx)(u.CompactContextButton,{fillPercent:a.getContextWindowUsagePercentage(_.per_turn_token,_.context_window),perTurnToken:_.per_turn_token})]})}),(0,f.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,f.jsxs)(`div`,{className:`grid gap-3`,children:[(0,f.jsx)(`div`,{className:`flex justify-between items-center pb-2`,children:(0,f.jsx)(`span`,{className:`text-lg font-semibold`,children:p(t.I18nKey.CONVERSATION$TOKEN_USAGE)})}),g&&(0,f.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:p(t.I18nKey.CONVERSATION$PLAN_USAGE_NOTE)}),_!==null&&(0,f.jsx)(l.UsageSection,{usage:_}),(0,f.jsx)(c.CostSection,{cost:m.cost,maxBudgetPerTask:m.max_budget_per_task})]})}),(0,f.jsx)(d.ProviderBalanceCard,{})]}):(0,f.jsx)(r.ConversationTabEmptyState,{icon:(0,f.jsx)(n.Gauge,{}),children:p(t.I18nKey.CONVERSATION$NO_METRICS)})}exports.UsagePanel=p;
|
|
2
|
+
//# sourceMappingURL=usage-panel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-panel.cjs","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/usage-panel.tsx"],"sourcesContent":["import { Gauge } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ConversationTabEmptyState } from \"#/components/features/conversation/conversation-tab-empty-state\";\nimport { useLiveConversationMetrics } from \"#/hooks/use-live-conversation-metrics\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { CostSection } from \"../metrics-modal/cost-section\";\nimport { UsageSection } from \"../metrics-modal/usage-section\";\nimport { CompactContextButton } from \"./compact-context-button\";\nimport { ContextMeter } from \"./context-meter\";\nimport { ProviderBalanceCard } from \"./provider-balance-card\";\nimport { getContextWindowUsagePercentage } from \"#/utils/format-token-count\";\n\n/**\n * \"Usage\" right-panel tab: context-fill meter with a manual \"Compact\n * context\" action, accumulated token/cost stats, and the provider credit\n * balance (when the agent server reports one).\n *\n * Metrics come from {@link useLiveConversationMetrics}: live WebSocket\n * updates plus a 30s REST poll while the tab is mounted.\n */\nexport function UsagePanel() {\n const { t } = useTranslation(\"openhands\");\n const metrics = useLiveConversationMetrics();\n const { data: conversation } = useActiveConversation();\n // ACP conversations (e.g. Claude Code) draw on the CLI's own subscription\n // plan; the dollar figure is an API-equivalent estimate, not a bill.\n const isAcp = conversation?.agent_kind === \"acp\";\n\n const { usage } = metrics;\n const hasMetrics = metrics.cost !== null || usage !== null;\n\n if (!hasMetrics) {\n return (\n <ConversationTabEmptyState icon={<Gauge />}>\n {t(I18nKey.CONVERSATION$NO_METRICS)}\n </ConversationTabEmptyState>\n );\n }\n\n return (\n <main\n data-testid=\"usage-panel\"\n className=\"h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3\"\n >\n {usage !== null && (\n <div className=\"rounded-md border border-[var(--oh-border)] bg-surface-raised p-3\">\n <div className=\"grid gap-3\">\n <ContextMeter\n perTurnToken={usage.per_turn_token}\n contextWindow={usage.context_window}\n />\n <CompactContextButton\n fillPercent={getContextWindowUsagePercentage(\n usage.per_turn_token,\n usage.context_window,\n )}\n perTurnToken={usage.per_turn_token}\n />\n </div>\n </div>\n )}\n\n <div className=\"rounded-md border border-[var(--oh-border)] bg-surface-raised p-3\">\n <div className=\"grid gap-3\">\n <div className=\"flex justify-between items-center pb-2\">\n <span className=\"text-lg font-semibold\">\n {t(I18nKey.CONVERSATION$TOKEN_USAGE)}\n </span>\n </div>\n {isAcp && (\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {t(I18nKey.CONVERSATION$PLAN_USAGE_NOTE)}\n </span>\n )}\n {usage !== null && <UsageSection usage={usage} />}\n <CostSection\n cost={metrics.cost}\n maxBudgetPerTask={metrics.max_budget_per_task}\n />\n </div>\n </div>\n\n <ProviderBalanceCard />\n </main>\n );\n}\n"],"mappings":"ouBAqBA,SAAgB,GAAa,CAC3B,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,EAAU,EAAA,2BAA2B,EACrC,CAAE,KAAM,GAAiB,EAAA,sBAAsB,EAG/C,EAAQ,GAAc,aAAe,MAErC,CAAE,SAAU,EAWlB,OAVmB,EAAQ,OAAS,MAAQ,IAAU,MAWpD,EAAA,EAAA,MAAC,OAAD,CACE,cAAY,cACZ,UAAU,kFAFZ,CAIG,IAAU,OACT,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,8EACb,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sBAAf,EACE,EAAA,EAAA,KAAC,EAAA,aAAD,CACE,aAAc,EAAM,eACpB,cAAe,EAAM,cACtB,CAAA,GACD,EAAA,EAAA,KAAC,EAAA,qBAAD,CACE,YAAa,EAAA,gCACX,EAAM,eACN,EAAM,cACR,EACA,aAAc,EAAM,cACrB,CAAA,CACE,GACF,CAAA,GAGP,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,8EACb,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,sBAAf,EACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mDACb,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,iCACb,EAAE,EAAA,QAAQ,wBAAwB,CAC/B,CAAA,CACH,CAAA,EACJ,IACC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0CACb,EAAE,EAAA,QAAQ,4BAA4B,CACnC,CAAA,EAEP,IAAU,OAAQ,EAAA,EAAA,KAAC,EAAA,aAAD,CAAqB,OAAQ,CAAA,GAChD,EAAA,EAAA,KAAC,EAAA,YAAD,CACE,KAAM,EAAQ,KACd,iBAAkB,EAAQ,mBAC3B,CAAA,CACE,GACF,CAAA,GAEL,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAsB,CAAA,CAClB,KAlDJ,EAAA,EAAA,KAAC,EAAA,0BAAD,CAA2B,MAAM,EAAA,EAAA,KAAC,EAAA,MAAD,CAAQ,CAAA,WACtC,EAAE,EAAA,QAAQ,uBAAuB,CACT,CAAA,CAkDjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Usage" right-panel tab: context-fill meter with a manual "Compact
|
|
3
|
+
* context" action, accumulated token/cost stats, and the provider credit
|
|
4
|
+
* balance (when the agent server reports one).
|
|
5
|
+
*
|
|
6
|
+
* Metrics come from {@link useLiveConversationMetrics}: live WebSocket
|
|
7
|
+
* updates plus a 30s REST poll while the tab is mounted.
|
|
8
|
+
*/
|
|
9
|
+
export declare function UsagePanel(): import("react").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useTranslation as e } from "../../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
2
|
+
import { I18nKey as t } from "../../../../i18n/declaration.js";
|
|
3
|
+
import { Gauge as n } from "../../../../node_modules/lucide-react/dist/esm/icons/gauge.js";
|
|
4
|
+
import { ConversationTabEmptyState as r } from "../conversation-tab-empty-state.js";
|
|
5
|
+
import { useActiveConversation as i } from "../../../../hooks/query/use-active-conversation.js";
|
|
6
|
+
import { getContextWindowUsagePercentage as a } from "../../../../utils/format-token-count.js";
|
|
7
|
+
import { ContextMeter as o } from "./context-meter.js";
|
|
8
|
+
import { useLiveConversationMetrics as s } from "../../../../hooks/use-live-conversation-metrics.js";
|
|
9
|
+
import { CostSection as c } from "../metrics-modal/cost-section.js";
|
|
10
|
+
import { UsageSection as l } from "../metrics-modal/usage-section.js";
|
|
11
|
+
import { CompactContextButton as u } from "./compact-context-button.js";
|
|
12
|
+
import { ProviderBalanceCard as d } from "./provider-balance-card.js";
|
|
13
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
14
|
+
//#region src/components/features/conversation/usage-panel/usage-panel.tsx
|
|
15
|
+
function m() {
|
|
16
|
+
let { t: m } = e("openhands"), h = s(), { data: g } = i(), _ = g?.agent_kind === "acp", { usage: v } = h;
|
|
17
|
+
return h.cost !== null || v !== null ? /* @__PURE__ */ p("main", {
|
|
18
|
+
"data-testid": "usage-panel",
|
|
19
|
+
className: "h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3",
|
|
20
|
+
children: [
|
|
21
|
+
v !== null && /* @__PURE__ */ f("div", {
|
|
22
|
+
className: "rounded-md border border-[var(--oh-border)] bg-surface-raised p-3",
|
|
23
|
+
children: /* @__PURE__ */ p("div", {
|
|
24
|
+
className: "grid gap-3",
|
|
25
|
+
children: [/* @__PURE__ */ f(o, {
|
|
26
|
+
perTurnToken: v.per_turn_token,
|
|
27
|
+
contextWindow: v.context_window
|
|
28
|
+
}), /* @__PURE__ */ f(u, {
|
|
29
|
+
fillPercent: a(v.per_turn_token, v.context_window),
|
|
30
|
+
perTurnToken: v.per_turn_token
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ f("div", {
|
|
35
|
+
className: "rounded-md border border-[var(--oh-border)] bg-surface-raised p-3",
|
|
36
|
+
children: /* @__PURE__ */ p("div", {
|
|
37
|
+
className: "grid gap-3",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ f("div", {
|
|
40
|
+
className: "flex justify-between items-center pb-2",
|
|
41
|
+
children: /* @__PURE__ */ f("span", {
|
|
42
|
+
className: "text-lg font-semibold",
|
|
43
|
+
children: m(t.CONVERSATION$TOKEN_USAGE)
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
_ && /* @__PURE__ */ f("span", {
|
|
47
|
+
className: "text-xs text-[var(--oh-muted)]",
|
|
48
|
+
children: m(t.CONVERSATION$PLAN_USAGE_NOTE)
|
|
49
|
+
}),
|
|
50
|
+
v !== null && /* @__PURE__ */ f(l, { usage: v }),
|
|
51
|
+
/* @__PURE__ */ f(c, {
|
|
52
|
+
cost: h.cost,
|
|
53
|
+
maxBudgetPerTask: h.max_budget_per_task
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ f(d, {})
|
|
59
|
+
]
|
|
60
|
+
}) : /* @__PURE__ */ f(r, {
|
|
61
|
+
icon: /* @__PURE__ */ f(n, {}),
|
|
62
|
+
children: m(t.CONVERSATION$NO_METRICS)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { m as UsagePanel };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=usage-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-panel.js","names":[],"sources":["../../../../../src/components/features/conversation/usage-panel/usage-panel.tsx"],"sourcesContent":["import { Gauge } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ConversationTabEmptyState } from \"#/components/features/conversation/conversation-tab-empty-state\";\nimport { useLiveConversationMetrics } from \"#/hooks/use-live-conversation-metrics\";\nimport { useActiveConversation } from \"#/hooks/query/use-active-conversation\";\nimport { CostSection } from \"../metrics-modal/cost-section\";\nimport { UsageSection } from \"../metrics-modal/usage-section\";\nimport { CompactContextButton } from \"./compact-context-button\";\nimport { ContextMeter } from \"./context-meter\";\nimport { ProviderBalanceCard } from \"./provider-balance-card\";\nimport { getContextWindowUsagePercentage } from \"#/utils/format-token-count\";\n\n/**\n * \"Usage\" right-panel tab: context-fill meter with a manual \"Compact\n * context\" action, accumulated token/cost stats, and the provider credit\n * balance (when the agent server reports one).\n *\n * Metrics come from {@link useLiveConversationMetrics}: live WebSocket\n * updates plus a 30s REST poll while the tab is mounted.\n */\nexport function UsagePanel() {\n const { t } = useTranslation(\"openhands\");\n const metrics = useLiveConversationMetrics();\n const { data: conversation } = useActiveConversation();\n // ACP conversations (e.g. Claude Code) draw on the CLI's own subscription\n // plan; the dollar figure is an API-equivalent estimate, not a bill.\n const isAcp = conversation?.agent_kind === \"acp\";\n\n const { usage } = metrics;\n const hasMetrics = metrics.cost !== null || usage !== null;\n\n if (!hasMetrics) {\n return (\n <ConversationTabEmptyState icon={<Gauge />}>\n {t(I18nKey.CONVERSATION$NO_METRICS)}\n </ConversationTabEmptyState>\n );\n }\n\n return (\n <main\n data-testid=\"usage-panel\"\n className=\"h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3\"\n >\n {usage !== null && (\n <div className=\"rounded-md border border-[var(--oh-border)] bg-surface-raised p-3\">\n <div className=\"grid gap-3\">\n <ContextMeter\n perTurnToken={usage.per_turn_token}\n contextWindow={usage.context_window}\n />\n <CompactContextButton\n fillPercent={getContextWindowUsagePercentage(\n usage.per_turn_token,\n usage.context_window,\n )}\n perTurnToken={usage.per_turn_token}\n />\n </div>\n </div>\n )}\n\n <div className=\"rounded-md border border-[var(--oh-border)] bg-surface-raised p-3\">\n <div className=\"grid gap-3\">\n <div className=\"flex justify-between items-center pb-2\">\n <span className=\"text-lg font-semibold\">\n {t(I18nKey.CONVERSATION$TOKEN_USAGE)}\n </span>\n </div>\n {isAcp && (\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {t(I18nKey.CONVERSATION$PLAN_USAGE_NOTE)}\n </span>\n )}\n {usage !== null && <UsageSection usage={usage} />}\n <CostSection\n cost={metrics.cost}\n maxBudgetPerTask={metrics.max_budget_per_task}\n />\n </div>\n </div>\n\n <ProviderBalanceCard />\n </main>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAqBA,SAAgB,IAAa;CAC3B,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,IAAU,EAA2B,GACrC,EAAE,MAAM,MAAiB,EAAsB,GAG/C,IAAQ,GAAc,eAAe,OAErC,EAAE,aAAU;CAWlB,OAVmB,EAAQ,SAAS,QAAQ,MAAU,OAWpD,kBAAC,QAAD;EACE,eAAY;EACZ,WAAU;YAFZ;GAIG,MAAU,QACT,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD;MACE,cAAc,EAAM;MACpB,eAAe,EAAM;KACtB,CAAA,GACD,kBAAC,GAAD;MACE,aAAa,EACX,EAAM,gBACN,EAAM,cACR;MACA,cAAc,EAAM;KACrB,CAAA,CACE;;GACF,CAAA;GAGP,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAE,EAAQ,wBAAwB;OAC/B,CAAA;MACH,CAAA;MACJ,KACC,kBAAC,QAAD;OAAM,WAAU;iBACb,EAAE,EAAQ,4BAA4B;MACnC,CAAA;MAEP,MAAU,QAAQ,kBAAC,GAAD,EAAqB,SAAQ,CAAA;MAChD,kBAAC,GAAD;OACE,MAAM,EAAQ;OACd,kBAAkB,EAAQ;MAC3B,CAAA;KACE;;GACF,CAAA;GAEL,kBAAC,GAAD,CAAsB,CAAA;EAClB;MAlDJ,kBAAC,GAAD;EAA2B,MAAM,kBAAC,GAAD,CAAQ,CAAA;YACtC,EAAE,EAAQ,uBAAuB;CACT,CAAA;AAkDjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),n=require("../../../i18n/declaration.cjs"),r=require("./budget-progress-bar.cjs"),i=require("./budget-usage-text.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");function s({cost:e,maxBudgetPerTask:a}){let{t:s}=t.useTranslation(`openhands`);return e===null?null:(0,o.jsx)(`div`,{
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),n=require("../../../i18n/declaration.cjs"),r=require("./budget-progress-bar.cjs"),i=require("./budget-usage-text.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");function s({cost:e,maxBudgetPerTask:a}){let{t:s}=t.useTranslation(`openhands`);return e===null?null:(0,o.jsx)(`div`,{children:a!==null&&a>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.BudgetProgressBar,{currentCost:e,maxBudget:a}),(0,o.jsx)(i.BudgetUsageText,{currentCost:e,maxBudget:a})]}):(0,o.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:s(n.I18nKey.CONVERSATION$NO_BUDGET_LIMIT)})})}exports.BudgetDisplay=s;
|
|
2
2
|
//# sourceMappingURL=budget-display.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget-display.cjs","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-display.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { BudgetProgressBar } from \"./budget-progress-bar\";\nimport { BudgetUsageText } from \"./budget-usage-text\";\n\ninterface BudgetDisplayProps {\n cost: number | null;\n maxBudgetPerTask: number | null;\n}\n\nexport function BudgetDisplay({ cost, maxBudgetPerTask }: BudgetDisplayProps) {\n const { t } = useTranslation(\"openhands\");\n\n // Don't render anything if cost is not available\n if (cost === null) {\n return null;\n }\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"budget-display.cjs","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-display.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { BudgetProgressBar } from \"./budget-progress-bar\";\nimport { BudgetUsageText } from \"./budget-usage-text\";\n\ninterface BudgetDisplayProps {\n cost: number | null;\n maxBudgetPerTask: number | null;\n}\n\nexport function BudgetDisplay({ cost, maxBudgetPerTask }: BudgetDisplayProps) {\n const { t } = useTranslation(\"openhands\");\n\n // Don't render anything if cost is not available\n if (cost === null) {\n return null;\n }\n\n return (\n <div>\n {maxBudgetPerTask !== null && maxBudgetPerTask > 0 ? (\n <>\n <BudgetProgressBar currentCost={cost} maxBudget={maxBudgetPerTask} />\n <BudgetUsageText currentCost={cost} maxBudget={maxBudgetPerTask} />\n </>\n ) : (\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {t(I18nKey.CONVERSATION$NO_BUDGET_LIMIT)}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":"yUAWA,SAAgB,EAAc,CAAE,OAAM,oBAAwC,CAC5E,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAOxC,OAJI,IAAS,KACJ,MAIP,EAAA,EAAA,KAAC,MAAD,CAAA,SACG,IAAqB,MAAQ,EAAmB,GAC/C,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,kBAAD,CAAmB,YAAa,EAAM,UAAW,CAAmB,CAAA,GACpE,EAAA,EAAA,KAAC,EAAA,gBAAD,CAAiB,YAAa,EAAM,UAAW,CAAmB,CAAA,CAClE,CAAA,CAAA,GAEF,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0CACb,EAAE,EAAA,QAAQ,4BAA4B,CACnC,CAAA,CAEL,CAAA,CAET"}
|
|
@@ -7,19 +7,16 @@ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
|
7
7
|
//#region src/components/features/conversation-panel/budget-display.tsx
|
|
8
8
|
function s({ cost: s, maxBudgetPerTask: c }) {
|
|
9
9
|
let { t: l } = e("openhands");
|
|
10
|
-
return s === null ? null : /* @__PURE__ */ a("div", {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children: l(t.CONVERSATION$NO_BUDGET_LIMIT)
|
|
21
|
-
})
|
|
22
|
-
});
|
|
10
|
+
return s === null ? null : /* @__PURE__ */ a("div", { children: c !== null && c > 0 ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, {
|
|
11
|
+
currentCost: s,
|
|
12
|
+
maxBudget: c
|
|
13
|
+
}), /* @__PURE__ */ a(r, {
|
|
14
|
+
currentCost: s,
|
|
15
|
+
maxBudget: c
|
|
16
|
+
})] }) : /* @__PURE__ */ a("span", {
|
|
17
|
+
className: "text-xs text-[var(--oh-muted)]",
|
|
18
|
+
children: l(t.CONVERSATION$NO_BUDGET_LIMIT)
|
|
19
|
+
}) });
|
|
23
20
|
}
|
|
24
21
|
//#endregion
|
|
25
22
|
export { s as BudgetDisplay };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget-display.js","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-display.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { BudgetProgressBar } from \"./budget-progress-bar\";\nimport { BudgetUsageText } from \"./budget-usage-text\";\n\ninterface BudgetDisplayProps {\n cost: number | null;\n maxBudgetPerTask: number | null;\n}\n\nexport function BudgetDisplay({ cost, maxBudgetPerTask }: BudgetDisplayProps) {\n const { t } = useTranslation(\"openhands\");\n\n // Don't render anything if cost is not available\n if (cost === null) {\n return null;\n }\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"budget-display.js","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-display.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { BudgetProgressBar } from \"./budget-progress-bar\";\nimport { BudgetUsageText } from \"./budget-usage-text\";\n\ninterface BudgetDisplayProps {\n cost: number | null;\n maxBudgetPerTask: number | null;\n}\n\nexport function BudgetDisplay({ cost, maxBudgetPerTask }: BudgetDisplayProps) {\n const { t } = useTranslation(\"openhands\");\n\n // Don't render anything if cost is not available\n if (cost === null) {\n return null;\n }\n\n return (\n <div>\n {maxBudgetPerTask !== null && maxBudgetPerTask > 0 ? (\n <>\n <BudgetProgressBar currentCost={cost} maxBudget={maxBudgetPerTask} />\n <BudgetUsageText currentCost={cost} maxBudget={maxBudgetPerTask} />\n </>\n ) : (\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {t(I18nKey.CONVERSATION$NO_BUDGET_LIMIT)}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,EAAc,EAAE,SAAM,uBAAwC;CAC5E,IAAM,EAAE,SAAM,EAAe,WAAW;CAOxC,OAJI,MAAS,OACJ,OAIP,kBAAC,OAAD,EAAA,UACG,MAAqB,QAAQ,IAAmB,IAC/C,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EAAmB,aAAa;EAAM,WAAW;CAAmB,CAAA,GACpE,kBAAC,GAAD;EAAiB,aAAa;EAAM,WAAW;CAAmB,CAAA,CAClE,EAAA,CAAA,IAEF,kBAAC,QAAD;EAAM,WAAU;YACb,EAAE,EAAQ,4BAA4B;CACnC,CAAA,EAEL,CAAA;AAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../utils/utils.cjs");let t=require("react/jsx-runtime");function n({currentCost:n,maxBudget:r}){let i=n/r*100;return(0,t.jsx)(`div`,{className:`
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../utils/utils.cjs");let t=require("react/jsx-runtime");function n({currentCost:n,maxBudget:r}){let i=n/r*100;return(0,t.jsx)(`div`,{className:`relative mt-1 h-1.5 w-full rounded-full bg-tertiary`,children:(0,t.jsx)(`div`,{className:e.cn(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,i>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,i)}%`}})})}exports.BudgetProgressBar=n;
|
|
2
2
|
//# sourceMappingURL=budget-progress-bar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget-progress-bar.cjs","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-progress-bar.tsx"],"sourcesContent":["import { cn } from \"#/utils/utils\";\n\ninterface BudgetProgressBarProps {\n currentCost: number;\n maxBudget: number;\n}\n\nexport function BudgetProgressBar({\n currentCost,\n maxBudget,\n}: BudgetProgressBarProps) {\n const usagePercentage = (currentCost / maxBudget) * 100;\n const isNearLimit = usagePercentage > 80;\n\n return (\n <div className=\"
|
|
1
|
+
{"version":3,"file":"budget-progress-bar.cjs","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-progress-bar.tsx"],"sourcesContent":["import { cn } from \"#/utils/utils\";\n\ninterface BudgetProgressBarProps {\n currentCost: number;\n maxBudget: number;\n}\n\nexport function BudgetProgressBar({\n currentCost,\n maxBudget,\n}: BudgetProgressBarProps) {\n const usagePercentage = (currentCost / maxBudget) * 100;\n const isNearLimit = usagePercentage > 80;\n\n return (\n <div className=\"relative mt-1 h-1.5 w-full rounded-full bg-tertiary\">\n <div\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full transition-all duration-300\",\n isNearLimit ? \"bg-red-500\" : \"bg-blue-500\",\n )}\n // runtime usage-percentage width\n style={{\n width: `${Math.min(100, usagePercentage)}%`,\n }}\n />\n </div>\n );\n}\n"],"mappings":"kIAOA,SAAgB,EAAkB,CAChC,cACA,aACyB,CACzB,IAAM,EAAmB,EAAc,EAAa,IAGpD,OACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,gEACb,EAAA,EAAA,KAAC,MAAD,CACE,UAAW,EAAA,GACT,qEANY,EAAkB,GAOhB,aAAe,aAC/B,EAEA,MAAO,CACL,MAAO,GAAG,KAAK,IAAI,IAAK,CAAe,EAAE,EAC3C,CACD,CAAA,CACE,CAAA,CAET"}
|
|
@@ -4,9 +4,9 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
4
4
|
function n({ currentCost: n, maxBudget: r }) {
|
|
5
5
|
let i = n / r * 100;
|
|
6
6
|
return /* @__PURE__ */ t("div", {
|
|
7
|
-
className: "
|
|
7
|
+
className: "relative mt-1 h-1.5 w-full rounded-full bg-tertiary",
|
|
8
8
|
children: /* @__PURE__ */ t("div", {
|
|
9
|
-
className: e("
|
|
9
|
+
className: e("absolute inset-y-0 left-0 rounded-full transition-all duration-300", i > 80 ? "bg-red-500" : "bg-blue-500"),
|
|
10
10
|
style: { width: `${Math.min(100, i)}%` }
|
|
11
11
|
})
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget-progress-bar.js","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-progress-bar.tsx"],"sourcesContent":["import { cn } from \"#/utils/utils\";\n\ninterface BudgetProgressBarProps {\n currentCost: number;\n maxBudget: number;\n}\n\nexport function BudgetProgressBar({\n currentCost,\n maxBudget,\n}: BudgetProgressBarProps) {\n const usagePercentage = (currentCost / maxBudget) * 100;\n const isNearLimit = usagePercentage > 80;\n\n return (\n <div className=\"
|
|
1
|
+
{"version":3,"file":"budget-progress-bar.js","names":[],"sources":["../../../../src/components/features/conversation-panel/budget-progress-bar.tsx"],"sourcesContent":["import { cn } from \"#/utils/utils\";\n\ninterface BudgetProgressBarProps {\n currentCost: number;\n maxBudget: number;\n}\n\nexport function BudgetProgressBar({\n currentCost,\n maxBudget,\n}: BudgetProgressBarProps) {\n const usagePercentage = (currentCost / maxBudget) * 100;\n const isNearLimit = usagePercentage > 80;\n\n return (\n <div className=\"relative mt-1 h-1.5 w-full rounded-full bg-tertiary\">\n <div\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full transition-all duration-300\",\n isNearLimit ? \"bg-red-500\" : \"bg-blue-500\",\n )}\n // runtime usage-percentage width\n style={{\n width: `${Math.min(100, usagePercentage)}%`,\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;AAOA,SAAgB,EAAkB,EAChC,gBACA,gBACyB;CACzB,IAAM,IAAmB,IAAc,IAAa;CAGpD,OACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GACE,WAAW,EACT,sEANY,IAAkB,KAOhB,eAAe,aAC/B;GAEA,OAAO,EACL,OAAO,GAAG,KAAK,IAAI,KAAK,CAAe,EAAE,GAC3C;EACD,CAAA;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/Trans.cjs"),n=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),r=require("../../../i18n/declaration.cjs"),i=require("../../shared/modals/modal-backdrop.cjs"),a=require("../../shared/modals/modal-body.cjs"),o=require("../../shared/modals/confirmation-modals/base-modal.cjs"),s=require("../settings/brand-button.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("react/jsx-runtime");function u({onConfirm:e,onCancel:c,conversationTitle:u}){let{t:d}=n.useTranslation(`openhands`),f=u!=null&&u!==``?(0,l.jsx)(t.Trans,{ns:`openhands`,i18nKey:r.I18nKey.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE,values:{title:u},components:{title:(0,l.jsx)(`span`,{className:`text-white`})}}):d(r.I18nKey.CONVERSATION$ARCHIVE_WARNING);return(0,l.jsx)(i.ModalBackdrop,{onClose:c,children:(0,l.jsxs)(a.ModalBody,{className:`items-start border border-[var(--oh-border)]`,children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,l.jsx)(o.BaseModalTitle,{title:d(r.I18nKey.CONVERSATION$CONFIRM_ARCHIVE)}),(0,l.jsx)(o.BaseModalDescription,{children:f})]}),(0,l.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,l.jsx)(s.BrandButton,{type:`button`,variant:`secondary`,onClick:c,testId:`cancel-button`,children:d(r.I18nKey.BUTTON$CANCEL)}),(0,l.jsx)(s.BrandButton,{type:`button`,variant:`primary`,onClick:e,testId:`confirm-button`,children:d(r.I18nKey.ACTION$CONFIRM_ARCHIVE)})]})]})})}exports.ConfirmArchiveModal=u;
|
|
2
|
+
//# sourceMappingURL=confirm-archive-modal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-archive-modal.cjs","names":[],"sources":["../../../../src/components/features/conversation-panel/confirm-archive-modal.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport {\n BaseModalDescription,\n BaseModalTitle,\n} from \"#/components/shared/modals/confirmation-modals/base-modal\";\nimport { ModalBackdrop } from \"#/components/shared/modals/modal-backdrop\";\nimport { ModalBody } from \"#/components/shared/modals/modal-body\";\nimport { BrandButton } from \"../settings/brand-button\";\nimport { I18nKey } from \"#/i18n/declaration\";\n\ninterface ConfirmArchiveModalProps {\n onConfirm: () => void;\n onCancel: () => void;\n conversationTitle?: string;\n}\n\nexport function ConfirmArchiveModal({\n onConfirm,\n onCancel,\n conversationTitle,\n}: ConfirmArchiveModalProps) {\n const { t } = useTranslation(\"openhands\");\n\n const confirmationMessage =\n conversationTitle != null && conversationTitle !== \"\" ? (\n <Trans\n ns=\"openhands\"\n i18nKey={I18nKey.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE}\n values={{ title: conversationTitle }}\n components={{ title: <span className=\"text-white\" /> }}\n />\n ) : (\n t(I18nKey.CONVERSATION$ARCHIVE_WARNING)\n );\n\n return (\n <ModalBackdrop onClose={onCancel}>\n <ModalBody className=\"items-start border border-[var(--oh-border)]\">\n <div className=\"flex flex-col gap-2\">\n <BaseModalTitle title={t(I18nKey.CONVERSATION$CONFIRM_ARCHIVE)} />\n <BaseModalDescription>{confirmationMessage}</BaseModalDescription>\n </div>\n <div\n className=\"flex justify-end gap-2 w-full\"\n onClick={(event) => event.stopPropagation()}\n >\n <BrandButton\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n testId=\"cancel-button\"\n >\n {t(I18nKey.BUTTON$CANCEL)}\n </BrandButton>\n <BrandButton\n type=\"button\"\n variant=\"primary\"\n onClick={onConfirm}\n testId=\"confirm-button\"\n >\n {t(I18nKey.ACTION$CONFIRM_ARCHIVE)}\n </BrandButton>\n </div>\n </ModalBody>\n </ModalBackdrop>\n );\n}\n"],"mappings":"khBAiBA,SAAgB,EAAoB,CAClC,YACA,WACA,qBAC2B,CAC3B,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAElC,EACJ,GAAqB,MAAQ,IAAsB,IACjD,EAAA,EAAA,KAAC,EAAA,MAAD,CACE,GAAG,YACH,QAAS,EAAA,QAAQ,wCACjB,OAAQ,CAAE,MAAO,CAAkB,EACnC,WAAY,CAAE,OAAO,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,YAAc,CAAA,CAAE,CACtD,CAAA,EAED,EAAE,EAAA,QAAQ,4BAA4B,EAG1C,OACE,EAAA,EAAA,KAAC,EAAA,cAAD,CAAe,QAAS,YACtB,EAAA,EAAA,MAAC,EAAA,UAAD,CAAW,UAAU,wDAArB,EACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,+BAAf,EACE,EAAA,EAAA,KAAC,EAAA,eAAD,CAAgB,MAAO,EAAE,EAAA,QAAQ,4BAA4B,CAAI,CAAA,GACjE,EAAA,EAAA,KAAC,EAAA,qBAAD,CAAA,SAAuB,CAA0C,CAAA,CAC9D,KACL,EAAA,EAAA,MAAC,MAAD,CACE,UAAU,gCACV,QAAU,GAAU,EAAM,gBAAgB,WAF5C,EAIE,EAAA,EAAA,KAAC,EAAA,YAAD,CACE,KAAK,SACL,QAAQ,YACR,QAAS,EACT,OAAO,yBAEN,EAAE,EAAA,QAAQ,aAAa,CACb,CAAA,GACb,EAAA,EAAA,KAAC,EAAA,YAAD,CACE,KAAK,SACL,QAAQ,UACR,QAAS,EACT,OAAO,0BAEN,EAAE,EAAA,QAAQ,sBAAsB,CACtB,CAAA,CACV,GACI,GACE,CAAA,CAEnB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ConfirmArchiveModalProps {
|
|
3
|
+
onConfirm: () => void;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
conversationTitle?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function ConfirmArchiveModal({ onConfirm, onCancel, conversationTitle, }: ConfirmArchiveModalProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Trans as e } from "../../../node_modules/react-i18next/dist/es/Trans.js";
|
|
2
|
+
import { useTranslation as t } from "../../../node_modules/react-i18next/dist/es/useTranslation.js";
|
|
3
|
+
import { I18nKey as n } from "../../../i18n/declaration.js";
|
|
4
|
+
import { ModalBackdrop as r } from "../../shared/modals/modal-backdrop.js";
|
|
5
|
+
import { ModalBody as i } from "../../shared/modals/modal-body.js";
|
|
6
|
+
import { BaseModalDescription as a, BaseModalTitle as o } from "../../shared/modals/confirmation-modals/base-modal.js";
|
|
7
|
+
import { BrandButton as s } from "../settings/brand-button.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/features/conversation-panel/confirm-archive-modal.tsx
|
|
11
|
+
function u({ onConfirm: u, onCancel: d, conversationTitle: f }) {
|
|
12
|
+
let { t: p } = t("openhands"), m = f != null && f !== "" ? /* @__PURE__ */ c(e, {
|
|
13
|
+
ns: "openhands",
|
|
14
|
+
i18nKey: n.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE,
|
|
15
|
+
values: { title: f },
|
|
16
|
+
components: { title: /* @__PURE__ */ c("span", { className: "text-white" }) }
|
|
17
|
+
}) : p(n.CONVERSATION$ARCHIVE_WARNING);
|
|
18
|
+
return /* @__PURE__ */ c(r, {
|
|
19
|
+
onClose: d,
|
|
20
|
+
children: /* @__PURE__ */ l(i, {
|
|
21
|
+
className: "items-start border border-[var(--oh-border)]",
|
|
22
|
+
children: [/* @__PURE__ */ l("div", {
|
|
23
|
+
className: "flex flex-col gap-2",
|
|
24
|
+
children: [/* @__PURE__ */ c(o, { title: p(n.CONVERSATION$CONFIRM_ARCHIVE) }), /* @__PURE__ */ c(a, { children: m })]
|
|
25
|
+
}), /* @__PURE__ */ l("div", {
|
|
26
|
+
className: "flex justify-end gap-2 w-full",
|
|
27
|
+
onClick: (e) => e.stopPropagation(),
|
|
28
|
+
children: [/* @__PURE__ */ c(s, {
|
|
29
|
+
type: "button",
|
|
30
|
+
variant: "secondary",
|
|
31
|
+
onClick: d,
|
|
32
|
+
testId: "cancel-button",
|
|
33
|
+
children: p(n.BUTTON$CANCEL)
|
|
34
|
+
}), /* @__PURE__ */ c(s, {
|
|
35
|
+
type: "button",
|
|
36
|
+
variant: "primary",
|
|
37
|
+
onClick: u,
|
|
38
|
+
testId: "confirm-button",
|
|
39
|
+
children: p(n.ACTION$CONFIRM_ARCHIVE)
|
|
40
|
+
})]
|
|
41
|
+
})]
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { u as ConfirmArchiveModal };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=confirm-archive-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-archive-modal.js","names":[],"sources":["../../../../src/components/features/conversation-panel/confirm-archive-modal.tsx"],"sourcesContent":["import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport {\n BaseModalDescription,\n BaseModalTitle,\n} from \"#/components/shared/modals/confirmation-modals/base-modal\";\nimport { ModalBackdrop } from \"#/components/shared/modals/modal-backdrop\";\nimport { ModalBody } from \"#/components/shared/modals/modal-body\";\nimport { BrandButton } from \"../settings/brand-button\";\nimport { I18nKey } from \"#/i18n/declaration\";\n\ninterface ConfirmArchiveModalProps {\n onConfirm: () => void;\n onCancel: () => void;\n conversationTitle?: string;\n}\n\nexport function ConfirmArchiveModal({\n onConfirm,\n onCancel,\n conversationTitle,\n}: ConfirmArchiveModalProps) {\n const { t } = useTranslation(\"openhands\");\n\n const confirmationMessage =\n conversationTitle != null && conversationTitle !== \"\" ? (\n <Trans\n ns=\"openhands\"\n i18nKey={I18nKey.CONVERSATION$ARCHIVE_WARNING_WITH_TITLE}\n values={{ title: conversationTitle }}\n components={{ title: <span className=\"text-white\" /> }}\n />\n ) : (\n t(I18nKey.CONVERSATION$ARCHIVE_WARNING)\n );\n\n return (\n <ModalBackdrop onClose={onCancel}>\n <ModalBody className=\"items-start border border-[var(--oh-border)]\">\n <div className=\"flex flex-col gap-2\">\n <BaseModalTitle title={t(I18nKey.CONVERSATION$CONFIRM_ARCHIVE)} />\n <BaseModalDescription>{confirmationMessage}</BaseModalDescription>\n </div>\n <div\n className=\"flex justify-end gap-2 w-full\"\n onClick={(event) => event.stopPropagation()}\n >\n <BrandButton\n type=\"button\"\n variant=\"secondary\"\n onClick={onCancel}\n testId=\"cancel-button\"\n >\n {t(I18nKey.BUTTON$CANCEL)}\n </BrandButton>\n <BrandButton\n type=\"button\"\n variant=\"primary\"\n onClick={onConfirm}\n testId=\"confirm-button\"\n >\n {t(I18nKey.ACTION$CONFIRM_ARCHIVE)}\n </BrandButton>\n </div>\n </ModalBody>\n </ModalBackdrop>\n );\n}\n"],"mappings":";;;;;;;;;;AAiBA,SAAgB,EAAoB,EAClC,cACA,aACA,wBAC2B;CAC3B,IAAM,EAAE,SAAM,EAAe,WAAW,GAElC,IACJ,KAAqB,QAAQ,MAAsB,KACjD,kBAAC,GAAD;EACE,IAAG;EACH,SAAS,EAAQ;EACjB,QAAQ,EAAE,OAAO,EAAkB;EACnC,YAAY,EAAE,OAAO,kBAAC,QAAD,EAAM,WAAU,aAAc,CAAA,EAAE;CACtD,CAAA,IAED,EAAE,EAAQ,4BAA4B;CAG1C,OACE,kBAAC,GAAD;EAAe,SAAS;YACtB,kBAAC,GAAD;GAAW,WAAU;aAArB,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAgB,OAAO,EAAE,EAAQ,4BAA4B,EAAI,CAAA,GACjE,kBAAC,GAAD,EAAA,UAAuB,EAA0C,CAAA,CAC9D;OACL,kBAAC,OAAD;IACE,WAAU;IACV,UAAU,MAAU,EAAM,gBAAgB;cAF5C,CAIE,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,SAAS;KACT,QAAO;eAEN,EAAE,EAAQ,aAAa;IACb,CAAA,GACb,kBAAC,GAAD;KACE,MAAK;KACL,SAAQ;KACR,SAAS;KACT,QAAO;eAEN,EAAE,EAAQ,sBAAsB;IACtB,CAAA,CACV;KACI;;CACE,CAAA;AAEnB"}
|