@openhands/agent-canvas 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-BkL3HWa3.js → acp-providers-D1PORKc0.js} +1 -1
- package/build/assets/active-backend-context-IqOjobNK.js +2 -0
- package/build/assets/{agent-context-settings-Bno1nwPL.js → agent-context-settings-DMrObcIS.js} +1 -1
- package/build/assets/agent-profiles-settings-DororXN5.js +1 -0
- package/build/assets/agent-server-conversation-service.api-DWBe0rbX.js +86 -0
- package/build/assets/{agent-settings-h8hQz-IU.js → agent-settings-BJVk92PU.js} +1 -1
- package/build/assets/agent-settings-COfJsQ1d.js +1 -0
- package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-CzZsm7ms.js} +1 -1
- package/build/assets/{api-key-entry-screen-Qsb83VX1.js → api-key-entry-screen-D8Fade_-.js} +1 -1
- package/build/assets/app-settings-CpyGB3AT.js +1 -0
- package/build/assets/{automation-detail-7LkL91j9.js → automation-detail-B-jQ39Mm.js} +1 -1
- package/build/assets/{automation-export-U2QNyNy6.js → automation-export-B1dywoqk.js} +1 -1
- package/build/assets/{automation-setup-route-Bel9_Lue.js → automation-setup-route-C-bWUZBi.js} +1 -1
- package/build/assets/{automation-templates-CRLDssaI.js → automation-templates-DgpCGOJV.js} +1 -1
- package/build/assets/{automations-list-B2iV3ZKW.js → automations-list-DnMxlxsL.js} +1 -1
- package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-HHEneWMw.js} +1 -1
- package/build/assets/backend-form-modal-DiVrD4Cm.js +1 -0
- package/build/assets/{backend-synced-settings-badge-DB4717Iu.js → backend-synced-settings-badge-7MIjpr8M.js} +1 -1
- package/build/assets/{badge-yR53enbU.js → badge-CpYmcVZV.js} +1 -1
- package/build/assets/{base-modal-3NmIOKDm.js → base-modal-Fnh6Uln9.js} +1 -1
- package/build/assets/bot-BQZx8e2i.js +1 -0
- package/build/assets/{brand-button-CJcwjnfb.js → brand-button-swT1RyO0.js} +1 -1
- package/build/assets/browser-B9AbV6kG.js +7 -0
- package/build/assets/{browser-tab-A94o33Vn.js → browser-tab-zAY12m_i.js} +1 -1
- package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-DsJtivmL.js} +1 -1
- package/build/assets/check-WAFXrrs_.js +1 -0
- package/build/assets/chevron-down-CifNWzme.js +1 -0
- package/build/assets/circle-check-CtnimJa8.js +1 -0
- package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-Cuzx55bo.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-CBQdPZl_.js → cloud-funnel-analytics-86CwNdSh.js} +1 -1
- package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-D0fRotFi.js} +1 -1
- package/build/assets/{command-menu-PsRXVBz2.js → command-menu-BXy03FBl.js} +1 -1
- package/build/assets/{condenser-settings-w7L3EFvm.js → condenser-settings-BmZa0ui_.js} +1 -1
- package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-BgoN6lbN.js} +1 -1
- package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-Bq02tc-P.js} +1 -1
- package/build/assets/conversation-BPo8SvLN.js +1 -0
- package/build/assets/conversation-CPCVsCUY.js +90 -0
- package/build/assets/conversation-panel-BPo8SvLN.js +1 -0
- package/build/assets/{conversation-state-store-Bs8gA263.js → conversation-state-store-C5YpjMNy.js} +1 -1
- package/build/assets/conversation-store-Blc5xysY.js +6 -0
- package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-CMqo_0Bd.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-Cg1pF0xn.js} +1 -1
- package/build/assets/{device-verify-BIjXeW9N.js → device-verify-BfQLgNyq.js} +1 -1
- package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-BIqQr5mx.js} +1 -1
- package/build/assets/{entry.client-DzbDyLkV.js → entry.client-CxFjRYqH.js} +2 -2
- package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-C_yV4_bo.js} +1 -1
- package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-Bi4qbh2g.js} +1 -1
- package/build/assets/{extensions-hub-DOmHPGTA.js → extensions-hub-BqUINAhp.js} +1 -1
- package/build/assets/{extensions-navigation-6zU5M1pa.js → extensions-navigation-lraj88Wk.js} +1 -1
- package/build/assets/external-link-CgtpA_a1.js +1 -0
- package/build/assets/{file-text-RecuaId_.js → file-text-DEK4LSVw.js} +1 -1
- package/build/assets/files-tab-DV0L-lFE.js +1 -0
- package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-7yFSQJq_.js} +1 -1
- package/build/assets/format-model-name-BN_rx1Y3.js +1 -0
- package/build/assets/{format-relative-time-DGPQlPx0.js → format-relative-time-DSErAuVr.js} +1 -1
- package/build/assets/git-provider-icon-BvlLAche.js +1 -0
- package/build/assets/{git-repo-dropdown-B7RvO70z.js → git-repo-dropdown-ByMzpNko.js} +1 -1
- package/build/assets/git-repo-dropdown-C6R7hgM8.js +1 -0
- package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_sfncLZ.js} +1 -1
- package/build/assets/{home-DEZaZqYv.js → home-BOrlwLqG.js} +1 -1
- package/build/assets/home-BvMNC6E-.js +1 -0
- package/build/assets/{home-store-D7CjMN_-.js → home-store-CxqsY9Fi.js} +1 -1
- package/build/assets/index-home-BvMNC6E-.js +1 -0
- package/build/assets/info-BRVcJAUg.js +1 -0
- package/build/assets/{install-server-modal-BTwK5lbi.js → install-server-modal-Bl4G1zF4.js} +1 -1
- package/build/assets/{kebab-menu-item-content-C4CkeiJO.js → kebab-menu-item-content-BGoGFEAg.js} +1 -1
- package/build/assets/{launch-DVlx4v9o.js → launch-CkqiSCqi.js} +1 -1
- package/build/assets/{list-todo-CheUtB7F.js → list-todo-DNWlzfaM.js} +1 -1
- package/build/assets/llm-not-configured-banner-DLw_tu-G.js +27 -0
- package/build/assets/llm-settings-B-pkVCrt.js +1 -0
- package/build/assets/llm-settings-DSC0-IQ7.js +1 -0
- package/build/assets/llm-subscription-service-BAdOl5Xx.js +1 -0
- package/build/assets/loader-circle-B47W9XqT.js +1 -0
- package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-xhnrGP4Y.js} +1 -1
- package/build/assets/{manage-backends-modal-HNWKLYhq.js → manage-backends-modal-DhGk5mJt.js} +1 -1
- package/build/assets/manifest-653b89aa.js +1 -0
- package/build/assets/{manifest-subpage-layout-D-m-h8_t.js → manifest-subpage-layout-CKWvL2ig.js} +1 -1
- package/build/assets/{map-provider-7Bp2aih5.js → map-provider-Mx8mZuE-.js} +1 -1
- package/build/assets/markdown-renderer-DUmk7pFc.js +8 -0
- package/build/assets/{mcp-gLgPP7AS.js → mcp-DCkvl6K0.js} +2 -2
- package/build/assets/mcp-marketplace-utils-DEbMXlQr.js +1 -0
- package/build/assets/messages-DSXvyc21.js +40 -0
- package/build/assets/{modal-body-duRaxj_K.js → modal-body-gIe21fDv.js} +1 -1
- package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D66dlgZ7.js} +1 -1
- package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-B6iOGYpI.js} +1 -1
- package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-BYX1Pw5W.js} +1 -1
- package/build/assets/{npm-DRzJF5Zn.js → npm-DLckoeJc.js} +1 -1
- package/build/assets/{onboarding-DSr8hOpk.js → onboarding-D7WDG66N.js} +1 -1
- package/build/assets/{onboarding-modal-C6Euf7N4.js → onboarding-modal-C_xVrFNv.js} +1 -1
- package/build/assets/{organization-service.api-C4GYWwj9.js → organization-service.api-D-s9z18a.js} +1 -1
- package/build/assets/pencil-BGOCPRyu.js +1 -0
- package/build/assets/{planner-tab-CZcguxTK.js → planner-tab-AKaXIIfg.js} +1 -1
- package/build/assets/{plugins-management-service-BmDzOQsd.js → plugins-management-service-wtmY4QQw.js} +1 -1
- package/build/assets/plus-zNEL8rcX.js +1 -0
- package/build/assets/{profiles-service.api-CoLTwjc1.js → profiles-service.api-DCMYxHMi.js} +1 -1
- package/build/assets/{providers-tBzTpz1w.js → providers-BjrtjX4L.js} +1 -1
- package/build/assets/{proxy-DCI9S-LA.js → proxy-9Z_WZggZ.js} +1 -1
- package/build/assets/{puzzle-B3v361yY.js → puzzle-BWLmN8z4.js} +1 -1
- package/build/assets/recommended-automations-launcher-CFlzhu1o.js +1 -0
- package/build/assets/refresh-cw-CXtFWpwv.js +1 -0
- package/build/assets/root-CanxKlNV.css +1 -0
- package/build/assets/root-DkfG_UWR.js +2 -0
- package/build/assets/root-layout-D75LHYhh.js +2 -0
- package/build/assets/{schema-field-zhsVDllR.js → schema-field-OnM5Uob_.js} +1 -1
- package/build/assets/{sdk-section-page-CS4GWn0y.js → sdk-section-page-m5WQm2sy.js} +1 -1
- package/build/assets/search-CycosyjN.js +1 -0
- package/build/assets/{secrets-service-DjgGduXk.js → secrets-service-B26R61C1.js} +1 -1
- package/build/assets/{secrets-settings-f-qahfbi.js → secrets-settings-CbLYCKOX.js} +1 -1
- package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DCspm2U5.js} +1 -1
- package/build/assets/{settings-DQd0xLEw.js → settings-BJQI_iBM.js} +1 -1
- package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-BI8V_Nov.js} +1 -1
- package/build/assets/{settings-index-BVwy9JEp.js → settings-index-BiTqJoH7.js} +1 -1
- package/build/assets/{settings-input-D61Vzp9e.js → settings-input-Cz62hWVW.js} +1 -1
- package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-z_3FW5H3.js} +1 -1
- package/build/assets/{settings-modal-D6D5ngET.js → settings-modal-BIrIVn97.js} +1 -1
- package/build/assets/{settings-service.api-DZp7E7A9.js → settings-service.api--rJmnuLa.js} +1 -1
- package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-BRsSI8Vs.js} +1 -1
- package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-Ba7vel6T.js} +1 -1
- package/build/assets/shared-conversation-CQK_PqHx.js +1 -0
- package/build/assets/shield-check-T3JsDJiM.js +1 -0
- package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-Bhi3hVcu.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-OoZBHxaT.js → sidebar-mobile-menu-toggle-YWJNRN4p.js} +1 -1
- package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-BSUlY5Ml.js} +1 -1
- package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-Cl1cUv_F.js} +1 -1
- package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-BXz8L8Rn.js} +1 -1
- package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-QgfKv31M.js} +1 -1
- package/build/assets/{skill-scope-B1Per5XI.js → skill-scope-Dc3JPW-8.js} +1 -1
- package/build/assets/{skills-plugins-B3AO6sMz.js → skills-plugins-CpTV27n3.js} +1 -1
- package/build/assets/{skills-settings-DmmgJ6CT.js → skills-settings-CSW__IW4.js} +1 -1
- package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-TJ0mdECe.js} +1 -1
- package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-BUMSbgrF.js} +1 -1
- package/build/assets/{task-list-tab-C19Q_JNf.js → task-list-tab-mAHMOkUz.js} +1 -1
- package/build/assets/{terminal-CbuMRYal.js → terminal-BzxBaHx2.js} +1 -1
- package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-O5v1FgxW.js} +1 -1
- package/build/assets/trash-2-C0xNVp9c.js +1 -0
- package/build/assets/{typography-D9tiHct7.js → typography-NOKSk9_R.js} +1 -1
- package/build/assets/usage-tab-tEmVN0KD.js +1 -0
- package/build/assets/{use-acp-credential-form-DJmmJKMo.js → use-acp-credential-form-BPNi0Zbm.js} +1 -1
- package/build/assets/{use-activate-agent-profile-CeFfYwu_.js → use-activate-agent-profile-D9YRQPTF.js} +1 -1
- package/build/assets/{use-agent-profiles-BHLkLbRR.js → use-agent-profiles-Cb2zUW3l.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Bu4y8gSx.js → use-can-manage-org-profiles-Dxzq2AEd.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-QD9x3ySO.js → use-cloud-current-user-id-Co2eJk2A.js} +1 -1
- package/build/assets/{use-config-CPwqciXN.js → use-config-DKAMiI5R.js} +1 -1
- package/build/assets/use-create-conversation-CoHTiCbI.js +1 -0
- package/build/assets/{use-create-secret-BsOfOLvg.js → use-create-secret-2zBlCDsF.js} +1 -1
- package/build/assets/use-is-authed-C52-ivnB.js +1 -0
- package/build/assets/{use-is-creating-conversation-CVefC9Ns.js → use-is-creating-conversation-DdaAE6jV.js} +1 -1
- package/build/assets/{use-launch-skill-in-chat-BcKNjxxd.js → use-launch-skill-in-chat-COnDpxCQ.js} +1 -1
- package/build/assets/use-llm-profiles-C_BHue65.js +1 -0
- package/build/assets/{use-manifest-capabilities-DBYPjyV6.js → use-manifest-capabilities-DPrQsaPP.js} +1 -1
- package/build/assets/{use-onboarding-completion-CtNJxkXG.js → use-onboarding-completion-CCE8OQgV.js} +1 -1
- package/build/assets/{use-plugins-marketplace-ZEA-gyM9.js → use-plugins-marketplace-CEiak69h.js} +1 -1
- package/build/assets/use-save-agent-profile-DK9idD6a.js +1 -0
- package/build/assets/{use-save-settings-pSjRhD_m.js → use-save-settings-DNmnbG6f.js} +1 -1
- package/build/assets/{use-settings-nav-items-CQgkxUbV.js → use-settings-nav-items-BlFL7YhM.js} +1 -1
- package/build/assets/{use-settings-BHWsOcIG.js → use-settings-wCwPaSIv.js} +1 -1
- package/build/assets/{use-tracking-CGCsBWhg.js → use-tracking-CVwPmhlX.js} +1 -1
- package/build/assets/{use-user-conversation-DRfEU8x0.js → use-user-conversation-DVtfg0B_.js} +1 -1
- package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-p1xq35r2.js} +1 -1
- package/build/assets/{useMutation-ChpkYxI5.js → useMutation-BFDQmgk9.js} +1 -1
- package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-DF1NAAeC.js} +1 -1
- package/build/assets/{useQuery-BCnzy4LX.js → useQuery-DRv--6bK.js} +1 -1
- package/build/assets/utils-zxEjKE70.js +1 -0
- package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js} +3 -3
- package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-D9wR9yM2.js} +1 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js +13 -0
- package/build/assets/vendor~root-layout-C-IgVx6e.js +1 -0
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js} +2 -2
- package/build/assets/{verification-settings-BItwt998.js → verification-settings-B8UMQ7MG.js} +1 -1
- package/build/assets/{wrench-B1_H-tL1.js → wrench-DIka3hCq.js} +1 -1
- package/build/assets/x-BWKA2Ver.js +1 -0
- package/build/assets/zap-DHddTPc0.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +28 -1
- package/build/locales/ca/openhands.json +28 -1
- package/build/locales/de/openhands.json +28 -1
- package/build/locales/en/openhands.json +28 -1
- package/build/locales/es/openhands.json +28 -1
- package/build/locales/fr/openhands.json +28 -1
- package/build/locales/it/openhands.json +28 -1
- package/build/locales/ja/openhands.json +28 -1
- package/build/locales/ko-KR/openhands.json +28 -1
- package/build/locales/no/openhands.json +28 -1
- package/build/locales/pt/openhands.json +28 -1
- package/build/locales/tr/openhands.json +28 -1
- package/build/locales/uk/openhands.json +28 -1
- package/build/locales/zh-CN/openhands.json +28 -1
- package/build/locales/zh-TW/openhands.json +28 -1
- package/config/defaults.json +3 -3
- package/dist/api/agent-server-compatibility.cjs +1 -1
- package/dist/api/agent-server-compatibility.cjs.map +1 -1
- package/dist/api/agent-server-compatibility.js +1 -1
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +24 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +116 -97
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/llm-balance-service.cjs +2 -0
- package/dist/api/llm-balance-service.cjs.map +1 -0
- package/dist/api/llm-balance-service.d.ts +33 -0
- package/dist/api/llm-balance-service.js +53 -0
- package/dist/api/llm-balance-service.js.map +1 -0
- package/dist/api/llm-subscription-service.cjs +1 -1
- package/dist/api/llm-subscription-service.cjs.map +1 -1
- package/dist/api/llm-subscription-service.js +42 -34
- package/dist/api/llm-subscription-service.js.map +1 -1
- package/dist/components/conversation/index.cjs +1 -1
- package/dist/components/conversation/index.d.ts +0 -1
- package/dist/components/conversation/index.js +0 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +24 -23
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
- package/dist/components/conversation-events/chat/group-events.cjs +1 -1
- package/dist/components/conversation-events/chat/group-events.cjs.map +1 -1
- package/dist/components/conversation-events/chat/group-events.d.ts +3 -3
- package/dist/components/conversation-events/chat/group-events.js +27 -26
- package/dist/components/conversation-events/chat/group-events.js.map +1 -1
- package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +123 -118
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-grip.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-grip.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-grip.d.ts +2 -1
- package/dist/components/features/chat/components/chat-input-grip.js +7 -7
- package/dist/components/features/chat/components/chat-input-grip.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +61 -60
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
- package/dist/components/features/chat/components/context-window-meter.cjs +2 -0
- package/dist/components/features/chat/components/context-window-meter.cjs.map +1 -0
- package/dist/components/features/chat/components/context-window-meter.d.ts +2 -0
- package/dist/components/features/chat/components/context-window-meter.js +131 -0
- package/dist/components/features/chat/components/context-window-meter.js.map +1 -0
- package/dist/components/features/chat/components/context-window-ring.cjs +2 -0
- package/dist/components/features/chat/components/context-window-ring.cjs.map +1 -0
- package/dist/components/features/chat/components/context-window-ring.d.ts +26 -0
- package/dist/components/features/chat/components/context-window-ring.js +45 -0
- package/dist/components/features/chat/components/context-window-ring.js.map +1 -0
- package/dist/components/features/chat/custom-chat-input.cjs +1 -1
- package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
- package/dist/components/features/chat/custom-chat-input.js +68 -67
- package/dist/components/features/chat/custom-chat-input.js.map +1 -1
- package/dist/components/features/chat/model-messages.cjs +1 -1
- package/dist/components/features/chat/model-messages.cjs.map +1 -1
- package/dist/components/features/chat/model-messages.js +26 -25
- package/dist/components/features/chat/model-messages.js.map +1 -1
- package/dist/components/features/chat/path-component.cjs +1 -1
- package/dist/components/features/chat/path-component.cjs.map +1 -1
- package/dist/components/features/chat/path-component.js +9 -6
- package/dist/components/features/chat/path-component.js.map +1 -1
- package/dist/components/features/chat/plan-preview.cjs +1 -1
- package/dist/components/features/chat/plan-preview.js +4 -4
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.d.ts +0 -8
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +92 -50
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +7 -2
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +15 -9
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs +2 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs.map +1 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.d.ts +20 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js +76 -0
- package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js.map +1 -0
- package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
- package/dist/components/features/controls/server-status-context-menu.cjs.map +1 -1
- package/dist/components/features/controls/server-status-context-menu.d.ts +5 -3
- package/dist/components/features/controls/server-status-context-menu.js +8 -8
- package/dist/components/features/controls/server-status-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.js +58 -61
- package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.js +74 -46
- package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
- package/dist/components/features/conversation/conversation-name.cjs +1 -1
- package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name.js +69 -71
- package/dist/components/features/conversation/conversation-name.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js +7 -6
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +92 -86
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +81 -71
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.cjs +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.cjs.map +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.js +6 -6
- package/dist/components/features/conversation/metrics-modal/cost-section.js.map +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.cjs +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.cjs.map +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +2 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.js +10 -9
- package/dist/components/features/conversation/metrics-modal/metric-row.js.map +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.cjs +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.cjs.map +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.js +2 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.js.map +1 -1
- package/dist/components/features/conversation/usage-panel/compact-context-button.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.d.ts +16 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.js +59 -0
- package/dist/components/features/conversation/usage-panel/compact-context-button.js.map +1 -0
- package/dist/components/features/conversation/usage-panel/context-meter.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/context-meter.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/context-meter.d.ts +19 -0
- package/dist/components/features/conversation/usage-panel/context-meter.js +46 -0
- package/dist/components/features/conversation/usage-panel/context-meter.js.map +1 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.d.ts +7 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.js +57 -0
- package/dist/components/features/conversation/usage-panel/provider-balance-card.js.map +1 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.cjs +2 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.cjs.map +1 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.d.ts +9 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.js +68 -0
- package/dist/components/features/conversation/usage-panel/usage-panel.js.map +1 -0
- package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.js +10 -13
- package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.js +2 -2
- package/dist/components/features/conversation-panel/budget-progress-bar.js.map +1 -1
- package/dist/components/features/conversation-panel/confirm-archive-modal.cjs +2 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.cjs.map +1 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.d.ts +8 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.js +48 -0
- package/dist/components/features/conversation-panel/confirm-archive-modal.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +3 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +39 -34
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +3 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +104 -80
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +7 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +28 -20
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +9 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +94 -84
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +2 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.js +32 -31
- package/dist/components/features/conversation-panel/conversation-group-folder-list.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +2 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.js +27 -26
- package/dist/components/features/conversation-panel/conversation-group-folder-row.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +3 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +116 -106
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +27 -0
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +69 -46
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +230 -165
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.js +22 -25
- package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.cjs +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.cjs.map +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.js +2 -2
- package/dist/components/features/markdown/markdown-table-scroll.js.map +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.js +1 -0
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.js +2 -2
- package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.js +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.js +154 -98
- package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/llm-balance.cjs +2 -0
- package/dist/constants/llm-balance.cjs.map +1 -0
- package/dist/constants/llm-balance.d.ts +13 -0
- package/dist/constants/llm-balance.js +6 -0
- package/dist/constants/llm-balance.js.map +1 -0
- package/dist/contexts/conversation-websocket-context.cjs +2 -2
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +217 -209
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/chat/use-grip-resize.cjs +1 -1
- package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
- package/dist/hooks/chat/use-grip-resize.d.ts +1 -0
- package/dist/hooks/chat/use-grip-resize.js +39 -30
- package/dist/hooks/chat/use-grip-resize.js.map +1 -1
- package/dist/hooks/chat/use-slash-command.cjs +1 -1
- package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
- package/dist/hooks/chat/use-slash-command.js +61 -60
- package/dist/hooks/chat/use-slash-command.js.map +1 -1
- package/dist/hooks/mutation/use-condense-conversation.cjs +2 -0
- package/dist/hooks/mutation/use-condense-conversation.cjs.map +1 -0
- package/dist/hooks/mutation/use-condense-conversation.d.ts +12 -0
- package/dist/hooks/mutation/use-condense-conversation.js +17 -0
- package/dist/hooks/mutation/use-condense-conversation.js.map +1 -0
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +30 -21
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.js +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
- package/dist/hooks/query/use-conversation-metrics.cjs +1 -1
- package/dist/hooks/query/use-conversation-metrics.cjs.map +1 -1
- package/dist/hooks/query/use-conversation-metrics.js +1 -1
- package/dist/hooks/query/use-conversation-metrics.js.map +1 -1
- package/dist/hooks/query/use-llm-balance.cjs +2 -0
- package/dist/hooks/query/use-llm-balance.cjs.map +1 -0
- package/dist/hooks/query/use-llm-balance.d.ts +10 -0
- package/dist/hooks/query/use-llm-balance.js +24 -0
- package/dist/hooks/query/use-llm-balance.js.map +1 -0
- package/dist/hooks/query/use-search-providers.cjs +1 -1
- package/dist/hooks/query/use-search-providers.cjs.map +1 -1
- package/dist/hooks/query/use-search-providers.js +1 -1
- package/dist/hooks/query/use-search-providers.js.map +1 -1
- package/dist/hooks/use-await-context-compaction.cjs +2 -0
- package/dist/hooks/use-await-context-compaction.cjs.map +1 -0
- package/dist/hooks/use-await-context-compaction.d.ts +38 -0
- package/dist/hooks/use-await-context-compaction.js +61 -0
- package/dist/hooks/use-await-context-compaction.js.map +1 -0
- package/dist/hooks/use-compact-context-action.cjs +2 -0
- package/dist/hooks/use-compact-context-action.cjs.map +1 -0
- package/dist/hooks/use-compact-context-action.d.ts +10 -0
- package/dist/hooks/use-compact-context-action.js +61 -0
- package/dist/hooks/use-compact-context-action.js.map +1 -0
- package/dist/hooks/use-context-window-usage.cjs +2 -0
- package/dist/hooks/use-context-window-usage.cjs.map +1 -0
- package/dist/hooks/use-context-window-usage.d.ts +5 -0
- package/dist/hooks/use-context-window-usage.js +20 -0
- package/dist/hooks/use-context-window-usage.js.map +1 -0
- package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
- package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
- package/dist/hooks/use-conversation-name-context-menu.d.ts +0 -3
- package/dist/hooks/use-conversation-name-context-menu.js +54 -57
- package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
- package/dist/hooks/use-drag-resize.cjs +1 -1
- package/dist/hooks/use-drag-resize.cjs.map +1 -1
- package/dist/hooks/use-drag-resize.d.ts +8 -0
- package/dist/hooks/use-drag-resize.js +21 -18
- package/dist/hooks/use-drag-resize.js.map +1 -1
- package/dist/hooks/use-live-conversation-metrics.cjs +2 -0
- package/dist/hooks/use-live-conversation-metrics.cjs.map +1 -0
- package/dist/hooks/use-live-conversation-metrics.d.ts +18 -0
- package/dist/hooks/use-live-conversation-metrics.js +37 -0
- package/dist/hooks/use-live-conversation-metrics.js.map +1 -0
- package/dist/hooks/use-select-conversation-tab.cjs +1 -1
- package/dist/hooks/use-select-conversation-tab.cjs.map +1 -1
- package/dist/hooks/use-select-conversation-tab.js +2 -2
- package/dist/hooks/use-select-conversation-tab.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +27 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +474 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +28 -29
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.js +0 -1
- package/dist/locales/ar/openhands.json +28 -1
- package/dist/locales/ca/openhands.json +28 -1
- package/dist/locales/de/openhands.json +28 -1
- package/dist/locales/en/openhands.json +28 -1
- package/dist/locales/es/openhands.json +28 -1
- package/dist/locales/fr/openhands.json +28 -1
- package/dist/locales/it/openhands.json +28 -1
- package/dist/locales/ja/openhands.json +28 -1
- package/dist/locales/ko-KR/openhands.json +28 -1
- package/dist/locales/no/openhands.json +28 -1
- package/dist/locales/pt/openhands.json +28 -1
- package/dist/locales/tr/openhands.json +28 -1
- package/dist/locales/uk/openhands.json +28 -1
- package/dist/locales/zh-CN/openhands.json +28 -1
- package/dist/locales/zh-TW/openhands.json +28 -1
- package/dist/node_modules/@microlink/react-json-view/dist/main.cjs +5 -5
- package/dist/node_modules/@microlink/react-json-view/dist/main.cjs.map +1 -1
- package/dist/node_modules/@microlink/react-json-view/dist/main.js +5194 -5187
- package/dist/node_modules/@microlink/react-json-view/dist/main.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +21 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +22 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +33 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +56 -22
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +31 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +21 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +21 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +9 -5
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/i18next-http-backend/esm/index.cjs +1 -1
- package/dist/node_modules/i18next-http-backend/esm/index.cjs.map +1 -1
- package/dist/node_modules/i18next-http-backend/esm/index.js +2 -2
- package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js +31 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/archive.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js.map +1 -0
- package/dist/node_modules/zustand/esm/middleware.cjs +3 -3
- package/dist/node_modules/zustand/esm/middleware.cjs.map +1 -1
- package/dist/node_modules/zustand/esm/middleware.js +33 -31
- package/dist/node_modules/zustand/esm/middleware.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +17 -16
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +94 -93
- package/dist/routes/app-settings.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 +131 -119
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/routes/usage-tab.cjs +2 -0
- package/dist/routes/usage-tab.cjs.map +1 -0
- package/dist/routes/usage-tab.d.ts +2 -0
- package/dist/routes/usage-tab.js +10 -0
- package/dist/routes/usage-tab.js.map +1 -0
- package/dist/services/child-conversation-launch.cjs +1 -1
- package/dist/services/child-conversation-launch.cjs.map +1 -1
- package/dist/services/child-conversation-launch.js +11 -5
- package/dist/services/child-conversation-launch.js.map +1 -1
- package/dist/stores/archived-conversations-store.cjs +2 -0
- package/dist/stores/archived-conversations-store.cjs.map +1 -0
- package/dist/stores/archived-conversations-store.d.ts +24 -0
- package/dist/stores/archived-conversations-store.js +33 -0
- package/dist/stores/archived-conversations-store.js.map +1 -0
- package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
- package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
- package/dist/stores/conversation-panel-preferences-store.d.ts +3 -0
- package/dist/stores/conversation-panel-preferences-store.js +4 -0
- package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
- package/dist/stores/conversation-store.cjs.map +1 -1
- package/dist/stores/conversation-store.d.ts +1 -1
- package/dist/stores/conversation-store.js.map +1 -1
- package/dist/stores/metrics-store.cjs +1 -1
- package/dist/stores/metrics-store.cjs.map +1 -1
- package/dist/stores/metrics-store.d.ts +1 -0
- package/dist/stores/metrics-store.js +7 -4
- package/dist/stores/metrics-store.js.map +1 -1
- package/dist/types/agent-server/core/events/condensation-event.d.ts +3 -0
- package/dist/types/agent-server/core/events/conversation-state-event.d.ts +4 -6
- package/dist/types/agent-server/type-guards.cjs +1 -1
- package/dist/types/agent-server/type-guards.cjs.map +1 -1
- package/dist/types/agent-server/type-guards.d.ts +5 -0
- package/dist/types/agent-server/type-guards.js +3 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/utils/conversation-local-storage.cjs +1 -1
- package/dist/utils/conversation-local-storage.cjs.map +1 -1
- package/dist/utils/conversation-local-storage.js +2 -1
- package/dist/utils/conversation-local-storage.js.map +1 -1
- package/dist/utils/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +11 -0
- package/dist/utils/format-model-name.js +11 -3
- package/dist/utils/format-model-name.js.map +1 -1
- package/dist/utils/format-token-count.cjs +2 -0
- package/dist/utils/format-token-count.cjs.map +1 -0
- package/dist/utils/format-token-count.d.ts +3 -0
- package/dist/utils/format-token-count.js +19 -0
- package/dist/utils/format-token-count.js.map +1 -0
- package/dist/utils/hover-reveal-classes.cjs +2 -0
- package/dist/utils/hover-reveal-classes.cjs.map +1 -0
- package/dist/utils/hover-reveal-classes.d.ts +34 -0
- package/dist/utils/hover-reveal-classes.js +41 -0
- package/dist/utils/hover-reveal-classes.js.map +1 -0
- package/dist/utils/is-markdown-file-path.cjs +2 -0
- package/dist/utils/is-markdown-file-path.cjs.map +1 -0
- package/dist/utils/is-markdown-file-path.d.ts +4 -0
- package/dist/utils/is-markdown-file-path.js +14 -0
- package/dist/utils/is-markdown-file-path.js.map +1 -0
- package/dist/utils/mcp-marketplace-utils.cjs +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
- package/dist/utils/mcp-marketplace-utils.d.ts +7 -0
- package/dist/utils/mcp-marketplace-utils.js +19 -16
- package/dist/utils/mcp-marketplace-utils.js.map +1 -1
- package/dist/utils/transcript-export/index.cjs +3 -3
- package/dist/utils/transcript-export/index.cjs.map +1 -1
- package/dist/utils/transcript-export/index.js +12 -12
- package/dist/utils/transcript-export/index.js.map +1 -1
- package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
- package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
- package/dist/utils/transcript-export/load-complete-events.js +4 -4
- package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
- package/dist/utils/workspace-relative-path.cjs +2 -0
- package/dist/utils/workspace-relative-path.cjs.map +1 -0
- package/dist/utils/workspace-relative-path.d.ts +10 -0
- package/dist/utils/workspace-relative-path.js +22 -0
- package/dist/utils/workspace-relative-path.js.map +1 -0
- package/package.json +17 -16
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-process-utils.mjs +6 -1
- package/scripts/dev-safe.mjs +57 -2
- package/build/assets/active-backend-context-BBvP-bI2.js +0 -2
- package/build/assets/agent-profiles-settings-DqoS7RL3.js +0 -1
- package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +0 -86
- package/build/assets/agent-settings-BJHryp65.js +0 -1
- package/build/assets/app-settings-r1RUbgGi.js +0 -1
- package/build/assets/backend-form-modal-OroTqnAv.js +0 -1
- package/build/assets/bot-DuN83i3p.js +0 -1
- package/build/assets/browser--eoQOo4M.js +0 -6
- package/build/assets/check-DLOKoFU9.js +0 -1
- package/build/assets/chevron-down-CnIbtM6i.js +0 -1
- package/build/assets/circle-check-CxCYJrpZ.js +0 -1
- package/build/assets/conversation-BUzBZAc-.js +0 -90
- package/build/assets/conversation-panel-pzAKsSDb.js +0 -1
- package/build/assets/conversation-pzAKsSDb.js +0 -1
- package/build/assets/conversation-store-B8Eahyeg.js +0 -6
- package/build/assets/external-link-zWbg5KXS.js +0 -1
- package/build/assets/files-tab-BzofBmF4.js +0 -1
- package/build/assets/git-provider-icon-BLMlwy02.js +0 -1
- package/build/assets/git-repo-dropdown-B_PTq4ol.js +0 -1
- package/build/assets/home-r89Vj2td.js +0 -1
- package/build/assets/index-home-r89Vj2td.js +0 -1
- package/build/assets/llm-not-configured-banner-CwKu8C6g.js +0 -27
- package/build/assets/llm-settings-BJotLQND.js +0 -1
- package/build/assets/llm-settings-CDM-5H2A.js +0 -1
- package/build/assets/llm-subscription-service-7eVfDIE1.js +0 -1
- package/build/assets/loader-circle-C5AnEN8r.js +0 -1
- package/build/assets/manifest-2a36a8f8.js +0 -1
- package/build/assets/markdown-renderer-BiiiIznl.js +0 -8
- package/build/assets/mcp-marketplace-utils-Dr_HG_ol.js +0 -1
- package/build/assets/messages-D1cbVhRK.js +0 -40
- package/build/assets/pencil-Bl3GWhgq.js +0 -1
- package/build/assets/plus-CtzlyAoF.js +0 -1
- package/build/assets/recommended-automations-launcher-BbJAJVED.js +0 -1
- package/build/assets/refresh-cw-B9GhC3QC.js +0 -1
- package/build/assets/root-BfM_kC_d.css +0 -1
- package/build/assets/root-gstBEjty.js +0 -2
- package/build/assets/root-layout-BIAFLP9p.js +0 -2
- package/build/assets/search-CYaiKHRp.js +0 -1
- package/build/assets/shared-conversation-DIxZjElr.js +0 -1
- package/build/assets/shield-check-D2cpEpv3.js +0 -1
- package/build/assets/trash-2-CzDVN-Iw.js +0 -1
- package/build/assets/use-create-conversation-DWaSVUOB.js +0 -1
- package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
- package/build/assets/use-llm-profiles-CU8ah1pz.js +0 -1
- package/build/assets/use-save-agent-profile-DgI_Uz9a.js +0 -1
- package/build/assets/utils-DPQfkd-7.js +0 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js +0 -13
- package/build/assets/x-RYDBg-e2.js +0 -1
- package/build/assets/zap-tbKDzCe3.js +0 -1
- package/dist/components/features/conversation/metrics-modal/context-window-section.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/context-window-section.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +0 -6
- package/dist/components/features/conversation/metrics-modal/context-window-section.js +0 -46
- package/dist/components/features/conversation/metrics-modal/context-window-section.js.map +0 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/empty-state.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +0 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.js +0 -18
- package/dist/components/features/conversation/metrics-modal/empty-state.js.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +0 -5
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js +0 -20
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs +0 -2
- package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs.map +0 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +0 -6
- package/dist/components/features/conversation/metrics-modal/metrics-modal.js +0 -57
- package/dist/components/features/conversation/metrics-modal/metrics-modal.js.map +0 -1
- package/dist/icons/u-credit-card.cjs +0 -2
- package/dist/icons/u-credit-card.cjs.map +0 -1
- package/dist/icons/u-credit-card.js +0 -21
- package/dist/icons/u-credit-card.js.map +0 -1
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js} +0 -0
|
@@ -6,167 +6,168 @@ import { displayErrorToast as i, displaySuccessToast as a } from "../utils/custo
|
|
|
6
6
|
import { setTelemetryConsent as o } from "../services/telemetry.js";
|
|
7
7
|
import { useActiveBackend as s } from "../contexts/active-backend-context.js";
|
|
8
8
|
import { DEFAULT_SETTINGS as c } from "../services/settings.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import b from "
|
|
21
|
-
import
|
|
9
|
+
import { formatModelNameForDisplay as l } from "../utils/format-model-name.js";
|
|
10
|
+
import { useLlmProfiles as u } from "../hooks/query/use-llm-profiles.js";
|
|
11
|
+
import { useSettings as d } from "../hooks/query/use-settings.js";
|
|
12
|
+
import { NavigationLink as f } from "../components/shared/navigation-link.js";
|
|
13
|
+
import { BrandButton as p } from "../components/features/settings/brand-button.js";
|
|
14
|
+
import { useSaveSettings as m } from "../hooks/mutation/use-save-settings.js";
|
|
15
|
+
import { SettingsSwitch as h } from "../components/features/settings/settings-switch.js";
|
|
16
|
+
import { SettingsInput as g } from "../components/features/settings/settings-input.js";
|
|
17
|
+
import { SettingsDropdownInput as _ } from "../components/features/settings/settings-dropdown-input.js";
|
|
18
|
+
import { LanguageInput as v } from "../components/features/settings/app-settings/language-input.js";
|
|
19
|
+
import { ThemeInput as y } from "../components/features/settings/app-settings/theme-input.js";
|
|
20
|
+
import { AppSettingsInputsSkeleton as b } from "../components/features/settings/app-settings/app-settings-inputs-skeleton.js";
|
|
21
|
+
import x from "react";
|
|
22
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
22
23
|
//#region src/routes/app-settings.tsx
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
let { t:
|
|
26
|
-
let e =
|
|
27
|
-
return !e || !
|
|
28
|
-
}, [
|
|
29
|
-
key:
|
|
30
|
-
label:
|
|
31
|
-
}, ...
|
|
24
|
+
var w = "__automatic__";
|
|
25
|
+
function T() {
|
|
26
|
+
let { t: T } = e("openhands"), { mutate: E, isPending: D } = m(), { data: O, isLoading: k } = d(), A = s().backend.kind === "cloud", { data: j, isLoading: M } = u(), [ee, N] = x.useState(!1), [P, F] = x.useState(!1), [I, L] = x.useState(!1), [R, z] = x.useState(!1), [B, V] = x.useState(!1), [H, U] = x.useState(void 0), W = x.useMemo(() => {
|
|
27
|
+
let e = O?.title_llm_profile ?? null;
|
|
28
|
+
return !e || !j || j.profiles.some((t) => t.name === e) ? e : null;
|
|
29
|
+
}, [j, O?.title_llm_profile]), G = H === void 0 ? W : H, K = x.useMemo(() => [{
|
|
30
|
+
key: w,
|
|
31
|
+
label: T(t.SETTINGS$TITLE_GENERATION_AUTOMATIC)
|
|
32
|
+
}, ...j?.profiles.map((e) => ({
|
|
32
33
|
key: e.name,
|
|
33
|
-
label: e.model ?
|
|
34
|
+
label: e.model ? T(t.SETTINGS$TITLE_GENERATION_PROFILE_OPTION, {
|
|
34
35
|
name: e.name,
|
|
35
|
-
model: e.model
|
|
36
|
+
model: l(e.model) ?? e.model
|
|
36
37
|
}) : e.name
|
|
37
|
-
})) ?? []], [
|
|
38
|
-
let s = e.get("language-input")?.toString(), l = n.find(({ label: e }) => e === s)?.value || c.language, u =
|
|
39
|
-
|
|
38
|
+
})) ?? []], [j?.profiles, T]), q = (e) => {
|
|
39
|
+
let s = e.get("language-input")?.toString(), l = n.find(({ label: e }) => e === s)?.value || c.language, u = A ? !0 : e.get("enable-analytics-switch")?.toString() === "on", d = e.get("enable-sound-notifications-switch")?.toString() === "on", f = e.get("git-user-name-input")?.toString() || c.git_user_name, p = e.get("git-user-email-input")?.toString() || c.git_user_email;
|
|
40
|
+
E({
|
|
40
41
|
language: l,
|
|
41
|
-
...!
|
|
42
|
+
...!A && { user_consents_to_analytics: u },
|
|
42
43
|
enable_sound_notifications: d,
|
|
43
44
|
git_user_name: f,
|
|
44
45
|
git_user_email: p,
|
|
45
|
-
title_llm_profile:
|
|
46
|
+
title_llm_profile: G
|
|
46
47
|
}, {
|
|
47
48
|
onSuccess: () => {
|
|
48
|
-
o(u ? "granted" : "denied"), a(
|
|
49
|
+
o(u ? "granted" : "denied"), a(T(t.SETTINGS$SAVED));
|
|
49
50
|
},
|
|
50
51
|
onError: (e) => {
|
|
51
|
-
i(r(e) ||
|
|
52
|
+
i(r(e) || T(t.ERROR$GENERIC));
|
|
52
53
|
},
|
|
53
54
|
onSettled: () => {
|
|
54
|
-
|
|
55
|
+
N(!1), F(!1), L(!1), z(!1), V(!1), U(void 0);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
}, q = (e) => {
|
|
58
|
-
let t = n.find(({ label: t }) => t === e)?.label, r = n.find(({ value: e }) => e === D?.language)?.label;
|
|
59
|
-
M(t !== r);
|
|
60
58
|
}, J = (e) => {
|
|
61
|
-
|
|
59
|
+
let t = n.find(({ label: t }) => t === e)?.label, r = n.find(({ value: e }) => e === O?.language)?.label;
|
|
60
|
+
N(t !== r);
|
|
62
61
|
}, Y = (e) => {
|
|
63
|
-
|
|
62
|
+
F(e !== (O?.user_consents_to_analytics ?? !0));
|
|
64
63
|
}, X = (e) => {
|
|
65
|
-
|
|
66
|
-
R(e !== t);
|
|
64
|
+
L(e !== !!O?.enable_sound_notifications);
|
|
67
65
|
}, Z = (e) => {
|
|
68
|
-
let t =
|
|
69
|
-
|
|
70
|
-
}, Q =
|
|
71
|
-
|
|
66
|
+
let t = O?.git_user_name;
|
|
67
|
+
z(e !== t);
|
|
68
|
+
}, Q = (e) => {
|
|
69
|
+
let t = O?.git_user_email;
|
|
70
|
+
V(e !== t);
|
|
71
|
+
}, te = !ee && !P && !I && G === W && !R && !B, $ = !O || k || M || D;
|
|
72
|
+
return /* @__PURE__ */ C("form", {
|
|
72
73
|
"data-testid": "app-settings-screen",
|
|
73
|
-
action:
|
|
74
|
+
action: q,
|
|
74
75
|
className: "flex flex-col gap-6",
|
|
75
|
-
children: [$ && /* @__PURE__ */
|
|
76
|
+
children: [$ && /* @__PURE__ */ S(b, {}), !$ && /* @__PURE__ */ C("div", {
|
|
76
77
|
className: "flex flex-col gap-6",
|
|
77
78
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ S(v, {
|
|
79
80
|
name: "language-input",
|
|
80
|
-
defaultKey:
|
|
81
|
-
onChange:
|
|
81
|
+
defaultKey: O.language,
|
|
82
|
+
onChange: J
|
|
82
83
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ S(y, {}),
|
|
85
|
+
/* @__PURE__ */ S(h, {
|
|
85
86
|
testId: "enable-analytics-switch",
|
|
86
|
-
name:
|
|
87
|
-
defaultIsToggled:
|
|
88
|
-
isToggled:
|
|
89
|
-
isDisabled:
|
|
90
|
-
onToggle:
|
|
91
|
-
children:
|
|
87
|
+
name: A ? void 0 : "enable-analytics-switch",
|
|
88
|
+
defaultIsToggled: A ? !0 : O.user_consents_to_analytics ?? !0,
|
|
89
|
+
isToggled: A ? !0 : void 0,
|
|
90
|
+
isDisabled: A,
|
|
91
|
+
onToggle: A ? void 0 : Y,
|
|
92
|
+
children: T(t.ANALYTICS$SEND_ANONYMOUS_DATA)
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ S(h, {
|
|
94
95
|
testId: "enable-sound-notifications-switch",
|
|
95
96
|
name: "enable-sound-notifications-switch",
|
|
96
|
-
defaultIsToggled: !!
|
|
97
|
-
onToggle:
|
|
98
|
-
children:
|
|
97
|
+
defaultIsToggled: !!O.enable_sound_notifications,
|
|
98
|
+
onToggle: X,
|
|
99
|
+
children: T(t.SETTINGS$SOUND_NOTIFICATIONS)
|
|
99
100
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ C("div", {
|
|
101
102
|
className: "border-t border-[var(--oh-border)] pt-6 mt-2",
|
|
102
103
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ S("h3", {
|
|
104
105
|
className: "text-lg font-medium mb-2",
|
|
105
|
-
children:
|
|
106
|
+
children: T(t.SETTINGS$CONVERSATION_TITLES)
|
|
106
107
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ S("p", {
|
|
108
109
|
className: "mb-4 text-sm leading-5 text-tertiary-light",
|
|
109
|
-
children:
|
|
110
|
+
children: T(t.SETTINGS$TITLE_GENERATION_DESCRIPTION)
|
|
110
111
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ S(_, {
|
|
112
113
|
testId: "title-llm-profile-input",
|
|
113
114
|
name: "title-llm-profile-input",
|
|
114
|
-
label:
|
|
115
|
-
items:
|
|
116
|
-
selectedKey:
|
|
115
|
+
label: T(t.SETTINGS$TITLE_GENERATION_MODEL),
|
|
116
|
+
items: K,
|
|
117
|
+
selectedKey: G ?? w,
|
|
117
118
|
onSelectionChange: (e) => {
|
|
118
119
|
let t = e?.toString();
|
|
119
|
-
|
|
120
|
+
U(!t || t === w ? null : t);
|
|
120
121
|
}
|
|
121
122
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ S(f, {
|
|
123
124
|
to: "/settings/llm",
|
|
124
125
|
className: "mt-3 inline-block text-sm text-primary hover:underline",
|
|
125
|
-
children:
|
|
126
|
+
children: T(t.SETTINGS$MANAGE_LLM_PROFILES)
|
|
126
127
|
})
|
|
127
128
|
]
|
|
128
129
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ C("div", {
|
|
130
131
|
className: "border-t border-[var(--oh-border)] pt-6 mt-2",
|
|
131
132
|
children: [
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ S("h3", {
|
|
133
134
|
className: "text-lg font-medium mb-2",
|
|
134
|
-
children:
|
|
135
|
+
children: T(t.SETTINGS$GIT_SETTINGS)
|
|
135
136
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ S("p", {
|
|
137
138
|
className: "mb-4 text-sm leading-5 text-tertiary-light",
|
|
138
|
-
children:
|
|
139
|
+
children: T(t.SETTINGS$GIT_SETTINGS_DESCRIPTION)
|
|
139
140
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ C("div", {
|
|
141
142
|
className: "flex flex-col gap-6",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ S(g, {
|
|
143
144
|
testId: "git-user-name-input",
|
|
144
145
|
name: "git-user-name-input",
|
|
145
146
|
type: "text",
|
|
146
|
-
label:
|
|
147
|
-
defaultValue:
|
|
148
|
-
onChange:
|
|
149
|
-
placeholder:
|
|
147
|
+
label: T(t.SETTINGS$GIT_USERNAME),
|
|
148
|
+
defaultValue: O.git_user_name || "",
|
|
149
|
+
onChange: Z,
|
|
150
|
+
placeholder: T(t.SETTINGS$GIT_USERNAME_PLACEHOLDER),
|
|
150
151
|
className: "w-full min-w-0"
|
|
151
|
-
}), /* @__PURE__ */
|
|
152
|
+
}), /* @__PURE__ */ S(g, {
|
|
152
153
|
testId: "git-user-email-input",
|
|
153
154
|
name: "git-user-email-input",
|
|
154
155
|
type: "email",
|
|
155
|
-
label:
|
|
156
|
-
defaultValue:
|
|
157
|
-
onChange:
|
|
158
|
-
placeholder:
|
|
156
|
+
label: T(t.SETTINGS$GIT_EMAIL),
|
|
157
|
+
defaultValue: O.git_user_email || "",
|
|
158
|
+
onChange: Q,
|
|
159
|
+
placeholder: T(t.SETTINGS$GIT_EMAIL_PLACEHOLDER),
|
|
159
160
|
className: "w-full min-w-0"
|
|
160
161
|
})]
|
|
161
162
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ S("div", {
|
|
163
164
|
className: "flex justify-start pt-4",
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ C(p, {
|
|
165
166
|
testId: "submit-button",
|
|
166
167
|
variant: "primary",
|
|
167
168
|
type: "submit",
|
|
168
|
-
isDisabled:
|
|
169
|
-
children: [!
|
|
169
|
+
isDisabled: D || te,
|
|
170
|
+
children: [!D && T(t.SETTINGS$SAVE_CHANGES), D && T(t.SETTINGS$SAVING)]
|
|
170
171
|
})
|
|
171
172
|
})
|
|
172
173
|
]
|
|
@@ -176,6 +177,6 @@ function w() {
|
|
|
176
177
|
});
|
|
177
178
|
}
|
|
178
179
|
//#endregion
|
|
179
|
-
export {
|
|
180
|
+
export { T as default };
|
|
180
181
|
|
|
181
182
|
//# sourceMappingURL=app-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-settings.js","names":[],"sources":["../../src/routes/app-settings.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useSaveSettings } from \"#/hooks/mutation/use-save-settings\";\nimport { useSettings } from \"#/hooks/query/use-settings\";\nimport { AvailableLanguages } from \"#/i18n\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { setTelemetryConsent } from \"#/services/telemetry\";\nimport { BrandButton } from \"#/components/features/settings/brand-button\";\nimport { SettingsSwitch } from \"#/components/features/settings/settings-switch\";\nimport { SettingsInput } from \"#/components/features/settings/settings-input\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { LanguageInput } from \"#/components/features/settings/app-settings/language-input\";\nimport { ThemeInput } from \"#/components/features/settings/app-settings/theme-input\";\nimport {\n displayErrorToast,\n displaySuccessToast,\n} from \"#/utils/custom-toast-handlers\";\nimport { retrieveAxiosErrorMessage } from \"#/utils/retrieve-axios-error-message\";\nimport { AppSettingsInputsSkeleton } from \"#/components/features/settings/app-settings/app-settings-inputs-skeleton\";\nimport { SettingsDropdownInput } from \"#/components/features/settings/settings-dropdown-input\";\nimport { NavigationLink } from \"#/components/shared/navigation-link\";\nimport { useLlmProfiles } from \"#/hooks/query/use-llm-profiles\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\nconst AUTOMATIC_TITLE_LLM_PROFILE_KEY = \"__automatic__\";\n\nexport function AppSettingsScreen() {\n const { t } = useTranslation(\"openhands\");\n\n const { mutate: saveSettings, isPending } = useSaveSettings();\n const { data: settings, isLoading } = useSettings();\n const activeBackend = useActiveBackend();\n const isCloudBackend = activeBackend.backend.kind === \"cloud\";\n const { data: llmProfiles, isLoading: areLlmProfilesLoading } =\n useLlmProfiles();\n\n const [languageInputHasChanged, setLanguageInputHasChanged] =\n React.useState(false);\n const [analyticsSwitchHasChanged, setAnalyticsSwitchHasChanged] =\n React.useState(false);\n const [\n soundNotificationsSwitchHasChanged,\n setSoundNotificationsSwitchHasChanged,\n ] = React.useState(false);\n const [gitUserNameHasChanged, setGitUserNameHasChanged] =\n React.useState(false);\n const [gitUserEmailHasChanged, setGitUserEmailHasChanged] =\n React.useState(false);\n const [titleLlmProfileInput, setTitleLlmProfileInput] = React.useState<\n string | null | undefined\n >(undefined);\n\n const storedTitleLlmProfile = React.useMemo(() => {\n const preference = settings?.title_llm_profile ?? null;\n if (!preference || !llmProfiles) return preference;\n return llmProfiles.profiles.some((profile) => profile.name === preference)\n ? preference\n : null;\n }, [llmProfiles, settings?.title_llm_profile]);\n const selectedTitleLlmProfile =\n titleLlmProfileInput === undefined\n ? storedTitleLlmProfile\n : titleLlmProfileInput;\n const titleLlmProfileItems = React.useMemo(\n () => [\n {\n key: AUTOMATIC_TITLE_LLM_PROFILE_KEY,\n label: t(I18nKey.SETTINGS$TITLE_GENERATION_AUTOMATIC),\n },\n ...(llmProfiles?.profiles.map((profile) => ({\n key: profile.name,\n label: profile.model\n ? t(I18nKey.SETTINGS$TITLE_GENERATION_PROFILE_OPTION, {\n name: profile.name,\n model: profile.model,\n })\n : profile.name,\n })) ?? []),\n ],\n [llmProfiles?.profiles, t],\n );\n\n const formAction = (formData: FormData) => {\n const languageLabel = formData.get(\"language-input\")?.toString();\n const languageValue = AvailableLanguages.find(\n ({ label }) => label === languageLabel,\n )?.value;\n const language = languageValue || DEFAULT_SETTINGS.language;\n\n const enableAnalytics = isCloudBackend\n ? true\n : formData.get(\"enable-analytics-switch\")?.toString() === \"on\";\n const enableSoundNotifications =\n formData.get(\"enable-sound-notifications-switch\")?.toString() === \"on\";\n\n const gitUserName =\n formData.get(\"git-user-name-input\")?.toString() ||\n DEFAULT_SETTINGS.git_user_name;\n const gitUserEmail =\n formData.get(\"git-user-email-input\")?.toString() ||\n DEFAULT_SETTINGS.git_user_email;\n\n saveSettings(\n {\n language,\n ...(!isCloudBackend && { user_consents_to_analytics: enableAnalytics }),\n enable_sound_notifications: enableSoundNotifications,\n git_user_name: gitUserName,\n git_user_email: gitUserEmail,\n title_llm_profile: selectedTitleLlmProfile,\n },\n {\n onSuccess: () => {\n void setTelemetryConsent(enableAnalytics ? \"granted\" : \"denied\");\n displaySuccessToast(t(I18nKey.SETTINGS$SAVED));\n },\n onError: (error) => {\n const errorMessage = retrieveAxiosErrorMessage(error);\n displayErrorToast(errorMessage || t(I18nKey.ERROR$GENERIC));\n },\n onSettled: () => {\n setLanguageInputHasChanged(false);\n setAnalyticsSwitchHasChanged(false);\n setSoundNotificationsSwitchHasChanged(false);\n setGitUserNameHasChanged(false);\n setGitUserEmailHasChanged(false);\n setTitleLlmProfileInput(undefined);\n },\n },\n );\n };\n\n const checkIfLanguageInputHasChanged = (value: string) => {\n const selectedLanguage = AvailableLanguages.find(\n ({ label: langValue }) => langValue === value,\n )?.label;\n const currentLanguage = AvailableLanguages.find(\n ({ value: langValue }) => langValue === settings?.language,\n )?.label;\n\n setLanguageInputHasChanged(selectedLanguage !== currentLanguage);\n };\n\n const checkIfAnalyticsSwitchHasChanged = (checked: boolean) => {\n // Treat null as true since analytics is opt-in by default\n const currentAnalytics = settings?.user_consents_to_analytics ?? true;\n setAnalyticsSwitchHasChanged(checked !== currentAnalytics);\n };\n\n const checkIfSoundNotificationsSwitchHasChanged = (checked: boolean) => {\n const currentSoundNotifications = !!settings?.enable_sound_notifications;\n setSoundNotificationsSwitchHasChanged(\n checked !== currentSoundNotifications,\n );\n };\n\n const checkIfGitUserNameHasChanged = (value: string) => {\n const currentValue = settings?.git_user_name;\n setGitUserNameHasChanged(value !== currentValue);\n };\n\n const checkIfGitUserEmailHasChanged = (value: string) => {\n const currentValue = settings?.git_user_email;\n setGitUserEmailHasChanged(value !== currentValue);\n };\n\n const formIsClean =\n !languageInputHasChanged &&\n !analyticsSwitchHasChanged &&\n !soundNotificationsSwitchHasChanged &&\n selectedTitleLlmProfile === storedTitleLlmProfile &&\n !gitUserNameHasChanged &&\n !gitUserEmailHasChanged;\n\n const shouldBeLoading =\n !settings || isLoading || areLlmProfilesLoading || isPending;\n\n return (\n <form\n data-testid=\"app-settings-screen\"\n action={formAction}\n className=\"flex flex-col gap-6\"\n >\n {shouldBeLoading && <AppSettingsInputsSkeleton />}\n {!shouldBeLoading && (\n <div className=\"flex flex-col gap-6\">\n <LanguageInput\n name=\"language-input\"\n defaultKey={settings.language}\n onChange={checkIfLanguageInputHasChanged}\n />\n\n <ThemeInput />\n\n <SettingsSwitch\n testId=\"enable-analytics-switch\"\n name={isCloudBackend ? undefined : \"enable-analytics-switch\"}\n defaultIsToggled={\n isCloudBackend\n ? true\n : (settings.user_consents_to_analytics ?? true)\n }\n isToggled={isCloudBackend ? true : undefined}\n isDisabled={isCloudBackend}\n onToggle={\n isCloudBackend ? undefined : checkIfAnalyticsSwitchHasChanged\n }\n >\n {t(I18nKey.ANALYTICS$SEND_ANONYMOUS_DATA)}\n </SettingsSwitch>\n\n <SettingsSwitch\n testId=\"enable-sound-notifications-switch\"\n name=\"enable-sound-notifications-switch\"\n defaultIsToggled={!!settings.enable_sound_notifications}\n onToggle={checkIfSoundNotificationsSwitchHasChanged}\n >\n {t(I18nKey.SETTINGS$SOUND_NOTIFICATIONS)}\n </SettingsSwitch>\n\n <div className=\"border-t border-[var(--oh-border)] pt-6 mt-2\">\n <h3 className=\"text-lg font-medium mb-2\">\n {t(I18nKey.SETTINGS$CONVERSATION_TITLES)}\n </h3>\n <p className=\"mb-4 text-sm leading-5 text-tertiary-light\">\n {t(I18nKey.SETTINGS$TITLE_GENERATION_DESCRIPTION)}\n </p>\n <SettingsDropdownInput\n testId=\"title-llm-profile-input\"\n name=\"title-llm-profile-input\"\n label={t(I18nKey.SETTINGS$TITLE_GENERATION_MODEL)}\n items={titleLlmProfileItems}\n selectedKey={\n selectedTitleLlmProfile ?? AUTOMATIC_TITLE_LLM_PROFILE_KEY\n }\n onSelectionChange={(key) => {\n const value = key?.toString();\n setTitleLlmProfileInput(\n !value || value === AUTOMATIC_TITLE_LLM_PROFILE_KEY\n ? null\n : value,\n );\n }}\n />\n <NavigationLink\n to=\"/settings/llm\"\n className=\"mt-3 inline-block text-sm text-primary hover:underline\"\n >\n {t(I18nKey.SETTINGS$MANAGE_LLM_PROFILES)}\n </NavigationLink>\n </div>\n\n <div className=\"border-t border-[var(--oh-border)] pt-6 mt-2\">\n <h3 className=\"text-lg font-medium mb-2\">\n {t(I18nKey.SETTINGS$GIT_SETTINGS)}\n </h3>\n <p className=\"mb-4 text-sm leading-5 text-tertiary-light\">\n {t(I18nKey.SETTINGS$GIT_SETTINGS_DESCRIPTION)}\n </p>\n <div className=\"flex flex-col gap-6\">\n <SettingsInput\n testId=\"git-user-name-input\"\n name=\"git-user-name-input\"\n type=\"text\"\n label={t(I18nKey.SETTINGS$GIT_USERNAME)}\n defaultValue={settings.git_user_name || \"\"}\n onChange={checkIfGitUserNameHasChanged}\n placeholder={t(I18nKey.SETTINGS$GIT_USERNAME_PLACEHOLDER)}\n className=\"w-full min-w-0\"\n />\n <SettingsInput\n testId=\"git-user-email-input\"\n name=\"git-user-email-input\"\n type=\"email\"\n label={t(I18nKey.SETTINGS$GIT_EMAIL)}\n defaultValue={settings.git_user_email || \"\"}\n onChange={checkIfGitUserEmailHasChanged}\n placeholder={t(I18nKey.SETTINGS$GIT_EMAIL_PLACEHOLDER)}\n className=\"w-full min-w-0\"\n />\n </div>\n <div className=\"flex justify-start pt-4\">\n <BrandButton\n testId=\"submit-button\"\n variant=\"primary\"\n type=\"submit\"\n isDisabled={isPending || formIsClean}\n >\n {!isPending && t(I18nKey.SETTINGS$SAVE_CHANGES)}\n {isPending && t(I18nKey.SETTINGS$SAVING)}\n </BrandButton>\n </div>\n </div>\n </div>\n )}\n </form>\n );\n}\n\nexport default AppSettingsScreen;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAM,IAAkC;A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iCAAiC;MAC3C,CAAA;MACH,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACE,kBAAC,GAAD;QACE,QAAO;QACP,MAAK;QACL,MAAK;QACL,OAAO,EAAE,EAAQ,qBAAqB;QACtC,cAAc,EAAS,iBAAiB;QACxC,UAAU;QACV,aAAa,EAAE,EAAQ,iCAAiC;QACxD,WAAU;OACX,CAAA,GACD,kBAAC,GAAD;QACE,QAAO;QACP,MAAK;QACL,MAAK;QACL,OAAO,EAAE,EAAQ,kBAAkB;QACnC,cAAc,EAAS,kBAAkB;QACzC,UAAU;QACV,aAAa,EAAE,EAAQ,8BAA8B;QACrD,WAAU;OACX,CAAA,CACE;;MACL,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,GAAD;QACE,QAAO;QACP,SAAQ;QACR,MAAK;QACL,YAAY,KAAa;kBAJ3B,CAMG,CAAC,KAAa,EAAE,EAAQ,qBAAqB,GAC7C,KAAa,EAAE,EAAQ,eAAe,CAC5B;;MACV,CAAA;KACF;;GACF;IAEH;;AAEV"}
|
|
1
|
+
{"version":3,"file":"app-settings.js","names":[],"sources":["../../src/routes/app-settings.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useSaveSettings } from \"#/hooks/mutation/use-save-settings\";\nimport { useSettings } from \"#/hooks/query/use-settings\";\nimport { AvailableLanguages } from \"#/i18n\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { setTelemetryConsent } from \"#/services/telemetry\";\nimport { BrandButton } from \"#/components/features/settings/brand-button\";\nimport { SettingsSwitch } from \"#/components/features/settings/settings-switch\";\nimport { SettingsInput } from \"#/components/features/settings/settings-input\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { LanguageInput } from \"#/components/features/settings/app-settings/language-input\";\nimport { ThemeInput } from \"#/components/features/settings/app-settings/theme-input\";\nimport {\n displayErrorToast,\n displaySuccessToast,\n} from \"#/utils/custom-toast-handlers\";\nimport { retrieveAxiosErrorMessage } from \"#/utils/retrieve-axios-error-message\";\nimport { AppSettingsInputsSkeleton } from \"#/components/features/settings/app-settings/app-settings-inputs-skeleton\";\nimport { SettingsDropdownInput } from \"#/components/features/settings/settings-dropdown-input\";\nimport { NavigationLink } from \"#/components/shared/navigation-link\";\nimport { useLlmProfiles } from \"#/hooks/query/use-llm-profiles\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { formatModelNameForDisplay } from \"#/utils/format-model-name\";\n\nconst AUTOMATIC_TITLE_LLM_PROFILE_KEY = \"__automatic__\";\n\nexport function AppSettingsScreen() {\n const { t } = useTranslation(\"openhands\");\n\n const { mutate: saveSettings, isPending } = useSaveSettings();\n const { data: settings, isLoading } = useSettings();\n const activeBackend = useActiveBackend();\n const isCloudBackend = activeBackend.backend.kind === \"cloud\";\n const { data: llmProfiles, isLoading: areLlmProfilesLoading } =\n useLlmProfiles();\n\n const [languageInputHasChanged, setLanguageInputHasChanged] =\n React.useState(false);\n const [analyticsSwitchHasChanged, setAnalyticsSwitchHasChanged] =\n React.useState(false);\n const [\n soundNotificationsSwitchHasChanged,\n setSoundNotificationsSwitchHasChanged,\n ] = React.useState(false);\n const [gitUserNameHasChanged, setGitUserNameHasChanged] =\n React.useState(false);\n const [gitUserEmailHasChanged, setGitUserEmailHasChanged] =\n React.useState(false);\n const [titleLlmProfileInput, setTitleLlmProfileInput] = React.useState<\n string | null | undefined\n >(undefined);\n\n const storedTitleLlmProfile = React.useMemo(() => {\n const preference = settings?.title_llm_profile ?? null;\n if (!preference || !llmProfiles) return preference;\n return llmProfiles.profiles.some((profile) => profile.name === preference)\n ? preference\n : null;\n }, [llmProfiles, settings?.title_llm_profile]);\n const selectedTitleLlmProfile =\n titleLlmProfileInput === undefined\n ? storedTitleLlmProfile\n : titleLlmProfileInput;\n const titleLlmProfileItems = React.useMemo(\n () => [\n {\n key: AUTOMATIC_TITLE_LLM_PROFILE_KEY,\n label: t(I18nKey.SETTINGS$TITLE_GENERATION_AUTOMATIC),\n },\n ...(llmProfiles?.profiles.map((profile) => ({\n key: profile.name,\n label: profile.model\n ? t(I18nKey.SETTINGS$TITLE_GENERATION_PROFILE_OPTION, {\n name: profile.name,\n model: formatModelNameForDisplay(profile.model) ?? profile.model,\n })\n : profile.name,\n })) ?? []),\n ],\n [llmProfiles?.profiles, t],\n );\n\n const formAction = (formData: FormData) => {\n const languageLabel = formData.get(\"language-input\")?.toString();\n const languageValue = AvailableLanguages.find(\n ({ label }) => label === languageLabel,\n )?.value;\n const language = languageValue || DEFAULT_SETTINGS.language;\n\n const enableAnalytics = isCloudBackend\n ? true\n : formData.get(\"enable-analytics-switch\")?.toString() === \"on\";\n const enableSoundNotifications =\n formData.get(\"enable-sound-notifications-switch\")?.toString() === \"on\";\n\n const gitUserName =\n formData.get(\"git-user-name-input\")?.toString() ||\n DEFAULT_SETTINGS.git_user_name;\n const gitUserEmail =\n formData.get(\"git-user-email-input\")?.toString() ||\n DEFAULT_SETTINGS.git_user_email;\n\n saveSettings(\n {\n language,\n ...(!isCloudBackend && { user_consents_to_analytics: enableAnalytics }),\n enable_sound_notifications: enableSoundNotifications,\n git_user_name: gitUserName,\n git_user_email: gitUserEmail,\n title_llm_profile: selectedTitleLlmProfile,\n },\n {\n onSuccess: () => {\n void setTelemetryConsent(enableAnalytics ? \"granted\" : \"denied\");\n displaySuccessToast(t(I18nKey.SETTINGS$SAVED));\n },\n onError: (error) => {\n const errorMessage = retrieveAxiosErrorMessage(error);\n displayErrorToast(errorMessage || t(I18nKey.ERROR$GENERIC));\n },\n onSettled: () => {\n setLanguageInputHasChanged(false);\n setAnalyticsSwitchHasChanged(false);\n setSoundNotificationsSwitchHasChanged(false);\n setGitUserNameHasChanged(false);\n setGitUserEmailHasChanged(false);\n setTitleLlmProfileInput(undefined);\n },\n },\n );\n };\n\n const checkIfLanguageInputHasChanged = (value: string) => {\n const selectedLanguage = AvailableLanguages.find(\n ({ label: langValue }) => langValue === value,\n )?.label;\n const currentLanguage = AvailableLanguages.find(\n ({ value: langValue }) => langValue === settings?.language,\n )?.label;\n\n setLanguageInputHasChanged(selectedLanguage !== currentLanguage);\n };\n\n const checkIfAnalyticsSwitchHasChanged = (checked: boolean) => {\n // Treat null as true since analytics is opt-in by default\n const currentAnalytics = settings?.user_consents_to_analytics ?? true;\n setAnalyticsSwitchHasChanged(checked !== currentAnalytics);\n };\n\n const checkIfSoundNotificationsSwitchHasChanged = (checked: boolean) => {\n const currentSoundNotifications = !!settings?.enable_sound_notifications;\n setSoundNotificationsSwitchHasChanged(\n checked !== currentSoundNotifications,\n );\n };\n\n const checkIfGitUserNameHasChanged = (value: string) => {\n const currentValue = settings?.git_user_name;\n setGitUserNameHasChanged(value !== currentValue);\n };\n\n const checkIfGitUserEmailHasChanged = (value: string) => {\n const currentValue = settings?.git_user_email;\n setGitUserEmailHasChanged(value !== currentValue);\n };\n\n const formIsClean =\n !languageInputHasChanged &&\n !analyticsSwitchHasChanged &&\n !soundNotificationsSwitchHasChanged &&\n selectedTitleLlmProfile === storedTitleLlmProfile &&\n !gitUserNameHasChanged &&\n !gitUserEmailHasChanged;\n\n const shouldBeLoading =\n !settings || isLoading || areLlmProfilesLoading || isPending;\n\n return (\n <form\n data-testid=\"app-settings-screen\"\n action={formAction}\n className=\"flex flex-col gap-6\"\n >\n {shouldBeLoading && <AppSettingsInputsSkeleton />}\n {!shouldBeLoading && (\n <div className=\"flex flex-col gap-6\">\n <LanguageInput\n name=\"language-input\"\n defaultKey={settings.language}\n onChange={checkIfLanguageInputHasChanged}\n />\n\n <ThemeInput />\n\n <SettingsSwitch\n testId=\"enable-analytics-switch\"\n name={isCloudBackend ? undefined : \"enable-analytics-switch\"}\n defaultIsToggled={\n isCloudBackend\n ? true\n : (settings.user_consents_to_analytics ?? true)\n }\n isToggled={isCloudBackend ? true : undefined}\n isDisabled={isCloudBackend}\n onToggle={\n isCloudBackend ? undefined : checkIfAnalyticsSwitchHasChanged\n }\n >\n {t(I18nKey.ANALYTICS$SEND_ANONYMOUS_DATA)}\n </SettingsSwitch>\n\n <SettingsSwitch\n testId=\"enable-sound-notifications-switch\"\n name=\"enable-sound-notifications-switch\"\n defaultIsToggled={!!settings.enable_sound_notifications}\n onToggle={checkIfSoundNotificationsSwitchHasChanged}\n >\n {t(I18nKey.SETTINGS$SOUND_NOTIFICATIONS)}\n </SettingsSwitch>\n\n <div className=\"border-t border-[var(--oh-border)] pt-6 mt-2\">\n <h3 className=\"text-lg font-medium mb-2\">\n {t(I18nKey.SETTINGS$CONVERSATION_TITLES)}\n </h3>\n <p className=\"mb-4 text-sm leading-5 text-tertiary-light\">\n {t(I18nKey.SETTINGS$TITLE_GENERATION_DESCRIPTION)}\n </p>\n <SettingsDropdownInput\n testId=\"title-llm-profile-input\"\n name=\"title-llm-profile-input\"\n label={t(I18nKey.SETTINGS$TITLE_GENERATION_MODEL)}\n items={titleLlmProfileItems}\n selectedKey={\n selectedTitleLlmProfile ?? AUTOMATIC_TITLE_LLM_PROFILE_KEY\n }\n onSelectionChange={(key) => {\n const value = key?.toString();\n setTitleLlmProfileInput(\n !value || value === AUTOMATIC_TITLE_LLM_PROFILE_KEY\n ? null\n : value,\n );\n }}\n />\n <NavigationLink\n to=\"/settings/llm\"\n className=\"mt-3 inline-block text-sm text-primary hover:underline\"\n >\n {t(I18nKey.SETTINGS$MANAGE_LLM_PROFILES)}\n </NavigationLink>\n </div>\n\n <div className=\"border-t border-[var(--oh-border)] pt-6 mt-2\">\n <h3 className=\"text-lg font-medium mb-2\">\n {t(I18nKey.SETTINGS$GIT_SETTINGS)}\n </h3>\n <p className=\"mb-4 text-sm leading-5 text-tertiary-light\">\n {t(I18nKey.SETTINGS$GIT_SETTINGS_DESCRIPTION)}\n </p>\n <div className=\"flex flex-col gap-6\">\n <SettingsInput\n testId=\"git-user-name-input\"\n name=\"git-user-name-input\"\n type=\"text\"\n label={t(I18nKey.SETTINGS$GIT_USERNAME)}\n defaultValue={settings.git_user_name || \"\"}\n onChange={checkIfGitUserNameHasChanged}\n placeholder={t(I18nKey.SETTINGS$GIT_USERNAME_PLACEHOLDER)}\n className=\"w-full min-w-0\"\n />\n <SettingsInput\n testId=\"git-user-email-input\"\n name=\"git-user-email-input\"\n type=\"email\"\n label={t(I18nKey.SETTINGS$GIT_EMAIL)}\n defaultValue={settings.git_user_email || \"\"}\n onChange={checkIfGitUserEmailHasChanged}\n placeholder={t(I18nKey.SETTINGS$GIT_EMAIL_PLACEHOLDER)}\n className=\"w-full min-w-0\"\n />\n </div>\n <div className=\"flex justify-start pt-4\">\n <BrandButton\n testId=\"submit-button\"\n variant=\"primary\"\n type=\"submit\"\n isDisabled={isPending || formIsClean}\n >\n {!isPending && t(I18nKey.SETTINGS$SAVE_CHANGES)}\n {isPending && t(I18nKey.SETTINGS$SAVING)}\n </BrandButton>\n </div>\n </div>\n </div>\n )}\n </form>\n );\n}\n\nexport default AppSettingsScreen;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,IAAkC;AAExC,SAAgB,IAAoB;CAClC,IAAM,EAAE,SAAM,EAAe,WAAW,GAElC,EAAE,QAAQ,GAAc,iBAAc,EAAgB,GACtD,EAAE,MAAM,GAAU,iBAAc,EAAY,GAE5C,IADgB,EACC,EAAc,QAAQ,SAAS,SAChD,EAAE,MAAM,GAAa,WAAW,MACpC,EAAe,GAEX,CAAC,IAAyB,KAC9B,EAAM,SAAS,EAAK,GAChB,CAAC,GAA2B,KAChC,EAAM,SAAS,EAAK,GAChB,CACJ,GACA,KACE,EAAM,SAAS,EAAK,GAClB,CAAC,GAAuB,KAC5B,EAAM,SAAS,EAAK,GAChB,CAAC,GAAwB,KAC7B,EAAM,SAAS,EAAK,GAChB,CAAC,GAAsB,KAA2B,EAAM,SAE5D,KAAA,CAAS,GAEL,IAAwB,EAAM,cAAc;EAChD,IAAM,IAAa,GAAU,qBAAqB;EAElD,OADI,CAAC,KAAc,CAAC,KACb,EAAY,SAAS,MAAM,MAAY,EAAQ,SAAS,CAAU,IADjC,IAGpC;CAC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C5B;;MACV,CAAA;KACF;;GACF;IAEH;;AAEV"}
|
|
@@ -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("../services/settings.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/info.cjs"),i=require("../services/settings.cjs"),a=require("../constants/llm-subscription.cjs"),o=require("../utils/format-model-name.cjs"),s=require("../hooks/query/use-settings.cjs"),c=require("../components/features/settings/settings-input.cjs"),l=require("../components/features/settings/settings-dropdown-input.cjs"),u=require("../utils/extract-model-and-provider.cjs"),d=require("../ui/help-link.cjs"),f=require("../components/shared/modals/settings/model-selector.cjs"),p=require("../hooks/query/use-agent-settings-schema.cjs"),m=require("../components/features/settings/llm-settings/openai-subscription-auth-card.cjs"),h=require("../components/features/settings/key-status-icon.cjs"),g=require("../utils/sdk-settings-schema.cjs"),_=require("../components/features/settings/sdk-settings/sdk-section-page.cjs");require("../components/features/settings/llm-profiles/index.cjs");const v=require("../hooks/query/use-llm-subscription-models.cjs");let y=require("react");y=e.__toESM(y,1);let b=require("react/jsx-runtime");var x=new Set([`llm.model`,`llm.api_key`,`llm.base_url`,a.LLM_AUTH_TYPE_KEY,a.LLM_SUBSCRIPTION_VENDOR_KEY]),S=(e,t)=>!e||!t?null:`${e}/${t}`,C=(e,t)=>e?.sections.flatMap(e=>e.fields).find(e=>e.key===t)?.default??null,w={openai:new Set([`https://api.openai.com`,`https://api.openai.com/v1`]),moonshot:new Set([`https://api.kimi.com/coding/v1`])},T=e=>{try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``)||``;return`${t.origin}${n}`}catch{return e.trim().replace(/\/+$/,``)}},E=(e,t)=>{let n=T(t),{provider:r}=u.extractModelAndProvider(e);if(r){let e=w[r];if(e)return e.has(n)}return Object.values(w).some(e=>e?.has(n))};function D({testId:e}){let{t:r}=t.useTranslation(`openhands`);return(0,b.jsx)(d.HelpLink,{testId:e,text:r(n.I18nKey.SETTINGS$OPENHANDS_API_KEY_HELP_TEXT),linkText:r(n.I18nKey.SETTINGS$NAV_API_KEYS),href:`https://app.all-hands.dev/settings/api-keys`,suffix:` ${r(n.I18nKey.SETTINGS$OPENHANDS_API_KEY_HELP_SUFFIX)}`})}function O(){return(0,b.jsxs)(`p`,{"data-testid":`openhands-free-models-note`,className:`flex items-start gap-2 text-xs text-warning`,children:[(0,b.jsx)(r.Info,{className:`mt-0.5 size-4 shrink-0 text-warning`,"aria-hidden":!0}),(0,b.jsx)(`span`,{children:o.FREE_OPENHANDS_MODEL_NOTE})]})}function k({scope:e=`personal`,onSaveSuccess:r,initialValueOverrides:u,embedded:w,hideSaveButton:T,suppressSuccessToast:k,onSaveControlChange:A}){let{t:j}=t.useTranslation(`openhands`),{data:M}=s.useSettings(e),{data:N}=p.useAgentSettingsSchema(M?.agent_settings_schema),P=M?.agent_settings?.llm,F=a.resolveLlmAuthType(u?.[`llm.auth_type`]??P?.auth_type),[I,L]=y.default.useState(F===a.LLM_AUTH_TYPE_SUBSCRIPTION),{data:R,isLoading:z,isFetching:B}=v.useOpenAISubscriptionModels({enabled:I}),V=I&&!R&&(z||B),H=y.default.useRef(null),U=y.default.useRef(null);y.default.useEffect(()=>{F===`subscription`&&L(!0)},[F]);let W=String(i.DEFAULT_SETTINGS.agent_settings?.llm?.model??``),G=y.default.useCallback((e,t)=>{let n=g.inferInitialView(e,t);if(n!==`basic`)return n;let r=e.llm_model??``,i=e.llm_base_url?.trim()??``;return i.length>0&&!E(r,i)?`all`:`basic`},[]),K=y.default.useCallback(({values:e,isDisabled:t,view:r,onChange:i})=>{let s=typeof e[`llm.model`]==`string`?e[`llm.model`]:``,u=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,p=s.startsWith(`openhands/`),g=a.resolveLlmAuthType(e[a.LLM_AUTH_TYPE_KEY]),_=g===a.LLM_AUTH_TYPE_SUBSCRIPTION,v=t||_&&V,y=R?.includes(s)?s:R?.[0]??``,x=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,C=w?x.length>0:!!M?.llm_api_key_set,T=(e,r)=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c.SettingsInput,{testId:e,label:j(n.I18nKey.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,value:x,placeholder:C?`<hidden>`:``,onChange:e=>i(`llm.api_key`,e),isDisabled:t,startContent:C?(0,b.jsx)(h.KeyStatusIcon,{isSet:C}):void 0}),(0,b.jsx)(d.HelpLink,{testId:r,text:j(n.I18nKey.SETTINGS$DONT_KNOW_API_KEY),linkText:j(n.I18nKey.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`})]}),E=e=>{let t=e===`subscription`?a.LLM_AUTH_TYPE_SUBSCRIPTION:a.LLM_AUTH_TYPE_API_KEY;if(i(a.LLM_AUTH_TYPE_KEY,t),t===`subscription`){L(!0),s&&!R?.includes(s)&&(H.current=s);let e=U.current&&R?.includes(U.current)?U.current:R?.[0];i(a.LLM_SUBSCRIPTION_VENDOR_KEY,a.OPENAI_SUBSCRIPTION_VENDOR),!R?.includes(s)&&e&&i(`llm.model`,e);return}s&&R?.includes(s)&&(U.current=s,i(`llm.model`,H.current??W))},k=()=>(0,b.jsx)(l.SettingsDropdownInput,{testId:`llm-auth-type-input`,name:a.LLM_AUTH_TYPE_KEY,label:j(n.I18nKey.SETTINGS$LLM_AUTH_TYPE),items:[{key:a.LLM_AUTH_TYPE_API_KEY,label:j(n.I18nKey.SETTINGS$LLM_AUTH_TYPE_API_KEY)},{key:a.LLM_AUTH_TYPE_SUBSCRIPTION,label:j(n.I18nKey.SETTINGS$LLM_AUTH_TYPE_SUBSCRIPTION)}],selectedKey:g,isClearable:!1,required:!0,isDisabled:v,onSelectionChange:E}),A=()=>(0,b.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-subscription-settings`,children:[(0,b.jsx)(l.SettingsDropdownInput,{testId:`llm-subscription-model-input`,name:`llm.subscription_model`,label:j(n.I18nKey.SETTINGS$SUBSCRIPTION_MODEL),items:(R??[]).map(e=>({key:e,label:e})),selectedKey:y,isClearable:!1,required:!0,isDisabled:v||!R?.length,onSelectionChange:e=>{let t=typeof e==`string`?e:R?.[0];t&&i(`llm.model`,t)}}),(0,b.jsx)(m.OpenAISubscriptionAuthCard,{isDisabled:t})]});return(0,b.jsx)(`div`,{className:`flex flex-col gap-6`,children:r===`basic`?(0,b.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-settings-form-basic`,children:[k(),_?A():(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.ModelSelector,{currentModel:s||void 0,onChange:(e,t)=>{let n=S(e,t);n&&i(`llm.model`,n)},wrapperClassName:`!flex-col !gap-6`,isDisabled:t}),p?(0,b.jsx)(D,{testId:`openhands-api-key-help`}):null,T(`llm-api-key-input`,`llm-api-key-help-anchor`)]})]}):(0,b.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-settings-form-advanced`,children:[k(),_?A():(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c.SettingsInput,{testId:`llm-custom-model-input`,label:j(n.I18nKey.SETTINGS$CUSTOM_MODEL),type:`text`,className:`w-full`,value:s,placeholder:W,onChange:e=>i(`llm.model`,e),isDisabled:t}),p?(0,b.jsxs)(b.Fragment,{children:[o.isFreeOpenHandsModel(s)?(0,b.jsx)(O,{}):null,(0,b.jsx)(D,{testId:`openhands-api-key-help-2`})]}):null,(0,b.jsx)(c.SettingsInput,{testId:`base-url-input`,label:j(n.I18nKey.SETTINGS$BASE_URL),type:`text`,className:`w-full`,value:u,placeholder:`https://api.openai.com`,onChange:e=>i(`llm.base_url`,e),isDisabled:t}),T(`llm-api-key-input`,`llm-api-key-help-anchor-advanced`)]})]})})},[W,w,V,M?.llm_api_key_set,R,j]),q=y.default.useCallback((e,t)=>{let n=structuredClone(e.agent_settings_diff??{}),r=n.llm??{};if(a.resolveLlmAuthType(t.values[`llm.auth_type`])===`subscription`){r.auth_type=a.LLM_AUTH_TYPE_SUBSCRIPTION,r.subscription_vendor=a.OPENAI_SUBSCRIPTION_VENDOR;let e=typeof r.model==`string`?r.model:String(t.values[`llm.model`]??``),n=R?.[0];if(!R?.includes(e)&&!n)throw Error(`Subscription models are not loaded yet.`);r.model=R?.includes(e)?e:n,delete r.api_key,delete r.base_url}else t.dirty[`llm.auth_type`]&&(r.auth_type=a.LLM_AUTH_TYPE_API_KEY,r.subscription_vendor=null),t.view===`basic`&&r.model!==void 0&&(r.base_url=C(N,`llm.base_url`));return n.llm=r,{agent_settings_diff:n}},[N,R]);return(0,b.jsx)(_.SdkSectionPage,{scope:e,settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`llm`],excludeKeys:x}],header:K,buildPayload:q,getInitialView:G,forceShowAdvancedView:!0,allowAllView:!0,onSaveSuccess:r,initialValueOverrides:u,embedded:w,hideSaveButton:T,suppressSuccessToast:k,onSaveControlChange:A,testId:`llm-settings-screen`})}exports.LlmSettingsScreen=k;
|
|
2
2
|
//# sourceMappingURL=llm-settings.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-settings.cjs","names":[],"sources":["../../src/routes/llm-settings.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ModelSelector } from \"#/components/shared/modals/settings/model-selector\";\nimport { useAgentSettingsSchema } from \"#/hooks/query/use-agent-settings-schema\";\nimport { useSettings } from \"#/hooks/query/use-settings\";\nimport { SettingsInput } from \"#/components/features/settings/settings-input\";\nimport { SettingsDropdownInput } from \"#/components/features/settings/settings-dropdown-input\";\nimport { OpenAISubscriptionAuthCard } from \"#/components/features/settings/llm-settings/openai-subscription-auth-card\";\nimport { HelpLink } from \"#/ui/help-link\";\nimport { KeyStatusIcon } from \"#/components/features/settings/key-status-icon\";\nimport {\n SdkSectionHeaderProps,\n SdkSectionPage,\n SdkSectionSaveControl,\n} from \"#/components/features/settings/sdk-settings/sdk-section-page\";\nimport { LlmSettingsLocalView } from \"#/components/features/settings/llm-profiles\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { Settings, SettingsSchema, SettingsScope } from \"#/types/settings\";\nimport { extractModelAndProvider } from \"#/utils/extract-model-and-provider\";\nimport {\n inferInitialView,\n type SettingsFormValues,\n type SettingsView,\n} from \"#/utils/sdk-settings-schema\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport {\n LLM_AUTH_TYPE_API_KEY,\n LLM_AUTH_TYPE_KEY,\n LLM_AUTH_TYPE_SUBSCRIPTION,\n LLM_SUBSCRIPTION_VENDOR_KEY,\n OPENAI_SUBSCRIPTION_VENDOR,\n resolveLlmAuthType,\n} from \"#/constants/llm-subscription\";\nimport { useOpenAISubscriptionModels } from \"#/hooks/query/use-llm-subscription-models\";\n\nconst LLM_EXCLUDED_KEYS = new Set([\n \"llm.model\",\n \"llm.api_key\",\n \"llm.base_url\",\n LLM_AUTH_TYPE_KEY,\n LLM_SUBSCRIPTION_VENDOR_KEY,\n]);\n\nconst buildModelId = (provider: string | null, model: string | null) => {\n if (!provider || !model) return null;\n return `${provider}/${model}`;\n};\n\nconst getSchemaFieldDefaultValue = (\n schema: SettingsSchema | null | undefined,\n fieldKey: string,\n) =>\n schema?.sections\n .flatMap((section) => section.fields)\n .find((field) => field.key === fieldKey)?.default ?? null;\n\nconst KNOWN_PROVIDER_DEFAULT_BASE_URLS: Partial<Record<string, Set<string>>> = {\n openai: new Set([\"https://api.openai.com\", \"https://api.openai.com/v1\"]),\n moonshot: new Set([\"https://api.kimi.com/coding/v1\"]),\n};\n\nconst normalizeBaseUrl = (baseUrl: string) => {\n try {\n const parsedUrl = new URL(baseUrl);\n const normalizedPath = parsedUrl.pathname.replace(/\\/+$/, \"\") || \"\";\n return `${parsedUrl.origin}${normalizedPath}`;\n } catch {\n return baseUrl.trim().replace(/\\/+$/, \"\");\n }\n};\n\nconst isProviderDefaultBaseUrl = (model: string, baseUrl: string) => {\n const normalizedBaseUrl = normalizeBaseUrl(baseUrl);\n const { provider } = extractModelAndProvider(model);\n\n if (provider) {\n const knownDefaults = KNOWN_PROVIDER_DEFAULT_BASE_URLS[provider];\n if (knownDefaults) {\n return knownDefaults.has(normalizedBaseUrl);\n }\n }\n\n return Object.values(KNOWN_PROVIDER_DEFAULT_BASE_URLS).some((knownDefaults) =>\n knownDefaults?.has(normalizedBaseUrl),\n );\n};\n\ninterface OpenHandsApiKeyHelpProps {\n testId: string;\n}\n\nfunction OpenHandsApiKeyHelp({ testId }: OpenHandsApiKeyHelpProps) {\n const { t } = useTranslation(\"openhands\");\n\n return (\n <HelpLink\n testId={testId}\n text={t(I18nKey.SETTINGS$OPENHANDS_API_KEY_HELP_TEXT)}\n linkText={t(I18nKey.SETTINGS$NAV_API_KEYS)}\n href=\"https://app.all-hands.dev/settings/api-keys\"\n suffix={` ${t(I18nKey.SETTINGS$OPENHANDS_API_KEY_HELP_SUFFIX)}`}\n />\n );\n}\n\nexport function LlmSettingsScreen({\n scope = \"personal\",\n onSaveSuccess,\n initialValueOverrides,\n embedded,\n hideSaveButton,\n suppressSuccessToast,\n onSaveControlChange,\n}: {\n scope?: SettingsScope;\n /** Optional hook fired after a successful save (e.g. advance an onboarding step). */\n onSaveSuccess?: () => void;\n /** Forwarded to {@link SdkSectionPage}. */\n initialValueOverrides?: SettingsFormValues;\n /** Forwarded to {@link SdkSectionPage}. */\n embedded?: boolean;\n /** Forwarded to {@link SdkSectionPage}. */\n hideSaveButton?: boolean;\n /** Forwarded to {@link SdkSectionPage}. */\n suppressSuccessToast?: boolean;\n /** Forwarded to {@link SdkSectionPage}. */\n onSaveControlChange?: (control: SdkSectionSaveControl) => void;\n}) {\n const { t } = useTranslation(\"openhands\");\n\n const { data: settings } = useSettings(scope);\n const { data: schema } = useAgentSettingsSchema(\n settings?.agent_settings_schema,\n );\n const persistedLlmSettings = settings?.agent_settings?.llm as\n | Record<string, unknown>\n | undefined;\n const initialAuthType = resolveLlmAuthType(\n initialValueOverrides?.[LLM_AUTH_TYPE_KEY] ??\n persistedLlmSettings?.auth_type,\n );\n const [enableSubscriptionModels, setEnableSubscriptionModels] =\n React.useState(initialAuthType === LLM_AUTH_TYPE_SUBSCRIPTION);\n const {\n data: subscriptionModels,\n isLoading: isSubscriptionModelsLoading,\n isFetching: isSubscriptionModelsFetching,\n } = useOpenAISubscriptionModels({ enabled: enableSubscriptionModels });\n const isWaitingForSubscriptionModels =\n enableSubscriptionModels &&\n !subscriptionModels &&\n (isSubscriptionModelsLoading || isSubscriptionModelsFetching);\n const lastApiKeyModelRef = React.useRef<string | null>(null);\n const lastSubscriptionModelRef = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n if (initialAuthType === LLM_AUTH_TYPE_SUBSCRIPTION) {\n setEnableSubscriptionModels(true);\n }\n }, [initialAuthType]);\n\n const defaultModel = String(\n (DEFAULT_SETTINGS.agent_settings?.llm as Record<string, unknown>)?.model ??\n \"\",\n );\n\n const getInitialView = React.useCallback(\n (\n currentSettings: Settings,\n filteredSchema: SettingsSchema,\n ): SettingsView => {\n const schemaView = inferInitialView(currentSettings, filteredSchema);\n if (schemaView !== \"basic\") {\n return schemaView;\n }\n\n const currentModel = currentSettings.llm_model ?? \"\";\n const trimmedBaseUrl = currentSettings.llm_base_url?.trim() ?? \"\";\n const hasCustomBaseUrl =\n trimmedBaseUrl.length > 0 &&\n !isProviderDefaultBaseUrl(currentModel, trimmedBaseUrl);\n\n return hasCustomBaseUrl ? \"all\" : \"basic\";\n },\n [],\n );\n\n const buildHeader = React.useCallback(\n ({ values, isDisabled, view, onChange }: SdkSectionHeaderProps) => {\n const modelValue =\n typeof values[\"llm.model\"] === \"string\" ? values[\"llm.model\"] : \"\";\n const baseUrlValue =\n typeof values[\"llm.base_url\"] === \"string\"\n ? values[\"llm.base_url\"]\n : \"\";\n const showOpenHandsApiKeyHelp = modelValue.startsWith(\"openhands/\");\n const authType = resolveLlmAuthType(values[LLM_AUTH_TYPE_KEY]);\n const isSubscriptionAuth = authType === LLM_AUTH_TYPE_SUBSCRIPTION;\n const shouldDisableSubscriptionControls =\n isDisabled || (isSubscriptionAuth && isWaitingForSubscriptionModels);\n const subscriptionModelValue = subscriptionModels?.includes(modelValue)\n ? modelValue\n : (subscriptionModels?.[0] ?? \"\");\n\n const apiKeyValue =\n typeof values[\"llm.api_key\"] === \"string\" ? values[\"llm.api_key\"] : \"\";\n // For embedded profile forms (create/edit) the global\n // `llm_api_key_set` flag is misleading: a brand-new profile would show a\n // \"key set\" indicator just because some other profile has a key. Reflect\n // the form's own key state instead so create mode starts visibly unset.\n const apiKeyIsSet = embedded\n ? apiKeyValue.length > 0\n : Boolean(settings?.llm_api_key_set);\n\n const renderApiKeyInput = (testId: string, helpTestId: string) => (\n <>\n <SettingsInput\n testId={testId}\n label={t(I18nKey.SETTINGS_FORM$API_KEY)}\n type=\"password\"\n className=\"w-full\"\n value={apiKeyValue}\n // eslint-disable-next-line i18next/no-literal-string -- masked-key sentinel, not translatable\n placeholder={apiKeyIsSet ? \"<hidden>\" : \"\"}\n onChange={(value) => onChange(\"llm.api_key\", value)}\n isDisabled={isDisabled}\n startContent={\n apiKeyIsSet ? <KeyStatusIcon isSet={apiKeyIsSet} /> : undefined\n }\n />\n\n <HelpLink\n testId={helpTestId}\n text={t(I18nKey.SETTINGS$DONT_KNOW_API_KEY)}\n linkText={t(I18nKey.SETTINGS$CLICK_FOR_INSTRUCTIONS)}\n href=\"https://docs.openhands.dev/usage/local-setup#getting-an-api-key\"\n />\n </>\n );\n\n const handleAuthTypeChange = (selectedKey: React.Key | null) => {\n const nextAuthType =\n selectedKey === LLM_AUTH_TYPE_SUBSCRIPTION\n ? LLM_AUTH_TYPE_SUBSCRIPTION\n : LLM_AUTH_TYPE_API_KEY;\n onChange(LLM_AUTH_TYPE_KEY, nextAuthType);\n\n if (nextAuthType === LLM_AUTH_TYPE_SUBSCRIPTION) {\n setEnableSubscriptionModels(true);\n if (modelValue && !subscriptionModels?.includes(modelValue)) {\n lastApiKeyModelRef.current = modelValue;\n }\n const restoredSubscriptionModel =\n lastSubscriptionModelRef.current &&\n subscriptionModels?.includes(lastSubscriptionModelRef.current)\n ? lastSubscriptionModelRef.current\n : subscriptionModels?.[0];\n onChange(LLM_SUBSCRIPTION_VENDOR_KEY, OPENAI_SUBSCRIPTION_VENDOR);\n if (\n !subscriptionModels?.includes(modelValue) &&\n restoredSubscriptionModel\n ) {\n onChange(\"llm.model\", restoredSubscriptionModel);\n }\n return;\n }\n\n if (modelValue && subscriptionModels?.includes(modelValue)) {\n lastSubscriptionModelRef.current = modelValue;\n onChange(\"llm.model\", lastApiKeyModelRef.current ?? defaultModel);\n }\n };\n\n const renderAuthTypeInput = () => (\n <SettingsDropdownInput\n testId=\"llm-auth-type-input\"\n name={LLM_AUTH_TYPE_KEY}\n label={t(I18nKey.SETTINGS$LLM_AUTH_TYPE)}\n items={[\n {\n key: LLM_AUTH_TYPE_API_KEY,\n label: t(I18nKey.SETTINGS$LLM_AUTH_TYPE_API_KEY),\n },\n {\n key: LLM_AUTH_TYPE_SUBSCRIPTION,\n label: t(I18nKey.SETTINGS$LLM_AUTH_TYPE_SUBSCRIPTION),\n },\n ]}\n selectedKey={authType}\n isClearable={false}\n required\n isDisabled={shouldDisableSubscriptionControls}\n onSelectionChange={handleAuthTypeChange}\n />\n );\n\n const renderSubscriptionSettings = () => (\n <div\n className=\"flex flex-col gap-6\"\n data-testid=\"llm-subscription-settings\"\n >\n <SettingsDropdownInput\n testId=\"llm-subscription-model-input\"\n name=\"llm.subscription_model\"\n label={t(I18nKey.SETTINGS$SUBSCRIPTION_MODEL)}\n items={(subscriptionModels ?? []).map((model) => ({\n key: model,\n label: model,\n }))}\n selectedKey={subscriptionModelValue}\n isClearable={false}\n required\n isDisabled={\n shouldDisableSubscriptionControls || !subscriptionModels?.length\n }\n onSelectionChange={(selectedKey) => {\n const nextModel =\n typeof selectedKey === \"string\"\n ? selectedKey\n : subscriptionModels?.[0];\n if (nextModel) {\n onChange(\"llm.model\", nextModel);\n }\n }}\n />\n <OpenAISubscriptionAuthCard isDisabled={isDisabled} />\n </div>\n );\n\n return (\n <div className=\"flex flex-col gap-6\">\n {view === \"basic\" ? (\n <div\n className=\"flex flex-col gap-6\"\n data-testid=\"llm-settings-form-basic\"\n >\n {renderAuthTypeInput()}\n\n {isSubscriptionAuth ? (\n renderSubscriptionSettings()\n ) : (\n <>\n <ModelSelector\n currentModel={modelValue || undefined}\n onChange={(provider, model) => {\n const nextModel = buildModelId(provider, model);\n if (nextModel) {\n onChange(\"llm.model\", nextModel);\n }\n }}\n wrapperClassName=\"!flex-col !gap-6\"\n isDisabled={isDisabled}\n />\n\n {showOpenHandsApiKeyHelp ? (\n <OpenHandsApiKeyHelp testId=\"openhands-api-key-help\" />\n ) : null}\n\n {renderApiKeyInput(\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-input\",\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-help-anchor\",\n )}\n </>\n )}\n </div>\n ) : (\n <div\n className=\"flex flex-col gap-6\"\n data-testid=\"llm-settings-form-advanced\"\n >\n {renderAuthTypeInput()}\n\n {isSubscriptionAuth ? (\n renderSubscriptionSettings()\n ) : (\n <>\n <SettingsInput\n testId=\"llm-custom-model-input\"\n label={t(I18nKey.SETTINGS$CUSTOM_MODEL)}\n type=\"text\"\n className=\"w-full\"\n value={modelValue}\n placeholder={defaultModel}\n onChange={(value) => onChange(\"llm.model\", value)}\n isDisabled={isDisabled}\n />\n\n {showOpenHandsApiKeyHelp ? (\n <OpenHandsApiKeyHelp testId=\"openhands-api-key-help-2\" />\n ) : null}\n\n <SettingsInput\n testId=\"base-url-input\"\n label={t(I18nKey.SETTINGS$BASE_URL)}\n type=\"text\"\n className=\"w-full\"\n value={baseUrlValue}\n // eslint-disable-next-line i18next/no-literal-string -- example value, not translatable\n placeholder=\"https://api.openai.com\"\n onChange={(value) => onChange(\"llm.base_url\", value)}\n isDisabled={isDisabled}\n />\n\n {renderApiKeyInput(\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-input\",\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-help-anchor-advanced\",\n )}\n </>\n )}\n </div>\n )}\n </div>\n );\n },\n [\n defaultModel,\n embedded,\n isWaitingForSubscriptionModels,\n settings?.llm_api_key_set,\n subscriptionModels,\n t,\n ],\n );\n\n const buildPayload = React.useCallback(\n (\n defaultPayload: Record<string, unknown>,\n context: {\n values: Record<string, string | boolean>;\n dirty: Record<string, boolean>;\n view: SettingsView;\n },\n ) => {\n // defaultPayload is the wrapped diff (e.g.\n // `{ agent_settings_diff: { llm: { model: \"gpt-4\" } } }`); we only\n // mutate the inner `llm` object below.\n const agentSettings = structuredClone(\n (defaultPayload.agent_settings_diff as Record<string, unknown>) ?? {},\n );\n const llm = (agentSettings.llm ?? {}) as Record<string, unknown>;\n const authType = resolveLlmAuthType(context.values[LLM_AUTH_TYPE_KEY]);\n\n if (authType === LLM_AUTH_TYPE_SUBSCRIPTION) {\n llm.auth_type = LLM_AUTH_TYPE_SUBSCRIPTION;\n llm.subscription_vendor = OPENAI_SUBSCRIPTION_VENDOR;\n const model =\n typeof llm.model === \"string\"\n ? llm.model\n : String(context.values[\"llm.model\"] ?? \"\");\n const fallbackSubscriptionModel = subscriptionModels?.[0];\n if (\n !subscriptionModels?.includes(model) &&\n !fallbackSubscriptionModel\n ) {\n throw new Error(\"Subscription models are not loaded yet.\");\n }\n llm.model = subscriptionModels?.includes(model)\n ? model\n : fallbackSubscriptionModel;\n delete llm.api_key;\n delete llm.base_url;\n } else {\n if (context.dirty[LLM_AUTH_TYPE_KEY]) {\n llm.auth_type = LLM_AUTH_TYPE_API_KEY;\n llm.subscription_vendor = null;\n }\n if (context.view === \"basic\" && llm.model !== undefined) {\n llm.base_url = getSchemaFieldDefaultValue(schema, \"llm.base_url\");\n }\n }\n\n agentSettings.llm = llm;\n return { agent_settings_diff: agentSettings };\n },\n [schema, subscriptionModels],\n );\n\n return (\n <SdkSectionPage\n scope={scope}\n settingsSources={[\n {\n settingsSource: \"agent_settings\",\n sectionKeys: [\"llm\"],\n excludeKeys: LLM_EXCLUDED_KEYS,\n },\n ]}\n header={buildHeader}\n buildPayload={buildPayload}\n getInitialView={getInitialView}\n forceShowAdvancedView\n allowAllView\n onSaveSuccess={onSaveSuccess}\n initialValueOverrides={initialValueOverrides}\n embedded={embedded}\n hideSaveButton={hideSaveButton}\n suppressSuccessToast={suppressSuccessToast}\n onSaveControlChange={onSaveControlChange}\n testId=\"llm-settings-screen\"\n />\n );\n}\n\n/**\n * Default export for the route renders the LLM-profile management view for both\n * backend types. Both manage the LLM through named profiles — local via the\n * agent-server (`/api/profiles`), cloud via the app-server\n * (`/api/v1/settings/profiles`) — and the view is backend-agnostic because it\n * goes through ProfilesService, which routes per active backend.\n *\n * The LlmSettingsScreen component is also exported for embedded use cases\n * (e.g., onboarding, the profile create/edit form).\n *\n * Note: This is a route file, only the router should import the default export.\n * Other consumers should use the named export `LlmSettingsScreen` for embedded\n * use cases.\n */\nexport default function LlmSettingsRoute() {\n return <LlmSettingsLocalView />;\n}\n"],"mappings":"ymCAmCA,IAAM,EAAoB,IAAI,IAAI,CAChC,YACA,cACA,eACA,EAAA,kBACA,EAAA,2BACF,CAAC,EAEK,GAAgB,EAAyB,IACzC,CAAC,GAAY,CAAC,EAAc,KACzB,GAAG,EAAS,GAAG,IAGlB,GACJ,EACA,IAEA,GAAQ,SACL,QAAS,GAAY,EAAQ,MAAM,EACnC,KAAM,GAAU,EAAM,MAAQ,CAAQ,GAAG,SAAW,KAEnD,EAAyE,CAC7E,OAAQ,IAAI,IAAI,CAAC,yBAA0B,2BAA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ChB,YAAa,CAAC,KAAK,EACnB,YAAa,CACf,CACF,EACA,OAAQ,EACM,eACE,iBAChB,sBAAA,GACA,aAAA,GACe,gBACQ,wBACb,WACM,iBACM,uBACD,sBACrB,OAAO,qBACR,CAAA,CAEL"}
|
|
1
|
+
{"version":3,"file":"llm-settings.cjs","names":[],"sources":["../../src/routes/llm-settings.tsx"],"sourcesContent":["import React from \"react\";\nimport { Info } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ModelSelector } from \"#/components/shared/modals/settings/model-selector\";\nimport { useAgentSettingsSchema } from \"#/hooks/query/use-agent-settings-schema\";\nimport { useSettings } from \"#/hooks/query/use-settings\";\nimport { SettingsInput } from \"#/components/features/settings/settings-input\";\nimport { SettingsDropdownInput } from \"#/components/features/settings/settings-dropdown-input\";\nimport { OpenAISubscriptionAuthCard } from \"#/components/features/settings/llm-settings/openai-subscription-auth-card\";\nimport { HelpLink } from \"#/ui/help-link\";\nimport { KeyStatusIcon } from \"#/components/features/settings/key-status-icon\";\nimport {\n SdkSectionHeaderProps,\n SdkSectionPage,\n SdkSectionSaveControl,\n} from \"#/components/features/settings/sdk-settings/sdk-section-page\";\nimport { LlmSettingsLocalView } from \"#/components/features/settings/llm-profiles\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { Settings, SettingsSchema, SettingsScope } from \"#/types/settings\";\nimport { extractModelAndProvider } from \"#/utils/extract-model-and-provider\";\nimport {\n inferInitialView,\n type SettingsFormValues,\n type SettingsView,\n} from \"#/utils/sdk-settings-schema\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport {\n LLM_AUTH_TYPE_API_KEY,\n LLM_AUTH_TYPE_KEY,\n LLM_AUTH_TYPE_SUBSCRIPTION,\n LLM_SUBSCRIPTION_VENDOR_KEY,\n OPENAI_SUBSCRIPTION_VENDOR,\n resolveLlmAuthType,\n} from \"#/constants/llm-subscription\";\nimport { useOpenAISubscriptionModels } from \"#/hooks/query/use-llm-subscription-models\";\nimport {\n FREE_OPENHANDS_MODEL_NOTE,\n isFreeOpenHandsModel,\n} from \"#/utils/format-model-name\";\n\nconst LLM_EXCLUDED_KEYS = new Set([\n \"llm.model\",\n \"llm.api_key\",\n \"llm.base_url\",\n LLM_AUTH_TYPE_KEY,\n LLM_SUBSCRIPTION_VENDOR_KEY,\n]);\n\nconst buildModelId = (provider: string | null, model: string | null) => {\n if (!provider || !model) return null;\n return `${provider}/${model}`;\n};\n\nconst getSchemaFieldDefaultValue = (\n schema: SettingsSchema | null | undefined,\n fieldKey: string,\n) =>\n schema?.sections\n .flatMap((section) => section.fields)\n .find((field) => field.key === fieldKey)?.default ?? null;\n\nconst KNOWN_PROVIDER_DEFAULT_BASE_URLS: Partial<Record<string, Set<string>>> = {\n openai: new Set([\"https://api.openai.com\", \"https://api.openai.com/v1\"]),\n moonshot: new Set([\"https://api.kimi.com/coding/v1\"]),\n};\n\nconst normalizeBaseUrl = (baseUrl: string) => {\n try {\n const parsedUrl = new URL(baseUrl);\n const normalizedPath = parsedUrl.pathname.replace(/\\/+$/, \"\") || \"\";\n return `${parsedUrl.origin}${normalizedPath}`;\n } catch {\n return baseUrl.trim().replace(/\\/+$/, \"\");\n }\n};\n\nconst isProviderDefaultBaseUrl = (model: string, baseUrl: string) => {\n const normalizedBaseUrl = normalizeBaseUrl(baseUrl);\n const { provider } = extractModelAndProvider(model);\n\n if (provider) {\n const knownDefaults = KNOWN_PROVIDER_DEFAULT_BASE_URLS[provider];\n if (knownDefaults) {\n return knownDefaults.has(normalizedBaseUrl);\n }\n }\n\n return Object.values(KNOWN_PROVIDER_DEFAULT_BASE_URLS).some((knownDefaults) =>\n knownDefaults?.has(normalizedBaseUrl),\n );\n};\n\ninterface OpenHandsApiKeyHelpProps {\n testId: string;\n}\n\nfunction OpenHandsApiKeyHelp({ testId }: OpenHandsApiKeyHelpProps) {\n const { t } = useTranslation(\"openhands\");\n\n return (\n <HelpLink\n testId={testId}\n text={t(I18nKey.SETTINGS$OPENHANDS_API_KEY_HELP_TEXT)}\n linkText={t(I18nKey.SETTINGS$NAV_API_KEYS)}\n href=\"https://app.all-hands.dev/settings/api-keys\"\n suffix={` ${t(I18nKey.SETTINGS$OPENHANDS_API_KEY_HELP_SUFFIX)}`}\n />\n );\n}\n\nfunction OpenHandsFreeModelsNote() {\n return (\n <p\n data-testid=\"openhands-free-models-note\"\n className=\"flex items-start gap-2 text-xs text-warning\"\n >\n <Info className=\"mt-0.5 size-4 shrink-0 text-warning\" aria-hidden />\n <span>{FREE_OPENHANDS_MODEL_NOTE}</span>\n </p>\n );\n}\n\nexport function LlmSettingsScreen({\n scope = \"personal\",\n onSaveSuccess,\n initialValueOverrides,\n embedded,\n hideSaveButton,\n suppressSuccessToast,\n onSaveControlChange,\n}: {\n scope?: SettingsScope;\n /** Optional hook fired after a successful save (e.g. advance an onboarding step). */\n onSaveSuccess?: () => void;\n /** Forwarded to {@link SdkSectionPage}. */\n initialValueOverrides?: SettingsFormValues;\n /** Forwarded to {@link SdkSectionPage}. */\n embedded?: boolean;\n /** Forwarded to {@link SdkSectionPage}. */\n hideSaveButton?: boolean;\n /** Forwarded to {@link SdkSectionPage}. */\n suppressSuccessToast?: boolean;\n /** Forwarded to {@link SdkSectionPage}. */\n onSaveControlChange?: (control: SdkSectionSaveControl) => void;\n}) {\n const { t } = useTranslation(\"openhands\");\n\n const { data: settings } = useSettings(scope);\n const { data: schema } = useAgentSettingsSchema(\n settings?.agent_settings_schema,\n );\n const persistedLlmSettings = settings?.agent_settings?.llm as\n | Record<string, unknown>\n | undefined;\n const initialAuthType = resolveLlmAuthType(\n initialValueOverrides?.[LLM_AUTH_TYPE_KEY] ??\n persistedLlmSettings?.auth_type,\n );\n const [enableSubscriptionModels, setEnableSubscriptionModels] =\n React.useState(initialAuthType === LLM_AUTH_TYPE_SUBSCRIPTION);\n const {\n data: subscriptionModels,\n isLoading: isSubscriptionModelsLoading,\n isFetching: isSubscriptionModelsFetching,\n } = useOpenAISubscriptionModels({ enabled: enableSubscriptionModels });\n const isWaitingForSubscriptionModels =\n enableSubscriptionModels &&\n !subscriptionModels &&\n (isSubscriptionModelsLoading || isSubscriptionModelsFetching);\n const lastApiKeyModelRef = React.useRef<string | null>(null);\n const lastSubscriptionModelRef = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n if (initialAuthType === LLM_AUTH_TYPE_SUBSCRIPTION) {\n setEnableSubscriptionModels(true);\n }\n }, [initialAuthType]);\n\n const defaultModel = String(\n (DEFAULT_SETTINGS.agent_settings?.llm as Record<string, unknown>)?.model ??\n \"\",\n );\n\n const getInitialView = React.useCallback(\n (\n currentSettings: Settings,\n filteredSchema: SettingsSchema,\n ): SettingsView => {\n const schemaView = inferInitialView(currentSettings, filteredSchema);\n if (schemaView !== \"basic\") {\n return schemaView;\n }\n\n const currentModel = currentSettings.llm_model ?? \"\";\n const trimmedBaseUrl = currentSettings.llm_base_url?.trim() ?? \"\";\n const hasCustomBaseUrl =\n trimmedBaseUrl.length > 0 &&\n !isProviderDefaultBaseUrl(currentModel, trimmedBaseUrl);\n\n return hasCustomBaseUrl ? \"all\" : \"basic\";\n },\n [],\n );\n\n const buildHeader = React.useCallback(\n ({ values, isDisabled, view, onChange }: SdkSectionHeaderProps) => {\n const modelValue =\n typeof values[\"llm.model\"] === \"string\" ? values[\"llm.model\"] : \"\";\n const baseUrlValue =\n typeof values[\"llm.base_url\"] === \"string\"\n ? values[\"llm.base_url\"]\n : \"\";\n const showOpenHandsApiKeyHelp = modelValue.startsWith(\"openhands/\");\n const authType = resolveLlmAuthType(values[LLM_AUTH_TYPE_KEY]);\n const isSubscriptionAuth = authType === LLM_AUTH_TYPE_SUBSCRIPTION;\n const shouldDisableSubscriptionControls =\n isDisabled || (isSubscriptionAuth && isWaitingForSubscriptionModels);\n const subscriptionModelValue = subscriptionModels?.includes(modelValue)\n ? modelValue\n : (subscriptionModels?.[0] ?? \"\");\n\n const apiKeyValue =\n typeof values[\"llm.api_key\"] === \"string\" ? values[\"llm.api_key\"] : \"\";\n // For embedded profile forms (create/edit) the global\n // `llm_api_key_set` flag is misleading: a brand-new profile would show a\n // \"key set\" indicator just because some other profile has a key. Reflect\n // the form's own key state instead so create mode starts visibly unset.\n const apiKeyIsSet = embedded\n ? apiKeyValue.length > 0\n : Boolean(settings?.llm_api_key_set);\n\n const renderApiKeyInput = (testId: string, helpTestId: string) => (\n <>\n <SettingsInput\n testId={testId}\n label={t(I18nKey.SETTINGS_FORM$API_KEY)}\n type=\"password\"\n className=\"w-full\"\n value={apiKeyValue}\n // eslint-disable-next-line i18next/no-literal-string -- masked-key sentinel, not translatable\n placeholder={apiKeyIsSet ? \"<hidden>\" : \"\"}\n onChange={(value) => onChange(\"llm.api_key\", value)}\n isDisabled={isDisabled}\n startContent={\n apiKeyIsSet ? <KeyStatusIcon isSet={apiKeyIsSet} /> : undefined\n }\n />\n\n <HelpLink\n testId={helpTestId}\n text={t(I18nKey.SETTINGS$DONT_KNOW_API_KEY)}\n linkText={t(I18nKey.SETTINGS$CLICK_FOR_INSTRUCTIONS)}\n href=\"https://docs.openhands.dev/usage/local-setup#getting-an-api-key\"\n />\n </>\n );\n\n const handleAuthTypeChange = (selectedKey: React.Key | null) => {\n const nextAuthType =\n selectedKey === LLM_AUTH_TYPE_SUBSCRIPTION\n ? LLM_AUTH_TYPE_SUBSCRIPTION\n : LLM_AUTH_TYPE_API_KEY;\n onChange(LLM_AUTH_TYPE_KEY, nextAuthType);\n\n if (nextAuthType === LLM_AUTH_TYPE_SUBSCRIPTION) {\n setEnableSubscriptionModels(true);\n if (modelValue && !subscriptionModels?.includes(modelValue)) {\n lastApiKeyModelRef.current = modelValue;\n }\n const restoredSubscriptionModel =\n lastSubscriptionModelRef.current &&\n subscriptionModels?.includes(lastSubscriptionModelRef.current)\n ? lastSubscriptionModelRef.current\n : subscriptionModels?.[0];\n onChange(LLM_SUBSCRIPTION_VENDOR_KEY, OPENAI_SUBSCRIPTION_VENDOR);\n if (\n !subscriptionModels?.includes(modelValue) &&\n restoredSubscriptionModel\n ) {\n onChange(\"llm.model\", restoredSubscriptionModel);\n }\n return;\n }\n\n if (modelValue && subscriptionModels?.includes(modelValue)) {\n lastSubscriptionModelRef.current = modelValue;\n onChange(\"llm.model\", lastApiKeyModelRef.current ?? defaultModel);\n }\n };\n\n const renderAuthTypeInput = () => (\n <SettingsDropdownInput\n testId=\"llm-auth-type-input\"\n name={LLM_AUTH_TYPE_KEY}\n label={t(I18nKey.SETTINGS$LLM_AUTH_TYPE)}\n items={[\n {\n key: LLM_AUTH_TYPE_API_KEY,\n label: t(I18nKey.SETTINGS$LLM_AUTH_TYPE_API_KEY),\n },\n {\n key: LLM_AUTH_TYPE_SUBSCRIPTION,\n label: t(I18nKey.SETTINGS$LLM_AUTH_TYPE_SUBSCRIPTION),\n },\n ]}\n selectedKey={authType}\n isClearable={false}\n required\n isDisabled={shouldDisableSubscriptionControls}\n onSelectionChange={handleAuthTypeChange}\n />\n );\n\n const renderSubscriptionSettings = () => (\n <div\n className=\"flex flex-col gap-6\"\n data-testid=\"llm-subscription-settings\"\n >\n <SettingsDropdownInput\n testId=\"llm-subscription-model-input\"\n name=\"llm.subscription_model\"\n label={t(I18nKey.SETTINGS$SUBSCRIPTION_MODEL)}\n items={(subscriptionModels ?? []).map((model) => ({\n key: model,\n label: model,\n }))}\n selectedKey={subscriptionModelValue}\n isClearable={false}\n required\n isDisabled={\n shouldDisableSubscriptionControls || !subscriptionModels?.length\n }\n onSelectionChange={(selectedKey) => {\n const nextModel =\n typeof selectedKey === \"string\"\n ? selectedKey\n : subscriptionModels?.[0];\n if (nextModel) {\n onChange(\"llm.model\", nextModel);\n }\n }}\n />\n <OpenAISubscriptionAuthCard isDisabled={isDisabled} />\n </div>\n );\n\n return (\n <div className=\"flex flex-col gap-6\">\n {view === \"basic\" ? (\n <div\n className=\"flex flex-col gap-6\"\n data-testid=\"llm-settings-form-basic\"\n >\n {renderAuthTypeInput()}\n\n {isSubscriptionAuth ? (\n renderSubscriptionSettings()\n ) : (\n <>\n <ModelSelector\n currentModel={modelValue || undefined}\n onChange={(provider, model) => {\n const nextModel = buildModelId(provider, model);\n if (nextModel) {\n onChange(\"llm.model\", nextModel);\n }\n }}\n wrapperClassName=\"!flex-col !gap-6\"\n isDisabled={isDisabled}\n />\n\n {showOpenHandsApiKeyHelp ? (\n <OpenHandsApiKeyHelp testId=\"openhands-api-key-help\" />\n ) : null}\n\n {renderApiKeyInput(\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-input\",\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-help-anchor\",\n )}\n </>\n )}\n </div>\n ) : (\n <div\n className=\"flex flex-col gap-6\"\n data-testid=\"llm-settings-form-advanced\"\n >\n {renderAuthTypeInput()}\n\n {isSubscriptionAuth ? (\n renderSubscriptionSettings()\n ) : (\n <>\n <SettingsInput\n testId=\"llm-custom-model-input\"\n label={t(I18nKey.SETTINGS$CUSTOM_MODEL)}\n type=\"text\"\n className=\"w-full\"\n value={modelValue}\n placeholder={defaultModel}\n onChange={(value) => onChange(\"llm.model\", value)}\n isDisabled={isDisabled}\n />\n\n {showOpenHandsApiKeyHelp ? (\n <>\n {isFreeOpenHandsModel(modelValue) ? (\n <OpenHandsFreeModelsNote />\n ) : null}\n <OpenHandsApiKeyHelp testId=\"openhands-api-key-help-2\" />\n </>\n ) : null}\n\n <SettingsInput\n testId=\"base-url-input\"\n label={t(I18nKey.SETTINGS$BASE_URL)}\n type=\"text\"\n className=\"w-full\"\n value={baseUrlValue}\n // eslint-disable-next-line i18next/no-literal-string -- example value, not translatable\n placeholder=\"https://api.openai.com\"\n onChange={(value) => onChange(\"llm.base_url\", value)}\n isDisabled={isDisabled}\n />\n\n {renderApiKeyInput(\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-input\",\n // eslint-disable-next-line i18next/no-literal-string -- DOM id, not user-facing\n \"llm-api-key-help-anchor-advanced\",\n )}\n </>\n )}\n </div>\n )}\n </div>\n );\n },\n [\n defaultModel,\n embedded,\n isWaitingForSubscriptionModels,\n settings?.llm_api_key_set,\n subscriptionModels,\n t,\n ],\n );\n\n const buildPayload = React.useCallback(\n (\n defaultPayload: Record<string, unknown>,\n context: {\n values: Record<string, string | boolean>;\n dirty: Record<string, boolean>;\n view: SettingsView;\n },\n ) => {\n // defaultPayload is the wrapped diff (e.g.\n // `{ agent_settings_diff: { llm: { model: \"gpt-4\" } } }`); we only\n // mutate the inner `llm` object below.\n const agentSettings = structuredClone(\n (defaultPayload.agent_settings_diff as Record<string, unknown>) ?? {},\n );\n const llm = (agentSettings.llm ?? {}) as Record<string, unknown>;\n const authType = resolveLlmAuthType(context.values[LLM_AUTH_TYPE_KEY]);\n\n if (authType === LLM_AUTH_TYPE_SUBSCRIPTION) {\n llm.auth_type = LLM_AUTH_TYPE_SUBSCRIPTION;\n llm.subscription_vendor = OPENAI_SUBSCRIPTION_VENDOR;\n const model =\n typeof llm.model === \"string\"\n ? llm.model\n : String(context.values[\"llm.model\"] ?? \"\");\n const fallbackSubscriptionModel = subscriptionModels?.[0];\n if (\n !subscriptionModels?.includes(model) &&\n !fallbackSubscriptionModel\n ) {\n throw new Error(\"Subscription models are not loaded yet.\");\n }\n llm.model = subscriptionModels?.includes(model)\n ? model\n : fallbackSubscriptionModel;\n delete llm.api_key;\n delete llm.base_url;\n } else {\n if (context.dirty[LLM_AUTH_TYPE_KEY]) {\n llm.auth_type = LLM_AUTH_TYPE_API_KEY;\n llm.subscription_vendor = null;\n }\n if (context.view === \"basic\" && llm.model !== undefined) {\n llm.base_url = getSchemaFieldDefaultValue(schema, \"llm.base_url\");\n }\n }\n\n agentSettings.llm = llm;\n return { agent_settings_diff: agentSettings };\n },\n [schema, subscriptionModels],\n );\n\n return (\n <SdkSectionPage\n scope={scope}\n settingsSources={[\n {\n settingsSource: \"agent_settings\",\n sectionKeys: [\"llm\"],\n excludeKeys: LLM_EXCLUDED_KEYS,\n },\n ]}\n header={buildHeader}\n buildPayload={buildPayload}\n getInitialView={getInitialView}\n forceShowAdvancedView\n allowAllView\n onSaveSuccess={onSaveSuccess}\n initialValueOverrides={initialValueOverrides}\n embedded={embedded}\n hideSaveButton={hideSaveButton}\n suppressSuccessToast={suppressSuccessToast}\n onSaveControlChange={onSaveControlChange}\n testId=\"llm-settings-screen\"\n />\n );\n}\n\n/**\n * Default export for the route renders the LLM-profile management view for both\n * backend types. Both manage the LLM through named profiles — local via the\n * agent-server (`/api/profiles`), cloud via the app-server\n * (`/api/v1/settings/profiles`) — and the view is backend-agnostic because it\n * goes through ProfilesService, which routes per active backend.\n *\n * The LlmSettingsScreen component is also exported for embedded use cases\n * (e.g., onboarding, the profile create/edit form).\n *\n * Note: This is a route file, only the router should import the default export.\n * Other consumers should use the named export `LlmSettingsScreen` for embedded\n * use cases.\n */\nexport default function LlmSettingsRoute() {\n return <LlmSettingsLocalView />;\n}\n"],"mappings":"utCAwCA,IAAM,EAAoB,IAAI,IAAI,CAChC,YACA,cACA,eACA,EAAA,kBACA,EAAA,2BACF,CAAC,EAEK,GAAgB,EAAyB,IACzC,CAAC,GAAY,CAAC,EAAc,KACzB,GAAG,EAAS,GAAG,IAGlB,GACJ,EACA,IAEA,GAAQ,SACL,QAAS,GAAY,EAAQ,MAAM,EACnC,KAAM,GAAU,EAAM,MAAQ,CAAQ,GAAG,SAAW,KAEnD,EAAyE,CAC7E,OAAQ,IAAI,IAAI,CAAC,yBAA0B,2BAA2B,CAAC,EACvE,SAAU,IAAI,IAAI,CAAC,gCAAgC,CAAC,CACtD,EAEM,EAAoB,GAAoB,CAC5C,GAAI,CACF,IAAM,EAAY,IAAI,IAAI,CAAO,EAC3B,EAAiB,EAAU,SAAS,QAAQ,OAAQ,EAAE,GAAK,GACjE,MAAO,GAAG,EAAU,SAAS,GAC/B,MAAQ,CACN,OAAO,EAAQ,KAAK,EAAE,QAAQ,OAAQ,EAAE,CAC1C,CACF,EAEM,GAA4B,EAAe,IAAoB,CACnE,I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