@openhands/agent-canvas 1.4.0 → 1.5.1
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 +11 -12
- package/README.windows.md +4 -2
- package/build/assets/{Trans-Ch-OVWEA.js → Trans-DqF_OEZB.js} +1 -1
- package/build/assets/{acp-providers-Sy2LKyMa.js → acp-providers-DerAmTyY.js} +1 -1
- package/build/assets/active-backend-context-B8rMv0X9.js +1 -0
- package/build/assets/{add-backend-modal-Bgy8anoR.js → add-backend-modal-CxC7BNEc.js} +1 -1
- package/build/assets/{agent-profiles-settings-3mmXljZX.js → agent-profiles-settings-BJb8YXR1.js} +1 -1
- package/build/assets/agent-server-compatibility-BWN-EIQn.js +1 -0
- package/build/assets/agent-server-conversation-service.api-DSPIkMwJ.js +41 -0
- package/build/assets/{agent-settings-B-W10B4E.js → agent-settings-CgCnqaAA.js} +2 -2
- package/build/assets/agent-settings-DDkSavD7.js +1 -0
- package/build/assets/{alert-banner-Bpf2NQJq.js → alert-banner-Dh51WURQ.js} +1 -1
- package/build/assets/api-key-entry-screen-iZc7n8AI.js +1 -0
- package/build/assets/app-settings-B5zyipxJ.js +1 -0
- package/build/assets/automation-detail-CZsu2CoM.js +2 -0
- package/build/assets/automation-export-BwRX6H32.js +2 -0
- package/build/assets/automations-list-lHAVzMoA.js +1 -0
- package/build/assets/{back-nav-button-CUS2mi-U.js → back-nav-button-DVknCcSP.js} +1 -1
- package/build/assets/backend-form-modal-RGcu909r.js +1 -0
- package/build/assets/{backend-synced-settings-badge-D9hZx05w.js → backend-synced-settings-badge-BSfN0AZA.js} +1 -1
- package/build/assets/{base-modal-BuF2f0YL.js → base-modal-CIF_785P.js} +1 -1
- package/build/assets/{bot-D7eUAuSB.js → bot-C-EA6685.js} +1 -1
- package/build/assets/{brand-button-vMVuyDXu.js → brand-button-B1izLAdR.js} +1 -1
- package/build/assets/{browser-BifzWIBd.js → browser-DKaeq_sT.js} +3 -3
- package/build/assets/{browser-tab-CkkqJnqw.js → browser-tab-qb_ftCxW.js} +1 -1
- package/build/assets/canvas-ui-COgjltGz.js +1 -0
- package/build/assets/{chat-send-button-B_jc5z5C.js → chat-send-button-BZHG2hAW.js} +1 -1
- package/build/assets/check-TbOEtHKj.js +1 -0
- package/build/assets/{chevron-down-CI8A6tet.js → chevron-down-D7IvFMBM.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-C5YxjxvI.js → circle-plus-check-toggle-DoFIjVE0.js} +1 -1
- package/build/assets/client-source-BZK8vRs2.js +1 -0
- package/build/assets/cloud-funnel-analytics-Zcv57hfT.js +1 -0
- package/build/assets/{color-themes-DPBzNtVg.js → color-themes-CHizm1xF.js} +1 -1
- package/build/assets/{combobox-caret-DoObzqf4.js → combobox-caret-CxZpqoSR.js} +1 -1
- package/build/assets/{command-menu-D-JV3Wqm.js → command-menu-oTvKDU3Y.js} +1 -1
- package/build/assets/condenser-settings-BGlWn93P.js +1 -0
- package/build/assets/{confirmation-modal-BGLu6XJN.js → confirmation-modal-DGBWM2Ls.js} +1 -1
- package/build/assets/{context-menu-list-item-BD5_EaKN.js → context-menu-list-item-6psNyl7X.js} +1 -1
- package/build/assets/conversation-BoCYx8n2.js +89 -0
- package/build/assets/conversation-DgHqMjnY.js +1 -0
- package/build/assets/conversation-panel-78Rxh_-I.js +1 -0
- package/build/assets/conversation-service.api-_f9GlIEi.js +1 -0
- package/build/assets/{conversation-tab-empty-state-B2dDYEwf.js → conversation-tab-empty-state-CNUmIms2.js} +1 -1
- package/build/assets/{copy-3JCw_XFB.js → copy-D1YGjP-C.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-CaR52OnA.js → copy-to-clipboard-button-CFzH_NOX.js} +1 -1
- package/build/assets/declaration-BGsHjPEW.js +1 -0
- package/build/assets/{device-verify-Dj6I4Iqe.js → device-verify-WBSjJBLH.js} +1 -1
- package/build/assets/{dropdown-classes-DJSXeLqc.js → dropdown-classes-D3wMJlXT.js} +1 -1
- package/build/assets/{ellipsis-button-C5Z-tPFp.js → ellipsis-button-CbNnHlIq.js} +1 -1
- package/build/assets/{entry.client-2_3ePAm0.js → entry.client-DNlPGxsu.js} +2 -2
- package/build/assets/{enum-filter-dropdown-DXbVwiNZ.js → enum-filter-dropdown-JLYv1t8L.js} +1 -1
- package/build/assets/{environment-switch-overlay-DZQfRGTx.js → environment-switch-overlay-B1PFO8P8.js} +1 -1
- package/build/assets/{extensions-hub-CLjmOGqS.js → extensions-hub-CCbLA7IM.js} +1 -1
- package/build/assets/{extensions-navigation-B5MeUiMq.js → extensions-navigation-CPNjMNvR.js} +1 -1
- package/build/assets/{external-link-D2zJjE9G.js → external-link-lhdITPqq.js} +1 -1
- package/build/assets/files-tab-y4K7EXBO.js +1 -0
- package/build/assets/{form-control-classes-ChpNBe9n.js → form-control-classes-CbdN5aO3.js} +1 -1
- package/build/assets/format-time-delta-DhDbkD7V.js +1 -0
- package/build/assets/git-provider-icon-ITvsH4Ko.js +1 -0
- package/build/assets/home-BwbeOWwU.js +1 -0
- package/build/assets/home-DKPGQ5P3.js +1 -0
- package/build/assets/index-home-Bko2Itv5.js +1 -0
- package/build/assets/install-server-modal-Qk1gwyI8.js +1 -0
- package/build/assets/{launch-V_3Rp7WS.js → launch-CAGavYl-.js} +1 -1
- package/build/assets/lesson-plan-DMCPdtrf.js +4 -0
- package/build/assets/{list-todo-BfH6yYUK.js → list-todo-CAtvkzcy.js} +1 -1
- package/build/assets/llm-not-configured-banner-C1ktyb3C.js +27 -0
- package/build/assets/llm-settings-BBsZFi9l.js +1 -0
- package/build/assets/llm-settings-DFkJQr_w.js +1 -0
- package/build/assets/llm-subscription-service-Casyzgn1.js +1 -0
- package/build/assets/loader-circle-CsAsfLIs.js +1 -0
- package/build/assets/{loading-spinner-BLdswi6q.js → loading-spinner-BcdnT0mN.js} +1 -1
- package/build/assets/manage-backends-modal-CKQ46rvw.js +1 -0
- package/build/assets/manifest-03478bbf.js +1 -0
- package/build/assets/{map-provider-BM2SJarp.js → map-provider-BbIb12oh.js} +1 -1
- package/build/assets/{markdown-renderer-DMT7Zkpd.js → markdown-renderer-B4V2OMFP.js} +1 -1
- package/build/assets/{mcp-BQufNPZ6.js → mcp-BapoJsDc.js} +2 -2
- package/build/assets/{messages-BnJCqnFf.js → messages-CUBFMY5o.js} +26 -26
- package/build/assets/{modal-body-DouOE5KH.js → modal-body-Cc2zp0xb.js} +1 -1
- package/build/assets/{modal-classes-Cf-4tbHz.js → modal-classes-3qT9Ap7Q.js} +1 -1
- package/build/assets/{modal-close-button-B6CfxxJj.js → modal-close-button-BcIBUdSq.js} +1 -1
- package/build/assets/model-selector-DJrMrFAr.js +1 -0
- package/build/assets/onboarding-6NMkdNxV.js +1 -0
- package/build/assets/onboarding-modal-Q4AnpIdg.js +1 -0
- package/build/assets/organization-service.api-vrRNwOma.js +1 -0
- package/build/assets/path-utils-PNfCKQDV.js +1 -0
- package/build/assets/{pencil-Dj2XjKmI.js → pencil-CWhApFIT.js} +1 -1
- package/build/assets/{plan-components-CcCBmCzW.js → plan-components-BdZXPyZU.js} +1 -1
- package/build/assets/{planner-tab-Dhyqcqmb.js → planner-tab-ByOw1he8.js} +1 -1
- package/build/assets/plugins-management-service-B75jyC56.js +1 -0
- package/build/assets/profiles-service.api-BQTklD5D.js +1 -0
- package/build/assets/providers-DfTB2gPd.js +1 -0
- package/build/assets/proxy-B3tCGf0X.js +1 -0
- package/build/assets/{recommended-automations-launcher-CTcGTl4d.js → recommended-automations-launcher-Bj7PuHY1.js} +1 -1
- package/build/assets/{refresh-cw-DM82EIyx.js → refresh-cw-B9B7-vsy.js} +1 -1
- package/build/assets/root-CDnuTToz.js +2 -0
- package/build/assets/root-CYWeTrWE.css +1 -0
- package/build/assets/root-layout-DfYVlcRG.js +2 -0
- package/build/assets/{runtime-waiting-state-BsXLElvN.js → runtime-waiting-state-CnyVhX4T.js} +1 -1
- package/build/assets/schema-field-CUwk4wrQ.js +1 -0
- package/build/assets/sdk-section-page-DLLNrYjI.js +1 -0
- package/build/assets/{sdk-settings-schema-Cv7M9eSe.js → sdk-settings-schema-CLR01YIK.js} +1 -1
- package/build/assets/search-dIQ09UY2.js +1 -0
- package/build/assets/secrets-service-CvyPWJhg.js +1 -0
- package/build/assets/{secrets-settings-Cx6yJlyb.js → secrets-settings-CHy72A5C.js} +1 -1
- package/build/assets/{segmented-toggle-DyQqPhoD.js → segmented-toggle-kzwZkLaj.js} +1 -1
- package/build/assets/settings-B9S8UVQr.js +1 -0
- package/build/assets/{settings-dropdown-input-BjunGXJb.js → settings-dropdown-input-Dhx9ErGd.js} +1 -1
- package/build/assets/{settings-index-D6sxWSRk.js → settings-index-BKDl2CQ-.js} +1 -1
- package/build/assets/{settings-input-bD6npsDm.js → settings-input-BsgQWS5R.js} +1 -1
- package/build/assets/{settings-list-classes-Dp_OgzN0.js → settings-list-classes-DSJJX99U.js} +1 -1
- package/build/assets/settings-modal-DeK11CyT.js +1 -0
- package/build/assets/settings-service.api-DXk5TdeJ.js +1 -0
- package/build/assets/{settings-switch-5cuxl8Dc.js → settings-switch-Bes8dIlV.js} +1 -1
- package/build/assets/{settings-utils-BMdG65By.js → settings-utils-DzCVfiR3.js} +1 -1
- package/build/assets/shared-conversation-9atDzTR4.js +1 -0
- package/build/assets/{sidebar-layout-DuzJMMw-.js → sidebar-layout-Bm7pa3Vk.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-VvvX32iF.js → sidebar-mobile-menu-toggle-giMMZctn.js} +1 -1
- package/build/assets/{sidebar-nav-link-5AlTT5-j.js → sidebar-nav-link-CHqyFXwV.js} +1 -1
- package/build/assets/{sidebar-store-CZuE8AH5.js → sidebar-store-uiUXBU1N.js} +1 -1
- package/build/assets/{skill-card-pill-row-eTIkE4nz.js → skill-card-pill-row-BPYKQ3IN.js} +1 -1
- package/build/assets/skills-plugins-Tropusio.js +1 -0
- package/build/assets/{skills-settings-BUv04tSc.js → skills-settings-BvzBBCWk.js} +2 -2
- package/build/assets/{square-chevron-right-Czw3FFWc.js → square-chevron-right-DE-JN-2Z.js} +1 -1
- package/build/assets/{styled-tooltip-CgX2oRaK.js → styled-tooltip-B14i_Uac.js} +1 -1
- package/build/assets/{suspense-BO1Tl_Vf.js → suspense-DmZ3MSSh.js} +1 -1
- package/build/assets/{task-list-tab-0k9PhuqO.js → task-list-tab-DyfgG4MC.js} +1 -1
- package/build/assets/telemetry-C5JMEfqB.js +2 -0
- package/build/assets/{terminal-B61WrJdS.js → terminal-DRXt2Lr4.js} +1 -1
- package/build/assets/{toggle-switch-2j5wwR85.js → toggle-switch-DX_k418f.js} +1 -1
- package/build/assets/{trash-2-Be_7y3Mn.js → trash-2-BU6BlW4i.js} +1 -1
- package/build/assets/{typography-D8mHDeNG.js → typography-CzfoD9DY.js} +1 -1
- package/build/assets/use-acp-credential-form-Bm8qXdlc.js +1 -0
- package/build/assets/{use-activate-agent-profile-20v1xU0H.js → use-activate-agent-profile-DlykqEfN.js} +1 -1
- package/build/assets/{use-active-agent-profile-BkJN7Xsy.js → use-active-agent-profile-hI-x-UBa.js} +1 -1
- package/build/assets/{use-active-conversation-DOZVSVtU.js → use-active-conversation-2qeez40F.js} +1 -1
- package/build/assets/use-agent-profiles-0pr5bLS7.js +1 -0
- package/build/assets/{use-agent-state-DHZO1obC.js → use-agent-state-C6peDXUm.js} +1 -1
- package/build/assets/use-backends-health-CLHPitJM.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-C-OhWVBS.js → use-can-manage-org-profiles-Ck_bsNbH.js} +1 -1
- package/build/assets/use-cloud-current-user-id-DUCSxNjY.js +1 -0
- package/build/assets/use-config-B5r8erYt.js +1 -0
- package/build/assets/use-create-conversation-r1JHfKO5.js +1 -0
- package/build/assets/{use-create-secret-D0HCOZFu.js → use-create-secret-Cf2N11d2.js} +1 -1
- package/build/assets/{use-event-store-DjgU4wfO.js → use-event-store-Bbaz51GR.js} +1 -1
- package/build/assets/{use-handle-plan-click-DyRASKMC.js → use-handle-plan-click-CsAW3FlH.js} +1 -1
- package/build/assets/use-is-authed-BezEyfeh.js +1 -0
- package/build/assets/use-llm-profiles-Dr5__SlZ.js +1 -0
- package/build/assets/use-plugins-marketplace-BplU65ae.js +1 -0
- package/build/assets/use-runtime-is-ready-vCFOcLFa.js +1 -0
- package/build/assets/use-save-agent-profile-RqUGqTv6.js +1 -0
- package/build/assets/use-save-settings-Chvzeu2s.js +1 -0
- package/build/assets/use-settings-CyxSlyTQ.js +1 -0
- package/build/assets/use-settings-nav-items-zEkSO_Bf.js +16 -0
- package/build/assets/use-skills-xrVoKYrF.js +1 -0
- package/build/assets/{use-task-list-AVBLbbcR.js → use-task-list-CfisapBW.js} +1 -1
- package/build/assets/use-tracking-D2Qg5Lpd.js +1 -0
- package/build/assets/{use-user-conversation-zpx7I18x.js → use-user-conversation-CnE4zhOA.js} +1 -1
- package/build/assets/{useMutation-DrCAVg5w.js → useMutation-u8UgRgDK.js} +1 -1
- package/build/assets/{useMutationState-D8QN0ZCy.js → useMutationState-OnAsCLA_.js} +1 -1
- package/build/assets/{useQueries-DClgUTc7.js → useQueries-BpIlT8Mt.js} +1 -1
- package/build/assets/{useQuery-CRBP8vIS.js → useQuery-D5pEZbY0.js} +1 -1
- package/build/assets/{useTranslation-CDRCKC9-.js → useTranslation-Cbf5AGg_.js} +1 -1
- package/build/assets/{utils-D3U3rlqr.js → utils-DB9LsAzA.js} +1 -1
- package/build/assets/{vendor~browser-tab-Di0kh5Zw.js → vendor~browser-tab-CsMb-pta.js} +1 -1
- package/build/assets/{vendor~browser-Cvg7jXCP.js → vendor~browser-wXQ-WZEC.js} +1 -1
- package/build/assets/{vendor~entry.client-9tWQ_Ugw.js → vendor~entry.client-DDuH4--y.js} +1 -1
- package/build/assets/{vendor~entry.client-D6BtSOtn.js → vendor~entry.client-DQGrNspu.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js +2 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js +185 -0
- package/build/assets/{vendor~files-tab-B02k3xvx.js → vendor~files-tab-B-5fBohe.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation-CYMF9JYB.js → vendor~index-home~home~conversation-panel~conversation-ChmYLVgz.js} +1 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD7v71DM.js +2 -0
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD0GaRGa.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BT05Osu4.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D7EUmQ8Y.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DgzWSMRc.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DqZatR3B.js} +1 -1
- package/build/assets/{vendor~launch-CHXA9cJu.js → vendor~launch-_Km3J77E.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~ivvrgjsa-BlIZPCXX.js → vendor~module-D5a_AClf.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-CpiTHpHl.js → vendor~root-layout~conversation-panel~conversation-8tIsyrPj.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-BrguKXCn.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-Cn2jwSga.js → vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CZM4hwUT.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~enjl5xdm-B0EIDu4M.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js} +2 -2
- package/build/assets/{verification-settings-D576N2xa.js → verification-settings-CfkrXoSa.js} +1 -1
- package/build/assets/x-ZE4iplpF.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +9 -0
- package/build/locales/ca/openhands.json +9 -0
- package/build/locales/de/openhands.json +9 -0
- package/build/locales/en/openhands.json +9 -0
- package/build/locales/es/openhands.json +9 -0
- package/build/locales/fr/openhands.json +9 -0
- package/build/locales/it/openhands.json +9 -0
- package/build/locales/ja/openhands.json +9 -0
- package/build/locales/ko-KR/openhands.json +9 -0
- package/build/locales/no/openhands.json +9 -0
- package/build/locales/pt/openhands.json +9 -0
- package/build/locales/tr/openhands.json +9 -0
- package/build/locales/uk/openhands.json +9 -0
- package/build/locales/zh-CN/openhands.json +9 -0
- package/build/locales/zh-TW/openhands.json +9 -0
- package/config/defaults.json +5 -4
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +9 -1
- package/dist/api/agent-server-adapter.js +105 -102
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/agent-server-config.cjs +1 -1
- package/dist/api/agent-server-config.cjs.map +1 -1
- package/dist/api/agent-server-config.d.ts +3 -0
- package/dist/api/agent-server-config.js +45 -23
- package/dist/api/agent-server-config.js.map +1 -1
- package/dist/api/backend-registry/auth.cjs +1 -1
- package/dist/api/backend-registry/auth.cjs.map +1 -1
- package/dist/api/backend-registry/auth.js +1 -1
- package/dist/api/backend-registry/auth.js.map +1 -1
- package/dist/api/backend-registry/default-backend.cjs +1 -1
- package/dist/api/backend-registry/default-backend.cjs.map +1 -1
- package/dist/api/backend-registry/default-backend.d.ts +3 -0
- package/dist/api/backend-registry/default-backend.js +22 -10
- package/dist/api/backend-registry/default-backend.js.map +1 -1
- package/dist/api/backend-registry/storage.cjs +1 -1
- package/dist/api/backend-registry/storage.cjs.map +1 -1
- package/dist/api/backend-registry/storage.js +38 -33
- package/dist/api/backend-registry/storage.js.map +1 -1
- package/dist/api/backend-registry/types.d.ts +2 -0
- package/dist/api/canvas-ui-client-tool.cjs +38 -0
- package/dist/api/canvas-ui-client-tool.cjs.map +1 -0
- package/dist/api/canvas-ui-client-tool.d.ts +14 -0
- package/dist/api/canvas-ui-client-tool.js +47 -0
- package/dist/api/canvas-ui-client-tool.js.map +1 -0
- package/dist/api/client-source.cjs +2 -0
- package/dist/api/client-source.cjs.map +1 -0
- package/dist/api/client-source.d.ts +9 -0
- package/dist/api/client-source.js +10 -0
- package/dist/api/client-source.js.map +1 -0
- package/dist/api/cloud/client.cjs +2 -0
- package/dist/api/cloud/client.cjs.map +1 -0
- package/dist/api/cloud/client.d.ts +4 -0
- package/dist/api/cloud/client.js +38 -0
- package/dist/api/cloud/client.js.map +1 -0
- 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.js +35 -33
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/cloud/organization-service.api.cjs +1 -1
- package/dist/api/cloud/organization-service.api.cjs.map +1 -1
- package/dist/api/cloud/organization-service.api.js +11 -10
- package/dist/api/cloud/organization-service.api.js.map +1 -1
- package/dist/api/cloud/proxy.cjs +1 -1
- package/dist/api/cloud/proxy.cjs.map +1 -1
- package/dist/api/cloud/proxy.d.ts +2 -40
- package/dist/api/cloud/proxy.js +14 -39
- package/dist/api/cloud/proxy.js.map +1 -1
- package/dist/api/conversation-metadata-store.cjs +1 -1
- package/dist/api/conversation-metadata-store.cjs.map +1 -1
- package/dist/api/conversation-metadata-store.d.ts +2 -9
- package/dist/api/conversation-metadata-store.js +13 -9
- package/dist/api/conversation-metadata-store.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 +2 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +98 -88
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +5 -0
- package/dist/api/device-flow-client.cjs +1 -1
- package/dist/api/device-flow-client.cjs.map +1 -1
- package/dist/api/device-flow-client.d.ts +4 -58
- package/dist/api/device-flow-client.js +8 -98
- package/dist/api/device-flow-client.js.map +1 -1
- package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
- package/dist/api/git-service/agent-server-git-service.api.cjs.map +1 -1
- package/dist/api/git-service/agent-server-git-service.api.d.ts +10 -2
- package/dist/api/git-service/agent-server-git-service.api.js +107 -40
- package/dist/api/git-service/agent-server-git-service.api.js.map +1 -1
- package/dist/api/open-hands.types.d.ts +11 -0
- package/dist/api/option-service/option-service.api.cjs +1 -1
- package/dist/api/option-service/option-service.api.cjs.map +1 -1
- package/dist/api/option-service/option-service.api.js +0 -1
- package/dist/api/option-service/option-service.api.js.map +1 -1
- package/dist/api/option-service/option.types.d.ts +0 -1
- package/dist/api/secrets-service.cjs +1 -1
- package/dist/api/secrets-service.cjs.map +1 -1
- package/dist/api/secrets-service.js +15 -14
- package/dist/api/secrets-service.js.map +1 -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 +73 -64
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.cjs +2 -2
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.js +2 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.js.map +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.d.ts +4 -2
- package/dist/components/features/backends/backend-form-modal.js +108 -101
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/backend-row.cjs +1 -1
- package/dist/components/features/backends/backend-row.cjs.map +1 -1
- package/dist/components/features/backends/backend-row.js +2 -1
- package/dist/components/features/backends/backend-row.js.map +1 -1
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +51 -51
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/backends/device-flow-auth.cjs +1 -1
- package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
- package/dist/components/features/backends/device-flow-auth.d.ts +4 -1
- package/dist/components/features/backends/device-flow-auth.js +38 -38
- package/dist/components/features/backends/device-flow-auth.js.map +1 -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 +173 -165
- 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.d.ts +2 -1
- package/dist/components/features/chat/components/chat-input-actions.js +44 -43
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-container.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-container.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-container.d.ts +2 -1
- package/dist/components/features/chat/components/chat-input-container.js +20 -19
- package/dist/components/features/chat/components/chat-input-container.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-profile-picker.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-profile-picker.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-profile-picker.js +44 -32
- package/dist/components/features/chat/components/chat-input-profile-picker.js.map +1 -1
- package/dist/components/features/chat/components/resolve-picker-kind.cjs +1 -1
- package/dist/components/features/chat/components/resolve-picker-kind.cjs.map +1 -1
- package/dist/components/features/chat/components/resolve-picker-kind.d.ts +10 -22
- package/dist/components/features/chat/components/resolve-picker-kind.js +6 -3
- package/dist/components/features/chat/components/resolve-picker-kind.js.map +1 -1
- 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.d.ts +2 -1
- package/dist/components/features/chat/custom-chat-input.js +52 -51
- package/dist/components/features/chat/custom-chat-input.js.map +1 -1
- package/dist/components/features/chat/interactive-chat-box.cjs +1 -1
- package/dist/components/features/chat/interactive-chat-box.cjs.map +1 -1
- package/dist/components/features/chat/interactive-chat-box.d.ts +2 -1
- package/dist/components/features/chat/interactive-chat-box.js +9 -8
- package/dist/components/features/chat/interactive-chat-box.js.map +1 -1
- package/dist/components/features/diff-viewer/commit-list.cjs +2 -0
- package/dist/components/features/diff-viewer/commit-list.cjs.map +1 -0
- package/dist/components/features/diff-viewer/commit-list.d.ts +13 -0
- package/dist/components/features/diff-viewer/commit-list.js +27 -0
- package/dist/components/features/diff-viewer/commit-list.js.map +1 -0
- package/dist/components/features/diff-viewer/commit-row.cjs +2 -0
- package/dist/components/features/diff-viewer/commit-row.cjs.map +1 -0
- package/dist/components/features/diff-viewer/commit-row.d.ts +14 -0
- package/dist/components/features/diff-viewer/commit-row.js +59 -0
- package/dist/components/features/diff-viewer/commit-row.js.map +1 -0
- package/dist/components/features/diff-viewer/file-diff-viewer.cjs +1 -1
- package/dist/components/features/diff-viewer/file-diff-viewer.cjs.map +1 -1
- package/dist/components/features/diff-viewer/file-diff-viewer.d.ts +7 -1
- package/dist/components/features/diff-viewer/file-diff-viewer.js +40 -39
- package/dist/components/features/diff-viewer/file-diff-viewer.js.map +1 -1
- package/dist/components/features/plugins/plugin-detail-modal.d.ts +2 -1
- package/dist/components/providers/agent-server-ui-providers.cjs +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.d.ts +4 -2
- package/dist/components/providers/agent-server-ui-providers.js +9 -2
- package/dist/components/providers/agent-server-ui-providers.js.map +1 -1
- package/dist/components/providers/index.cjs +1 -1
- package/dist/components/providers/index.d.ts +1 -2
- package/dist/components/providers/index.js +0 -1
- package/dist/components/providers/telemetry-provider.cjs +2 -0
- package/dist/components/providers/telemetry-provider.cjs.map +1 -0
- package/dist/components/providers/telemetry-provider.d.ts +6 -0
- package/dist/components/providers/telemetry-provider.js +64 -0
- package/dist/components/providers/telemetry-provider.js.map +1 -0
- package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
- package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
- package/dist/components/shared/modals/settings/settings-modal.js +23 -22
- package/dist/components/shared/modals/settings/settings-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 +5 -4
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +1 -1
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/constants/canvas-ui.cjs +2 -0
- package/dist/constants/canvas-ui.cjs.map +1 -0
- package/dist/constants/canvas-ui.d.ts +8 -0
- package/dist/constants/canvas-ui.js +6 -0
- package/dist/constants/canvas-ui.js.map +1 -0
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +197 -204
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- 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.d.ts +2 -1
- package/dist/hooks/mutation/use-create-conversation.js +52 -52
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs.map +1 -1
- package/dist/hooks/mutation/use-save-settings.d.ts +3 -1
- package/dist/hooks/mutation/use-save-settings.js +6 -5
- package/dist/hooks/mutation/use-save-settings.js.map +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +2 -0
- package/dist/hooks/query/query-keys.js +4 -1
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-backends-health.cjs +1 -1
- package/dist/hooks/query/use-backends-health.cjs.map +1 -1
- package/dist/hooks/query/use-backends-health.js +50 -48
- package/dist/hooks/query/use-backends-health.js.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.d.ts +1 -0
- package/dist/hooks/query/use-cloud-organizations.js +5 -2
- package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
- package/dist/hooks/query/use-commit-changes.cjs +2 -0
- package/dist/hooks/query/use-commit-changes.cjs.map +1 -0
- package/dist/hooks/query/use-commit-changes.d.ts +5 -0
- package/dist/hooks/query/use-commit-changes.js +34 -0
- package/dist/hooks/query/use-commit-changes.js.map +1 -0
- 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.d.ts +3 -2
- package/dist/hooks/query/use-task-polling.js +53 -40
- package/dist/hooks/query/use-task-polling.js.map +1 -1
- package/dist/hooks/query/use-unified-git-commits.cjs +2 -0
- package/dist/hooks/query/use-unified-git-commits.cjs.map +1 -0
- package/dist/hooks/query/use-unified-git-commits.d.ts +10 -0
- package/dist/hooks/query/use-unified-git-commits.js +41 -0
- package/dist/hooks/query/use-unified-git-commits.js.map +1 -0
- package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
- package/dist/hooks/query/use-unified-git-diff.cjs.map +1 -1
- package/dist/hooks/query/use-unified-git-diff.d.ts +5 -0
- package/dist/hooks/query/use-unified-git-diff.js +11 -4
- package/dist/hooks/query/use-unified-git-diff.js.map +1 -1
- package/dist/hooks/use-acp-model-context.cjs +1 -1
- package/dist/hooks/use-acp-model-context.cjs.map +1 -1
- package/dist/hooks/use-acp-model-context.d.ts +4 -1
- package/dist/hooks/use-acp-model-context.js +9 -8
- package/dist/hooks/use-acp-model-context.js.map +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.cjs +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.cjs.map +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.js +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.js.map +1 -1
- package/dist/hooks/use-chat-input-model-state.cjs.map +1 -1
- package/dist/hooks/use-chat-input-model-state.d.ts +2 -1
- package/dist/hooks/use-chat-input-model-state.js.map +1 -1
- package/dist/hooks/use-chat-input-profile-state.cjs +1 -1
- package/dist/hooks/use-chat-input-profile-state.cjs.map +1 -1
- package/dist/hooks/use-chat-input-profile-state.d.ts +1 -10
- package/dist/hooks/use-chat-input-profile-state.js +42 -15
- package/dist/hooks/use-chat-input-profile-state.js.map +1 -1
- package/dist/hooks/use-device-flow.cjs +1 -1
- package/dist/hooks/use-device-flow.cjs.map +1 -1
- package/dist/hooks/use-device-flow.d.ts +4 -1
- package/dist/hooks/use-device-flow.js +42 -40
- package/dist/hooks/use-device-flow.js.map +1 -1
- package/dist/hooks/use-telemetry.cjs +1 -1
- package/dist/hooks/use-telemetry.cjs.map +1 -1
- package/dist/hooks/use-telemetry.d.ts +3 -3
- package/dist/hooks/use-telemetry.js +16 -22
- package/dist/hooks/use-telemetry.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 +5 -5
- package/dist/hooks/use-tracking.js +37 -37
- 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 +9 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.js +19 -18
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +153 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +32 -32
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +1 -1
- package/dist/locales/ar/openhands.json +9 -0
- package/dist/locales/ca/openhands.json +9 -0
- package/dist/locales/de/openhands.json +9 -0
- package/dist/locales/en/openhands.json +9 -0
- package/dist/locales/es/openhands.json +9 -0
- package/dist/locales/fr/openhands.json +9 -0
- package/dist/locales/it/openhands.json +9 -0
- package/dist/locales/ja/openhands.json +9 -0
- package/dist/locales/ko-KR/openhands.json +9 -0
- package/dist/locales/no/openhands.json +9 -0
- package/dist/locales/pt/openhands.json +9 -0
- package/dist/locales/tr/openhands.json +9 -0
- package/dist/locales/uk/openhands.json +9 -0
- package/dist/locales/zh-CN/openhands.json +9 -0
- package/dist/locales/zh-TW/openhands.json +9 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.js +351 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.js +106 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +69 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.js +3 -0
- 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 +18 -2
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js.map +1 -1
- package/dist/node_modules/axios/index.cjs +1 -1
- package/dist/node_modules/axios/index.js +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +59 -60
- package/dist/routes/app-settings.js.map +1 -1
- package/dist/routes/commits-tab.cjs +2 -0
- package/dist/routes/commits-tab.cjs.map +1 -0
- package/dist/routes/commits-tab.d.ts +8 -0
- package/dist/routes/commits-tab.js +45 -0
- package/dist/routes/commits-tab.js.map +1 -0
- package/dist/routes/files-tab.cjs +1 -1
- package/dist/routes/files-tab.cjs.map +1 -1
- package/dist/routes/files-tab.js +148 -127
- package/dist/routes/files-tab.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +4 -1
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/services/cloud-funnel-analytics.cjs +2 -0
- package/dist/services/cloud-funnel-analytics.cjs.map +1 -0
- package/dist/services/cloud-funnel-analytics.d.ts +4 -0
- package/dist/services/cloud-funnel-analytics.js +39 -0
- package/dist/services/cloud-funnel-analytics.js.map +1 -0
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.d.ts +46 -9
- package/dist/services/telemetry.js +182 -71
- package/dist/services/telemetry.js.map +1 -1
- package/dist/themes/color-themes.cjs.map +1 -1
- package/dist/themes/color-themes.d.ts +3 -6
- package/dist/themes/color-themes.js.map +1 -1
- package/dist/types/agent-server/core/base/action.d.ts +5 -4
- package/dist/types/agent-server/core/base/base.d.ts +3 -2
- package/dist/types/agent-server/core/base/observation.d.ts +1 -1
- 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 +3 -5
- package/dist/types/agent-server/type-guards.js +2 -1
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/types/automation.d.ts +5 -0
- package/dist/utils/api-error-message.d.ts +11 -0
- package/dist/utils/automation-timeout.d.ts +19 -0
- package/dist/utils/base-path.cjs +2 -0
- package/dist/utils/base-path.cjs.map +1 -0
- package/dist/utils/base-path.d.ts +2 -0
- package/dist/utils/base-path.js +23 -0
- package/dist/utils/base-path.js.map +1 -0
- package/dist/utils/error-handler.cjs +1 -1
- package/dist/utils/error-handler.cjs.map +1 -1
- package/dist/utils/error-handler.d.ts +1 -4
- package/dist/utils/error-handler.js +6 -7
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/map-provider.cjs +1 -1
- package/dist/utils/map-provider.cjs.map +1 -1
- package/dist/utils/map-provider.d.ts +1 -0
- package/dist/utils/map-provider.js +2 -1
- package/dist/utils/map-provider.js.map +1 -1
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +7 -8
- package/scripts/dev-static.mjs +3 -0
- package/scripts/dev-with-automation.mjs +3 -0
- package/scripts/docker-build.mjs +4 -0
- package/scripts/static-server.mjs +93 -7
- package/tools/canvas_ui_tool.py +14 -8
- package/build/assets/active-backend-context-hxq31W25.js +0 -1
- package/build/assets/agent-server-client-options-DVLRd9sw.js +0 -1
- package/build/assets/agent-server-conversation-service.api-CuSdr4Qb.js +0 -5
- package/build/assets/agent-settings-D_yOy8XB.js +0 -1
- package/build/assets/api-key-entry-screen-Dl0qVYi4.js +0 -1
- package/build/assets/app-settings-yVizGXox.js +0 -1
- package/build/assets/automation-detail-dvJfLs5u.js +0 -2
- package/build/assets/automation-export-BPcgLqPD.js +0 -2
- package/build/assets/automations-list-CUXogTe0.js +0 -1
- package/build/assets/backend-form-modal-CQJGmItq.js +0 -1
- package/build/assets/check-Bvi71siz.js +0 -1
- package/build/assets/condenser-settings-Ca8fYZ_Z.js +0 -1
- package/build/assets/conversation-9NBSRoR9.js +0 -1
- package/build/assets/conversation-BXg6Oti2.js +0 -89
- package/build/assets/conversation-panel-CZri9Rup.js +0 -1
- package/build/assets/conversation-service.api-DPBQvTKD.js +0 -1
- package/build/assets/declaration-gq8V5eTU.js +0 -1
- package/build/assets/files-tab-UVoray88.js +0 -1
- package/build/assets/git-provider-icon-o6hdnJUB.js +0 -1
- package/build/assets/handle-capture-consent-CPMXU29K.js +0 -1
- package/build/assets/home-D1IHvGTN.js +0 -1
- package/build/assets/index-redirect-CUUJiNki.js +0 -1
- package/build/assets/install-server-modal-BbuQaA2w.js +0 -1
- package/build/assets/lesson-plan-jC0HBoe6.js +0 -4
- package/build/assets/llm-not-configured-banner-DoARbcdL.js +0 -27
- package/build/assets/llm-settings-4JMLV8mq.js +0 -1
- package/build/assets/llm-settings-D91gMw3U.js +0 -1
- package/build/assets/llm-subscription-service-CKyaV24y.js +0 -1
- package/build/assets/loader-circle-BEykUKYG.js +0 -1
- package/build/assets/manage-backends-modal-DkWAMSle.js +0 -1
- package/build/assets/manifest-aa5c29f6.js +0 -1
- package/build/assets/model-selector-BfqpMkSJ.js +0 -1
- package/build/assets/mouse-pointer-click-PdEQPL6v.js +0 -1
- package/build/assets/onboarding-Bu-HN1ze.js +0 -1
- package/build/assets/onboarding-modal-CZgjs5Bx.js +0 -1
- package/build/assets/option-service.api-BrZ5q87N.js +0 -1
- package/build/assets/organization-service.api-Bk4pCGU1.js +0 -1
- package/build/assets/path-utils-CSmuZoix.js +0 -1
- package/build/assets/plugins-management-service-BRBLxvUl.js +0 -1
- package/build/assets/profiles-service.api-BMXQ9pZC.js +0 -1
- package/build/assets/providers-BpO967xS.js +0 -1
- package/build/assets/proxy-BgJLtxu7.js +0 -1
- package/build/assets/root-BM5WgQ4_.js +0 -2
- package/build/assets/root-V8fkplMy.css +0 -1
- package/build/assets/root-layout-BdoyoobY.js +0 -2
- package/build/assets/schema-field-BSHrUMme.js +0 -1
- package/build/assets/sdk-section-page-t82gsOqa.js +0 -1
- package/build/assets/search-4DHskuhE.js +0 -1
- package/build/assets/secrets-service-B2GqPV0N.js +0 -1
- package/build/assets/settings-DmPLkgq0.js +0 -1
- package/build/assets/settings-modal-CwrZKrTq.js +0 -1
- package/build/assets/settings-service.api-Ce-ub11I.js +0 -1
- package/build/assets/shared-conversation-BDREQPnE.js +0 -1
- package/build/assets/skills-plugins-2Y44YHbO.js +0 -1
- package/build/assets/use-acp-credential-form-MzZM6D7D.js +0 -1
- package/build/assets/use-agent-profiles-DwZxnwO5.js +0 -1
- package/build/assets/use-backends-health-CRHzuvxO.js +0 -1
- package/build/assets/use-cloud-current-user-id-utFreJ0i.js +0 -1
- package/build/assets/use-config-mJrtZHP1.js +0 -1
- package/build/assets/use-create-conversation-DdqsP78F.js +0 -1
- package/build/assets/use-is-authed-B6M0mcGL.js +0 -1
- package/build/assets/use-llm-profiles-RC-PkpBl.js +0 -1
- package/build/assets/use-plugins-marketplace-FHlbeQ4c.js +0 -1
- package/build/assets/use-runtime-is-ready-RKj2WmEh.js +0 -1
- package/build/assets/use-save-agent-profile-tvDP15mh.js +0 -1
- package/build/assets/use-save-settings-BGlSfuYn.js +0 -1
- package/build/assets/use-settings-CH5LzXD8.js +0 -1
- package/build/assets/use-settings-nav-items-Dwktv8wo.js +0 -16
- package/build/assets/use-skills-CSzSL6HG.js +0 -1
- package/build/assets/use-tracking-BIXzagSI.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~lf310vj7-CSVPGId3.js +0 -10
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nfpll1wp-BCpa95De.js +0 -177
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jewnulst-C57fm7C-.js +0 -1
- package/build/assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CqXiHwjU.js +0 -2
- package/build/assets/x-Cb0WAtak.js +0 -1
- package/dist/components/providers/posthog-wrapper.cjs +0 -2
- package/dist/components/providers/posthog-wrapper.cjs.map +0 -1
- package/dist/components/providers/posthog-wrapper.d.ts +0 -4
- package/dist/components/providers/posthog-wrapper.js +0 -49
- package/dist/components/providers/posthog-wrapper.js.map +0 -1
- package/dist/node_modules/posthog-js/react/dist/esm/index.cjs +0 -2
- package/dist/node_modules/posthog-js/react/dist/esm/index.cjs.map +0 -1
- package/dist/node_modules/posthog-js/react/dist/esm/index.js +0 -113
- package/dist/node_modules/posthog-js/react/dist/esm/index.js.map +0 -1
- package/dist/utils/handle-capture-consent.cjs +0 -2
- package/dist/utils/handle-capture-consent.cjs.map +0 -1
- package/dist/utils/handle-capture-consent.d.ts +0 -7
- package/dist/utils/handle-capture-consent.js +0 -8
- package/dist/utils/handle-capture-consent.js.map +0 -1
- /package/build/assets/{__vite-browser-external-4xJsU2-u.js → __vite-browser-external-BQUj0sYu.js} +0 -0
- /package/build/assets/{agent-server-ui-style-scope-COnDHTm5.js → agent-server-ui-style-scope-qhnhZHBV.js} +0 -0
- /package/build/assets/{automation-BU8zu-FP.js → automation-LZB0MjdV.js} +0 -0
- /package/build/assets/{close-p3Op5lxI.js → close-DLFb5kfv.js} +0 -0
- /package/build/assets/{common-Dh7OqABE.js → common-CxbUL3nR.js} +0 -0
- /package/build/assets/{createLucideIcon-CVAsW2Yo.js → createLucideIcon-D4Tak8A1.js} +0 -0
- /package/build/assets/{folder-mMWFvaw0.js → folder-Bk311brm.js} +0 -0
- /package/build/assets/{get-language-from-path-CPNnuVhI.js → get-language-from-path-DBqBsCWH.js} +0 -0
- /package/build/assets/{git-status-mapper-BI8FyUVp.js → git-status-mapper-DnL9OC8_.js} +0 -0
- /package/build/assets/{iconBase-DaTRRUjy.js → iconBase-Dz51Zn5x.js} +0 -0
- /package/build/assets/{link-external-DfKQroKX.js → link-external-CaBmUEs_.js} +0 -0
- /package/build/assets/{search-BsjCEFNf.js → search-BgOCR7_c.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-DENKlZpD.js → settings-like-page-layout-classes-Cdl6jOe5.js} +0 -0
- /package/build/assets/{skills-9cDZONKh.js → skills-EqzxYBvT.js} +0 -0
- /package/build/assets/{terminal-BuLtIrb9.js → terminal-Cgf___rK.js} +0 -0
- /package/build/assets/{u-check-circle-half-LiwZkuFe.js → u-check-circle-half-MsShT8Ec.js} +0 -0
- /package/build/assets/{u-edit-DJ90xc8Z.js → u-edit-DL5LgKon.js} +0 -0
- /package/build/assets/{use-breakpoint-B-O0lQ84.js → use-breakpoint-BP3lqLMx.js} +0 -0
- /package/build/assets/{use-click-outside-element-Bf4Omzot.js → use-click-outside-element-D9BYdANT.js} +0 -0
- /package/build/assets/{use-launch-skill-in-chat-BnoDgvAy.js → use-launch-skill-in-chat-DJWEfVc5.js} +0 -0
- /package/build/assets/{vendor~browser-Dqd33JyP.js → vendor~browser-By2MVv_N.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DHDkknt5.js → vendor~conversation-panel~conversation~alert-banner-CxfzCmkN.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~epa72zsm-B4rXs7Zd.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9UMeuPV6.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-COhHANvV.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DTzw2x50.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-FghQ3Z1a.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js → vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js → vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C4-GDgiF.js} +0 -0
- /package/build/assets/{vendor~terminal-aeP3PnKf.js → vendor~terminal-CnKZILnC.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../../../../i18n/declaration.cjs`),r=require(`../../../../node_modules/lucide-react/dist/esm/icons/cpu.cjs`),i=require(`../../../../types/agent-state.cjs`),a=require(`../../../../utils/utils.cjs`),o=require(`../../../../hooks/use-conversation-id.cjs`),s=require(`../../../../stores/conversation-store.cjs`),c=require(`../../../../contexts/active-backend-context.cjs`),ee=require(`../../../../hooks/use-agent-state.cjs`),l=require(`../../../../utils/form-control-classes.cjs`),te=require(`../../../../hooks/use-unified-websocket-status.cjs`),ne=require(`../../controls/agent-status.cjs`),re=require(`../../../../icons/lesson-plan.cjs`),u=require(`../../../../icons/code-pill.cjs`),d=require(`../../../../ui/context-menu.cjs`),f=require(`../../context-menu/context-menu-list-item.cjs`),ie=require(`../../../../hooks/use-click-outside-element.cjs`),ae=require(`../../../../hooks/query/use-agent-profiles.cjs`),oe=require(`../../../../hooks/use-handle-plan-click.cjs`),se=require(`../change-agent-button.cjs`),ce=require(`../../../../hooks/use-chat-input-model-state.cjs`),p=require(`./chat-input-model.cjs`),m=require(`./chat-input-profile-picker.cjs`),
|
|
1
|
+
const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../../../../i18n/declaration.cjs`),r=require(`../../../../node_modules/lucide-react/dist/esm/icons/cpu.cjs`),i=require(`../../../../types/agent-state.cjs`),a=require(`../../../../utils/utils.cjs`),o=require(`../../../../hooks/use-conversation-id.cjs`),s=require(`../../../../stores/conversation-store.cjs`),c=require(`../../../../contexts/active-backend-context.cjs`),ee=require(`../../../../hooks/use-agent-state.cjs`),l=require(`../../../../utils/form-control-classes.cjs`),te=require(`../../../../hooks/use-unified-websocket-status.cjs`),ne=require(`../../controls/agent-status.cjs`),re=require(`../../../../icons/lesson-plan.cjs`),u=require(`../../../../icons/code-pill.cjs`),d=require(`../../../../ui/context-menu.cjs`),f=require(`../../context-menu/context-menu-list-item.cjs`),ie=require(`../../../../hooks/use-click-outside-element.cjs`),ae=require(`../../../../hooks/query/use-agent-profiles.cjs`),oe=require(`../../../../hooks/use-handle-plan-click.cjs`),se=require(`../change-agent-button.cjs`),ce=require(`../../../../hooks/use-chat-input-model-state.cjs`),p=require(`./chat-input-model.cjs`),m=require(`./chat-input-profile-picker.cjs`),le=require(`./chat-input-llm-profile-picker.cjs`),ue=require(`./resolve-picker-kind.cjs`),de=require(`../../../../hooks/mutation/use-unified-stop-conversation.cjs`),h=require(`../../../../icons/carret-right-fill.cjs`),g=require(`../../controls/tools-context-menu-icon-text.cjs`),fe=require(`../chat-add-file-button.cjs`),pe=require(`../chat-send-button.cjs`),me=require(`../../../../icons/three-dots-vertical.cjs`),he=require(`../../../../hooks/mutation/use-pause-conversation.cjs`),ge=require(`../../../../hooks/mutation/use-resume-conversation.cjs`);let _=require(`react`);_=e.__toESM(_,1);let v=require(`react/jsx-runtime`),y=require(`react-dom`);y=e.__toESM(y,1);function b({disabled:e,canSubmit:b=!0,hasStartedConversation:_e,onAddFileClick:ve=()=>{},showButton:ye=!0,buttonClassName:be=``,handleSubmit:xe=()=>{}}){let{t:x}=t.useTranslation(`openhands`),Se=de.useUnifiedPauseConversation(),S=he.usePauseConversation(),Ce=ge.useResumeConversation(),{conversationId:C}=o.useOptionalConversationId(),{backend:we}=c.useActiveBackend(),w=we.kind===`cloud`,T=ce.useChatInputModelState(),E=ae.useAgentProfiles({enabled:!C}),Te=E.isFetched&&(E.data?.profiles?.length??0)===0,D=w&&!T.isAcpContext,Ee=te.useUnifiedWebSocketStatus(),{curAgentState:De}=ee.useAgentState(),{conversationMode:Oe,setConversationMode:ke}=s.useConversationStore(),{handlePlanClick:Ae,isCreatingConversation:je}=oe.useHandlePlanClick(),O=_.default.useRef(null),k=_.default.useRef(null),A=_.default.useRef(null),j=_.default.useRef(null),M=_.default.useRef(null),N=_.default.useRef(null),[P,Me]=_.default.useState(1/0),[Ne,Pe]=_.default.useState(0),[Fe,Ie]=_.default.useState(32),[F,Le]=_.default.useState(96),[I,Re]=_.default.useState(120),[L,R]=_.default.useState(!1),[z,B]=_.default.useState(null),[V,ze]=_.default.useState();_.default.useEffect(()=>{let e=O.current,t=k.current,n=A.current,r=j.current,i=M.current;if(!e||!t||!n||!i||D&&!r||typeof ResizeObserver>`u`)return;let a=()=>{let a=e.getBoundingClientRect().width,o=t.getBoundingClientRect().width,s=n.getBoundingClientRect().width,c=i.getBoundingClientRect().width;if(a>0&&Me(a),o>0&&Pe(o),s>0&&Ie(s),c>0&&Re(c),r){let e=r.getBoundingClientRect().width;e>0&&Le(e)}},o=new ResizeObserver(()=>{a()});return o.observe(e),o.observe(t),o.observe(n),o.observe(i),r&&o.observe(r),a(),()=>o.disconnect()},[D]);let Be=()=>{C&&S.mutate({conversationId:C})},Ve=()=>{C&&Ce.mutate({conversationId:C})},He=Se.isPending||S.isPending,H=_.default.useCallback(e=>{let t=e,n={showCodeInline:!1,showModelInline:!1};return D&&t>=F&&(n.showCodeInline=!0,t-=F+12),t>=I&&(n.showModelInline=!0),n},[D,F,I]),U=P-Ne-8-Fe-12,W=H(U),G=(!D||W.showCodeInline)&&W.showModelInline?W:H(U-28-12),K=D?G.showCodeInline:!1,q=G.showModelInline,Ue=P>=360,J=D&&!K||!q;_.default.useEffect(()=>{J||(R(!1),B(null))},[J]);let We=ie.useClickOutsideElement(()=>{R(!1),B(null)}),Y=De===i.AgentState.RUNNING||je||Ee!==`OPEN`,X=()=>{B(null),R(!1)},Z=ue.resolvePickerKind({hasConversation:!!C,hasStartedConversation:_e,isCloud:w,isAcp:T.isAcpContext,profilesAvailable:!Te}),Q=a.cn(`group`,l.formControlTransitionClassName),$=a.cn(`text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]`,l.formControlTransitionClassName);_.default.useLayoutEffect(()=>{if(!L||!N.current)return;let e=N.current,t=()=>{let t=e.getBoundingClientRect();ze({position:`fixed`,top:t.top-8,left:t.left,transform:`translateY(-100%)`,zIndex:9999})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[L]);let Ge=(0,v.jsxs)(d.ContextMenu,{ref:We,testId:`chat-input-overflow-menu`,position:`top`,alignment:`left`,className:`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]`,children:[D&&!K&&(0,v.jsxs)(`div`,{className:`relative group/overflow-agent`,children:[(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-button`,onClick:()=>B(e=>e===`agent`?null:`agent`),isDisabled:Y,children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(u.CodePillIcon,{className:`h-[11px] w-[11px]`}),text:x(Oe===`code`?n.I18nKey.COMMON$CODE:n.I18nKey.COMMON$PLAN),rightIcon:(0,v.jsx)(h.default,{width:10,height:10})})}),!Y&&(0,v.jsx)(`div`,{className:a.cn(`absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]`,`group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto`,`hover:opacity-100 hover:visible hover:pointer-events-auto`,z===`agent`&&`opacity-100 visible pointer-events-auto`),children:(0,v.jsxs)(d.ContextMenu,{testId:`overflow-agent-submenu`,className:`overflow-visible min-w-[195px]`,children:[(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-code`,onClick:e=>{e.preventDefault(),e.stopPropagation(),ke(`code`),X()},children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(u.CodePillIcon,{className:`h-[11px] w-[11px]`}),text:x(n.I18nKey.COMMON$CODE)})}),(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-agent-plan`,onClick:e=>{Ae(e),X()},children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(re.default,{width:16,height:16,color:`currentColor`}),text:x(n.I18nKey.COMMON$PLAN)})})]})})]}),!q&&(0,v.jsxs)(`div`,{className:`relative group/overflow-model`,children:[(0,v.jsx)(f.ContextMenuListItem,{testId:`overflow-model-button`,onClick:()=>B(e=>e===`model`?null:`model`),children:(0,v.jsx)(g.ToolsContextMenuIconText,{icon:(0,v.jsx)(r.Cpu,{width:16,height:16,strokeWidth:2,"aria-hidden":!0}),text:x(n.I18nKey.SETTINGS$AGENT_MODEL),rightIcon:(0,v.jsx)(h.default,{width:10,height:10})})}),(0,v.jsx)(`div`,{className:a.cn(`absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]`,`group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto`,`hover:opacity-100 hover:visible hover:pointer-events-auto`,z===`model`&&`opacity-100 visible pointer-events-auto`),children:(0,v.jsx)(d.ContextMenu,{testId:`overflow-model-submenu`,className:`min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0`,children:Z===`model`?(0,v.jsx)(p.ChatInputModelMenuContent,{model:T,onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$}):Z===`agent-profile`?(0,v.jsx)(m.ChatInputProfileMenuContent,{onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$}):(0,v.jsx)(le.ChatInputLlmProfileMenuContent,{onClose:X,dividerInset:`menu`,settingsLinkClassName:Q,settingsIconClassName:$})})})]})]});return(0,v.jsxs)(`div`,{ref:O,className:`w-full min-w-0 flex items-center justify-between gap-2`,children:[(0,v.jsx)(`div`,{className:`flex min-w-0 items-center gap-1`,children:(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,v.jsx)(`div`,{ref:A,className:a.cn(!1),children:(0,v.jsx)(fe.ChatAddFileButton,{disabled:e,handleFileIconClick:ve})}),D&&(0,v.jsx)(`div`,{ref:j,className:a.cn(!K&&`hidden`),children:(0,v.jsx)(se.ChangeAgentButton,{})}),(0,v.jsx)(`div`,{ref:M,className:a.cn(!q&&`hidden`),children:Z===`model`?(0,v.jsx)(p.ChatInputModel,{}):Z===`agent-profile`?(0,v.jsx)(m.ChatInputProfilePicker,{}):(0,v.jsx)(le.ChatInputLlmProfilePicker,{})}),J&&(0,v.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,v.jsx)(`button`,{ref:N,type:`button`,className:a.cn(l.chatInputIconButtonClassName,`size-6`),"aria-label":x(n.I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS),"aria-expanded":L,"aria-haspopup":`menu`,onClick:e=>{e.preventDefault(),e.stopPropagation(),R(e=>!e)},children:(0,v.jsx)(me.default,{width:16,height:16,color:`currentColor`})}),L&&typeof document<`u`&&V&&y.default.createPortal((0,v.jsx)(`div`,{style:V,children:Ge}),document.body)]})]})}),(0,v.jsxs)(`div`,{ref:k,className:`ml-auto flex shrink-0 items-center gap-2`,children:[Ue&&C&&(0,v.jsx)(ne.default,{handleStop:Be,handleResumeAgent:Ve,disabled:e,isPausing:He}),ye&&(0,v.jsx)(pe.ChatSendButton,{buttonClassName:be,handleSubmit:xe,disabled:e||!b})]})]})}exports.ChatInputActions=b;
|
|
2
2
|
//# sourceMappingURL=chat-input-actions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-actions.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":"g7DAsDA,SAAgB,EAAiB,CAC/B,WACA,YAAY,GACZ,sBAAuB,GACvB,cAAa,GACb,mBAAkB,GAClB,oBAAqB,IACG,CACxB,GAAM,CAAE,KAAM,EAAA,eAAe,YAAY,CACnC,GAAuB,GAAA,6BAA6B,CACpD,EAA4B,GAAA,sBAAsB,CAClD,GAA6B,GAAA,uBAAuB,CACpD,CAAE,kBAAmB,EAAA,2BAA2B,CAChD,CAAE,YAAY,EAAA,kBAAkB,CAChC,EAAU,GAAQ,OAAS,QAC3B,EAAa,GAAA,wBAAwB,CAKrC,EAAoB,GAAA,iBAAiB,CACzC,QAAS,CAAC,EACX,CAAC,CACI,GACJ,EAAkB,YACjB,EAAkB,MAAM,UAAU,QAAU,KAAO,EAGhD,EAAwB,GAAW,CAAC,EAAW,aAC/C,GAAkB,GAAA,2BAA2B,CAC7C,CAAE,kBAAkB,GAAA,eAAe,CACnC,CAAE,oBAAkB,wBAAwB,EAAA,sBAAsB,CAClE,CAAE,mBAAiB,2BAA2B,GAAA,oBAAoB,CAElE,EAAgB,EAAA,QAAM,OAAuB,KAAK,C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,KAAK,SACL,UAAW,EAAA,GAAG,EAAA,6BAA8B,SAAS,CACrD,aAAY,EAAE,EAAA,QAAQ,kCAAkC,CACxD,gBAAe,EACf,gBAAc,OACd,QAAU,GAAU,CAClB,EAAM,gBAAgB,CACtB,EAAM,iBAAiB,CACvB,EAAmB,GAAS,CAAC,EAAK,YAGpC,EAAA,EAAA,KAAC,GAAA,QAAD,CACE,MAAO,GACP,OAAQ,GACR,MAAM,eACN,CAAA,CACK,CAAA,CAER,GACC,OAAO,SAAa,KACpB,GACA,EAAA,QAAS,cACP,EAAA,EAAA,KAAC,MAAD,CAAK,MAAO,WAAsB,GAAmB,CAAA,CACrD,SAAS,KACV,CACC,GAEJ,GACF,CAAA,EACN,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,UAAU,oDAFZ,CAIG,IAAyB,IACxB,EAAA,EAAA,KAAC,GAAA,QAAD,CACE,WAAY,GACZ,kBAAmB,GACT,WACC,aACX,CAAA,CAEH,KACC,EAAA,EAAA,KAAC,GAAA,eAAD,CACmB,mBACH,gBACd,SAAU,GAAY,CAAC,EACvB,CAAA,CAEA,GACF"}
|
|
1
|
+
{"version":3,"file":"chat-input-actions.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n hasStartedConversation?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n hasStartedConversation,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n hasStartedConversation,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":"i7DAuDA,SAAgB,EAAiB,CAC/B,WACA,YAAY,GACZ,0BACA,sBAAuB,GACvB,cAAa,GACb,mBAAkB,GAClB,oBAAqB,IACG,CACxB,GAAM,CAAE,KAAM,EAAA,eAAe,YAAY,CACnC,GAAuB,GAAA,6BAA6B,CACpD,EAA4B,GAAA,sBAAsB,CAClD,GAA6B,GAAA,uBAAuB,CACpD,CAAE,kBAAmB,EAAA,2BAA2B,CAChD,CAAE,YAAY,EAAA,kBAAkB,CAChC,EAAU,GAAQ,OAAS,QAC3B,EAAa,GAAA,wBAAwB,CAKrC,EAAoB,GAAA,iBAAiB,CACzC,QAAS,CAAC,EACX,CAAC,CACI,GACJ,EAAkB,YACjB,EAAkB,MAAM,UAAU,QAAU,KAAO,EAGhD,EAAwB,GAAW,CAAC,EAAW,aAC/C,GAAkB,GAAA,2BAA2B,CAC7C,CAAE,kBAAkB,GAAA,eAAe,CACnC,CAAE,oBAAkB,wBAAwB,EAAA,sBAAsB,CAClE,CAAE,mBAAiB,2BAA2B,GAAA,oBAAoB,CAElE,EAAgB,EAAA,QAAM,OAAuB,KAAK,CAClD,EAAkB,EAAA,QAAM,OAAuB,K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AG,EAAA,6BAA8B,SAAS,CACrD,aAAY,EAAE,EAAA,QAAQ,kCAAkC,CACxD,gBAAe,EACf,gBAAc,OACd,QAAU,GAAU,CAClB,EAAM,gBAAgB,CACtB,EAAM,iBAAiB,CACvB,EAAmB,GAAS,CAAC,EAAK,YAGpC,EAAA,EAAA,KAAC,GAAA,QAAD,CACE,MAAO,GACP,OAAQ,GACR,MAAM,eACN,CAAA,CACK,CAAA,CAER,GACC,OAAO,SAAa,KACpB,GACA,EAAA,QAAS,cACP,EAAA,EAAA,KAAC,MAAD,CAAK,MAAO,WAAsB,GAAmB,CAAA,CACrD,SAAS,KACV,CACC,GAEJ,GACF,CAAA,EACN,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,UAAU,oDAFZ,CAIG,IAAyB,IACxB,EAAA,EAAA,KAAC,GAAA,QAAD,CACE,WAAY,GACZ,kBAAmB,GACT,WACC,aACX,CAAA,CAEH,KACC,EAAA,EAAA,KAAC,GAAA,eAAD,CACmB,mBACH,gBACd,SAAU,GAAY,CAAC,EACvB,CAAA,CAEA,GACF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
interface ChatInputActionsProps {
|
|
2
2
|
disabled: boolean;
|
|
3
3
|
canSubmit?: boolean;
|
|
4
|
+
hasStartedConversation?: boolean;
|
|
4
5
|
onAddFileClick?: () => void;
|
|
5
6
|
showButton?: boolean;
|
|
6
7
|
buttonClassName?: string;
|
|
7
8
|
handleSubmit?: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare function ChatInputActions({ disabled, canSubmit, onAddFileClick, showButton, buttonClassName, handleSubmit, }: ChatInputActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function ChatInputActions({ disabled, canSubmit, hasStartedConversation, onAddFileClick, showButton, buttonClassName, handleSubmit, }: ChatInputActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -9,13 +9,13 @@ import { useActiveBackend as s } from "../../../../contexts/active-backend-conte
|
|
|
9
9
|
import { useAgentState as c } from "../../../../hooks/use-agent-state.js";
|
|
10
10
|
import { chatInputIconButtonClassName as ee, formControlTransitionClassName as l } from "../../../../utils/form-control-classes.js";
|
|
11
11
|
import { useUnifiedWebSocketStatus as te } from "../../../../hooks/use-unified-websocket-status.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { CodePillIcon as
|
|
15
|
-
import { ContextMenu as
|
|
16
|
-
import { ContextMenuListItem as
|
|
17
|
-
import { useClickOutsideElement as
|
|
18
|
-
import { useAgentProfiles as
|
|
12
|
+
import u from "../../controls/agent-status.js";
|
|
13
|
+
import ne from "../../../../icons/lesson-plan.js";
|
|
14
|
+
import { CodePillIcon as d } from "../../../../icons/code-pill.js";
|
|
15
|
+
import { ContextMenu as f } from "../../../../ui/context-menu.js";
|
|
16
|
+
import { ContextMenuListItem as p } from "../../context-menu/context-menu-list-item.js";
|
|
17
|
+
import { useClickOutsideElement as re } from "../../../../hooks/use-click-outside-element.js";
|
|
18
|
+
import { useAgentProfiles as ie } from "../../../../hooks/query/use-agent-profiles.js";
|
|
19
19
|
import { useHandlePlanClick as ae } from "../../../../hooks/use-handle-plan-click.js";
|
|
20
20
|
import { ChangeAgentButton as oe } from "../change-agent-button.js";
|
|
21
21
|
import { useChatInputModelState as se } from "../../../../hooks/use-chat-input-model-state.js";
|
|
@@ -35,27 +35,27 @@ import g from "react";
|
|
|
35
35
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
36
36
|
import xe from "react-dom";
|
|
37
37
|
//#region src/components/features/chat/components/chat-input-actions.tsx
|
|
38
|
-
function y({ disabled: y, canSubmit: Se = !0,
|
|
39
|
-
let { t: b } = e("openhands"),
|
|
38
|
+
function y({ disabled: y, canSubmit: Se = !0, hasStartedConversation: Ce, onAddFileClick: we = () => {}, showButton: Te = !0, buttonClassName: Ee = "", handleSubmit: De = () => {} }) {
|
|
39
|
+
let { t: b } = e("openhands"), Oe = he(), x = ye(), ke = be(), { conversationId: S } = a(), { backend: Ae } = s(), C = Ae.kind === "cloud", w = se(), T = ie({ enabled: !S }), je = T.isFetched && (T.data?.profiles?.length ?? 0) === 0, E = C && !w.isAcpContext, Me = te(), { curAgentState: Ne } = c(), { conversationMode: Pe, setConversationMode: Fe } = o(), { handlePlanClick: Ie, isCreatingConversation: Le } = ae(), D = g.useRef(null), O = g.useRef(null), k = g.useRef(null), A = g.useRef(null), j = g.useRef(null), M = g.useRef(null), [N, Re] = g.useState(Infinity), [ze, Be] = g.useState(0), [P, Ve] = g.useState(32), [F, He] = g.useState(96), [I, Ue] = g.useState(120), [L, R] = g.useState(!1), [z, B] = g.useState(null), [V, We] = g.useState();
|
|
40
40
|
g.useEffect(() => {
|
|
41
41
|
let e = D.current, t = O.current, n = k.current, r = A.current, i = j.current;
|
|
42
42
|
if (!e || !t || !n || !i || E && !r || typeof ResizeObserver > "u") return;
|
|
43
43
|
let a = () => {
|
|
44
44
|
let a = e.getBoundingClientRect().width, o = t.getBoundingClientRect().width, s = n.getBoundingClientRect().width, c = i.getBoundingClientRect().width;
|
|
45
|
-
if (a > 0 &&
|
|
45
|
+
if (a > 0 && Re(a), o > 0 && Be(o), s > 0 && Ve(s), c > 0 && Ue(c), r) {
|
|
46
46
|
let e = r.getBoundingClientRect().width;
|
|
47
|
-
e > 0 &&
|
|
47
|
+
e > 0 && He(e);
|
|
48
48
|
}
|
|
49
49
|
}, o = new ResizeObserver(() => {
|
|
50
50
|
a();
|
|
51
51
|
});
|
|
52
52
|
return o.observe(e), o.observe(t), o.observe(n), o.observe(i), r && o.observe(r), a(), () => o.disconnect();
|
|
53
53
|
}, [E]);
|
|
54
|
-
let
|
|
54
|
+
let Ge = () => {
|
|
55
55
|
S && x.mutate({ conversationId: S });
|
|
56
|
-
},
|
|
57
|
-
S &&
|
|
58
|
-
},
|
|
56
|
+
}, Ke = () => {
|
|
57
|
+
S && ke.mutate({ conversationId: S });
|
|
58
|
+
}, qe = Oe.isPending || x.isPending, H = g.useCallback((e) => {
|
|
59
59
|
let t = e, n = {
|
|
60
60
|
showCodeInline: !1,
|
|
61
61
|
showModelInline: !1
|
|
@@ -65,25 +65,26 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
65
65
|
E,
|
|
66
66
|
F,
|
|
67
67
|
I
|
|
68
|
-
]), U = N -
|
|
68
|
+
]), U = N - ze - 8 - P - 12, W = H(U), G = (!E || W.showCodeInline) && W.showModelInline ? W : H(U - 28 - 12), K = E ? G.showCodeInline : !1, q = G.showModelInline, Je = N >= 360, J = E && !K || !q;
|
|
69
69
|
g.useEffect(() => {
|
|
70
70
|
J || (R(!1), B(null));
|
|
71
71
|
}, [J]);
|
|
72
|
-
let
|
|
72
|
+
let Ye = re(() => {
|
|
73
73
|
R(!1), B(null);
|
|
74
|
-
}), Y =
|
|
74
|
+
}), Y = Ne === r.RUNNING || Le || Me !== "OPEN", X = () => {
|
|
75
75
|
B(null), R(!1);
|
|
76
76
|
}, Z = me({
|
|
77
77
|
hasConversation: !!S,
|
|
78
|
+
hasStartedConversation: Ce,
|
|
78
79
|
isCloud: C,
|
|
79
80
|
isAcp: w.isAcpContext,
|
|
80
|
-
profilesAvailable: !
|
|
81
|
+
profilesAvailable: !je
|
|
81
82
|
}), Q = i("group", l), $ = i("text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]", l);
|
|
82
83
|
g.useLayoutEffect(() => {
|
|
83
84
|
if (!L || !M.current) return;
|
|
84
85
|
let e = M.current, t = () => {
|
|
85
86
|
let t = e.getBoundingClientRect();
|
|
86
|
-
|
|
87
|
+
We({
|
|
87
88
|
position: "fixed",
|
|
88
89
|
top: t.top - 8,
|
|
89
90
|
left: t.left,
|
|
@@ -95,21 +96,21 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
95
96
|
window.removeEventListener("resize", t), window.removeEventListener("scroll", t, !0);
|
|
96
97
|
};
|
|
97
98
|
}, [L]);
|
|
98
|
-
let
|
|
99
|
-
ref:
|
|
99
|
+
let Xe = /* @__PURE__ */ v(f, {
|
|
100
|
+
ref: Ye,
|
|
100
101
|
testId: "chat-input-overflow-menu",
|
|
101
102
|
position: "top",
|
|
102
103
|
alignment: "left",
|
|
103
104
|
className: "!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]",
|
|
104
105
|
children: [E && !K && /* @__PURE__ */ v("div", {
|
|
105
106
|
className: "relative group/overflow-agent",
|
|
106
|
-
children: [/* @__PURE__ */ _(
|
|
107
|
+
children: [/* @__PURE__ */ _(p, {
|
|
107
108
|
testId: "overflow-agent-button",
|
|
108
109
|
onClick: () => B((e) => e === "agent" ? null : "agent"),
|
|
109
110
|
isDisabled: Y,
|
|
110
111
|
children: /* @__PURE__ */ _(h, {
|
|
111
|
-
icon: /* @__PURE__ */ _(
|
|
112
|
-
text: b(
|
|
112
|
+
icon: /* @__PURE__ */ _(d, { className: "h-[11px] w-[11px]" }),
|
|
113
|
+
text: b(Pe === "code" ? t.COMMON$CODE : t.COMMON$PLAN),
|
|
113
114
|
rightIcon: /* @__PURE__ */ _(m, {
|
|
114
115
|
width: 10,
|
|
115
116
|
height: 10
|
|
@@ -117,25 +118,25 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
117
118
|
})
|
|
118
119
|
}), !Y && /* @__PURE__ */ _("div", {
|
|
119
120
|
className: i("absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]", "group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto", "hover:opacity-100 hover:visible hover:pointer-events-auto", z === "agent" && "opacity-100 visible pointer-events-auto"),
|
|
120
|
-
children: /* @__PURE__ */ v(
|
|
121
|
+
children: /* @__PURE__ */ v(f, {
|
|
121
122
|
testId: "overflow-agent-submenu",
|
|
122
123
|
className: "overflow-visible min-w-[195px]",
|
|
123
|
-
children: [/* @__PURE__ */ _(
|
|
124
|
+
children: [/* @__PURE__ */ _(p, {
|
|
124
125
|
testId: "overflow-agent-code",
|
|
125
126
|
onClick: (e) => {
|
|
126
|
-
e.preventDefault(), e.stopPropagation(),
|
|
127
|
+
e.preventDefault(), e.stopPropagation(), Fe("code"), X();
|
|
127
128
|
},
|
|
128
129
|
children: /* @__PURE__ */ _(h, {
|
|
129
|
-
icon: /* @__PURE__ */ _(
|
|
130
|
+
icon: /* @__PURE__ */ _(d, { className: "h-[11px] w-[11px]" }),
|
|
130
131
|
text: b(t.COMMON$CODE)
|
|
131
132
|
})
|
|
132
|
-
}), /* @__PURE__ */ _(
|
|
133
|
+
}), /* @__PURE__ */ _(p, {
|
|
133
134
|
testId: "overflow-agent-plan",
|
|
134
135
|
onClick: (e) => {
|
|
135
|
-
|
|
136
|
+
Ie(e), X();
|
|
136
137
|
},
|
|
137
138
|
children: /* @__PURE__ */ _(h, {
|
|
138
|
-
icon: /* @__PURE__ */ _(
|
|
139
|
+
icon: /* @__PURE__ */ _(ne, {
|
|
139
140
|
width: 16,
|
|
140
141
|
height: 16,
|
|
141
142
|
color: "currentColor"
|
|
@@ -147,7 +148,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
147
148
|
})]
|
|
148
149
|
}), !q && /* @__PURE__ */ v("div", {
|
|
149
150
|
className: "relative group/overflow-model",
|
|
150
|
-
children: [/* @__PURE__ */ _(
|
|
151
|
+
children: [/* @__PURE__ */ _(p, {
|
|
151
152
|
testId: "overflow-model-button",
|
|
152
153
|
onClick: () => B((e) => e === "model" ? null : "model"),
|
|
153
154
|
children: /* @__PURE__ */ _(h, {
|
|
@@ -165,7 +166,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
165
166
|
})
|
|
166
167
|
}), /* @__PURE__ */ _("div", {
|
|
167
168
|
className: i("absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]", "group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto", "hover:opacity-100 hover:visible hover:pointer-events-auto", z === "model" && "opacity-100 visible pointer-events-auto"),
|
|
168
|
-
children: /* @__PURE__ */ _(
|
|
169
|
+
children: /* @__PURE__ */ _(f, {
|
|
169
170
|
testId: "overflow-model-submenu",
|
|
170
171
|
className: "min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0",
|
|
171
172
|
children: Z === "model" ? /* @__PURE__ */ _(le, {
|
|
@@ -197,7 +198,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
197
198
|
className: i(!1),
|
|
198
199
|
children: /* @__PURE__ */ _(ge, {
|
|
199
200
|
disabled: y,
|
|
200
|
-
handleFileIconClick:
|
|
201
|
+
handleFileIconClick: we
|
|
201
202
|
})
|
|
202
203
|
}),
|
|
203
204
|
E && /* @__PURE__ */ _("div", {
|
|
@@ -229,7 +230,7 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
229
230
|
})
|
|
230
231
|
}), L && typeof document < "u" && V && xe.createPortal(/* @__PURE__ */ _("div", {
|
|
231
232
|
style: V,
|
|
232
|
-
children:
|
|
233
|
+
children: Xe
|
|
233
234
|
}), document.body)]
|
|
234
235
|
})
|
|
235
236
|
]
|
|
@@ -237,14 +238,14 @@ function y({ disabled: y, canSubmit: Se = !0, onAddFileClick: Ce = () => {}, sho
|
|
|
237
238
|
}), /* @__PURE__ */ v("div", {
|
|
238
239
|
ref: O,
|
|
239
240
|
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
240
|
-
children: [
|
|
241
|
-
handleStop:
|
|
242
|
-
handleResumeAgent:
|
|
241
|
+
children: [Je && S && /* @__PURE__ */ _(u, {
|
|
242
|
+
handleStop: Ge,
|
|
243
|
+
handleResumeAgent: Ke,
|
|
243
244
|
disabled: y,
|
|
244
|
-
isPausing:
|
|
245
|
-
}),
|
|
246
|
-
buttonClassName:
|
|
247
|
-
handleSubmit:
|
|
245
|
+
isPausing: qe
|
|
246
|
+
}), Te && /* @__PURE__ */ _(_e, {
|
|
247
|
+
buttonClassName: Ee,
|
|
248
|
+
handleSubmit: De,
|
|
248
249
|
disabled: y || !Se
|
|
249
250
|
})]
|
|
250
251
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-actions.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div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D;QACE,OAAO;QACP,QAAQ;QACR,OAAM;QACN,CAAA;OACK,CAAA,EAER,KACC,OAAO,WAAa,OACpB,KACA,GAAS,aACP,kBAAC,OAAD;OAAK,OAAO;iBAAsB;OAAmB,CAAA,EACrD,SAAS,KACV,CACC;;KAEJ;;GACF,CAAA,EACN,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;aAFZ,CAIG,MAAyB,KACxB,kBAAC,IAAD;IACE,YAAY;IACZ,mBAAmB;IACT;IACC;IACX,CAAA,EAEH,MACC,kBAAC,IAAD;IACmB;IACH;IACd,UAAU,KAAY,CAAC;IACvB,CAAA,CAEA;KACF"}
|
|
1
|
+
{"version":3,"file":"chat-input-actions.js","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-actions.tsx"],"sourcesContent":["import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useTranslation } from \"react-i18next\";\nimport { Cpu } from \"lucide-react\";\nimport { AgentStatus } from \"#/components/features/controls/agent-status\";\nimport { ChangeAgentButton } from \"../change-agent-button\";\nimport { ChatInputModel, ChatInputModelMenuContent } from \"./chat-input-model\";\nimport {\n ChatInputProfilePicker,\n ChatInputProfileMenuContent,\n} from \"./chat-input-profile-picker\";\nimport {\n ChatInputLlmProfilePicker,\n ChatInputLlmProfileMenuContent,\n} from \"./chat-input-llm-profile-picker\";\nimport { resolvePickerKind } from \"./resolve-picker-kind\";\nimport { ChatAddFileButton } from \"../chat-add-file-button\";\nimport { ChatSendButton } from \"../chat-send-button\";\nimport CarretRightFillIcon from \"#/icons/carret-right-fill.svg?react\";\nimport LessonPlanIcon from \"#/icons/lesson-plan.svg?react\";\nimport ThreeDotsVerticalIcon from \"#/icons/three-dots-vertical.svg?react\";\nimport { CodePillIcon } from \"#/icons/code-pill\";\nimport { useUnifiedPauseConversation } from \"#/hooks/mutation/use-unified-stop-conversation\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { usePauseConversation } from \"#/hooks/mutation/use-pause-conversation\";\nimport { useResumeConversation } from \"#/hooks/mutation/use-resume-conversation\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useChatInputModelState } from \"#/hooks/use-chat-input-model-state\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { useUnifiedWebSocketStatus } from \"#/hooks/use-unified-websocket-status\";\nimport { useHandlePlanClick } from \"#/hooks/use-handle-plan-click\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { ToolsContextMenuIconText } from \"../../controls/tools-context-menu-icon-text\";\nimport { ContextMenuListItem } from \"../../context-menu/context-menu-list-item\";\nimport { ContextMenu } from \"#/ui/context-menu\";\nimport { useClickOutsideElement } from \"#/hooks/use-click-outside-element\";\nimport { cn } from \"#/utils/utils\";\nimport {\n chatInputIconButtonClassName,\n formControlTransitionClassName,\n} from \"#/utils/form-control-classes\";\n\ninterface ChatInputActionsProps {\n disabled: boolean;\n canSubmit?: boolean;\n hasStartedConversation?: boolean;\n onAddFileClick?: () => void;\n showButton?: boolean;\n buttonClassName?: string;\n handleSubmit?: () => void;\n}\n\nexport function ChatInputActions({\n disabled,\n canSubmit = true,\n hasStartedConversation,\n onAddFileClick = () => {},\n showButton = true,\n buttonClassName = \"\",\n handleSubmit = () => {},\n}: ChatInputActionsProps) {\n const { t } = useTranslation(\"openhands\");\n const unifiedPauseMutation = useUnifiedPauseConversation();\n const pauseConversationMutation = usePauseConversation();\n const resumeConversationMutation = useResumeConversation();\n const { conversationId } = useOptionalConversationId();\n const { backend } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n const modelState = useChatInputModelState();\n // The home page defaults to the AgentProfile picker (#3727) on both local and\n // cloud (cloud gained the /api/agent-profiles surface in OpenHands #15060). A\n // backend without that surface returns none — fall back so the composer still\n // shows a model affordance instead of nothing (#1571). Only fetched on home.\n const homeAgentProfiles = useAgentProfiles({\n enabled: !conversationId,\n });\n const agentProfilesUnavailableOnHome =\n homeAgentProfiles.isFetched &&\n (homeAgentProfiles.data?.profiles?.length ?? 0) === 0;\n // Code/Plan mode switching is a cloud OpenHands feature — it doesn't apply\n // to ACP conversations (which have no \"plan\" mode), so hide it when ACP.\n const showChangeAgentButton = isCloud && !modelState.isAcpContext;\n const webSocketStatus = useUnifiedWebSocketStatus();\n const { curAgentState } = useAgentState();\n const { conversationMode, setConversationMode } = useConversationStore();\n const { handlePlanClick, isCreatingConversation } = useHandlePlanClick();\n\n const actionsRowRef = React.useRef<HTMLDivElement>(null);\n const rightSectionRef = React.useRef<HTMLDivElement>(null);\n const addFileRef = React.useRef<HTMLDivElement>(null);\n const codeRef = React.useRef<HTMLDivElement>(null);\n const modelRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n const [actionsRowWidth, setActionsRowWidth] = React.useState<number>(\n Number.POSITIVE_INFINITY,\n );\n const [rightSectionWidth, setRightSectionWidth] = React.useState(0);\n const [addFileWidth, setAddFileWidth] = React.useState(32);\n const [codeWidth, setCodeWidth] = React.useState(96);\n const [modelWidth, setModelWidth] = React.useState(120);\n const [isOverflowOpen, setIsOverflowOpen] = React.useState(false);\n const [activeSubmenu, setActiveSubmenu] = React.useState<\n \"agent\" | \"model\" | null\n >(null);\n const [overflowPortalStyle, setOverflowPortalStyle] =\n React.useState<React.CSSProperties>();\n\n React.useEffect(() => {\n const rowEl = actionsRowRef.current;\n const rightEl = rightSectionRef.current;\n const addEl = addFileRef.current;\n const codeEl = codeRef.current;\n const modelEl = modelRef.current;\n\n if (\n !rowEl ||\n !rightEl ||\n !addEl ||\n !modelEl ||\n (showChangeAgentButton && !codeEl) ||\n typeof ResizeObserver === \"undefined\"\n ) {\n return;\n }\n\n const syncWidths = () => {\n const nextRowWidth = rowEl.getBoundingClientRect().width;\n const nextRightWidth = rightEl.getBoundingClientRect().width;\n const nextAddWidth = addEl.getBoundingClientRect().width;\n const nextModelWidth = modelEl.getBoundingClientRect().width;\n\n if (nextRowWidth > 0) setActionsRowWidth(nextRowWidth);\n if (nextRightWidth > 0) setRightSectionWidth(nextRightWidth);\n if (nextAddWidth > 0) setAddFileWidth(nextAddWidth);\n if (nextModelWidth > 0) setModelWidth(nextModelWidth);\n\n if (codeEl) {\n const nextCodeWidth = codeEl.getBoundingClientRect().width;\n if (nextCodeWidth > 0) setCodeWidth(nextCodeWidth);\n }\n };\n\n const observer = new ResizeObserver(() => {\n syncWidths();\n });\n\n observer.observe(rowEl);\n observer.observe(rightEl);\n observer.observe(addEl);\n observer.observe(modelEl);\n if (codeEl) {\n observer.observe(codeEl);\n }\n\n syncWidths();\n\n return () => observer.disconnect();\n }, [showChangeAgentButton]);\n\n const handlePauseAgent = () => {\n if (!conversationId) return;\n pauseConversationMutation.mutate({ conversationId });\n };\n\n const handleResumeAgentClick = () => {\n if (!conversationId) return;\n resumeConversationMutation.mutate({ conversationId });\n };\n\n const isPausing =\n unifiedPauseMutation.isPending || pauseConversationMutation.isPending;\n\n const OVERFLOW_BUTTON_WIDTH = 28;\n const INLINE_GAP = 12;\n const ROOT_GAP = 8;\n\n const fitOptionalItems = React.useCallback(\n (availableWidth: number) => {\n let remaining = availableWidth;\n const next = {\n showCodeInline: false,\n showModelInline: false,\n };\n\n if (showChangeAgentButton && remaining >= codeWidth) {\n next.showCodeInline = true;\n remaining -= codeWidth + INLINE_GAP;\n }\n\n if (remaining >= modelWidth) {\n next.showModelInline = true;\n }\n\n return next;\n },\n [showChangeAgentButton, codeWidth, modelWidth],\n );\n\n const leftBaseWidth =\n actionsRowWidth - rightSectionWidth - ROOT_GAP - addFileWidth - INLINE_GAP;\n\n const fitWithoutOverflow = fitOptionalItems(leftBaseWidth);\n const allOptionalFit =\n (!showChangeAgentButton || fitWithoutOverflow.showCodeInline) &&\n fitWithoutOverflow.showModelInline;\n\n const fitWithOverflow = allOptionalFit\n ? fitWithoutOverflow\n : fitOptionalItems(leftBaseWidth - OVERFLOW_BUTTON_WIDTH - INLINE_GAP);\n\n const showCodeInline = !showChangeAgentButton\n ? false\n : fitWithOverflow.showCodeInline;\n const showModelInline = fitWithOverflow.showModelInline;\n const showAddFileInline = true;\n const showAgentStatusInline = actionsRowWidth >= 360;\n\n const hasOverflowItems =\n !showAddFileInline ||\n (showChangeAgentButton && !showCodeInline) ||\n !showModelInline;\n\n React.useEffect(() => {\n if (!hasOverflowItems) {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n }\n }, [hasOverflowItems]);\n\n const overflowMenuRef = useClickOutsideElement<HTMLUListElement>(() => {\n setIsOverflowOpen(false);\n setActiveSubmenu(null);\n });\n\n const isAgentSwitcherDisabled =\n curAgentState === AgentState.RUNNING ||\n isCreatingConversation ||\n webSocketStatus !== \"OPEN\";\n\n const closeOverflowMenus = () => {\n setActiveSubmenu(null);\n setIsOverflowOpen(false);\n };\n\n // Which chat-input model/profile picker to show (pure matrix, unit-tested in\n // `resolve-picker-kind.test.ts`).\n const pickerKind = resolvePickerKind({\n hasConversation: !!conversationId,\n hasStartedConversation,\n isCloud,\n isAcp: modelState.isAcpContext,\n profilesAvailable: !agentProfilesUnavailableOnHome,\n });\n\n // Shared styling for the settings link inside the overflow submenu content.\n const overflowSettingsLinkClassName = cn(\n \"group\",\n formControlTransitionClassName,\n );\n const overflowSettingsIconClassName = cn(\n \"text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)]\",\n formControlTransitionClassName,\n );\n\n React.useLayoutEffect(() => {\n if (!isOverflowOpen || !overflowTriggerRef.current) {\n return;\n }\n\n const trigger = overflowTriggerRef.current;\n\n const updatePosition = () => {\n const rect = trigger.getBoundingClientRect();\n const GAP = 8;\n setOverflowPortalStyle({\n position: \"fixed\",\n top: rect.top - GAP,\n left: rect.left,\n transform: \"translateY(-100%)\",\n zIndex: 9999,\n });\n };\n\n updatePosition();\n window.addEventListener(\"resize\", updatePosition);\n window.addEventListener(\"scroll\", updatePosition, true);\n\n return () => {\n window.removeEventListener(\"resize\", updatePosition);\n window.removeEventListener(\"scroll\", updatePosition, true);\n };\n }, [isOverflowOpen]);\n\n const overflowMenu = (\n <ContextMenu\n ref={overflowMenuRef}\n testId=\"chat-input-overflow-menu\"\n position=\"top\"\n alignment=\"left\"\n className=\"!static !top-auto !bottom-auto !left-auto !right-auto !mt-0 overflow-visible min-w-[200px]\"\n >\n {showChangeAgentButton && !showCodeInline && (\n <div className=\"relative group/overflow-agent\">\n <ContextMenuListItem\n testId=\"overflow-agent-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"agent\" ? null : \"agent\",\n )\n }\n isDisabled={isAgentSwitcherDisabled}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={\n conversationMode === \"code\"\n ? t(I18nKey.COMMON$CODE)\n : t(I18nKey.COMMON$PLAN)\n }\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n {!isAgentSwitcherDisabled && (\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-agent:opacity-100 group-hover/overflow-agent:visible group-hover/overflow-agent:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"agent\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n <ContextMenu\n testId=\"overflow-agent-submenu\"\n className=\"overflow-visible min-w-[195px]\"\n >\n <ContextMenuListItem\n testId=\"overflow-agent-code\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setConversationMode(\"code\");\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={<CodePillIcon className=\"h-[11px] w-[11px]\" />}\n text={t(I18nKey.COMMON$CODE)}\n />\n </ContextMenuListItem>\n <ContextMenuListItem\n testId=\"overflow-agent-plan\"\n onClick={(event) => {\n handlePlanClick(event);\n closeOverflowMenus();\n }}\n >\n <ToolsContextMenuIconText\n icon={\n <LessonPlanIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n }\n text={t(I18nKey.COMMON$PLAN)}\n />\n </ContextMenuListItem>\n </ContextMenu>\n </div>\n )}\n </div>\n )}\n {!showModelInline && (\n <div className=\"relative group/overflow-model\">\n <ContextMenuListItem\n testId=\"overflow-model-button\"\n onClick={() =>\n setActiveSubmenu((current) =>\n current === \"model\" ? null : \"model\",\n )\n }\n >\n <ToolsContextMenuIconText\n icon={<Cpu width={16} height={16} strokeWidth={2} aria-hidden />}\n text={t(I18nKey.SETTINGS$AGENT_MODEL)}\n rightIcon={<CarretRightFillIcon width={10} height={10} />}\n />\n </ContextMenuListItem>\n <div\n className={cn(\n \"absolute left-full top-[-4px] z-60 opacity-0 invisible pointer-events-none transition-all duration-200 ml-[1px]\",\n \"group-hover/overflow-model:opacity-100 group-hover/overflow-model:visible group-hover/overflow-model:pointer-events-auto\",\n \"hover:opacity-100 hover:visible hover:pointer-events-auto\",\n activeSubmenu === \"model\" &&\n \"opacity-100 visible pointer-events-auto\",\n )}\n >\n {/* overflow-y-auto (not overflow-visible) so a long ACP model list\n scrolls within the menu instead of overflowing the viewport.\n Safe because this menu has no floating children (tooltips /\n nested popovers) that would be clipped — only a flat model list\n + Settings link. Revisit if floating children are added here. */}\n <ContextMenu\n testId=\"overflow-model-submenu\"\n className=\"min-w-[220px] max-w-[320px] max-h-[60vh] overflow-y-auto gap-0\"\n >\n {pickerKind === \"model\" ? (\n <ChatInputModelMenuContent\n model={modelState}\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n ) : (\n <ChatInputLlmProfileMenuContent\n onClose={closeOverflowMenus}\n dividerInset=\"menu\"\n settingsLinkClassName={overflowSettingsLinkClassName}\n settingsIconClassName={overflowSettingsIconClassName}\n />\n )}\n </ContextMenu>\n </div>\n </div>\n )}\n </ContextMenu>\n );\n\n return (\n <div\n ref={actionsRowRef}\n className=\"w-full min-w-0 flex items-center justify-between gap-2\"\n >\n <div className=\"flex min-w-0 items-center gap-1\">\n <div className=\"flex min-w-0 items-center gap-3\">\n <div ref={addFileRef} className={cn(!showAddFileInline && \"hidden\")}>\n <ChatAddFileButton\n disabled={disabled}\n handleFileIconClick={onAddFileClick}\n />\n </div>\n {showChangeAgentButton && (\n <div ref={codeRef} className={cn(!showCodeInline && \"hidden\")}>\n <ChangeAgentButton />\n </div>\n )}\n <div ref={modelRef} className={cn(!showModelInline && \"hidden\")}>\n {/* Picker depends on backend + whether we're in a conversation;\n see the `pickerKind` cases above. */}\n {pickerKind === \"model\" ? (\n <ChatInputModel />\n ) : pickerKind === \"agent-profile\" ? (\n <ChatInputProfilePicker />\n ) : (\n <ChatInputLlmProfilePicker />\n )}\n </div>\n\n {hasOverflowItems && (\n <div className=\"relative shrink-0\">\n <button\n ref={overflowTriggerRef}\n type=\"button\"\n className={cn(chatInputIconButtonClassName, \"size-6\")}\n aria-label={t(I18nKey.CHAT_INTERFACE$MORE_INPUT_ACTIONS)}\n aria-expanded={isOverflowOpen}\n aria-haspopup=\"menu\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsOverflowOpen((open) => !open);\n }}\n >\n <ThreeDotsVerticalIcon\n width={16}\n height={16}\n color=\"currentColor\"\n />\n </button>\n\n {isOverflowOpen &&\n typeof document !== \"undefined\" &&\n overflowPortalStyle &&\n ReactDOM.createPortal(\n <div style={overflowPortalStyle}>{overflowMenu}</div>,\n document.body,\n )}\n </div>\n )}\n </div>\n </div>\n <div\n ref={rightSectionRef}\n className=\"ml-auto flex shrink-0 items-center gap-2\"\n >\n {showAgentStatusInline && conversationId && (\n <AgentStatus\n handleStop={handlePauseAgent}\n handleResumeAgent={handleResumeAgentClick}\n disabled={disabled}\n isPausing={isPausing}\n />\n )}\n {showButton && (\n <ChatSendButton\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n disabled={disabled || !canSubmit}\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,EAAiB,EAC/B,aACA,gBAAY,IACZ,4BACA,2BAAuB,IACvB,iBAAa,IACb,sBAAkB,IAClB,yBAAqB,MACG;CACxB,IAAM,EAAE,SAAM,EAAe,YAAY,EACnC,KAAuB,IAA6B,EACpD,IAA4B,IAAsB,EAClD,KAA6B,IAAuB,EACpD,EAAE,sBAAmB,GAA2B,EAChD,EAAE,gBAAY,GAAkB,EAChC,IAAU,GAAQ,SAAS,SAC3B,IAAa,IAAwB,EAKrC,IAAoB,GAAiB,EACzC,SAAS,CAAC,GACX,CAAC,EACI,KACJ,EAAkB,cACjB,EAAkB,MAAM,UAAU,UAAU,OAAO,GAGhD,IAAwB,KAAW,CAAC,EAAW,cAC/C,KAAkB,IAA2B,EAC7C,EAAE,sBAAkB,GAAe,EACnC,EAAE,sBAAkB,4BAAwB,GAAsB,EAClE,EAAE,qBAAiB,+BAA2B,IAAoB,EAElE,IAAgB,EAAM,OAAuB,KAAK,EAClD,IAAkB,EAAM,OAAuB,KAAK,EACpD,IAAa,EAAM,OAAuB,KAAK,EAC/C,IAAU,EAAM,OAAuB,KAAK,EAC5C,IAAW,EAAM,OAAuB,KAAK,EAC7C,IAAqB,EAAM,OAA0B,KAAK,EAC1D,CAAC,GAAiB,MAAsB,EAAM,SAClD,SACD,EACK,CAAC,IAAmB,MAAwB,EAAM,SAAS,EAAE,EAC7D,CAAC,GAAc,MAAmB,EAAM,SAAS,GAAG,EACpD,CAAC,GAAW,MAAgB,EAAM,SAAS,GAAG,EAC9C,CAAC,GAAY,MAAiB,EAAM,SAAS,IAAI,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AAW,EAAG,IAA8B,SAAS;OACrD,cAAY,EAAE,EAAQ,kCAAkC;OACxD,iBAAe;OACf,iBAAc;OACd,UAAU,MAAU;AAGlB,QAFA,EAAM,gBAAgB,EACtB,EAAM,iBAAiB,EACvB,GAAmB,MAAS,CAAC,EAAK;;iBAGpC,kBAAC,IAAD;QACE,OAAO;QACP,QAAQ;QACR,OAAM;QACN,CAAA;OACK,CAAA,EAER,KACC,OAAO,WAAa,OACpB,KACA,GAAS,aACP,kBAAC,OAAD;OAAK,OAAO;iBAAsB;OAAmB,CAAA,EACrD,SAAS,KACV,CACC;;KAEJ;;GACF,CAAA,EACN,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;aAFZ,CAIG,MAAyB,KACxB,kBAAC,GAAD;IACE,YAAY;IACZ,mBAAmB;IACT;IACC;IACX,CAAA,EAEH,MACC,kBAAC,IAAD;IACmB;IACH;IACd,UAAU,KAAY,CAAC;IACvB,CAAA,CAEA;KACF"}
|
|
@@ -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(`../drag-over.cjs`),i=require(`../uploaded-files.cjs`),a=require(`./chat-input-row.cjs`),o=require(`./chat-input-actions.cjs`),s=require(`./slash-command-menu.cjs`);let c=require(`react`);c=e.__toESM(c,1);let l=require(`react/jsx-runtime`);function u({chatContainerRef:e,isDragOver:c,disabled:u,canSubmit:d,isNewConversationPending:
|
|
1
|
+
const e=require(`../../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../../utils/utils.cjs`),n=require(`../../../../stores/conversation-store.cjs`),r=require(`../drag-over.cjs`),i=require(`../uploaded-files.cjs`),a=require(`./chat-input-row.cjs`),o=require(`./chat-input-actions.cjs`),s=require(`./slash-command-menu.cjs`);let c=require(`react`);c=e.__toESM(c,1);let l=require(`react/jsx-runtime`);function u({chatContainerRef:e,isDragOver:c,disabled:u,canSubmit:d,hasStartedConversation:f,isNewConversationPending:p=!1,showButton:m,buttonClassName:h,chatInputRef:g,handleFileIconClick:_,handleSubmit:v,onDragOver:y,onDragLeave:b,onDrop:x,onInput:S,onPaste:C,onKeyDown:w,onFocus:T,onBlur:E,isSlashMenuOpen:D=!1,slashItems:O=[],slashSelectedIndex:k=0,onSlashSelect:A}){return(0,l.jsxs)(`div`,{ref:e,className:t.cn(`bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full`,n.useConversationStore(e=>e.conversationMode)===`plan`&&`border border-[#597FF4]`),onDragOver:e=>y(e,u),onDragLeave:e=>b(e,u),onDrop:e=>x(e,u),children:[c&&(0,l.jsx)(r.DragOver,{}),(0,l.jsx)(i.UploadedFiles,{}),(0,l.jsxs)(`div`,{className:`relative w-full`,children:[D&&A&&(0,l.jsx)(s.SlashCommandMenu,{items:O,selectedIndex:k,onSelect:A}),(0,l.jsx)(a.ChatInputRow,{chatInputRef:g,isNewConversationPending:p,onInput:S,onPaste:C,onKeyDown:w,onFocus:T,onBlur:E})]}),(0,l.jsx)(o.ChatInputActions,{disabled:u,canSubmit:d,hasStartedConversation:f,onAddFileClick:()=>_(u),showButton:m,buttonClassName:h,handleSubmit:v})]})}exports.ChatInputContainer=u;
|
|
2
2
|
//# sourceMappingURL=chat-input-container.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-input-container.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-container.tsx"],"sourcesContent":["import React from \"react\";\nimport { DragOver } from \"../drag-over\";\nimport { UploadedFiles } from \"../uploaded-files\";\nimport { ChatInputRow } from \"./chat-input-row\";\nimport { ChatInputActions } from \"./chat-input-actions\";\nimport { SlashCommandMenu } from \"./slash-command-menu\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\nimport { SlashCommandItem } from \"#/hooks/chat/use-slash-command\";\n\ninterface ChatInputContainerProps {\n chatContainerRef: React.RefObject<HTMLDivElement | null>;\n isDragOver: boolean;\n disabled: boolean;\n canSubmit: boolean;\n isNewConversationPending?: boolean;\n showButton: boolean;\n buttonClassName: string;\n chatInputRef: React.RefObject<HTMLDivElement | null>;\n handleFileIconClick: (isDisabled: boolean) => void;\n handleSubmit: () => void;\n onDragOver: (e: React.DragEvent, isDisabled: boolean) => void;\n onDragLeave: (e: React.DragEvent, isDisabled: boolean) => void;\n onDrop: (e: React.DragEvent, isDisabled: boolean) => void;\n onInput: () => void;\n onPaste: (e: React.ClipboardEvent) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n isSlashMenuOpen?: boolean;\n slashItems?: SlashCommandItem[];\n slashSelectedIndex?: number;\n onSlashSelect?: (item: SlashCommandItem) => void;\n}\n\nexport function ChatInputContainer({\n chatContainerRef,\n isDragOver,\n disabled,\n canSubmit,\n isNewConversationPending = false,\n showButton,\n buttonClassName,\n chatInputRef,\n handleFileIconClick,\n handleSubmit,\n onDragOver,\n onDragLeave,\n onDrop,\n onInput,\n onPaste,\n onKeyDown,\n onFocus,\n onBlur,\n isSlashMenuOpen = false,\n slashItems = [],\n slashSelectedIndex = 0,\n onSlashSelect,\n}: ChatInputContainerProps) {\n const conversationMode = useConversationStore(\n (state) => state.conversationMode,\n );\n\n return (\n <div\n ref={chatContainerRef}\n className={cn(\n \"bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full\",\n conversationMode === \"plan\" && \"border border-[#597FF4]\",\n )}\n onDragOver={(e) => onDragOver(e, disabled)}\n onDragLeave={(e) => onDragLeave(e, disabled)}\n onDrop={(e) => onDrop(e, disabled)}\n >\n {/* Drag Over UI */}\n {isDragOver && <DragOver />}\n\n <UploadedFiles />\n\n {/* Wrapper so the slash menu anchors just above the input row,\n not above the entire (possibly resized) container */}\n <div className=\"relative w-full\">\n {isSlashMenuOpen && onSlashSelect && (\n <SlashCommandMenu\n items={slashItems}\n selectedIndex={slashSelectedIndex}\n onSelect={onSlashSelect}\n />\n )}\n\n <ChatInputRow\n chatInputRef={chatInputRef}\n isNewConversationPending={isNewConversationPending}\n onInput={onInput}\n onPaste={onPaste}\n onKeyDown={onKeyDown}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </div>\n\n <ChatInputActions\n disabled={disabled}\n canSubmit={canSubmit}\n onAddFileClick={() => handleFileIconClick(disabled)}\n showButton={showButton}\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n />\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-input-container.cjs","names":[],"sources":["../../../../../src/components/features/chat/components/chat-input-container.tsx"],"sourcesContent":["import React from \"react\";\nimport { DragOver } from \"../drag-over\";\nimport { UploadedFiles } from \"../uploaded-files\";\nimport { ChatInputRow } from \"./chat-input-row\";\nimport { ChatInputActions } from \"./chat-input-actions\";\nimport { SlashCommandMenu } from \"./slash-command-menu\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { cn } from \"#/utils/utils\";\nimport { SlashCommandItem } from \"#/hooks/chat/use-slash-command\";\n\ninterface ChatInputContainerProps {\n chatContainerRef: React.RefObject<HTMLDivElement | null>;\n isDragOver: boolean;\n disabled: boolean;\n canSubmit: boolean;\n hasStartedConversation?: boolean;\n isNewConversationPending?: boolean;\n showButton: boolean;\n buttonClassName: string;\n chatInputRef: React.RefObject<HTMLDivElement | null>;\n handleFileIconClick: (isDisabled: boolean) => void;\n handleSubmit: () => void;\n onDragOver: (e: React.DragEvent, isDisabled: boolean) => void;\n onDragLeave: (e: React.DragEvent, isDisabled: boolean) => void;\n onDrop: (e: React.DragEvent, isDisabled: boolean) => void;\n onInput: () => void;\n onPaste: (e: React.ClipboardEvent) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n onFocus?: () => void;\n onBlur?: () => void;\n isSlashMenuOpen?: boolean;\n slashItems?: SlashCommandItem[];\n slashSelectedIndex?: number;\n onSlashSelect?: (item: SlashCommandItem) => void;\n}\n\nexport function ChatInputContainer({\n chatContainerRef,\n isDragOver,\n disabled,\n canSubmit,\n hasStartedConversation,\n isNewConversationPending = false,\n showButton,\n buttonClassName,\n chatInputRef,\n handleFileIconClick,\n handleSubmit,\n onDragOver,\n onDragLeave,\n onDrop,\n onInput,\n onPaste,\n onKeyDown,\n onFocus,\n onBlur,\n isSlashMenuOpen = false,\n slashItems = [],\n slashSelectedIndex = 0,\n onSlashSelect,\n}: ChatInputContainerProps) {\n const conversationMode = useConversationStore(\n (state) => state.conversationMode,\n );\n\n return (\n <div\n ref={chatContainerRef}\n className={cn(\n \"bg-[var(--oh-surface)] box-border content-stretch flex flex-col items-start justify-center p-4 relative rounded-[15px] w-full\",\n conversationMode === \"plan\" && \"border border-[#597FF4]\",\n )}\n onDragOver={(e) => onDragOver(e, disabled)}\n onDragLeave={(e) => onDragLeave(e, disabled)}\n onDrop={(e) => onDrop(e, disabled)}\n >\n {/* Drag Over UI */}\n {isDragOver && <DragOver />}\n\n <UploadedFiles />\n\n {/* Wrapper so the slash menu anchors just above the input row,\n not above the entire (possibly resized) container */}\n <div className=\"relative w-full\">\n {isSlashMenuOpen && onSlashSelect && (\n <SlashCommandMenu\n items={slashItems}\n selectedIndex={slashSelectedIndex}\n onSelect={onSlashSelect}\n />\n )}\n\n <ChatInputRow\n chatInputRef={chatInputRef}\n isNewConversationPending={isNewConversationPending}\n onInput={onInput}\n onPaste={onPaste}\n onKeyDown={onKeyDown}\n onFocus={onFocus}\n onBlur={onBlur}\n />\n </div>\n\n <ChatInputActions\n disabled={disabled}\n canSubmit={canSubmit}\n hasStartedConversation={hasStartedConversation}\n onAddFileClick={() => handleFileIconClick(disabled)}\n showButton={showButton}\n buttonClassName={buttonClassName}\n handleSubmit={handleSubmit}\n />\n </div>\n );\n}\n"],"mappings":"wZAoCA,SAAgB,EAAmB,CACjC,mBACA,aACA,WACA,YACA,yBACA,2BAA2B,GAC3B,aACA,kBACA,eACA,sBACA,eACA,aACA,cACA,SACA,UACA,UACA,YACA,UACA,SACA,kBAAkB,GAClB,aAAa,EAAE,CACf,qBAAqB,EACrB,iBAC0B,CAK1B,OACE,EAAA,EAAA,MAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAA,GACT,gIARmB,EAAA,qBACtB,GAAU,EAAM,iBAQb,GAAqB,QAAU,0BAChC,CACD,WAAa,GAAM,EAAW,EAAG,EAAS,CAC1C,YAAc,GAAM,EAAY,EAAG,EAAS,CAC5C,OAAS,GAAM,EAAO,EAAG,EAAS,UARpC,CAWG,IAAc,EAAA,EAAA,KAAC,EAAA,SAAD,EAAY,CAAA,EAE3B,EAAA,EAAA,KAAC,EAAA,cAAD,EAAiB,CAAA,EAIjB,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,2BAAf,CACG,GAAmB,IAClB,EAAA,EAAA,KAAC,EAAA,iBAAD,CACE,MAAO,EACP,cAAe,EACf,SAAU,EACV,CAAA,EAGJ,EAAA,EAAA,KAAC,EAAA,aAAD,CACgB,eACY,2BACjB,UACA,UACE,YACF,UACD,SACR,CAAA,CACE,IAEN,EAAA,EAAA,KAAC,EAAA,iBAAD,CACY,WACC,YACa,yBACxB,mBAAsB,EAAoB,EAAS,CACvC,aACK,kBACH,eACd,CAAA,CACE"}
|