@openhands/agent-canvas 1.0.0-rc.9 → 1.0.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 +46 -31
- package/README.windows.md +2 -2
- package/bin/agent-canvas.mjs +3 -1
- package/build/assets/Trans-CBypf0vt.js +1 -0
- package/build/assets/{acp-providers-Dzb4nxxB.js → acp-providers-BMyF5WII.js} +1 -1
- package/build/assets/active-backend-context-Cy_Ui5d7.js +1 -0
- package/build/assets/add-backend-modal-CUw7x0zm.js +1 -0
- package/build/assets/{agent-server-client-options-wXLeJYeM.js → agent-server-client-options-FoO1qgAQ.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-D6Cmbnhd.js +5 -0
- package/build/assets/{agent-settings-Blipgztd.js → agent-settings-DW4vwOaz.js} +2 -2
- package/build/assets/{alert-banner-Bsvys-hT.js → alert-banner-BHmoArV2.js} +1 -1
- package/build/assets/{analytics-consent-form-modal-Cujm1lCj.js → analytics-consent-form-modal-BNK0yu4L.js} +1 -1
- package/build/assets/api-key-entry-screen-BjVajIjf.js +1 -0
- package/build/assets/app-settings-C-5X6RzZ.js +1 -0
- package/build/assets/automation-detail-uDMoYmAc.js +1 -0
- package/build/assets/automations-list-DBCKCbId.js +1 -0
- package/build/assets/{back-nav-button-D20Avel_.js → back-nav-button-Bckz5Wh6.js} +1 -1
- package/build/assets/backend-form-modal-D2-XqJA4.js +1 -0
- package/build/assets/{backend-synced-settings-badge-Da0G6Lwv.js → backend-synced-settings-badge-Dx16CR_k.js} +1 -1
- package/build/assets/{base-modal-DvuGYyu1.js → base-modal-7QRNzf6r.js} +1 -1
- package/build/assets/{brand-button-9SOzmqPP.js → brand-button-CKLvirxz.js} +1 -1
- package/build/assets/browser-D1ZybR7v.js +5 -0
- package/build/assets/browser-store-hzasvz9c.js +1 -0
- package/build/assets/{browser-tab-bveyJhG9.js → browser-tab-iOQjXzmI.js} +1 -1
- package/build/assets/chat-send-button-_Uc9iFpG.js +1 -0
- package/build/assets/check-DfvhVBub.js +1 -0
- package/build/assets/{checkmark--JWAesua.js → checkmark-BHPhb50L.js} +1 -1
- package/build/assets/{chevron-down-B9j6lcFg.js → chevron-down-CMkqyPEY.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-AO9DWyDX.js → circle-plus-check-toggle-ChmnRlpR.js} +1 -1
- package/build/assets/{close--W-tHn1h.js → close-DBs90sI6.js} +1 -1
- package/build/assets/{code-tag-chmctf4w.js → code-tag-BtHOqHwB.js} +1 -1
- package/build/assets/{color-themes-0biOprdo.js → color-themes-CBikRn3w.js} +1 -1
- package/build/assets/{combobox-caret-C9BNHfSu.js → combobox-caret-evUAh6YW.js} +1 -1
- package/build/assets/{command-store-UzKGSUC2.js → command-store-DZfR8QtE.js} +1 -1
- package/build/assets/condenser-settings-0tw3yXX8.js +1 -0
- package/build/assets/{confirmation-modal-Cq3eqvqH.js → confirmation-modal-DWuxe1zG.js} +1 -1
- package/build/assets/{context-menu-list-item-BQU0jZPq.js → context-menu-list-item-BbHFxHaq.js} +1 -1
- package/build/assets/conversation-B1v96pQf.js +19 -0
- package/build/assets/conversation-DgfcjCPm.js +1 -0
- package/build/assets/{conversation-local-storage-an3MiIiJ.js → conversation-local-storage-Btum2xBJ.js} +1 -1
- package/build/assets/conversation-panel-TJ7swm6a.js +1 -0
- package/build/assets/conversation-service.api-DXawvmNN.js +1 -0
- package/build/assets/conversation-state-store-DmuPn875.js +1 -0
- package/build/assets/{conversation-store-FQmakEd-.js → conversation-store-Bu89Yxg1.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-C8tztloo.js → conversation-tab-empty-state-7js7FjYM.js} +1 -1
- package/build/assets/{copy-CdKN5rtJ.js → copy-B0SkXenR.js} +1 -1
- package/build/assets/copy-to-clipboard-button-CfH2EQz9.js +1 -0
- package/build/assets/{createLucideIcon-CkGTf9Qj.js → createLucideIcon-Bazr-V-B.js} +1 -1
- package/build/assets/declaration-Cn-NXHEy.js +1 -0
- package/build/assets/{device-verify-YuGXnpRk.js → device-verify-CWKyQ680.js} +1 -1
- package/build/assets/{dist-5dObF4p4.js → dist-Cbu6eGx8.js} +1 -1
- package/build/assets/dist-Dg2JWLGc.js +1 -0
- package/build/assets/{dropdown-classes-CVp0kVdt.js → dropdown-classes-BI1bI1ho.js} +1 -1
- package/build/assets/edit-automation-modal-DdAG6kFZ.js +1 -0
- package/build/assets/{ellipsis-button-k7HLwYth.js → ellipsis-button-DdCsOBHV.js} +1 -1
- package/build/assets/entry.client-DXyvKj5G.js +2 -0
- package/build/assets/{enum-filter-dropdown-COqUq3mB.js → enum-filter-dropdown-WROAIeys.js} +1 -1
- package/build/assets/{environment-switch-overlay-wB5LxfYZ.js → environment-switch-overlay-Dv0imPE6.js} +1 -1
- package/build/assets/{extensions-hub-BYCLWP3d.js → extensions-hub-CkyDPXvn.js} +1 -1
- package/build/assets/{extensions-navigation-3FLKfb6g.js → extensions-navigation-gMR-la1J.js} +1 -1
- package/build/assets/{external-link-BATfjnkz.js → external-link-FsutnU75.js} +1 -1
- package/build/assets/files-tab-DNUoveJZ.js +1 -0
- package/build/assets/files-tab-store-SyvkH3ic.js +1 -0
- package/build/assets/{folder-DPTBlxWb.js → folder-DusyBXDE.js} +1 -1
- package/build/assets/{globe-Dpgjreyy.js → globe-BUcin4kT.js} +1 -1
- package/build/assets/home-D809jWVS.js +1 -0
- package/build/assets/{iconBase-BVhFI-0E.js → iconBase-B6CXDDaE.js} +1 -1
- package/build/assets/index-redirect-nMYgOTBX.js +1 -0
- package/build/assets/install-server-modal-D92Qy57I.js +1 -0
- package/build/assets/{launch-CMZknx1e.js → launch-BnCG2g2a.js} +1 -1
- package/build/assets/lesson-plan-j-ZaE8vK.js +3 -0
- package/build/assets/{lightbulb-S616sGEL.js → lightbulb-BJ5tWmAh.js} +1 -1
- package/build/assets/{link-external-ooNztGLp.js → link-external-DUtmHAHi.js} +1 -1
- package/build/assets/{list-todo-nCa9zxVE.js → list-todo-C-gekh-4.js} +1 -1
- package/build/assets/{llm-client-D6EtdLBs.js → llm-client-BZUkZYlc.js} +1 -1
- package/build/assets/llm-not-configured-banner-PlvJ99rE.js +27 -0
- package/build/assets/llm-settings-Dgk32xRW.js +1 -0
- package/build/assets/llm-settings-Dxo7owKm.js +1 -0
- package/build/assets/llm-subscription-Bvu8BLXc.js +1 -0
- package/build/assets/llm-subscription-service-Bq6z3Wkv.js +1 -0
- package/build/assets/loader-circle-Cw7_q9hg.js +1 -0
- package/build/assets/{loading-spinner-D7bOU6I7.js → loading-spinner-RF3IlMF5.js} +1 -1
- package/build/assets/manage-backends-modal-BT66a6e0.js +1 -0
- package/build/assets/manifest-b8402d59.js +1 -0
- package/build/assets/markdown-renderer-Tw6FR2ad.js +2 -0
- package/build/assets/mcp-B_pA7vZg.js +9 -0
- package/build/assets/mcp-client-ppbYplKX.js +1 -0
- package/build/assets/messages-Cg9aNVi6.js +41 -0
- package/build/assets/{modal-backdrop-_VbcKk5K.js → modal-backdrop-DRpBVVW5.js} +1 -1
- package/build/assets/{modal-body-Cd-PtMHr.js → modal-body-CEV2O67p.js} +1 -1
- package/build/assets/{modal-classes-CNm4ovfm.js → modal-classes-B2DuQ9qD.js} +1 -1
- package/build/assets/{modal-close-button-Dbo0NAMt.js → modal-close-button-gtb7RHFB.js} +1 -1
- package/build/assets/model-selector-CAv3RrJ3.js +1 -0
- package/build/assets/{mouse-pointer-click-D0QNGSIo.js → mouse-pointer-click-B3i6HcaF.js} +1 -1
- package/build/assets/{navigation-context-BpAOh_t5.js → navigation-context-CM9JmTvm.js} +1 -1
- package/build/assets/{navigation-link-Dci7Nuyf.js → navigation-link-FmXzqR1J.js} +1 -1
- package/build/assets/onboarding-Q9CzuVWy.js +1 -0
- package/build/assets/{openhands-logo-Dzm-d_V_.js → openhands-logo-B4aEO2sf.js} +1 -1
- package/build/assets/option-service.api-C-s2BYZp.js +1 -0
- package/build/assets/organization-service.api-CXTKpFnV.js +1 -0
- package/build/assets/{path-utils-DKu3CNkH.js → path-utils-CE98fIFP.js} +1 -1
- package/build/assets/{pencil-DPEtl5QD.js → pencil-bWrxRWlr.js} +1 -1
- package/build/assets/{plan-components-CutRBi0G.js → plan-components-BF-X7vnQ.js} +1 -1
- package/build/assets/{planner-tab-YkOp7QXt.js → planner-tab-jkyaGiRc.js} +1 -1
- package/build/assets/plus-BTCK8WtR.js +1 -0
- package/build/assets/{profiles-client-BjUo3q05.js → profiles-client-CQ9L1yHR.js} +1 -1
- package/build/assets/providers-B3hkV58J.js +1 -0
- package/build/assets/proxy-BOcEWkCD.js +1 -0
- package/build/assets/{react-dom-hVBnwgwZ.js → react-dom-BBXlXOZX.js} +1 -1
- package/build/assets/{react-CM_dJw1Z.js → react-uQK8du1l.js} +1 -1
- package/build/assets/{react-Dy05vyj5.js → react-x84lbX6s.js} +1 -1
- package/build/assets/{recommended-automations-launcher-WxaZcjRD.js → recommended-automations-launcher-DMk35aFI.js} +11 -11
- package/build/assets/root-CV0kyxfP.js +2 -0
- package/build/assets/root-PB2Jnj61.css +1 -0
- package/build/assets/root-layout-Bl4Qzg5J.js +2 -0
- package/build/assets/{runtime-waiting-state-8i0Z3A_i.js → runtime-waiting-state-C1hJpXxl.js} +1 -1
- package/build/assets/sdk-section-page-DHbC2_j3.js +1 -0
- package/build/assets/sdk-settings-schema-z51bBmMl.js +1 -0
- package/build/assets/{search-C_l_XW4e.js → search-Dxm1MUMi.js} +1 -1
- package/build/assets/{secrets-service-Skzza9sx.js → secrets-service-DlScPUwy.js} +1 -1
- package/build/assets/secrets-settings-B97-JKBe.js +1 -0
- package/build/assets/settings-BpmooyBV.js +1 -0
- package/build/assets/{settings-dropdown-input-BP-arqjU.js → settings-dropdown-input-hIIAlmHb.js} +1 -1
- package/build/assets/{settings-gear-f-zWpxfI.js → settings-gear-DQLTCnFx.js} +1 -1
- package/build/assets/{settings-index-BLfmrKRl.js → settings-index-kKASonWk.js} +1 -1
- package/build/assets/{settings-input-BM8ANxDb.js → settings-input-BlOzCtP3.js} +1 -1
- package/build/assets/{settings-list-classes-B9uo5WES.js → settings-list-classes-BFRbCy4U.js} +1 -1
- package/build/assets/settings-modal-C4pZwj-l.js +1 -0
- package/build/assets/{settings-section-header-context-Cid25HM2.js → settings-section-header-context-iz4Go0dL.js} +1 -1
- package/build/assets/settings-service.api-DVLwi82B.js +1 -0
- package/build/assets/{settings-switch-xa6q4M6j.js → settings-switch-6cXIH-UE.js} +1 -1
- package/build/assets/{settings-utils--H_EvFjx.js → settings-utils-CfScEaPn.js} +1 -1
- package/build/assets/shared-conversation-CLkayApe.js +1 -0
- package/build/assets/sidebar-mobile-menu-toggle-C8uT4Mhd.js +1 -0
- package/build/assets/{sidebar-nav-link-BekRAssb.js → sidebar-nav-link-BKZiAQxQ.js} +1 -1
- package/build/assets/{skill-card-pill-row-DeodrwPG.js → skill-card-pill-row-D13WRKIE.js} +1 -1
- package/build/assets/{skills-BE5HJuGM.js → skills-NpRk6v79.js} +1 -1
- package/build/assets/{skills-client-CgraS-wA.js → skills-client-DsqwQEwj.js} +1 -1
- package/build/assets/{skills-plugins-rIza_fUf.js → skills-plugins-bkwxItAw.js} +1 -1
- package/build/assets/{skills-settings-Dvl7gpEx.js → skills-settings-DMbrlB2b.js} +2 -2
- package/build/assets/{square-chevron-right-BWAB7NPp.js → square-chevron-right-DxZKcVq4.js} +1 -1
- package/build/assets/{styled-tooltip-X61SEwqk.js → styled-tooltip-DG1ofAcS.js} +1 -1
- package/build/assets/suspense-sOGeme-f.js +1 -0
- package/build/assets/{switch-skeleton-BbIWemkK.js → switch-skeleton-CZ6XCVZk.js} +1 -1
- package/build/assets/{task-list-tab-BFnyHGsn.js → task-list-tab-CddMPNCD.js} +1 -1
- package/build/assets/telemetry-CX4mTZUw.js +2 -0
- package/build/assets/{terminal-BFypysgZ.js → terminal-BOAVxAej.js} +1 -1
- package/build/assets/{terminal-B92mACR5.js → terminal-DbtwHqt4.js} +1 -1
- package/build/assets/{toggle-switch-CL_wRiGs.js → toggle-switch-C0t6ge2m.js} +1 -1
- package/build/assets/{trash-2-C-RvV8WA.js → trash-2-Dmprz0A0.js} +1 -1
- package/build/assets/{typography-BLSEGjph.js → typography-CNHbO1eE.js} +1 -1
- package/build/assets/{u-check-circle-dG_VJqx5.js → u-check-circle-CX66WzfT.js} +1 -1
- package/build/assets/{u-check-circle-half-D-5ZPRnd.js → u-check-circle-half-Bj853Ub0.js} +1 -1
- package/build/assets/{u-circuit-BXoisXOA.js → u-circuit-B9bLCP7N.js} +1 -1
- package/build/assets/{u-edit-DIgADxLH.js → u-edit-D7JyvoWm.js} +1 -1
- package/build/assets/use-acp-credential-form-Cj_oUYd5.js +1 -0
- package/build/assets/{use-active-conversation-BkohEtaN.js → use-active-conversation-B64-yy2X.js} +1 -1
- package/build/assets/use-agent-settings-schema-BzbQYEzb.js +1 -0
- package/build/assets/{use-agent-state-DITv5qV7.js → use-agent-state-DxFk391r.js} +1 -1
- package/build/assets/{use-breakpoint-DpxHDmuH.js → use-breakpoint-Cent5lpI.js} +1 -1
- package/build/assets/{use-click-outside-element-DhxCUyWl.js → use-click-outside-element-DOYR26nw.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-CSm3kgqy.js → use-cloud-current-user-id-BVf7pb8n.js} +1 -1
- package/build/assets/use-config-CvdJUq4E.js +1 -0
- package/build/assets/use-create-conversation-Cnouynop.js +1 -0
- package/build/assets/{use-create-secret-LObNBU3M.js → use-create-secret-Cgu4uxyr.js} +1 -1
- package/build/assets/{use-event-store-DNSmyzUh.js → use-event-store-Nv92IYMU.js} +1 -1
- package/build/assets/use-handle-plan-click-C7824bbe.js +1 -0
- package/build/assets/use-is-authed-mnJtd2bw.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-BTgXIu3N.js → use-launch-skill-in-chat-NDUo_UCA.js} +1 -1
- package/build/assets/use-llm-profiles-9eH3Y3Ef.js +1 -0
- package/build/assets/use-runtime-is-ready-DEnxJH7W.js +1 -0
- package/build/assets/use-save-settings-DrClHnX7.js +1 -0
- package/build/assets/use-settings-BNAoCX93.js +1 -0
- package/build/assets/{use-settings-nav-items-ykMjd_NG.js → use-settings-nav-items-CLIW2p2n.js} +2 -2
- package/build/assets/{use-skills-_unimM2d.js → use-skills-B9gOHrOj.js} +1 -1
- package/build/assets/{use-task-list-E5t-jtgs.js → use-task-list-DLKPnq3I.js} +1 -1
- package/build/assets/{use-tracking-C9P88zSo.js → use-tracking-Dph_dRlL.js} +1 -1
- package/build/assets/{use-user-conversation-2jZZ-MLA.js → use-user-conversation-leIsQH1B.js} +1 -1
- package/build/assets/useMutation-cXADjWAv.js +1 -0
- package/build/assets/useQuery-BQr6A6ry.js +1 -0
- package/build/assets/useTranslation-Bp1btAjp.js +1 -0
- package/build/assets/{utils-eXk6yerZ.js → utils-o-OXNtEy.js} +1 -1
- package/build/assets/v4-DOSjXdIn.js +1 -0
- package/build/assets/{vendor~browser-tab-BGJDGHyS.js → vendor~browser-tab-642bOcE1.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation-D98u43rl.js → vendor~conversation-panel~conversation-DqmbnXRn.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation~alert-banner-CtjHOMO_.js → vendor~conversation-panel~conversation~alert-banner-CSDVP1nw.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation~index-BXt2-3Cc.js → vendor~conversation-panel~conversation~index-DITarr3F.js} +1 -1
- package/build/assets/{vendor~entry.client-DrAdOKqA.js → vendor~entry.client-CQ77DucR.js} +1 -1
- package/build/assets/{vendor~entry.client-EcEhmoJW.js → vendor~entry.client-ePAFmSwg.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~f0pn7nss-DUk-MwlC.js +177 -0
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~lb3qbbk3-BvmOva8I.js +1 -0
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-Cl4h-NSi.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BkQQxq_q.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-8xF3WeB9.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js → vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~nyk4vv4g-UzR6fe3Y.js} +1 -1
- package/build/assets/{vendor~files-tab--640YzQO.js → vendor~files-tab-Cko7Kr5k.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation-dhKA2JVJ.js → vendor~home~conversation-panel~conversation-D3otw5Jn.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DMOoHVBy.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CMdKUYP2.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BoE6JRJj.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DSR6Mugx.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dqpi2xyZ.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DdOzMvB1.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DX2CmDJ0.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dj2eezvL.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BNExlCqT.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DyN8jeZz.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DCn1M97v.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-lpEWrbMA.js} +1 -1
- package/build/assets/{vendor~launch-C0VvUe2W.js → vendor~launch-DoYO54df.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-COLUW-6M.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-BGwU2SbU.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js → vendor~root-layout~home~conversation-panel~conversation-Iqs0j4Wo.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-7eqKdLSQ.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BdS6bbw9.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BP3MGAAY.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Fd3F3jth.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Dkd2wxJA.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Cg0AqwMN.js} +2 -2
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-BlsbqRyZ.js} +1 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~ec6pk3ix-CBICqfKC.js +48 -0
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DavKsAvB.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~nv6afr11-BYNoKMU0.js} +97 -69
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BspUuSsP.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~automations-list-D40jgugf.js → vendor~root-layout~home~mcp~automations-list-C9U_eOqU.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~automations-list-cNHi83v_.js → vendor~root-layout~home~mcp~automations-list-DhQ3LPVw.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-xCM3k6Rd.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BEbhHQYg.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-DdgDNzMc.js} +2 -2
- package/build/assets/{verification-settings-EUkt_CkZ.js → verification-settings-D7R-Ne6L.js} +1 -1
- package/build/assets/x-DCZg87p7.js +1 -0
- package/build/assets/{x-mark-C42svtnu.js → x-mark-jrBTJbnP.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +22 -0
- package/build/locales/ca/openhands.json +22 -0
- package/build/locales/de/openhands.json +22 -0
- package/build/locales/en/openhands.json +22 -0
- package/build/locales/es/openhands.json +22 -0
- package/build/locales/fr/openhands.json +22 -0
- package/build/locales/it/openhands.json +22 -0
- package/build/locales/ja/openhands.json +22 -0
- package/build/locales/ko-KR/openhands.json +22 -0
- package/build/locales/no/openhands.json +22 -0
- package/build/locales/pt/openhands.json +22 -0
- package/build/locales/tr/openhands.json +22 -0
- package/build/locales/uk/openhands.json +22 -0
- package/build/locales/zh-CN/openhands.json +22 -0
- package/build/locales/zh-TW/openhands.json +22 -0
- package/config/defaults.json +4 -2
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +8 -0
- package/dist/api/agent-server-adapter.js +82 -80
- 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 +10 -0
- package/dist/api/agent-server-compatibility.js +69 -25
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/backend-registry/default-backend.cjs +1 -1
- package/dist/api/backend-registry/default-backend.cjs.map +1 -1
- package/dist/api/backend-registry/default-backend.d.ts +6 -5
- package/dist/api/backend-registry/default-backend.js +1 -1
- package/dist/api/backend-registry/default-backend.js.map +1 -1
- package/dist/api/backend-registry/storage.cjs +1 -1
- package/dist/api/backend-registry/storage.cjs.map +1 -1
- package/dist/api/backend-registry/storage.js +38 -68
- package/dist/api/backend-registry/storage.js.map +1 -1
- package/dist/api/cloud/proxy.cjs +1 -1
- package/dist/api/cloud/proxy.cjs.map +1 -1
- package/dist/api/cloud/proxy.d.ts +3 -16
- package/dist/api/cloud/proxy.js +1 -1
- package/dist/api/cloud/proxy.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +75 -75
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/llm-subscription-service.cjs +2 -0
- package/dist/api/llm-subscription-service.cjs.map +1 -0
- package/dist/api/llm-subscription-service.d.ts +23 -0
- package/dist/api/llm-subscription-service.js +109 -0
- package/dist/api/llm-subscription-service.js.map +1 -0
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.d.ts +2 -3
- package/dist/api/mcp-service/mcp-service.api.js +38 -13
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.js +41 -42
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/messages.cjs +1 -1
- package/dist/components/conversation-events/chat/messages.cjs.map +1 -1
- package/dist/components/conversation-events/chat/messages.js +4 -4
- package/dist/components/conversation-events/chat/messages.js.map +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.js +136 -135
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +103 -91
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.js +14 -8
- package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
- package/dist/components/features/chat/path-component.cjs +1 -1
- package/dist/components/features/chat/path-component.cjs.map +1 -1
- package/dist/components/features/chat/path-component.js +1 -1
- package/dist/components/features/chat/path-component.js.map +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs.map +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js +77 -66
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +1 -0
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.js +73 -46
- package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
- package/dist/components/features/mcp-page/marketplace-card.cjs +1 -1
- package/dist/components/features/mcp-page/marketplace-card.cjs.map +1 -1
- package/dist/components/features/mcp-page/marketplace-card.js +6 -2
- package/dist/components/features/mcp-page/marketplace-card.js.map +1 -1
- package/dist/components/features/settings/brand-button.cjs +1 -1
- package/dist/components/features/settings/brand-button.cjs.map +1 -1
- package/dist/components/features/settings/brand-button.js +1 -1
- package/dist/components/features/settings/brand-button.js.map +1 -1
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.cjs +2 -0
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.cjs.map +1 -0
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.d.ts +5 -0
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.js +167 -0
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.js.map +1 -0
- package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.d.ts +1 -2
- package/dist/components/shared/modals/settings/model-selector.js +59 -65
- package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
- package/dist/components/shared/modals/settings/settings-form.cjs +1 -1
- package/dist/components/shared/modals/settings/settings-form.cjs.map +1 -1
- package/dist/components/shared/modals/settings/settings-form.js +1 -2
- package/dist/components/shared/modals/settings/settings-form.js.map +1 -1
- package/dist/config/defaults.cjs +2 -0
- package/dist/config/defaults.cjs.map +1 -0
- package/dist/config/defaults.js +35 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/constants/llm-subscription.cjs +2 -0
- package/dist/constants/llm-subscription.cjs.map +1 -0
- package/dist/constants/llm-subscription.d.ts +16 -0
- package/dist/constants/llm-subscription.js +47 -0
- package/dist/constants/llm-subscription.js.map +1 -0
- package/dist/contexts/conversation-websocket-context.cjs +1 -1
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +1 -1
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/mutation/use-llm-subscription-auth.cjs +2 -0
- package/dist/hooks/mutation/use-llm-subscription-auth.cjs.map +1 -0
- package/dist/hooks/mutation/use-llm-subscription-auth.d.ts +3 -0
- package/dist/hooks/mutation/use-llm-subscription-auth.js +30 -0
- package/dist/hooks/mutation/use-llm-subscription-auth.js.map +1 -0
- package/dist/hooks/mutation/use-save-fields-as-secrets.cjs +1 -1
- package/dist/hooks/mutation/use-save-fields-as-secrets.cjs.map +1 -1
- package/dist/hooks/mutation/use-save-fields-as-secrets.d.ts +8 -6
- package/dist/hooks/mutation/use-save-fields-as-secrets.js +1 -1
- package/dist/hooks/mutation/use-save-fields-as-secrets.js.map +1 -1
- package/dist/hooks/mutation/use-test-mcp-server.d.ts +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +5 -0
- package/dist/hooks/query/query-keys.js +14 -2
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-agent-settings-schema.cjs +1 -1
- package/dist/hooks/query/use-agent-settings-schema.cjs.map +1 -1
- package/dist/hooks/query/use-agent-settings-schema.d.ts +2 -2
- package/dist/hooks/query/use-agent-settings-schema.js +21 -19
- package/dist/hooks/query/use-agent-settings-schema.js.map +1 -1
- package/dist/hooks/query/use-backends-health.cjs +1 -1
- package/dist/hooks/query/use-backends-health.cjs.map +1 -1
- package/dist/hooks/query/use-backends-health.js +38 -36
- package/dist/hooks/query/use-backends-health.js.map +1 -1
- package/dist/hooks/query/use-llm-subscription-models.cjs +2 -0
- package/dist/hooks/query/use-llm-subscription-models.cjs.map +1 -0
- package/dist/hooks/query/use-llm-subscription-models.d.ts +3 -0
- package/dist/hooks/query/use-llm-subscription-models.js +19 -0
- package/dist/hooks/query/use-llm-subscription-models.js.map +1 -0
- package/dist/hooks/query/use-llm-subscription-status.cjs +2 -0
- package/dist/hooks/query/use-llm-subscription-status.cjs.map +1 -0
- package/dist/hooks/query/use-llm-subscription-status.d.ts +3 -0
- package/dist/hooks/query/use-llm-subscription-status.js +19 -0
- package/dist/hooks/query/use-llm-subscription-status.js.map +1 -0
- package/dist/hooks/use-websocket.cjs +1 -1
- package/dist/hooks/use-websocket.cjs.map +1 -1
- package/dist/hooks/use-websocket.d.ts +0 -1
- package/dist/hooks/use-websocket.js +37 -38
- package/dist/hooks/use-websocket.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +22 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +374 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +22 -0
- package/dist/locales/ca/openhands.json +22 -0
- package/dist/locales/de/openhands.json +22 -0
- package/dist/locales/en/openhands.json +22 -0
- package/dist/locales/es/openhands.json +22 -0
- package/dist/locales/fr/openhands.json +22 -0
- package/dist/locales/it/openhands.json +22 -0
- package/dist/locales/ja/openhands.json +22 -0
- package/dist/locales/ko-KR/openhands.json +22 -0
- package/dist/locales/no/openhands.json +22 -0
- package/dist/locales/pt/openhands.json +22 -0
- package/dist/locales/tr/openhands.json +22 -0
- package/dist/locales/uk/openhands.json +22 -0
- package/dist/locales/zh-CN/openhands.json +22 -0
- package/dist/locales/zh-TW/openhands.json +22 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +10 -22
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +97 -69
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +3 -3
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -5
- package/dist/package.js.map +1 -1
- package/dist/routes/files-tab.cjs +1 -1
- package/dist/routes/files-tab.cjs.map +1 -1
- package/dist/routes/files-tab.js +28 -17
- 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 +142 -85
- 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 +1 -1
- package/dist/services/canvas-ui.js +2 -2
- package/dist/services/canvas-ui.js.map +1 -1
- package/dist/stores/files-tab-store.cjs +1 -1
- package/dist/stores/files-tab-store.cjs.map +1 -1
- package/dist/stores/files-tab-store.d.ts +2 -1
- package/dist/stores/files-tab-store.js +5 -1
- package/dist/stores/files-tab-store.js.map +1 -1
- package/dist/stores/use-event-store.cjs +1 -1
- package/dist/stores/use-event-store.cjs.map +1 -1
- package/dist/stores/use-event-store.js +39 -34
- package/dist/stores/use-event-store.js.map +1 -1
- package/dist/types/mcp-server.d.ts +21 -0
- package/dist/ui/dropdown/dropdown.cjs +1 -1
- package/dist/ui/dropdown/dropdown.cjs.map +1 -1
- package/dist/ui/dropdown/dropdown.js +6 -2
- package/dist/ui/dropdown/dropdown.js.map +1 -1
- package/dist/utils/handle-event-for-ui.cjs +1 -1
- package/dist/utils/handle-event-for-ui.cjs.map +1 -1
- package/dist/utils/handle-event-for-ui.d.ts +2 -0
- package/dist/utils/handle-event-for-ui.js +1 -1
- package/dist/utils/handle-event-for-ui.js.map +1 -1
- package/dist/utils/llm-subscription-schema.cjs +2 -0
- package/dist/utils/llm-subscription-schema.cjs.map +1 -0
- package/dist/utils/llm-subscription-schema.d.ts +2 -0
- package/dist/utils/llm-subscription-schema.js +22 -0
- package/dist/utils/llm-subscription-schema.js.map +1 -0
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.js +32 -17
- package/dist/utils/mcp-config.js.map +1 -1
- package/dist/utils/mcp-credential-validation.cjs +2 -0
- package/dist/utils/mcp-credential-validation.cjs.map +1 -0
- package/dist/utils/mcp-credential-validation.d.ts +22 -0
- package/dist/utils/mcp-credential-validation.js +31 -0
- package/dist/utils/mcp-credential-validation.js.map +1 -0
- package/dist/utils/mcp-marketplace-utils.cjs +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
- package/dist/utils/mcp-marketplace-utils.d.ts +7 -2
- package/dist/utils/mcp-marketplace-utils.js +33 -48
- package/dist/utils/mcp-marketplace-utils.js.map +1 -1
- package/dist/utils/sdk-settings-schema.cjs +1 -1
- package/dist/utils/sdk-settings-schema.cjs.map +1 -1
- package/dist/utils/sdk-settings-schema.js +64 -61
- package/dist/utils/sdk-settings-schema.js.map +1 -1
- package/package.json +3 -5
- package/scripts/check-sdk-version-sync.mjs +9 -27
- package/scripts/dev-with-automation.mjs +1 -3
- package/scripts/docker-build.mjs +0 -4
- package/scripts/run-staged-typecheck.mjs +44 -0
- package/build/assets/QueryClientProvider-XcSjsfpb.js +0 -1
- package/build/assets/Trans-sy4l4TyQ.js +0 -1
- package/build/assets/active-backend-context-B2OSC-qe.js +0 -1
- package/build/assets/add-backend-modal-lG8XDYjr.js +0 -1
- package/build/assets/agent-server-adapter-BPpZcLOE.js +0 -5
- package/build/assets/agent-server-conversation-service.api-C4Fc9Jnp.js +0 -1
- package/build/assets/api-key-entry-screen-BarZU9nr.js +0 -1
- package/build/assets/app-settings-CofRfixq.js +0 -1
- package/build/assets/automation-detail-BV4Cn0O8.js +0 -1
- package/build/assets/automations-list-BaJ61q7P.js +0 -1
- package/build/assets/backend-form-modal-B3BCZDPq.js +0 -1
- package/build/assets/browser-store-JRrcGdlk.js +0 -1
- package/build/assets/browser-wz8UzRmF.js +0 -5
- package/build/assets/chat-send-button-DzRpAQr4.js +0 -1
- package/build/assets/check-BhnsMsWy.js +0 -1
- package/build/assets/condenser-settings-Bo07FAEi.js +0 -1
- package/build/assets/context-CI9FqkUp.js +0 -1
- package/build/assets/conversation-DDdRyW4z.js +0 -19
- package/build/assets/conversation-panel-Dww2uJOd.js +0 -1
- package/build/assets/conversation-rGQV1Eym.js +0 -1
- package/build/assets/conversation-service.api-ByRiRU1e.js +0 -1
- package/build/assets/conversation-state-store-NEktJKfL.js +0 -1
- package/build/assets/declaration-D9ucT0fq.js +0 -1
- package/build/assets/dist-BCpEDEJq.js +0 -1
- package/build/assets/edit-automation-modal-CpA_JKLY.js +0 -1
- package/build/assets/entry.client-DUpefbBp.js +0 -2
- package/build/assets/files-tab-CBUPwSV1.js +0 -1
- package/build/assets/files-tab-store-DSKUhziI.js +0 -1
- package/build/assets/home-BDCL0Psk.js +0 -1
- package/build/assets/index-redirect-BQ_55qN6.js +0 -1
- package/build/assets/install-server-modal-CWZhBKwH.js +0 -1
- package/build/assets/lesson-plan-y520IDs6.js +0 -3
- package/build/assets/llm-not-configured-banner-CJyURBCm.js +0 -27
- package/build/assets/llm-settings-BW6yW2Go.js +0 -1
- package/build/assets/llm-settings-CiY22Wzi.js +0 -1
- package/build/assets/loader-circle-1XB9nbwF.js +0 -1
- package/build/assets/manage-backends-modal-v5POMal5.js +0 -1
- package/build/assets/manifest-eccb7f46.js +0 -1
- package/build/assets/markdown-renderer-z446oW0Z.js +0 -2
- package/build/assets/mcp-DgPFZ_Dv.js +0 -9
- package/build/assets/mcp-settings-redirect-l3Zbmc0F.js +0 -1
- package/build/assets/messages-Dq6AQ8mp.js +0 -41
- package/build/assets/model-selector-CdZs21EZ.js +0 -1
- package/build/assets/onboarding-Cdwu8QIy.js +0 -1
- package/build/assets/option-service.api-CdYnKVsu.js +0 -1
- package/build/assets/organization-service.api-CzMvXIQT.js +0 -1
- package/build/assets/plus-DKUID4kd.js +0 -1
- package/build/assets/providers-CbpQft-X.js +0 -1
- package/build/assets/proxy-Bx3NeKeo.js +0 -1
- package/build/assets/query-client-config-Ca3tW1AH.js +0 -1
- package/build/assets/root-CRkz_h2T.css +0 -1
- package/build/assets/root-CiNoOVrb.js +0 -2
- package/build/assets/root-layout-DUw-s9LS.js +0 -2
- package/build/assets/sdk-section-page-DPBwwLle.js +0 -1
- package/build/assets/sdk-settings-schema-Big50zDH.js +0 -1
- package/build/assets/secrets-settings-DmpsTC9V.js +0 -1
- package/build/assets/settings-ChsRtIJQ.js +0 -1
- package/build/assets/settings-modal-Cth7Zb-I.js +0 -1
- package/build/assets/settings-service.api-CcpckquT.js +0 -1
- package/build/assets/shared-conversation-Y0C8zqdr.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-BvcBXvLY.js +0 -1
- package/build/assets/suspense-Bqb0V0q1.js +0 -1
- package/build/assets/telemetry-CAWBJ_rB.js +0 -2
- package/build/assets/use-acp-credential-form-Dj7Jkhgp.js +0 -1
- package/build/assets/use-agent-settings-schema-Lf_lBAky.js +0 -1
- package/build/assets/use-config-DVU9HaPf.js +0 -1
- package/build/assets/use-create-conversation-CJUAOf1q.js +0 -1
- package/build/assets/use-handle-plan-click-BdcdMWbv.js +0 -1
- package/build/assets/use-is-authed-B8eLO-Xq.js +0 -1
- package/build/assets/use-llm-profiles-BBTR-OsK.js +0 -1
- package/build/assets/use-runtime-is-ready-BOQpqCvp.js +0 -1
- package/build/assets/use-save-settings-7_MLft-Y.js +0 -1
- package/build/assets/use-settings-CNsxccvQ.js +0 -1
- package/build/assets/useMutation-Dm84WAKR.js +0 -1
- package/build/assets/useQuery-DGRSm7IT.js +0 -1
- package/build/assets/useTranslation-CL6FTf1b.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js +0 -177
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-DQE89epK.js +0 -48
- package/build/assets/x-CCfDppg5.js +0 -1
- package/dist/api/settings-service/legacy-app-preferences-migration.cjs +0 -2
- package/dist/api/settings-service/legacy-app-preferences-migration.cjs.map +0 -1
- package/dist/api/settings-service/legacy-app-preferences-migration.d.ts +0 -34
- package/dist/api/settings-service/legacy-app-preferences-migration.js +0 -52
- package/dist/api/settings-service/legacy-app-preferences-migration.js.map +0 -1
- package/dist/hooks/query/use-openhands-verified-models.cjs +0 -2
- package/dist/hooks/query/use-openhands-verified-models.cjs.map +0 -1
- package/dist/hooks/query/use-openhands-verified-models.d.ts +0 -1
- package/dist/hooks/query/use-openhands-verified-models.js +0 -14
- package/dist/hooks/query/use-openhands-verified-models.js.map +0 -1
- package/dist/utils/normalize-display-model.cjs +0 -2
- package/dist/utils/normalize-display-model.cjs.map +0 -1
- package/dist/utils/normalize-display-model.d.ts +0 -9
- package/dist/utils/normalize-display-model.js +0 -13
- package/dist/utils/normalize-display-model.js.map +0 -1
- package/dist/utils/openhands-llm.cjs +0 -2
- package/dist/utils/openhands-llm.cjs.map +0 -1
- package/dist/utils/openhands-llm.d.ts +0 -15
- package/dist/utils/openhands-llm.js +0 -15
- package/dist/utils/openhands-llm.js.map +0 -1
- /package/build/assets/{agent-server-ui-style-scope-BwIZYdC1.js → agent-server-ui-style-scope-1MuaCC1k.js} +0 -0
- /package/build/assets/{common-Dh7OqABE.js → common-DqjLSBOt.js} +0 -0
- /package/build/assets/{environment-switch-store-CiurvTtK.js → environment-switch-store-CBXkf5bS.js} +0 -0
- /package/build/assets/{extension-module-card-classes-DP5J6ngE.js → extension-module-card-classes-CVGfXtoL.js} +0 -0
- /package/build/assets/{git-status-mapper-BI8FyUVp.js → git-status-mapper-DVFXF1_X.js} +0 -0
- /package/build/assets/{handle-capture-consent-CPMXU29K.js → handle-capture-consent-BTvatyfE.js} +0 -0
- /package/build/assets/{map-provider-BM2SJarp.js → map-provider-COgsZR9p.js} +0 -0
- /package/build/assets/{objectWithoutPropertiesLoose-DSQKyRhw.js → objectWithoutPropertiesLoose-B80nTzVc.js} +0 -0
- /package/build/assets/{preload-helper-CT1Z6Pdu.js → preload-helper-D_sPnjeL.js} +0 -0
- /package/build/assets/{rolldown-runtime-BFRubm34.js → rolldown-runtime-wFmyQBCi.js} +0 -0
- /package/build/assets/{sdk-settings-field-metadata-p2GVlft7.js → sdk-settings-field-metadata-Cc4D-ut7.js} +0 -0
- /package/build/assets/{settings-wh2sLLJM.js → settings-1287uR2J.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~cg1m3bv7-aUIHudsf.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-BmZcy_kH.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DPPGSgT1.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-adapter.cjs","names":[],"sources":["../../src/api/agent-server-adapter.ts"],"sourcesContent":["import { ACP_SETTINGS_KEYS } from \"@openhands/typescript-client\";\nimport { SKILLS_CATALOG } from \"@openhands/extensions/skills\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { ExecutionStatus } from \"#/types/agent-server/core\";\nimport { Settings, SettingsValue } from \"#/types/settings\";\nimport {\n getAcpPreferredDefaultModel,\n getAcpProvider,\n resolveEffectiveAcpModel,\n} from \"#/constants/acp-providers\";\nimport { getAgentServerClientOptions } from \"./agent-server-client-options\";\nimport { isAgentServerToolAvailable } from \"./agent-server-compatibility\";\nimport { getAgentServerWorkingDir } from \"./agent-server-config\";\nimport { getEffectiveLocalBackend } from \"./backend-registry/active-store\";\nimport { buildAuthHeaders } from \"./backend-registry/auth\";\nimport {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n SandboxStatus,\n} from \"./conversation-service/agent-server-conversation-service.types\";\nimport SettingsService from \"./settings-service/settings-service.api\";\nimport { getStoredConversationMetadata } from \"./conversation-metadata-store\";\n\nexport interface DirectConversationInfo {\n id: string;\n title?: string | null;\n created_at: string;\n updated_at: string;\n execution_status?: string | null;\n /** Cloud-only sandbox lifecycle state. Omitted / null for local agent-server conversations. */\n sandbox_status?: string | null;\n metrics?: {\n accumulated_cost?: number | null;\n max_budget_per_task?: number | null;\n accumulated_token_usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n cache_read_tokens?: number;\n cache_write_tokens?: number;\n context_window?: number;\n per_turn_token?: number;\n } | null;\n } | null;\n agent?: {\n /**\n * Pydantic discriminator from the SDK union: ``\"ACPAgent\"`` for ACP CLI\n * subprocesses (model lives on the subprocess via ``acp_model``),\n * ``\"Agent\"`` for direct litellm. Read by {@link toAppConversation}.\n */\n kind?: string | null;\n acp_model?: string | null;\n llm?: {\n model?: string | null;\n } | null;\n } | null;\n current_model_id?: string | null;\n current_model_name?: string | null;\n workspace?: {\n working_dir?: string | null;\n } | null;\n /**\n * Arbitrary string-keyed conversation tags surfaced by the agent-server\n * (see ``ConversationInfo.tags``). Canvas only consumes one key today —\n * ``ACP_SERVER_TAG_KEY`` (\"acpserver\") — but the field is typed as a\n * generic record so future readers don't need another wire-shape change.\n * Keys are constrained to ``^[a-z0-9]+$`` by the agent-server validator;\n * values are opaque strings.\n */\n tags?: Record<string, string> | null;\n}\n\n// Module qualname for the Canvas-UI tool. The agent-server imports this via\n// tool_module_qualnames; the host directory is exposed via OH_EXTRA_PYTHON_PATH\n// (see scripts/dev-safe.mjs).\nconst CANVAS_UI_TOOL_NAME = \"canvas_ui\";\nconst CANVAS_UI_TOOL_MODULE = \"canvas_ui_tool\";\n\nconst DEFAULT_TOOL_NAMES = [\n \"terminal\",\n \"file_editor\",\n \"task_tracker\",\n CANVAS_UI_TOOL_NAME,\n];\nconst BROWSER_TOOL_SET_NAME = \"browser_tool_set\";\nconst TASK_TOOL_SET_NAME = \"task_tool_set\";\n\nfunction browserToolsEnabled() {\n return import.meta.env.VITE_ENABLE_BROWSER_TOOLS !== \"false\";\n}\n\n/**\n * Shape of the runtime services info (set by the dev launchers in\n * scripts/dev-*.mjs as `VITE_RUNTIME_SERVICES_INFO`, or injected at serve time\n * by `scripts/static-server.mjs` for static builds — see\n * `getRawRuntimeServicesInfo`). All URLs are written from the agent's point of\n * view, not the browser's. The block is rendered into the agent's system prompt\n * via `AgentContext.system_message_suffix` so the agent knows what's\n * reachable from inside its sandbox without having to probe.\n */\ninterface RuntimeServicesInfo {\n mode?: string;\n agent_host_alias?: string;\n services?: {\n agent_server?: { description?: string; url_from_agent?: string };\n ingress?: { description?: string; url_from_agent?: string };\n frontend?: {\n kind?: \"vite\" | \"static\";\n description?: string;\n url_from_agent?: string;\n };\n // `vite` is the legacy key name for the frontend entry, accepted for\n // one release while older dev-stack launchers may still emit it.\n vite?: { description?: string; url_from_agent?: string };\n automation?: {\n description?: string;\n url_from_agent?: string;\n api_prefix?: string;\n docs_url?: string;\n openapi_url?: string;\n auth_env_var?: string;\n };\n };\n}\n\n/**\n * Return the raw runtime-services JSON string, consulting two sources in order\n * (mirrors `getBakedSessionApiKey` in agent-server-config.ts):\n * 1. `VITE_RUNTIME_SERVICES_INFO` — baked into the bundle at build time by\n * the dev launchers (`npm run dev`, dev:static).\n * 2. `window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__` — injected into\n * index.html at serve time by `scripts/static-server.mjs\n * --runtime-services-info <json>`. This is the path used by static builds\n * (the Docker image and the published binary), where the env var is empty\n * in the prebuilt bundle. Without it the `<RUNTIME_SERVICES>` block is\n * missing and the agent cannot reach the local automation backend.\n */\nfunction getRawRuntimeServicesInfo(): string | null {\n const envRaw = import.meta.env.VITE_RUNTIME_SERVICES_INFO?.trim();\n if (envRaw) return envRaw;\n\n if (typeof window !== \"undefined\") {\n const injected = (window as unknown as Record<string, unknown>)\n .__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;\n if (typeof injected === \"string\") {\n return injected.trim() || null;\n }\n }\n\n return null;\n}\n\nfunction parseRuntimeServicesInfo(): RuntimeServicesInfo | null {\n const raw = getRawRuntimeServicesInfo();\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw) as RuntimeServicesInfo;\n if (!parsed || typeof parsed !== \"object\") return null;\n return parsed;\n } catch {\n // Malformed JSON: ignore and fall back to no runtime info, rather than\n // tearing down conversation creation over a misconfigured env var or\n // injected value.\n return null;\n }\n}\n\n/**\n * Return the deployment mode from the runtime services info, e.g. \"docker\",\n * \"dev:automation\", etc. Returns `null` when no runtime info is configured.\n */\nexport function getDeploymentMode(): string | null {\n return parseRuntimeServicesInfo()?.mode ?? null;\n}\n\n/**\n * Render the runtime services info into a markdown block suitable for\n * appending to the system prompt via `AgentContext.system_message_suffix`.\n *\n * Returns `undefined` when no runtime info is configured, so callers can\n * safely omit the field on production builds (where the launcher doesn't\n * set `VITE_RUNTIME_SERVICES_INFO`).\n */\nexport function buildRuntimeServicesSystemSuffix(): string | undefined {\n const info = parseRuntimeServicesInfo();\n if (!info?.services) return undefined;\n\n const lines: string[] = [];\n lines.push(\"<RUNTIME_SERVICES>\");\n if (info.mode) {\n lines.push(\n `You are running inside an agent-canvas dev stack started in '${info.mode}' mode.`,\n );\n } else {\n lines.push(\"You are running inside an agent-canvas dev stack.\");\n }\n lines.push(\n \"The following services are reachable from your sandbox. URLs are written\",\n \"from your point of view (i.e., as you should curl/fetch them).\",\n \"\",\n );\n\n const { agent_server, ingress, automation } = info.services;\n // Accept `frontend` (current key) or `vite` (legacy key) for the\n // frontend service entry. The legacy fallback can be removed once all\n // launchers in this repo emit `frontend`.\n const frontend = info.services.frontend ?? info.services.vite;\n\n if (agent_server?.url_from_agent) {\n lines.push(\n `* Agent Server (you): ${agent_server.url_from_agent}`,\n ` ${agent_server.description ?? \"The agent-server hosting your tool calls.\"}`,\n );\n }\n if (ingress?.url_from_agent) {\n lines.push(\n `* Ingress: ${ingress.url_from_agent}`,\n ` ${ingress.description ?? \"Unified entry point for browser-facing traffic.\"}`,\n );\n }\n if (frontend?.url_from_agent) {\n lines.push(\n `* Frontend: ${frontend.url_from_agent}`,\n ` ${frontend.description ?? \"Frontend dev server.\"}`,\n );\n }\n if (automation?.url_from_agent) {\n lines.push(\n `* Automation backend: ${automation.url_from_agent}`,\n ` ${automation.description ?? \"OpenHands Automations service.\"}`,\n );\n if (automation.docs_url) {\n lines.push(` Docs: ${automation.docs_url}`);\n }\n if (automation.openapi_url) {\n lines.push(` OpenAPI: ${automation.openapi_url}`);\n }\n if (automation.auth_env_var) {\n // X-Session-API-Key is the local convention shared by the agent-server\n // and automation backend (see openhands-automation auth.py).\n lines.push(\n ` Auth: header 'X-Session-API-Key: $${automation.auth_env_var}'`,\n );\n }\n } else {\n lines.push(\n \"* Automation backend: not running in this dev mode (skip /api/automation calls).\",\n );\n }\n\n // Anchor the \"don't guess\" warning to the actual agent-server URL for\n // this stack instead of a hardcoded port. The agent-server listens on\n // different ports across dev modes, and baking the wrong port into the\n // system prompt is exactly the kind of confusion this block is meant to\n // prevent.\n const agentServerUrl = agent_server?.url_from_agent;\n lines.push(\n \"\",\n \"Trust this block over guessing: do not assume any other URLs are running.\",\n );\n if (agentServerUrl) {\n lines.push(\n `In particular, ${agentServerUrl} inside your sandbox is the Agent Server`,\n \"you are running inside of — NOT the automation backend.\",\n );\n }\n lines.push(\"</RUNTIME_SERVICES>\");\n\n return lines.join(\"\\n\");\n}\n\nexport function toConversationUrl(conversationId: string): string {\n // Local-format conversation URL — points at whichever local agent-server\n // is actually serving the conversation (the bundled one when the active\n // selection is cloud).\n const { host } = getAgentServerClientOptions();\n return `${host}/api/conversations/${conversationId}`;\n}\n\n// TODO(i18n): extract \"Conversation\" once we add CONVERSATION$DEFAULT_TITLE\n// with `{{shortId}}` interpolation. Kept as a literal for now to keep the\n// fallback inside this pure adapter rather than fanning out to display sites.\nexport function getDefaultConversationTitle(conversationId: string): string {\n return `Conversation ${conversationId.slice(0, 5)}`;\n}\n\nexport function toAppConversation(\n info: DirectConversationInfo,\n): AppConversation {\n const metadata = getStoredConversationMetadata(info.id);\n // ACPAgent conversations carry a sentinel ``llm`` on older SDKs. Prefer the\n // runtime model fields when available, then the configured ``acp_model`` that\n // Canvas saves for built-in providers. ``agent_kind`` still gates model\n // switching, so surfacing this string is display-only.\n const isAcp = info.agent?.kind === \"ACPAgent\";\n // Only surface ``acp_server`` for ACP conversations even if the wire\n // payload accidentally carries an ``acpserver`` tag on an OpenHands\n // conversation — the chip is identity info for the ACP CLI subprocess,\n // and showing it on a non-ACP conversation would be a lie.\n const acpServer = isAcp ? (info.tags?.[ACP_SERVER_TAG_KEY] ?? null) : null;\n return {\n id: info.id,\n created_by_user_id: null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: metadata?.selected_workspace ?? null,\n active_profile: metadata?.active_profile ?? null,\n title: info.title?.trim()\n ? info.title\n : getDefaultConversationTitle(info.id),\n trigger: null,\n pr_number: [],\n agent_kind: isAcp ? \"acp\" : \"openhands\",\n acp_server: acpServer,\n // Chip path: no ``providerDefault`` — the chip must distinguish\n // \"no concrete model\" (fall back to the provider display name in\n // ConversationCardFooter) from \"default\" (would lie about what's\n // running on the subprocess).\n llm_model: isAcp\n ? resolveEffectiveAcpModel({\n runtimeName: info.current_model_name,\n runtimeId: info.current_model_id,\n configured: info.agent?.acp_model,\n sdkLlm: info.agent?.llm?.model,\n })\n : (info.agent?.llm?.model ?? DEFAULT_SETTINGS.llm_model),\n metrics: info.metrics\n ? {\n accumulated_cost: info.metrics.accumulated_cost ?? null,\n max_budget_per_task: info.metrics.max_budget_per_task ?? null,\n accumulated_token_usage: info.metrics.accumulated_token_usage\n ? {\n prompt_tokens:\n info.metrics.accumulated_token_usage.prompt_tokens ?? 0,\n completion_tokens:\n info.metrics.accumulated_token_usage.completion_tokens ?? 0,\n cache_read_tokens:\n info.metrics.accumulated_token_usage.cache_read_tokens ?? 0,\n cache_write_tokens:\n info.metrics.accumulated_token_usage.cache_write_tokens ?? 0,\n context_window:\n info.metrics.accumulated_token_usage.context_window ?? 0,\n per_turn_token:\n info.metrics.accumulated_token_usage.per_turn_token ?? 0,\n }\n : null,\n }\n : null,\n created_at: info.created_at,\n updated_at: info.updated_at,\n execution_status:\n (info.execution_status as AppConversation[\"execution_status\"]) ??\n ExecutionStatus.IDLE,\n sandbox_status: (info.sandbox_status as SandboxStatus | null) ?? null,\n conversation_url: toConversationUrl(info.id),\n session_api_key: getAgentServerClientOptions().apiKey ?? null,\n sandbox_id: null,\n workspace: {\n working_dir: info.workspace?.working_dir ?? getAgentServerWorkingDir(),\n },\n public: false,\n sub_conversation_ids: [],\n };\n}\n\nexport function toConversationPage(data: {\n items: DirectConversationInfo[];\n next_page_id?: string | null;\n}): AppConversationPage {\n return {\n items: data.items.map(toAppConversation),\n next_page_id: data.next_page_id ?? null,\n };\n}\n\ntype SettingsRecord = Record<string, unknown>;\n\ninterface AgentToolSpec {\n name: string;\n params: SettingsRecord;\n}\n\ntype AgentSettingsPayload = SettingsRecord & {\n llm?: SettingsRecord;\n agent_context: SettingsRecord;\n tools?: AgentToolSpec[];\n};\n\ninterface LocalWorkspacePayload {\n kind: \"LocalWorkspace\";\n working_dir: string;\n}\n\ninterface InitialMessagePayload {\n role: \"user\";\n content: Array<{ type: \"text\"; text: string }>;\n run: true;\n}\n\ntype ConversationSettingsPayload = SettingsRecord & {\n workspace: LocalWorkspacePayload;\n initial_message?: InitialMessagePayload;\n};\n\nexport const ACP_SERVER_TAG_KEY = \"acpserver\";\n\nconst CONVERSATION_SETTINGS_METADATA_KEYS = new Set([\n \"schema_version\",\n \"agent_settings\",\n \"workspace\",\n \"conversation_id\",\n \"initial_message\",\n \"plugins\",\n]);\n\nfunction toRecord(value: unknown): SettingsRecord {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return {};\n }\n\n return structuredClone(value as SettingsRecord);\n}\n\nfunction normalizeSecretString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction getConversationConfirmationPolicy(\n conversationSettings: SettingsRecord,\n) {\n if (conversationSettings.confirmation_mode !== true) {\n return { kind: \"NeverConfirm\" };\n }\n\n if (conversationSettings.security_analyzer === \"llm\") {\n return { kind: \"ConfirmRisky\", threshold: \"HIGH\", confirm_unknown: true };\n }\n\n return { kind: \"AlwaysConfirm\" };\n}\n\nfunction getConversationSecurityAnalyzer(conversationSettings: SettingsRecord) {\n switch (conversationSettings.security_analyzer) {\n case \"llm\":\n return { kind: \"LLMSecurityAnalyzer\" };\n case \"pattern\":\n return { kind: \"PatternSecurityAnalyzer\" };\n case \"policy_rail\":\n return { kind: \"PolicyRailSecurityAnalyzer\" };\n default:\n return undefined;\n }\n}\n\nfunction isToolRecord(\n value: unknown,\n): value is { name: string; params?: unknown } {\n return (\n !!value &&\n typeof value === \"object\" &&\n !Array.isArray(value) &&\n typeof (value as { name?: unknown }).name === \"string\"\n );\n}\n\nfunction shouldIncludeTool(name: string, agentSettings: SettingsRecord) {\n if (name === BROWSER_TOOL_SET_NAME) {\n return browserToolsEnabled() && isAgentServerToolAvailable(name);\n }\n\n if (name === TASK_TOOL_SET_NAME) {\n return (\n agentSettings.enable_sub_agents === true &&\n isAgentServerToolAvailable(name)\n );\n }\n\n return true;\n}\n\nfunction getAgentTools(agentSettings: SettingsRecord): AgentToolSpec[] {\n const tools = new Map<string, AgentToolSpec>();\n\n for (const name of DEFAULT_TOOL_NAMES) {\n tools.set(name, { name, params: {} });\n }\n\n for (const name of [BROWSER_TOOL_SET_NAME, TASK_TOOL_SET_NAME]) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n const configuredTools = agentSettings.tools;\n if (\n Array.isArray(configuredTools) &&\n configuredTools.every((tool) => isToolRecord(tool))\n ) {\n for (const tool of configuredTools) {\n if (shouldIncludeTool(tool.name, agentSettings)) {\n tools.set(tool.name, {\n name: tool.name,\n params: toRecord(tool.params),\n });\n }\n }\n }\n\n return Array.from(tools.values());\n}\n\nfunction buildInitialMessage(\n query?: string,\n conversationInstructions?: string,\n): InitialMessagePayload | null {\n const parts = [query?.trim(), conversationInstructions?.trim()].filter(\n Boolean,\n );\n if (parts.length === 0) {\n return null;\n }\n\n return {\n role: \"user\",\n content: [{ type: \"text\", text: parts.join(\"\\n\\n\") }],\n run: true,\n };\n}\n\n/**\n * Shape of a bundled skill entry passed to the agent-server SDK via\n * `agent_context.skills`. Mirrors the SDK's `Skill` model fields that\n * the server uses for trigger matching, activation, and system-prompt\n * injection.\n */\ninterface BundledSkill {\n name: string;\n content: string;\n trigger: { type: \"keyword\"; keywords: string[] } | null;\n source: \"public\";\n description: string | null;\n is_agentskills_format: true;\n license?: string;\n compatibility?: string;\n}\n\n/**\n * Convert the bundled `SKILLS_CATALOG` entries into the SDK `Skill` JSON\n * shape so the agent-server can perform trigger matching, skill activation,\n * and system-prompt injection without cloning the extensions repo.\n *\n * The SDK discriminates triggers via `{ type: \"keyword\", keywords: [...] }`.\n * Skills with no triggers get `trigger: null` (always-active / on-demand).\n */\nfunction buildBundledSkills(): BundledSkill[] {\n return SKILLS_CATALOG.map((entry) => {\n const trigger: BundledSkill[\"trigger\"] =\n entry.triggers?.length > 0\n ? { type: \"keyword\", keywords: entry.triggers }\n : null;\n\n return {\n name: entry.name,\n content: entry.content,\n trigger,\n source: \"public\" as const,\n description: entry.description ?? null,\n is_agentskills_format: true as const,\n ...(entry.license ? { license: entry.license } : {}),\n ...(entry.compatibility ? { compatibility: entry.compatibility } : {}),\n };\n });\n}\n\nfunction buildAgentContext(agentSettings: SettingsRecord): SettingsRecord {\n const runtimeServicesSuffix = buildRuntimeServicesSystemSuffix();\n const existingContext = toRecord(agentSettings.agent_context);\n\n // Merge bundled public skills with any skills already present in the\n // agent context (e.g. user-defined skills set via the settings API).\n const existingSkills = Array.isArray(existingContext.skills)\n ? (existingContext.skills as SettingsRecord[])\n : [];\n const mergedSkills = [...existingSkills, ...buildBundledSkills()];\n\n return {\n ...existingContext,\n // Public skills are bundled at build time from the @openhands/extensions\n // npm package and passed directly in agent_context.skills. Setting\n // load_public_skills to false tells the agent-server SDK to skip its own\n // extensions-repo clone — the frontend is the sole source of public\n // skills now.\n //\n // Migration: the former VITE_LOAD_PUBLIC_SKILLS env var was removed\n // because bundled skills have no clone latency. Users who previously set\n // VITE_LOAD_PUBLIC_SKILLS=false to avoid clone delays no longer need it.\n skills: mergedSkills,\n load_public_skills: false,\n load_user_skills: true,\n load_project_skills: true,\n ...(runtimeServicesSuffix\n ? { system_message_suffix: runtimeServicesSuffix }\n : {}),\n };\n}\n\nfunction isAcpAgent(settings: Settings): boolean {\n const agentSettings = toRecord(settings.agent_settings);\n return agentSettings.agent_kind === \"acp\";\n}\n\nfunction getAcpServerTag(settings: Settings): string | undefined {\n const agentSettings = toRecord(settings.agent_settings);\n const value = agentSettings.acp_server;\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction resolveAcpCommand(agentSettings: SettingsRecord): unknown {\n const cmd = agentSettings.acp_command;\n const isEmpty = Array.isArray(cmd) && cmd.length === 0;\n const noCommand = cmd === undefined;\n if (!isEmpty && !noCommand) {\n return cmd;\n }\n\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const provider = getAcpProvider(serverKey);\n return provider ? [...provider.default_command] : cmd;\n}\n\nfunction buildConfiguredAcpAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const payload: AgentSettingsPayload = {\n agent_kind: \"acp\",\n agent_context: buildAgentContext(agentSettings),\n };\n\n // TODO(#1019): set ``acp_isolate_data_dir: true`` here for a containerized\n // backend so concurrent same-provider conversations don't race on a shared\n // HOME. The SDK supports it (software-agent-sdk#3492), but the released\n // ``@openhands/typescript-client`` (1.24.3) doesn't surface it on\n // ``ACPAgentSettings`` yet, so sending it risks a validation error on older\n // servers. Cloud grouping isolation is separate (agent-canvas#1016).\n\n for (const key of ACP_SETTINGS_KEYS) {\n // ``acp_model`` is resolved separately below so a saved ``null`` still\n // falls back to the provider's default rather than being dropped.\n if (key === \"acp_model\") continue;\n // ``acp_env`` is deprecated — provider creds now route via ``request.secrets``.\n if (key === \"acp_env\") continue;\n const value =\n key === \"acp_command\"\n ? resolveAcpCommand(agentSettings)\n : agentSettings[key];\n if (value !== undefined && value !== null) {\n payload[key] = value;\n }\n }\n\n // ``mcp_config`` is a *shared* field (not in ACP_SETTINGS_KEYS): forward it\n // so the ACP subprocess connects to the configured MCP servers at session\n // creation. Only include it when it actually carries servers — an empty or\n // malformed value is dropped rather than sending ``mcp_config: {}``.\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length > 0 && \"mcpServers\" in mcpConfig) {\n payload.mcp_config = mcpConfig;\n }\n\n // Saved settings may carry ``acp_model: null`` (existing users predating\n // the default-model registry, or saved fields the agent-server stripped).\n // Fall back to the *preferred* default (Vertex-safe for Gemini) so the\n // conversation starts with whatever the Settings → Agent UI shows — without\n // that, the form's displayed default would silently not take effect at\n // runtime until the user re-saved the page.\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const effectiveModel = resolveEffectiveAcpModel({\n configured: agentSettings.acp_model as string | null | undefined,\n providerDefault: getAcpPreferredDefaultModel(serverKey),\n });\n if (effectiveModel) {\n payload.acp_model = effectiveModel;\n }\n\n return payload;\n}\n\nfunction buildConfiguredOpenHandsAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const llm = toRecord(agentSettings.llm);\n\n llm.model =\n typeof llm.model === \"string\" && llm.model.trim().length > 0\n ? llm.model\n : DEFAULT_SETTINGS.llm_model;\n\n const apiKey = normalizeSecretString(llm.api_key);\n if (apiKey) {\n llm.api_key = apiKey;\n } else {\n delete llm.api_key;\n }\n\n const baseUrl = normalizeSecretString(llm.base_url);\n if (baseUrl) {\n llm.base_url = baseUrl;\n } else {\n delete llm.base_url;\n }\n\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length === 0 || !(\"mcpServers\" in mcpConfig)) {\n delete agentSettings.mcp_config;\n }\n\n delete agentSettings.acp_server;\n for (const key of ACP_SETTINGS_KEYS) {\n delete agentSettings[key];\n }\n // ``acp_env`` is no longer a forwarded ACP setting (provider creds ride the\n // Secrets panel), but a legacy value may linger on persisted settings —\n // scrub it so it never leaks onto the OpenHands payload.\n delete agentSettings.acp_env;\n\n return {\n ...agentSettings,\n llm,\n agent_context: buildAgentContext(agentSettings),\n tools: getAgentTools(agentSettings),\n };\n}\n\nfunction buildConfiguredAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n return isAcpAgent(settings)\n ? buildConfiguredAcpAgentSettings(settings)\n : buildConfiguredOpenHandsAgentSettings(settings);\n}\n\nfunction buildConfiguredConversationSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n workingDir?: string;\n}): ConversationSettingsPayload {\n const { settings, query, conversationInstructions, plugins, workingDir } =\n options;\n const conversationSettings = toRecord(settings.conversation_settings);\n const initialMessage = buildInitialMessage(query, conversationInstructions);\n\n CONVERSATION_SETTINGS_METADATA_KEYS.forEach(\n (key) => delete conversationSettings[key],\n );\n\n const payload: ConversationSettingsPayload = {\n ...conversationSettings,\n workspace: {\n kind: \"LocalWorkspace\",\n working_dir: workingDir ?? getAgentServerWorkingDir(),\n },\n ...(initialMessage ? { initial_message: initialMessage } : {}),\n ...(plugins?.length\n ? {\n plugins: plugins.map((plugin) => ({\n source: plugin.source,\n ...(plugin.ref ? { ref: plugin.ref } : {}),\n ...(plugin.repo_path ? { repo_path: plugin.repo_path } : {}),\n })),\n }\n : {}),\n };\n\n return payload;\n}\n\ninterface LookupSecret {\n kind: \"LookupSecret\";\n url: string;\n headers?: Record<string, string>;\n description?: string;\n}\n\ntype StartConversationPayload = Record<string, unknown> & {\n agent_settings: AgentSettingsPayload;\n workspace: LocalWorkspacePayload;\n confirmation_policy: SettingsRecord;\n security_analyzer?: SettingsRecord;\n initial_message?: InitialMessagePayload;\n max_iterations: number;\n stuck_detection: true;\n autotitle: true;\n worktree: boolean;\n secrets_encrypted?: true;\n conversation_id?: string;\n secrets?: Record<string, LookupSecret>;\n tags?: Record<string, string>;\n tool_module_qualnames?: Record<string, string>;\n};\n\nexport interface StartConversationOptions {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n encryptedAgentSettings?: Record<string, SettingsValue>;\n encryptedConversationSettings?: Record<string, SettingsValue>;\n secretsEncrypted?: boolean;\n customSecrets?: Array<{ name: string; description?: string }>;\n}\n\nexport function buildStartConversationRequest(\n options: StartConversationOptions,\n): StartConversationPayload {\n const sourceAgentSettings = options.encryptedAgentSettings\n ? { ...options.settings, agent_settings: options.encryptedAgentSettings }\n : options.settings;\n\n const acpMode = isAcpAgent(sourceAgentSettings);\n const agentSettings = buildConfiguredAgentSettings(sourceAgentSettings);\n const acpServerTag = acpMode\n ? getAcpServerTag(sourceAgentSettings)\n : undefined;\n\n const sourceConversationOptions = options.encryptedConversationSettings\n ? {\n ...options,\n settings: {\n ...options.settings,\n conversation_settings: options.encryptedConversationSettings,\n },\n }\n : options;\n\n const conversationSettings = buildConfiguredConversationSettings(\n sourceConversationOptions,\n );\n\n const payload: StartConversationPayload = {\n agent_settings: agentSettings,\n workspace: conversationSettings.workspace,\n confirmation_policy:\n getConversationConfirmationPolicy(conversationSettings),\n max_iterations:\n typeof conversationSettings.max_iterations === \"number\"\n ? conversationSettings.max_iterations\n : 500,\n stuck_detection: true,\n autotitle: true,\n worktree: options.worktree ?? true,\n };\n\n if (acpServerTag) {\n payload.tags = { [ACP_SERVER_TAG_KEY]: acpServerTag };\n }\n\n // ``secrets_encrypted`` makes the agent-server run every request secret through\n // ``cipher.decrypt()`` at conversation start. Suppress it for ACP: an ACP agent\n // carries no encrypted payload (no LLM api_key, and credentials ride as\n // LookupSecrets whose values are fetched at resolution time, not decrypted), so\n // there is nothing to decrypt. Claiming otherwise hard-fails (\"cipher not\n // configured\") on a backend without ``OH_SECRET_KEY`` (e.g. a fresh ACP\n // container). Non-ACP conversations still need it for their encrypted LLM key.\n if (options.secretsEncrypted && !acpMode) {\n payload.secrets_encrypted = true;\n }\n\n if (options.conversationId) {\n payload.conversation_id = options.conversationId;\n }\n\n const securityAnalyzer =\n getConversationSecurityAnalyzer(conversationSettings);\n if (securityAnalyzer) {\n payload.security_analyzer = securityAnalyzer;\n }\n\n if (conversationSettings.initial_message) {\n payload.initial_message = conversationSettings.initial_message;\n }\n\n if (conversationSettings.plugins) {\n payload.plugins = conversationSettings.plugins;\n }\n\n if (conversationSettings.hook_config) {\n payload.hook_config = conversationSettings.hook_config;\n }\n\n payload.tool_module_qualnames = {\n [CANVAS_UI_TOOL_NAME]: CANVAS_UI_TOOL_MODULE,\n ...((conversationSettings.tool_module_qualnames as\n | Record<string, string>\n | undefined) ?? {}),\n };\n\n if (conversationSettings.agent_definitions) {\n payload.agent_definitions = conversationSettings.agent_definitions;\n }\n\n // Every saved secret rides as a LookupSecret the agent-server resolves back\n // from its own store at spawn time — ``request.secrets`` is the sole channel,\n // uniform for ACP and non-ACP (agent-canvas#1039). For ACP the resolution\n // runs off the event loop (software-agent-sdk#3510, ≥1.25.0), so the loopback\n // fetch can't deadlock.\n if (options.customSecrets && options.customSecrets.length > 0) {\n const backend = getEffectiveLocalBackend();\n const headers = backend ? buildAuthHeaders(backend) : {};\n\n const secrets: Record<string, LookupSecret> = {};\n for (const secret of options.customSecrets) {\n const lookupSecret: LookupSecret = {\n kind: \"LookupSecret\",\n url: `/api/settings/secrets/${encodeURIComponent(secret.name)}`,\n description: secret.description,\n };\n\n if (Object.keys(headers).length > 0) {\n lookupSecret.headers = headers;\n }\n\n secrets[secret.name] = lookupSecret;\n }\n\n payload.secrets = secrets;\n }\n\n return payload;\n}\n\nexport async function buildStartConversationRequestWithEncryptedSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n}): Promise<Record<string, unknown>> {\n const { SecretsService } = await import(\"./secrets-service\");\n\n const [settingsResult, customSecrets] = await Promise.all([\n SettingsService.getSettingsForConversation(),\n SecretsService.getSecrets(),\n ]);\n\n const { agentSettings, conversationSettings, secretsEncrypted } =\n settingsResult;\n\n return buildStartConversationRequest({\n ...options,\n encryptedAgentSettings: agentSettings,\n encryptedConversationSettings: conversationSettings,\n secretsEncrypted,\n customSecrets,\n });\n}\n\nexport function emptyHooksResponse(): GetHooksResponse {\n return { hooks: [] };\n}\n"],"mappings":"kuBA4EA,IAAM,EAAsB,YACtB,EAAwB,iBAExB,EAAqB,CACzB,WACA,cACA,eACA,EACD,CACK,EAAwB,mBACxB,EAAqB,gBAE3B,SAAS,GAAsB,CAC7B,MAAO,GAiDT,SAAS,GAA2C,CAClD,IAAM,GAAA,IAAA,KAAqD,MAAM,CACjE,GAAI,EAAQ,OAAO,EAEnB,GAAI,OAAO,OAAW,IAAa,CACjC,IAAM,EAAY,OACf,uCACH,GAAI,OAAO,GAAa,SACtB,OAAO,EAAS,MAAM,EAAI,KAI9B,OAAO,KAGT,SAAS,GAAuD,CAC9D,IAAM,EAAM,GAA2B,CACvC,GAAI,CAAC,EAAK,OAAO,KAC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cAAc,OAAS,EAAG,CAC7D,IAAM,EAAU,EAAA,0BAA0B,CACpC,EAAU,EAAU,EAAA,iBAAiB,EAAQ,CAAG,EAAE,CAElD,EAAwC,EAAE,CAChD,IAAK,IAAM,KAAU,EAAQ,cAAe,CAC1C,IAAM,EAA6B,CACjC,KAAM,eACN,IAAK,yBAAyB,mBAAmB,EAAO,KAAK,GAC7D,YAAa,EAAO,YACrB,CAEG,OAAO,KAAK,EAAQ,CAAC,OAAS,IAChC,EAAa,QAAU,GAGzB,EAAQ,EAAO,MAAQ,EAGzB,EAAQ,QAAU,EAGpB,OAAO,EAGT,eAAsB,EAAmD,EAQpC,CACnC,GAAM,CAAE,kBAAmB,MAAA,QAAA,SAAA,CAAA,SAAA,QAAM,wBAAA,CAAA,CAE3B,CAAC,EAAgB,GAAiB,MAAM,QAAQ,IAAI,CACxD,EAAA,QAAgB,4BAA4B,CAC5C,EAAe,YAAY,CAC5B,CAAC,CAEI,CAAE,gBAAe,uBAAsB,oBAC3C,EAEF,OAAO,EAA8B,CACnC,GAAG,EACH,uBAAwB,EACxB,8BAA+B,EAC/B,mBACA,gBACD,CAAC,CAGJ,SAAgB,GAAuC,CACrD,MAAO,CAAE,MAAO,EAAE,CAAE"}
|
|
1
|
+
{"version":3,"file":"agent-server-adapter.cjs","names":[],"sources":["../../src/api/agent-server-adapter.ts"],"sourcesContent":["import { ACP_SETTINGS_KEYS } from \"@openhands/typescript-client\";\nimport { SKILLS_CATALOG } from \"@openhands/extensions/skills\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { ExecutionStatus } from \"#/types/agent-server/core\";\nimport { Settings, SettingsValue } from \"#/types/settings\";\nimport {\n getAcpPreferredDefaultModel,\n getAcpProvider,\n resolveEffectiveAcpModel,\n} from \"#/constants/acp-providers\";\nimport { getAgentServerClientOptions } from \"./agent-server-client-options\";\nimport { isAgentServerToolAvailable } from \"./agent-server-compatibility\";\nimport { getAgentServerWorkingDir } from \"./agent-server-config\";\nimport { getEffectiveLocalBackend } from \"./backend-registry/active-store\";\nimport { buildAuthHeaders } from \"./backend-registry/auth\";\nimport {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n SandboxStatus,\n} from \"./conversation-service/agent-server-conversation-service.types\";\nimport SettingsService from \"./settings-service/settings-service.api\";\nimport { getStoredConversationMetadata } from \"./conversation-metadata-store\";\nimport LLMSubscriptionService from \"./llm-subscription-service\";\nimport {\n LLM_AUTH_TYPE_SUBSCRIPTION,\n OPENAI_SUBSCRIPTION_VENDOR,\n isSubscriptionLlmConfig,\n} from \"#/constants/llm-subscription\";\n\nexport interface DirectConversationInfo {\n id: string;\n title?: string | null;\n created_at: string;\n updated_at: string;\n execution_status?: string | null;\n /** Cloud-only sandbox lifecycle state. Omitted / null for local agent-server conversations. */\n sandbox_status?: string | null;\n metrics?: {\n accumulated_cost?: number | null;\n max_budget_per_task?: number | null;\n accumulated_token_usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n cache_read_tokens?: number;\n cache_write_tokens?: number;\n context_window?: number;\n per_turn_token?: number;\n } | null;\n } | null;\n agent?: {\n /**\n * Pydantic discriminator from the SDK union: ``\"ACPAgent\"`` for ACP CLI\n * subprocesses (model lives on the subprocess via ``acp_model``),\n * ``\"Agent\"`` for direct litellm. Read by {@link toAppConversation}.\n */\n kind?: string | null;\n acp_model?: string | null;\n llm?: {\n model?: string | null;\n } | null;\n } | null;\n current_model_id?: string | null;\n current_model_name?: string | null;\n workspace?: {\n working_dir?: string | null;\n } | null;\n /**\n * Arbitrary string-keyed conversation tags surfaced by the agent-server\n * (see ``ConversationInfo.tags``). Canvas only consumes one key today —\n * ``ACP_SERVER_TAG_KEY`` (\"acpserver\") — but the field is typed as a\n * generic record so future readers don't need another wire-shape change.\n * Keys are constrained to ``^[a-z0-9]+$`` by the agent-server validator;\n * values are opaque strings.\n */\n tags?: Record<string, string> | null;\n}\n\n// Module qualname for the Canvas-UI tool. The agent-server imports this via\n// tool_module_qualnames; the host directory is exposed via OH_EXTRA_PYTHON_PATH\n// (see scripts/dev-safe.mjs).\nconst CANVAS_UI_TOOL_NAME = \"canvas_ui\";\nconst CANVAS_UI_TOOL_MODULE = \"canvas_ui_tool\";\n\nconst DEFAULT_TOOL_NAMES = [\n \"terminal\",\n \"file_editor\",\n \"task_tracker\",\n CANVAS_UI_TOOL_NAME,\n];\nconst BROWSER_TOOL_SET_NAME = \"browser_tool_set\";\nconst TASK_TOOL_SET_NAME = \"task_tool_set\";\n\nfunction browserToolsEnabled() {\n return import.meta.env.VITE_ENABLE_BROWSER_TOOLS !== \"false\";\n}\n\n/**\n * Shape of the runtime services info (set by the dev launchers in\n * scripts/dev-*.mjs as `VITE_RUNTIME_SERVICES_INFO`, or injected at serve time\n * by `scripts/static-server.mjs` for static builds — see\n * `getRawRuntimeServicesInfo`). All URLs are written from the agent's point of\n * view, not the browser's. The block is rendered into the agent's system prompt\n * via `AgentContext.system_message_suffix` so the agent knows what's\n * reachable from inside its sandbox without having to probe.\n */\ninterface RuntimeServicesInfo {\n mode?: string;\n agent_host_alias?: string;\n services?: {\n agent_server?: { description?: string; url_from_agent?: string };\n ingress?: { description?: string; url_from_agent?: string };\n frontend?: {\n kind?: \"vite\" | \"static\";\n description?: string;\n url_from_agent?: string;\n };\n // `vite` is the legacy key name for the frontend entry, accepted for\n // one release while older dev-stack launchers may still emit it.\n vite?: { description?: string; url_from_agent?: string };\n automation?: {\n description?: string;\n url_from_agent?: string;\n api_prefix?: string;\n docs_url?: string;\n openapi_url?: string;\n auth_env_var?: string;\n };\n };\n}\n\n/**\n * Return the raw runtime-services JSON string, consulting two sources in order\n * (mirrors `getBakedSessionApiKey` in agent-server-config.ts):\n * 1. `VITE_RUNTIME_SERVICES_INFO` — baked into the bundle at build time by\n * the dev launchers (`npm run dev`, dev:static).\n * 2. `window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__` — injected into\n * index.html at serve time by `scripts/static-server.mjs\n * --runtime-services-info <json>`. This is the path used by static builds\n * (the Docker image and the published binary), where the env var is empty\n * in the prebuilt bundle. Without it the `<RUNTIME_SERVICES>` block is\n * missing and the agent cannot reach the local automation backend.\n */\nfunction getRawRuntimeServicesInfo(): string | null {\n const envRaw = import.meta.env.VITE_RUNTIME_SERVICES_INFO?.trim();\n if (envRaw) return envRaw;\n\n if (typeof window !== \"undefined\") {\n const injected = (window as unknown as Record<string, unknown>)\n .__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;\n if (typeof injected === \"string\") {\n return injected.trim() || null;\n }\n }\n\n return null;\n}\n\nfunction parseRuntimeServicesInfo(): RuntimeServicesInfo | null {\n const raw = getRawRuntimeServicesInfo();\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw) as RuntimeServicesInfo;\n if (!parsed || typeof parsed !== \"object\") return null;\n return parsed;\n } catch {\n // Malformed JSON: ignore and fall back to no runtime info, rather than\n // tearing down conversation creation over a misconfigured env var or\n // injected value.\n return null;\n }\n}\n\n/**\n * Return the deployment mode from the runtime services info, e.g. \"docker\",\n * \"dev:automation\", etc. Returns `null` when no runtime info is configured.\n */\nexport function getDeploymentMode(): string | null {\n return parseRuntimeServicesInfo()?.mode ?? null;\n}\n\n/**\n * Render the runtime services info into a markdown block suitable for\n * appending to the system prompt via `AgentContext.system_message_suffix`.\n *\n * Returns `undefined` when no runtime info is configured, so callers can\n * safely omit the field on production builds (where the launcher doesn't\n * set `VITE_RUNTIME_SERVICES_INFO`).\n */\nexport function buildRuntimeServicesSystemSuffix(): string | undefined {\n const info = parseRuntimeServicesInfo();\n if (!info?.services) return undefined;\n\n const lines: string[] = [];\n lines.push(\"<RUNTIME_SERVICES>\");\n if (info.mode) {\n lines.push(\n `You are running inside an agent-canvas dev stack started in '${info.mode}' mode.`,\n );\n } else {\n lines.push(\"You are running inside an agent-canvas dev stack.\");\n }\n lines.push(\n \"The following services are reachable from your sandbox. URLs are written\",\n \"from your point of view (i.e., as you should curl/fetch them).\",\n \"\",\n );\n\n const { agent_server, ingress, automation } = info.services;\n const { frontend } = info.services;\n\n if (agent_server?.url_from_agent) {\n lines.push(\n `* Agent Server (you): ${agent_server.url_from_agent}`,\n ` ${agent_server.description ?? \"The agent-server hosting your tool calls.\"}`,\n );\n }\n if (ingress?.url_from_agent) {\n lines.push(\n `* Ingress: ${ingress.url_from_agent}`,\n ` ${ingress.description ?? \"Unified entry point for browser-facing traffic.\"}`,\n );\n }\n if (frontend?.url_from_agent) {\n lines.push(\n `* Frontend: ${frontend.url_from_agent}`,\n ` ${frontend.description ?? \"Frontend dev server.\"}`,\n );\n }\n if (automation?.url_from_agent) {\n lines.push(\n `* Automation backend: ${automation.url_from_agent}`,\n ` ${automation.description ?? \"OpenHands Automations service.\"}`,\n );\n if (automation.docs_url) {\n lines.push(` Docs: ${automation.docs_url}`);\n }\n if (automation.openapi_url) {\n lines.push(` OpenAPI: ${automation.openapi_url}`);\n }\n if (automation.auth_env_var) {\n // X-Session-API-Key is the local convention shared by the agent-server\n // and automation backend (see openhands-automation auth.py).\n lines.push(\n ` Auth: header 'X-Session-API-Key: $${automation.auth_env_var}'`,\n );\n }\n } else {\n lines.push(\n \"* Automation backend: not running in this dev mode (skip /api/automation calls).\",\n );\n }\n\n // Anchor the \"don't guess\" warning to the actual agent-server URL for\n // this stack instead of a hardcoded port. The agent-server listens on\n // different ports across dev modes, and baking the wrong port into the\n // system prompt is exactly the kind of confusion this block is meant to\n // prevent.\n const agentServerUrl = agent_server?.url_from_agent;\n lines.push(\n \"\",\n \"Trust this block over guessing: do not assume any other URLs are running.\",\n );\n if (agentServerUrl) {\n lines.push(\n `In particular, ${agentServerUrl} inside your sandbox is the Agent Server`,\n \"you are running inside of — NOT the automation backend.\",\n );\n }\n lines.push(\"</RUNTIME_SERVICES>\");\n\n return lines.join(\"\\n\");\n}\n\nexport function toConversationUrl(conversationId: string): string {\n // Local-format conversation URL — points at whichever local agent-server\n // is actually serving the conversation (the bundled one when the active\n // selection is cloud).\n const { host } = getAgentServerClientOptions();\n return `${host}/api/conversations/${conversationId}`;\n}\n\n// TODO(i18n): extract \"Conversation\" once we add CONVERSATION$DEFAULT_TITLE\n// with `{{shortId}}` interpolation. Kept as a literal for now to keep the\n// fallback inside this pure adapter rather than fanning out to display sites.\nexport function getDefaultConversationTitle(conversationId: string): string {\n return `Conversation ${conversationId.slice(0, 5)}`;\n}\n\nexport function toAppConversation(\n info: DirectConversationInfo,\n): AppConversation {\n const metadata = getStoredConversationMetadata(info.id);\n // ACPAgent conversations carry a sentinel ``llm`` on older SDKs. Prefer the\n // runtime model fields when available, then the configured ``acp_model`` that\n // Canvas saves for built-in providers. ``agent_kind`` still gates model\n // switching, so surfacing this string is display-only.\n const isAcp = info.agent?.kind === \"ACPAgent\";\n // Only surface ``acp_server`` for ACP conversations even if the wire\n // payload accidentally carries an ``acpserver`` tag on an OpenHands\n // conversation — the chip is identity info for the ACP CLI subprocess,\n // and showing it on a non-ACP conversation would be a lie.\n const acpServer = isAcp ? (info.tags?.[ACP_SERVER_TAG_KEY] ?? null) : null;\n return {\n id: info.id,\n created_by_user_id: null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: metadata?.selected_workspace ?? null,\n active_profile: metadata?.active_profile ?? null,\n title: info.title?.trim()\n ? info.title\n : getDefaultConversationTitle(info.id),\n trigger: null,\n pr_number: [],\n agent_kind: isAcp ? \"acp\" : \"openhands\",\n acp_server: acpServer,\n // Chip path: no ``providerDefault`` — the chip must distinguish\n // \"no concrete model\" (fall back to the provider display name in\n // ConversationCardFooter) from \"default\" (would lie about what's\n // running on the subprocess).\n llm_model: isAcp\n ? resolveEffectiveAcpModel({\n runtimeName: info.current_model_name,\n runtimeId: info.current_model_id,\n configured: info.agent?.acp_model,\n sdkLlm: info.agent?.llm?.model,\n })\n : (info.agent?.llm?.model ?? DEFAULT_SETTINGS.llm_model),\n metrics: info.metrics\n ? {\n accumulated_cost: info.metrics.accumulated_cost ?? null,\n max_budget_per_task: info.metrics.max_budget_per_task ?? null,\n accumulated_token_usage: info.metrics.accumulated_token_usage\n ? {\n prompt_tokens:\n info.metrics.accumulated_token_usage.prompt_tokens ?? 0,\n completion_tokens:\n info.metrics.accumulated_token_usage.completion_tokens ?? 0,\n cache_read_tokens:\n info.metrics.accumulated_token_usage.cache_read_tokens ?? 0,\n cache_write_tokens:\n info.metrics.accumulated_token_usage.cache_write_tokens ?? 0,\n context_window:\n info.metrics.accumulated_token_usage.context_window ?? 0,\n per_turn_token:\n info.metrics.accumulated_token_usage.per_turn_token ?? 0,\n }\n : null,\n }\n : null,\n created_at: info.created_at,\n updated_at: info.updated_at,\n execution_status:\n (info.execution_status as AppConversation[\"execution_status\"]) ??\n ExecutionStatus.IDLE,\n sandbox_status: (info.sandbox_status as SandboxStatus | null) ?? null,\n conversation_url: toConversationUrl(info.id),\n session_api_key: getAgentServerClientOptions().apiKey ?? null,\n sandbox_id: null,\n workspace: {\n working_dir: info.workspace?.working_dir ?? getAgentServerWorkingDir(),\n },\n public: false,\n sub_conversation_ids: [],\n };\n}\n\nexport function toConversationPage(data: {\n items: DirectConversationInfo[];\n next_page_id?: string | null;\n}): AppConversationPage {\n return {\n items: data.items.map(toAppConversation),\n next_page_id: data.next_page_id ?? null,\n };\n}\n\ntype SettingsRecord = Record<string, unknown>;\n\ninterface AgentToolSpec {\n name: string;\n params: SettingsRecord;\n}\n\ntype AgentSettingsPayload = SettingsRecord & {\n llm?: SettingsRecord;\n agent_context: SettingsRecord;\n tools?: AgentToolSpec[];\n};\n\ninterface LocalWorkspacePayload {\n kind: \"LocalWorkspace\";\n working_dir: string;\n}\n\ninterface InitialMessagePayload {\n role: \"user\";\n content: Array<{ type: \"text\"; text: string }>;\n run: true;\n}\n\ntype ConversationSettingsPayload = SettingsRecord & {\n workspace: LocalWorkspacePayload;\n initial_message?: InitialMessagePayload;\n};\n\nexport const ACP_SERVER_TAG_KEY = \"acpserver\";\n\nconst CONVERSATION_SETTINGS_METADATA_KEYS = new Set([\n \"schema_version\",\n \"agent_settings\",\n \"workspace\",\n \"conversation_id\",\n \"initial_message\",\n \"plugins\",\n]);\n\nfunction toRecord(value: unknown): SettingsRecord {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return {};\n }\n\n return structuredClone(value as SettingsRecord);\n}\n\nfunction normalizeSecretString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction getConversationConfirmationPolicy(\n conversationSettings: SettingsRecord,\n) {\n if (conversationSettings.confirmation_mode !== true) {\n return { kind: \"NeverConfirm\" };\n }\n\n if (conversationSettings.security_analyzer === \"llm\") {\n return { kind: \"ConfirmRisky\", threshold: \"HIGH\", confirm_unknown: true };\n }\n\n return { kind: \"AlwaysConfirm\" };\n}\n\nfunction getConversationSecurityAnalyzer(conversationSettings: SettingsRecord) {\n switch (conversationSettings.security_analyzer) {\n case \"llm\":\n return { kind: \"LLMSecurityAnalyzer\" };\n case \"pattern\":\n return { kind: \"PatternSecurityAnalyzer\" };\n case \"policy_rail\":\n return { kind: \"PolicyRailSecurityAnalyzer\" };\n default:\n return undefined;\n }\n}\n\nfunction isToolRecord(\n value: unknown,\n): value is { name: string; params?: unknown } {\n return (\n !!value &&\n typeof value === \"object\" &&\n !Array.isArray(value) &&\n typeof (value as { name?: unknown }).name === \"string\"\n );\n}\n\nfunction shouldIncludeTool(name: string, agentSettings: SettingsRecord) {\n if (name === CANVAS_UI_TOOL_NAME) {\n return isAgentServerToolAvailable(name);\n }\n\n if (name === BROWSER_TOOL_SET_NAME) {\n return browserToolsEnabled() && isAgentServerToolAvailable(name);\n }\n\n if (name === TASK_TOOL_SET_NAME) {\n return (\n agentSettings.enable_sub_agents === true &&\n isAgentServerToolAvailable(name)\n );\n }\n\n return true;\n}\n\nfunction getAgentTools(agentSettings: SettingsRecord): AgentToolSpec[] {\n const tools = new Map<string, AgentToolSpec>();\n\n for (const name of DEFAULT_TOOL_NAMES) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n for (const name of [BROWSER_TOOL_SET_NAME, TASK_TOOL_SET_NAME]) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n const configuredTools = agentSettings.tools;\n if (\n Array.isArray(configuredTools) &&\n configuredTools.every((tool) => isToolRecord(tool))\n ) {\n for (const tool of configuredTools) {\n if (shouldIncludeTool(tool.name, agentSettings)) {\n tools.set(tool.name, {\n name: tool.name,\n params: toRecord(tool.params),\n });\n }\n }\n }\n\n return Array.from(tools.values());\n}\n\nfunction buildInitialMessage(\n query?: string,\n conversationInstructions?: string,\n): InitialMessagePayload | null {\n const parts = [query?.trim(), conversationInstructions?.trim()].filter(\n Boolean,\n );\n if (parts.length === 0) {\n return null;\n }\n\n return {\n role: \"user\",\n content: [{ type: \"text\", text: parts.join(\"\\n\\n\") }],\n run: true,\n };\n}\n\n/**\n * Shape of a bundled skill entry passed to the agent-server SDK via\n * `agent_context.skills`. Mirrors the SDK's `Skill` model fields that\n * the server uses for trigger matching, activation, and system-prompt\n * injection.\n */\ninterface BundledSkill {\n name: string;\n content: string;\n trigger: { type: \"keyword\"; keywords: string[] } | null;\n source: \"public\";\n description: string | null;\n is_agentskills_format: true;\n license?: string;\n compatibility?: string;\n}\n\n/**\n * Convert the bundled `SKILLS_CATALOG` entries into the SDK `Skill` JSON\n * shape so the agent-server can perform trigger matching, skill activation,\n * and system-prompt injection without cloning the extensions repo.\n *\n * The SDK discriminates triggers via `{ type: \"keyword\", keywords: [...] }`.\n * Skills with no triggers get `trigger: null` (always-active / on-demand).\n */\nfunction buildBundledSkills(): BundledSkill[] {\n return SKILLS_CATALOG.map((entry) => {\n const trigger: BundledSkill[\"trigger\"] =\n entry.triggers?.length > 0\n ? { type: \"keyword\", keywords: entry.triggers }\n : null;\n\n return {\n name: entry.name,\n content: entry.content,\n trigger,\n source: \"public\" as const,\n description: entry.description ?? null,\n is_agentskills_format: true as const,\n ...(entry.license ? { license: entry.license } : {}),\n ...(entry.compatibility ? { compatibility: entry.compatibility } : {}),\n };\n });\n}\n\nfunction buildAgentContext(agentSettings: SettingsRecord): SettingsRecord {\n const runtimeServicesSuffix = buildRuntimeServicesSystemSuffix();\n const existingContext = toRecord(agentSettings.agent_context);\n\n // Merge bundled public skills with any skills already present in the\n // agent context (e.g. user-defined skills set via the settings API).\n const existingSkills = Array.isArray(existingContext.skills)\n ? (existingContext.skills as SettingsRecord[])\n : [];\n const mergedSkills = [...existingSkills, ...buildBundledSkills()];\n\n return {\n ...existingContext,\n // Public skills are bundled at build time from the @openhands/extensions\n // npm package and passed directly in agent_context.skills. Setting\n // load_public_skills to false tells the agent-server SDK to skip its own\n // extensions-repo clone — the frontend is the sole source of public\n // skills now.\n //\n // Migration: the former VITE_LOAD_PUBLIC_SKILLS env var was removed\n // because bundled skills have no clone latency. Users who previously set\n // VITE_LOAD_PUBLIC_SKILLS=false to avoid clone delays no longer need it.\n skills: mergedSkills,\n load_public_skills: false,\n load_user_skills: true,\n load_project_skills: true,\n ...(runtimeServicesSuffix\n ? { system_message_suffix: runtimeServicesSuffix }\n : {}),\n };\n}\n\nfunction isAcpAgent(settings: Settings): boolean {\n const agentSettings = toRecord(settings.agent_settings);\n return agentSettings.agent_kind === \"acp\";\n}\n\nfunction getAcpServerTag(settings: Settings): string | undefined {\n const agentSettings = toRecord(settings.agent_settings);\n const value = agentSettings.acp_server;\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction resolveAcpCommand(agentSettings: SettingsRecord): unknown {\n const cmd = agentSettings.acp_command;\n const isEmpty = Array.isArray(cmd) && cmd.length === 0;\n const noCommand = cmd === undefined;\n if (!isEmpty && !noCommand) {\n return cmd;\n }\n\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const provider = getAcpProvider(serverKey);\n return provider ? [...provider.default_command] : cmd;\n}\n\nfunction buildConfiguredAcpAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const payload: AgentSettingsPayload = {\n agent_kind: \"acp\",\n agent_context: buildAgentContext(agentSettings),\n };\n\n // TODO(#1019): set ``acp_isolate_data_dir: true`` here for a containerized\n // backend so concurrent same-provider conversations don't race on a shared\n // HOME. The SDK supports it (software-agent-sdk#3492), but the released\n // ``@openhands/typescript-client`` (1.24.3) doesn't surface it on\n // ``ACPAgentSettings`` yet, so sending it risks a validation error on older\n // servers. Cloud grouping isolation is separate (agent-canvas#1016).\n\n for (const key of ACP_SETTINGS_KEYS) {\n // ``acp_model`` is resolved separately below so a saved ``null`` still\n // falls back to the provider's default rather than being dropped.\n if (key === \"acp_model\") continue;\n // ``acp_env`` is deprecated — provider creds now route via ``request.secrets``.\n if (key === \"acp_env\") continue;\n const value =\n key === \"acp_command\"\n ? resolveAcpCommand(agentSettings)\n : agentSettings[key];\n if (value !== undefined && value !== null) {\n payload[key] = value;\n }\n }\n\n // ``mcp_config`` is a *shared* field (not in ACP_SETTINGS_KEYS): forward it\n // so the ACP subprocess connects to the configured MCP servers at session\n // creation. Only include it when it actually carries servers — an empty or\n // malformed value is dropped rather than sending ``mcp_config: {}``.\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length > 0 && \"mcpServers\" in mcpConfig) {\n payload.mcp_config = mcpConfig;\n }\n\n // Saved settings may carry ``acp_model: null`` (existing users predating\n // the default-model registry, or saved fields the agent-server stripped).\n // Fall back to the *preferred* default (Vertex-safe for Gemini) so the\n // conversation starts with whatever the Settings → Agent UI shows — without\n // that, the form's displayed default would silently not take effect at\n // runtime until the user re-saved the page.\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const effectiveModel = resolveEffectiveAcpModel({\n configured: agentSettings.acp_model as string | null | undefined,\n providerDefault: getAcpPreferredDefaultModel(serverKey),\n });\n if (effectiveModel) {\n payload.acp_model = effectiveModel;\n }\n\n return payload;\n}\n\nfunction buildConfiguredOpenHandsAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const llm = toRecord(agentSettings.llm);\n\n llm.model =\n typeof llm.model === \"string\" && llm.model.trim().length > 0\n ? llm.model\n : DEFAULT_SETTINGS.llm_model;\n\n const apiKey = normalizeSecretString(llm.api_key);\n if (apiKey) {\n llm.api_key = apiKey;\n } else {\n delete llm.api_key;\n }\n\n const baseUrl = normalizeSecretString(llm.base_url);\n if (baseUrl) {\n llm.base_url = baseUrl;\n } else {\n delete llm.base_url;\n }\n\n if (isSubscriptionLlmConfig(llm)) {\n llm.auth_type = LLM_AUTH_TYPE_SUBSCRIPTION;\n llm.subscription_vendor = OPENAI_SUBSCRIPTION_VENDOR;\n delete llm.api_key;\n delete llm.base_url;\n } else {\n delete llm.auth_type;\n delete llm.subscription_vendor;\n }\n\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length === 0 || !(\"mcpServers\" in mcpConfig)) {\n delete agentSettings.mcp_config;\n }\n\n delete agentSettings.acp_server;\n for (const key of ACP_SETTINGS_KEYS) {\n delete agentSettings[key];\n }\n // ``acp_env`` is no longer a forwarded ACP setting (provider creds ride the\n // Secrets panel), but a legacy value may linger on persisted settings —\n // scrub it so it never leaks onto the OpenHands payload.\n delete agentSettings.acp_env;\n\n return {\n ...agentSettings,\n llm,\n agent_context: buildAgentContext(agentSettings),\n tools: getAgentTools(agentSettings),\n };\n}\n\nfunction buildConfiguredAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n return isAcpAgent(settings)\n ? buildConfiguredAcpAgentSettings(settings)\n : buildConfiguredOpenHandsAgentSettings(settings);\n}\n\nfunction buildConfiguredConversationSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n workingDir?: string;\n}): ConversationSettingsPayload {\n const { settings, query, conversationInstructions, plugins, workingDir } =\n options;\n const conversationSettings = toRecord(settings.conversation_settings);\n const initialMessage = buildInitialMessage(query, conversationInstructions);\n\n CONVERSATION_SETTINGS_METADATA_KEYS.forEach(\n (key) => delete conversationSettings[key],\n );\n\n const payload: ConversationSettingsPayload = {\n ...conversationSettings,\n workspace: {\n kind: \"LocalWorkspace\",\n working_dir: workingDir ?? getAgentServerWorkingDir(),\n },\n ...(initialMessage ? { initial_message: initialMessage } : {}),\n ...(plugins?.length\n ? {\n plugins: plugins.map((plugin) => ({\n source: plugin.source,\n ...(plugin.ref ? { ref: plugin.ref } : {}),\n ...(plugin.repo_path ? { repo_path: plugin.repo_path } : {}),\n })),\n }\n : {}),\n };\n\n return payload;\n}\n\ninterface LookupSecret {\n kind: \"LookupSecret\";\n url: string;\n headers?: Record<string, string>;\n description?: string;\n}\n\ntype StartConversationPayload = Record<string, unknown> & {\n agent_settings: AgentSettingsPayload;\n workspace: LocalWorkspacePayload;\n confirmation_policy: SettingsRecord;\n security_analyzer?: SettingsRecord;\n initial_message?: InitialMessagePayload;\n max_iterations: number;\n stuck_detection: true;\n autotitle: true;\n worktree: boolean;\n secrets_encrypted?: true;\n conversation_id?: string;\n secrets?: Record<string, LookupSecret>;\n tags?: Record<string, string>;\n tool_module_qualnames?: Record<string, string>;\n};\n\nexport interface StartConversationOptions {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n encryptedAgentSettings?: Record<string, SettingsValue>;\n encryptedConversationSettings?: Record<string, SettingsValue>;\n secretsEncrypted?: boolean;\n customSecrets?: Array<{ name: string; description?: string }>;\n}\n\nexport function buildStartConversationRequest(\n options: StartConversationOptions,\n): StartConversationPayload {\n const sourceAgentSettings = options.encryptedAgentSettings\n ? { ...options.settings, agent_settings: options.encryptedAgentSettings }\n : options.settings;\n\n const acpMode = isAcpAgent(sourceAgentSettings);\n const agentSettings = buildConfiguredAgentSettings(sourceAgentSettings);\n const acpServerTag = acpMode\n ? getAcpServerTag(sourceAgentSettings)\n : undefined;\n\n const sourceConversationOptions = options.encryptedConversationSettings\n ? {\n ...options,\n settings: {\n ...options.settings,\n conversation_settings: options.encryptedConversationSettings,\n },\n }\n : options;\n\n const conversationSettings = buildConfiguredConversationSettings(\n sourceConversationOptions,\n );\n\n const payload: StartConversationPayload = {\n agent_settings: agentSettings,\n workspace: conversationSettings.workspace,\n confirmation_policy:\n getConversationConfirmationPolicy(conversationSettings),\n max_iterations:\n typeof conversationSettings.max_iterations === \"number\"\n ? conversationSettings.max_iterations\n : 500,\n stuck_detection: true,\n autotitle: true,\n worktree: options.worktree ?? true,\n };\n\n if (acpServerTag) {\n payload.tags = { [ACP_SERVER_TAG_KEY]: acpServerTag };\n }\n\n // ``secrets_encrypted`` makes the agent-server run every request secret through\n // ``cipher.decrypt()`` at conversation start. Suppress it for ACP: an ACP agent\n // carries no encrypted payload (no LLM api_key, and credentials ride as\n // LookupSecrets whose values are fetched at resolution time, not decrypted), so\n // there is nothing to decrypt. Claiming otherwise hard-fails (\"cipher not\n // configured\") on a backend without ``OH_SECRET_KEY`` (e.g. a fresh ACP\n // container). Non-ACP conversations still need it for their encrypted LLM key.\n if (options.secretsEncrypted && !acpMode) {\n payload.secrets_encrypted = true;\n }\n\n if (options.conversationId) {\n payload.conversation_id = options.conversationId;\n }\n\n const securityAnalyzer =\n getConversationSecurityAnalyzer(conversationSettings);\n if (securityAnalyzer) {\n payload.security_analyzer = securityAnalyzer;\n }\n\n if (conversationSettings.initial_message) {\n payload.initial_message = conversationSettings.initial_message;\n }\n\n if (conversationSettings.plugins) {\n payload.plugins = conversationSettings.plugins;\n }\n\n if (conversationSettings.hook_config) {\n payload.hook_config = conversationSettings.hook_config;\n }\n\n const toolModuleQualnames: Record<string, string> = {};\n const canvasUiAvailable = isAgentServerToolAvailable(CANVAS_UI_TOOL_NAME);\n if (canvasUiAvailable) {\n toolModuleQualnames[CANVAS_UI_TOOL_NAME] = CANVAS_UI_TOOL_MODULE;\n }\n Object.assign(\n toolModuleQualnames,\n (conversationSettings.tool_module_qualnames as\n | Record<string, string>\n | undefined) ?? {},\n );\n if (!canvasUiAvailable) {\n delete toolModuleQualnames[CANVAS_UI_TOOL_NAME];\n }\n if (Object.keys(toolModuleQualnames).length > 0) {\n payload.tool_module_qualnames = toolModuleQualnames;\n }\n\n if (conversationSettings.agent_definitions) {\n payload.agent_definitions = conversationSettings.agent_definitions;\n }\n\n // Every saved secret rides as a LookupSecret the agent-server resolves back\n // from its own store at spawn time — ``request.secrets`` is the sole channel,\n // uniform for ACP and non-ACP (agent-canvas#1039). For ACP the resolution\n // runs off the event loop (software-agent-sdk#3510, >=1.25.0), so the loopback\n // fetch can't deadlock.\n if (options.customSecrets && options.customSecrets.length > 0) {\n const backend = getEffectiveLocalBackend();\n const headers = backend ? buildAuthHeaders(backend) : {};\n\n const secrets: Record<string, LookupSecret> = {};\n for (const secret of options.customSecrets) {\n const lookupSecret: LookupSecret = {\n kind: \"LookupSecret\",\n url: `/api/settings/secrets/${encodeURIComponent(secret.name)}`,\n description: secret.description,\n };\n\n if (Object.keys(headers).length > 0) {\n lookupSecret.headers = headers;\n }\n\n secrets[secret.name] = lookupSecret;\n }\n\n payload.secrets = secrets;\n }\n\n return payload;\n}\n\nexport const SUBSCRIPTION_LOGIN_REQUIRED_ERROR =\n \"Connect your ChatGPT subscription before starting a conversation with this LLM profile.\";\n\n/**\n * Throws if a ChatGPT subscription LLM profile is not connected.\n * Called before conversation creation and LLM profile switch only — not on\n * subsequent message sends or conversation resume. The agent-server must handle\n * mid-conversation token expiry gracefully.\n */\nexport async function assertSubscriptionAuthReady(\n agentSettings: Record<string, unknown>,\n): Promise<void> {\n const llm = toRecord(agentSettings.llm);\n if (!isSubscriptionLlmConfig(llm)) return;\n\n const status = await LLMSubscriptionService.getOpenAIStatus();\n if (!status.connected) {\n throw new Error(SUBSCRIPTION_LOGIN_REQUIRED_ERROR);\n }\n}\n\nexport async function buildStartConversationRequestWithEncryptedSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n}): Promise<Record<string, unknown>> {\n const { SecretsService } = await import(\"./secrets-service\");\n\n const [settingsResult, customSecrets] = await Promise.all([\n SettingsService.getSettingsForConversation(),\n SecretsService.getSecrets(),\n ]);\n\n const { agentSettings, conversationSettings, secretsEncrypted } =\n settingsResult;\n\n await assertSubscriptionAuthReady(agentSettings);\n\n return buildStartConversationRequest({\n ...options,\n encryptedAgentSettings: agentSettings,\n encryptedConversationSettings: conversationSettings,\n secretsEncrypted,\n customSecrets,\n });\n}\n\nexport function emptyHooksResponse(): GetHooksResponse {\n return { hooks: [] };\n}\n"],"mappings":"6zBAkFA,IAAM,EAAsB,YACtB,EAAwB,iBAExB,EAAqB,CACzB,WACA,cACA,eACA,EACD,CACK,EAAwB,mBACxB,EAAqB,gBAE3B,SAAS,GAAsB,CAC7B,MAAO,GAiDT,SAAS,GAA2C,CAClD,IAAM,GAAA,IAAA,KAAqD,MAAM,CACjE,GAAI,EAAQ,OAAO,EAEnB,GAAI,OAAO,OAAW,IAAa,CACjC,IAAM,EAAY,OACf,uCACH,GAAI,OAAO,GAAa,SACtB,OAAO,EAAS,MAAM,EAAI,KAI9B,OAAO,KAGT,SAAS,GAAuD,CAC9D,IAAM,EAAM,GAA2B,CACvC,GAAI,CAAC,EAAK,OAAO,KACjB,GAAI,CACF,IAAM,EAAS,KAAK,MAAM,EAAI,CAE9B,MADI,CAAC,GAAU,OAAO,GAAW,SAAiB,KAC3C,OACD,CAIN,OAAO,MAoBX,SAAgB,GAAuD,CACrE,IAAM,EAAO,GAA0B,CACvC,GAAI,CAAC,GAAM,SAAU,OAErB,IAAM,EAAkB,EAAE,CAC1B,EAAM,KAAK,qBAAqB,CAC5B,EAAK,KACP,EAAM,KACJ,gEAAgE,EAAK,KAAK,SAC3E,CAED,EAAM,KAAK,oDAAoD,C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,EAAU,EAAA,0BAA0B,CACpC,EAAU,EAAU,EAAA,iBAAiB,EAAQ,CAAG,EAAE,CAElD,EAAwC,EAAE,CAChD,IAAK,IAAM,KAAU,EAAQ,cAAe,CAC1C,IAAM,EAA6B,CACjC,KAAM,eACN,IAAK,yBAAyB,mBAAmB,EAAO,KAAK,GAC7D,YAAa,EAAO,YACrB,CAEG,OAAO,KAAK,EAAQ,CAAC,OAAS,IAChC,EAAa,QAAU,GAGzB,EAAQ,EAAO,MAAQ,EAGzB,EAAQ,QAAU,EAGpB,OAAO,EAGT,IAAa,EACX,0FAQF,eAAsB,EACpB,EACe,CAEV,KAAA,wBADO,EAAS,EAAc,IACN,CAAI,EAG7B,EAAC,MADgB,EAAA,QAAuB,iBAAiB,EACjD,UACV,MAAU,MAAM,EAAkC,CAItD,eAAsB,EAAmD,EAQpC,CACnC,GAAM,CAAE,kBAAmB,MAAA,QAAA,SAAA,CAAA,SAAA,QAAM,wBAAA,CAAA,CAE3B,CAAC,EAAgB,GAAiB,MAAM,QAAQ,IAAI,CACxD,EAAA,QAAgB,4BAA4B,CAC5C,EAAe,YAAY,CAC5B,CAAC,CAEI,CAAE,gBAAe,uBAAsB,oBAC3C,EAIF,OAFA,MAAM,EAA4B,EAAc,CAEzC,EAA8B,CACnC,GAAG,EACH,uBAAwB,EACxB,8BAA+B,EAC/B,mBACA,gBACD,CAAC,CAGJ,SAAgB,GAAuC,CACrD,MAAO,CAAE,MAAO,EAAE,CAAE"}
|
|
@@ -130,6 +130,14 @@ export interface StartConversationOptions {
|
|
|
130
130
|
}>;
|
|
131
131
|
}
|
|
132
132
|
export declare function buildStartConversationRequest(options: StartConversationOptions): StartConversationPayload;
|
|
133
|
+
export declare const SUBSCRIPTION_LOGIN_REQUIRED_ERROR = "Connect your ChatGPT subscription before starting a conversation with this LLM profile.";
|
|
134
|
+
/**
|
|
135
|
+
* Throws if a ChatGPT subscription LLM profile is not connected.
|
|
136
|
+
* Called before conversation creation and LLM profile switch only — not on
|
|
137
|
+
* subsequent message sends or conversation resume. The agent-server must handle
|
|
138
|
+
* mid-conversation token expiry gracefully.
|
|
139
|
+
*/
|
|
140
|
+
export declare function assertSubscriptionAuthReady(agentSettings: Record<string, unknown>): Promise<void>;
|
|
133
141
|
export declare function buildStartConversationRequestWithEncryptedSettings(options: {
|
|
134
142
|
settings: Settings;
|
|
135
143
|
query?: string;
|
|
@@ -11,17 +11,19 @@ import c from "../node_modules/@openhands/extensions/skills/index.js";
|
|
|
11
11
|
import { DEFAULT_SETTINGS as l } from "../services/settings.js";
|
|
12
12
|
import { getAcpPreferredDefaultModel as u, getAcpProvider as d, resolveEffectiveAcpModel as f } from "../constants/acp-providers.js";
|
|
13
13
|
import p from "./settings-service/settings-service.api.js";
|
|
14
|
+
import { LLM_AUTH_TYPE_SUBSCRIPTION as m, OPENAI_SUBSCRIPTION_VENDOR as h, isSubscriptionLlmConfig as g } from "../constants/llm-subscription.js";
|
|
15
|
+
import _ from "./llm-subscription-service.js";
|
|
14
16
|
//#region src/api/agent-server-adapter.ts
|
|
15
|
-
var
|
|
17
|
+
var v = "canvas_ui", y = "canvas_ui_tool", b = [
|
|
16
18
|
"terminal",
|
|
17
19
|
"file_editor",
|
|
18
20
|
"task_tracker",
|
|
19
|
-
|
|
20
|
-
],
|
|
21
|
-
function
|
|
21
|
+
v
|
|
22
|
+
], x = "browser_tool_set", S = "task_tool_set";
|
|
23
|
+
function C() {
|
|
22
24
|
return !0;
|
|
23
25
|
}
|
|
24
|
-
function
|
|
26
|
+
function w() {
|
|
25
27
|
let e = (void 0)?.trim();
|
|
26
28
|
if (e) return e;
|
|
27
29
|
if (typeof window < "u") {
|
|
@@ -30,8 +32,8 @@ function b() {
|
|
|
30
32
|
}
|
|
31
33
|
return null;
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
let e =
|
|
35
|
+
function T() {
|
|
36
|
+
let e = w();
|
|
35
37
|
if (!e) return null;
|
|
36
38
|
try {
|
|
37
39
|
let t = JSON.parse(e);
|
|
@@ -40,27 +42,24 @@ function x() {
|
|
|
40
42
|
return null;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
function C() {
|
|
47
|
-
let e = x();
|
|
45
|
+
function E() {
|
|
46
|
+
let e = T();
|
|
48
47
|
if (!e?.services) return;
|
|
49
48
|
let t = [];
|
|
50
49
|
t.push("<RUNTIME_SERVICES>"), e.mode ? t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`) : t.push("You are running inside an agent-canvas dev stack."), t.push("The following services are reachable from your sandbox. URLs are written", "from your point of view (i.e., as you should curl/fetch them).", "");
|
|
51
|
-
let { agent_server: n, ingress: r, automation: i } = e.services, a = e.services
|
|
50
|
+
let { agent_server: n, ingress: r, automation: i } = e.services, { frontend: a } = e.services;
|
|
52
51
|
n?.url_from_agent && t.push(`* Agent Server (you): ${n.url_from_agent}`, ` ${n.description ?? "The agent-server hosting your tool calls."}`), r?.url_from_agent && t.push(`* Ingress: ${r.url_from_agent}`, ` ${r.description ?? "Unified entry point for browser-facing traffic."}`), a?.url_from_agent && t.push(`* Frontend: ${a.url_from_agent}`, ` ${a.description ?? "Frontend dev server."}`), i?.url_from_agent ? (t.push(`* Automation backend: ${i.url_from_agent}`, ` ${i.description ?? "OpenHands Automations service."}`), i.docs_url && t.push(` Docs: ${i.docs_url}`), i.openapi_url && t.push(` OpenAPI: ${i.openapi_url}`), i.auth_env_var && t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)) : t.push("* Automation backend: not running in this dev mode (skip /api/automation calls).");
|
|
53
52
|
let o = n?.url_from_agent;
|
|
54
53
|
return t.push("", "Trust this block over guessing: do not assume any other URLs are running."), o && t.push(`In particular, ${o} inside your sandbox is the Agent Server`, "you are running inside of — NOT the automation backend."), t.push("</RUNTIME_SERVICES>"), t.join("\n");
|
|
55
54
|
}
|
|
56
|
-
function
|
|
55
|
+
function D(e) {
|
|
57
56
|
let { host: t } = r();
|
|
58
57
|
return `${t}/api/conversations/${e}`;
|
|
59
58
|
}
|
|
60
|
-
function
|
|
59
|
+
function O(e) {
|
|
61
60
|
return `Conversation ${e.slice(0, 5)}`;
|
|
62
61
|
}
|
|
63
|
-
function
|
|
62
|
+
function k(n) {
|
|
64
63
|
let i = s(n.id), a = n.agent?.kind === "ACPAgent", o = a ? n.tags?.acpserver ?? null : null;
|
|
65
64
|
return {
|
|
66
65
|
id: n.id,
|
|
@@ -70,7 +69,7 @@ function E(n) {
|
|
|
70
69
|
git_provider: i?.git_provider ?? null,
|
|
71
70
|
selected_workspace: i?.selected_workspace ?? null,
|
|
72
71
|
active_profile: i?.active_profile ?? null,
|
|
73
|
-
title: n.title?.trim() ? n.title :
|
|
72
|
+
title: n.title?.trim() ? n.title : O(n.id),
|
|
74
73
|
trigger: null,
|
|
75
74
|
pr_number: [],
|
|
76
75
|
agent_kind: a ? "acp" : "openhands",
|
|
@@ -97,7 +96,7 @@ function E(n) {
|
|
|
97
96
|
updated_at: n.updated_at,
|
|
98
97
|
execution_status: n.execution_status ?? e.IDLE,
|
|
99
98
|
sandbox_status: n.sandbox_status ?? null,
|
|
100
|
-
conversation_url:
|
|
99
|
+
conversation_url: D(n.id),
|
|
101
100
|
session_api_key: r().apiKey ?? null,
|
|
102
101
|
sandbox_id: null,
|
|
103
102
|
workspace: { working_dir: n.workspace?.working_dir ?? t() },
|
|
@@ -105,13 +104,13 @@ function E(n) {
|
|
|
105
104
|
sub_conversation_ids: []
|
|
106
105
|
};
|
|
107
106
|
}
|
|
108
|
-
function
|
|
107
|
+
function A(e) {
|
|
109
108
|
return {
|
|
110
|
-
items: e.items.map(
|
|
109
|
+
items: e.items.map(k),
|
|
111
110
|
next_page_id: e.next_page_id ?? null
|
|
112
111
|
};
|
|
113
112
|
}
|
|
114
|
-
var
|
|
113
|
+
var j = "acpserver", M = new Set([
|
|
115
114
|
"schema_version",
|
|
116
115
|
"agent_settings",
|
|
117
116
|
"workspace",
|
|
@@ -119,22 +118,22 @@ var O = "acpserver", k = new Set([
|
|
|
119
118
|
"initial_message",
|
|
120
119
|
"plugins"
|
|
121
120
|
]);
|
|
122
|
-
function
|
|
121
|
+
function N(e) {
|
|
123
122
|
return !e || typeof e != "object" || Array.isArray(e) ? {} : structuredClone(e);
|
|
124
123
|
}
|
|
125
|
-
function
|
|
124
|
+
function P(e) {
|
|
126
125
|
if (typeof e != "string") return;
|
|
127
126
|
let t = e.trim();
|
|
128
127
|
return t.length > 0 ? t : void 0;
|
|
129
128
|
}
|
|
130
|
-
function
|
|
129
|
+
function F(e) {
|
|
131
130
|
return e.confirmation_mode === !0 ? e.security_analyzer === "llm" ? {
|
|
132
131
|
kind: "ConfirmRisky",
|
|
133
132
|
threshold: "HIGH",
|
|
134
133
|
confirm_unknown: !0
|
|
135
134
|
} : { kind: "AlwaysConfirm" } : { kind: "NeverConfirm" };
|
|
136
135
|
}
|
|
137
|
-
function
|
|
136
|
+
function I(e) {
|
|
138
137
|
switch (e.security_analyzer) {
|
|
139
138
|
case "llm": return { kind: "LLMSecurityAnalyzer" };
|
|
140
139
|
case "pattern": return { kind: "PatternSecurityAnalyzer" };
|
|
@@ -142,30 +141,30 @@ function N(e) {
|
|
|
142
141
|
default: return;
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
|
-
function
|
|
144
|
+
function L(e) {
|
|
146
145
|
return !!e && typeof e == "object" && !Array.isArray(e) && typeof e.name == "string";
|
|
147
146
|
}
|
|
148
|
-
function
|
|
149
|
-
return e ===
|
|
147
|
+
function R(e, t) {
|
|
148
|
+
return e === v ? i(e) : e === x ? C() && i(e) : e === S ? t.enable_sub_agents === !0 && i(e) : !0;
|
|
150
149
|
}
|
|
151
|
-
function
|
|
150
|
+
function z(e) {
|
|
152
151
|
let t = /* @__PURE__ */ new Map();
|
|
153
|
-
for (let
|
|
154
|
-
name:
|
|
152
|
+
for (let n of b) R(n, e) && t.set(n, {
|
|
153
|
+
name: n,
|
|
155
154
|
params: {}
|
|
156
155
|
});
|
|
157
|
-
for (let n of [
|
|
156
|
+
for (let n of [x, S]) R(n, e) && t.set(n, {
|
|
158
157
|
name: n,
|
|
159
158
|
params: {}
|
|
160
159
|
});
|
|
161
160
|
let n = e.tools;
|
|
162
|
-
if (Array.isArray(n) && n.every((e) =>
|
|
161
|
+
if (Array.isArray(n) && n.every((e) => L(e))) for (let r of n) R(r.name, e) && t.set(r.name, {
|
|
163
162
|
name: r.name,
|
|
164
|
-
params:
|
|
163
|
+
params: N(r.params)
|
|
165
164
|
});
|
|
166
165
|
return Array.from(t.values());
|
|
167
166
|
}
|
|
168
|
-
function
|
|
167
|
+
function B(e, t) {
|
|
169
168
|
let n = [e?.trim(), t?.trim()].filter(Boolean);
|
|
170
169
|
return n.length === 0 ? null : {
|
|
171
170
|
role: "user",
|
|
@@ -176,7 +175,7 @@ function L(e, t) {
|
|
|
176
175
|
run: !0
|
|
177
176
|
};
|
|
178
177
|
}
|
|
179
|
-
function
|
|
178
|
+
function V() {
|
|
180
179
|
return c.map((e) => {
|
|
181
180
|
let t = e.triggers?.length > 0 ? {
|
|
182
181
|
type: "keyword",
|
|
@@ -194,8 +193,8 @@ function R() {
|
|
|
194
193
|
};
|
|
195
194
|
});
|
|
196
195
|
}
|
|
197
|
-
function
|
|
198
|
-
let t =
|
|
196
|
+
function H(e) {
|
|
197
|
+
let t = E(), n = N(e.agent_context), r = [...Array.isArray(n.skills) ? n.skills : [], ...V()];
|
|
199
198
|
return {
|
|
200
199
|
...n,
|
|
201
200
|
skills: r,
|
|
@@ -205,30 +204,30 @@ function z(e) {
|
|
|
205
204
|
...t ? { system_message_suffix: t } : {}
|
|
206
205
|
};
|
|
207
206
|
}
|
|
208
|
-
function
|
|
209
|
-
return
|
|
207
|
+
function U(e) {
|
|
208
|
+
return N(e.agent_settings).agent_kind === "acp";
|
|
210
209
|
}
|
|
211
|
-
function
|
|
212
|
-
let t =
|
|
210
|
+
function W(e) {
|
|
211
|
+
let t = N(e.agent_settings).acp_server;
|
|
213
212
|
return typeof t == "string" && t.length > 0 ? t : void 0;
|
|
214
213
|
}
|
|
215
|
-
function
|
|
214
|
+
function G(e) {
|
|
216
215
|
let t = e.acp_command;
|
|
217
216
|
if (!(Array.isArray(t) && t.length === 0) && t !== void 0) return t;
|
|
218
217
|
let n = d(typeof e.acp_server == "string" ? e.acp_server : void 0);
|
|
219
218
|
return n ? [...n.default_command] : t;
|
|
220
219
|
}
|
|
221
|
-
function
|
|
222
|
-
let t =
|
|
220
|
+
function K(e) {
|
|
221
|
+
let t = N(e.agent_settings), n = {
|
|
223
222
|
agent_kind: "acp",
|
|
224
|
-
agent_context:
|
|
223
|
+
agent_context: H(t)
|
|
225
224
|
};
|
|
226
225
|
for (let e of o) {
|
|
227
226
|
if (e === "acp_model" || e === "acp_env") continue;
|
|
228
|
-
let r = e === "acp_command" ?
|
|
227
|
+
let r = e === "acp_command" ? G(t) : t[e];
|
|
229
228
|
r != null && (n[e] = r);
|
|
230
229
|
}
|
|
231
|
-
let r =
|
|
230
|
+
let r = N(t.mcp_config);
|
|
232
231
|
Object.keys(r).length > 0 && "mcpServers" in r && (n.mcp_config = r);
|
|
233
232
|
let i = typeof t.acp_server == "string" ? t.acp_server : void 0, a = f({
|
|
234
233
|
configured: t.acp_model,
|
|
@@ -236,29 +235,29 @@ function U(e) {
|
|
|
236
235
|
});
|
|
237
236
|
return a && (n.acp_model = a), n;
|
|
238
237
|
}
|
|
239
|
-
function
|
|
240
|
-
let t =
|
|
238
|
+
function q(e) {
|
|
239
|
+
let t = N(e.agent_settings), n = N(t.llm);
|
|
241
240
|
n.model = typeof n.model == "string" && n.model.trim().length > 0 ? n.model : l.llm_model;
|
|
242
|
-
let r =
|
|
241
|
+
let r = P(n.api_key);
|
|
243
242
|
r ? n.api_key = r : delete n.api_key;
|
|
244
|
-
let i =
|
|
245
|
-
i ? n.base_url = i : delete n.base_url;
|
|
246
|
-
let a =
|
|
243
|
+
let i = P(n.base_url);
|
|
244
|
+
i ? n.base_url = i : delete n.base_url, g(n) ? (n.auth_type = m, n.subscription_vendor = h, delete n.api_key, delete n.base_url) : (delete n.auth_type, delete n.subscription_vendor);
|
|
245
|
+
let a = N(t.mcp_config);
|
|
247
246
|
(Object.keys(a).length === 0 || !("mcpServers" in a)) && delete t.mcp_config, delete t.acp_server;
|
|
248
247
|
for (let e of o) delete t[e];
|
|
249
248
|
return delete t.acp_env, {
|
|
250
249
|
...t,
|
|
251
250
|
llm: n,
|
|
252
|
-
agent_context:
|
|
253
|
-
tools:
|
|
251
|
+
agent_context: H(t),
|
|
252
|
+
tools: z(t)
|
|
254
253
|
};
|
|
255
254
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
255
|
+
function J(e) {
|
|
256
|
+
return U(e) ? K(e) : q(e);
|
|
258
257
|
}
|
|
259
|
-
function
|
|
260
|
-
let { settings: n, query: r, conversationInstructions: i, plugins: a, workingDir: o } = e, s =
|
|
261
|
-
return
|
|
258
|
+
function Y(e) {
|
|
259
|
+
let { settings: n, query: r, conversationInstructions: i, plugins: a, workingDir: o } = e, s = N(n.conversation_settings), c = B(r, i);
|
|
260
|
+
return M.forEach((e) => delete s[e]), {
|
|
262
261
|
...s,
|
|
263
262
|
workspace: {
|
|
264
263
|
kind: "LocalWorkspace",
|
|
@@ -272,31 +271,30 @@ function K(e) {
|
|
|
272
271
|
})) } : {}
|
|
273
272
|
};
|
|
274
273
|
}
|
|
275
|
-
function
|
|
274
|
+
function X(e) {
|
|
276
275
|
let t = e.encryptedAgentSettings ? {
|
|
277
276
|
...e.settings,
|
|
278
277
|
agent_settings: e.encryptedAgentSettings
|
|
279
|
-
} : e.settings, r =
|
|
278
|
+
} : e.settings, r = U(t), o = J(t), s = r ? W(t) : void 0, c = Y(e.encryptedConversationSettings ? {
|
|
280
279
|
...e,
|
|
281
280
|
settings: {
|
|
282
281
|
...e.settings,
|
|
283
282
|
conversation_settings: e.encryptedConversationSettings
|
|
284
283
|
}
|
|
285
|
-
} : e),
|
|
286
|
-
agent_settings:
|
|
287
|
-
workspace:
|
|
288
|
-
confirmation_policy:
|
|
289
|
-
max_iterations: typeof
|
|
284
|
+
} : e), l = {
|
|
285
|
+
agent_settings: o,
|
|
286
|
+
workspace: c.workspace,
|
|
287
|
+
confirmation_policy: F(c),
|
|
288
|
+
max_iterations: typeof c.max_iterations == "number" ? c.max_iterations : 500,
|
|
290
289
|
stuck_detection: !0,
|
|
291
290
|
autotitle: !0,
|
|
292
291
|
worktree: e.worktree ?? !0
|
|
293
292
|
};
|
|
294
|
-
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}, s.agent_definitions && (c.agent_definitions = s.agent_definitions), e.customSecrets && e.customSecrets.length > 0) {
|
|
293
|
+
s && (l.tags = { [j]: s }), e.secretsEncrypted && !r && (l.secrets_encrypted = !0), e.conversationId && (l.conversation_id = e.conversationId);
|
|
294
|
+
let u = I(c);
|
|
295
|
+
u && (l.security_analyzer = u), c.initial_message && (l.initial_message = c.initial_message), c.plugins && (l.plugins = c.plugins), c.hook_config && (l.hook_config = c.hook_config);
|
|
296
|
+
let d = {}, f = i(v);
|
|
297
|
+
if (f && (d[v] = y), Object.assign(d, c.tool_module_qualnames ?? {}), f || delete d[v], Object.keys(d).length > 0 && (l.tool_module_qualnames = d), c.agent_definitions && (l.agent_definitions = c.agent_definitions), e.customSecrets && e.customSecrets.length > 0) {
|
|
300
298
|
let t = n(), r = t ? a(t) : {}, i = {};
|
|
301
299
|
for (let t of e.customSecrets) {
|
|
302
300
|
let e = {
|
|
@@ -306,13 +304,17 @@ function q(e) {
|
|
|
306
304
|
};
|
|
307
305
|
Object.keys(r).length > 0 && (e.headers = r), i[t.name] = e;
|
|
308
306
|
}
|
|
309
|
-
|
|
307
|
+
l.secrets = i;
|
|
310
308
|
}
|
|
311
|
-
return
|
|
309
|
+
return l;
|
|
310
|
+
}
|
|
311
|
+
var Z = "Connect your ChatGPT subscription before starting a conversation with this LLM profile.";
|
|
312
|
+
async function Q(e) {
|
|
313
|
+
if (g(N(e.llm)) && !(await _.getOpenAIStatus()).connected) throw Error(Z);
|
|
312
314
|
}
|
|
313
|
-
async function
|
|
315
|
+
async function $(e) {
|
|
314
316
|
let { SecretsService: t } = await import("./secrets-service.js"), [n, r] = await Promise.all([p.getSettingsForConversation(), t.getSecrets()]), { agentSettings: i, conversationSettings: a, secretsEncrypted: o } = n;
|
|
315
|
-
return
|
|
317
|
+
return await Q(i), X({
|
|
316
318
|
...e,
|
|
317
319
|
encryptedAgentSettings: i,
|
|
318
320
|
encryptedConversationSettings: a,
|
|
@@ -320,10 +322,10 @@ async function J(e) {
|
|
|
320
322
|
customSecrets: r
|
|
321
323
|
});
|
|
322
324
|
}
|
|
323
|
-
function
|
|
325
|
+
function ee() {
|
|
324
326
|
return { hooks: [] };
|
|
325
327
|
}
|
|
326
328
|
//#endregion
|
|
327
|
-
export {
|
|
329
|
+
export { Q as assertSubscriptionAuthReady, $ as buildStartConversationRequestWithEncryptedSettings, ee as emptyHooksResponse, O as getDefaultConversationTitle, k as toAppConversation, A as toConversationPage };
|
|
328
330
|
|
|
329
331
|
//# sourceMappingURL=agent-server-adapter.js.map
|