@openhands/agent-canvas 1.1.0 → 1.2.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/Trans-De9RwQhA.js +1 -0
- package/build/assets/__vite-browser-external-4xJsU2-u.js +1 -0
- package/build/assets/{acp-providers-B_ZxlEbx.js → acp-providers-D_D8VUpP.js} +1 -1
- package/build/assets/active-backend-context-DRFevVIj.js +1 -0
- package/build/assets/add-backend-modal-DzuB9zlG.js +1 -0
- package/build/assets/agent-profiles-settings-BfAwTshW.js +1 -0
- package/build/assets/{agent-server-client-options-CxnCYyIW.js → agent-server-client-options-DVLRd9sw.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-DfH2k6Sx.js +5 -0
- package/build/assets/agent-settings-CMMms-0q.js +1 -0
- package/build/assets/agent-settings-DjVlKgaP.js +2 -0
- package/build/assets/alert-banner-BW0wRYw6.js +1 -0
- package/build/assets/api-key-entry-screen-O8gS-fnF.js +1 -0
- package/build/assets/app-settings-SlZvaXlk.js +1 -0
- package/build/assets/automation-detail-CwsNJ9AM.js +2 -0
- package/build/assets/automations-list-B9cPtugh.js +1 -0
- package/build/assets/back-nav-button-BYmxFxGt.js +1 -0
- package/build/assets/backend-form-modal-D2EDGVAc.js +1 -0
- package/build/assets/backend-synced-settings-badge-6OCwIuLY.js +1 -0
- package/build/assets/base-modal-CC5Pp8CF.js +1 -0
- package/build/assets/bot-D7eUAuSB.js +1 -0
- package/build/assets/brand-button-DKPMEKcW.js +1 -0
- package/build/assets/{browser-CCwPzPsD.js → browser-B39N74jU.js} +2 -2
- package/build/assets/browser-store-BI6uklCG.js +1 -0
- package/build/assets/browser-tab-aiDg7aEn.js +1 -0
- package/build/assets/chat-send-button-DxuZIoW8.js +1 -0
- package/build/assets/check-Bvi71siz.js +1 -0
- package/build/assets/checkmark-h7udgXMM.js +1 -0
- package/build/assets/{chevron-down-BxZEAIv4.js → chevron-down-CI8A6tet.js} +1 -1
- package/build/assets/circle-plus-check-toggle-T3eAIuPQ.js +1 -0
- package/build/assets/close-p3Op5lxI.js +1 -0
- package/build/assets/code-tag-DYlAhEQY.js +1 -0
- package/build/assets/{color-themes-CTNRQd1a.js → color-themes-Dd1sO5U6.js} +1 -1
- package/build/assets/combobox-caret-CLGvOs32.js +1 -0
- package/build/assets/command-menu-DKrLCRla.js +1 -0
- package/build/assets/{command-store-C-57Heey.js → command-store-D8J5LMW1.js} +1 -1
- package/build/assets/condenser-settings-BhxvlfoY.js +1 -0
- package/build/assets/confirmation-modal-BK1F0A68.js +1 -0
- package/build/assets/context-menu-list-item-DBFzplWW.js +1 -0
- package/build/assets/conversation-B8prFAZF.js +19 -0
- package/build/assets/conversation-DGVDwGn8.js +1 -0
- package/build/assets/conversation-local-storage-F6zVMM--.js +1 -0
- package/build/assets/conversation-panel-C7DC4Cxx.js +1 -0
- package/build/assets/conversation-service.api-Ch9kR9aE.js +1 -0
- package/build/assets/conversation-state-store-B2Bp32XI.js +1 -0
- package/build/assets/conversation-store-LptbOvKa.js +1 -0
- package/build/assets/conversation-tab-empty-state-m8IUkfMj.js +1 -0
- package/build/assets/copy-3JCw_XFB.js +1 -0
- package/build/assets/copy-BLmGeJcd.js +1 -0
- package/build/assets/copy-to-clipboard-button-Aj9wFmt2.js +1 -0
- package/build/assets/createLucideIcon-CVAsW2Yo.js +1 -0
- package/build/assets/declaration-B9kpCaYl.js +1 -0
- package/build/assets/device-verify-B5YCrvSu.js +1 -0
- package/build/assets/dist-CodhvuAP.js +1 -0
- package/build/assets/dropdown-classes-CgQ45JmQ.js +1 -0
- package/build/assets/edit-automation-modal-BoibW8cd.js +1 -0
- package/build/assets/ellipsis-button-1BV9Sga8.js +1 -0
- package/build/assets/entry.client-BgWj9jL_.js +2 -0
- package/build/assets/enum-filter-dropdown-DCITiYVi.js +1 -0
- package/build/assets/environment-switch-overlay-DUnKILNH.js +1 -0
- package/build/assets/extensions-hub-MtC8lK3A.js +1 -0
- package/build/assets/{extensions-navigation-DfLHdTUC.js → extensions-navigation-BtV14oQL.js} +1 -1
- package/build/assets/{external-link-D8njjDTk.js → external-link-D2zJjE9G.js} +1 -1
- package/build/assets/files-tab-DHqtsKLy.js +1 -0
- package/build/assets/files-tab-store-DJsPxYdg.js +1 -0
- package/build/assets/folder-mMWFvaw0.js +1 -0
- package/build/assets/form-control-classes-9rkU4usZ.js +1 -0
- package/build/assets/get-language-from-path-CPNnuVhI.js +1 -0
- package/build/assets/git-provider-icon-CGU7_KiU.js +1 -0
- package/build/assets/home-BgjWP_UN.js +1 -0
- package/build/assets/iconBase-DaTRRUjy.js +1 -0
- package/build/assets/index-redirect-CUUJiNki.js +1 -0
- package/build/assets/install-server-modal-J_eQ6lhG.js +1 -0
- package/build/assets/launch-DamfAY5L.js +1 -0
- package/build/assets/lesson-plan-HD886V64.js +4 -0
- package/build/assets/link-external-DfKQroKX.js +1 -0
- package/build/assets/{list-todo-B_Ts2JmZ.js → list-todo-BfH6yYUK.js} +1 -1
- package/build/assets/llm-not-configured-banner-DTrLsVr_.js +27 -0
- package/build/assets/llm-settings-BgSFkbHC.js +1 -0
- package/build/assets/llm-settings-Bkc8C5Bi.js +1 -0
- package/build/assets/{llm-subscription-service-BX_AtNlO.js → llm-subscription-service-CKyaV24y.js} +1 -1
- package/build/assets/loader-circle-BEykUKYG.js +1 -0
- package/build/assets/loading-spinner-DHAIPZkP.js +1 -0
- package/build/assets/manage-backends-modal-BUzj5_Lq.js +1 -0
- package/build/assets/manifest-4d6a1552.js +1 -0
- package/build/assets/{markdown-renderer-DWy7Np7u.js → markdown-renderer-D8mayGjI.js} +1 -1
- package/build/assets/mcp-DvqJYDbz.js +9 -0
- package/build/assets/messages-C4KEFkPk.js +40 -0
- package/build/assets/middleware-DYHYNAnP.js +6 -0
- package/build/assets/modal-backdrop-zVwfOJZr.js +1 -0
- package/build/assets/modal-body-Dcu5McCa.js +1 -0
- package/build/assets/{modal-classes-C4kS6ib_.js → modal-classes-DPqxSyuP.js} +1 -1
- package/build/assets/modal-close-button-CTCX4nCH.js +1 -0
- package/build/assets/model-selector-VDHBytb6.js +1 -0
- package/build/assets/{mouse-pointer-click-CXAx4FyM.js → mouse-pointer-click-PdEQPL6v.js} +1 -1
- package/build/assets/navigation-context-DPs2G0X8.js +1 -0
- package/build/assets/navigation-link-D8hfwvxI.js +1 -0
- package/build/assets/onboarding-gGIqoxvA.js +1 -0
- package/build/assets/onboarding-modal-CGHPoMp7.js +1 -0
- package/build/assets/openhands-logo-bcNw5bkY.js +1 -0
- package/build/assets/option-service.api-Dz7Eomnx.js +1 -0
- package/build/assets/organization-service.api-CnynNoT-.js +1 -0
- package/build/assets/path-utils-CBaRYg35.js +1 -0
- package/build/assets/{pencil-CsL0ns9y.js → pencil-Dj2XjKmI.js} +1 -1
- package/build/assets/plan-components-j9X4AxYM.js +1 -0
- package/build/assets/planner-tab-G4j36bJk.js +1 -0
- package/build/assets/plugins-management-service-BAp70KN7.js +1 -0
- package/build/assets/profiles-service.api-CeYEmSM3.js +1 -0
- package/build/assets/providers-CPoq0VXm.js +1 -0
- package/build/assets/{proxy-TeteRRW5.js → proxy-CHmFkV16.js} +1 -1
- package/build/assets/react-DPDgL6du.js +1 -0
- package/build/assets/recommended-automations-launcher-CXaEK1rW.js +50 -0
- package/build/assets/{refresh-cw-GkGYXsU-.js → refresh-cw-DM82EIyx.js} +1 -1
- package/build/assets/root-CxWZUXTQ.css +1 -0
- package/build/assets/root-S6CfVoNm.js +2 -0
- package/build/assets/root-layout-CvxdHJ6j.js +2 -0
- package/build/assets/runtime-waiting-state-DkzLgvMn.js +1 -0
- package/build/assets/schema-field-DwUzlw6b.js +1 -0
- package/build/assets/sdk-section-page-BUXONTx6.js +1 -0
- package/build/assets/sdk-settings-schema-BjBkMHzZ.js +1 -0
- package/build/assets/search-4DHskuhE.js +1 -0
- package/build/assets/search-BsjCEFNf.js +1 -0
- package/build/assets/secrets-service-CZYjNxFw.js +1 -0
- package/build/assets/secrets-settings-ZxyfRBgx.js +1 -0
- package/build/assets/segmented-toggle-Cen5AMUc.js +1 -0
- package/build/assets/settings-Bx6vn-g8.js +1 -0
- package/build/assets/settings-dropdown-input-xzoZwgUe.js +1 -0
- package/build/assets/settings-gear-MXCyZW0x.js +1 -0
- package/build/assets/settings-index-D4SM26d5.js +1 -0
- package/build/assets/settings-input-DYs7t3oK.js +1 -0
- package/build/assets/settings-list-classes-DvQr5jVS.js +1 -0
- package/build/assets/{settings-CN_HaPjH.js → settings-mQUckT0g.js} +1 -1
- package/build/assets/settings-modal-BoC8oMlg.js +1 -0
- package/build/assets/settings-section-header-context-COMOIaxV.js +1 -0
- package/build/assets/settings-service.api-DldkFI1x.js +1 -0
- package/build/assets/settings-switch-C2N2xqEb.js +1 -0
- package/build/assets/{settings-utils-9-_6iVIn.js → settings-utils-BMdG65By.js} +1 -1
- package/build/assets/shared-conversation-DMiaQFsj.js +1 -0
- package/build/assets/sidebar-layout-BtpUSN3j.js +1 -0
- package/build/assets/sidebar-mobile-menu-toggle-CaV3tQFF.js +1 -0
- package/build/assets/sidebar-nav-link-CIB3NBRW.js +1 -0
- package/build/assets/sidebar-store-CZuE8AH5.js +1 -0
- package/build/assets/skill-card-pill-row-D2bUe2kB.js +1 -0
- package/build/assets/skills-9cDZONKh.js +1 -0
- package/build/assets/skills-plugins-D2WkrXkr.js +1 -0
- package/build/assets/skills-settings-CZGVOp_t.js +2 -0
- package/build/assets/{square-chevron-right-Cfi-SUY0.js → square-chevron-right-Czw3FFWc.js} +1 -1
- package/build/assets/styled-tooltip-DsKsFjuq.js +1 -0
- package/build/assets/suspense-X5dBsJzn.js +1 -0
- package/build/assets/switch-skeleton-DqQwalyu.js +1 -0
- package/build/assets/task-list-tab-BAThr9Ex.js +1 -0
- package/build/assets/{terminal-HakoMrQX.js → terminal-B0aL_iDZ.js} +2 -2
- package/build/assets/terminal-BuLtIrb9.js +1 -0
- package/build/assets/toggle-switch-DBlOOzBr.js +1 -0
- package/build/assets/{trash-2-Bq4hqiRH.js → trash-2-Be_7y3Mn.js} +1 -1
- package/build/assets/typography-YGPBGzOG.js +1 -0
- package/build/assets/u-check-circle-BqoIxNz_.js +1 -0
- package/build/assets/u-check-circle-half-LiwZkuFe.js +1 -0
- package/build/assets/u-edit-DJ90xc8Z.js +1 -0
- package/build/assets/use-acp-credential-form-rzaqkJ1n.js +1 -0
- package/build/assets/use-activate-agent-profile-DY0txItX.js +1 -0
- package/build/assets/use-active-agent-profile-Cp5AFONR.js +1 -0
- package/build/assets/use-active-conversation-DvcFBqFe.js +1 -0
- package/build/assets/use-agent-profiles-DnH16_Vm.js +1 -0
- package/build/assets/use-agent-state-BvRcEzY4.js +1 -0
- package/build/assets/use-backends-health-e-Ull4wz.js +1 -0
- package/build/assets/use-breakpoint-B-O0lQ84.js +1 -0
- package/build/assets/use-can-manage-org-profiles-OIhplvQ0.js +1 -0
- package/build/assets/use-click-outside-element-Bf4Omzot.js +1 -0
- package/build/assets/use-cloud-current-user-id-ekU7UXDT.js +1 -0
- package/build/assets/use-config-Dwf5gla-.js +1 -0
- package/build/assets/use-create-conversation-CvAXfA3T.js +1 -0
- package/build/assets/use-create-secret-BKeXCo__.js +1 -0
- package/build/assets/use-event-store-YSOxy9FC.js +4 -0
- package/build/assets/use-handle-plan-click-cAXS-Hft.js +1 -0
- package/build/assets/use-is-authed-_dhQ2Xuj.js +1 -0
- package/build/assets/use-launch-skill-in-chat-BnoDgvAy.js +1 -0
- package/build/assets/use-llm-profiles-BcLibtGb.js +1 -0
- package/build/assets/use-onboarding-completion-C_Swglzp.js +1 -0
- package/build/assets/use-plugins-marketplace-BGb-KgfD.js +1 -0
- package/build/assets/use-runtime-is-ready-CBFe69Ew.js +1 -0
- package/build/assets/use-save-agent-profile-DFjxHhNx.js +1 -0
- package/build/assets/{use-save-settings-DErJDIDL.js → use-save-settings-5xPYpSQM.js} +1 -1
- package/build/assets/use-settings-B07msZ2Z.js +1 -0
- package/build/assets/use-settings-nav-items-CswsOEyw.js +16 -0
- package/build/assets/use-skills-Aoaoq_ei.js +1 -0
- package/build/assets/use-task-list-CmWGElgb.js +1 -0
- package/build/assets/use-tracking-CqODdfO4.js +1 -0
- package/build/assets/use-user-conversation-BPHQ-dm-.js +1 -0
- package/build/assets/useMutation-DCE9RcgK.js +1 -0
- package/build/assets/useMutationState-BUab8Kxr.js +1 -0
- package/build/assets/useQueries-CRzaAqzH.js +1 -0
- package/build/assets/useQuery-CpjHYtZc.js +1 -0
- package/build/assets/useTranslation-Cgy4JA_g.js +1 -0
- package/build/assets/utils-CE0lDWtb.js +1 -0
- package/build/assets/vendor-styling-CI0PQ3ab.js +22 -0
- package/build/assets/{vendor~browser-BQU4C3CQ.js → vendor~browser-Cvg7jXCP.js} +1 -1
- package/build/assets/{vendor~browser-tab-Cim6xN2k.js → vendor~browser-tab-Di0kh5Zw.js} +1 -1
- package/build/assets/vendor~conversation-panel~conversation~alert-banner-DHDkknt5.js +1 -0
- package/build/assets/vendor~entry.client-9tWQ_Ugw.js +1 -0
- package/build/assets/{vendor~entry.client-lAMyAlBD.js → vendor~entry.client-D6BtSOtn.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~d1e18dtv-5Q6lQJdE.js +177 -0
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js +1 -0
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js +10 -0
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~t35o0b0f-Bss49YXv.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~k6tszsdc-Bb-xMtbv.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~nn5zty47-Zl0G1QCy.js +1 -0
- package/build/assets/{vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~fpbtwbmk-DDSPtjxR.js → vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js} +1 -1
- package/build/assets/{vendor~files-tab-BvQLon-P.js → vendor~files-tab-B02k3xvx.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation-DBPRU26Z.js → vendor~home~conversation-panel~conversation-CYMF9JYB.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DnEBAp2W.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9UMeuPV6.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CzI-A-Gz.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD0GaRGa.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-ByET2Quf.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CqXiHwjU.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DCYBrned.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D7EUmQ8Y.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DnctfFZL.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DTzw2x50.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-pSG7lnvH.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js} +1 -1
- package/build/assets/{vendor~launch-DqoOsAhA.js → vendor~launch-CHXA9cJu.js} +1 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation-CpiTHpHl.js +1 -0
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-BJl81v7J.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js} +1 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation-Cn2jwSga.js +1 -0
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~enjl5xdm-mMKDm94D.js +48 -0
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-DRld6s9c.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-DJHl5b-B.js} +236 -17
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-9d2kA26V.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CZM4hwUT.js} +1 -1
- package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-L2sdihTY.js +1 -0
- package/build/assets/verification-settings-DZQ-JvKH.js +1 -0
- package/build/assets/x-Cb0WAtak.js +1 -0
- package/build/assets/x-mark-Batp6gXa.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +138 -1
- package/build/locales/ca/openhands.json +138 -1
- package/build/locales/de/openhands.json +138 -1
- package/build/locales/en/openhands.json +138 -1
- package/build/locales/es/openhands.json +138 -1
- package/build/locales/fr/openhands.json +138 -1
- package/build/locales/it/openhands.json +138 -1
- package/build/locales/ja/openhands.json +138 -1
- package/build/locales/ko-KR/openhands.json +138 -1
- package/build/locales/no/openhands.json +138 -1
- package/build/locales/pt/openhands.json +138 -1
- package/build/locales/tr/openhands.json +138 -1
- package/build/locales/uk/openhands.json +138 -1
- package/build/locales/zh-CN/openhands.json +138 -1
- package/build/locales/zh-TW/openhands.json +138 -1
- package/config/defaults.json +7 -9
- package/dist/_virtual/__vite-browser-external.cjs +2 -0
- package/dist/_virtual/__vite-browser-external.cjs.map +1 -0
- package/dist/_virtual/__vite-browser-external.js +9 -0
- package/dist/_virtual/__vite-browser-external.js.map +1 -0
- package/dist/api/agent-profiles-service/agent-profiles-service.api.cjs +2 -0
- package/dist/api/agent-profiles-service/agent-profiles-service.api.cjs.map +1 -0
- package/dist/api/agent-profiles-service/agent-profiles-service.api.d.ts +22 -0
- package/dist/api/agent-profiles-service/agent-profiles-service.api.js +35 -0
- package/dist/api/agent-profiles-service/agent-profiles-service.api.js.map +1 -0
- package/dist/api/agent-server-adapter.cjs +2 -2
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +11 -1
- package/dist/api/agent-server-adapter.js +60 -60
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/agent-server-compatibility.cjs +1 -1
- package/dist/api/agent-server-compatibility.cjs.map +1 -1
- package/dist/api/agent-server-compatibility.js +1 -0
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/agent-server-home.cjs +1 -1
- package/dist/api/agent-server-home.cjs.map +1 -1
- package/dist/api/agent-server-home.js +1 -0
- package/dist/api/agent-server-home.js.map +1 -1
- package/dist/api/cloud/agent-profiles-service.api.cjs +2 -0
- package/dist/api/cloud/agent-profiles-service.api.cjs.map +1 -0
- package/dist/api/cloud/agent-profiles-service.api.d.ts +7 -0
- package/dist/api/cloud/agent-profiles-service.api.js +58 -0
- package/dist/api/cloud/agent-profiles-service.api.js.map +1 -0
- package/dist/api/cloud/organization-service.api.cjs +1 -1
- package/dist/api/cloud/organization-service.api.cjs.map +1 -1
- package/dist/api/cloud/organization-service.api.d.ts +8 -0
- package/dist/api/cloud/organization-service.api.js +3 -1
- package/dist/api/cloud/organization-service.api.js.map +1 -1
- package/dist/api/cloud/profiles-service.api.cjs +2 -0
- package/dist/api/cloud/profiles-service.api.cjs.map +1 -0
- package/dist/api/cloud/profiles-service.api.d.ts +7 -0
- package/dist/api/cloud/profiles-service.api.js +75 -0
- package/dist/api/cloud/profiles-service.api.js.map +1 -0
- package/dist/api/cloud/settings-service.api.cjs +1 -1
- package/dist/api/cloud/settings-service.api.cjs.map +1 -1
- package/dist/api/cloud/settings-service.api.js +1 -1
- package/dist/api/cloud/settings-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.api.cjs +1 -1
- package/dist/api/config-service/config-service.api.cjs.map +1 -1
- package/dist/api/config-service/config-service.api.js +1 -0
- package/dist/api/config-service/config-service.api.js.map +1 -1
- package/dist/api/conversation-metadata-store.cjs.map +1 -1
- package/dist/api/conversation-metadata-store.d.ts +11 -0
- package/dist/api/conversation-metadata-store.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +20 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +134 -105
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +2 -0
- package/dist/api/conversation-service/conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/conversation-service.api.d.ts +1 -0
- package/dist/api/conversation-service/conversation-service.api.js +4 -0
- package/dist/api/conversation-service/conversation-service.api.js.map +1 -1
- package/dist/api/device-flow-client.cjs +1 -1
- package/dist/api/device-flow-client.cjs.map +1 -1
- package/dist/api/device-flow-client.js +33 -25
- package/dist/api/device-flow-client.js.map +1 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.cjs.map +1 -1
- package/dist/api/event-service/event-service.api.js +1 -0
- package/dist/api/event-service/event-service.api.js.map +1 -1
- package/dist/api/mcp-service/mcp-redacted-credentials.cjs +1 -1
- package/dist/api/mcp-service/mcp-redacted-credentials.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-redacted-credentials.d.ts +3 -3
- package/dist/api/mcp-service/mcp-redacted-credentials.js +29 -30
- package/dist/api/mcp-service/mcp-redacted-credentials.js.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.d.ts +8 -1
- package/dist/api/mcp-service/mcp-service.api.js +129 -23
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/api/option-service/option-service.api.cjs +1 -1
- package/dist/api/option-service/option-service.api.cjs.map +1 -1
- package/dist/api/option-service/option-service.api.js +1 -0
- package/dist/api/option-service/option-service.api.js.map +1 -1
- package/dist/api/plugins-management-service.cjs +2 -0
- package/dist/api/plugins-management-service.cjs.map +1 -0
- package/dist/api/plugins-management-service.d.ts +50 -0
- package/dist/api/plugins-management-service.js +41 -0
- package/dist/api/plugins-management-service.js.map +1 -0
- package/dist/api/plugins-service.d.ts +49 -0
- package/dist/api/profiles-service/profiles-service.api.cjs +1 -1
- package/dist/api/profiles-service/profiles-service.api.cjs.map +1 -1
- package/dist/api/profiles-service/profiles-service.api.js +21 -14
- package/dist/api/profiles-service/profiles-service.api.js.map +1 -1
- package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
- package/dist/api/runtime-service/agent-server-runtime-service.cjs.map +1 -1
- package/dist/api/runtime-service/agent-server-runtime-service.js +1 -0
- package/dist/api/runtime-service/agent-server-runtime-service.js.map +1 -1
- package/dist/api/secrets-service.cjs +1 -1
- package/dist/api/secrets-service.cjs.map +1 -1
- package/dist/api/secrets-service.js +1 -0
- package/dist/api/secrets-service.js.map +1 -1
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.js +92 -50
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/api/skills-service.cjs +1 -1
- package/dist/api/skills-service.cjs.map +1 -1
- package/dist/api/skills-service.js +1 -0
- package/dist/api/skills-service.js.map +1 -1
- package/dist/api/workspaces-service/workspaces-service.api.cjs +1 -1
- package/dist/api/workspaces-service/workspaces-service.api.cjs.map +1 -1
- package/dist/api/workspaces-service/workspaces-service.api.js +1 -0
- package/dist/api/workspaces-service/workspaces-service.api.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 +57 -38
- 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 -1
- 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 +13 -9
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.cjs +1 -1
- package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.js +65 -26
- package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message.cjs +2 -2
- package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-message.js +78 -76
- package/dist/components/conversation-events/chat/event-message.js.map +1 -1
- package/dist/components/features/analytics/telemetry-consent-banner.cjs +1 -1
- package/dist/components/features/analytics/telemetry-consent-banner.cjs.map +1 -1
- package/dist/components/features/analytics/telemetry-consent-banner.js +1 -0
- package/dist/components/features/analytics/telemetry-consent-banner.js.map +1 -1
- package/dist/components/features/automations/detail/activity-log-item.d.ts +3 -2
- package/dist/components/features/automations/detail/activity-log-section.d.ts +3 -2
- package/dist/components/features/automations/detail/debug-automation-button.d.ts +17 -0
- package/dist/components/features/automations/detail/run-logs-modal.d.ts +6 -1
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.d.ts +6 -2
- package/dist/components/features/backends/backend-form-modal.js +198 -161
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/backend-row.cjs +1 -1
- package/dist/components/features/backends/backend-row.cjs.map +1 -1
- package/dist/components/features/backends/backend-row.d.ts +2 -1
- package/dist/components/features/backends/backend-row.js +60 -54
- package/dist/components/features/backends/backend-row.js.map +1 -1
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +4 -4
- package/dist/components/features/backends/backend-version.cjs +1 -1
- package/dist/components/features/backends/backend-version.cjs.map +1 -1
- package/dist/components/features/backends/backend-version.js +1 -0
- package/dist/components/features/backends/backend-version.js.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.js +72 -61
- package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
- package/dist/components/features/chat/change-agent-button.cjs +1 -1
- package/dist/components/features/chat/change-agent-button.js +9 -9
- package/dist/components/features/chat/chat-add-file-button.cjs +1 -1
- package/dist/components/features/chat/chat-add-file-button.cjs.map +1 -1
- package/dist/components/features/chat/chat-add-file-button.js +38 -34
- package/dist/components/features/chat/chat-add-file-button.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +2 -2
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +136 -129
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +100 -87
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +2 -0
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -0
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.d.ts +15 -0
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +118 -0
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -0
- package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-model.js +17 -17
- package/dist/components/features/chat/components/chat-input-profile-picker.cjs +2 -0
- package/dist/components/features/chat/components/chat-input-profile-picker.cjs.map +1 -0
- package/dist/components/features/chat/components/chat-input-profile-picker.d.ts +9 -0
- package/dist/components/features/chat/components/chat-input-profile-picker.js +112 -0
- package/dist/components/features/chat/components/chat-input-profile-picker.js.map +1 -0
- package/dist/components/features/chat/components/resolve-picker-kind.cjs +2 -0
- package/dist/components/features/chat/components/resolve-picker-kind.cjs.map +1 -0
- package/dist/components/features/chat/components/resolve-picker-kind.d.ts +29 -0
- package/dist/components/features/chat/components/resolve-picker-kind.js +8 -0
- package/dist/components/features/chat/components/resolve-picker-kind.js.map +1 -0
- package/dist/components/features/chat/goal-status-banner.cjs +2 -0
- package/dist/components/features/chat/goal-status-banner.cjs.map +1 -0
- package/dist/components/features/chat/goal-status-banner.d.ts +11 -0
- package/dist/components/features/chat/goal-status-banner.js +12 -0
- package/dist/components/features/chat/goal-status-banner.js.map +1 -0
- package/dist/components/features/chat/goal-status-content.cjs +2 -0
- package/dist/components/features/chat/goal-status-content.cjs.map +1 -0
- package/dist/components/features/chat/goal-status-content.d.ts +21 -0
- package/dist/components/features/chat/goal-status-content.js +98 -0
- package/dist/components/features/chat/goal-status-content.js.map +1 -0
- package/dist/components/features/chat/interactive-chat-box.cjs +1 -1
- package/dist/components/features/chat/interactive-chat-box.cjs.map +1 -1
- package/dist/components/features/chat/interactive-chat-box.js +20 -19
- package/dist/components/features/chat/interactive-chat-box.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/code-block.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/code-block.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/code-block.d.ts +10 -3
- package/dist/components/features/chat/tool-visualizers/primitives/code-block.js +29 -16
- package/dist/components/features/chat/tool-visualizers/primitives/code-block.js.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/output-pane.cjs +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/output-pane.cjs.map +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/output-pane.d.ts +2 -2
- package/dist/components/features/chat/tool-visualizers/primitives/output-pane.js +16 -16
- package/dist/components/features/chat/tool-visualizers/primitives/output-pane.js.map +1 -1
- package/dist/components/features/chat/user-message-body.cjs +1 -1
- package/dist/components/features/chat/user-message-body.cjs.map +1 -1
- package/dist/components/features/chat/user-message-body.js +20 -20
- package/dist/components/features/chat/user-message-body.js.map +1 -1
- package/dist/components/features/command-menu/command-menu-items.d.ts +32 -0
- package/dist/components/features/command-menu/command-menu-trigger.cjs +2 -0
- package/dist/components/features/command-menu/command-menu-trigger.cjs.map +1 -0
- package/dist/components/features/command-menu/command-menu-trigger.d.ts +5 -0
- package/dist/components/features/command-menu/command-menu-trigger.js +53 -0
- package/dist/components/features/command-menu/command-menu-trigger.js.map +1 -0
- package/dist/components/features/command-menu/command-menu.d.ts +2 -0
- package/dist/components/features/command-menu/index.d.ts +2 -0
- package/dist/components/features/controls/tools-context-menu.cjs +1 -1
- package/dist/components/features/controls/tools-context-menu.cjs.map +1 -1
- package/dist/components/features/controls/tools-context-menu.d.ts +3 -1
- package/dist/components/features/controls/tools-context-menu.js +94 -77
- package/dist/components/features/controls/tools-context-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js +8 -5
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js.map +1 -1
- 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 +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.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 +2 -1
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.js +4 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/plugins-modal.cjs +2 -0
- package/dist/components/features/conversation-panel/plugins-modal.cjs.map +1 -0
- package/dist/components/features/conversation-panel/plugins-modal.d.ts +12 -0
- package/dist/components/features/conversation-panel/plugins-modal.js +62 -0
- package/dist/components/features/conversation-panel/plugins-modal.js.map +1 -0
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.cjs +1 -1
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.cjs.map +1 -1
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.js +4 -4
- package/dist/components/features/mcp-logo-badge.cjs +1 -1
- package/dist/components/features/mcp-logo-badge.cjs.map +1 -1
- package/dist/components/features/mcp-logo-badge.js +17 -15
- package/dist/components/features/mcp-logo-badge.js.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +102 -59
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.js +284 -169
- package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.js +16 -18
- package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
- package/dist/components/features/onboarding/onboarding-host.d.ts +3 -13
- package/dist/components/features/plugins/add-plugin-modal.d.ts +6 -0
- package/dist/components/features/plugins/build-plugins-view-model.d.ts +39 -0
- package/dist/components/features/plugins/plugin-card.d.ts +13 -0
- package/dist/components/features/plugins/plugin-detail-modal.d.ts +13 -0
- package/dist/components/features/plugins/plugin-picker-card.d.ts +10 -0
- package/dist/components/features/plugins/plugin-picker-modal.d.ts +9 -0
- package/dist/components/features/plugins/plugin-picker-trigger.d.ts +9 -0
- package/dist/components/features/plugins/plugin-picker.d.ts +18 -0
- package/dist/components/features/plugins/plugin-spec-identity.d.ts +28 -0
- package/dist/components/features/plugins/plugins-toolbar.d.ts +9 -0
- package/dist/components/features/settings/agent-profiles/agent-profile-actions-menu.d.ts +16 -0
- package/dist/components/features/settings/agent-profiles/agent-profile-row.d.ts +13 -0
- package/dist/components/features/settings/agent-profiles/agent-profiles-body.d.ts +15 -0
- package/dist/components/features/settings/agent-profiles/agent-profiles-local-view.d.ts +7 -0
- package/dist/components/features/settings/agent-profiles/agent-profiles-manager.d.ts +7 -0
- package/dist/components/features/settings/agent-profiles/delete-agent-profile-modal.d.ts +7 -0
- package/dist/components/features/settings/agent-profiles/index.d.ts +6 -0
- package/dist/components/features/settings/agent-profiles/merge-agent-profile-save-input.d.ts +18 -0
- package/dist/components/features/settings/llm-profiles/llm-profiles-manager.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-profiles-manager.js +1 -0
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.d.ts +3 -1
- package/dist/components/features/settings/llm-profiles/profiles-body.d.ts +3 -1
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.cjs +1 -1
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.cjs.map +1 -1
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.js +3 -2
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.js.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +7 -7
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js +279 -130
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-list-item.d.ts +1 -12
- package/dist/components/features/settings/mcp-settings/mcp-server-list.d.ts +1 -11
- package/dist/components/features/settings/settings-dropdown-input.cjs +1 -1
- package/dist/components/features/settings/settings-dropdown-input.js +6 -6
- 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.d.ts +1 -2
- package/dist/components/features/sidebar/sidebar-rail-body.js +81 -82
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +45 -46
- package/dist/components/features/sidebar/sidebar.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 +1 -2
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/components/shared/modals/modal-backdrop.cjs +1 -1
- package/dist/components/shared/modals/modal-backdrop.cjs.map +1 -1
- package/dist/components/shared/modals/modal-backdrop.d.ts +5 -1
- package/dist/components/shared/modals/modal-backdrop.js +3 -3
- package/dist/components/shared/modals/modal-backdrop.js.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
- package/dist/components/shared/modals/settings/model-selector.js +16 -16
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +7 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +200 -197
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/chat/use-goal-interceptor.cjs +2 -0
- package/dist/hooks/chat/use-goal-interceptor.cjs.map +1 -0
- package/dist/hooks/chat/use-goal-interceptor.d.ts +8 -0
- package/dist/hooks/chat/use-goal-interceptor.js +37 -0
- package/dist/hooks/chat/use-goal-interceptor.js.map +1 -0
- package/dist/hooks/chat/use-grip-resize.cjs +1 -1
- package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
- package/dist/hooks/chat/use-grip-resize.js +17 -16
- package/dist/hooks/chat/use-grip-resize.js.map +1 -1
- package/dist/hooks/chat/use-model-interceptor.cjs +1 -1
- package/dist/hooks/chat/use-model-interceptor.cjs.map +1 -1
- package/dist/hooks/chat/use-model-interceptor.d.ts +3 -3
- package/dist/hooks/chat/use-model-interceptor.js +8 -9
- package/dist/hooks/chat/use-model-interceptor.js.map +1 -1
- package/dist/hooks/chat/use-slash-command.cjs +1 -1
- package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
- package/dist/hooks/chat/use-slash-command.js +4 -4
- package/dist/hooks/chat/use-slash-command.js.map +1 -1
- package/dist/hooks/mutation/conversation-mutation-utils.cjs +1 -1
- package/dist/hooks/mutation/conversation-mutation-utils.cjs.map +1 -1
- package/dist/hooks/mutation/conversation-mutation-utils.d.ts +17 -0
- package/dist/hooks/mutation/conversation-mutation-utils.js +23 -4
- package/dist/hooks/mutation/conversation-mutation-utils.js.map +1 -1
- package/dist/hooks/mutation/use-activate-agent-profile.cjs +2 -0
- package/dist/hooks/mutation/use-activate-agent-profile.cjs.map +1 -0
- package/dist/hooks/mutation/use-activate-agent-profile.d.ts +23 -0
- package/dist/hooks/mutation/use-activate-agent-profile.js +34 -0
- package/dist/hooks/mutation/use-activate-agent-profile.js.map +1 -0
- package/dist/hooks/mutation/use-activate-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-activate-llm-profile.js +1 -1
- package/dist/hooks/mutation/use-add-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-add-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-add-mcp-server.d.ts +1 -12
- package/dist/hooks/mutation/use-add-mcp-server.js +10 -34
- package/dist/hooks/mutation/use-add-mcp-server.js.map +1 -1
- package/dist/hooks/mutation/use-apply-onboarding-agent-profile.d.ts +20 -0
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.d.ts +2 -0
- package/dist/hooks/mutation/use-create-conversation.js +94 -25
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-delete-agent-profile.d.ts +1 -0
- package/dist/hooks/mutation/use-delete-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-delete-llm-profile.js +1 -1
- package/dist/hooks/mutation/use-delete-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-delete-mcp-server.js +4 -4
- package/dist/hooks/mutation/use-fork-conversation.cjs +2 -0
- package/dist/hooks/mutation/use-fork-conversation.cjs.map +1 -0
- package/dist/hooks/mutation/use-fork-conversation.d.ts +24 -0
- package/dist/hooks/mutation/use-fork-conversation.js +29 -0
- package/dist/hooks/mutation/use-fork-conversation.js.map +1 -0
- package/dist/hooks/mutation/use-install-plugin.d.ts +7 -0
- package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
- package/dist/hooks/mutation/use-new-conversation-command.d.ts +1 -0
- package/dist/hooks/mutation/use-new-conversation-command.js +20 -10
- package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
- package/dist/hooks/mutation/use-rename-agent-profile.d.ts +6 -0
- package/dist/hooks/mutation/use-rename-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-rename-llm-profile.js +1 -1
- package/dist/hooks/mutation/use-save-agent-profile.d.ts +5 -0
- package/dist/hooks/mutation/use-save-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-save-llm-profile.js +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.d.ts +3 -4
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.js +10 -35
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.js.map +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile.cjs +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile.d.ts +20 -5
- package/dist/hooks/mutation/use-switch-llm-profile.js +38 -14
- package/dist/hooks/mutation/use-switch-llm-profile.js.map +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.js +11 -37
- package/dist/hooks/mutation/use-update-mcp-server.js.map +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +21 -0
- package/dist/hooks/query/query-keys.js +7 -3
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-active-conversation.cjs +1 -1
- package/dist/hooks/query/use-active-conversation.cjs.map +1 -1
- package/dist/hooks/query/use-active-conversation.js +17 -16
- package/dist/hooks/query/use-active-conversation.js.map +1 -1
- package/dist/hooks/query/use-agent-profiles.cjs +2 -0
- package/dist/hooks/query/use-agent-profiles.cjs.map +1 -0
- package/dist/hooks/query/use-agent-profiles.d.ts +13 -0
- package/dist/hooks/query/use-agent-profiles.js +24 -0
- package/dist/hooks/query/use-agent-profiles.js.map +1 -0
- package/dist/hooks/query/use-backends-health.cjs +1 -1
- package/dist/hooks/query/use-backends-health.cjs.map +1 -1
- package/dist/hooks/query/use-backends-health.js +18 -3
- package/dist/hooks/query/use-backends-health.js.map +1 -1
- package/dist/hooks/query/use-conversation-history.cjs +1 -1
- package/dist/hooks/query/use-conversation-history.cjs.map +1 -1
- package/dist/hooks/query/use-conversation-history.js +4 -2
- package/dist/hooks/query/use-conversation-history.js.map +1 -1
- package/dist/hooks/query/use-local-workspaces.cjs +1 -1
- package/dist/hooks/query/use-local-workspaces.cjs.map +1 -1
- package/dist/hooks/query/use-local-workspaces.js +1 -0
- package/dist/hooks/query/use-local-workspaces.js.map +1 -1
- package/dist/hooks/query/use-plugins-marketplace.d.ts +7 -0
- package/dist/hooks/query/use-resolved-workspaces.cjs +1 -1
- package/dist/hooks/query/use-resolved-workspaces.cjs.map +1 -1
- package/dist/hooks/query/use-resolved-workspaces.js +7 -6
- package/dist/hooks/query/use-resolved-workspaces.js.map +1 -1
- package/dist/hooks/query/use-search-subdirs.cjs +1 -1
- package/dist/hooks/query/use-search-subdirs.cjs.map +1 -1
- package/dist/hooks/query/use-search-subdirs.js +1 -0
- package/dist/hooks/query/use-search-subdirs.js.map +1 -1
- package/dist/hooks/query/use-settings.cjs +1 -1
- package/dist/hooks/query/use-settings.cjs.map +1 -1
- package/dist/hooks/query/use-settings.js +11 -11
- package/dist/hooks/query/use-settings.js.map +1 -1
- package/dist/hooks/query/use-verified-models.cjs +1 -1
- package/dist/hooks/query/use-verified-models.cjs.map +1 -1
- package/dist/hooks/query/use-verified-models.js +1 -0
- package/dist/hooks/query/use-verified-models.js.map +1 -1
- package/dist/hooks/use-acp-model-context.cjs +1 -1
- package/dist/hooks/use-acp-model-context.cjs.map +1 -1
- package/dist/hooks/use-acp-model-context.d.ts +1 -1
- package/dist/hooks/use-acp-model-context.js +9 -8
- package/dist/hooks/use-acp-model-context.js.map +1 -1
- package/dist/hooks/use-active-agent-profile.cjs +2 -0
- package/dist/hooks/use-active-agent-profile.cjs.map +1 -0
- package/dist/hooks/use-active-agent-profile.d.ts +20 -0
- package/dist/hooks/use-active-agent-profile.js +17 -0
- package/dist/hooks/use-active-agent-profile.js.map +1 -0
- package/dist/hooks/use-auto-resize.cjs +1 -1
- package/dist/hooks/use-auto-resize.cjs.map +1 -1
- package/dist/hooks/use-auto-resize.d.ts +2 -0
- package/dist/hooks/use-auto-resize.js +49 -45
- package/dist/hooks/use-auto-resize.js.map +1 -1
- package/dist/hooks/use-can-manage-org-profiles.cjs +1 -0
- package/dist/hooks/use-can-manage-org-profiles.d.ts +18 -0
- package/dist/hooks/use-can-manage-org-profiles.js +2 -0
- package/dist/hooks/use-chat-input-llm-profile-state.cjs +2 -0
- package/dist/hooks/use-chat-input-llm-profile-state.cjs.map +1 -0
- package/dist/hooks/use-chat-input-llm-profile-state.d.ts +23 -0
- package/dist/hooks/use-chat-input-llm-profile-state.js +30 -0
- package/dist/hooks/use-chat-input-llm-profile-state.js.map +1 -0
- package/dist/hooks/use-chat-input-model-state.cjs.map +1 -1
- package/dist/hooks/use-chat-input-model-state.d.ts +1 -1
- package/dist/hooks/use-chat-input-model-state.js.map +1 -1
- package/dist/hooks/use-chat-input-profile-state.cjs +2 -0
- package/dist/hooks/use-chat-input-profile-state.cjs.map +1 -0
- package/dist/hooks/use-chat-input-profile-state.d.ts +20 -0
- package/dist/hooks/use-chat-input-profile-state.js +22 -0
- package/dist/hooks/use-chat-input-profile-state.js.map +1 -0
- package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
- package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
- package/dist/hooks/use-conversation-name-context-menu.d.ts +4 -0
- package/dist/hooks/use-conversation-name-context-menu.js +44 -37
- package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
- package/dist/hooks/use-conversation-plugins.cjs +2 -0
- package/dist/hooks/use-conversation-plugins.cjs.map +1 -0
- package/dist/hooks/use-conversation-plugins.d.ts +9 -0
- package/dist/hooks/use-conversation-plugins.js +12 -0
- package/dist/hooks/use-conversation-plugins.js.map +1 -0
- package/dist/hooks/use-handle-plan-click.cjs +1 -1
- package/dist/hooks/use-handle-plan-click.cjs.map +1 -1
- package/dist/hooks/use-handle-plan-click.js +2 -1
- package/dist/hooks/use-handle-plan-click.js.map +1 -1
- package/dist/hooks/use-llm-configured.cjs +1 -1
- package/dist/hooks/use-llm-configured.cjs.map +1 -1
- package/dist/hooks/use-llm-configured.js +17 -16
- package/dist/hooks/use-llm-configured.js.map +1 -1
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +51 -1
- package/dist/hooks/use-tracking.js +61 -2
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +138 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +18 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +2329 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/slack.cjs +2 -0
- package/dist/icons/slack.cjs.map +1 -0
- package/dist/icons/slack.js +19 -0
- package/dist/icons/slack.js.map +1 -0
- package/dist/icons/u-puzzle-piece.cjs +2 -0
- package/dist/icons/u-puzzle-piece.cjs.map +1 -0
- package/dist/icons/u-puzzle-piece.js +19 -0
- package/dist/icons/u-puzzle-piece.js.map +1 -0
- package/dist/icons/x-circle-solid.cjs +2 -0
- package/dist/icons/x-circle-solid.cjs.map +1 -0
- package/dist/icons/x-circle-solid.js +13 -0
- package/dist/icons/x-circle-solid.js.map +1 -0
- package/dist/locales/ar/openhands.json +138 -1
- package/dist/locales/ca/openhands.json +138 -1
- package/dist/locales/de/openhands.json +138 -1
- package/dist/locales/en/openhands.json +138 -1
- package/dist/locales/es/openhands.json +138 -1
- package/dist/locales/fr/openhands.json +138 -1
- package/dist/locales/it/openhands.json +138 -1
- package/dist/locales/ja/openhands.json +138 -1
- package/dist/locales/ko-KR/openhands.json +138 -1
- package/dist/locales/no/openhands.json +138 -1
- package/dist/locales/pt/openhands.json +138 -1
- package/dist/locales/tr/openhands.json +138 -1
- package/dist/locales/uk/openhands.json +138 -1
- package/dist/locales/zh-CN/openhands.json +138 -1
- package/dist/locales/zh-TW/openhands.json +138 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js +0 -20
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/asana.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/asana.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/asana.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/asana.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/bitbucket.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/bitbucket.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/bitbucket.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/bitbucket.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/box.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/box.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/box.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/box.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/canva.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/canva.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/canva.js +3 -7
- package/dist/node_modules/@openhands/extensions/integrations/catalog/canva.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/confluence.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/confluence.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/confluence.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/confluence.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/discord.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/discord.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/discord.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/discord.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js +20 -26
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +0 -9
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gmail.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gmail.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gmail.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gmail.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-calendar.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-calendar.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-calendar.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-calendar.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-docs.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-docs.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-docs.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-docs.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-drive.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-drive.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-drive.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-drive.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-sheets.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-sheets.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-sheets.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/google-sheets.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/intercom.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/intercom.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/intercom.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/intercom.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/jira.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/jira.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/jira.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/jira.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js +13 -13
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/miro.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/miro.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/miro.js +14 -10
- package/dist/node_modules/@openhands/extensions/integrations/catalog/miro.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/monday.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/monday.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/monday.js +13 -10
- package/dist/node_modules/@openhands/extensions/integrations/catalog/monday.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/netlify.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/netlify.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/netlify.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/netlify.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +1 -8
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/okta.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/okta.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/okta.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/okta.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/posthog.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/posthog.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/posthog.js +20 -18
- package/dist/node_modules/@openhands/extensions/integrations/catalog/posthog.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/quickbooks.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/quickbooks.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/quickbooks.js +66 -21
- package/dist/node_modules/@openhands/extensions/integrations/catalog/quickbooks.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/salesforce.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/salesforce.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/salesforce.js +17 -11
- package/dist/node_modules/@openhands/extensions/integrations/catalog/salesforce.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.js +12 -17
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.js +14 -19
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js +15 -20
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/trello.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/trello.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/trello.js +10 -8
- package/dist/node_modules/@openhands/extensions/integrations/catalog/trello.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vercel.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vercel.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vercel.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/vercel.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/xero.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/xero.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/xero.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/xero.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zoom.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zoom.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zoom.js +1 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zoom.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +67 -87
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/index.js +4 -4
- package/dist/node_modules/@openhands/extensions/integrations/index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +236 -17
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +24 -5
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-profiles-client.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-profiles-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-profiles-client.js +40 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-profiles-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +4 -4
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/http-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/http-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/http-client.js +84 -27
- package/dist/node_modules/@openhands/typescript-client/dist/client/http-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js +9 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/plugins-client.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/plugins-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/plugins-client.js +42 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/plugins-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/skills-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/skills-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/skills-client.js +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/skills-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/clients.js +20 -0
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +18 -0
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.js +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js +15 -17
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/workspace.cjs +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/workspace.js +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +7 -4
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +106 -0
- package/dist/routes/files-tab.cjs +1 -1
- package/dist/routes/files-tab.js +23 -23
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.d.ts +6 -4
- package/dist/routes/llm-settings.js +0 -1
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.js.map +1 -1
- package/dist/services/settings.cjs +1 -1
- package/dist/services/settings.cjs.map +1 -1
- package/dist/services/settings.js +2 -6
- package/dist/services/settings.js.map +1 -1
- package/dist/stores/command-menu-store.cjs +2 -0
- package/dist/stores/command-menu-store.cjs.map +1 -0
- package/dist/stores/command-menu-store.d.ts +8 -0
- package/dist/stores/command-menu-store.js +12 -0
- package/dist/stores/command-menu-store.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.js +1 -1
- package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
- package/dist/stores/conversation-store.cjs +1 -1
- package/dist/stores/conversation-store.cjs.map +1 -1
- package/dist/stores/conversation-store.d.ts +1 -0
- package/dist/stores/conversation-store.js +1 -0
- package/dist/stores/conversation-store.js.map +1 -1
- package/dist/stores/goal-store.cjs +2 -0
- package/dist/stores/goal-store.cjs.map +1 -0
- package/dist/stores/goal-store.d.ts +28 -0
- package/dist/stores/goal-store.js +14 -0
- package/dist/stores/goal-store.js.map +1 -0
- package/dist/types/agent-server/core/events/conversation-state-event.d.ts +39 -3
- 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 +2 -1
- package/dist/types/agent-server/type-guards.js +3 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/types/mcp-auth.cjs +2 -0
- package/dist/types/mcp-auth.cjs.map +1 -0
- package/dist/types/mcp-auth.d.ts +43 -0
- package/dist/types/mcp-auth.js +13 -0
- package/dist/types/mcp-auth.js.map +1 -0
- package/dist/types/mcp-server.d.ts +22 -1
- package/dist/types/settings.d.ts +6 -4
- package/dist/ui/context-menu.d.ts +1 -1
- package/dist/utils/acp-command.d.ts +64 -0
- package/dist/utils/automation-debug-prompt.d.ts +18 -0
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.cjs.map +1 -1
- package/dist/utils/constants.d.ts +2 -0
- package/dist/utils/constants.js +12 -3
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/dropdown-classes.cjs +1 -1
- package/dist/utils/dropdown-classes.cjs.map +1 -1
- package/dist/utils/dropdown-classes.js +4 -2
- package/dist/utils/dropdown-classes.js.map +1 -1
- package/dist/utils/form-control-classes.cjs +1 -1
- package/dist/utils/form-control-classes.js +1 -1
- package/dist/utils/handle-event-for-ui.cjs +1 -1
- package/dist/utils/handle-event-for-ui.cjs.map +1 -1
- package/dist/utils/handle-event-for-ui.js +72 -37
- package/dist/utils/handle-event-for-ui.js.map +1 -1
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.d.ts +15 -9
- package/dist/utils/mcp-config.js +124 -53
- package/dist/utils/mcp-config.js.map +1 -1
- package/dist/utils/mcp-installed-server-display.cjs +2 -0
- package/dist/utils/mcp-installed-server-display.cjs.map +1 -0
- package/dist/utils/mcp-installed-server-display.d.ts +8 -0
- package/dist/utils/mcp-installed-server-display.js +12 -0
- package/dist/utils/mcp-installed-server-display.js.map +1 -0
- package/dist/utils/mcp-installed-servers.cjs +1 -1
- package/dist/utils/mcp-installed-servers.cjs.map +1 -1
- package/dist/utils/mcp-installed-servers.js +4 -4
- package/dist/utils/mcp-installed-servers.js.map +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
- package/dist/utils/mcp-marketplace-utils.d.ts +2 -0
- package/dist/utils/mcp-marketplace-utils.js +31 -16
- package/dist/utils/mcp-marketplace-utils.js.map +1 -1
- package/dist/utils/mcp-server-name.cjs +2 -0
- package/dist/utils/mcp-server-name.cjs.map +1 -0
- package/dist/utils/mcp-server-name.d.ts +3 -0
- package/dist/utils/mcp-server-name.js +12 -0
- package/dist/utils/mcp-server-name.js.map +1 -0
- package/dist/utils/plugin-display.cjs +2 -0
- package/dist/utils/plugin-display.cjs.map +1 -0
- package/dist/utils/plugin-display.d.ts +20 -0
- package/dist/utils/plugin-display.js +29 -0
- package/dist/utils/plugin-display.js.map +1 -0
- package/dist/utils/settings-utils.cjs.map +1 -1
- package/dist/utils/settings-utils.js.map +1 -1
- package/dist/utils/workspaces-compatibility.cjs +1 -1
- package/dist/utils/workspaces-compatibility.cjs.map +1 -1
- package/dist/utils/workspaces-compatibility.js +1 -0
- package/dist/utils/workspaces-compatibility.js.map +1 -1
- package/package.json +7 -4
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +6 -0
- package/scripts/dev-safe.mjs +14 -3
- package/scripts/dev-with-automation.mjs +4 -0
- package/scripts/gen-acp-docker-env.mjs +107 -0
- package/scripts/ingress.mjs +66 -226
- package/scripts/proxy-utils.mjs +171 -0
- package/scripts/static-server.mjs +127 -283
- package/build/assets/Trans-CiZR6eVI.js +0 -1
- package/build/assets/active-backend-context-CEuva6ZJ.js +0 -1
- package/build/assets/add-backend-modal-b_eiVk3A.js +0 -1
- package/build/assets/agent-server-conversation-service.api-D_uJ7BKc.js +0 -5
- package/build/assets/agent-settings-DyfziYyM.js +0 -2
- package/build/assets/alert-banner-BFayS5vM.js +0 -1
- package/build/assets/analytics-consent-form-modal-CQ22qlFF.js +0 -1
- package/build/assets/api-key-entry-screen-KnIwP0vN.js +0 -1
- package/build/assets/app-settings-CBaHJ5vJ.js +0 -1
- package/build/assets/automation-detail-DgQswnXg.js +0 -1
- package/build/assets/automations-list-D99p6CoQ.js +0 -1
- package/build/assets/back-nav-button-Cp9z-wsG.js +0 -1
- package/build/assets/backend-form-modal-BABAz-zH.js +0 -1
- package/build/assets/backend-synced-settings-badge-DzwWQC4T.js +0 -1
- package/build/assets/base-modal-1bHiB5Wf.js +0 -1
- package/build/assets/brand-button-FHWgEb4Q.js +0 -1
- package/build/assets/browser-store-B9h0eW79.js +0 -1
- package/build/assets/browser-tab-JiCXo0Nc.js +0 -1
- package/build/assets/chat-send-button-QtyofqFt.js +0 -1
- package/build/assets/check-6ieIiPhW.js +0 -1
- package/build/assets/checkmark-BfgRVMHK.js +0 -1
- package/build/assets/circle-plus-check-toggle-CmINKfZj.js +0 -1
- package/build/assets/close-DhH0uMa7.js +0 -1
- package/build/assets/code-tag-CnORXDJj.js +0 -1
- package/build/assets/combobox-caret-BB15S7zY.js +0 -1
- package/build/assets/condenser-settings-BOKNShD9.js +0 -1
- package/build/assets/confirmation-modal-CofmThy4.js +0 -1
- package/build/assets/context-menu-list-item-DO12IEaK.js +0 -1
- package/build/assets/conversation-DIzv-jq8.js +0 -1
- package/build/assets/conversation-DV3odvMe.js +0 -19
- package/build/assets/conversation-local-storage-DK7yJr5N.js +0 -1
- package/build/assets/conversation-panel-CgCarTAn.js +0 -1
- package/build/assets/conversation-service.api-RV_bOKNz.js +0 -1
- package/build/assets/conversation-state-store-4obo4ZMf.js +0 -1
- package/build/assets/conversation-store-CXrL0v-X.js +0 -6
- package/build/assets/conversation-tab-empty-state-CqT5ur_H.js +0 -1
- package/build/assets/copy-C5tBqfWu.js +0 -1
- package/build/assets/copy-to-clipboard-button-BVFYcsg_.js +0 -1
- package/build/assets/createLucideIcon-D3nkdIAN.js +0 -1
- package/build/assets/declaration-B0yY_dkQ.js +0 -1
- package/build/assets/device-verify-DRupI_hz.js +0 -1
- package/build/assets/dist-D5d5zm8o.js +0 -1
- package/build/assets/dist-fV7trlfb.js +0 -1
- package/build/assets/dropdown-classes-5IsMjYYw.js +0 -1
- package/build/assets/edit-automation-modal-BG-gd82b.js +0 -1
- package/build/assets/ellipsis-button-DWvVZO_r.js +0 -1
- package/build/assets/entry.client-uhbVfCtd.js +0 -2
- package/build/assets/enum-filter-dropdown-CB2fqz_e.js +0 -1
- package/build/assets/environment-switch-overlay-Oeal5TVq.js +0 -1
- package/build/assets/extensions-hub-DxiE0AZR.js +0 -1
- package/build/assets/files-tab-1F2OlNeH.js +0 -1
- package/build/assets/files-tab-store-C1q5Rbx3.js +0 -1
- package/build/assets/folder-C5tr7xyN.js +0 -1
- package/build/assets/get-language-from-path-E1JKsbeE.js +0 -1
- package/build/assets/git-provider-icon-CKs-22Ts.js +0 -1
- package/build/assets/home-B3E0le0g.js +0 -1
- package/build/assets/iconBase-DMoh3FEg.js +0 -1
- package/build/assets/index-redirect-DhuK5mhS.js +0 -1
- package/build/assets/install-server-modal-DjintV14.js +0 -1
- package/build/assets/is-backend-llm-ready-Bj44pekN.js +0 -1
- package/build/assets/launch-DCU3S84p.js +0 -1
- package/build/assets/lesson-plan-BUUPKVsa.js +0 -3
- package/build/assets/link-external-CF4KHxx-.js +0 -1
- package/build/assets/llm-client-BakM_czF.js +0 -1
- package/build/assets/llm-not-configured-banner-BV-NIjfR.js +0 -27
- package/build/assets/llm-settings-B5d7PHzz.js +0 -1
- package/build/assets/llm-settings-C5whb-0p.js +0 -1
- package/build/assets/loader-circle-DyX8DmLg.js +0 -1
- package/build/assets/loading-spinner-BvOAco8a.js +0 -1
- package/build/assets/manage-backends-modal-D9ClxVpM.js +0 -1
- package/build/assets/manifest-38a873aa.js +0 -1
- package/build/assets/mcp-7rk44GRS.js +0 -9
- package/build/assets/mcp-client-DxHXYNOw.js +0 -1
- package/build/assets/messages-DgBEaXil.js +0 -43
- package/build/assets/modal-backdrop-DjAC2zOZ.js +0 -1
- package/build/assets/modal-body-OJdIUJ68.js +0 -1
- package/build/assets/modal-close-button-BNjGesHc.js +0 -1
- package/build/assets/model-selector-w2uGPM5y.js +0 -1
- package/build/assets/navigation-context-CUJ60pLI.js +0 -1
- package/build/assets/navigation-link-BiPKTOHF.js +0 -1
- package/build/assets/onboarding-Cit87z8g.js +0 -1
- package/build/assets/onboarding-modal-JPrzvr8W.js +0 -1
- package/build/assets/openhands-logo-uNs9g6LY.js +0 -1
- package/build/assets/option-service.api-BLYUhnCF.js +0 -1
- package/build/assets/organization-service.api-DpSSwlZu.js +0 -1
- package/build/assets/path-utils-B4WAVqvK.js +0 -1
- package/build/assets/plan-components-DSOTFW2D.js +0 -1
- package/build/assets/planner-tab-LmoxgKKe.js +0 -1
- package/build/assets/preload-helper-D_sPnjeL.js +0 -1
- package/build/assets/profiles-client-B4SJ4ZAf.js +0 -1
- package/build/assets/providers-BGUAB8kf.js +0 -1
- package/build/assets/react-Dn-iWFF5.js +0 -1
- package/build/assets/react-dom-BBXlXOZX.js +0 -1
- package/build/assets/react-uQK8du1l.js +0 -1
- package/build/assets/recommended-automations-launcher-Df9MXUpX.js +0 -50
- package/build/assets/root-BShAdYGY.css +0 -1
- package/build/assets/root-C99reK-P.js +0 -2
- package/build/assets/root-layout-BtH64XeC.js +0 -2
- package/build/assets/runtime-waiting-state-C7MjXDeW.js +0 -1
- package/build/assets/schema-field-BCDuEMrl.js +0 -1
- package/build/assets/sdk-section-page-XJN9mGju.js +0 -1
- package/build/assets/sdk-settings-schema-B15AE1GH.js +0 -1
- package/build/assets/search-rob4u9f8.js +0 -1
- package/build/assets/secrets-service-CrPyCR8u.js +0 -1
- package/build/assets/secrets-settings-UJn15N7E.js +0 -1
- package/build/assets/settings-C5aUD_sQ.js +0 -1
- package/build/assets/settings-dropdown-input-DQRt2_RA.js +0 -1
- package/build/assets/settings-gear-B7bZDo_8.js +0 -1
- package/build/assets/settings-index-zP_rYIW1.js +0 -1
- package/build/assets/settings-input-n8FzVso3.js +0 -1
- package/build/assets/settings-list-classes-DquY3fwm.js +0 -1
- package/build/assets/settings-modal-szlQ6LpE.js +0 -1
- package/build/assets/settings-section-header-context-DrXgyNC-.js +0 -1
- package/build/assets/settings-service.api-B4G8NzCM.js +0 -1
- package/build/assets/settings-switch-DsbEm3ie.js +0 -1
- package/build/assets/shared-conversation-BrAvqeaI.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-BRZGCe-l.js +0 -1
- package/build/assets/sidebar-nav-link-B_EygIce.js +0 -1
- package/build/assets/skill-card-pill-row-Bq9Imkdh.js +0 -1
- package/build/assets/skills-Wg6i0kbu.js +0 -1
- package/build/assets/skills-client-DNd444Bm.js +0 -1
- package/build/assets/skills-plugins-DaGkVI7-.js +0 -1
- package/build/assets/skills-settings-Dlp0WFaT.js +0 -2
- package/build/assets/styled-tooltip-ulgpZDga.js +0 -1
- package/build/assets/suspense-BqBQEuKs.js +0 -1
- package/build/assets/switch-skeleton-C49gVWOQ.js +0 -1
- package/build/assets/task-list-tab-Bz-UlCm2.js +0 -1
- package/build/assets/telemetry-DD3HKMgf.js +0 -2
- package/build/assets/terminal-BwLvVzyJ.js +0 -1
- package/build/assets/toggle-switch-CxW8-lBI.js +0 -1
- package/build/assets/typography-BLf_mRKH.js +0 -1
- package/build/assets/u-check-circle-CxTAJuY9.js +0 -1
- package/build/assets/u-check-circle-half-Bj73jfUG.js +0 -1
- package/build/assets/u-circuit-C-6V9H9C.js +0 -1
- package/build/assets/u-edit-C7OnK2sa.js +0 -1
- package/build/assets/use-acp-credential-form-oehc057O.js +0 -1
- package/build/assets/use-active-conversation-CFXVX2on.js +0 -1
- package/build/assets/use-agent-state-D6xfZA4-.js +0 -1
- package/build/assets/use-backends-health-93yRIOWs.js +0 -1
- package/build/assets/use-breakpoint-Xdy_aZHE.js +0 -1
- package/build/assets/use-click-outside-element-CADb_gCP.js +0 -1
- package/build/assets/use-cloud-current-user-id-CzOXsy04.js +0 -1
- package/build/assets/use-config-oXjEWyb6.js +0 -1
- package/build/assets/use-create-conversation-D-YkgrxS.js +0 -1
- package/build/assets/use-create-secret-CX7Ij7W4.js +0 -1
- package/build/assets/use-event-store-DMRAQQi8.js +0 -1
- package/build/assets/use-handle-plan-click-CwW2Ijc2.js +0 -1
- package/build/assets/use-is-authed-CNbX1KMm.js +0 -1
- package/build/assets/use-launch-skill-in-chat-xI9byRUw.js +0 -1
- package/build/assets/use-llm-profiles-BXRZ2rBh.js +0 -1
- package/build/assets/use-runtime-is-ready-Dwzs9_vp.js +0 -1
- package/build/assets/use-settings-_usWr_qn.js +0 -1
- package/build/assets/use-settings-nav-items-DoB5iH-7.js +0 -16
- package/build/assets/use-skills-BtorhoCN.js +0 -1
- package/build/assets/use-task-list-u46BhYBC.js +0 -1
- package/build/assets/use-tracking-Ca7p71hH.js +0 -1
- package/build/assets/use-user-conversation-U-16WF6G.js +0 -1
- package/build/assets/useMutation-CseCrRRO.js +0 -1
- package/build/assets/useQuery-bowvACed.js +0 -1
- package/build/assets/useTranslation-KhTtKmnv.js +0 -1
- package/build/assets/utils-cRyMoFbz.js +0 -1
- package/build/assets/vendor~conversation-panel~conversation~alert-banner-CjfR7T3x.js +0 -1
- package/build/assets/vendor~entry.client-_zl82x5T.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dj9x5fm9-CgCGB-3J.js +0 -177
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfvr34cq-BJdsUTJG.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~m3df9r20-BynFAJ_S.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nk00xiud-MfCRtPrK.js +0 -9
- package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~ghtfhmuy-BHDILMe2.js +0 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation-BFZmbXpq.js +0 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~index-BPY-kNjK.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation-BhWqQNmF.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~cfyi58ut-CnnEa0dP.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~clac83qc-DMX6XUwI.js +0 -2
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ldu51w4e-Cqp6k3RG.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ldu51w4e-DS4GWhCz.js +0 -9
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~ji28rqgb-DVffa9Ks.js +0 -48
- package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-BzR6ypP3.js +0 -1
- package/build/assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~hzfcl1q6-BcvHZmEZ.js +0 -2
- package/build/assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~hzfcl1q6-Cuvp6wqR.js +0 -14
- package/build/assets/verification-settings-DKZnUHD6.js +0 -1
- package/build/assets/x-DpnGZyVW.js +0 -1
- package/build/assets/x-mark-x3tvCZzc.js +0 -1
- package/dist/components/features/analytics/analytics-consent-form-modal.d.ts +0 -5
- package/dist/components/features/chat/switch-profile-button.cjs +0 -2
- package/dist/components/features/chat/switch-profile-button.cjs.map +0 -1
- package/dist/components/features/chat/switch-profile-button.d.ts +0 -1
- package/dist/components/features/chat/switch-profile-button.js +0 -48
- package/dist/components/features/chat/switch-profile-button.js.map +0 -1
- package/dist/components/features/chat/switch-profile-context-menu.cjs +0 -2
- package/dist/components/features/chat/switch-profile-context-menu.cjs.map +0 -1
- package/dist/components/features/chat/switch-profile-context-menu.d.ts +0 -9
- package/dist/components/features/chat/switch-profile-context-menu.js +0 -106
- package/dist/components/features/chat/switch-profile-context-menu.js.map +0 -1
- package/dist/components/features/onboarding/is-backend-llm-ready.d.ts +0 -30
- package/dist/icons/u-circuit.cjs +0 -2
- package/dist/icons/u-circuit.cjs.map +0 -1
- package/dist/icons/u-circuit.js +0 -19
- package/dist/icons/u-circuit.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickup.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickup.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickup.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickup.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/dropbox.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/dropbox.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/dropbox.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/dropbox.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/freshdesk.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/freshdesk.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/freshdesk.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/freshdesk.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mailchimp.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mailchimp.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mailchimp.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mailchimp.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/pipedrive.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/pipedrive.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/pipedrive.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/pipedrive.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/plaid.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/plaid.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/plaid.js +0 -28
- package/dist/node_modules/@openhands/extensions/integrations/catalog/plaid.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/servicenow.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/servicenow.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/servicenow.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/servicenow.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/shopify.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/shopify.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/shopify.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/shopify.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zendesk.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zendesk.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zendesk.js +0 -35
- package/dist/node_modules/@openhands/extensions/integrations/catalog/zendesk.js.map +0 -1
- /package/build/assets/{agent-server-ui-style-scope-CIDFDeQb.js → agent-server-ui-style-scope-COnDHTm5.js} +0 -0
- /package/build/assets/{automation-DNgDxqtq.js → automation-BU8zu-FP.js} +0 -0
- /package/build/assets/{common-KeiA2Rod.js → common-Dh7OqABE.js} +0 -0
- /package/build/assets/{environment-switch-store-BpKxp6Xq.js → environment-switch-store-DkjlKWzN.js} +0 -0
- /package/build/assets/{extension-module-card-classes-DvvyImGv.js → extension-module-card-classes-9V3J9J_b.js} +0 -0
- /package/build/assets/{git-status-mapper-B3_HbzUT.js → git-status-mapper-BI8FyUVp.js} +0 -0
- /package/build/assets/{handle-capture-consent-BChvj6mt.js → handle-capture-consent-CPMXU29K.js} +0 -0
- /package/build/assets/{llm-subscription-C1xDoa3K.js → llm-subscription-DtsX5Lhg.js} +0 -0
- /package/build/assets/{map-provider-MonJL5SS.js → map-provider-BM2SJarp.js} +0 -0
- /package/build/assets/{objectWithoutPropertiesLoose-BRYudkUn.js → objectWithoutPropertiesLoose-BgYIAs2y.js} +0 -0
- /package/build/assets/{rolldown-runtime-wFmyQBCi.js → rolldown-runtime-BFRubm34.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-DNg2vKSM.js → settings-like-page-layout-classes-DENKlZpD.js} +0 -0
- /package/build/assets/{v4-BMWDcIWQ.js → v4-DbCkTSoU.js} +0 -0
- /package/build/assets/{vendor~browser-yZEspfT9.js → vendor~browser-Dqd33JyP.js} +0 -0
- /package/build/assets/{vendor~terminal-CcUoOdAH.js → vendor~terminal-aeP3PnKf.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-compatibility.cjs","names":[],"sources":["../../src/api/agent-server-compatibility.ts"],"sourcesContent":["import {\n ServerClient,\n SettingsClient,\n} from \"@openhands/typescript-client/clients\";\nimport type { ServerInfo as BaseServerInfo } from \"@openhands/typescript-client\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport { isAuthRequired } from \"#/api/agent-server-config\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n isNoBackend,\n} from \"#/api/backend-registry/active-store\";\nimport defaults from \"../../config/defaults.json\";\n\nconst AGENT_SERVER_INFO_TIMEOUT_MS = 5000;\nconst UNKNOWN_AGENT_SERVER_VERSION = \"unknown\";\n\nexport const MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION =\n defaults.compatibility.minimumAgentServer;\nexport const AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNSUPPORTED_VERSION\";\nexport const AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNKNOWN_VERSION\";\n\nexport interface AgentServerInfo extends BaseServerInfo {\n usable_tools?: string[] | null;\n}\n\nlet cachedAgentServerInfo: AgentServerInfo | null = null;\n\nconst getAdvertisedTools = (serverInfo: AgentServerInfo | null) => {\n if (Array.isArray(serverInfo?.usable_tools)) {\n return serverInfo.usable_tools;\n }\n return null;\n};\n\nexport class AgentServerUnavailableError extends Error {\n readonly details: string | null;\n readonly noBackendConfigured: boolean;\n\n constructor(\n details?: string | null,\n options?: { noBackendConfigured?: boolean },\n ) {\n const noBackendConfigured = options?.noBackendConfigured ?? false;\n super(\n noBackendConfigured\n ? \"No agent server backend is configured yet. Add a backend to get started.\"\n : \"Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.\",\n );\n this.name = \"AgentServerUnavailableError\";\n this.details = details ?? null;\n this.noBackendConfigured = noBackendConfigured;\n }\n}\n\nexport const isAgentServerUnavailableError = (\n error: unknown,\n): error is AgentServerUnavailableError =>\n error instanceof AgentServerUnavailableError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"name\" in error &&\n error.name === \"AgentServerUnavailableError\");\n\nexport class AgentServerUnsupportedVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE;\n readonly actualVersion: string;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string) {\n const message = `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} or newer; this backend is running ${actualVersion}. Please upgrade the agent-server backend.`;\n super(message);\n this.name = \"AgentServerUnsupportedVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport class AgentServerUnknownVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE;\n readonly actualVersion: string | null;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string | null) {\n const reported = actualVersion ? ` It reported \"${actualVersion}\".` : \"\";\n const message =\n `Could not determine this backend's agent-server version.${reported} ` +\n `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} ` +\n \"or newer, but this backend did not return a valid version from \" +\n \"/server_info. Restart or rebuild the agent-server backend, then try again.\";\n super(message);\n this.name = \"AgentServerUnknownVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport const isAgentServerUnsupportedVersionError = (\n error: unknown,\n): error is AgentServerUnsupportedVersionError =>\n error instanceof AgentServerUnsupportedVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE);\n\nexport const isAgentServerUnknownVersionError = (\n error: unknown,\n): error is AgentServerUnknownVersionError =>\n error instanceof AgentServerUnknownVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE);\n\n/**\n * Returns true when the agent-server probe failed with HTTP 401.\n * In public mode this means the stored key is stale (server restarted\n * with a different `LOCAL_BACKEND_API_KEY`). Only meaningful when\n * auth is required — a 401 in local mode is a misconfiguration, not a\n * key-rotation event. Uses {@link isAuthRequired} so both the build-time\n * `VITE_AUTH_REQUIRED` flag and the runtime `window.__AGENT_CANVAS_AUTH_REQUIRED__`\n * injection (used by pre-built static binaries) are honoured.\n */\nexport const isAgentServerAuthError = (error: unknown): boolean =>\n isAuthRequired() && isSdkHttpStatusError(error, 401);\n\nexport function clearCachedAgentServerInfo() {\n cachedAgentServerInfo = null;\n}\n\nexport function isAgentServerToolAvailable(toolName: string) {\n const availableTools = getAdvertisedTools(cachedAgentServerInfo);\n if (!Array.isArray(availableTools)) {\n return true;\n }\n return availableTools.includes(toolName);\n}\n\nexport function isSdkHttpError(error: unknown) {\n return (\n error instanceof Error &&\n error.name === \"HttpError\" &&\n \"status\" in error &&\n typeof error.status === \"number\"\n );\n}\n\n/**\n * Narrows an SDK HTTP error to a specific status code.\n * Use instead of manually casting `(err as { status: number }).status`.\n */\nexport function isSdkHttpStatusError(error: unknown, status: number): boolean {\n return (\n isSdkHttpError(error) && (error as { status: number }).status === status\n );\n}\n\nfunction getRawAgentServerVersion(serverInfo: AgentServerInfo): string | null {\n if (typeof serverInfo.version !== \"string\") return null;\n const trimmed = serverInfo.version.trim();\n return trimmed || null;\n}\n\nfunction getComparableAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getRawAgentServerVersion(serverInfo);\n if (!version || version.toLowerCase() === UNKNOWN_AGENT_SERVER_VERSION) {\n return null;\n }\n return version;\n}\n\nexport function getDisplayAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getComparableAgentServerVersion(serverInfo);\n if (!version || !parseAgentServerVersion(version)) {\n return null;\n }\n return version;\n}\n\nfunction compareAgentServerVersions(actual: string, required: string) {\n const parsedActual = parseAgentServerVersion(actual);\n const parsedRequired = parseAgentServerVersion(required);\n\n if (!parsedActual || !parsedRequired) {\n return null;\n }\n\n for (const key of [\"major\", \"minor\", \"patch\"] as const) {\n if (parsedActual[key] > parsedRequired[key]) {\n return 1;\n }\n if (parsedActual[key] < parsedRequired[key]) {\n return -1;\n }\n }\n\n if (parsedActual.prerelease && !parsedRequired.prerelease) {\n return -1;\n }\n if (!parsedActual.prerelease && parsedRequired.prerelease) {\n return 1;\n }\n if (parsedActual.prerelease && parsedRequired.prerelease) {\n return parsedActual.prerelease.localeCompare(parsedRequired.prerelease);\n }\n\n return 0;\n}\n\nfunction parseAgentServerVersion(version: string) {\n const trimmed = version.trim().replace(/^v/, \"\");\n const [withoutBuild] = trimmed.split(\"+\");\n const [core, prerelease] = withoutBuild.split(\"-\", 2);\n const parts = core.split(\".\");\n\n if (parts.length !== 3) {\n return null;\n }\n\n const [major, minor, patch] = parts.map((part) => Number(part));\n if (\n ![major, minor, patch].every((part) => Number.isInteger(part) && part >= 0)\n ) {\n return null;\n }\n\n return { major, minor, patch, prerelease };\n}\n\nexport function assertAgentServerVersionIsSupported(\n serverInfo: AgentServerInfo,\n) {\n const actualVersion = getComparableAgentServerVersion(serverInfo);\n if (!actualVersion) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(\n getRawAgentServerVersion(serverInfo),\n );\n }\n\n const comparison = compareAgentServerVersions(\n actualVersion,\n MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION,\n );\n\n if (comparison === null) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(actualVersion);\n }\n\n if (comparison < 0) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnsupportedVersionError(actualVersion);\n }\n}\n\nexport async function loadAgentServerInfo() {\n // The probe is a *local* agent-server concern — it verifies the runtime\n // hosting the GUI is reachable. It must NEVER run against the active\n // backend when that backend is cloud, because cloud hosts don't\n // expose /api/server_info and would fail with a CORS error besides.\n const local = getEffectiveLocalBackend();\n if (!local) {\n clearCachedAgentServerInfo();\n\n // Empty registry (NO_BACKEND sentinel) — the user has no backend\n // configured at all. Throw so root.tsx shows the manage-backends\n // modal instead of silently rendering a broken home page.\n if (isNoBackend(getActiveBackend().backend)) {\n throw new AgentServerUnavailableError(\"No backend configured\", {\n noBackendConfigured: true,\n });\n }\n\n // Active backend is cloud — no local probe needed.\n return null;\n }\n\n const clientOptions = getAgentServerClientOptions({\n host: local.host,\n sessionApiKey: local.apiKey || null,\n timeout: AGENT_SERVER_INFO_TIMEOUT_MS,\n });\n let serverInfo: AgentServerInfo;\n\n try {\n serverInfo = (await new ServerClient(\n clientOptions,\n ).getServerInfo()) as AgentServerInfo;\n } catch (error) {\n clearCachedAgentServerInfo();\n // Preserve 401 so root.tsx can show the auth screen (public mode).\n // All other HTTP errors (502, 503, etc.) mean the server is unreachable\n // or misconfigured — treat them as unavailable.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n const details = error instanceof Error ? error.message : null;\n throw new AgentServerUnavailableError(details);\n }\n\n assertAgentServerVersionIsSupported(serverInfo);\n\n // /server_info is unprotected, so a stale session key still gets 200.\n // In public mode, validate the key against a protected endpoint so a\n // server restart with a new LOCAL_BACKEND_API_KEY surfaces immediately\n // instead of letting the app load and fail on every subsequent call.\n if (isAuthRequired()) {\n try {\n await new SettingsClient(clientOptions).getSettings();\n } catch (error) {\n // Only rethrow 401 — that means the stored key is invalid /\n // rotated. Other HTTP errors (403, 5xx) and non-HTTP errors\n // (network, timeout) are swallowed: the server *is* up (we just\n // reached /server_info), so let the app proceed with an\n // unvalidated key rather than blocking the UI.\n // NOTE: If the connection drops between the /server_info and\n // getSettings() probes, the app loads with an unvalidated key and\n // subsequent 401s won't trigger the auth screen (they come from\n // React Query hooks, not this bootstrap path). Acceptable for now\n // since the window is narrow and a page refresh recovers.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n console.warn(\n \"[agent-server] getSettings() probe failed (non-401):\",\n error,\n );\n }\n }\n\n cachedAgentServerInfo = serverInfo;\n return serverInfo;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"agent-server-compatibility.cjs","names":[],"sources":["../../src/api/agent-server-compatibility.ts"],"sourcesContent":["import {\n ServerClient,\n SettingsClient,\n} from \"@openhands/typescript-client/clients\";\nimport type { ServerInfo as BaseServerInfo } from \"@openhands/typescript-client\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport { isAuthRequired } from \"#/api/agent-server-config\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n isNoBackend,\n} from \"#/api/backend-registry/active-store\";\nimport defaults from \"../../config/defaults.json\";\n\nconst AGENT_SERVER_INFO_TIMEOUT_MS = 5000;\nconst UNKNOWN_AGENT_SERVER_VERSION = \"unknown\";\n\nexport const MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION =\n defaults.compatibility.minimumAgentServer;\nexport const AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNSUPPORTED_VERSION\";\nexport const AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNKNOWN_VERSION\";\n\nexport interface AgentServerInfo extends BaseServerInfo {\n usable_tools?: string[] | null;\n}\n\nlet cachedAgentServerInfo: AgentServerInfo | null = null;\n\nconst getAdvertisedTools = (serverInfo: AgentServerInfo | null) => {\n if (Array.isArray(serverInfo?.usable_tools)) {\n return serverInfo.usable_tools;\n }\n return null;\n};\n\nexport class AgentServerUnavailableError extends Error {\n readonly details: string | null;\n readonly noBackendConfigured: boolean;\n\n constructor(\n details?: string | null,\n options?: { noBackendConfigured?: boolean },\n ) {\n const noBackendConfigured = options?.noBackendConfigured ?? false;\n super(\n noBackendConfigured\n ? \"No agent server backend is configured yet. Add a backend to get started.\"\n : \"Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.\",\n );\n this.name = \"AgentServerUnavailableError\";\n this.details = details ?? null;\n this.noBackendConfigured = noBackendConfigured;\n }\n}\n\nexport const isAgentServerUnavailableError = (\n error: unknown,\n): error is AgentServerUnavailableError =>\n error instanceof AgentServerUnavailableError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"name\" in error &&\n error.name === \"AgentServerUnavailableError\");\n\nexport class AgentServerUnsupportedVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE;\n readonly actualVersion: string;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string) {\n const message = `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} or newer; this backend is running ${actualVersion}. Please upgrade the agent-server backend.`;\n super(message);\n this.name = \"AgentServerUnsupportedVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport class AgentServerUnknownVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE;\n readonly actualVersion: string | null;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string | null) {\n const reported = actualVersion ? ` It reported \"${actualVersion}\".` : \"\";\n const message =\n `Could not determine this backend's agent-server version.${reported} ` +\n `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} ` +\n \"or newer, but this backend did not return a valid version from \" +\n \"/server_info. Restart or rebuild the agent-server backend, then try again.\";\n super(message);\n this.name = \"AgentServerUnknownVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport const isAgentServerUnsupportedVersionError = (\n error: unknown,\n): error is AgentServerUnsupportedVersionError =>\n error instanceof AgentServerUnsupportedVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE);\n\nexport const isAgentServerUnknownVersionError = (\n error: unknown,\n): error is AgentServerUnknownVersionError =>\n error instanceof AgentServerUnknownVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE);\n\n/**\n * Returns true when the agent-server probe failed with HTTP 401.\n * In public mode this means the stored key is stale (server restarted\n * with a different `LOCAL_BACKEND_API_KEY`). Only meaningful when\n * auth is required — a 401 in local mode is a misconfiguration, not a\n * key-rotation event. Uses {@link isAuthRequired} so both the build-time\n * `VITE_AUTH_REQUIRED` flag and the runtime `window.__AGENT_CANVAS_AUTH_REQUIRED__`\n * injection (used by pre-built static binaries) are honoured.\n */\nexport const isAgentServerAuthError = (error: unknown): boolean =>\n isAuthRequired() && isSdkHttpStatusError(error, 401);\n\nexport function clearCachedAgentServerInfo() {\n cachedAgentServerInfo = null;\n}\n\nexport function isAgentServerToolAvailable(toolName: string) {\n const availableTools = getAdvertisedTools(cachedAgentServerInfo);\n if (!Array.isArray(availableTools)) {\n return true;\n }\n return availableTools.includes(toolName);\n}\n\nexport function isSdkHttpError(error: unknown) {\n return (\n error instanceof Error &&\n error.name === \"HttpError\" &&\n \"status\" in error &&\n typeof error.status === \"number\"\n );\n}\n\n/**\n * Narrows an SDK HTTP error to a specific status code.\n * Use instead of manually casting `(err as { status: number }).status`.\n */\nexport function isSdkHttpStatusError(error: unknown, status: number): boolean {\n return (\n isSdkHttpError(error) && (error as { status: number }).status === status\n );\n}\n\nfunction getRawAgentServerVersion(serverInfo: AgentServerInfo): string | null {\n if (typeof serverInfo.version !== \"string\") return null;\n const trimmed = serverInfo.version.trim();\n return trimmed || null;\n}\n\nfunction getComparableAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getRawAgentServerVersion(serverInfo);\n if (!version || version.toLowerCase() === UNKNOWN_AGENT_SERVER_VERSION) {\n return null;\n }\n return version;\n}\n\nexport function getDisplayAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getComparableAgentServerVersion(serverInfo);\n if (!version || !parseAgentServerVersion(version)) {\n return null;\n }\n return version;\n}\n\nfunction compareAgentServerVersions(actual: string, required: string) {\n const parsedActual = parseAgentServerVersion(actual);\n const parsedRequired = parseAgentServerVersion(required);\n\n if (!parsedActual || !parsedRequired) {\n return null;\n }\n\n for (const key of [\"major\", \"minor\", \"patch\"] as const) {\n if (parsedActual[key] > parsedRequired[key]) {\n return 1;\n }\n if (parsedActual[key] < parsedRequired[key]) {\n return -1;\n }\n }\n\n if (parsedActual.prerelease && !parsedRequired.prerelease) {\n return -1;\n }\n if (!parsedActual.prerelease && parsedRequired.prerelease) {\n return 1;\n }\n if (parsedActual.prerelease && parsedRequired.prerelease) {\n return parsedActual.prerelease.localeCompare(parsedRequired.prerelease);\n }\n\n return 0;\n}\n\nfunction parseAgentServerVersion(version: string) {\n const trimmed = version.trim().replace(/^v/, \"\");\n const [withoutBuild] = trimmed.split(\"+\");\n const [core, prerelease] = withoutBuild.split(\"-\", 2);\n const parts = core.split(\".\");\n\n if (parts.length !== 3) {\n return null;\n }\n\n const [major, minor, patch] = parts.map((part) => Number(part));\n if (\n ![major, minor, patch].every((part) => Number.isInteger(part) && part >= 0)\n ) {\n return null;\n }\n\n return { major, minor, patch, prerelease };\n}\n\nexport function assertAgentServerVersionIsSupported(\n serverInfo: AgentServerInfo,\n) {\n const actualVersion = getComparableAgentServerVersion(serverInfo);\n if (!actualVersion) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(\n getRawAgentServerVersion(serverInfo),\n );\n }\n\n const comparison = compareAgentServerVersions(\n actualVersion,\n MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION,\n );\n\n if (comparison === null) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(actualVersion);\n }\n\n if (comparison < 0) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnsupportedVersionError(actualVersion);\n }\n}\n\nexport async function loadAgentServerInfo() {\n // The probe is a *local* agent-server concern — it verifies the runtime\n // hosting the GUI is reachable. It must NEVER run against the active\n // backend when that backend is cloud, because cloud hosts don't\n // expose /api/server_info and would fail with a CORS error besides.\n const local = getEffectiveLocalBackend();\n if (!local) {\n clearCachedAgentServerInfo();\n\n // Empty registry (NO_BACKEND sentinel) — the user has no backend\n // configured at all. Throw so root.tsx shows the manage-backends\n // modal instead of silently rendering a broken home page.\n if (isNoBackend(getActiveBackend().backend)) {\n throw new AgentServerUnavailableError(\"No backend configured\", {\n noBackendConfigured: true,\n });\n }\n\n // Active backend is cloud — no local probe needed.\n return null;\n }\n\n const clientOptions = getAgentServerClientOptions({\n host: local.host,\n sessionApiKey: local.apiKey || null,\n timeout: AGENT_SERVER_INFO_TIMEOUT_MS,\n });\n let serverInfo: AgentServerInfo;\n\n try {\n serverInfo = (await new ServerClient(\n clientOptions,\n ).getServerInfo()) as AgentServerInfo;\n } catch (error) {\n clearCachedAgentServerInfo();\n // Preserve 401 so root.tsx can show the auth screen (public mode).\n // All other HTTP errors (502, 503, etc.) mean the server is unreachable\n // or misconfigured — treat them as unavailable.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n const details = error instanceof Error ? error.message : null;\n throw new AgentServerUnavailableError(details);\n }\n\n assertAgentServerVersionIsSupported(serverInfo);\n\n // /server_info is unprotected, so a stale session key still gets 200.\n // In public mode, validate the key against a protected endpoint so a\n // server restart with a new LOCAL_BACKEND_API_KEY surfaces immediately\n // instead of letting the app load and fail on every subsequent call.\n if (isAuthRequired()) {\n try {\n await new SettingsClient(clientOptions).getSettings();\n } catch (error) {\n // Only rethrow 401 — that means the stored key is invalid /\n // rotated. Other HTTP errors (403, 5xx) and non-HTTP errors\n // (network, timeout) are swallowed: the server *is* up (we just\n // reached /server_info), so let the app proceed with an\n // unvalidated key rather than blocking the UI.\n // NOTE: If the connection drops between the /server_info and\n // getSettings() probes, the app loads with an unvalidated key and\n // subsequent 401s won't trigger the auth screen (they come from\n // React Query hooks, not this bootstrap path). Acceptable for now\n // since the window is narrow and a page refresh recovers.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n console.warn(\n \"[agent-server] getSettings() probe failed (non-401):\",\n error,\n );\n }\n }\n\n cachedAgentServerInfo = serverInfo;\n return serverInfo;\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ServerClient as e } from "../node_modules/@openhands/typescript-client/dist/client/server-client.js";
|
|
2
2
|
import { SettingsClient as t } from "../node_modules/@openhands/typescript-client/dist/client/settings-client.js";
|
|
3
|
+
import "../node_modules/@openhands/typescript-client/dist/clients.js";
|
|
3
4
|
import { isAuthRequired as n } from "./agent-server-config.js";
|
|
4
5
|
import { getActiveBackend as r, getEffectiveLocalBackend as i, isNoBackend as a } from "./backend-registry/active-store.js";
|
|
5
6
|
import { getAgentServerClientOptions as o } from "./agent-server-client-options.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-compatibility.js","names":[],"sources":["../../src/api/agent-server-compatibility.ts"],"sourcesContent":["import {\n ServerClient,\n SettingsClient,\n} from \"@openhands/typescript-client/clients\";\nimport type { ServerInfo as BaseServerInfo } from \"@openhands/typescript-client\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport { isAuthRequired } from \"#/api/agent-server-config\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n isNoBackend,\n} from \"#/api/backend-registry/active-store\";\nimport defaults from \"../../config/defaults.json\";\n\nconst AGENT_SERVER_INFO_TIMEOUT_MS = 5000;\nconst UNKNOWN_AGENT_SERVER_VERSION = \"unknown\";\n\nexport const MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION =\n defaults.compatibility.minimumAgentServer;\nexport const AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNSUPPORTED_VERSION\";\nexport const AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNKNOWN_VERSION\";\n\nexport interface AgentServerInfo extends BaseServerInfo {\n usable_tools?: string[] | null;\n}\n\nlet cachedAgentServerInfo: AgentServerInfo | null = null;\n\nconst getAdvertisedTools = (serverInfo: AgentServerInfo | null) => {\n if (Array.isArray(serverInfo?.usable_tools)) {\n return serverInfo.usable_tools;\n }\n return null;\n};\n\nexport class AgentServerUnavailableError extends Error {\n readonly details: string | null;\n readonly noBackendConfigured: boolean;\n\n constructor(\n details?: string | null,\n options?: { noBackendConfigured?: boolean },\n ) {\n const noBackendConfigured = options?.noBackendConfigured ?? false;\n super(\n noBackendConfigured\n ? \"No agent server backend is configured yet. Add a backend to get started.\"\n : \"Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.\",\n );\n this.name = \"AgentServerUnavailableError\";\n this.details = details ?? null;\n this.noBackendConfigured = noBackendConfigured;\n }\n}\n\nexport const isAgentServerUnavailableError = (\n error: unknown,\n): error is AgentServerUnavailableError =>\n error instanceof AgentServerUnavailableError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"name\" in error &&\n error.name === \"AgentServerUnavailableError\");\n\nexport class AgentServerUnsupportedVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE;\n readonly actualVersion: string;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string) {\n const message = `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} or newer; this backend is running ${actualVersion}. Please upgrade the agent-server backend.`;\n super(message);\n this.name = \"AgentServerUnsupportedVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport class AgentServerUnknownVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE;\n readonly actualVersion: string | null;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string | null) {\n const reported = actualVersion ? ` It reported \"${actualVersion}\".` : \"\";\n const message =\n `Could not determine this backend's agent-server version.${reported} ` +\n `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} ` +\n \"or newer, but this backend did not return a valid version from \" +\n \"/server_info. Restart or rebuild the agent-server backend, then try again.\";\n super(message);\n this.name = \"AgentServerUnknownVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport const isAgentServerUnsupportedVersionError = (\n error: unknown,\n): error is AgentServerUnsupportedVersionError =>\n error instanceof AgentServerUnsupportedVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE);\n\nexport const isAgentServerUnknownVersionError = (\n error: unknown,\n): error is AgentServerUnknownVersionError =>\n error instanceof AgentServerUnknownVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE);\n\n/**\n * Returns true when the agent-server probe failed with HTTP 401.\n * In public mode this means the stored key is stale (server restarted\n * with a different `LOCAL_BACKEND_API_KEY`). Only meaningful when\n * auth is required — a 401 in local mode is a misconfiguration, not a\n * key-rotation event. Uses {@link isAuthRequired} so both the build-time\n * `VITE_AUTH_REQUIRED` flag and the runtime `window.__AGENT_CANVAS_AUTH_REQUIRED__`\n * injection (used by pre-built static binaries) are honoured.\n */\nexport const isAgentServerAuthError = (error: unknown): boolean =>\n isAuthRequired() && isSdkHttpStatusError(error, 401);\n\nexport function clearCachedAgentServerInfo() {\n cachedAgentServerInfo = null;\n}\n\nexport function isAgentServerToolAvailable(toolName: string) {\n const availableTools = getAdvertisedTools(cachedAgentServerInfo);\n if (!Array.isArray(availableTools)) {\n return true;\n }\n return availableTools.includes(toolName);\n}\n\nexport function isSdkHttpError(error: unknown) {\n return (\n error instanceof Error &&\n error.name === \"HttpError\" &&\n \"status\" in error &&\n typeof error.status === \"number\"\n );\n}\n\n/**\n * Narrows an SDK HTTP error to a specific status code.\n * Use instead of manually casting `(err as { status: number }).status`.\n */\nexport function isSdkHttpStatusError(error: unknown, status: number): boolean {\n return (\n isSdkHttpError(error) && (error as { status: number }).status === status\n );\n}\n\nfunction getRawAgentServerVersion(serverInfo: AgentServerInfo): string | null {\n if (typeof serverInfo.version !== \"string\") return null;\n const trimmed = serverInfo.version.trim();\n return trimmed || null;\n}\n\nfunction getComparableAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getRawAgentServerVersion(serverInfo);\n if (!version || version.toLowerCase() === UNKNOWN_AGENT_SERVER_VERSION) {\n return null;\n }\n return version;\n}\n\nexport function getDisplayAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getComparableAgentServerVersion(serverInfo);\n if (!version || !parseAgentServerVersion(version)) {\n return null;\n }\n return version;\n}\n\nfunction compareAgentServerVersions(actual: string, required: string) {\n const parsedActual = parseAgentServerVersion(actual);\n const parsedRequired = parseAgentServerVersion(required);\n\n if (!parsedActual || !parsedRequired) {\n return null;\n }\n\n for (const key of [\"major\", \"minor\", \"patch\"] as const) {\n if (parsedActual[key] > parsedRequired[key]) {\n return 1;\n }\n if (parsedActual[key] < parsedRequired[key]) {\n return -1;\n }\n }\n\n if (parsedActual.prerelease && !parsedRequired.prerelease) {\n return -1;\n }\n if (!parsedActual.prerelease && parsedRequired.prerelease) {\n return 1;\n }\n if (parsedActual.prerelease && parsedRequired.prerelease) {\n return parsedActual.prerelease.localeCompare(parsedRequired.prerelease);\n }\n\n return 0;\n}\n\nfunction parseAgentServerVersion(version: string) {\n const trimmed = version.trim().replace(/^v/, \"\");\n const [withoutBuild] = trimmed.split(\"+\");\n const [core, prerelease] = withoutBuild.split(\"-\", 2);\n const parts = core.split(\".\");\n\n if (parts.length !== 3) {\n return null;\n }\n\n const [major, minor, patch] = parts.map((part) => Number(part));\n if (\n ![major, minor, patch].every((part) => Number.isInteger(part) && part >= 0)\n ) {\n return null;\n }\n\n return { major, minor, patch, prerelease };\n}\n\nexport function assertAgentServerVersionIsSupported(\n serverInfo: AgentServerInfo,\n) {\n const actualVersion = getComparableAgentServerVersion(serverInfo);\n if (!actualVersion) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(\n getRawAgentServerVersion(serverInfo),\n );\n }\n\n const comparison = compareAgentServerVersions(\n actualVersion,\n MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION,\n );\n\n if (comparison === null) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(actualVersion);\n }\n\n if (comparison < 0) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnsupportedVersionError(actualVersion);\n }\n}\n\nexport async function loadAgentServerInfo() {\n // The probe is a *local* agent-server concern — it verifies the runtime\n // hosting the GUI is reachable. It must NEVER run against the active\n // backend when that backend is cloud, because cloud hosts don't\n // expose /api/server_info and would fail with a CORS error besides.\n const local = getEffectiveLocalBackend();\n if (!local) {\n clearCachedAgentServerInfo();\n\n // Empty registry (NO_BACKEND sentinel) — the user has no backend\n // configured at all. Throw so root.tsx shows the manage-backends\n // modal instead of silently rendering a broken home page.\n if (isNoBackend(getActiveBackend().backend)) {\n throw new AgentServerUnavailableError(\"No backend configured\", {\n noBackendConfigured: true,\n });\n }\n\n // Active backend is cloud — no local probe needed.\n return null;\n }\n\n const clientOptions = getAgentServerClientOptions({\n host: local.host,\n sessionApiKey: local.apiKey || null,\n timeout: AGENT_SERVER_INFO_TIMEOUT_MS,\n });\n let serverInfo: AgentServerInfo;\n\n try {\n serverInfo = (await new ServerClient(\n clientOptions,\n ).getServerInfo()) as AgentServerInfo;\n } catch (error) {\n clearCachedAgentServerInfo();\n // Preserve 401 so root.tsx can show the auth screen (public mode).\n // All other HTTP errors (502, 503, etc.) mean the server is unreachable\n // or misconfigured — treat them as unavailable.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n const details = error instanceof Error ? error.message : null;\n throw new AgentServerUnavailableError(details);\n }\n\n assertAgentServerVersionIsSupported(serverInfo);\n\n // /server_info is unprotected, so a stale session key still gets 200.\n // In public mode, validate the key against a protected endpoint so a\n // server restart with a new LOCAL_BACKEND_API_KEY surfaces immediately\n // instead of letting the app load and fail on every subsequent call.\n if (isAuthRequired()) {\n try {\n await new SettingsClient(clientOptions).getSettings();\n } catch (error) {\n // Only rethrow 401 — that means the stored key is invalid /\n // rotated. Other HTTP errors (403, 5xx) and non-HTTP errors\n // (network, timeout) are swallowed: the server *is* up (we just\n // reached /server_info), so let the app proceed with an\n // unvalidated key rather than blocking the UI.\n // NOTE: If the connection drops between the /server_info and\n // getSettings() probes, the app loads with an unvalidated key and\n // subsequent 401s won't trigger the auth screen (they come from\n // React Query hooks, not this bootstrap path). Acceptable for now\n // since the window is narrow and a page refresh recovers.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n console.warn(\n \"[agent-server] getSettings() probe failed (non-401):\",\n error,\n );\n }\n }\n\n cachedAgentServerInfo = serverInfo;\n return serverInfo;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"agent-server-compatibility.js","names":[],"sources":["../../src/api/agent-server-compatibility.ts"],"sourcesContent":["import {\n ServerClient,\n SettingsClient,\n} from \"@openhands/typescript-client/clients\";\nimport type { ServerInfo as BaseServerInfo } from \"@openhands/typescript-client\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport { isAuthRequired } from \"#/api/agent-server-config\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n isNoBackend,\n} from \"#/api/backend-registry/active-store\";\nimport defaults from \"../../config/defaults.json\";\n\nconst AGENT_SERVER_INFO_TIMEOUT_MS = 5000;\nconst UNKNOWN_AGENT_SERVER_VERSION = \"unknown\";\n\nexport const MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION =\n defaults.compatibility.minimumAgentServer;\nexport const AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNSUPPORTED_VERSION\";\nexport const AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE =\n \"AGENT_SERVER_UNKNOWN_VERSION\";\n\nexport interface AgentServerInfo extends BaseServerInfo {\n usable_tools?: string[] | null;\n}\n\nlet cachedAgentServerInfo: AgentServerInfo | null = null;\n\nconst getAdvertisedTools = (serverInfo: AgentServerInfo | null) => {\n if (Array.isArray(serverInfo?.usable_tools)) {\n return serverInfo.usable_tools;\n }\n return null;\n};\n\nexport class AgentServerUnavailableError extends Error {\n readonly details: string | null;\n readonly noBackendConfigured: boolean;\n\n constructor(\n details?: string | null,\n options?: { noBackendConfigured?: boolean },\n ) {\n const noBackendConfigured = options?.noBackendConfigured ?? false;\n super(\n noBackendConfigured\n ? \"No agent server backend is configured yet. Add a backend to get started.\"\n : \"Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.\",\n );\n this.name = \"AgentServerUnavailableError\";\n this.details = details ?? null;\n this.noBackendConfigured = noBackendConfigured;\n }\n}\n\nexport const isAgentServerUnavailableError = (\n error: unknown,\n): error is AgentServerUnavailableError =>\n error instanceof AgentServerUnavailableError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"name\" in error &&\n error.name === \"AgentServerUnavailableError\");\n\nexport class AgentServerUnsupportedVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE;\n readonly actualVersion: string;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string) {\n const message = `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} or newer; this backend is running ${actualVersion}. Please upgrade the agent-server backend.`;\n super(message);\n this.name = \"AgentServerUnsupportedVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport class AgentServerUnknownVersionError extends AgentServerUnavailableError {\n readonly code = AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE;\n readonly actualVersion: string | null;\n readonly requiredVersion = MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION;\n\n constructor(actualVersion: string | null) {\n const reported = actualVersion ? ` It reported \"${actualVersion}\".` : \"\";\n const message =\n `Could not determine this backend's agent-server version.${reported} ` +\n `Agent Canvas requires agent-server ${MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION} ` +\n \"or newer, but this backend did not return a valid version from \" +\n \"/server_info. Restart or rebuild the agent-server backend, then try again.\";\n super(message);\n this.name = \"AgentServerUnknownVersionError\";\n this.message = message;\n this.actualVersion = actualVersion;\n }\n}\n\nexport const isAgentServerUnsupportedVersionError = (\n error: unknown,\n): error is AgentServerUnsupportedVersionError =>\n error instanceof AgentServerUnsupportedVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNSUPPORTED_VERSION_ERROR_CODE);\n\nexport const isAgentServerUnknownVersionError = (\n error: unknown,\n): error is AgentServerUnknownVersionError =>\n error instanceof AgentServerUnknownVersionError ||\n (typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n error.code === AGENT_SERVER_UNKNOWN_VERSION_ERROR_CODE);\n\n/**\n * Returns true when the agent-server probe failed with HTTP 401.\n * In public mode this means the stored key is stale (server restarted\n * with a different `LOCAL_BACKEND_API_KEY`). Only meaningful when\n * auth is required — a 401 in local mode is a misconfiguration, not a\n * key-rotation event. Uses {@link isAuthRequired} so both the build-time\n * `VITE_AUTH_REQUIRED` flag and the runtime `window.__AGENT_CANVAS_AUTH_REQUIRED__`\n * injection (used by pre-built static binaries) are honoured.\n */\nexport const isAgentServerAuthError = (error: unknown): boolean =>\n isAuthRequired() && isSdkHttpStatusError(error, 401);\n\nexport function clearCachedAgentServerInfo() {\n cachedAgentServerInfo = null;\n}\n\nexport function isAgentServerToolAvailable(toolName: string) {\n const availableTools = getAdvertisedTools(cachedAgentServerInfo);\n if (!Array.isArray(availableTools)) {\n return true;\n }\n return availableTools.includes(toolName);\n}\n\nexport function isSdkHttpError(error: unknown) {\n return (\n error instanceof Error &&\n error.name === \"HttpError\" &&\n \"status\" in error &&\n typeof error.status === \"number\"\n );\n}\n\n/**\n * Narrows an SDK HTTP error to a specific status code.\n * Use instead of manually casting `(err as { status: number }).status`.\n */\nexport function isSdkHttpStatusError(error: unknown, status: number): boolean {\n return (\n isSdkHttpError(error) && (error as { status: number }).status === status\n );\n}\n\nfunction getRawAgentServerVersion(serverInfo: AgentServerInfo): string | null {\n if (typeof serverInfo.version !== \"string\") return null;\n const trimmed = serverInfo.version.trim();\n return trimmed || null;\n}\n\nfunction getComparableAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getRawAgentServerVersion(serverInfo);\n if (!version || version.toLowerCase() === UNKNOWN_AGENT_SERVER_VERSION) {\n return null;\n }\n return version;\n}\n\nexport function getDisplayAgentServerVersion(\n serverInfo: AgentServerInfo,\n): string | null {\n const version = getComparableAgentServerVersion(serverInfo);\n if (!version || !parseAgentServerVersion(version)) {\n return null;\n }\n return version;\n}\n\nfunction compareAgentServerVersions(actual: string, required: string) {\n const parsedActual = parseAgentServerVersion(actual);\n const parsedRequired = parseAgentServerVersion(required);\n\n if (!parsedActual || !parsedRequired) {\n return null;\n }\n\n for (const key of [\"major\", \"minor\", \"patch\"] as const) {\n if (parsedActual[key] > parsedRequired[key]) {\n return 1;\n }\n if (parsedActual[key] < parsedRequired[key]) {\n return -1;\n }\n }\n\n if (parsedActual.prerelease && !parsedRequired.prerelease) {\n return -1;\n }\n if (!parsedActual.prerelease && parsedRequired.prerelease) {\n return 1;\n }\n if (parsedActual.prerelease && parsedRequired.prerelease) {\n return parsedActual.prerelease.localeCompare(parsedRequired.prerelease);\n }\n\n return 0;\n}\n\nfunction parseAgentServerVersion(version: string) {\n const trimmed = version.trim().replace(/^v/, \"\");\n const [withoutBuild] = trimmed.split(\"+\");\n const [core, prerelease] = withoutBuild.split(\"-\", 2);\n const parts = core.split(\".\");\n\n if (parts.length !== 3) {\n return null;\n }\n\n const [major, minor, patch] = parts.map((part) => Number(part));\n if (\n ![major, minor, patch].every((part) => Number.isInteger(part) && part >= 0)\n ) {\n return null;\n }\n\n return { major, minor, patch, prerelease };\n}\n\nexport function assertAgentServerVersionIsSupported(\n serverInfo: AgentServerInfo,\n) {\n const actualVersion = getComparableAgentServerVersion(serverInfo);\n if (!actualVersion) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(\n getRawAgentServerVersion(serverInfo),\n );\n }\n\n const comparison = compareAgentServerVersions(\n actualVersion,\n MINIMUM_COMPATIBLE_AGENT_SERVER_VERSION,\n );\n\n if (comparison === null) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnknownVersionError(actualVersion);\n }\n\n if (comparison < 0) {\n clearCachedAgentServerInfo();\n throw new AgentServerUnsupportedVersionError(actualVersion);\n }\n}\n\nexport async function loadAgentServerInfo() {\n // The probe is a *local* agent-server concern — it verifies the runtime\n // hosting the GUI is reachable. It must NEVER run against the active\n // backend when that backend is cloud, because cloud hosts don't\n // expose /api/server_info and would fail with a CORS error besides.\n const local = getEffectiveLocalBackend();\n if (!local) {\n clearCachedAgentServerInfo();\n\n // Empty registry (NO_BACKEND sentinel) — the user has no backend\n // configured at all. Throw so root.tsx shows the manage-backends\n // modal instead of silently rendering a broken home page.\n if (isNoBackend(getActiveBackend().backend)) {\n throw new AgentServerUnavailableError(\"No backend configured\", {\n noBackendConfigured: true,\n });\n }\n\n // Active backend is cloud — no local probe needed.\n return null;\n }\n\n const clientOptions = getAgentServerClientOptions({\n host: local.host,\n sessionApiKey: local.apiKey || null,\n timeout: AGENT_SERVER_INFO_TIMEOUT_MS,\n });\n let serverInfo: AgentServerInfo;\n\n try {\n serverInfo = (await new ServerClient(\n clientOptions,\n ).getServerInfo()) as AgentServerInfo;\n } catch (error) {\n clearCachedAgentServerInfo();\n // Preserve 401 so root.tsx can show the auth screen (public mode).\n // All other HTTP errors (502, 503, etc.) mean the server is unreachable\n // or misconfigured — treat them as unavailable.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n const details = error instanceof Error ? error.message : null;\n throw new AgentServerUnavailableError(details);\n }\n\n assertAgentServerVersionIsSupported(serverInfo);\n\n // /server_info is unprotected, so a stale session key still gets 200.\n // In public mode, validate the key against a protected endpoint so a\n // server restart with a new LOCAL_BACKEND_API_KEY surfaces immediately\n // instead of letting the app load and fail on every subsequent call.\n if (isAuthRequired()) {\n try {\n await new SettingsClient(clientOptions).getSettings();\n } catch (error) {\n // Only rethrow 401 — that means the stored key is invalid /\n // rotated. Other HTTP errors (403, 5xx) and non-HTTP errors\n // (network, timeout) are swallowed: the server *is* up (we just\n // reached /server_info), so let the app proceed with an\n // unvalidated key rather than blocking the UI.\n // NOTE: If the connection drops between the /server_info and\n // getSettings() probes, the app loads with an unvalidated key and\n // subsequent 401s won't trigger the auth screen (they come from\n // React Query hooks, not this bootstrap path). Acceptable for now\n // since the window is narrow and a page refresh recovers.\n if (isSdkHttpStatusError(error, 401)) {\n throw error;\n }\n\n console.warn(\n \"[agent-server] getSettings() probe failed (non-401):\",\n error,\n );\n }\n }\n\n cachedAgentServerInfo = serverInfo;\n return serverInfo;\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/@openhands/typescript-client/dist/client/file-client.cjs`)
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/@openhands/typescript-client/dist/client/file-client.cjs`);require(`../node_modules/@openhands/typescript-client/dist/clients.cjs`);const t=require(`./agent-server-client-options.cjs`);var n=new Map;function r(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function i(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function a(r={}){let i=t.getAgentServerClientOptions(r),a=i.host,o=n.get(a);if(o)return o;let s=(async()=>{let{home:t}=await new e.FileClient(i).getHome();if(!t||typeof t!=`string`)throw Error(`Agent server returned an empty home directory`);return t.replace(/[/\\]+$/,``)})();n.set(a,s);try{return await s}catch(e){throw n.delete(a),e}}async function o(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?r(n)?n:i(await a(t),n):a(t)}exports.resolveAbsoluteAgentServerPath=o;
|
|
2
2
|
//# sourceMappingURL=agent-server-home.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-home.cjs","names":[],"sources":["../../src/api/agent-server-home.ts"],"sourcesContent":["// @spec WUP-001 — Resolve relative working dirs against /api/file/home\nimport { FileClient } from \"@openhands/typescript-client/clients\";\nimport {\n getAgentServerClientOptions,\n type AgentServerClientOverrides,\n} from \"./agent-server-client-options\";\n\n/**\n * Cache the agent-server's home directory per host so we only round-trip\n * `/api/file/home` once per backend. The home dir is effectively static for\n * the lifetime of a running agent-server (it's `Path.home()` on the host),\n * so caching is safe and avoids hammering the endpoint on every upload.\n *\n * The cache holds `Promise<string>` rather than `string` so concurrent\n * callers share a single in-flight request.\n */\nconst homeDirCache = new Map<string, Promise<string>>();\n\nfunction isAbsolutePath(path: string): boolean {\n // Treat POSIX-style and Windows-style absolute paths as absolute.\n // The agent-server itself is POSIX on Linux/macOS and uses `\\\\` style\n // on Windows; we just need to know whether `Path(path).is_absolute()`\n // would return true on the server.\n //\n // Patterns covered:\n // POSIX absolute: /foo/bar\n // Windows drive: C:\\foo or C:/foo\n // Windows UNC: \\\\server\\share (starts with `\\`, matches `[/\\\\]`)\n return /^([/\\\\]|[a-zA-Z]:[/\\\\])/.test(path);\n}\n\n/**\n * Join a parent directory and a relative child segment with a forward slash,\n * collapsing any duplicate separators that result from the join.\n */\nfunction joinPath(parent: string, child: string): string {\n const left = parent.replace(/[/\\\\]+$/, \"\");\n const right = child.replace(/^[/\\\\]+/, \"\");\n return `${left}/${right}`;\n}\n\n/**\n * Fetch and cache the agent-server's home directory via `GET /api/file/home`.\n *\n * The result is the absolute path returned by `Path.home()` on the\n * agent-server host (e.g. `/Users/foo`, `/root`, or `C:\\\\Users\\\\Foo`). This\n * is the most reliable absolute, writable anchor the agent-server API\n * currently exposes — `/server_info` doesn't include the process CWD.\n *\n * @param overrides Same shape as `getAgentServerClientOptions` — lets cloud\n * sandboxes pass a `conversationUrl` + `sessionApiKey` so the lookup goes\n * to the per-conversation runtime rather than the bundled local backend.\n */\nexport async function getAgentServerHomeDir(\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const options = getAgentServerClientOptions(overrides);\n const cacheKey = options.host;\n const cached = homeDirCache.get(cacheKey);\n if (cached) return cached;\n\n const lookup = (async () => {\n const { home } = await new FileClient(options).getHome();\n if (!home || typeof home !== \"string\") {\n throw new Error(\"Agent server returned an empty home directory\");\n }\n return home.replace(/[/\\\\]+$/, \"\");\n })();\n\n homeDirCache.set(cacheKey, lookup);\n try {\n return await lookup;\n } catch (error) {\n // Don't cache failures — let the next call retry.\n homeDirCache.delete(cacheKey);\n throw error;\n }\n}\n\n/** Test-only helper. */\nexport function clearAgentServerHomeDirCache(): void {\n homeDirCache.clear();\n}\n\n/**\n * Resolve a (possibly relative) working dir to an absolute path the\n * agent-server's file APIs will accept.\n *\n * - If `workingDir` is already absolute, returns it unchanged.\n * - Otherwise prepends the agent-server's home dir (looked up via\n * `/api/file/home` and cached). This matches how the published binary\n * and Docker entrypoint expect to anchor relative working dirs: under\n * `~/workspace/project` rather than the filesystem root.\n *\n * Why this matters: the agent-server's `/api/file/upload` endpoint requires\n * an absolute path and `mkdir -p`s the parent. Naively prepending `/` to a\n * relative dir like `workspace/project/<hex>` produces `/workspace/...`,\n * which on macOS lives under the SIP-protected read-only root and fails\n * with `Errno 30: Read-only file system: '/workspace'`. Resolving against\n * `Path.home()` instead puts the path somewhere reliably writable.\n */\nexport async function resolveAbsoluteAgentServerPath(\n workingDir: string,\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const trimmed = workingDir.replace(/[/\\\\]+$/, \"\");\n if (!trimmed) {\n return getAgentServerHomeDir(overrides);\n }\n if (isAbsolutePath(trimmed)) return trimmed;\n\n const home = await getAgentServerHomeDir(overrides);\n return joinPath(home, trimmed);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-server-home.cjs","names":[],"sources":["../../src/api/agent-server-home.ts"],"sourcesContent":["// @spec WUP-001 — Resolve relative working dirs against /api/file/home\nimport { FileClient } from \"@openhands/typescript-client/clients\";\nimport {\n getAgentServerClientOptions,\n type AgentServerClientOverrides,\n} from \"./agent-server-client-options\";\n\n/**\n * Cache the agent-server's home directory per host so we only round-trip\n * `/api/file/home` once per backend. The home dir is effectively static for\n * the lifetime of a running agent-server (it's `Path.home()` on the host),\n * so caching is safe and avoids hammering the endpoint on every upload.\n *\n * The cache holds `Promise<string>` rather than `string` so concurrent\n * callers share a single in-flight request.\n */\nconst homeDirCache = new Map<string, Promise<string>>();\n\nfunction isAbsolutePath(path: string): boolean {\n // Treat POSIX-style and Windows-style absolute paths as absolute.\n // The agent-server itself is POSIX on Linux/macOS and uses `\\\\` style\n // on Windows; we just need to know whether `Path(path).is_absolute()`\n // would return true on the server.\n //\n // Patterns covered:\n // POSIX absolute: /foo/bar\n // Windows drive: C:\\foo or C:/foo\n // Windows UNC: \\\\server\\share (starts with `\\`, matches `[/\\\\]`)\n return /^([/\\\\]|[a-zA-Z]:[/\\\\])/.test(path);\n}\n\n/**\n * Join a parent directory and a relative child segment with a forward slash,\n * collapsing any duplicate separators that result from the join.\n */\nfunction joinPath(parent: string, child: string): string {\n const left = parent.replace(/[/\\\\]+$/, \"\");\n const right = child.replace(/^[/\\\\]+/, \"\");\n return `${left}/${right}`;\n}\n\n/**\n * Fetch and cache the agent-server's home directory via `GET /api/file/home`.\n *\n * The result is the absolute path returned by `Path.home()` on the\n * agent-server host (e.g. `/Users/foo`, `/root`, or `C:\\\\Users\\\\Foo`). This\n * is the most reliable absolute, writable anchor the agent-server API\n * currently exposes — `/server_info` doesn't include the process CWD.\n *\n * @param overrides Same shape as `getAgentServerClientOptions` — lets cloud\n * sandboxes pass a `conversationUrl` + `sessionApiKey` so the lookup goes\n * to the per-conversation runtime rather than the bundled local backend.\n */\nexport async function getAgentServerHomeDir(\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const options = getAgentServerClientOptions(overrides);\n const cacheKey = options.host;\n const cached = homeDirCache.get(cacheKey);\n if (cached) return cached;\n\n const lookup = (async () => {\n const { home } = await new FileClient(options).getHome();\n if (!home || typeof home !== \"string\") {\n throw new Error(\"Agent server returned an empty home directory\");\n }\n return home.replace(/[/\\\\]+$/, \"\");\n })();\n\n homeDirCache.set(cacheKey, lookup);\n try {\n return await lookup;\n } catch (error) {\n // Don't cache failures — let the next call retry.\n homeDirCache.delete(cacheKey);\n throw error;\n }\n}\n\n/** Test-only helper. */\nexport function clearAgentServerHomeDirCache(): void {\n homeDirCache.clear();\n}\n\n/**\n * Resolve a (possibly relative) working dir to an absolute path the\n * agent-server's file APIs will accept.\n *\n * - If `workingDir` is already absolute, returns it unchanged.\n * - Otherwise prepends the agent-server's home dir (looked up via\n * `/api/file/home` and cached). This matches how the published binary\n * and Docker entrypoint expect to anchor relative working dirs: under\n * `~/workspace/project` rather than the filesystem root.\n *\n * Why this matters: the agent-server's `/api/file/upload` endpoint requires\n * an absolute path and `mkdir -p`s the parent. Naively prepending `/` to a\n * relative dir like `workspace/project/<hex>` produces `/workspace/...`,\n * which on macOS lives under the SIP-protected read-only root and fails\n * with `Errno 30: Read-only file system: '/workspace'`. Resolving against\n * `Path.home()` instead puts the path somewhere reliably writable.\n */\nexport async function resolveAbsoluteAgentServerPath(\n workingDir: string,\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const trimmed = workingDir.replace(/[/\\\\]+$/, \"\");\n if (!trimmed) {\n return getAgentServerHomeDir(overrides);\n }\n if (isAbsolutePath(trimmed)) return trimmed;\n\n const home = await getAgentServerHomeDir(overrides);\n return joinPath(home, trimmed);\n}\n"],"mappings":"uQAgBA,IAAM,EAAe,IAAI,IAEzB,SAAS,EAAe,EAAuB,CAU7C,MAAO,0BAA0B,KAAK,EAAK,CAO7C,SAAS,EAAS,EAAgB,EAAuB,CAGvD,MAAO,GAFM,EAAO,QAAQ,UAAW,GAE7B,CAAK,GADD,EAAM,QAAQ,UAAW,GACrB,GAepB,eAAsB,EACpB,EAAwC,EAAE,CACzB,CACjB,IAAM,EAAU,EAAA,4BAA4B,EAAU,CAChD,EAAW,EAAQ,KACnB,EAAS,EAAa,IAAI,EAAS,CACzC,GAAI,EAAQ,OAAO,EAEnB,IAAM,GAAU,SAAY,CAC1B,GAAM,CAAE,QAAS,MAAM,IAAI,EAAA,WAAW,EAAQ,CAAC,SAAS,CACxD,GAAI,CAAC,GAAQ,OAAO,GAAS,SAC3B,MAAU,MAAM,gDAAgD,CAElE,OAAO,EAAK,QAAQ,UAAW,GAAG,IAChC,CAEJ,EAAa,IAAI,EAAU,EAAO,CAClC,GAAI,CACF,OAAO,MAAM,QACN,EAAO,CAGd,MADA,EAAa,OAAO,EAAS,CACvB,GA0BV,eAAsB,EACpB,EACA,EAAwC,EAAE,CACzB,CACjB,IAAM,EAAU,EAAW,QAAQ,UAAW,GAAG,CAOjD,OANK,EAGD,EAAe,EAAQ,CAAS,EAG7B,EAAS,MADG,EAAsB,EAAU,CAC7B,EAAQ,CALrB,EAAsB,EAAU"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FileClient as e } from "../node_modules/@openhands/typescript-client/dist/client/file-client.js";
|
|
2
|
+
import "../node_modules/@openhands/typescript-client/dist/clients.js";
|
|
2
3
|
import { getAgentServerClientOptions as t } from "./agent-server-client-options.js";
|
|
3
4
|
//#region src/api/agent-server-home.ts
|
|
4
5
|
var n = /* @__PURE__ */ new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-server-home.js","names":[],"sources":["../../src/api/agent-server-home.ts"],"sourcesContent":["// @spec WUP-001 — Resolve relative working dirs against /api/file/home\nimport { FileClient } from \"@openhands/typescript-client/clients\";\nimport {\n getAgentServerClientOptions,\n type AgentServerClientOverrides,\n} from \"./agent-server-client-options\";\n\n/**\n * Cache the agent-server's home directory per host so we only round-trip\n * `/api/file/home` once per backend. The home dir is effectively static for\n * the lifetime of a running agent-server (it's `Path.home()` on the host),\n * so caching is safe and avoids hammering the endpoint on every upload.\n *\n * The cache holds `Promise<string>` rather than `string` so concurrent\n * callers share a single in-flight request.\n */\nconst homeDirCache = new Map<string, Promise<string>>();\n\nfunction isAbsolutePath(path: string): boolean {\n // Treat POSIX-style and Windows-style absolute paths as absolute.\n // The agent-server itself is POSIX on Linux/macOS and uses `\\\\` style\n // on Windows; we just need to know whether `Path(path).is_absolute()`\n // would return true on the server.\n //\n // Patterns covered:\n // POSIX absolute: /foo/bar\n // Windows drive: C:\\foo or C:/foo\n // Windows UNC: \\\\server\\share (starts with `\\`, matches `[/\\\\]`)\n return /^([/\\\\]|[a-zA-Z]:[/\\\\])/.test(path);\n}\n\n/**\n * Join a parent directory and a relative child segment with a forward slash,\n * collapsing any duplicate separators that result from the join.\n */\nfunction joinPath(parent: string, child: string): string {\n const left = parent.replace(/[/\\\\]+$/, \"\");\n const right = child.replace(/^[/\\\\]+/, \"\");\n return `${left}/${right}`;\n}\n\n/**\n * Fetch and cache the agent-server's home directory via `GET /api/file/home`.\n *\n * The result is the absolute path returned by `Path.home()` on the\n * agent-server host (e.g. `/Users/foo`, `/root`, or `C:\\\\Users\\\\Foo`). This\n * is the most reliable absolute, writable anchor the agent-server API\n * currently exposes — `/server_info` doesn't include the process CWD.\n *\n * @param overrides Same shape as `getAgentServerClientOptions` — lets cloud\n * sandboxes pass a `conversationUrl` + `sessionApiKey` so the lookup goes\n * to the per-conversation runtime rather than the bundled local backend.\n */\nexport async function getAgentServerHomeDir(\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const options = getAgentServerClientOptions(overrides);\n const cacheKey = options.host;\n const cached = homeDirCache.get(cacheKey);\n if (cached) return cached;\n\n const lookup = (async () => {\n const { home } = await new FileClient(options).getHome();\n if (!home || typeof home !== \"string\") {\n throw new Error(\"Agent server returned an empty home directory\");\n }\n return home.replace(/[/\\\\]+$/, \"\");\n })();\n\n homeDirCache.set(cacheKey, lookup);\n try {\n return await lookup;\n } catch (error) {\n // Don't cache failures — let the next call retry.\n homeDirCache.delete(cacheKey);\n throw error;\n }\n}\n\n/** Test-only helper. */\nexport function clearAgentServerHomeDirCache(): void {\n homeDirCache.clear();\n}\n\n/**\n * Resolve a (possibly relative) working dir to an absolute path the\n * agent-server's file APIs will accept.\n *\n * - If `workingDir` is already absolute, returns it unchanged.\n * - Otherwise prepends the agent-server's home dir (looked up via\n * `/api/file/home` and cached). This matches how the published binary\n * and Docker entrypoint expect to anchor relative working dirs: under\n * `~/workspace/project` rather than the filesystem root.\n *\n * Why this matters: the agent-server's `/api/file/upload` endpoint requires\n * an absolute path and `mkdir -p`s the parent. Naively prepending `/` to a\n * relative dir like `workspace/project/<hex>` produces `/workspace/...`,\n * which on macOS lives under the SIP-protected read-only root and fails\n * with `Errno 30: Read-only file system: '/workspace'`. Resolving against\n * `Path.home()` instead puts the path somewhere reliably writable.\n */\nexport async function resolveAbsoluteAgentServerPath(\n workingDir: string,\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const trimmed = workingDir.replace(/[/\\\\]+$/, \"\");\n if (!trimmed) {\n return getAgentServerHomeDir(overrides);\n }\n if (isAbsolutePath(trimmed)) return trimmed;\n\n const home = await getAgentServerHomeDir(overrides);\n return joinPath(home, trimmed);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-server-home.js","names":[],"sources":["../../src/api/agent-server-home.ts"],"sourcesContent":["// @spec WUP-001 — Resolve relative working dirs against /api/file/home\nimport { FileClient } from \"@openhands/typescript-client/clients\";\nimport {\n getAgentServerClientOptions,\n type AgentServerClientOverrides,\n} from \"./agent-server-client-options\";\n\n/**\n * Cache the agent-server's home directory per host so we only round-trip\n * `/api/file/home` once per backend. The home dir is effectively static for\n * the lifetime of a running agent-server (it's `Path.home()` on the host),\n * so caching is safe and avoids hammering the endpoint on every upload.\n *\n * The cache holds `Promise<string>` rather than `string` so concurrent\n * callers share a single in-flight request.\n */\nconst homeDirCache = new Map<string, Promise<string>>();\n\nfunction isAbsolutePath(path: string): boolean {\n // Treat POSIX-style and Windows-style absolute paths as absolute.\n // The agent-server itself is POSIX on Linux/macOS and uses `\\\\` style\n // on Windows; we just need to know whether `Path(path).is_absolute()`\n // would return true on the server.\n //\n // Patterns covered:\n // POSIX absolute: /foo/bar\n // Windows drive: C:\\foo or C:/foo\n // Windows UNC: \\\\server\\share (starts with `\\`, matches `[/\\\\]`)\n return /^([/\\\\]|[a-zA-Z]:[/\\\\])/.test(path);\n}\n\n/**\n * Join a parent directory and a relative child segment with a forward slash,\n * collapsing any duplicate separators that result from the join.\n */\nfunction joinPath(parent: string, child: string): string {\n const left = parent.replace(/[/\\\\]+$/, \"\");\n const right = child.replace(/^[/\\\\]+/, \"\");\n return `${left}/${right}`;\n}\n\n/**\n * Fetch and cache the agent-server's home directory via `GET /api/file/home`.\n *\n * The result is the absolute path returned by `Path.home()` on the\n * agent-server host (e.g. `/Users/foo`, `/root`, or `C:\\\\Users\\\\Foo`). This\n * is the most reliable absolute, writable anchor the agent-server API\n * currently exposes — `/server_info` doesn't include the process CWD.\n *\n * @param overrides Same shape as `getAgentServerClientOptions` — lets cloud\n * sandboxes pass a `conversationUrl` + `sessionApiKey` so the lookup goes\n * to the per-conversation runtime rather than the bundled local backend.\n */\nexport async function getAgentServerHomeDir(\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const options = getAgentServerClientOptions(overrides);\n const cacheKey = options.host;\n const cached = homeDirCache.get(cacheKey);\n if (cached) return cached;\n\n const lookup = (async () => {\n const { home } = await new FileClient(options).getHome();\n if (!home || typeof home !== \"string\") {\n throw new Error(\"Agent server returned an empty home directory\");\n }\n return home.replace(/[/\\\\]+$/, \"\");\n })();\n\n homeDirCache.set(cacheKey, lookup);\n try {\n return await lookup;\n } catch (error) {\n // Don't cache failures — let the next call retry.\n homeDirCache.delete(cacheKey);\n throw error;\n }\n}\n\n/** Test-only helper. */\nexport function clearAgentServerHomeDirCache(): void {\n homeDirCache.clear();\n}\n\n/**\n * Resolve a (possibly relative) working dir to an absolute path the\n * agent-server's file APIs will accept.\n *\n * - If `workingDir` is already absolute, returns it unchanged.\n * - Otherwise prepends the agent-server's home dir (looked up via\n * `/api/file/home` and cached). This matches how the published binary\n * and Docker entrypoint expect to anchor relative working dirs: under\n * `~/workspace/project` rather than the filesystem root.\n *\n * Why this matters: the agent-server's `/api/file/upload` endpoint requires\n * an absolute path and `mkdir -p`s the parent. Naively prepending `/` to a\n * relative dir like `workspace/project/<hex>` produces `/workspace/...`,\n * which on macOS lives under the SIP-protected read-only root and fails\n * with `Errno 30: Read-only file system: '/workspace'`. Resolving against\n * `Path.home()` instead puts the path somewhere reliably writable.\n */\nexport async function resolveAbsoluteAgentServerPath(\n workingDir: string,\n overrides: AgentServerClientOverrides = {},\n): Promise<string> {\n const trimmed = workingDir.replace(/[/\\\\]+$/, \"\");\n if (!trimmed) {\n return getAgentServerHomeDir(overrides);\n }\n if (isAbsolutePath(trimmed)) return trimmed;\n\n const home = await getAgentServerHomeDir(overrides);\n return joinPath(home, trimmed);\n}\n"],"mappings":";;;;AAgBA,IAAM,oBAAe,IAAI,KAA8B;AAEvD,SAAS,EAAe,GAAuB;AAU7C,QAAO,0BAA0B,KAAK,EAAK;;AAO7C,SAAS,EAAS,GAAgB,GAAuB;AAGvD,QAAO,GAFM,EAAO,QAAQ,WAAW,GAE7B,CAAK,GADD,EAAM,QAAQ,WAAW,GACrB;;AAepB,eAAsB,EACpB,IAAwC,EAAE,EACzB;CACjB,IAAM,IAAU,EAA4B,EAAU,EAChD,IAAW,EAAQ,MACnB,IAAS,EAAa,IAAI,EAAS;AACzC,KAAI,EAAQ,QAAO;CAEnB,IAAM,KAAU,YAAY;EAC1B,IAAM,EAAE,YAAS,MAAM,IAAI,EAAW,EAAQ,CAAC,SAAS;AACxD,MAAI,CAAC,KAAQ,OAAO,KAAS,SAC3B,OAAU,MAAM,gDAAgD;AAElE,SAAO,EAAK,QAAQ,WAAW,GAAG;KAChC;AAEJ,GAAa,IAAI,GAAU,EAAO;AAClC,KAAI;AACF,SAAO,MAAM;UACN,GAAO;AAGd,QADA,EAAa,OAAO,EAAS,EACvB;;;AA0BV,eAAsB,EACpB,GACA,IAAwC,EAAE,EACzB;CACjB,IAAM,IAAU,EAAW,QAAQ,WAAW,GAAG;AAOjD,QANK,IAGD,EAAe,EAAQ,GAAS,IAG7B,EAAS,MADG,EAAsB,EAAU,EAC7B,EAAQ,GALrB,EAAsB,EAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`./proxy.cjs`);var n=`/api/agent-profiles`;function r(){let t=e.getActiveBackend().backend;if(t.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return t}async function i(){return t.callCloudProxy({backend:r(),method:`GET`,path:n})}async function a(e){return t.callCloudProxy({backend:r(),method:`GET`,path:`${n}/${encodeURIComponent(e)}`})}async function o(e,i){return t.callCloudProxy({backend:r(),method:`POST`,path:`${n}/${encodeURIComponent(e)}`,body:i})}async function s(e){return t.callCloudProxy({backend:r(),method:`DELETE`,path:`${n}/${encodeURIComponent(e)}`})}async function c(e,i){return t.callCloudProxy({backend:r(),method:`POST`,path:`${n}/${encodeURIComponent(e)}/rename`,body:{new_name:i}})}async function l(e){return t.callCloudProxy({backend:r(),method:`POST`,path:`${n}/${encodeURIComponent(e)}/activate`,body:{}})}exports.activateCloudAgentProfile=l,exports.deleteCloudAgentProfile=s,exports.getCloudAgentProfile=a,exports.listCloudAgentProfiles=i,exports.renameCloudAgentProfile=c,exports.saveCloudAgentProfile=o;
|
|
2
|
+
//# sourceMappingURL=agent-profiles-service.api.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-profiles-service.api.cjs","names":[],"sources":["../../../src/api/cloud/agent-profiles-service.api.ts"],"sourcesContent":["import type {\n AgentProfileSaveInput,\n AgentProfileListResponse,\n AgentProfileDetailResponse,\n AgentProfileMutationResponse,\n ActivateAgentProfileResponse,\n} from \"@openhands/typescript-client\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * Cloud transport for the Agent Profiles surface. The cloud enterprise\n * app-server exposes the SAME `/api/agent-profiles` contract as the local\n * agent-server (paths + response shapes mirror `agent_profiles_router.py`),\n * but cloud calls authenticate with the backend's bearer token + `X-Org-Id`\n * and must go through {@link callCloudProxy} — not the direct\n * `AgentProfilesClient` (which speaks `X-Session-API-Key` to a local host).\n *\n * The org is resolved server-side from the auth session (`EFFECTIVE_ORG_ID`),\n * so — unlike org LLM profiles — no `{org_id}` path segment is needed here.\n *\n * Mirrors the pattern in `cloud/settings-service.api.ts`. Consumed by\n * `AgentProfilesService` on the cloud path.\n */\n\nconst BASE = \"/api/agent-profiles\";\n\nfunction activeCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud agent-profile call requires a cloud backend.\");\n }\n return active;\n}\n\nexport async function listCloudAgentProfiles(): Promise<AgentProfileListResponse> {\n return callCloudProxy<AgentProfileListResponse>({\n backend: activeCloudBackend(),\n method: \"GET\",\n path: BASE,\n });\n}\n\nexport async function getCloudAgentProfile(\n name: string,\n): Promise<AgentProfileDetailResponse> {\n return callCloudProxy<AgentProfileDetailResponse>({\n backend: activeCloudBackend(),\n method: \"GET\",\n path: `${BASE}/${encodeURIComponent(name)}`,\n });\n}\n\nexport async function saveCloudAgentProfile(\n name: string,\n profile: AgentProfileSaveInput,\n): Promise<AgentProfileMutationResponse> {\n return callCloudProxy<AgentProfileMutationResponse>({\n backend: activeCloudBackend(),\n method: \"POST\",\n path: `${BASE}/${encodeURIComponent(name)}`,\n body: profile,\n });\n}\n\nexport async function deleteCloudAgentProfile(\n name: string,\n): Promise<AgentProfileMutationResponse> {\n return callCloudProxy<AgentProfileMutationResponse>({\n backend: activeCloudBackend(),\n method: \"DELETE\",\n path: `${BASE}/${encodeURIComponent(name)}`,\n });\n}\n\nexport async function renameCloudAgentProfile(\n name: string,\n newName: string,\n): Promise<AgentProfileMutationResponse> {\n return callCloudProxy<AgentProfileMutationResponse>({\n backend: activeCloudBackend(),\n method: \"POST\",\n path: `${BASE}/${encodeURIComponent(name)}/rename`,\n body: { new_name: newName },\n });\n}\n\nexport async function activateCloudAgentProfile(\n profileId: string,\n): Promise<ActivateAgentProfileResponse> {\n return callCloudProxy<ActivateAgentProfileResponse>({\n backend: activeCloudBackend(),\n method: \"POST\",\n path: `${BASE}/${encodeURIComponent(profileId)}/activate`,\n body: {},\n });\n}\n"],"mappings":"iIA0BA,IAAM,EAAO,sBAEb,SAAS,GAA8B,CACrC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,qDAAqD,CAEvE,OAAO,EAGT,eAAsB,GAA4D,CAChF,OAAO,EAAA,eAAyC,CAC9C,QAAS,GAAoB,CAC7B,OAAQ,MACR,KAAM,EACP,CAAC,CAGJ,eAAsB,EACpB,EACqC,CACrC,OAAO,EAAA,eAA2C,CAChD,QAAS,GAAoB,CAC7B,OAAQ,MACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,GAC1C,CAAC,CAGJ,eAAsB,EACpB,EACA,EACuC,CACvC,OAAO,EAAA,eAA6C,CAClD,QAAS,GAAoB,CAC7B,OAAQ,OACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,GACzC,KAAM,EACP,CAAC,CAGJ,eAAsB,EACpB,EACuC,CACvC,OAAO,EAAA,eAA6C,CAClD,QAAS,GAAoB,CAC7B,OAAQ,SACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,GAC1C,CAAC,CAGJ,eAAsB,EACpB,EACA,EACuC,CACvC,OAAO,EAAA,eAA6C,CAClD,QAAS,GAAoB,CAC7B,OAAQ,OACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,CAAC,SAC1C,KAAM,CAAE,SAAU,EAAS,CAC5B,CAAC,CAGJ,eAAsB,EACpB,EACuC,CACvC,OAAO,EAAA,eAA6C,CAClD,QAAS,GAAoB,CAC7B,OAAQ,OACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAU,CAAC,WAC/C,KAAM,EAAE,CACT,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentProfileSaveInput, AgentProfileListResponse, AgentProfileDetailResponse, AgentProfileMutationResponse, ActivateAgentProfileResponse } from "@openhands/typescript-client";
|
|
2
|
+
export declare function listCloudAgentProfiles(): Promise<AgentProfileListResponse>;
|
|
3
|
+
export declare function getCloudAgentProfile(name: string): Promise<AgentProfileDetailResponse>;
|
|
4
|
+
export declare function saveCloudAgentProfile(name: string, profile: AgentProfileSaveInput): Promise<AgentProfileMutationResponse>;
|
|
5
|
+
export declare function deleteCloudAgentProfile(name: string): Promise<AgentProfileMutationResponse>;
|
|
6
|
+
export declare function renameCloudAgentProfile(name: string, newName: string): Promise<AgentProfileMutationResponse>;
|
|
7
|
+
export declare function activateCloudAgentProfile(profileId: string): Promise<ActivateAgentProfileResponse>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getActiveBackend as e } from "../backend-registry/active-store.js";
|
|
2
|
+
import { callCloudProxy as t } from "./proxy.js";
|
|
3
|
+
//#region src/api/cloud/agent-profiles-service.api.ts
|
|
4
|
+
var n = "/api/agent-profiles";
|
|
5
|
+
function r() {
|
|
6
|
+
let t = e().backend;
|
|
7
|
+
if (t.kind !== "cloud") throw Error("Cloud agent-profile call requires a cloud backend.");
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
async function i() {
|
|
11
|
+
return t({
|
|
12
|
+
backend: r(),
|
|
13
|
+
method: "GET",
|
|
14
|
+
path: n
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async function a(e) {
|
|
18
|
+
return t({
|
|
19
|
+
backend: r(),
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `${n}/${encodeURIComponent(e)}`
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async function o(e, i) {
|
|
25
|
+
return t({
|
|
26
|
+
backend: r(),
|
|
27
|
+
method: "POST",
|
|
28
|
+
path: `${n}/${encodeURIComponent(e)}`,
|
|
29
|
+
body: i
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function s(e) {
|
|
33
|
+
return t({
|
|
34
|
+
backend: r(),
|
|
35
|
+
method: "DELETE",
|
|
36
|
+
path: `${n}/${encodeURIComponent(e)}`
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async function c(e, i) {
|
|
40
|
+
return t({
|
|
41
|
+
backend: r(),
|
|
42
|
+
method: "POST",
|
|
43
|
+
path: `${n}/${encodeURIComponent(e)}/rename`,
|
|
44
|
+
body: { new_name: i }
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async function l(e) {
|
|
48
|
+
return t({
|
|
49
|
+
backend: r(),
|
|
50
|
+
method: "POST",
|
|
51
|
+
path: `${n}/${encodeURIComponent(e)}/activate`,
|
|
52
|
+
body: {}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { l as activateCloudAgentProfile, s as deleteCloudAgentProfile, a as getCloudAgentProfile, i as listCloudAgentProfiles, c as renameCloudAgentProfile, o as saveCloudAgentProfile };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=agent-profiles-service.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-profiles-service.api.js","names":[],"sources":["../../../src/api/cloud/agent-profiles-service.api.ts"],"sourcesContent":["import type {\n AgentProfileSaveInput,\n AgentProfileListResponse,\n AgentProfileDetailResponse,\n AgentProfileMutationResponse,\n ActivateAgentProfileResponse,\n} from \"@openhands/typescript-client\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * Cloud transport for the Agent Profiles surface. The cloud enterprise\n * app-server exposes the SAME `/api/agent-profiles` contract as the local\n * agent-server (paths + response shapes mirror `agent_profiles_router.py`),\n * but cloud calls authenticate with the backend's bearer token + `X-Org-Id`\n * and must go through {@link callCloudProxy} — not the direct\n * `AgentProfilesClient` (which speaks `X-Session-API-Key` to a local host).\n *\n * The org is resolved server-side from the auth session (`EFFECTIVE_ORG_ID`),\n * so — unlike org LLM profiles — no `{org_id}` path segment is needed here.\n *\n * Mirrors the pattern in `cloud/settings-service.api.ts`. Consumed by\n * `AgentProfilesService` on the cloud path.\n */\n\nconst BASE = \"/api/agent-profiles\";\n\nfunction activeCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud agent-profile call requires a cloud backend.\");\n }\n return active;\n}\n\nexport async function listCloudAgentProfiles(): Promise<AgentProfileListResponse> {\n return callCloudProxy<AgentProfileListResponse>({\n backend: activeCloudBackend(),\n method: \"GET\",\n path: BASE,\n });\n}\n\nexport async function getCloudAgentProfile(\n name: string,\n): Promise<AgentProfileDetailResponse> {\n return callCloudProxy<AgentProfileDetailResponse>({\n backend: activeCloudBackend(),\n method: \"GET\",\n path: `${BASE}/${encodeURIComponent(name)}`,\n });\n}\n\nexport async function saveCloudAgentProfile(\n name: string,\n profile: AgentProfileSaveInput,\n): Promise<AgentProfileMutationResponse> {\n return callCloudProxy<AgentProfileMutationResponse>({\n backend: activeCloudBackend(),\n method: \"POST\",\n path: `${BASE}/${encodeURIComponent(name)}`,\n body: profile,\n });\n}\n\nexport async function deleteCloudAgentProfile(\n name: string,\n): Promise<AgentProfileMutationResponse> {\n return callCloudProxy<AgentProfileMutationResponse>({\n backend: activeCloudBackend(),\n method: \"DELETE\",\n path: `${BASE}/${encodeURIComponent(name)}`,\n });\n}\n\nexport async function renameCloudAgentProfile(\n name: string,\n newName: string,\n): Promise<AgentProfileMutationResponse> {\n return callCloudProxy<AgentProfileMutationResponse>({\n backend: activeCloudBackend(),\n method: \"POST\",\n path: `${BASE}/${encodeURIComponent(name)}/rename`,\n body: { new_name: newName },\n });\n}\n\nexport async function activateCloudAgentProfile(\n profileId: string,\n): Promise<ActivateAgentProfileResponse> {\n return callCloudProxy<ActivateAgentProfileResponse>({\n backend: activeCloudBackend(),\n method: \"POST\",\n path: `${BASE}/${encodeURIComponent(profileId)}/activate`,\n body: {},\n });\n}\n"],"mappings":";;;AA0BA,IAAM,IAAO;AAEb,SAAS,IAA8B;CACrC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,qDAAqD;AAEvE,QAAO;;AAGT,eAAsB,IAA4D;AAChF,QAAO,EAAyC;EAC9C,SAAS,GAAoB;EAC7B,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,eAAsB,EACpB,GACqC;AACrC,QAAO,EAA2C;EAChD,SAAS,GAAoB;EAC7B,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK;EAC1C,CAAC;;AAGJ,eAAsB,EACpB,GACA,GACuC;AACvC,QAAO,EAA6C;EAClD,SAAS,GAAoB;EAC7B,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK;EACzC,MAAM;EACP,CAAC;;AAGJ,eAAsB,EACpB,GACuC;AACvC,QAAO,EAA6C;EAClD,SAAS,GAAoB;EAC7B,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK;EAC1C,CAAC;;AAGJ,eAAsB,EACpB,GACA,GACuC;AACvC,QAAO,EAA6C;EAClD,SAAS,GAAoB;EAC7B,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,CAAC;EAC1C,MAAM,EAAE,UAAU,GAAS;EAC5B,CAAC;;AAGJ,eAAsB,EACpB,GACuC;AACvC,QAAO,EAA6C;EAClD,SAAS,GAAoB;EAC7B,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAU,CAAC;EAC/C,MAAM,EAAE;EACT,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`../../node_modules/axios/lib/axios.cjs`),n=require(`./proxy.cjs`);function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(t){if(t)return t;let n=e.getActiveBackend().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n.callCloudProxy({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(e){let r=i(e);try{return{orgId:(await n.callCloudProxy({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(e){if(t.default.isAxiosError(e)&&e.response?.status===400)return{orgId:null,isLegacyKey:!0};throw e}}async function s(e,t){let r=await n.callCloudProxy({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`../../node_modules/axios/lib/axios.cjs`),n=require(`./proxy.cjs`);function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(t){if(t)return t;let n=e.getActiveBackend().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n.callCloudProxy({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(e){let r=i(e);try{return{orgId:(await n.callCloudProxy({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(e){if(t.default.isAxiosError(e)&&e.response?.status===400)return{orgId:null,isLegacyKey:!0};throw e}}async function s(e,t){let r=await n.callCloudProxy({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id??``,role:r?.role??null,permissions:Array.isArray(r?.permissions)?r.permissions:null}}exports.getCloudOrganizationMe=s,exports.getCloudOrganizations=a,exports.getCurrentCloudApiKey=o;
|
|
2
2
|
//# sourceMappingURL=organization-service.api.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-service.api.cjs","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Calls the cloud API directly with the backend's bearer token.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{
|
|
1
|
+
{"version":3,"file":"organization-service.api.cjs","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Calls the cloud API directly with the backend's bearer token.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n *\n * `role` is the caller's role in the org (`owner` | `admin` | `member`, or\n * `null` if the upstream omits it). `permissions` is the server-defined\n * permission set for that role (e.g. `edit_org_settings`); it is `null` on\n * older app-servers that don't return it, so callers fall back to the role.\n * See `useCanManageOrgProfiles`.\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{\n orgId: string;\n userId: string;\n role: string | null;\n permissions?: string[] | null;\n}> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<{\n org_id: string;\n user_id: string;\n role?: string;\n permissions?: string[];\n }>({\n backend: target,\n method: \"GET\",\n path: `/api/organizations/${encodeURIComponent(orgId)}/me`,\n });\n return {\n orgId: data?.org_id ?? orgId,\n userId: data?.user_id ?? \"\",\n role: data?.role ?? null,\n // `null` when the field is absent (older app-server) so callers can fall\n // back to a role check; a present array is the server's source of truth.\n permissions: Array.isArray(data?.permissions) ? data.permissions : null,\n };\n}\n"],"mappings":"qLAeA,SAAS,EACP,EACqB,CACrB,MAAO,CACL,MAAO,GAAM,OAAS,EAAE,CACxB,aAAc,GAAM,gBAAkB,KACvC,CAGH,SAAS,EAAe,EAA4B,CAClD,GAAI,EAAS,OAAO,EACpB,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MACR,6EACD,CAEH,OAAO,EAUT,eAAsB,EACpB,EAC8B,CAO9B,OAAO,EAAgB,MALJ,EAAA,eAA2C,CAC5D,QAFa,EAAe,EAEnB,CACT,OAAQ,MACR,KAAM,qBACP,CAAC,CAC0B,CAc9B,eAAsB,EACpB,EACyD,CACzD,IAAM,EAAS,EAAe,EAAQ,CACtC,GAAI,CAMF,MAAO,CAAE,OAAO,MALG,EAAA,eAAoC,CACrD,QAAS,EACT,OAAQ,MACR,KAAM,oBACP,CAAC,GACoB,QAAU,KAAM,YAAa,GAAO,OACnD,EAAG,CACV,GAAI,EAAA,QAAM,aAAa,EAAE,EAAI,EAAE,UAAU,SAAW,IAClD,MAAO,CAAE,MAAO,KAAM,YAAa,GAAM,CAE3C,MAAM,GAiBV,eAAsB,EACpB,EACA,EAMC,CAED,IAAM,EAAO,MAAM,EAAA,eAKhB,CACD,QAPa,EAAe,EAOnB,CACT,OAAQ,MACR,KAAM,sBAAsB,mBAAmB,EAAM,CAAC,KACvD,CAAC,CACF,MAAO,CACL,MAAO,GAAM,QAAU,EACvB,OAAQ,GAAM,SAAW,GACzB,KAAM,GAAM,MAAQ,KAGpB,YAAa,MAAM,QAAQ,GAAM,YAAY,CAAG,EAAK,YAAc,KACpE"}
|
|
@@ -33,9 +33,17 @@ export declare function getCurrentCloudApiKey(backend?: Backend): Promise<{
|
|
|
33
33
|
* whether `orgId` is the user's personal workspace — that's the cloud
|
|
34
34
|
* contract (the auto-generated personal-workspace org has the same id as
|
|
35
35
|
* the user).
|
|
36
|
+
*
|
|
37
|
+
* `role` is the caller's role in the org (`owner` | `admin` | `member`, or
|
|
38
|
+
* `null` if the upstream omits it). `permissions` is the server-defined
|
|
39
|
+
* permission set for that role (e.g. `edit_org_settings`); it is `null` on
|
|
40
|
+
* older app-servers that don't return it, so callers fall back to the role.
|
|
41
|
+
* See `useCanManageOrgProfiles`.
|
|
36
42
|
*/
|
|
37
43
|
export declare function getCloudOrganizationMe(orgId: string, backend?: Backend): Promise<{
|
|
38
44
|
orgId: string;
|
|
39
45
|
userId: string;
|
|
46
|
+
role: string | null;
|
|
47
|
+
permissions?: string[] | null;
|
|
40
48
|
}>;
|
|
41
49
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-service.api.js","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Calls the cloud API directly with the backend's bearer token.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{
|
|
1
|
+
{"version":3,"file":"organization-service.api.js","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Calls the cloud API directly with the backend's bearer token.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n *\n * `role` is the caller's role in the org (`owner` | `admin` | `member`, or\n * `null` if the upstream omits it). `permissions` is the server-defined\n * permission set for that role (e.g. `edit_org_settings`); it is `null` on\n * older app-servers that don't return it, so callers fall back to the role.\n * See `useCanManageOrgProfiles`.\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{\n orgId: string;\n userId: string;\n role: string | null;\n permissions?: string[] | null;\n}> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<{\n org_id: string;\n user_id: string;\n role?: string;\n permissions?: string[];\n }>({\n backend: target,\n method: \"GET\",\n path: `/api/organizations/${encodeURIComponent(orgId)}/me`,\n });\n return {\n orgId: data?.org_id ?? orgId,\n userId: data?.user_id ?? \"\",\n role: data?.role ?? null,\n // `null` when the field is absent (older app-server) so callers can fall\n // back to a role check; a present array is the server's source of truth.\n permissions: Array.isArray(data?.permissions) ? data.permissions : null,\n };\n}\n"],"mappings":";;;;AAeA,SAAS,EACP,GACqB;AACrB,QAAO;EACL,OAAO,GAAM,SAAS,EAAE;EACxB,cAAc,GAAM,kBAAkB;EACvC;;AAGH,SAAS,EAAe,GAA4B;AAClD,KAAI,EAAS,QAAO;CACpB,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MACR,6EACD;AAEH,QAAO;;AAUT,eAAsB,EACpB,GAC8B;AAO9B,QAAO,EAAgB,MALJ,EAA2C;EAC5D,SAFa,EAAe,EAEnB;EACT,QAAQ;EACR,MAAM;EACP,CAAC,CAC0B;;AAc9B,eAAsB,EACpB,GACyD;CACzD,IAAM,IAAS,EAAe,EAAQ;AACtC,KAAI;AAMF,SAAO;GAAE,QAAO,MALG,EAAoC;IACrD,SAAS;IACT,QAAQ;IACR,MAAM;IACP,CAAC,GACoB,UAAU;GAAM,aAAa;GAAO;UACnD,GAAG;AACV,MAAI,EAAM,aAAa,EAAE,IAAI,EAAE,UAAU,WAAW,IAClD,QAAO;GAAE,OAAO;GAAM,aAAa;GAAM;AAE3C,QAAM;;;AAiBV,eAAsB,EACpB,GACA,GAMC;CAED,IAAM,IAAO,MAAM,EAKhB;EACD,SAPa,EAAe,EAOnB;EACT,QAAQ;EACR,MAAM,sBAAsB,mBAAmB,EAAM,CAAC;EACvD,CAAC;AACF,QAAO;EACL,OAAO,GAAM,UAAU;EACvB,QAAQ,GAAM,WAAW;EACzB,MAAM,GAAM,QAAQ;EAGpB,aAAa,MAAM,QAAQ,GAAM,YAAY,GAAG,EAAK,cAAc;EACpE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`./proxy.cjs`);var n=`/api/v1/settings/profiles`;function r(){let{backend:t,orgId:r}=e.getActiveBackend();if(t.kind!==`cloud`)throw Error(`Cloud profiles call requires a cloud backend.`);return{backend:t,base:r?`/api/organizations/${encodeURIComponent(r)}/profiles`:n}}async function i(){let{backend:e,base:n}=r();return t.callCloudProxy({backend:e,method:`GET`,path:n})}async function a(e){let{backend:n,base:i}=r(),a=await t.callCloudProxy({backend:n,method:`GET`,path:`${i}/${encodeURIComponent(e)}`});return{name:a.name,config:a.config??a.llm??{},api_key_set:a.api_key_set??!1}}async function o(e,n){let{backend:i,base:a}=r();return t.callCloudProxy({backend:i,method:`POST`,path:`${a}/${encodeURIComponent(e)}`,body:n})}async function s(e){let{backend:n,base:i}=r();return t.callCloudProxy({backend:n,method:`DELETE`,path:`${i}/${encodeURIComponent(e)}`})}async function c(e,n){let{backend:i,base:a}=r();return t.callCloudProxy({backend:i,method:`POST`,path:`${a}/${encodeURIComponent(e)}/rename`,body:{new_name:n}})}async function l(e){let{backend:n,base:i}=r(),a=await t.callCloudProxy({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}/activate`,body:{}});return{name:a.name,message:a.message,llm_applied:a.model!=null||a.llm!=null}}exports.activateCloudProfile=l,exports.deleteCloudProfile=s,exports.fetchCloudProfile=a,exports.fetchCloudProfiles=i,exports.renameCloudProfile=c,exports.saveCloudProfile=o;
|
|
2
|
+
//# sourceMappingURL=profiles-service.api.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles-service.api.cjs","names":[],"sources":["../../../src/api/cloud/profiles-service.api.ts"],"sourcesContent":["import type {\n ActivateProfileResponse,\n ProfileDetailResponse,\n ProfileListResponse,\n ProfileMutationResponse,\n SaveProfileRequest,\n} from \"@openhands/typescript-client\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * Cloud LLM-profile service.\n *\n * Profile CRUD is routed to the org-scoped endpoints\n * `/api/organizations/{orgId}/profiles`, which enforce `EDIT_ORG_SETTINGS`\n * server-side — so a member's mutation is rejected with 403 even on a direct\n * API call, not just hidden in the UI. When the active cloud backend has no org\n * bound (legacy API keys), we fall back to the ungated per-user settings route\n * `/api/v1/settings/profiles`, where there is no org role to enforce against.\n *\n * The two routes share shapes except `get` (org returns `llm`, settings returns\n * `config`) and `activate` (org returns `llm`, settings returns `model`); both\n * are normalized to the SDK profile types below. Neither route exposes secrets.\n */\n\nconst SETTINGS_PROFILES_PATH = \"/api/v1/settings/profiles\";\n\n/**\n * Resolve the backend + base path for the active cloud backend's profiles:\n * the org-gated route when an org is bound, else the per-user settings route.\n */\nfunction cloudProfilesTarget(): { backend: Backend; base: string } {\n const { backend, orgId } = getActiveBackend();\n if (backend.kind !== \"cloud\") {\n throw new Error(\"Cloud profiles call requires a cloud backend.\");\n }\n return {\n backend,\n base: orgId\n ? `/api/organizations/${encodeURIComponent(orgId)}/profiles`\n : SETTINGS_PROFILES_PATH,\n };\n}\n\nexport async function fetchCloudProfiles(): Promise<ProfileListResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileListResponse>({\n backend,\n method: \"GET\",\n path: base,\n });\n}\n\nexport async function fetchCloudProfile(\n name: string,\n): Promise<ProfileDetailResponse> {\n const { backend, base } = cloudProfilesTarget();\n // Org returns `{ name, llm }`; settings returns `{ name, config, api_key_set }`.\n // Normalize to the SDK detail shape. Neither route exposes the key, and the\n // GUI never reads the detail's `api_key_set` (only list-item `api_key_set`).\n const result = await callCloudProxy<{\n name: string;\n config?: Record<string, unknown>;\n llm?: Record<string, unknown>;\n api_key_set?: boolean;\n }>({\n backend,\n method: \"GET\",\n path: `${base}/${encodeURIComponent(name)}`,\n });\n return {\n name: result.name,\n config: result.config ?? result.llm ?? {},\n api_key_set: result.api_key_set ?? false,\n };\n}\n\nexport async function saveCloudProfile(\n name: string,\n request: SaveProfileRequest,\n): Promise<ProfileMutationResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileMutationResponse>({\n backend,\n method: \"POST\",\n path: `${base}/${encodeURIComponent(name)}`,\n body: request,\n });\n}\n\nexport async function deleteCloudProfile(\n name: string,\n): Promise<ProfileMutationResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileMutationResponse>({\n backend,\n method: \"DELETE\",\n path: `${base}/${encodeURIComponent(name)}`,\n });\n}\n\nexport async function renameCloudProfile(\n name: string,\n newName: string,\n): Promise<ProfileMutationResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileMutationResponse>({\n backend,\n method: \"POST\",\n path: `${base}/${encodeURIComponent(name)}/rename`,\n body: { new_name: newName },\n });\n}\n\nexport async function activateCloudProfile(\n name: string,\n): Promise<ActivateProfileResponse> {\n const { backend, base } = cloudProfilesTarget();\n // Org returns `{ name, message, llm }`; settings returns `{ name, message,\n // model }`. The SDK type carries `llm_applied`; derive it from whichever the\n // route provided (consumers only read name/message — the hook just\n // invalidates caches).\n const result = await callCloudProxy<{\n name: string;\n message: string;\n model?: string | null;\n llm?: Record<string, unknown> | null;\n }>({\n backend,\n method: \"POST\",\n path: `${base}/${encodeURIComponent(name)}/activate`,\n body: {},\n });\n return {\n name: result.name,\n message: result.message,\n llm_applied: result.model != null || result.llm != null,\n };\n}\n"],"mappings":"iIA0BA,IAAM,EAAyB,4BAM/B,SAAS,GAA0D,CACjE,GAAM,CAAE,UAAS,SAAU,EAAA,kBAAkB,CAC7C,GAAI,EAAQ,OAAS,QACnB,MAAU,MAAM,gDAAgD,CAElE,MAAO,CACL,UACA,KAAM,EACF,sBAAsB,mBAAmB,EAAM,CAAC,WAChD,EACL,CAGH,eAAsB,GAAmD,CACvE,GAAM,CAAE,UAAS,QAAS,GAAqB,CAC/C,OAAO,EAAA,eAAoC,CACzC,UACA,OAAQ,MACR,KAAM,EACP,CAAC,CAGJ,eAAsB,EACpB,EACgC,CAChC,GAAM,CAAE,UAAS,QAAS,GAAqB,CAIzC,EAAS,MAAM,EAAA,eAKlB,CACD,UACA,OAAQ,MACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,GAC1C,CAAC,CACF,MAAO,CACL,KAAM,EAAO,KACb,OAAQ,EAAO,QAAU,EAAO,KAAO,EAAE,CACzC,YAAa,EAAO,aAAe,GACpC,CAGH,eAAsB,EACpB,EACA,EACkC,CAClC,GAAM,CAAE,UAAS,QAAS,GAAqB,CAC/C,OAAO,EAAA,eAAwC,CAC7C,UACA,OAAQ,OACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,GACzC,KAAM,EACP,CAAC,CAGJ,eAAsB,EACpB,EACkC,CAClC,GAAM,CAAE,UAAS,QAAS,GAAqB,CAC/C,OAAO,EAAA,eAAwC,CAC7C,UACA,OAAQ,SACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,GAC1C,CAAC,CAGJ,eAAsB,EACpB,EACA,EACkC,CAClC,GAAM,CAAE,UAAS,QAAS,GAAqB,CAC/C,OAAO,EAAA,eAAwC,CAC7C,UACA,OAAQ,OACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,CAAC,SAC1C,KAAM,CAAE,SAAU,EAAS,CAC5B,CAAC,CAGJ,eAAsB,EACpB,EACkC,CAClC,GAAM,CAAE,UAAS,QAAS,GAAqB,CAKzC,EAAS,MAAM,EAAA,eAKlB,CACD,UACA,OAAQ,OACR,KAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,CAAC,WAC1C,KAAM,EAAE,CACT,CAAC,CACF,MAAO,CACL,KAAM,EAAO,KACb,QAAS,EAAO,QAChB,YAAa,EAAO,OAAS,MAAQ,EAAO,KAAO,KACpD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ActivateProfileResponse, ProfileDetailResponse, ProfileListResponse, ProfileMutationResponse, SaveProfileRequest } from "@openhands/typescript-client";
|
|
2
|
+
export declare function fetchCloudProfiles(): Promise<ProfileListResponse>;
|
|
3
|
+
export declare function fetchCloudProfile(name: string): Promise<ProfileDetailResponse>;
|
|
4
|
+
export declare function saveCloudProfile(name: string, request: SaveProfileRequest): Promise<ProfileMutationResponse>;
|
|
5
|
+
export declare function deleteCloudProfile(name: string): Promise<ProfileMutationResponse>;
|
|
6
|
+
export declare function renameCloudProfile(name: string, newName: string): Promise<ProfileMutationResponse>;
|
|
7
|
+
export declare function activateCloudProfile(name: string): Promise<ActivateProfileResponse>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { getActiveBackend as e } from "../backend-registry/active-store.js";
|
|
2
|
+
import { callCloudProxy as t } from "./proxy.js";
|
|
3
|
+
//#region src/api/cloud/profiles-service.api.ts
|
|
4
|
+
var n = "/api/v1/settings/profiles";
|
|
5
|
+
function r() {
|
|
6
|
+
let { backend: t, orgId: r } = e();
|
|
7
|
+
if (t.kind !== "cloud") throw Error("Cloud profiles call requires a cloud backend.");
|
|
8
|
+
return {
|
|
9
|
+
backend: t,
|
|
10
|
+
base: r ? `/api/organizations/${encodeURIComponent(r)}/profiles` : n
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
async function i() {
|
|
14
|
+
let { backend: e, base: n } = r();
|
|
15
|
+
return t({
|
|
16
|
+
backend: e,
|
|
17
|
+
method: "GET",
|
|
18
|
+
path: n
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function a(e) {
|
|
22
|
+
let { backend: n, base: i } = r(), a = await t({
|
|
23
|
+
backend: n,
|
|
24
|
+
method: "GET",
|
|
25
|
+
path: `${i}/${encodeURIComponent(e)}`
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
name: a.name,
|
|
29
|
+
config: a.config ?? a.llm ?? {},
|
|
30
|
+
api_key_set: a.api_key_set ?? !1
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function o(e, n) {
|
|
34
|
+
let { backend: i, base: a } = r();
|
|
35
|
+
return t({
|
|
36
|
+
backend: i,
|
|
37
|
+
method: "POST",
|
|
38
|
+
path: `${a}/${encodeURIComponent(e)}`,
|
|
39
|
+
body: n
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async function s(e) {
|
|
43
|
+
let { backend: n, base: i } = r();
|
|
44
|
+
return t({
|
|
45
|
+
backend: n,
|
|
46
|
+
method: "DELETE",
|
|
47
|
+
path: `${i}/${encodeURIComponent(e)}`
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async function c(e, n) {
|
|
51
|
+
let { backend: i, base: a } = r();
|
|
52
|
+
return t({
|
|
53
|
+
backend: i,
|
|
54
|
+
method: "POST",
|
|
55
|
+
path: `${a}/${encodeURIComponent(e)}/rename`,
|
|
56
|
+
body: { new_name: n }
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
async function l(e) {
|
|
60
|
+
let { backend: n, base: i } = r(), a = await t({
|
|
61
|
+
backend: n,
|
|
62
|
+
method: "POST",
|
|
63
|
+
path: `${i}/${encodeURIComponent(e)}/activate`,
|
|
64
|
+
body: {}
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
name: a.name,
|
|
68
|
+
message: a.message,
|
|
69
|
+
llm_applied: a.model != null || a.llm != null
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { l as activateCloudProfile, s as deleteCloudProfile, a as fetchCloudProfile, i as fetchCloudProfiles, c as renameCloudProfile, o as saveCloudProfile };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=profiles-service.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles-service.api.js","names":[],"sources":["../../../src/api/cloud/profiles-service.api.ts"],"sourcesContent":["import type {\n ActivateProfileResponse,\n ProfileDetailResponse,\n ProfileListResponse,\n ProfileMutationResponse,\n SaveProfileRequest,\n} from \"@openhands/typescript-client\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * Cloud LLM-profile service.\n *\n * Profile CRUD is routed to the org-scoped endpoints\n * `/api/organizations/{orgId}/profiles`, which enforce `EDIT_ORG_SETTINGS`\n * server-side — so a member's mutation is rejected with 403 even on a direct\n * API call, not just hidden in the UI. When the active cloud backend has no org\n * bound (legacy API keys), we fall back to the ungated per-user settings route\n * `/api/v1/settings/profiles`, where there is no org role to enforce against.\n *\n * The two routes share shapes except `get` (org returns `llm`, settings returns\n * `config`) and `activate` (org returns `llm`, settings returns `model`); both\n * are normalized to the SDK profile types below. Neither route exposes secrets.\n */\n\nconst SETTINGS_PROFILES_PATH = \"/api/v1/settings/profiles\";\n\n/**\n * Resolve the backend + base path for the active cloud backend's profiles:\n * the org-gated route when an org is bound, else the per-user settings route.\n */\nfunction cloudProfilesTarget(): { backend: Backend; base: string } {\n const { backend, orgId } = getActiveBackend();\n if (backend.kind !== \"cloud\") {\n throw new Error(\"Cloud profiles call requires a cloud backend.\");\n }\n return {\n backend,\n base: orgId\n ? `/api/organizations/${encodeURIComponent(orgId)}/profiles`\n : SETTINGS_PROFILES_PATH,\n };\n}\n\nexport async function fetchCloudProfiles(): Promise<ProfileListResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileListResponse>({\n backend,\n method: \"GET\",\n path: base,\n });\n}\n\nexport async function fetchCloudProfile(\n name: string,\n): Promise<ProfileDetailResponse> {\n const { backend, base } = cloudProfilesTarget();\n // Org returns `{ name, llm }`; settings returns `{ name, config, api_key_set }`.\n // Normalize to the SDK detail shape. Neither route exposes the key, and the\n // GUI never reads the detail's `api_key_set` (only list-item `api_key_set`).\n const result = await callCloudProxy<{\n name: string;\n config?: Record<string, unknown>;\n llm?: Record<string, unknown>;\n api_key_set?: boolean;\n }>({\n backend,\n method: \"GET\",\n path: `${base}/${encodeURIComponent(name)}`,\n });\n return {\n name: result.name,\n config: result.config ?? result.llm ?? {},\n api_key_set: result.api_key_set ?? false,\n };\n}\n\nexport async function saveCloudProfile(\n name: string,\n request: SaveProfileRequest,\n): Promise<ProfileMutationResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileMutationResponse>({\n backend,\n method: \"POST\",\n path: `${base}/${encodeURIComponent(name)}`,\n body: request,\n });\n}\n\nexport async function deleteCloudProfile(\n name: string,\n): Promise<ProfileMutationResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileMutationResponse>({\n backend,\n method: \"DELETE\",\n path: `${base}/${encodeURIComponent(name)}`,\n });\n}\n\nexport async function renameCloudProfile(\n name: string,\n newName: string,\n): Promise<ProfileMutationResponse> {\n const { backend, base } = cloudProfilesTarget();\n return callCloudProxy<ProfileMutationResponse>({\n backend,\n method: \"POST\",\n path: `${base}/${encodeURIComponent(name)}/rename`,\n body: { new_name: newName },\n });\n}\n\nexport async function activateCloudProfile(\n name: string,\n): Promise<ActivateProfileResponse> {\n const { backend, base } = cloudProfilesTarget();\n // Org returns `{ name, message, llm }`; settings returns `{ name, message,\n // model }`. The SDK type carries `llm_applied`; derive it from whichever the\n // route provided (consumers only read name/message — the hook just\n // invalidates caches).\n const result = await callCloudProxy<{\n name: string;\n message: string;\n model?: string | null;\n llm?: Record<string, unknown> | null;\n }>({\n backend,\n method: \"POST\",\n path: `${base}/${encodeURIComponent(name)}/activate`,\n body: {},\n });\n return {\n name: result.name,\n message: result.message,\n llm_applied: result.model != null || result.llm != null,\n };\n}\n"],"mappings":";;;AA0BA,IAAM,IAAyB;AAM/B,SAAS,IAA0D;CACjE,IAAM,EAAE,YAAS,aAAU,GAAkB;AAC7C,KAAI,EAAQ,SAAS,QACnB,OAAU,MAAM,gDAAgD;AAElE,QAAO;EACL;EACA,MAAM,IACF,sBAAsB,mBAAmB,EAAM,CAAC,aAChD;EACL;;AAGH,eAAsB,IAAmD;CACvE,IAAM,EAAE,YAAS,YAAS,GAAqB;AAC/C,QAAO,EAAoC;EACzC;EACA,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,eAAsB,EACpB,GACgC;CAChC,IAAM,EAAE,YAAS,YAAS,GAAqB,EAIzC,IAAS,MAAM,EAKlB;EACD;EACA,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK;EAC1C,CAAC;AACF,QAAO;EACL,MAAM,EAAO;EACb,QAAQ,EAAO,UAAU,EAAO,OAAO,EAAE;EACzC,aAAa,EAAO,eAAe;EACpC;;AAGH,eAAsB,EACpB,GACA,GACkC;CAClC,IAAM,EAAE,YAAS,YAAS,GAAqB;AAC/C,QAAO,EAAwC;EAC7C;EACA,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK;EACzC,MAAM;EACP,CAAC;;AAGJ,eAAsB,EACpB,GACkC;CAClC,IAAM,EAAE,YAAS,YAAS,GAAqB;AAC/C,QAAO,EAAwC;EAC7C;EACA,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK;EAC1C,CAAC;;AAGJ,eAAsB,EACpB,GACA,GACkC;CAClC,IAAM,EAAE,YAAS,YAAS,GAAqB;AAC/C,QAAO,EAAwC;EAC7C;EACA,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,CAAC;EAC1C,MAAM,EAAE,UAAU,GAAS;EAC5B,CAAC;;AAGJ,eAAsB,EACpB,GACkC;CAClC,IAAM,EAAE,YAAS,YAAS,GAAqB,EAKzC,IAAS,MAAM,EAKlB;EACD;EACA,QAAQ;EACR,MAAM,GAAG,EAAK,GAAG,mBAAmB,EAAK,CAAC;EAC1C,MAAM,EAAE;EACT,CAAC;AACF,QAAO;EACL,MAAM,EAAO;EACb,SAAS,EAAO;EAChB,aAAa,EAAO,SAAS,QAAQ,EAAO,OAAO;EACpD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`./proxy.cjs`);function n(){let t=e.getActiveBackend().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function r(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),t}function i(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function a(){let e=await t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:r(e),conversation_settings:i(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function o(e){let r=n(),i={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(i.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(i.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,n]of Object.entries(e.app_preferences))n!==void 0&&(i[t]=n);await t.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/settings`,body:i})}async function s(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function c(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}exports.fetchCloudConversationSettingsSchema=c,exports.fetchCloudSettings=a,exports.fetchCloudSettingsSchema=s,exports.saveCloudSettings=o;
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`./proxy.cjs`);function n(){let t=e.getActiveBackend().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function r(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),e.mcp_config&&Object.keys(e.mcp_config).length>0&&(t.mcp_config=e.mcp_config),t}function i(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function a(){let e=await t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:r(e),conversation_settings:i(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function o(e){let r=n(),i={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(i.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(i.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,n]of Object.entries(e.app_preferences))n!==void 0&&(i[t]=n);await t.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/settings`,body:i})}async function s(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function c(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}exports.fetchCloudConversationSettingsSchema=c,exports.fetchCloudSettings=a,exports.fetchCloudSettingsSchema=s,exports.saveCloudSettings=o;
|
|
2
2
|
//# sourceMappingURL=settings-service.api.cjs.map
|