@openhands/agent-canvas 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-BKvmTf82.js → acp-providers-CX3Lh9gj.js} +1 -1
- package/build/assets/active-backend-context-CrHTlgvN.js +2 -0
- package/build/assets/{agent-context-settings-D3PjSTU1.js → agent-context-settings-DSZlXrLj.js} +1 -1
- package/build/assets/{agent-profiles-settings-D4cY5U2T.js → agent-profiles-settings-Dzgb7G9z.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-tnqNjbpE.js +86 -0
- package/build/assets/agent-settings-DLtsqaOs.js +2 -0
- package/build/assets/agent-settings-fFvR-XC2.js +1 -0
- package/build/assets/alert-banner-HP6mX-Vr.js +1 -0
- package/build/assets/{api-error-message-BJyfWp6p.js → api-error-message-B-XdSk3b.js} +1 -1
- package/build/assets/api-key-entry-screen-qTzrmJcr.js +1 -0
- package/build/assets/{app-settings-CbHqzQus.js → app-settings-dbnneVaV.js} +1 -1
- package/build/assets/automation-detail-BmwlCUAB.js +3 -0
- package/build/assets/{automation-export-BRopEHMu.js → automation-export-D3a3of4G.js} +1 -1
- package/build/assets/{automation-git-sync-CzyS4cn1.js → automation-git-sync-CprN5DcU.js} +1 -1
- package/build/assets/automation-setup-route-C40kXjMY.js +1 -0
- package/build/assets/{automation-templates-C_0FZgLG.js → automation-templates-BRppNh99.js} +1 -1
- package/build/assets/automations-list-DuNcRawl.js +1 -0
- package/build/assets/{back-nav-button-Dm9tIjVf.js → back-nav-button-Cjl_hoxq.js} +1 -1
- package/build/assets/backend-form-modal-lhGwzXFI.js +1 -0
- package/build/assets/{backend-synced-settings-badge-3fOwg6Bd.js → backend-synced-settings-badge-DPkz30BE.js} +1 -1
- package/build/assets/{badge-D4SqUCsR.js → badge-BU3S0VtE.js} +1 -1
- package/build/assets/{base-modal-C7_BDl_U.js → base-modal-D_L0oEbG.js} +1 -1
- package/build/assets/{bot-C-0Wu7vQ.js → bot-dMYHVfYM.js} +1 -1
- package/build/assets/{brand-button-Dxv6PDeN.js → brand-button-BAfk4wGP.js} +1 -1
- package/build/assets/browser-DSAo0tz1.js +46 -0
- package/build/assets/{browser-tab-BAl4ckJE.js → browser-tab-C9vy56R5.js} +1 -1
- package/build/assets/canvas-extension-page-dx1gFrfW.js +1 -0
- package/build/assets/canvas-extensions-8A-XhpgP.js +1 -0
- package/build/assets/canvas-extensions-runtime-2_x5Ezmi.js +1 -0
- package/build/assets/{chat-send-button-DWwR2cgI.js → chat-send-button-MUQqCZCS.js} +1 -1
- package/build/assets/check-CS0vmpQQ.js +1 -0
- package/build/assets/chevron-down-e1QBpjVy.js +1 -0
- package/build/assets/chevron-right-ZG4R5G4Q.js +1 -0
- package/build/assets/circle-check-DzWLNsbE.js +1 -0
- package/build/assets/{circle-plus-check-toggle-CBh_qomE.js → circle-plus-check-toggle-BO_kFZt3.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-287iIERo.js → cloud-funnel-analytics-CztBCCPp.js} +1 -1
- package/build/assets/{cog-C4rrw-ZK.js → cog-D-MPQW6G.js} +1 -1
- package/build/assets/command-menu--UIlGL72.js +1 -0
- package/build/assets/{commits-tab-DZtJgaDM.js → commits-tab-AnZwLvh-.js} +1 -1
- package/build/assets/{condenser-settings-BcNmYR4s.js → condenser-settings-DmEOje-7.js} +1 -1
- package/build/assets/{confirmation-modal-Bk4JRcCM.js → confirmation-modal-Dv1ktp8K.js} +1 -1
- package/build/assets/{context-menu-list-item-lVYETtY5.js → context-menu-list-item-I86vKcmM.js} +1 -1
- package/build/assets/conversation-BbGrAO4Z.js +93 -0
- package/build/assets/conversation-mYT6NAoj.js +1 -0
- package/build/assets/conversation-panel-mYT6NAoj.js +1 -0
- package/build/assets/conversation-state-store-B0ImPLHO.js +1 -0
- package/build/assets/{conversation-tab-empty-state-HJtkmHZj.js → conversation-tab-empty-state-FIbh_lc8.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-Cjkswvnj.js → copy-to-clipboard-button-Ca8iSkkA.js} +1 -1
- package/build/assets/{device-verify-EZhHhBT7.js → device-verify-Bhn2e_Ye.js} +1 -1
- package/build/assets/{dropdown-classes-DJe-E6MC.js → dropdown-classes-Bc1djN0-.js} +1 -1
- package/build/assets/{edit-automation-modal-D-urtv8n.js → edit-automation-modal-DadGbJ2u.js} +1 -1
- package/build/assets/empty-state-BoGVDecT.js +1 -0
- package/build/assets/{entry.client-C7Bi2tkU.js → entry.client-CqyPPjOq.js} +2 -2
- package/build/assets/{enum-filter-dropdown-DliX_Lo0.js → enum-filter-dropdown-Bgca129f.js} +1 -1
- package/build/assets/{environment-switch-overlay-CEKrFiMw.js → environment-switch-overlay-BmBRT7gv.js} +1 -1
- package/build/assets/{error-state-BALXiBNy.js → error-state-Body8Ngd.js} +1 -1
- package/build/assets/extensions-hub-CcDqq_vR.js +1 -0
- package/build/assets/extensions-navigation-Cr4yzYk4.js +1 -0
- package/build/assets/{external-link-DFpYunfj.js → external-link-DKUlnCQV.js} +1 -1
- package/build/assets/files-tab-D4o2VyE_.js +1 -0
- package/build/assets/{form-control-classes-CGw40z5h.js → form-control-classes-Bkh5FGrD.js} +1 -1
- package/build/assets/format-model-name-CasAP3nd.js +1 -0
- package/build/assets/get-git-path-ChKDVHZp.js +1 -0
- package/build/assets/{git-repo-dropdown-ai8qaNkD.js → git-repo-dropdown-4ROKl2cB.js} +1 -1
- package/build/assets/git-repo-dropdown-BkqzkMmM.js +1 -0
- package/build/assets/{highlighted-source-view-C3sxykQi.js → highlighted-source-view-BFRxGT_Q.js} +1 -1
- package/build/assets/home-ChpSuepX.js +1 -0
- package/build/assets/home-DIsB440S.js +1 -0
- package/build/assets/home-automation-run-tooltip-BVNDWjAH.js +1 -0
- package/build/assets/home-store-CY9Ej0ux.js +1 -0
- package/build/assets/index-home-BdlrFIif.js +1 -0
- package/build/assets/info-B6RQawoW.js +1 -0
- package/build/assets/install-server-modal-Dpy89p4g.js +1 -0
- package/build/assets/kebab-menu-item-content-D8hSNGmm.js +1 -0
- package/build/assets/{key-Cn5za3rg.js → key-BmVyxs-2.js} +1 -1
- package/build/assets/{launch-C1ieiOGe.js → launch-IrTDEFCs.js} +1 -1
- package/build/assets/list-filter-DsEK7NFC.js +1 -0
- package/build/assets/{list-todo-Cuu-STFc.js → list-todo-apgLVjMw.js} +1 -1
- package/build/assets/llm-not-configured-banner-CIFABh3K.js +27 -0
- package/build/assets/llm-settings-B9juXhIa.js +1 -0
- package/build/assets/llm-settings-De1d5dfr.js +1 -0
- package/build/assets/llm-subscription-service-BpJ0ouQo.js +1 -0
- package/build/assets/loader-circle-CC1au6hc.js +1 -0
- package/build/assets/{loading-spinner-0L3ZTToZ.js → loading-spinner-BY9N3pOe.js} +1 -1
- package/build/assets/manage-backends-modal-BrPV3oB-.js +1 -0
- package/build/assets/manifest-80fb1c29.js +1 -0
- package/build/assets/{manifest-subpage-layout-BGhiUQbA.js → manifest-subpage-layout-CAOYzrYp.js} +1 -1
- package/build/assets/{map-provider-B9LTm23I.js → map-provider-Cu3Zgumb.js} +1 -1
- package/build/assets/markdown-renderer-BzTlxI8x.js +8 -0
- package/build/assets/{mcp-CKbR4Vft.js → mcp-BTs_SXfZ.js} +1 -1
- package/build/assets/{mcp-marketplace-utils-C13fFccR.js → mcp-marketplace-utils-AIBzzHTO.js} +1 -1
- package/build/assets/{mcp-page-Bm4K2NQq.js → mcp-page-BEBYqH_K.js} +2 -2
- package/build/assets/messages-DKV9cRc2.js +41 -0
- package/build/assets/{modal-body-CMOc2tLl.js → modal-body-BxZjsju9.js} +1 -1
- package/build/assets/{modal-classes-BAb4Y_BG.js → modal-classes-C8eycCwG.js} +1 -1
- package/build/assets/{modal-close-button-CkJ0Ktjj.js → modal-close-button-DDzdRvCs.js} +1 -1
- package/build/assets/{mouse-pointer-click-CsgRs_-r.js → mouse-pointer-click-Co2uyaPA.js} +1 -1
- package/build/assets/onboarding-DV_OXoeP.js +1 -0
- package/build/assets/onboarding-modal-rkyBYkeQ.js +1 -0
- package/build/assets/{organization-service.api-C8XpQ0pM.js → organization-service.api-DrYNkEN_.js} +1 -1
- package/build/assets/{pencil-Clh1Wjvh.js → pencil-47jAZH_V.js} +1 -1
- package/build/assets/pin-By41Vl5J.js +1 -0
- package/build/assets/{planner-tab-DQvDU3ap.js → planner-tab-C9uZmhme.js} +1 -1
- package/build/assets/{plug-BuQhHSSG.js → plug-CG5HFcNG.js} +1 -1
- package/build/assets/plugins-management-service-BMJgC3Ga.js +1 -0
- package/build/assets/plus-C7Slq-0I.js +1 -0
- package/build/assets/profiles-service.api-ChoKrL0l.js +1 -0
- package/build/assets/providers-BhMcY5nv.js +1 -0
- package/build/assets/proxy-9Fe1v5na.js +1 -0
- package/build/assets/{puzzle-A9pGxxai.js → puzzle-JM_QaRm0.js} +1 -1
- package/build/assets/recommended-automations-launcher-6ABrI9Cy.js +1 -0
- package/build/assets/{refresh-cw-Bh69DyYO.js → refresh-cw-3q3Frrii.js} +1 -1
- package/build/assets/root-Dc8YmC9F.js +2 -0
- package/build/assets/root-VDaypvK4.css +1 -0
- package/build/assets/root-layout-CXkhSPYh.js +2 -0
- package/build/assets/schema-field-D-y9-LDb.js +1 -0
- package/build/assets/{sdk-section-page-HTffvm7Q.js → sdk-section-page-BlFiizlG.js} +1 -1
- package/build/assets/{secret-form-HTUbYw5o.js → secret-form-BB7the8W.js} +1 -1
- package/build/assets/secrets-service-ByZVENbp.js +1 -0
- package/build/assets/{secrets-settings-BizaTEr1.js → secrets-settings-B_GpxKW2.js} +1 -1
- package/build/assets/{settings-BlmrkwRi.js → settings-C0EWuBtA.js} +1 -1
- package/build/assets/settings-CKqk8ZnH.js +1 -0
- package/build/assets/{settings-dropdown-input-tM0A0ipy.js → settings-dropdown-input-BcwylHs2.js} +1 -1
- package/build/assets/{settings-index-CKq0b0Vg.js → settings-index-5w5UW2K3.js} +1 -1
- package/build/assets/{settings-input-C03KUoSC.js → settings-input-Db-1g8Ql.js} +1 -1
- package/build/assets/{settings-list-classes-BJ0g8rWj.js → settings-list-classes-BzeSZbF2.js} +1 -1
- package/build/assets/{settings-modal-AzEF1QPP.js → settings-modal-DfJ3tcJQ.js} +1 -1
- package/build/assets/settings-service.api-DJ1r62Zr.js +1 -0
- package/build/assets/{settings-switch-CQE0EGC-.js → settings-switch-CS-dJDmA.js} +1 -1
- package/build/assets/{settings-utils-ClYOkbbI.js → settings-utils-UYpEdPuD.js} +1 -1
- package/build/assets/shared-conversation-CA5ISEDy.js +1 -0
- package/build/assets/{shield-check-CFDViW82.js → shield-check-D2aCRd16.js} +1 -1
- package/build/assets/{sidebar-layout-D3hE08wK.js → sidebar-layout-D6fS8-Gl.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-BOtyJHwE.js → sidebar-mobile-menu-toggle-C_fb0Jki.js} +1 -1
- package/build/assets/sidebar-nav-link-DQQcMf1A.js +1 -0
- package/build/assets/{sidebar-onboarding-checklist-storage-3qYflszY.js → sidebar-onboarding-checklist-storage-BBkeI6Bp.js} +1 -1
- package/build/assets/sidebar-store-DGqHkVLw.js +1 -0
- package/build/assets/{skill-card-pill-row-CFxjoqxn.js → skill-card-pill-row-B27-xyig.js} +1 -1
- package/build/assets/skill-enablement-DXeaImBz.js +1 -0
- package/build/assets/skill-filter-w__3UCEE.js +2 -0
- package/build/assets/{skill-icon-badge-CPQJ6A-I.js → skill-icon-badge-RQkq8wvl.js} +1 -1
- package/build/assets/skill-scope-B42H-XOc.js +1 -0
- package/build/assets/skills-plugins-tgF8EiXC.js +1 -0
- package/build/assets/skills-settings-BgJ9PaOe.js +1 -0
- package/build/assets/{styled-tooltip-Dl06rkpY.js → styled-tooltip-C4jf5Fv9.js} +1 -1
- package/build/assets/{task-list-tab-04GNQuii.js → task-list-tab-C5zcaktH.js} +1 -1
- package/build/assets/{terminal-Cj0iHIW7.js → terminal-CNElN42a.js} +2 -2
- package/build/assets/{toggle-switch-Fd_QGz0r.js → toggle-switch-ChOLXv2n.js} +1 -1
- package/build/assets/{trash-2-Dl8_RGz0.js → trash-2-D7K26eDO.js} +1 -1
- package/build/assets/{trash-_RMt7Ayc.js → trash-D-HYiVYM.js} +1 -1
- package/build/assets/{triangle-alert-SM-q4NU_.js → triangle-alert-CtdXWHUI.js} +1 -1
- package/build/assets/{typography-SgFy466J.js → typography-v1KN0tzi.js} +1 -1
- package/build/assets/usage-tab-CVDffLPt.js +1 -0
- package/build/assets/use-acp-credential-form-XIQmpX6M.js +1 -0
- package/build/assets/{use-activate-agent-profile-B2NS8nA5.js → use-activate-agent-profile-BLfmvDiG.js} +1 -1
- package/build/assets/use-agent-profiles-Bd9Bvvp1.js +1 -0
- package/build/assets/{use-automation-health-BxXdzZMP.js → use-automation-health-E6NZi9rb.js} +1 -1
- package/build/assets/{use-automations-zYb0dUny.js → use-automations-xijQKIl9.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BWMahtUh.js → use-can-manage-org-profiles-CrJP5262.js} +1 -1
- package/build/assets/use-canvas-extensions-Bi693ujJ.js +1 -0
- package/build/assets/{use-cloud-current-user-id-CPHMDG-C.js → use-cloud-current-user-id-CDfAHpPX.js} +1 -1
- package/build/assets/use-config-A9QovgXO.js +1 -0
- package/build/assets/{use-create-conversation-DwN5vv2f.js → use-create-conversation-Dx3l7mFZ.js} +1 -1
- package/build/assets/use-create-secret-B9cUFWRG.js +1 -0
- package/build/assets/{use-get-secrets-BT4ihRwj.js → use-get-secrets-K3jmk-LH.js} +1 -1
- package/build/assets/use-is-authed-nTBcM7dE.js +1 -0
- package/build/assets/use-llm-configured-BV9nZ1_j.js +1 -0
- package/build/assets/use-llm-profiles-BO-P4Oyo.js +1 -0
- package/build/assets/use-manifest-capabilities-Cw_flwEz.js +1 -0
- package/build/assets/use-onboarding-completion-D8U7k4Qb.js +1 -0
- package/build/assets/use-pinned-home-route-CckOZrmb.js +1 -0
- package/build/assets/use-plugins-marketplace-7i94Zu3Z.js +1 -0
- package/build/assets/use-save-agent-profile-BUjSsDXK.js +1 -0
- package/build/assets/{use-save-settings-CUZW6yXP.js → use-save-settings-DYqkKv7T.js} +1 -1
- package/build/assets/{use-settings-C5VhGpqd.js → use-settings-DSXLbvBl.js} +1 -1
- package/build/assets/{use-settings-nav-items-DHaUu1Dg.js → use-settings-nav-items-CwRw-CmX.js} +1 -1
- package/build/assets/use-tracking-D53y3TH9.js +3 -0
- package/build/assets/{use-user-conversation-DT0_QCnL.js → use-user-conversation-B9Gebw_g.js} +1 -1
- package/build/assets/{useInfiniteQuery-CgeUQPfs.js → useInfiniteQuery-C926xzY4.js} +1 -1
- package/build/assets/{useMutation-DFnzkf6f.js → useMutation-B-qc391N.js} +1 -1
- package/build/assets/{useQueries-BhbrGEf1.js → useQueries-DlbhlH9I.js} +1 -1
- package/build/assets/{useQuery-BXWbZBZl.js → useQuery-BSTgq1rl.js} +1 -1
- package/build/assets/utils-CN5ZfZy1.js +1 -0
- package/build/assets/{vendor~conversation-panel~conversation-CTvDDiXg.js → vendor~conversation-panel~conversation-C8Fn4XOf.js} +1 -1
- package/build/assets/{vendor~entry.client-BFE7Llz9.js → vendor~entry.client-CoCfUXUF.js} +1 -1
- package/build/assets/{vendor~entry.client-BaKt_PIp.js → vendor~entry.client-DA2izTjq.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kepq2zme-ZixYGy6E.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-DqZDXfg2.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-BTyukeM-.js → vendor~index-home~home~conversation-panel~conversation-hWywRBaR.js} +1 -1
- package/build/assets/{vendor~root-layout-BlUaZ18v.js → vendor~root-layout-C9Ju9DQg.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-BYAWJwQX.js → vendor~root-layout~conversation-panel~conversation-BMbMgaGu.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-CHaLEBVR.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BWir3rJs.js} +1 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-j5MFqfSy.js +1 -0
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-cDuKr-WD.js +1 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz-MAyNb.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-Dtu7BpYk.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~nj1hli3r-DP9wmsjo.js} +2 -2
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-DonTKfQD.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-CUmIwQCN.js} +117 -13
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BgxDvUcf.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js} +42 -3
- package/build/assets/{verification-settings-Bj6bo097.js → verification-settings-gw_q6vkL.js} +1 -1
- package/build/assets/{wrench-hi7Q13dF.js → wrench-CUEI1krB.js} +1 -1
- package/build/assets/{x-DkgltWa0.js → x-DJdhbdmt.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +32 -16
- package/build/locales/ca/openhands.json +32 -16
- package/build/locales/de/openhands.json +32 -16
- package/build/locales/en/openhands.json +32 -16
- package/build/locales/es/openhands.json +32 -16
- package/build/locales/fr/openhands.json +32 -16
- package/build/locales/it/openhands.json +32 -16
- package/build/locales/ja/openhands.json +32 -16
- package/build/locales/ko-KR/openhands.json +32 -16
- package/build/locales/no/openhands.json +32 -16
- package/build/locales/pt/openhands.json +32 -16
- package/build/locales/tr/openhands.json +32 -16
- package/build/locales/uk/openhands.json +32 -16
- package/build/locales/zh-CN/openhands.json +32 -16
- package/build/locales/zh-TW/openhands.json +32 -16
- package/config/defaults.json +9 -5
- package/dist/api/agent-profiles-service/profile-field-support.d.ts +26 -0
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.js +118 -116
- 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 +21 -0
- package/dist/api/agent-server-compatibility.js +52 -38
- 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.d.ts +26 -0
- package/dist/api/agent-server-config.js +18 -5
- package/dist/api/agent-server-config.js.map +1 -1
- package/dist/api/canvas-extensions-service.cjs +1 -0
- package/dist/api/canvas-extensions-service.d.ts +22 -0
- package/dist/api/canvas-extensions-service.js +4 -0
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
- package/dist/api/cloud/conversation-service.api.d.ts +6 -0
- package/dist/api/cloud/conversation-service.api.js +14 -6
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/conversation-file-upload.api.cjs +1 -1
- package/dist/api/conversation-file-upload.api.js +10 -10
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +11 -0
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +129 -118
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.js +12 -12
- package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
- package/dist/api/git-service/agent-server-git-service.api.js +8 -8
- package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
- package/dist/api/runtime-service/agent-server-runtime-service.js +8 -8
- 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 +3 -2
- package/dist/api/settings-service/settings-service.api.js +2 -1
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/event-group.cjs +1 -1
- package/dist/components/conversation-events/chat/event-message-components/event-group.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/event-group.js +40 -36
- package/dist/components/conversation-events/chat/event-message-components/event-group.js.map +1 -1
- package/dist/components/features/automations/automation-card.cjs +1 -1
- package/dist/components/features/automations/automation-card.cjs.map +1 -1
- package/dist/components/features/automations/automation-card.js +114 -104
- package/dist/components/features/automations/automation-card.js.map +1 -1
- package/dist/components/features/automations/detail/run-phase.cjs +2 -0
- package/dist/components/features/automations/detail/run-phase.cjs.map +1 -0
- package/dist/components/features/automations/detail/run-phase.d.ts +89 -0
- package/dist/components/features/automations/detail/run-phase.js +72 -0
- package/dist/components/features/automations/detail/run-phase.js.map +1 -0
- 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.js +5 -11
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/canvas-extensions/add-canvas-extension-modal.d.ts +6 -0
- package/dist/components/features/canvas-extensions/canvas-extension-card.d.ts +9 -0
- package/dist/components/features/canvas-extensions/canvas-extensions-runtime.cjs +2 -0
- package/dist/components/features/canvas-extensions/canvas-extensions-runtime.cjs.map +1 -0
- package/dist/components/features/canvas-extensions/canvas-extensions-runtime.d.ts +23 -0
- package/dist/components/features/canvas-extensions/canvas-extensions-runtime.js +19 -0
- package/dist/components/features/canvas-extensions/canvas-extensions-runtime.js.map +1 -0
- 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 +171 -168
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/chat-markdown-path-code.cjs +3 -0
- package/dist/components/features/chat/chat-markdown-path-code.cjs.map +1 -0
- package/dist/components/features/chat/chat-markdown-path-code.d.ts +27 -0
- package/dist/components/features/chat/chat-markdown-path-code.js +72 -0
- package/dist/components/features/chat/chat-markdown-path-code.js.map +1 -0
- package/dist/components/features/chat/path-component.cjs +1 -1
- package/dist/components/features/chat/path-component.cjs.map +1 -1
- package/dist/components/features/chat/path-component.d.ts +8 -2
- package/dist/components/features/chat/path-component.js +33 -21
- package/dist/components/features/chat/path-component.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +38 -43
- package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +8 -5
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +22 -16
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
- package/dist/components/features/chat/user-message-body.cjs +1 -1
- package/dist/components/features/chat/user-message-body.cjs.map +1 -1
- package/dist/components/features/chat/user-message-body.d.ts +4 -0
- package/dist/components/features/chat/user-message-body.js +30 -24
- package/dist/components/features/chat/user-message-body.js.map +1 -1
- package/dist/components/features/conversation/conversation-overview-skills-panel.cjs +1 -1
- package/dist/components/features/conversation/conversation-overview-skills-panel.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-overview-skills-panel.js +63 -81
- package/dist/components/features/conversation/conversation-overview-skills-panel.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +50 -50
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.js +3 -3
- package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.js.map +1 -1
- package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
- package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
- package/dist/components/features/conversation-panel/skills-modal.js +29 -28
- package/dist/components/features/conversation-panel/skills-modal.js.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
- package/dist/components/features/files-tab/file-content-viewer.js +5 -5
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +51 -29
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
- package/dist/components/features/onboarding/onboarding-host.d.ts +3 -4
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +5 -9
- package/dist/components/features/settings/acp-auth-status-banner.d.ts +23 -6
- 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 -0
- package/dist/components/features/settings/llm-profiles/provider-connection-modal.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/provider-connection-modal.js +3 -0
- package/dist/components/features/settings/sdk-settings/field-help.cjs +1 -1
- package/dist/components/features/settings/sdk-settings/field-help.cjs.map +1 -1
- package/dist/components/features/settings/sdk-settings/field-help.d.ts +1 -1
- package/dist/components/features/settings/sdk-settings/field-help.js +1 -1
- package/dist/components/features/settings/sdk-settings/field-help.js.map +1 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs +1 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.js +6 -6
- package/dist/components/features/settings/sdk-settings/sdk-section-page.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-nav-link.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-nav-link.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-nav-link.d.ts +10 -1
- package/dist/components/features/sidebar/sidebar-nav-link.js +54 -36
- package/dist/components/features/sidebar/sidebar-nav-link.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +143 -120
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +1 -1
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/components/features/skills/build-skill-pills.cjs +1 -1
- package/dist/components/features/skills/build-skill-pills.cjs.map +1 -1
- package/dist/components/features/skills/build-skill-pills.js +60 -52
- package/dist/components/features/skills/build-skill-pills.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 -43
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/components/features/skills/skill-filter.cjs +1 -1
- package/dist/components/features/skills/skill-filter.cjs.map +1 -1
- package/dist/components/features/skills/skill-filter.d.ts +8 -3
- package/dist/components/features/skills/skill-filter.js +69 -52
- package/dist/components/features/skills/skill-filter.js.map +1 -1
- package/dist/components/shared/modals/settings/settings-form.cjs +1 -1
- package/dist/components/shared/modals/settings/settings-form.js +8 -8
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +9 -5
- package/dist/config/defaults.js.map +1 -1
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +5 -5
- package/dist/extensions/canvas-extension-module-loader.d.ts +11 -0
- package/dist/hooks/mutation/use-manage-canvas-extensions.d.ts +12 -0
- package/dist/hooks/query/concurrency-limiter.cjs +2 -0
- package/dist/hooks/query/concurrency-limiter.cjs.map +1 -0
- package/dist/hooks/query/concurrency-limiter.d.ts +22 -0
- package/dist/hooks/query/concurrency-limiter.js +29 -0
- package/dist/hooks/query/concurrency-limiter.js.map +1 -0
- 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.map +1 -1
- package/dist/hooks/query/use-active-conversation.cjs +1 -1
- package/dist/hooks/query/use-active-conversation.js +4 -4
- package/dist/hooks/query/use-automations.cjs.map +1 -1
- package/dist/hooks/query/use-automations.js.map +1 -1
- package/dist/hooks/query/use-backends-health.cjs +1 -1
- package/dist/hooks/query/use-backends-health.cjs.map +1 -1
- package/dist/hooks/query/use-backends-health.d.ts +1 -1
- package/dist/hooks/query/use-backends-health.js +50 -64
- package/dist/hooks/query/use-backends-health.js.map +1 -1
- package/dist/hooks/query/use-canvas-extensions.cjs +1 -0
- package/dist/hooks/query/use-canvas-extensions.d.ts +5 -0
- package/dist/hooks/query/use-canvas-extensions.js +3 -0
- package/dist/hooks/query/use-commit-changes.cjs +1 -1
- package/dist/hooks/query/use-commit-changes.js +4 -4
- package/dist/hooks/query/use-latest-automation-runs.cjs +1 -1
- package/dist/hooks/query/use-latest-automation-runs.js +1 -0
- package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
- package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
- package/dist/hooks/query/use-paginated-conversations.js +19 -16
- package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
- package/dist/hooks/query/use-search-providers.cjs +1 -1
- package/dist/hooks/query/use-search-providers.cjs.map +1 -1
- package/dist/hooks/query/use-search-providers.js +17 -10
- package/dist/hooks/query/use-search-providers.js.map +1 -1
- package/dist/hooks/query/use-unified-get-git-changes.cjs +1 -1
- package/dist/hooks/query/use-unified-get-git-changes.js +4 -4
- package/dist/hooks/query/use-unified-git-commits.cjs +1 -1
- package/dist/hooks/query/use-unified-git-commits.js +4 -4
- package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
- package/dist/hooks/query/use-unified-git-diff.js +4 -4
- package/dist/hooks/query/use-unified-vscode-url.cjs +1 -1
- package/dist/hooks/query/use-unified-vscode-url.cjs.map +1 -1
- package/dist/hooks/query/use-unified-vscode-url.d.ts +1 -0
- package/dist/hooks/query/use-unified-vscode-url.js +40 -26
- package/dist/hooks/query/use-unified-vscode-url.js.map +1 -1
- package/dist/hooks/query/use-workspace-file-content.cjs +1 -1
- package/dist/hooks/query/use-workspace-file-content.js +5 -5
- package/dist/hooks/query/use-workspace-files.cjs +1 -1
- package/dist/hooks/query/use-workspace-files.js +6 -6
- package/dist/hooks/use-acp-credential-form.d.ts +6 -0
- package/dist/hooks/use-conversation-overview-git-diff-stats.cjs +1 -1
- package/dist/hooks/use-conversation-overview-git-diff-stats.js +4 -4
- package/dist/hooks/use-pinned-home-route.cjs +2 -0
- package/dist/hooks/use-pinned-home-route.cjs.map +1 -0
- package/dist/hooks/use-pinned-home-route.d.ts +33 -0
- package/dist/hooks/use-pinned-home-route.js +34 -0
- package/dist/hooks/use-pinned-home-route.js.map +1 -0
- package/dist/hooks/use-skill-enablement.cjs +2 -0
- package/dist/hooks/use-skill-enablement.cjs.map +1 -0
- package/dist/hooks/use-skill-enablement.d.ts +14 -0
- package/dist/hooks/use-skill-enablement.js +80 -0
- package/dist/hooks/use-skill-enablement.js.map +1 -0
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +29 -13
- 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 +538 -266
- package/dist/i18n/translation.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -14
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +1 -0
- package/dist/locales/ar/openhands.json +32 -16
- package/dist/locales/ca/openhands.json +32 -16
- package/dist/locales/de/openhands.json +32 -16
- package/dist/locales/en/openhands.json +32 -16
- package/dist/locales/es/openhands.json +32 -16
- package/dist/locales/fr/openhands.json +32 -16
- package/dist/locales/it/openhands.json +32 -16
- package/dist/locales/ja/openhands.json +32 -16
- package/dist/locales/ko-KR/openhands.json +32 -16
- package/dist/locales/no/openhands.json +32 -16
- package/dist/locales/pt/openhands.json +32 -16
- package/dist/locales/tr/openhands.json +32 -16
- package/dist/locales/uk/openhands.json +32 -16
- package/dist/locales/zh-CN/openhands.json +32 -16
- package/dist/locales/zh-TW/openhands.json +32 -16
- package/dist/manifests/automation-interface.cjs +1 -1
- package/dist/manifests/automation-interface.cjs.map +1 -1
- package/dist/manifests/automation-interface.d.ts +6 -0
- package/dist/manifests/automation-interface.js +11 -8
- package/dist/manifests/automation-interface.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +45 -4
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +5 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +5 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +5 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +5 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.js +21 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.js +21 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.js +21 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.js +21 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.js +21 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.js +5 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs +30 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js +65 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +21 -9
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +2 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js +40 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js.map +1 -0
- 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 +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -1
- 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 -72
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +42 -3
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +22 -3
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.js +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js +8 -7
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.js +2 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/blocks.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/blocks.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/blocks.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/blocks.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +10 -0
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +7 -7
- package/dist/routes/files-tab.cjs +1 -1
- package/dist/routes/files-tab.cjs.map +1 -1
- package/dist/routes/files-tab.js +14 -14
- package/dist/routes/files-tab.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +122 -114
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/services/canvas-ui.cjs +1 -1
- package/dist/services/canvas-ui.cjs.map +1 -1
- package/dist/services/canvas-ui.d.ts +5 -0
- package/dist/services/canvas-ui.js +24 -10
- package/dist/services/canvas-ui.js.map +1 -1
- package/dist/services/settings.cjs +1 -1
- package/dist/services/settings.cjs.map +1 -1
- package/dist/services/settings.js +3 -2
- package/dist/services/settings.js.map +1 -1
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +20 -0
- package/dist/types/automation.js.map +1 -1
- package/dist/types/canvas-extension.cjs +2 -0
- package/dist/types/canvas-extension.cjs.map +1 -0
- package/dist/types/canvas-extension.d.ts +77 -0
- package/dist/types/canvas-extension.js +6 -0
- package/dist/types/canvas-extension.js.map +1 -0
- package/dist/types/settings.d.ts +7 -0
- package/dist/ui/help-link.cjs +1 -1
- package/dist/ui/help-link.cjs.map +1 -1
- package/dist/ui/help-link.d.ts +6 -1
- package/dist/ui/help-link.js +32 -18
- package/dist/ui/help-link.js.map +1 -1
- package/dist/utils/acp-auth-display.d.ts +35 -0
- package/dist/utils/cache-utils.cjs +1 -1
- package/dist/utils/cache-utils.js +5 -5
- package/dist/utils/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +7 -3
- package/dist/utils/format-model-name.js +6 -11
- package/dist/utils/format-model-name.js.map +1 -1
- package/dist/utils/format-relative-time.cjs +1 -1
- package/dist/utils/format-relative-time.cjs.map +1 -1
- package/dist/utils/format-relative-time.d.ts +7 -0
- package/dist/utils/format-relative-time.js +7 -2
- package/dist/utils/format-relative-time.js.map +1 -1
- package/dist/utils/path-utils.cjs +1 -1
- package/dist/utils/path-utils.cjs.map +1 -1
- package/dist/utils/path-utils.d.ts +15 -3
- package/dist/utils/path-utils.js +29 -3
- package/dist/utils/path-utils.js.map +1 -1
- package/dist/utils/skill-enablement.cjs +2 -0
- package/dist/utils/skill-enablement.cjs.map +1 -0
- package/dist/utils/skill-enablement.d.ts +51 -0
- package/dist/utils/skill-enablement.js +31 -0
- package/dist/utils/skill-enablement.js.map +1 -0
- package/dist/utils/vscode-origin.cjs +2 -0
- package/dist/utils/vscode-origin.cjs.map +1 -0
- package/dist/utils/vscode-origin.d.ts +55 -0
- package/dist/utils/vscode-origin.js +27 -0
- package/dist/utils/vscode-origin.js.map +1 -0
- package/dist/utils/workspace-mode.d.ts +4 -0
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +1 -0
- package/scripts/dev-extra-backend.mjs +28 -9
- package/scripts/dev-safe.mjs +81 -8
- package/scripts/dev-static.mjs +35 -37
- package/scripts/dev-with-automation.mjs +82 -1
- package/scripts/ingress.mjs +27 -1
- package/scripts/static-server.mjs +74 -1
- package/tools/canvas_ui_tool.py +19 -0
- package/build/assets/active-backend-context-DKFSMbn3.js +0 -2
- package/build/assets/agent-server-conversation-service.api-DozDKIW_.js +0 -86
- package/build/assets/agent-settings-351vXWc9.js +0 -2
- package/build/assets/agent-settings-Ce7BDZ6I.js +0 -1
- package/build/assets/alert-banner-Kyy1YWZU.js +0 -1
- package/build/assets/api-key-entry-screen-INIxqAMs.js +0 -1
- package/build/assets/automation-detail-DXDhUwPq.js +0 -3
- package/build/assets/automation-setup-route-FRr05f_g.js +0 -1
- package/build/assets/automations-list-CERuQWE6.js +0 -1
- package/build/assets/backend-form-modal-DK78-jn1.js +0 -1
- package/build/assets/browser-11etCQ04.js +0 -7
- package/build/assets/check-Cf2YoT90.js +0 -1
- package/build/assets/chevron-down-C3OQ-ehx.js +0 -1
- package/build/assets/chevron-right-CN1uUiJ1.js +0 -1
- package/build/assets/circle-check-g5yeGMd-.js +0 -1
- package/build/assets/command-menu-BZQ8S3Ke.js +0 -1
- package/build/assets/conversation-CchMzpGl.js +0 -1
- package/build/assets/conversation-Dpzftz57.js +0 -93
- package/build/assets/conversation-panel-CchMzpGl.js +0 -1
- package/build/assets/conversation-state-store-a9d2fxRc.js +0 -1
- package/build/assets/empty-state-CvaVahVr.js +0 -1
- package/build/assets/extensions-hub-CFduxBnk.js +0 -1
- package/build/assets/extensions-navigation-BeC224yX.js +0 -1
- package/build/assets/files-tab-CL3J9b3p.js +0 -1
- package/build/assets/format-model-name-BNPKVsIq.js +0 -1
- package/build/assets/get-git-path-DlAJa_i6.js +0 -1
- package/build/assets/git-repo-dropdown-DGMEhz7d.js +0 -1
- package/build/assets/home-BCGlNJCA.js +0 -1
- package/build/assets/home-DB1pRqTC.js +0 -1
- package/build/assets/home-automation-run-tooltip-CooFQRIG.js +0 -1
- package/build/assets/home-store-Dl1dPE58.js +0 -1
- package/build/assets/index-home-DB1pRqTC.js +0 -1
- package/build/assets/info-uYSVzX86.js +0 -1
- package/build/assets/install-server-modal-BbJdhzet.js +0 -1
- package/build/assets/kebab-menu-item-content-BYokkRHi.js +0 -1
- package/build/assets/list-filter-OFkpRrmi.js +0 -1
- package/build/assets/llm-not-configured-banner-BqqYnJ1t.js +0 -27
- package/build/assets/llm-settings-CnDbbmVW.js +0 -1
- package/build/assets/llm-settings-S8Yjg__1.js +0 -1
- package/build/assets/llm-subscription-service-BpPfzW4x.js +0 -1
- package/build/assets/loader-circle-nvrwthvj.js +0 -1
- package/build/assets/manage-backends-modal-BCUPswyl.js +0 -1
- package/build/assets/manifest-58597dde.js +0 -1
- package/build/assets/markdown-renderer-Cb2sBWtV.js +0 -8
- package/build/assets/messages-BTN5thLe.js +0 -40
- package/build/assets/onboarding-Cx_kaiD1.js +0 -1
- package/build/assets/onboarding-modal-vMwn7ihv.js +0 -1
- package/build/assets/plugins-management-service-BjYeF0b0.js +0 -1
- package/build/assets/plus-CEKne-Yp.js +0 -1
- package/build/assets/profiles-service.api-QB-T_u-g.js +0 -1
- package/build/assets/providers-FfSZ5TXP.js +0 -1
- package/build/assets/proxy-tcFL2yTQ.js +0 -1
- package/build/assets/recommended-automations-launcher-Bw8uC4V6.js +0 -1
- package/build/assets/root-BLeQfBEq.css +0 -1
- package/build/assets/root-ZKKYPR1Z.js +0 -2
- package/build/assets/root-layout-luJoE9IG.js +0 -2
- package/build/assets/schema-field-Csw5fhtN.js +0 -1
- package/build/assets/secrets-service-BTor9uAU.js +0 -1
- package/build/assets/settings-DcNPxz0v.js +0 -1
- package/build/assets/settings-service.api-B2agVfjL.js +0 -1
- package/build/assets/shared-conversation-B55pCyBG.js +0 -1
- package/build/assets/sidebar-nav-link-CPzhyHQg.js +0 -1
- package/build/assets/sidebar-store-DtpU7zaI.js +0 -1
- package/build/assets/skill-filter-CWZ5kjcg.js +0 -2
- package/build/assets/skill-scope-CV1dkAbW.js +0 -1
- package/build/assets/skills-plugins-DGHULTq6.js +0 -1
- package/build/assets/skills-settings-CM1lFv3e.js +0 -1
- package/build/assets/usage-tab-BcfWV6db.js +0 -1
- package/build/assets/use-acp-credential-form-BsSW5NHG.js +0 -1
- package/build/assets/use-agent-profiles-DWBPC0Si.js +0 -1
- package/build/assets/use-config-Bft35DOK.js +0 -1
- package/build/assets/use-create-secret-BSxJMxHp.js +0 -1
- package/build/assets/use-is-authed-CFGkY3-Z.js +0 -1
- package/build/assets/use-llm-configured-BI6obxsc.js +0 -1
- package/build/assets/use-llm-profiles-djGAhTWL.js +0 -1
- package/build/assets/use-manifest-capabilities-3z0-1G59.js +0 -1
- package/build/assets/use-onboarding-completion-BXpyUSsJ.js +0 -1
- package/build/assets/use-plugins-marketplace-DI4_pK56.js +0 -1
- package/build/assets/use-save-agent-profile-DdBSTdpN.js +0 -1
- package/build/assets/use-tracking-D5t9otIF.js +0 -3
- package/build/assets/utils-DaCIEEQP.js +0 -1
- package/build/assets/vendor~index-home~home~conversation-panel~conversation~alert-banner-B3qC_oj8.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-B2OLKL7N.js +0 -1
- package/dist/components/features/tips/random-tip.d.ts +0 -2
- package/dist/utils/tips.d.ts +0 -7
- package/dist/utils/workspace-relative-path.cjs +0 -2
- package/dist/utils/workspace-relative-path.cjs.map +0 -1
- package/dist/utils/workspace-relative-path.d.ts +0 -10
- package/dist/utils/workspace-relative-path.js +0 -22
- package/dist/utils/workspace-relative-path.js.map +0 -1
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew3u153i-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-rfV8mQ9m.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ox0jfsa0-cHFhpUBq.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-conversation-service.api.js","names":[],"sources":["../../../src/api/conversation-service/agent-server-conversation-service.api.ts"],"sourcesContent":["import {\n ConversationSortOrder,\n type ForkConversationRequest,\n type LLMConfig,\n} from \"@openhands/typescript-client\";\nimport {\n ConversationClient,\n FileClient,\n ProfilesClient,\n VSCodeClient,\n} from \"@openhands/typescript-client/clients\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AgentKind, Provider } from \"#/types/settings\";\nimport type { ConversationRuntimeContext } from \"#/api/conversation-file-upload.api\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport {\n buildConversationWorkingDir,\n getAgentServerWorkingDir,\n} from \"../agent-server-config\";\nimport { resolveAbsoluteAgentServerPath } from \"../agent-server-home\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport ProfilesService from \"../profiles-service/profiles-service.api\";\nimport {\n batchGetCloudConversations,\n createCloudAppConversation,\n deleteCloudConversation,\n downloadCloudConversation,\n getCloudAppConversationStartTask,\n readCloudConversationFile,\n searchCloudConversations,\n updateCloudConversationPublicFlag,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n emptyHooksResponse,\n getDefaultConversationTitle,\n toAppConversation,\n toConversationPage,\n} from \"../agent-server-adapter\";\nimport { GetVSCodeUrlResponse } from \"../open-hands.types\";\nimport {\n getAgentServerClientOptions,\n NoBackendAvailableError,\n} from \"../agent-server-client-options\";\nimport SettingsService from \"../settings-service/settings-service.api\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport { resolveTitleLlmProfile } from \"#/utils/title-llm-profile\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n RuntimeConversationStats,\n SendMessageRequest,\n SendMessageResponse,\n} from \"./agent-server-conversation-service.types\";\n\nconst DEFAULT_CONVERSATION_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\n// Creating the first conversation right after a cold agent-server boot (fresh\n// machine or the packaged desktop app, where uvx may still be warming caches)\n// can exceed the client's 60s default timeout.\nconst CREATE_CONVERSATION_TIMEOUT_MS = 5 * 60 * 1000;\nconst INVALID_CONVERSATION_RESPONSE_MESSAGE =\n \"Unable to load conversations because the selected agent server returned \" +\n \"data this UI does not understand. Check the backend URL/session key and \" +\n \"update the agent server if needed.\";\nfunction invalidConversationResponse(): Error {\n return new Error(INVALID_CONVERSATION_RESPONSE_MESSAGE);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction numberOrNull(value: unknown): number | null {\n return typeof value === \"number\" ? value : null;\n}\n\nfunction numberOrZero(value: unknown): number {\n return typeof value === \"number\" ? value : 0;\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nfunction readTimestamp(\n item: Record<string, unknown>,\n snakeKey: \"created_at\" | \"updated_at\",\n camelKey: \"createdAt\" | \"updatedAt\",\n): string {\n const value = item[snakeKey] ?? item[camelKey];\n return typeof value === \"string\" && value.trim()\n ? value\n : DEFAULT_CONVERSATION_TIMESTAMP;\n}\n\nfunction normalizeTokenUsage(\n value: unknown,\n): NonNullable<MetricsSnapshot[\"accumulated_token_usage\"]> | null {\n if (!isRecord(value)) return null;\n\n return {\n prompt_tokens: numberOrZero(value.prompt_tokens),\n completion_tokens: numberOrZero(value.completion_tokens),\n cache_read_tokens: numberOrZero(value.cache_read_tokens),\n cache_write_tokens: numberOrZero(value.cache_write_tokens),\n context_window: numberOrZero(value.context_window),\n per_turn_token: numberOrZero(value.per_turn_token),\n };\n}\n\nfunction normalizeMetrics(value: unknown): MetricsSnapshot | null {\n if (!isRecord(value)) return null;\n\n return {\n accumulated_cost: numberOrNull(value.accumulated_cost),\n max_budget_per_task: numberOrNull(value.max_budget_per_task),\n accumulated_token_usage: normalizeTokenUsage(value.accumulated_token_usage),\n };\n}\n\n// Shallow check only (matches the trust level `getRuntimeConversation` used\n// before this field was threaded through `DirectConversationInfo`): the\n// per-usage-id entries are consumed via `combineUsageMetrics`, which already\n// tolerates missing/malformed fields, so there's no need to validate them here.\nfunction normalizeStats(value: unknown): RuntimeConversationStats | null {\n return isRecord(value)\n ? (value as unknown as RuntimeConversationStats)\n : null;\n}\n\nfunction normalizeAgent(value: unknown): DirectConversationInfo[\"agent\"] {\n if (!isRecord(value)) return null;\n const llm = isRecord(value.llm)\n ? { model: stringOrNull(value.llm.model) }\n : null;\n // ``kind`` is the SDK's pydantic discriminator (``\"Agent\"`` vs ``\"ACPAgent\"``);\n // ``toAppConversation`` reads it to derive ``agent_kind``. ``acp_server`` is\n // the ACP provider identity (``ACPAgent.acp_server``, SDK #3692) — required so\n // the adapter can source the chip + in-conversation model list from the agent\n // when the ``acpserver`` tag is absent (a profile launch doesn't stamp it,\n // #1571). ``acp_model`` is the Canvas-configured model — preserved so the chip\n // can fall back to it when the SDK runtime model fields aren't populated.\n // Preserving these makes the wire path agree with the unit-test path that\n // builds ``DirectConversationInfo`` directly\n // (e.g. ``__tests__/api/agent-server-adapter.test.ts``).\n return {\n kind: stringOrNull(value.kind),\n acp_server: stringOrNull(value.acp_server),\n acp_model: stringOrNull(value.acp_model),\n llm,\n };\n}\n\nfunction normalizeWorkspace(\n value: unknown,\n): DirectConversationInfo[\"workspace\"] {\n if (!isRecord(value)) return null;\n return { working_dir: stringOrNull(value.working_dir) };\n}\n\n/**\n * Accept the agent-server's ``tags: Record[str, str]`` payload defensively:\n * the wire shape is guaranteed by the server-side validator (keys\n * ``^[a-z0-9]+$``, string values), but a non-conforming response (older\n * server, raw API write, future schema drift) must never crash the parser\n * — Canvas only consumes ``acpserver`` and falls back to a generic chip\n * for anything it doesn't recognize. Drop entries whose value isn't a\n * plain string; return ``null`` when the wire field is absent or not an\n * object so consumers can use ``info.tags?.[KEY] ?? null`` uniformly.\n */\nfunction normalizeTags(value: unknown): Record<string, string> | null {\n if (!isRecord(value)) return null;\n const tags: Record<string, string> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (typeof entry === \"string\") {\n tags[key] = entry;\n }\n }\n return tags;\n}\n\nfunction normalizeLaunchedAgentProfile(\n value: unknown,\n): DirectConversationInfo[\"launched_agent_profile\"] {\n if (!isRecord(value)) return null;\n const { agent_profile_id: agentProfileId, revision } = value;\n if (typeof agentProfileId !== \"string\" || typeof revision !== \"number\") {\n return null;\n }\n return { agent_profile_id: agentProfileId, revision };\n}\n\nfunction normalizeAbsolutePath(path: string): string | null {\n if (!path.startsWith(\"/\")) return null;\n\n const segments: string[] = [];\n for (const segment of path.split(\"/\")) {\n if (segment && segment !== \".\") {\n if (segment === \"..\") {\n if (!segments.length) return null;\n segments.pop();\n } else {\n segments.push(segment);\n }\n }\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction requirePathInsideDirectory(path: string, directory: string): string {\n const normalizedPath = normalizeAbsolutePath(path);\n const normalizedDirectory = normalizeAbsolutePath(directory);\n\n if (\n !normalizedPath ||\n !normalizedDirectory ||\n (normalizedPath !== normalizedDirectory &&\n !normalizedPath.startsWith(`${normalizedDirectory}/`))\n ) {\n throw new Error(\"Conversation file path must stay inside the workspace\");\n }\n\n return normalizedPath;\n}\n\nfunction requireDirectConversationInfo(item: unknown): DirectConversationInfo {\n if (!isRecord(item) || typeof item.id !== \"string\" || !item.id.trim()) {\n throw invalidConversationResponse();\n }\n\n return {\n id: item.id.trim(),\n title: stringOrNull(item.title),\n created_at: readTimestamp(item, \"created_at\", \"createdAt\"),\n updated_at: readTimestamp(item, \"updated_at\", \"updatedAt\"),\n execution_status: stringOrNull(item.execution_status),\n sandbox_status: stringOrNull(item.sandbox_status),\n metrics: normalizeMetrics(item.metrics),\n stats: normalizeStats(item.stats),\n agent: normalizeAgent(item.agent),\n workspace: normalizeWorkspace(item.workspace),\n tags: normalizeTags(item.tags),\n launched_agent_profile: normalizeLaunchedAgentProfile(\n item.launched_agent_profile,\n ),\n // SDK-runtime ACP model fields (populated when the agent-server supports\n // ``ConversationInfo.current_model_*``). Consumed by the conversation\n // adapter to drive the per-card chip's model text. Older agent-servers\n // omit these — adapter handles ``undefined`` / ``null`` gracefully.\n current_model_id: stringOrNull(item.current_model_id),\n current_model_name: stringOrNull(item.current_model_name),\n };\n}\n\nfunction requireDirectConversationItems(\n items: unknown,\n): DirectConversationInfo[] {\n if (!Array.isArray(items)) {\n throw invalidConversationResponse();\n }\n return items.map(requireDirectConversationInfo);\n}\n\nfunction requireConversationSearchPage(page: unknown): {\n items: DirectConversationInfo[];\n next_page_id: string | null;\n} {\n if (Array.isArray(page)) {\n return {\n items: requireDirectConversationItems(page),\n next_page_id: null,\n };\n }\n\n if (!isRecord(page)) {\n throw invalidConversationResponse();\n }\n\n return {\n items: requireDirectConversationItems(page.items),\n next_page_id:\n typeof page.next_page_id === \"string\" ? page.next_page_id : null,\n };\n}\n\nconst RUNTIME_STATUSES = new Set<string>([\n \"idle\",\n \"running\",\n \"paused\",\n \"waiting_for_confirmation\",\n \"finished\",\n \"error\",\n \"stuck\",\n]);\n\nfunction toRuntimeStatus(\n status: DirectConversationInfo[\"execution_status\"],\n): RuntimeConversationInfo[\"status\"] {\n const nextStatus = status ?? \"idle\";\n return (\n RUNTIME_STATUSES.has(nextStatus) ? nextStatus : \"idle\"\n ) as RuntimeConversationInfo[\"status\"];\n}\n\nfunction requireAppConversation(\n conversation: AppConversation | null | undefined,\n conversationId: string,\n): AppConversation {\n if (!conversation) {\n throw new Error(`Conversation ${conversationId} was not found`);\n }\n return conversation;\n}\n\n/**\n * Options for {@link AgentServerConversationService.createConversation}.\n */\nexport interface CreateConversationOptions {\n initialUserMsg?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n metadata?: ConversationMetadata | null;\n workingDirOverride?: string;\n workspaceMode?: WorkspaceMode;\n parentConversationId?: string;\n agentType?: \"default\" | \"plan\";\n sandboxId?: string;\n // Launch from a saved AgentProfile (resolved server-side) instead of the\n // current encrypted agent_settings (#3727). Supported on both local and the\n // cloud app-server (OpenHands #15060): local threads it through the\n // encrypted-settings builder; cloud sends it as a flat request field.\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n}\n\nclass AgentServerConversationService {\n static async sendMessage(\n conversationId: string,\n message: SendMessageRequest,\n runtime?: ConversationRuntimeContext | null,\n ): Promise<SendMessageResponse> {\n const active = getActiveBackend().backend;\n let conversationUrl = runtime?.conversationUrl ?? null;\n let sessionApiKey = runtime?.sessionApiKey ?? null;\n\n if (active.kind === \"cloud\") {\n if (!conversationUrl || !sessionApiKey) {\n const [conversation] = await batchGetCloudConversations([\n conversationId,\n ]);\n conversationUrl = conversation?.conversation_url?.trim() ?? null;\n sessionApiKey = conversation?.session_api_key?.trim() ?? null;\n }\n\n if (!conversationUrl || !sessionApiKey) {\n throw new Error(\n \"Conversation sandbox is still starting. Wait for it to finish, then try again.\",\n );\n }\n\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/events`,\n body: { ...message, run: true },\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n\n return message;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).sendEvent(conversationId, message, {\n run: true,\n });\n\n return message;\n }\n\n static async createConversation(\n options: CreateConversationOptions = {},\n ): Promise<AppConversationStartTask> {\n const {\n initialUserMsg,\n conversationInstructions,\n plugins,\n metadata,\n workingDirOverride,\n workspaceMode,\n parentConversationId,\n agentType,\n sandboxId,\n agentProfileId,\n agentProfileKind,\n } = options;\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud path mirrors OpenHands' frontend: build a flat\n // AppConversationStartRequest, POST /api/v1/app-conversations\n // (returns a WORKING task), and let the conversation route's\n // useTaskPolling drive it to READY. NO encrypted-settings\n // round-trip — the cloud backend holds secrets server-side.\n // When launching from a profile, send `agent_profile_id`; the backend\n // resolves it to agent_settings server-side.\n const request: AppConversationStartRequest = {\n initial_message: initialUserMsg\n ? {\n role: \"user\",\n content: [{ type: \"text\", text: initialUserMsg }],\n }\n : null,\n title: conversationInstructions ?? null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n plugins: plugins ?? null,\n parent_conversation_id: parentConversationId ?? null,\n agent_type: agentType,\n sandbox_id: sandboxId ?? null,\n agent_profile_id: agentProfileId ?? null,\n trigger: \"gui\",\n };\n return createCloudAppConversation(request);\n }\n\n const [settings, profiles] = await Promise.all([\n SettingsService.getSettings(),\n ProfilesService.listProfiles().catch(() => undefined),\n ]);\n const titleLlmProfile = resolveTitleLlmProfile(\n settings.title_llm_profile,\n profiles,\n );\n const conversationId = uuidv4();\n // @spec WUP-001 — Send an absolute working_dir to the agent-server.\n // The default is `workspace/project/<hex>` (relative); without\n // resolving it here, `/api/file/upload` later prepends `/` and writes\n // to `/workspace/...` (read-only on macOS and fresh containers). When\n // the user picks an explicit workspace, `workingDirOverride` is\n // already absolute (it comes from `search_subdirs`).\n const workingDir = await resolveAbsoluteAgentServerPath(\n workingDirOverride ?? buildConversationWorkingDir(conversationId),\n );\n const resolvedWorkspaceMode =\n workspaceMode ?? (workingDirOverride ? \"local_repo\" : \"new_worktree\");\n\n // Use encrypted settings to avoid exposing secrets in the browser\n const payload = await buildStartConversationRequestWithEncryptedSettings({\n settings,\n query: initialUserMsg,\n conversationInstructions,\n plugins,\n conversationId,\n // The agent-server rejects a parent in a different workspace, so callers\n // launching a child must pass the parent's own `working_dir` as\n // `workingDirOverride` (see `resolveConversationWorkingDir`). Servers\n // older than 1.37.1 ignore the field and create an unlinked conversation.\n parentConversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n titleLlmProfile,\n });\n\n const data = await new ConversationClient(\n getAgentServerClientOptions({ timeout: CREATE_CONVERSATION_TIMEOUT_MS }),\n ).createConversation<DirectConversationInfo>(payload);\n const localBackend = getEffectiveLocalBackend();\n if (!localBackend) throw new NoBackendAvailableError();\n\n if (metadata?.selected_repository || workingDirOverride) {\n // The agent-server runtime has no concept of selected repo/branch/\n // workspace, so persist the home-page selection client-side.\n // `toAppConversation` reads the repo/branch fields back to hydrate\n // the chat-page badges; `useHasAttachedSource` reads\n // `selected_workspace` to default the Files tab to Diff mode when\n // the user explicitly attached a local workspace.\n setStoredConversationMetadata(data.id, {\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: workingDirOverride ?? null,\n workspace_mode: resolvedWorkspaceMode,\n });\n }\n\n return {\n id: data.id,\n created_by_user_id: null,\n status: \"READY\",\n detail: null,\n app_conversation_id: data.id,\n agent_server_url: localBackend.host,\n request: {\n initial_message: payload.initial_message as\n | AppConversationStartRequest[\"initial_message\"]\n | undefined,\n plugins: plugins ?? null,\n },\n created_at: data.created_at,\n updated_at: data.updated_at,\n };\n }\n\n static async getStartTask(\n taskId: string,\n ): Promise<AppConversationStartTask | null> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return getCloudAppConversationStartTask(taskId);\n }\n // Local agent-server creates conversations synchronously — every\n // local \"task\" is already READY when createConversation returns, so\n // there's nothing to poll for.\n return null;\n }\n\n static async getVSCodeUrl(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<GetVSCodeUrlResponse> {\n // Local-only path. Cloud conversations read the VSCode URL straight\n // from the cloud-computed `sandbox.exposed_urls` (see\n // `useUnifiedVSCodeUrl` + `useCloudSandbox`); the runtime's own\n // `/api/vscode/url` only knows its internal `localhost:8001`, which\n // the user's browser can't reach.\n const workspaceDir =\n await this.resolveConversationWorkingDir(conversationId);\n // Local mode: the typescript-client targets the local agent-server\n // directly via the conversationUrl override.\n const vscodeUrl = await new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getUrl({\n baseUrl:\n typeof window !== \"undefined\" ? window.location.origin : undefined,\n workspaceDir,\n });\n\n return { vscode_url: vscodeUrl };\n }\n\n static async resolveConversationWorkingDir(\n conversationId: string,\n ): Promise<string> {\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return conversation?.workspace?.working_dir ?? getAgentServerWorkingDir();\n }\n\n static async batchGetAppConversations(\n ids: string[],\n ): Promise<(AppConversation | null)[]> {\n if (ids.length === 0) return [];\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n return batchGetCloudConversations(ids);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).getConversations<DirectConversationInfo>(ids);\n\n return requireDirectConversationItems(data).map((item) =>\n toAppConversation(item),\n );\n }\n\n static async updateConversationPublicFlag(\n conversationId: string,\n isPublic: boolean,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind !== \"cloud\") {\n throw new Error(\"Public sharing requires a cloud backend.\");\n }\n return updateCloudConversationPublicFlag(conversationId, isPublic);\n }\n\n static async updateConversationRepository(\n conversationId: string,\n repository: string | null,\n branch?: string | null,\n gitProvider?: string | null,\n ): Promise<AppConversation> {\n if (repository) {\n const existing = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...(existing ?? {}),\n selected_repository: repository,\n selected_branch: branch ?? null,\n git_provider: (gitProvider as Provider | null | undefined) ?? null,\n });\n } else {\n removeStoredConversationMetadata(conversationId);\n }\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n static async readConversationFile(\n conversationId: string,\n filePath?: string,\n ): Promise<string> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud exposes a per-conversation file endpoint; the sandbox\n // working dir is fixed (`/workspace/project`), so PLAN.md lives at\n // a known absolute path. Mirrors OpenHands' readConversationFile.\n const path = requirePathInsideDirectory(\n filePath ?? \"/workspace/project/.agents_tmp/PLAN.md\",\n \"/workspace/project\",\n );\n return readCloudConversationFile(conversationId, path);\n }\n\n const workingDir = await this.resolveConversationWorkingDir(conversationId);\n const path = requirePathInsideDirectory(\n filePath ?? `${workingDir}/.agents_tmp/PLAN.md`,\n workingDir,\n );\n return new FileClient(getAgentServerClientOptions()).downloadTextFile(path);\n }\n\n static async downloadConversation(conversationId: string): Promise<Blob> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return downloadCloudConversation(conversationId);\n }\n\n return new FileClient(getAgentServerClientOptions()).downloadTrajectory(\n conversationId,\n );\n }\n\n static async getHooks(conversationId: string): Promise<GetHooksResponse> {\n if (!conversationId) {\n return emptyHooksResponse();\n }\n return emptyHooksResponse();\n }\n\n static async getRuntimeConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<RuntimeConversationInfo> {\n // Fetch directly from the per-conversation runtime agent-server at conversationUrl.\n const response = await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<DirectConversationInfo>(conversationId);\n const data = requireDirectConversationInfo(response);\n\n return {\n id: data.id,\n title: data.title?.trim()\n ? data.title\n : getDefaultConversationTitle(data.id),\n metrics: normalizeMetrics(data.metrics),\n created_at: data.created_at,\n updated_at: data.updated_at,\n status: toRuntimeStatus(data.execution_status),\n stats: data.stats ?? { usage_to_metrics: {} },\n };\n }\n\n /**\n * Force condensation (\"compact\") of the conversation history via\n * `POST /api/conversations/{id}/condense`. Routed the same way as\n * {@link sendMessage}: through the cloud proxy at the conversation's own\n * runtime host for cloud backends, directly against that runtime otherwise.\n */\n static async condenseConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<void> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationUrl) {\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/condense`,\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n return;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).condenseConversation(conversationId);\n }\n\n static async searchConversations(\n limit: number = 20,\n pageId?: string,\n ): Promise<AppConversationPage> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return searchCloudConversations(limit, pageId);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).searchConversations({\n limit,\n page_id: pageId,\n sort_order: ConversationSortOrder.UPDATED_AT_DESC,\n });\n\n return toConversationPage(requireConversationSearchPage(data));\n }\n\n static async deleteConversation(conversationId: string): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await deleteCloudConversation(conversationId);\n } else {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).deleteConversation(conversationId);\n }\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n title,\n });\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n /**\n * Forks a conversation, copying event history up to and including\n * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for\n * `from_event_id` (older backends copy the whole conversation).\n */\n static async forkConversation(\n sourceConversationId: string,\n fromEventId: string,\n title?: string,\n ): Promise<DirectConversationInfo> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\n \"Branching a conversation isn't supported on the cloud backend yet.\",\n );\n }\n\n // `from_event_id` is accepted by `/fork` but not yet typed in\n // ForkConversationRequest (through client 1.32.0); the client forwards the\n // body verbatim, so cast to carry it. A title also suppresses the backend\n // auto-title, so the \"(branch)\" marker sticks.\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).forkConversation<DirectConversationInfo>(sourceConversationId, {\n from_event_id: fromEventId,\n ...(title ? { title } : {}),\n } as ForkConversationRequest & { from_event_id: string });\n\n // Carry over the source's client-side metadata (repo/branch/workspace/\n // profile/plugins) so the fork hydrates its chat-page badges the same way.\n const sourceMetadata = getStoredConversationMetadata(sourceConversationId);\n if (sourceMetadata) {\n setStoredConversationMetadata(data.id, sourceMetadata);\n }\n\n return data;\n }\n\n /**\n * Returns an event's `parent_id` (the fork point for branching *before* it),\n * or undefined at the root. Uses the single-event endpoint because the events\n * *search* API omits `parent_id`.\n */\n static async getEventParentId(\n conversationId: string,\n eventId: string,\n ): Promise<string | undefined> {\n const event = (await new ConversationClient(\n getAgentServerClientOptions(),\n ).getEvent(conversationId, eventId)) as { parent_id?: string | null };\n return event.parent_id ?? undefined;\n }\n\n /**\n * Switches the LLM profile for the running conversation when one is open\n * (POST /switch_profile — per-conversation swap, doesn't change the user's\n * default profile). When called without a conversationId (home page),\n * falls back to POST /activate so the next conversation created picks up\n * the chosen profile.\n *\n * The per-conversation endpoint accepts only the profile name, so the UI does\n * not need to fetch or forward profile secrets. That keeps switching working\n * even when the agent server has no OH_SECRET_KEY for encrypted secret export.\n *\n * Cloud backends route to the app-server's per-conversation\n * `/switch_profile`, which owns the profiles and resolves the swap\n * server-side (base_url/api_key fixups, usage_id derivation, then the\n * agent-server's switch_llm) — so the client only forwards the profile name,\n * mirroring {@link switchAcpModel}.\n */\n static async switchProfile(\n conversationId: string | null,\n profileName: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n\n if (backend.kind === \"cloud\") {\n // No conversation (home page): activate globally so the next\n // conversation starts with it. ProfilesService routes to the cloud\n // activate endpoint.\n if (!conversationId) {\n await ProfilesService.activateProfile(profileName);\n return;\n }\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_profile`,\n body: { profile_name: profileName },\n });\n return;\n }\n\n if (!conversationId) {\n await new ProfilesClient(getAgentServerClientOptions()).activateProfile(\n profileName,\n );\n return;\n }\n\n const clientOptions = getAgentServerClientOptions();\n const conversationClient = new ConversationClient(clientOptions);\n const profile = await new ProfilesClient(clientOptions).getProfile(\n profileName,\n { exposeSecrets: \"encrypted\" },\n );\n const model =\n typeof profile.config.model === \"string\" ? profile.config.model : \"\";\n if (!model) throw new Error(`Profile '${profileName}' has no model.`);\n await assertSubscriptionAuthReady({ llm: profile.config });\n await conversationClient.switchLLM(conversationId, {\n ...profile.config,\n model,\n // Keep streaming on after a switch (parity with conversation start);\n // the profile config would otherwise default it to stream=False.\n stream: true,\n // Avoid stale first-write-wins entries in the backend LLM registry.\n usage_id: `profile:${profileName}:${uuidv4()}`,\n } as LLMConfig);\n }\n\n /**\n * Switches the model of a running ACP conversation in place (POST\n * /switch_acp_model — the ACP analog of {@link switchProfile}'s /switch_profile).\n * The agent-server calls the ACP wrapper's ``session/set_model`` on the live\n * session, preserving context. Mirrors {@link switchProfile}'s\n * local-backend-only guard and per-conversation ConversationClient call.\n *\n * Works on a created-but-not-yet-run conversation too: the agent-server\n * treats a pre-first-run switch as a persist-only deferral (the model is\n * mirrored into the conversation's stored agent and applied when the session\n * starts). The home/no-conversation default is persisted via the active ACP\n * profile / Settings instead (see ``use-switch-acp-model``).\n */\n static async switchAcpModel(\n conversationId: string,\n model: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n if (backend.kind === \"cloud\") {\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_acp_model`,\n body: { model },\n });\n return;\n }\n\n await new ConversationClient(getAgentServerClientOptions()).switchAcpModel(\n conversationId,\n model,\n );\n }\n}\n\nexport default AgentServerConversationService;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyEA,IAAM,IAAiC,4BAIjC,IAAiC,MAAS,KAC1C,IACJ;AAGF,SAAS,IAAqC;CAC5C,OAAO,gBAAI,MAAM,CAAqC;AACxD;AAEA,SAAS,EAAS,GAAkD;CAClE,OAAO,OAAO,KAAU,cAAY,KAAkB,CAAC,MAAM,QAAQ,CAAK;AAC5E;AAEA,SAAS,EAAa,GAA+B;CACnD,OAAO,OAAO,KAAU,WAAW,IAAQ;AAC7C;AAEA,SAAS,EAAa,GAAwB;CAC5C,OAAO,OAAO,KAAU,WAAW,IAAQ;AAC7C;AAEA,SAAS,EAAa,GAA+B;CACnD,OAAO,OAAO,KAAU,WAAW,IAAQ;AAC7C;AAEA,SAAS,EACP,GACA,GACA,GACQ;CACR,IAAM,IAAQ,EAAK,MAAa,EAAK;CACrC,OAAO,OAAO,KAAU,YAAY,EAAM,KAAK,IAC3C,IACA;AACN;AAEA,SAAS,EACP,GACgE;CAGhE,OAFK,EAAS,CAAK,IAEZ;EAC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O,GACrB,aAAa,KAAA;CAC5B;CAmBA,aAAa,cACX,GACA,GACe;EACf,IAAM,EAAE,eAAY,EAAiB;EAErC,IAAI,EAAQ,SAAS,SAAS;GAI5B,IAAI,CAAC,GAAgB;IACnB,MAAM,EAAgB,gBAAgB,CAAW;IACjD;GACF;GACA,MAAM,EAAe;IACnB;IACA,QAAQ;IACR,MAAM,6BAA6B,EAAe;IAClD,MAAM,EAAE,cAAc,EAAY;GACpC,CAAC;GACD;EACF;EAEA,IAAI,CAAC,GAAgB;GACnB,MAAM,IAAI,EAAe,EAA4B,CAAC,EAAE,gBACtD,CACF;GACA;EACF;EAEA,IAAM,IAAgB,EAA4B,GAC5C,IAAqB,IAAI,EAAmB,CAAa,GACzD,IAAU,MAAM,IAAI,EAAe,CAAa,EAAE,WACtD,GACA,EAAE,eAAe,YAAY,CAC/B,GACM,IACJ,OAAO,EAAQ,OAAO,SAAU,WAAW,EAAQ,OAAO,QAAQ;EACpE,IAAI,CAAC,GAAO,MAAU,MAAM,YAAY,EAAY,gBAAgB;EAEpE,AADA,MAAM,EAA4B,EAAE,KAAK,EAAQ,OAAO,CAAC,GACzD,MAAM,EAAmB,UAAU,GAAgB;GACjD,GAAG,EAAQ;GACX;GAGA,QAAQ;GAER,UAAU,WAAW,EAAY,GAAG,EAAO;EAC7C,CAAc;CAChB;CAeA,aAAa,eACX,GACA,GACe;EACf,IAAM,EAAE,eAAY,EAAiB;EACrC,IAAI,EAAQ,SAAS,SAAS;GAC5B,MAAM,EAAe;IACnB;IACA,QAAQ;IACR,MAAM,6BAA6B,EAAe;IAClD,MAAM,EAAE,SAAM;GAChB,CAAC;GACD;EACF;EAEA,MAAM,IAAI,EAAmB,EAA4B,CAAC,EAAE,eAC1D,GACA,CACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"agent-server-conversation-service.api.js","names":[],"sources":["../../../src/api/conversation-service/agent-server-conversation-service.api.ts"],"sourcesContent":["import {\n ConversationSortOrder,\n type ForkConversationRequest,\n type LLMConfig,\n type VSCodeStatusResponse,\n} from \"@openhands/typescript-client\";\nimport {\n ConversationClient,\n FileClient,\n ProfilesClient,\n VSCodeClient,\n} from \"@openhands/typescript-client/clients\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AgentKind, Provider } from \"#/types/settings\";\nimport type { ConversationRuntimeContext } from \"#/api/conversation-file-upload.api\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport {\n buildConversationWorkingDirForBackend,\n getAgentServerWorkingDir,\n} from \"../agent-server-config\";\nimport { resolveAbsoluteAgentServerPath } from \"../agent-server-home\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport ProfilesService from \"../profiles-service/profiles-service.api\";\nimport {\n batchGetCloudConversations,\n createCloudAppConversation,\n deleteCloudConversation,\n downloadCloudConversation,\n getCloudAppConversationStartTask,\n readCloudConversationFile,\n searchCloudConversations,\n updateCloudConversationPublicFlag,\n updateCloudConversationTitle,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n emptyHooksResponse,\n getDefaultConversationTitle,\n toAppConversation,\n toConversationPage,\n} from \"../agent-server-adapter\";\nimport { GetVSCodeUrlResponse } from \"../open-hands.types\";\nimport {\n getAgentServerClientOptions,\n NoBackendAvailableError,\n} from \"../agent-server-client-options\";\nimport SettingsService from \"../settings-service/settings-service.api\";\nimport { getTelemetryDistinctId } from \"../../services/telemetry\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport { resolveTitleLlmProfile } from \"#/utils/title-llm-profile\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n RuntimeConversationStats,\n SendMessageRequest,\n SendMessageResponse,\n} from \"./agent-server-conversation-service.types\";\n\nconst DEFAULT_CONVERSATION_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\n// Creating the first conversation right after a cold agent-server boot (fresh\n// machine or the packaged desktop app, where uvx may still be warming caches)\n// can exceed the client's 60s default timeout.\nconst CREATE_CONVERSATION_TIMEOUT_MS = 5 * 60 * 1000;\nconst INVALID_CONVERSATION_RESPONSE_MESSAGE =\n \"Unable to load conversations because the selected agent server returned \" +\n \"data this UI does not understand. Check the backend URL/session key and \" +\n \"update the agent server if needed.\";\nfunction invalidConversationResponse(): Error {\n return new Error(INVALID_CONVERSATION_RESPONSE_MESSAGE);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction numberOrNull(value: unknown): number | null {\n return typeof value === \"number\" ? value : null;\n}\n\nfunction numberOrZero(value: unknown): number {\n return typeof value === \"number\" ? value : 0;\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nfunction readTimestamp(\n item: Record<string, unknown>,\n snakeKey: \"created_at\" | \"updated_at\",\n camelKey: \"createdAt\" | \"updatedAt\",\n): string {\n const value = item[snakeKey] ?? item[camelKey];\n return typeof value === \"string\" && value.trim()\n ? value\n : DEFAULT_CONVERSATION_TIMESTAMP;\n}\n\nfunction normalizeTokenUsage(\n value: unknown,\n): NonNullable<MetricsSnapshot[\"accumulated_token_usage\"]> | null {\n if (!isRecord(value)) return null;\n\n return {\n prompt_tokens: numberOrZero(value.prompt_tokens),\n completion_tokens: numberOrZero(value.completion_tokens),\n cache_read_tokens: numberOrZero(value.cache_read_tokens),\n cache_write_tokens: numberOrZero(value.cache_write_tokens),\n context_window: numberOrZero(value.context_window),\n per_turn_token: numberOrZero(value.per_turn_token),\n };\n}\n\nfunction normalizeMetrics(value: unknown): MetricsSnapshot | null {\n if (!isRecord(value)) return null;\n\n return {\n accumulated_cost: numberOrNull(value.accumulated_cost),\n max_budget_per_task: numberOrNull(value.max_budget_per_task),\n accumulated_token_usage: normalizeTokenUsage(value.accumulated_token_usage),\n };\n}\n\n// Shallow check only (matches the trust level `getRuntimeConversation` used\n// before this field was threaded through `DirectConversationInfo`): the\n// per-usage-id entries are consumed via `combineUsageMetrics`, which already\n// tolerates missing/malformed fields, so there's no need to validate them here.\nfunction normalizeStats(value: unknown): RuntimeConversationStats | null {\n return isRecord(value)\n ? (value as unknown as RuntimeConversationStats)\n : null;\n}\n\nfunction normalizeAgent(value: unknown): DirectConversationInfo[\"agent\"] {\n if (!isRecord(value)) return null;\n const llm = isRecord(value.llm)\n ? { model: stringOrNull(value.llm.model) }\n : null;\n // ``kind`` is the SDK's pydantic discriminator (``\"Agent\"`` vs ``\"ACPAgent\"``);\n // ``toAppConversation`` reads it to derive ``agent_kind``. ``acp_server`` is\n // the ACP provider identity (``ACPAgent.acp_server``, SDK #3692) — required so\n // the adapter can source the chip + in-conversation model list from the agent\n // when the ``acpserver`` tag is absent (a profile launch doesn't stamp it,\n // #1571). ``acp_model`` is the Canvas-configured model — preserved so the chip\n // can fall back to it when the SDK runtime model fields aren't populated.\n // Preserving these makes the wire path agree with the unit-test path that\n // builds ``DirectConversationInfo`` directly\n // (e.g. ``__tests__/api/agent-server-adapter.test.ts``).\n return {\n kind: stringOrNull(value.kind),\n acp_server: stringOrNull(value.acp_server),\n acp_model: stringOrNull(value.acp_model),\n llm,\n };\n}\n\nfunction normalizeWorkspace(\n value: unknown,\n): DirectConversationInfo[\"workspace\"] {\n if (!isRecord(value)) return null;\n return { working_dir: stringOrNull(value.working_dir) };\n}\n\n/**\n * Accept the agent-server's ``tags: Record[str, str]`` payload defensively:\n * the wire shape is guaranteed by the server-side validator (keys\n * ``^[a-z0-9]+$``, string values), but a non-conforming response (older\n * server, raw API write, future schema drift) must never crash the parser\n * — Canvas only consumes ``acpserver`` and falls back to a generic chip\n * for anything it doesn't recognize. Drop entries whose value isn't a\n * plain string; return ``null`` when the wire field is absent or not an\n * object so consumers can use ``info.tags?.[KEY] ?? null`` uniformly.\n */\nfunction normalizeTags(value: unknown): Record<string, string> | null {\n if (!isRecord(value)) return null;\n const tags: Record<string, string> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (typeof entry === \"string\") {\n tags[key] = entry;\n }\n }\n return tags;\n}\n\nfunction normalizeLaunchedAgentProfile(\n value: unknown,\n): DirectConversationInfo[\"launched_agent_profile\"] {\n if (!isRecord(value)) return null;\n const { agent_profile_id: agentProfileId, revision } = value;\n if (typeof agentProfileId !== \"string\" || typeof revision !== \"number\") {\n return null;\n }\n return { agent_profile_id: agentProfileId, revision };\n}\n\nfunction normalizeAbsolutePath(path: string): string | null {\n if (!path.startsWith(\"/\")) return null;\n\n const segments: string[] = [];\n for (const segment of path.split(\"/\")) {\n if (segment && segment !== \".\") {\n if (segment === \"..\") {\n if (!segments.length) return null;\n segments.pop();\n } else {\n segments.push(segment);\n }\n }\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction requirePathInsideDirectory(path: string, directory: string): string {\n const normalizedPath = normalizeAbsolutePath(path);\n const normalizedDirectory = normalizeAbsolutePath(directory);\n\n if (\n !normalizedPath ||\n !normalizedDirectory ||\n (normalizedPath !== normalizedDirectory &&\n !normalizedPath.startsWith(`${normalizedDirectory}/`))\n ) {\n throw new Error(\"Conversation file path must stay inside the workspace\");\n }\n\n return normalizedPath;\n}\n\nfunction requireDirectConversationInfo(item: unknown): DirectConversationInfo {\n if (!isRecord(item) || typeof item.id !== \"string\" || !item.id.trim()) {\n throw invalidConversationResponse();\n }\n\n return {\n id: item.id.trim(),\n title: stringOrNull(item.title),\n created_at: readTimestamp(item, \"created_at\", \"createdAt\"),\n updated_at: readTimestamp(item, \"updated_at\", \"updatedAt\"),\n execution_status: stringOrNull(item.execution_status),\n sandbox_status: stringOrNull(item.sandbox_status),\n metrics: normalizeMetrics(item.metrics),\n stats: normalizeStats(item.stats),\n agent: normalizeAgent(item.agent),\n workspace: normalizeWorkspace(item.workspace),\n tags: normalizeTags(item.tags),\n launched_agent_profile: normalizeLaunchedAgentProfile(\n item.launched_agent_profile,\n ),\n // SDK-runtime ACP model fields (populated when the agent-server supports\n // ``ConversationInfo.current_model_*``). Consumed by the conversation\n // adapter to drive the per-card chip's model text. Older agent-servers\n // omit these — adapter handles ``undefined`` / ``null`` gracefully.\n current_model_id: stringOrNull(item.current_model_id),\n current_model_name: stringOrNull(item.current_model_name),\n };\n}\n\nfunction requireDirectConversationItems(\n items: unknown,\n): DirectConversationInfo[] {\n if (!Array.isArray(items)) {\n throw invalidConversationResponse();\n }\n return items.map(requireDirectConversationInfo);\n}\n\nfunction requireConversationSearchPage(page: unknown): {\n items: DirectConversationInfo[];\n next_page_id: string | null;\n} {\n if (Array.isArray(page)) {\n return {\n items: requireDirectConversationItems(page),\n next_page_id: null,\n };\n }\n\n if (!isRecord(page)) {\n throw invalidConversationResponse();\n }\n\n return {\n items: requireDirectConversationItems(page.items),\n next_page_id:\n typeof page.next_page_id === \"string\" ? page.next_page_id : null,\n };\n}\n\nconst RUNTIME_STATUSES = new Set<string>([\n \"idle\",\n \"running\",\n \"paused\",\n \"waiting_for_confirmation\",\n \"finished\",\n \"error\",\n \"stuck\",\n]);\n\nfunction toRuntimeStatus(\n status: DirectConversationInfo[\"execution_status\"],\n): RuntimeConversationInfo[\"status\"] {\n const nextStatus = status ?? \"idle\";\n return (\n RUNTIME_STATUSES.has(nextStatus) ? nextStatus : \"idle\"\n ) as RuntimeConversationInfo[\"status\"];\n}\n\nfunction requireAppConversation(\n conversation: AppConversation | null | undefined,\n conversationId: string,\n): AppConversation {\n if (!conversation) {\n throw new Error(`Conversation ${conversationId} was not found`);\n }\n return conversation;\n}\n\n/**\n * Options for {@link AgentServerConversationService.createConversation}.\n */\nexport interface CreateConversationOptions {\n initialUserMsg?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n metadata?: ConversationMetadata | null;\n workingDirOverride?: string;\n workspaceMode?: WorkspaceMode;\n parentConversationId?: string;\n agentType?: \"default\" | \"plan\";\n sandboxId?: string;\n // Launch from a saved AgentProfile (resolved server-side) instead of the\n // current encrypted agent_settings (#3727). Supported on both local and the\n // cloud app-server (OpenHands #15060): local threads it through the\n // encrypted-settings builder; cloud sends it as a flat request field.\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n}\n\nclass AgentServerConversationService {\n static async sendMessage(\n conversationId: string,\n message: SendMessageRequest,\n runtime?: ConversationRuntimeContext | null,\n ): Promise<SendMessageResponse> {\n const active = getActiveBackend().backend;\n let conversationUrl = runtime?.conversationUrl ?? null;\n let sessionApiKey = runtime?.sessionApiKey ?? null;\n\n if (active.kind === \"cloud\") {\n if (!conversationUrl || !sessionApiKey) {\n const [conversation] = await batchGetCloudConversations([\n conversationId,\n ]);\n conversationUrl = conversation?.conversation_url?.trim() ?? null;\n sessionApiKey = conversation?.session_api_key?.trim() ?? null;\n }\n\n if (!conversationUrl || !sessionApiKey) {\n throw new Error(\n \"Conversation sandbox is still starting. Wait for it to finish, then try again.\",\n );\n }\n\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/events`,\n body: { ...message, run: true },\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n\n return message;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).sendEvent(conversationId, message, {\n run: true,\n });\n\n return message;\n }\n\n static async createConversation(\n options: CreateConversationOptions = {},\n ): Promise<AppConversationStartTask> {\n const {\n initialUserMsg,\n conversationInstructions,\n plugins,\n metadata,\n workingDirOverride,\n workspaceMode,\n parentConversationId,\n agentType,\n sandboxId,\n agentProfileId,\n agentProfileKind,\n } = options;\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud path mirrors OpenHands' frontend: build a flat\n // AppConversationStartRequest, POST /api/v1/app-conversations\n // (returns a WORKING task), and let the conversation route's\n // useTaskPolling drive it to READY. NO encrypted-settings\n // round-trip — the cloud backend holds secrets server-side.\n // When launching from a profile, send `agent_profile_id`; the backend\n // resolves it to agent_settings server-side.\n const request: AppConversationStartRequest = {\n initial_message: initialUserMsg\n ? {\n role: \"user\",\n content: [{ type: \"text\", text: initialUserMsg }],\n }\n : null,\n title: conversationInstructions ?? null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n plugins: plugins ?? null,\n parent_conversation_id: parentConversationId ?? null,\n agent_type: agentType,\n sandbox_id: sandboxId ?? null,\n agent_profile_id: agentProfileId ?? null,\n trigger: \"gui\",\n };\n return createCloudAppConversation(request);\n }\n\n const [settings, profiles] = await Promise.all([\n SettingsService.getSettings(),\n ProfilesService.listProfiles().catch(() => undefined),\n ]);\n const titleLlmProfile = resolveTitleLlmProfile(\n settings.title_llm_profile,\n profiles,\n );\n const conversationId = uuidv4();\n // @spec WUP-001 — Send an absolute working_dir to the agent-server.\n // The default is `workspace/project/<hex>` (relative); without\n // resolving it here, `/api/file/upload` later prepends `/` and writes\n // to `/workspace/...` (read-only on macOS and fresh containers). When\n // the user picks an explicit workspace, `workingDirOverride` is\n // already absolute (it comes from `search_subdirs`).\n //\n // Pick the base working dir per-backend:\n // 1. explicit user workspace pick → use it as-is;\n // 2. no pick, backend that served this frontend → the baked default\n // (honors a launcher-baked absolute `VITE_WORKING_DIR`);\n // 3. no pick, any other backend → the backend-relative default.\n // A baked absolute dir is a path on the host that served this frontend,\n // so it is only valid on that backend. Using it for a different backend\n // (e.g. a remote sandbox) makes the agent-server mkdir an unwritable path\n // and the conversation fails at the first prompt (e.g. `Permission\n // denied: '/Users'`). The relative default is anchored per-backend by\n // `resolveAbsoluteAgentServerPath()` via `/api/file/home`. The gate keys\n // on the active backend's host (not its id): the seeded `default-local`\n // entry is mutable, so a user can edit it to point at a remote host while\n // its id stays `default-local`.\n const baseWorkingDir =\n workingDirOverride ??\n buildConversationWorkingDirForBackend(\n conversationId,\n getActiveBackend().backend.host,\n );\n const workingDir = await resolveAbsoluteAgentServerPath(baseWorkingDir);\n const resolvedWorkspaceMode =\n workspaceMode ?? (workingDirOverride ? \"local_repo\" : \"new_worktree\");\n\n // Use encrypted settings to avoid exposing secrets in the browser\n const payload = await buildStartConversationRequestWithEncryptedSettings({\n settings,\n query: initialUserMsg,\n conversationInstructions,\n plugins,\n conversationId,\n // The agent-server rejects a parent in a different workspace, so callers\n // launching a child must pass the parent's own `working_dir` as\n // `workingDirOverride` (see `resolveConversationWorkingDir`). Servers\n // older than 1.37.1 ignore the field and create an unlinked conversation.\n parentConversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n titleLlmProfile,\n });\n\n const telemetryDistinctId = await getTelemetryDistinctId();\n const data = await new ConversationClient(\n getAgentServerClientOptions({ timeout: CREATE_CONVERSATION_TIMEOUT_MS }),\n ).createConversation<DirectConversationInfo>({\n ...payload,\n ...(telemetryDistinctId ? { user_id: telemetryDistinctId } : {}),\n });\n const localBackend = getEffectiveLocalBackend();\n if (!localBackend) throw new NoBackendAvailableError();\n\n if (metadata?.selected_repository || workingDirOverride) {\n // The agent-server runtime has no concept of selected repo/branch/\n // workspace, so persist the home-page selection client-side.\n // `toAppConversation` reads the repo/branch fields back to hydrate\n // the chat-page badges; `useHasAttachedSource` reads\n // `selected_workspace` to default the Files tab to Diff mode when\n // the user explicitly attached a local workspace.\n setStoredConversationMetadata(data.id, {\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: workingDirOverride ?? null,\n workspace_mode: resolvedWorkspaceMode,\n });\n }\n\n return {\n id: data.id,\n created_by_user_id: null,\n status: \"READY\",\n detail: null,\n app_conversation_id: data.id,\n agent_server_url: localBackend.host,\n request: {\n initial_message: payload.initial_message as\n | AppConversationStartRequest[\"initial_message\"]\n | undefined,\n plugins: plugins ?? null,\n },\n created_at: data.created_at,\n updated_at: data.updated_at,\n };\n }\n\n static async getStartTask(\n taskId: string,\n ): Promise<AppConversationStartTask | null> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return getCloudAppConversationStartTask(taskId);\n }\n // Local agent-server creates conversations synchronously — every\n // local \"task\" is already READY when createConversation returns, so\n // there's nothing to poll for.\n return null;\n }\n\n static async getVSCodeUrl(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<GetVSCodeUrlResponse> {\n // Local-only path. Cloud conversations read the VSCode URL straight\n // from the cloud-computed `sandbox.exposed_urls` (see\n // `useUnifiedVSCodeUrl` + `useCloudSandbox`); the runtime's own\n // `/api/vscode/url` only knows its internal `localhost:8001`, which\n // the user's browser can't reach.\n const workspaceDir =\n await this.resolveConversationWorkingDir(conversationId);\n // Local mode: the typescript-client targets the local agent-server\n // directly via the conversationUrl override.\n const vscodeUrl = await new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getUrl({\n baseUrl:\n typeof window !== \"undefined\" ? window.location.origin : undefined,\n workspaceDir,\n });\n\n return { vscode_url: vscodeUrl };\n }\n\n /**\n * Read the editor's capability state from the agent-server.\n *\n * `/api/vscode/status` answers 200 with `enabled: false` when the\n * deployment set `enable_vscode: false`, which distinguishes \"this\n * deployment offers no editor\" from a transport, auth, or server\n * failure — `/api/vscode/url` answers 503 for the former and so\n * cannot be told apart from the latter.\n */\n static async getVSCodeStatus(\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<VSCodeStatusResponse> {\n return new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getStatus();\n }\n\n static async resolveConversationWorkingDir(\n conversationId: string,\n ): Promise<string> {\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return conversation?.workspace?.working_dir ?? getAgentServerWorkingDir();\n }\n\n static async batchGetAppConversations(\n ids: string[],\n ): Promise<(AppConversation | null)[]> {\n if (ids.length === 0) return [];\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n return batchGetCloudConversations(ids);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).getConversations<DirectConversationInfo>(ids);\n\n return requireDirectConversationItems(data).map((item) =>\n toAppConversation(item),\n );\n }\n\n static async updateConversationPublicFlag(\n conversationId: string,\n isPublic: boolean,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind !== \"cloud\") {\n throw new Error(\"Public sharing requires a cloud backend.\");\n }\n return updateCloudConversationPublicFlag(conversationId, isPublic);\n }\n\n static async updateConversationRepository(\n conversationId: string,\n repository: string | null,\n branch?: string | null,\n gitProvider?: string | null,\n ): Promise<AppConversation> {\n if (repository) {\n const existing = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...(existing ?? {}),\n selected_repository: repository,\n selected_branch: branch ?? null,\n git_provider: (gitProvider as Provider | null | undefined) ?? null,\n });\n } else {\n removeStoredConversationMetadata(conversationId);\n }\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n static async readConversationFile(\n conversationId: string,\n filePath?: string,\n ): Promise<string> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud exposes a per-conversation file endpoint; the sandbox\n // working dir is fixed (`/workspace/project`), so PLAN.md lives at\n // a known absolute path. Mirrors OpenHands' readConversationFile.\n const path = requirePathInsideDirectory(\n filePath ?? \"/workspace/project/.agents_tmp/PLAN.md\",\n \"/workspace/project\",\n );\n return readCloudConversationFile(conversationId, path);\n }\n\n const workingDir = await this.resolveConversationWorkingDir(conversationId);\n const path = requirePathInsideDirectory(\n filePath ?? `${workingDir}/.agents_tmp/PLAN.md`,\n workingDir,\n );\n return new FileClient(getAgentServerClientOptions()).downloadTextFile(path);\n }\n\n static async downloadConversation(conversationId: string): Promise<Blob> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return downloadCloudConversation(conversationId);\n }\n\n return new FileClient(getAgentServerClientOptions()).downloadTrajectory(\n conversationId,\n );\n }\n\n static async getHooks(conversationId: string): Promise<GetHooksResponse> {\n if (!conversationId) {\n return emptyHooksResponse();\n }\n return emptyHooksResponse();\n }\n\n static async getRuntimeConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<RuntimeConversationInfo> {\n // Fetch directly from the per-conversation runtime agent-server at conversationUrl.\n const response = await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<DirectConversationInfo>(conversationId);\n const data = requireDirectConversationInfo(response);\n\n return {\n id: data.id,\n title: data.title?.trim()\n ? data.title\n : getDefaultConversationTitle(data.id),\n metrics: normalizeMetrics(data.metrics),\n created_at: data.created_at,\n updated_at: data.updated_at,\n status: toRuntimeStatus(data.execution_status),\n stats: data.stats ?? { usage_to_metrics: {} },\n };\n }\n\n /**\n * Force condensation (\"compact\") of the conversation history via\n * `POST /api/conversations/{id}/condense`. Routed the same way as\n * {@link sendMessage}: through the cloud proxy at the conversation's own\n * runtime host for cloud backends, directly against that runtime otherwise.\n */\n static async condenseConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<void> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationUrl) {\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/condense`,\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n return;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).condenseConversation(conversationId);\n }\n\n static async searchConversations(\n limit: number = 20,\n pageId?: string,\n ): Promise<AppConversationPage> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return searchCloudConversations(limit, pageId);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).searchConversations({\n limit,\n page_id: pageId,\n sort_order: ConversationSortOrder.UPDATED_AT_DESC,\n });\n\n return toConversationPage(requireConversationSearchPage(data));\n }\n\n static async deleteConversation(conversationId: string): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await deleteCloudConversation(conversationId);\n } else {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).deleteConversation(conversationId);\n }\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return updateCloudConversationTitle(conversationId, title);\n }\n\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n title,\n });\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n /**\n * Forks a conversation, copying event history up to and including\n * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for\n * `from_event_id` (older backends copy the whole conversation).\n */\n static async forkConversation(\n sourceConversationId: string,\n fromEventId: string,\n title?: string,\n ): Promise<DirectConversationInfo> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\n \"Branching a conversation isn't supported on the cloud backend yet.\",\n );\n }\n\n // `from_event_id` is accepted by `/fork` but not yet typed in\n // ForkConversationRequest (through client 1.32.0); the client forwards the\n // body verbatim, so cast to carry it. A title also suppresses the backend\n // auto-title, so the \"(branch)\" marker sticks.\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).forkConversation<DirectConversationInfo>(sourceConversationId, {\n from_event_id: fromEventId,\n ...(title ? { title } : {}),\n } as ForkConversationRequest & { from_event_id: string });\n\n // Carry over the source's client-side metadata (repo/branch/workspace/\n // profile/plugins) so the fork hydrates its chat-page badges the same way.\n const sourceMetadata = getStoredConversationMetadata(sourceConversationId);\n if (sourceMetadata) {\n setStoredConversationMetadata(data.id, sourceMetadata);\n }\n\n return data;\n }\n\n /**\n * Returns an event's `parent_id` (the fork point for branching *before* it),\n * or undefined at the root. Uses the single-event endpoint because the events\n * *search* API omits `parent_id`.\n */\n static async getEventParentId(\n conversationId: string,\n eventId: string,\n ): Promise<string | undefined> {\n const event = (await new ConversationClient(\n getAgentServerClientOptions(),\n ).getEvent(conversationId, eventId)) as { parent_id?: string | null };\n return event.parent_id ?? undefined;\n }\n\n /**\n * Switches the LLM profile for the running conversation when one is open\n * (POST /switch_profile — per-conversation swap, doesn't change the user's\n * default profile). When called without a conversationId (home page),\n * falls back to POST /activate so the next conversation created picks up\n * the chosen profile.\n *\n * The per-conversation endpoint accepts only the profile name, so the UI does\n * not need to fetch or forward profile secrets. That keeps switching working\n * even when the agent server has no OH_SECRET_KEY for encrypted secret export.\n *\n * Cloud backends route to the app-server's per-conversation\n * `/switch_profile`, which owns the profiles and resolves the swap\n * server-side (base_url/api_key fixups, usage_id derivation, then the\n * agent-server's switch_llm) — so the client only forwards the profile name,\n * mirroring {@link switchAcpModel}.\n */\n static async switchProfile(\n conversationId: string | null,\n profileName: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n\n if (backend.kind === \"cloud\") {\n // No conversation (home page): activate globally so the next\n // conversation starts with it. ProfilesService routes to the cloud\n // activate endpoint.\n if (!conversationId) {\n await ProfilesService.activateProfile(profileName);\n return;\n }\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_profile`,\n body: { profile_name: profileName },\n });\n return;\n }\n\n if (!conversationId) {\n await new ProfilesClient(getAgentServerClientOptions()).activateProfile(\n profileName,\n );\n return;\n }\n\n const clientOptions = getAgentServerClientOptions();\n const conversationClient = new ConversationClient(clientOptions);\n const profile = await new ProfilesClient(clientOptions).getProfile(\n profileName,\n { exposeSecrets: \"encrypted\" },\n );\n const model =\n typeof profile.config.model === \"string\" ? profile.config.model : \"\";\n if (!model) throw new Error(`Profile '${profileName}' has no model.`);\n await assertSubscriptionAuthReady({ llm: profile.config });\n await conversationClient.switchLLM(conversationId, {\n ...profile.config,\n model,\n // Keep streaming on after a switch (parity with conversation start);\n // the profile config would otherwise default it to stream=False.\n stream: true,\n // Avoid stale first-write-wins entries in the backend LLM registry.\n usage_id: `profile:${profileName}:${uuidv4()}`,\n } as LLMConfig);\n }\n\n /**\n * Switches the model of a running ACP conversation in place (POST\n * /switch_acp_model — the ACP analog of {@link switchProfile}'s /switch_profile).\n * The agent-server calls the ACP wrapper's ``session/set_model`` on the live\n * session, preserving context. Mirrors {@link switchProfile}'s\n * local-backend-only guard and per-conversation ConversationClient call.\n *\n * Works on a created-but-not-yet-run conversation too: the agent-server\n * treats a pre-first-run switch as a persist-only deferral (the model is\n * mirrored into the conversation's stored agent and applied when the session\n * starts). The home/no-conversation default is persisted via the active ACP\n * profile / Settings instead (see ``use-switch-acp-model``).\n */\n static async switchAcpModel(\n conversationId: string,\n model: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n if (backend.kind === \"cloud\") {\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_acp_model`,\n body: { model },\n });\n return;\n }\n\n await new ConversationClient(getAgentServerClientOptions()).switchAcpModel(\n conversationId,\n model,\n );\n }\n}\n\nexport default AgentServerConversationService;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4EA,IAAM,IAAiC,4BAIjC,IAAiC,MAAS,KAC1C,IACJ;AAGF,SAAS,IAAqC;CAC5C,OAAO,gBAAI,MAAM,CAAqC;AACxD;AAEA,SAAS,EAAS,GAAkD;CAClE,OAAO,OAAO,KAAU,cAAY,KAAkB,CAAC,MAAM,QAAQ,CAAK;AAC5E;AAEA,SAAS,EAAa,GAA+B;CACnD,OAAO,OAAO,KAAU,WAAW,IAAQ;AAC7C;AAEA,SAAS,EAAa,GAAwB;CAC5C,OAAO,OAAO,KAAU,WAAW,IAAQ;AAC7C;AAEA,SAAS,EAAa,GAA+B;CACnD,OAAO,OAAO,KAAU,WAAW,IAAQ;AAC7C;AA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;GACX;GAGA,QAAQ;GAER,UAAU,WAAW,EAAY,GAAG,EAAO;EAC7C,CAAc;CAChB;CAeA,aAAa,eACX,GACA,GACe;EACf,IAAM,EAAE,eAAY,EAAiB;EACrC,IAAI,EAAQ,SAAS,SAAS;GAC5B,MAAM,EAAe;IACnB;IACA,QAAQ;IACR,MAAM,6BAA6B,EAAe;IAClD,MAAM,EAAE,SAAM;GAChB,CAAC;GACD;EACF;EAEA,MAAM,IAAI,EAAmB,EAA4B,CAAC,EAAE,eAC1D,GACA,CACF;CACF;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const t=require("../../utils/websocket-url.cjs"),n=require("../backend-registry/active-store.cjs"),r=require("../agent-server-client-options.cjs"),i=require("
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const t=require("../../utils/websocket-url.cjs"),n=require("../backend-registry/active-store.cjs"),r=require("../agent-server-client-options.cjs"),i=require("../../node_modules/@openhands/typescript-client/dist/events/remote-events-list.cjs"),a=require("../cloud/proxy.cjs");var o=class{static async respondToConfirmation(i,o,s,c){let l=n.getActiveBackend().backend;return l.kind===`cloud`?a.callCloudProxy({backend:l,method:`POST`,hostOverride:t.buildHttpBaseUrl(o),path:`/api/conversations/${i}/events/respond_to_confirmation`,body:s,authMode:`session-api-key`,sessionApiKey:c}):new e.ConversationClient(r.getAgentServerClientOptions({conversationUrl:o,sessionApiKey:c})).respondToConfirmation(i,s)}static async getEventCount(i,o,s){let c=n.getActiveBackend().backend;return c.kind===`cloud`?a.callCloudProxy({backend:c,method:`GET`,hostOverride:t.buildHttpBaseUrl(o),path:`/api/conversations/${i}/events/count`,authMode:`session-api-key`,sessionApiKey:s}):new e.ConversationClient(r.getAgentServerClientOptions({conversationUrl:o,sessionApiKey:s})).getEventCount(i)}static async searchEvents(e,t,o,s={}){let c=n.getActiveBackend().backend,l=s.limit??100;if(c.kind===`cloud`){let t=Math.min(l,100),n=!!(s.sortOrder||s.pageId||s.timestampGte||s.timestampLt),r=new URLSearchParams;r.set(`limit`,String(t)),s.sortOrder&&r.set(`sort_order`,s.sortOrder),s.pageId&&r.set(`page_id`,s.pageId),s.timestampGte&&r.set(`timestamp__gte`,s.timestampGte),s.timestampLt&&r.set(`timestamp__lt`,s.timestampLt);let i=t=>a.callCloudProxy({backend:c,method:`GET`,path:`/api/v1/conversation/${e}/events/search?${t.toString()}`});try{let e=await i(r);return{items:e?.items??[],next_page_id:e?.next_page_id??null}}catch(e){if(!n||s.strictPagination)throw e;return console.warn(`[EventService] Cloud backend doesn't support pagination filters. Falling back to initial load only. Server needs OpenHands/OpenHands#14399.`),{items:[],next_page_id:null}}}let u=await new i.RemoteEventsList(r.getAgentServerHttpClientOptions({conversationUrl:t,sessionApiKey:o}),e).search({limit:l,...s.pageId?{page_id:s.pageId}:{},...s.sortOrder?{sort_order:s.sortOrder}:{},...s.timestampGte?{timestamp__gte:s.timestampGte}:{},...s.timestampLt?{timestamp__lt:s.timestampLt}:{}});return{items:u?.items??[],next_page_id:u?.next_page_id??null}}};exports.default=o;
|
|
2
2
|
//# sourceMappingURL=event-service.api.cjs.map
|
|
@@ -3,36 +3,36 @@ import "../../node_modules/@openhands/typescript-client/dist/clients.js";
|
|
|
3
3
|
import { buildHttpBaseUrl as t } from "../../utils/websocket-url.js";
|
|
4
4
|
import { getActiveBackend as n } from "../backend-registry/active-store.js";
|
|
5
5
|
import { getAgentServerClientOptions as r, getAgentServerHttpClientOptions as i } from "../agent-server-client-options.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { RemoteEventsList as a } from "../../node_modules/@openhands/typescript-client/dist/events/remote-events-list.js";
|
|
7
|
+
import { callCloudProxy as o } from "../cloud/proxy.js";
|
|
8
8
|
//#region src/api/event-service/event-service.api.ts
|
|
9
9
|
var s = class {
|
|
10
|
-
static async respondToConfirmation(i,
|
|
10
|
+
static async respondToConfirmation(i, a, s, c) {
|
|
11
11
|
let l = n().backend;
|
|
12
|
-
return l.kind === "cloud" ?
|
|
12
|
+
return l.kind === "cloud" ? o({
|
|
13
13
|
backend: l,
|
|
14
14
|
method: "POST",
|
|
15
|
-
hostOverride: t(
|
|
15
|
+
hostOverride: t(a),
|
|
16
16
|
path: `/api/conversations/${i}/events/respond_to_confirmation`,
|
|
17
17
|
body: s,
|
|
18
18
|
authMode: "session-api-key",
|
|
19
19
|
sessionApiKey: c
|
|
20
20
|
}) : new e(r({
|
|
21
|
-
conversationUrl:
|
|
21
|
+
conversationUrl: a,
|
|
22
22
|
sessionApiKey: c
|
|
23
23
|
})).respondToConfirmation(i, s);
|
|
24
24
|
}
|
|
25
|
-
static async getEventCount(i,
|
|
25
|
+
static async getEventCount(i, a, s) {
|
|
26
26
|
let c = n().backend;
|
|
27
|
-
return c.kind === "cloud" ?
|
|
27
|
+
return c.kind === "cloud" ? o({
|
|
28
28
|
backend: c,
|
|
29
29
|
method: "GET",
|
|
30
|
-
hostOverride: t(
|
|
30
|
+
hostOverride: t(a),
|
|
31
31
|
path: `/api/conversations/${i}/events/count`,
|
|
32
32
|
authMode: "session-api-key",
|
|
33
33
|
sessionApiKey: s
|
|
34
34
|
}) : new e(r({
|
|
35
|
-
conversationUrl:
|
|
35
|
+
conversationUrl: a,
|
|
36
36
|
sessionApiKey: s
|
|
37
37
|
})).getEventCount(i);
|
|
38
38
|
}
|
|
@@ -41,7 +41,7 @@ var s = class {
|
|
|
41
41
|
if (c.kind === "cloud") {
|
|
42
42
|
let t = Math.min(l, 100), n = !!(s.sortOrder || s.pageId || s.timestampGte || s.timestampLt), r = new URLSearchParams();
|
|
43
43
|
r.set("limit", String(t)), s.sortOrder && r.set("sort_order", s.sortOrder), s.pageId && r.set("page_id", s.pageId), s.timestampGte && r.set("timestamp__gte", s.timestampGte), s.timestampLt && r.set("timestamp__lt", s.timestampLt);
|
|
44
|
-
let i = (t) =>
|
|
44
|
+
let i = (t) => o({
|
|
45
45
|
backend: c,
|
|
46
46
|
method: "GET",
|
|
47
47
|
path: `/api/v1/conversation/${e}/events/search?${t.toString()}`
|
|
@@ -60,7 +60,7 @@ var s = class {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
let u = await new
|
|
63
|
+
let u = await new a(i({
|
|
64
64
|
conversationUrl: t,
|
|
65
65
|
sessionApiKey: r
|
|
66
66
|
}), e).search({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../utils/websocket-url.cjs"),t=require("../backend-registry/active-store.cjs"),n=require("../agent-server-client-options.cjs"),r=require("../agent-server-compatibility.cjs"),i=require("../../node_modules/axios/index.cjs"),a=require("
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../utils/websocket-url.cjs"),t=require("../backend-registry/active-store.cjs"),n=require("../agent-server-client-options.cjs"),r=require("../agent-server-compatibility.cjs"),i=require("../../node_modules/axios/index.cjs"),a=require("../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs"),o=require("../cloud/proxy.cjs"),s=require("../../utils/git-status-mapper.cjs");function c(e){return e.startsWith(`/`)?e:`/${e}`}async function l(r,i,s,l){let u=t.getActiveBackend().backend;if(u.kind===`cloud`&&r){let t=new URLSearchParams({...l,path:c(l.path)});return o.callCloudProxy({backend:u,method:`GET`,hostOverride:e.buildHttpBaseUrl(r),path:`${s}?${t.toString()}`,authMode:`session-api-key`,sessionApiKey:i??void 0})}return(await new a.RemoteWorkspace(n.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).client.get(s,{params:l})).data}function u(e){return r.isSdkHttpStatusError(e,404)||i.isAxiosError(e)&&e.response?.status===404}var d=class{static async getGitChanges(e,r,i,l){let u=t.getActiveBackend().backend;if(u.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,c(l));let n=await o.callCloudProxy({backend:u,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:s.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}let d=await new a.RemoteWorkspace(n.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).gitChanges(l);if(!Array.isArray(d))throw Error(`Invalid response from runtime - runtime may be unavailable`);return d.map(e=>({status:s.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await l(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(u(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await l(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:s.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,r,i,s,u){if(u){let e=await l(r,i,`/api/git/diff`,{path:s,commit:u});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let d=t.getActiveBackend().backend;if(d.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,c(s));let n=await o.callCloudProxy({backend:d,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let f=await new a.RemoteWorkspace(n.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).gitDiff(s);return{modified:f.modified??``,original:f.original??``,...f.diff?{diff:f.diff}:{}}}};exports.default=d;
|
|
2
2
|
//# sourceMappingURL=agent-server-git-service.api.cjs.map
|
|
@@ -3,8 +3,8 @@ import { getActiveBackend as t } from "../backend-registry/active-store.js";
|
|
|
3
3
|
import { getAgentServerClientOptions as n } from "../agent-server-client-options.js";
|
|
4
4
|
import { isSdkHttpStatusError as r } from "../agent-server-compatibility.js";
|
|
5
5
|
import { isAxiosError as i } from "../../node_modules/axios/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { RemoteWorkspace as a } from "../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js";
|
|
7
|
+
import { callCloudProxy as o } from "../cloud/proxy.js";
|
|
8
8
|
import { mapAnyGitStatusToClientStatus as s } from "../../utils/git-status-mapper.js";
|
|
9
9
|
//#region src/api/git-service/agent-server-git-service.api.ts
|
|
10
10
|
function c(e) {
|
|
@@ -17,7 +17,7 @@ async function l(r, i, s, l) {
|
|
|
17
17
|
...l,
|
|
18
18
|
path: c(l.path)
|
|
19
19
|
});
|
|
20
|
-
return
|
|
20
|
+
return o({
|
|
21
21
|
backend: u,
|
|
22
22
|
method: "GET",
|
|
23
23
|
hostOverride: e(r),
|
|
@@ -26,7 +26,7 @@ async function l(r, i, s, l) {
|
|
|
26
26
|
sessionApiKey: i ?? void 0
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
return (await new
|
|
29
|
+
return (await new a(n({
|
|
30
30
|
conversationUrl: r,
|
|
31
31
|
sessionApiKey: i
|
|
32
32
|
})).client.get(s, { params: l })).data;
|
|
@@ -40,7 +40,7 @@ var d = class {
|
|
|
40
40
|
if (u.kind === "cloud" && e) {
|
|
41
41
|
let t = new URLSearchParams();
|
|
42
42
|
t.set("path", c(l));
|
|
43
|
-
let n = await
|
|
43
|
+
let n = await o({
|
|
44
44
|
backend: u,
|
|
45
45
|
method: "GET",
|
|
46
46
|
path: `/api/v1/app-conversations/${e}/git/changes?${t.toString()}`
|
|
@@ -51,7 +51,7 @@ var d = class {
|
|
|
51
51
|
path: e.path
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
54
|
-
let d = await new
|
|
54
|
+
let d = await new a(n({
|
|
55
55
|
conversationUrl: r,
|
|
56
56
|
sessionApiKey: i
|
|
57
57
|
})).gitChanges(l);
|
|
@@ -106,7 +106,7 @@ var d = class {
|
|
|
106
106
|
if (d.kind === "cloud" && e) {
|
|
107
107
|
let t = new URLSearchParams();
|
|
108
108
|
t.set("path", c(s));
|
|
109
|
-
let n = await
|
|
109
|
+
let n = await o({
|
|
110
110
|
backend: d,
|
|
111
111
|
method: "GET",
|
|
112
112
|
path: `/api/v1/app-conversations/${e}/git/diff?${t.toString()}`
|
|
@@ -117,7 +117,7 @@ var d = class {
|
|
|
117
117
|
...n?.diff ? { diff: n.diff } : {}
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
let f = await new
|
|
120
|
+
let f = await new a(n({
|
|
121
121
|
conversationUrl: r,
|
|
122
122
|
sessionApiKey: i
|
|
123
123
|
})).gitDiff(s);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const t=require("../../utils/websocket-url.cjs"),n=require("../backend-registry/active-store.cjs"),r=require("../agent-server-client-options.cjs"),i=require("
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const t=require("../../utils/websocket-url.cjs"),n=require("../backend-registry/active-store.cjs"),r=require("../agent-server-client-options.cjs"),i=require("../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs"),a=require("../cloud/proxy.cjs");var o=class{static async executeCommand(e,o,s,c,l=30){let u=n.getActiveBackend().backend;if(u.kind===`cloud`&&e){let n=await a.callCloudProxy({backend:u,method:`POST`,hostOverride:t.buildHttpBaseUrl(e),path:`/api/bash/execute_bash_command`,body:{command:s,...c?{cwd:c}:{},timeout:Math.floor(l)},authMode:`session-api-key`,sessionApiKey:o,timeoutSeconds:l+10});return{exit_code:n.exit_code??-1,stdout:n.stdout??``,stderr:n.stderr??``}}let d=await new i.RemoteWorkspace(r.getAgentServerClientOptions({conversationUrl:e,sessionApiKey:o})).executeCommand(s,c,l);return{exit_code:d.exit_code,stdout:d.stdout,stderr:d.stderr}}static async downloadFile(i,o,s){let c=n.getActiveBackend().backend;return c.kind===`cloud`&&i?(await a.callCloudProxy({backend:c,method:`GET`,hostOverride:t.buildHttpBaseUrl(i),path:`/api/file/download?path=${encodeURIComponent(s)}`,authMode:`session-api-key`,sessionApiKey:o,responseType:`blob`})).arrayBuffer():new e.FileClient(r.getAgentServerClientOptions({conversationUrl:i,sessionApiKey:o})).downloadFile(s)}};exports.default=o;
|
|
2
2
|
//# sourceMappingURL=agent-server-runtime-service.cjs.map
|
|
@@ -3,14 +3,14 @@ import "../../node_modules/@openhands/typescript-client/dist/clients.js";
|
|
|
3
3
|
import { buildHttpBaseUrl as t } from "../../utils/websocket-url.js";
|
|
4
4
|
import { getActiveBackend as n } from "../backend-registry/active-store.js";
|
|
5
5
|
import { getAgentServerClientOptions as r } from "../agent-server-client-options.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { RemoteWorkspace as i } from "../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js";
|
|
7
|
+
import { callCloudProxy as a } from "../cloud/proxy.js";
|
|
8
8
|
//#region src/api/runtime-service/agent-server-runtime-service.ts
|
|
9
9
|
var o = class {
|
|
10
10
|
static async executeCommand(e, o, s, c, l = 30) {
|
|
11
11
|
let u = n().backend;
|
|
12
12
|
if (u.kind === "cloud" && e) {
|
|
13
|
-
let n = await
|
|
13
|
+
let n = await a({
|
|
14
14
|
backend: u,
|
|
15
15
|
method: "POST",
|
|
16
16
|
hostOverride: t(e),
|
|
@@ -30,7 +30,7 @@ var o = class {
|
|
|
30
30
|
stderr: n.stderr ?? ""
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
let d = await new
|
|
33
|
+
let d = await new i(r({
|
|
34
34
|
conversationUrl: e,
|
|
35
35
|
sessionApiKey: o
|
|
36
36
|
})).executeCommand(s, c, l);
|
|
@@ -40,18 +40,18 @@ var o = class {
|
|
|
40
40
|
stderr: d.stderr
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
static async downloadFile(
|
|
43
|
+
static async downloadFile(i, o, s) {
|
|
44
44
|
let c = n().backend;
|
|
45
|
-
return c.kind === "cloud" &&
|
|
45
|
+
return c.kind === "cloud" && i ? (await a({
|
|
46
46
|
backend: c,
|
|
47
47
|
method: "GET",
|
|
48
|
-
hostOverride: t(
|
|
48
|
+
hostOverride: t(i),
|
|
49
49
|
path: `/api/file/download?path=${encodeURIComponent(s)}`,
|
|
50
50
|
authMode: "session-api-key",
|
|
51
51
|
sessionApiKey: o,
|
|
52
52
|
responseType: "blob"
|
|
53
53
|
})).arrayBuffer() : new e(r({
|
|
54
|
-
conversationUrl:
|
|
54
|
+
conversationUrl: i,
|
|
55
55
|
sessionApiKey: o
|
|
56
56
|
})).downloadFile(s);
|
|
57
57
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/settings-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const t=require("../backend-registry/active-store.cjs"),n=require("../agent-server-client-options.cjs"),r=require("../../services/settings.cjs"),i=require("../../utils/mcp-config.cjs"),a=require("../cloud/settings-service.api.cjs");var o=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`],s=new Set(o),c=e=>s.has(e),l=e=>{let t={},n={};for(let[r,i]of Object.entries(e))c(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},u=e=>JSON.parse(JSON.stringify(e)),d=(e,t)=>({...e??{},...t??{}});async function f(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var p={redacted:null,encrypted:null,timestamp:0},m=300*1e3,h=()=>Date.now()-p.timestamp<m,g=()=>{p={redacted:null,encrypted:null,timestamp:0}},_=e=>!!e&&typeof e==`object`&&!Array.isArray(e),v=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,y=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:v(e.username,e.password)};case`header`:return i.stringRecord(e.headers)??{};case`oauth2`:{let t=_(e.state)?e.state.tokens:void 0;return!_(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},b=async e=>{if(!_(e))return e;let n=_(e.mcpServers),r=n?e.mcpServers:e,o=Object.values(r).some(e=>_(e)&&_(e.auth)&&e.auth!==null)&&t.getActiveBackend().backend.kind===`cloud`,s=new Map;if(o)try{let e=await a.fetchCloudSettings(),t=_(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(_(n)){let t=i.stringRecord(n.headers);t&&s.set(e,t)}}catch{}let c=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!_(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!_(t.auth))return[e,t];let n=y(t.auth);if(n===null)return[e,t];let r={...t},a={...i.stringRecord(t.headers)??{},...n},o=s.get(e);if(o)for(let e of Object.keys(o))e in a||(a[e]=null);return delete r.auth,Object.keys(a).length>0?r.headers=a:delete r.headers,[e,r]}));return n?{...e,mcpServers:c}:c},x=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of o){let r=n[e];r!==void 0&&(t[e]=r)}return t},S=e=>{let t=d(r.DEFAULT_SETTINGS.agent_settings??{},e.agent_settings??{}),n=d(r.DEFAULT_SETTINGS.conversation_settings??{},e.conversation_settings??{}),i={...u(r.DEFAULT_SETTINGS),...e,provider_tokens_set:{...r.DEFAULT_SETTINGS.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(i.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(i.llm_model=a.model),typeof a?.base_url==`string`&&(i.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(i.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(i.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(i.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(i.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(i.max_iterations=n.max_iterations),i.search_api_key_set=!!i.search_api_key,i},C=class r{static async fetchSettingsFromApi(t){return f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).getSettings({exposeSecrets:t}))}static async getSettings(){if(t.getActiveBackend().backend.kind===`cloud`)try{return S(await f(()=>a.fetchCloudSettings()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),S({})}if(h()&&p.redacted)return S(x(p.redacted));try{let e=await this.fetchSettingsFromApi();return p.redacted=e,p.timestamp=Date.now(),S(x(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),S({})}}static async getSettingsForConversation(){if(h()&&p.encrypted)return{agentSettings:p.encrypted.agent_settings,conversationSettings:p.encrypted.conversation_settings,secretsEncrypted:!0};let e=await this.fetchSettingsFromApi(`encrypted`);return p.encrypted=e,p.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0}}static async getSettingsSchema(){return t.getActiveBackend().backend.kind===`cloud`?await a.fetchCloudSettingsSchema():await new e.SettingsClient(n.getAgentServerClientOptions()).getAgentSchema()}static async getConversationSettingsSchema(){return t.getActiveBackend().backend.kind===`cloud`?await a.fetchCloudConversationSettingsSchema():await new e.SettingsClient(n.getAgentServerClientOptions()).getConversationSchema()}static async patchMcpConfig(r){if(t.getActiveBackend().backend.kind===`cloud`){let e=await b(r);await f(()=>a.saveCloudSettings({agent_settings_diff:{mcp_config:e}}))}else await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).updateSettings({agent_settings_diff:{mcp_config:r}}));return g(),!0}static async patchMcpServer(i,a){return t.getActiveBackend().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).patchMcpServer(i,a)),g(),!0)}static async createMcpServer(i,a){return t.getActiveBackend().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).createMcpServer(i,a)),g(),!0)}static async deleteMcpServer(i){return t.getActiveBackend().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).deleteMcpServer(i)),g(),!0)}static async saveSettings(r){let{extracted:i,rest:o}=l(r),s=Object.keys(i).length>0,c={},u=o.agent_settings_diff;u&&Object.keys(u).length>0&&(c.agent_settings_diff=u);let d=o.conversation_settings_diff;if(d&&Object.keys(d).length>0&&(c.conversation_settings_diff=d),s&&(c.misc_settings_diff={app_preferences:i}),t.getActiveBackend().backend.kind===`cloud`){if(!(c.agent_settings_diff||c.conversation_settings_diff||s))return!0;let e={};c.agent_settings_diff&&(e.agent_settings_diff={...c.agent_settings_diff},`mcp_config`in e.agent_settings_diff&&(e.agent_settings_diff.mcp_config=await b(e.agent_settings_diff.mcp_config))),c.conversation_settings_diff&&(e.conversation_settings_diff=c.conversation_settings_diff),s&&(e.app_preferences=i),await f(()=>a.saveCloudSettings(e))}else{if(!(c.agent_settings_diff||c.conversation_settings_diff||c.misc_settings_diff))return!0;await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).updateSettings(c))}return g(),!0}static invalidateCache(){g()}};exports.default=C;
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/settings-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const t=require("../backend-registry/active-store.cjs"),n=require("../agent-server-client-options.cjs"),r=require("../../services/settings.cjs"),i=require("../../utils/mcp-config.cjs"),a=require("../cloud/settings-service.api.cjs");var o=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`,`enabled_skills`],s=new Set(o),c=e=>s.has(e),l=e=>{let t={},n={};for(let[r,i]of Object.entries(e))c(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},u=e=>JSON.parse(JSON.stringify(e)),d=(e,t)=>({...e??{},...t??{}});async function f(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var p={redacted:null,encrypted:null,timestamp:0},m=300*1e3,h=()=>Date.now()-p.timestamp<m,g=()=>{p={redacted:null,encrypted:null,timestamp:0}},_=e=>!!e&&typeof e==`object`&&!Array.isArray(e),v=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,y=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:v(e.username,e.password)};case`header`:return i.stringRecord(e.headers)??{};case`oauth2`:{let t=_(e.state)?e.state.tokens:void 0;return!_(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},b=async e=>{if(!_(e))return e;let n=_(e.mcpServers),r=n?e.mcpServers:e,o=Object.values(r).some(e=>_(e)&&_(e.auth)&&e.auth!==null)&&t.getActiveBackend().backend.kind===`cloud`,s=new Map;if(o)try{let e=await a.fetchCloudSettings(),t=_(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(_(n)){let t=i.stringRecord(n.headers);t&&s.set(e,t)}}catch{}let c=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!_(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!_(t.auth))return[e,t];let n=y(t.auth);if(n===null)return[e,t];let r={...t},a={...i.stringRecord(t.headers)??{},...n},o=s.get(e);if(o)for(let e of Object.keys(o))e in a||(a[e]=null);return delete r.auth,Object.keys(a).length>0?r.headers=a:delete r.headers,[e,r]}));return n?{...e,mcpServers:c}:c},x=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of o){let r=n[e];r!==void 0&&(t[e]=r)}return t},S=e=>{let t=d(r.DEFAULT_SETTINGS.agent_settings??{},e.agent_settings??{}),n=d(r.DEFAULT_SETTINGS.conversation_settings??{},e.conversation_settings??{}),i={...u(r.DEFAULT_SETTINGS),...e,provider_tokens_set:{...r.DEFAULT_SETTINGS.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(i.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(i.llm_model=a.model),typeof a?.base_url==`string`&&(i.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(i.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(i.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(i.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(i.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(i.max_iterations=n.max_iterations),i.search_api_key_set=!!i.search_api_key,i},C=class r{static async fetchSettingsFromApi(t){return f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).getSettings({exposeSecrets:t}))}static async getSettings(){if(t.getActiveBackend().backend.kind===`cloud`)try{return S(await f(()=>a.fetchCloudSettings()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),S({})}if(h()&&p.redacted)return S(x(p.redacted));try{let e=await this.fetchSettingsFromApi();return p.redacted=e,p.timestamp=Date.now(),S(x(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),S({})}}static async getSettingsForConversation(){if(h()&&p.encrypted)return{agentSettings:p.encrypted.agent_settings,conversationSettings:p.encrypted.conversation_settings,secretsEncrypted:!0};let e=await this.fetchSettingsFromApi(`encrypted`);return p.encrypted=e,p.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0}}static async getSettingsSchema(){return t.getActiveBackend().backend.kind===`cloud`?await a.fetchCloudSettingsSchema():await new e.SettingsClient(n.getAgentServerClientOptions()).getAgentSchema()}static async getConversationSettingsSchema(){return t.getActiveBackend().backend.kind===`cloud`?await a.fetchCloudConversationSettingsSchema():await new e.SettingsClient(n.getAgentServerClientOptions()).getConversationSchema()}static async patchMcpConfig(r){if(t.getActiveBackend().backend.kind===`cloud`){let e=await b(r);await f(()=>a.saveCloudSettings({agent_settings_diff:{mcp_config:e}}))}else await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).updateSettings({agent_settings_diff:{mcp_config:r}}));return g(),!0}static async patchMcpServer(i,a){return t.getActiveBackend().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).patchMcpServer(i,a)),g(),!0)}static async createMcpServer(i,a){return t.getActiveBackend().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).createMcpServer(i,a)),g(),!0)}static async deleteMcpServer(i){return t.getActiveBackend().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).deleteMcpServer(i)),g(),!0)}static async saveSettings(r){let{extracted:i,rest:o}=l(r),s=Object.keys(i).length>0,c={},u=o.agent_settings_diff;u&&Object.keys(u).length>0&&(c.agent_settings_diff=u);let d=o.conversation_settings_diff;if(d&&Object.keys(d).length>0&&(c.conversation_settings_diff=d),s&&(c.misc_settings_diff={app_preferences:i}),t.getActiveBackend().backend.kind===`cloud`){if(!(c.agent_settings_diff||c.conversation_settings_diff||s))return!0;let e={};c.agent_settings_diff&&(e.agent_settings_diff={...c.agent_settings_diff},`mcp_config`in e.agent_settings_diff&&(e.agent_settings_diff.mcp_config=await b(e.agent_settings_diff.mcp_config))),c.conversation_settings_diff&&(e.conversation_settings_diff=c.conversation_settings_diff),s&&(e.app_preferences=i),await f(()=>a.saveCloudSettings(e))}else{if(!(c.agent_settings_diff||c.conversation_settings_diff||c.misc_settings_diff))return!0;await f(()=>new e.SettingsClient(n.getAgentServerClientOptions()).updateSettings(c))}return g(),!0}static invalidateCache(){g()}};exports.default=C;
|
|
2
2
|
//# sourceMappingURL=settings-service.api.cjs.map
|