@openhands/agent-canvas 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-DLe_gVDY.js → acp-providers-BkL3HWa3.js} +1 -1
- package/build/assets/{active-backend-context-B0wI7OzM.js → active-backend-context-BBvP-bI2.js} +1 -1
- package/build/assets/{agent-context-settings-CaQtdNA-.js → agent-context-settings-Bno1nwPL.js} +1 -1
- package/build/assets/{agent-profiles-settings-CvuErjp6.js → agent-profiles-settings-DqoS7RL3.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +86 -0
- package/build/assets/agent-settings-BJHryp65.js +1 -0
- package/build/assets/{agent-settings-UE-U4Xii.js → agent-settings-h8hQz-IU.js} +1 -1
- package/build/assets/{alert-banner-BMaOtTCG.js → alert-banner-lrK-2_0Y.js} +1 -1
- package/build/assets/{api-key-entry-screen-Cy66vT4D.js → api-key-entry-screen-Qsb83VX1.js} +1 -1
- package/build/assets/{app-settings-9ok42bV6.js → app-settings-r1RUbgGi.js} +1 -1
- package/build/assets/{automation-detail-fuITm6i3.js → automation-detail-7LkL91j9.js} +3 -3
- package/build/assets/{automation-export-CRq40mux.js → automation-export-U2QNyNy6.js} +1 -1
- package/build/assets/{automation-setup-route-EXDazOHW.js → automation-setup-route-Bel9_Lue.js} +1 -1
- package/build/assets/{automation-templates-BArZsaxP.js → automation-templates-CRLDssaI.js} +1 -1
- package/build/assets/{automations-list-CG4HKOTn.js → automations-list-B2iV3ZKW.js} +1 -1
- package/build/assets/{back-nav-button-BZB6H7xz.js → back-nav-button-B3pYwmUJ.js} +1 -1
- package/build/assets/backend-form-modal-OroTqnAv.js +1 -0
- package/build/assets/{backend-synced-settings-badge-B_NXJ3u1.js → backend-synced-settings-badge-DB4717Iu.js} +1 -1
- package/build/assets/{badge-C64c-7PO.js → badge-yR53enbU.js} +1 -1
- package/build/assets/{base-modal-C0RQPug5.js → base-modal-3NmIOKDm.js} +1 -1
- package/build/assets/{brand-button-DJmFCyMK.js → brand-button-CJcwjnfb.js} +1 -1
- package/build/assets/{browser-D3gd2n83.js → browser--eoQOo4M.js} +1 -1
- package/build/assets/{browser-tab-BicAWuJ1.js → browser-tab-A94o33Vn.js} +1 -1
- package/build/assets/{chat-send-button-CCrH1E8u.js → chat-send-button-B8n6-DQA.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-CB_sNERY.js → circle-plus-check-toggle-BVzv5EkZ.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-XynamQGU.js → cloud-funnel-analytics-CBQdPZl_.js} +1 -1
- package/build/assets/{combobox-caret-Bwiifgjs.js → combobox-caret-BlmRwiM8.js} +1 -1
- package/build/assets/command-menu-PsRXVBz2.js +1 -0
- package/build/assets/{condenser-settings-cNGy75gq.js → condenser-settings-w7L3EFvm.js} +1 -1
- package/build/assets/{confirmation-modal-BATFmFyP.js → confirmation-modal-DAH0XtOp.js} +1 -1
- package/build/assets/{context-menu-list-item-DhJCcBA0.js → context-menu-list-item-BQhmFVEK.js} +1 -1
- package/build/assets/{conversation-Csdxh9Xt.js → conversation-BUzBZAc-.js} +4 -4
- package/build/assets/conversation-panel-pzAKsSDb.js +1 -0
- package/build/assets/conversation-pzAKsSDb.js +1 -0
- package/build/assets/{conversation-state-store-C2QzhPaK.js → conversation-state-store-Bs8gA263.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-D3fb5xIA.js → conversation-tab-empty-state-C9sfDOlt.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-c4MQwKGj.js → copy-to-clipboard-button-DatoElj8.js} +1 -1
- package/build/assets/{device-verify-oFpQoLgm.js → device-verify-BIjXeW9N.js} +1 -1
- package/build/assets/{dropdown-classes-f91ARMV1.js → dropdown-classes-zFW7qPSK.js} +1 -1
- package/build/assets/{entry.client-BCzY2Bf3.js → entry.client-DzbDyLkV.js} +2 -2
- package/build/assets/{enum-filter-dropdown-HG3q3rkV.js → enum-filter-dropdown-CctILg5t.js} +1 -1
- package/build/assets/{environment-switch-overlay-CquZXolz.js → environment-switch-overlay-Cvmo6clk.js} +1 -1
- package/build/assets/{extensions-hub-BeweE0PW.js → extensions-hub-DOmHPGTA.js} +1 -1
- package/build/assets/{extensions-navigation-Dd58NlUF.js → extensions-navigation-6zU5M1pa.js} +1 -1
- package/build/assets/{files-tab-CLLG55-q.js → files-tab-BzofBmF4.js} +1 -1
- package/build/assets/{form-control-classes-pHtZUI6K.js → form-control-classes-DLN3Qgub.js} +1 -1
- package/build/assets/{format-relative-time-6-3uvOXe.js → format-relative-time-DGPQlPx0.js} +1 -1
- package/build/assets/{git-provider-icon-wg7ShB98.js → git-provider-icon-BLMlwy02.js} +1 -1
- package/build/assets/{git-repo-dropdown-CWnaUyxL.js → git-repo-dropdown-B7RvO70z.js} +1 -1
- package/build/assets/git-repo-dropdown-B_PTq4ol.js +1 -0
- package/build/assets/{highlighted-source-view-DBtI3por.js → highlighted-source-view-CgJfD5VT.js} +1 -1
- package/build/assets/{home-BpZQkDWM.js → home-DEZaZqYv.js} +1 -1
- package/build/assets/home-r89Vj2td.js +1 -0
- package/build/assets/{home-store-DM4qw1lF.js → home-store-D7CjMN_-.js} +1 -1
- package/build/assets/index-home-r89Vj2td.js +1 -0
- package/build/assets/install-server-modal-BTwK5lbi.js +1 -0
- package/build/assets/{kebab-menu-item-content-By16Tm_0.js → kebab-menu-item-content-C4CkeiJO.js} +1 -1
- package/build/assets/{launch-C9uijypN.js → launch-DVlx4v9o.js} +1 -1
- package/build/assets/{llm-not-configured-banner-DrBrhfN0.js → llm-not-configured-banner-CwKu8C6g.js} +2 -2
- package/build/assets/llm-settings-BJotLQND.js +1 -0
- package/build/assets/llm-settings-CDM-5H2A.js +1 -0
- package/build/assets/{llm-subscription-service-DwjJ8-_X.js → llm-subscription-service-7eVfDIE1.js} +1 -1
- package/build/assets/{loading-spinner-6Yj-YyoS.js → loading-spinner-CN3riY7k.js} +1 -1
- package/build/assets/{manage-backends-modal-DrwErS0N.js → manage-backends-modal-HNWKLYhq.js} +1 -1
- package/build/assets/manifest-2a36a8f8.js +1 -0
- package/build/assets/{manifest-subpage-layout-CtqVwIvJ.js → manifest-subpage-layout-D-m-h8_t.js} +1 -1
- package/build/assets/map-provider-7Bp2aih5.js +1 -0
- package/build/assets/markdown-renderer-BiiiIznl.js +8 -0
- package/build/assets/mcp-gLgPP7AS.js +9 -0
- package/build/assets/{mcp-marketplace-utils-BMnYz0Gc.js → mcp-marketplace-utils-Dr_HG_ol.js} +1 -1
- package/build/assets/messages-D1cbVhRK.js +40 -0
- package/build/assets/{modal-body-BHGCSAtj.js → modal-body-duRaxj_K.js} +1 -1
- package/build/assets/{modal-classes-DSTLuxkA.js → modal-classes-CLEXO6dj.js} +1 -1
- package/build/assets/{modal-close-button-dheWZ2ys.js → modal-close-button-D0aT02hs.js} +1 -1
- package/build/assets/npm-DRzJF5Zn.js +1 -0
- package/build/assets/{onboarding-5CZvRBbh.js → onboarding-DSr8hOpk.js} +1 -1
- package/build/assets/{onboarding-modal-CD2ehuxt.js → onboarding-modal-C6Euf7N4.js} +1 -1
- package/build/assets/{organization-service.api-Dsuoep0g.js → organization-service.api-C4GYWwj9.js} +1 -1
- package/build/assets/{planner-tab-DeO7Thb0.js → planner-tab-CZcguxTK.js} +1 -1
- package/build/assets/{plugins-management-service-C9f75R6X.js → plugins-management-service-BmDzOQsd.js} +1 -1
- package/build/assets/{profiles-service.api-Dl20_2IM.js → profiles-service.api-CoLTwjc1.js} +1 -1
- package/build/assets/{providers-CeuhK46N.js → providers-tBzTpz1w.js} +1 -1
- package/build/assets/{proxy-CIGI9zQC.js → proxy-DCI9S-LA.js} +1 -1
- package/build/assets/recommended-automations-launcher-BbJAJVED.js +1 -0
- package/build/assets/root-BfM_kC_d.css +1 -0
- package/build/assets/root-gstBEjty.js +2 -0
- package/build/assets/root-layout-BIAFLP9p.js +2 -0
- package/build/assets/{schema-field-z2vSLuLo.js → schema-field-zhsVDllR.js} +1 -1
- package/build/assets/{sdk-section-page-BnCXAytf.js → sdk-section-page-CS4GWn0y.js} +1 -1
- package/build/assets/{secrets-service-DGUNlwQd.js → secrets-service-DjgGduXk.js} +1 -1
- package/build/assets/{secrets-settings-DUmML_dK.js → secrets-settings-f-qahfbi.js} +1 -1
- package/build/assets/{segmented-toggle-eSofF7gn.js → segmented-toggle-SmvsR3jW.js} +1 -1
- package/build/assets/settings-DQd0xLEw.js +1 -0
- package/build/assets/{settings-dropdown-input-Cx4g7Xfl.js → settings-dropdown-input-TWIeiG02.js} +1 -1
- package/build/assets/{settings-index-BECdgecg.js → settings-index-BVwy9JEp.js} +1 -1
- package/build/assets/{settings-input-BQY115xH.js → settings-input-D61Vzp9e.js} +1 -1
- package/build/assets/{settings-list-classes-C9cLrrcc.js → settings-list-classes-sE0ASr1s.js} +1 -1
- package/build/assets/{settings-modal-ChBJNTdd.js → settings-modal-D6D5ngET.js} +1 -1
- package/build/assets/{settings-service.api-Dz9cZyvx.js → settings-service.api-DZp7E7A9.js} +1 -1
- package/build/assets/{settings-switch-BIodMVz9.js → settings-switch-Drt-rF5s.js} +1 -1
- package/build/assets/{settings-utils-BL_Z9uIe.js → settings-utils-gw2ppAvw.js} +1 -1
- package/build/assets/{shared-conversation-CSF0aTuE.js → shared-conversation-DIxZjElr.js} +1 -1
- package/build/assets/{wrench-DRitTfwe.js → shield-check-D2cpEpv3.js} +1 -1
- package/build/assets/{sidebar-layout-DEycoFd_.js → sidebar-layout-Dxg6zc2K.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DeRvTupV.js → sidebar-mobile-menu-toggle-OoZBHxaT.js} +1 -1
- package/build/assets/{sidebar-nav-link-BjpQ-NVc.js → sidebar-nav-link-CxLoG-dG.js} +1 -1
- package/build/assets/sidebar-store-BJeYY-E9.js +1 -0
- package/build/assets/{skill-card-pill-row-BH6fPGba.js → skill-card-pill-row-B_BYBONu.js} +1 -1
- package/build/assets/{skill-icon-badge-D4uznfjU.js → skill-icon-badge-CN41Hy9l.js} +1 -1
- package/build/assets/{skill-scope-DH_AUUUP.js → skill-scope-B1Per5XI.js} +1 -1
- package/build/assets/{skills-plugins-vfvOk34h.js → skills-plugins-B3AO6sMz.js} +1 -1
- package/build/assets/skills-settings-DmmgJ6CT.js +2 -0
- package/build/assets/{styled-tooltip-CQ9JEFiO.js → styled-tooltip-C5C07RQC.js} +1 -1
- package/build/assets/{task-list-tab-DeF_uXdw.js → task-list-tab-C19Q_JNf.js} +1 -1
- package/build/assets/{terminal-DRc4rup7.js → terminal-CbuMRYal.js} +1 -1
- package/build/assets/{toggle-switch--8n8NeV_.js → toggle-switch-CIioisto.js} +1 -1
- package/build/assets/{typography-BSbUhJPn.js → typography-D9tiHct7.js} +1 -1
- package/build/assets/{use-acp-credential-form-BGKFi1VL.js → use-acp-credential-form-DJmmJKMo.js} +1 -1
- package/build/assets/{use-activate-agent-profile-2nvALjC-.js → use-activate-agent-profile-CeFfYwu_.js} +1 -1
- package/build/assets/{use-agent-profiles-BlQA67MW.js → use-agent-profiles-BHLkLbRR.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Clw5Dh1s.js → use-can-manage-org-profiles-Bu4y8gSx.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B8AQSQFM.js → use-cloud-current-user-id-QD9x3ySO.js} +1 -1
- package/build/assets/{use-config-C3zGuUQI.js → use-config-CPwqciXN.js} +1 -1
- package/build/assets/{use-create-conversation-FaP0kUpg.js → use-create-conversation-DWaSVUOB.js} +1 -1
- package/build/assets/{use-create-secret-CgQ3pXd6.js → use-create-secret-BsOfOLvg.js} +1 -1
- package/build/assets/{use-llm-profiles-C-tDO6UB.js → use-llm-profiles-CU8ah1pz.js} +1 -1
- package/build/assets/{use-manifest-capabilities-DLP5wCxp.js → use-manifest-capabilities-DBYPjyV6.js} +1 -1
- package/build/assets/{use-onboarding-completion-BiCdXvlU.js → use-onboarding-completion-CtNJxkXG.js} +1 -1
- package/build/assets/{use-plugins-marketplace-DRFNLBlr.js → use-plugins-marketplace-ZEA-gyM9.js} +1 -1
- package/build/assets/{use-save-agent-profile-CaGVAudI.js → use-save-agent-profile-DgI_Uz9a.js} +1 -1
- package/build/assets/{use-save-settings-C9B8Y-h3.js → use-save-settings-pSjRhD_m.js} +1 -1
- package/build/assets/{use-settings-3RcgdUuZ.js → use-settings-BHWsOcIG.js} +1 -1
- package/build/assets/use-settings-nav-items-CQgkxUbV.js +16 -0
- package/build/assets/{use-tracking-CTtkLAmx.js → use-tracking-CGCsBWhg.js} +1 -1
- package/build/assets/{use-user-conversation-Bei82QsZ.js → use-user-conversation-DRfEU8x0.js} +1 -1
- package/build/assets/utils-DPQfkd-7.js +1 -0
- package/build/assets/{verification-settings-nD61Ijph.js → verification-settings-BItwt998.js} +1 -1
- package/build/assets/wrench-B1_H-tL1.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +39 -2
- package/build/locales/ca/openhands.json +39 -2
- package/build/locales/de/openhands.json +39 -2
- package/build/locales/en/openhands.json +39 -2
- package/build/locales/es/openhands.json +39 -2
- package/build/locales/fr/openhands.json +39 -2
- package/build/locales/it/openhands.json +39 -2
- package/build/locales/ja/openhands.json +39 -2
- package/build/locales/ko-KR/openhands.json +39 -2
- package/build/locales/no/openhands.json +39 -2
- package/build/locales/pt/openhands.json +39 -2
- package/build/locales/tr/openhands.json +39 -2
- package/build/locales/uk/openhands.json +39 -2
- package/build/locales/zh-CN/openhands.json +39 -2
- package/build/locales/zh-TW/openhands.json +39 -2
- package/config/defaults.json +1 -1
- 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 +32 -5
- package/dist/api/agent-server-adapter.js +120 -91
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
- package/dist/api/cloud/conversation-service.api.d.ts +19 -2
- package/dist/api/cloud/conversation-service.api.js +51 -47
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/conversation-file-upload.api.cjs +1 -1
- package/dist/api/conversation-file-upload.api.js +10 -10
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +55 -61
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.js +12 -12
- package/dist/api/launch-child-conversation-client-tool.cjs +47 -0
- package/dist/api/launch-child-conversation-client-tool.cjs.map +1 -0
- package/dist/api/launch-child-conversation-client-tool.d.ts +3 -0
- package/dist/api/launch-child-conversation-client-tool.js +93 -0
- package/dist/api/launch-child-conversation-client-tool.js.map +1 -0
- package/dist/api/open-hands.types.d.ts +1 -1
- package/dist/api/workspace-upload-path.cjs +1 -1
- package/dist/api/workspace-upload-path.js +8 -8
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +24 -18
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +5 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +2 -2
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +11 -7
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -2
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +2 -8
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +48 -51
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.d.ts +12 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js +6 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.d.ts +16 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js +95 -78
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js +40 -38
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.d.ts +14 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js +167 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.d.ts +63 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js +66 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.d.ts +15 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js +117 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.js +30 -19
- package/dist/components/features/conversation-panel/conversation-card/no-repository.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +7 -2
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +146 -104
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +20 -0
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +53 -27
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +226 -213
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.cjs +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.cjs.map +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.d.ts +10 -5
- package/dist/components/features/settings/agent-canvas-update-card.js +223 -149
- package/dist/components/features/settings/agent-canvas-update-card.js.map +1 -1
- package/dist/components/features/settings/agent-canvas-version-modal.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-version-modal.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-modal.d.ts +11 -0
- package/dist/components/features/settings/agent-canvas-version-modal.js +166 -0
- package/dist/components/features/settings/agent-canvas-version-modal.js.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-tile.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-version-tile.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-tile.d.ts +13 -0
- package/dist/components/features/settings/agent-canvas-version-tile.js +60 -0
- package/dist/components/features/settings/agent-canvas-version-tile.js.map +1 -0
- package/dist/components/features/settings/settings-desktop-sidebar.cjs +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.cjs.map +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +109 -108
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
- package/dist/components/features/skills/extensions-navigation.js +9 -9
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/child-conversation.cjs +2 -0
- package/dist/constants/child-conversation.cjs.map +1 -0
- package/dist/constants/child-conversation.d.ts +29 -0
- package/dist/constants/child-conversation.js +6 -0
- package/dist/constants/child-conversation.js.map +1 -0
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +189 -188
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/chat/use-model-interceptor.cjs +1 -1
- package/dist/hooks/chat/use-model-interceptor.js +6 -6
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +6 -6
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +38 -1
- 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 +644 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/docker.cjs +2 -0
- package/dist/icons/docker.cjs.map +1 -0
- package/dist/icons/docker.js +19 -0
- package/dist/icons/docker.js.map +1 -0
- package/dist/icons/npm.cjs +2 -0
- package/dist/icons/npm.cjs.map +1 -0
- package/dist/icons/npm.js +19 -0
- package/dist/icons/npm.js.map +1 -0
- package/dist/locales/ar/openhands.json +39 -2
- package/dist/locales/ca/openhands.json +39 -2
- package/dist/locales/de/openhands.json +39 -2
- package/dist/locales/en/openhands.json +39 -2
- package/dist/locales/es/openhands.json +39 -2
- package/dist/locales/fr/openhands.json +39 -2
- package/dist/locales/it/openhands.json +39 -2
- package/dist/locales/ja/openhands.json +39 -2
- package/dist/locales/ko-KR/openhands.json +39 -2
- package/dist/locales/no/openhands.json +39 -2
- package/dist/locales/pt/openhands.json +39 -2
- package/dist/locales/tr/openhands.json +39 -2
- package/dist/locales/uk/openhands.json +39 -2
- package/dist/locales/zh-CN/openhands.json +39 -2
- package/dist/locales/zh-TW/openhands.json +39 -2
- package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.js +35 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js +33 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +6 -3
- package/dist/package.js.map +1 -1
- package/dist/services/child-conversation-launch.cjs +2 -0
- package/dist/services/child-conversation-launch.cjs.map +1 -0
- package/dist/services/child-conversation-launch.d.ts +41 -0
- package/dist/services/child-conversation-launch.js +182 -0
- package/dist/services/child-conversation-launch.js.map +1 -0
- package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
- package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
- package/dist/stores/conversation-panel-preferences-store.d.ts +5 -1
- package/dist/stores/conversation-panel-preferences-store.js +8 -2
- package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
- package/dist/types/agent-server/core/base/action.d.ts +17 -1
- package/dist/types/agent-server/core/base/base.d.ts +2 -1
- package/dist/types/agent-server/type-guards.cjs +1 -1
- package/dist/types/agent-server/type-guards.cjs.map +1 -1
- package/dist/types/agent-server/type-guards.d.ts +8 -1
- package/dist/types/agent-server/type-guards.js +4 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/types/automation.d.ts +14 -0
- package/dist/utils/custom-toast-handlers.cjs +1 -1
- package/dist/utils/custom-toast-handlers.cjs.map +1 -1
- package/dist/utils/custom-toast-handlers.js +18 -1
- package/dist/utils/custom-toast-handlers.js.map +1 -1
- package/package.json +6 -3
- package/scripts/brand-dev-electron.mjs +244 -0
- package/scripts/check-translation-completeness.cjs +4 -0
- package/scripts/generate-icons.mjs +109 -0
- package/build/assets/agent-server-conversation-service.api-km_8sOVf.js +0 -41
- package/build/assets/agent-settings-nmO-KSXr.js +0 -1
- package/build/assets/backend-form-modal-B_lXjOGa.js +0 -1
- package/build/assets/command-menu-CA3IjGNc.js +0 -1
- package/build/assets/conversation-B6t6EiVp.js +0 -1
- package/build/assets/conversation-panel-B6t6EiVp.js +0 -1
- package/build/assets/copy-DaHuDtG4.js +0 -1
- package/build/assets/git-repo-dropdown-TzOuG5Ef.js +0 -1
- package/build/assets/home-OEx0XtfP.js +0 -1
- package/build/assets/index-home-OEx0XtfP.js +0 -1
- package/build/assets/info-C9lpK5pw.js +0 -1
- package/build/assets/install-server-modal-DnjZrJUy.js +0 -1
- package/build/assets/list-filter-C86CBRDE.js +0 -1
- package/build/assets/llm-settings-CRsLqxgu.js +0 -1
- package/build/assets/llm-settings-RBm_3kNm.js +0 -1
- package/build/assets/manifest-c352d453.js +0 -1
- package/build/assets/map-provider-CXU6issd.js +0 -1
- package/build/assets/markdown-renderer-lsvsp7jn.js +0 -8
- package/build/assets/mcp-DD4hPTRE.js +0 -9
- package/build/assets/messages-Dt77e0qi.js +0 -40
- package/build/assets/recommended-automations-launcher-6xmbf7lh.js +0 -1
- package/build/assets/root-BQPNqNvD.js +0 -2
- package/build/assets/root-BeuHFY2s.css +0 -1
- package/build/assets/root-layout-Dl_2CDoq.js +0 -3
- package/build/assets/settings-Co-M5bK9.js +0 -1
- package/build/assets/sidebar-store-B04sX8aP.js +0 -1
- package/build/assets/skills-settings-DnbIu2eO.js +0 -2
- package/build/assets/use-settings-nav-items-y-Oyc93G.js +0 -16
- package/build/assets/utils-BX9XJ0IE.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +0 -1
|
@@ -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 { ServerClient } from \"@openhands/typescript-client/clients\";\nimport { SKILLS_CATALOG } from \"@openhands/extensions/skills\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { ExecutionStatus } from \"#/types/agent-server/core\";\nimport { AgentKind, 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 {\n getCachedAgentServerInfo,\n isAgentServerToolAvailable,\n} 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\";\nimport {\n CANVAS_UI_CLIENT_TOOL,\n CANVAS_UI_CLIENT_TOOL_NAME,\n LEGACY_CANVAS_UI_TOOL_NAME,\n type ClientToolSpec,\n} from \"./canvas-ui-client-tool\";\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 /**\n * ACP CLI identity (``claude-code`` / ``codex`` / ``gemini-cli``) from the\n * SDK's ``ACPAgent.acp_server`` (#3692). Preferred fallback when the\n * ``acpserver`` tag is absent — e.g. a profile launch doesn't stamp the tag\n * client-side and the server may not repopulate it. Read by {@link toAppConversation}.\n */\n acp_server?: 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 launched_agent_profile?: {\n agent_profile_id: string;\n revision: number;\n } | null;\n}\n\nconst DEFAULT_TOOL_NAMES = [\"terminal\", \"file_editor\", \"task_tracker\"];\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 served by Agent Canvas backends in\n * `/server_info.runtime_services`. 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 reachable\n * from inside its sandbox without having to probe.\n */\nexport interface 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\nexport function parseRuntimeServicesInfo(\n value: unknown,\n): RuntimeServicesInfo | null {\n if (typeof value === \"string\") {\n const raw = value.trim();\n if (!raw) return null;\n try {\n return parseRuntimeServicesInfo(JSON.parse(raw));\n } catch {\n return null;\n }\n }\n\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return null;\n }\n\n const parsed = value as RuntimeServicesInfo;\n if (!parsed.services || typeof parsed.services !== \"object\") return null;\n return parsed;\n}\n\nexport async function fetchBackendRuntimeServicesInfo(): Promise<RuntimeServicesInfo | null> {\n let clientOptions: ReturnType<typeof getAgentServerClientOptions>;\n try {\n clientOptions = getAgentServerClientOptions({ timeout: 3000 });\n } catch {\n return null;\n }\n\n const cached = parseRuntimeServicesInfo(\n getCachedAgentServerInfo({ host: clientOptions.host })?.runtime_services,\n );\n if (cached) return cached;\n\n try {\n const serverInfo = await new ServerClient(clientOptions).getServerInfo();\n return parseRuntimeServicesInfo(\n (serverInfo as { runtime_services?: unknown }).runtime_services,\n );\n } catch {\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 supplied.\n */\nexport function getDeploymentMode(\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): string | null {\n return runtimeServicesInfo?.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 available, so callers can safely\n * omit the field when the selected backend does not advertise runtime services.\n */\nexport function buildRuntimeServicesSystemSuffix(\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): string | undefined {\n const info = parseRuntimeServicesInfo(runtimeServicesInfo);\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. Fall back to the\n // agent's own ``acp_server`` (#3692) when the tag is missing — a profile\n // launch doesn't stamp the tag, so tag-only reads would drop the ACP model\n // picker and degrade the chip to a generic \"ACP\" (#1571).\n const acpServer = isAcp\n ? (info.tags?.[ACP_SERVER_TAG_KEY] ?? info.agent?.acp_server ?? null)\n : 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 tags: info.tags ?? null,\n launched_agent_profile: info.launched_agent_profile ?? null,\n // Chip path: omit ``providerDefault`` so that when no concrete model\n // resolves, the chip falls back to the provider display name in\n // ConversationCardFooter rather than a registry default the session may\n // not actually be running.\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\n/**\n * Conversation tag keys Canvas itself stamps/consumes for internal routing.\n * They are already surfaced through dedicated UI (the ACP provider chip), so\n * the generic tag-chip display filters them out.\n */\nexport const RESERVED_CONVERSATION_TAG_KEYS: ReadonlySet<string> = new Set([\n ACP_SERVER_TAG_KEY,\n]);\n\n/**\n * User-facing subset of a conversation's server-side tags: everything except\n * {@link RESERVED_CONVERSATION_TAG_KEYS}, as stable ``[key, value]`` entries\n * sorted by key so chip order doesn't shuffle between refetches.\n */\nexport function getDisplayConversationTags(\n tags: Record<string, string> | null | undefined,\n): Array<[string, string]> {\n if (!tags) {\n return [];\n }\n return Object.entries(tags)\n .filter(([key]) => !RESERVED_CONVERSATION_TAG_KEYS.has(key))\n .sort(([a], [b]) => a.localeCompare(b));\n}\n\nconst FERNET_TOKEN_PREFIX = \"gAAAAA\";\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 isPlainRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction hasEncryptedString(value: unknown): boolean {\n if (typeof value === \"string\") {\n return value.startsWith(FERNET_TOKEN_PREFIX);\n }\n if (Array.isArray(value)) {\n return value.some(hasEncryptedString);\n }\n if (isPlainRecord(value)) {\n return Object.values(value).some(hasEncryptedString);\n }\n return false;\n}\n\nfunction hasEncryptedMcpSecrets(mcpConfig: unknown): boolean {\n if (!isPlainRecord(mcpConfig)) {\n return false;\n }\n\n return Object.values(mcpConfig).some(hasEncryptedString);\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 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: string;\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 // Use the absolute path to the skill's SKILL.md so the Python\n // agent-server can resolve bundled resources (scripts/, references/).\n // Falls back to \"public\" in library builds where the path isn't known.\n const source = __EXTENSIONS_SKILLS_DIR__\n ? `${__EXTENSIONS_SKILLS_DIR__}/${entry.name}/SKILL.md`\n : \"public\";\n\n return {\n name: entry.name,\n content: entry.content,\n trigger,\n source,\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(\n agentSettings: SettingsRecord,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n disabledSkills: string[] = [],\n): SettingsRecord {\n const runtimeServicesSuffix =\n buildRuntimeServicesSystemSuffix(runtimeServicesInfo);\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 disabledSkillNames = new Set(disabledSkills);\n const mergedSkills = [...existingSkills, ...buildBundledSkills()].filter(\n (skill) =>\n typeof skill.name !== \"string\" || !disabledSkillNames.has(skill.name),\n );\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 runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const payload: AgentSettingsPayload = {\n agent_kind: \"acp\",\n agent_context: buildAgentContext(\n agentSettings,\n runtimeServicesInfo,\n settings.disabled_skills,\n ),\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) {\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 runtimeServicesInfo?: RuntimeServicesInfo | null,\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 // Stream assistant tokens (parity with ACP agents). The agent-server only\n // emits StreamingDeltaEvents for SDK LLM agents when an LLM has stream=True.\n llm.stream = true;\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) {\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(\n agentSettings,\n runtimeServicesInfo,\n settings.disabled_skills,\n ),\n tools: getAgentTools(agentSettings),\n };\n}\n\nfunction buildConfiguredAgentSettings(\n settings: Settings,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n return isAcpAgent(settings)\n ? buildConfiguredAcpAgentSettings(settings, runtimeServicesInfo)\n : buildConfiguredOpenHandsAgentSettings(settings, runtimeServicesInfo);\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 // Omitted when launching via ``agent_profile_id`` — the two are mutually\n // exclusive agent sources; the server resolves the profile server-side.\n agent_settings?: AgentSettingsPayload;\n agent_profile_id?: string;\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 title_llm_profile?: string;\n worktree: boolean;\n secrets_encrypted?: true;\n conversation_id?: string;\n secrets?: Record<string, LookupSecret>;\n tags?: Record<string, string>;\n client_tools: ClientToolSpec[];\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 // When set, the conversation launches from this AgentProfile (resolved\n // server-side) instead of an inline ``agent_settings`` dump (#3727).\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n runtimeServicesInfo?: RuntimeServicesInfo | null;\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 launchAgentKind = options.agentProfileId\n ? options.agentProfileKind\n : acpMode\n ? \"acp\"\n : \"openhands\";\n const agentSettings = buildConfiguredAgentSettings(\n sourceAgentSettings,\n options.runtimeServicesInfo,\n );\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_profile_id`` and ``agent_settings`` are mutually exclusive agent\n // sources; the profile path lets the server resolve the profile (#3727).\n //\n // Enrichment boundary: on the profile path the server rebuilds the agent\n // purely from the stored profile fields, so the client-owned enrichments\n // this adapter folds into ``agent_settings`` do NOT apply. The exec toolset\n // (terminal/file_editor/task_tracker) and public-skill loading are the\n // server/SDK's responsibility to restore on the profile path — tracked in\n // software-agent-sdk#3967 (profile resolution must attach the default\n // toolset + public skills, else a profile-launched OpenHands agent has only\n // Finish/Think). The dev ``RUNTIME_SERVICES`` system-message suffix remains\n // agent-settings-only; the Canvas UI tool is a top-level client tool and\n // therefore works on both inline-agent and profile launch paths.\n //\n // Persistent memory is NOT on that boundary: ``load_memory`` is a global\n // user preference, so the agent-server stamps the stored\n // ``agent_settings.agent_context.load_memory`` onto the profile-resolved\n // agent the same way it already applies the global ``mcp_config``. The\n // toggle therefore applies to both launch paths, and the client must not\n // re-send it here (``agent_profile_id`` and ``agent_settings`` are\n // mutually exclusive).\n ...(options.agentProfileId\n ? { agent_profile_id: options.agentProfileId }\n : { agent_settings: agentSettings }),\n workspace: conversationSettings.workspace,\n client_tools:\n launchAgentKind === \"openhands\" ? [CANVAS_UI_CLIENT_TOOL] : [],\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 ...(options.titleLlmProfile\n ? { title_llm_profile: options.titleLlmProfile }\n : {}),\n worktree: options.worktree ?? true,\n };\n\n // A profile launch resolves the ACP server server-side, so don't stamp the\n // tag from current settings (it may not match the launched profile).\n if (!options.agentProfileId && acpServerTag) {\n payload.tags = { [ACP_SERVER_TAG_KEY]: acpServerTag };\n }\n\n // ``secrets_encrypted`` makes the agent-server decrypt request secrets at\n // conversation start. Non-ACP conversations need it for encrypted LLM keys.\n // ACP normally carries provider credentials as LookupSecrets, so avoid\n // forcing a cipher on fresh ACP-only backends. The exception is MCP:\n // encrypted settings round-trip mcp_config secrets as Fernet tokens,\n // and ACP forwards mcp_config directly to the subprocess.\n if (\n !options.agentProfileId &&\n options.secretsEncrypted &&\n (!acpMode || hasEncryptedMcpSecrets(agentSettings.mcp_config))\n ) {\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 = {\n ...((conversationSettings.tool_module_qualnames as\n | Record<string, string>\n | undefined) ?? {}),\n };\n delete toolModuleQualnames[LEGACY_CANVAS_UI_TOOL_NAME];\n delete toolModuleQualnames[CANVAS_UI_CLIENT_TOOL_NAME];\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 agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n}): Promise<Record<string, unknown>> {\n const { SecretsService } = await import(\"./secrets-service\");\n\n const [settingsResult, customSecrets, runtimeServicesInfo] =\n await Promise.all([\n SettingsService.getSettingsForConversation(),\n SecretsService.getSecrets(),\n fetchBackendRuntimeServicesInfo(),\n ]);\n\n const { agentSettings, conversationSettings, secretsEncrypted } =\n settingsResult;\n\n // A profile launch resolves the LLM server-side, so the current-settings\n // subscription check doesn't apply (and can't see the profile's LLM).\n if (!options.agentProfileId) {\n await assertSubscriptionAuthReady(agentSettings);\n }\n\n return buildStartConversationRequest({\n ...options,\n encryptedAgentSettings: agentSettings,\n encryptedConversationSettings: conversationSettings,\n secretsEncrypted,\n customSecrets,\n runtimeServicesInfo,\n });\n}\n\nexport function emptyHooksResponse(): GetHooksResponse {\n return { hooks: [] };\n}\n"],"mappings":"qjCAoGA,IAAM,EAAqB,CAAC,WAAY,cAAe,cAAc,EAC/D,EAAwB,mBACxB,EAAqB,gBAE3B,SAAS,GAAsB,CAC7B,MAAO,EACT,CAkCA,SAAgB,EACd,EAC4B,CAC5B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAM,EAAM,KAAK,EACvB,GAAI,CAAC,EAAK,OAAO,KACjB,GAAI,CACF,OAAO,EAAyB,KAAK,MAAM,CAAG,CAAC,CACjD,MAAQ,CACN,OAAO,IACT,CACF,CAEA,GAAI,CAAC,GAAS,OAAO,GAAU,UAAY,MAAM,QAAQ,CAAK,EAC5D,OAAO,KAGT,IAAM,EAAS,EAEf,MADI,CAAC,EAAO,UAAY,OAAO,EAAO,UAAa,SAAiB,KAC7D,CACT,CAEA,eAAsB,GAAuE,CAC3F,IAAI,EACJ,GAAI,CACF,EAAgB,EAAA,4BAA4B,CAAE,QAAS,GAAK,CAAC,CAC/D,MAAQ,CACN,OAAO,IACT,CAEA,IAAM,EAAS,EACb,EAAA,yBAAyB,CAAE,KAAM,EAAc,IAAK,CAAC,GAAG,gBAC1D,EACA,GAAI,EAAQ,OAAO,EAEnB,GAAI,CAEF,OAAO,GACJ,MAFsB,IAAI,EAAA,aAAa,CAAa,EAAE,cAAc,GAEtB,gBACjD,CACF,MAAQ,CACN,OAAO,IACT,CACF,CAmBA,SAAgB,EACd,EACoB,CACpB,IAAM,EAAO,EAAyB,CAAmB,EACzD,GAAI,CAAC,GAAM,SAAU,OA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"sourcesContent":["import { ACP_SETTINGS_KEYS } from \"@openhands/typescript-client\";\nimport { ServerClient } from \"@openhands/typescript-client/clients\";\nimport { SKILLS_CATALOG } from \"@openhands/extensions/skills\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { ExecutionStatus } from \"#/types/agent-server/core\";\nimport { AgentKind, 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 {\n getCachedAgentServerInfo,\n isAgentServerToolAvailable,\n} 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\";\nimport {\n CANVAS_UI_CLIENT_TOOL,\n CANVAS_UI_CLIENT_TOOL_NAME,\n LEGACY_CANVAS_UI_TOOL_NAME,\n type ClientToolSpec,\n} from \"./canvas-ui-client-tool\";\nimport {\n LAUNCH_CHILD_CONVERSATION_CLIENT_TOOL,\n LAUNCH_CHILD_CONVERSATION_TOOL_NAME,\n} from \"./launch-child-conversation-client-tool\";\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 /**\n * ACP CLI identity (``claude-code`` / ``codex`` / ``gemini-cli``) from the\n * SDK's ``ACPAgent.acp_server`` (#3692). Preferred fallback when the\n * ``acpserver`` tag is absent — e.g. a profile launch doesn't stamp the tag\n * client-side and the server may not repopulate it. Read by {@link toAppConversation}.\n */\n acp_server?: 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 launched_agent_profile?: {\n agent_profile_id: string;\n revision: number;\n } | null;\n}\n\nconst DEFAULT_TOOL_NAMES = [\"terminal\", \"file_editor\", \"task_tracker\"];\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 served by Agent Canvas backends in\n * `/server_info.runtime_services`. 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 reachable\n * from inside its sandbox without having to probe.\n */\nexport interface 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\nexport function parseRuntimeServicesInfo(\n value: unknown,\n): RuntimeServicesInfo | null {\n if (typeof value === \"string\") {\n const raw = value.trim();\n if (!raw) return null;\n try {\n return parseRuntimeServicesInfo(JSON.parse(raw));\n } catch {\n return null;\n }\n }\n\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return null;\n }\n\n const parsed = value as RuntimeServicesInfo;\n if (!parsed.services || typeof parsed.services !== \"object\") return null;\n return parsed;\n}\n\nexport async function fetchBackendRuntimeServicesInfo(): Promise<RuntimeServicesInfo | null> {\n let clientOptions: ReturnType<typeof getAgentServerClientOptions>;\n try {\n clientOptions = getAgentServerClientOptions({ timeout: 3000 });\n } catch {\n return null;\n }\n\n const cached = parseRuntimeServicesInfo(\n getCachedAgentServerInfo({ host: clientOptions.host })?.runtime_services,\n );\n if (cached) return cached;\n\n try {\n const serverInfo = await new ServerClient(clientOptions).getServerInfo();\n return parseRuntimeServicesInfo(\n (serverInfo as { runtime_services?: unknown }).runtime_services,\n );\n } catch {\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 supplied.\n */\nexport function getDeploymentMode(\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): string | null {\n return runtimeServicesInfo?.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 available, so callers can safely\n * omit the field when the selected backend does not advertise runtime services.\n */\nexport function buildRuntimeServicesSystemSuffix(\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): string | undefined {\n const info = parseRuntimeServicesInfo(runtimeServicesInfo);\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. Fall back to the\n // agent's own ``acp_server`` (#3692) when the tag is missing — a profile\n // launch doesn't stamp the tag, so tag-only reads would drop the ACP model\n // picker and degrade the chip to a generic \"ACP\" (#1571).\n const acpServer = isAcp\n ? (info.tags?.[ACP_SERVER_TAG_KEY] ?? info.agent?.acp_server ?? null)\n : 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 tags: info.tags ?? null,\n launched_agent_profile: info.launched_agent_profile ?? null,\n // Chip path: omit ``providerDefault`` so that when no concrete model\n // resolves, the chip falls back to the provider display name in\n // ConversationCardFooter rather than a registry default the session may\n // not actually be running.\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\nexport const AUTOMATION_TRIGGER_TAG_KEY = \"automationtrigger\";\nexport const AUTOMATION_ID_TAG_KEY = \"automationid\";\nexport const AUTOMATION_NAME_TAG_KEY = \"automationname\";\nexport const AUTOMATION_RUN_ID_TAG_KEY = \"automationrunid\";\n\n/**\n * Tag keys stamped on conversations created by automation runs (see the SDK's\n * `RemoteWorkspace.default_conversation_tags`). The presence of any of these\n * marks a conversation as automation-born.\n */\nexport const AUTOMATION_TAG_KEYS: readonly string[] = [\n AUTOMATION_TRIGGER_TAG_KEY,\n AUTOMATION_ID_TAG_KEY,\n AUTOMATION_NAME_TAG_KEY,\n AUTOMATION_RUN_ID_TAG_KEY,\n];\n\n/**\n * Conversation tag keys that must not appear as generic chips / hovercard\n * rows. Each is either already surfaced by a first-class UI source or is\n * internal routing data:\n * - ``acpserver`` → ACP provider chip\n * - ``title`` → conversation card heading\n * - git / repo / branch / workspace stamps → repo-branch metadata + directory\n * footer / hovercard rows (``selected_repository``, ``selected_branch``,\n * ``git_provider``, ``workspace.working_dir``)\n * - ``automationid`` / ``automationrunid`` → raw UUIDs consumed by the\n * conversation panel's automation filter (chip noise), while\n * ``automationname`` / ``automationtrigger`` stay visible\n */\nexport const RESERVED_CONVERSATION_TAG_KEYS: ReadonlySet<string> = new Set([\n ACP_SERVER_TAG_KEY,\n AUTOMATION_ID_TAG_KEY,\n AUTOMATION_RUN_ID_TAG_KEY,\n \"title\",\n \"git_provider\",\n \"repo_name\",\n \"repo\",\n \"repository\",\n \"selected_branch\",\n \"branch\",\n \"archiveworkspacepath\",\n \"workspace\",\n \"working_dir\",\n]);\n\n/**\n * High-signal tag keys shown first in the chip row (before A–Z). Automations\n * often stamp ``origin``; remaining free-form tags sort alphabetically.\n */\nexport const PRIORITY_CONVERSATION_TAG_KEYS: readonly string[] = [\"origin\"];\n\n/**\n * User-facing subset of a conversation's server-side tags: everything except\n * {@link RESERVED_CONVERSATION_TAG_KEYS}, as stable ``[key, value]`` entries.\n * Priority keys come first (in {@link PRIORITY_CONVERSATION_TAG_KEYS} order);\n * the rest sort A–Z so chip order doesn't shuffle between refetches.\n */\nexport function getDisplayConversationTags(\n tags: Record<string, string> | null | undefined,\n): Array<[string, string]> {\n if (!tags) {\n return [];\n }\n // Both the reserved-key check and the priority lookup must see the same\n // normalized key: a cloud backend can stamp ``Origin`` / `` origin``, and\n // ranking those off the raw key would silently drop them out of first place.\n const priorityRank = (key: string): number => {\n const index = PRIORITY_CONVERSATION_TAG_KEYS.indexOf(\n key.trim().toLowerCase(),\n );\n return index === -1 ? Number.POSITIVE_INFINITY : index;\n };\n\n return Object.entries(tags)\n .filter(\n ([key, value]) =>\n !RESERVED_CONVERSATION_TAG_KEYS.has(key.trim().toLowerCase()) &&\n typeof value === \"string\" &&\n value.trim().length > 0,\n )\n .sort(([a], [b]) => {\n const aRank = priorityRank(a);\n const bRank = priorityRank(b);\n if (aRank !== bRank) {\n return aRank - bRank;\n }\n return a.localeCompare(b);\n });\n}\n\nconst FERNET_TOKEN_PREFIX = \"gAAAAA\";\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 isPlainRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction hasEncryptedString(value: unknown): boolean {\n if (typeof value === \"string\") {\n return value.startsWith(FERNET_TOKEN_PREFIX);\n }\n if (Array.isArray(value)) {\n return value.some(hasEncryptedString);\n }\n if (isPlainRecord(value)) {\n return Object.values(value).some(hasEncryptedString);\n }\n return false;\n}\n\nfunction hasEncryptedMcpSecrets(mcpConfig: unknown): boolean {\n if (!isPlainRecord(mcpConfig)) {\n return false;\n }\n\n return Object.values(mcpConfig).some(hasEncryptedString);\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 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: string;\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 // Use the absolute path to the skill's SKILL.md so the Python\n // agent-server can resolve bundled resources (scripts/, references/).\n // Falls back to \"public\" in library builds where the path isn't known.\n const source = __EXTENSIONS_SKILLS_DIR__\n ? `${__EXTENSIONS_SKILLS_DIR__}/${entry.name}/SKILL.md`\n : \"public\";\n\n return {\n name: entry.name,\n content: entry.content,\n trigger,\n source,\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(\n agentSettings: SettingsRecord,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n disabledSkills: string[] = [],\n): SettingsRecord {\n const runtimeServicesSuffix =\n buildRuntimeServicesSystemSuffix(runtimeServicesInfo);\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 disabledSkillNames = new Set(disabledSkills);\n const mergedSkills = [...existingSkills, ...buildBundledSkills()].filter(\n (skill) =>\n typeof skill.name !== \"string\" || !disabledSkillNames.has(skill.name),\n );\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 runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const payload: AgentSettingsPayload = {\n agent_kind: \"acp\",\n agent_context: buildAgentContext(\n agentSettings,\n runtimeServicesInfo,\n settings.disabled_skills,\n ),\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) {\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 runtimeServicesInfo?: RuntimeServicesInfo | null,\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 // Stream assistant tokens (parity with ACP agents). The agent-server only\n // emits StreamingDeltaEvents for SDK LLM agents when an LLM has stream=True.\n llm.stream = true;\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) {\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(\n agentSettings,\n runtimeServicesInfo,\n settings.disabled_skills,\n ),\n tools: getAgentTools(agentSettings),\n };\n}\n\nfunction buildConfiguredAgentSettings(\n settings: Settings,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n return isAcpAgent(settings)\n ? buildConfiguredAcpAgentSettings(settings, runtimeServicesInfo)\n : buildConfiguredOpenHandsAgentSettings(settings, runtimeServicesInfo);\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 // Omitted when launching via ``agent_profile_id`` — the two are mutually\n // exclusive agent sources; the server resolves the profile server-side.\n agent_settings?: AgentSettingsPayload;\n agent_profile_id?: string;\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 title_llm_profile?: string;\n worktree: boolean;\n secrets_encrypted?: true;\n conversation_id?: string;\n parent_conversation_id?: string;\n secrets?: Record<string, LookupSecret>;\n tags?: Record<string, string>;\n client_tools: ClientToolSpec[];\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 // Links the new conversation to an existing one as its child. The\n // agent-server requires the parent to exist and to share this\n // conversation's requested `workspace.working_dir` (software-agent-sdk\n // #4188, agent-server >= 1.37.1); older servers ignore the field.\n parentConversationId?: 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 // When set, the conversation launches from this AgentProfile (resolved\n // server-side) instead of an inline ``agent_settings`` dump (#3727).\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n runtimeServicesInfo?: RuntimeServicesInfo | null;\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 launchAgentKind = options.agentProfileId\n ? options.agentProfileKind\n : acpMode\n ? \"acp\"\n : \"openhands\";\n const agentSettings = buildConfiguredAgentSettings(\n sourceAgentSettings,\n options.runtimeServicesInfo,\n );\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_profile_id`` and ``agent_settings`` are mutually exclusive agent\n // sources; the profile path lets the server resolve the profile (#3727).\n //\n // Enrichment boundary: on the profile path the server rebuilds the agent\n // purely from the stored profile fields, so the client-owned enrichments\n // this adapter folds into ``agent_settings`` do NOT apply. The exec toolset\n // (terminal/file_editor/task_tracker) and public-skill loading are the\n // server/SDK's responsibility to restore on the profile path — tracked in\n // software-agent-sdk#3967 (profile resolution must attach the default\n // toolset + public skills, else a profile-launched OpenHands agent has only\n // Finish/Think). The dev ``RUNTIME_SERVICES`` system-message suffix remains\n // agent-settings-only; the Canvas UI tool is a top-level client tool and\n // therefore works on both inline-agent and profile launch paths.\n //\n // Persistent memory is NOT on that boundary: ``load_memory`` is a global\n // user preference, so the agent-server stamps the stored\n // ``agent_settings.agent_context.load_memory`` onto the profile-resolved\n // agent the same way it already applies the global ``mcp_config``. The\n // toggle therefore applies to both launch paths, and the client must not\n // re-send it here (``agent_profile_id`` and ``agent_settings`` are\n // mutually exclusive).\n ...(options.agentProfileId\n ? { agent_profile_id: options.agentProfileId }\n : { agent_settings: agentSettings }),\n workspace: conversationSettings.workspace,\n // The agent-server caches each client tool's schema per tool *name* for the\n // life of the process and rejects a re-registration with a different schema\n // (`ClientToolSchemaConflictError`). Editing either schema below therefore\n // requires restarting a long-running dev agent-server before new\n // conversations can start.\n client_tools:\n launchAgentKind === \"openhands\"\n ? [CANVAS_UI_CLIENT_TOOL, LAUNCH_CHILD_CONVERSATION_CLIENT_TOOL]\n : [],\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 ...(options.titleLlmProfile\n ? { title_llm_profile: options.titleLlmProfile }\n : {}),\n worktree: options.worktree ?? true,\n };\n\n // A profile launch resolves the ACP server server-side, so don't stamp the\n // tag from current settings (it may not match the launched profile).\n if (!options.agentProfileId && acpServerTag) {\n payload.tags = { [ACP_SERVER_TAG_KEY]: acpServerTag };\n }\n\n // ``secrets_encrypted`` makes the agent-server decrypt request secrets at\n // conversation start. Non-ACP conversations need it for encrypted LLM keys.\n // ACP normally carries provider credentials as LookupSecrets, so avoid\n // forcing a cipher on fresh ACP-only backends. The exception is MCP:\n // encrypted settings round-trip mcp_config secrets as Fernet tokens,\n // and ACP forwards mcp_config directly to the subprocess.\n if (\n !options.agentProfileId &&\n options.secretsEncrypted &&\n (!acpMode || hasEncryptedMcpSecrets(agentSettings.mcp_config))\n ) {\n payload.secrets_encrypted = true;\n }\n\n if (options.conversationId) {\n payload.conversation_id = options.conversationId;\n }\n\n if (options.parentConversationId) {\n payload.parent_conversation_id = options.parentConversationId;\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 = {\n ...((conversationSettings.tool_module_qualnames as\n | Record<string, string>\n | undefined) ?? {}),\n };\n delete toolModuleQualnames[LEGACY_CANVAS_UI_TOOL_NAME];\n delete toolModuleQualnames[CANVAS_UI_CLIENT_TOOL_NAME];\n delete toolModuleQualnames[LAUNCH_CHILD_CONVERSATION_TOOL_NAME];\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 parentConversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n}): Promise<Record<string, unknown>> {\n const { SecretsService } = await import(\"./secrets-service\");\n\n const [settingsResult, customSecrets, runtimeServicesInfo] =\n await Promise.all([\n SettingsService.getSettingsForConversation(),\n SecretsService.getSecrets(),\n fetchBackendRuntimeServicesInfo(),\n ]);\n\n const { agentSettings, conversationSettings, secretsEncrypted } =\n settingsResult;\n\n // A profile launch resolves the LLM server-side, so the current-settings\n // subscription check doesn't apply (and can't see the profile's LLM).\n if (!options.agentProfileId) {\n await assertSubscriptionAuthReady(agentSettings);\n }\n\n return buildStartConversationRequest({\n ...options,\n encryptedAgentSettings: agentSettings,\n encryptedConversationSettings: conversationSettings,\n secretsEncrypted,\n customSecrets,\n runtimeServicesInfo,\n });\n}\n\nexport function emptyHooksResponse(): GetHooksResponse {\n return { hooks: [] };\n}\n"],"mappings":"+pCAwGA,IAAM,GAAqB,CAAC,WAAY,cAAe,cAAc,EAC/D,EAAwB,mBACxB,EAAqB,gBAE3B,SAAS,GAAsB,CAC7B,MAAO,EACT,CAkCA,SAAgB,EACd,EAC4B,CAC5B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAM,EAAM,KAAK,EACvB,GAAI,CAAC,EAAK,OAAO,KACjB,GAAI,CACF,OAAO,EAAyB,KAAK,MAAM,CAAG,CAAC,CACjD,MAAQ,CACN,OAAO,IACT,CACF,CAEA,GAAI,CAAC,GAAS,OAAO,GAAU,UAAY,MAAM,QAAQ,CAAK,EAC5D,OAAO,KAGT,IAAM,EAAS,EAEf,MADI,CAAC,EAAO,UAAY,OAAO,EAAO,UAAa,SAAiB,KAC7D,CACT,CAEA,eAAsB,GAAuE,CAC3F,IAAI,EACJ,GAAI,CACF,EAAgB,EAAA,4BAA4B,CAAE,QAAS,GAAK,CAAC,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AQ,cAAe,CAC1C,IAAM,EAA6B,CACjC,KAAM,eACN,IAAK,yBAAyB,mBAAmB,EAAO,IAAI,IAC5D,YAAa,EAAO,WACtB,EAEI,OAAO,KAAK,CAAO,EAAE,OAAS,IAChC,EAAa,QAAU,GAGzB,EAAQ,EAAO,MAAQ,CACzB,CAEA,EAAQ,QAAU,CACpB,CAEA,OAAO,CACT,CAEA,IAAa,GACX,0FAQF,eAAsB,EACpB,EACe,CAEV,KAAA,wBADO,EAAS,EAAc,GACN,CAAG,GAG5B,EAAC,MADgB,EAAA,QAAuB,gBAAgB,GAChD,UACV,MAAU,MAAM,EAAiC,CAErD,CAEA,eAAsB,GAAmD,EAYpC,CACnC,GAAM,CAAE,kBAAmB,MAAA,QAAA,QAAA,EAAA,SAAA,QAAM,uBAAA,CAAA,EAE3B,CAAC,EAAgB,EAAe,GACpC,MAAM,QAAQ,IAAI,CAChB,EAAA,QAAgB,2BAA2B,EAC3C,EAAe,WAAW,EAC1B,EAAgC,CAClC,CAAC,EAEG,CAAE,gBAAe,uBAAsB,oBAC3C,EAQF,OAJK,EAAQ,gBACX,MAAM,EAA4B,CAAa,EAG1C,GAA8B,CACnC,GAAG,EACH,uBAAwB,EACxB,8BAA+B,EAC/B,mBACA,gBACA,qBACF,CAAC,CACH,CAEA,SAAgB,IAAuC,CACrD,MAAO,CAAE,MAAO,CAAC,CAAE,CACrB"}
|
|
@@ -142,16 +142,40 @@ interface InitialMessagePayload {
|
|
|
142
142
|
run: true;
|
|
143
143
|
}
|
|
144
144
|
export declare const ACP_SERVER_TAG_KEY = "acpserver";
|
|
145
|
+
export declare const AUTOMATION_TRIGGER_TAG_KEY = "automationtrigger";
|
|
146
|
+
export declare const AUTOMATION_ID_TAG_KEY = "automationid";
|
|
147
|
+
export declare const AUTOMATION_NAME_TAG_KEY = "automationname";
|
|
148
|
+
export declare const AUTOMATION_RUN_ID_TAG_KEY = "automationrunid";
|
|
145
149
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
150
|
+
* Tag keys stamped on conversations created by automation runs (see the SDK's
|
|
151
|
+
* `RemoteWorkspace.default_conversation_tags`). The presence of any of these
|
|
152
|
+
* marks a conversation as automation-born.
|
|
153
|
+
*/
|
|
154
|
+
export declare const AUTOMATION_TAG_KEYS: readonly string[];
|
|
155
|
+
/**
|
|
156
|
+
* Conversation tag keys that must not appear as generic chips / hovercard
|
|
157
|
+
* rows. Each is either already surfaced by a first-class UI source or is
|
|
158
|
+
* internal routing data:
|
|
159
|
+
* - ``acpserver`` → ACP provider chip
|
|
160
|
+
* - ``title`` → conversation card heading
|
|
161
|
+
* - git / repo / branch / workspace stamps → repo-branch metadata + directory
|
|
162
|
+
* footer / hovercard rows (``selected_repository``, ``selected_branch``,
|
|
163
|
+
* ``git_provider``, ``workspace.working_dir``)
|
|
164
|
+
* - ``automationid`` / ``automationrunid`` → raw UUIDs consumed by the
|
|
165
|
+
* conversation panel's automation filter (chip noise), while
|
|
166
|
+
* ``automationname`` / ``automationtrigger`` stay visible
|
|
149
167
|
*/
|
|
150
168
|
export declare const RESERVED_CONVERSATION_TAG_KEYS: ReadonlySet<string>;
|
|
169
|
+
/**
|
|
170
|
+
* High-signal tag keys shown first in the chip row (before A–Z). Automations
|
|
171
|
+
* often stamp ``origin``; remaining free-form tags sort alphabetically.
|
|
172
|
+
*/
|
|
173
|
+
export declare const PRIORITY_CONVERSATION_TAG_KEYS: readonly string[];
|
|
151
174
|
/**
|
|
152
175
|
* User-facing subset of a conversation's server-side tags: everything except
|
|
153
|
-
* {@link RESERVED_CONVERSATION_TAG_KEYS}, as stable ``[key, value]`` entries
|
|
154
|
-
*
|
|
176
|
+
* {@link RESERVED_CONVERSATION_TAG_KEYS}, as stable ``[key, value]`` entries.
|
|
177
|
+
* Priority keys come first (in {@link PRIORITY_CONVERSATION_TAG_KEYS} order);
|
|
178
|
+
* the rest sort A–Z so chip order doesn't shuffle between refetches.
|
|
155
179
|
*/
|
|
156
180
|
export declare function getDisplayConversationTags(tags: Record<string, string> | null | undefined): Array<[string, string]>;
|
|
157
181
|
interface LookupSecret {
|
|
@@ -174,6 +198,7 @@ type StartConversationPayload = Record<string, unknown> & {
|
|
|
174
198
|
worktree: boolean;
|
|
175
199
|
secrets_encrypted?: true;
|
|
176
200
|
conversation_id?: string;
|
|
201
|
+
parent_conversation_id?: string;
|
|
177
202
|
secrets?: Record<string, LookupSecret>;
|
|
178
203
|
tags?: Record<string, string>;
|
|
179
204
|
client_tools: ClientToolSpec[];
|
|
@@ -185,6 +210,7 @@ export interface StartConversationOptions {
|
|
|
185
210
|
conversationInstructions?: string;
|
|
186
211
|
plugins?: PluginSpec[];
|
|
187
212
|
conversationId?: string;
|
|
213
|
+
parentConversationId?: string;
|
|
188
214
|
workingDir?: string;
|
|
189
215
|
worktree?: boolean;
|
|
190
216
|
encryptedAgentSettings?: Record<string, SettingsValue>;
|
|
@@ -214,6 +240,7 @@ export declare function buildStartConversationRequestWithEncryptedSettings(optio
|
|
|
214
240
|
conversationInstructions?: string;
|
|
215
241
|
plugins?: PluginSpec[];
|
|
216
242
|
conversationId?: string;
|
|
243
|
+
parentConversationId?: string;
|
|
217
244
|
workingDir?: string;
|
|
218
245
|
worktree?: boolean;
|
|
219
246
|
agentProfileId?: string;
|