@openhands/agent-canvas 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/acp-providers-DOKcGeaV.js +1 -0
- package/build/assets/active-backend-context-BETEdaJl.js +2 -0
- package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
- package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
- package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
- package/build/assets/agent-settings-BnzyTgCb.js +2 -0
- package/build/assets/agent-settings-CeXj3xK-.js +1 -0
- package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
- package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
- package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
- package/build/assets/automation-detail-CF2SweVs.js +3 -0
- package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
- package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
- package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
- package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
- package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
- package/build/assets/automations-list-yK7ETmYP.js +1 -0
- package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
- package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
- package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
- package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
- package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
- package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
- package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
- package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
- package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
- package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
- package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
- package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
- package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
- package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
- package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
- package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
- package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
- package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
- package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
- package/build/assets/conversation-XRsI28ZM.js +1 -0
- package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
- package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
- package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
- package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
- package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
- package/build/assets/empty-state-B5advKVW.js +1 -0
- package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
- package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
- package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
- package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
- package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
- package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
- package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
- package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
- package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
- package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
- package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
- package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
- package/build/assets/home-4lyLzYjG.js +1 -0
- package/build/assets/home-BGaB0EeK.js +1 -0
- package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
- package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
- package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
- package/build/assets/index-home-6Y_Y7kOo.js +1 -0
- package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
- package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
- package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
- package/build/assets/link-external-B4gx3EeM.js +1 -0
- package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
- package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
- package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
- package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
- package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
- package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
- package/build/assets/manifest-23d79467.js +1 -0
- package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
- package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
- package/build/assets/mcp-CoUOIGBF.js +1 -0
- package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
- package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
- package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
- package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
- package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
- package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
- package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
- package/build/assets/onboarding-Cc4Av7bi.js +1 -0
- package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
- package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.js} +1 -1
- package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
- package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-yISBVUKu.js} +1 -1
- package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
- package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
- package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
- package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
- package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
- package/build/assets/root-D1y82Lhg.js +2 -0
- package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
- package/build/assets/root-sEWn3ha1.css +1 -0
- package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
- package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
- package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
- package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
- package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
- package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
- package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
- package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
- package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
- package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
- package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
- package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
- package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
- package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
- package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
- package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
- package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
- package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
- package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
- package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
- package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
- package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
- package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
- package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
- package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
- package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
- package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
- package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
- package/build/assets/trash-D1QMHInX.js +1 -0
- package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
- package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
- package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
- package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
- package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
- package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
- package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
- package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
- package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
- package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
- package/build/assets/use-create-conversation-D15Px574.js +1 -0
- package/build/assets/use-create-secret-D_qPU88t.js +1 -0
- package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
- package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
- package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
- package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
- package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
- package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
- package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
- package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
- package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
- package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
- package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
- package/build/assets/use-tracking-BAFpgpgq.js +3 -0
- package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
- package/build/assets/utils-CbjwNcR-.js +1 -0
- package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
- package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +18 -1
- package/build/locales/ca/openhands.json +18 -1
- package/build/locales/de/openhands.json +18 -1
- package/build/locales/en/openhands.json +18 -1
- package/build/locales/es/openhands.json +18 -1
- package/build/locales/fr/openhands.json +18 -1
- package/build/locales/it/openhands.json +18 -1
- package/build/locales/ja/openhands.json +18 -1
- package/build/locales/ko-KR/openhands.json +18 -1
- package/build/locales/no/openhands.json +18 -1
- package/build/locales/pt/openhands.json +18 -1
- package/build/locales/tr/openhands.json +18 -1
- package/build/locales/uk/openhands.json +18 -1
- package/build/locales/zh-CN/openhands.json +18 -1
- package/build/locales/zh-TW/openhands.json +18 -1
- package/config/defaults.json +3 -3
- package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
- package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
- package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
- package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
- 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/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +0 -5
- package/dist/constants/acp-providers.js +20 -16
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/constants/profile-scope.d.ts +21 -0
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +30 -19
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
- package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +1 -0
- package/dist/hooks/query/query-keys.js +10 -1
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
- package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
- package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.js +3 -1
- package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
- package/dist/hooks/use-drag-resize.cjs +1 -1
- package/dist/hooks/use-drag-resize.cjs.map +1 -1
- package/dist/hooks/use-drag-resize.js +8 -9
- package/dist/hooks/use-drag-resize.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 +18 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +3 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +289 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +18 -1
- package/dist/locales/ca/openhands.json +18 -1
- package/dist/locales/de/openhands.json +18 -1
- package/dist/locales/en/openhands.json +18 -1
- package/dist/locales/es/openhands.json +18 -1
- package/dist/locales/fr/openhands.json +18 -1
- package/dist/locales/it/openhands.json +18 -1
- package/dist/locales/ja/openhands.json +18 -1
- package/dist/locales/ko-KR/openhands.json +18 -1
- package/dist/locales/no/openhands.json +18 -1
- package/dist/locales/pt/openhands.json +18 -1
- package/dist/locales/tr/openhands.json +18 -1
- package/dist/locales/uk/openhands.json +18 -1
- package/dist/locales/zh-CN/openhands.json +18 -1
- package/dist/locales/zh-TW/openhands.json +18 -1
- package/dist/manifests/automation-setup.cjs.map +1 -1
- package/dist/manifests/automation-setup.js.map +1 -1
- package/dist/manifests/manifest-local-validation.cjs.map +1 -1
- package/dist/manifests/manifest-local-validation.js.map +1 -1
- package/dist/manifests/manifest-validation.cjs +1 -1
- package/dist/manifests/manifest-validation.cjs.map +1 -1
- package/dist/manifests/manifest-validation.js +2 -2
- package/dist/manifests/manifest-validation.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
- 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 +2 -2
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +11 -0
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +26 -2
- package/dist/types/automation.js.map +1 -1
- package/dist/utils/automation-disabled-reason.cjs +2 -0
- package/dist/utils/automation-disabled-reason.cjs.map +1 -0
- package/dist/utils/automation-disabled-reason.d.ts +32 -0
- package/dist/utils/automation-disabled-reason.js +19 -0
- package/dist/utils/automation-disabled-reason.js.map +1 -0
- package/dist/utils/parse-git-remote-url.cjs +1 -1
- package/dist/utils/parse-git-remote-url.cjs.map +1 -1
- package/dist/utils/parse-git-remote-url.d.ts +5 -1
- package/dist/utils/parse-git-remote-url.js +20 -13
- package/dist/utils/parse-git-remote-url.js.map +1 -1
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +79 -8
- package/scripts/dev-safe.mjs +14 -1
- package/scripts/docker-build.mjs +3 -0
- package/scripts/static-server.mjs +24 -7
- package/build/assets/acp-providers-DcY_mKYa.js +0 -1
- package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
- package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
- package/build/assets/agent-settings-BF8hM6wb.js +0 -2
- package/build/assets/agent-settings-YPutBAeR.js +0 -1
- package/build/assets/automation-detail-BxXhb_m2.js +0 -3
- package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
- package/build/assets/automations-list-DEPVNud3.js +0 -1
- package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
- package/build/assets/conversation-edjzrv5w.js +0 -1
- package/build/assets/conversation-panel-edjzrv5w.js +0 -1
- package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
- package/build/assets/empty-state-FK_s1B60.js +0 -1
- package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
- package/build/assets/home-BM5_Wz_R.js +0 -1
- package/build/assets/home-Ivfm7KC4.js +0 -1
- package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
- package/build/assets/index-home-td9BN2T3.js +0 -1
- package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
- package/build/assets/link-external-BNZzCM1I.js +0 -1
- package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
- package/build/assets/llm-settings-CZaXYgtw.js +0 -1
- package/build/assets/manifest-bfeccb98.js +0 -1
- package/build/assets/mcp-CraxoXQv.js +0 -1
- package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
- package/build/assets/mcp-page-CteH_K0N.js +0 -9
- package/build/assets/onboarding-DXFBRqEy.js +0 -1
- package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
- package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
- package/build/assets/root-CM6IZHlg.css +0 -1
- package/build/assets/root-DdFkodKW.js +0 -2
- package/build/assets/trash-Ckh7yCaB.js +0 -1
- package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
- package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
- package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
- package/build/assets/use-tracking-j4uo9VEW.js +0 -3
- package/build/assets/utils-BgLSZdyy.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
|
@@ -25,8 +25,8 @@ var v = ["create-conversation"], y = () => {
|
|
|
25
25
|
],
|
|
26
26
|
queryFn: m.listProfiles,
|
|
27
27
|
...t
|
|
28
|
-
}), D = T ?? E.active_agent_profile_id ?? void 0, O = D ? E?.profiles?.find((e) => e.id === D) : void 0, k = S.kind === "cloud", A =
|
|
29
|
-
if (!k && O?.name === "default" && O?.agent_kind === "openhands") A =
|
|
28
|
+
}), D = T ?? E.active_agent_profile_id ?? void 0, O = D ? E?.profiles?.find((e) => e.id === D) : void 0, k = S.kind === "cloud", A = !1, j = null;
|
|
29
|
+
if (!k && O?.name === "default" && O?.agent_kind === "openhands") A = !0;
|
|
30
30
|
else if (O?.agent_kind === "openhands" && O.llm_profile_ref) {
|
|
31
31
|
let e = !1;
|
|
32
32
|
try {
|
|
@@ -41,9 +41,20 @@ var v = ["create-conversation"], y = () => {
|
|
|
41
41
|
});
|
|
42
42
|
e = t.profiles.some((e) => e.name === O.llm_profile_ref), j = t.active_profile ?? null;
|
|
43
43
|
} catch {}
|
|
44
|
-
e ? !k && !T && j && j !== O.llm_profile_ref && (A =
|
|
44
|
+
e ? !k && !T && j && j !== O.llm_profile_ref && (A = !0) : (console.warn(`Agent profile "${O.name}" references missing LLM profile "${O.llm_profile_ref}"; launching from agent_settings instead.`), A = !0);
|
|
45
45
|
}
|
|
46
|
-
let M =
|
|
46
|
+
let M = !0;
|
|
47
|
+
if (A && O) try {
|
|
48
|
+
let n = (await y.fetchQuery({
|
|
49
|
+
queryKey: e.detail(S.id, C, O.name),
|
|
50
|
+
queryFn: () => m.getProfile(O.name),
|
|
51
|
+
...t
|
|
52
|
+
})).profile.secret_refs;
|
|
53
|
+
M = !Array.isArray(n);
|
|
54
|
+
} catch {
|
|
55
|
+
M = !1;
|
|
56
|
+
}
|
|
57
|
+
let N = A && M ? void 0 : D, P = await d.createConversation({
|
|
47
58
|
initialUserMsg: a,
|
|
48
59
|
conversationInstructions: o,
|
|
49
60
|
plugins: f,
|
|
@@ -56,12 +67,12 @@ var v = ["create-conversation"], y = () => {
|
|
|
56
67
|
workspaceMode: v,
|
|
57
68
|
parentConversationId: b,
|
|
58
69
|
agentType: w,
|
|
59
|
-
...
|
|
60
|
-
agentProfileId:
|
|
70
|
+
...N ? {
|
|
71
|
+
agentProfileId: N,
|
|
61
72
|
agentProfileKind: O?.agent_kind
|
|
62
73
|
} : {}
|
|
63
|
-
}),
|
|
64
|
-
if (
|
|
74
|
+
}), F = P.app_conversation_id, I = f?.map(l) ?? [], L = I;
|
|
75
|
+
if (F) {
|
|
65
76
|
let e = [];
|
|
66
77
|
try {
|
|
67
78
|
e = await y.ensureQueryData({
|
|
@@ -73,32 +84,32 @@ var v = ["create-conversation"], y = () => {
|
|
|
73
84
|
queryFn: () => g.listInstalledPlugins()
|
|
74
85
|
});
|
|
75
86
|
} catch {}
|
|
76
|
-
let t = new Set(
|
|
87
|
+
let t = new Set(I.map(_)), n = e.filter((e) => e.enabled).map((e) => ({
|
|
77
88
|
source: e.source,
|
|
78
89
|
ref: e.resolved_ref ?? null,
|
|
79
90
|
repo_path: e.repo_path ?? null,
|
|
80
91
|
name: e.name
|
|
81
92
|
})).filter((e) => !t.has(_(e)));
|
|
82
|
-
|
|
93
|
+
L = [...I, ...n];
|
|
83
94
|
}
|
|
84
|
-
let
|
|
85
|
-
if (
|
|
86
|
-
let e = s(
|
|
87
|
-
c(
|
|
95
|
+
let R = N && O?.agent_kind === "openhands" ? O.llm_profile_ref : j ?? x?.active_profile ?? null;
|
|
96
|
+
if (F && (R || L.length)) {
|
|
97
|
+
let e = s(F);
|
|
98
|
+
c(F, {
|
|
88
99
|
selected_repository: e?.selected_repository ?? null,
|
|
89
100
|
selected_branch: e?.selected_branch ?? null,
|
|
90
101
|
git_provider: e?.git_provider ?? null,
|
|
91
102
|
selected_workspace: e?.selected_workspace ?? null,
|
|
92
103
|
workspace_mode: e?.workspace_mode ?? null,
|
|
93
|
-
active_profile:
|
|
94
|
-
plugins:
|
|
104
|
+
active_profile: R ?? e?.active_profile ?? null,
|
|
105
|
+
plugins: L.length ? L : e?.plugins ?? null
|
|
95
106
|
});
|
|
96
107
|
}
|
|
97
108
|
return {
|
|
98
|
-
conversation_id:
|
|
109
|
+
conversation_id: P.app_conversation_id ? P.app_conversation_id : `task-${P.id}`,
|
|
99
110
|
session_api_key: null,
|
|
100
|
-
url:
|
|
101
|
-
task_id:
|
|
111
|
+
url: P.agent_server_url,
|
|
112
|
+
task_id: P.id
|
|
102
113
|
};
|
|
103
114
|
},
|
|
104
115
|
onSuccess: async (e, t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-create-conversation.js","names":[],"sources":["../../../src/hooks/mutation/use-create-conversation.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { PluginSpec } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { SuggestedTask } from \"#/utils/types\";\nimport { Provider } from \"#/types/settings\";\nimport { useTracking } from \"#/hooks/use-tracking\";\nimport { useLlmProfiles } from \"#/hooks/query/use-llm-profiles\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport ProfilesService from \"#/api/profiles-service/profiles-service.api\";\nimport AgentProfilesService, {\n WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME,\n type AgentProfileListResponse,\n} from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport PluginsManagementService, {\n type InstalledPluginInfo,\n} from \"#/api/plugins-management-service\";\nimport {\n PLUGINS_QUERY_KEYS,\n LLM_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n} from \"#/hooks/query/query-keys\";\nimport { pluginReferenceKey } from \"#/utils/plugin-display\";\nimport {\n getStoredConversationMetadata,\n setStoredConversationMetadata,\n toPluginCoordinates,\n type WorkspaceMode,\n} from \"#/api/conversation-metadata-store\";\n\nexport interface CreateConversationVariables {\n query?: string;\n repository?: {\n name: string;\n gitProvider: Provider;\n branch?: string;\n };\n suggestedTask?: SuggestedTask;\n conversationInstructions?: string;\n parentConversationId?: string;\n agentType?: \"default\" | \"plan\";\n plugins?: PluginSpec[];\n workingDir?: string;\n workspaceMode?: WorkspaceMode;\n // Launch from a specific AgentProfile (local backend). When omitted, the\n // active AgentProfile (if any) is used so home-composed conversations\n // launch from the user's selected profile (#3727).\n agentProfileId?: string;\n entryPoint?: string; // analytics only; not forwarded to the service\n}\n\nexport const CREATE_CONVERSATION_MUTATION_KEY = [\"create-conversation\"];\n\ninterface CreateConversationResponse {\n conversation_id: string;\n session_api_key: string | null;\n url: string | null;\n task_id?: string;\n}\n\nexport const useCreateConversation = () => {\n const queryClient = useQueryClient();\n const { trackConversationCreated } = useTracking();\n // Cache-warm on the home page (the profile picker reads the same query).\n // Stamped onto the conversation at creation so the switcher can show the\n // exact profile even when several profiles share a model (#1082).\n const { data: llmProfiles } = useLlmProfiles();\n // Warm the agent-profiles cache too — the launch path below awaits the same\n // query via ensureQueryData, so a warm cache makes home-launch instant. The\n // hook's maybe-unresolved data is deliberately NOT read at launch time:\n // activation is pointer-only (it never writes agent_settings), so racing a\n // cold cache into the agent_settings fallback would silently launch the\n // wrong agent.\n const { backend, orgId } = useActiveBackend();\n useAgentProfiles();\n\n return useMutation({\n mutationKey: CREATE_CONVERSATION_MUTATION_KEY,\n mutationFn: async (\n variables: CreateConversationVariables,\n ): Promise<CreateConversationResponse> => {\n const {\n query,\n conversationInstructions,\n plugins,\n repository,\n workingDir,\n workspaceMode,\n parentConversationId,\n agentType,\n agentProfileId,\n } = variables;\n\n // The active AgentProfile is the default launch profile for new\n // conversations (#3727), on both local and cloud (cloud gained\n // /api/agent-profiles in OpenHands #15060, #3730). Await the list from\n // the shared query cache: a send fired before the home query resolves\n // must still launch from the active profile. Do not fall back to the\n // global agent_settings when profile discovery fails: activation is\n // pointer-only, so those settings may describe a different agent.\n const agentProfiles: AgentProfileListResponse =\n await queryClient.ensureQueryData({\n queryKey: [...AGENT_PROFILES_QUERY_KEYS.all, backend.id, orgId],\n queryFn: AgentProfilesService.listProfiles,\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n\n const requestedAgentProfileId =\n agentProfileId ?? agentProfiles.active_agent_profile_id ?? undefined;\n\n // Fall back to the legacy agent_settings launch when the resolved agent\n // profile can't resolve its LLM. The agent-server seeds a `default`\n // openhands profile whose `llm_profile_ref` can point at an LLM profile\n // that doesn't exist (fresh store, or one configured with named profiles\n // only); launching from it 404s (\"LLM profile '<ref>' not found\") and\n // would brick home-launch. agent_settings reflects the active LLM, so the\n // fallback degrades cleanly until the seed mirrors it (SDK #3933).\n // ACP profiles carry no llm_profile_ref, so they're never gated here.\n const resolvedAgentProfile = requestedAgentProfileId\n ? agentProfiles?.profiles?.find(\n (profile) => profile.id === requestedAgentProfileId,\n )\n : undefined;\n // Cloud has no `agent_settings` payload to fall back to — the downgrade\n // below only makes sense on local, where it exists and carries the\n // canvas-only enrichments. Gating it here keeps cloud always launching\n // from the resolved profile id, so the conversation gets\n // `launched_agent_profile` stamped and the profile's config applied\n // (#1571 review).\n const isCloud = backend.kind === \"cloud\";\n let effectiveAgentProfileId = requestedAgentProfileId;\n // The account-wide active LLM profile from the launch-path fetch below\n // (null when that fetch didn't run or failed). Fresher than the\n // `useLlmProfiles()` render snapshot, which a fast send can outrun.\n let fetchedActiveLlmProfile: string | null = null;\n if (\n !isCloud &&\n resolvedAgentProfile?.name === WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME &&\n resolvedAgentProfile?.agent_kind === \"openhands\"\n ) {\n // The seeded OpenHands `default` profile is the enriched baseline, not a\n // deliberate profile pick — it mirrors global agent_settings. Launch it\n // via agent_settings so the canvas-only enrichments the profile-resolution\n // path drops survive for the common home-launch: the <RUNTIME_SERVICES>\n // system-message suffix and project-skill loading (buildAgentContext).\n // Named profiles are deliberate custom configs and still use the profile\n // path (accepting that enrichment boundary).\n // Trade-off: per-profile fields set on `default` itself don't apply on\n // home-launch — custom per-profile config belongs in a named profile.\n //\n // Scoped to OpenHands: an ACP `default` must keep the profile path.\n // Activation is pointer-only, so global agent_settings is stale (often\n // still OpenHands) when an ACP profile is active — launching it via\n // agent_settings would start the wrong agent. ACP carries no\n // <RUNTIME_SERVICES> enrichment, so there's nothing to preserve.\n //\n // Scoped to local: cloud never writes agent_settings, so it always\n // resolves `default` server-side via agent_profile_id (validated below).\n effectiveAgentProfileId = undefined;\n } else if (\n resolvedAgentProfile?.agent_kind === \"openhands\" &&\n resolvedAgentProfile.llm_profile_ref\n ) {\n // Await the LLM-profile list rather than reading the maybe-unresolved\n // `useLlmProfiles()` result: a send fired before that query loads (or\n // after it errors) must still validate the ref, not launch blind.\n let llmProfileExists = false;\n try {\n const llm = await queryClient.ensureQueryData({\n queryKey: [...LLM_PROFILES_QUERY_KEYS.all, backend.id, orgId],\n queryFn: ProfilesService.listProfiles,\n // Match the agent-profiles fetch above: on a backend where this\n // errors, fall back to agent_settings immediately rather than\n // stalling the send through the default exponential backoff.\n retry: false,\n });\n llmProfileExists = llm.profiles.some(\n (profile) => profile.name === resolvedAgentProfile.llm_profile_ref,\n );\n fetchedActiveLlmProfile = llm.active_profile ?? null;\n } catch {\n // List unavailable → can't validate → fall back to agent_settings.\n }\n if (!llmProfileExists) {\n // Downgrade is silent in the UI; leave a diagnosable trace.\n console.warn(\n `Agent profile \"${resolvedAgentProfile.name}\" references missing ` +\n `LLM profile \"${resolvedAgentProfile.llm_profile_ref}\"; ` +\n \"launching from agent_settings instead.\",\n );\n effectiveAgentProfileId = undefined;\n } else if (\n !isCloud &&\n !agentProfileId &&\n fetchedActiveLlmProfile &&\n fetchedActiveLlmProfile !== resolvedAgentProfile.llm_profile_ref\n ) {\n // The home LLM pill shows — and its dropdown activates — the\n // account-wide active LLM profile, never the pinned ref\n // (useChatInputLlmProfileState), so when the two differ the launch\n // must run the selection or the UI advertises a model the\n // conversation won't use (#16539). Launch via agent_settings, which\n // the dropdown's profile activation syncs to the selection. Scoped\n // to the implicit active-profile launch: an explicit `agentProfileId`\n // (the in-conversation profile picker) is a deliberate profile pick,\n // so its pinned ref stays authoritative. Local-only like the\n // downgrades above — cloud has no agent_settings payload to fall\n // back to. Trade-off: the named profile's non-LLM config doesn't\n // apply to this launch; the start request has no per-launch LLM\n // override that could preserve it (AgentLaunchAdditions carries only\n // a system-message suffix).\n effectiveAgentProfileId = undefined;\n }\n }\n\n // Only extend the call with the profile fields when launching from a\n // profile, so a plain create stays byte-identical to the legacy\n // agent_settings path (#3727). sandboxId is unused here.\n const conversation =\n await AgentServerConversationService.createConversation({\n initialUserMsg: query,\n conversationInstructions,\n plugins,\n metadata: repository\n ? {\n selected_repository: repository.name,\n selected_branch: repository.branch ?? null,\n git_provider: repository.gitProvider,\n }\n : null,\n workingDirOverride: workingDir,\n workspaceMode,\n parentConversationId,\n agentType,\n ...(effectiveAgentProfileId\n ? {\n agentProfileId: effectiveAgentProfileId,\n agentProfileKind: resolvedAgentProfile?.agent_kind,\n }\n : {}),\n });\n\n // Stamp the active LLM profile onto the (local) conversation so the\n // chat switcher shows the exact profile even when several profiles\n // share a model (#1082). Cloud conversations don't use local profiles\n // (app_conversation_id stays null until the sandbox is READY). Merge so\n // the repo/workspace metadata the service just persisted is preserved.\n const localConversationId = conversation.app_conversation_id;\n // Snapshot the conversation's plugins into client-side metadata so the\n // in-conversation plugins view can show what's loaded (coordinates only\n // — strip parameters, which may carry secrets). The agent-server doesn't\n // return a live conversation's loaded plugins, so this snapshot is the\n // source for that view. Two sources, deduped by coordinates:\n // 1. plugins explicitly attached at creation (e.g. the /launch flow);\n // 2. enabled installed plugins, which the SDK auto-loads into every new\n // local conversation (see use-set-plugin-enabled).\n const explicitPlugins = plugins?.map(toPluginCoordinates) ?? [];\n let attachedPlugins: PluginSpec[] = explicitPlugins;\n if (localConversationId) {\n let installed: InstalledPluginInfo[] = [];\n try {\n installed = await queryClient.ensureQueryData({\n // Same key `usePlugins` writes. Unscoped, this served the previous\n // backend's list and attached plugins the target server lacks.\n queryKey: [...PLUGINS_QUERY_KEYS.installed, backend.id, orgId],\n queryFn: () => PluginsManagementService.listInstalledPlugins(),\n });\n } catch {\n // Best-effort: never let plugin lookup block conversation creation.\n }\n const seen = new Set(explicitPlugins.map(pluginReferenceKey));\n const enabledInstalled = installed\n .filter((plugin) => plugin.enabled)\n .map((plugin) => ({\n source: plugin.source,\n ref: plugin.resolved_ref ?? null,\n repo_path: plugin.repo_path ?? null,\n // Keep the human-friendly name so the plugins view shows e.g.\n // \"city-weather\" rather than deriving \"local\" from the source.\n name: plugin.name,\n }))\n .filter((plugin) => !seen.has(pluginReferenceKey(plugin)));\n attachedPlugins = [...explicitPlugins, ...enabledInstalled];\n }\n // A launch from a named OpenHands profile runs that profile's\n // `llm_profile_ref`, which can differ from the standalone active LLM\n // profile — stamp the ref so the switcher pill names the exact profile\n // the conversation runs (#1082). The agent_settings paths (the `default`\n // baseline, a dangling ref, or a dropdown override (#16539) — where\n // effectiveAgentProfileId is cleared) run the active LLM, so they stamp\n // the active profile, preferring the launch-path fetch over the hook's\n // render snapshot. ACP profiles carry no LLM profile, so they fall\n // through to the active-profile stamp (unused by the ACP model chip).\n const activeProfile =\n effectiveAgentProfileId &&\n resolvedAgentProfile?.agent_kind === \"openhands\"\n ? resolvedAgentProfile.llm_profile_ref\n : (fetchedActiveLlmProfile ?? llmProfiles?.active_profile ?? null);\n if (localConversationId && (activeProfile || attachedPlugins.length)) {\n const prev = getStoredConversationMetadata(localConversationId);\n setStoredConversationMetadata(localConversationId, {\n selected_repository: prev?.selected_repository ?? null,\n selected_branch: prev?.selected_branch ?? null,\n git_provider: prev?.git_provider ?? null,\n selected_workspace: prev?.selected_workspace ?? null,\n workspace_mode: prev?.workspace_mode ?? null,\n active_profile: activeProfile ?? prev?.active_profile ?? null,\n plugins: attachedPlugins.length\n ? attachedPlugins\n : (prev?.plugins ?? null),\n });\n }\n\n // OpenHands cloud pattern: when the start task isn't immediately\n // READY (cloud sandbox is still provisioning),\n // app_conversation_id is null. We return a `task-{id}` URL so the\n // conversation route's useTaskPolling can drive it to READY and\n // then redirect to the real `/conversations/{app_conversation_id}`.\n const conversationId = conversation.app_conversation_id\n ? conversation.app_conversation_id\n : `task-${conversation.id}`;\n\n return {\n conversation_id: conversationId,\n session_api_key: null,\n url: conversation.agent_server_url,\n task_id: conversation.id,\n };\n },\n onSuccess: async (data, variables) => {\n trackConversationCreated({\n conversationId: data.conversation_id,\n taskId: data.task_id,\n hasRepository: !!variables.repository,\n gitProvider: variables.repository?.gitProvider,\n hasWorkspace: !!variables.workingDir,\n workspaceMode: variables.workspaceMode,\n hasInitialQuery: !!variables.query,\n agentType: variables.agentType,\n hasParentConversation: !!variables.parentConversationId,\n entryPoint: variables.entryPoint,\n });\n\n // Invalidate (rather than remove) so the existing paginated list stays\n // rendered while a background refetch picks up the new conversation.\n // `removeQueries` would wipe the cache and force the panel back to its\n // initial loading state, dropping loaded pages and scroll position.\n queryClient.invalidateQueries({\n queryKey: [\"user\", \"conversations\"],\n });\n // The cloud path returns a start task (no app_conversation_id\n // yet); the sidebar surfaces those via `useStartTasks` which doesn't\n // poll, so invalidate it explicitly so the in-flight task shows up\n // in the conversation list immediately.\n queryClient.invalidateQueries({\n queryKey: [\"start-tasks\"],\n });\n },\n });\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"use-create-conversation.js","names":[],"sources":["../../../src/hooks/mutation/use-create-conversation.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { PluginSpec } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { SuggestedTask } from \"#/utils/types\";\nimport { Provider } from \"#/types/settings\";\nimport { useTracking } from \"#/hooks/use-tracking\";\nimport { useLlmProfiles } from \"#/hooks/query/use-llm-profiles\";\nimport { useAgentProfiles } from \"#/hooks/query/use-agent-profiles\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport ProfilesService from \"#/api/profiles-service/profiles-service.api\";\nimport AgentProfilesService, {\n WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME,\n type AgentProfileListResponse,\n} from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport PluginsManagementService, {\n type InstalledPluginInfo,\n} from \"#/api/plugins-management-service\";\nimport {\n PLUGINS_QUERY_KEYS,\n LLM_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n} from \"#/hooks/query/query-keys\";\nimport { pluginReferenceKey } from \"#/utils/plugin-display\";\nimport {\n getStoredConversationMetadata,\n setStoredConversationMetadata,\n toPluginCoordinates,\n type WorkspaceMode,\n} from \"#/api/conversation-metadata-store\";\n\nexport interface CreateConversationVariables {\n query?: string;\n repository?: {\n name: string;\n gitProvider: Provider;\n branch?: string;\n };\n suggestedTask?: SuggestedTask;\n conversationInstructions?: string;\n parentConversationId?: string;\n agentType?: \"default\" | \"plan\";\n plugins?: PluginSpec[];\n workingDir?: string;\n workspaceMode?: WorkspaceMode;\n // Launch from a specific AgentProfile (local backend). When omitted, the\n // active AgentProfile (if any) is used so home-composed conversations\n // launch from the user's selected profile (#3727).\n agentProfileId?: string;\n entryPoint?: string; // analytics only; not forwarded to the service\n}\n\nexport const CREATE_CONVERSATION_MUTATION_KEY = [\"create-conversation\"];\n\ninterface CreateConversationResponse {\n conversation_id: string;\n session_api_key: string | null;\n url: string | null;\n task_id?: string;\n}\n\nexport const useCreateConversation = () => {\n const queryClient = useQueryClient();\n const { trackConversationCreated } = useTracking();\n // Cache-warm on the home page (the profile picker reads the same query).\n // Stamped onto the conversation at creation so the switcher can show the\n // exact profile even when several profiles share a model (#1082).\n const { data: llmProfiles } = useLlmProfiles();\n // Warm the agent-profiles cache too — the launch path below awaits the same\n // query via ensureQueryData, so a warm cache makes home-launch instant. The\n // hook's maybe-unresolved data is deliberately NOT read at launch time:\n // activation is pointer-only (it never writes agent_settings), so racing a\n // cold cache into the agent_settings fallback would silently launch the\n // wrong agent.\n const { backend, orgId } = useActiveBackend();\n useAgentProfiles();\n\n return useMutation({\n mutationKey: CREATE_CONVERSATION_MUTATION_KEY,\n mutationFn: async (\n variables: CreateConversationVariables,\n ): Promise<CreateConversationResponse> => {\n const {\n query,\n conversationInstructions,\n plugins,\n repository,\n workingDir,\n workspaceMode,\n parentConversationId,\n agentType,\n agentProfileId,\n } = variables;\n\n // The active AgentProfile is the default launch profile for new\n // conversations (#3727), on both local and cloud (cloud gained\n // /api/agent-profiles in OpenHands #15060, #3730). Await the list from\n // the shared query cache: a send fired before the home query resolves\n // must still launch from the active profile. Do not fall back to the\n // global agent_settings when profile discovery fails: activation is\n // pointer-only, so those settings may describe a different agent.\n const agentProfiles: AgentProfileListResponse =\n await queryClient.ensureQueryData({\n queryKey: [...AGENT_PROFILES_QUERY_KEYS.all, backend.id, orgId],\n queryFn: AgentProfilesService.listProfiles,\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n\n const requestedAgentProfileId =\n agentProfileId ?? agentProfiles.active_agent_profile_id ?? undefined;\n\n // Fall back to the legacy agent_settings launch when the resolved agent\n // profile can't resolve its LLM. The agent-server seeds a `default`\n // openhands profile whose `llm_profile_ref` can point at an LLM profile\n // that doesn't exist (fresh store, or one configured with named profiles\n // only); launching from it 404s (\"LLM profile '<ref>' not found\") and\n // would brick home-launch. agent_settings reflects the active LLM, so the\n // fallback degrades cleanly until the seed mirrors it (SDK #3933).\n // ACP profiles carry no llm_profile_ref, so they're never gated here.\n const resolvedAgentProfile = requestedAgentProfileId\n ? agentProfiles?.profiles?.find(\n (profile) => profile.id === requestedAgentProfileId,\n )\n : undefined;\n // Cloud has no `agent_settings` payload to fall back to — the downgrade\n // below only makes sense on local, where it exists and carries the\n // canvas-only enrichments. Gating it here keeps cloud always launching\n // from the resolved profile id, so the conversation gets\n // `launched_agent_profile` stamped and the profile's config applied\n // (#1571 review).\n const isCloud = backend.kind === \"cloud\";\n let prefersAgentSettingsFallback = false;\n // The account-wide active LLM profile from the launch-path fetch below\n // (null when that fetch didn't run or failed). Fresher than the\n // `useLlmProfiles()` render snapshot, which a fast send can outrun.\n let fetchedActiveLlmProfile: string | null = null;\n if (\n !isCloud &&\n resolvedAgentProfile?.name === WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME &&\n resolvedAgentProfile?.agent_kind === \"openhands\"\n ) {\n // The seeded OpenHands `default` profile is the enriched baseline, not a\n // deliberate profile pick — it mirrors global agent_settings. Launch it\n // via agent_settings so the canvas-only enrichments the profile-resolution\n // path drops survive for the common home-launch: the <RUNTIME_SERVICES>\n // system-message suffix and project-skill loading (buildAgentContext).\n // Named profiles are deliberate custom configs and still use the profile\n // path (accepting that enrichment boundary).\n // Trade-off: per-profile fields set on `default` itself don't apply on\n // home-launch — custom per-profile config belongs in a named profile.\n //\n // Scoped to OpenHands: an ACP `default` must keep the profile path.\n // Activation is pointer-only, so global agent_settings is stale (often\n // still OpenHands) when an ACP profile is active — launching it via\n // agent_settings would start the wrong agent. ACP carries no\n // <RUNTIME_SERVICES> enrichment, so there's nothing to preserve.\n //\n // Scoped to local: cloud never writes agent_settings, so it always\n // resolves `default` server-side via agent_profile_id (validated below).\n prefersAgentSettingsFallback = true;\n } else if (\n resolvedAgentProfile?.agent_kind === \"openhands\" &&\n resolvedAgentProfile.llm_profile_ref\n ) {\n // Await the LLM-profile list rather than reading the maybe-unresolved\n // `useLlmProfiles()` result: a send fired before that query loads (or\n // after it errors) must still validate the ref, not launch blind.\n let llmProfileExists = false;\n try {\n const llm = await queryClient.ensureQueryData({\n queryKey: [...LLM_PROFILES_QUERY_KEYS.all, backend.id, orgId],\n queryFn: ProfilesService.listProfiles,\n // Match the agent-profiles fetch above: on a backend where this\n // errors, fall back to agent_settings immediately rather than\n // stalling the send through the default exponential backoff.\n retry: false,\n });\n llmProfileExists = llm.profiles.some(\n (profile) => profile.name === resolvedAgentProfile.llm_profile_ref,\n );\n fetchedActiveLlmProfile = llm.active_profile ?? null;\n } catch {\n // List unavailable → can't validate → fall back to agent_settings.\n }\n if (!llmProfileExists) {\n // Downgrade is silent in the UI; leave a diagnosable trace.\n console.warn(\n `Agent profile \"${resolvedAgentProfile.name}\" references missing ` +\n `LLM profile \"${resolvedAgentProfile.llm_profile_ref}\"; ` +\n \"launching from agent_settings instead.\",\n );\n prefersAgentSettingsFallback = true;\n } else if (\n !isCloud &&\n !agentProfileId &&\n fetchedActiveLlmProfile &&\n fetchedActiveLlmProfile !== resolvedAgentProfile.llm_profile_ref\n ) {\n // The home LLM pill shows — and its dropdown activates — the\n // account-wide active LLM profile, never the pinned ref\n // (useChatInputLlmProfileState), so when the two differ the launch\n // must run the selection or the UI advertises a model the\n // conversation won't use (#16539). Launch via agent_settings, which\n // the dropdown's profile activation syncs to the selection. Scoped\n // to the implicit active-profile launch: an explicit `agentProfileId`\n // (the in-conversation profile picker) is a deliberate profile pick,\n // so its pinned ref stays authoritative. Local-only like the\n // downgrades above — cloud has no agent_settings payload to fall\n // back to. Trade-off: the named profile's non-LLM config doesn't\n // apply to this launch; the start request has no per-launch LLM\n // override that could preserve it (AgentLaunchAdditions carries only\n // a system-message suffix).\n prefersAgentSettingsFallback = true;\n }\n }\n\n // A legacy agent_settings launch carries no profile identity, so Agent\n // Server cannot enforce that profile's secret allow-list. Keep restricted\n // profiles on the server-resolved path even when one of the compatibility\n // fallbacks above would otherwise apply. If the detail cannot be read,\n // fail closed by preserving the profile id and letting Agent Server return\n // the underlying profile-resolution error.\n let profileAllowsAgentSettingsFallback = true;\n if (prefersAgentSettingsFallback && resolvedAgentProfile) {\n try {\n // Revalidate stale cached details: policy may have changed since the\n // profile editor or another client last populated this query.\n const detail = await queryClient.fetchQuery({\n queryKey: AGENT_PROFILES_QUERY_KEYS.detail(\n backend.id,\n orgId,\n resolvedAgentProfile.name,\n ),\n queryFn: () =>\n AgentProfilesService.getProfile(resolvedAgentProfile.name),\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n const secretRefs = (detail.profile as { secret_refs?: unknown })\n .secret_refs;\n profileAllowsAgentSettingsFallback = !Array.isArray(secretRefs);\n } catch {\n profileAllowsAgentSettingsFallback = false;\n }\n }\n const effectiveAgentProfileId =\n prefersAgentSettingsFallback && profileAllowsAgentSettingsFallback\n ? undefined\n : requestedAgentProfileId;\n\n // Only extend the call with the profile fields when launching from a\n // profile, so a plain create stays byte-identical to the legacy\n // agent_settings path (#3727). sandboxId is unused here.\n const conversation =\n await AgentServerConversationService.createConversation({\n initialUserMsg: query,\n conversationInstructions,\n plugins,\n metadata: repository\n ? {\n selected_repository: repository.name,\n selected_branch: repository.branch ?? null,\n git_provider: repository.gitProvider,\n }\n : null,\n workingDirOverride: workingDir,\n workspaceMode,\n parentConversationId,\n agentType,\n ...(effectiveAgentProfileId\n ? {\n agentProfileId: effectiveAgentProfileId,\n agentProfileKind: resolvedAgentProfile?.agent_kind,\n }\n : {}),\n });\n\n // Stamp the active LLM profile onto the (local) conversation so the\n // chat switcher shows the exact profile even when several profiles\n // share a model (#1082). Cloud conversations don't use local profiles\n // (app_conversation_id stays null until the sandbox is READY). Merge so\n // the repo/workspace metadata the service just persisted is preserved.\n const localConversationId = conversation.app_conversation_id;\n // Snapshot the conversation's plugins into client-side metadata so the\n // in-conversation plugins view can show what's loaded (coordinates only\n // — strip parameters, which may carry secrets). The agent-server doesn't\n // return a live conversation's loaded plugins, so this snapshot is the\n // source for that view. Two sources, deduped by coordinates:\n // 1. plugins explicitly attached at creation (e.g. the /launch flow);\n // 2. enabled installed plugins, which the SDK auto-loads into every new\n // local conversation (see use-set-plugin-enabled).\n const explicitPlugins = plugins?.map(toPluginCoordinates) ?? [];\n let attachedPlugins: PluginSpec[] = explicitPlugins;\n if (localConversationId) {\n let installed: InstalledPluginInfo[] = [];\n try {\n installed = await queryClient.ensureQueryData({\n // Same key `usePlugins` writes. Unscoped, this served the previous\n // backend's list and attached plugins the target server lacks.\n queryKey: [...PLUGINS_QUERY_KEYS.installed, backend.id, orgId],\n queryFn: () => PluginsManagementService.listInstalledPlugins(),\n });\n } catch {\n // Best-effort: never let plugin lookup block conversation creation.\n }\n const seen = new Set(explicitPlugins.map(pluginReferenceKey));\n const enabledInstalled = installed\n .filter((plugin) => plugin.enabled)\n .map((plugin) => ({\n source: plugin.source,\n ref: plugin.resolved_ref ?? null,\n repo_path: plugin.repo_path ?? null,\n // Keep the human-friendly name so the plugins view shows e.g.\n // \"city-weather\" rather than deriving \"local\" from the source.\n name: plugin.name,\n }))\n .filter((plugin) => !seen.has(pluginReferenceKey(plugin)));\n attachedPlugins = [...explicitPlugins, ...enabledInstalled];\n }\n // A launch from a named OpenHands profile runs that profile's\n // `llm_profile_ref`, which can differ from the standalone active LLM\n // profile — stamp the ref so the switcher pill names the exact profile\n // the conversation runs (#1082). The agent_settings paths (the `default`\n // baseline, a dangling ref, or a dropdown override (#16539) — where\n // effectiveAgentProfileId is cleared) run the active LLM, so they stamp\n // the active profile, preferring the launch-path fetch over the hook's\n // render snapshot. ACP profiles carry no LLM profile, so they fall\n // through to the active-profile stamp (unused by the ACP model chip).\n const activeProfile =\n effectiveAgentProfileId &&\n resolvedAgentProfile?.agent_kind === \"openhands\"\n ? resolvedAgentProfile.llm_profile_ref\n : (fetchedActiveLlmProfile ?? llmProfiles?.active_profile ?? null);\n if (localConversationId && (activeProfile || attachedPlugins.length)) {\n const prev = getStoredConversationMetadata(localConversationId);\n setStoredConversationMetadata(localConversationId, {\n selected_repository: prev?.selected_repository ?? null,\n selected_branch: prev?.selected_branch ?? null,\n git_provider: prev?.git_provider ?? null,\n selected_workspace: prev?.selected_workspace ?? null,\n workspace_mode: prev?.workspace_mode ?? null,\n active_profile: activeProfile ?? prev?.active_profile ?? null,\n plugins: attachedPlugins.length\n ? attachedPlugins\n : (prev?.plugins ?? null),\n });\n }\n\n // OpenHands cloud pattern: when the start task isn't immediately\n // READY (cloud sandbox is still provisioning),\n // app_conversation_id is null. We return a `task-{id}` URL so the\n // conversation route's useTaskPolling can drive it to READY and\n // then redirect to the real `/conversations/{app_conversation_id}`.\n const conversationId = conversation.app_conversation_id\n ? conversation.app_conversation_id\n : `task-${conversation.id}`;\n\n return {\n conversation_id: conversationId,\n session_api_key: null,\n url: conversation.agent_server_url,\n task_id: conversation.id,\n };\n },\n onSuccess: async (data, variables) => {\n trackConversationCreated({\n conversationId: data.conversation_id,\n taskId: data.task_id,\n hasRepository: !!variables.repository,\n gitProvider: variables.repository?.gitProvider,\n hasWorkspace: !!variables.workingDir,\n workspaceMode: variables.workspaceMode,\n hasInitialQuery: !!variables.query,\n agentType: variables.agentType,\n hasParentConversation: !!variables.parentConversationId,\n entryPoint: variables.entryPoint,\n });\n\n // Invalidate (rather than remove) so the existing paginated list stays\n // rendered while a background refetch picks up the new conversation.\n // `removeQueries` would wipe the cache and force the panel back to its\n // initial loading state, dropping loaded pages and scroll position.\n queryClient.invalidateQueries({\n queryKey: [\"user\", \"conversations\"],\n });\n // The cloud path returns a start task (no app_conversation_id\n // yet); the sidebar surfaces those via `useStartTasks` which doesn't\n // poll, so invalidate it explicitly so the in-flight task shows up\n // in the conversation list immediately.\n queryClient.invalidateQueries({\n queryKey: [\"start-tasks\"],\n });\n },\n });\n};\n"],"mappings":"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"}
|
|
@@ -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("../../contexts/active-backend-context.cjs"),i=require("../../api/settings-service/settings-service.api.cjs"),a=require("../../api/conversation-service/agent-server-conversation-service.api.cjs"),o=require("./conversation-mutation-utils.cjs"),s=require("../../api/agent-profiles-service/agent-profiles-service.api.cjs"),c=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("../../contexts/active-backend-context.cjs"),i=require("../../api/settings-service/settings-service.api.cjs"),a=require("../../api/conversation-service/agent-server-conversation-service.api.cjs"),o=require("./conversation-mutation-utils.cjs"),s=require("../../api/agent-profiles-service/agent-profiles-service.api.cjs"),c=require("../../components/features/settings/agent-profiles/merge-agent-profile-save-input.cjs");var l=()=>{let l=t.useQueryClient(),{backend:u,orgId:d}=r.useActiveBackend();return n.useMutation({mutationFn:async({conversationId:t,model:n})=>{if(t){await a.default.switchAcpModel(t,n);return}let r=await l.ensureQueryData({queryKey:[...e.AGENT_PROFILES_QUERY_KEYS.all,u.id,d],queryFn:s.default.listProfiles,...e.AGENT_PROFILES_RETRY_OPTIONS}),o=r.profiles?.find(e=>e.id!=null&&e.id===r.active_agent_profile_id);if(o?.agent_kind===`acp`){let t=await l.ensureQueryData({queryKey:e.AGENT_PROFILES_QUERY_KEYS.detail(u.id,d,o.name),queryFn:()=>s.default.getProfile(o.name),...e.AGENT_PROFILES_RETRY_OPTIONS});await s.default.saveProfile(o.name,c.mergeAgentProfileSaveInput(t.profile,{agent_kind:`acp`,acp_model:n}));return}await i.default.saveSettings({agent_settings_diff:{acp_model:n}})},onSuccess:(t,{conversationId:n})=>{n?o.invalidateConversationQueries(l,n):(i.default.invalidateCache(),l.invalidateQueries({queryKey:e.SETTINGS_QUERY_KEYS.personal()}),l.invalidateQueries({queryKey:e.AGENT_PROFILES_QUERY_KEYS.all}))}})};exports.useSwitchAcpModel=l;
|
|
2
2
|
//# sourceMappingURL=use-switch-acp-model.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-switch-acp-model.cjs","names":[],"sources":["../../../src/hooks/mutation/use-switch-acp-model.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport AgentProfilesService, {\n type AgentProfileListResponse,\n} from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { mergeAgentProfileSaveInput } from \"#/components/features/settings/agent-profiles/merge-agent-profile-save-input\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n SETTINGS_QUERY_KEYS,\n} from \"#/hooks/query/query-keys\";\nimport {
|
|
1
|
+
{"version":3,"file":"use-switch-acp-model.cjs","names":[],"sources":["../../../src/hooks/mutation/use-switch-acp-model.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport AgentProfilesService, {\n type AgentProfileListResponse,\n} from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { mergeAgentProfileSaveInput } from \"#/components/features/settings/agent-profiles/merge-agent-profile-save-input\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n SETTINGS_QUERY_KEYS,\n} from \"#/hooks/query/query-keys\";\nimport { invalidateConversationQueries } from \"./conversation-mutation-utils\";\n\ninterface SwitchAcpModelVars {\n /**\n * When set, the ACP conversation's running model is swapped live via the\n * wrapper's ``session/set_model`` (POST /switch_acp_model) and the user's\n * saved default is untouched. When null (home page / no session), the model\n * is persisted as the default the next conversation launches with.\n */\n conversationId: string | null;\n model: string;\n}\n\n/**\n * ACP analog of {@link useSwitchLlmProfile}. Switches the ACP model\n * per-conversation when called from inside a conversation (live in-place model\n * switch; a created-but-not-yet-run conversation is a persist-only deferral on\n * the server, so blank conversations work too); persists it as the launch\n * default when called from the home page.\n *\n * The home-page persist target is the **active ACP AgentProfile**: profile\n * launches resolve the agent server-side purely from the stored profile\n * (``agent_profile_id`` and ``agent_settings`` are mutually exclusive launch\n * sources), so writing ``agent_settings.acp_model`` would not affect them.\n * Only when the profile list resolves with no active ACP profile does the\n * write fall back to the ``agent_settings_diff`` the legacy launch path\n * reads. A failed profile discovery propagates instead of downgrading\n * (#16523): an active-profile launch ignores agent_settings, so persisting\n * the pick there would silently drop it.\n *\n * Invalidates the same conversation/settings query keys the profile hook does\n * so the chat-input model chip + conversation chip refresh with the new model.\n */\nexport const useSwitchAcpModel = () => {\n const queryClient = useQueryClient();\n const { backend, orgId } = useActiveBackend();\n\n return useMutation({\n mutationFn: async ({ conversationId, model }: SwitchAcpModelVars) => {\n if (conversationId) {\n await AgentServerConversationService.switchAcpModel(\n conversationId,\n model,\n );\n return;\n }\n\n // Home page: resolve the active profile from the shared query cache\n // (same keys/retry policy as useCreateConversation's launch path, so a\n // pick can't disagree with what a subsequent send would launch). Like\n // that launch path, do not fall back to the legacy agent_settings\n // persist when profile discovery fails (#16523): an active-profile\n // launch ignores agent_settings, so the pick would be silently dropped.\n // The rejection surfaces via the global mutation error toast.\n const agentProfiles: AgentProfileListResponse =\n await queryClient.ensureQueryData({\n queryKey: [...AGENT_PROFILES_QUERY_KEYS.all, backend.id, orgId],\n queryFn: AgentProfilesService.listProfiles,\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n const activeProfile = agentProfiles.profiles?.find(\n (profile) =>\n profile.id != null &&\n profile.id === agentProfiles.active_agent_profile_id,\n );\n\n if (activeProfile?.agent_kind === \"acp\") {\n // Merge over the stored profile so a model-only pick can't wipe the\n // fields this surface doesn't model (command, session mode, …).\n const detail = await queryClient.ensureQueryData({\n queryKey: AGENT_PROFILES_QUERY_KEYS.detail(\n backend.id,\n orgId,\n activeProfile.name,\n ),\n queryFn: () => AgentProfilesService.getProfile(activeProfile.name),\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n await AgentProfilesService.saveProfile(\n activeProfile.name,\n mergeAgentProfileSaveInput(detail.profile, {\n agent_kind: \"acp\",\n acp_model: model,\n }),\n );\n return;\n }\n\n // No active ACP profile: persist as the agent-settings default the\n // legacy launch path reads. The backend deep-merges\n // ``agent_settings_diff`` into the existing ``agent_settings`` dict, so\n // a scalar ``acp_model`` diff updates only the model and preserves the\n // selected provider + command.\n await SettingsService.saveSettings({\n agent_settings_diff: { acp_model: model },\n });\n },\n onSuccess: (_data, { conversationId }) => {\n if (conversationId) {\n invalidateConversationQueries(queryClient, conversationId);\n } else {\n // Mirror useSwitchLlmProfile's home-page path: clear the stale settings\n // cache so the next conversation-start reads the newly saved default,\n // and refetch the settings query so the home-page chip updates. The\n // agent-profiles prefix covers both the list and the detail entry the\n // profile-persist path just rewrote.\n SettingsService.invalidateCache();\n queryClient.invalidateQueries({\n queryKey: SETTINGS_QUERY_KEYS.personal(),\n });\n queryClient.invalidateQueries({\n queryKey: AGENT_PROFILES_QUERY_KEYS.all,\n });\n }\n },\n // No meta.disableToast: unlike useSwitchLlmProfile (which tailors a\n // \"Switched to {name} failed\" message via its own onError), there's no\n // per-action message worth tailoring here, so the global mutation error\n // toast reports a failed switch / profile or settings write rather than\n // swallowing it.\n });\n};\n"],"mappings":"qrBA8CA,IAAa,MAA0B,CACrC,IAAM,EAAc,EAAA,eAAe,EAC7B,CAAE,UAAS,SAAU,EAAA,iBAAiB,EAE5C,OAAO,EAAA,YAAY,CACjB,WAAY,MAAO,CAAE,iBAAgB,WAAgC,CACnE,GAAI,EAAgB,CAClB,MAAM,EAAA,QAA+B,eACnC,EACA,CACF,EACA,MACF,CASA,IAAM,EACJ,MAAM,EAAY,gBAAgB,CAChC,SAAU,CAAC,GAAG,EAAA,0BAA0B,IAAK,EAAQ,GAAI,CAAK,EAC9D,QAAS,EAAA,QAAqB,aAC9B,GAAG,EAAA,4BACL,CAAC,EACG,EAAgB,EAAc,UAAU,KAC3C,GACC,EAAQ,IAAM,MACd,EAAQ,KAAO,EAAc,uBACjC,EAEA,GAAI,GAAe,aAAe,MAAO,CAGvC,IAAM,EAAS,MAAM,EAAY,gBAAgB,CAC/C,SAAU,EAAA,0BAA0B,OAClC,EAAQ,GACR,EACA,EAAc,IAChB,EACA,YAAe,EAAA,QAAqB,WAAW,EAAc,IAAI,EACjE,GAAG,EAAA,4BACL,CAAC,EACD,MAAM,EAAA,QAAqB,YACzB,EAAc,KACd,EAAA,2BAA2B,EAAO,QAAS,CACzC,WAAY,MACZ,UAAW,CACb,CAAC,CACH,EACA,MACF,CAOA,MAAM,EAAA,QAAgB,aAAa,CACjC,oBAAqB,CAAE,UAAW,CAAM,CAC1C,CAAC,CACH,EACA,WAAY,EAAO,CAAE,oBAAqB,CACpC,EACF,EAAA,8BAA8B,EAAa,CAAc,GAOzD,EAAA,QAAgB,gBAAgB,EAChC,EAAY,kBAAkB,CAC5B,SAAU,EAAA,oBAAoB,SAAS,CACzC,CAAC,EACD,EAAY,kBAAkB,CAC5B,SAAU,EAAA,0BAA0B,GACtC,CAAC,EAEL,CAMF,CAAC,CACH"}
|
|
@@ -6,33 +6,32 @@ import o from "../../api/settings-service/settings-service.api.js";
|
|
|
6
6
|
import s from "../../api/conversation-service/agent-server-conversation-service.api.js";
|
|
7
7
|
import { invalidateConversationQueries as c } from "./conversation-mutation-utils.js";
|
|
8
8
|
import l from "../../api/agent-profiles-service/agent-profiles-service.api.js";
|
|
9
|
-
import {
|
|
10
|
-
import { mergeAgentProfileSaveInput as d } from "../../components/features/settings/agent-profiles/merge-agent-profile-save-input.js";
|
|
9
|
+
import { mergeAgentProfileSaveInput as u } from "../../components/features/settings/agent-profiles/merge-agent-profile-save-input.js";
|
|
11
10
|
//#region src/hooks/mutation/use-switch-acp-model.ts
|
|
12
|
-
var
|
|
13
|
-
let
|
|
11
|
+
var d = () => {
|
|
12
|
+
let d = r(), { backend: f, orgId: p } = a();
|
|
14
13
|
return i({
|
|
15
14
|
mutationFn: async ({ conversationId: n, model: r }) => {
|
|
16
15
|
if (n) {
|
|
17
16
|
await s.switchAcpModel(n, r);
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
|
-
let i = await
|
|
19
|
+
let i = await d.ensureQueryData({
|
|
21
20
|
queryKey: [
|
|
22
21
|
...e.all,
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
f.id,
|
|
23
|
+
p
|
|
25
24
|
],
|
|
26
25
|
queryFn: l.listProfiles,
|
|
27
26
|
...t
|
|
28
27
|
}), a = i.profiles?.find((e) => e.id != null && e.id === i.active_agent_profile_id);
|
|
29
28
|
if (a?.agent_kind === "acp") {
|
|
30
|
-
let
|
|
31
|
-
queryKey:
|
|
29
|
+
let n = await d.ensureQueryData({
|
|
30
|
+
queryKey: e.detail(f.id, p, a.name),
|
|
32
31
|
queryFn: () => l.getProfile(a.name),
|
|
33
32
|
...t
|
|
34
33
|
});
|
|
35
|
-
await l.saveProfile(a.name,
|
|
34
|
+
await l.saveProfile(a.name, u(n.profile, {
|
|
36
35
|
agent_kind: "acp",
|
|
37
36
|
acp_model: r
|
|
38
37
|
}));
|
|
@@ -41,11 +40,11 @@ var f = () => {
|
|
|
41
40
|
await o.saveSettings({ agent_settings_diff: { acp_model: r } });
|
|
42
41
|
},
|
|
43
42
|
onSuccess: (t, { conversationId: r }) => {
|
|
44
|
-
r ? c(
|
|
43
|
+
r ? c(d, r) : (o.invalidateCache(), d.invalidateQueries({ queryKey: n.personal() }), d.invalidateQueries({ queryKey: e.all }));
|
|
45
44
|
}
|
|
46
45
|
});
|
|
47
46
|
};
|
|
48
47
|
//#endregion
|
|
49
|
-
export {
|
|
48
|
+
export { d as useSwitchAcpModel };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=use-switch-acp-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-switch-acp-model.js","names":[],"sources":["../../../src/hooks/mutation/use-switch-acp-model.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport AgentProfilesService, {\n type AgentProfileListResponse,\n} from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { mergeAgentProfileSaveInput } from \"#/components/features/settings/agent-profiles/merge-agent-profile-save-input\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n SETTINGS_QUERY_KEYS,\n} from \"#/hooks/query/query-keys\";\nimport {
|
|
1
|
+
{"version":3,"file":"use-switch-acp-model.js","names":[],"sources":["../../../src/hooks/mutation/use-switch-acp-model.ts"],"sourcesContent":["import { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport AgentProfilesService, {\n type AgentProfileListResponse,\n} from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { mergeAgentProfileSaveInput } from \"#/components/features/settings/agent-profiles/merge-agent-profile-save-input\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n SETTINGS_QUERY_KEYS,\n} from \"#/hooks/query/query-keys\";\nimport { invalidateConversationQueries } from \"./conversation-mutation-utils\";\n\ninterface SwitchAcpModelVars {\n /**\n * When set, the ACP conversation's running model is swapped live via the\n * wrapper's ``session/set_model`` (POST /switch_acp_model) and the user's\n * saved default is untouched. When null (home page / no session), the model\n * is persisted as the default the next conversation launches with.\n */\n conversationId: string | null;\n model: string;\n}\n\n/**\n * ACP analog of {@link useSwitchLlmProfile}. Switches the ACP model\n * per-conversation when called from inside a conversation (live in-place model\n * switch; a created-but-not-yet-run conversation is a persist-only deferral on\n * the server, so blank conversations work too); persists it as the launch\n * default when called from the home page.\n *\n * The home-page persist target is the **active ACP AgentProfile**: profile\n * launches resolve the agent server-side purely from the stored profile\n * (``agent_profile_id`` and ``agent_settings`` are mutually exclusive launch\n * sources), so writing ``agent_settings.acp_model`` would not affect them.\n * Only when the profile list resolves with no active ACP profile does the\n * write fall back to the ``agent_settings_diff`` the legacy launch path\n * reads. A failed profile discovery propagates instead of downgrading\n * (#16523): an active-profile launch ignores agent_settings, so persisting\n * the pick there would silently drop it.\n *\n * Invalidates the same conversation/settings query keys the profile hook does\n * so the chat-input model chip + conversation chip refresh with the new model.\n */\nexport const useSwitchAcpModel = () => {\n const queryClient = useQueryClient();\n const { backend, orgId } = useActiveBackend();\n\n return useMutation({\n mutationFn: async ({ conversationId, model }: SwitchAcpModelVars) => {\n if (conversationId) {\n await AgentServerConversationService.switchAcpModel(\n conversationId,\n model,\n );\n return;\n }\n\n // Home page: resolve the active profile from the shared query cache\n // (same keys/retry policy as useCreateConversation's launch path, so a\n // pick can't disagree with what a subsequent send would launch). Like\n // that launch path, do not fall back to the legacy agent_settings\n // persist when profile discovery fails (#16523): an active-profile\n // launch ignores agent_settings, so the pick would be silently dropped.\n // The rejection surfaces via the global mutation error toast.\n const agentProfiles: AgentProfileListResponse =\n await queryClient.ensureQueryData({\n queryKey: [...AGENT_PROFILES_QUERY_KEYS.all, backend.id, orgId],\n queryFn: AgentProfilesService.listProfiles,\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n const activeProfile = agentProfiles.profiles?.find(\n (profile) =>\n profile.id != null &&\n profile.id === agentProfiles.active_agent_profile_id,\n );\n\n if (activeProfile?.agent_kind === \"acp\") {\n // Merge over the stored profile so a model-only pick can't wipe the\n // fields this surface doesn't model (command, session mode, …).\n const detail = await queryClient.ensureQueryData({\n queryKey: AGENT_PROFILES_QUERY_KEYS.detail(\n backend.id,\n orgId,\n activeProfile.name,\n ),\n queryFn: () => AgentProfilesService.getProfile(activeProfile.name),\n ...AGENT_PROFILES_RETRY_OPTIONS,\n });\n await AgentProfilesService.saveProfile(\n activeProfile.name,\n mergeAgentProfileSaveInput(detail.profile, {\n agent_kind: \"acp\",\n acp_model: model,\n }),\n );\n return;\n }\n\n // No active ACP profile: persist as the agent-settings default the\n // legacy launch path reads. The backend deep-merges\n // ``agent_settings_diff`` into the existing ``agent_settings`` dict, so\n // a scalar ``acp_model`` diff updates only the model and preserves the\n // selected provider + command.\n await SettingsService.saveSettings({\n agent_settings_diff: { acp_model: model },\n });\n },\n onSuccess: (_data, { conversationId }) => {\n if (conversationId) {\n invalidateConversationQueries(queryClient, conversationId);\n } else {\n // Mirror useSwitchLlmProfile's home-page path: clear the stale settings\n // cache so the next conversation-start reads the newly saved default,\n // and refetch the settings query so the home-page chip updates. The\n // agent-profiles prefix covers both the list and the detail entry the\n // profile-persist path just rewrote.\n SettingsService.invalidateCache();\n queryClient.invalidateQueries({\n queryKey: SETTINGS_QUERY_KEYS.personal(),\n });\n queryClient.invalidateQueries({\n queryKey: AGENT_PROFILES_QUERY_KEYS.all,\n });\n }\n },\n // No meta.disableToast: unlike useSwitchLlmProfile (which tailors a\n // \"Switched to {name} failed\" message via its own onError), there's no\n // per-action message worth tailoring here, so the global mutation error\n // toast reports a failed switch / profile or settings write rather than\n // swallowing it.\n });\n};\n"],"mappings":";;;;;;;;;;AA8CA,IAAa,UAA0B;CACrC,IAAM,IAAc,EAAe,GAC7B,EAAE,YAAS,aAAU,EAAiB;CAE5C,OAAO,EAAY;EACjB,YAAY,OAAO,EAAE,mBAAgB,eAAgC;GACnE,IAAI,GAAgB;IAClB,MAAM,EAA+B,eACnC,GACA,CACF;IACA;GACF;GASA,IAAM,IACJ,MAAM,EAAY,gBAAgB;IAChC,UAAU;KAAC,GAAG,EAA0B;KAAK,EAAQ;KAAI;IAAK;IAC9D,SAAS,EAAqB;IAC9B,GAAG;GACL,CAAC,GACG,IAAgB,EAAc,UAAU,MAC3C,MACC,EAAQ,MAAM,QACd,EAAQ,OAAO,EAAc,uBACjC;GAEA,IAAI,GAAe,eAAe,OAAO;IAGvC,IAAM,IAAS,MAAM,EAAY,gBAAgB;KAC/C,UAAU,EAA0B,OAClC,EAAQ,IACR,GACA,EAAc,IAChB;KACA,eAAe,EAAqB,WAAW,EAAc,IAAI;KACjE,GAAG;IACL,CAAC;IACD,MAAM,EAAqB,YACzB,EAAc,MACd,EAA2B,EAAO,SAAS;KACzC,YAAY;KACZ,WAAW;IACb,CAAC,CACH;IACA;GACF;GAOA,MAAM,EAAgB,aAAa,EACjC,qBAAqB,EAAE,WAAW,EAAM,EAC1C,CAAC;EACH;EACA,YAAY,GAAO,EAAE,wBAAqB;GACxC,AAAI,IACF,EAA8B,GAAa,CAAc,KAOzD,EAAgB,gBAAgB,GAChC,EAAY,kBAAkB,EAC5B,UAAU,EAAoB,SAAS,EACzC,CAAC,GACD,EAAY,kBAAkB,EAC5B,UAAU,EAA0B,IACtC,CAAC;EAEL;CAMF,CAAC;AACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");var e={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},t={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},n={all:[`llm-profiles`]},r={all:[`agent-profiles`]},i={all:[`provider-connections`]},a={retry:!1},o={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},s={all:[`local-workspaces`]},c={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},l={latestVersion:[`agent-canvas-latest-version`]},u={subConversations:[`v1`,`sub-conversations`]},d={create:[`create-local-planning-conversation`]},f={staleTime:1e3*60*5,gcTime:1e3*60*15};exports.AGENT_PROFILES_QUERY_KEYS=r,exports.AGENT_PROFILES_RETRY_OPTIONS=a,exports.APP_UPDATE_QUERY_KEYS=l,exports.CONFIG_CACHE_OPTIONS=f,exports.CONVERSATION_QUERY_KEYS=u,exports.LLM_PROFILES_QUERY_KEYS=n,exports.LLM_SUBSCRIPTION_QUERY_KEYS=o,exports.LOCAL_PLANNER_MUTATION_KEYS=d,exports.LOCAL_WORKSPACES_QUERY_KEYS=s,exports.PLUGINS_QUERY_KEYS=c,exports.PROVIDER_CONNECTIONS_QUERY_KEYS=i,exports.QUERY_KEYS=e,exports.SETTINGS_QUERY_KEYS=t;
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");var e={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},t={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},n={all:[`llm-profiles`]},r={all:[`agent-profiles`],detail:(e,t,n)=>[`agent-profiles`,e,t,`detail`,n]},i={all:[`provider-connections`]},a={retry:!1},o={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},s={all:[`local-workspaces`]},c={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},l={latestVersion:[`agent-canvas-latest-version`]},u={subConversations:[`v1`,`sub-conversations`]},d={create:[`create-local-planning-conversation`]},f={staleTime:1e3*60*5,gcTime:1e3*60*15};exports.AGENT_PROFILES_QUERY_KEYS=r,exports.AGENT_PROFILES_RETRY_OPTIONS=a,exports.APP_UPDATE_QUERY_KEYS=l,exports.CONFIG_CACHE_OPTIONS=f,exports.CONVERSATION_QUERY_KEYS=u,exports.LLM_PROFILES_QUERY_KEYS=n,exports.LLM_SUBSCRIPTION_QUERY_KEYS=o,exports.LOCAL_PLANNER_MUTATION_KEYS=d,exports.LOCAL_WORKSPACES_QUERY_KEYS=s,exports.PLUGINS_QUERY_KEYS=c,exports.PROVIDER_CONNECTIONS_QUERY_KEYS=i,exports.QUERY_KEYS=e,exports.SETTINGS_QUERY_KEYS=t;
|
|
2
2
|
//# sourceMappingURL=query-keys.cjs.map
|
|
@@ -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\nexport const PROVIDER_CONNECTIONS_QUERY_KEYS = {\n all: [\"provider-connections\"] 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 CANVAS_EXTENSIONS_QUERY_KEYS = {\n all: [\"canvas-extensions\"] as const,\n installed: (\n backendId: string,\n orgId: string | null,\n connectionRevision: number,\n ) =>\n [\n \"canvas-extensions\",\n \"installed\",\n backendId,\n orgId,\n connectionRevision,\n ] 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\nexport const CONVERSATION_QUERY_KEYS = {\n subConversations: [\"v1\", \"sub-conversations\"] as const,\n} as const;\n\nexport const LOCAL_PLANNER_MUTATION_KEYS = {\n create: [\"create-local-planning-conversation\"] 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,
|
|
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 // Nested under `all` so profile mutations invalidate cached details too.\n detail: (backendId: string, orgId: string | null | undefined, name: string) =>\n [\"agent-profiles\", backendId, orgId, \"detail\", name] as const,\n} as const;\n\nexport const PROVIDER_CONNECTIONS_QUERY_KEYS = {\n all: [\"provider-connections\"] 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 CANVAS_EXTENSIONS_QUERY_KEYS = {\n all: [\"canvas-extensions\"] as const,\n installed: (\n backendId: string,\n orgId: string | null,\n connectionRevision: number,\n ) =>\n [\n \"canvas-extensions\",\n \"installed\",\n backendId,\n orgId,\n connectionRevision,\n ] 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\nexport const CONVERSATION_QUERY_KEYS = {\n subConversations: [\"v1\", \"sub-conversations\"] as const,\n} as const;\n\nexport const LOCAL_PLANNER_MUTATION_KEYS = {\n create: [\"create-local-planning-conversation\"] 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,EAEtB,QAAS,EAAmB,EAAkC,IAC5D,CAAC,iBAAkB,EAAW,EAAO,SAAU,CAAI,CACvD,EAEa,EAAkC,CAC7C,IAAK,CAAC,sBAAsB,CAC9B,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,EAuBa,EAAwB,CAEnC,cAAe,CAAC,6BAA6B,CAC/C,EAEa,EAA0B,CACrC,iBAAkB,CAAC,KAAM,mBAAmB,CAC9C,EAEa,EAA8B,CACzC,OAAQ,CAAC,oCAAoC,CAC/C,EAGa,EAAuB,CAClC,UAAW,IAAO,GAAK,EACvB,OAAQ,IAAO,GAAK,EACtB"}
|
|
@@ -19,6 +19,7 @@ export declare const LLM_PROFILES_QUERY_KEYS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const AGENT_PROFILES_QUERY_KEYS: {
|
|
21
21
|
readonly all: readonly ["agent-profiles"];
|
|
22
|
+
readonly detail: (backendId: string, orgId: string | null | undefined, name: string) => readonly ["agent-profiles", string, string | null | undefined, "detail", string];
|
|
22
23
|
};
|
|
23
24
|
export declare const PROVIDER_CONNECTIONS_QUERY_KEYS: {
|
|
24
25
|
readonly all: readonly ["provider-connections"];
|
|
@@ -6,7 +6,16 @@ var e = {
|
|
|
6
6
|
all: ["settings"],
|
|
7
7
|
byScope: (e) => ["settings", e],
|
|
8
8
|
personal: () => ["settings", "personal"]
|
|
9
|
-
}, n = { all: ["llm-profiles"] }, r = {
|
|
9
|
+
}, n = { all: ["llm-profiles"] }, r = {
|
|
10
|
+
all: ["agent-profiles"],
|
|
11
|
+
detail: (e, t, n) => [
|
|
12
|
+
"agent-profiles",
|
|
13
|
+
e,
|
|
14
|
+
t,
|
|
15
|
+
"detail",
|
|
16
|
+
n
|
|
17
|
+
]
|
|
18
|
+
}, i = { all: ["provider-connections"] }, a = { retry: !1 }, o = {
|
|
10
19
|
all: ["llm-subscription"],
|
|
11
20
|
openaiStatus: [
|
|
12
21
|
"llm-subscription",
|
|
@@ -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\nexport const PROVIDER_CONNECTIONS_QUERY_KEYS = {\n all: [\"provider-connections\"] 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 CANVAS_EXTENSIONS_QUERY_KEYS = {\n all: [\"canvas-extensions\"] as const,\n installed: (\n backendId: string,\n orgId: string | null,\n connectionRevision: number,\n ) =>\n [\n \"canvas-extensions\",\n \"installed\",\n backendId,\n orgId,\n connectionRevision,\n ] 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\nexport const CONVERSATION_QUERY_KEYS = {\n subConversations: [\"v1\", \"sub-conversations\"] as const,\n} as const;\n\nexport const LOCAL_PLANNER_MUTATION_KEYS = {\n create: [\"create-local-planning-conversation\"] 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,
|
|
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 // Nested under `all` so profile mutations invalidate cached details too.\n detail: (backendId: string, orgId: string | null | undefined, name: string) =>\n [\"agent-profiles\", backendId, orgId, \"detail\", name] as const,\n} as const;\n\nexport const PROVIDER_CONNECTIONS_QUERY_KEYS = {\n all: [\"provider-connections\"] 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 CANVAS_EXTENSIONS_QUERY_KEYS = {\n all: [\"canvas-extensions\"] as const,\n installed: (\n backendId: string,\n orgId: string | null,\n connectionRevision: number,\n ) =>\n [\n \"canvas-extensions\",\n \"installed\",\n backendId,\n orgId,\n connectionRevision,\n ] 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\nexport const CONVERSATION_QUERY_KEYS = {\n subConversations: [\"v1\", \"sub-conversations\"] as const,\n} as const;\n\nexport const LOCAL_PLANNER_MUTATION_KEYS = {\n create: [\"create-local-planning-conversation\"] 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;CACvC,KAAK,CAAC,gBAAgB;CAEtB,SAAS,GAAmB,GAAkC,MAC5D;EAAC;EAAkB;EAAW;EAAO;EAAU;CAAI;AACvD,GAEa,IAAkC,EAC7C,KAAK,CAAC,sBAAsB,EAC9B,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,GAuBa,IAAwB,EAEnC,eAAe,CAAC,6BAA6B,EAC/C,GAEa,IAA0B,EACrC,kBAAkB,CAAC,MAAM,mBAAmB,EAC9C,GAEa,IAA8B,EACzC,QAAQ,CAAC,oCAAoC,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("../use-conversation-id.cjs"),t=require("./query-keys.cjs"),n=require("../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),r=require("../../contexts/active-backend-context.cjs"),i=require("../../api/agent-profiles-service/agent-profiles-service.api.cjs"),a=require("../use-active-agent-profile.cjs");function o(
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../use-conversation-id.cjs"),t=require("./query-keys.cjs"),n=require("../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),r=require("../../contexts/active-backend-context.cjs"),i=require("../../api/agent-profiles-service/agent-profiles-service.api.cjs"),a=require("../use-active-agent-profile.cjs");function o(){let{backend:o,orgId:s}=r.useActiveBackend(),{conversationId:c}=e.useOptionalConversationId(),{activeProfile:l}=a.useActiveAgentProfile(),u=l?.agent_kind===`acp`?l.name:null,{data:d}=n.useQuery({queryKey:t.AGENT_PROFILES_QUERY_KEYS.detail(o.id,s,u??``),queryFn:()=>i.default.getProfile(u),enabled:!c&&u!=null,...t.CONFIG_CACHE_OPTIONS,...t.AGENT_PROFILES_RETRY_OPTIONS,meta:{disableToast:!0}}),f=d?.profile;return f?.agent_kind===`acp`?f:null}exports.useActiveAcpProfileDetail=o;
|
|
2
2
|
//# sourceMappingURL=use-active-acp-profile-detail.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-active-acp-profile-detail.cjs","names":[],"sources":["../../../src/hooks/query/use-active-acp-profile-detail.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport type { ACPAgentProfile } from \"@openhands/typescript-client\";\nimport AgentProfilesService from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { useActiveAgentProfile } from \"#/hooks/use-active-agent-profile\";\nimport {\n CONFIG_CACHE_OPTIONS,\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n} from \"./query-keys\";\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"use-active-acp-profile-detail.cjs","names":[],"sources":["../../../src/hooks/query/use-active-acp-profile-detail.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport type { ACPAgentProfile } from \"@openhands/typescript-client\";\nimport AgentProfilesService from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { useActiveAgentProfile } from \"#/hooks/use-active-agent-profile\";\nimport {\n CONFIG_CACHE_OPTIONS,\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n} from \"./query-keys\";\n\n/**\n * Full detail of the active AgentProfile when it is ACP and no conversation is\n * open. `AgentProfileSummary` carries no `acp_server`/`acp_model`, and profile\n * activation never writes `settings.agent_settings` — so the home-page ACP\n * model picker must read the active profile's own fields (the conversation\n * launch source) rather than the possibly-stale global agent settings.\n *\n * Returns the ACP-narrowed profile, or `null` while loading / when the active\n * profile isn't ACP / on legacy backends without the profiles surface (callers\n * fall back to `settings.agent_settings` there).\n */\nexport function useActiveAcpProfileDetail(): ACPAgentProfile | null {\n const { backend, orgId } = useActiveBackend();\n const { conversationId } = useOptionalConversationId();\n const { activeProfile } = useActiveAgentProfile();\n const activeAcpProfileName =\n activeProfile?.agent_kind === \"acp\" ? activeProfile.name : null;\n\n const { data } = useQuery({\n queryKey: AGENT_PROFILES_QUERY_KEYS.detail(\n backend.id,\n orgId,\n activeAcpProfileName ?? \"\",\n ),\n queryFn: () => AgentProfilesService.getProfile(activeAcpProfileName!),\n enabled: !conversationId && activeAcpProfileName != null,\n ...CONFIG_CACHE_OPTIONS,\n ...AGENT_PROFILES_RETRY_OPTIONS,\n meta: { disableToast: true },\n });\n\n const profile = data?.profile;\n return profile?.agent_kind === \"acp\" ? profile : null;\n}\n"],"mappings":"6XAuBA,SAAgB,GAAoD,CAClE,GAAM,CAAE,UAAS,SAAU,EAAA,iBAAiB,EACtC,CAAE,kBAAmB,EAAA,0BAA0B,EAC/C,CAAE,iBAAkB,EAAA,sBAAsB,EAC1C,EACJ,GAAe,aAAe,MAAQ,EAAc,KAAO,KAEvD,CAAE,QAAS,EAAA,SAAS,CACxB,SAAU,EAAA,0BAA0B,OAClC,EAAQ,GACR,EACA,GAAwB,EAC1B,EACA,YAAe,EAAA,QAAqB,WAAW,CAAqB,EACpE,QAAS,CAAC,GAAkB,GAAwB,KACpD,GAAG,EAAA,qBACH,GAAG,EAAA,6BACH,KAAM,CAAE,aAAc,EAAK,CAC7B,CAAC,EAEK,EAAU,GAAM,QACtB,OAAO,GAAS,aAAe,MAAQ,EAAU,IACnD"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import type { ACPAgentProfile } from "@openhands/typescript-client";
|
|
2
|
-
/**
|
|
3
|
-
* Cache key for one profile's full detail. Lives under the agent-profiles
|
|
4
|
-
* prefix on purpose: activate/save/delete invalidate that prefix, so the
|
|
5
|
-
* detail refetches for free. (`useActivateAgentProfile.onMutate` also
|
|
6
|
-
* `setQueriesData`s the prefix, writing a stray `active_agent_profile_id`
|
|
7
|
-
* onto this entry — benign, consumers only read `.profile`.) Shared with
|
|
8
|
-
* `useSwitchAcpModel`, which `ensureQueryData`s the same entry.
|
|
9
|
-
*/
|
|
10
|
-
export declare function agentProfileDetailQueryKey(backendId: string, orgId: string | null | undefined, name: string): readonly ["agent-profiles", string, string | null | undefined, "detail", string];
|
|
11
2
|
/**
|
|
12
3
|
* Full detail of the active AgentProfile when it is ACP and no conversation is
|
|
13
4
|
* open. `AgentProfileSummary` carries no `acp_server`/`acp_model`, and profile
|
|
@@ -5,18 +5,9 @@ import { useActiveBackend as a } from "../../contexts/active-backend-context.js"
|
|
|
5
5
|
import o from "../../api/agent-profiles-service/agent-profiles-service.api.js";
|
|
6
6
|
import { useActiveAgentProfile as s } from "../use-active-agent-profile.js";
|
|
7
7
|
//#region src/hooks/query/use-active-acp-profile-detail.ts
|
|
8
|
-
function c(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
e,
|
|
12
|
-
n,
|
|
13
|
-
"detail",
|
|
14
|
-
r
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
function l() {
|
|
18
|
-
let { backend: t, orgId: l } = a(), { conversationId: u } = e(), { activeProfile: d } = s(), f = d?.agent_kind === "acp" ? d.name : null, { data: p } = i({
|
|
19
|
-
queryKey: c(t.id, l, f ?? ""),
|
|
8
|
+
function c() {
|
|
9
|
+
let { backend: c, orgId: l } = a(), { conversationId: u } = e(), { activeProfile: d } = s(), f = d?.agent_kind === "acp" ? d.name : null, { data: p } = i({
|
|
10
|
+
queryKey: t.detail(c.id, l, f ?? ""),
|
|
20
11
|
queryFn: () => o.getProfile(f),
|
|
21
12
|
enabled: !u && f != null,
|
|
22
13
|
...r,
|
|
@@ -26,6 +17,6 @@ function l() {
|
|
|
26
17
|
return m?.agent_kind === "acp" ? m : null;
|
|
27
18
|
}
|
|
28
19
|
//#endregion
|
|
29
|
-
export { c as
|
|
20
|
+
export { c as useActiveAcpProfileDetail };
|
|
30
21
|
|
|
31
22
|
//# sourceMappingURL=use-active-acp-profile-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-active-acp-profile-detail.js","names":[],"sources":["../../../src/hooks/query/use-active-acp-profile-detail.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport type { ACPAgentProfile } from \"@openhands/typescript-client\";\nimport AgentProfilesService from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { useActiveAgentProfile } from \"#/hooks/use-active-agent-profile\";\nimport {\n CONFIG_CACHE_OPTIONS,\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n} from \"./query-keys\";\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"use-active-acp-profile-detail.js","names":[],"sources":["../../../src/hooks/query/use-active-acp-profile-detail.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport type { ACPAgentProfile } from \"@openhands/typescript-client\";\nimport AgentProfilesService from \"#/api/agent-profiles-service/agent-profiles-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { useOptionalConversationId } from \"#/hooks/use-conversation-id\";\nimport { useActiveAgentProfile } from \"#/hooks/use-active-agent-profile\";\nimport {\n CONFIG_CACHE_OPTIONS,\n AGENT_PROFILES_QUERY_KEYS,\n AGENT_PROFILES_RETRY_OPTIONS,\n} from \"./query-keys\";\n\n/**\n * Full detail of the active AgentProfile when it is ACP and no conversation is\n * open. `AgentProfileSummary` carries no `acp_server`/`acp_model`, and profile\n * activation never writes `settings.agent_settings` — so the home-page ACP\n * model picker must read the active profile's own fields (the conversation\n * launch source) rather than the possibly-stale global agent settings.\n *\n * Returns the ACP-narrowed profile, or `null` while loading / when the active\n * profile isn't ACP / on legacy backends without the profiles surface (callers\n * fall back to `settings.agent_settings` there).\n */\nexport function useActiveAcpProfileDetail(): ACPAgentProfile | null {\n const { backend, orgId } = useActiveBackend();\n const { conversationId } = useOptionalConversationId();\n const { activeProfile } = useActiveAgentProfile();\n const activeAcpProfileName =\n activeProfile?.agent_kind === \"acp\" ? activeProfile.name : null;\n\n const { data } = useQuery({\n queryKey: AGENT_PROFILES_QUERY_KEYS.detail(\n backend.id,\n orgId,\n activeAcpProfileName ?? \"\",\n ),\n queryFn: () => AgentProfilesService.getProfile(activeAcpProfileName!),\n enabled: !conversationId && activeAcpProfileName != null,\n ...CONFIG_CACHE_OPTIONS,\n ...AGENT_PROFILES_RETRY_OPTIONS,\n meta: { disableToast: true },\n });\n\n const profile = data?.profile;\n return profile?.agent_kind === \"acp\" ? profile : null;\n}\n"],"mappings":";;;;;;;AAuBA,SAAgB,IAAoD;CAClE,IAAM,EAAE,YAAS,aAAU,EAAiB,GACtC,EAAE,sBAAmB,EAA0B,GAC/C,EAAE,qBAAkB,EAAsB,GAC1C,IACJ,GAAe,eAAe,QAAQ,EAAc,OAAO,MAEvD,EAAE,YAAS,EAAS;EACxB,UAAU,EAA0B,OAClC,EAAQ,IACR,GACA,KAAwB,EAC1B;EACA,eAAe,EAAqB,WAAW,CAAqB;EACpE,SAAS,CAAC,KAAkB,KAAwB;EACpD,GAAG;EACH,GAAG;EACH,MAAM,EAAE,cAAc,GAAK;CAC7B,CAAC,GAEK,IAAU,GAAM;CACtB,OAAO,GAAS,eAAe,QAAQ,IAAU;AACnD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../api/backend-registry/active-store.cjs"),n=require("../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"),r=require("../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),i=require("../../query-client-config.cjs"),a=require("../../contexts/active-backend-context.cjs"),o=require("../../api/automation-service/automation-service.api.cjs");let s=require("react");s=e.__toESM(s,1);var c=`automation-sdk-version`,l=3600*1e3;async function u(){if(typeof o.default.getSdkVersion!=`function`)return null;try{return await o.default.getSdkVersion()}catch{return null}}function d(){let e=a.useActiveBackend(),{backend:d}=e,f=s.default.useContext(n.QueryClientContext),p=!t.isNoBackend(d)&&typeof o.default.getSdkVersion==`function`,{data:m}=r.useQuery({queryKey:[c,d.id,d.kind,d.host,e.orgId??``],queryFn:u,enabled:p,initialData:p?void 0:null,staleTime:l,gcTime:l},f??i.getQueryClient());return m??null}exports.useAutomationSdkVersion=d;
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../api/backend-registry/active-store.cjs"),n=require("../../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs"),r=require("../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),i=require("../../query-client-config.cjs"),a=require("../../contexts/active-backend-context.cjs"),o=require("../../api/automation-service/automation-service.api.cjs");let s=require("react");s=e.__toESM(s,1);var c=`automation-sdk-version`,l=3600*1e3;async function u(){if(typeof o.default.getSdkVersion!=`function`)return null;try{return await o.default.getSdkVersion()}catch{return null}}function d(){let e=a.useActiveBackend(),{backend:d}=e,f=s.default.useContext(n.QueryClientContext),p=!t.isNoBackend(d)&&typeof o.default.getSdkVersion==`function`,{data:m}=r.useQuery({queryKey:[c,d.id,d.kind,d.host,e.orgId??``],queryFn:u,enabled:p,initialData:p?void 0:null,staleTime:l,gcTime:l,refetchOnWindowFocus:!1,refetchOnReconnect:!1},f??i.getQueryClient());return m??null}exports.useAutomationSdkVersion=d;
|
|
2
2
|
//# sourceMappingURL=use-automation-sdk-version.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-automation-sdk-version.cjs","names":[],"sources":["../../../src/hooks/query/use-automation-sdk-version.ts"],"sourcesContent":["import React from \"react\";\nimport { QueryClientContext, useQuery } from \"@tanstack/react-query\";\nimport AutomationService from \"#/api/automation-service/automation-service.api\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { getQueryClient } from \"#/query-client-config\";\n\nexport const AUTOMATION_SDK_VERSION_CACHE_NAMESPACE = \"automation-sdk-version\";\n\nconst AUTOMATION_SDK_VERSION_CACHE_TIME_MS = 60 * 60 * 1000;\nasync function fetchAutomationSdkVersion(): Promise<string | null> {\n if (typeof AutomationService.getSdkVersion !== \"function\") {\n return null;\n }\n\n try {\n return await AutomationService.getSdkVersion();\n } catch {\n return null;\n }\n}\n\nexport function useAutomationSdkVersion() {\n const active = useActiveBackend();\n const { backend } = active;\n const providerQueryClient = React.useContext(QueryClientContext);\n const canFetchSdkVersion =\n !isNoBackend(backend) &&\n typeof AutomationService.getSdkVersion === \"function\";\n const { data } = useQuery(\n {\n queryKey: [\n AUTOMATION_SDK_VERSION_CACHE_NAMESPACE,\n backend.id,\n backend.kind,\n backend.host,\n active.orgId ?? \"\",\n ],\n queryFn: fetchAutomationSdkVersion,\n enabled: canFetchSdkVersion,\n initialData: canFetchSdkVersion ? undefined : null,\n staleTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n gcTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n },\n providerQueryClient ?? getQueryClient(),\n );\n\n return data ?? null;\n}\n"],"mappings":"2eAOA,IAAa,EAAyC,yBAEhD,EAAuC,KAAU,IACvD,eAAe,GAAoD,CACjE,GAAI,OAAO,EAAA,QAAkB,eAAkB,WAC7C,OAAO,KAGT,GAAI,CACF,OAAO,MAAM,EAAA,QAAkB,cAAc,CAC/C,MAAQ,CACN,OAAO,IACT,CACF,CAEA,SAAgB,GAA0B,CACxC,IAAM,EAAS,EAAA,iBAAiB,EAC1B,CAAE,WAAY,EACd,EAAsB,EAAA,QAAM,WAAW,EAAA,kBAAkB,EACzD,EACJ,CAAC,EAAA,YAAY,CAAO,GACpB,OAAO,EAAA,QAAkB,eAAkB,WACvC,CAAE,QAAS,EAAA,SACf,CACE,SAAU,CACR,EACA,EAAQ,GACR,EAAQ,KACR,EAAQ,KACR,EAAO,OAAS,EAClB,EACA,QAAS,EACT,QAAS,EACT,YAAa,EAAqB,IAAA,GAAY,KAC9C,UAAW,EACX,OAAQ,
|
|
1
|
+
{"version":3,"file":"use-automation-sdk-version.cjs","names":[],"sources":["../../../src/hooks/query/use-automation-sdk-version.ts"],"sourcesContent":["import React from \"react\";\nimport { QueryClientContext, useQuery } from \"@tanstack/react-query\";\nimport AutomationService from \"#/api/automation-service/automation-service.api\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { getQueryClient } from \"#/query-client-config\";\n\nexport const AUTOMATION_SDK_VERSION_CACHE_NAMESPACE = \"automation-sdk-version\";\n\nconst AUTOMATION_SDK_VERSION_CACHE_TIME_MS = 60 * 60 * 1000;\nasync function fetchAutomationSdkVersion(): Promise<string | null> {\n if (typeof AutomationService.getSdkVersion !== \"function\") {\n return null;\n }\n\n try {\n return await AutomationService.getSdkVersion();\n } catch {\n return null;\n }\n}\n\nexport function useAutomationSdkVersion() {\n const active = useActiveBackend();\n const { backend } = active;\n const providerQueryClient = React.useContext(QueryClientContext);\n const canFetchSdkVersion =\n !isNoBackend(backend) &&\n typeof AutomationService.getSdkVersion === \"function\";\n const { data } = useQuery(\n {\n queryKey: [\n AUTOMATION_SDK_VERSION_CACHE_NAMESPACE,\n backend.id,\n backend.kind,\n backend.host,\n active.orgId ?? \"\",\n ],\n queryFn: fetchAutomationSdkVersion,\n enabled: canFetchSdkVersion,\n initialData: canFetchSdkVersion ? undefined : null,\n staleTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n gcTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n },\n providerQueryClient ?? getQueryClient(),\n );\n\n return data ?? null;\n}\n"],"mappings":"2eAOA,IAAa,EAAyC,yBAEhD,EAAuC,KAAU,IACvD,eAAe,GAAoD,CACjE,GAAI,OAAO,EAAA,QAAkB,eAAkB,WAC7C,OAAO,KAGT,GAAI,CACF,OAAO,MAAM,EAAA,QAAkB,cAAc,CAC/C,MAAQ,CACN,OAAO,IACT,CACF,CAEA,SAAgB,GAA0B,CACxC,IAAM,EAAS,EAAA,iBAAiB,EAC1B,CAAE,WAAY,EACd,EAAsB,EAAA,QAAM,WAAW,EAAA,kBAAkB,EACzD,EACJ,CAAC,EAAA,YAAY,CAAO,GACpB,OAAO,EAAA,QAAkB,eAAkB,WACvC,CAAE,QAAS,EAAA,SACf,CACE,SAAU,CACR,EACA,EAAQ,GACR,EAAQ,KACR,EAAQ,KACR,EAAO,OAAS,EAClB,EACA,QAAS,EACT,QAAS,EACT,YAAa,EAAqB,IAAA,GAAY,KAC9C,UAAW,EACX,OAAQ,EACR,qBAAsB,GACtB,mBAAoB,EACtB,EACA,GAAuB,EAAA,eAAe,CACxC,EAEA,OAAO,GAAQ,IACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-automation-sdk-version.js","names":[],"sources":["../../../src/hooks/query/use-automation-sdk-version.ts"],"sourcesContent":["import React from \"react\";\nimport { QueryClientContext, useQuery } from \"@tanstack/react-query\";\nimport AutomationService from \"#/api/automation-service/automation-service.api\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { getQueryClient } from \"#/query-client-config\";\n\nexport const AUTOMATION_SDK_VERSION_CACHE_NAMESPACE = \"automation-sdk-version\";\n\nconst AUTOMATION_SDK_VERSION_CACHE_TIME_MS = 60 * 60 * 1000;\nasync function fetchAutomationSdkVersion(): Promise<string | null> {\n if (typeof AutomationService.getSdkVersion !== \"function\") {\n return null;\n }\n\n try {\n return await AutomationService.getSdkVersion();\n } catch {\n return null;\n }\n}\n\nexport function useAutomationSdkVersion() {\n const active = useActiveBackend();\n const { backend } = active;\n const providerQueryClient = React.useContext(QueryClientContext);\n const canFetchSdkVersion =\n !isNoBackend(backend) &&\n typeof AutomationService.getSdkVersion === \"function\";\n const { data } = useQuery(\n {\n queryKey: [\n AUTOMATION_SDK_VERSION_CACHE_NAMESPACE,\n backend.id,\n backend.kind,\n backend.host,\n active.orgId ?? \"\",\n ],\n queryFn: fetchAutomationSdkVersion,\n enabled: canFetchSdkVersion,\n initialData: canFetchSdkVersion ? undefined : null,\n staleTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n gcTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n },\n providerQueryClient ?? getQueryClient(),\n );\n\n return data ?? null;\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,IAAyC,0BAEhD,IAAuC,OAAU;AACvD,eAAe,IAAoD;CACjE,IAAI,OAAO,EAAkB,iBAAkB,YAC7C,OAAO;CAGT,IAAI;EACF,OAAO,MAAM,EAAkB,cAAc;CAC/C,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,IAA0B;CACxC,IAAM,IAAS,EAAiB,GAC1B,EAAE,eAAY,GACd,IAAsB,EAAM,WAAW,CAAkB,GACzD,IACJ,CAAC,EAAY,CAAO,KACpB,OAAO,EAAkB,iBAAkB,YACvC,EAAE,YAAS,EACf;EACE,UAAU;GACR;GACA,EAAQ;GACR,EAAQ;GACR,EAAQ;GACR,EAAO,SAAS;EAClB;EACA,SAAS;EACT,SAAS;EACT,aAAa,IAAqB,KAAA,IAAY;EAC9C,WAAW;EACX,QAAQ;
|
|
1
|
+
{"version":3,"file":"use-automation-sdk-version.js","names":[],"sources":["../../../src/hooks/query/use-automation-sdk-version.ts"],"sourcesContent":["import React from \"react\";\nimport { QueryClientContext, useQuery } from \"@tanstack/react-query\";\nimport AutomationService from \"#/api/automation-service/automation-service.api\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { getQueryClient } from \"#/query-client-config\";\n\nexport const AUTOMATION_SDK_VERSION_CACHE_NAMESPACE = \"automation-sdk-version\";\n\nconst AUTOMATION_SDK_VERSION_CACHE_TIME_MS = 60 * 60 * 1000;\nasync function fetchAutomationSdkVersion(): Promise<string | null> {\n if (typeof AutomationService.getSdkVersion !== \"function\") {\n return null;\n }\n\n try {\n return await AutomationService.getSdkVersion();\n } catch {\n return null;\n }\n}\n\nexport function useAutomationSdkVersion() {\n const active = useActiveBackend();\n const { backend } = active;\n const providerQueryClient = React.useContext(QueryClientContext);\n const canFetchSdkVersion =\n !isNoBackend(backend) &&\n typeof AutomationService.getSdkVersion === \"function\";\n const { data } = useQuery(\n {\n queryKey: [\n AUTOMATION_SDK_VERSION_CACHE_NAMESPACE,\n backend.id,\n backend.kind,\n backend.host,\n active.orgId ?? \"\",\n ],\n queryFn: fetchAutomationSdkVersion,\n enabled: canFetchSdkVersion,\n initialData: canFetchSdkVersion ? undefined : null,\n staleTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n gcTime: AUTOMATION_SDK_VERSION_CACHE_TIME_MS,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n },\n providerQueryClient ?? getQueryClient(),\n );\n\n return data ?? null;\n}\n"],"mappings":";;;;;;;;AAOA,IAAa,IAAyC,0BAEhD,IAAuC,OAAU;AACvD,eAAe,IAAoD;CACjE,IAAI,OAAO,EAAkB,iBAAkB,YAC7C,OAAO;CAGT,IAAI;EACF,OAAO,MAAM,EAAkB,cAAc;CAC/C,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAgB,IAA0B;CACxC,IAAM,IAAS,EAAiB,GAC1B,EAAE,eAAY,GACd,IAAsB,EAAM,WAAW,CAAkB,GACzD,IACJ,CAAC,EAAY,CAAO,KACpB,OAAO,EAAkB,iBAAkB,YACvC,EAAE,YAAS,EACf;EACE,UAAU;GACR;GACA,EAAQ;GACR,EAAQ;GACR,EAAQ;GACR,EAAO,SAAS;EAClB;EACA,SAAS;EACT,SAAS;EACT,aAAa,IAAqB,KAAA,IAAY;EAC9C,WAAW;EACX,QAAQ;EACR,sBAAsB;EACtB,oBAAoB;CACtB,GACA,KAAuB,EAAe,CACxC;CAEA,OAAO,KAAQ;AACjB"}
|