@openhands/agent-canvas 1.5.1 → 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-B8rMv0X9.js → active-backend-context-Cd1qcZsb.js} +1 -1
- package/build/assets/{add-backend-modal-CxC7BNEc.js → add-backend-modal-5chsfln3.js} +1 -1
- package/build/assets/{agent-profiles-settings-BJb8YXR1.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-CZsu2CoM.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-BSfN0AZA.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-BGlWn93P.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-_f9GlIEi.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-DNlPGxsu.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-CAGavYl-.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-Casyzgn1.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-DJrMrFAr.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-vrRNwOma.js → organization-service.api-CvfQugOt.js} +1 -1
- package/build/assets/{path-utils-PNfCKQDV.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-ByOw1he8.js → planner-tab-ZrjiirRr.js} +1 -1
- package/build/assets/{plugins-management-service-B75jyC56.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-BQTklD5D.js → profiles-service.api-CRVlrQpT.js} +1 -1
- package/build/assets/{providers-DfTB2gPd.js → providers-C2DFGBrf.js} +1 -1
- package/build/assets/{proxy-B3tCGf0X.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-CUwk4wrQ.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-CvyPWJhg.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-DXk5TdeJ.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-DRXt2Lr4.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-Bm8qXdlc.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-hI-x-UBa.js → use-active-agent-profile-CCeFtmk9.js} +1 -1
- package/build/assets/{use-active-conversation-2qeez40F.js → use-active-conversation-Badxj8w4.js} +1 -1
- package/build/assets/{use-agent-profiles-0pr5bLS7.js → use-agent-profiles-BSWVN6hH.js} +1 -1
- package/build/assets/{use-agent-state-C6peDXUm.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-Ck_bsNbH.js → use-can-manage-org-profiles-Do6mYf6P.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-DUCSxNjY.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-r1JHfKO5.js → use-create-conversation-vvl0kvu7.js} +1 -1
- package/build/assets/{use-create-secret-Cf2N11d2.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-CsAW3FlH.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-RqUGqTv6.js → use-save-agent-profile-Bj7N-1jS.js} +1 -1
- package/build/assets/{use-save-settings-Chvzeu2s.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-xrVoKYrF.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-CnE4zhOA.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-CfkrXoSa.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/query/use-task-polling.cjs +1 -1
- package/dist/hooks/query/use-task-polling.cjs.map +1 -1
- package/dist/hooks/query/use-task-polling.d.ts +19 -3
- package/dist/hooks/query/use-task-polling.js +36 -35
- package/dist/hooks/query/use-task-polling.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/conversation.cjs +1 -1
- package/dist/routes/conversation.cjs.map +1 -1
- package/dist/routes/conversation.js +1 -1
- package/dist/routes/conversation.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-BWN-EIQn.js +0 -1
- package/build/assets/agent-server-conversation-service.api-DSPIkMwJ.js +0 -41
- package/build/assets/agent-settings-CgCnqaAA.js +0 -2
- package/build/assets/agent-settings-DDkSavD7.js +0 -1
- package/build/assets/api-key-entry-screen-iZc7n8AI.js +0 -1
- package/build/assets/app-settings-B5zyipxJ.js +0 -1
- package/build/assets/automation-export-BwRX6H32.js +0 -2
- package/build/assets/automations-list-lHAVzMoA.js +0 -1
- package/build/assets/backend-form-modal-RGcu909r.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-BZK8vRs2.js +0 -1
- package/build/assets/cloud-funnel-analytics-Zcv57hfT.js +0 -1
- package/build/assets/conversation-BoCYx8n2.js +0 -89
- package/build/assets/conversation-DgHqMjnY.js +0 -1
- package/build/assets/conversation-panel-78Rxh_-I.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-CCbLA7IM.js +0 -1
- package/build/assets/extensions-navigation-CPNjMNvR.js +0 -1
- package/build/assets/files-tab-store-DJsPxYdg.js +0 -1
- package/build/assets/files-tab-y4K7EXBO.js +0 -1
- package/build/assets/git-provider-icon-ITvsH4Ko.js +0 -1
- package/build/assets/home-BwbeOWwU.js +0 -1
- package/build/assets/home-DKPGQ5P3.js +0 -1
- package/build/assets/index-home-Bko2Itv5.js +0 -1
- package/build/assets/install-server-modal-Qk1gwyI8.js +0 -1
- package/build/assets/lesson-plan-DMCPdtrf.js +0 -4
- package/build/assets/llm-not-configured-banner-C1ktyb3C.js +0 -27
- package/build/assets/llm-settings-BBsZFi9l.js +0 -1
- package/build/assets/llm-settings-DFkJQr_w.js +0 -1
- package/build/assets/manage-backends-modal-CKQ46rvw.js +0 -1
- package/build/assets/manifest-03478bbf.js +0 -1
- package/build/assets/markdown-renderer-B4V2OMFP.js +0 -2
- package/build/assets/mcp-BapoJsDc.js +0 -9
- package/build/assets/messages-CUBFMY5o.js +0 -40
- package/build/assets/objectWithoutPropertiesLoose-BgYIAs2y.js +0 -1
- package/build/assets/onboarding-6NMkdNxV.js +0 -1
- package/build/assets/onboarding-modal-Q4AnpIdg.js +0 -1
- package/build/assets/recommended-automations-launcher-Bj7PuHY1.js +0 -58
- package/build/assets/refresh-cw-B9B7-vsy.js +0 -1
- package/build/assets/root-CDnuTToz.js +0 -2
- package/build/assets/root-CYWeTrWE.css +0 -1
- package/build/assets/root-layout-DfYVlcRG.js +0 -2
- package/build/assets/sdk-section-page-DLLNrYjI.js +0 -1
- package/build/assets/secrets-settings-CHy72A5C.js +0 -1
- package/build/assets/settings-B9S8UVQr.js +0 -1
- package/build/assets/settings-index-BKDl2CQ-.js +0 -1
- package/build/assets/settings-modal-DeK11CyT.js +0 -1
- package/build/assets/shared-conversation-9atDzTR4.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-giMMZctn.js +0 -1
- package/build/assets/skills-plugins-Tropusio.js +0 -1
- package/build/assets/skills-settings-BvzBBCWk.js +0 -2
- package/build/assets/telemetry-C5JMEfqB.js +0 -2
- package/build/assets/use-activate-agent-profile-DlykqEfN.js +0 -1
- package/build/assets/use-backends-health-CLHPitJM.js +0 -1
- package/build/assets/use-config-B5r8erYt.js +0 -1
- package/build/assets/use-event-store-Bbaz51GR.js +0 -4
- package/build/assets/use-llm-profiles-Dr5__SlZ.js +0 -1
- package/build/assets/use-plugins-marketplace-BplU65ae.js +0 -1
- package/build/assets/use-runtime-is-ready-vCFOcLFa.js +0 -1
- package/build/assets/use-settings-CyxSlyTQ.js +0 -1
- package/build/assets/use-settings-nav-items-zEkSO_Bf.js +0 -16
- package/build/assets/use-tracking-D2Qg5Lpd.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
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { getActiveBackend as e, getEffectiveLocalBackend as t } from "../backend-registry/active-store.js";
|
|
2
|
+
import { NoBackendAvailableError as n } from "../agent-server-client-options.js";
|
|
3
|
+
import r from "../../node_modules/axios/lib/axios.js";
|
|
4
|
+
import { callCloudProxy as i } from "../cloud/proxy.js";
|
|
5
|
+
import { AGENT_CANVAS_CLIENT_HEADERS as a, OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER as o } from "../client-source.js";
|
|
6
|
+
import { getTelemetryConsent as s, getTelemetryDistinctId as c, getTelemetryDistinctIdForConsentSync as l } from "../../services/telemetry.js";
|
|
7
|
+
//#region src/api/automation-service/automation-service.api.ts
|
|
8
|
+
var u = "/api/automation", d = r.create();
|
|
9
|
+
async function f(e = {}) {
|
|
10
|
+
let t = await c();
|
|
11
|
+
return {
|
|
12
|
+
...a,
|
|
13
|
+
...t ? { [o]: t } : {},
|
|
14
|
+
...e
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
d.interceptors.request.use(async (e) => {
|
|
18
|
+
let r = await f();
|
|
19
|
+
if (Object.entries(r).forEach(([t, n]) => {
|
|
20
|
+
e.headers.set(t, n);
|
|
21
|
+
}), e.baseURL) return e;
|
|
22
|
+
let i = t();
|
|
23
|
+
if (!i) throw new n();
|
|
24
|
+
e.baseURL = i.host;
|
|
25
|
+
let a = i.apiKey?.trim();
|
|
26
|
+
return a && e.headers.set("X-Session-API-Key", a), e;
|
|
27
|
+
});
|
|
28
|
+
function p(e) {
|
|
29
|
+
return typeof e == "string" && e.trim() || null;
|
|
30
|
+
}
|
|
31
|
+
function m(e) {
|
|
32
|
+
return typeof e == "string" ? p(e) : p(e.sdk_version) ?? p(e.version);
|
|
33
|
+
}
|
|
34
|
+
function h(e, t) {
|
|
35
|
+
let n = new URLSearchParams();
|
|
36
|
+
return n.set("limit", String(e)), n.set("offset", String(t)), n.toString();
|
|
37
|
+
}
|
|
38
|
+
function g(e) {
|
|
39
|
+
return e.trigger.type === "event" ? {
|
|
40
|
+
type: "event",
|
|
41
|
+
source: e.trigger.source,
|
|
42
|
+
on: e.trigger.on,
|
|
43
|
+
...e.trigger.filter && { filter: e.trigger.filter }
|
|
44
|
+
} : {
|
|
45
|
+
type: "cron",
|
|
46
|
+
schedule: e.trigger.schedule,
|
|
47
|
+
timezone: e.timezone ?? e.trigger.timezone ?? "UTC"
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function _() {
|
|
51
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `pending.${crypto.randomUUID()}` : `pending.${Date.now()}.${Math.random().toString(36).slice(2, 10)}`;
|
|
52
|
+
}
|
|
53
|
+
function v(e) {
|
|
54
|
+
if (!e.prompt) throw Error("An automation prompt is required for import.");
|
|
55
|
+
let t = e.repository ? [{
|
|
56
|
+
url: e.repository,
|
|
57
|
+
...e.branch && { ref: e.branch },
|
|
58
|
+
...!e.repository.includes("://") && !e.repository.startsWith("git@") && { provider: "github" }
|
|
59
|
+
}] : void 0;
|
|
60
|
+
return {
|
|
61
|
+
path: `${u}/v1/preset/${e.plugins?.length ? "plugin" : "prompt"}`,
|
|
62
|
+
body: {
|
|
63
|
+
name: e.name,
|
|
64
|
+
prompt: e.prompt,
|
|
65
|
+
trigger: {
|
|
66
|
+
type: "event",
|
|
67
|
+
source: "agent-canvas-import",
|
|
68
|
+
on: _()
|
|
69
|
+
},
|
|
70
|
+
...e.model && { model: e.model },
|
|
71
|
+
...t && { repos: t },
|
|
72
|
+
...e.plugins?.length && { plugins: e.plugins.map((e) => ({ source: e })) },
|
|
73
|
+
...e.timeout != null && { timeout: e.timeout }
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function y(e) {
|
|
78
|
+
let t = e.apiKey.trim();
|
|
79
|
+
return {
|
|
80
|
+
baseURL: e.host,
|
|
81
|
+
headers: await f(t ? { "X-Session-API-Key": t } : {})
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
async function b(e) {
|
|
85
|
+
return f(e.orgId ? { "X-Org-Id": e.orgId } : {});
|
|
86
|
+
}
|
|
87
|
+
var x = class t {
|
|
88
|
+
static async syncTelemetryConsent(t = s()) {
|
|
89
|
+
if (e().backend.kind !== "local") return;
|
|
90
|
+
let n = await l();
|
|
91
|
+
await d.post(`${u}/v1/telemetry/consent`, {
|
|
92
|
+
consent_granted: t === "granted",
|
|
93
|
+
frontend_distinct_id: n
|
|
94
|
+
}, { timeout: 5e3 });
|
|
95
|
+
}
|
|
96
|
+
static async getSdkVersion() {
|
|
97
|
+
let t = e(), n = `${u}/sdk-version`;
|
|
98
|
+
try {
|
|
99
|
+
let e;
|
|
100
|
+
if (t.backend.kind === "cloud") e = await i({
|
|
101
|
+
backend: t.backend,
|
|
102
|
+
method: "GET",
|
|
103
|
+
path: n,
|
|
104
|
+
headers: await b(t),
|
|
105
|
+
timeoutSeconds: 5
|
|
106
|
+
});
|
|
107
|
+
else {
|
|
108
|
+
let { data: t } = await d.get(n, { timeout: 5e3 });
|
|
109
|
+
e = t;
|
|
110
|
+
}
|
|
111
|
+
return m(e);
|
|
112
|
+
} catch {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
static async listAutomations(t = {}) {
|
|
117
|
+
let { limit: n = 50, offset: r = 0 } = t, a = e().backend;
|
|
118
|
+
if (a.kind === "cloud") return i({
|
|
119
|
+
backend: a,
|
|
120
|
+
method: "GET",
|
|
121
|
+
path: `${u}/v1?${h(n, r)}`,
|
|
122
|
+
headers: await f()
|
|
123
|
+
});
|
|
124
|
+
let { data: o } = await d.get(`${u}/v1`, { params: {
|
|
125
|
+
limit: n,
|
|
126
|
+
offset: r
|
|
127
|
+
} });
|
|
128
|
+
return o;
|
|
129
|
+
}
|
|
130
|
+
static async getAutomations(e = 50, n = 0) {
|
|
131
|
+
return t.listAutomations({
|
|
132
|
+
limit: e,
|
|
133
|
+
offset: n
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
static async getAutomation(t) {
|
|
137
|
+
let n = e().backend, r = `${u}/v1/${encodeURIComponent(t)}`;
|
|
138
|
+
if (n.kind === "cloud") return i({
|
|
139
|
+
backend: n,
|
|
140
|
+
method: "GET",
|
|
141
|
+
path: r,
|
|
142
|
+
headers: await f()
|
|
143
|
+
});
|
|
144
|
+
let { data: a } = await d.get(r);
|
|
145
|
+
return a;
|
|
146
|
+
}
|
|
147
|
+
static async createAutomation(t) {
|
|
148
|
+
let n = e(), { path: r, body: a } = v(t), o;
|
|
149
|
+
if (n.backend.kind === "cloud") o = await i({
|
|
150
|
+
backend: n.backend,
|
|
151
|
+
method: "POST",
|
|
152
|
+
path: r,
|
|
153
|
+
body: a,
|
|
154
|
+
headers: await b(n)
|
|
155
|
+
});
|
|
156
|
+
else {
|
|
157
|
+
let { data: e } = await d.post(r, a, await y(n.backend));
|
|
158
|
+
o = e;
|
|
159
|
+
}
|
|
160
|
+
let s = `${u}/v1/${encodeURIComponent(o.id)}`, c = {
|
|
161
|
+
trigger: g(t),
|
|
162
|
+
enabled: !1
|
|
163
|
+
};
|
|
164
|
+
try {
|
|
165
|
+
if (n.backend.kind === "cloud") return await i({
|
|
166
|
+
backend: n.backend,
|
|
167
|
+
method: "PATCH",
|
|
168
|
+
path: s,
|
|
169
|
+
body: c,
|
|
170
|
+
headers: await b(n)
|
|
171
|
+
});
|
|
172
|
+
let { data: e } = await d.patch(s, c, await y(n.backend));
|
|
173
|
+
return e;
|
|
174
|
+
} catch (e) {
|
|
175
|
+
try {
|
|
176
|
+
n.backend.kind === "cloud" ? await i({
|
|
177
|
+
backend: n.backend,
|
|
178
|
+
method: "DELETE",
|
|
179
|
+
path: s,
|
|
180
|
+
headers: await b(n)
|
|
181
|
+
}) : await d.delete(s, await y(n.backend));
|
|
182
|
+
} catch (t) {
|
|
183
|
+
throw AggregateError([e, t], "Failed to disable the imported automation and clean it up.");
|
|
184
|
+
}
|
|
185
|
+
throw e;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
static async updateAutomation(t, n) {
|
|
189
|
+
let r = e().backend, a = `${u}/v1/${encodeURIComponent(t)}`;
|
|
190
|
+
if (r.kind === "cloud") return i({
|
|
191
|
+
backend: r,
|
|
192
|
+
method: "PATCH",
|
|
193
|
+
path: a,
|
|
194
|
+
body: n,
|
|
195
|
+
headers: await f()
|
|
196
|
+
});
|
|
197
|
+
let { data: o } = await d.patch(a, n);
|
|
198
|
+
return o;
|
|
199
|
+
}
|
|
200
|
+
static async deleteAutomation(t) {
|
|
201
|
+
let n = e().backend, r = `${u}/v1/${encodeURIComponent(t)}`;
|
|
202
|
+
if (n.kind === "cloud") {
|
|
203
|
+
await i({
|
|
204
|
+
backend: n,
|
|
205
|
+
method: "DELETE",
|
|
206
|
+
path: r,
|
|
207
|
+
headers: await f()
|
|
208
|
+
});
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
await d.delete(r);
|
|
212
|
+
}
|
|
213
|
+
static async dispatchAutomation(t) {
|
|
214
|
+
let n = e().backend, r = `${u}/v1/${encodeURIComponent(t)}/dispatch`;
|
|
215
|
+
if (n.kind === "cloud") return i({
|
|
216
|
+
backend: n,
|
|
217
|
+
method: "POST",
|
|
218
|
+
path: r,
|
|
219
|
+
headers: await f()
|
|
220
|
+
});
|
|
221
|
+
let { data: a } = await d.post(r);
|
|
222
|
+
return a;
|
|
223
|
+
}
|
|
224
|
+
static async listAutomationRuns(t, n = {}) {
|
|
225
|
+
let { limit: r = 50, offset: a = 0 } = n, o = e().backend, s = `${u}/v1/${encodeURIComponent(t)}/runs`;
|
|
226
|
+
if (o.kind === "cloud") return i({
|
|
227
|
+
backend: o,
|
|
228
|
+
method: "GET",
|
|
229
|
+
path: `${s}?${h(r, a)}`,
|
|
230
|
+
headers: await f()
|
|
231
|
+
});
|
|
232
|
+
let { data: c } = await d.get(s, { params: {
|
|
233
|
+
limit: r,
|
|
234
|
+
offset: a
|
|
235
|
+
} });
|
|
236
|
+
return c;
|
|
237
|
+
}
|
|
238
|
+
static async getAutomationRuns(e, n = 50, r = 0) {
|
|
239
|
+
return t.listAutomationRuns(e, {
|
|
240
|
+
limit: n,
|
|
241
|
+
offset: r
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
static async toggleAutomation(e, n) {
|
|
245
|
+
return t.updateAutomation(e, { enabled: n });
|
|
246
|
+
}
|
|
247
|
+
static async downloadTarball(t, n) {
|
|
248
|
+
let r = e().backend, a = `${u}/v1/${encodeURIComponent(t)}/tarball`, o;
|
|
249
|
+
if (r.kind === "cloud") o = await i({
|
|
250
|
+
backend: r,
|
|
251
|
+
method: "GET",
|
|
252
|
+
path: a,
|
|
253
|
+
responseType: "blob",
|
|
254
|
+
headers: await f()
|
|
255
|
+
});
|
|
256
|
+
else {
|
|
257
|
+
let { data: e } = await d.get(a, { responseType: "blob" });
|
|
258
|
+
o = e;
|
|
259
|
+
}
|
|
260
|
+
let s = URL.createObjectURL(o), c = document.createElement("a");
|
|
261
|
+
c.href = s, c.download = `${n}.tar`, c.click(), URL.revokeObjectURL(s);
|
|
262
|
+
}
|
|
263
|
+
static async checkHealth() {
|
|
264
|
+
let t = e().backend, n = `${u}/health`;
|
|
265
|
+
try {
|
|
266
|
+
if (t.kind === "cloud") return await i({
|
|
267
|
+
backend: t,
|
|
268
|
+
method: "GET",
|
|
269
|
+
path: n,
|
|
270
|
+
timeoutSeconds: 5,
|
|
271
|
+
headers: await f()
|
|
272
|
+
});
|
|
273
|
+
let { data: e } = await d.get(n, { timeout: 5e3 });
|
|
274
|
+
return e;
|
|
275
|
+
} catch {
|
|
276
|
+
return { status: "error" };
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
//#endregion
|
|
281
|
+
export { x as default };
|
|
282
|
+
|
|
283
|
+
//# sourceMappingURL=automation-service.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automation-service.api.js","names":[],"sources":["../../../src/api/automation-service/automation-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getTelemetryConsent,\n getTelemetryDistinctId,\n getTelemetryDistinctIdForConsentSync,\n type TelemetryConsent,\n} from \"#/services/telemetry\";\nimport type {\n Automation,\n AutomationRun,\n AutomationSpec,\n AutomationTrigger,\n AutomationsResponse,\n AutomationRunsResponse,\n} from \"#/types/automation\";\nimport type { Backend, ResolvedActiveBackend } from \"../backend-registry/types\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport {\n AGENT_CANVAS_CLIENT_HEADERS,\n OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER,\n} from \"../client-source\";\n\nconst AUTOMATION_BASE_PATH = \"/api/automation\";\n\nexport interface AutomationHealthResponse {\n status: \"ok\" | \"error\";\n message?: string;\n}\n\ntype AutomationSdkVersionResponse =\n | string\n | {\n sdk_version?: unknown;\n version?: unknown;\n };\n\n// Local automation calls go to the automation sidecar that\n// `scripts/dev-with-automation.mjs` mounts behind the local agent-server.\n// Both backends use the same session API key and the same `X-Session-API-Key`\n// header for consistency.\nconst localAutomationAxios = axios.create();\n\nasync function buildAutomationRequestHeaders(\n extraHeaders: Record<string, string> = {},\n): Promise<Record<string, string>> {\n const telemetryDistinctId = await getTelemetryDistinctId();\n return {\n ...AGENT_CANVAS_CLIENT_HEADERS,\n ...(telemetryDistinctId\n ? { [OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER]: telemetryDistinctId }\n : {}),\n ...extraHeaders,\n };\n}\n\nlocalAutomationAxios.interceptors.request.use(async (config) => {\n const requestHeaders = await buildAutomationRequestHeaders();\n Object.entries(requestHeaders).forEach(([name, value]) => {\n config.headers.set(name, value);\n });\n\n // Import uses an explicit baseURL/header pair so its POST, PATCH, and\n // cleanup stay pinned to the backend selected when the mutation started.\n if (config.baseURL) return config;\n\n // Resolve the local backend on every call so it tracks the\n // currently-active local backend (and any host/key edits made via the\n // manage-backends UI), rather than freezing whatever value the\n // agent-server-config produced at module load time.\n // Using the backend registry (rather than the build-time VITE_SESSION_API_KEY\n // env var) ensures the published npm package picks up the runtime-injected\n // session key that scripts/static-server.mjs seeds into localStorage, fixing\n // the 401 errors reported in issue #829.\n const backend = getEffectiveLocalBackend();\n if (!backend) throw new NoBackendAvailableError();\n // eslint-disable-next-line no-param-reassign\n config.baseURL = backend.host;\n\n const apiKey = backend.apiKey?.trim();\n if (apiKey) {\n config.headers.set(\"X-Session-API-Key\", apiKey);\n }\n return config;\n});\n\nfunction normalizeAutomationSdkVersion(version: unknown): string | null {\n if (typeof version !== \"string\") return null;\n const trimmed = version.trim();\n return trimmed || null;\n}\n\nfunction getAutomationSdkVersionFromResponse(\n response: AutomationSdkVersionResponse,\n): string | null {\n if (typeof response === \"string\") {\n return normalizeAutomationSdkVersion(response);\n }\n return (\n normalizeAutomationSdkVersion(response.sdk_version) ??\n normalizeAutomationSdkVersion(response.version)\n );\n}\n\nfunction buildPaginationQuery(limit: number, offset: number): string {\n const params = new URLSearchParams();\n params.set(\"limit\", String(limit));\n params.set(\"offset\", String(offset));\n return params.toString();\n}\n\nfunction buildImportedTrigger(spec: AutomationSpec): AutomationTrigger {\n if (spec.trigger.type === \"event\") {\n return {\n type: \"event\",\n source: spec.trigger.source,\n on: spec.trigger.on,\n ...(spec.trigger.filter && { filter: spec.trigger.filter }),\n };\n }\n\n return {\n type: \"cron\",\n schedule: spec.trigger.schedule,\n timezone: spec.timezone ?? spec.trigger.timezone ?? \"UTC\",\n };\n}\n\nfunction generatePendingImportEvent(): string {\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto.randomUUID === \"function\"\n ) {\n return `pending.${crypto.randomUUID()}`;\n }\n return `pending.${Date.now()}.${Math.random().toString(36).slice(2, 10)}`;\n}\n\nfunction buildCreateAutomationRequest(spec: AutomationSpec) {\n if (!spec.prompt) {\n throw new Error(\"An automation prompt is required for import.\");\n }\n\n const repos = spec.repository\n ? [\n {\n url: spec.repository,\n ...(spec.branch && { ref: spec.branch }),\n ...(!spec.repository.includes(\"://\") &&\n !spec.repository.startsWith(\"git@\") && { provider: \"github\" }),\n },\n ]\n : undefined;\n\n return {\n path: `${AUTOMATION_BASE_PATH}/v1/preset/${spec.plugins?.length ? \"plugin\" : \"prompt\"}`,\n body: {\n name: spec.name,\n prompt: spec.prompt,\n // Preset creation defaults to enabled. A unique event trigger keeps the\n // new record inert until the real trigger and disabled state are applied\n // together in the follow-up PATCH.\n trigger: {\n type: \"event\",\n source: \"agent-canvas-import\",\n on: generatePendingImportEvent(),\n },\n ...(spec.model && { model: spec.model }),\n ...(repos && { repos }),\n ...(spec.plugins?.length && {\n plugins: spec.plugins.map((source) => ({ source })),\n }),\n ...(spec.timeout != null && { timeout: spec.timeout }),\n },\n };\n}\n\nasync function buildPinnedLocalConfig(backend: Backend) {\n const apiKey = backend.apiKey.trim();\n return {\n baseURL: backend.host,\n headers: await buildAutomationRequestHeaders(\n apiKey ? { \"X-Session-API-Key\": apiKey } : {},\n ),\n };\n}\n\nasync function buildPinnedCloudHeaders(active: ResolvedActiveBackend) {\n return buildAutomationRequestHeaders(\n active.orgId ? { \"X-Org-Id\": active.orgId } : {},\n );\n}\n\nclass AutomationService {\n static async syncTelemetryConsent(\n consent: TelemetryConsent = getTelemetryConsent(),\n ): Promise<void> {\n const active = getActiveBackend();\n if (active.backend.kind !== \"local\") return;\n\n const frontendDistinctId = await getTelemetryDistinctIdForConsentSync();\n await localAutomationAxios.post(\n `${AUTOMATION_BASE_PATH}/v1/telemetry/consent`,\n {\n consent_granted: consent === \"granted\",\n frontend_distinct_id: frontendDistinctId,\n },\n { timeout: 5000 },\n );\n }\n\n static async getSdkVersion(): Promise<string | null> {\n const active = getActiveBackend();\n const path = `${AUTOMATION_BASE_PATH}/sdk-version`;\n\n try {\n let response: AutomationSdkVersionResponse;\n if (active.backend.kind === \"cloud\") {\n response = await callCloudProxy<AutomationSdkVersionResponse>({\n backend: active.backend,\n method: \"GET\",\n path,\n headers: await buildPinnedCloudHeaders(active),\n timeoutSeconds: 5,\n });\n } else {\n const { data } =\n await localAutomationAxios.get<AutomationSdkVersionResponse>(path, {\n timeout: 5000,\n });\n response = data;\n }\n\n return getAutomationSdkVersionFromResponse(response);\n } catch {\n return null;\n }\n }\n\n static async listAutomations(\n params: { limit?: number; offset?: number } = {},\n ): Promise<AutomationsResponse> {\n const { limit = 50, offset = 0 } = params;\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\") {\n return callCloudProxy<AutomationsResponse>({\n backend: active,\n method: \"GET\",\n path: `${AUTOMATION_BASE_PATH}/v1?${buildPaginationQuery(limit, offset)}`,\n headers: await buildAutomationRequestHeaders(),\n });\n }\n\n const { data } = await localAutomationAxios.get<AutomationsResponse>(\n `${AUTOMATION_BASE_PATH}/v1`,\n { params: { limit, offset } },\n );\n return data;\n }\n\n static async getAutomations(\n limit = 50,\n offset = 0,\n ): Promise<AutomationsResponse> {\n return AutomationService.listAutomations({ limit, offset });\n }\n\n static async getAutomation(id: string): Promise<Automation> {\n const active = getActiveBackend().backend;\n const path = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(id)}`;\n\n if (active.kind === \"cloud\") {\n return callCloudProxy<Automation>({\n backend: active,\n method: \"GET\",\n path,\n headers: await buildAutomationRequestHeaders(),\n });\n }\n\n const { data } = await localAutomationAxios.get<Automation>(path);\n return data;\n }\n\n static async createAutomation(spec: AutomationSpec): Promise<Automation> {\n const active = getActiveBackend();\n const { path, body } = buildCreateAutomationRequest(spec);\n\n let created: Automation;\n if (active.backend.kind === \"cloud\") {\n created = await callCloudProxy<Automation>({\n backend: active.backend,\n method: \"POST\",\n path,\n body,\n headers: await buildPinnedCloudHeaders(active),\n });\n } else {\n const { data } = await localAutomationAxios.post<Automation>(\n path,\n body,\n await buildPinnedLocalConfig(active.backend),\n );\n created = data;\n }\n\n const updatePath = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(created.id)}`;\n const updateBody: Partial<Automation> = {\n trigger: buildImportedTrigger(spec),\n enabled: false,\n };\n\n try {\n if (active.backend.kind === \"cloud\") {\n return await callCloudProxy<Automation>({\n backend: active.backend,\n method: \"PATCH\",\n path: updatePath,\n body: updateBody,\n headers: await buildPinnedCloudHeaders(active),\n });\n }\n\n const { data } = await localAutomationAxios.patch<Automation>(\n updatePath,\n updateBody,\n await buildPinnedLocalConfig(active.backend),\n );\n return data;\n } catch (updateError) {\n try {\n if (active.backend.kind === \"cloud\") {\n await callCloudProxy<unknown>({\n backend: active.backend,\n method: \"DELETE\",\n path: updatePath,\n headers: await buildPinnedCloudHeaders(active),\n });\n } else {\n await localAutomationAxios.delete(\n updatePath,\n await buildPinnedLocalConfig(active.backend),\n );\n }\n } catch (cleanupError) {\n throw new AggregateError(\n [updateError, cleanupError],\n \"Failed to disable the imported automation and clean it up.\",\n );\n }\n throw updateError;\n }\n }\n\n static async updateAutomation(\n id: string,\n body: Partial<Automation>,\n ): Promise<Automation> {\n const active = getActiveBackend().backend;\n const path = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(id)}`;\n\n if (active.kind === \"cloud\") {\n return callCloudProxy<Automation>({\n backend: active,\n method: \"PATCH\",\n path,\n body: body as Record<string, unknown>,\n headers: await buildAutomationRequestHeaders(),\n });\n }\n\n const { data } = await localAutomationAxios.patch<Automation>(path, body);\n return data;\n }\n\n static async deleteAutomation(id: string): Promise<void> {\n const active = getActiveBackend().backend;\n const path = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(id)}`;\n\n if (active.kind === \"cloud\") {\n await callCloudProxy<unknown>({\n backend: active,\n method: \"DELETE\",\n path,\n headers: await buildAutomationRequestHeaders(),\n });\n return;\n }\n\n await localAutomationAxios.delete(path);\n }\n\n static async dispatchAutomation(id: string): Promise<AutomationRun> {\n const active = getActiveBackend().backend;\n const path = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(id)}/dispatch`;\n\n if (active.kind === \"cloud\") {\n return callCloudProxy<AutomationRun>({\n backend: active,\n method: \"POST\",\n path,\n headers: await buildAutomationRequestHeaders(),\n });\n }\n\n const { data } = await localAutomationAxios.post<AutomationRun>(path);\n return data;\n }\n\n static async listAutomationRuns(\n id: string,\n params: { limit?: number; offset?: number } = {},\n ): Promise<AutomationRunsResponse> {\n const { limit = 50, offset = 0 } = params;\n const active = getActiveBackend().backend;\n const basePath = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(id)}/runs`;\n\n if (active.kind === \"cloud\") {\n return callCloudProxy<AutomationRunsResponse>({\n backend: active,\n method: \"GET\",\n path: `${basePath}?${buildPaginationQuery(limit, offset)}`,\n headers: await buildAutomationRequestHeaders(),\n });\n }\n\n const { data } = await localAutomationAxios.get<AutomationRunsResponse>(\n basePath,\n { params: { limit, offset } },\n );\n return data;\n }\n\n static async getAutomationRuns(\n id: string,\n limit = 50,\n offset = 0,\n ): Promise<AutomationRunsResponse> {\n return AutomationService.listAutomationRuns(id, { limit, offset });\n }\n\n static async toggleAutomation(\n id: string,\n enabled: boolean,\n ): Promise<Automation> {\n return AutomationService.updateAutomation(id, { enabled });\n }\n\n static async downloadTarball(id: string, name: string): Promise<void> {\n const active = getActiveBackend().backend;\n const path = `${AUTOMATION_BASE_PATH}/v1/${encodeURIComponent(id)}/tarball`;\n\n let blob: Blob;\n if (active.kind === \"cloud\") {\n blob = await callCloudProxy<Blob>({\n backend: active,\n method: \"GET\",\n path,\n responseType: \"blob\",\n headers: await buildAutomationRequestHeaders(),\n });\n } else {\n const { data } = await localAutomationAxios.get<Blob>(path, {\n responseType: \"blob\",\n });\n blob = data;\n }\n\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = `${name}.tar`;\n a.click();\n URL.revokeObjectURL(url);\n }\n\n static async checkHealth(): Promise<AutomationHealthResponse> {\n const active = getActiveBackend().backend;\n const path = `${AUTOMATION_BASE_PATH}/health`;\n\n try {\n if (active.kind === \"cloud\") {\n const response = await callCloudProxy<AutomationHealthResponse>({\n backend: active,\n method: \"GET\",\n path,\n // Fail fast, matching the local branch's 5s timeout below.\n timeoutSeconds: 5,\n headers: await buildAutomationRequestHeaders(),\n });\n return response;\n }\n\n const { data } = await localAutomationAxios.get<AutomationHealthResponse>(\n path,\n { timeout: 5000 },\n );\n return data;\n } catch {\n return { status: \"error\" };\n }\n }\n}\n\nexport default AutomationService;\n"],"mappings":";;;;;;;AA2BA,IAAM,IAAuB,mBAkBvB,IAAuB,EAAM,QAAQ;AAE3C,eAAe,EACb,IAAuC,EA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AE;GAAO;GAAQ,CAAC;;CAGpE,aAAa,iBACX,GACA,GACqB;AACrB,SAAO,EAAkB,iBAAiB,GAAI,EAAE,YAAS,CAAC;;CAG5D,aAAa,gBAAgB,GAAY,GAA6B;EACpE,IAAM,IAAS,GAAkB,CAAC,SAC5B,IAAO,GAAG,EAAqB,MAAM,mBAAmB,EAAG,CAAC,WAE9D;AACJ,MAAI,EAAO,SAAS,QAClB,KAAO,MAAM,EAAqB;GAChC,SAAS;GACT,QAAQ;GACR;GACA,cAAc;GACd,SAAS,MAAM,GAA+B;GAC/C,CAAC;OACG;GACL,IAAM,EAAE,YAAS,MAAM,EAAqB,IAAU,GAAM,EAC1D,cAAc,QACf,CAAC;AACF,OAAO;;EAGT,IAAM,IAAM,IAAI,gBAAgB,EAAK,EAC/B,IAAI,SAAS,cAAc,IAAI;AAIrC,EAHA,EAAE,OAAO,GACT,EAAE,WAAW,GAAG,EAAK,OACrB,EAAE,OAAO,EACT,IAAI,gBAAgB,EAAI;;CAG1B,aAAa,cAAiD;EAC5D,IAAM,IAAS,GAAkB,CAAC,SAC5B,IAAO,GAAG,EAAqB;AAErC,MAAI;AACF,OAAI,EAAO,SAAS,QASlB,QAAO,MARgB,EAAyC;IAC9D,SAAS;IACT,QAAQ;IACR;IAEA,gBAAgB;IAChB,SAAS,MAAM,GAA+B;IAC/C,CAAC;GAIJ,IAAM,EAAE,YAAS,MAAM,EAAqB,IAC1C,GACA,EAAE,SAAS,KAAM,CAClB;AACD,UAAO;UACD;AACN,UAAO,EAAE,QAAQ,SAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../package.cjs`);var t=`agent_canvas`,n=e.default.version,r
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../package.cjs`);var t=`agent_canvas`,n=e.default.version,r=`X-OpenHands-Client`,i=`X-OpenHands-Client-Version`,a=`X-OpenHands-Telemetry-Distinct-Id`,o={[r]:t,[i]:n};exports.AGENT_CANVAS_CLIENT_HEADERS=o,exports.AGENT_CANVAS_CLIENT_SOURCE=t,exports.AGENT_CANVAS_CLIENT_VERSION=n,exports.OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER=a;
|
|
2
2
|
//# sourceMappingURL=client-source.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-source.cjs","names":[],"sources":["../../src/api/client-source.ts"],"sourcesContent":["import packageJson from \"../../package.json\";\n\nexport const AGENT_CANVAS_CLIENT_SOURCE = \"agent_canvas\";\nexport const AGENT_CANVAS_CLIENT_VERSION = packageJson.version;\n\n/**\n * Coarse, non-user-identifying request metadata for Cloud observability.\n *\n * Cloud ingress can retain these headers as facets without logging request\n * bodies, API keys, device codes, or conversation content.\n */\nexport const
|
|
1
|
+
{"version":3,"file":"client-source.cjs","names":[],"sources":["../../src/api/client-source.ts"],"sourcesContent":["import packageJson from \"../../package.json\";\n\nexport const AGENT_CANVAS_CLIENT_SOURCE = \"agent_canvas\";\nexport const AGENT_CANVAS_CLIENT_VERSION = packageJson.version;\n\n/**\n * Coarse, non-user-identifying request metadata for Cloud observability.\n *\n * Cloud ingress can retain these headers as facets without logging request\n * bodies, API keys, device codes, or conversation content.\n */\nexport const OPENHANDS_CLIENT_HEADER = \"X-OpenHands-Client\";\nexport const OPENHANDS_CLIENT_VERSION_HEADER = \"X-OpenHands-Client-Version\";\nexport const OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER =\n \"X-OpenHands-Telemetry-Distinct-Id\";\n\nexport const AGENT_CANVAS_CLIENT_HEADERS: Readonly<Record<string, string>> = {\n [OPENHANDS_CLIENT_HEADER]: AGENT_CANVAS_CLIENT_SOURCE,\n [OPENHANDS_CLIENT_VERSION_HEADER]: AGENT_CANVAS_CLIENT_VERSION,\n};\n"],"mappings":"+EAEA,IAAa,EAA6B,eAC7B,EAA8B,EAAA,QAAY,QAQ1C,EAA0B,qBAC1B,EAAkC,6BAClC,EACX,oCAEW,EAAgE,EAC1E,GAA0B,GAC1B,GAAkC,EACpC"}
|
|
@@ -6,4 +6,7 @@ export declare const AGENT_CANVAS_CLIENT_VERSION: string;
|
|
|
6
6
|
* Cloud ingress can retain these headers as facets without logging request
|
|
7
7
|
* bodies, API keys, device codes, or conversation content.
|
|
8
8
|
*/
|
|
9
|
+
export declare const OPENHANDS_CLIENT_HEADER = "X-OpenHands-Client";
|
|
10
|
+
export declare const OPENHANDS_CLIENT_VERSION_HEADER = "X-OpenHands-Client-Version";
|
|
11
|
+
export declare const OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER = "X-OpenHands-Telemetry-Distinct-Id";
|
|
9
12
|
export declare const AGENT_CANVAS_CLIENT_HEADERS: Readonly<Record<string, string>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import e from "../package.js";
|
|
2
2
|
//#region src/api/client-source.ts
|
|
3
|
-
var t = "agent_canvas", n = e.version, r = {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var t = "agent_canvas", n = e.version, r = "X-OpenHands-Client", i = "X-OpenHands-Client-Version", a = "X-OpenHands-Telemetry-Distinct-Id", o = {
|
|
4
|
+
[r]: t,
|
|
5
|
+
[i]: n
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export { o as AGENT_CANVAS_CLIENT_HEADERS, t as AGENT_CANVAS_CLIENT_SOURCE, n as AGENT_CANVAS_CLIENT_VERSION, a as OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=client-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-source.js","names":[],"sources":["../../src/api/client-source.ts"],"sourcesContent":["import packageJson from \"../../package.json\";\n\nexport const AGENT_CANVAS_CLIENT_SOURCE = \"agent_canvas\";\nexport const AGENT_CANVAS_CLIENT_VERSION = packageJson.version;\n\n/**\n * Coarse, non-user-identifying request metadata for Cloud observability.\n *\n * Cloud ingress can retain these headers as facets without logging request\n * bodies, API keys, device codes, or conversation content.\n */\nexport const
|
|
1
|
+
{"version":3,"file":"client-source.js","names":[],"sources":["../../src/api/client-source.ts"],"sourcesContent":["import packageJson from \"../../package.json\";\n\nexport const AGENT_CANVAS_CLIENT_SOURCE = \"agent_canvas\";\nexport const AGENT_CANVAS_CLIENT_VERSION = packageJson.version;\n\n/**\n * Coarse, non-user-identifying request metadata for Cloud observability.\n *\n * Cloud ingress can retain these headers as facets without logging request\n * bodies, API keys, device codes, or conversation content.\n */\nexport const OPENHANDS_CLIENT_HEADER = \"X-OpenHands-Client\";\nexport const OPENHANDS_CLIENT_VERSION_HEADER = \"X-OpenHands-Client-Version\";\nexport const OPENHANDS_TELEMETRY_DISTINCT_ID_HEADER =\n \"X-OpenHands-Telemetry-Distinct-Id\";\n\nexport const AGENT_CANVAS_CLIENT_HEADERS: Readonly<Record<string, string>> = {\n [OPENHANDS_CLIENT_HEADER]: AGENT_CANVAS_CLIENT_SOURCE,\n [OPENHANDS_CLIENT_VERSION_HEADER]: AGENT_CANVAS_CLIENT_VERSION,\n};\n"],"mappings":";;AAEA,IAAa,IAA6B,gBAC7B,IAA8B,EAAY,SAQ1C,IAA0B,sBAC1B,IAAkC,8BAClC,IACX,qCAEW,IAAgE;EAC1E,IAA0B;EAC1B,IAAkC;CACpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-service.api.cjs","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type AppPreferences } from \"../settings-service/settings-service.api\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n if (flat.mcp_config && Object.keys(flat.mcp_config).length > 0) {\n agent.mcp_config = flat.mcp_config;\n }\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n /**\n * App-level user preferences (language, sound notifications, disabled\n * skills, …). The cloud `POST /api/v1/settings` consumes these as flat\n * top-level fields, so this helper iterates the object and assigns each\n * key onto the request body.\n *\n * Note: `app_preferences.disabled_skills` is the canonical source for the\n * skill list since `AppPreferences` was unified in agent-server 1.27.\n * Callers that still pass `disabled_skills` separately should migrate to\n * setting it under `app_preferences` instead.\n */\n app_preferences?: AppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (diff.agent_settings_diff) {\n const agentDiff: Record<string, SettingsValue> = {\n ...diff.agent_settings_diff,\n };\n // The cloud validates agent settings against the SDK's\n // OpenHandsAgentSettings, whose `agent_context` is a required\n // AgentContext (not Optional). A literal `agent_context: null` fails\n // backend validation, so drop it and let the backend keep/default it.\n // See OpenHands/agent-canvas#981.\n if (agentDiff.agent_context === null) {\n delete agentDiff.agent_context;\n }\n if (Object.keys(agentDiff).length > 0) {\n body.agent_settings_diff = agentDiff;\n }\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Flat top-level app-preference fields (language, git_user_name,\n // disabled_skills, …). The cloud POST /api/v1/settings stores these\n // directly; see `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape. `undefined`\n // values are skipped so the cloud server keeps the prior value; `null`\n // and empty arrays (e.g. re-enabling every skill) round-trip as\n // explicit clears.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n if (value !== undefined) {\n body[key] = value;\n }\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":"iIAwDA,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,gDAAgD,CAElE,OAAO,EAQT,SAAS,EACP,EAC+B,CAC/B,GAAI,EAAK,gBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,OAAS,EACnE,OAAO,EAAK,eAEd,IAAM,EAAuC,EAAE,CACzC,EAAqC,EAAE,CACzC,OAAO,EAAK,WAAc,WAAU,EAAI,MAAQ,EAAK,WACrD,OAAO,EAAK,cAAiB,WAAU,EAAI,SAAW,EAAK,cAC3D,OAAO,EAAK,aAAgB,WAAU,EAAI,QAAU,EAAK,aACzD,OAAO,KAAK,EAAI,CAAC,OAAS,IAAG,EAAM,IAAM,GAE7C,IAAM,EAA2C,EAAE,CAanD,OAZI,OAAO,EAAK,0BAA6B,YAC3C,EAAU,QAAU,EAAK,0BAEvB,OAAO,EAAK,oBAAuB,WACrC,EAAU,SAAW,EAAK,oBAExB,OAAO,KAAK,EAAU,CAAC,OAAS,IAAG,EAAM,UAAY,GAErD,OAAO,EAAK,OAAU,WAAU,EAAM,MAAQ,EAAK,OACnD,EAAK,YAAc,OAAO,KAAK,EAAK,WAAW,CAAC,OAAS,IAC3D,EAAM,WAAa,EAAK,YAEnB,EAGT,SAAS,EACP,EAC+B,CAC/B,GACE,EAAK,uBACL,OAAO,KAAK,EAAK,sBAAsB,CAAC,OAAS,EAEjD,OAAO,EAAK,sBAEd,IAAM,EAAqC,EAAE,CAa7C,OAZ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],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type AppPreferences } from \"../settings-service/settings-service.api\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n title_llm_profile?: string | null;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n if (flat.mcp_config && Object.keys(flat.mcp_config).length > 0) {\n agent.mcp_config = flat.mcp_config;\n }\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n /**\n * App-level user preferences (language, sound notifications, disabled\n * skills, …). The cloud `POST /api/v1/settings` consumes these as flat\n * top-level fields, so this helper iterates the object and assigns each\n * key onto the request body.\n *\n * Note: `app_preferences.disabled_skills` is the canonical source for the\n * skill list since `AppPreferences` was unified in agent-server 1.27.\n * Callers that still pass `disabled_skills` separately should migrate to\n * setting it under `app_preferences` instead.\n */\n app_preferences?: AppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (diff.agent_settings_diff) {\n const agentDiff: Record<string, SettingsValue> = {\n ...diff.agent_settings_diff,\n };\n // The cloud validates agent settings against the SDK's\n // OpenHandsAgentSettings, whose `agent_context` is a required\n // AgentContext (not Optional). A literal `agent_context: null` fails\n // backend validation, so drop it and let the backend keep/default it.\n // See OpenHands/agent-canvas#981.\n if (agentDiff.agent_context === null) {\n delete agentDiff.agent_context;\n }\n if (Object.keys(agentDiff).length > 0) {\n body.agent_settings_diff = agentDiff;\n }\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Flat top-level app-preference fields (language, git_user_name,\n // disabled_skills, …). The cloud POST /api/v1/settings stores these\n // directly; see `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape. `undefined`\n // values are skipped so the cloud server keeps the prior value; `null`\n // and empty arrays (e.g. re-enabling every skill) round-trip as\n // explicit clears.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n if (value !== undefined) {\n body[key] = value;\n }\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":"iIAyDA,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,gDAAgD,CAElE,OAAO,EAQT,SAAS,EACP,EAC+B,CAC/B,GAAI,EAAK,gBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,OAAS,EACnE,OAAO,EAAK,eAEd,IAAM,EAAuC,EAAE,CACzC,EAAqC,EAAE,CACzC,OAAO,EAAK,WAAc,WAAU,EAAI,MAAQ,EAAK,WACrD,OAAO,EAAK,cAAiB,WAAU,EAAI,SAAW,EAAK,cAC3D,OAAO,EAAK,aAAgB,WAAU,EAAI,QAAU,EAAK,aACzD,OAAO,KAAK,EAAI,CAAC,OAAS,IAAG,EAAM,IAAM,GAE7C,IAAM,EAA2C,EAAE,CAanD,OAZI,OAAO,EAAK,0BAA6B,YAC3C,EAAU,QAAU,EAAK,0BAEvB,OAAO,EAAK,oBAAuB,WACrC,EAAU,SAA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AA,KACZ,EAAK,GAAO,GAIlB,MAAM,EAAA,eAAwB,CAC5B,UACA,OAAQ,OACR,KAAM,mBACN,OACD,CAAC,CAGJ,eAAsB,GAA6C,CAEjE,OAAO,EAAA,eAAwB,CAC7B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,gCACP,CAAC,CAGJ,eAAsB,GAAyD,CAE7E,OAAO,EAAA,eAAwB,CAC7B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,uCACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-service.api.js","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type AppPreferences } from \"../settings-service/settings-service.api\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n if (flat.mcp_config && Object.keys(flat.mcp_config).length > 0) {\n agent.mcp_config = flat.mcp_config;\n }\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n /**\n * App-level user preferences (language, sound notifications, disabled\n * skills, …). The cloud `POST /api/v1/settings` consumes these as flat\n * top-level fields, so this helper iterates the object and assigns each\n * key onto the request body.\n *\n * Note: `app_preferences.disabled_skills` is the canonical source for the\n * skill list since `AppPreferences` was unified in agent-server 1.27.\n * Callers that still pass `disabled_skills` separately should migrate to\n * setting it under `app_preferences` instead.\n */\n app_preferences?: AppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (diff.agent_settings_diff) {\n const agentDiff: Record<string, SettingsValue> = {\n ...diff.agent_settings_diff,\n };\n // The cloud validates agent settings against the SDK's\n // OpenHandsAgentSettings, whose `agent_context` is a required\n // AgentContext (not Optional). A literal `agent_context: null` fails\n // backend validation, so drop it and let the backend keep/default it.\n // See OpenHands/agent-canvas#981.\n if (agentDiff.agent_context === null) {\n delete agentDiff.agent_context;\n }\n if (Object.keys(agentDiff).length > 0) {\n body.agent_settings_diff = agentDiff;\n }\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Flat top-level app-preference fields (language, git_user_name,\n // disabled_skills, …). The cloud POST /api/v1/settings stores these\n // directly; see `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape. `undefined`\n // values are skipped so the cloud server keeps the prior value; `null`\n // and empty arrays (e.g. re-enabling every skill) round-trip as\n // explicit clears.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n if (value !== undefined) {\n body[key] = value;\n }\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":";;;AAwDA,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,gDAAgD;AAElE,QAAO;;AAQT,SAAS,EACP,GAC+B;AAC/B,KAAI,EAAK,kBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,SAAS,EACnE,QAAO,EAAK;CAEd,IAAM,IAAuC,EAAE,EACzC,IAAqC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,KAAI,EAAK,qBAAqB;EAC5B,IAAM,IAA2C,EAC/C,GAAG,EAAK,qBACT;AASD,EAHI,EAAU,kBAAkB,QAC9B,OAAO,EAAU,eAEf,OAAO,KAAK,EAAU,CAAC,SAAS,MAClC,EAAK,sBAAsB;;AAgB/B,KAZE,EAAK,8BACL,OAAO,KAAK,EAAK,2BAA2B,CAAC,SAAS,MAEtD,EAAK,6BAA6B,EAAK,6BASrC,EAAK,sBACF,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAK,gBAAgB,CAC7D,CAAI,MAAU,KAAA,MACZ,EAAK,KAAO;AAIlB,OAAM,EAAwB;EAC5B;EACA,QAAQ;EACR,MAAM;EACN;EACD,CAAC;;AAGJ,eAAsB,IAA6C;AAEjE,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,eAAsB,IAAyD;AAE7E,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC"}
|
|
1
|
+
{"version":3,"file":"settings-service.api.js","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type AppPreferences } from \"../settings-service/settings-service.api\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n title_llm_profile?: string | null;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n if (flat.mcp_config && Object.keys(flat.mcp_config).length > 0) {\n agent.mcp_config = flat.mcp_config;\n }\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n /**\n * App-level user preferences (language, sound notifications, disabled\n * skills, …). The cloud `POST /api/v1/settings` consumes these as flat\n * top-level fields, so this helper iterates the object and assigns each\n * key onto the request body.\n *\n * Note: `app_preferences.disabled_skills` is the canonical source for the\n * skill list since `AppPreferences` was unified in agent-server 1.27.\n * Callers that still pass `disabled_skills` separately should migrate to\n * setting it under `app_preferences` instead.\n */\n app_preferences?: AppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (diff.agent_settings_diff) {\n const agentDiff: Record<string, SettingsValue> = {\n ...diff.agent_settings_diff,\n };\n // The cloud validates agent settings against the SDK's\n // OpenHandsAgentSettings, whose `agent_context` is a required\n // AgentContext (not Optional). A literal `agent_context: null` fails\n // backend validation, so drop it and let the backend keep/default it.\n // See OpenHands/agent-canvas#981.\n if (agentDiff.agent_context === null) {\n delete agentDiff.agent_context;\n }\n if (Object.keys(agentDiff).length > 0) {\n body.agent_settings_diff = agentDiff;\n }\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Flat top-level app-preference fields (language, git_user_name,\n // disabled_skills, …). The cloud POST /api/v1/settings stores these\n // directly; see `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape. `undefined`\n // values are skipped so the cloud server keeps the prior value; `null`\n // and empty arrays (e.g. re-enabling every skill) round-trip as\n // explicit clears.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n if (value !== undefined) {\n body[key] = value;\n }\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<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;CAErE,IAAM,IAAO,MAAM,EAAsC;EACvD,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;AAEF,QAAO;EACL,GAAG;EACH,gBAAgB,EAAoB,EAAK;EACzC,uBAAuB,EAA2B,EAAK;EACvD,iBAAiB,CAAC,CAAC,EAAK;EACxB,oBAAoB,CAAC,CAAC,EAAK;EAC3B,qBAAqB,EAAK;EAC3B;;AAGH,eAAsB,EAAkB,GAetB;CAChB,IAAM,IAAU,GAAuB,EACjC,IAAgC,EAAE;AACxC,KAAI,EAAK,qBAAqB;EAC5B,IAAM,IAA2C,EAC/C,GAAG,EAAK,qBACT;AASD,EAHI,EAAU,kBAAkB,QAC9B,OAAO,EAAU,eAEf,OAAO,KAAK,EAAU,CAAC,SAAS,MAClC,EAAK,sBAAsB;;AAgB/B,KAZE,EAAK,8BACL,OAAO,KAAK,EAAK,2BAA2B,CAAC,SAAS,MAEtD,EAAK,6BAA6B,EAAK,6BASrC,EAAK,sBACF,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAK,gBAAgB,CAC7D,CAAI,MAAU,KAAA,MACZ,EAAK,KAAO;AAIlB,OAAM,EAAwB;EAC5B;EACA,QAAQ;EACR,MAAM;EACN;EACD,CAAC;;AAGJ,eAAsB,IAA6C;AAEjE,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,eAAsB,IAAyD;AAE7E,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs`),t=require(`../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs`),n=require(`../../node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs`),r=require(`../../node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs`);require(`../../node_modules/@openhands/typescript-client/dist/clients.cjs`);const i=require(`../../utils/websocket-url.cjs`),a=require(`../agent-server-config.cjs`),o=require(`../backend-registry/active-store.cjs`),s=require(`../agent-server-client-options.cjs`),c=require(`../../node_modules/uuid/dist/v4.cjs`),l=require(`../cloud/proxy.cjs`),u=require(`../../node_modules/@openhands/typescript-client/dist/models/conversation.cjs`);require(`../../node_modules/@openhands/typescript-client/dist/index.cjs`);const d=require(`../agent-server-home.cjs`),f=require(`../profiles-service/profiles-service.api.cjs`),p=require(`../conversation-metadata-store.cjs`),m=require(`../cloud/conversation-service.api.cjs`),h=require(`../settings-service/settings-service.api.cjs`),g=require(`../agent-server-adapter.cjs`);var _=`1970-01-01T00:00:00.000Z`,v=`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.`;function y(){return Error(v)}function b(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function x(e){return typeof e==`number`?e:null}function S(e){return typeof e==`number`?e:0}function C(e){return typeof e==`string`?e:null}function w(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:_}function T(e){return b(e)?{prompt_tokens:S(e.prompt_tokens),completion_tokens:S(e.completion_tokens),cache_read_tokens:S(e.cache_read_tokens),cache_write_tokens:S(e.cache_write_tokens),context_window:S(e.context_window),per_turn_token:S(e.per_turn_token)}:null}function E(e){return b(e)?{accumulated_cost:x(e.accumulated_cost),max_budget_per_task:x(e.max_budget_per_task),accumulated_token_usage:T(e.accumulated_token_usage)}:null}function D(e){if(!b(e))return null;let t=b(e.llm)?{model:C(e.llm.model)}:null;return{kind:C(e.kind),acp_server:C(e.acp_server),acp_model:C(e.acp_model),llm:t}}function O(e){return b(e)?{working_dir:C(e.working_dir)}:null}function k(e){if(!b(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function A(e){if(!b(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function j(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function M(e,t){let n=j(e),r=j(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function N(e){if(!b(e)||typeof e.id!=`string`||!e.id.trim())throw y();return{id:e.id.trim(),title:C(e.title),created_at:w(e,`created_at`,`createdAt`),updated_at:w(e,`updated_at`,`updatedAt`),execution_status:C(e.execution_status),sandbox_status:C(e.sandbox_status),metrics:E(e.metrics),agent:D(e.agent),workspace:O(e.workspace),tags:k(e.tags),launched_agent_profile:A(e.launched_agent_profile),current_model_id:C(e.current_model_id),current_model_name:C(e.current_model_name)}}function P(e){if(!Array.isArray(e))throw y();return e.map(N)}function F(e){if(Array.isArray(e))return{items:P(e),next_page_id:null};if(!b(e))throw y();return{items:P(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var I=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function L(e){let t=e??`idle`;return I.has(t)?t:`idle`}function R(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var z=class{static async sendMessage(t,n,r){let a=o.getActiveBackend().backend,c=r?.conversationUrl??null,u=r?.sessionApiKey??null;if(a.kind===`cloud`){if(!c||!u){let[e]=await m.batchGetCloudConversations([t]);c=e?.conversation_url?.trim()??null,u=e?.session_api_key?.trim()??null}if(!c||!u)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await l.callCloudProxy({backend:a,method:`POST`,hostOverride:i.buildHttpBaseUrl(c),path:`/api/conversations/${t}/events`,body:{...n,run:!0},authMode:`session-api-key`,sessionApiKey:u}),n}return await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:c,sessionApiKey:u})).sendEvent(t,n,{run:!0}),n}static async createConversation(t,n,r,i,l,u,f,_,v,y,b){if(o.getActiveBackend().backend.kind===`cloud`)return m.createCloudAppConversation({initial_message:t?{role:`user`,content:[{type:`text`,text:t}]}:null,title:n??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:r??null,parent_conversation_id:f??null,agent_type:_,sandbox_id:v??null,agent_profile_id:y??null});let x=await h.default.getSettings(),S=c.default(),C=await d.resolveAbsoluteAgentServerPath(l??a.buildConversationWorkingDir(S)),w=u??(l?`local_repo`:`new_worktree`),T=await g.buildStartConversationRequestWithEncryptedSettings({settings:x,query:t,conversationInstructions:n,plugins:r,conversationId:S,workingDir:C,worktree:w===`new_worktree`,agentProfileId:y,agentProfileKind:b}),E=await new e.ConversationClient(s.getAgentServerClientOptions()).createConversation(T),D=o.getEffectiveLocalBackend();if(!D)throw new s.NoBackendAvailableError;return(i?.selected_repository||l)&&p.setStoredConversationMetadata(E.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:l??null,workspace_mode:w}),{id:E.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:E.id,agent_server_url:D.host,request:{initial_message:T.initial_message,plugins:r??null},created_at:E.created_at,updated_at:E.updated_at}}static async getStartTask(e){return o.getActiveBackend().backend.kind===`cloud`?m.getCloudAppConversationStartTask(e):null}static async getVSCodeUrl(e,t,n){let i=await this.resolveConversationWorkingDir(e);return{vscode_url:await new r.VSCodeClient(s.getAgentServerClientOptions({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:i})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??a.getAgentServerWorkingDir()}static async batchGetAppConversations(t){return t.length===0?[]:o.getActiveBackend().backend.kind===`cloud`?m.batchGetCloudConversations(t):P(await new e.ConversationClient(s.getAgentServerClientOptions()).getConversations(t)).map(e=>g.toAppConversation(e))}static async updateConversationPublicFlag(e,t){if(o.getActiveBackend().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return m.updateCloudConversationPublicFlag(e,t)}static async updateConversationRepository(e,t,n,r){t?p.setStoredConversationMetadata(e,{...p.getStoredConversationMetadata(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):p.removeStoredConversationMetadata(e);let[i]=await this.batchGetAppConversations([e]);return R(i,e)}static async readConversationFile(e,n){if(o.getActiveBackend().backend.kind===`cloud`)return m.readCloudConversationFile(e,M(n??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let r=await this.resolveConversationWorkingDir(e),i=M(n??`${r}/.agents_tmp/PLAN.md`,r);return new t.FileClient(s.getAgentServerClientOptions()).downloadTextFile(i)}static async downloadConversation(e){return o.getActiveBackend().backend.kind===`cloud`?m.downloadCloudConversation(e):new t.FileClient(s.getAgentServerClientOptions()).downloadTrajectory(e)}static async getHooks(e){return g.emptyHooksResponse()}static async getRuntimeConversation(t,n,r){let a=o.getActiveBackend().backend,c=a.kind===`cloud`&&n?await l.callCloudProxy({backend:a,method:`GET`,hostOverride:i.buildHttpBaseUrl(n),path:`/api/conversations/${t}`,authMode:`session-api-key`,sessionApiKey:r}):await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:n,sessionApiKey:r})).getConversation(t),u=N(c),d=b(c)?c.stats:null;return{id:u.id,title:u.title?.trim()?u.title:g.getDefaultConversationTitle(u.id),metrics:E(u.metrics),created_at:u.created_at,updated_at:u.updated_at,status:L(u.execution_status),stats:b(d)?d:{usage_to_metrics:{}}}}static async searchConversations(t=20,n){return o.getActiveBackend().backend.kind===`cloud`?m.searchCloudConversations(t,n):g.toConversationPage(F(await new e.ConversationClient(s.getAgentServerClientOptions()).searchConversations({limit:t,page_id:n,sort_order:u.ConversationSortOrder.UPDATED_AT_DESC})))}static async deleteConversation(t){o.getActiveBackend().backend.kind===`cloud`?await m.deleteCloudConversation(t):await new e.ConversationClient(s.getAgentServerClientOptions()).deleteConversation(t),p.removeStoredConversationMetadata(t)}static async updateConversationTitle(t,n){await new e.ConversationClient(s.getAgentServerClientOptions()).updateConversation(t,{title:n});let[r]=await this.batchGetAppConversations([t]);return R(r,t)}static async forkConversation(t,n,r){if(o.getActiveBackend().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new e.ConversationClient(s.getAgentServerClientOptions()).forkConversation(t,{from_event_id:n,...r?{title:r}:{}}),a=p.getStoredConversationMetadata(t);return a&&p.setStoredConversationMetadata(i.id,a),i}static async getEventParentId(t,n){return(await new e.ConversationClient(s.getAgentServerClientOptions()).getEvent(t,n)).parent_id??void 0}static async switchProfile(t,r){let{backend:i}=o.getActiveBackend();if(i.kind===`cloud`){if(!t){await f.default.activateProfile(r);return}await l.callCloudProxy({backend:i,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_profile`,body:{profile_name:r}});return}if(!t){await new n.ProfilesClient(s.getAgentServerClientOptions()).activateProfile(r);return}let a=s.getAgentServerClientOptions(),u=new e.ConversationClient(a),d=await new n.ProfilesClient(a).getProfile(r,{exposeSecrets:`encrypted`}),p=typeof d.config.model==`string`?d.config.model:``;if(!p)throw Error(`Profile '${r}' has no model.`);await g.assertSubscriptionAuthReady({llm:d.config}),await u.switchLLM(t,{...d.config,model:p,stream:!0,usage_id:`profile:${r}:${c.default()}`})}static async switchAcpModel(t,n){let{backend:r}=o.getActiveBackend();if(r.kind===`cloud`){await l.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_acp_model`,body:{model:n}});return}await new e.ConversationClient(s.getAgentServerClientOptions()).switchAcpModel(t,n)}};exports.default=z;
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs`),t=require(`../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs`),n=require(`../../node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs`),r=require(`../../node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs`);require(`../../node_modules/@openhands/typescript-client/dist/clients.cjs`);const i=require(`../../utils/websocket-url.cjs`),a=require(`../agent-server-config.cjs`),o=require(`../backend-registry/active-store.cjs`),s=require(`../agent-server-client-options.cjs`),c=require(`../../node_modules/uuid/dist/v4.cjs`),l=require(`../cloud/proxy.cjs`),u=require(`../../node_modules/@openhands/typescript-client/dist/models/conversation.cjs`);require(`../../node_modules/@openhands/typescript-client/dist/index.cjs`);const d=require(`../agent-server-home.cjs`),f=require(`../profiles-service/profiles-service.api.cjs`),p=require(`../conversation-metadata-store.cjs`),m=require(`../cloud/conversation-service.api.cjs`),h=require(`../settings-service/settings-service.api.cjs`),g=require(`../agent-server-adapter.cjs`),_=require(`../../utils/title-llm-profile.cjs`);var v=`1970-01-01T00:00:00.000Z`,y=300*1e3,b=`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.`;function x(){return Error(b)}function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C(e){return typeof e==`number`?e:null}function w(e){return typeof e==`number`?e:0}function T(e){return typeof e==`string`?e:null}function E(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:v}function D(e){return S(e)?{prompt_tokens:w(e.prompt_tokens),completion_tokens:w(e.completion_tokens),cache_read_tokens:w(e.cache_read_tokens),cache_write_tokens:w(e.cache_write_tokens),context_window:w(e.context_window),per_turn_token:w(e.per_turn_token)}:null}function O(e){return S(e)?{accumulated_cost:C(e.accumulated_cost),max_budget_per_task:C(e.max_budget_per_task),accumulated_token_usage:D(e.accumulated_token_usage)}:null}function k(e){if(!S(e))return null;let t=S(e.llm)?{model:T(e.llm.model)}:null;return{kind:T(e.kind),acp_server:T(e.acp_server),acp_model:T(e.acp_model),llm:t}}function A(e){return S(e)?{working_dir:T(e.working_dir)}:null}function j(e){if(!S(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function M(e){if(!S(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function N(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function P(e,t){let n=N(e),r=N(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function F(e){if(!S(e)||typeof e.id!=`string`||!e.id.trim())throw x();return{id:e.id.trim(),title:T(e.title),created_at:E(e,`created_at`,`createdAt`),updated_at:E(e,`updated_at`,`updatedAt`),execution_status:T(e.execution_status),sandbox_status:T(e.sandbox_status),metrics:O(e.metrics),agent:k(e.agent),workspace:A(e.workspace),tags:j(e.tags),launched_agent_profile:M(e.launched_agent_profile),current_model_id:T(e.current_model_id),current_model_name:T(e.current_model_name)}}function I(e){if(!Array.isArray(e))throw x();return e.map(F)}function L(e){if(Array.isArray(e))return{items:I(e),next_page_id:null};if(!S(e))throw x();return{items:I(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var R=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function z(e){let t=e??`idle`;return R.has(t)?t:`idle`}function B(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var V=class{static async sendMessage(t,n,r){let a=o.getActiveBackend().backend,c=r?.conversationUrl??null,u=r?.sessionApiKey??null;if(a.kind===`cloud`){if(!c||!u){let[e]=await m.batchGetCloudConversations([t]);c=e?.conversation_url?.trim()??null,u=e?.session_api_key?.trim()??null}if(!c||!u)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await l.callCloudProxy({backend:a,method:`POST`,hostOverride:i.buildHttpBaseUrl(c),path:`/api/conversations/${t}/events`,body:{...n,run:!0},authMode:`session-api-key`,sessionApiKey:u}),n}return await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:c,sessionApiKey:u})).sendEvent(t,n,{run:!0}),n}static async createConversation(t,n,r,i,l,u,v,b,x,S,C){if(o.getActiveBackend().backend.kind===`cloud`)return m.createCloudAppConversation({initial_message:t?{role:`user`,content:[{type:`text`,text:t}]}:null,title:n??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:r??null,parent_conversation_id:v??null,agent_type:b,sandbox_id:x??null,agent_profile_id:S??null});let[w,T]=await Promise.all([h.default.getSettings(),f.default.listProfiles().catch(()=>void 0)]),E=_.resolveTitleLlmProfile(w.title_llm_profile,T),D=c.default(),O=await d.resolveAbsoluteAgentServerPath(l??a.buildConversationWorkingDir(D)),k=u??(l?`local_repo`:`new_worktree`),A=await g.buildStartConversationRequestWithEncryptedSettings({settings:w,query:t,conversationInstructions:n,plugins:r,conversationId:D,workingDir:O,worktree:k===`new_worktree`,agentProfileId:S,agentProfileKind:C,titleLlmProfile:E}),j=await new e.ConversationClient(s.getAgentServerClientOptions({timeout:y})).createConversation(A),M=o.getEffectiveLocalBackend();if(!M)throw new s.NoBackendAvailableError;return(i?.selected_repository||l)&&p.setStoredConversationMetadata(j.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:l??null,workspace_mode:k}),{id:j.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:j.id,agent_server_url:M.host,request:{initial_message:A.initial_message,plugins:r??null},created_at:j.created_at,updated_at:j.updated_at}}static async getStartTask(e){return o.getActiveBackend().backend.kind===`cloud`?m.getCloudAppConversationStartTask(e):null}static async getVSCodeUrl(e,t,n){let i=await this.resolveConversationWorkingDir(e);return{vscode_url:await new r.VSCodeClient(s.getAgentServerClientOptions({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:i})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??a.getAgentServerWorkingDir()}static async batchGetAppConversations(t){return t.length===0?[]:o.getActiveBackend().backend.kind===`cloud`?m.batchGetCloudConversations(t):I(await new e.ConversationClient(s.getAgentServerClientOptions()).getConversations(t)).map(e=>g.toAppConversation(e))}static async updateConversationPublicFlag(e,t){if(o.getActiveBackend().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return m.updateCloudConversationPublicFlag(e,t)}static async updateConversationRepository(e,t,n,r){t?p.setStoredConversationMetadata(e,{...p.getStoredConversationMetadata(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):p.removeStoredConversationMetadata(e);let[i]=await this.batchGetAppConversations([e]);return B(i,e)}static async readConversationFile(e,n){if(o.getActiveBackend().backend.kind===`cloud`)return m.readCloudConversationFile(e,P(n??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let r=await this.resolveConversationWorkingDir(e),i=P(n??`${r}/.agents_tmp/PLAN.md`,r);return new t.FileClient(s.getAgentServerClientOptions()).downloadTextFile(i)}static async downloadConversation(e){return o.getActiveBackend().backend.kind===`cloud`?m.downloadCloudConversation(e):new t.FileClient(s.getAgentServerClientOptions()).downloadTrajectory(e)}static async getHooks(e){return g.emptyHooksResponse()}static async getRuntimeConversation(t,n,r){let a=o.getActiveBackend().backend,c=a.kind===`cloud`&&n?await l.callCloudProxy({backend:a,method:`GET`,hostOverride:i.buildHttpBaseUrl(n),path:`/api/conversations/${t}`,authMode:`session-api-key`,sessionApiKey:r}):await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:n,sessionApiKey:r})).getConversation(t),u=F(c),d=S(c)?c.stats:null;return{id:u.id,title:u.title?.trim()?u.title:g.getDefaultConversationTitle(u.id),metrics:O(u.metrics),created_at:u.created_at,updated_at:u.updated_at,status:z(u.execution_status),stats:S(d)?d:{usage_to_metrics:{}}}}static async searchConversations(t=20,n){return o.getActiveBackend().backend.kind===`cloud`?m.searchCloudConversations(t,n):g.toConversationPage(L(await new e.ConversationClient(s.getAgentServerClientOptions()).searchConversations({limit:t,page_id:n,sort_order:u.ConversationSortOrder.UPDATED_AT_DESC})))}static async deleteConversation(t){o.getActiveBackend().backend.kind===`cloud`?await m.deleteCloudConversation(t):await new e.ConversationClient(s.getAgentServerClientOptions()).deleteConversation(t),p.removeStoredConversationMetadata(t)}static async updateConversationTitle(t,n){await new e.ConversationClient(s.getAgentServerClientOptions()).updateConversation(t,{title:n});let[r]=await this.batchGetAppConversations([t]);return B(r,t)}static async forkConversation(t,n,r){if(o.getActiveBackend().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new e.ConversationClient(s.getAgentServerClientOptions()).forkConversation(t,{from_event_id:n,...r?{title:r}:{}}),a=p.getStoredConversationMetadata(t);return a&&p.setStoredConversationMetadata(i.id,a),i}static async getEventParentId(t,n){return(await new e.ConversationClient(s.getAgentServerClientOptions()).getEvent(t,n)).parent_id??void 0}static async switchProfile(t,r){let{backend:i}=o.getActiveBackend();if(i.kind===`cloud`){if(!t){await f.default.activateProfile(r);return}await l.callCloudProxy({backend:i,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_profile`,body:{profile_name:r}});return}if(!t){await new n.ProfilesClient(s.getAgentServerClientOptions()).activateProfile(r);return}let a=s.getAgentServerClientOptions(),u=new e.ConversationClient(a),d=await new n.ProfilesClient(a).getProfile(r,{exposeSecrets:`encrypted`}),p=typeof d.config.model==`string`?d.config.model:``;if(!p)throw Error(`Profile '${r}' has no model.`);await g.assertSubscriptionAuthReady({llm:d.config}),await u.switchLLM(t,{...d.config,model:p,stream:!0,usage_id:`profile:${r}:${c.default()}`})}static async switchAcpModel(t,n){let{backend:r}=o.getActiveBackend();if(r.kind===`cloud`){await l.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_acp_model`,body:{model:n}});return}await new e.ConversationClient(s.getAgentServerClientOptions()).switchAcpModel(t,n)}};exports.default=V;
|
|
2
2
|
//# sourceMappingURL=agent-server-conversation-service.api.cjs.map
|