@openhands/agent-canvas 1.7.2 → 1.9.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-DP5rcauH.js → Trans-Bwpzk1wT.js} +1 -1
- package/build/assets/{acp-providers-BHKZvEm5.js → acp-providers-C921BlYB.js} +1 -1
- package/build/assets/active-backend-context-BiwzkzDy.js +2 -0
- package/build/assets/agent-context-settings-DXNT_dcw.js +1 -0
- package/build/assets/agent-profiles-settings-BymJf3EP.js +1 -0
- package/build/assets/agent-server-conversation-service.api-CYSWw-2g.js +41 -0
- package/build/assets/agent-settings-BjgQQe-_.js +1 -0
- package/build/assets/{agent-settings-BIOsUglV.js → agent-settings-WzqXk6B4.js} +2 -2
- package/build/assets/{alert-banner-C1nzoXBC.js → alert-banner-DR8EVyZM.js} +1 -1
- package/build/assets/api-error-message-e16L1kwH.js +1 -0
- package/build/assets/api-key-entry-screen-DI0I04O3.js +1 -0
- package/build/assets/app-settings-DGistSFV.js +1 -0
- package/build/assets/automation-C_eCrGyP.js +1 -0
- package/build/assets/automation-detail-DY6x2FW1.js +2 -0
- package/build/assets/automation-export-C09f-Lua.js +2 -0
- package/build/assets/automation-setup-route-CqKp0717.js +1 -0
- package/build/assets/automations-list-CqWJ7qXW.js +1 -0
- package/build/assets/{back-nav-button-Be_L157B.js → back-nav-button-D4ngzpSh.js} +1 -1
- package/build/assets/backend-form-modal-B8D5hBzK.js +1 -0
- package/build/assets/{backend-synced-settings-badge-BNpEylNP.js → backend-synced-settings-badge-BnzI8Ysj.js} +1 -1
- package/build/assets/{badge-DwgrwohM.js → badge-1Mf1iPcX.js} +1 -1
- package/build/assets/{base-modal-CSHhJTSr.js → base-modal-BBuy0WQQ.js} +1 -1
- package/build/assets/{brand-button-CQO8oqVo.js → brand-button-DGN6Y9o6.js} +1 -1
- package/build/assets/browser-D_ekTlTS.js +6 -0
- package/build/assets/{browser-tab-CEApjoEV.js → browser-tab-D4a4Ou_w.js} +1 -1
- package/build/assets/{chat-send-button-D4614wUz.js → chat-send-button-CgbcjD97.js} +1 -1
- package/build/assets/check-CPLXgluF.js +1 -0
- package/build/assets/chevron-down-CP4QHvyc.js +1 -0
- package/build/assets/circle-check-Dpy2_xSI.js +1 -0
- package/build/assets/{circle-plus-check-toggle-E3Ecb_gg.js → circle-plus-check-toggle-yTAS-nX3.js} +1 -1
- package/build/assets/cloud-funnel-analytics-CEOl5Gxr.js +1 -0
- package/build/assets/{combobox-caret-C8_eGdp2.js → combobox-caret-Bd2yySnF.js} +1 -1
- package/build/assets/command-menu-Bj6X4ckE.js +1 -0
- package/build/assets/condenser-settings-EAXQNR2E.js +1 -0
- package/build/assets/{confirmation-modal-gZtbojCm.js → confirmation-modal-NCUPr2-O.js} +1 -1
- package/build/assets/{context-menu-list-item-BTHGFhIx.js → context-menu-list-item-CrCrYuPF.js} +1 -1
- package/build/assets/conversation-BzyIcSwr.js +1 -0
- package/build/assets/conversation-CUJ0Vo8g.js +90 -0
- package/build/assets/conversation-panel-BzyIcSwr.js +1 -0
- package/build/assets/conversation-state-store-F62HvuI1.js +1 -0
- package/build/assets/{conversation-tab-empty-state-BCMHkGQk.js → conversation-tab-empty-state-BCZ7rUMH.js} +1 -1
- package/build/assets/{copy-B8Y5ufoR.js → copy-DCmZtz6n.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-C4l3CMSd.js → copy-to-clipboard-button-D_Lp6-Fl.js} +1 -1
- package/build/assets/{device-verify-C_M7Z8xs.js → device-verify-DLmolX8Q.js} +1 -1
- package/build/assets/{dropdown-classes-DQlj-MpS.js → dropdown-classes-BB8rzqXL.js} +1 -1
- package/build/assets/{entry.client-DETaouwO.js → entry.client-BbIYOsIg.js} +2 -2
- package/build/assets/{enum-filter-dropdown-paB-lFSP.js → enum-filter-dropdown-C08-srev.js} +1 -1
- package/build/assets/{environment-switch-overlay-D0FgCMqs.js → environment-switch-overlay-BepBBX66.js} +1 -1
- package/build/assets/extensions-hub-R3KNv-5V.js +1 -0
- package/build/assets/extensions-navigation-CfWFmI1I.js +1 -0
- package/build/assets/{external-link-Cnnd6ikC.js → external-link-BdBSg8rk.js} +1 -1
- package/build/assets/files-tab-DEq8MbHu.js +1 -0
- package/build/assets/{form-control-classes-CSPevi7c.js → form-control-classes-DAfsCJTe.js} +1 -1
- package/build/assets/{format-time-delta-DuhE50B-.js → format-time-delta-CxfPJpzC.js} +1 -1
- package/build/assets/git-provider-icon-BZqqUPlm.js +1 -0
- package/build/assets/git-repo-dropdown-9WKINV6J.js +1 -0
- package/build/assets/git-repo-dropdown-DEpOwUez.js +1 -0
- package/build/assets/{highlighted-source-view-suUKd5if.js → highlighted-source-view-CX9oIoVT.js} +1 -1
- package/build/assets/home-CY0JaxiY.js +1 -0
- package/build/assets/home-CaNWlVvB.js +1 -0
- package/build/assets/home-store-Ch1ErdBc.js +1 -0
- package/build/assets/index-home-CaNWlVvB.js +1 -0
- package/build/assets/info-CmWQXtRQ.js +1 -0
- package/build/assets/install-server-modal-BWrudmZU.js +1 -0
- package/build/assets/{launch-Ccnhte5b.js → launch-B1POpHuP.js} +1 -1
- package/build/assets/{list-todo-_BXQzOiB.js → list-todo-DtiL3lTp.js} +1 -1
- package/build/assets/llm-not-configured-banner-3tMsM4K6.js +27 -0
- package/build/assets/llm-settings-CXo8iPNW.js +1 -0
- package/build/assets/llm-settings-D0W8mJDk.js +1 -0
- package/build/assets/{llm-subscription-service-W5BprsNA.js → llm-subscription-service-DBJbfd8Z.js} +1 -1
- package/build/assets/loader-circle-B4QDBARx.js +1 -0
- package/build/assets/{loading-spinner-CcpnCr_d.js → loading-spinner-DfZ_bhV7.js} +1 -1
- package/build/assets/manage-backends-modal-CwyWsiag.js +1 -0
- package/build/assets/manifest-39f4789d.js +1 -0
- package/build/assets/{markdown-renderer-CvOO0YIr.js → markdown-renderer-DgiLLhW6.js} +6 -6
- package/build/assets/mcp-DXG9LWrI.js +9 -0
- package/build/assets/mcp-marketplace-utils-DFmhKc5s.js +1 -0
- package/build/assets/messages-kBjKaAeA.js +40 -0
- package/build/assets/{modal-body-DQhiw-AR.js → modal-body-CMsDpalT.js} +1 -1
- package/build/assets/{modal-classes-YaEEa5eZ.js → modal-classes-B6PDrxXo.js} +1 -1
- package/build/assets/{modal-close-button-turIYn0t.js → modal-close-button-DyxBZaAb.js} +1 -1
- package/build/assets/{onboarding-BegDrOKn.js → onboarding-47hh2IHA.js} +1 -1
- package/build/assets/onboarding-modal-9BuvvROo.js +1 -0
- package/build/assets/organization-service.api-UDy63-oC.js +1 -0
- package/build/assets/{pencil-8_lvWDoZ.js → pencil-BjgtZmWp.js} +1 -1
- package/build/assets/{planner-tab-w6HT0N_A.js → planner-tab-BWk8885v.js} +1 -1
- package/build/assets/plugins-management-service-CjkgF2dd.js +1 -0
- package/build/assets/plus-DrKuuvMe.js +1 -0
- package/build/assets/profiles-service.api-CukSFLzz.js +1 -0
- package/build/assets/providers-CqUWC85T.js +1 -0
- package/build/assets/proxy-BBUG3sd2.js +1 -0
- package/build/assets/{puzzle-DXWdfaa7.js → puzzle-BoNc6zZ8.js} +1 -1
- package/build/assets/recommended-automations-launcher-ejxy1P27.js +1 -0
- package/build/assets/{refresh-cw-D7CYLy-d.js → refresh-cw-BrM5ZAZD.js} +1 -1
- package/build/assets/root-5S-M8SYa.js +2 -0
- package/build/assets/root-DZ39lS5f.css +1 -0
- package/build/assets/root-layout-BPqoa0gv.js +3 -0
- package/build/assets/schema-field-nImDoY6-.js +1 -0
- package/build/assets/{sdk-section-page-BW-i45yr.js → sdk-section-page-BxMrtUNV.js} +1 -1
- package/build/assets/search-Dc2qR4O2.js +1 -0
- package/build/assets/secrets-service-Dhjh3HhH.js +1 -0
- package/build/assets/{secrets-settings-D7U1ErCH.js → secrets-settings-CPdxceT_.js} +1 -1
- package/build/assets/segmented-toggle-Do6oyepX.js +1 -0
- package/build/assets/settings-BRbnfKEm.js +1 -0
- package/build/assets/{settings-dropdown-input-Dx6vlkgf.js → settings-dropdown-input-DYCULKpp.js} +1 -1
- package/build/assets/{settings-index-COAdxm2Q.js → settings-index-C9o2NBO0.js} +1 -1
- package/build/assets/settings-input-B-q2gkVy.js +1 -0
- package/build/assets/{settings-list-classes-gQdBahdt.js → settings-list-classes-WpQi0q1L.js} +1 -1
- package/build/assets/{settings-modal-CFnbQ8_4.js → settings-modal-CEK0AIx6.js} +1 -1
- package/build/assets/settings-service.api-CZiPD8__.js +1 -0
- package/build/assets/{settings-switch-UNSf8K8I.js → settings-switch-LqKdGxHL.js} +1 -1
- package/build/assets/shared-conversation-Bu-dQlgp.js +1 -0
- package/build/assets/{sidebar-layout-DXHtbEj1.js → sidebar-layout-oHBGQmLh.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-U78hQRJ1.js → sidebar-mobile-menu-toggle-ND-hgygu.js} +1 -1
- package/build/assets/{sidebar-nav-link-pvUivfK2.js → sidebar-nav-link-CrujNA09.js} +1 -1
- package/build/assets/{sidebar-store-DwrYKwYr.js → sidebar-store-Bui-WNEr.js} +1 -1
- package/build/assets/{skill-card-pill-row-D7XCz5uk.js → skill-card-pill-row-CZBI7OqH.js} +1 -1
- package/build/assets/{skill-icon-badge-HqBWZ2Eq.js → skill-icon-badge-BOov_phZ.js} +1 -1
- package/build/assets/{skills-plugins-BPhaNpfx.js → skills-plugins-D0PiHWAD.js} +1 -1
- package/build/assets/{skills-settings-CcwMtnnJ.js → skills-settings-B43KArIz.js} +2 -2
- package/build/assets/{styled-tooltip-DsjDnR_W.js → styled-tooltip-C7grwnOX.js} +1 -1
- package/build/assets/{task-list-tab-BmaTwjaS.js → task-list-tab-R3ac6m7O.js} +1 -1
- package/build/assets/{terminal-BRcoba5B.js → terminal-yqkNdEAx.js} +1 -1
- package/build/assets/{toggle-switch-BptY3XRG.js → toggle-switch-BeSrbgCg.js} +1 -1
- package/build/assets/{trash-2-Bq4lHbTB.js → trash-2-wW5TWcdN.js} +1 -1
- package/build/assets/{typography-C6fuRTTT.js → typography-iYhzLlHO.js} +1 -1
- package/build/assets/{use-acp-credential-form-B0_pZ_uS.js → use-acp-credential-form-DUxbxmbq.js} +1 -1
- package/build/assets/use-activate-agent-profile-CDHA52tC.js +1 -0
- package/build/assets/use-agent-profiles-TsOdIyw5.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-CrG1km7R.js → use-can-manage-org-profiles-Bt1M71u5.js} +1 -1
- package/build/assets/use-cloud-current-user-id-DWt7HCgf.js +1 -0
- package/build/assets/{use-config-Csy8EAP9.js → use-config-CxlEdf_v.js} +1 -1
- package/build/assets/{use-create-conversation-Dsa4nzU9.js → use-create-conversation-nOJ6Um5h.js} +1 -1
- package/build/assets/{use-create-secret-BnxuAjDt.js → use-create-secret-Dj5ang9x.js} +1 -1
- package/build/assets/use-is-authed-BT7Iud4U.js +1 -0
- package/build/assets/{use-is-creating-conversation-CIAcnd8M.js → use-is-creating-conversation-CAggrM75.js} +1 -1
- package/build/assets/use-llm-profiles-2Wc2db8u.js +1 -0
- package/build/assets/use-onboarding-completion-gxQlcEy2.js +1 -0
- package/build/assets/use-plugins-marketplace-CVO7sXYR.js +1 -0
- package/build/assets/use-save-agent-profile-D0wC5ExW.js +1 -0
- package/build/assets/{use-save-settings-BRh9p_fv.js → use-save-settings-L3aMaDeS.js} +1 -1
- package/build/assets/use-settings-8nt3DGxW.js +1 -0
- package/build/assets/use-settings-nav-items-DHAAD-zk.js +16 -0
- package/build/assets/use-skills-CE6miQ3r.js +1 -0
- package/build/assets/use-tracking-BGboadaZ.js +68 -0
- package/build/assets/{use-user-conversation-GnGhs_Ob.js → use-user-conversation-BIIpGUgM.js} +1 -1
- package/build/assets/useInfiniteQuery-BLRVmVPU.js +1 -0
- package/build/assets/{useMutation-DyQXZFEF.js → useMutation-CaSHLnX0.js} +1 -1
- package/build/assets/{useQueries-B3T1a7qt.js → useQueries--d_WWAzc.js} +1 -1
- package/build/assets/{useQuery-B38jBavx.js → useQuery-DiPh8LRJ.js} +1 -1
- package/build/assets/utils-BgGG1znF.js +1 -0
- package/build/assets/{vendor~browser-CIoZCqGs.js → vendor~browser-IVYgIgG1.js} +1 -1
- package/build/assets/{vendor~entry.client-Di4qO77Y.js → vendor~entry.client-BcYIVQvB.js} +1 -1
- package/build/assets/{vendor~entry.client-BfviqoVc.js → vendor~entry.client-CXM9oiAk.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js} +2 -2
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js} +1 -1
- package/build/assets/{vendor~files-tab-vm3f67Pz.js → vendor~files-tab-C7RmQJwN.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-kX4LrGQC.js → vendor~index-home~home~conversation-panel~conversation-Bqp1ZqJM.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-DpA6fir3.js → vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js} +1 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js +1 -0
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js +1 -0
- package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js +1 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js} +17 -4
- package/build/assets/{verification-settings-CaCzojbc.js → verification-settings-DBsnSXC3.js} +1 -1
- package/build/assets/x-omAzpXkl.js +1 -0
- package/build/favicon-16x16.png +0 -0
- package/build/favicon-32x32.png +0 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +39 -2
- package/build/locales/ca/openhands.json +39 -2
- package/build/locales/de/openhands.json +39 -2
- package/build/locales/en/openhands.json +40 -3
- package/build/locales/es/openhands.json +39 -2
- package/build/locales/fr/openhands.json +39 -2
- package/build/locales/it/openhands.json +39 -2
- package/build/locales/ja/openhands.json +39 -2
- package/build/locales/ko-KR/openhands.json +39 -2
- package/build/locales/no/openhands.json +39 -2
- package/build/locales/pt/openhands.json +39 -2
- package/build/locales/tr/openhands.json +39 -2
- package/build/locales/uk/openhands.json +39 -2
- package/build/locales/zh-CN/openhands.json +39 -2
- package/build/locales/zh-TW/openhands.json +39 -2
- package/config/defaults.json +4 -4
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +46 -6
- package/dist/api/agent-server-adapter.js +187 -168
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/agent-server-compatibility.cjs +1 -1
- package/dist/api/agent-server-compatibility.cjs.map +1 -1
- package/dist/api/agent-server-compatibility.d.ts +4 -0
- package/dist/api/agent-server-compatibility.js +41 -38
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/automation-service/automation-service.api.cjs +1 -1
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
- package/dist/api/automation-service/automation-service.api.d.ts +20 -0
- package/dist/api/automation-service/automation-service.api.js +136 -99
- package/dist/api/automation-service/automation-service.api.js.map +1 -1
- package/dist/api/backend-registry/storage.cjs +1 -1
- package/dist/api/backend-registry/storage.cjs.map +1 -1
- package/dist/api/backend-registry/storage.js +1 -1
- package/dist/api/backend-registry/storage.js.map +1 -1
- package/dist/api/backend-registry/types.d.ts +2 -0
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.js +22 -22
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +19 -19
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.js +26 -12
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +2 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.d.ts +12 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +94 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -0
- 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 +31 -90
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/features/automations/recommended-automations-launcher.d.ts +0 -7
- package/dist/components/features/automations/recommended-automations-section.d.ts +0 -6
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.js +568 -358
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/device-flow-auth.cjs +1 -1
- package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
- package/dist/components/features/backends/device-flow-auth.d.ts +9 -1
- package/dist/components/features/backends/device-flow-auth.js +56 -55
- package/dist/components/features/backends/device-flow-auth.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 +1 -1
- package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +1 -1
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +105 -105
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/chat-message.cjs +1 -1
- package/dist/components/features/chat/chat-message.cjs.map +1 -1
- package/dist/components/features/chat/chat-message.d.ts +2 -1
- package/dist/components/features/chat/chat-message.js +59 -49
- package/dist/components/features/chat/chat-message.js.map +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
- package/dist/components/features/chat/pending-user-messages.js +4 -1
- package/dist/components/features/chat/pending-user-messages.js.map +1 -1
- package/dist/components/features/chat/typing-indicator.cjs +1 -1
- package/dist/components/features/chat/typing-indicator.cjs.map +1 -1
- package/dist/components/features/chat/typing-indicator.d.ts +8 -1
- package/dist/components/features/chat/typing-indicator.js +94 -10
- package/dist/components/features/chat/typing-indicator.js.map +1 -1
- package/dist/components/features/command-menu/command-menu-items.d.ts +5 -1
- package/dist/components/features/files-tab/segmented-toggle.cjs +1 -1
- package/dist/components/features/files-tab/segmented-toggle.cjs.map +1 -1
- package/dist/components/features/files-tab/segmented-toggle.d.ts +2 -0
- package/dist/components/features/files-tab/segmented-toggle.js +17 -14
- package/dist/components/features/files-tab/segmented-toggle.js.map +1 -1
- package/dist/components/features/manifest/manifest-form-field.d.ts +27 -0
- package/dist/components/features/manifest/manifest-prerequisites-step.d.ts +11 -0
- package/dist/components/features/manifest/manifest-review-step.d.ts +14 -0
- package/dist/components/features/manifest/manifest-setup-dialog.d.ts +14 -0
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +16 -16
- 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.d.ts +2 -2
- package/dist/components/features/mcp-page/installed-server-card.js +6 -7
- package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.cjs +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.d.ts +2 -2
- package/dist/components/features/mcp-page/installed-servers-section.js +2 -2
- package/dist/components/features/mcp-page/installed-servers-section.js.map +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.cjs +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.js +4 -4
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +1 -1
- 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 +2 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
- package/dist/components/features/settings/settings-input.cjs +1 -1
- package/dist/components/features/settings/settings-input.cjs.map +1 -1
- package/dist/components/features/settings/settings-input.d.ts +6 -0
- package/dist/components/features/settings/settings-input.js +13 -8
- package/dist/components/features/settings/settings-input.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +124 -123
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/contexts/active-backend-context.cjs +1 -1
- package/dist/contexts/active-backend-context.cjs.map +1 -1
- package/dist/contexts/active-backend-context.d.ts +3 -2
- package/dist/contexts/active-backend-context.js +55 -42
- package/dist/contexts/active-backend-context.js.map +1 -1
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.js +5 -5
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +4 -0
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.cjs +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.js +7 -5
- package/dist/hooks/query/use-cloud-current-user-id.js.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.js +5 -1
- package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
- package/dist/hooks/query/use-manifest-capabilities.d.ts +21 -0
- package/dist/hooks/query/use-manifest-prerequisites.d.ts +24 -0
- package/dist/hooks/use-can-manage-org-profiles.cjs +1 -1
- package/dist/hooks/use-can-manage-org-profiles.cjs.map +1 -1
- package/dist/hooks/use-can-manage-org-profiles.js +2 -1
- package/dist/hooks/use-can-manage-org-profiles.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 +2 -1
- package/dist/hooks/use-llm-configured.js.map +1 -1
- package/dist/hooks/use-manifest-preflight.d.ts +18 -0
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +14 -0
- package/dist/hooks/use-tracking.js +28 -10
- 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 +38 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +645 -16
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/external-link.cjs +2 -0
- package/dist/icons/external-link.cjs.map +1 -0
- package/dist/icons/external-link.js +22 -0
- package/dist/icons/external-link.js.map +1 -0
- package/dist/icons/server.cjs +2 -0
- package/dist/icons/server.cjs.map +1 -0
- package/dist/icons/server.js +17 -0
- package/dist/icons/server.js.map +1 -0
- package/dist/locales/ar/openhands.json +39 -2
- package/dist/locales/ca/openhands.json +39 -2
- package/dist/locales/de/openhands.json +39 -2
- package/dist/locales/en/openhands.json +40 -3
- package/dist/locales/es/openhands.json +39 -2
- package/dist/locales/fr/openhands.json +39 -2
- package/dist/locales/it/openhands.json +39 -2
- package/dist/locales/ja/openhands.json +39 -2
- package/dist/locales/ko-KR/openhands.json +39 -2
- package/dist/locales/no/openhands.json +39 -2
- package/dist/locales/pt/openhands.json +39 -2
- package/dist/locales/tr/openhands.json +39 -2
- package/dist/locales/uk/openhands.json +39 -2
- package/dist/locales/zh-CN/openhands.json +39 -2
- package/dist/locales/zh-TW/openhands.json +39 -2
- package/dist/manifests/automation-interface.cjs +2 -0
- package/dist/manifests/automation-interface.cjs.map +1 -0
- package/dist/manifests/automation-interface.d.ts +44 -0
- package/dist/manifests/automation-interface.js +81 -0
- package/dist/manifests/automation-interface.js.map +1 -0
- package/dist/manifests/automation-setup.cjs +2 -0
- package/dist/manifests/automation-setup.cjs.map +1 -0
- package/dist/manifests/automation-setup.d.ts +52 -0
- package/dist/manifests/automation-setup.js +8 -0
- package/dist/manifests/automation-setup.js.map +1 -0
- package/dist/manifests/interface-validation.cjs +2 -0
- package/dist/manifests/interface-validation.cjs.map +1 -0
- package/dist/manifests/interface-validation.d.ts +27 -0
- package/dist/manifests/interface-validation.js +182 -0
- package/dist/manifests/interface-validation.js.map +1 -0
- package/dist/manifests/manifest-actions.d.ts +15 -0
- package/dist/manifests/manifest-capabilities.d.ts +25 -0
- package/dist/manifests/manifest-error-map.d.ts +40 -0
- package/dist/manifests/manifest-local-validation.d.ts +56 -0
- package/dist/manifests/manifest-registry.cjs +2 -0
- package/dist/manifests/manifest-registry.cjs.map +1 -0
- package/dist/manifests/manifest-registry.d.ts +15 -0
- package/dist/manifests/manifest-registry.js +26 -0
- package/dist/manifests/manifest-registry.js.map +1 -0
- package/dist/manifests/manifest-sources.cjs +2 -0
- package/dist/manifests/manifest-sources.cjs.map +1 -0
- package/dist/manifests/manifest-sources.d.ts +15 -0
- package/dist/manifests/manifest-sources.js +8 -0
- package/dist/manifests/manifest-sources.js.map +1 -0
- package/dist/manifests/manifest-template.d.ts +18 -0
- package/dist/manifests/manifest-validation.cjs +2 -0
- package/dist/manifests/manifest-validation.cjs.map +1 -0
- package/dist/manifests/manifest-validation.d.ts +30 -0
- package/dist/manifests/manifest-validation.js +145 -0
- package/dist/manifests/manifest-validation.js.map +1 -0
- package/dist/manifests/types.cjs +2 -0
- package/dist/manifests/types.cjs.map +1 -0
- package/dist/manifests/types.d.ts +227 -0
- package/dist/manifests/types.js +6 -0
- package/dist/manifests/types.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +75 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +78 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs +17 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js +89 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs +10 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js +17 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js +15 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js +18 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js +14 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js +14 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +23 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/index.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/index.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/index.js +18 -0
- package/dist/node_modules/@openhands/extensions/automations/index.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.js +89 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +3 -3
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +17 -4
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +5 -5
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +9 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js +29 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.js +5 -5
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.js +73 -82
- package/dist/routes/mcp.js.map +1 -1
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.d.ts +8 -0
- package/dist/services/telemetry.js +163 -116
- package/dist/services/telemetry.js.map +1 -1
- package/dist/types/agent-server/core/events/conversation-state-event.d.ts +2 -19
- package/dist/types/agent-server/core/events/observation-event.d.ts +2 -18
- package/dist/types/automation.d.ts +7 -3
- package/dist/types/mcp-server.d.ts +5 -0
- package/dist/types/settings.d.ts +3 -0
- package/dist/utils/api-error-message.d.ts +6 -2
- package/dist/utils/automation-catalog.cjs +2 -0
- package/dist/utils/automation-catalog.cjs.map +1 -0
- package/dist/utils/automation-catalog.d.ts +28 -0
- package/dist/utils/automation-catalog.js +5 -0
- package/dist/utils/automation-catalog.js.map +1 -0
- package/dist/utils/automation-timeout.d.ts +3 -2
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.d.ts +8 -0
- package/dist/utils/mcp-config.js +25 -20
- package/dist/utils/mcp-config.js.map +1 -1
- 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 +6 -3
- package/dist/utils/mcp-installed-servers.js.map +1 -1
- package/dist/utils/responder-deployment.d.ts +5 -1
- package/dist/utils/transcript-export/index.cjs +5 -5
- package/dist/utils/transcript-export/index.js +12 -12
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +1 -0
- package/scripts/dev-safe.mjs +17 -12
- package/scripts/dev-static.mjs +17 -0
- package/scripts/dev-with-automation.mjs +12 -14
- package/scripts/ingress.mjs +22 -0
- package/scripts/proxy-utils.mjs +157 -2
- package/scripts/runtime-services-info.mjs +6 -6
- package/scripts/static-build.mjs +0 -7
- package/scripts/static-server.mjs +10 -0
- package/build/assets/active-backend-context-BlZPzZNU.js +0 -1
- package/build/assets/agent-context-settings-CTaN-Iw9.js +0 -1
- package/build/assets/agent-profiles-settings-CR4VTqv_.js +0 -1
- package/build/assets/agent-server-conversation-service.api-Btmi4q6d.js +0 -41
- package/build/assets/agent-settings-KQs-occT.js +0 -1
- package/build/assets/api-key-entry-screen-BhR24gkM.js +0 -1
- package/build/assets/app-settings-Bs4sY8WP.js +0 -1
- package/build/assets/automation-BGP_I1RR.js +0 -1
- package/build/assets/automation-detail-CwDnJbYR.js +0 -2
- package/build/assets/automation-export-Bu-r-EzL.js +0 -2
- package/build/assets/automations-list-CYw7_6FR.js +0 -1
- package/build/assets/backend-form-modal-Ce-KRHOJ.js +0 -1
- package/build/assets/browser-BUDJnBg4.js +0 -6
- package/build/assets/check-BMOG005H.js +0 -1
- package/build/assets/chevron-down-CV1zZP_K.js +0 -1
- package/build/assets/circle-check-lvN_jFN5.js +0 -1
- package/build/assets/client-source-1v-kWLNU.js +0 -1
- package/build/assets/cloud-funnel-analytics-CasMM7EO.js +0 -1
- package/build/assets/command-menu-N_BriUy8.js +0 -1
- package/build/assets/condenser-settings-Czi8cKxV.js +0 -1
- package/build/assets/conversation-C25pc2dT.js +0 -1
- package/build/assets/conversation-CObLYSJd.js +0 -90
- package/build/assets/conversation-panel-C25pc2dT.js +0 -1
- package/build/assets/conversation-state-store-DTq4hFoP.js +0 -1
- package/build/assets/extensions-hub-BKftOQ-X.js +0 -1
- package/build/assets/extensions-navigation-DF24q1H1.js +0 -1
- package/build/assets/files-tab-SAiFCnS5.js +0 -1
- package/build/assets/git-provider-icon-BREx-yUX.js +0 -1
- package/build/assets/home-EPNFgzUh.js +0 -1
- package/build/assets/home-sN90Xcxp.js +0 -1
- package/build/assets/index-home-EPNFgzUh.js +0 -1
- package/build/assets/install-server-modal-BI8yUfmr.js +0 -1
- package/build/assets/llm-not-configured-banner-DTWzISnk.js +0 -27
- package/build/assets/llm-settings-BXk5_Pac.js +0 -1
- package/build/assets/llm-settings-C1vpgWam.js +0 -1
- package/build/assets/loader-circle-6zlEYCJw.js +0 -1
- package/build/assets/manage-backends-modal-DhflyGTf.js +0 -1
- package/build/assets/manifest-8082e879.js +0 -1
- package/build/assets/mcp-CxLPda-W.js +0 -9
- package/build/assets/messages-DINDkPNK.js +0 -40
- package/build/assets/onboarding-modal-DdvE6rzw.js +0 -1
- package/build/assets/organization-service.api-CT2OQlLz.js +0 -1
- package/build/assets/plugins-management-service-DVkoM3eA.js +0 -1
- package/build/assets/plus-vIbGD459.js +0 -1
- package/build/assets/profiles-service.api-CBafmAPO.js +0 -1
- package/build/assets/providers-9UzRB9mT.js +0 -1
- package/build/assets/proxy-C79PCMjo.js +0 -1
- package/build/assets/recommended-automations-launcher-BF2mtAKw.js +0 -58
- package/build/assets/root-B5JXKp1P.css +0 -1
- package/build/assets/root-Sj7W28yE.js +0 -2
- package/build/assets/root-layout-DbhKVoc7.js +0 -3
- package/build/assets/schema-field-CV6bFnoL.js +0 -1
- package/build/assets/search-sKuYKllf.js +0 -1
- package/build/assets/secrets-service-BjK-bPN2.js +0 -1
- package/build/assets/segmented-toggle-DbbD3Tve.js +0 -1
- package/build/assets/settings-Bj5Oo45A.js +0 -1
- package/build/assets/settings-input-BjW_zyTN.js +0 -1
- package/build/assets/settings-service.api-DryhKdSr.js +0 -1
- package/build/assets/shared-conversation-CnMxy7p_.js +0 -1
- package/build/assets/telemetry-cmCL3o6Z.js +0 -2
- package/build/assets/use-activate-agent-profile-DH33MvVj.js +0 -1
- package/build/assets/use-agent-profiles-Dmd_4H8q.js +0 -1
- package/build/assets/use-cloud-current-user-id-B6DP3s47.js +0 -1
- package/build/assets/use-is-authed-BsS4XwSL.js +0 -1
- package/build/assets/use-llm-profiles-BMQoc612.js +0 -1
- package/build/assets/use-onboarding-completion-B-2BTS-y.js +0 -1
- package/build/assets/use-plugins-marketplace-PBc_XNz_.js +0 -1
- package/build/assets/use-save-agent-profile-2Mk9ZX37.js +0 -1
- package/build/assets/use-settings-DBI44RnH.js +0 -1
- package/build/assets/use-settings-nav-items-Cva28C-c.js +0 -16
- package/build/assets/use-skills-RQsCtdzN.js +0 -1
- package/build/assets/use-tracking-CN1nIMnY.js +0 -1
- package/build/assets/utils-qjs_KuS4.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js +0 -1
- package/build/assets/x-EjvKGawc.js +0 -1
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js} +0 -0
|
@@ -4,70 +4,83 @@ import { NO_BACKEND as r, getActiveSelection as i, getRegisteredBackends as a, g
|
|
|
4
4
|
import { clearCachedAgentServerInfo as u } from "../api/agent-server-compatibility.js";
|
|
5
5
|
import { QUERY_KEYS as d } from "../hooks/query/query-keys.js";
|
|
6
6
|
import { queryClient as f } from "../query-client-config.js";
|
|
7
|
-
import p from "
|
|
8
|
-
import
|
|
7
|
+
import { setTelemetryCloudContext as p, setTelemetryIdentity as m } from "../services/telemetry.js";
|
|
8
|
+
import h from "react";
|
|
9
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
9
10
|
//#region src/contexts/active-backend-context.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
11
|
+
var _ = h.createContext(null);
|
|
12
|
+
function v() {
|
|
12
13
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `backend-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
15
|
+
function y(e, t) {
|
|
16
|
+
let n = e.backend.kind === "cloud", r = t.backend.kind === "cloud";
|
|
17
|
+
!n && !r || (p(null), r && (!n || e.backend.id !== t.backend.id) && m(null));
|
|
18
|
+
}
|
|
19
|
+
function b({ children: n }) {
|
|
20
|
+
let b = h.useSyncExternalStore(l, o, o), x = h.useCallback(() => {
|
|
16
21
|
u(), f.invalidateQueries({ queryKey: d.WEB_CLIENT_CONFIG });
|
|
17
|
-
}, []),
|
|
18
|
-
let n = i()?.backendId ?? null,
|
|
19
|
-
e ===
|
|
22
|
+
}, []), S = h.useCallback((e, t) => {
|
|
23
|
+
let n = o(), c = i()?.backendId ?? null, l = i()?.orgId ?? null, u = t ?? null;
|
|
24
|
+
if (e === c && u === l) return;
|
|
25
|
+
let d = a(), f = d.find((t) => t.id === e), p = {
|
|
26
|
+
backend: f ?? d[0] ?? r,
|
|
27
|
+
orgId: f ? u : null
|
|
28
|
+
};
|
|
29
|
+
y(n.active, p), s({
|
|
20
30
|
backendId: e,
|
|
21
|
-
orgId:
|
|
22
|
-
}),
|
|
23
|
-
}, [
|
|
24
|
-
let t = {
|
|
31
|
+
orgId: u
|
|
32
|
+
}), x();
|
|
33
|
+
}, [x]), C = h.useCallback((e) => {
|
|
34
|
+
let t = o().active, n = {
|
|
25
35
|
...e,
|
|
26
|
-
id:
|
|
27
|
-
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
id: v()
|
|
37
|
+
}, r = [...a(), n];
|
|
38
|
+
return y(t, {
|
|
39
|
+
backend: n,
|
|
40
|
+
orgId: null
|
|
41
|
+
}), c(r), s({ backendId: n.id }), x(), n;
|
|
42
|
+
}, [x]), w = h.useCallback((e, n) => {
|
|
43
|
+
let r = a().find((t) => t.id === e), i = o().active.backend.id, s = n.host !== void 0 && r !== void 0 && n.host !== r.host, l = n.apiKey !== void 0 && r !== void 0 && n.apiKey !== r.apiKey;
|
|
31
44
|
c(a().map((t) => t.id === e ? {
|
|
32
45
|
...t,
|
|
33
|
-
...n
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
c(a().filter((e) => e.id !== t)), e(t),
|
|
39
|
-
}, [
|
|
40
|
-
backends:
|
|
41
|
-
active:
|
|
42
|
-
setActive:
|
|
43
|
-
addBackend:
|
|
44
|
-
updateBackend:
|
|
45
|
-
removeBackend:
|
|
46
|
+
...n,
|
|
47
|
+
connectionRevision: s || l ? (t.connectionRevision ?? 0) + 1 : t.connectionRevision
|
|
48
|
+
} : t)), (s || l) && (t(e), i === e && (r?.kind === "cloud" && (p(null), m(null)), x()));
|
|
49
|
+
}, [x]), T = h.useCallback((t) => {
|
|
50
|
+
let n = a().find((e) => e.id === t), r = n?.kind === "cloud" && o().active.backend.id === n.id;
|
|
51
|
+
c(a().filter((e) => e.id !== t)), r && (p(null), m(null)), e(t), x();
|
|
52
|
+
}, [x]), E = h.useMemo(() => ({
|
|
53
|
+
backends: b.backends,
|
|
54
|
+
active: b.active,
|
|
55
|
+
setActive: S,
|
|
56
|
+
addBackend: C,
|
|
57
|
+
updateBackend: w,
|
|
58
|
+
removeBackend: T
|
|
46
59
|
}), [
|
|
47
|
-
r,
|
|
48
|
-
v,
|
|
49
|
-
y,
|
|
50
60
|
b,
|
|
51
|
-
|
|
61
|
+
S,
|
|
62
|
+
C,
|
|
63
|
+
w,
|
|
64
|
+
T
|
|
52
65
|
]);
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
value:
|
|
66
|
+
return /* @__PURE__ */ g(_.Provider, {
|
|
67
|
+
value: E,
|
|
55
68
|
children: n
|
|
56
69
|
});
|
|
57
70
|
}
|
|
58
|
-
function
|
|
59
|
-
let e =
|
|
71
|
+
function x() {
|
|
72
|
+
let e = h.useContext(_);
|
|
60
73
|
if (!e) throw Error("useActiveBackendContext must be used inside <ActiveBackendProvider>");
|
|
61
74
|
return e;
|
|
62
75
|
}
|
|
63
|
-
function
|
|
64
|
-
let e =
|
|
76
|
+
function S() {
|
|
77
|
+
let e = h.useContext(_);
|
|
65
78
|
return e ? e.active : {
|
|
66
79
|
backend: n() ?? r,
|
|
67
80
|
orgId: null
|
|
68
81
|
};
|
|
69
82
|
}
|
|
70
83
|
//#endregion
|
|
71
|
-
export {
|
|
84
|
+
export { b as ActiveBackendProvider, S as useActiveBackend, x as useActiveBackendContext };
|
|
72
85
|
|
|
73
86
|
//# sourceMappingURL=active-backend-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-backend-context.js","names":[],"sources":["../../src/contexts/active-backend-context.tsx"],"sourcesContent":["import React from \"react\";\nimport { clearCachedAgentServerInfo } from \"#/api/agent-server-compatibility\";\nimport {\n getActiveSelection,\n getRegisteredBackends,\n getSnapshot,\n NO_BACKEND,\n setActiveSelection,\n setRegisteredBackends,\n subscribeActiveBackend,\n} from \"#/api/backend-registry/active-store\";\nimport { makeDefaultLocalBackend } from \"#/api/backend-registry/default-backend\";\nimport {\n dropBackendHealth,\n resetBackendHealth,\n} from \"#/api/backend-registry/health-store\";\nimport {\n type Backend,\n type BackendSelection,\n type ResolvedActiveBackend,\n} from \"#/api/backend-registry/types\";\nimport { QUERY_KEYS } from \"#/hooks/query/query-keys\";\nimport { queryClient } from \"#/query-client-config\";\n\ninterface ActiveBackendContextValue {\n backends: Backend[];\n active: ResolvedActiveBackend;\n setActive: (backendId: string, orgId?: string | null) => void;\n addBackend: (backend: Omit<Backend, \"id\">) => Backend;\n updateBackend: (id: string, patch: Partial<Omit<Backend, \"id\">>) => void;\n removeBackend: (id: string) => void;\n}\n\nconst ActiveBackendContext =\n React.createContext<ActiveBackendContextValue | null>(null);\n\nfunction generateId(): string {\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto.randomUUID === \"function\"\n ) {\n return crypto.randomUUID();\n }\n return `backend-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\nexport function ActiveBackendProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n const snapshot = React.useSyncExternalStore(\n subscribeActiveBackend,\n getSnapshot,\n getSnapshot,\n );\n\n const retryBootstrapProbe = React.useCallback(() => {\n clearCachedAgentServerInfo();\n void queryClient.invalidateQueries({\n queryKey: QUERY_KEYS.WEB_CLIENT_CONFIG,\n });\n }, []);\n\n const setActive = React.useCallback(\n (backendId: string, orgId?: string | null) => {\n const prevBackendId = getActiveSelection()?.backendId ?? null;\n const prevOrgId = getActiveSelection()?.orgId ?? null;\n const nextOrgId = orgId ?? null;\n\n if (backendId === prevBackendId && nextOrgId === prevOrgId) return;\n\n const next: BackendSelection = { backendId, orgId: nextOrgId };\n setActiveSelection(next);\n retryBootstrapProbe();\n\n // No blanket `invalidateQueries()` here. Long-lived queries\n // (`useSettings`, `usePaginatedConversations`,\n // `useGitRepositories`, `useAppInstallations`,\n // `useCloudCurrentUserId`, `useGitUser`, …) include the active\n // backend's `id` and `orgId` in their query keys, so React Query\n // treats a backend/org switch as a brand-new query and fetches\n // automatically — once, with no duplicate waves.\n },\n [retryBootstrapProbe],\n );\n\n // @spec BM-001 — Auto-switch to newly connected backend\n const addBackend = React.useCallback(\n (backend: Omit<Backend, \"id\">): Backend => {\n const next: Backend = { ...backend, id: generateId() };\n const list = [...getRegisteredBackends(), next];\n setRegisteredBackends(list);\n setActiveSelection({ backendId: next.id });\n retryBootstrapProbe();\n return next;\n },\n [retryBootstrapProbe],\n );\n\n const updateBackend = React.useCallback(\n (id: string, patch: Partial<Omit<Backend, \"id\">>) => {\n const prev = getRegisteredBackends().find((b) => b.id === id);\n const activeBeforeUpdate = getActiveSelection()?.backendId ?? null;\n const list = getRegisteredBackends().map((b) =>\n b.id === id ? { ...b, ...patch } : b,\n );\n setRegisteredBackends(list);\n\n // Re-arm health polling when the user edits the fields that\n // actually drive the probe. Cosmetic edits (name) shouldn't\n // re-enable a backend that was disabled for being unreachable.\n const hostChanged =\n patch.host !== undefined &&\n prev !== undefined &&\n patch.host !== prev.host;\n const apiKeyChanged =\n patch.apiKey !== undefined &&\n prev !== undefined &&\n patch.apiKey !== prev.apiKey;\n if (hostChanged || apiKeyChanged) {\n resetBackendHealth(id);\n if (activeBeforeUpdate === id) {\n retryBootstrapProbe();\n }\n }\n },\n [retryBootstrapProbe],\n );\n\n const removeBackend = React.useCallback(\n (id: string) => {\n const list = getRegisteredBackends().filter((b) => b.id !== id);\n setRegisteredBackends(list);\n dropBackendHealth(id);\n retryBootstrapProbe();\n // If the active selection pointed at this backend, the active\n // store falls back to the first remaining local backend (or the\n // env-derived default if no locals exist); consumer hooks re-key\n // by the new active backend identity and refetch automatically.\n },\n [retryBootstrapProbe],\n );\n\n const value = React.useMemo<ActiveBackendContextValue>(\n () => ({\n backends: snapshot.backends,\n active: snapshot.active,\n setActive,\n addBackend,\n updateBackend,\n removeBackend,\n }),\n [snapshot, setActive, addBackend, updateBackend, removeBackend],\n );\n\n return (\n <ActiveBackendContext.Provider value={value}>\n {children}\n </ActiveBackendContext.Provider>\n );\n}\n\nexport function useActiveBackendContext(): ActiveBackendContextValue {\n const ctx = React.useContext(ActiveBackendContext);\n if (!ctx) {\n throw new Error(\n \"useActiveBackendContext must be used inside <ActiveBackendProvider>\",\n );\n }\n return ctx;\n}\n\n/**\n * Read the resolved active backend.\n *\n * Falls back to a synthesized env-derived local backend when called\n * outside an `<ActiveBackendProvider>` (e.g. from a unit test that\n * mounts a narrow component without the full provider stack). That\n * synthesized backend is identical to the seed used on first install.\n *\n * Components that need to mutate state (`setActive`, `addBackend`,\n * etc.) must use `useActiveBackendContext()` directly — that throws if\n * the provider is missing, since mutation requires the live store.\n */\nexport function useActiveBackend(): ResolvedActiveBackend {\n const ctx = React.useContext(ActiveBackendContext);\n if (ctx) return ctx.active;\n return { backend: makeDefaultLocalBackend() ?? NO_BACKEND, orgId: null };\n}\n"],"mappings":";;;;;;;;;AAiCA,IAAM,IACJ,EAAM,cAAgD,IAAI;AAE5D,SAAS,IAAqB;CAO5B,OALE,OAAO,SAAW,OAClB,OAAO,OAAO,cAAe,aAEtB,OAAO,WAAW,IAEpB,WAAW,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE;AACxE;AAEA,SAAgB,EAAsB,EACpC,eAGC;CACD,IAAM,IAAW,EAAM,qBACrB,GACA,GACA,CACF,GAEM,IAAsB,EAAM,kBAAkB;EAElD,AADA,EAA2B,GAC3B,EAAiB,kBAAkB,EACjC,UAAU,EAAW,kBACvB,CAAC;CACH,GAAG,CAAC,CAAC,GAEC,IAAY,EAAM,aACrB,GAAmB,MAA0B;EAC5C,IAAM,IAAgB,EAAmB,GAAG,aAAa,MACnD,IAAY,EAAmB,GAAG,SAAS,MAC3C,IAAY,KAAS;EAEvB,MAAc,KAAiB,MAAc,MAGjD,EAAmB;GADc;GAAW,OAAO;EAChC,CAAI,GACvB,EAAoB;CAStB,GACA,CAAC,CAAmB,CACtB,GAGM,IAAa,EAAM,aACtB,MAA0C;EACzC,IAAM,IAAgB;GAAE,GAAG;GAAS,IAAI,EAAW;EAAE;EAKrD,OAHA,EAAsB,CADR,GAAG,EAAsB,GAAG,CACpB,CAAI,GAC1B,EAAmB,EAAE,WAAW,EAAK,GAAG,CAAC,GACzC,EAAoB,GACb;CACT,GACA,CAAC,CAAmB,CACtB,GAEM,IAAgB,EAAM,aACzB,GAAY,MAAwC;EACnD,IAAM,IAAO,EAAsB,EAAE,MAAM,MAAM,EAAE,OAAO,CAAE,GACtD,IAAqB,EAAmB,GAAG,aAAa;EAI9D,EAHa,EAAsB,EAAE,KAAK,MACxC,EAAE,OAAO,IAAK;GAAE,GAAG;GAAG,GAAG;EAAM,IAAI,CAEf,CAAI;EAK1B,IAAM,IACJ,EAAM,SAAS,KAAA,KACf,MAAS,KAAA,KACT,EAAM,SAAS,EAAK,MAChB,IACJ,EAAM,WAAW,KAAA,KACjB,MAAS,KAAA,KACT,EAAM,WAAW,EAAK;EACxB,CAAI,KAAe,OACjB,EAAmB,CAAE,GACjB,MAAuB,KACzB,EAAoB;CAG1B,GACA,CAAC,CAAmB,CACtB,GAEM,IAAgB,EAAM,aACzB,MAAe;EAId,AAFA,EADa,EAAsB,EAAE,QAAQ,MAAM,EAAE,OAAO,CACtC,CAAI,GAC1B,EAAkB,CAAE,GACpB,EAAoB;CAKtB,GACA,CAAC,CAAmB,CACtB,GAEM,IAAQ,EAAM,eACX;EACL,UAAU,EAAS;EACnB,QAAQ,EAAS;EACjB;EACA;EACA;EACA;CACF,IACA;EAAC;EAAU;EAAW;EAAY;EAAe;CAAa,CAChE;CAEA,OACE,kBAAC,EAAqB,UAAtB;EAAsC;EACnC;CAC4B,CAAA;AAEnC;AAEA,SAAgB,IAAqD;CACnE,IAAM,IAAM,EAAM,WAAW,CAAoB;CACjD,IAAI,CAAC,GACH,MAAU,MACR,qEACF;CAEF,OAAO;AACT;AAcA,SAAgB,IAA0C;CACxD,IAAM,IAAM,EAAM,WAAW,CAAoB;CAEjD,OADI,IAAY,EAAI,SACb;EAAE,SAAS,EAAwB,KAAK;EAAY,OAAO;CAAK;AACzE"}
|
|
1
|
+
{"version":3,"file":"active-backend-context.js","names":[],"sources":["../../src/contexts/active-backend-context.tsx"],"sourcesContent":["import React from \"react\";\nimport { clearCachedAgentServerInfo } from \"#/api/agent-server-compatibility\";\nimport {\n getActiveSelection,\n getRegisteredBackends,\n getSnapshot,\n NO_BACKEND,\n setActiveSelection,\n setRegisteredBackends,\n subscribeActiveBackend,\n} from \"#/api/backend-registry/active-store\";\nimport { makeDefaultLocalBackend } from \"#/api/backend-registry/default-backend\";\nimport {\n dropBackendHealth,\n resetBackendHealth,\n} from \"#/api/backend-registry/health-store\";\nimport {\n type Backend,\n type BackendSelection,\n type ResolvedActiveBackend,\n} from \"#/api/backend-registry/types\";\nimport { QUERY_KEYS } from \"#/hooks/query/query-keys\";\nimport { queryClient } from \"#/query-client-config\";\nimport {\n setTelemetryCloudContext,\n setTelemetryIdentity,\n} from \"#/services/telemetry\";\n\ntype BackendInput = Omit<Backend, \"id\" | \"connectionRevision\">;\n\ninterface ActiveBackendContextValue {\n backends: Backend[];\n active: ResolvedActiveBackend;\n setActive: (backendId: string, orgId?: string | null) => void;\n addBackend: (backend: BackendInput) => Backend;\n updateBackend: (id: string, patch: Partial<BackendInput>) => void;\n removeBackend: (id: string) => void;\n}\n\nconst ActiveBackendContext =\n React.createContext<ActiveBackendContextValue | null>(null);\n\nfunction generateId(): string {\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto.randomUUID === \"function\"\n ) {\n return crypto.randomUUID();\n }\n return `backend-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;\n}\n\nfunction applyTelemetrySelectionBoundary(\n previous: ResolvedActiveBackend,\n next: ResolvedActiveBackend,\n): void {\n const previousWasCloud = previous.backend.kind === \"cloud\";\n const nextIsCloud = next.backend.kind === \"cloud\";\n if (!previousWasCloud && !nextIsCloud) return;\n\n setTelemetryCloudContext(null);\n\n if (\n nextIsCloud &&\n (!previousWasCloud || previous.backend.id !== next.backend.id)\n ) {\n void setTelemetryIdentity(null);\n }\n}\n\nexport function ActiveBackendProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n const snapshot = React.useSyncExternalStore(\n subscribeActiveBackend,\n getSnapshot,\n getSnapshot,\n );\n\n const retryBootstrapProbe = React.useCallback(() => {\n clearCachedAgentServerInfo();\n void queryClient.invalidateQueries({\n queryKey: QUERY_KEYS.WEB_CLIENT_CONFIG,\n });\n }, []);\n\n const setActive = React.useCallback(\n (backendId: string, orgId?: string | null) => {\n const currentSnapshot = getSnapshot();\n const prevBackendId = getActiveSelection()?.backendId ?? null;\n const prevOrgId = getActiveSelection()?.orgId ?? null;\n const nextOrgId = orgId ?? null;\n\n if (backendId === prevBackendId && nextOrgId === prevOrgId) return;\n\n const registeredBackends = getRegisteredBackends();\n const selectedBackend = registeredBackends.find(\n (b) => b.id === backendId,\n );\n const nextActive: ResolvedActiveBackend = {\n backend: selectedBackend ?? registeredBackends[0] ?? NO_BACKEND,\n orgId: selectedBackend ? nextOrgId : null,\n };\n applyTelemetrySelectionBoundary(currentSnapshot.active, nextActive);\n\n const next: BackendSelection = { backendId, orgId: nextOrgId };\n setActiveSelection(next);\n retryBootstrapProbe();\n\n // No blanket `invalidateQueries()` here. Long-lived queries\n // (`useSettings`, `usePaginatedConversations`,\n // `useGitRepositories`, `useAppInstallations`,\n // `useCloudCurrentUserId`, `useGitUser`, …) include the active\n // backend's `id` and `orgId` in their query keys, so React Query\n // treats a backend/org switch as a brand-new query and fetches\n // automatically — once, with no duplicate waves.\n },\n [retryBootstrapProbe],\n );\n\n // @spec BM-001 — Auto-switch to newly connected backend\n const addBackend = React.useCallback(\n (backend: BackendInput): Backend => {\n const previousActive = getSnapshot().active;\n const next: Backend = { ...backend, id: generateId() };\n const list = [...getRegisteredBackends(), next];\n applyTelemetrySelectionBoundary(previousActive, {\n backend: next,\n orgId: null,\n });\n setRegisteredBackends(list);\n setActiveSelection({ backendId: next.id });\n retryBootstrapProbe();\n return next;\n },\n [retryBootstrapProbe],\n );\n\n const updateBackend = React.useCallback(\n (id: string, patch: Partial<BackendInput>) => {\n const prev = getRegisteredBackends().find((b) => b.id === id);\n const activeBeforeUpdate = getSnapshot().active.backend.id;\n // Re-arm health polling when the user edits the fields that\n // actually drive the probe. Cosmetic edits (name) shouldn't\n // re-enable a backend that was disabled for being unreachable.\n const hostChanged =\n patch.host !== undefined &&\n prev !== undefined &&\n patch.host !== prev.host;\n const apiKeyChanged =\n patch.apiKey !== undefined &&\n prev !== undefined &&\n patch.apiKey !== prev.apiKey;\n const list = getRegisteredBackends().map((b) =>\n b.id === id\n ? {\n ...b,\n ...patch,\n connectionRevision:\n hostChanged || apiKeyChanged\n ? (b.connectionRevision ?? 0) + 1\n : b.connectionRevision,\n }\n : b,\n );\n setRegisteredBackends(list);\n\n if (hostChanged || apiKeyChanged) {\n resetBackendHealth(id);\n if (activeBeforeUpdate === id) {\n if (prev?.kind === \"cloud\") {\n setTelemetryCloudContext(null);\n void setTelemetryIdentity(null);\n }\n retryBootstrapProbe();\n }\n }\n },\n [retryBootstrapProbe],\n );\n\n const removeBackend = React.useCallback(\n (id: string) => {\n const removed = getRegisteredBackends().find((b) => b.id === id);\n const wasActiveCloud =\n removed?.kind === \"cloud\" &&\n getSnapshot().active.backend.id === removed.id;\n const list = getRegisteredBackends().filter((b) => b.id !== id);\n setRegisteredBackends(list);\n if (wasActiveCloud) {\n setTelemetryCloudContext(null);\n void setTelemetryIdentity(null);\n }\n dropBackendHealth(id);\n retryBootstrapProbe();\n // If the active selection pointed at this backend, the active\n // store falls back to the first remaining local backend (or the\n // env-derived default if no locals exist); consumer hooks re-key\n // by the new active backend identity and refetch automatically.\n },\n [retryBootstrapProbe],\n );\n\n const value = React.useMemo<ActiveBackendContextValue>(\n () => ({\n backends: snapshot.backends,\n active: snapshot.active,\n setActive,\n addBackend,\n updateBackend,\n removeBackend,\n }),\n [snapshot, setActive, addBackend, updateBackend, removeBackend],\n );\n\n return (\n <ActiveBackendContext.Provider value={value}>\n {children}\n </ActiveBackendContext.Provider>\n );\n}\n\nexport function useActiveBackendContext(): ActiveBackendContextValue {\n const ctx = React.useContext(ActiveBackendContext);\n if (!ctx) {\n throw new Error(\n \"useActiveBackendContext must be used inside <ActiveBackendProvider>\",\n );\n }\n return ctx;\n}\n\n/**\n * Read the resolved active backend.\n *\n * Falls back to a synthesized env-derived local backend when called\n * outside an `<ActiveBackendProvider>` (e.g. from a unit test that\n * mounts a narrow component without the full provider stack). That\n * synthesized backend is identical to the seed used on first install.\n *\n * Components that need to mutate state (`setActive`, `addBackend`,\n * etc.) must use `useActiveBackendContext()` directly — that throws if\n * the provider is missing, since mutation requires the live store.\n */\nexport function useActiveBackend(): ResolvedActiveBackend {\n const ctx = React.useContext(ActiveBackendContext);\n if (ctx) return ctx.active;\n return { backend: makeDefaultLocalBackend() ?? NO_BACKEND, orgId: null };\n}\n"],"mappings":";;;;;;;;;;AAuCA,IAAM,IACJ,EAAM,cAAgD,IAAI;AAE5D,SAAS,IAAqB;CAO5B,OALE,OAAO,SAAW,OAClB,OAAO,OAAO,cAAe,aAEtB,OAAO,WAAW,IAEpB,WAAW,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE;AACxE;AAEA,SAAS,EACP,GACA,GACM;CACN,IAAM,IAAmB,EAAS,QAAQ,SAAS,SAC7C,IAAc,EAAK,QAAQ,SAAS;CACtC,CAAC,KAAoB,CAAC,MAE1B,EAAyB,IAAI,GAG3B,MACC,CAAC,KAAoB,EAAS,QAAQ,OAAO,EAAK,QAAQ,OAE3D,EAA0B,IAAI;AAElC;AAEA,SAAgB,EAAsB,EACpC,eAGC;CACD,IAAM,IAAW,EAAM,qBACrB,GACA,GACA,CACF,GAEM,IAAsB,EAAM,kBAAkB;EAElD,AADA,EAA2B,GAC3B,EAAiB,kBAAkB,EACjC,UAAU,EAAW,kBACvB,CAAC;CACH,GAAG,CAAC,CAAC,GAEC,IAAY,EAAM,aACrB,GAAmB,MAA0B;EAC5C,IAAM,IAAkB,EAAY,GAC9B,IAAgB,EAAmB,GAAG,aAAa,MACnD,IAAY,EAAmB,GAAG,SAAS,MAC3C,IAAY,KAAS;EAE3B,IAAI,MAAc,KAAiB,MAAc,GAAW;EAE5D,IAAM,IAAqB,EAAsB,GAC3C,IAAkB,EAAmB,MACxC,MAAM,EAAE,OAAO,CAClB,GACM,IAAoC;GACxC,SAAS,KAAmB,EAAmB,MAAM;GACrD,OAAO,IAAkB,IAAY;EACvC;EAKA,AAJA,EAAgC,EAAgB,QAAQ,CAAU,GAGlE,EAAmB;GADc;GAAW,OAAO;EAChC,CAAI,GACvB,EAAoB;CAStB,GACA,CAAC,CAAmB,CACtB,GAGM,IAAa,EAAM,aACtB,MAAmC;EAClC,IAAM,IAAiB,EAAY,EAAE,QAC/B,IAAgB;GAAE,GAAG;GAAS,IAAI,EAAW;EAAE,GAC/C,IAAO,CAAC,GAAG,EAAsB,GAAG,CAAI;EAQ9C,OAPA,EAAgC,GAAgB;GAC9C,SAAS;GACT,OAAO;EACT,CAAC,GACD,EAAsB,CAAI,GAC1B,EAAmB,EAAE,WAAW,EAAK,GAAG,CAAC,GACzC,EAAoB,GACb;CACT,GACA,CAAC,CAAmB,CACtB,GAEM,IAAgB,EAAM,aACzB,GAAY,MAAiC;EAC5C,IAAM,IAAO,EAAsB,EAAE,MAAM,MAAM,EAAE,OAAO,CAAE,GACtD,IAAqB,EAAY,EAAE,OAAO,QAAQ,IAIlD,IACJ,EAAM,SAAS,KAAA,KACf,MAAS,KAAA,KACT,EAAM,SAAS,EAAK,MAChB,IACJ,EAAM,WAAW,KAAA,KACjB,MAAS,KAAA,KACT,EAAM,WAAW,EAAK;EAexB,AAFA,EAZa,EAAsB,EAAE,KAAK,MACxC,EAAE,OAAO,IACL;GACE,GAAG;GACH,GAAG;GACH,oBACE,KAAe,KACV,EAAE,sBAAsB,KAAK,IAC9B,EAAE;EACV,IACA,CAEgB,CAAI,IAEtB,KAAe,OACjB,EAAmB,CAAE,GACjB,MAAuB,MACrB,GAAM,SAAS,YACjB,EAAyB,IAAI,GAC7B,EAA0B,IAAI,IAEhC,EAAoB;CAG1B,GACA,CAAC,CAAmB,CACtB,GAEM,IAAgB,EAAM,aACzB,MAAe;EACd,IAAM,IAAU,EAAsB,EAAE,MAAM,MAAM,EAAE,OAAO,CAAE,GACzD,IACJ,GAAS,SAAS,WAClB,EAAY,EAAE,OAAO,QAAQ,OAAO,EAAQ;EAQ9C,AANA,EADa,EAAsB,EAAE,QAAQ,MAAM,EAAE,OAAO,CACtC,CAAI,GACtB,MACF,EAAyB,IAAI,GAC7B,EAA0B,IAAI,IAEhC,EAAkB,CAAE,GACpB,EAAoB;CAKtB,GACA,CAAC,CAAmB,CACtB,GAEM,IAAQ,EAAM,eACX;EACL,UAAU,EAAS;EACnB,QAAQ,EAAS;EACjB;EACA;EACA;EACA;CACF,IACA;EAAC;EAAU;EAAW;EAAY;EAAe;CAAa,CAChE;CAEA,OACE,kBAAC,EAAqB,UAAtB;EAAsC;EACnC;CAC4B,CAAA;AAEnC;AAEA,SAAgB,IAAqD;CACnE,IAAM,IAAM,EAAM,WAAW,CAAoB;CACjD,IAAI,CAAC,GACH,MAAU,MACR,qEACF;CAEF,OAAO;AACT;AAcA,SAAgB,IAA0C;CACxD,IAAM,IAAM,EAAM,WAAW,CAAoB;CAEjD,OADI,IAAY,EAAI,SACb;EAAE,SAAS,EAAwB,KAAK;EAAY,OAAO;CAAK;AACzE"}
|
package/dist/favicon-16x16.png
CHANGED
|
Binary file
|
package/dist/favicon-32x32.png
CHANGED
|
Binary file
|
package/dist/favicon.ico
CHANGED
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../query/query-keys.cjs"),t=require("../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"),n=require("../../node_modules/@tanstack/react-query/build/modern/useMutation.cjs"),r=require("../../utils/mcp-config.cjs"),i=require("../../api/settings-service/settings-service.api.cjs"),a=require("../query/use-settings.cjs"),o=require("../../api/mcp-health/mcp-health-store.cjs"),s=require("../../
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../query/query-keys.cjs"),t=require("../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"),n=require("../../node_modules/@tanstack/react-query/build/modern/useMutation.cjs"),r=require("../../utils/mcp-config.cjs"),i=require("../../api/settings-service/settings-service.api.cjs"),a=require("../query/use-settings.cjs"),o=require("../../api/mcp-health/mcp-health-store.cjs"),s=require("../../api/mcp-service/mcp-redacted-credentials.cjs"),c=require("../../utils/mcp-server-health-key.cjs");function l(){let l=t.useQueryClient(),{data:u}=a.useSettings();return n.useMutation({mutationFn:async({serverId:e,server:t})=>{let n=r.parseMcpConfig(u?.agent_settings?.mcp_config),a={sse_servers:[...n.sse_servers],stdio_servers:[...n.stdio_servers],shttp_servers:[...n.shttp_servers]},o=await s.substituteRedactedMcpCredentials(t),[c,l]=e.split(`-`),d=parseInt(l,10);c===`sse`?a.sse_servers[d]=r.toMcpSseServer(o):c===`stdio`?a.stdio_servers[d]=r.toMcpStdioServer(o):c===`shttp`&&(a.shttp_servers[d]=r.toMcpShttpServer(o)),await i.default.saveSettings({agent_settings_diff:{mcp_config:r.toSdkMcpConfig(a)}})},onSuccess:(t,n)=>{o.clearMcpServerHealth(c.getMcpServerHealthKey(n.server)),l.invalidateQueries({queryKey:e.SETTINGS_QUERY_KEYS.personal()})}})}exports.useUpdateMcpServer=l;
|
|
2
2
|
//# sourceMappingURL=use-update-mcp-server.cjs.map
|
|
@@ -5,8 +5,8 @@ import { parseMcpConfig as r, toMcpShttpServer as i, toMcpSseServer as a, toMcpS
|
|
|
5
5
|
import c from "../../api/settings-service/settings-service.api.js";
|
|
6
6
|
import { useSettings as l } from "../query/use-settings.js";
|
|
7
7
|
import { clearMcpServerHealth as u } from "../../api/mcp-health/mcp-health-store.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { substituteRedactedMcpCredentials as d } from "../../api/mcp-service/mcp-redacted-credentials.js";
|
|
9
|
+
import { getMcpServerHealthKey as f } from "../../utils/mcp-server-health-key.js";
|
|
10
10
|
//#region src/hooks/mutation/use-update-mcp-server.ts
|
|
11
11
|
function p() {
|
|
12
12
|
let p = t(), { data: m } = l();
|
|
@@ -16,11 +16,11 @@ function p() {
|
|
|
16
16
|
sse_servers: [...n.sse_servers],
|
|
17
17
|
stdio_servers: [...n.stdio_servers],
|
|
18
18
|
shttp_servers: [...n.shttp_servers]
|
|
19
|
-
}, u = await
|
|
20
|
-
|
|
19
|
+
}, u = await d(t), [f, p] = e.split("-"), h = parseInt(p, 10);
|
|
20
|
+
f === "sse" ? l.sse_servers[h] = a(u) : f === "stdio" ? l.stdio_servers[h] = o(u) : f === "shttp" && (l.shttp_servers[h] = i(u)), await c.saveSettings({ agent_settings_diff: { mcp_config: s(l) } });
|
|
21
21
|
},
|
|
22
22
|
onSuccess: (t, n) => {
|
|
23
|
-
u(
|
|
23
|
+
u(f(n.server)), p.invalidateQueries({ queryKey: e.personal() });
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.cjs","names":[],"sources":["../../../src/hooks/query/query-keys.ts"],"sourcesContent":["/**\n * Centralized query keys and cache configuration for TanStack Query.\n * Using constants ensures type safety and prevents typos.\n */\n\nimport { SettingsScope } from \"#/types/settings\";\n\nexport const QUERY_KEYS = {\n /** Web client configuration from the server */\n WEB_CLIENT_CONFIG: [\"web-client-config\"] as const,\n /** Same-origin OpenHands app cookie authentication status */\n MAIN_APP_COOKIE_AUTH: [\"main-app-cookie-auth\"] as const,\n} as const;\n\nexport const SETTINGS_QUERY_KEYS = {\n all: [\"settings\"] as const,\n byScope: (scope: SettingsScope) => [\"settings\", scope] as const,\n personal: () => [\"settings\", \"personal\"] as const,\n} as const;\n\nexport const LLM_PROFILES_QUERY_KEYS = {\n all: [\"llm-profiles\"] as const,\n} as const;\n\nexport const AGENT_PROFILES_QUERY_KEYS = {\n all: [\"agent-profiles\"] as const,\n} as const;\n\n/** Fail fast when older backends lack the profile endpoint. */\nexport const AGENT_PROFILES_RETRY_OPTIONS = {\n retry: false,\n} as const;\n\nexport const LLM_SUBSCRIPTION_QUERY_KEYS = {\n all: [\"llm-subscription\"] as const,\n openaiStatus: [\"llm-subscription\", \"openai\", \"status\"] as const,\n openaiModels: [\"llm-subscription\", \"openai\", \"models\"] as const,\n} as const;\n\nexport const LOCAL_WORKSPACES_QUERY_KEYS = {\n all: [\"local-workspaces\"] as const,\n} as const;\n\nexport const PLUGINS_QUERY_KEYS = {\n /** Dynamic marketplace catalog (used by `use-plugins-marketplace`). */\n marketplace: [\"plugins-marketplace\"] as const,\n /** Installed plugins from the local agent-server. */\n installed: [\"plugins-installed\"] as const,\n /** Locally-discovered ambient plugins (used by `use-local-plugins`). */\n local: [\"plugins-local\"] as const,\n} as const;\n\nexport const APP_UPDATE_QUERY_KEYS = {\n /** Latest published @openhands/agent-canvas version (npm `latest` dist-tag). */\n latestVersion: [\"agent-canvas-latest-version\"] as const,\n} as const;\n\n/** Cache configuration shared across all config-related queries */\nexport const CONFIG_CACHE_OPTIONS = {\n staleTime: 1000 * 60 * 5, // 5 minutes\n gcTime: 1000 * 60 * 15, // 15 minutes\n} as const;\n\nexport type QueryKeys = (typeof QUERY_KEYS)[keyof typeof QUERY_KEYS];\n"],"mappings":"gDAOA,IAAa,EAAa,CAExB,kBAAmB,CAAC,mBAAmB,EAEvC,qBAAsB,CAAC,sBAAsB,CAC/C,EAEa,EAAsB,CACjC,IAAK,CAAC,UAAU,EAChB,QAAU,GAAyB,CAAC,WAAY,CAAK,EACrD,aAAgB,CAAC,WAAY,UAAU,CACzC,EAEa,EAA0B,CACrC,IAAK,CAAC,cAAc,CACtB,EAEa,EAA4B,CACvC,IAAK,CAAC,gBAAgB,CACxB,EAGa,EAA+B,CAC1C,MAAO,EACT,EAEa,EAA8B,CACzC,IAAK,CAAC,kBAAkB,EACxB,aAAc,CAAC,mBAAoB,SAAU,QAAQ,EACrD,aAAc,CAAC,mBAAoB,SAAU,QAAQ,CACvD,EAEa,EAA8B,CACzC,IAAK,CAAC,kBAAkB,CAC1B,EAEa,EAAqB,CAEhC,YAAa,CAAC,qBAAqB,EAEnC,UAAW,CAAC,mBAAmB,EAE/B,MAAO,CAAC,eAAe,CACzB,
|
|
1
|
+
{"version":3,"file":"query-keys.cjs","names":[],"sources":["../../../src/hooks/query/query-keys.ts"],"sourcesContent":["/**\n * Centralized query keys and cache configuration for TanStack Query.\n * Using constants ensures type safety and prevents typos.\n */\n\nimport { SettingsScope } from \"#/types/settings\";\n\nexport const QUERY_KEYS = {\n /** Web client configuration from the server */\n WEB_CLIENT_CONFIG: [\"web-client-config\"] as const,\n /** Same-origin OpenHands app cookie authentication status */\n MAIN_APP_COOKIE_AUTH: [\"main-app-cookie-auth\"] as const,\n} as const;\n\nexport const SETTINGS_QUERY_KEYS = {\n all: [\"settings\"] as const,\n byScope: (scope: SettingsScope) => [\"settings\", scope] as const,\n personal: () => [\"settings\", \"personal\"] as const,\n} as const;\n\nexport const LLM_PROFILES_QUERY_KEYS = {\n all: [\"llm-profiles\"] as const,\n} as const;\n\nexport const AGENT_PROFILES_QUERY_KEYS = {\n all: [\"agent-profiles\"] as const,\n} as const;\n\n/** Fail fast when older backends lack the profile endpoint. */\nexport const AGENT_PROFILES_RETRY_OPTIONS = {\n retry: false,\n} as const;\n\nexport const LLM_SUBSCRIPTION_QUERY_KEYS = {\n all: [\"llm-subscription\"] as const,\n openaiStatus: [\"llm-subscription\", \"openai\", \"status\"] as const,\n openaiModels: [\"llm-subscription\", \"openai\", \"models\"] as const,\n} as const;\n\nexport const LOCAL_WORKSPACES_QUERY_KEYS = {\n all: [\"local-workspaces\"] as const,\n} as const;\n\nexport const PLUGINS_QUERY_KEYS = {\n /** Dynamic marketplace catalog (used by `use-plugins-marketplace`). */\n marketplace: [\"plugins-marketplace\"] as const,\n /** Installed plugins from the local agent-server. */\n installed: [\"plugins-installed\"] as const,\n /** Locally-discovered ambient plugins (used by `use-local-plugins`). */\n local: [\"plugins-local\"] as const,\n} as const;\n\nexport const SETUP_QUERY_KEYS = {\n /** What the deployment supports. The same answer for every setup entry. */\n capabilities: () => [\"setup-capabilities\"] as const,\n} as const;\n\nexport const APP_UPDATE_QUERY_KEYS = {\n /** Latest published @openhands/agent-canvas version (npm `latest` dist-tag). */\n latestVersion: [\"agent-canvas-latest-version\"] as const,\n} as const;\n\n/** Cache configuration shared across all config-related queries */\nexport const CONFIG_CACHE_OPTIONS = {\n staleTime: 1000 * 60 * 5, // 5 minutes\n gcTime: 1000 * 60 * 15, // 15 minutes\n} as const;\n\nexport type QueryKeys = (typeof QUERY_KEYS)[keyof typeof QUERY_KEYS];\n"],"mappings":"gDAOA,IAAa,EAAa,CAExB,kBAAmB,CAAC,mBAAmB,EAEvC,qBAAsB,CAAC,sBAAsB,CAC/C,EAEa,EAAsB,CACjC,IAAK,CAAC,UAAU,EAChB,QAAU,GAAyB,CAAC,WAAY,CAAK,EACrD,aAAgB,CAAC,WAAY,UAAU,CACzC,EAEa,EAA0B,CACrC,IAAK,CAAC,cAAc,CACtB,EAEa,EAA4B,CACvC,IAAK,CAAC,gBAAgB,CACxB,EAGa,EAA+B,CAC1C,MAAO,EACT,EAEa,EAA8B,CACzC,IAAK,CAAC,kBAAkB,EACxB,aAAc,CAAC,mBAAoB,SAAU,QAAQ,EACrD,aAAc,CAAC,mBAAoB,SAAU,QAAQ,CACvD,EAEa,EAA8B,CACzC,IAAK,CAAC,kBAAkB,CAC1B,EAEa,EAAqB,CAEhC,YAAa,CAAC,qBAAqB,EAEnC,UAAW,CAAC,mBAAmB,EAE/B,MAAO,CAAC,eAAe,CACzB,EAOa,EAAwB,CAEnC,cAAe,CAAC,6BAA6B,CAC/C,EAGa,EAAuB,CAClC,UAAW,IAAO,GAAK,EACvB,OAAQ,IAAO,GAAK,EACtB"}
|
|
@@ -40,6 +40,10 @@ export declare const PLUGINS_QUERY_KEYS: {
|
|
|
40
40
|
/** Locally-discovered ambient plugins (used by `use-local-plugins`). */
|
|
41
41
|
readonly local: readonly ["plugins-local"];
|
|
42
42
|
};
|
|
43
|
+
export declare const SETUP_QUERY_KEYS: {
|
|
44
|
+
/** What the deployment supports. The same answer for every setup entry. */
|
|
45
|
+
readonly capabilities: () => readonly ["setup-capabilities"];
|
|
46
|
+
};
|
|
43
47
|
export declare const APP_UPDATE_QUERY_KEYS: {
|
|
44
48
|
/** Latest published @openhands/agent-canvas version (npm `latest` dist-tag). */
|
|
45
49
|
readonly latestVersion: readonly ["agent-canvas-latest-version"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-keys.js","names":[],"sources":["../../../src/hooks/query/query-keys.ts"],"sourcesContent":["/**\n * Centralized query keys and cache configuration for TanStack Query.\n * Using constants ensures type safety and prevents typos.\n */\n\nimport { SettingsScope } from \"#/types/settings\";\n\nexport const QUERY_KEYS = {\n /** Web client configuration from the server */\n WEB_CLIENT_CONFIG: [\"web-client-config\"] as const,\n /** Same-origin OpenHands app cookie authentication status */\n MAIN_APP_COOKIE_AUTH: [\"main-app-cookie-auth\"] as const,\n} as const;\n\nexport const SETTINGS_QUERY_KEYS = {\n all: [\"settings\"] as const,\n byScope: (scope: SettingsScope) => [\"settings\", scope] as const,\n personal: () => [\"settings\", \"personal\"] as const,\n} as const;\n\nexport const LLM_PROFILES_QUERY_KEYS = {\n all: [\"llm-profiles\"] as const,\n} as const;\n\nexport const AGENT_PROFILES_QUERY_KEYS = {\n all: [\"agent-profiles\"] as const,\n} as const;\n\n/** Fail fast when older backends lack the profile endpoint. */\nexport const AGENT_PROFILES_RETRY_OPTIONS = {\n retry: false,\n} as const;\n\nexport const LLM_SUBSCRIPTION_QUERY_KEYS = {\n all: [\"llm-subscription\"] as const,\n openaiStatus: [\"llm-subscription\", \"openai\", \"status\"] as const,\n openaiModels: [\"llm-subscription\", \"openai\", \"models\"] as const,\n} as const;\n\nexport const LOCAL_WORKSPACES_QUERY_KEYS = {\n all: [\"local-workspaces\"] as const,\n} as const;\n\nexport const PLUGINS_QUERY_KEYS = {\n /** Dynamic marketplace catalog (used by `use-plugins-marketplace`). */\n marketplace: [\"plugins-marketplace\"] as const,\n /** Installed plugins from the local agent-server. */\n installed: [\"plugins-installed\"] as const,\n /** Locally-discovered ambient plugins (used by `use-local-plugins`). */\n local: [\"plugins-local\"] as const,\n} as const;\n\nexport const APP_UPDATE_QUERY_KEYS = {\n /** Latest published @openhands/agent-canvas version (npm `latest` dist-tag). */\n latestVersion: [\"agent-canvas-latest-version\"] as const,\n} as const;\n\n/** Cache configuration shared across all config-related queries */\nexport const CONFIG_CACHE_OPTIONS = {\n staleTime: 1000 * 60 * 5, // 5 minutes\n gcTime: 1000 * 60 * 15, // 15 minutes\n} as const;\n\nexport type QueryKeys = (typeof QUERY_KEYS)[keyof typeof QUERY_KEYS];\n"],"mappings":";AAOA,IAAa,IAAa;CAExB,mBAAmB,CAAC,mBAAmB;CAEvC,sBAAsB,CAAC,sBAAsB;AAC/C,GAEa,IAAsB;CACjC,KAAK,CAAC,UAAU;CAChB,UAAU,MAAyB,CAAC,YAAY,CAAK;CACrD,gBAAgB,CAAC,YAAY,UAAU;AACzC,GAEa,IAA0B,EACrC,KAAK,CAAC,cAAc,EACtB,GAEa,IAA4B,EACvC,KAAK,CAAC,gBAAgB,EACxB,GAGa,IAA+B,EAC1C,OAAO,GACT,GAEa,IAA8B;CACzC,KAAK,CAAC,kBAAkB;CACxB,cAAc;EAAC;EAAoB;EAAU;CAAQ;CACrD,cAAc;EAAC;EAAoB;EAAU;CAAQ;AACvD,GAEa,IAA8B,EACzC,KAAK,CAAC,kBAAkB,EAC1B,GAEa,IAAqB;CAEhC,aAAa,CAAC,qBAAqB;CAEnC,WAAW,CAAC,mBAAmB;CAE/B,OAAO,CAAC,eAAe;AACzB,
|
|
1
|
+
{"version":3,"file":"query-keys.js","names":[],"sources":["../../../src/hooks/query/query-keys.ts"],"sourcesContent":["/**\n * Centralized query keys and cache configuration for TanStack Query.\n * Using constants ensures type safety and prevents typos.\n */\n\nimport { SettingsScope } from \"#/types/settings\";\n\nexport const QUERY_KEYS = {\n /** Web client configuration from the server */\n WEB_CLIENT_CONFIG: [\"web-client-config\"] as const,\n /** Same-origin OpenHands app cookie authentication status */\n MAIN_APP_COOKIE_AUTH: [\"main-app-cookie-auth\"] as const,\n} as const;\n\nexport const SETTINGS_QUERY_KEYS = {\n all: [\"settings\"] as const,\n byScope: (scope: SettingsScope) => [\"settings\", scope] as const,\n personal: () => [\"settings\", \"personal\"] as const,\n} as const;\n\nexport const LLM_PROFILES_QUERY_KEYS = {\n all: [\"llm-profiles\"] as const,\n} as const;\n\nexport const AGENT_PROFILES_QUERY_KEYS = {\n all: [\"agent-profiles\"] as const,\n} as const;\n\n/** Fail fast when older backends lack the profile endpoint. */\nexport const AGENT_PROFILES_RETRY_OPTIONS = {\n retry: false,\n} as const;\n\nexport const LLM_SUBSCRIPTION_QUERY_KEYS = {\n all: [\"llm-subscription\"] as const,\n openaiStatus: [\"llm-subscription\", \"openai\", \"status\"] as const,\n openaiModels: [\"llm-subscription\", \"openai\", \"models\"] as const,\n} as const;\n\nexport const LOCAL_WORKSPACES_QUERY_KEYS = {\n all: [\"local-workspaces\"] as const,\n} as const;\n\nexport const PLUGINS_QUERY_KEYS = {\n /** Dynamic marketplace catalog (used by `use-plugins-marketplace`). */\n marketplace: [\"plugins-marketplace\"] as const,\n /** Installed plugins from the local agent-server. */\n installed: [\"plugins-installed\"] as const,\n /** Locally-discovered ambient plugins (used by `use-local-plugins`). */\n local: [\"plugins-local\"] as const,\n} as const;\n\nexport const SETUP_QUERY_KEYS = {\n /** What the deployment supports. The same answer for every setup entry. */\n capabilities: () => [\"setup-capabilities\"] as const,\n} as const;\n\nexport const APP_UPDATE_QUERY_KEYS = {\n /** Latest published @openhands/agent-canvas version (npm `latest` dist-tag). */\n latestVersion: [\"agent-canvas-latest-version\"] as const,\n} as const;\n\n/** Cache configuration shared across all config-related queries */\nexport const CONFIG_CACHE_OPTIONS = {\n staleTime: 1000 * 60 * 5, // 5 minutes\n gcTime: 1000 * 60 * 15, // 15 minutes\n} as const;\n\nexport type QueryKeys = (typeof QUERY_KEYS)[keyof typeof QUERY_KEYS];\n"],"mappings":";AAOA,IAAa,IAAa;CAExB,mBAAmB,CAAC,mBAAmB;CAEvC,sBAAsB,CAAC,sBAAsB;AAC/C,GAEa,IAAsB;CACjC,KAAK,CAAC,UAAU;CAChB,UAAU,MAAyB,CAAC,YAAY,CAAK;CACrD,gBAAgB,CAAC,YAAY,UAAU;AACzC,GAEa,IAA0B,EACrC,KAAK,CAAC,cAAc,EACtB,GAEa,IAA4B,EACvC,KAAK,CAAC,gBAAgB,EACxB,GAGa,IAA+B,EAC1C,OAAO,GACT,GAEa,IAA8B;CACzC,KAAK,CAAC,kBAAkB;CACxB,cAAc;EAAC;EAAoB;EAAU;CAAQ;CACrD,cAAc;EAAC;EAAoB;EAAU;CAAQ;AACvD,GAEa,IAA8B,EACzC,KAAK,CAAC,kBAAkB,EAC1B,GAEa,IAAqB;CAEhC,aAAa,CAAC,qBAAqB;CAEnC,WAAW,CAAC,mBAAmB;CAE/B,OAAO,CAAC,eAAe;AACzB,GAOa,IAAwB,EAEnC,eAAe,CAAC,6BAA6B,EAC/C,GAGa,IAAuB;CAClC,WAAW,MAAO,KAAK;CACvB,QAAQ,MAAO,KAAK;AACtB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@tanstack/react-query/build/modern/useQueries.cjs"),t=require("../../contexts/active-backend-context.cjs"),n=require("../../api/cloud/organization-service.api.cjs"),r=require("./use-cloud-organizations.cjs");function i(){let{backends:i}=t.useActiveBackendContext(),a=t.useActiveBackend(),o=r.useAllCloudOrganizations(),s=[];for(let e of i)if(e.kind===`cloud`){let t=o[e.id],n=e.id===a.backend.id&&a.orgId?a.orgId:t?.orgs[0]?.id??null;n&&s.push({backendId:e.id,orgIdForMe:n})}let c=e.useQueries({queries:s.map(({backendId:e,orgIdForMe:
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@tanstack/react-query/build/modern/useQueries.cjs"),t=require("../../contexts/active-backend-context.cjs"),n=require("../../api/cloud/organization-service.api.cjs"),r=require("./use-cloud-organizations.cjs");function i(){let{backends:i}=t.useActiveBackendContext(),a=t.useActiveBackend(),o=r.useAllCloudOrganizations(),s=[];for(let e of i)if(e.kind===`cloud`){let t=o[e.id],n=e.id===a.backend.id&&a.orgId?a.orgId:t?.orgs[0]?.id??null;n&&s.push({backendId:e.id,connectionRevision:e.connectionRevision??0,orgIdForMe:n})}let c=e.useQueries({queries:s.map(({backendId:e,connectionRevision:t,orgIdForMe:r})=>{let a=i.find(t=>t.id===e);return{queryKey:[`cloud-current-user`,e,r,t],queryFn:async()=>a?n.getCloudOrganizationMe(r,a):{orgId:r,userId:``},enabled:!!a,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}})}),l={};return s.forEach((e,t)=>{let n=c[t];l[e.backendId]={isLoading:n.isLoading,userId:n.data?.userId??null}}),l}exports.useCloudCurrentUserId=i;
|
|
2
2
|
//# sourceMappingURL=use-cloud-current-user-id.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cloud-current-user-id.cjs","names":[],"sources":["../../../src/hooks/query/use-cloud-current-user-id.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport {\n useActiveBackend,\n useActiveBackendContext,\n} from \"#/contexts/active-backend-context\";\nimport { useAllCloudOrganizations } from \"./use-cloud-organizations\";\n\n/**\n * Resolve the current user's `user_id` per cloud backend with one\n * `/api/organizations/{orgId}/me` call per backend (NOT one per org).\n *\n * The cloud contract: `/me` returns `{ org_id, user_id, … }`. `user_id`\n * is identical regardless of which org you ask, so we make a single\n * call per backend.\n *\n * Path-param rule: when `backend.id === active.backend.id` and\n * `active.orgId` is set, the call uses **that** orgId — i.e. `/me`\n * always tracks the currently selected environment for the active\n * backend. For inactive backends (or when no org is selected yet), the\n * first org is used as a sentinel just to obtain `user_id`. This\n * matches the requirement that `/me` reflect the selected org for the\n * active environment, while still supporting the personal-workspace\n * label across non-active backends in the dropdown.\n *\n * The query key includes `active.orgId`, so picking a different org\n * via `setActive` re-keys this query and refetches `/me` with the new\n * active orgId.\n */\nexport function useCloudCurrentUserId(): Record<\n string,\n { isLoading: boolean; userId: string | null }\n> {\n const { backends } = useActiveBackendContext();\n const active = useActiveBackend();\n const cloudOrgs = useAllCloudOrganizations();\n\n const targets: {
|
|
1
|
+
{"version":3,"file":"use-cloud-current-user-id.cjs","names":[],"sources":["../../../src/hooks/query/use-cloud-current-user-id.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport {\n useActiveBackend,\n useActiveBackendContext,\n} from \"#/contexts/active-backend-context\";\nimport { useAllCloudOrganizations } from \"./use-cloud-organizations\";\n\n/**\n * Resolve the current user's `user_id` per cloud backend with one\n * `/api/organizations/{orgId}/me` call per backend (NOT one per org).\n *\n * The cloud contract: `/me` returns `{ org_id, user_id, … }`. `user_id`\n * is identical regardless of which org you ask, so we make a single\n * call per backend.\n *\n * Path-param rule: when `backend.id === active.backend.id` and\n * `active.orgId` is set, the call uses **that** orgId — i.e. `/me`\n * always tracks the currently selected environment for the active\n * backend. For inactive backends (or when no org is selected yet), the\n * first org is used as a sentinel just to obtain `user_id`. This\n * matches the requirement that `/me` reflect the selected org for the\n * active environment, while still supporting the personal-workspace\n * label across non-active backends in the dropdown.\n *\n * The query key includes `active.orgId`, so picking a different org\n * via `setActive` re-keys this query and refetches `/me` with the new\n * active orgId.\n */\nexport function useCloudCurrentUserId(): Record<\n string,\n { isLoading: boolean; userId: string | null }\n> {\n const { backends } = useActiveBackendContext();\n const active = useActiveBackend();\n const cloudOrgs = useAllCloudOrganizations();\n\n const targets: {\n backendId: string;\n connectionRevision: number;\n orgIdForMe: string;\n }[] = [];\n for (const backend of backends) {\n if (backend.kind === \"cloud\") {\n const entry = cloudOrgs[backend.id];\n // Prefer the active org when this backend IS the active one and\n // an org has been selected; otherwise fall back to the first org\n // we know about for that backend.\n const preferredOrgId =\n backend.id === active.backend.id && active.orgId\n ? active.orgId\n : (entry?.orgs[0]?.id ?? null);\n if (preferredOrgId) {\n targets.push({\n backendId: backend.id,\n connectionRevision: backend.connectionRevision ?? 0,\n orgIdForMe: preferredOrgId,\n });\n }\n }\n }\n\n const results = useQueries({\n queries: targets.map(({ backendId, connectionRevision, orgIdForMe }) => {\n const backend = backends.find((b) => b.id === backendId);\n return {\n // `orgIdForMe` is included in the query key so re-resolving the\n // active org also re-keys this query → React Query refetches\n // automatically without relying on explicit invalidation.\n queryKey: [\n \"cloud-current-user\",\n backendId,\n orgIdForMe,\n connectionRevision,\n ] as const,\n queryFn: async () => {\n if (!backend) return { orgId: orgIdForMe, userId: \"\" };\n return getCloudOrganizationMe(orgIdForMe, backend);\n },\n enabled: !!backend,\n staleTime: 1000 * 60 * 5,\n retry: false,\n meta: { disableToast: true },\n };\n }),\n });\n\n const out: Record<string, { isLoading: boolean; userId: string | null }> = {};\n targets.forEach((target, index) => {\n const q = results[index];\n out[target.backendId] = {\n isLoading: q.isLoading,\n userId: q.data?.userId ?? null,\n };\n });\n return out;\n}\n"],"mappings":"oSA6BA,SAAgB,GAGd,CACA,GAAM,CAAE,YAAa,EAAA,wBAAwB,EACvC,EAAS,EAAA,iBAAiB,EAC1B,EAAY,EAAA,yBAAyB,EAErC,EAIA,CAAC,EACP,IAAK,IAAM,KAAW,EACpB,GAAI,EAAQ,OAAS,QAAS,CAC5B,IAAM,EAAQ,EAAU,EAAQ,IAI1B,EACJ,EAAQ,KAAO,EAAO,QAAQ,IAAM,EAAO,MACvC,EAAO,MACN,GAAO,KAAK,IAAI,IAAM,KACzB,GACF,EAAQ,KAAK,CACX,UAAW,EAAQ,GACnB,mBAAoB,EAAQ,oBAAsB,EAClD,WAAY,CACd,CAAC,CAEL,CAGF,IAAM,EAAU,EAAA,WAAW,CACzB,QAAS,EAAQ,KAAK,CAAE,YAAW,qBAAoB,gBAAiB,CACtE,IAAM,EAAU,EAAS,KAAM,GAAM,EAAE,KAAO,CAAS,EACvD,MAAO,CAIL,SAAU,CACR,qBACA,EACA,EACA,CACF,EACA,QAAS,SACF,EACE,EAAA,uBAAuB,EAAY,CAAO,EAD5B,CAAE,MAAO,EAAY,OAAQ,EAAG,EAGvD,QAAS,CAAC,CAAC,EACX,UAAW,IAAO,GAAK,EACvB,MAAO,GACP,KAAM,CAAE,aAAc,EAAK,CAC7B,CACF,CAAC,CACH,CAAC,EAEK,EAAqE,CAAC,EAQ5E,OAPA,EAAQ,SAAS,EAAQ,IAAU,CACjC,IAAM,EAAI,EAAQ,GAClB,EAAI,EAAO,WAAa,CACtB,UAAW,EAAE,UACb,OAAQ,EAAE,MAAM,QAAU,IAC5B,CACF,CAAC,EACM,CACT"}
|
|
@@ -9,22 +9,24 @@ function a() {
|
|
|
9
9
|
let t = s[e.id], n = e.id === o.backend.id && o.orgId ? o.orgId : t?.orgs[0]?.id ?? null;
|
|
10
10
|
n && c.push({
|
|
11
11
|
backendId: e.id,
|
|
12
|
+
connectionRevision: e.connectionRevision ?? 0,
|
|
12
13
|
orgIdForMe: n
|
|
13
14
|
});
|
|
14
15
|
}
|
|
15
|
-
let l = e({ queries: c.map(({ backendId: e,
|
|
16
|
-
let
|
|
16
|
+
let l = e({ queries: c.map(({ backendId: e, connectionRevision: t, orgIdForMe: n }) => {
|
|
17
|
+
let i = a.find((t) => t.id === e);
|
|
17
18
|
return {
|
|
18
19
|
queryKey: [
|
|
19
20
|
"cloud-current-user",
|
|
20
21
|
e,
|
|
22
|
+
n,
|
|
21
23
|
t
|
|
22
24
|
],
|
|
23
|
-
queryFn: async () =>
|
|
24
|
-
orgId:
|
|
25
|
+
queryFn: async () => i ? r(n, i) : {
|
|
26
|
+
orgId: n,
|
|
25
27
|
userId: ""
|
|
26
28
|
},
|
|
27
|
-
enabled: !!
|
|
29
|
+
enabled: !!i,
|
|
28
30
|
staleTime: 1e3 * 60 * 5,
|
|
29
31
|
retry: !1,
|
|
30
32
|
meta: { disableToast: !0 }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cloud-current-user-id.js","names":[],"sources":["../../../src/hooks/query/use-cloud-current-user-id.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport {\n useActiveBackend,\n useActiveBackendContext,\n} from \"#/contexts/active-backend-context\";\nimport { useAllCloudOrganizations } from \"./use-cloud-organizations\";\n\n/**\n * Resolve the current user's `user_id` per cloud backend with one\n * `/api/organizations/{orgId}/me` call per backend (NOT one per org).\n *\n * The cloud contract: `/me` returns `{ org_id, user_id, … }`. `user_id`\n * is identical regardless of which org you ask, so we make a single\n * call per backend.\n *\n * Path-param rule: when `backend.id === active.backend.id` and\n * `active.orgId` is set, the call uses **that** orgId — i.e. `/me`\n * always tracks the currently selected environment for the active\n * backend. For inactive backends (or when no org is selected yet), the\n * first org is used as a sentinel just to obtain `user_id`. This\n * matches the requirement that `/me` reflect the selected org for the\n * active environment, while still supporting the personal-workspace\n * label across non-active backends in the dropdown.\n *\n * The query key includes `active.orgId`, so picking a different org\n * via `setActive` re-keys this query and refetches `/me` with the new\n * active orgId.\n */\nexport function useCloudCurrentUserId(): Record<\n string,\n { isLoading: boolean; userId: string | null }\n> {\n const { backends } = useActiveBackendContext();\n const active = useActiveBackend();\n const cloudOrgs = useAllCloudOrganizations();\n\n const targets: {
|
|
1
|
+
{"version":3,"file":"use-cloud-current-user-id.js","names":[],"sources":["../../../src/hooks/query/use-cloud-current-user-id.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport {\n useActiveBackend,\n useActiveBackendContext,\n} from \"#/contexts/active-backend-context\";\nimport { useAllCloudOrganizations } from \"./use-cloud-organizations\";\n\n/**\n * Resolve the current user's `user_id` per cloud backend with one\n * `/api/organizations/{orgId}/me` call per backend (NOT one per org).\n *\n * The cloud contract: `/me` returns `{ org_id, user_id, … }`. `user_id`\n * is identical regardless of which org you ask, so we make a single\n * call per backend.\n *\n * Path-param rule: when `backend.id === active.backend.id` and\n * `active.orgId` is set, the call uses **that** orgId — i.e. `/me`\n * always tracks the currently selected environment for the active\n * backend. For inactive backends (or when no org is selected yet), the\n * first org is used as a sentinel just to obtain `user_id`. This\n * matches the requirement that `/me` reflect the selected org for the\n * active environment, while still supporting the personal-workspace\n * label across non-active backends in the dropdown.\n *\n * The query key includes `active.orgId`, so picking a different org\n * via `setActive` re-keys this query and refetches `/me` with the new\n * active orgId.\n */\nexport function useCloudCurrentUserId(): Record<\n string,\n { isLoading: boolean; userId: string | null }\n> {\n const { backends } = useActiveBackendContext();\n const active = useActiveBackend();\n const cloudOrgs = useAllCloudOrganizations();\n\n const targets: {\n backendId: string;\n connectionRevision: number;\n orgIdForMe: string;\n }[] = [];\n for (const backend of backends) {\n if (backend.kind === \"cloud\") {\n const entry = cloudOrgs[backend.id];\n // Prefer the active org when this backend IS the active one and\n // an org has been selected; otherwise fall back to the first org\n // we know about for that backend.\n const preferredOrgId =\n backend.id === active.backend.id && active.orgId\n ? active.orgId\n : (entry?.orgs[0]?.id ?? null);\n if (preferredOrgId) {\n targets.push({\n backendId: backend.id,\n connectionRevision: backend.connectionRevision ?? 0,\n orgIdForMe: preferredOrgId,\n });\n }\n }\n }\n\n const results = useQueries({\n queries: targets.map(({ backendId, connectionRevision, orgIdForMe }) => {\n const backend = backends.find((b) => b.id === backendId);\n return {\n // `orgIdForMe` is included in the query key so re-resolving the\n // active org also re-keys this query → React Query refetches\n // automatically without relying on explicit invalidation.\n queryKey: [\n \"cloud-current-user\",\n backendId,\n orgIdForMe,\n connectionRevision,\n ] as const,\n queryFn: async () => {\n if (!backend) return { orgId: orgIdForMe, userId: \"\" };\n return getCloudOrganizationMe(orgIdForMe, backend);\n },\n enabled: !!backend,\n staleTime: 1000 * 60 * 5,\n retry: false,\n meta: { disableToast: true },\n };\n }),\n });\n\n const out: Record<string, { isLoading: boolean; userId: string | null }> = {};\n targets.forEach((target, index) => {\n const q = results[index];\n out[target.backendId] = {\n isLoading: q.isLoading,\n userId: q.data?.userId ?? null,\n };\n });\n return out;\n}\n"],"mappings":";;;;;AA6BA,SAAgB,IAGd;CACA,IAAM,EAAE,gBAAa,EAAwB,GACvC,IAAS,EAAiB,GAC1B,IAAY,EAAyB,GAErC,IAIA,CAAC;CACP,KAAK,IAAM,KAAW,GACpB,IAAI,EAAQ,SAAS,SAAS;EAC5B,IAAM,IAAQ,EAAU,EAAQ,KAI1B,IACJ,EAAQ,OAAO,EAAO,QAAQ,MAAM,EAAO,QACvC,EAAO,QACN,GAAO,KAAK,IAAI,MAAM;EAC7B,AAAI,KACF,EAAQ,KAAK;GACX,WAAW,EAAQ;GACnB,oBAAoB,EAAQ,sBAAsB;GAClD,YAAY;EACd,CAAC;CAEL;CAGF,IAAM,IAAU,EAAW,EACzB,SAAS,EAAQ,KAAK,EAAE,cAAW,uBAAoB,oBAAiB;EACtE,IAAM,IAAU,EAAS,MAAM,MAAM,EAAE,OAAO,CAAS;EACvD,OAAO;GAIL,UAAU;IACR;IACA;IACA;IACA;GACF;GACA,SAAS,YACF,IACE,EAAuB,GAAY,CAAO,IAD5B;IAAE,OAAO;IAAY,QAAQ;GAAG;GAGvD,SAAS,CAAC,CAAC;GACX,WAAW,MAAO,KAAK;GACvB,OAAO;GACP,MAAM,EAAE,cAAc,GAAK;EAC7B;CACF,CAAC,EACH,CAAC,GAEK,IAAqE,CAAC;CAQ5E,OAPA,EAAQ,SAAS,GAAQ,MAAU;EACjC,IAAM,IAAI,EAAQ;EAClB,EAAI,EAAO,aAAa;GACtB,WAAW,EAAE;GACb,QAAQ,EAAE,MAAM,UAAU;EAC5B;CACF,CAAC,GACM;AACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@tanstack/react-query/build/modern/useQueries.cjs"),t=require("../../contexts/active-backend-context.cjs"),n=require("../../api/cloud/organization-service.api.cjs");function r(){let{backends:r}=t.useActiveBackendContext(),i=r.filter(e=>e.kind===`cloud`),a=e.useQueries({queries:i.map(e=>({queryKey:[`cloud-organizations`,e.id],queryFn:async()=>{let t=await n.getCloudOrganizations(e);if(e.authMode===`cookie`)return t;let r=await n.getCurrentCloudApiKey(e);return r.isLegacyKey||r.orgId===null?t:{...t,items:t.items.filter(e=>e.id===r.orgId)}},staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}))}),o={};return i.forEach((e,t)=>{let n=a[t];o[e.id]={backend:e,isLoading:n.isLoading,orgs:n.data?.items??[],currentOrgId:n.data?.currentOrgId??null}}),o}exports.useAllCloudOrganizations=r;
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@tanstack/react-query/build/modern/useQueries.cjs"),t=require("../../contexts/active-backend-context.cjs"),n=require("../../api/cloud/organization-service.api.cjs");function r(){let{backends:r}=t.useActiveBackendContext(),i=r.filter(e=>e.kind===`cloud`),a=e.useQueries({queries:i.map(e=>({queryKey:[`cloud-organizations`,e.id,e.connectionRevision??0],queryFn:async()=>{let t=await n.getCloudOrganizations(e);if(e.authMode===`cookie`)return t;let r=await n.getCurrentCloudApiKey(e);return r.isLegacyKey||r.orgId===null?t:{...t,items:t.items.filter(e=>e.id===r.orgId)}},staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}))}),o={};return i.forEach((e,t)=>{let n=a[t];o[e.id]={backend:e,isLoading:n.isLoading,orgs:n.data?.items??[],currentOrgId:n.data?.currentOrgId??null}}),o}exports.useAllCloudOrganizations=r;
|
|
2
2
|
//# sourceMappingURL=use-cloud-organizations.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cloud-organizations.cjs","names":[],"sources":["../../../src/hooks/query/use-cloud-organizations.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useActiveBackendContext } from \"#/contexts/active-backend-context\";\nimport {\n getCloudOrganizations,\n getCurrentCloudApiKey,\n} from \"#/api/cloud/organization-service.api\";\nimport type { Backend } from \"#/api/backend-registry/types\";\n\n/**\n * Fetch organizations for every registered cloud backend in parallel.\n *\n * Used by the BackendSelector to flatten each cloud backend into per-org\n * rows. Each query is keyed by the backend ID so React Query caches\n * responses independently and a switch (which clears the cache) refetches.\n */\nexport function useAllCloudOrganizations() {\n const { backends } = useActiveBackendContext();\n const cloudBackends = backends.filter((b) => b.kind === \"cloud\");\n\n const queries = useQueries({\n queries: cloudBackends.map((backend) => ({\n queryKey: [\"cloud-organizations\"
|
|
1
|
+
{"version":3,"file":"use-cloud-organizations.cjs","names":[],"sources":["../../../src/hooks/query/use-cloud-organizations.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useActiveBackendContext } from \"#/contexts/active-backend-context\";\nimport {\n getCloudOrganizations,\n getCurrentCloudApiKey,\n} from \"#/api/cloud/organization-service.api\";\nimport type { Backend } from \"#/api/backend-registry/types\";\n\n/**\n * Fetch organizations for every registered cloud backend in parallel.\n *\n * Used by the BackendSelector to flatten each cloud backend into per-org\n * rows. Each query is keyed by the backend ID so React Query caches\n * responses independently and a switch (which clears the cache) refetches.\n */\nexport function useAllCloudOrganizations() {\n const { backends } = useActiveBackendContext();\n const cloudBackends = backends.filter((b) => b.kind === \"cloud\");\n\n const queries = useQueries({\n queries: cloudBackends.map((backend) => ({\n queryKey: [\n \"cloud-organizations\",\n backend.id,\n backend.connectionRevision ?? 0,\n ],\n // Filter the user's full org membership down to the single org the\n // backend's API key is bound to. The cloud enforces one-key-one-org\n // server-side (HTTP 403 otherwise); without this filter the\n // selector would advertise orgs the key cannot use. Legacy keys\n // with no binding fall through unfiltered.\n queryFn: async () => {\n const orgs = await getCloudOrganizations(backend);\n if (backend.authMode === \"cookie\") return orgs;\n\n const key = await getCurrentCloudApiKey(backend);\n if (key.isLegacyKey || key.orgId === null) return orgs;\n return {\n ...orgs,\n items: orgs.items.filter((o) => o.id === key.orgId),\n };\n },\n staleTime: 1000 * 60 * 5,\n retry: false,\n meta: { disableToast: true },\n })),\n });\n\n // Map backend id -> result to make consumers easy to read.\n const byBackendId: Record<\n string,\n {\n backend: Backend;\n isLoading: boolean;\n orgs: { id: string; name: string; is_personal?: boolean }[];\n currentOrgId: string | null;\n }\n > = {};\n cloudBackends.forEach((backend, index) => {\n const q = queries[index];\n byBackendId[backend.id] = {\n backend,\n isLoading: q.isLoading,\n orgs: q.data?.items ?? [],\n currentOrgId: q.data?.currentOrgId ?? null,\n };\n });\n\n return byBackendId;\n}\n"],"mappings":"yPAeA,SAAgB,GAA2B,CACzC,GAAM,CAAE,YAAa,EAAA,wBAAwB,EACvC,EAAgB,EAAS,OAAQ,GAAM,EAAE,OAAS,OAAO,EAEzD,EAAU,EAAA,WAAW,CACzB,QAAS,EAAc,IAAK,IAAa,CACvC,SAAU,CACR,sBACA,EAAQ,GACR,EAAQ,oBAAsB,CAChC,EAMA,QAAS,SAAY,CACnB,IAAM,EAAO,MAAM,EAAA,sBAAsB,CAAO,EAChD,GAAI,EAAQ,WAAa,SAAU,OAAO,EAE1C,IAAM,EAAM,MAAM,EAAA,sBAAsB,CAAO,EAE/C,OADI,EAAI,aAAe,EAAI,QAAU,KAAa,EAC3C,CACL,GAAG,EACH,MAAO,EAAK,MAAM,OAAQ,GAAM,EAAE,KAAO,EAAI,KAAK,CACpD,CACF,EACA,UAAW,IAAO,GAAK,EACvB,MAAO,GACP,KAAM,CAAE,aAAc,EAAK,CAC7B,EAAE,CACJ,CAAC,EAGK,EAQF,CAAC,EAWL,OAVA,EAAc,SAAS,EAAS,IAAU,CACxC,IAAM,EAAI,EAAQ,GAClB,EAAY,EAAQ,IAAM,CACxB,UACA,UAAW,EAAE,UACb,KAAM,EAAE,MAAM,OAAS,CAAC,EACxB,aAAc,EAAE,MAAM,cAAgB,IACxC,CACF,CAAC,EAEM,CACT"}
|
|
@@ -4,7 +4,11 @@ import { getCloudOrganizations as n, getCurrentCloudApiKey as r } from "../../ap
|
|
|
4
4
|
//#region src/hooks/query/use-cloud-organizations.ts
|
|
5
5
|
function i() {
|
|
6
6
|
let { backends: i } = t(), a = i.filter((e) => e.kind === "cloud"), o = e({ queries: a.map((e) => ({
|
|
7
|
-
queryKey: [
|
|
7
|
+
queryKey: [
|
|
8
|
+
"cloud-organizations",
|
|
9
|
+
e.id,
|
|
10
|
+
e.connectionRevision ?? 0
|
|
11
|
+
],
|
|
8
12
|
queryFn: async () => {
|
|
9
13
|
let t = await n(e);
|
|
10
14
|
if (e.authMode === "cookie") return t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-cloud-organizations.js","names":[],"sources":["../../../src/hooks/query/use-cloud-organizations.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useActiveBackendContext } from \"#/contexts/active-backend-context\";\nimport {\n getCloudOrganizations,\n getCurrentCloudApiKey,\n} from \"#/api/cloud/organization-service.api\";\nimport type { Backend } from \"#/api/backend-registry/types\";\n\n/**\n * Fetch organizations for every registered cloud backend in parallel.\n *\n * Used by the BackendSelector to flatten each cloud backend into per-org\n * rows. Each query is keyed by the backend ID so React Query caches\n * responses independently and a switch (which clears the cache) refetches.\n */\nexport function useAllCloudOrganizations() {\n const { backends } = useActiveBackendContext();\n const cloudBackends = backends.filter((b) => b.kind === \"cloud\");\n\n const queries = useQueries({\n queries: cloudBackends.map((backend) => ({\n queryKey: [\"cloud-organizations\"
|
|
1
|
+
{"version":3,"file":"use-cloud-organizations.js","names":[],"sources":["../../../src/hooks/query/use-cloud-organizations.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { useActiveBackendContext } from \"#/contexts/active-backend-context\";\nimport {\n getCloudOrganizations,\n getCurrentCloudApiKey,\n} from \"#/api/cloud/organization-service.api\";\nimport type { Backend } from \"#/api/backend-registry/types\";\n\n/**\n * Fetch organizations for every registered cloud backend in parallel.\n *\n * Used by the BackendSelector to flatten each cloud backend into per-org\n * rows. Each query is keyed by the backend ID so React Query caches\n * responses independently and a switch (which clears the cache) refetches.\n */\nexport function useAllCloudOrganizations() {\n const { backends } = useActiveBackendContext();\n const cloudBackends = backends.filter((b) => b.kind === \"cloud\");\n\n const queries = useQueries({\n queries: cloudBackends.map((backend) => ({\n queryKey: [\n \"cloud-organizations\",\n backend.id,\n backend.connectionRevision ?? 0,\n ],\n // Filter the user's full org membership down to the single org the\n // backend's API key is bound to. The cloud enforces one-key-one-org\n // server-side (HTTP 403 otherwise); without this filter the\n // selector would advertise orgs the key cannot use. Legacy keys\n // with no binding fall through unfiltered.\n queryFn: async () => {\n const orgs = await getCloudOrganizations(backend);\n if (backend.authMode === \"cookie\") return orgs;\n\n const key = await getCurrentCloudApiKey(backend);\n if (key.isLegacyKey || key.orgId === null) return orgs;\n return {\n ...orgs,\n items: orgs.items.filter((o) => o.id === key.orgId),\n };\n },\n staleTime: 1000 * 60 * 5,\n retry: false,\n meta: { disableToast: true },\n })),\n });\n\n // Map backend id -> result to make consumers easy to read.\n const byBackendId: Record<\n string,\n {\n backend: Backend;\n isLoading: boolean;\n orgs: { id: string; name: string; is_personal?: boolean }[];\n currentOrgId: string | null;\n }\n > = {};\n cloudBackends.forEach((backend, index) => {\n const q = queries[index];\n byBackendId[backend.id] = {\n backend,\n isLoading: q.isLoading,\n orgs: q.data?.items ?? [],\n currentOrgId: q.data?.currentOrgId ?? null,\n };\n });\n\n return byBackendId;\n}\n"],"mappings":";;;;AAeA,SAAgB,IAA2B;CACzC,IAAM,EAAE,gBAAa,EAAwB,GACvC,IAAgB,EAAS,QAAQ,MAAM,EAAE,SAAS,OAAO,GAEzD,IAAU,EAAW,EACzB,SAAS,EAAc,KAAK,OAAa;EACvC,UAAU;GACR;GACA,EAAQ;GACR,EAAQ,sBAAsB;EAChC;EAMA,SAAS,YAAY;GACnB,IAAM,IAAO,MAAM,EAAsB,CAAO;GAChD,IAAI,EAAQ,aAAa,UAAU,OAAO;GAE1C,IAAM,IAAM,MAAM,EAAsB,CAAO;GAE/C,OADI,EAAI,eAAe,EAAI,UAAU,OAAa,IAC3C;IACL,GAAG;IACH,OAAO,EAAK,MAAM,QAAQ,MAAM,EAAE,OAAO,EAAI,KAAK;GACpD;EACF;EACA,WAAW,MAAO,KAAK;EACvB,OAAO;EACP,MAAM,EAAE,cAAc,GAAK;CAC7B,EAAE,EACJ,CAAC,GAGK,IAQF,CAAC;CAWL,OAVA,EAAc,SAAS,GAAS,MAAU;EACxC,IAAM,IAAI,EAAQ;EAClB,EAAY,EAAQ,MAAM;GACxB;GACA,WAAW,EAAE;GACb,MAAM,EAAE,MAAM,SAAS,CAAC;GACxB,cAAc,EAAE,MAAM,gBAAgB;EACxC;CACF,CAAC,GAEM;AACT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SetupCapabilitySupport } from "#/manifests/manifest-capabilities";
|
|
2
|
+
import type { DeploymentCapabilities, SetupEntry } from "#/manifests/types";
|
|
3
|
+
export interface SetupCapabilitiesResult {
|
|
4
|
+
/** The discovery response, or null when there is nothing to report. */
|
|
5
|
+
capabilities: DeploymentCapabilities | null;
|
|
6
|
+
supported: SetupCapabilitySupport;
|
|
7
|
+
/** Which requirements a `false` verdict came from; empty otherwise. */
|
|
8
|
+
unmet: string[];
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Ask the deployment what it supports, then compare that against what the
|
|
13
|
+
* manifest requires.
|
|
14
|
+
*
|
|
15
|
+
* A deployment that does not answer resolves to "unknown" rather than
|
|
16
|
+
* unsupported. Discovery is not implemented on every deployment yet, and
|
|
17
|
+
* refusing to render on a failed probe would block every manifest on the ones
|
|
18
|
+
* that simply cannot be asked. Nothing is resolved into the form in that case
|
|
19
|
+
* either, so the manifest's own defaults stand.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useSetupCapabilities(entry: SetupEntry): SetupCapabilitiesResult;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type IntegrationCatalogEntry as MarketplaceEntry } from "@openhands/extensions/integrations";
|
|
2
|
+
import type { SetupEntry, SetupIntegrationRequirement } from "#/manifests/types";
|
|
3
|
+
export interface MissingSetupIntegration {
|
|
4
|
+
id: string;
|
|
5
|
+
requirement: SetupIntegrationRequirement;
|
|
6
|
+
/** The catalog entry, when the id resolves to one. */
|
|
7
|
+
entry: MarketplaceEntry | null;
|
|
8
|
+
}
|
|
9
|
+
export interface SetupPrerequisitesResult {
|
|
10
|
+
/** Unconnected integrations the manifest declares as required. */
|
|
11
|
+
blockingIntegrations: MissingSetupIntegration[];
|
|
12
|
+
/** Unconnected integrations the manifest is willing to proceed without. */
|
|
13
|
+
warningIntegrations: MissingSetupIntegration[];
|
|
14
|
+
isBlocked: boolean;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Stage 3 — which of the accounts this manifest needs are already connected.
|
|
19
|
+
*
|
|
20
|
+
* A requirement is blocking unless it opts out with `required: false`, which is
|
|
21
|
+
* the manifest's way of saying the integration can be connected later, during
|
|
22
|
+
* setup itself.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSetupPrerequisites(entry: SetupEntry): SetupPrerequisitesResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),t=require("../contexts/active-backend-context.cjs"),n=require("../api/cloud/organization-service.api.cjs");var r=`edit_org_settings`;function i(){let{backend:i,orgId:a}=t.useActiveBackend(),o=i.kind===`cloud`,{data:s}=e.useQuery({queryKey:[`cloud-current-user`,i.id,a],queryFn:()=>n.getCloudOrganizationMe(a,i),enabled:o&&!!a,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});return o?s?.permissions?s.permissions.includes(r):s?.role===`owner`||s?.role===`admin`:!0}exports.useCanManageOrgProfiles=i;
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),t=require("../contexts/active-backend-context.cjs"),n=require("../api/cloud/organization-service.api.cjs");var r=`edit_org_settings`;function i(){let{backend:i,orgId:a}=t.useActiveBackend(),o=i.kind===`cloud`,{data:s}=e.useQuery({queryKey:[`cloud-current-user`,i.id,a,i.connectionRevision??0],queryFn:()=>n.getCloudOrganizationMe(a,i),enabled:o&&!!a,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});return o?s?.permissions?s.permissions.includes(r):s?.role===`owner`||s?.role===`admin`:!0}exports.useCanManageOrgProfiles=i;
|
|
2
2
|
//# sourceMappingURL=use-can-manage-org-profiles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-can-manage-org-profiles.cjs","names":[],"sources":["../../src/hooks/use-can-manage-org-profiles.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\n/**\n * Server-defined permission (mirrors the app-server's\n * `authorization.Permission.EDIT_ORG_SETTINGS`) that gates org-scoped profile\n * mutations (both LLM profiles and agent profiles).\n */\nconst EDIT_ORG_SETTINGS = \"edit_org_settings\";\n\n/**\n * Whether the current user may MUTATE org-scoped profiles — LLM profiles and\n * agent profiles alike — on the active backend: create, edit, rename, delete,\n * duplicate, or activate/switch.\n *\n * - Local agent-server (OSS): always `true`; the user owns their own profiles.\n * - Cloud: profiles are org-scoped. The app-server grants every mutating\n * profile action (save/delete/rename/activate) only to the `owner`/`admin`\n * roles via the `edit_org_settings` permission; a `member` is view-only. We\n * read the caller's server-defined permissions from\n * `GET /api/organizations/{orgId}/me` — the same call `useCloudCurrentUserId`\n * makes, reusing its query key so no extra request is issued — and fall back\n * to a role check when an older app-server doesn't return `permissions`.\n *\n * Returns `false` while the role/permissions are still loading or unknown on\n * cloud, so mutating controls never flash for a member before they resolve.\n */\nexport function useCanManageOrgProfiles(): boolean {\n const { backend, orgId } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n\n //
|
|
1
|
+
{"version":3,"file":"use-can-manage-org-profiles.cjs","names":[],"sources":["../../src/hooks/use-can-manage-org-profiles.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\n/**\n * Server-defined permission (mirrors the app-server's\n * `authorization.Permission.EDIT_ORG_SETTINGS`) that gates org-scoped profile\n * mutations (both LLM profiles and agent profiles).\n */\nconst EDIT_ORG_SETTINGS = \"edit_org_settings\";\n\n/**\n * Whether the current user may MUTATE org-scoped profiles — LLM profiles and\n * agent profiles alike — on the active backend: create, edit, rename, delete,\n * duplicate, or activate/switch.\n *\n * - Local agent-server (OSS): always `true`; the user owns their own profiles.\n * - Cloud: profiles are org-scoped. The app-server grants every mutating\n * profile action (save/delete/rename/activate) only to the `owner`/`admin`\n * roles via the `edit_org_settings` permission; a `member` is view-only. We\n * read the caller's server-defined permissions from\n * `GET /api/organizations/{orgId}/me` — the same call `useCloudCurrentUserId`\n * makes, reusing its query key so no extra request is issued — and fall back\n * to a role check when an older app-server doesn't return `permissions`.\n *\n * Returns `false` while the role/permissions are still loading or unknown on\n * cloud, so mutating controls never flash for a member before they resolve.\n */\nexport function useCanManageOrgProfiles(): boolean {\n const { backend, orgId } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n\n // Keep the key byte-identical to useCloudCurrentUserId so React Query shares\n // the cached /me result, including its connection-credential revision.\n // eslint-disable-next-line @tanstack/query/exhaustive-deps\n const { data } = useQuery({\n queryKey: [\n \"cloud-current-user\",\n backend.id,\n orgId,\n backend.connectionRevision ?? 0,\n ],\n queryFn: () => getCloudOrganizationMe(orgId!, backend),\n enabled: isCloud && !!orgId,\n staleTime: 1000 * 60 * 5,\n retry: false,\n meta: { disableToast: true },\n });\n\n if (!isCloud) return true;\n // Prefer the server-defined permission set; fall back to a role check for\n // older app-servers whose /me doesn't return `permissions` yet, so this\n // keeps working against either backend version.\n if (data?.permissions) {\n return data.permissions.includes(EDIT_ORG_SETTINGS);\n }\n return data?.role === \"owner\" || data?.role === \"admin\";\n}\n"],"mappings":"2OASA,IAAM,EAAoB,oBAmB1B,SAAgB,GAAmC,CACjD,GAAM,CAAE,UAAS,SAAU,EAAA,iBAAiB,EACtC,EAAU,EAAQ,OAAS,QAK3B,CAAE,QAAS,EAAA,SAAS,CACxB,SAAU,CACR,qBACA,EAAQ,GACR,EACA,EAAQ,oBAAsB,CAChC,EACA,YAAe,EAAA,uBAAuB,EAAQ,CAAO,EACrD,QAAS,GAAW,CAAC,CAAC,EACtB,UAAW,IAAO,GAAK,EACvB,MAAO,GACP,KAAM,CAAE,aAAc,EAAK,CAC7B,CAAC,EASD,OAPK,EAID,GAAM,YACD,EAAK,YAAY,SAAS,CAAiB,EAE7C,GAAM,OAAS,SAAW,GAAM,OAAS,QAP3B,EAQvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-can-manage-org-profiles.js","names":[],"sources":["../../src/hooks/use-can-manage-org-profiles.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\n/**\n * Server-defined permission (mirrors the app-server's\n * `authorization.Permission.EDIT_ORG_SETTINGS`) that gates org-scoped profile\n * mutations (both LLM profiles and agent profiles).\n */\nconst EDIT_ORG_SETTINGS = \"edit_org_settings\";\n\n/**\n * Whether the current user may MUTATE org-scoped profiles — LLM profiles and\n * agent profiles alike — on the active backend: create, edit, rename, delete,\n * duplicate, or activate/switch.\n *\n * - Local agent-server (OSS): always `true`; the user owns their own profiles.\n * - Cloud: profiles are org-scoped. The app-server grants every mutating\n * profile action (save/delete/rename/activate) only to the `owner`/`admin`\n * roles via the `edit_org_settings` permission; a `member` is view-only. We\n * read the caller's server-defined permissions from\n * `GET /api/organizations/{orgId}/me` — the same call `useCloudCurrentUserId`\n * makes, reusing its query key so no extra request is issued — and fall back\n * to a role check when an older app-server doesn't return `permissions`.\n *\n * Returns `false` while the role/permissions are still loading or unknown on\n * cloud, so mutating controls never flash for a member before they resolve.\n */\nexport function useCanManageOrgProfiles(): boolean {\n const { backend, orgId } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n\n //
|
|
1
|
+
{"version":3,"file":"use-can-manage-org-profiles.js","names":[],"sources":["../../src/hooks/use-can-manage-org-profiles.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { getCloudOrganizationMe } from \"#/api/cloud/organization-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\n/**\n * Server-defined permission (mirrors the app-server's\n * `authorization.Permission.EDIT_ORG_SETTINGS`) that gates org-scoped profile\n * mutations (both LLM profiles and agent profiles).\n */\nconst EDIT_ORG_SETTINGS = \"edit_org_settings\";\n\n/**\n * Whether the current user may MUTATE org-scoped profiles — LLM profiles and\n * agent profiles alike — on the active backend: create, edit, rename, delete,\n * duplicate, or activate/switch.\n *\n * - Local agent-server (OSS): always `true`; the user owns their own profiles.\n * - Cloud: profiles are org-scoped. The app-server grants every mutating\n * profile action (save/delete/rename/activate) only to the `owner`/`admin`\n * roles via the `edit_org_settings` permission; a `member` is view-only. We\n * read the caller's server-defined permissions from\n * `GET /api/organizations/{orgId}/me` — the same call `useCloudCurrentUserId`\n * makes, reusing its query key so no extra request is issued — and fall back\n * to a role check when an older app-server doesn't return `permissions`.\n *\n * Returns `false` while the role/permissions are still loading or unknown on\n * cloud, so mutating controls never flash for a member before they resolve.\n */\nexport function useCanManageOrgProfiles(): boolean {\n const { backend, orgId } = useActiveBackend();\n const isCloud = backend.kind === \"cloud\";\n\n // Keep the key byte-identical to useCloudCurrentUserId so React Query shares\n // the cached /me result, including its connection-credential revision.\n // eslint-disable-next-line @tanstack/query/exhaustive-deps\n const { data } = useQuery({\n queryKey: [\n \"cloud-current-user\",\n backend.id,\n orgId,\n backend.connectionRevision ?? 0,\n ],\n queryFn: () => getCloudOrganizationMe(orgId!, backend),\n enabled: isCloud && !!orgId,\n staleTime: 1000 * 60 * 5,\n retry: false,\n meta: { disableToast: true },\n });\n\n if (!isCloud) return true;\n // Prefer the server-defined permission set; fall back to a role check for\n // older app-servers whose /me doesn't return `permissions` yet, so this\n // keeps working against either backend version.\n if (data?.permissions) {\n return data.permissions.includes(EDIT_ORG_SETTINGS);\n }\n return data?.role === \"owner\" || data?.role === \"admin\";\n}\n"],"mappings":";;;;AASA,IAAM,IAAoB;AAmB1B,SAAgB,IAAmC;CACjD,IAAM,EAAE,YAAS,aAAU,EAAiB,GACtC,IAAU,EAAQ,SAAS,SAK3B,EAAE,YAAS,EAAS;EACxB,UAAU;GACR;GACA,EAAQ;GACR;GACA,EAAQ,sBAAsB;EAChC;EACA,eAAe,EAAuB,GAAQ,CAAO;EACrD,SAAS,KAAW,CAAC,CAAC;EACtB,WAAW,MAAO,KAAK;EACvB,OAAO;EACP,MAAM,EAAE,cAAc,GAAK;CAC7B,CAAC;CASD,OAPK,IAID,GAAM,cACD,EAAK,YAAY,SAAS,CAAiB,IAE7C,GAAM,SAAS,WAAW,GAAM,SAAS,UAP3B;AAQvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs");const e=require("./query/query-keys.cjs"),t=require("../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),n=require("../contexts/active-backend-context.cjs"),r=require("../api/profiles-service/profiles-service.api.cjs"),i=require("../constants/llm-subscription.cjs"),a=require("./query/use-llm-profiles.cjs"),o=require("./query/use-settings.cjs")
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");const e=require("./query/query-keys.cjs"),t=require("../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),n=require("../contexts/active-backend-context.cjs"),r=require("../api/profiles-service/profiles-service.api.cjs"),i=require("../constants/llm-subscription.cjs"),a=require("./query/use-llm-profiles.cjs"),o=require("./query/use-settings.cjs");require("../api/agent-profiles-service/agent-profiles-service.api.cjs");const s=require("./use-active-agent-profile.cjs"),c=require("./query/use-config.cjs"),l=require("../utils/settings-utils.cjs");function u(){let{data:u,isLoading:d,isError:f}=o.useSettings(),{data:p,isLoading:m,isError:h}=c.useConfig(),{data:g,isLoading:_,isError:v}=a.useLlmProfiles(),{backend:y,orgId:b}=n.useActiveBackend(),x=y.kind===`local`,{activeProfile:S,isLoading:C}=s.useActiveAgentProfile(),w=(S?.agent_kind??u?.agent_settings?.agent_kind)===`acp`,T=u?.llm_api_key_set===!0,E=S?.agent_kind===`openhands`&&!(x&&S.name==="default")?S.llm_profile_ref:void 0,D=(E?g?.profiles.find(e=>e.name===E):void 0)??g?.profiles.find(e=>e.name===g?.active_profile),O=D?.api_key_set===!0,k=x&&!!D&&!O,{data:A,isLoading:j,isError:M}=t.useQuery({queryKey:[...e.LLM_PROFILES_QUERY_KEYS.all,y.id,b,`detail`,D?.name],queryFn:()=>r.default.getProfile(D.name),...e.CONFIG_CACHE_OPTIONS,enabled:k,meta:{disableToast:!0}}),N=k&&i.isSubscriptionLlmConfig(A?.config),P=l.isSettingsPageHidden(`/settings/llm`,p?.feature_flags);return{isConfigured:w||P||(x?O||N:T),isLoading:d||f&&!u||m||h&&!p||_||v&&!g||C||k&&(j||M&&!A)}}exports.useLlmConfigured=u;
|
|
2
2
|
//# sourceMappingURL=use-llm-configured.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-llm-configured.cjs","names":[],"sources":["../../src/hooks/use-llm-configured.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useSettings } from \"#/hooks/query/use-settings\";\nimport { useConfig } from \"#/hooks/query/use-config\";\nimport { useLlmProfiles } from \"#/hooks/query/use-llm-profiles\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useActiveAgentProfile } from \"#/hooks/use-active-agent-profile\";\nimport { isSettingsPageHidden } from \"#/utils/settings-utils\";\nimport ProfilesService from \"#/api/profiles-service/profiles-service.api\";\nimport {\n CONFIG_CACHE_OPTIONS,\n LLM_PROFILES_QUERY_KEYS,\n} from \"#/hooks/query/query-keys\";\nimport { isSubscriptionLlmConfig } from \"#/constants/llm-subscription\";\n\ninterface LlmConfiguredResult {\n /**\n * True when the active backend's agent has a usable LLM:\n * - ACP agents own their LLM via a subprocess, so they never need a key.\n * - OpenHands agents are ready only once an LLM API key has been saved.\n * - When the LLM settings page is hidden by a feature flag there is no\n * place to finish setup, so we treat the LLM as configured to avoid\n * surfacing an actionless warning.\n */\n isConfigured: boolean;\n /**\n * True while the configured/unconfigured state is indeterminate — either\n * settings/config are still resolving, or a fetch failed and left us with no\n * data to decide from. Consumers should render nothing in this state so a\n * warning doesn't flash before data loads or on a transient network error.\n */\n isLoading: boolean;\n}\n\n/**\n * Reports whether the active backend's agent has an LLM ready to run\n * conversations. Surfaces the gap left by the onboarding \"Skip for now\" path,\n * which persists no settings — leaving an OpenHands agent without an API key.\n */\nexport function useLlmConfigured(): LlmConfiguredResult {\n const {\n data: settings,\n isLoading: settingsLoading,\n isError: settingsError,\n } = useSettings();\n const {\n data: config,\n isLoading: configLoading,\n isError: configError,\n } = useConfig();\n const {\n data: profilesData,\n isLoading: profilesLoading,\n isError: profilesError,\n } = useLlmProfiles();\n const { backend, orgId } = useActiveBackend();\n const isLocal = backend.kind === \"local\";\n\n // The active AgentProfile is the current agent — an ACP profile owns its LLM\n // via the subprocess and never needs an API key. Fall back to the global\n // agent settings only while the profile list loads.\n const {\n activeProfile: activeAgentProfile,\n isLoading: activeAgentProfileLoading,\n } = useActiveAgentProfile();\n const activeAgentKind = activeAgentProfile?.agent_kind;\n const isAcpAgent =\n (activeAgentKind ?? settings?.agent_settings?.agent_kind) === \"acp\";\n const hasApiKey = settings?.llm_api_key_set === true;\n // The LLM that will actually power the next conversation is the profile the\n // active AGENT profile references (`llm_profile_ref`) — conversations launch\n // from the agent profile, not the standalone \"active LLM profile\".\n const referencedLlmProfileName =\n activeAgentProfile?.agent_kind === \"openhands\"\n ? activeAgentProfile.llm_profile_ref\n : undefined;\n const referencedProfile = referencedLlmProfileName\n ? profilesData?.profiles.find(\n (profile) => profile.name === referencedLlmProfileName,\n )\n : undefined;\n // Fall back to the active LLM profile when the ref is absent (list loading,\n // or an agent profile without a ref) OR stale (names a profile that no longer\n // exists). This mirrors the launch-time fallback in `useCreateConversation`,\n // which drops a stale-ref profile launch to an `agent_settings` launch on the\n // active LLM. Without this fallback the two contradict each other: launch\n // succeeds via the fallback, but this hook reports `isConfigured: false` and\n // spuriously disables the composer + shows the banner — even inside a running\n // conversation (VascoSch92 review, #1571).\n const activeProfile =\n referencedProfile ??\n profilesData?.profiles.find(\n (profile) => profile.name === profilesData?.active_profile,\n );\n const hasActiveProfileApiKey = activeProfile?.api_key_set === true;\n const shouldLoadActiveProfileDetail =\n isLocal && !!activeProfile && !hasActiveProfileApiKey;\n const {\n data: activeProfileDetail,\n isLoading: activeProfileDetailLoading,\n isError: activeProfileDetailError,\n } = useQuery({\n queryKey: [\n ...LLM_PROFILES_QUERY_KEYS.all,\n backend.id,\n orgId,\n \"detail\",\n activeProfile?.name,\n ],\n queryFn: () => ProfilesService.getProfile(activeProfile!.name),\n ...CONFIG_CACHE_OPTIONS,\n enabled: shouldLoadActiveProfileDetail,\n meta: { disableToast: true },\n });\n const hasActiveProfileSubscription =\n shouldLoadActiveProfileDetail &&\n isSubscriptionLlmConfig(\n activeProfileDetail?.config as Record<string, unknown> | undefined,\n );\n const llmSettingsHidden = isSettingsPageHidden(\n \"/settings/llm\",\n config?.feature_flags,\n );\n\n // In local mode, profiles are the source of truth: a usable LLM must be\n // backed by an active profile that still exists and is authenticated. API-key\n // profiles use the list endpoint's api_key_set flag; subscription profiles\n // intentionally have no key, so we inspect the active profile detail config.\n // The raw settings key can be a stale copy left behind by a deleted profile\n // (settings are not cleared on delete), so we don't count it here. Cloud\n // backends don't use profiles and keep the settings-key signal.\n const hasUsableActiveProfile =\n hasActiveProfileApiKey || hasActiveProfileSubscription;\n const hasUsableLlm = isLocal ? hasUsableActiveProfile : hasApiKey;\n\n // Treat a fetch failure as indeterminate (same as loading) only when it\n // leaves us with no data to decide from — otherwise a transient network\n // error would surface the banner with the same urgency as a genuinely\n // missing API key. A settings 404 is deliberately not covered here:\n // `useSettings` maps it to DEFAULT_SETTINGS (no key, OpenHands agent) while\n // keeping `isError` set, and that is exactly the new-user / \"Skip for now\"\n // state the banner exists to catch — so we keep deciding from that data.\n const settingsIndeterminate = settingsLoading || (settingsError && !settings);\n const configIndeterminate = configLoading || (configError && !config);\n // The active agent profile decides `isAcpAgent` and which LLM profile the\n // next conversation runs; on a cold cache it's still loading, so decide\n // nothing yet — otherwise an ACP agent (which needs no key) briefly reads as\n // an unconfigured OpenHands agent and flashes the \"LLM not set up\" banner.\n const agentProfileIndeterminate = activeAgentProfileLoading;\n const profilesIndeterminate =\n profilesLoading || (profilesError && !profilesData);\n const activeProfileDetailIndeterminate =\n shouldLoadActiveProfileDetail &&\n (activeProfileDetailLoading ||\n (activeProfileDetailError && !activeProfileDetail));\n\n return {\n isConfigured: isAcpAgent || llmSettingsHidden || hasUsableLlm,\n isLoading:\n settingsIndeterminate ||\n configIndeterminate ||\n profilesIndeterminate ||\n agentProfileIndeterminate ||\n activeProfileDetailIndeterminate,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-llm-configured.cjs","names":[],"sources":["../../src/hooks/use-llm-configured.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useSettings } from \"#/hooks/query/use-settings\";\nimport { useConfig } from \"#/hooks/query/use-config\";\nimport { useLlmProfiles } from \"#/hooks/query/use-llm-profiles\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useActiveAgentProfile } from \"#/hooks/use-active-agent-profile\";\nimport { isSettingsPageHidden } from \"#/utils/settings-utils\";\nimport ProfilesService from \"#/api/profiles-service/profiles-service.api\";\nimport { WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME } from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport {\n CONFIG_CACHE_OPTIONS,\n LLM_PROFILES_QUERY_KEYS,\n} from \"#/hooks/query/query-keys\";\nimport { isSubscriptionLlmConfig } from \"#/constants/llm-subscription\";\n\ninterface LlmConfiguredResult {\n /**\n * True when the active backend's agent has a usable LLM:\n * - ACP agents own their LLM via a subprocess, so they never need a key.\n * - OpenHands agents are ready only once an LLM API key has been saved.\n * - When the LLM settings page is hidden by a feature flag there is no\n * place to finish setup, so we treat the LLM as configured to avoid\n * surfacing an actionless warning.\n */\n isConfigured: boolean;\n /**\n * True while the configured/unconfigured state is indeterminate — either\n * settings/config are still resolving, or a fetch failed and left us with no\n * data to decide from. Consumers should render nothing in this state so a\n * warning doesn't flash before data loads or on a transient network error.\n */\n isLoading: boolean;\n}\n\n/**\n * Reports whether the active backend's agent has an LLM ready to run\n * conversations. Surfaces the gap left by the onboarding \"Skip for now\" path,\n * which persists no settings — leaving an OpenHands agent without an API key.\n */\nexport function useLlmConfigured(): LlmConfiguredResult {\n const {\n data: settings,\n isLoading: settingsLoading,\n isError: settingsError,\n } = useSettings();\n const {\n data: config,\n isLoading: configLoading,\n isError: configError,\n } = useConfig();\n const {\n data: profilesData,\n isLoading: profilesLoading,\n isError: profilesError,\n } = useLlmProfiles();\n const { backend, orgId } = useActiveBackend();\n const isLocal = backend.kind === \"local\";\n\n // The active AgentProfile is the current agent — an ACP profile owns its LLM\n // via the subprocess and never needs an API key. Fall back to the global\n // agent settings only while the profile list loads.\n const {\n activeProfile: activeAgentProfile,\n isLoading: activeAgentProfileLoading,\n } = useActiveAgentProfile();\n const activeAgentKind = activeAgentProfile?.agent_kind;\n const isAcpAgent =\n (activeAgentKind ?? settings?.agent_settings?.agent_kind) === \"acp\";\n const hasApiKey = settings?.llm_api_key_set === true;\n // The LLM that will actually power the next conversation is the profile the\n // active AGENT profile references (`llm_profile_ref`) — conversations launch\n // from the agent profile, not the standalone \"active LLM profile\".\n // Except the local seeded `default` profile: `useCreateConversation` launches\n // it via `agent_settings` on the ACTIVE LLM, not the seed's ref, so gating on\n // that ref blocks launches that would have succeeded (#16193).\n const referencedLlmProfileName =\n activeAgentProfile?.agent_kind === \"openhands\" &&\n !(\n isLocal &&\n activeAgentProfile.name === WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME\n )\n ? activeAgentProfile.llm_profile_ref\n : undefined;\n const referencedProfile = referencedLlmProfileName\n ? profilesData?.profiles.find(\n (profile) => profile.name === referencedLlmProfileName,\n )\n : undefined;\n // Fall back to the active LLM profile when the ref is absent (list loading,\n // or an agent profile without a ref) OR stale (names a profile that no longer\n // exists). This mirrors the launch-time fallback in `useCreateConversation`,\n // which drops a stale-ref profile launch to an `agent_settings` launch on the\n // active LLM. Without this fallback the two contradict each other: launch\n // succeeds via the fallback, but this hook reports `isConfigured: false` and\n // spuriously disables the composer + shows the banner — even inside a running\n // conversation (VascoSch92 review, #1571).\n const activeProfile =\n referencedProfile ??\n profilesData?.profiles.find(\n (profile) => profile.name === profilesData?.active_profile,\n );\n const hasActiveProfileApiKey = activeProfile?.api_key_set === true;\n const shouldLoadActiveProfileDetail =\n isLocal && !!activeProfile && !hasActiveProfileApiKey;\n const {\n data: activeProfileDetail,\n isLoading: activeProfileDetailLoading,\n isError: activeProfileDetailError,\n } = useQuery({\n queryKey: [\n ...LLM_PROFILES_QUERY_KEYS.all,\n backend.id,\n orgId,\n \"detail\",\n activeProfile?.name,\n ],\n queryFn: () => ProfilesService.getProfile(activeProfile!.name),\n ...CONFIG_CACHE_OPTIONS,\n enabled: shouldLoadActiveProfileDetail,\n meta: { disableToast: true },\n });\n const hasActiveProfileSubscription =\n shouldLoadActiveProfileDetail &&\n isSubscriptionLlmConfig(\n activeProfileDetail?.config as Record<string, unknown> | undefined,\n );\n const llmSettingsHidden = isSettingsPageHidden(\n \"/settings/llm\",\n config?.feature_flags,\n );\n\n // In local mode, profiles are the source of truth: a usable LLM must be\n // backed by an active profile that still exists and is authenticated. API-key\n // profiles use the list endpoint's api_key_set flag; subscription profiles\n // intentionally have no key, so we inspect the active profile detail config.\n // The raw settings key can be a stale copy left behind by a deleted profile\n // (settings are not cleared on delete), so we don't count it here. Cloud\n // backends don't use profiles and keep the settings-key signal.\n const hasUsableActiveProfile =\n hasActiveProfileApiKey || hasActiveProfileSubscription;\n const hasUsableLlm = isLocal ? hasUsableActiveProfile : hasApiKey;\n\n // Treat a fetch failure as indeterminate (same as loading) only when it\n // leaves us with no data to decide from — otherwise a transient network\n // error would surface the banner with the same urgency as a genuinely\n // missing API key. A settings 404 is deliberately not covered here:\n // `useSettings` maps it to DEFAULT_SETTINGS (no key, OpenHands agent) while\n // keeping `isError` set, and that is exactly the new-user / \"Skip for now\"\n // state the banner exists to catch — so we keep deciding from that data.\n const settingsIndeterminate = settingsLoading || (settingsError && !settings);\n const configIndeterminate = configLoading || (configError && !config);\n // The active agent profile decides `isAcpAgent` and which LLM profile the\n // next conversation runs; on a cold cache it's still loading, so decide\n // nothing yet — otherwise an ACP agent (which needs no key) briefly reads as\n // an unconfigured OpenHands agent and flashes the \"LLM not set up\" banner.\n const agentProfileIndeterminate = activeAgentProfileLoading;\n const profilesIndeterminate =\n profilesLoading || (profilesError && !profilesData);\n const activeProfileDetailIndeterminate =\n shouldLoadActiveProfileDetail &&\n (activeProfileDetailLoading ||\n (activeProfileDetailError && !activeProfileDetail));\n\n return {\n isConfigured: isAcpAgent || llmSettingsHidden || hasUsableLlm,\n isLoading:\n settingsIndeterminate ||\n configIndeterminate ||\n profilesIndeterminate ||\n agentProfileIndeterminate ||\n activeProfileDetailIndeterminate,\n };\n}\n"],"mappings":"4lBAuCA,SAAgB,GAAwC,CACtD,GAAM,CACJ,KAAM,EACN,UAAW,EACX,QAAS,GACP,EAAA,YAAY,EACV,CACJ,KAAM,EACN,UAAW,EACX,QAAS,GACP,EAAA,UAAU,EACR,CACJ,KAAM,EACN,UAAW,EACX,QAAS,GACP,EAAA,eAAe,EACb,CAAE,UAAS,SAAU,EAAA,iBAAiB,EACtC,EAAU,EAAQ,OAAS,QAK3B,CACJ,cAAe,EACf,UAAW,GACT,EAAA,sBAAsB,EAEpB,GADkB,GAAoB,YAEtB,GAAU,gBAAgB,cAAgB,MAC1D,EAAY,GAAU,kBAAoB,GAO1C,EACJ,GAAoB,aAAe,aACnC,EACE,GACA,EAAmB,OAAA,WAEjB,EAAmB,gBACnB,IAAA,GAcA,GAboB,EACtB,GAAc,SAAS,KACpB,GAAY,EAAQ,OAAS,CAChC,EACA,IAAA,KAWF,GAAc,SAAS,KACpB,GAAY,EAAQ,OAAS,GAAc,cAC9C,EACI,EAAyB,GAAe,cAAgB,GACxD,EACJ,GAAW,CAAC,CAAC,GAAiB,CAAC,EAC3B,CACJ,KAAM,EACN,UAAW,EACX,QAAS,GACP,EAAA,SAAS,CACX,SAAU,CACR,GAAG,EAAA,wBAAwB,IAC3B,EAAQ,GACR,EACA,SACA,GAAe,IACjB,EACA,YAAe,EAAA,QAAgB,WAAW,EAAe,IAAI,EAC7D,GAAG,EAAA,qBACH,QAAS,EACT,KAAM,CAAE,aAAc,EAAK,CAC7B,CAAC,EACK,EACJ,GACA,EAAA,wBACE,GAAqB,MACvB,EACI,EAAoB,EAAA,qBACxB,gBACA,GAAQ,aACV,EAkCA,MAAO,CACL,aAAc,GAAc,IAxBT,EADnB,GAA0B,EAC4B,GAyBtD,UAhB4B,GAAoB,GAAiB,CAAC,GACxC,GAAkB,GAAe,CAAC,GAO5D,GAAoB,GAAiB,CAAC,GAYpC,GAVF,IACC,GACE,GAA4B,CAAC,EAUlC,CACF"}
|