@openhands/agent-canvas 1.12.0 → 1.14.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-CYy8qA2z.js} +1 -1
- package/build/assets/active-backend-context-BZDG15C0.js +2 -0
- package/build/assets/{agent-context-settings-CzWS1DgR.js → agent-context-settings-DGWBBbcp.js} +1 -1
- package/build/assets/agent-profiles-settings-DrkGdf4_.js +1 -0
- package/build/assets/agent-server-conversation-service.api-DK56YPTs.js +86 -0
- package/build/assets/{agent-settings-D2J1dKVd.js → agent-settings-DfcSgkLD.js} +2 -2
- package/build/assets/agent-settings-Lrc5-twS.js +1 -0
- package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-BgDHhL7b.js} +1 -1
- package/build/assets/api-error-message-BEIE_yD1.js +1 -0
- package/build/assets/{api-key-entry-screen-D70oJj2c.js → api-key-entry-screen-DaZnOlVo.js} +1 -1
- package/build/assets/{app-settings-D0OKHB3M.js → app-settings-BG5NAUbC.js} +1 -1
- package/build/assets/automation-detail-D4Hs831Z.js +3 -0
- package/build/assets/automation-export-n0X6FB0C.js +2 -0
- package/build/assets/automation-git-sync-CDrm8WV7.js +1 -0
- package/build/assets/automation-setup-route-CZCl4ONs.js +1 -0
- package/build/assets/{automation-templates-D9gs6ihu.js → automation-templates-DFF96AdL.js} +1 -1
- package/build/assets/automations-list-Bl-oGOrV.js +1 -0
- package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-H_ThtDA0.js} +1 -1
- package/build/assets/{backend-form-modal-HwclKrUS.js → backend-form-modal-CbCemvHt.js} +1 -1
- package/build/assets/backend-not-configured-DP8KLNq_.js +1 -0
- package/build/assets/{backend-synced-settings-badge-YI3k09Wr.js → backend-synced-settings-badge-BBASWqsb.js} +1 -1
- package/build/assets/{badge-Dpn3-LTV.js → badge-B-51h-SW.js} +1 -1
- package/build/assets/{base-modal-3NmIOKDm.js → base-modal-BbjycA8X.js} +1 -1
- package/build/assets/bot-CGPCg03p.js +1 -0
- package/build/assets/{brand-button-CJcwjnfb.js → brand-button-Blxv5nww.js} +1 -1
- package/build/assets/browser-CuW0nWvh.js +7 -0
- package/build/assets/{browser-tab-4CPdj3J3.js → browser-tab-D5G0ORwt.js} +1 -1
- package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-BD2tii1r.js} +1 -1
- package/build/assets/check-DSuS-lyr.js +1 -0
- package/build/assets/chevron-down-CgGcmtE2.js +1 -0
- package/build/assets/circle-check-CG5-NPw7.js +1 -0
- package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-ASbpB8vN.js} +1 -1
- package/build/assets/cloud-funnel-analytics-GlCUG0gk.js +1 -0
- package/build/assets/cog-CZiR80uT.js +1 -0
- package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-DvpEsh2O.js} +1 -1
- package/build/assets/{command-menu-BKOLj-TC.js → command-menu-DwUQzjYP.js} +1 -1
- package/build/assets/{condenser-settings-DLQogFnB.js → condenser-settings-BptcoiLA.js} +1 -1
- package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-CiEwxZAA.js} +1 -1
- package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-CdcamfM1.js} +1 -1
- package/build/assets/conversation-DREHj4nT.js +1 -0
- package/build/assets/conversation-DotRfiDz.js +90 -0
- package/build/assets/conversation-panel-DREHj4nT.js +1 -0
- package/build/assets/conversation-state-store-DMLtlHbE.js +1 -0
- package/build/assets/conversation-store-Blc5xysY.js +6 -0
- package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-D-puECpY.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-BGxcUbgy.js} +1 -1
- package/build/assets/{device-verify-BIjXeW9N.js → device-verify-CZJfWaJf.js} +1 -1
- package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-tLhpwtxS.js} +1 -1
- package/build/assets/{entry.client-EBn3ZtNP.js → entry.client-D8GnI6GZ.js} +2 -2
- package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-Fk8k60nk.js} +1 -1
- package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-DeztVYuL.js} +1 -1
- package/build/assets/{extensions-hub-BZ3HYztk.js → extensions-hub-Cd6GCYzq.js} +1 -1
- package/build/assets/{extensions-navigation-Bnx32WAb.js → extensions-navigation-C4sgZg-y.js} +1 -1
- package/build/assets/external-link-C0UpBgsE.js +1 -0
- package/build/assets/{file-text-RecuaId_.js → file-text-C6WYtNdV.js} +1 -1
- package/build/assets/files-tab-BW_qzyAm.js +1 -0
- package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-CGXBLcn1.js} +1 -1
- package/build/assets/format-model-name-BNPKVsIq.js +1 -0
- package/build/assets/format-relative-time-ZhQD4rsl.js +1 -0
- package/build/assets/git-provider-icon-CaQ1yLPi.js +1 -0
- package/build/assets/{git-repo-dropdown-B5VnMftu.js → git-repo-dropdown-CgXR6M_E.js} +1 -1
- package/build/assets/git-repo-dropdown-D2Uei3CO.js +1 -0
- package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_YOp8Fo.js} +1 -1
- package/build/assets/home-DNzzJcMP.js +1 -0
- package/build/assets/home-aCos-5vc.js +1 -0
- package/build/assets/{home-store-Cubdq0uP.js → home-store-DgzViC3f.js} +1 -1
- package/build/assets/index-home-DNzzJcMP.js +1 -0
- package/build/assets/info-CLoC1LRo.js +1 -0
- package/build/assets/install-server-modal-D7zIqNKz.js +1 -0
- package/build/assets/kebab-menu-item-content-DERMdnDv.js +1 -0
- package/build/assets/{launch-c4GEP8oo.js → launch-5PjKeLak.js} +1 -1
- package/build/assets/{list-todo-CheUtB7F.js → list-todo-BF049YaY.js} +1 -1
- package/build/assets/llm-not-configured-banner-BK9z5eS0.js +27 -0
- package/build/assets/llm-settings-BLAMK2tR.js +1 -0
- package/build/assets/llm-settings-BWsbarGM.js +1 -0
- package/build/assets/llm-subscription-service-SfnEV9Uc.js +1 -0
- package/build/assets/loader-circle-D7IagAyF.js +1 -0
- package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-DBgXgra0.js} +1 -1
- package/build/assets/{manage-backends-modal-DTCME_Pu.js → manage-backends-modal-BTqNPhzc.js} +1 -1
- package/build/assets/manifest-abebca3c.js +1 -0
- package/build/assets/manifest-subpage-layout-Rn-glaxV.js +1 -0
- package/build/assets/{map-provider-7Bp2aih5.js → map-provider-BK4HnqYz.js} +1 -1
- package/build/assets/markdown-renderer-Cp6DlHQN.js +8 -0
- package/build/assets/{mcp-Da7wFU7A.js → mcp-BC-Ixn4T.js} +2 -2
- package/build/assets/mcp-marketplace-utils-BJWJgbB6.js +1 -0
- package/build/assets/messages-CzFKrzPG.js +40 -0
- package/build/assets/{modal-body-duRaxj_K.js → modal-body-BdKfD3Hl.js} +1 -1
- package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D5_b5vMi.js} +1 -1
- package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-objukxk_.js} +1 -1
- package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-C_gXyLyD.js} +1 -1
- package/build/assets/{npm-Cswluf6-.js → npm-CHVHV1MC.js} +1 -1
- package/build/assets/{onboarding-BKbTYlW1.js → onboarding-Diw0V51A.js} +1 -1
- package/build/assets/onboarding-modal-Da4yHzsA.js +1 -0
- package/build/assets/{organization-service.api-DK8csGvK.js → organization-service.api-BztSy69u.js} +1 -1
- package/build/assets/parse-git-remote-url-BkXN9jzl.js +1 -0
- package/build/assets/pencil-49avMHlD.js +1 -0
- package/build/assets/{planner-tab-D-mZ1I7n.js → planner-tab-CJiSpNax.js} +1 -1
- package/build/assets/{plugins-management-service-CywqyfLK.js → plugins-management-service-lHdNKWNU.js} +1 -1
- package/build/assets/plus-C0BagBpV.js +1 -0
- package/build/assets/profiles-service.api-BLr7FXec.js +1 -0
- package/build/assets/providers-CWXnb7S3.js +1 -0
- package/build/assets/{proxy-b4aqL4SX.js → proxy-DYDXxtje.js} +1 -1
- package/build/assets/{puzzle-B3v361yY.js → puzzle-Bt2B1rzf.js} +1 -1
- package/build/assets/recommended-automations-launcher-CcFMfJRR.js +1 -0
- package/build/assets/refresh-cw-nmcesifB.js +1 -0
- package/build/assets/root-CT4t7apy.css +1 -0
- package/build/assets/root-DnRgLKpU.js +2 -0
- package/build/assets/root-layout-2L9tr-BN.js +2 -0
- package/build/assets/{schema-field-Z-rMg9ti.js → schema-field-C59lVZTA.js} +1 -1
- package/build/assets/{sdk-section-page-m_cjygxR.js → sdk-section-page-BbBEQQjq.js} +1 -1
- package/build/assets/search-CYSDBczG.js +1 -0
- package/build/assets/secrets-service-BtsgYSlj.js +1 -0
- package/build/assets/secrets-settings-DJ0OKa4_.js +1 -0
- package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DiVfTZuN.js} +1 -1
- package/build/assets/{settings-CZPGNens.js → settings-CDqL_Uqh.js} +1 -1
- package/build/assets/{settings-CWFxymAf.js → settings-DcNPxz0v.js} +1 -1
- package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-Ba1UN5Du.js} +1 -1
- package/build/assets/{settings-index-Dtlegd6s.js → settings-index-Cz2cKt2K.js} +1 -1
- package/build/assets/{settings-input-D61Vzp9e.js → settings-input-CWUEHHvS.js} +1 -1
- package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-DdcLXDGn.js} +1 -1
- package/build/assets/{settings-modal-CalzJP2l.js → settings-modal-nEEK1Kh1.js} +1 -1
- package/build/assets/{settings-service.api-DfPYaxZJ.js → settings-service.api-3yAUFcaP.js} +1 -1
- package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-Dk9hChx1.js} +1 -1
- package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-CxjtCSB3.js} +1 -1
- package/build/assets/shared-conversation-DbAcrx3s.js +1 -0
- package/build/assets/shield-check-CiOTXxV2.js +1 -0
- package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-lrfPooIB.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-C6HpQ55l.js → sidebar-mobile-menu-toggle-KERXfNu1.js} +1 -1
- package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-B8lFD6Cb.js} +1 -1
- package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-u6pUpxJ7.js} +1 -1
- package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-dGIUzr_b.js} +1 -1
- package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-kkOWZ89w.js} +1 -1
- package/build/assets/{skill-scope-Dt1V5X2p.js → skill-scope-DWN1PBPH.js} +1 -1
- package/build/assets/{skills-plugins-B-H0cCOP.js → skills-plugins-DFjH2Nq6.js} +1 -1
- package/build/assets/{skills-settings-DthdIDUb.js → skills-settings-DIHpl3ol.js} +2 -2
- package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-ntyMLnbj.js} +1 -1
- package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-B6JXcsmL.js} +1 -1
- package/build/assets/{task-list-tab-BTde81Iu.js → task-list-tab-aEJzEcHD.js} +1 -1
- package/build/assets/{terminal-DRrJo-cR.js → terminal-Dch7Ty5K.js} +1 -1
- package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-B2MLKsgt.js} +1 -1
- package/build/assets/trash-2-yZnDM4Ji.js +1 -0
- package/build/assets/{typography-D9tiHct7.js → typography-DB5HoCk0.js} +1 -1
- package/build/assets/usage-tab-DrEtBmBT.js +1 -0
- package/build/assets/use-acp-credential-form-c8KXAa8A.js +1 -0
- package/build/assets/{use-activate-agent-profile-DrPzIKJF.js → use-activate-agent-profile-B0p34N3q.js} +1 -1
- package/build/assets/use-agent-profiles-CPIc6wLH.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-BzE28H3x.js → use-can-manage-org-profiles-Dz_8Eqkv.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-U6HPjy50.js → use-cloud-current-user-id-DvUVqCle.js} +1 -1
- package/build/assets/use-config-C3PO4TBw.js +1 -0
- package/build/assets/use-create-conversation-DVrA_uLD.js +1 -0
- package/build/assets/use-create-secret-DbBIpaCR.js +1 -0
- package/build/assets/use-get-secrets-6PBitf54.js +1 -0
- package/build/assets/use-has-permission-CQ31Cl8j.js +1 -0
- package/build/assets/use-is-authed-2UrDIziV.js +1 -0
- package/build/assets/use-is-creating-conversation-BvYpmb3v.js +1 -0
- 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-diZS4FiN.js +1 -0
- package/build/assets/use-manifest-capabilities-HIWCtIUm.js +1 -0
- package/build/assets/{use-onboarding-completion-6kWOW3ul.js → use-onboarding-completion-Bs8PcXik.js} +1 -1
- package/build/assets/{use-plugins-marketplace-CqkR8kLE.js → use-plugins-marketplace-BCuNLFsr.js} +1 -1
- package/build/assets/use-save-agent-profile-BaMNSpBV.js +1 -0
- package/build/assets/{use-save-settings-DIEurJ3D.js → use-save-settings-BahvC2Gw.js} +1 -1
- package/build/assets/{use-settings-BmLzQjnC.js → use-settings-C6ZxpBDX.js} +1 -1
- package/build/assets/{use-settings-nav-items-DV9qgeu7.js → use-settings-nav-items-Bqn69Ggw.js} +2 -2
- package/build/assets/use-tracking-Bhu7gk2y.js +3 -0
- package/build/assets/{use-user-conversation-Dt-W6uNw.js → use-user-conversation-BkNXpXrd.js} +1 -1
- package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-c_OmS3lK.js} +1 -1
- package/build/assets/{useMutation-ChpkYxI5.js → useMutation-6ZsQCqAn.js} +1 -1
- package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-xDrGlTO_.js} +1 -1
- package/build/assets/{useQuery-BCnzy4LX.js → useQuery-Bs5NFz2s.js} +1 -1
- package/build/assets/utils-DUD5ScdA.js +1 -0
- package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
- package/build/assets/{vendor~entry.client-CgNUwtQL.js → vendor~entry.client-BFE7Llz9.js} +1 -1
- package/build/assets/{vendor~entry.client-zSIea5EO.js → vendor~entry.client-BaKt_PIp.js} +1 -1
- 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~kepq2zme-D87mAf6K.js} +3 -3
- package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-B6POTS66.js} +1 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation-53Q_U6uP.js +13 -0
- package/build/assets/vendor~root-layout-DeQACFVA.js +1 -0
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-bv7ooVgH.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-e8pX05xf.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-BvS6PCK2.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-DOPLJMH9.js} +2 -2
- 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~iw7io29p-Dz8NQve5.js} +1 -1
- package/build/assets/{verification-settings-oi54wEc1.js → verification-settings-COueVXmM.js} +1 -1
- package/build/assets/{wrench-B1_H-tL1.js → wrench-C95ujnYo.js} +1 -1
- package/build/assets/x-86ZCfxKY.js +1 -0
- package/build/assets/zap-DRa-r-Tf.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +88 -3
- package/build/locales/ca/openhands.json +88 -3
- package/build/locales/de/openhands.json +88 -3
- package/build/locales/en/openhands.json +88 -3
- package/build/locales/es/openhands.json +88 -3
- package/build/locales/fr/openhands.json +88 -3
- package/build/locales/it/openhands.json +88 -3
- package/build/locales/ja/openhands.json +88 -3
- package/build/locales/ko-KR/openhands.json +88 -3
- package/build/locales/no/openhands.json +88 -3
- package/build/locales/pt/openhands.json +88 -3
- package/build/locales/tr/openhands.json +88 -3
- package/build/locales/uk/openhands.json +88 -3
- package/build/locales/zh-CN/openhands.json +88 -3
- package/build/locales/zh-TW/openhands.json +88 -3
- 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/automation-service/automation-service.api.cjs +1 -1
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
- package/dist/api/automation-service/automation-service.api.d.ts +10 -0
- package/dist/api/automation-service/automation-service.api.js +42 -0
- package/dist/api/automation-service/automation-service.api.js.map +1 -1
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
- package/dist/api/cloud/conversation-service.api.d.ts +9 -0
- package/dist/api/cloud/conversation-service.api.js +11 -1
- package/dist/api/cloud/conversation-service.api.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/api/profiles-service/profiles-service.api.cjs +1 -1
- package/dist/api/profiles-service/profiles-service.api.cjs.map +1 -1
- package/dist/api/profiles-service/profiles-service.api.d.ts +15 -2
- package/dist/api/profiles-service/profiles-service.api.js +25 -2
- package/dist/api/profiles-service/profiles-service.api.js.map +1 -1
- package/dist/api/secrets-service.cjs +1 -1
- package/dist/api/secrets-service.cjs.map +1 -1
- package/dist/api/secrets-service.d.ts +5 -0
- package/dist/api/secrets-service.js +12 -6
- package/dist/api/secrets-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/event-message-components/index.d.ts +0 -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/git-sync/git-sync-activity-row.d.ts +15 -0
- package/dist/components/features/automations/git-sync/git-sync-config-form.d.ts +13 -0
- package/dist/components/features/automations/git-sync/git-sync-error-banner.d.ts +6 -0
- package/dist/components/features/automations/git-sync/git-sync-not-local-state.d.ts +1 -0
- package/dist/components/features/automations/git-sync/git-sync-overview-section.d.ts +12 -0
- package/dist/components/features/automations/git-sync/git-sync-skeleton.d.ts +1 -0
- package/dist/components/features/automations/git-sync/git-sync-status-pill.d.ts +7 -0
- package/dist/components/features/automations/git-sync/git-sync-unsupported-state.d.ts +7 -0
- package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
- package/dist/components/features/automations/responder-deployment-modal.d.ts +2 -1
- package/dist/components/features/chat/chat-interface.cjs +2 -2
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +177 -176
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- 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/error-message-banner.cjs +1 -1
- package/dist/components/features/chat/error-message-banner.cjs.map +1 -1
- package/dist/components/features/chat/error-message-banner.d.ts +3 -1
- package/dist/components/features/chat/error-message-banner.js +64 -58
- package/dist/components/features/chat/error-message-banner.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/compact-conversation-row.cjs +1 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.js +6 -6
- 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 +240 -175
- 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/features/onboarding/steps/setup-llm-step.d.ts +10 -7
- 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 +227 -219
- 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-commit-changes.cjs +1 -1
- package/dist/hooks/query/use-commit-changes.js +4 -4
- 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-git-sync.d.ts +19 -0
- 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/query/use-task-polling.cjs +1 -1
- package/dist/hooks/query/use-task-polling.cjs.map +1 -1
- package/dist/hooks/query/use-task-polling.js +12 -10
- package/dist/hooks/query/use-task-polling.js.map +1 -1
- package/dist/hooks/query/use-unified-get-git-changes.cjs +1 -1
- package/dist/hooks/query/use-unified-get-git-changes.js +4 -4
- package/dist/hooks/query/use-unified-git-commits.cjs +1 -1
- package/dist/hooks/query/use-unified-git-commits.js +4 -4
- package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
- package/dist/hooks/query/use-unified-git-diff.js +4 -4
- package/dist/hooks/query/use-workspace-files.cjs +1 -1
- package/dist/hooks/query/use-workspace-files.cjs.map +1 -1
- package/dist/hooks/query/use-workspace-files.d.ts +14 -4
- package/dist/hooks/query/use-workspace-files.js +45 -32
- package/dist/hooks/query/use-workspace-files.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-responder-url-secret.d.ts +5 -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/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +6 -0
- package/dist/hooks/use-tracking.js +6 -0
- package/dist/hooks/use-tracking.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 +86 -1
- 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 +1475 -30
- 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 +88 -3
- package/dist/locales/ca/openhands.json +88 -3
- package/dist/locales/de/openhands.json +88 -3
- package/dist/locales/en/openhands.json +88 -3
- package/dist/locales/es/openhands.json +88 -3
- package/dist/locales/fr/openhands.json +88 -3
- package/dist/locales/it/openhands.json +88 -3
- package/dist/locales/ja/openhands.json +88 -3
- package/dist/locales/ko-KR/openhands.json +88 -3
- package/dist/locales/no/openhands.json +88 -3
- package/dist/locales/pt/openhands.json +88 -3
- package/dist/locales/tr/openhands.json +88 -3
- package/dist/locales/uk/openhands.json +88 -3
- package/dist/locales/zh-CN/openhands.json +88 -3
- package/dist/locales/zh-TW/openhands.json +88 -3
- 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/circle-alert.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.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/files-tab.cjs +1 -1
- package/dist/routes/files-tab.js +11 -11
- package/dist/routes/files-tab.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/services/settings.cjs +1 -1
- package/dist/services/settings.cjs.map +1 -1
- package/dist/services/settings.js +2 -2
- package/dist/services/settings.js.map +1 -1
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.js +47 -51
- package/dist/services/telemetry.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/error-message-store.cjs +1 -1
- package/dist/stores/error-message-store.cjs.map +1 -1
- package/dist/stores/error-message-store.d.ts +3 -1
- package/dist/stores/error-message-store.js +5 -3
- package/dist/stores/error-message-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/types/git-sync.d.ts +51 -0
- 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/error-handler.cjs +1 -1
- package/dist/utils/error-handler.cjs.map +1 -1
- package/dist/utils/error-handler.d.ts +3 -2
- package/dist/utils/error-handler.js +18 -5
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +1 -0
- package/dist/utils/format-model-name.js +1 -0
- package/dist/utils/format-model-name.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 +25 -17
- 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/check-translation-completeness.cjs +3 -0
- package/scripts/dev-process-utils.mjs +6 -1
- package/scripts/dev-safe.mjs +57 -2
- package/scripts/dev-with-automation.mjs +98 -9
- 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/automation-detail-C0SxWTnQ.js +0 -3
- package/build/assets/automation-export-BjQa_fT6.js +0 -2
- package/build/assets/automation-setup-route-BzCNpljP.js +0 -1
- package/build/assets/automations-list-dZg8zOCl.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/cloud-funnel-analytics-CcSez21r.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-state-store-CtgILxWF.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/format-model-name-BN_rx1Y3.js +0 -1
- package/build/assets/format-relative-time-BerVamGl.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/home-Y0aDou-a.js +0 -1
- package/build/assets/index-home-DqyeeFA_.js +0 -1
- package/build/assets/info-C9lpK5pw.js +0 -1
- package/build/assets/install-server-modal-DW6dSyGr.js +0 -1
- package/build/assets/kebab-menu-item-content-CKydZrbH.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/manifest-subpage-layout-Ds7G5GZ8.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/onboarding-modal-DrrGlEQq.js +0 -1
- package/build/assets/pencil-Bl3GWhgq.js +0 -1
- package/build/assets/plus-CtzlyAoF.js +0 -1
- package/build/assets/profiles-service.api-vcE_jJCe.js +0 -1
- package/build/assets/providers-CdrPPm0z.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-CBBi6IAe.js +0 -2
- 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/secrets-service-BHF4fxML.js +0 -1
- package/build/assets/secrets-settings-aBGXtQhX.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-acp-credential-form-DGyo0QvL.js +0 -1
- package/build/assets/use-agent-profiles-B37XWDLq.js +0 -1
- package/build/assets/use-config-DapX3pjC.js +0 -1
- package/build/assets/use-create-conversation-CRf1dCm5.js +0 -1
- package/build/assets/use-create-secret-DcpT3RPw.js +0 -1
- package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
- package/build/assets/use-is-creating-conversation-CVefC9Ns.js +0 -1
- package/build/assets/use-llm-profiles-CHxqoHiN.js +0 -1
- package/build/assets/use-manifest-capabilities-zihHDbMW.js +0 -1
- package/build/assets/use-save-agent-profile-CH9_EXQG.js +0 -1
- package/build/assets/use-tracking-salbPJxT.js +0 -3
- 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/api/cloud/suggestions-service.api.d.ts +0 -8
- package/dist/api/suggestions-service/suggestions-service.api.d.ts +0 -11
- package/dist/components/conversation-events/chat/event-message-components/observation-pair-event-message.d.ts +0 -7
- package/dist/components/conversation-events/index.d.ts +0 -1
- package/dist/components/features/automations/metadata-chip.d.ts +0 -6
- package/dist/components/features/chat/task-tracking/status-badge.d.ts +0 -5
- package/dist/components/features/chat/task-tracking/status-icon.d.ts +0 -5
- package/dist/components/features/chat/task-tracking/task-list-section.d.ts +0 -10
- package/dist/components/features/controls/tools.d.ts +0 -2
- 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/components/features/conversation-panel/new-conversation-button.d.ts +0 -23
- package/dist/components/features/home/home-header/guide-message.d.ts +0 -1
- package/dist/components/features/home/home-header/home-header.d.ts +0 -1
- package/dist/components/features/home/new-conversation/create-conversation-button.d.ts +0 -1
- package/dist/components/features/home/new-conversation/new-conversation.d.ts +0 -1
- package/dist/components/features/home/new-conversation.d.ts +0 -1
- package/dist/components/features/home/tasks/task-card.d.ts +0 -6
- package/dist/components/features/home/tasks/task-group.d.ts +0 -7
- package/dist/components/features/home/tasks/task-issue-number.d.ts +0 -6
- package/dist/components/features/home/tasks/task-item-title.d.ts +0 -1
- package/dist/components/features/home/tasks/task-suggestions-skeleton.d.ts +0 -1
- package/dist/components/features/home/tasks/task-suggestions.d.ts +0 -6
- package/dist/components/features/settings/agent-server-onboarding.d.ts +0 -10
- package/dist/components/features/settings/mcp-settings/mcp-server-list-item.d.ts +0 -6
- package/dist/components/features/settings/mcp-settings/mcp-server-list.d.ts +0 -8
- package/dist/hooks/query/use-suggested-tasks.d.ts +0 -1
- package/dist/hooks/use-should-show-user-features.d.ts +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/dist/ui/card-title.d.ts +0 -16
- package/dist/ui/card.d.ts +0 -14
- package/dist/utils/group-suggested-tasks.d.ts +0 -7
- /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~dcc51rps-rfV8mQ9m.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ox0jfsa0-cHFhpUBq.js} +0 -0
- /package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~9pstowjp-BOVIFA_g.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BOVIFA_g.js} +0 -0
- /package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C0JXQb_q.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-window-meter.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/context-window-meter.tsx"],"sourcesContent":["import React from \"react\";\nimport { Gauge, Loader2, Minimize } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useContextWindowUsage } from \"#/hooks/use-context-window-usage\";\nimport { useSelectConversationTab } from \"#/hooks/use-select-conversation-tab\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { useCompactContextAction } from \"#/hooks/use-compact-context-action\";\nimport { ContextMenuListItem } from \"#/components/features/context-menu/context-menu-list-item\";\nimport { ConversationNameContextMenuIconText } from \"#/components/features/conversation/conversation-name-context-menu-icon-text\";\nimport { StyledTooltip } from \"#/components/shared/buttons/styled-tooltip\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { Divider } from \"#/ui/divider\";\nimport { cn } from \"#/utils/utils\";\nimport { chatInputIconButtonClassName } from \"#/utils/form-control-classes\";\nimport {\n formatCompactTokenCount,\n getContextWindowUsagePercentage,\n} from \"#/utils/format-token-count\";\nimport { getContextFillTone } from \"#/components/features/conversation/usage-panel/context-meter\";\nimport {\n ContextWindowRing,\n CONTEXT_WINDOW_TRACK_COLOR,\n} from \"./context-window-ring\";\n\nconst TONE_BAR_CLASS = {\n neutral: \"bg-foreground\",\n warning: \"bg-amber-500\",\n danger: \"bg-red-500\",\n} as const;\n\nconst TONE_LABEL_CLASS = {\n neutral: \"text-[var(--oh-muted)]\",\n warning: \"text-amber-500\",\n danger: \"text-red-500\",\n} as const;\n\nexport function ContextWindowMeter() {\n const { t } = useTranslation(\"openhands\");\n const usage = useContextWindowUsage();\n const { navigateToTab } = useSelectConversationTab();\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const popoverRef = useClickOutsideElement<HTMLDivElement>(\n () => setIsPopoverOpen(false),\n triggerRef,\n );\n const { handleCompact, isCompacting, isDisabled } = useCompactContextAction(\n usage?.perTurnToken ?? 0,\n );\n\n if (!usage) {\n return null;\n }\n\n const usagePercentage = getContextWindowUsagePercentage(\n usage.perTurnToken,\n usage.contextWindow,\n );\n const roundedPercentage = Math.round(usagePercentage);\n const remainingPercentage = Math.max(0, 100 - roundedPercentage);\n const usagePercentLabel = `${roundedPercentage}% ${t(I18nKey.CONVERSATION$USED)} (${remainingPercentage}% ${t(I18nKey.CONVERSATION$LEFT)})`;\n const usageTokenSummary = `${formatCompactTokenCount(usage.perTurnToken)} / ${formatCompactTokenCount(usage.contextWindow)}`;\n const tone = getContextFillTone(usagePercentage);\n\n const openUsagePanel = () => {\n setIsPopoverOpen(false);\n navigateToTab(\"usage\");\n };\n\n return (\n <div className=\"relative shrink-0\">\n <StyledTooltip\n content={t(I18nKey.CHAT_INTERFACE$SHOW_CONTEXT)}\n placement=\"top\"\n >\n <button\n ref={triggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-8\")}\n aria-label={`${t(I18nKey.CHAT_INTERFACE$CONTEXT_WINDOW_METER_LABEL)}: ${usagePercentLabel}`}\n aria-expanded={isPopoverOpen}\n aria-haspopup=\"dialog\"\n data-testid=\"context-window-meter\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsPopoverOpen((open) => !open);\n }}\n >\n <ContextWindowRing percentage={usagePercentage} />\n </button>\n </StyledTooltip>\n\n {isPopoverOpen && (\n <div\n ref={popoverRef}\n data-testid=\"context-window-meter-popover\"\n className={cn(\n \"absolute bottom-full right-0 z-[60] mb-2 w-[280px]\",\n \"flex flex-col gap-0.5 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg\",\n )}\n >\n <div className=\"flex flex-col gap-2 px-2 py-1.5\">\n <div className=\"flex items-center justify-between gap-2 text-sm\">\n <span className=\"font-semibold text-[var(--oh-foreground)]\">\n {t(I18nKey.CONVERSATION$CONTEXT_WINDOW)}\n </span>\n <span className={cn(\"shrink-0 text-xs\", TONE_LABEL_CLASS[tone])}>\n {usagePercentLabel}\n </span>\n </div>\n\n <button\n type=\"button\"\n data-testid=\"context-window-meter-bar-button\"\n className=\"relative h-1.5 w-full rounded-full cursor-pointer\"\n style={{ backgroundColor: CONTEXT_WINDOW_TRACK_COLOR }}\n aria-label={t(I18nKey.COMMON$USAGE)}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n openUsagePanel();\n }}\n >\n <span\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full transition-all duration-300\",\n TONE_BAR_CLASS[tone],\n )}\n style={{ width: `${Math.min(100, usagePercentage)}%` }}\n />\n </button>\n\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n data-testid=\"context-window-compact-button\"\n disabled={isDisabled}\n aria-busy={isCompacting}\n aria-label={t(I18nKey.CONVERSATION$COMPACT_CONTEXT)}\n className={cn(\n \"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs\",\n \"text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]\",\n \"transition-colors disabled:cursor-not-allowed disabled:opacity-50\",\n )}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n handleCompact();\n }}\n >\n {isCompacting ? (\n <Loader2 className=\"size-3 animate-spin\" aria-hidden />\n ) : (\n <Minimize className=\"size-3\" aria-hidden />\n )}\n <span>{t(I18nKey.CONVERSATION$COMPACT_CONTEXT)}</span>\n </button>\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {usageTokenSummary}\n </span>\n </div>\n </div>\n\n <Divider inset=\"menu\" />\n\n <ContextMenuListItem\n testId=\"context-window-plan-usage\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n openUsagePanel();\n }}\n >\n <ConversationNameContextMenuIconText\n icon={<Gauge size={16} />}\n text={t(I18nKey.COMMON$USAGE)}\n />\n </ContextMenuListItem>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":"+sCAwBA,IAAM,EAAiB,CACrB,QAAS,gBACT,QAAS,eACT,OAAQ,YACV,EAEM,EAAmB,CACvB,QAAS,yBACT,QAAS,iBACT,OAAQ,cACV,EAEA,SAAgB,GAAqB,CACnC,GAAM,CAAE,KAAM,EAAA,eAAe,WAAW,EAClC,EAAQ,EAAA,sBAAsB,EAC9B,CAAE,iBAAkB,EAAA,yBAAyB,EAC7C,CAAC,EAAe,GAAoB,EAAA,QAAM,SAAS,EAAK,EACxD,EAAa,EAAA,QAAM,OAA0B,IAAI,EACjD,EAAa,EAAA,2BACX,EAAiB,EAAK,EAC5B,CACF,EACM,CAAE,gBAAe,eAAc,cAAe,EAAA,wBAClD,GAAO,cAAgB,CACzB,EAEA,GAAI,CAAC,EACH,OAAO,KAGT,IAAM,EAAkB,EAAA,gCACtB,EAAM,aACN,EAAM,aACR,EACM,EAAoB,KAAK,MAAM,CAAe,EAC9C,EAAsB,KAAK,IAAI,EAAG,IAAM,CAAiB,EACzD,EAAoB,GAAG,EAAkB,IAAI,EAAE,EAAA,QAAQ,iBAAiB,EAAE,IAAI,EAAoB,IAAI,EAAE,EAAA,QAAQ,iBAAiB,EAAE,GACnI,EAAoB,GAAG,EAAA,wBAAwB,EAAM,YAAY,EAAE,KAAK,EAAA,wBAAwB,EAAM,aAAa,IACnH,EAAO,EAAA,mBAAmB,CAAe,EAEzC,MAAuB,CAC3B,EAAiB,EAAK,EACtB,EAAc,OAAO,CACvB,EAEA,OACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,6BAAf,EACE,EAAA,EAAA,KAAC,EAAA,cAAD,CACE,QAAS,EAAE,EAAA,QAAQ,2BAA2B,EAC9C,UAAU,gBAEV,EAAA,EAAA,KAAC,SAAD,CACE,IAAK,EACL,KAAK,SACL,UAAW,EAAA,GAAG,EAAA,6BAA8B,QAAQ,EACpD,aAAY,GAAG,EAAE,EAAA,QAAQ,yCAAyC,EAAE,IAAI,IACxE,gBAAe,EACf,gBAAc,SACd,cAAY,uBACZ,QAAU,GAAU,CAClB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,EAAkB,GAAS,CAAC,CAAI,CAClC,YAEA,EAAA,EAAA,KAAC,EAAA,kBAAD,CAAmB,WAAY,CAAkB,CAAA,CAC3C,CAAA,CACK,CAAA,EAEd,IACC,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,cAAY,+BACZ,UAAW,EAAA,GACT,qDACA,0GACF,WANF,EAQE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,2CAAf,EACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,2DAAf,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,qDACb,EAAE,EAAA,QAAQ,2BAA2B,CAClC,CAAA,GACN,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,GAAG,mBAAoB,EAAiB,EAAK,WAC3D,CACG,CAAA,CACH,KAEL,EAAA,EAAA,KAAC,SAAD,CACE,KAAK,SACL,cAAY,kCACZ,UAAU,oDACV,MAAO,CAAE,gBAAiB,EAAA,0BAA2B,EACrD,aAAY,EAAE,EAAA,QAAQ,YAAY,EAClC,QAAU,GAAU,CAClB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,EAAe,CACjB,YAEA,EAAA,EAAA,KAAC,OAAD,CACE,UAAW,EAAA,GACT,qEACA,EAAe,EACjB,EACA,MAAO,CAAE,MAAO,GAAG,KAAK,IAAI,IAAK,CAAe,EAAE,EAAG,CACtD,CAAA,CACK,CAAA,GAER,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,mDAAf,EACE,EAAA,EAAA,MAAC,SAAD,CACE,KAAK,SACL,cAAY,gCACZ,SAAU,EACV,YAAW,EACX,aAAY,EAAE,EAAA,QAAQ,4BAA4B,EAClD,UAAW,EAAA,GACT,+DACA,kGACA,mEACF,EACA,QAAU,GAAU,CAClB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,EAAc,CAChB,WAfF,CAiBG,GACC,EAAA,EAAA,KAAC,EAAA,aAAD,CAAS,UAAU,sBAAsB,cAAA,EAAa,CAAA,GAEtD,EAAA,EAAA,KAAC,EAAA,SAAD,CAAU,UAAU,SAAS,cAAA,EAAa,CAAA,GAE5C,EAAA,EAAA,KAAC,OAAD,CAAA,SAAO,EAAE,EAAA,QAAQ,4BAA4B,CAAQ,CAAA,CAC/C,KACR,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0CACb,CACG,CAAA,CACH,GACF,KAEL,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAM,MAAQ,CAAA,GAEvB,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,OAAO,4BACP,QAAU,GAAU,CAClB,EAAM,eAAe,EACrB,EAAM,gBAAgB,EACtB,EAAe,CACjB,YAEA,EAAA,EAAA,KAAC,EAAA,oCAAD,CACE,MAAM,EAAA,EAAA,KAAC,EAAA,MAAD,CAAO,KAAM,EAAK,CAAA,EACxB,KAAM,EAAE,EAAA,QAAQ,YAAY,CAC7B,CAAA,CACkB,CAAA,CAClB,GAEJ,GAET"}
|
|
@@ -0,0 +1,131 @@
|
|
|
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 { 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 { cn as a } from "../../../../utils/utils.js";
|
|
7
|
+
import { chatInputIconButtonClassName as o } from "../../../../utils/form-control-classes.js";
|
|
8
|
+
import { StyledTooltip as s } from "../../../shared/buttons/styled-tooltip.js";
|
|
9
|
+
import { ContextMenuListItem as c } from "../../context-menu/context-menu-list-item.js";
|
|
10
|
+
import { useClickOutsideElement as l } from "../../../../hooks/use-click-outside-element.js";
|
|
11
|
+
import { Divider as u } from "../../../../ui/divider.js";
|
|
12
|
+
import { useSelectConversationTab as d } from "../../../../hooks/use-select-conversation-tab.js";
|
|
13
|
+
import { useContextWindowUsage as f } from "../../../../hooks/use-context-window-usage.js";
|
|
14
|
+
import { formatCompactTokenCount as p, getContextWindowUsagePercentage as m } from "../../../../utils/format-token-count.js";
|
|
15
|
+
import { useCompactContextAction as h } from "../../../../hooks/use-compact-context-action.js";
|
|
16
|
+
import { ConversationNameContextMenuIconText as g } from "../../conversation/conversation-name-context-menu-icon-text.js";
|
|
17
|
+
import { getContextFillTone as _ } from "../../conversation/usage-panel/context-meter.js";
|
|
18
|
+
import { CONTEXT_WINDOW_TRACK_COLOR as v, ContextWindowRing as y } from "./context-window-ring.js";
|
|
19
|
+
import b from "react";
|
|
20
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
21
|
+
//#region src/components/features/chat/components/context-window-meter.tsx
|
|
22
|
+
var C = {
|
|
23
|
+
neutral: "bg-foreground",
|
|
24
|
+
warning: "bg-amber-500",
|
|
25
|
+
danger: "bg-red-500"
|
|
26
|
+
}, w = {
|
|
27
|
+
neutral: "text-[var(--oh-muted)]",
|
|
28
|
+
warning: "text-amber-500",
|
|
29
|
+
danger: "text-red-500"
|
|
30
|
+
};
|
|
31
|
+
function T() {
|
|
32
|
+
let { t: T } = e("openhands"), E = f(), { navigateToTab: D } = d(), [O, k] = b.useState(!1), A = b.useRef(null), j = l(() => k(!1), A), { handleCompact: M, isCompacting: N, isDisabled: P } = h(E?.perTurnToken ?? 0);
|
|
33
|
+
if (!E) return null;
|
|
34
|
+
let F = m(E.perTurnToken, E.contextWindow), I = Math.round(F), L = Math.max(0, 100 - I), R = `${I}% ${T(t.CONVERSATION$USED)} (${L}% ${T(t.CONVERSATION$LEFT)})`, z = `${p(E.perTurnToken)} / ${p(E.contextWindow)}`, B = _(F), V = () => {
|
|
35
|
+
k(!1), D("usage");
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ S("div", {
|
|
38
|
+
className: "relative shrink-0",
|
|
39
|
+
children: [/* @__PURE__ */ x(s, {
|
|
40
|
+
content: T(t.CHAT_INTERFACE$SHOW_CONTEXT),
|
|
41
|
+
placement: "top",
|
|
42
|
+
children: /* @__PURE__ */ x("button", {
|
|
43
|
+
ref: A,
|
|
44
|
+
type: "button",
|
|
45
|
+
className: a(o, "size-8"),
|
|
46
|
+
"aria-label": `${T(t.CHAT_INTERFACE$CONTEXT_WINDOW_METER_LABEL)}: ${R}`,
|
|
47
|
+
"aria-expanded": O,
|
|
48
|
+
"aria-haspopup": "dialog",
|
|
49
|
+
"data-testid": "context-window-meter",
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
e.preventDefault(), e.stopPropagation(), k((e) => !e);
|
|
52
|
+
},
|
|
53
|
+
children: /* @__PURE__ */ x(y, { percentage: F })
|
|
54
|
+
})
|
|
55
|
+
}), O && /* @__PURE__ */ S("div", {
|
|
56
|
+
ref: j,
|
|
57
|
+
"data-testid": "context-window-meter-popover",
|
|
58
|
+
className: a("absolute bottom-full right-0 z-[60] mb-2 w-[280px]", "flex flex-col gap-0.5 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg"),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ S("div", {
|
|
61
|
+
className: "flex flex-col gap-2 px-2 py-1.5",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ S("div", {
|
|
64
|
+
className: "flex items-center justify-between gap-2 text-sm",
|
|
65
|
+
children: [/* @__PURE__ */ x("span", {
|
|
66
|
+
className: "font-semibold text-[var(--oh-foreground)]",
|
|
67
|
+
children: T(t.CONVERSATION$CONTEXT_WINDOW)
|
|
68
|
+
}), /* @__PURE__ */ x("span", {
|
|
69
|
+
className: a("shrink-0 text-xs", w[B]),
|
|
70
|
+
children: R
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ x("button", {
|
|
74
|
+
type: "button",
|
|
75
|
+
"data-testid": "context-window-meter-bar-button",
|
|
76
|
+
className: "relative h-1.5 w-full rounded-full cursor-pointer",
|
|
77
|
+
style: { backgroundColor: v },
|
|
78
|
+
"aria-label": T(t.COMMON$USAGE),
|
|
79
|
+
onClick: (e) => {
|
|
80
|
+
e.preventDefault(), e.stopPropagation(), V();
|
|
81
|
+
},
|
|
82
|
+
children: /* @__PURE__ */ x("span", {
|
|
83
|
+
className: a("absolute inset-y-0 left-0 rounded-full transition-all duration-300", C[B]),
|
|
84
|
+
style: { width: `${Math.min(100, F)}%` }
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ S("div", {
|
|
88
|
+
className: "flex items-center justify-between gap-2",
|
|
89
|
+
children: [/* @__PURE__ */ S("button", {
|
|
90
|
+
type: "button",
|
|
91
|
+
"data-testid": "context-window-compact-button",
|
|
92
|
+
disabled: P,
|
|
93
|
+
"aria-busy": N,
|
|
94
|
+
"aria-label": T(t.CONVERSATION$COMPACT_CONTEXT),
|
|
95
|
+
className: a("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs", "text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]", "transition-colors disabled:cursor-not-allowed disabled:opacity-50"),
|
|
96
|
+
onClick: (e) => {
|
|
97
|
+
e.preventDefault(), e.stopPropagation(), M();
|
|
98
|
+
},
|
|
99
|
+
children: [N ? /* @__PURE__ */ x(r, {
|
|
100
|
+
className: "size-3 animate-spin",
|
|
101
|
+
"aria-hidden": !0
|
|
102
|
+
}) : /* @__PURE__ */ x(i, {
|
|
103
|
+
className: "size-3",
|
|
104
|
+
"aria-hidden": !0
|
|
105
|
+
}), /* @__PURE__ */ x("span", { children: T(t.CONVERSATION$COMPACT_CONTEXT) })]
|
|
106
|
+
}), /* @__PURE__ */ x("span", {
|
|
107
|
+
className: "text-xs text-[var(--oh-muted)]",
|
|
108
|
+
children: z
|
|
109
|
+
})]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ x(u, { inset: "menu" }),
|
|
114
|
+
/* @__PURE__ */ x(c, {
|
|
115
|
+
testId: "context-window-plan-usage",
|
|
116
|
+
onClick: (e) => {
|
|
117
|
+
e.preventDefault(), e.stopPropagation(), V();
|
|
118
|
+
},
|
|
119
|
+
children: /* @__PURE__ */ x(g, {
|
|
120
|
+
icon: /* @__PURE__ */ x(n, { size: 16 }),
|
|
121
|
+
text: T(t.COMMON$USAGE)
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { T as ContextWindowMeter };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=context-window-meter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-window-meter.js","names":[],"sources":["../../../../../src/components/features/chat/components/context-window-meter.tsx"],"sourcesContent":["import React from \"react\";\nimport { Gauge, Loader2, Minimize } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useContextWindowUsage } from \"#/hooks/use-context-window-usage\";\nimport { useSelectConversationTab } from \"#/hooks/use-select-conversation-tab\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { useCompactContextAction } from \"#/hooks/use-compact-context-action\";\nimport { ContextMenuListItem } from \"#/components/features/context-menu/context-menu-list-item\";\nimport { ConversationNameContextMenuIconText } from \"#/components/features/conversation/conversation-name-context-menu-icon-text\";\nimport { StyledTooltip } from \"#/components/shared/buttons/styled-tooltip\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { Divider } from \"#/ui/divider\";\nimport { cn } from \"#/utils/utils\";\nimport { chatInputIconButtonClassName } from \"#/utils/form-control-classes\";\nimport {\n formatCompactTokenCount,\n getContextWindowUsagePercentage,\n} from \"#/utils/format-token-count\";\nimport { getContextFillTone } from \"#/components/features/conversation/usage-panel/context-meter\";\nimport {\n ContextWindowRing,\n CONTEXT_WINDOW_TRACK_COLOR,\n} from \"./context-window-ring\";\n\nconst TONE_BAR_CLASS = {\n neutral: \"bg-foreground\",\n warning: \"bg-amber-500\",\n danger: \"bg-red-500\",\n} as const;\n\nconst TONE_LABEL_CLASS = {\n neutral: \"text-[var(--oh-muted)]\",\n warning: \"text-amber-500\",\n danger: \"text-red-500\",\n} as const;\n\nexport function ContextWindowMeter() {\n const { t } = useTranslation(\"openhands\");\n const usage = useContextWindowUsage();\n const { navigateToTab } = useSelectConversationTab();\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const popoverRef = useClickOutsideElement<HTMLDivElement>(\n () => setIsPopoverOpen(false),\n triggerRef,\n );\n const { handleCompact, isCompacting, isDisabled } = useCompactContextAction(\n usage?.perTurnToken ?? 0,\n );\n\n if (!usage) {\n return null;\n }\n\n const usagePercentage = getContextWindowUsagePercentage(\n usage.perTurnToken,\n usage.contextWindow,\n );\n const roundedPercentage = Math.round(usagePercentage);\n const remainingPercentage = Math.max(0, 100 - roundedPercentage);\n const usagePercentLabel = `${roundedPercentage}% ${t(I18nKey.CONVERSATION$USED)} (${remainingPercentage}% ${t(I18nKey.CONVERSATION$LEFT)})`;\n const usageTokenSummary = `${formatCompactTokenCount(usage.perTurnToken)} / ${formatCompactTokenCount(usage.contextWindow)}`;\n const tone = getContextFillTone(usagePercentage);\n\n const openUsagePanel = () => {\n setIsPopoverOpen(false);\n navigateToTab(\"usage\");\n };\n\n return (\n <div className=\"relative shrink-0\">\n <StyledTooltip\n content={t(I18nKey.CHAT_INTERFACE$SHOW_CONTEXT)}\n placement=\"top\"\n >\n <button\n ref={triggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-8\")}\n aria-label={`${t(I18nKey.CHAT_INTERFACE$CONTEXT_WINDOW_METER_LABEL)}: ${usagePercentLabel}`}\n aria-expanded={isPopoverOpen}\n aria-haspopup=\"dialog\"\n data-testid=\"context-window-meter\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsPopoverOpen((open) => !open);\n }}\n >\n <ContextWindowRing percentage={usagePercentage} />\n </button>\n </StyledTooltip>\n\n {isPopoverOpen && (\n <div\n ref={popoverRef}\n data-testid=\"context-window-meter-popover\"\n className={cn(\n \"absolute bottom-full right-0 z-[60] mb-2 w-[280px]\",\n \"flex flex-col gap-0.5 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg\",\n )}\n >\n <div className=\"flex flex-col gap-2 px-2 py-1.5\">\n <div className=\"flex items-center justify-between gap-2 text-sm\">\n <span className=\"font-semibold text-[var(--oh-foreground)]\">\n {t(I18nKey.CONVERSATION$CONTEXT_WINDOW)}\n </span>\n <span className={cn(\"shrink-0 text-xs\", TONE_LABEL_CLASS[tone])}>\n {usagePercentLabel}\n </span>\n </div>\n\n <button\n type=\"button\"\n data-testid=\"context-window-meter-bar-button\"\n className=\"relative h-1.5 w-full rounded-full cursor-pointer\"\n style={{ backgroundColor: CONTEXT_WINDOW_TRACK_COLOR }}\n aria-label={t(I18nKey.COMMON$USAGE)}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n openUsagePanel();\n }}\n >\n <span\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full transition-all duration-300\",\n TONE_BAR_CLASS[tone],\n )}\n style={{ width: `${Math.min(100, usagePercentage)}%` }}\n />\n </button>\n\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n data-testid=\"context-window-compact-button\"\n disabled={isDisabled}\n aria-busy={isCompacting}\n aria-label={t(I18nKey.CONVERSATION$COMPACT_CONTEXT)}\n className={cn(\n \"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs\",\n \"text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]\",\n \"transition-colors disabled:cursor-not-allowed disabled:opacity-50\",\n )}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n handleCompact();\n }}\n >\n {isCompacting ? (\n <Loader2 className=\"size-3 animate-spin\" aria-hidden />\n ) : (\n <Minimize className=\"size-3\" aria-hidden />\n )}\n <span>{t(I18nKey.CONVERSATION$COMPACT_CONTEXT)}</span>\n </button>\n <span className=\"text-xs text-[var(--oh-muted)]\">\n {usageTokenSummary}\n </span>\n </div>\n </div>\n\n <Divider inset=\"menu\" />\n\n <ContextMenuListItem\n testId=\"context-window-plan-usage\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n openUsagePanel();\n }}\n >\n <ConversationNameContextMenuIconText\n icon={<Gauge size={16} />}\n text={t(I18nKey.COMMON$USAGE)}\n />\n </ContextMenuListItem>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,IAAiB;CACrB,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAEM,IAAmB;CACvB,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAEA,SAAgB,IAAqB;CACnC,IAAM,EAAE,SAAM,EAAe,WAAW,GAClC,IAAQ,EAAsB,GAC9B,EAAE,qBAAkB,EAAyB,GAC7C,CAAC,GAAe,KAAoB,EAAM,SAAS,EAAK,GACxD,IAAa,EAAM,OAA0B,IAAI,GACjD,IAAa,QACX,EAAiB,EAAK,GAC5B,CACF,GACM,EAAE,kBAAe,iBAAc,kBAAe,EAClD,GAAO,gBAAgB,CACzB;CAEA,IAAI,CAAC,GACH,OAAO;CAGT,IAAM,IAAkB,EACtB,EAAM,cACN,EAAM,aACR,GACM,IAAoB,KAAK,MAAM,CAAe,GAC9C,IAAsB,KAAK,IAAI,GAAG,MAAM,CAAiB,GACzD,IAAoB,GAAG,EAAkB,IAAI,EAAE,EAAQ,iBAAiB,EAAE,IAAI,EAAoB,IAAI,EAAE,EAAQ,iBAAiB,EAAE,IACnI,IAAoB,GAAG,EAAwB,EAAM,YAAY,EAAE,KAAK,EAAwB,EAAM,aAAa,KACnH,IAAO,EAAmB,CAAe,GAEzC,UAAuB;EAE3B,AADA,EAAiB,EAAK,GACtB,EAAc,OAAO;CACvB;CAEA,OACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,SAAS,EAAE,EAAQ,2BAA2B;GAC9C,WAAU;aAEV,kBAAC,UAAD;IACE,KAAK;IACL,MAAK;IACL,WAAW,EAAG,GAA8B,QAAQ;IACpD,cAAY,GAAG,EAAE,EAAQ,yCAAyC,EAAE,IAAI;IACxE,iBAAe;IACf,iBAAc;IACd,eAAY;IACZ,UAAU,MAAU;KAGlB,AAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,GAAkB,MAAS,CAAC,CAAI;IAClC;cAEA,kBAAC,GAAD,EAAmB,YAAY,EAAkB,CAAA;GAC3C,CAAA;EACK,CAAA,GAEd,KACC,kBAAC,OAAD;GACE,KAAK;GACL,eAAY;GACZ,WAAW,EACT,sDACA,0GACF;aANF;IAQE,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,QAAD;QAAM,WAAU;kBACb,EAAE,EAAQ,2BAA2B;OAClC,CAAA,GACN,kBAAC,QAAD;QAAM,WAAW,EAAG,oBAAoB,EAAiB,EAAK;kBAC3D;OACG,CAAA,CACH;;MAEL,kBAAC,UAAD;OACE,MAAK;OACL,eAAY;OACZ,WAAU;OACV,OAAO,EAAE,iBAAiB,EAA2B;OACrD,cAAY,EAAE,EAAQ,YAAY;OAClC,UAAU,MAAU;QAGlB,AAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,EAAe;OACjB;iBAEA,kBAAC,QAAD;QACE,WAAW,EACT,sEACA,EAAe,EACjB;QACA,OAAO,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAAe,EAAE,GAAG;OACtD,CAAA;MACK,CAAA;MAER,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,UAAD;QACE,MAAK;QACL,eAAY;QACZ,UAAU;QACV,aAAW;QACX,cAAY,EAAE,EAAQ,4BAA4B;QAClD,WAAW,EACT,gEACA,mGACA,mEACF;QACA,UAAU,MAAU;SAGlB,AAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,EAAc;QAChB;kBAfF,CAiBG,IACC,kBAAC,GAAD;SAAS,WAAU;SAAsB,eAAA;QAAa,CAAA,IAEtD,kBAAC,GAAD;SAAU,WAAU;SAAS,eAAA;QAAa,CAAA,GAE5C,kBAAC,QAAD,EAAA,UAAO,EAAE,EAAQ,4BAA4B,EAAQ,CAAA,CAC/C;WACR,kBAAC,QAAD;QAAM,WAAU;kBACb;OACG,CAAA,CACH;;KACF;;IAEL,kBAAC,GAAD,EAAS,OAAM,OAAQ,CAAA;IAEvB,kBAAC,GAAD;KACE,QAAO;KACP,UAAU,MAAU;MAGlB,AAFA,EAAM,eAAe,GACrB,EAAM,gBAAgB,GACtB,EAAe;KACjB;eAEA,kBAAC,GAAD;MACE,MAAM,kBAAC,GAAD,EAAO,MAAM,GAAK,CAAA;MACxB,MAAM,EAAE,EAAQ,YAAY;KAC7B,CAAA;IACkB,CAAA;GAClB;IAEJ;;AAET"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require("../../../../_virtual/_rolldown/runtime.cjs");const e=require("../../../../utils/utils.cjs"),t=require("../../conversation/usage-panel/context-meter.cjs");let n=require("react/jsx-runtime");var r=16,i=2,a=`color-mix(in srgb, var(--oh-foreground) ${.42*100}%, transparent)`,o={neutral:`var(--oh-foreground)`,warning:`#f59e0b`,danger:`#ef4444`};function s({percentage:s,className:c}){let l=(r-i)/2,u=2*Math.PI*l,d=Math.min(100,Math.max(0,s)),f=u-d/100*u,p=t.getContextFillTone(d);return(0,n.jsxs)(`svg`,{width:r,height:r,viewBox:`0 0 ${r} ${r}`,className:e.cn(`shrink-0`,c),"aria-hidden":!0,children:[(0,n.jsx)(`circle`,{cx:r/2,cy:r/2,r:l,fill:`none`,style:{stroke:a},strokeWidth:i,"data-testid":`context-window-ring-track`}),(0,n.jsx)(`circle`,{cx:r/2,cy:r/2,r:l,fill:`none`,stroke:o[p],strokeWidth:i,strokeLinecap:`round`,strokeDasharray:u,strokeDashoffset:f,transform:`rotate(-90 ${r/2} ${r/2})`,className:`transition-[stroke-dashoffset,stroke] duration-300`,"data-testid":`context-window-ring-arc`})]})}exports.CONTEXT_WINDOW_TRACK_COLOR=a,exports.ContextWindowRing=s;
|
|
2
|
+
//# sourceMappingURL=context-window-ring.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-window-ring.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/context-window-ring.tsx"],"sourcesContent":["import { cn } from \"#/utils/utils\";\nimport { getContextFillTone } from \"#/components/features/conversation/usage-panel/context-meter\";\n\nconst CONTEXT_WINDOW_RING_SIZE = 16;\nconst CONTEXT_WINDOW_RING_STROKE = 2;\n\n/**\n * Opacity of the ring's unfilled track, as a fraction of `--oh-foreground`.\n *\n * The track is derived from the foreground rather than pinned to a scale stop.\n * It carries information (the arc's proportion is only readable against it), so\n * it is a foreground element, and every stop in the surface family sits close\n * to the surfaces it delimits. Drawing it with `--oh-border` put it in that\n * family: it was 1.57:1 against the composer at rest, and the trigger's hover\n * fill resolves to the same stop, taking it to 1.00:1. No stop in that family\n * fixes it, and no fixed stop holds across the three palettes in\n * `color-themes.ts`, whose scales differ.\n *\n * Compositing the foreground over whatever the active theme paints keeps the\n * track between surface and arc by construction rather than by coincidence.\n * 42% is the value that maximises the worst case across the shipped palettes;\n * `context-window-ring.test.tsx` asserts it per theme.\n */\nexport const CONTEXT_WINDOW_RING_TRACK_ALPHA = 0.42;\n\n/** Shared by the ring's track and the popover's usage bar, which had the same defect. */\nexport const CONTEXT_WINDOW_TRACK_COLOR = `color-mix(in srgb, var(--oh-foreground) ${CONTEXT_WINDOW_RING_TRACK_ALPHA * 100}%, transparent)`;\n\nconst TONE_STROKE = {\n neutral: \"var(--oh-foreground)\",\n warning: \"#f59e0b\", // amber-500\n danger: \"#ef4444\", // red-500\n} as const;\n\ninterface ContextWindowRingProps {\n percentage: number;\n className?: string;\n}\n\nexport function ContextWindowRing({\n percentage,\n className,\n}: ContextWindowRingProps) {\n const radius = (CONTEXT_WINDOW_RING_SIZE - CONTEXT_WINDOW_RING_STROKE) / 2;\n const circumference = 2 * Math.PI * radius;\n const clampedPercentage = Math.min(100, Math.max(0, percentage));\n const dashOffset = circumference - (clampedPercentage / 100) * circumference;\n const tone = getContextFillTone(clampedPercentage);\n\n return (\n <svg\n width={CONTEXT_WINDOW_RING_SIZE}\n height={CONTEXT_WINDOW_RING_SIZE}\n viewBox={`0 0 ${CONTEXT_WINDOW_RING_SIZE} ${CONTEXT_WINDOW_RING_SIZE}`}\n className={cn(\"shrink-0\", className)}\n aria-hidden\n >\n <circle\n cx={CONTEXT_WINDOW_RING_SIZE / 2}\n cy={CONTEXT_WINDOW_RING_SIZE / 2}\n r={radius}\n fill=\"none\"\n style={{ stroke: CONTEXT_WINDOW_TRACK_COLOR }}\n strokeWidth={CONTEXT_WINDOW_RING_STROKE}\n data-testid=\"context-window-ring-track\"\n />\n <circle\n cx={CONTEXT_WINDOW_RING_SIZE / 2}\n cy={CONTEXT_WINDOW_RING_SIZE / 2}\n r={radius}\n fill=\"none\"\n stroke={TONE_STROKE[tone]}\n strokeWidth={CONTEXT_WINDOW_RING_STROKE}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n transform={`rotate(-90 ${CONTEXT_WINDOW_RING_SIZE / 2} ${CONTEXT_WINDOW_RING_SIZE / 2})`}\n className=\"transition-[stroke-dashoffset,stroke] duration-300\"\n data-testid=\"context-window-ring-arc\"\n />\n </svg>\n );\n}\n"],"mappings":"sMAGA,IAAM,EAA2B,GAC3B,EAA6B,EAsBtB,EAA6B,2CAA2C,IAAkC,IAAI,iBAErH,EAAc,CAClB,QAAS,uBACT,QAAS,UACT,OAAQ,SACV,EAOA,SAAgB,EAAkB,CAChC,aACA,aACyB,CACzB,IAAM,GAAU,EAA2B,GAA8B,EACnE,EAAgB,EAAI,KAAK,GAAK,EAC9B,EAAoB,KAAK,IAAI,IAAK,KAAK,IAAI,EAAG,CAAU,CAAC,EACzD,EAAa,EAAiB,EAAoB,IAAO,EACzD,EAAO,EAAA,mBAAmB,CAAiB,EAEjD,OACE,EAAA,EAAA,MAAC,MAAD,CACE,MAAO,EACP,OAAQ,EACR,QAAS,OAAO,EAAyB,GAAG,IAC5C,UAAW,EAAA,GAAG,WAAY,CAAS,EACnC,cAAA,YALF,EAOE,EAAA,EAAA,KAAC,SAAD,CACE,GAAI,EAA2B,EAC/B,GAAI,EAA2B,EAC/B,EAAG,EACH,KAAK,OACL,MAAO,CAAE,OAAQ,CAA2B,EAC5C,YAAa,EACb,cAAY,2BACb,CAAA,GACD,EAAA,EAAA,KAAC,SAAD,CACE,GAAI,EAA2B,EAC/B,GAAI,EAA2B,EAC/B,EAAG,EACH,KAAK,OACL,OAAQ,EAAY,GACpB,YAAa,EACb,cAAc,QACd,gBAAiB,EACjB,iBAAkB,EAClB,UAAW,cAAc,EAA2B,EAAE,GAAG,EAA2B,EAAE,GACtF,UAAU,qDACV,cAAY,yBACb,CAAA,CACE,GAET"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opacity of the ring's unfilled track, as a fraction of `--oh-foreground`.
|
|
3
|
+
*
|
|
4
|
+
* The track is derived from the foreground rather than pinned to a scale stop.
|
|
5
|
+
* It carries information (the arc's proportion is only readable against it), so
|
|
6
|
+
* it is a foreground element, and every stop in the surface family sits close
|
|
7
|
+
* to the surfaces it delimits. Drawing it with `--oh-border` put it in that
|
|
8
|
+
* family: it was 1.57:1 against the composer at rest, and the trigger's hover
|
|
9
|
+
* fill resolves to the same stop, taking it to 1.00:1. No stop in that family
|
|
10
|
+
* fixes it, and no fixed stop holds across the three palettes in
|
|
11
|
+
* `color-themes.ts`, whose scales differ.
|
|
12
|
+
*
|
|
13
|
+
* Compositing the foreground over whatever the active theme paints keeps the
|
|
14
|
+
* track between surface and arc by construction rather than by coincidence.
|
|
15
|
+
* 42% is the value that maximises the worst case across the shipped palettes;
|
|
16
|
+
* `context-window-ring.test.tsx` asserts it per theme.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CONTEXT_WINDOW_RING_TRACK_ALPHA = 0.42;
|
|
19
|
+
/** Shared by the ring's track and the popover's usage bar, which had the same defect. */
|
|
20
|
+
export declare const CONTEXT_WINDOW_TRACK_COLOR = "color-mix(in srgb, var(--oh-foreground) 42%, transparent)";
|
|
21
|
+
interface ContextWindowRingProps {
|
|
22
|
+
percentage: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function ContextWindowRing({ percentage, className, }: ContextWindowRingProps): import("react").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn as e } from "../../../../utils/utils.js";
|
|
2
|
+
import { getContextFillTone as t } from "../../conversation/usage-panel/context-meter.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/features/chat/components/context-window-ring.tsx
|
|
5
|
+
var i = 16, a = 2, o = `color-mix(in srgb, var(--oh-foreground) ${.42 * 100}%, transparent)`, s = {
|
|
6
|
+
neutral: "var(--oh-foreground)",
|
|
7
|
+
warning: "#f59e0b",
|
|
8
|
+
danger: "#ef4444"
|
|
9
|
+
};
|
|
10
|
+
function c({ percentage: c, className: l }) {
|
|
11
|
+
let u = (i - a) / 2, d = 2 * Math.PI * u, f = Math.min(100, Math.max(0, c)), p = d - f / 100 * d, m = t(f);
|
|
12
|
+
return /* @__PURE__ */ r("svg", {
|
|
13
|
+
width: i,
|
|
14
|
+
height: i,
|
|
15
|
+
viewBox: `0 0 ${i} ${i}`,
|
|
16
|
+
className: e("shrink-0", l),
|
|
17
|
+
"aria-hidden": !0,
|
|
18
|
+
children: [/* @__PURE__ */ n("circle", {
|
|
19
|
+
cx: i / 2,
|
|
20
|
+
cy: i / 2,
|
|
21
|
+
r: u,
|
|
22
|
+
fill: "none",
|
|
23
|
+
style: { stroke: o },
|
|
24
|
+
strokeWidth: a,
|
|
25
|
+
"data-testid": "context-window-ring-track"
|
|
26
|
+
}), /* @__PURE__ */ n("circle", {
|
|
27
|
+
cx: i / 2,
|
|
28
|
+
cy: i / 2,
|
|
29
|
+
r: u,
|
|
30
|
+
fill: "none",
|
|
31
|
+
stroke: s[m],
|
|
32
|
+
strokeWidth: a,
|
|
33
|
+
strokeLinecap: "round",
|
|
34
|
+
strokeDasharray: d,
|
|
35
|
+
strokeDashoffset: p,
|
|
36
|
+
transform: `rotate(-90 ${i / 2} ${i / 2})`,
|
|
37
|
+
className: "transition-[stroke-dashoffset,stroke] duration-300",
|
|
38
|
+
"data-testid": "context-window-ring-arc"
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { o as CONTEXT_WINDOW_TRACK_COLOR, c as ContextWindowRing };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=context-window-ring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-window-ring.js","names":[],"sources":["../../../../../src/components/features/chat/components/context-window-ring.tsx"],"sourcesContent":["import { cn } from \"#/utils/utils\";\nimport { getContextFillTone } from \"#/components/features/conversation/usage-panel/context-meter\";\n\nconst CONTEXT_WINDOW_RING_SIZE = 16;\nconst CONTEXT_WINDOW_RING_STROKE = 2;\n\n/**\n * Opacity of the ring's unfilled track, as a fraction of `--oh-foreground`.\n *\n * The track is derived from the foreground rather than pinned to a scale stop.\n * It carries information (the arc's proportion is only readable against it), so\n * it is a foreground element, and every stop in the surface family sits close\n * to the surfaces it delimits. Drawing it with `--oh-border` put it in that\n * family: it was 1.57:1 against the composer at rest, and the trigger's hover\n * fill resolves to the same stop, taking it to 1.00:1. No stop in that family\n * fixes it, and no fixed stop holds across the three palettes in\n * `color-themes.ts`, whose scales differ.\n *\n * Compositing the foreground over whatever the active theme paints keeps the\n * track between surface and arc by construction rather than by coincidence.\n * 42% is the value that maximises the worst case across the shipped palettes;\n * `context-window-ring.test.tsx` asserts it per theme.\n */\nexport const CONTEXT_WINDOW_RING_TRACK_ALPHA = 0.42;\n\n/** Shared by the ring's track and the popover's usage bar, which had the same defect. */\nexport const CONTEXT_WINDOW_TRACK_COLOR = `color-mix(in srgb, var(--oh-foreground) ${CONTEXT_WINDOW_RING_TRACK_ALPHA * 100}%, transparent)`;\n\nconst TONE_STROKE = {\n neutral: \"var(--oh-foreground)\",\n warning: \"#f59e0b\", // amber-500\n danger: \"#ef4444\", // red-500\n} as const;\n\ninterface ContextWindowRingProps {\n percentage: number;\n className?: string;\n}\n\nexport function ContextWindowRing({\n percentage,\n className,\n}: ContextWindowRingProps) {\n const radius = (CONTEXT_WINDOW_RING_SIZE - CONTEXT_WINDOW_RING_STROKE) / 2;\n const circumference = 2 * Math.PI * radius;\n const clampedPercentage = Math.min(100, Math.max(0, percentage));\n const dashOffset = circumference - (clampedPercentage / 100) * circumference;\n const tone = getContextFillTone(clampedPercentage);\n\n return (\n <svg\n width={CONTEXT_WINDOW_RING_SIZE}\n height={CONTEXT_WINDOW_RING_SIZE}\n viewBox={`0 0 ${CONTEXT_WINDOW_RING_SIZE} ${CONTEXT_WINDOW_RING_SIZE}`}\n className={cn(\"shrink-0\", className)}\n aria-hidden\n >\n <circle\n cx={CONTEXT_WINDOW_RING_SIZE / 2}\n cy={CONTEXT_WINDOW_RING_SIZE / 2}\n r={radius}\n fill=\"none\"\n style={{ stroke: CONTEXT_WINDOW_TRACK_COLOR }}\n strokeWidth={CONTEXT_WINDOW_RING_STROKE}\n data-testid=\"context-window-ring-track\"\n />\n <circle\n cx={CONTEXT_WINDOW_RING_SIZE / 2}\n cy={CONTEXT_WINDOW_RING_SIZE / 2}\n r={radius}\n fill=\"none\"\n stroke={TONE_STROKE[tone]}\n strokeWidth={CONTEXT_WINDOW_RING_STROKE}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n transform={`rotate(-90 ${CONTEXT_WINDOW_RING_SIZE / 2} ${CONTEXT_WINDOW_RING_SIZE / 2})`}\n className=\"transition-[stroke-dashoffset,stroke] duration-300\"\n data-testid=\"context-window-ring-arc\"\n />\n </svg>\n );\n}\n"],"mappings":";;;;AAGA,IAAM,IAA2B,IAC3B,IAA6B,GAsBtB,IAA6B,2CAA2C,MAAkC,IAAI,kBAErH,IAAc;CAClB,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAOA,SAAgB,EAAkB,EAChC,eACA,gBACyB;CACzB,IAAM,KAAU,IAA2B,KAA8B,GACnE,IAAgB,IAAI,KAAK,KAAK,GAC9B,IAAoB,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAU,CAAC,GACzD,IAAa,IAAiB,IAAoB,MAAO,GACzD,IAAO,EAAmB,CAAiB;CAEjD,OACE,kBAAC,OAAD;EACE,OAAO;EACP,QAAQ;EACR,SAAS,OAAO,EAAyB,GAAG;EAC5C,WAAW,EAAG,YAAY,CAAS;EACnC,eAAA;YALF,CAOE,kBAAC,UAAD;GACE,IAAI,IAA2B;GAC/B,IAAI,IAA2B;GAC/B,GAAG;GACH,MAAK;GACL,OAAO,EAAE,QAAQ,EAA2B;GAC5C,aAAa;GACb,eAAY;EACb,CAAA,GACD,kBAAC,UAAD;GACE,IAAI,IAA2B;GAC/B,IAAI,IAA2B;GAC/B,GAAG;GACH,MAAK;GACL,QAAQ,EAAY;GACpB,aAAa;GACb,eAAc;GACd,iBAAiB;GACjB,kBAAkB;GAClB,WAAW,cAAc,IAA2B,EAAE,GAAG,IAA2B,EAAE;GACtF,WAAU;GACV,eAAY;EACb,CAAA,CACE;;AAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/utils.cjs"),n=require("../../../stores/conversation-store.cjs"),r=require("../../../hooks/chat/use-chat-input-logic.cjs"),i=require("../../../hooks/chat/use-file-handling.cjs"),a=require("../../../hooks/chat/use-grip-resize.cjs"),o=require("../../../hooks/chat/use-chat-input-events.cjs"),s=require("../../../hooks/chat/use-chat-submission.cjs"),c=require("../../../hooks/chat/use-slash-command.cjs"),l=require("./components/chat-input-grip.cjs"),u=require("./components/chat-input-container.cjs"),d=require("./components/hidden-file-input.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("react/jsx-runtime");function m({disabled:e=!1,isNewConversationPending:m=!1,hasStartedConversation:h,showButton:g=!0,onSubmit:_,onFocus:ee,onBlur:te,onFilesPaste:ne,className:v=``,buttonClassName:y=``}){let[b,x]=f.default.useState(!1),{submittedMessage:S,clearAllFiles:C,setShouldHideSuggestions:w,setSubmittedMessage:T,images:E,files:D}=n.useConversationStore(),O=e,k=(0,f.useRef)(_);(0,f.useEffect)(()=>{k.current=_},[_]),(0,f.useEffect)(()=>{!S||e||(k.current(S),T(null))},[S,e,T]);let{chatInputRef:A,messageToSend:j,checkIsContentEmpty:M,clearEmptyContentHandler:N,saveDraft:P}=r.useChatInputLogic(),F=f.default.useCallback(()=>{let e=A.current?.innerText??``,t=E.length>0||D.length>0;x(e.trim().length>0||t)},[A,E,D]),{fileInputRef:I,chatContainerRef:L,isDragOver:R,handleFileIconClick:z,handleFileInputChange:B,handleDragOver:V,handleDragLeave:re,handleDrop:H}=i.useFileHandling(ne),{gripRef:U,isGripVisible:W,isGripDragging:G,
|
|
1
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/utils.cjs"),n=require("../../../stores/conversation-store.cjs"),r=require("../../../hooks/chat/use-chat-input-logic.cjs"),i=require("../../../hooks/chat/use-file-handling.cjs"),a=require("../../../hooks/chat/use-grip-resize.cjs"),o=require("../../../hooks/chat/use-chat-input-events.cjs"),s=require("../../../hooks/chat/use-chat-submission.cjs"),c=require("../../../hooks/chat/use-slash-command.cjs"),l=require("./components/chat-input-grip.cjs"),u=require("./components/chat-input-container.cjs"),d=require("./components/hidden-file-input.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("react/jsx-runtime");function m({disabled:e=!1,isNewConversationPending:m=!1,hasStartedConversation:h,showButton:g=!0,onSubmit:_,onFocus:ee,onBlur:te,onFilesPaste:ne,className:v=``,buttonClassName:y=``}){let[b,x]=f.default.useState(!1),{submittedMessage:S,clearAllFiles:C,setShouldHideSuggestions:w,setSubmittedMessage:T,images:E,files:D}=n.useConversationStore(),O=e,k=(0,f.useRef)(_);(0,f.useEffect)(()=>{k.current=_},[_]),(0,f.useEffect)(()=>{!S||e||(k.current(S),T(null))},[S,e,T]);let{chatInputRef:A,messageToSend:j,checkIsContentEmpty:M,clearEmptyContentHandler:N,saveDraft:P}=r.useChatInputLogic(),F=f.default.useCallback(()=>{let e=A.current?.innerText??``,t=E.length>0||D.length>0;x(e.trim().length>0||t)},[A,E,D]),{fileInputRef:I,chatContainerRef:L,isDragOver:R,handleFileIconClick:z,handleFileInputChange:B,handleDragOver:V,handleDragLeave:re,handleDrop:H}=i.useFileHandling(ne),{gripRef:U,isGripVisible:W,isGripDragging:G,canResize:K,handleTopEdgeClick:q,smartResize:J,handleGripMouseDown:Y,handleGripTouchStart:X,increaseHeightForEmptyContent:ie,resetManualResize:ae}=a.useGripResize(A,j),{handleSubmit:Z}=s.useChatSubmission(A,I,J,_,ae),Q=f.default.useCallback(()=>{Z(),F()},[Z,F]),{handleInput:oe,handlePaste:$,handleKeyDown:se,handleBlur:ce,handleFocus:le}=o.useChatInputEvents(A,J,ie,M,N,ee,te),{isMenuOpen:ue,filteredItems:de,selectedIndex:fe,updateSlashMenu:pe,selectItem:me,handleSlashKeyDown:he,closeMenu:ge}=c.useSlashCommand(A);return(0,f.useEffect)(()=>()=>{w(!1),C()},[w,C]),(0,f.useEffect)(()=>{F()},[F,E.length,D.length]),(0,p.jsxs)(`div`,{className:t.cn(`w-full`,v),children:[(0,p.jsx)(d.HiddenFileInput,{fileInputRef:I,onChange:B}),(0,p.jsxs)(`div`,{className:`relative w-full`,children:[(0,p.jsx)(l.ChatInputGrip,{gripRef:U,isGripVisible:W,isGripDragging:G,canResize:K,handleTopEdgeClick:q,handleGripMouseDown:Y,handleGripTouchStart:X}),(0,p.jsx)(u.ChatInputContainer,{chatContainerRef:L,isDragOver:R,disabled:O,canSubmit:b,hasStartedConversation:h,isNewConversationPending:m,showButton:g,buttonClassName:y,chatInputRef:A,handleFileIconClick:z,handleSubmit:Q,onDragOver:V,onDragLeave:re,onDrop:H,onInput:()=>{oe(),pe(),P(),F()},onPaste:$,onKeyDown:e=>{he(e)||se(e,O,Q)},onFocus:le,onBlur:()=>{ce(),ge(),F()},isSlashMenuOpen:ue,slashItems:de,slashSelectedIndex:fe,onSlashSelect:me})]})]})}exports.CustomChatInput=m;
|
|
2
2
|
//# sourceMappingURL=custom-chat-input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-chat-input.cjs","names":[],"sources":["../../../../src/components/features/chat/custom-chat-input.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport { useChatInputLogic } from \"#/hooks/chat/use-chat-input-logic\";\nimport { useFileHandling } from \"#/hooks/chat/use-file-handling\";\nimport { useGripResize } from \"#/hooks/chat/use-grip-resize\";\nimport { useChatInputEvents } from \"#/hooks/chat/use-chat-input-events\";\nimport { useChatSubmission } from \"#/hooks/chat/use-chat-submission\";\nimport { useSlashCommand } from \"#/hooks/chat/use-slash-command\";\nimport { ChatInputGrip } from \"./components/chat-input-grip\";\nimport { ChatInputContainer } from \"./components/chat-input-container\";\nimport { HiddenFileInput } from \"./components/hidden-file-input\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\n\nexport interface CustomChatInputProps {\n disabled?: boolean;\n isNewConversationPending?: boolean;\n hasStartedConversation?: boolean;\n showButton?: boolean;\n onSubmit: (message: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n onFilesPaste?: (\n files: File[],\n options?: import(\"#/hooks/chat/use-chat-attachment-upload\").ChatAttachmentUploadOptions,\n ) => void;\n className?: React.HTMLAttributes<HTMLDivElement>[\"className\"];\n buttonClassName?: React.HTMLAttributes<HTMLButtonElement>[\"className\"];\n}\n\nexport function CustomChatInput({\n disabled = false,\n isNewConversationPending = false,\n hasStartedConversation,\n showButton = true,\n onSubmit,\n onFocus,\n onBlur,\n onFilesPaste,\n className = \"\",\n buttonClassName = \"\",\n}: CustomChatInputProps) {\n const [canSubmit, setCanSubmit] = React.useState(false);\n const {\n submittedMessage,\n clearAllFiles,\n setShouldHideSuggestions,\n setSubmittedMessage,\n images,\n files,\n } = useConversationStore();\n\n // Note: we intentionally do NOT disable the input when the conversation is\n // in an ERROR/STUCK execution state. Users should be able to send a follow-up\n // message to recover the conversation; the message will be delivered\n // immediately via the WebSocket if connected, or queued via REST otherwise.\n const isDisabled = disabled;\n\n // Always call the latest `onSubmit` without making the effect re-run when\n // its identity changes. `onSubmit` (typically `handleSendMessage`) is a\n // fresh function on every parent render, and the parent re-renders\n // whenever the pending-message queue updates synchronously inside\n // `onSubmit` itself. Listing it in the dep array caused the effect to\n // fire twice — once for the original submit and again from the\n // mid-submit re-render, before `setSubmittedMessage(null)` was applied —\n // producing a duplicate \"Sending…\" bubble.\n const onSubmitRef = useRef(onSubmit);\n useEffect(() => {\n onSubmitRef.current = onSubmit;\n }, [onSubmit]);\n\n // Listen to submittedMessage state changes\n useEffect(() => {\n if (!submittedMessage || disabled) {\n return;\n }\n onSubmitRef.current(submittedMessage);\n setSubmittedMessage(null);\n }, [submittedMessage, disabled, setSubmittedMessage]);\n\n // Custom hooks\n const {\n chatInputRef,\n messageToSend,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n saveDraft,\n } = useChatInputLogic();\n\n const syncCanSubmit = React.useCallback(() => {\n const text = chatInputRef.current?.innerText ?? \"\";\n const hasAttachments = images.length > 0 || files.length > 0;\n setCanSubmit(text.trim().length > 0 || hasAttachments);\n }, [chatInputRef, images, files]);\n\n const {\n fileInputRef,\n chatContainerRef,\n isDragOver,\n handleFileIconClick,\n handleFileInputChange,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n } = useFileHandling(onFilesPaste);\n\n const {\n gripRef,\n isGripVisible,\n isGripDragging,\n handleTopEdgeClick,\n smartResize,\n handleGripMouseDown,\n handleGripTouchStart,\n increaseHeightForEmptyContent,\n resetManualResize,\n } = useGripResize(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n messageToSend,\n );\n\n const { handleSubmit } = useChatSubmission(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n fileInputRef as React.RefObject<HTMLInputElement | null>,\n smartResize,\n onSubmit,\n resetManualResize,\n );\n const handleSubmitAndSync = React.useCallback(() => {\n handleSubmit();\n syncCanSubmit();\n }, [handleSubmit, syncCanSubmit]);\n\n const { handleInput, handlePaste, handleKeyDown, handleBlur, handleFocus } =\n useChatInputEvents(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n smartResize,\n increaseHeightForEmptyContent,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n onFocus,\n onBlur,\n );\n\n const {\n isMenuOpen: isSlashMenuOpen,\n filteredItems: slashItems,\n selectedIndex: slashSelectedIndex,\n updateSlashMenu,\n selectItem: selectSlashItem,\n handleSlashKeyDown,\n closeMenu: closeSlashMenu,\n } = useSlashCommand(chatInputRef as React.RefObject<HTMLDivElement | null>);\n\n // Cleanup: reset suggestions visibility when component unmounts\n useEffect(\n () => () => {\n setShouldHideSuggestions(false);\n clearAllFiles();\n },\n [setShouldHideSuggestions, clearAllFiles],\n );\n useEffect(() => {\n syncCanSubmit();\n }, [syncCanSubmit, images.length, files.length]);\n return (\n <div className={cn(\"w-full\", className)}>\n {/* Hidden file input */}\n <HiddenFileInput\n fileInputRef={fileInputRef}\n onChange={handleFileInputChange}\n />\n\n {/* Container with grip */}\n <div className=\"relative w-full\">\n <ChatInputGrip\n gripRef={gripRef}\n isGripVisible={isGripVisible}\n isGripDragging={isGripDragging}\n handleTopEdgeClick={handleTopEdgeClick}\n handleGripMouseDown={handleGripMouseDown}\n handleGripTouchStart={handleGripTouchStart}\n />\n\n <ChatInputContainer\n chatContainerRef={chatContainerRef}\n isDragOver={isDragOver}\n disabled={isDisabled}\n canSubmit={canSubmit}\n hasStartedConversation={hasStartedConversation}\n isNewConversationPending={isNewConversationPending}\n showButton={showButton}\n buttonClassName={buttonClassName}\n chatInputRef={chatInputRef}\n handleFileIconClick={handleFileIconClick}\n handleSubmit={handleSubmitAndSync}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onInput={() => {\n handleInput();\n updateSlashMenu();\n saveDraft();\n syncCanSubmit();\n }}\n onPaste={handlePaste}\n onKeyDown={(e) => {\n if (handleSlashKeyDown(e)) return;\n handleKeyDown(e, isDisabled, handleSubmitAndSync);\n }}\n onFocus={handleFocus}\n onBlur={() => {\n handleBlur();\n closeSlashMenu();\n syncCanSubmit();\n }}\n isSlashMenuOpen={isSlashMenuOpen}\n slashItems={slashItems}\n slashSelectedIndex={slashSelectedIndex}\n onSlashSelect={selectSlashItem}\n />\n </div>\n </div>\n );\n}\n"],"mappings":"ksBA6BA,SAAgB,EAAgB,CAC9B,WAAW,GACX,2BAA2B,GAC3B,yBACA,aAAa,GACb,WACA,WACA,UACA,gBACA,YAAY,GACZ,kBAAkB,IACK,CACvB,GAAM,CAAC,EAAW,GAAgB,EAAA,QAAM,SAAS,EAAK,EAChD,CACJ,mBACA,gBACA,2BACA,sBACA,SACA,SACE,EAAA,qBAAqB,EAMnB,EAAa,EAUb,GAAA,EAAA,EAAA,QAAqB,CAAQ,GACnC,EAAA,EAAA,eAAgB,CACd,EAAY,QAAU,CACxB,EAAG,CAAC,CAAQ,CAAC,GAGb,EAAA,EAAA,eAAgB,CACV,CAAC,GAAoB,IAGzB,EAAY,QAAQ,CAAgB,EACpC,EAAoB,IAAI,EAC1B,EAAG,CAAC,EAAkB,EAAU,CAAmB,CAAC,EAGpD,GAAM,CACJ,eACA,gBACA,sBACA,2BACA,aACE,EAAA,kBAAkB,EAEhB,EAAgB,EAAA,QAAM,gBAAkB,CAC5C,IAAM,EAAO,EAAa,SAAS,WAAa,GAC1C,EAAiB,EAAO,OAAS,GAAK,EAAM,OAAS,EAC3D,EAAa,EAAK,KAAK,EAAE,OAAS,GAAK,CAAc,CACvD,EAAG,CAAC,EAAc,EAAQ,CAAK,CAAC,EAE1B,CACJ,eACA,mBACA,aACA,sBACA,wBACA,iBACA,mBACA,cACE,EAAA,gBAAgB,EAAY,EAE1B,CACJ,UACA,gBACA,iBACA,qBACA,cACA,sBACA,uBACA,
|
|
1
|
+
{"version":3,"file":"custom-chat-input.cjs","names":[],"sources":["../../../../src/components/features/chat/custom-chat-input.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport { useChatInputLogic } from \"#/hooks/chat/use-chat-input-logic\";\nimport { useFileHandling } from \"#/hooks/chat/use-file-handling\";\nimport { useGripResize } from \"#/hooks/chat/use-grip-resize\";\nimport { useChatInputEvents } from \"#/hooks/chat/use-chat-input-events\";\nimport { useChatSubmission } from \"#/hooks/chat/use-chat-submission\";\nimport { useSlashCommand } from \"#/hooks/chat/use-slash-command\";\nimport { ChatInputGrip } from \"./components/chat-input-grip\";\nimport { ChatInputContainer } from \"./components/chat-input-container\";\nimport { HiddenFileInput } from \"./components/hidden-file-input\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\n\nexport interface CustomChatInputProps {\n disabled?: boolean;\n isNewConversationPending?: boolean;\n hasStartedConversation?: boolean;\n showButton?: boolean;\n onSubmit: (message: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n onFilesPaste?: (\n files: File[],\n options?: import(\"#/hooks/chat/use-chat-attachment-upload\").ChatAttachmentUploadOptions,\n ) => void;\n className?: React.HTMLAttributes<HTMLDivElement>[\"className\"];\n buttonClassName?: React.HTMLAttributes<HTMLButtonElement>[\"className\"];\n}\n\nexport function CustomChatInput({\n disabled = false,\n isNewConversationPending = false,\n hasStartedConversation,\n showButton = true,\n onSubmit,\n onFocus,\n onBlur,\n onFilesPaste,\n className = \"\",\n buttonClassName = \"\",\n}: CustomChatInputProps) {\n const [canSubmit, setCanSubmit] = React.useState(false);\n const {\n submittedMessage,\n clearAllFiles,\n setShouldHideSuggestions,\n setSubmittedMessage,\n images,\n files,\n } = useConversationStore();\n\n // Note: we intentionally do NOT disable the input when the conversation is\n // in an ERROR/STUCK execution state. Users should be able to send a follow-up\n // message to recover the conversation; the message will be delivered\n // immediately via the WebSocket if connected, or queued via REST otherwise.\n const isDisabled = disabled;\n\n // Always call the latest `onSubmit` without making the effect re-run when\n // its identity changes. `onSubmit` (typically `handleSendMessage`) is a\n // fresh function on every parent render, and the parent re-renders\n // whenever the pending-message queue updates synchronously inside\n // `onSubmit` itself. Listing it in the dep array caused the effect to\n // fire twice — once for the original submit and again from the\n // mid-submit re-render, before `setSubmittedMessage(null)` was applied —\n // producing a duplicate \"Sending…\" bubble.\n const onSubmitRef = useRef(onSubmit);\n useEffect(() => {\n onSubmitRef.current = onSubmit;\n }, [onSubmit]);\n\n // Listen to submittedMessage state changes\n useEffect(() => {\n if (!submittedMessage || disabled) {\n return;\n }\n onSubmitRef.current(submittedMessage);\n setSubmittedMessage(null);\n }, [submittedMessage, disabled, setSubmittedMessage]);\n\n // Custom hooks\n const {\n chatInputRef,\n messageToSend,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n saveDraft,\n } = useChatInputLogic();\n\n const syncCanSubmit = React.useCallback(() => {\n const text = chatInputRef.current?.innerText ?? \"\";\n const hasAttachments = images.length > 0 || files.length > 0;\n setCanSubmit(text.trim().length > 0 || hasAttachments);\n }, [chatInputRef, images, files]);\n\n const {\n fileInputRef,\n chatContainerRef,\n isDragOver,\n handleFileIconClick,\n handleFileInputChange,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n } = useFileHandling(onFilesPaste);\n\n const {\n gripRef,\n isGripVisible,\n isGripDragging,\n canResize,\n handleTopEdgeClick,\n smartResize,\n handleGripMouseDown,\n handleGripTouchStart,\n increaseHeightForEmptyContent,\n resetManualResize,\n } = useGripResize(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n messageToSend,\n );\n\n const { handleSubmit } = useChatSubmission(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n fileInputRef as React.RefObject<HTMLInputElement | null>,\n smartResize,\n onSubmit,\n resetManualResize,\n );\n const handleSubmitAndSync = React.useCallback(() => {\n handleSubmit();\n syncCanSubmit();\n }, [handleSubmit, syncCanSubmit]);\n\n const { handleInput, handlePaste, handleKeyDown, handleBlur, handleFocus } =\n useChatInputEvents(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n smartResize,\n increaseHeightForEmptyContent,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n onFocus,\n onBlur,\n );\n\n const {\n isMenuOpen: isSlashMenuOpen,\n filteredItems: slashItems,\n selectedIndex: slashSelectedIndex,\n updateSlashMenu,\n selectItem: selectSlashItem,\n handleSlashKeyDown,\n closeMenu: closeSlashMenu,\n } = useSlashCommand(chatInputRef as React.RefObject<HTMLDivElement | null>);\n\n // Cleanup: reset suggestions visibility when component unmounts\n useEffect(\n () => () => {\n setShouldHideSuggestions(false);\n clearAllFiles();\n },\n [setShouldHideSuggestions, clearAllFiles],\n );\n useEffect(() => {\n syncCanSubmit();\n }, [syncCanSubmit, images.length, files.length]);\n return (\n <div className={cn(\"w-full\", className)}>\n {/* Hidden file input */}\n <HiddenFileInput\n fileInputRef={fileInputRef}\n onChange={handleFileInputChange}\n />\n\n {/* Container with grip */}\n <div className=\"relative w-full\">\n <ChatInputGrip\n gripRef={gripRef}\n isGripVisible={isGripVisible}\n isGripDragging={isGripDragging}\n canResize={canResize}\n handleTopEdgeClick={handleTopEdgeClick}\n handleGripMouseDown={handleGripMouseDown}\n handleGripTouchStart={handleGripTouchStart}\n />\n\n <ChatInputContainer\n chatContainerRef={chatContainerRef}\n isDragOver={isDragOver}\n disabled={isDisabled}\n canSubmit={canSubmit}\n hasStartedConversation={hasStartedConversation}\n isNewConversationPending={isNewConversationPending}\n showButton={showButton}\n buttonClassName={buttonClassName}\n chatInputRef={chatInputRef}\n handleFileIconClick={handleFileIconClick}\n handleSubmit={handleSubmitAndSync}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onInput={() => {\n handleInput();\n updateSlashMenu();\n saveDraft();\n syncCanSubmit();\n }}\n onPaste={handlePaste}\n onKeyDown={(e) => {\n if (handleSlashKeyDown(e)) return;\n handleKeyDown(e, isDisabled, handleSubmitAndSync);\n }}\n onFocus={handleFocus}\n onBlur={() => {\n handleBlur();\n closeSlashMenu();\n syncCanSubmit();\n }}\n isSlashMenuOpen={isSlashMenuOpen}\n slashItems={slashItems}\n slashSelectedIndex={slashSelectedIndex}\n onSlashSelect={selectSlashItem}\n />\n </div>\n </div>\n );\n}\n"],"mappings":"ksBA6BA,SAAgB,EAAgB,CAC9B,WAAW,GACX,2BAA2B,GAC3B,yBACA,aAAa,GACb,WACA,WACA,UACA,gBACA,YAAY,GACZ,kBAAkB,IACK,CACvB,GAAM,CAAC,EAAW,GAAgB,EAAA,QAAM,SAAS,EAAK,EAChD,CACJ,mBACA,gBACA,2BACA,sBACA,SACA,SACE,EAAA,qBAAqB,EAMnB,EAAa,EAUb,GAAA,EAAA,EAAA,QAAqB,CAAQ,GACnC,EAAA,EAAA,eAAgB,CACd,EAAY,QAAU,CACxB,EAAG,CAAC,CAAQ,CAAC,GAGb,EAAA,EAAA,eAAgB,CACV,CAAC,GAAoB,IAGzB,EAAY,QAAQ,CAAgB,EACpC,EAAoB,IAAI,EAC1B,EAAG,CAAC,EAAkB,EAAU,CAAmB,CAAC,EAGpD,GAAM,CACJ,eACA,gBACA,sBACA,2BACA,aACE,EAAA,kBAAkB,EAEhB,EAAgB,EAAA,QAAM,gBAAkB,CAC5C,IAAM,EAAO,EAAa,SAAS,WAAa,GAC1C,EAAiB,EAAO,OAAS,GAAK,EAAM,OAAS,EAC3D,EAAa,EAAK,KAAK,EAAE,OAAS,GAAK,CAAc,CACvD,EAAG,CAAC,EAAc,EAAQ,CAAK,CAAC,EAE1B,CACJ,eACA,mBACA,aACA,sBACA,wBACA,iBACA,mBACA,cACE,EAAA,gBAAgB,EAAY,EAE1B,CACJ,UACA,gBACA,iBACA,YACA,qBACA,cACA,sBACA,uBACA,iCACA,sBACE,EAAA,cACF,EACA,CACF,EAEM,CAAE,gBAAiB,EAAA,kBACvB,EACA,EACA,EACA,EACA,EACF,EACM,EAAsB,EAAA,QAAM,gBAAkB,CAClD,EAAa,EACb,EAAc,CAChB,EAAG,CAAC,EAAc,CAAa,CAAC,EAE1B,CAAE,eAAa,cAAa,iBAAe,cAAY,gBAC3D,EAAA,mBACE,EACA,EACA,GACA,EACA,EACA,GACA,EACF,EAEI,CACJ,WAAY,GACZ,cAAe,GACf,cAAe,GACf,mBACA,WAAY,GACZ,sBACA,UAAW,IACT,EAAA,gBAAgB,CAAsD,EAa1E,OAVA,EAAA,EAAA,mBACc,CACV,EAAyB,EAAK,EAC9B,EAAc,CAChB,EACA,CAAC,EAA0B,CAAa,CAC1C,GACA,EAAA,EAAA,eAAgB,CACd,EAAc,CAChB,EAAG,CAAC,EAAe,EAAO,OAAQ,EAAM,MAAM,CAAC,GAE7C,EAAA,EAAA,MAAC,MAAD,CAAK,UAAW,EAAA,GAAG,SAAU,CAAS,WAAtC,EAEE,EAAA,EAAA,KAAC,EAAA,gBAAD,CACgB,eACd,SAAU,CACX,CAAA,GAGD,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,2BAAf,EACE,EAAA,EAAA,KAAC,EAAA,cAAD,CACW,UACM,gBACC,iBACL,YACS,qBACC,sBACC,sBACvB,CAAA,GAED,EAAA,EAAA,KAAC,EAAA,mBAAD,CACoB,mBACN,aACZ,SAAU,EACC,YACa,yBACE,2BACd,aACK,kBACH,eACO,sBACrB,aAAc,EACd,WAAY,EACZ,YAAa,GACb,OAAQ,EACR,YAAe,CACb,GAAY,EACZ,GAAgB,EAChB,EAAU,EACV,EAAc,CAChB,EACA,QAAS,EACT,UAAY,GAAM,CACZ,GAAmB,CAAC,GACxB,GAAc,EAAG,EAAY,CAAmB,CAClD,EACA,QAAS,GACT,WAAc,CACZ,GAAW,EACX,GAAe,EACf,EAAc,CAChB,EACiB,mBACL,cACQ,sBACpB,cAAe,EAChB,CAAA,CACE,GACF,GAET"}
|
|
@@ -5,91 +5,92 @@ import { useFileHandling as r } from "../../../hooks/chat/use-file-handling.js";
|
|
|
5
5
|
import { useGripResize as i } from "../../../hooks/chat/use-grip-resize.js";
|
|
6
6
|
import { useChatInputEvents as a } from "../../../hooks/chat/use-chat-input-events.js";
|
|
7
7
|
import { useChatSubmission as o } from "../../../hooks/chat/use-chat-submission.js";
|
|
8
|
-
import { useSlashCommand as
|
|
9
|
-
import { ChatInputGrip as
|
|
10
|
-
import { ChatInputContainer as
|
|
11
|
-
import { HiddenFileInput as
|
|
12
|
-
import
|
|
13
|
-
import { jsx as
|
|
8
|
+
import { useSlashCommand as ee } from "../../../hooks/chat/use-slash-command.js";
|
|
9
|
+
import { ChatInputGrip as s } from "./components/chat-input-grip.js";
|
|
10
|
+
import { ChatInputContainer as c } from "./components/chat-input-container.js";
|
|
11
|
+
import { HiddenFileInput as l } from "./components/hidden-file-input.js";
|
|
12
|
+
import u, { useEffect as d, useRef as f } from "react";
|
|
13
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/features/chat/custom-chat-input.tsx
|
|
15
|
-
function
|
|
16
|
-
let [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
!
|
|
15
|
+
function h({ disabled: h = !1, isNewConversationPending: g = !1, hasStartedConversation: _, showButton: v = !0, onSubmit: y, onFocus: te, onBlur: ne, onFilesPaste: b, className: x = "", buttonClassName: S = "" }) {
|
|
16
|
+
let [C, w] = u.useState(!1), { submittedMessage: T, clearAllFiles: E, setShouldHideSuggestions: D, setSubmittedMessage: O, images: k, files: A } = t(), j = h, M = f(y);
|
|
17
|
+
d(() => {
|
|
18
|
+
M.current = y;
|
|
19
|
+
}, [y]), d(() => {
|
|
20
|
+
!T || h || (M.current(T), O(null));
|
|
21
21
|
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
T,
|
|
23
|
+
h,
|
|
24
|
+
O
|
|
25
25
|
]);
|
|
26
|
-
let { chatInputRef:
|
|
27
|
-
let e =
|
|
28
|
-
|
|
26
|
+
let { chatInputRef: N, messageToSend: P, checkIsContentEmpty: F, clearEmptyContentHandler: I, saveDraft: L } = n(), R = u.useCallback(() => {
|
|
27
|
+
let e = N.current?.innerText ?? "", t = k.length > 0 || A.length > 0;
|
|
28
|
+
w(e.trim().length > 0 || t);
|
|
29
29
|
}, [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]), { fileInputRef:
|
|
34
|
-
Q(),
|
|
35
|
-
}, [Q,
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
|
|
30
|
+
N,
|
|
31
|
+
k,
|
|
32
|
+
A
|
|
33
|
+
]), { fileInputRef: z, chatContainerRef: B, isDragOver: V, handleFileIconClick: H, handleFileInputChange: U, handleDragOver: re, handleDragLeave: W, handleDrop: G } = r(b), { gripRef: K, isGripVisible: q, isGripDragging: J, canResize: Y, handleTopEdgeClick: X, smartResize: Z, handleGripMouseDown: ie, handleGripTouchStart: ae, increaseHeightForEmptyContent: oe, resetManualResize: se } = i(N, P), { handleSubmit: Q } = o(N, z, Z, y, se), $ = u.useCallback(() => {
|
|
34
|
+
Q(), R();
|
|
35
|
+
}, [Q, R]), { handleInput: ce, handlePaste: le, handleKeyDown: ue, handleBlur: de, handleFocus: fe } = a(N, Z, oe, F, I, te, ne), { isMenuOpen: pe, filteredItems: me, selectedIndex: he, updateSlashMenu: ge, selectItem: _e, handleSlashKeyDown: ve, closeMenu: ye } = ee(N);
|
|
36
|
+
return d(() => () => {
|
|
37
|
+
D(!1), E();
|
|
38
|
+
}, [D, E]), d(() => {
|
|
39
|
+
R();
|
|
40
40
|
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
]), /* @__PURE__ */
|
|
45
|
-
className: e("w-full",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
47
|
-
fileInputRef:
|
|
48
|
-
onChange:
|
|
49
|
-
}), /* @__PURE__ */
|
|
41
|
+
R,
|
|
42
|
+
k.length,
|
|
43
|
+
A.length
|
|
44
|
+
]), /* @__PURE__ */ m("div", {
|
|
45
|
+
className: e("w-full", x),
|
|
46
|
+
children: [/* @__PURE__ */ p(l, {
|
|
47
|
+
fileInputRef: z,
|
|
48
|
+
onChange: U
|
|
49
|
+
}), /* @__PURE__ */ m("div", {
|
|
50
50
|
className: "relative w-full",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
-
gripRef:
|
|
53
|
-
isGripVisible:
|
|
54
|
-
isGripDragging:
|
|
51
|
+
children: [/* @__PURE__ */ p(s, {
|
|
52
|
+
gripRef: K,
|
|
53
|
+
isGripVisible: q,
|
|
54
|
+
isGripDragging: J,
|
|
55
|
+
canResize: Y,
|
|
55
56
|
handleTopEdgeClick: X,
|
|
56
|
-
handleGripMouseDown:
|
|
57
|
-
handleGripTouchStart:
|
|
58
|
-
}), /* @__PURE__ */
|
|
59
|
-
chatContainerRef:
|
|
60
|
-
isDragOver:
|
|
61
|
-
disabled:
|
|
62
|
-
canSubmit:
|
|
63
|
-
hasStartedConversation:
|
|
64
|
-
isNewConversationPending:
|
|
65
|
-
showButton:
|
|
66
|
-
buttonClassName:
|
|
67
|
-
chatInputRef:
|
|
68
|
-
handleFileIconClick:
|
|
57
|
+
handleGripMouseDown: ie,
|
|
58
|
+
handleGripTouchStart: ae
|
|
59
|
+
}), /* @__PURE__ */ p(c, {
|
|
60
|
+
chatContainerRef: B,
|
|
61
|
+
isDragOver: V,
|
|
62
|
+
disabled: j,
|
|
63
|
+
canSubmit: C,
|
|
64
|
+
hasStartedConversation: _,
|
|
65
|
+
isNewConversationPending: g,
|
|
66
|
+
showButton: v,
|
|
67
|
+
buttonClassName: S,
|
|
68
|
+
chatInputRef: N,
|
|
69
|
+
handleFileIconClick: H,
|
|
69
70
|
handleSubmit: $,
|
|
70
|
-
onDragOver:
|
|
71
|
-
onDragLeave:
|
|
72
|
-
onDrop:
|
|
71
|
+
onDragOver: re,
|
|
72
|
+
onDragLeave: W,
|
|
73
|
+
onDrop: G,
|
|
73
74
|
onInput: () => {
|
|
74
|
-
|
|
75
|
+
ce(), ge(), L(), R();
|
|
75
76
|
},
|
|
76
|
-
onPaste:
|
|
77
|
+
onPaste: le,
|
|
77
78
|
onKeyDown: (e) => {
|
|
78
|
-
|
|
79
|
+
ve(e) || ue(e, j, $);
|
|
79
80
|
},
|
|
80
|
-
onFocus:
|
|
81
|
+
onFocus: fe,
|
|
81
82
|
onBlur: () => {
|
|
82
|
-
|
|
83
|
+
de(), ye(), R();
|
|
83
84
|
},
|
|
84
|
-
isSlashMenuOpen:
|
|
85
|
-
slashItems:
|
|
86
|
-
slashSelectedIndex:
|
|
87
|
-
onSlashSelect:
|
|
85
|
+
isSlashMenuOpen: pe,
|
|
86
|
+
slashItems: me,
|
|
87
|
+
slashSelectedIndex: he,
|
|
88
|
+
onSlashSelect: _e
|
|
88
89
|
})]
|
|
89
90
|
})]
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
//#endregion
|
|
93
|
-
export {
|
|
94
|
+
export { h as CustomChatInput };
|
|
94
95
|
|
|
95
96
|
//# sourceMappingURL=custom-chat-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-chat-input.js","names":[],"sources":["../../../../src/components/features/chat/custom-chat-input.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport { useChatInputLogic } from \"#/hooks/chat/use-chat-input-logic\";\nimport { useFileHandling } from \"#/hooks/chat/use-file-handling\";\nimport { useGripResize } from \"#/hooks/chat/use-grip-resize\";\nimport { useChatInputEvents } from \"#/hooks/chat/use-chat-input-events\";\nimport { useChatSubmission } from \"#/hooks/chat/use-chat-submission\";\nimport { useSlashCommand } from \"#/hooks/chat/use-slash-command\";\nimport { ChatInputGrip } from \"./components/chat-input-grip\";\nimport { ChatInputContainer } from \"./components/chat-input-container\";\nimport { HiddenFileInput } from \"./components/hidden-file-input\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\n\nexport interface CustomChatInputProps {\n disabled?: boolean;\n isNewConversationPending?: boolean;\n hasStartedConversation?: boolean;\n showButton?: boolean;\n onSubmit: (message: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n onFilesPaste?: (\n files: File[],\n options?: import(\"#/hooks/chat/use-chat-attachment-upload\").ChatAttachmentUploadOptions,\n ) => void;\n className?: React.HTMLAttributes<HTMLDivElement>[\"className\"];\n buttonClassName?: React.HTMLAttributes<HTMLButtonElement>[\"className\"];\n}\n\nexport function CustomChatInput({\n disabled = false,\n isNewConversationPending = false,\n hasStartedConversation,\n showButton = true,\n onSubmit,\n onFocus,\n onBlur,\n onFilesPaste,\n className = \"\",\n buttonClassName = \"\",\n}: CustomChatInputProps) {\n const [canSubmit, setCanSubmit] = React.useState(false);\n const {\n submittedMessage,\n clearAllFiles,\n setShouldHideSuggestions,\n setSubmittedMessage,\n images,\n files,\n } = useConversationStore();\n\n // Note: we intentionally do NOT disable the input when the conversation is\n // in an ERROR/STUCK execution state. Users should be able to send a follow-up\n // message to recover the conversation; the message will be delivered\n // immediately via the WebSocket if connected, or queued via REST otherwise.\n const isDisabled = disabled;\n\n // Always call the latest `onSubmit` without making the effect re-run when\n // its identity changes. `onSubmit` (typically `handleSendMessage`) is a\n // fresh function on every parent render, and the parent re-renders\n // whenever the pending-message queue updates synchronously inside\n // `onSubmit` itself. Listing it in the dep array caused the effect to\n // fire twice — once for the original submit and again from the\n // mid-submit re-render, before `setSubmittedMessage(null)` was applied —\n // producing a duplicate \"Sending…\" bubble.\n const onSubmitRef = useRef(onSubmit);\n useEffect(() => {\n onSubmitRef.current = onSubmit;\n }, [onSubmit]);\n\n // Listen to submittedMessage state changes\n useEffect(() => {\n if (!submittedMessage || disabled) {\n return;\n }\n onSubmitRef.current(submittedMessage);\n setSubmittedMessage(null);\n }, [submittedMessage, disabled, setSubmittedMessage]);\n\n // Custom hooks\n const {\n chatInputRef,\n messageToSend,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n saveDraft,\n } = useChatInputLogic();\n\n const syncCanSubmit = React.useCallback(() => {\n const text = chatInputRef.current?.innerText ?? \"\";\n const hasAttachments = images.length > 0 || files.length > 0;\n setCanSubmit(text.trim().length > 0 || hasAttachments);\n }, [chatInputRef, images, files]);\n\n const {\n fileInputRef,\n chatContainerRef,\n isDragOver,\n handleFileIconClick,\n handleFileInputChange,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n } = useFileHandling(onFilesPaste);\n\n const {\n gripRef,\n isGripVisible,\n isGripDragging,\n handleTopEdgeClick,\n smartResize,\n handleGripMouseDown,\n handleGripTouchStart,\n increaseHeightForEmptyContent,\n resetManualResize,\n } = useGripResize(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n messageToSend,\n );\n\n const { handleSubmit } = useChatSubmission(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n fileInputRef as React.RefObject<HTMLInputElement | null>,\n smartResize,\n onSubmit,\n resetManualResize,\n );\n const handleSubmitAndSync = React.useCallback(() => {\n handleSubmit();\n syncCanSubmit();\n }, [handleSubmit, syncCanSubmit]);\n\n const { handleInput, handlePaste, handleKeyDown, handleBlur, handleFocus } =\n useChatInputEvents(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n smartResize,\n increaseHeightForEmptyContent,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n onFocus,\n onBlur,\n );\n\n const {\n isMenuOpen: isSlashMenuOpen,\n filteredItems: slashItems,\n selectedIndex: slashSelectedIndex,\n updateSlashMenu,\n selectItem: selectSlashItem,\n handleSlashKeyDown,\n closeMenu: closeSlashMenu,\n } = useSlashCommand(chatInputRef as React.RefObject<HTMLDivElement | null>);\n\n // Cleanup: reset suggestions visibility when component unmounts\n useEffect(\n () => () => {\n setShouldHideSuggestions(false);\n clearAllFiles();\n },\n [setShouldHideSuggestions, clearAllFiles],\n );\n useEffect(() => {\n syncCanSubmit();\n }, [syncCanSubmit, images.length, files.length]);\n return (\n <div className={cn(\"w-full\", className)}>\n {/* Hidden file input */}\n <HiddenFileInput\n fileInputRef={fileInputRef}\n onChange={handleFileInputChange}\n />\n\n {/* Container with grip */}\n <div className=\"relative w-full\">\n <ChatInputGrip\n gripRef={gripRef}\n isGripVisible={isGripVisible}\n isGripDragging={isGripDragging}\n handleTopEdgeClick={handleTopEdgeClick}\n handleGripMouseDown={handleGripMouseDown}\n handleGripTouchStart={handleGripTouchStart}\n />\n\n <ChatInputContainer\n chatContainerRef={chatContainerRef}\n isDragOver={isDragOver}\n disabled={isDisabled}\n canSubmit={canSubmit}\n hasStartedConversation={hasStartedConversation}\n isNewConversationPending={isNewConversationPending}\n showButton={showButton}\n buttonClassName={buttonClassName}\n chatInputRef={chatInputRef}\n handleFileIconClick={handleFileIconClick}\n handleSubmit={handleSubmitAndSync}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onInput={() => {\n handleInput();\n updateSlashMenu();\n saveDraft();\n syncCanSubmit();\n }}\n onPaste={handlePaste}\n onKeyDown={(e) => {\n if (handleSlashKeyDown(e)) return;\n handleKeyDown(e, isDisabled, handleSubmitAndSync);\n }}\n onFocus={handleFocus}\n onBlur={() => {\n handleBlur();\n closeSlashMenu();\n syncCanSubmit();\n }}\n isSlashMenuOpen={isSlashMenuOpen}\n slashItems={slashItems}\n slashSelectedIndex={slashSelectedIndex}\n onSlashSelect={selectSlashItem}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA6BA,SAAgB,EAAgB,EAC9B,cAAW,IACX,8BAA2B,IAC3B,2BACA,gBAAa,IACb,aACA,aACA,YACA,iBACA,eAAY,IACZ,qBAAkB,MACK;CACvB,IAAM,CAAC,GAAW,KAAgB,EAAM,SAAS,EAAK,GAChD,EACJ,qBACA,kBACA,6BACA,wBACA,WACA,aACE,EAAqB,GAMnB,IAAa,GAUb,IAAc,EAAO,CAAQ;CAMnC,AALA,QAAgB;EACd,EAAY,UAAU;CACxB,GAAG,CAAC,CAAQ,CAAC,GAGb,QAAgB;EACV,CAAC,KAAoB,MAGzB,EAAY,QAAQ,CAAgB,GACpC,EAAoB,IAAI;CAC1B,GAAG;EAAC;EAAkB;EAAU;CAAmB,CAAC;CAGpD,IAAM,EACJ,iBACA,kBACA,wBACA,6BACA,iBACE,EAAkB,GAEhB,IAAgB,EAAM,kBAAkB;EAC5C,IAAM,IAAO,EAAa,SAAS,aAAa,IAC1C,IAAiB,EAAO,SAAS,KAAK,EAAM,SAAS;EAC3D,EAAa,EAAK,KAAK,EAAE,SAAS,KAAK,CAAc;CACvD,GAAG;EAAC;EAAc;EAAQ;CAAK,CAAC,GAE1B,EACJ,iBACA,qBACA,eACA,wBACA,0BACA,oBACA,oBACA,kBACE,EAAgB,CAAY,GAE1B,EACJ,YACA,kBACA,mBACA,uBACA,gBACA,yBACA,0BACA,mCACA,0BACE,EACF,GACA,CACF,GAEM,EAAE,oBAAiB,EACvB,GACA,GACA,GACA,GACA,EACF,GACM,IAAsB,EAAM,kBAAkB;EAElD,AADA,EAAa,GACb,EAAc;CAChB,GAAG,CAAC,GAAc,CAAa,CAAC,GAE1B,EAAE,iBAAa,iBAAa,mBAAe,gBAAY,oBAC3D,EACE,GACA,GACA,IACA,GACA,GACA,IACA,EACF,GAEI,EACJ,YAAY,IACZ,eAAe,IACf,eAAe,IACf,qBACA,YAAY,IACZ,wBACA,WAAW,OACT,
|
|
1
|
+
{"version":3,"file":"custom-chat-input.js","names":[],"sources":["../../../../src/components/features/chat/custom-chat-input.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\nimport { useChatInputLogic } from \"#/hooks/chat/use-chat-input-logic\";\nimport { useFileHandling } from \"#/hooks/chat/use-file-handling\";\nimport { useGripResize } from \"#/hooks/chat/use-grip-resize\";\nimport { useChatInputEvents } from \"#/hooks/chat/use-chat-input-events\";\nimport { useChatSubmission } from \"#/hooks/chat/use-chat-submission\";\nimport { useSlashCommand } from \"#/hooks/chat/use-slash-command\";\nimport { ChatInputGrip } from \"./components/chat-input-grip\";\nimport { ChatInputContainer } from \"./components/chat-input-container\";\nimport { HiddenFileInput } from \"./components/hidden-file-input\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\n\nexport interface CustomChatInputProps {\n disabled?: boolean;\n isNewConversationPending?: boolean;\n hasStartedConversation?: boolean;\n showButton?: boolean;\n onSubmit: (message: string) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n onFilesPaste?: (\n files: File[],\n options?: import(\"#/hooks/chat/use-chat-attachment-upload\").ChatAttachmentUploadOptions,\n ) => void;\n className?: React.HTMLAttributes<HTMLDivElement>[\"className\"];\n buttonClassName?: React.HTMLAttributes<HTMLButtonElement>[\"className\"];\n}\n\nexport function CustomChatInput({\n disabled = false,\n isNewConversationPending = false,\n hasStartedConversation,\n showButton = true,\n onSubmit,\n onFocus,\n onBlur,\n onFilesPaste,\n className = \"\",\n buttonClassName = \"\",\n}: CustomChatInputProps) {\n const [canSubmit, setCanSubmit] = React.useState(false);\n const {\n submittedMessage,\n clearAllFiles,\n setShouldHideSuggestions,\n setSubmittedMessage,\n images,\n files,\n } = useConversationStore();\n\n // Note: we intentionally do NOT disable the input when the conversation is\n // in an ERROR/STUCK execution state. Users should be able to send a follow-up\n // message to recover the conversation; the message will be delivered\n // immediately via the WebSocket if connected, or queued via REST otherwise.\n const isDisabled = disabled;\n\n // Always call the latest `onSubmit` without making the effect re-run when\n // its identity changes. `onSubmit` (typically `handleSendMessage`) is a\n // fresh function on every parent render, and the parent re-renders\n // whenever the pending-message queue updates synchronously inside\n // `onSubmit` itself. Listing it in the dep array caused the effect to\n // fire twice — once for the original submit and again from the\n // mid-submit re-render, before `setSubmittedMessage(null)` was applied —\n // producing a duplicate \"Sending…\" bubble.\n const onSubmitRef = useRef(onSubmit);\n useEffect(() => {\n onSubmitRef.current = onSubmit;\n }, [onSubmit]);\n\n // Listen to submittedMessage state changes\n useEffect(() => {\n if (!submittedMessage || disabled) {\n return;\n }\n onSubmitRef.current(submittedMessage);\n setSubmittedMessage(null);\n }, [submittedMessage, disabled, setSubmittedMessage]);\n\n // Custom hooks\n const {\n chatInputRef,\n messageToSend,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n saveDraft,\n } = useChatInputLogic();\n\n const syncCanSubmit = React.useCallback(() => {\n const text = chatInputRef.current?.innerText ?? \"\";\n const hasAttachments = images.length > 0 || files.length > 0;\n setCanSubmit(text.trim().length > 0 || hasAttachments);\n }, [chatInputRef, images, files]);\n\n const {\n fileInputRef,\n chatContainerRef,\n isDragOver,\n handleFileIconClick,\n handleFileInputChange,\n handleDragOver,\n handleDragLeave,\n handleDrop,\n } = useFileHandling(onFilesPaste);\n\n const {\n gripRef,\n isGripVisible,\n isGripDragging,\n canResize,\n handleTopEdgeClick,\n smartResize,\n handleGripMouseDown,\n handleGripTouchStart,\n increaseHeightForEmptyContent,\n resetManualResize,\n } = useGripResize(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n messageToSend,\n );\n\n const { handleSubmit } = useChatSubmission(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n fileInputRef as React.RefObject<HTMLInputElement | null>,\n smartResize,\n onSubmit,\n resetManualResize,\n );\n const handleSubmitAndSync = React.useCallback(() => {\n handleSubmit();\n syncCanSubmit();\n }, [handleSubmit, syncCanSubmit]);\n\n const { handleInput, handlePaste, handleKeyDown, handleBlur, handleFocus } =\n useChatInputEvents(\n chatInputRef as React.RefObject<HTMLDivElement | null>,\n smartResize,\n increaseHeightForEmptyContent,\n checkIsContentEmpty,\n clearEmptyContentHandler,\n onFocus,\n onBlur,\n );\n\n const {\n isMenuOpen: isSlashMenuOpen,\n filteredItems: slashItems,\n selectedIndex: slashSelectedIndex,\n updateSlashMenu,\n selectItem: selectSlashItem,\n handleSlashKeyDown,\n closeMenu: closeSlashMenu,\n } = useSlashCommand(chatInputRef as React.RefObject<HTMLDivElement | null>);\n\n // Cleanup: reset suggestions visibility when component unmounts\n useEffect(\n () => () => {\n setShouldHideSuggestions(false);\n clearAllFiles();\n },\n [setShouldHideSuggestions, clearAllFiles],\n );\n useEffect(() => {\n syncCanSubmit();\n }, [syncCanSubmit, images.length, files.length]);\n return (\n <div className={cn(\"w-full\", className)}>\n {/* Hidden file input */}\n <HiddenFileInput\n fileInputRef={fileInputRef}\n onChange={handleFileInputChange}\n />\n\n {/* Container with grip */}\n <div className=\"relative w-full\">\n <ChatInputGrip\n gripRef={gripRef}\n isGripVisible={isGripVisible}\n isGripDragging={isGripDragging}\n canResize={canResize}\n handleTopEdgeClick={handleTopEdgeClick}\n handleGripMouseDown={handleGripMouseDown}\n handleGripTouchStart={handleGripTouchStart}\n />\n\n <ChatInputContainer\n chatContainerRef={chatContainerRef}\n isDragOver={isDragOver}\n disabled={isDisabled}\n canSubmit={canSubmit}\n hasStartedConversation={hasStartedConversation}\n isNewConversationPending={isNewConversationPending}\n showButton={showButton}\n buttonClassName={buttonClassName}\n chatInputRef={chatInputRef}\n handleFileIconClick={handleFileIconClick}\n handleSubmit={handleSubmitAndSync}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n onInput={() => {\n handleInput();\n updateSlashMenu();\n saveDraft();\n syncCanSubmit();\n }}\n onPaste={handlePaste}\n onKeyDown={(e) => {\n if (handleSlashKeyDown(e)) return;\n handleKeyDown(e, isDisabled, handleSubmitAndSync);\n }}\n onFocus={handleFocus}\n onBlur={() => {\n handleBlur();\n closeSlashMenu();\n syncCanSubmit();\n }}\n isSlashMenuOpen={isSlashMenuOpen}\n slashItems={slashItems}\n slashSelectedIndex={slashSelectedIndex}\n onSlashSelect={selectSlashItem}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA6BA,SAAgB,EAAgB,EAC9B,cAAW,IACX,8BAA2B,IAC3B,2BACA,gBAAa,IACb,aACA,aACA,YACA,iBACA,eAAY,IACZ,qBAAkB,MACK;CACvB,IAAM,CAAC,GAAW,KAAgB,EAAM,SAAS,EAAK,GAChD,EACJ,qBACA,kBACA,6BACA,wBACA,WACA,aACE,EAAqB,GAMnB,IAAa,GAUb,IAAc,EAAO,CAAQ;CAMnC,AALA,QAAgB;EACd,EAAY,UAAU;CACxB,GAAG,CAAC,CAAQ,CAAC,GAGb,QAAgB;EACV,CAAC,KAAoB,MAGzB,EAAY,QAAQ,CAAgB,GACpC,EAAoB,IAAI;CAC1B,GAAG;EAAC;EAAkB;EAAU;CAAmB,CAAC;CAGpD,IAAM,EACJ,iBACA,kBACA,wBACA,6BACA,iBACE,EAAkB,GAEhB,IAAgB,EAAM,kBAAkB;EAC5C,IAAM,IAAO,EAAa,SAAS,aAAa,IAC1C,IAAiB,EAAO,SAAS,KAAK,EAAM,SAAS;EAC3D,EAAa,EAAK,KAAK,EAAE,SAAS,KAAK,CAAc;CACvD,GAAG;EAAC;EAAc;EAAQ;CAAK,CAAC,GAE1B,EACJ,iBACA,qBACA,eACA,wBACA,0BACA,oBACA,oBACA,kBACE,EAAgB,CAAY,GAE1B,EACJ,YACA,kBACA,mBACA,cACA,uBACA,gBACA,yBACA,0BACA,mCACA,0BACE,EACF,GACA,CACF,GAEM,EAAE,oBAAiB,EACvB,GACA,GACA,GACA,GACA,EACF,GACM,IAAsB,EAAM,kBAAkB;EAElD,AADA,EAAa,GACb,EAAc;CAChB,GAAG,CAAC,GAAc,CAAa,CAAC,GAE1B,EAAE,iBAAa,iBAAa,mBAAe,gBAAY,oBAC3D,EACE,GACA,GACA,IACA,GACA,GACA,IACA,EACF,GAEI,EACJ,YAAY,IACZ,eAAe,IACf,eAAe,IACf,qBACA,YAAY,IACZ,wBACA,WAAW,OACT,GAAgB,CAAsD;CAa1E,OAVA,cACc;EAEV,AADA,EAAyB,EAAK,GAC9B,EAAc;CAChB,GACA,CAAC,GAA0B,CAAa,CAC1C,GACA,QAAgB;EACd,EAAc;CAChB,GAAG;EAAC;EAAe,EAAO;EAAQ,EAAM;CAAM,CAAC,GAE7C,kBAAC,OAAD;EAAK,WAAW,EAAG,UAAU,CAAS;YAAtC,CAEE,kBAAC,GAAD;GACgB;GACd,UAAU;EACX,CAAA,GAGD,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,GAAD;IACW;IACM;IACC;IACL;IACS;IACC;IACC;GACvB,CAAA,GAED,kBAAC,GAAD;IACoB;IACN;IACZ,UAAU;IACC;IACa;IACE;IACd;IACK;IACH;IACO;IACrB,cAAc;IACd,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,eAAe;KAIb,AAHA,GAAY,GACZ,GAAgB,GAChB,EAAU,GACV,EAAc;IAChB;IACA,SAAS;IACT,YAAY,MAAM;KACZ,GAAmB,CAAC,KACxB,GAAc,GAAG,GAAY,CAAmB;IAClD;IACA,SAAS;IACT,cAAc;KAGZ,AAFA,GAAW,GACX,GAAe,GACf,EAAc;IAChB;IACiB;IACL;IACQ;IACpB,eAAe;GAChB,CAAA,CACE;IACF;;AAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/react-i18next/dist/es/Trans.cjs"),n=require("../../../node_modules/react-i18next/dist/es/useTranslation.cjs"),r=require("../../../i18n/declaration.cjs"),i=require("../../../node_modules/lucide-react/dist/esm/icons/check.cjs"),a=require("../../../node_modules/lucide-react/dist/esm/icons/circle-
|
|
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("../../../node_modules/lucide-react/dist/esm/icons/check.cjs"),a=require("../../../node_modules/lucide-react/dist/esm/icons/circle-alert.cjs"),o=require("../../../node_modules/lucide-react/dist/esm/icons/circle-x.cjs"),s=require("../../../node_modules/lucide-react/dist/esm/icons/copy.cjs"),c=require("../../../node_modules/lucide-react/dist/esm/icons/x.cjs"),l=require("../../../constants/status-colors.cjs"),u=require("../../../utils/utils.cjs"),d=require("../../../utils/custom-toast-handlers.cjs"),f=require("../../../utils/acp-error-codes.cjs");let p=require("react");p=e.__toESM(p,1);let m=require("react/jsx-runtime");var h=220;function g({message:e,code:g,onDismiss:_,onRetry:v,onReauth:y,classification:b}){let{t:x,i18n:S}=n.useTranslation(`openhands`),C=f.getAcpErrorHeaderKey(g),[w,T]=p.default.useState(!1),[E,D]=p.default.useState(!1),[O,k]=p.default.useState(!1),A=p.default.useRef(null),j=S.exists(e,{ns:`openhands`}),M=j?String(x(e)):e,N=M.length>h,P=N&&!w;return p.default.useEffect(()=>{if(!O)return;let e=setTimeout(()=>{k(!1)},2e3);return()=>clearTimeout(e)},[O]),p.default.useEffect(()=>{k(!1)},[M]),p.default.useLayoutEffect(()=>{let e=A.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){D(!1);return}D(e.getBoundingClientRect().height>t*1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[M,P,w,e]),(0,m.jsxs)(`div`,{className:u.cn(`flex w-full gap-2 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-raised)] p-2 text-[var(--oh-foreground)]`,E?`items-start`:`items-center`),"data-testid":`error-message-banner`,children:[b!=null&&b.kind!==`internal`&&b.kind!==`unknown`?(0,m.jsx)(a.CircleAlert,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--oh-warning)]`,strokeWidth:2,"data-testid":`warning-message-banner-icon`}):(0,m.jsx)(o.CircleX,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:l.OH_STATUS_ERROR_COLOR},"data-testid":`error-message-banner-icon`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[C&&(0,m.jsx)(`div`,{className:`text-sm font-medium text-[var(--oh-foreground)]`,"data-testid":`error-message-banner-header`,children:x(C)}),(0,m.jsx)(`div`,{ref:A,className:u.cn(`whitespace-pre-wrap break-words text-sm text-[var(--oh-muted)]`,P&&`line-clamp-3`),"data-testid":`error-message-banner-content`,children:j?(0,m.jsx)(t.Trans,{ns:`openhands`,i18nKey:e}):e}),y&&(0,m.jsx)(`button`,{type:`button`,onClick:y,className:`mt-2 cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`error-message-banner-reauth`,children:x(r.I18nKey.ERROR$ACP_UPDATE_CREDENTIALS)}),N&&(0,m.jsx)(`button`,{type:`button`,className:`mt-1 cursor-pointer text-xs font-normal text-[var(--oh-foreground)] underline`,onClick:()=>T(e=>!e),"data-testid":`error-message-banner-toggle`,children:x(w?r.I18nKey.COMMON$VIEW_LESS:r.I18nKey.COMMON$VIEW_MORE)})]}),(0,m.jsxs)(`div`,{className:u.cn(`flex shrink-0 gap-1`,E?`self-start`:`items-center`),children:[v&&(0,m.jsx)(`button`,{type:`button`,onClick:v,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`error-message-banner-retry`,children:x(r.I18nKey.CHAT_INTERFACE$MESSAGE_RETRY)}),(0,m.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(M),k(!0)}catch{d.displayErrorToast(x(r.I18nKey.CHAT_INTERFACE$CHAT_MESSAGE_COPY_FAILED))}},className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":x(O?r.I18nKey.BUTTON$COPIED:r.I18nKey.BUTTON$COPY),"data-testid":`error-message-banner-copy`,children:O?(0,m.jsx)(i.Check,{className:`h-4 w-4`,"aria-hidden":!0}):(0,m.jsx)(s.Copy,{className:`h-4 w-4`,"aria-hidden":!0})}),_&&(0,m.jsx)(`button`,{type:`button`,onClick:_,className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":x(r.I18nKey.BUTTON$CLOSE),"data-testid":`error-message-banner-dismiss`,children:(0,m.jsx)(c.X,{className:`h-4 w-4`,"aria-hidden":!0})})]})]})}exports.ErrorMessageBanner=g;
|
|
2
2
|
//# sourceMappingURL=error-message-banner.cjs.map
|