@openhands/agent-canvas 1.5.2 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{Trans-DqF_OEZB.js → Trans-52HCczKK.js} +1 -1
- package/build/assets/{acp-providers-DerAmTyY.js → acp-providers-xACMK9ZP.js} +1 -1
- package/build/assets/{active-backend-context-DHhm10VS.js → active-backend-context-Cd1qcZsb.js} +1 -1
- package/build/assets/{add-backend-modal-BoMkMyLB.js → add-backend-modal-5chsfln3.js} +1 -1
- package/build/assets/{agent-profiles-settings-CYPloKYK.js → agent-profiles-settings-BWK4H3kR.js} +1 -1
- package/build/assets/agent-server-compatibility-DMY0CihN.js +1 -0
- package/build/assets/agent-server-conversation-service.api-CI5-xmIX.js +41 -0
- package/build/assets/agent-settings-CMd8-O4f.js +2 -0
- package/build/assets/agent-settings-CdrhQJXX.js +1 -0
- package/build/assets/{alert-banner-Dh51WURQ.js → alert-banner-CLfWuIAX.js} +1 -1
- package/build/assets/api-key-entry-screen-Cc3aC7DZ.js +1 -0
- package/build/assets/app-settings-B-DQcBoB.js +1 -0
- package/build/assets/{automation-detail-Bn8q0AG3.js → automation-detail-BgxBIpyK.js} +2 -2
- package/build/assets/automation-export-Dbur8OHa.js +2 -0
- package/build/assets/automations-list-BWfjizlp.js +1 -0
- package/build/assets/{back-nav-button-DVknCcSP.js → back-nav-button-CaKvsD1E.js} +1 -1
- package/build/assets/backend-form-modal-YcfpuBZo.js +1 -0
- package/build/assets/{backend-synced-settings-badge-yVh6Kf4E.js → backend-synced-settings-badge-BellMmgC.js} +1 -1
- package/build/assets/{base-modal-CIF_785P.js → base-modal-Cw7enAHz.js} +1 -1
- package/build/assets/{brand-button-B1izLAdR.js → brand-button-BulEFHr3.js} +1 -1
- package/build/assets/{browser-DKaeq_sT.js → browser-DfVgUREb.js} +2 -2
- package/build/assets/browser-store-CBqI3tNR.js +1 -0
- package/build/assets/{browser-tab-qb_ftCxW.js → browser-tab-CmIKQB7S.js} +1 -1
- package/build/assets/chat-send-button-BchSSwuD.js +1 -0
- package/build/assets/circle-check-BXbQ5nEH.js +1 -0
- package/build/assets/{circle-plus-check-toggle-DoFIjVE0.js → circle-plus-check-toggle-BhpPjkh9.js} +1 -1
- package/build/assets/client-source-DAUgyJsi.js +1 -0
- package/build/assets/cloud-funnel-analytics-B5OeWh4y.js +1 -0
- package/build/assets/{color-themes-CHizm1xF.js → color-themes-QKMSVfDU.js} +1 -1
- package/build/assets/{combobox-caret-CxZpqoSR.js → combobox-caret-kNZtp53R.js} +1 -1
- package/build/assets/{command-menu-oTvKDU3Y.js → command-menu-tUsn23zy.js} +1 -1
- package/build/assets/{command-store-D8J5LMW1.js → command-store-B0hrIWMN.js} +1 -1
- package/build/assets/{condenser-settings-Q1rHh4Qe.js → condenser-settings-BBizzfIH.js} +1 -1
- package/build/assets/{confirmation-modal-DGBWM2Ls.js → confirmation-modal-108xng7X.js} +1 -1
- package/build/assets/{context-menu-list-item-6psNyl7X.js → context-menu-list-item-BbKfFuN1.js} +1 -1
- package/build/assets/conversation-CTzSrLMq.js +1 -0
- package/build/assets/conversation-CgcXNb-Z.js +90 -0
- package/build/assets/conversation-panel-bscjGQda.js +1 -0
- package/build/assets/{conversation-service.api-D8QU-BiL.js → conversation-service.api-DbBvscJA.js} +1 -1
- package/build/assets/conversation-state-store-C5GagZHT.js +1 -0
- package/build/assets/{conversation-store-LptbOvKa.js → conversation-store-CyVqoa0d.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-CNUmIms2.js → conversation-tab-empty-state-2KYlk5Bh.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-CFzH_NOX.js → copy-to-clipboard-button-C54YRPMg.js} +1 -1
- package/build/assets/declaration-_yumYLEx.js +1 -0
- package/build/assets/{device-verify-WBSjJBLH.js → device-verify-D6FW_KZq.js} +1 -1
- package/build/assets/{dropdown-classes-D3wMJlXT.js → dropdown-classes-9uONlOg1.js} +1 -1
- package/build/assets/{ellipsis-button-CbNnHlIq.js → ellipsis-button-CoaUrKmQ.js} +1 -1
- package/build/assets/{entry.client-Dnnak-Hq.js → entry.client-BJSVzw7V.js} +2 -2
- package/build/assets/{enum-filter-dropdown-JLYv1t8L.js → enum-filter-dropdown-qQzyjk_q.js} +1 -1
- package/build/assets/{environment-switch-overlay-B1PFO8P8.js → environment-switch-overlay-XRWCClLu.js} +1 -1
- package/build/assets/extensions-hub-DUp9sWQY.js +1 -0
- package/build/assets/extensions-navigation-DmkftjAx.js +1 -0
- package/build/assets/file-tUAzhmJ3.js +1 -0
- package/build/assets/files-tab-GV5hwiIM.js +1 -0
- package/build/assets/files-tab-store-DehyITNC.js +1 -0
- package/build/assets/{form-control-classes-CbdN5aO3.js → form-control-classes-BPUnoYyg.js} +1 -1
- package/build/assets/git-provider-icon-DDkru3b_.js +1 -0
- package/build/assets/highlighted-source-view-CYkPZUxr.js +1 -0
- package/build/assets/home-C53WekZ2.js +1 -0
- package/build/assets/home-EAwq8ah2.js +1 -0
- package/build/assets/index-home-kBdZGKtu.js +1 -0
- package/build/assets/install-server-modal-DYk4VP3-.js +1 -0
- package/build/assets/{launch-DlXspDku.js → launch-CIecOy_y.js} +1 -1
- package/build/assets/lesson-plan-BSEUwflx.js +4 -0
- package/build/assets/llm-not-configured-banner-C8uv1PHT.js +27 -0
- package/build/assets/llm-settings-0Bb97NCk.js +1 -0
- package/build/assets/llm-settings-D4toJ90k.js +1 -0
- package/build/assets/{llm-subscription-service-C0zN0-rH.js → llm-subscription-service-BPRw3u3H.js} +1 -1
- package/build/assets/{loading-spinner-BcdnT0mN.js → loading-spinner-BCInDEXB.js} +1 -1
- package/build/assets/manage-backends-modal-Bon32JYr.js +1 -0
- package/build/assets/manifest-ec000ae3.js +1 -0
- package/build/assets/markdown-renderer-BlaJOAI2.js +2 -0
- package/build/assets/mcp-CFIpOkn2.js +9 -0
- package/build/assets/messages-eRPeR4pW.js +40 -0
- package/build/assets/{modal-body-Cc2zp0xb.js → modal-body-Bg9UCeoV.js} +1 -1
- package/build/assets/{modal-classes-3qT9Ap7Q.js → modal-classes-H1KbJkeC.js} +1 -1
- package/build/assets/{modal-close-button-BcIBUdSq.js → modal-close-button-BMLYvo0C.js} +1 -1
- package/build/assets/{model-selector-D51W2Q9b.js → model-selector-BqX2RvEr.js} +1 -1
- package/build/assets/{navigation-link-D8hfwvxI.js → navigation-link-DoJzTCEz.js} +1 -1
- package/build/assets/onboarding-3KO4qE6R.js +1 -0
- package/build/assets/onboarding-modal-D4vqkJeT.js +1 -0
- package/build/assets/{organization-service.api-Da2jiuBS.js → organization-service.api-CvfQugOt.js} +1 -1
- package/build/assets/{path-utils-D53ZHUQU.js → path-utils-DRgexxnX.js} +1 -1
- package/build/assets/{plan-components-BdZXPyZU.js → plan-components-qkMiGs_-.js} +1 -1
- package/build/assets/{planner-tab-BM-pKx0z.js → planner-tab-ZrjiirRr.js} +1 -1
- package/build/assets/{plugins-management-service-DISfOL13.js → plugins-management-service-9qT-r_37.js} +1 -1
- package/build/assets/plus-CzE1b-wl.js +1 -0
- package/build/assets/{profiles-service.api-DWetW2TL.js → profiles-service.api-CRVlrQpT.js} +1 -1
- package/build/assets/{providers-C7lMslCi.js → providers-C2DFGBrf.js} +1 -1
- package/build/assets/{proxy-G4ce0fnQ.js → proxy-DnnDqkwn.js} +1 -1
- package/build/assets/puzzle-IHQnD54C.js +1 -0
- package/build/assets/recommended-automations-launcher-B97vgHuN.js +58 -0
- package/build/assets/refresh-cw-DxbAs3SK.js +1 -0
- package/build/assets/root-BbONavTg.css +1 -0
- package/build/assets/root-D01rpqZU.js +2 -0
- package/build/assets/root-layout-BiHbCIkS.js +2 -0
- package/build/assets/{runtime-waiting-state-CnyVhX4T.js → runtime-waiting-state-CbUV9txX.js} +1 -1
- package/build/assets/{schema-field-CwdqUOnE.js → schema-field-B9-9Ta9u.js} +1 -1
- package/build/assets/sdk-section-page-DG1s25Pr.js +1 -0
- package/build/assets/{sdk-settings-schema-CLR01YIK.js → sdk-settings-schema-B42JFr5Y.js} +1 -1
- package/build/assets/{secrets-service-Ch7RH8eH.js → secrets-service-DvyS6-mV.js} +1 -1
- package/build/assets/secrets-settings-CeSq6cQw.js +1 -0
- package/build/assets/{segmented-toggle-kzwZkLaj.js → segmented-toggle-DRVJBNy0.js} +1 -1
- package/build/assets/settings-Dzo0dJKM.js +1 -0
- package/build/assets/{settings-mQUckT0g.js → settings-HcwfqMjJ.js} +1 -1
- package/build/assets/{settings-dropdown-input-Dhx9ErGd.js → settings-dropdown-input-B6RL_mt0.js} +1 -1
- package/build/assets/settings-index-uAKHyijw.js +1 -0
- package/build/assets/{settings-input-BsgQWS5R.js → settings-input-ZoaAPNQh.js} +1 -1
- package/build/assets/{settings-list-classes-DSJJX99U.js → settings-list-classes-Dr8LgITi.js} +1 -1
- package/build/assets/settings-modal-BVX2G_IT.js +1 -0
- package/build/assets/{settings-service.api-DPTFyRXL.js → settings-service.api-BY7ncxIz.js} +1 -1
- package/build/assets/{settings-switch-Bes8dIlV.js → settings-switch-DUlGnP0B.js} +1 -1
- package/build/assets/{settings-utils-DzCVfiR3.js → settings-utils-kWEEvcdv.js} +1 -1
- package/build/assets/shared-conversation-CV4Rtdz2.js +1 -0
- package/build/assets/{sidebar-layout-Bm7pa3Vk.js → sidebar-layout-BhGooCga.js} +1 -1
- package/build/assets/sidebar-mobile-menu-toggle-BntOJphE.js +1 -0
- package/build/assets/{sidebar-nav-link-CHqyFXwV.js → sidebar-nav-link-DkA1XWV8.js} +1 -1
- package/build/assets/{sidebar-store-uiUXBU1N.js → sidebar-store-CF3b12-m.js} +1 -1
- package/build/assets/{skill-card-pill-row-BPYKQ3IN.js → skill-card-pill-row-_gWe1Tws.js} +1 -1
- package/build/assets/skill-icon-badge-C-zbaXbD.js +1 -0
- package/build/assets/skills-plugins-BwoXKtrR.js +1 -0
- package/build/assets/skills-settings-Crq-fZSt.js +2 -0
- package/build/assets/{styled-tooltip-B14i_Uac.js → styled-tooltip-CdnCJ67u.js} +1 -1
- package/build/assets/syntax-highlighter-CZK2ab-O.js +1 -0
- package/build/assets/{task-list-tab-DyfgG4MC.js → task-list-tab-CONOO9iI.js} +1 -1
- package/build/assets/telemetry-CC32dJYW.js +2 -0
- package/build/assets/{terminal-BDTa1HEr.js → terminal-CTkDpIU-.js} +1 -1
- package/build/assets/{toggle-switch-DX_k418f.js → toggle-switch-yVIzmJLM.js} +1 -1
- package/build/assets/{typography-CzfoD9DY.js → typography-BBVEW0un.js} +1 -1
- package/build/assets/{use-acp-credential-form-DHd_Id-q.js → use-acp-credential-form-CIsp8hJe.js} +1 -1
- package/build/assets/use-activate-agent-profile-BfcTTJJG.js +1 -0
- package/build/assets/{use-active-agent-profile-BMDTXsay.js → use-active-agent-profile-CCeFtmk9.js} +1 -1
- package/build/assets/{use-active-conversation-BbeVgedA.js → use-active-conversation-Badxj8w4.js} +1 -1
- package/build/assets/{use-agent-profiles-Dn_S_Tkz.js → use-agent-profiles-BSWVN6hH.js} +1 -1
- package/build/assets/{use-agent-state-5qM3X30V.js → use-agent-state-BzRrhoPd.js} +1 -1
- package/build/assets/use-backends-health-BsZikyFW.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-CyYqfzeo.js → use-can-manage-org-profiles-Do6mYf6P.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-BwMX7jHW.js → use-cloud-current-user-id-Cx3B_0-w.js} +1 -1
- package/build/assets/use-config-D9zUVw5b.js +1 -0
- package/build/assets/{use-create-conversation-CkKUQVbP.js → use-create-conversation-vvl0kvu7.js} +1 -1
- package/build/assets/{use-create-secret-DEgM0MXZ.js → use-create-secret-CB7Dvd4s.js} +1 -1
- package/build/assets/use-event-store-BlpSUF7N.js +4 -0
- package/build/assets/{use-handle-plan-click-BFcE0Xms.js → use-handle-plan-click-DDZkew9p.js} +1 -1
- package/build/assets/use-is-creating-conversation-fxSzN778.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-DJWEfVc5.js → use-launch-skill-in-chat-D6_n1fs3.js} +1 -1
- package/build/assets/use-llm-profiles-CNQm7HYS.js +1 -0
- package/build/assets/use-plugins-marketplace-CloojomS.js +1 -0
- package/build/assets/use-runtime-is-ready-Bx_4cfar.js +1 -0
- package/build/assets/{use-save-agent-profile-i4FcEP98.js → use-save-agent-profile-Bj7N-1jS.js} +1 -1
- package/build/assets/{use-save-settings-DiDEbIJw.js → use-save-settings-BMsb2wk_.js} +1 -1
- package/build/assets/use-settings-B9XEmh7i.js +1 -0
- package/build/assets/use-settings-nav-items-BGfBS0yL.js +16 -0
- package/build/assets/{use-skills-Blpg2BqE.js → use-skills-CSRbvPle.js} +1 -1
- package/build/assets/{use-task-list-CfisapBW.js → use-task-list-CTIVLrQA.js} +1 -1
- package/build/assets/use-tracking-DjdCssvp.js +1 -0
- package/build/assets/{use-user-conversation-BrN2xeQU.js → use-user-conversation-BCpFn-Ei.js} +1 -1
- package/build/assets/{useTranslation-Cbf5AGg_.js → useTranslation-CHm_6BRr.js} +1 -1
- package/build/assets/{utils-DB9LsAzA.js → utils-CrRpzbM2.js} +1 -1
- package/build/assets/vendor-markdown-DzO4uO_0.js +37 -0
- package/build/assets/{vendor~browser-wXQ-WZEC.js → vendor~browser-Byfuq5J-.js} +1 -1
- package/build/assets/{vendor~browser-tab-CsMb-pta.js → vendor~browser-tab-BLk3qxhw.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-DTJ_cjR5.js} +2 -2
- package/build/assets/{vendor~files-tab-B-5fBohe.js → vendor~files-tab-XmnauIZI.js} +1 -1
- package/build/assets/{vendor~launch-_Km3J77E.js → vendor~launch-DeC8QhXQ.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-BrguKXCn.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DDmLzCzm.js} +1 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-YrfJYTQw.js +1 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js → vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-DoaS51iW.js} +123 -3
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-DEYwoy8u.js} +1 -1
- package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-DZHLw5Sr.js +1 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-UJ4BNDJP.js} +1 -1
- package/build/assets/{verification-settings-C8KzAdAX.js → verification-settings-uwOfc16F.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +38 -4
- package/build/locales/ca/openhands.json +38 -4
- package/build/locales/de/openhands.json +38 -4
- package/build/locales/en/openhands.json +38 -4
- package/build/locales/es/openhands.json +38 -4
- package/build/locales/fr/openhands.json +38 -4
- package/build/locales/it/openhands.json +38 -4
- package/build/locales/ja/openhands.json +38 -4
- package/build/locales/ko-KR/openhands.json +38 -4
- package/build/locales/no/openhands.json +38 -4
- package/build/locales/pt/openhands.json +38 -4
- package/build/locales/tr/openhands.json +38 -4
- package/build/locales/uk/openhands.json +38 -4
- package/build/locales/zh-CN/openhands.json +38 -4
- package/build/locales/zh-TW/openhands.json +38 -4
- package/config/defaults.json +7 -3
- package/dist/api/agent-canvas-updates.cjs +2 -0
- package/dist/api/agent-canvas-updates.cjs.map +1 -0
- package/dist/api/agent-canvas-updates.d.ts +7 -0
- package/dist/api/agent-canvas-updates.js +19 -0
- package/dist/api/agent-canvas-updates.js.map +1 -0
- package/dist/api/agent-server-adapter.cjs +1 -1
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +3 -0
- package/dist/api/agent-server-adapter.js +1 -0
- package/dist/api/agent-server-adapter.js.map +1 -1
- 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.d.ts +5 -0
- package/dist/api/agent-server-compatibility.js +24 -15
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/agent-server-config.cjs +1 -1
- package/dist/api/agent-server-config.cjs.map +1 -1
- package/dist/api/agent-server-config.js +11 -8
- package/dist/api/agent-server-config.js.map +1 -1
- package/dist/api/automation-service/automation-service.api.cjs +2 -0
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -0
- package/dist/api/automation-service/automation-service.api.d.ts +3 -0
- package/dist/api/automation-service/automation-service.api.js +283 -0
- package/dist/api/automation-service/automation-service.api.js.map +1 -0
- package/dist/api/client-source.cjs +1 -1
- package/dist/api/client-source.cjs.map +1 -1
- package/dist/api/client-source.d.ts +3 -0
- package/dist/api/client-source.js +4 -4
- package/dist/api/client-source.js.map +1 -1
- package/dist/api/cloud/settings-service.api.cjs.map +1 -1
- package/dist/api/cloud/settings-service.api.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +111 -109
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/mcp-health/mcp-health-store.cjs +2 -0
- package/dist/api/mcp-health/mcp-health-store.cjs.map +1 -0
- package/dist/api/mcp-health/mcp-health-store.d.ts +22 -0
- package/dist/api/mcp-health/mcp-health-store.js +45 -0
- package/dist/api/mcp-health/mcp-health-store.js.map +1 -0
- package/dist/api/mcp-health/probe-mcp-server-health.cjs +2 -0
- package/dist/api/mcp-health/probe-mcp-server-health.cjs.map +1 -0
- package/dist/api/mcp-health/probe-mcp-server-health.d.ts +31 -0
- package/dist/api/mcp-health/probe-mcp-server-health.js +57 -0
- package/dist/api/mcp-health/probe-mcp-server-health.js.map +1 -0
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +66 -46
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/api/plugins-management-service.cjs.map +1 -1
- package/dist/api/plugins-management-service.d.ts +6 -1
- package/dist/api/plugins-management-service.js.map +1 -1
- package/dist/api/plugins-service.d.ts +30 -2
- package/dist/api/secrets-service.cjs +1 -1
- package/dist/api/secrets-service.cjs.map +1 -1
- package/dist/api/secrets-service.d.ts +6 -6
- package/dist/api/secrets-service.js +8 -3
- package/dist/api/secrets-service.js.map +1 -1
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.d.ts +1 -1
- package/dist/api/settings-service/settings-service.api.js +1 -0
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/critic-result-display.cjs +1 -1
- package/dist/components/conversation-events/chat/event-message-components/critic-result-display.js +5 -5
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.d.ts +4 -1
- package/dist/components/features/backends/backend-form-modal.js +15 -16
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +103 -102
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.js +85 -73
- package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +2 -2
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +131 -129
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/confirmation-mode-enabled.cjs +1 -1
- package/dist/components/features/chat/confirmation-mode-enabled.js +4 -4
- package/dist/components/features/chat/skill-install-restart-banner.cjs +2 -0
- package/dist/components/features/chat/skill-install-restart-banner.cjs.map +1 -0
- package/dist/components/features/chat/skill-install-restart-banner.d.ts +11 -0
- package/dist/components/features/chat/skill-install-restart-banner.js +63 -0
- package/dist/components/features/chat/skill-install-restart-banner.js.map +1 -0
- package/dist/components/features/conversation/right-panel-toggle.cjs +1 -1
- package/dist/components/features/conversation/right-panel-toggle.cjs.map +1 -1
- package/dist/components/features/conversation/right-panel-toggle.js +1 -1
- package/dist/components/features/conversation/right-panel-toggle.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +10 -10
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +78 -77
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.d.ts +4 -1
- package/dist/components/features/mcp-page/install-server-modal.js +135 -136
- package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.js +40 -34
- package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.cjs +2 -0
- package/dist/components/features/mcp-page/mcp-server-health.cjs.map +1 -0
- package/dist/components/features/mcp-page/mcp-server-health.d.ts +18 -0
- package/dist/components/features/mcp-page/mcp-server-health.js +117 -0
- package/dist/components/features/mcp-page/mcp-server-health.js.map +1 -0
- package/dist/components/features/plugins/build-plugins-view-model.d.ts +10 -1
- package/dist/components/features/plugins/plugin-files-section.d.ts +13 -0
- package/dist/components/features/settings/agent-canvas-update-card.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-update-card.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-update-card.d.ts +7 -0
- package/dist/components/features/settings/agent-canvas-update-card.js +170 -0
- package/dist/components/features/settings/agent-canvas-update-card.js.map +1 -0
- package/dist/components/features/settings/integrations-settings-link.cjs +2 -0
- package/dist/components/features/settings/integrations-settings-link.cjs.map +1 -0
- package/dist/components/features/settings/integrations-settings-link.d.ts +5 -0
- package/dist/components/features/settings/integrations-settings-link.js +41 -0
- package/dist/components/features/settings/integrations-settings-link.js.map +1 -0
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.cjs +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.cjs.map +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js +31 -21
- package/dist/components/features/settings/settings-desktop-sidebar.js.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js +40 -30
- package/dist/components/features/settings/settings-mobile-drawer.js.map +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
- package/dist/components/features/skills/extensions-navigation.js +54 -33
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +7 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.js.map +1 -1
- 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 +169 -166
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/mutation/use-delete-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-delete-llm-profile.js +1 -0
- package/dist/hooks/mutation/use-delete-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-delete-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-delete-mcp-server.js +8 -6
- package/dist/hooks/mutation/use-delete-mcp-server.js.map +1 -1
- package/dist/hooks/mutation/use-rename-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-rename-llm-profile.js +1 -0
- package/dist/hooks/mutation/use-save-settings.cjs +1 -1
- package/dist/hooks/mutation/use-save-settings.js +3 -3
- package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.js +11 -9
- package/dist/hooks/mutation/use-update-mcp-server.js.map +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +4 -0
- package/dist/hooks/query/query-keys.js +2 -2
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs +2 -0
- package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -0
- package/dist/hooks/query/use-automation-sdk-version.d.ts +3 -0
- package/dist/hooks/query/use-automation-sdk-version.js +63 -0
- package/dist/hooks/query/use-automation-sdk-version.js.map +1 -0
- package/dist/hooks/query/use-latest-agent-canvas-version.cjs +2 -0
- package/dist/hooks/query/use-latest-agent-canvas-version.cjs.map +1 -0
- package/dist/hooks/query/use-latest-agent-canvas-version.d.ts +10 -0
- package/dist/hooks/query/use-latest-agent-canvas-version.js +19 -0
- package/dist/hooks/query/use-latest-agent-canvas-version.js.map +1 -0
- package/dist/hooks/query/use-plugin-file-content.d.ts +7 -0
- package/dist/hooks/query/use-resolved-workspaces.cjs +1 -1
- package/dist/hooks/query/use-resolved-workspaces.cjs.map +1 -1
- package/dist/hooks/query/use-resolved-workspaces.js +25 -26
- package/dist/hooks/query/use-resolved-workspaces.js.map +1 -1
- package/dist/hooks/query/use-search-subdirs.cjs +1 -1
- package/dist/hooks/query/use-search-subdirs.cjs.map +1 -1
- package/dist/hooks/query/use-search-subdirs.d.ts +5 -0
- package/dist/hooks/query/use-search-subdirs.js +16 -4
- package/dist/hooks/query/use-search-subdirs.js.map +1 -1
- package/dist/hooks/use-device-flow.cjs +1 -1
- package/dist/hooks/use-device-flow.js +6 -6
- package/dist/hooks/use-llm-configured.cjs +1 -1
- package/dist/hooks/use-llm-configured.js +3 -3
- package/dist/hooks/use-mcp-server-health.cjs +2 -0
- package/dist/hooks/use-mcp-server-health.cjs.map +1 -0
- package/dist/hooks/use-mcp-server-health.d.ts +11 -0
- package/dist/hooks/use-mcp-server-health.js +18 -0
- package/dist/hooks/use-mcp-server-health.js.map +1 -0
- package/dist/hooks/use-skill-installs.cjs +2 -0
- package/dist/hooks/use-skill-installs.cjs.map +1 -0
- package/dist/hooks/use-skill-installs.d.ts +10 -0
- package/dist/hooks/use-skill-installs.js +21 -0
- package/dist/hooks/use-skill-installs.js.map +1 -0
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +3 -3
- package/dist/hooks/use-tracking.js +67 -52
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +35 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +3 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +623 -45
- package/dist/i18n/translation.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -2
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/locales/ar/openhands.json +38 -4
- package/dist/locales/ca/openhands.json +38 -4
- package/dist/locales/de/openhands.json +38 -4
- package/dist/locales/en/openhands.json +38 -4
- package/dist/locales/es/openhands.json +38 -4
- package/dist/locales/fr/openhands.json +38 -4
- package/dist/locales/it/openhands.json +38 -4
- package/dist/locales/ja/openhands.json +38 -4
- package/dist/locales/ko-KR/openhands.json +38 -4
- package/dist/locales/no/openhands.json +38 -4
- package/dist/locales/pt/openhands.json +38 -4
- package/dist/locales/tr/openhands.json +38 -4
- package/dist/locales/uk/openhands.json +38 -4
- package/dist/locales/zh-CN/openhands.json +38 -4
- package/dist/locales/zh-TW/openhands.json +38 -4
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.js +44 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js +13 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +21 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.js +13 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.js +13 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +13 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.js +13 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.js +13 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js +16 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.js +46 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +74 -70
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +123 -3
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +7 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +10 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +113 -67
- package/dist/routes/app-settings.js.map +1 -1
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.js +1 -0
- package/dist/routes/mcp.js.map +1 -1
- package/dist/services/cloud-funnel-analytics.cjs +1 -1
- package/dist/services/cloud-funnel-analytics.cjs.map +1 -1
- package/dist/services/cloud-funnel-analytics.d.ts +2 -2
- package/dist/services/cloud-funnel-analytics.js +18 -16
- package/dist/services/cloud-funnel-analytics.js.map +1 -1
- package/dist/services/settings.cjs +1 -1
- package/dist/services/settings.cjs.map +1 -1
- package/dist/services/settings.js +1 -0
- package/dist/services/settings.js.map +1 -1
- package/dist/services/telemetry-context.cjs +2 -0
- package/dist/services/telemetry-context.cjs.map +1 -0
- package/dist/services/telemetry-context.d.ts +17 -0
- package/dist/services/telemetry-context.js +27 -0
- package/dist/services/telemetry-context.js.map +1 -0
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.d.ts +7 -5
- package/dist/services/telemetry.js +132 -123
- package/dist/services/telemetry.js.map +1 -1
- package/dist/stores/skill-install-banner-store.cjs +2 -0
- package/dist/stores/skill-install-banner-store.cjs.map +1 -0
- package/dist/stores/skill-install-banner-store.d.ts +32 -0
- package/dist/stores/skill-install-banner-store.js +14 -0
- package/dist/stores/skill-install-banner-store.js.map +1 -0
- package/dist/stores/use-event-store.cjs +1 -1
- package/dist/stores/use-event-store.cjs.map +1 -1
- package/dist/stores/use-event-store.js +35 -35
- package/dist/stores/use-event-store.js.map +1 -1
- package/dist/types/mcp-health.cjs +2 -0
- package/dist/types/mcp-health.cjs.map +1 -0
- package/dist/types/mcp-health.d.ts +21 -0
- package/dist/types/mcp-health.js +6 -0
- package/dist/types/mcp-health.js.map +1 -0
- package/dist/types/settings.d.ts +1 -0
- package/dist/utils/handle-event-for-ui.cjs +1 -1
- package/dist/utils/handle-event-for-ui.cjs.map +1 -1
- package/dist/utils/handle-event-for-ui.d.ts +5 -0
- package/dist/utils/handle-event-for-ui.js +71 -57
- package/dist/utils/handle-event-for-ui.js.map +1 -1
- package/dist/utils/mcp-credential-validation.cjs +1 -1
- package/dist/utils/mcp-credential-validation.cjs.map +1 -1
- package/dist/utils/mcp-credential-validation.js +32 -16
- package/dist/utils/mcp-credential-validation.js.map +1 -1
- package/dist/utils/mcp-server-health-key.cjs +2 -0
- package/dist/utils/mcp-server-health-key.cjs.map +1 -0
- package/dist/utils/mcp-server-health-key.d.ts +16 -0
- package/dist/utils/mcp-server-health-key.js +23 -0
- package/dist/utils/mcp-server-health-key.js.map +1 -0
- package/dist/utils/mcp-test-error-message.cjs +2 -0
- package/dist/utils/mcp-test-error-message.cjs.map +1 -0
- package/dist/utils/mcp-test-error-message.d.ts +8 -0
- package/dist/utils/mcp-test-error-message.js +14 -0
- package/dist/utils/mcp-test-error-message.js.map +1 -0
- package/dist/utils/redact-mcp-secrets.cjs +2 -0
- package/dist/utils/redact-mcp-secrets.cjs.map +1 -0
- package/dist/utils/redact-mcp-secrets.d.ts +13 -0
- package/dist/utils/redact-mcp-secrets.js +57 -0
- package/dist/utils/redact-mcp-secrets.js.map +1 -0
- package/dist/utils/settings-utils.cjs.map +1 -1
- package/dist/utils/settings-utils.js.map +1 -1
- package/dist/utils/skill-install-events.cjs +3 -0
- package/dist/utils/skill-install-events.cjs.map +1 -0
- package/dist/utils/skill-install-events.d.ts +16 -0
- package/dist/utils/skill-install-events.js +26 -0
- package/dist/utils/skill-install-events.js.map +1 -0
- package/dist/utils/title-llm-profile.cjs +2 -0
- package/dist/utils/title-llm-profile.cjs.map +1 -0
- package/dist/utils/title-llm-profile.d.ts +2 -0
- package/dist/utils/title-llm-profile.js +11 -0
- package/dist/utils/title-llm-profile.js.map +1 -0
- package/package.json +10 -3
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +2 -0
- package/scripts/dev-process-utils.mjs +62 -1
- package/scripts/dev-safe.mjs +2 -2
- package/scripts/dev-static.mjs +5 -3
- package/scripts/dev-with-automation.mjs +98 -14
- package/scripts/download-node.mjs +382 -0
- package/scripts/download-uv.mjs +204 -0
- package/scripts/logger.mjs +64 -35
- package/build/assets/agent-server-compatibility-C0MtTTwb.js +0 -1
- package/build/assets/agent-server-conversation-service.api-lzc8dabY.js +0 -41
- package/build/assets/agent-settings-GwiXe_6k.js +0 -2
- package/build/assets/agent-settings-OdsyI2gX.js +0 -1
- package/build/assets/api-key-entry-screen-2gsoZAOK.js +0 -1
- package/build/assets/app-settings-CD9euh81.js +0 -1
- package/build/assets/automation-export-Djc8Tf0M.js +0 -2
- package/build/assets/automations-list-Dtiolk1h.js +0 -1
- package/build/assets/backend-form-modal-B8GtBA-J.js +0 -1
- package/build/assets/browser-store-BI6uklCG.js +0 -1
- package/build/assets/chat-send-button-BZHG2hAW.js +0 -1
- package/build/assets/client-source-CtQjJEy6.js +0 -1
- package/build/assets/cloud-funnel-analytics-uzzLlLuj.js +0 -1
- package/build/assets/conversation-B8d8_Upd.js +0 -1
- package/build/assets/conversation-Lmqm6VJC.js +0 -89
- package/build/assets/conversation-panel-B8n40Swu.js +0 -1
- package/build/assets/conversation-state-store-B2Bp32XI.js +0 -1
- package/build/assets/declaration-BGsHjPEW.js +0 -1
- package/build/assets/extensions-hub-DqvwvpCi.js +0 -1
- package/build/assets/extensions-navigation-BMc9Nluv.js +0 -1
- package/build/assets/files-tab-BAkaV4aO.js +0 -1
- package/build/assets/files-tab-store-DJsPxYdg.js +0 -1
- package/build/assets/git-provider-icon-xvbukHaT.js +0 -1
- package/build/assets/home-D01kSnmo.js +0 -1
- package/build/assets/home-NZO2bF4N.js +0 -1
- package/build/assets/index-home-BsI6i0TC.js +0 -1
- package/build/assets/install-server-modal-BYjqoRyX.js +0 -1
- package/build/assets/lesson-plan-cNUjpdFx.js +0 -4
- package/build/assets/llm-not-configured-banner-DUPyoFIZ.js +0 -27
- package/build/assets/llm-settings-Cs_iieFY.js +0 -1
- package/build/assets/llm-settings-J2ke2foG.js +0 -1
- package/build/assets/manage-backends-modal-nMoCZ2a0.js +0 -1
- package/build/assets/manifest-f1b46f62.js +0 -1
- package/build/assets/markdown-renderer-B4V2OMFP.js +0 -2
- package/build/assets/mcp-kZM-cAZw.js +0 -9
- package/build/assets/messages-CJAv5n4j.js +0 -40
- package/build/assets/objectWithoutPropertiesLoose-BgYIAs2y.js +0 -1
- package/build/assets/onboarding-Dx8n8HFr.js +0 -1
- package/build/assets/onboarding-modal-Bxuxpfdz.js +0 -1
- package/build/assets/recommended-automations-launcher-BWRRvMPE.js +0 -58
- package/build/assets/refresh-cw-B9B7-vsy.js +0 -1
- package/build/assets/root-CYWeTrWE.css +0 -1
- package/build/assets/root-layout-ClEl-JlJ.js +0 -2
- package/build/assets/root-oT83qVlk.js +0 -2
- package/build/assets/sdk-section-page-Cwj0T4gF.js +0 -1
- package/build/assets/secrets-settings-Bc_pBX6F.js +0 -1
- package/build/assets/settings-index-BzSIM1-N.js +0 -1
- package/build/assets/settings-modal-BnZ7mMu7.js +0 -1
- package/build/assets/settings-n9a395O0.js +0 -1
- package/build/assets/shared-conversation-CIDDti9I.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-CTX7J4wM.js +0 -1
- package/build/assets/skills-plugins-HZEbNDmX.js +0 -1
- package/build/assets/skills-settings-BdqijFlC.js +0 -2
- package/build/assets/telemetry-SHxpVxk8.js +0 -2
- package/build/assets/use-activate-agent-profile-BRDdSwQ0.js +0 -1
- package/build/assets/use-backends-health-BagmAE_W.js +0 -1
- package/build/assets/use-config-B39iHYFi.js +0 -1
- package/build/assets/use-event-store-Bbaz51GR.js +0 -4
- package/build/assets/use-llm-profiles-CgRtnj74.js +0 -1
- package/build/assets/use-plugins-marketplace-DOJp9rlE.js +0 -1
- package/build/assets/use-runtime-is-ready-ziHQvXZQ.js +0 -1
- package/build/assets/use-settings-BeJap6YL.js +0 -1
- package/build/assets/use-settings-nav-items-D5JJjFHJ.js +0 -16
- package/build/assets/use-tracking-DFoPQUSU.js +0 -1
- package/build/assets/useMutationState-OnAsCLA_.js +0 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD7v71DM.js +0 -2
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BT05Osu4.js +0 -28
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-COhHANvV.js +0 -2
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DgzWSMRc.js +0 -2
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DqZatR3B.js +0 -7
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-FghQ3Z1a.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C4-GDgiF.js +0 -1
- package/dist/components/features/analytics/telemetry-consent-banner.cjs +0 -2
- package/dist/components/features/analytics/telemetry-consent-banner.cjs.map +0 -1
- package/dist/components/features/analytics/telemetry-consent-banner.d.ts +0 -29
- package/dist/components/features/analytics/telemetry-consent-banner.js +0 -59
- package/dist/components/features/analytics/telemetry-consent-banner.js.map +0 -1
- /package/build/assets/{__vite-browser-external-BQUj0sYu.js → __vite-browser-external-CKHVBTNC.js} +0 -0
- /package/build/assets/{agent-server-ui-style-scope-qhnhZHBV.js → agent-server-ui-style-scope-BvSa9on7.js} +0 -0
- /package/build/assets/{automation-LZB0MjdV.js → automation-BGiPmxFR.js} +0 -0
- /package/build/assets/{canvas-ui-COgjltGz.js → canvas-ui-CC4EJo-H.js} +0 -0
- /package/build/assets/{checkmark-h7udgXMM.js → checkmark-ygQB1AtV.js} +0 -0
- /package/build/assets/{close-DLFb5kfv.js → close-BjSA0HWT.js} +0 -0
- /package/build/assets/{code-tag-DYlAhEQY.js → code-tag-D9aPPbOe.js} +0 -0
- /package/build/assets/{common-CxbUL3nR.js → common-CCuqQy_S.js} +0 -0
- /package/build/assets/{conversation-local-storage-F6zVMM--.js → conversation-local-storage-BDjWPg0Z.js} +0 -0
- /package/build/assets/{copy-BLmGeJcd.js → copy-Dce7sOvS.js} +0 -0
- /package/build/assets/{copy-D1YGjP-C.js → copy-iPJAncAj.js} +0 -0
- /package/build/assets/{dist-CodhvuAP.js → dist-D9PhjOaq.js} +0 -0
- /package/build/assets/{environment-switch-store-DkjlKWzN.js → environment-switch-store-DHfcz4M4.js} +0 -0
- /package/build/assets/{extension-module-card-classes-9V3J9J_b.js → extension-module-card-classes-BpebKiN6.js} +0 -0
- /package/build/assets/{external-link-lhdITPqq.js → external-link-CpPMXxrV.js} +0 -0
- /package/build/assets/{folder-Bk311brm.js → folder-BabbYnbF.js} +0 -0
- /package/build/assets/{format-time-delta-DhDbkD7V.js → format-time-delta-BkAmJEPT.js} +0 -0
- /package/build/assets/{get-language-from-path-DBqBsCWH.js → get-language-from-path-CPNnuVhI.js} +0 -0
- /package/build/assets/{git-status-mapper-DnL9OC8_.js → git-status-mapper-BIXK0AAG.js} +0 -0
- /package/build/assets/{iconBase-Dz51Zn5x.js → iconBase-Ch-fOe8B.js} +0 -0
- /package/build/assets/{link-external-CaBmUEs_.js → link-external-DfKQroKX.js} +0 -0
- /package/build/assets/{list-todo-CAtvkzcy.js → list-todo-6J6zc8oS.js} +0 -0
- /package/build/assets/{llm-subscription-DtsX5Lhg.js → llm-subscription-Bvu8BLXc.js} +0 -0
- /package/build/assets/{loader-circle-CsAsfLIs.js → loader-circle-DGsqG5qw.js} +0 -0
- /package/build/assets/{map-provider-BbIb12oh.js → map-provider-BSvXvVR0.js} +0 -0
- /package/build/assets/{middleware-DYHYNAnP.js → middleware-_izt7V6U.js} +0 -0
- /package/build/assets/{modal-backdrop-zVwfOJZr.js → modal-backdrop-B7H42xHG.js} +0 -0
- /package/build/assets/{navigation-context-DPs2G0X8.js → navigation-context-cvyvI1WA.js} +0 -0
- /package/build/assets/{openhands-logo-bcNw5bkY.js → openhands-logo-pEw0nKFP.js} +0 -0
- /package/build/assets/{pencil-CWhApFIT.js → pencil-DmSqWUA3.js} +0 -0
- /package/build/assets/{react-DPDgL6du.js → react-MKQOkha9.js} +0 -0
- /package/build/assets/{search-BgOCR7_c.js → search-B5D5EuSn.js} +0 -0
- /package/build/assets/{search-dIQ09UY2.js → search-vnYL5jwV.js} +0 -0
- /package/build/assets/{settings-gear-MXCyZW0x.js → settings-gear-BOwF59Bs.js} +0 -0
- /package/build/assets/{settings-section-header-context-COMOIaxV.js → settings-section-header-context-CGgHZXrf.js} +0 -0
- /package/build/assets/{skills-EqzxYBvT.js → skills-arUOHLcS.js} +0 -0
- /package/build/assets/{square-chevron-right-DE-JN-2Z.js → square-chevron-right-EizCGtgq.js} +0 -0
- /package/build/assets/{switch-skeleton-DqQwalyu.js → switch-skeleton-BjPRx1QD.js} +0 -0
- /package/build/assets/{terminal-Cgf___rK.js → terminal-a57bHgZs.js} +0 -0
- /package/build/assets/{trash-2-BU6BlW4i.js → trash-2-CF3hilrY.js} +0 -0
- /package/build/assets/{u-check-circle-BqoIxNz_.js → u-check-circle-WGqHdtfO.js} +0 -0
- /package/build/assets/{u-check-circle-half-MsShT8Ec.js → u-check-circle-half-LiwZkuFe.js} +0 -0
- /package/build/assets/{u-edit-DL5LgKon.js → u-edit-BwHepAPi.js} +0 -0
- /package/build/assets/{use-breakpoint-BP3lqLMx.js → use-breakpoint-B-O0lQ84.js} +0 -0
- /package/build/assets/{use-click-outside-element-D9BYdANT.js → use-click-outside-element-DLQIMQrz.js} +0 -0
- /package/build/assets/{use-is-authed-BezEyfeh.js → use-is-authed-BSeo4coy.js} +0 -0
- /package/build/assets/{use-onboarding-completion-C_Swglzp.js → use-onboarding-completion-C0hPNGpw.js} +0 -0
- /package/build/assets/{v4-DbCkTSoU.js → v4-q4yWTlMz.js} +0 -0
- /package/build/assets/{vendor~browser-By2MVv_N.js → vendor~browser-UwB1jbAZ.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-CxfzCmkN.js → vendor~conversation-panel~conversation~alert-banner-DHDkknt5.js} +0 -0
- /package/build/assets/{vendor~index-home~home~conversation-panel~conversation-ChmYLVgz.js → vendor~index-home~home~conversation-panel~conversation-Bff9cq5J.js} +0 -0
- /package/build/assets/{vendor~module-D5a_AClf.js → vendor~module-D4DeFV4J.js} +0 -0
- /package/build/assets/{vendor~terminal-CnKZILnC.js → vendor~terminal-B7Eiak0-.js} +0 -0
- /package/build/assets/{x-ZE4iplpF.js → x-DQB_00VJ.js} +0 -0
- /package/build/assets/{x-mark-Batp6gXa.js → x-mark-B32XuEwS.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-conversation-service.api.cjs","names":[],"sources":["../../../src/api/conversation-service/agent-server-conversation-service.api.ts"],"sourcesContent":["import {\n ConversationSortOrder,\n type ForkConversationRequest,\n type LLMConfig,\n} from \"@openhands/typescript-client\";\nimport {\n ConversationClient,\n FileClient,\n ProfilesClient,\n VSCodeClient,\n} from \"@openhands/typescript-client/clients\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AgentKind, Provider } from \"#/types/settings\";\nimport type { ConversationRuntimeContext } from \"#/api/conversation-file-upload.api\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport {\n buildConversationWorkingDir,\n getAgentServerWorkingDir,\n} from \"../agent-server-config\";\nimport { resolveAbsoluteAgentServerPath } from \"../agent-server-home\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport ProfilesService from \"../profiles-service/profiles-service.api\";\nimport {\n batchGetCloudConversations,\n createCloudAppConversation,\n deleteCloudConversation,\n downloadCloudConversation,\n getCloudAppConversationStartTask,\n readCloudConversationFile,\n searchCloudConversations,\n updateCloudConversationPublicFlag,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n emptyHooksResponse,\n getDefaultConversationTitle,\n toAppConversation,\n toConversationPage,\n} from \"../agent-server-adapter\";\nimport { GetVSCodeUrlResponse } from \"../open-hands.types\";\nimport {\n getAgentServerClientOptions,\n NoBackendAvailableError,\n} from \"../agent-server-client-options\";\nimport SettingsService from \"../settings-service/settings-service.api\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n SendMessageRequest,\n SendMessageResponse,\n} from \"./agent-server-conversation-service.types\";\n\nconst DEFAULT_CONVERSATION_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\nconst INVALID_CONVERSATION_RESPONSE_MESSAGE =\n \"Unable to load conversations because the selected agent server returned \" +\n \"data this UI does not understand. Check the backend URL/session key and \" +\n \"update the agent server if needed.\";\nfunction invalidConversationResponse(): Error {\n return new Error(INVALID_CONVERSATION_RESPONSE_MESSAGE);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction numberOrNull(value: unknown): number | null {\n return typeof value === \"number\" ? value : null;\n}\n\nfunction numberOrZero(value: unknown): number {\n return typeof value === \"number\" ? value : 0;\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nfunction readTimestamp(\n item: Record<string, unknown>,\n snakeKey: \"created_at\" | \"updated_at\",\n camelKey: \"createdAt\" | \"updatedAt\",\n): string {\n const value = item[snakeKey] ?? item[camelKey];\n return typeof value === \"string\" && value.trim()\n ? value\n : DEFAULT_CONVERSATION_TIMESTAMP;\n}\n\nfunction normalizeTokenUsage(\n value: unknown,\n): NonNullable<MetricsSnapshot[\"accumulated_token_usage\"]> | null {\n if (!isRecord(value)) return null;\n\n return {\n prompt_tokens: numberOrZero(value.prompt_tokens),\n completion_tokens: numberOrZero(value.completion_tokens),\n cache_read_tokens: numberOrZero(value.cache_read_tokens),\n cache_write_tokens: numberOrZero(value.cache_write_tokens),\n context_window: numberOrZero(value.context_window),\n per_turn_token: numberOrZero(value.per_turn_token),\n };\n}\n\nfunction normalizeMetrics(value: unknown): MetricsSnapshot | null {\n if (!isRecord(value)) return null;\n\n return {\n accumulated_cost: numberOrNull(value.accumulated_cost),\n max_budget_per_task: numberOrNull(value.max_budget_per_task),\n accumulated_token_usage: normalizeTokenUsage(value.accumulated_token_usage),\n };\n}\n\nfunction normalizeAgent(value: unknown): DirectConversationInfo[\"agent\"] {\n if (!isRecord(value)) return null;\n const llm = isRecord(value.llm)\n ? { model: stringOrNull(value.llm.model) }\n : null;\n // ``kind`` is the SDK's pydantic discriminator (``\"Agent\"`` vs ``\"ACPAgent\"``);\n // ``toAppConversation`` reads it to derive ``agent_kind``. ``acp_server`` is\n // the ACP provider identity (``ACPAgent.acp_server``, SDK #3692) — required so\n // the adapter can source the chip + in-conversation model list from the agent\n // when the ``acpserver`` tag is absent (a profile launch doesn't stamp it,\n // #1571). ``acp_model`` is the Canvas-configured model — preserved so the chip\n // can fall back to it when the SDK runtime model fields aren't populated.\n // Preserving these makes the wire path agree with the unit-test path that\n // builds ``DirectConversationInfo`` directly\n // (e.g. ``__tests__/api/agent-server-adapter.test.ts``).\n return {\n kind: stringOrNull(value.kind),\n acp_server: stringOrNull(value.acp_server),\n acp_model: stringOrNull(value.acp_model),\n llm,\n };\n}\n\nfunction normalizeWorkspace(\n value: unknown,\n): DirectConversationInfo[\"workspace\"] {\n if (!isRecord(value)) return null;\n return { working_dir: stringOrNull(value.working_dir) };\n}\n\n/**\n * Accept the agent-server's ``tags: Record[str, str]`` payload defensively:\n * the wire shape is guaranteed by the server-side validator (keys\n * ``^[a-z0-9]+$``, string values), but a non-conforming response (older\n * server, raw API write, future schema drift) must never crash the parser\n * — Canvas only consumes ``acpserver`` and falls back to a generic chip\n * for anything it doesn't recognize. Drop entries whose value isn't a\n * plain string; return ``null`` when the wire field is absent or not an\n * object so consumers can use ``info.tags?.[KEY] ?? null`` uniformly.\n */\nfunction normalizeTags(value: unknown): Record<string, string> | null {\n if (!isRecord(value)) return null;\n const tags: Record<string, string> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (typeof entry === \"string\") {\n tags[key] = entry;\n }\n }\n return tags;\n}\n\nfunction normalizeLaunchedAgentProfile(\n value: unknown,\n): DirectConversationInfo[\"launched_agent_profile\"] {\n if (!isRecord(value)) return null;\n const { agent_profile_id: agentProfileId, revision } = value;\n if (typeof agentProfileId !== \"string\" || typeof revision !== \"number\") {\n return null;\n }\n return { agent_profile_id: agentProfileId, revision };\n}\n\nfunction normalizeAbsolutePath(path: string): string | null {\n if (!path.startsWith(\"/\")) return null;\n\n const segments: string[] = [];\n for (const segment of path.split(\"/\")) {\n if (segment && segment !== \".\") {\n if (segment === \"..\") {\n if (!segments.length) return null;\n segments.pop();\n } else {\n segments.push(segment);\n }\n }\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction requirePathInsideDirectory(path: string, directory: string): string {\n const normalizedPath = normalizeAbsolutePath(path);\n const normalizedDirectory = normalizeAbsolutePath(directory);\n\n if (\n !normalizedPath ||\n !normalizedDirectory ||\n (normalizedPath !== normalizedDirectory &&\n !normalizedPath.startsWith(`${normalizedDirectory}/`))\n ) {\n throw new Error(\"Conversation file path must stay inside the workspace\");\n }\n\n return normalizedPath;\n}\n\nfunction requireDirectConversationInfo(item: unknown): DirectConversationInfo {\n if (!isRecord(item) || typeof item.id !== \"string\" || !item.id.trim()) {\n throw invalidConversationResponse();\n }\n\n return {\n id: item.id.trim(),\n title: stringOrNull(item.title),\n created_at: readTimestamp(item, \"created_at\", \"createdAt\"),\n updated_at: readTimestamp(item, \"updated_at\", \"updatedAt\"),\n execution_status: stringOrNull(item.execution_status),\n sandbox_status: stringOrNull(item.sandbox_status),\n metrics: normalizeMetrics(item.metrics),\n agent: normalizeAgent(item.agent),\n workspace: normalizeWorkspace(item.workspace),\n tags: normalizeTags(item.tags),\n launched_agent_profile: normalizeLaunchedAgentProfile(\n item.launched_agent_profile,\n ),\n // SDK-runtime ACP model fields (populated when the agent-server supports\n // ``ConversationInfo.current_model_*``). Consumed by the conversation\n // adapter to drive the per-card chip's model text. Older agent-servers\n // omit these — adapter handles ``undefined`` / ``null`` gracefully.\n current_model_id: stringOrNull(item.current_model_id),\n current_model_name: stringOrNull(item.current_model_name),\n };\n}\n\nfunction requireDirectConversationItems(\n items: unknown,\n): DirectConversationInfo[] {\n if (!Array.isArray(items)) {\n throw invalidConversationResponse();\n }\n return items.map(requireDirectConversationInfo);\n}\n\nfunction requireConversationSearchPage(page: unknown): {\n items: DirectConversationInfo[];\n next_page_id: string | null;\n} {\n if (Array.isArray(page)) {\n return {\n items: requireDirectConversationItems(page),\n next_page_id: null,\n };\n }\n\n if (!isRecord(page)) {\n throw invalidConversationResponse();\n }\n\n return {\n items: requireDirectConversationItems(page.items),\n next_page_id:\n typeof page.next_page_id === \"string\" ? page.next_page_id : null,\n };\n}\n\nconst RUNTIME_STATUSES = new Set<string>([\n \"idle\",\n \"running\",\n \"paused\",\n \"waiting_for_confirmation\",\n \"finished\",\n \"error\",\n \"stuck\",\n]);\n\nfunction toRuntimeStatus(\n status: DirectConversationInfo[\"execution_status\"],\n): RuntimeConversationInfo[\"status\"] {\n const nextStatus = status ?? \"idle\";\n return (\n RUNTIME_STATUSES.has(nextStatus) ? nextStatus : \"idle\"\n ) as RuntimeConversationInfo[\"status\"];\n}\n\nfunction requireAppConversation(\n conversation: AppConversation | null | undefined,\n conversationId: string,\n): AppConversation {\n if (!conversation) {\n throw new Error(`Conversation ${conversationId} was not found`);\n }\n return conversation;\n}\n\nclass AgentServerConversationService {\n static async sendMessage(\n conversationId: string,\n message: SendMessageRequest,\n runtime?: ConversationRuntimeContext | null,\n ): Promise<SendMessageResponse> {\n const active = getActiveBackend().backend;\n let conversationUrl = runtime?.conversationUrl ?? null;\n let sessionApiKey = runtime?.sessionApiKey ?? null;\n\n if (active.kind === \"cloud\") {\n if (!conversationUrl || !sessionApiKey) {\n const [conversation] = await batchGetCloudConversations([\n conversationId,\n ]);\n conversationUrl = conversation?.conversation_url?.trim() ?? null;\n sessionApiKey = conversation?.session_api_key?.trim() ?? null;\n }\n\n if (!conversationUrl || !sessionApiKey) {\n throw new Error(\n \"Conversation sandbox is still starting. Wait for it to finish, then try again.\",\n );\n }\n\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/events`,\n body: { ...message, run: true },\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n\n return message;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).sendEvent(conversationId, message, {\n run: true,\n });\n\n return message;\n }\n\n static async createConversation(\n initialUserMsg?: string,\n conversationInstructions?: string,\n plugins?: PluginSpec[],\n metadata?: ConversationMetadata | null,\n workingDirOverride?: string,\n workspaceMode?: WorkspaceMode,\n parentConversationId?: string,\n agentType?: \"default\" | \"plan\",\n sandboxId?: string,\n // Launch from a saved AgentProfile (resolved server-side) instead of the\n // current encrypted agent_settings (#3727). Supported on both local and the\n // cloud app-server (OpenHands #15060): local threads it through the\n // encrypted-settings builder; cloud sends it as a flat request field.\n agentProfileId?: string,\n agentProfileKind?: AgentKind,\n ): Promise<AppConversationStartTask> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud path mirrors OpenHands' frontend: build a flat\n // AppConversationStartRequest, POST /api/v1/app-conversations\n // (returns a WORKING task), and let the conversation route's\n // useTaskPolling drive it to READY. NO encrypted-settings\n // round-trip — the cloud backend holds secrets server-side.\n // When launching from a profile, send `agent_profile_id`; the backend\n // resolves it to agent_settings server-side.\n const request: AppConversationStartRequest = {\n initial_message: initialUserMsg\n ? {\n role: \"user\",\n content: [{ type: \"text\", text: initialUserMsg }],\n }\n : null,\n title: conversationInstructions ?? null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n plugins: plugins ?? null,\n parent_conversation_id: parentConversationId ?? null,\n agent_type: agentType,\n sandbox_id: sandboxId ?? null,\n agent_profile_id: agentProfileId ?? null,\n };\n return createCloudAppConversation(request);\n }\n\n const settings = await SettingsService.getSettings();\n const conversationId = uuidv4();\n // @spec WUP-001 — Send an absolute working_dir to the agent-server.\n // The default is `workspace/project/<hex>` (relative); without\n // resolving it here, `/api/file/upload` later prepends `/` and writes\n // to `/workspace/...` (read-only on macOS and fresh containers). When\n // the user picks an explicit workspace, `workingDirOverride` is\n // already absolute (it comes from `search_subdirs`).\n const workingDir = await resolveAbsoluteAgentServerPath(\n workingDirOverride ?? buildConversationWorkingDir(conversationId),\n );\n const resolvedWorkspaceMode =\n workspaceMode ?? (workingDirOverride ? \"local_repo\" : \"new_worktree\");\n\n // Use encrypted settings to avoid exposing secrets in the browser\n const payload = await buildStartConversationRequestWithEncryptedSettings({\n settings,\n query: initialUserMsg,\n conversationInstructions,\n plugins,\n conversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n });\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).createConversation<DirectConversationInfo>(payload);\n const localBackend = getEffectiveLocalBackend();\n if (!localBackend) throw new NoBackendAvailableError();\n\n if (metadata?.selected_repository || workingDirOverride) {\n // The agent-server runtime has no concept of selected repo/branch/\n // workspace, so persist the home-page selection client-side.\n // `toAppConversation` reads the repo/branch fields back to hydrate\n // the chat-page badges; `useHasAttachedSource` reads\n // `selected_workspace` to default the Files tab to Diff mode when\n // the user explicitly attached a local workspace.\n setStoredConversationMetadata(data.id, {\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: workingDirOverride ?? null,\n workspace_mode: resolvedWorkspaceMode,\n });\n }\n\n return {\n id: data.id,\n created_by_user_id: null,\n status: \"READY\",\n detail: null,\n app_conversation_id: data.id,\n agent_server_url: localBackend.host,\n request: {\n initial_message: payload.initial_message as\n | AppConversationStartRequest[\"initial_message\"]\n | undefined,\n plugins: plugins ?? null,\n },\n created_at: data.created_at,\n updated_at: data.updated_at,\n };\n }\n\n static async getStartTask(\n taskId: string,\n ): Promise<AppConversationStartTask | null> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return getCloudAppConversationStartTask(taskId);\n }\n // Local agent-server creates conversations synchronously — every\n // local \"task\" is already READY when createConversation returns, so\n // there's nothing to poll for.\n return null;\n }\n\n static async getVSCodeUrl(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<GetVSCodeUrlResponse> {\n // Local-only path. Cloud conversations read the VSCode URL straight\n // from the cloud-computed `sandbox.exposed_urls` (see\n // `useUnifiedVSCodeUrl` + `useCloudSandbox`); the runtime's own\n // `/api/vscode/url` only knows its internal `localhost:8001`, which\n // the user's browser can't reach.\n const workspaceDir =\n await this.resolveConversationWorkingDir(conversationId);\n // Local mode: the typescript-client targets the local agent-server\n // directly via the conversationUrl override.\n const vscodeUrl = await new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getUrl({\n baseUrl:\n typeof window !== \"undefined\" ? window.location.origin : undefined,\n workspaceDir,\n });\n\n return { vscode_url: vscodeUrl };\n }\n\n static async resolveConversationWorkingDir(\n conversationId: string,\n ): Promise<string> {\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return conversation?.workspace?.working_dir ?? getAgentServerWorkingDir();\n }\n\n static async batchGetAppConversations(\n ids: string[],\n ): Promise<(AppConversation | null)[]> {\n if (ids.length === 0) return [];\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n return batchGetCloudConversations(ids);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).getConversations<DirectConversationInfo>(ids);\n\n return requireDirectConversationItems(data).map((item) =>\n toAppConversation(item),\n );\n }\n\n static async updateConversationPublicFlag(\n conversationId: string,\n isPublic: boolean,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind !== \"cloud\") {\n throw new Error(\"Public sharing requires a cloud backend.\");\n }\n return updateCloudConversationPublicFlag(conversationId, isPublic);\n }\n\n static async updateConversationRepository(\n conversationId: string,\n repository: string | null,\n branch?: string | null,\n gitProvider?: string | null,\n ): Promise<AppConversation> {\n if (repository) {\n const existing = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...(existing ?? {}),\n selected_repository: repository,\n selected_branch: branch ?? null,\n git_provider: (gitProvider as Provider | null | undefined) ?? null,\n });\n } else {\n removeStoredConversationMetadata(conversationId);\n }\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n static async readConversationFile(\n conversationId: string,\n filePath?: string,\n ): Promise<string> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud exposes a per-conversation file endpoint; the sandbox\n // working dir is fixed (`/workspace/project`), so PLAN.md lives at\n // a known absolute path. Mirrors OpenHands' readConversationFile.\n const path = requirePathInsideDirectory(\n filePath ?? \"/workspace/project/.agents_tmp/PLAN.md\",\n \"/workspace/project\",\n );\n return readCloudConversationFile(conversationId, path);\n }\n\n const workingDir = await this.resolveConversationWorkingDir(conversationId);\n const path = requirePathInsideDirectory(\n filePath ?? `${workingDir}/.agents_tmp/PLAN.md`,\n workingDir,\n );\n return new FileClient(getAgentServerClientOptions()).downloadTextFile(path);\n }\n\n static async downloadConversation(conversationId: string): Promise<Blob> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return downloadCloudConversation(conversationId);\n }\n\n return new FileClient(getAgentServerClientOptions()).downloadTrajectory(\n conversationId,\n );\n }\n\n static async getHooks(conversationId: string): Promise<GetHooksResponse> {\n if (!conversationId) {\n return emptyHooksResponse();\n }\n return emptyHooksResponse();\n }\n\n static async getRuntimeConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<RuntimeConversationInfo> {\n const active = getActiveBackend().backend;\n\n type RawRuntime = DirectConversationInfo & {\n stats?: RuntimeConversationInfo[\"stats\"];\n };\n\n // Cloud mode: route through the cloud-proxy to the runtime sandbox at\n // the conversation's runtime URL — same pattern as getVSCodeUrl. Local\n // mode forwards conversationUrl so the host explicitly resolves to the\n // conversation's runtime instead of falling back to the active backend.\n const response =\n active.kind === \"cloud\" && conversationUrl\n ? await callCloudProxy<RawRuntime>({\n backend: active,\n method: \"GET\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}`,\n authMode: \"session-api-key\",\n sessionApiKey,\n })\n : await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<RawRuntime>(conversationId);\n const data = requireDirectConversationInfo(response);\n const stats = isRecord(response) ? response.stats : null;\n\n return {\n id: data.id,\n title: data.title?.trim()\n ? data.title\n : getDefaultConversationTitle(data.id),\n metrics: normalizeMetrics(data.metrics),\n created_at: data.created_at,\n updated_at: data.updated_at,\n status: toRuntimeStatus(data.execution_status),\n stats: isRecord(stats) ? stats : { usage_to_metrics: {} },\n };\n }\n\n static async searchConversations(\n limit: number = 20,\n pageId?: string,\n ): Promise<AppConversationPage> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return searchCloudConversations(limit, pageId);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).searchConversations({\n limit,\n page_id: pageId,\n sort_order: ConversationSortOrder.UPDATED_AT_DESC,\n });\n\n return toConversationPage(requireConversationSearchPage(data));\n }\n\n static async deleteConversation(conversationId: string): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await deleteCloudConversation(conversationId);\n } else {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).deleteConversation(conversationId);\n }\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n title,\n });\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n /**\n * Forks a conversation, copying event history up to and including\n * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for\n * `from_event_id` (older backends copy the whole conversation).\n */\n static async forkConversation(\n sourceConversationId: string,\n fromEventId: string,\n title?: string,\n ): Promise<DirectConversationInfo> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\n \"Branching a conversation isn't supported on the cloud backend yet.\",\n );\n }\n\n // `from_event_id` is accepted by `/fork` but not yet typed in\n // ForkConversationRequest (through client 1.32.0); the client forwards the\n // body verbatim, so cast to carry it. A title also suppresses the backend\n // auto-title, so the \"(branch)\" marker sticks.\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).forkConversation<DirectConversationInfo>(sourceConversationId, {\n from_event_id: fromEventId,\n ...(title ? { title } : {}),\n } as ForkConversationRequest & { from_event_id: string });\n\n // Carry over the source's client-side metadata (repo/branch/workspace/\n // profile/plugins) so the fork hydrates its chat-page badges the same way.\n const sourceMetadata = getStoredConversationMetadata(sourceConversationId);\n if (sourceMetadata) {\n setStoredConversationMetadata(data.id, sourceMetadata);\n }\n\n return data;\n }\n\n /**\n * Returns an event's `parent_id` (the fork point for branching *before* it),\n * or undefined at the root. Uses the single-event endpoint because the events\n * *search* API omits `parent_id`.\n */\n static async getEventParentId(\n conversationId: string,\n eventId: string,\n ): Promise<string | undefined> {\n const event = (await new ConversationClient(\n getAgentServerClientOptions(),\n ).getEvent(conversationId, eventId)) as { parent_id?: string | null };\n return event.parent_id ?? undefined;\n }\n\n /**\n * Switches the LLM profile for the running conversation when one is open\n * (POST /switch_profile — per-conversation swap, doesn't change the user's\n * default profile). When called without a conversationId (home page),\n * falls back to POST /activate so the next conversation created picks up\n * the chosen profile.\n *\n * The per-conversation endpoint accepts only the profile name, so the UI does\n * not need to fetch or forward profile secrets. That keeps switching working\n * even when the agent server has no OH_SECRET_KEY for encrypted secret export.\n *\n * Cloud backends route to the app-server's per-conversation\n * `/switch_profile`, which owns the profiles and resolves the swap\n * server-side (base_url/api_key fixups, usage_id derivation, then the\n * agent-server's switch_llm) — so the client only forwards the profile name,\n * mirroring {@link switchAcpModel}.\n */\n static async switchProfile(\n conversationId: string | null,\n profileName: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n\n if (backend.kind === \"cloud\") {\n // No conversation (home page): activate globally so the next\n // conversation starts with it. ProfilesService routes to the cloud\n // activate endpoint.\n if (!conversationId) {\n await ProfilesService.activateProfile(profileName);\n return;\n }\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_profile`,\n body: { profile_name: profileName },\n });\n return;\n }\n\n if (!conversationId) {\n await new ProfilesClient(getAgentServerClientOptions()).activateProfile(\n profileName,\n );\n return;\n }\n\n const clientOptions = getAgentServerClientOptions();\n const conversationClient = new ConversationClient(clientOptions);\n const profile = await new ProfilesClient(clientOptions).getProfile(\n profileName,\n { exposeSecrets: \"encrypted\" },\n );\n const model =\n typeof profile.config.model === \"string\" ? profile.config.model : \"\";\n if (!model) throw new Error(`Profile '${profileName}' has no model.`);\n await assertSubscriptionAuthReady({ llm: profile.config });\n await conversationClient.switchLLM(conversationId, {\n ...profile.config,\n model,\n // Keep streaming on after a switch (parity with conversation start);\n // the profile config would otherwise default it to stream=False.\n stream: true,\n // Avoid stale first-write-wins entries in the backend LLM registry.\n usage_id: `profile:${profileName}:${uuidv4()}`,\n } as LLMConfig);\n }\n\n /**\n * Switches the model of a running ACP conversation in place (POST\n * /switch_acp_model — the ACP analog of {@link switchProfile}'s /switch_profile).\n * The agent-server calls the ACP wrapper's ``session/set_model`` on the live\n * session, preserving context. Mirrors {@link switchProfile}'s\n * local-backend-only guard and per-conversation ConversationClient call.\n *\n * Only valid once an ACP session exists (after the first message); the\n * agent-server returns 409 before then — the home/no-session default is\n * persisted via Settings instead (see ``use-switch-acp-model``).\n */\n static async switchAcpModel(\n conversationId: string,\n model: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n if (backend.kind === \"cloud\") {\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_acp_model`,\n body: { model },\n });\n return;\n }\n\n await new ConversationClient(getAgentServerClientOptions()).switchAcpModel(\n conversationId,\n model,\n );\n }\n}\n\nexport default AgentServerConversationService;\n"],"mappings":"gtCAuEA,IAAM,EAAiC,2BACjC,EACJ,qLAGF,SAAS,GAAqC,CAC5C,OAAW,MAAM,EAAsC,CAGzD,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,EAAM,CAG7E,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EAAa,EAAwB,CAC5C,OAAO,OAAO,GAAU,SAAW,EAAQ,EAG7C,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EACP,EACA,EACA,EACQ,CACR,IAAM,EAAQ,EAAK,IAAa,EAAK,GACrC,OAAO,OAAO,GAAU,UAAY,EAAM,MAAM,CAC5C,EACA,EAGN,SAAS,EACP,EACgE,CAGhE,OAFK,EAAS,EAAM,CAEb,CACL,cAAe,EAAa,EAAM,cAAc,CAChD,kBAAmB,EAAa,EAAM,kBAAkB,C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gB,CACnB,MAAM,EAAA,QAAgB,gBAAgB,EAAY,CAClD,OAEF,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,iBAClD,KAAM,CAAE,aAAc,EAAa,CACpC,CAAC,CACF,OAGF,GAAI,CAAC,EAAgB,CACnB,MAAM,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,gBACtD,EACD,CACD,OAGF,IAAM,EAAgB,EAAA,6BAA6B,CAC7C,EAAqB,IAAI,EAAA,mBAAmB,EAAc,CAC1D,EAAU,MAAM,IAAI,EAAA,eAAe,EAAc,CAAC,WACtD,EACA,CAAE,cAAe,YAAa,CAC/B,CACK,EACJ,OAAO,EAAQ,OAAO,OAAU,SAAW,EAAQ,OAAO,MAAQ,GACpE,GAAI,CAAC,EAAO,MAAU,MAAM,YAAY,EAAY,iBAAiB,CACrE,MAAM,EAAA,4BAA4B,CAAE,IAAK,EAAQ,OAAQ,CAAC,CAC1D,MAAM,EAAmB,UAAU,EAAgB,CACjD,GAAG,EAAQ,OACX,QAGA,OAAQ,GAER,SAAU,WAAW,EAAY,GAAG,EAAA,SAAQ,GAC7C,CAAc,CAcjB,aAAa,eACX,EACA,EACe,CACf,GAAM,CAAE,WAAY,EAAA,kBAAkB,CACtC,GAAI,EAAQ,OAAS,QAAS,CAC5B,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,mBAClD,KAAM,CAAE,QAAO,CAChB,CAAC,CACF,OAGF,MAAM,IAAI,EAAA,mBAAmB,EAAA,6BAA6B,CAAC,CAAC,eAC1D,EACA,EACD"}
|
|
1
|
+
{"version":3,"file":"agent-server-conversation-service.api.cjs","names":[],"sources":["../../../src/api/conversation-service/agent-server-conversation-service.api.ts"],"sourcesContent":["import {\n ConversationSortOrder,\n type ForkConversationRequest,\n type LLMConfig,\n} from \"@openhands/typescript-client\";\nimport {\n ConversationClient,\n FileClient,\n ProfilesClient,\n VSCodeClient,\n} from \"@openhands/typescript-client/clients\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AgentKind, Provider } from \"#/types/settings\";\nimport type { ConversationRuntimeContext } from \"#/api/conversation-file-upload.api\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport {\n buildConversationWorkingDir,\n getAgentServerWorkingDir,\n} from \"../agent-server-config\";\nimport { resolveAbsoluteAgentServerPath } from \"../agent-server-home\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport ProfilesService from \"../profiles-service/profiles-service.api\";\nimport {\n batchGetCloudConversations,\n createCloudAppConversation,\n deleteCloudConversation,\n downloadCloudConversation,\n getCloudAppConversationStartTask,\n readCloudConversationFile,\n searchCloudConversations,\n updateCloudConversationPublicFlag,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n emptyHooksResponse,\n getDefaultConversationTitle,\n toAppConversation,\n toConversationPage,\n} from \"../agent-server-adapter\";\nimport { GetVSCodeUrlResponse } from \"../open-hands.types\";\nimport {\n getAgentServerClientOptions,\n NoBackendAvailableError,\n} from \"../agent-server-client-options\";\nimport SettingsService from \"../settings-service/settings-service.api\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport { resolveTitleLlmProfile } from \"#/utils/title-llm-profile\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n SendMessageRequest,\n SendMessageResponse,\n} from \"./agent-server-conversation-service.types\";\n\nconst DEFAULT_CONVERSATION_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\n// Creating the first conversation right after a cold agent-server boot (fresh\n// machine or the packaged desktop app, where uvx may still be warming caches)\n// can exceed the client's 60s default timeout.\nconst CREATE_CONVERSATION_TIMEOUT_MS = 5 * 60 * 1000;\nconst INVALID_CONVERSATION_RESPONSE_MESSAGE =\n \"Unable to load conversations because the selected agent server returned \" +\n \"data this UI does not understand. Check the backend URL/session key and \" +\n \"update the agent server if needed.\";\nfunction invalidConversationResponse(): Error {\n return new Error(INVALID_CONVERSATION_RESPONSE_MESSAGE);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction numberOrNull(value: unknown): number | null {\n return typeof value === \"number\" ? value : null;\n}\n\nfunction numberOrZero(value: unknown): number {\n return typeof value === \"number\" ? value : 0;\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nfunction readTimestamp(\n item: Record<string, unknown>,\n snakeKey: \"created_at\" | \"updated_at\",\n camelKey: \"createdAt\" | \"updatedAt\",\n): string {\n const value = item[snakeKey] ?? item[camelKey];\n return typeof value === \"string\" && value.trim()\n ? value\n : DEFAULT_CONVERSATION_TIMESTAMP;\n}\n\nfunction normalizeTokenUsage(\n value: unknown,\n): NonNullable<MetricsSnapshot[\"accumulated_token_usage\"]> | null {\n if (!isRecord(value)) return null;\n\n return {\n prompt_tokens: numberOrZero(value.prompt_tokens),\n completion_tokens: numberOrZero(value.completion_tokens),\n cache_read_tokens: numberOrZero(value.cache_read_tokens),\n cache_write_tokens: numberOrZero(value.cache_write_tokens),\n context_window: numberOrZero(value.context_window),\n per_turn_token: numberOrZero(value.per_turn_token),\n };\n}\n\nfunction normalizeMetrics(value: unknown): MetricsSnapshot | null {\n if (!isRecord(value)) return null;\n\n return {\n accumulated_cost: numberOrNull(value.accumulated_cost),\n max_budget_per_task: numberOrNull(value.max_budget_per_task),\n accumulated_token_usage: normalizeTokenUsage(value.accumulated_token_usage),\n };\n}\n\nfunction normalizeAgent(value: unknown): DirectConversationInfo[\"agent\"] {\n if (!isRecord(value)) return null;\n const llm = isRecord(value.llm)\n ? { model: stringOrNull(value.llm.model) }\n : null;\n // ``kind`` is the SDK's pydantic discriminator (``\"Agent\"`` vs ``\"ACPAgent\"``);\n // ``toAppConversation`` reads it to derive ``agent_kind``. ``acp_server`` is\n // the ACP provider identity (``ACPAgent.acp_server``, SDK #3692) — required so\n // the adapter can source the chip + in-conversation model list from the agent\n // when the ``acpserver`` tag is absent (a profile launch doesn't stamp it,\n // #1571). ``acp_model`` is the Canvas-configured model — preserved so the chip\n // can fall back to it when the SDK runtime model fields aren't populated.\n // Preserving these makes the wire path agree with the unit-test path that\n // builds ``DirectConversationInfo`` directly\n // (e.g. ``__tests__/api/agent-server-adapter.test.ts``).\n return {\n kind: stringOrNull(value.kind),\n acp_server: stringOrNull(value.acp_server),\n acp_model: stringOrNull(value.acp_model),\n llm,\n };\n}\n\nfunction normalizeWorkspace(\n value: unknown,\n): DirectConversationInfo[\"workspace\"] {\n if (!isRecord(value)) return null;\n return { working_dir: stringOrNull(value.working_dir) };\n}\n\n/**\n * Accept the agent-server's ``tags: Record[str, str]`` payload defensively:\n * the wire shape is guaranteed by the server-side validator (keys\n * ``^[a-z0-9]+$``, string values), but a non-conforming response (older\n * server, raw API write, future schema drift) must never crash the parser\n * — Canvas only consumes ``acpserver`` and falls back to a generic chip\n * for anything it doesn't recognize. Drop entries whose value isn't a\n * plain string; return ``null`` when the wire field is absent or not an\n * object so consumers can use ``info.tags?.[KEY] ?? null`` uniformly.\n */\nfunction normalizeTags(value: unknown): Record<string, string> | null {\n if (!isRecord(value)) return null;\n const tags: Record<string, string> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (typeof entry === \"string\") {\n tags[key] = entry;\n }\n }\n return tags;\n}\n\nfunction normalizeLaunchedAgentProfile(\n value: unknown,\n): DirectConversationInfo[\"launched_agent_profile\"] {\n if (!isRecord(value)) return null;\n const { agent_profile_id: agentProfileId, revision } = value;\n if (typeof agentProfileId !== \"string\" || typeof revision !== \"number\") {\n return null;\n }\n return { agent_profile_id: agentProfileId, revision };\n}\n\nfunction normalizeAbsolutePath(path: string): string | null {\n if (!path.startsWith(\"/\")) return null;\n\n const segments: string[] = [];\n for (const segment of path.split(\"/\")) {\n if (segment && segment !== \".\") {\n if (segment === \"..\") {\n if (!segments.length) return null;\n segments.pop();\n } else {\n segments.push(segment);\n }\n }\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction requirePathInsideDirectory(path: string, directory: string): string {\n const normalizedPath = normalizeAbsolutePath(path);\n const normalizedDirectory = normalizeAbsolutePath(directory);\n\n if (\n !normalizedPath ||\n !normalizedDirectory ||\n (normalizedPath !== normalizedDirectory &&\n !normalizedPath.startsWith(`${normalizedDirectory}/`))\n ) {\n throw new Error(\"Conversation file path must stay inside the workspace\");\n }\n\n return normalizedPath;\n}\n\nfunction requireDirectConversationInfo(item: unknown): DirectConversationInfo {\n if (!isRecord(item) || typeof item.id !== \"string\" || !item.id.trim()) {\n throw invalidConversationResponse();\n }\n\n return {\n id: item.id.trim(),\n title: stringOrNull(item.title),\n created_at: readTimestamp(item, \"created_at\", \"createdAt\"),\n updated_at: readTimestamp(item, \"updated_at\", \"updatedAt\"),\n execution_status: stringOrNull(item.execution_status),\n sandbox_status: stringOrNull(item.sandbox_status),\n metrics: normalizeMetrics(item.metrics),\n agent: normalizeAgent(item.agent),\n workspace: normalizeWorkspace(item.workspace),\n tags: normalizeTags(item.tags),\n launched_agent_profile: normalizeLaunchedAgentProfile(\n item.launched_agent_profile,\n ),\n // SDK-runtime ACP model fields (populated when the agent-server supports\n // ``ConversationInfo.current_model_*``). Consumed by the conversation\n // adapter to drive the per-card chip's model text. Older agent-servers\n // omit these — adapter handles ``undefined`` / ``null`` gracefully.\n current_model_id: stringOrNull(item.current_model_id),\n current_model_name: stringOrNull(item.current_model_name),\n };\n}\n\nfunction requireDirectConversationItems(\n items: unknown,\n): DirectConversationInfo[] {\n if (!Array.isArray(items)) {\n throw invalidConversationResponse();\n }\n return items.map(requireDirectConversationInfo);\n}\n\nfunction requireConversationSearchPage(page: unknown): {\n items: DirectConversationInfo[];\n next_page_id: string | null;\n} {\n if (Array.isArray(page)) {\n return {\n items: requireDirectConversationItems(page),\n next_page_id: null,\n };\n }\n\n if (!isRecord(page)) {\n throw invalidConversationResponse();\n }\n\n return {\n items: requireDirectConversationItems(page.items),\n next_page_id:\n typeof page.next_page_id === \"string\" ? page.next_page_id : null,\n };\n}\n\nconst RUNTIME_STATUSES = new Set<string>([\n \"idle\",\n \"running\",\n \"paused\",\n \"waiting_for_confirmation\",\n \"finished\",\n \"error\",\n \"stuck\",\n]);\n\nfunction toRuntimeStatus(\n status: DirectConversationInfo[\"execution_status\"],\n): RuntimeConversationInfo[\"status\"] {\n const nextStatus = status ?? \"idle\";\n return (\n RUNTIME_STATUSES.has(nextStatus) ? nextStatus : \"idle\"\n ) as RuntimeConversationInfo[\"status\"];\n}\n\nfunction requireAppConversation(\n conversation: AppConversation | null | undefined,\n conversationId: string,\n): AppConversation {\n if (!conversation) {\n throw new Error(`Conversation ${conversationId} was not found`);\n }\n return conversation;\n}\n\nclass AgentServerConversationService {\n static async sendMessage(\n conversationId: string,\n message: SendMessageRequest,\n runtime?: ConversationRuntimeContext | null,\n ): Promise<SendMessageResponse> {\n const active = getActiveBackend().backend;\n let conversationUrl = runtime?.conversationUrl ?? null;\n let sessionApiKey = runtime?.sessionApiKey ?? null;\n\n if (active.kind === \"cloud\") {\n if (!conversationUrl || !sessionApiKey) {\n const [conversation] = await batchGetCloudConversations([\n conversationId,\n ]);\n conversationUrl = conversation?.conversation_url?.trim() ?? null;\n sessionApiKey = conversation?.session_api_key?.trim() ?? null;\n }\n\n if (!conversationUrl || !sessionApiKey) {\n throw new Error(\n \"Conversation sandbox is still starting. Wait for it to finish, then try again.\",\n );\n }\n\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/events`,\n body: { ...message, run: true },\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n\n return message;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).sendEvent(conversationId, message, {\n run: true,\n });\n\n return message;\n }\n\n static async createConversation(\n initialUserMsg?: string,\n conversationInstructions?: string,\n plugins?: PluginSpec[],\n metadata?: ConversationMetadata | null,\n workingDirOverride?: string,\n workspaceMode?: WorkspaceMode,\n parentConversationId?: string,\n agentType?: \"default\" | \"plan\",\n sandboxId?: string,\n // Launch from a saved AgentProfile (resolved server-side) instead of the\n // current encrypted agent_settings (#3727). Supported on both local and the\n // cloud app-server (OpenHands #15060): local threads it through the\n // encrypted-settings builder; cloud sends it as a flat request field.\n agentProfileId?: string,\n agentProfileKind?: AgentKind,\n ): Promise<AppConversationStartTask> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud path mirrors OpenHands' frontend: build a flat\n // AppConversationStartRequest, POST /api/v1/app-conversations\n // (returns a WORKING task), and let the conversation route's\n // useTaskPolling drive it to READY. NO encrypted-settings\n // round-trip — the cloud backend holds secrets server-side.\n // When launching from a profile, send `agent_profile_id`; the backend\n // resolves it to agent_settings server-side.\n const request: AppConversationStartRequest = {\n initial_message: initialUserMsg\n ? {\n role: \"user\",\n content: [{ type: \"text\", text: initialUserMsg }],\n }\n : null,\n title: conversationInstructions ?? null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n plugins: plugins ?? null,\n parent_conversation_id: parentConversationId ?? null,\n agent_type: agentType,\n sandbox_id: sandboxId ?? null,\n agent_profile_id: agentProfileId ?? null,\n };\n return createCloudAppConversation(request);\n }\n\n const [settings, profiles] = await Promise.all([\n SettingsService.getSettings(),\n ProfilesService.listProfiles().catch(() => undefined),\n ]);\n const titleLlmProfile = resolveTitleLlmProfile(\n settings.title_llm_profile,\n profiles,\n );\n const conversationId = uuidv4();\n // @spec WUP-001 — Send an absolute working_dir to the agent-server.\n // The default is `workspace/project/<hex>` (relative); without\n // resolving it here, `/api/file/upload` later prepends `/` and writes\n // to `/workspace/...` (read-only on macOS and fresh containers). When\n // the user picks an explicit workspace, `workingDirOverride` is\n // already absolute (it comes from `search_subdirs`).\n const workingDir = await resolveAbsoluteAgentServerPath(\n workingDirOverride ?? buildConversationWorkingDir(conversationId),\n );\n const resolvedWorkspaceMode =\n workspaceMode ?? (workingDirOverride ? \"local_repo\" : \"new_worktree\");\n\n // Use encrypted settings to avoid exposing secrets in the browser\n const payload = await buildStartConversationRequestWithEncryptedSettings({\n settings,\n query: initialUserMsg,\n conversationInstructions,\n plugins,\n conversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n titleLlmProfile,\n });\n\n const data = await new ConversationClient(\n getAgentServerClientOptions({ timeout: CREATE_CONVERSATION_TIMEOUT_MS }),\n ).createConversation<DirectConversationInfo>(payload);\n const localBackend = getEffectiveLocalBackend();\n if (!localBackend) throw new NoBackendAvailableError();\n\n if (metadata?.selected_repository || workingDirOverride) {\n // The agent-server runtime has no concept of selected repo/branch/\n // workspace, so persist the home-page selection client-side.\n // `toAppConversation` reads the repo/branch fields back to hydrate\n // the chat-page badges; `useHasAttachedSource` reads\n // `selected_workspace` to default the Files tab to Diff mode when\n // the user explicitly attached a local workspace.\n setStoredConversationMetadata(data.id, {\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: workingDirOverride ?? null,\n workspace_mode: resolvedWorkspaceMode,\n });\n }\n\n return {\n id: data.id,\n created_by_user_id: null,\n status: \"READY\",\n detail: null,\n app_conversation_id: data.id,\n agent_server_url: localBackend.host,\n request: {\n initial_message: payload.initial_message as\n | AppConversationStartRequest[\"initial_message\"]\n | undefined,\n plugins: plugins ?? null,\n },\n created_at: data.created_at,\n updated_at: data.updated_at,\n };\n }\n\n static async getStartTask(\n taskId: string,\n ): Promise<AppConversationStartTask | null> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return getCloudAppConversationStartTask(taskId);\n }\n // Local agent-server creates conversations synchronously — every\n // local \"task\" is already READY when createConversation returns, so\n // there's nothing to poll for.\n return null;\n }\n\n static async getVSCodeUrl(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<GetVSCodeUrlResponse> {\n // Local-only path. Cloud conversations read the VSCode URL straight\n // from the cloud-computed `sandbox.exposed_urls` (see\n // `useUnifiedVSCodeUrl` + `useCloudSandbox`); the runtime's own\n // `/api/vscode/url` only knows its internal `localhost:8001`, which\n // the user's browser can't reach.\n const workspaceDir =\n await this.resolveConversationWorkingDir(conversationId);\n // Local mode: the typescript-client targets the local agent-server\n // directly via the conversationUrl override.\n const vscodeUrl = await new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getUrl({\n baseUrl:\n typeof window !== \"undefined\" ? window.location.origin : undefined,\n workspaceDir,\n });\n\n return { vscode_url: vscodeUrl };\n }\n\n static async resolveConversationWorkingDir(\n conversationId: string,\n ): Promise<string> {\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return conversation?.workspace?.working_dir ?? getAgentServerWorkingDir();\n }\n\n static async batchGetAppConversations(\n ids: string[],\n ): Promise<(AppConversation | null)[]> {\n if (ids.length === 0) return [];\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n return batchGetCloudConversations(ids);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).getConversations<DirectConversationInfo>(ids);\n\n return requireDirectConversationItems(data).map((item) =>\n toAppConversation(item),\n );\n }\n\n static async updateConversationPublicFlag(\n conversationId: string,\n isPublic: boolean,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind !== \"cloud\") {\n throw new Error(\"Public sharing requires a cloud backend.\");\n }\n return updateCloudConversationPublicFlag(conversationId, isPublic);\n }\n\n static async updateConversationRepository(\n conversationId: string,\n repository: string | null,\n branch?: string | null,\n gitProvider?: string | null,\n ): Promise<AppConversation> {\n if (repository) {\n const existing = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...(existing ?? {}),\n selected_repository: repository,\n selected_branch: branch ?? null,\n git_provider: (gitProvider as Provider | null | undefined) ?? null,\n });\n } else {\n removeStoredConversationMetadata(conversationId);\n }\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n static async readConversationFile(\n conversationId: string,\n filePath?: string,\n ): Promise<string> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud exposes a per-conversation file endpoint; the sandbox\n // working dir is fixed (`/workspace/project`), so PLAN.md lives at\n // a known absolute path. Mirrors OpenHands' readConversationFile.\n const path = requirePathInsideDirectory(\n filePath ?? \"/workspace/project/.agents_tmp/PLAN.md\",\n \"/workspace/project\",\n );\n return readCloudConversationFile(conversationId, path);\n }\n\n const workingDir = await this.resolveConversationWorkingDir(conversationId);\n const path = requirePathInsideDirectory(\n filePath ?? `${workingDir}/.agents_tmp/PLAN.md`,\n workingDir,\n );\n return new FileClient(getAgentServerClientOptions()).downloadTextFile(path);\n }\n\n static async downloadConversation(conversationId: string): Promise<Blob> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return downloadCloudConversation(conversationId);\n }\n\n return new FileClient(getAgentServerClientOptions()).downloadTrajectory(\n conversationId,\n );\n }\n\n static async getHooks(conversationId: string): Promise<GetHooksResponse> {\n if (!conversationId) {\n return emptyHooksResponse();\n }\n return emptyHooksResponse();\n }\n\n static async getRuntimeConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<RuntimeConversationInfo> {\n const active = getActiveBackend().backend;\n\n type RawRuntime = DirectConversationInfo & {\n stats?: RuntimeConversationInfo[\"stats\"];\n };\n\n // Cloud mode: route through the cloud-proxy to the runtime sandbox at\n // the conversation's runtime URL — same pattern as getVSCodeUrl. Local\n // mode forwards conversationUrl so the host explicitly resolves to the\n // conversation's runtime instead of falling back to the active backend.\n const response =\n active.kind === \"cloud\" && conversationUrl\n ? await callCloudProxy<RawRuntime>({\n backend: active,\n method: \"GET\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}`,\n authMode: \"session-api-key\",\n sessionApiKey,\n })\n : await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<RawRuntime>(conversationId);\n const data = requireDirectConversationInfo(response);\n const stats = isRecord(response) ? response.stats : null;\n\n return {\n id: data.id,\n title: data.title?.trim()\n ? data.title\n : getDefaultConversationTitle(data.id),\n metrics: normalizeMetrics(data.metrics),\n created_at: data.created_at,\n updated_at: data.updated_at,\n status: toRuntimeStatus(data.execution_status),\n stats: isRecord(stats) ? stats : { usage_to_metrics: {} },\n };\n }\n\n static async searchConversations(\n limit: number = 20,\n pageId?: string,\n ): Promise<AppConversationPage> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return searchCloudConversations(limit, pageId);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).searchConversations({\n limit,\n page_id: pageId,\n sort_order: ConversationSortOrder.UPDATED_AT_DESC,\n });\n\n return toConversationPage(requireConversationSearchPage(data));\n }\n\n static async deleteConversation(conversationId: string): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await deleteCloudConversation(conversationId);\n } else {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).deleteConversation(conversationId);\n }\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n title,\n });\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n /**\n * Forks a conversation, copying event history up to and including\n * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for\n * `from_event_id` (older backends copy the whole conversation).\n */\n static async forkConversation(\n sourceConversationId: string,\n fromEventId: string,\n title?: string,\n ): Promise<DirectConversationInfo> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\n \"Branching a conversation isn't supported on the cloud backend yet.\",\n );\n }\n\n // `from_event_id` is accepted by `/fork` but not yet typed in\n // ForkConversationRequest (through client 1.32.0); the client forwards the\n // body verbatim, so cast to carry it. A title also suppresses the backend\n // auto-title, so the \"(branch)\" marker sticks.\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).forkConversation<DirectConversationInfo>(sourceConversationId, {\n from_event_id: fromEventId,\n ...(title ? { title } : {}),\n } as ForkConversationRequest & { from_event_id: string });\n\n // Carry over the source's client-side metadata (repo/branch/workspace/\n // profile/plugins) so the fork hydrates its chat-page badges the same way.\n const sourceMetadata = getStoredConversationMetadata(sourceConversationId);\n if (sourceMetadata) {\n setStoredConversationMetadata(data.id, sourceMetadata);\n }\n\n return data;\n }\n\n /**\n * Returns an event's `parent_id` (the fork point for branching *before* it),\n * or undefined at the root. Uses the single-event endpoint because the events\n * *search* API omits `parent_id`.\n */\n static async getEventParentId(\n conversationId: string,\n eventId: string,\n ): Promise<string | undefined> {\n const event = (await new ConversationClient(\n getAgentServerClientOptions(),\n ).getEvent(conversationId, eventId)) as { parent_id?: string | null };\n return event.parent_id ?? undefined;\n }\n\n /**\n * Switches the LLM profile for the running conversation when one is open\n * (POST /switch_profile — per-conversation swap, doesn't change the user's\n * default profile). When called without a conversationId (home page),\n * falls back to POST /activate so the next conversation created picks up\n * the chosen profile.\n *\n * The per-conversation endpoint accepts only the profile name, so the UI does\n * not need to fetch or forward profile secrets. That keeps switching working\n * even when the agent server has no OH_SECRET_KEY for encrypted secret export.\n *\n * Cloud backends route to the app-server's per-conversation\n * `/switch_profile`, which owns the profiles and resolves the swap\n * server-side (base_url/api_key fixups, usage_id derivation, then the\n * agent-server's switch_llm) — so the client only forwards the profile name,\n * mirroring {@link switchAcpModel}.\n */\n static async switchProfile(\n conversationId: string | null,\n profileName: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n\n if (backend.kind === \"cloud\") {\n // No conversation (home page): activate globally so the next\n // conversation starts with it. ProfilesService routes to the cloud\n // activate endpoint.\n if (!conversationId) {\n await ProfilesService.activateProfile(profileName);\n return;\n }\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_profile`,\n body: { profile_name: profileName },\n });\n return;\n }\n\n if (!conversationId) {\n await new ProfilesClient(getAgentServerClientOptions()).activateProfile(\n profileName,\n );\n return;\n }\n\n const clientOptions = getAgentServerClientOptions();\n const conversationClient = new ConversationClient(clientOptions);\n const profile = await new ProfilesClient(clientOptions).getProfile(\n profileName,\n { exposeSecrets: \"encrypted\" },\n );\n const model =\n typeof profile.config.model === \"string\" ? profile.config.model : \"\";\n if (!model) throw new Error(`Profile '${profileName}' has no model.`);\n await assertSubscriptionAuthReady({ llm: profile.config });\n await conversationClient.switchLLM(conversationId, {\n ...profile.config,\n model,\n // Keep streaming on after a switch (parity with conversation start);\n // the profile config would otherwise default it to stream=False.\n stream: true,\n // Avoid stale first-write-wins entries in the backend LLM registry.\n usage_id: `profile:${profileName}:${uuidv4()}`,\n } as LLMConfig);\n }\n\n /**\n * Switches the model of a running ACP conversation in place (POST\n * /switch_acp_model — the ACP analog of {@link switchProfile}'s /switch_profile).\n * The agent-server calls the ACP wrapper's ``session/set_model`` on the live\n * session, preserving context. Mirrors {@link switchProfile}'s\n * local-backend-only guard and per-conversation ConversationClient call.\n *\n * Only valid once an ACP session exists (after the first message); the\n * agent-server returns 409 before then — the home/no-session default is\n * persisted via Settings instead (see ``use-switch-acp-model``).\n */\n static async switchAcpModel(\n conversationId: string,\n model: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n if (backend.kind === \"cloud\") {\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_acp_model`,\n body: { model },\n });\n return;\n }\n\n await new ConversationClient(getAgentServerClientOptions()).switchAcpModel(\n conversationId,\n model,\n );\n }\n}\n\nexport default AgentServerConversationService;\n"],"mappings":"+vCAwEA,IAAM,EAAiC,2BAIjC,EAAiC,IAAS,IAC1C,EACJ,qLAGF,SAAS,GAAqC,CAC5C,OAAW,MAAM,EAAsC,CAGzD,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,EAAM,CAG7E,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EAAa,EAAwB,CAC5C,OAAO,OAAO,GAAU,SAAW,EAAQ,EAG7C,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EACP,EACA,EACA,EACQ,CACR,IAAM,EAAQ,EAAK,IAAa,EAAK,GACrC,OAAO,OAAO,GAAU,UAAY,EAAM,MAAM,CAC5C,EACA,EAGN,SAAS,EACP,EACgE,CAGhE,OAFK,EAAS,EAAM,CAEb,CACL,cAAe,EAAa,EAAM,cAAc,CAChD,kBAAmB,EAAa,EAAM,kBAAkB,CACxD,kBAAmB,EAAa,EAAM,kBAAkB,CACxD,mBAAoB,EAAa,EAAM,mBAAmB,CAC1D,eAAgB,EAAa,EAAM,eAAe,CAClD,eAAgB,EAAa,EAAM,eAAe,CACnD,CAT4B,KAY/B,SAAS,EAAiB,EAAwC,CAGhE,OAFK,EAAS,EAAM,CAEb,CACL,iBAAkB,EAAa,EAAM,iBAAiB,CACtD,oBAAqB,EAAa,EAAM,oBAAoB,CAC5D,wBAAyB,EAAoB,EAAM,wBAAwB,CAC5E,CAN4B,KAS/B,SAAS,EAAe,EAAiD,CACvE,GAAI,CAAC,EAAS,EAAM,CAAE,OAAO,KAC7B,IAAM,EAAM,EAAS,EAAM,IAAI,CAC3B,CAAE,MAAO,EAAa,EAAM,IAAI,MAAM,CAAE,C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,EAAA,mBAAmB,EAAc,CAC1D,EAAU,MAAM,IAAI,EAAA,eAAe,EAAc,CAAC,WACtD,EACA,CAAE,cAAe,YAAa,CAC/B,CACK,EACJ,OAAO,EAAQ,OAAO,OAAU,SAAW,EAAQ,OAAO,MAAQ,GACpE,GAAI,CAAC,EAAO,MAAU,MAAM,YAAY,EAAY,iBAAiB,CACrE,MAAM,EAAA,4BAA4B,CAAE,IAAK,EAAQ,OAAQ,CAAC,CAC1D,MAAM,EAAmB,UAAU,EAAgB,CACjD,GAAG,EAAQ,OACX,QAGA,OAAQ,GAER,SAAU,WAAW,EAAY,GAAG,EAAA,SAAQ,GAC7C,CAAc,CAcjB,aAAa,eACX,EACA,EACe,CACf,GAAM,CAAE,WAAY,EAAA,kBAAkB,CACtC,GAAI,EAAQ,OAAS,QAAS,CAC5B,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,mBAClD,KAAM,CAAE,QAAO,CAChB,CAAC,CACF,OAGF,MAAM,IAAI,EAAA,mBAAmB,EAAA,6BAA6B,CAAC,CAAC,eAC1D,EACA,EACD"}
|
|
@@ -11,78 +11,79 @@ import d from "../../node_modules/uuid/dist/v4.js";
|
|
|
11
11
|
import { callCloudProxy as f } from "../cloud/proxy.js";
|
|
12
12
|
import { ConversationSortOrder as p } from "../../node_modules/@openhands/typescript-client/dist/models/conversation.js";
|
|
13
13
|
import "../../node_modules/@openhands/typescript-client/dist/index.js";
|
|
14
|
-
import { resolveAbsoluteAgentServerPath as
|
|
15
|
-
import
|
|
16
|
-
import { getStoredConversationMetadata as
|
|
17
|
-
import { batchGetCloudConversations as
|
|
18
|
-
import
|
|
14
|
+
import { resolveAbsoluteAgentServerPath as m } from "../agent-server-home.js";
|
|
15
|
+
import h from "../profiles-service/profiles-service.api.js";
|
|
16
|
+
import { getStoredConversationMetadata as g, removeStoredConversationMetadata as _, setStoredConversationMetadata as v } from "../conversation-metadata-store.js";
|
|
17
|
+
import { batchGetCloudConversations as y, createCloudAppConversation as b, deleteCloudConversation as x, downloadCloudConversation as S, getCloudAppConversationStartTask as C, readCloudConversationFile as w, searchCloudConversations as T, updateCloudConversationPublicFlag as E } from "../cloud/conversation-service.api.js";
|
|
18
|
+
import ee from "../settings-service/settings-service.api.js";
|
|
19
19
|
import { assertSubscriptionAuthReady as D, buildStartConversationRequestWithEncryptedSettings as O, emptyHooksResponse as k, getDefaultConversationTitle as A, toAppConversation as j, toConversationPage as M } from "../agent-server-adapter.js";
|
|
20
|
+
import { resolveTitleLlmProfile as N } from "../../utils/title-llm-profile.js";
|
|
20
21
|
//#region src/api/conversation-service/agent-server-conversation-service.api.ts
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
return Error(
|
|
22
|
+
var P = "1970-01-01T00:00:00.000Z", F = 300 * 1e3, I = "Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.";
|
|
23
|
+
function L() {
|
|
24
|
+
return Error(I);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function R(e) {
|
|
26
27
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function z(e) {
|
|
29
30
|
return typeof e == "number" ? e : null;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function B(e) {
|
|
32
33
|
return typeof e == "number" ? e : 0;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function V(e) {
|
|
35
36
|
return typeof e == "string" ? e : null;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function H(e, t, n) {
|
|
38
39
|
let r = e[t] ?? e[n];
|
|
39
|
-
return typeof r == "string" && r.trim() ? r :
|
|
40
|
+
return typeof r == "string" && r.trim() ? r : P;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
prompt_tokens:
|
|
44
|
-
completion_tokens:
|
|
45
|
-
cache_read_tokens:
|
|
46
|
-
cache_write_tokens:
|
|
47
|
-
context_window:
|
|
48
|
-
per_turn_token:
|
|
42
|
+
function U(e) {
|
|
43
|
+
return R(e) ? {
|
|
44
|
+
prompt_tokens: B(e.prompt_tokens),
|
|
45
|
+
completion_tokens: B(e.completion_tokens),
|
|
46
|
+
cache_read_tokens: B(e.cache_read_tokens),
|
|
47
|
+
cache_write_tokens: B(e.cache_write_tokens),
|
|
48
|
+
context_window: B(e.context_window),
|
|
49
|
+
per_turn_token: B(e.per_turn_token)
|
|
49
50
|
} : null;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
53
|
-
accumulated_cost:
|
|
54
|
-
max_budget_per_task:
|
|
55
|
-
accumulated_token_usage:
|
|
52
|
+
function W(e) {
|
|
53
|
+
return R(e) ? {
|
|
54
|
+
accumulated_cost: z(e.accumulated_cost),
|
|
55
|
+
max_budget_per_task: z(e.max_budget_per_task),
|
|
56
|
+
accumulated_token_usage: U(e.accumulated_token_usage)
|
|
56
57
|
} : null;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
if (!
|
|
60
|
-
let t =
|
|
59
|
+
function G(e) {
|
|
60
|
+
if (!R(e)) return null;
|
|
61
|
+
let t = R(e.llm) ? { model: V(e.llm.model) } : null;
|
|
61
62
|
return {
|
|
62
|
-
kind:
|
|
63
|
-
acp_server:
|
|
64
|
-
acp_model:
|
|
63
|
+
kind: V(e.kind),
|
|
64
|
+
acp_server: V(e.acp_server),
|
|
65
|
+
acp_model: V(e.acp_model),
|
|
65
66
|
llm: t
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
69
|
+
function K(e) {
|
|
70
|
+
return R(e) ? { working_dir: V(e.working_dir) } : null;
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
if (!
|
|
72
|
+
function q(e) {
|
|
73
|
+
if (!R(e)) return null;
|
|
73
74
|
let t = {};
|
|
74
75
|
for (let [n, r] of Object.entries(e)) typeof r == "string" && (t[n] = r);
|
|
75
76
|
return t;
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
if (!
|
|
78
|
+
function J(e) {
|
|
79
|
+
if (!R(e)) return null;
|
|
79
80
|
let { agent_profile_id: t, revision: n } = e;
|
|
80
81
|
return typeof t != "string" || typeof n != "number" ? null : {
|
|
81
82
|
agent_profile_id: t,
|
|
82
83
|
revision: n
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function Y(e) {
|
|
86
87
|
if (!e.startsWith("/")) return null;
|
|
87
88
|
let t = [];
|
|
88
89
|
for (let n of e.split("/")) if (n && n !== ".") if (n === "..") {
|
|
@@ -91,45 +92,45 @@ function q(e) {
|
|
|
91
92
|
} else t.push(n);
|
|
92
93
|
return `/${t.join("/")}`;
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
let n =
|
|
95
|
+
function X(e, t) {
|
|
96
|
+
let n = Y(e), r = Y(t);
|
|
96
97
|
if (!n || !r || n !== r && !n.startsWith(`${r}/`)) throw Error("Conversation file path must stay inside the workspace");
|
|
97
98
|
return n;
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
if (!
|
|
100
|
+
function Z(e) {
|
|
101
|
+
if (!R(e) || typeof e.id != "string" || !e.id.trim()) throw L();
|
|
101
102
|
return {
|
|
102
103
|
id: e.id.trim(),
|
|
103
|
-
title:
|
|
104
|
-
created_at:
|
|
105
|
-
updated_at:
|
|
106
|
-
execution_status:
|
|
107
|
-
sandbox_status:
|
|
108
|
-
metrics:
|
|
109
|
-
agent:
|
|
110
|
-
workspace:
|
|
111
|
-
tags:
|
|
112
|
-
launched_agent_profile:
|
|
113
|
-
current_model_id:
|
|
114
|
-
current_model_name:
|
|
104
|
+
title: V(e.title),
|
|
105
|
+
created_at: H(e, "created_at", "createdAt"),
|
|
106
|
+
updated_at: H(e, "updated_at", "updatedAt"),
|
|
107
|
+
execution_status: V(e.execution_status),
|
|
108
|
+
sandbox_status: V(e.sandbox_status),
|
|
109
|
+
metrics: W(e.metrics),
|
|
110
|
+
agent: G(e.agent),
|
|
111
|
+
workspace: K(e.workspace),
|
|
112
|
+
tags: q(e.tags),
|
|
113
|
+
launched_agent_profile: J(e.launched_agent_profile),
|
|
114
|
+
current_model_id: V(e.current_model_id),
|
|
115
|
+
current_model_name: V(e.current_model_name)
|
|
115
116
|
};
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
-
if (!Array.isArray(e)) throw
|
|
119
|
-
return e.map(
|
|
118
|
+
function Q(e) {
|
|
119
|
+
if (!Array.isArray(e)) throw L();
|
|
120
|
+
return e.map(Z);
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function te(e) {
|
|
122
123
|
if (Array.isArray(e)) return {
|
|
123
|
-
items:
|
|
124
|
+
items: Q(e),
|
|
124
125
|
next_page_id: null
|
|
125
126
|
};
|
|
126
|
-
if (!
|
|
127
|
+
if (!R(e)) throw L();
|
|
127
128
|
return {
|
|
128
|
-
items:
|
|
129
|
+
items: Q(e.items),
|
|
129
130
|
next_page_id: typeof e.next_page_id == "string" ? e.next_page_id : null
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
|
-
var
|
|
133
|
+
var ne = new Set([
|
|
133
134
|
"idle",
|
|
134
135
|
"running",
|
|
135
136
|
"paused",
|
|
@@ -138,20 +139,20 @@ var Q = new Set([
|
|
|
138
139
|
"error",
|
|
139
140
|
"stuck"
|
|
140
141
|
]);
|
|
141
|
-
function
|
|
142
|
+
function re(e) {
|
|
142
143
|
let t = e ?? "idle";
|
|
143
|
-
return
|
|
144
|
+
return ne.has(t) ? t : "idle";
|
|
144
145
|
}
|
|
145
146
|
function $(e, t) {
|
|
146
147
|
if (!e) throw Error(`Conversation ${t} was not found`);
|
|
147
148
|
return e;
|
|
148
149
|
}
|
|
149
|
-
var
|
|
150
|
+
var ie = class {
|
|
150
151
|
static async sendMessage(t, n, r) {
|
|
151
152
|
let a = s().backend, o = r?.conversationUrl ?? null, c = r?.sessionApiKey ?? null;
|
|
152
153
|
if (a.kind === "cloud") {
|
|
153
154
|
if (!o || !c) {
|
|
154
|
-
let [e] = await
|
|
155
|
+
let [e] = await y([t]);
|
|
155
156
|
o = e?.conversation_url?.trim() ?? null, c = e?.session_api_key?.trim() ?? null;
|
|
156
157
|
}
|
|
157
158
|
if (!o || !c) throw Error("Conversation sandbox is still starting. Wait for it to finish, then try again.");
|
|
@@ -173,8 +174,8 @@ var ne = class {
|
|
|
173
174
|
sessionApiKey: c
|
|
174
175
|
})).sendEvent(t, n, { run: !0 }), n;
|
|
175
176
|
}
|
|
176
|
-
static async createConversation(t, n, r, i, o, f, p,
|
|
177
|
-
if (s().backend.kind === "cloud") return
|
|
177
|
+
static async createConversation(t, n, r, i, o, f, p, g, _, y, x) {
|
|
178
|
+
if (s().backend.kind === "cloud") return b({
|
|
178
179
|
initial_message: t ? {
|
|
179
180
|
role: "user",
|
|
180
181
|
content: [{
|
|
@@ -188,45 +189,46 @@ var ne = class {
|
|
|
188
189
|
git_provider: i?.git_provider ?? null,
|
|
189
190
|
plugins: r ?? null,
|
|
190
191
|
parent_conversation_id: p ?? null,
|
|
191
|
-
agent_type:
|
|
192
|
-
sandbox_id:
|
|
193
|
-
agent_profile_id:
|
|
192
|
+
agent_type: g,
|
|
193
|
+
sandbox_id: _ ?? null,
|
|
194
|
+
agent_profile_id: y ?? null
|
|
194
195
|
});
|
|
195
|
-
let
|
|
196
|
-
settings:
|
|
196
|
+
let [S, C] = await Promise.all([ee.getSettings(), h.listProfiles().catch(() => void 0)]), w = N(S.title_llm_profile, C), T = d(), E = await m(o ?? a(T)), D = f ?? (o ? "local_repo" : "new_worktree"), k = await O({
|
|
197
|
+
settings: S,
|
|
197
198
|
query: t,
|
|
198
199
|
conversationInstructions: n,
|
|
199
200
|
plugins: r,
|
|
200
|
-
conversationId:
|
|
201
|
-
workingDir:
|
|
202
|
-
worktree:
|
|
203
|
-
agentProfileId:
|
|
204
|
-
agentProfileKind:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
201
|
+
conversationId: T,
|
|
202
|
+
workingDir: E,
|
|
203
|
+
worktree: D === "new_worktree",
|
|
204
|
+
agentProfileId: y,
|
|
205
|
+
agentProfileKind: x,
|
|
206
|
+
titleLlmProfile: w
|
|
207
|
+
}), A = await new e(u({ timeout: F })).createConversation(k), j = c();
|
|
208
|
+
if (!j) throw new l();
|
|
209
|
+
return (i?.selected_repository || o) && v(A.id, {
|
|
208
210
|
selected_repository: i?.selected_repository ?? null,
|
|
209
211
|
selected_branch: i?.selected_branch ?? null,
|
|
210
212
|
git_provider: i?.git_provider ?? null,
|
|
211
213
|
selected_workspace: o ?? null,
|
|
212
|
-
workspace_mode:
|
|
214
|
+
workspace_mode: D
|
|
213
215
|
}), {
|
|
214
|
-
id:
|
|
216
|
+
id: A.id,
|
|
215
217
|
created_by_user_id: null,
|
|
216
218
|
status: "READY",
|
|
217
219
|
detail: null,
|
|
218
|
-
app_conversation_id:
|
|
219
|
-
agent_server_url:
|
|
220
|
+
app_conversation_id: A.id,
|
|
221
|
+
agent_server_url: j.host,
|
|
220
222
|
request: {
|
|
221
|
-
initial_message:
|
|
223
|
+
initial_message: k.initial_message,
|
|
222
224
|
plugins: r ?? null
|
|
223
225
|
},
|
|
224
|
-
created_at:
|
|
225
|
-
updated_at:
|
|
226
|
+
created_at: A.created_at,
|
|
227
|
+
updated_at: A.updated_at
|
|
226
228
|
};
|
|
227
229
|
}
|
|
228
230
|
static async getStartTask(e) {
|
|
229
|
-
return s().backend.kind === "cloud" ?
|
|
231
|
+
return s().backend.kind === "cloud" ? C(e) : null;
|
|
230
232
|
}
|
|
231
233
|
static async getVSCodeUrl(e, t, n) {
|
|
232
234
|
let i = await this.resolveConversationWorkingDir(e);
|
|
@@ -243,29 +245,29 @@ var ne = class {
|
|
|
243
245
|
return t?.workspace?.working_dir ?? o();
|
|
244
246
|
}
|
|
245
247
|
static async batchGetAppConversations(t) {
|
|
246
|
-
return t.length === 0 ? [] : s().backend.kind === "cloud" ?
|
|
248
|
+
return t.length === 0 ? [] : s().backend.kind === "cloud" ? y(t) : Q(await new e(u()).getConversations(t)).map((e) => j(e));
|
|
247
249
|
}
|
|
248
250
|
static async updateConversationPublicFlag(e, t) {
|
|
249
251
|
if (s().backend.kind !== "cloud") throw Error("Public sharing requires a cloud backend.");
|
|
250
|
-
return
|
|
252
|
+
return E(e, t);
|
|
251
253
|
}
|
|
252
254
|
static async updateConversationRepository(e, t, n, r) {
|
|
253
|
-
t ?
|
|
254
|
-
...
|
|
255
|
+
t ? v(e, {
|
|
256
|
+
...g(e) ?? {},
|
|
255
257
|
selected_repository: t,
|
|
256
258
|
selected_branch: n ?? null,
|
|
257
259
|
git_provider: r ?? null
|
|
258
|
-
}) :
|
|
260
|
+
}) : _(e);
|
|
259
261
|
let [i] = await this.batchGetAppConversations([e]);
|
|
260
262
|
return $(i, e);
|
|
261
263
|
}
|
|
262
264
|
static async readConversationFile(e, n) {
|
|
263
|
-
if (s().backend.kind === "cloud") return
|
|
264
|
-
let r = await this.resolveConversationWorkingDir(e), i =
|
|
265
|
+
if (s().backend.kind === "cloud") return w(e, X(n ?? "/workspace/project/.agents_tmp/PLAN.md", "/workspace/project"));
|
|
266
|
+
let r = await this.resolveConversationWorkingDir(e), i = X(n ?? `${r}/.agents_tmp/PLAN.md`, r);
|
|
265
267
|
return new t(u()).downloadTextFile(i);
|
|
266
268
|
}
|
|
267
269
|
static async downloadConversation(e) {
|
|
268
|
-
return s().backend.kind === "cloud" ?
|
|
270
|
+
return s().backend.kind === "cloud" ? S(e) : new t(u()).downloadTrajectory(e);
|
|
269
271
|
}
|
|
270
272
|
static async getHooks(e) {
|
|
271
273
|
return k();
|
|
@@ -281,26 +283,26 @@ var ne = class {
|
|
|
281
283
|
}) : await new e(u({
|
|
282
284
|
conversationUrl: n,
|
|
283
285
|
sessionApiKey: r
|
|
284
|
-
})).getConversation(t), c =
|
|
286
|
+
})).getConversation(t), c = Z(o), l = R(o) ? o.stats : null;
|
|
285
287
|
return {
|
|
286
288
|
id: c.id,
|
|
287
289
|
title: c.title?.trim() ? c.title : A(c.id),
|
|
288
|
-
metrics:
|
|
290
|
+
metrics: W(c.metrics),
|
|
289
291
|
created_at: c.created_at,
|
|
290
292
|
updated_at: c.updated_at,
|
|
291
|
-
status:
|
|
292
|
-
stats:
|
|
293
|
+
status: re(c.execution_status),
|
|
294
|
+
stats: R(l) ? l : { usage_to_metrics: {} }
|
|
293
295
|
};
|
|
294
296
|
}
|
|
295
297
|
static async searchConversations(t = 20, n) {
|
|
296
|
-
return s().backend.kind === "cloud" ?
|
|
298
|
+
return s().backend.kind === "cloud" ? T(t, n) : M(te(await new e(u()).searchConversations({
|
|
297
299
|
limit: t,
|
|
298
300
|
page_id: n,
|
|
299
301
|
sort_order: p.UPDATED_AT_DESC
|
|
300
302
|
})));
|
|
301
303
|
}
|
|
302
304
|
static async deleteConversation(t) {
|
|
303
|
-
s().backend.kind === "cloud" ? await
|
|
305
|
+
s().backend.kind === "cloud" ? await x(t) : await new e(u()).deleteConversation(t), _(t);
|
|
304
306
|
}
|
|
305
307
|
static async updateConversationTitle(t, n) {
|
|
306
308
|
await new e(u()).updateConversation(t, { title: n });
|
|
@@ -312,8 +314,8 @@ var ne = class {
|
|
|
312
314
|
let i = await new e(u()).forkConversation(t, {
|
|
313
315
|
from_event_id: n,
|
|
314
316
|
...r ? { title: r } : {}
|
|
315
|
-
}), a =
|
|
316
|
-
return a &&
|
|
317
|
+
}), a = g(t);
|
|
318
|
+
return a && v(i.id, a), i;
|
|
317
319
|
}
|
|
318
320
|
static async getEventParentId(t, n) {
|
|
319
321
|
return (await new e(u()).getEvent(t, n)).parent_id ?? void 0;
|
|
@@ -322,7 +324,7 @@ var ne = class {
|
|
|
322
324
|
let { backend: i } = s();
|
|
323
325
|
if (i.kind === "cloud") {
|
|
324
326
|
if (!t) {
|
|
325
|
-
await
|
|
327
|
+
await h.activateProfile(r);
|
|
326
328
|
return;
|
|
327
329
|
}
|
|
328
330
|
await f({
|
|
@@ -361,6 +363,6 @@ var ne = class {
|
|
|
361
363
|
}
|
|
362
364
|
};
|
|
363
365
|
//#endregion
|
|
364
|
-
export {
|
|
366
|
+
export { ie as default };
|
|
365
367
|
|
|
366
368
|
//# sourceMappingURL=agent-server-conversation-service.api.js.map
|