@openhands/agent-canvas 1.17.0 → 1.19.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-BQ4o4vqy.js +1 -0
- package/build/assets/active-backend-context-BsLfwrXB.js +2 -0
- package/build/assets/{agent-context-settings-CJUrcBut.js → agent-context-settings-D9i6ezoJ.js} +1 -1
- package/build/assets/{agent-profiles-service.api-Biieml2L.js → agent-profiles-service.api-U-9YzDFU.js} +1 -1
- package/build/assets/agent-profiles-settings-D-bUV2PX.js +1 -0
- package/build/assets/agent-server-client-options-EHB23gyx.js +1 -0
- package/build/assets/agent-server-config-C_x8Otd9.js +1 -0
- package/build/assets/agent-server-conversation-service.api-BaVQ6NpE.js +88 -0
- package/build/assets/agent-settings-BZJHtaIK.js +2 -0
- package/build/assets/agent-settings-D4snDd6u.js +1 -0
- package/build/assets/alert-banner-BkVt_8Or.js +1 -0
- package/build/assets/{api-error-message-Ve79qDcN.js → api-error-message-BXo0lCI5.js} +1 -1
- package/build/assets/api-key-entry-screen-fAIld-n7.js +1 -0
- package/build/assets/app-settings-DITbrM2u.js +1 -0
- package/build/assets/automation-detail-DawHmaOl.js +3 -0
- package/build/assets/automation-disabled-reason-DtgC8Ppt.js +1 -0
- package/build/assets/{automation-export-DxY47m3T.js → automation-export-Kv6e0bHx.js} +1 -1
- package/build/assets/automation-git-sync-Dd98G_Oz.js +1 -0
- package/build/assets/automation-setup-route-Cdc109ZD.js +3 -0
- package/build/assets/{automation-templates-4C4PM8K7.js → automation-templates-Xhr-FDAB.js} +1 -1
- package/build/assets/automations-list-BeP1LuzQ.js +1 -0
- package/build/assets/{back-nav-button-B8tH0BEp.js → back-nav-button-DWNiN277.js} +1 -1
- package/build/assets/backend-form-modal-DeaUJIik.js +1 -0
- package/build/assets/backend-synced-settings-badge-Br85iWIY.js +1 -0
- package/build/assets/badge-Cdnei7Ly.js +1 -0
- package/build/assets/{base-modal-DTULovNc.js → base-modal-Ds7grR67.js} +1 -1
- package/build/assets/{bot-CLMxGFaq.js → bot-ByolqPEr.js} +1 -1
- package/build/assets/{brand-button-DxPO4Lf8.js → brand-button-mQq2Ld1I.js} +1 -1
- package/build/assets/browser-Bfum8fkE.js +46 -0
- package/build/assets/browser-tab-CmYT4j_r.js +1 -0
- package/build/assets/canvas-extension-page-CokKSVRG.js +1 -0
- package/build/assets/canvas-extensions-BoQEYG-2.js +1 -0
- package/build/assets/{canvas-extensions-runtime-DdnkgJXV.js → canvas-extensions-runtime-Du2M5iEX.js} +1 -1
- package/build/assets/{chat-send-button-B3SFSIg5.js → chat-send-button-DM3JgMc2.js} +1 -1
- package/build/assets/check-Bo8s5Ylg.js +1 -0
- package/build/assets/chevron-down-Cr6Fn_wS.js +1 -0
- package/build/assets/chevron-right-CfdfRn-8.js +1 -0
- package/build/assets/circle-check-5pH3qCji.js +1 -0
- package/build/assets/circle-plus-check-toggle-BbYBiUwv.js +1 -0
- package/build/assets/{cloud-funnel-analytics-BQanUEEC.js → cloud-funnel-analytics-D02kgq1s.js} +1 -1
- package/build/assets/{cog-VBlRo6iw.js → cog-Dy1eWbSZ.js} +1 -1
- package/build/assets/command-menu-mehU3Evb.js +1 -0
- package/build/assets/commits-tab-DhQW8CXi.js +1 -0
- package/build/assets/{condenser-settings-eVKFMvap.js → condenser-settings-eRk6Fkx6.js} +1 -1
- package/build/assets/confirmation-modal-BmVt_c0I.js +1 -0
- package/build/assets/{context-menu-list-item-DDROe12Z.js → context-menu-list-item-lx2zk9G7.js} +1 -1
- package/build/assets/{conversation-BnjJSFf5.js → conversation-BOj0ENI6.js} +8 -8
- package/build/assets/conversation-SouWlGvs.js +1 -0
- package/build/assets/conversation-panel-SouWlGvs.js +1 -0
- package/build/assets/conversation-state-store-C6YncQNo.js +1 -0
- package/build/assets/conversation-store-DC-JlJuq.js +6 -0
- package/build/assets/{conversation-tab-empty-state-DKlzAz5c.js → conversation-tab-empty-state-DIhwCC2J.js} +1 -1
- package/build/assets/copy-to-clipboard-button-DVNXLylP.js +1 -0
- package/build/assets/device-verify-LP-x7nra.js +1 -0
- package/build/assets/{dropdown-classes-B9kJVDIk.js → dropdown-classes-goDldkiu.js} +1 -1
- package/build/assets/edit-automation-modal-BJJR9wSW.js +1 -0
- package/build/assets/empty-state-Cd-TFe7i.js +1 -0
- package/build/assets/{entry.client-Ds8LVp-E.js → entry.client-CJdjIvMZ.js} +2 -2
- package/build/assets/enum-filter-dropdown-pocrz9AL.js +1 -0
- package/build/assets/environment-switch-overlay-Dwe78wRl.js +1 -0
- package/build/assets/error-state-SuWwztxV.js +1 -0
- package/build/assets/extensions-hub-O0esK3Er.js +1 -0
- package/build/assets/extensions-navigation-CgCVSXje.js +1 -0
- package/build/assets/{external-link-DQtv7eTh.js → external-link-Bd7Tga-1.js} +1 -1
- package/build/assets/files-tab-B_6t8ljw.js +1 -0
- package/build/assets/{form-control-classes-B-z85REi.js → form-control-classes-lQfLxzH4.js} +1 -1
- package/build/assets/format-model-name-Dfh9Udrx.js +1 -0
- package/build/assets/get-git-path-Bp5rsUkl.js +1 -0
- package/build/assets/git-repo-dropdown-CbD0_LPN.js +1 -0
- package/build/assets/git-repo-dropdown-DPQVumZg.js +1 -0
- package/build/assets/highlighted-source-view-Bp0sgK-f.js +1 -0
- package/build/assets/home-BghzJd-D.js +1 -0
- package/build/assets/home-CXZ8zawS.js +1 -0
- package/build/assets/home-automation-run-tooltip-BdpCckKO.js +1 -0
- package/build/assets/home-store-DNQpfIEO.js +1 -0
- package/build/assets/hooks-service-DkxnQa4N.js +1 -0
- package/build/assets/index-home-Ca6Q5CtT.js +1 -0
- package/build/assets/info-BcajzHn1.js +1 -0
- package/build/assets/install-server-modal-DvxxYKia.js +1 -0
- package/build/assets/{key-CfXbJa8w.js → key-CwTE6XJj.js} +1 -1
- package/build/assets/launch-jsRGPRBx.js +1 -0
- package/build/assets/link-external-B4gx3EeM.js +1 -0
- package/build/assets/list-filter-B8PQk3RA.js +1 -0
- package/build/assets/{list-todo-ByXMdY4W.js → list-todo-Caa8E1X_.js} +1 -1
- package/build/assets/llm-not-configured-banner-DMdL1vaX.js +27 -0
- package/build/assets/llm-settings-dkQ5Oq7W.js +1 -0
- package/build/assets/llm-settings-lNDerSlu.js +1 -0
- package/build/assets/{llm-subscription-service-aDNBQ7Gq.js → llm-subscription-service-BiQaZbvv.js} +1 -1
- package/build/assets/loader-circle-BxJgk73D.js +1 -0
- package/build/assets/{loading-spinner-DfHI77BA.js → loading-spinner-DK1sAwVg.js} +1 -1
- package/build/assets/manage-backends-modal-DqCJohsX.js +1 -0
- package/build/assets/manifest-ff93dc8c.js +1 -0
- package/build/assets/manifest-subpage-layout-sxuPqfUr.js +1 -0
- package/build/assets/{map-provider-DXvssjw9.js → map-provider-iRs80q_6.js} +1 -1
- package/build/assets/markdown-renderer-BH5pqDuJ.js +8 -0
- package/build/assets/mcp-BtaJDXnP.js +1 -0
- package/build/assets/mcp-installed-servers-Br4ZLsjr.js +1 -0
- package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
- package/build/assets/mcp-page-DwbnQpVs.js +9 -0
- package/build/assets/messages-DmFJlW6c.js +41 -0
- package/build/assets/{modal-body-DJw4xBki.js → modal-body-DBweM2EN.js} +1 -1
- package/build/assets/{modal-classes-Dg0ngBPO.js → modal-classes-jvG85nkU.js} +1 -1
- package/build/assets/modal-close-button-BrM5fNnn.js +1 -0
- package/build/assets/{mouse-pointer-click-DEhsSUpu.js → mouse-pointer-click-BXlRN92t.js} +1 -1
- package/build/assets/onboarding-CQ8T6T0U.js +1 -0
- package/build/assets/onboarding-modal-CnliiaSN.js +1 -0
- package/build/assets/{organization-service.api-Cyg1Tn03.js → organization-service.api-DmFUEmu5.js} +1 -1
- package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
- package/build/assets/{pencil-D5c47kyN.js → pencil-q-ihqDYv.js} +1 -1
- package/build/assets/{pin-C7vMagvf.js → pin-BdroVQdN.js} +1 -1
- package/build/assets/planner-tab-CXph_C9F.js +1 -0
- package/build/assets/{plug-CeaqeF6u.js → plug-7ACOEbMs.js} +1 -1
- package/build/assets/{plugins-management-service-Bh_pBuf-.js → plugins-management-service-CcEpfNKz.js} +1 -1
- package/build/assets/plus-C2e21TFC.js +1 -0
- package/build/assets/{profiles-service.api-BbOK0EkF.js → profiles-service.api-DdF_4Zhe.js} +1 -1
- package/build/assets/providers-BWRnl31s.js +1 -0
- package/build/assets/proxy-DbEf3Nqr.js +1 -0
- package/build/assets/{puzzle-DdAqbUrb.js → puzzle-LJYnuxKe.js} +1 -1
- package/build/assets/react-BX7IV650.js +1 -0
- package/build/assets/recommended-automations-launcher-r0oI91HN.js +1 -0
- package/build/assets/{refresh-cw-DEQdPCpH.js → refresh-cw-BtdC3T8P.js} +1 -1
- package/build/assets/root-j2fFRlWS.js +2 -0
- package/build/assets/root-layout-CfGgm2lo.js +2 -0
- package/build/assets/root-sEWn3ha1.css +1 -0
- package/build/assets/schema-field-c3Ncgm4x.js +1 -0
- package/build/assets/sdk-section-page-DFEiuiFQ.js +1 -0
- package/build/assets/secret-form-WXXNFqTM.js +1 -0
- package/build/assets/{secrets-service-Cr8g8xuv.js → secrets-service-DU6wh3wX.js} +1 -1
- package/build/assets/secrets-settings-BEqbPvjy.js +1 -0
- package/build/assets/settings-DjaSQwFh.js +1 -0
- package/build/assets/settings-dropdown-input-BRR2OZwi.js +1 -0
- package/build/assets/settings-index-DHv4XFcM.js +1 -0
- package/build/assets/settings-input-Cm4VxUon.js +1 -0
- package/build/assets/{settings-list-classes-Ds4jPBHK.js → settings-list-classes-CaUfKZ33.js} +1 -1
- package/build/assets/settings-modal-djXuAnBO.js +1 -0
- package/build/assets/settings-nav-DFb3hBMr.js +16 -0
- package/build/assets/{settings-service.api-9_xdv_mh.js → settings-service.api-Q9lKW1TX.js} +1 -1
- package/build/assets/settings-switch-seaSJc7t.js +1 -0
- package/build/assets/{settings-utils-8GIIgOQL.js → settings-utils-BTaaRhLZ.js} +1 -1
- package/build/assets/shared-conversation-x3rxVCon.js +1 -0
- package/build/assets/{shield-check-DO7wa_eu.js → shield-check-C3Rl0NF8.js} +1 -1
- package/build/assets/{sidebar-layout-EPfWxk11.js → sidebar-layout-B6mcvvdV.js} +1 -1
- package/build/assets/sidebar-mobile-menu-toggle-CEqS8KnA.js +1 -0
- package/build/assets/{sidebar-nav-link-_t4_Ef-9.js → sidebar-nav-link-BTHX11LG.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-DbDX-Wvj.js → sidebar-onboarding-checklist-storage-BP1kzn6p.js} +1 -1
- package/build/assets/sidebar-store-DAZVH-DR.js +1 -0
- package/build/assets/skill-card-pill-row-TD39nfP3.js +1 -0
- package/build/assets/{skill-filter-BBeZ4JEP.js → skill-filter-CdBbbwjm.js} +2 -2
- package/build/assets/{skill-icon-badge-BDhQ-tQ0.js → skill-icon-badge-vUEp7gsC.js} +1 -1
- package/build/assets/skill-scope-BTRBQt0-.js +1 -0
- package/build/assets/skills-plugins-k1tUNAw4.js +1 -0
- package/build/assets/skills-settings-CENviPT7.js +1 -0
- package/build/assets/{styled-tooltip-Pd22BIvr.js → styled-tooltip-DVAlWYnL.js} +1 -1
- package/build/assets/task-list-tab-BLKF_x9f.js +1 -0
- package/build/assets/{terminal-onXx0_Qz.js → terminal-Ckbnqb23.js} +1 -1
- package/build/assets/{toggle-switch-lwQtxDcm.js → toggle-switch-DeiG9Mf6.js} +1 -1
- package/build/assets/{trash-2-ZhKuTLiz.js → trash-2-Bb40zQzs.js} +1 -1
- package/build/assets/trash-CXN2R54L.js +1 -0
- package/build/assets/{triangle-alert-BajLPpQg.js → triangle-alert-DEdu-b_L.js} +1 -1
- package/build/assets/{typography-HLLg_FAn.js → typography-NarNyelM.js} +1 -1
- package/build/assets/usage-tab-Drd3O006.js +1 -0
- package/build/assets/use-acp-credential-form-CJ5wPsQm.js +1 -0
- package/build/assets/{use-activate-agent-profile-BLKML6vQ.js → use-activate-agent-profile-iQZ0U3qV.js} +1 -1
- package/build/assets/use-agent-profiles-LCvb5OXT.js +1 -0
- package/build/assets/{use-automation-health-BZkQNEA8.js → use-automation-health-DdgSa8sA.js} +1 -1
- package/build/assets/{use-automation-permissions-B_RpvL-s.js → use-automation-permissions-D3kEeieu.js} +1 -1
- package/build/assets/{use-automations-Cg0PDIZr.js → use-automations-CEubcYTD.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BbN6KfDr.js → use-can-manage-org-profiles-CB8ybxFK.js} +1 -1
- package/build/assets/{use-canvas-extensions-CFUpHat6.js → use-canvas-extensions-BMacwi2v.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-Dk0rjr63.js → use-cloud-current-user-id-BEKRd6XZ.js} +1 -1
- package/build/assets/{use-config-DpafU_QP.js → use-config-3WYcJsgC.js} +1 -1
- package/build/assets/{use-create-conversation-1YgmAHt-.js → use-create-conversation-Be-eVpFp.js} +1 -1
- package/build/assets/use-create-secret-Bk9ZxTjl.js +1 -0
- package/build/assets/use-free-models-Ci3FkKEm.js +1 -0
- package/build/assets/{use-get-secrets-CQ4b0qK8.js → use-get-secrets-fqS0kxt6.js} +1 -1
- package/build/assets/use-is-authed-A2Yinlt0.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-DeYa1tFM.js → use-launch-skill-in-chat-QbXDhiHr.js} +1 -1
- package/build/assets/use-llm-configured-B71ZEVg2.js +1 -0
- package/build/assets/use-llm-profiles-xtCBMbef.js +1 -0
- package/build/assets/{use-manifest-capabilities-AOWGcu0j.js → use-manifest-capabilities-Bso6A_-A.js} +1 -1
- package/build/assets/{use-onboarding-completion-CoINurkm.js → use-onboarding-completion-CEgjL02y.js} +1 -1
- package/build/assets/{use-pinned-home-route-D6krwXjy.js → use-pinned-home-route-pK4IlJ-p.js} +1 -1
- package/build/assets/{use-plugins-marketplace-mLsIDhBv.js → use-plugins-marketplace-B8-ZEB34.js} +1 -1
- package/build/assets/use-save-agent-profile-D7hJuW_u.js +1 -0
- package/build/assets/{use-save-settings-3U5K9-8x.js → use-save-settings-CikTu5xV.js} +1 -1
- package/build/assets/{use-settings-Dn00UISA.js → use-settings-BWIH5EuN.js} +1 -1
- package/build/assets/use-settings-nav-items-DSKwLDnd.js +1 -0
- package/build/assets/use-tracking-ChnSFChv.js +3 -0
- package/build/assets/{use-user-conversation-ZWlXtbZb.js → use-user-conversation-C_l65DqW.js} +1 -1
- package/build/assets/{useInfiniteQuery-BzrRqjLg.js → useInfiniteQuery-CtSRG7uW.js} +1 -1
- package/build/assets/{useMutation-CJuK90oc.js → useMutation-Cszf8mKy.js} +1 -1
- package/build/assets/useQueries-pUohFMSP.js +1 -0
- package/build/assets/useQuery-DAAacS7O.js +1 -0
- package/build/assets/useTranslation-CCgUjPJF.js +1 -0
- package/build/assets/utils-D-gOfhmN.js +1 -0
- package/build/assets/{vendor~conversation-panel~conversation-4eJ0tml3.js → vendor~conversation-panel~conversation-C22sJuWZ.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +2 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js +185 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js +1 -0
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-CSFLzmTN.js → vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js} +1 -1
- package/build/assets/{vendor~root-layout-n8XCEXG8.js → vendor~root-layout-CcdIqs-C.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-3Idg1_U3.js → vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js} +1 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js +1 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-DgQ564nC.js → vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js} +1 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js +48 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js} +1 -1
- package/build/assets/{verification-settings-u2POabjH.js → verification-settings-PKtoIUUY.js} +1 -1
- package/build/assets/{wrench-CkgI4rxA.js → wrench-B8Wg_nbp.js} +1 -1
- package/build/assets/{x-By6qCmtY.js → x-CX8lVGwm.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +16 -2
- package/build/locales/ca/openhands.json +16 -2
- package/build/locales/de/openhands.json +16 -2
- package/build/locales/en/openhands.json +16 -2
- package/build/locales/es/openhands.json +16 -2
- package/build/locales/fr/openhands.json +16 -2
- package/build/locales/it/openhands.json +16 -2
- package/build/locales/ja/openhands.json +16 -2
- package/build/locales/ko-KR/openhands.json +16 -2
- package/build/locales/no/openhands.json +16 -2
- package/build/locales/pt/openhands.json +16 -2
- package/build/locales/tr/openhands.json +16 -2
- package/build/locales/uk/openhands.json +16 -2
- package/build/locales/zh-CN/openhands.json +16 -2
- package/build/locales/zh-TW/openhands.json +16 -2
- package/config/defaults.json +3 -3
- package/dist/api/cloud/organization-service.api.cjs.map +1 -1
- package/dist/api/cloud/organization-service.api.d.ts +9 -1
- package/dist/api/cloud/organization-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.api.cjs +1 -1
- package/dist/api/config-service/config-service.api.cjs.map +1 -1
- package/dist/api/config-service/config-service.api.js +6 -2
- package/dist/api/config-service/config-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.types.d.ts +13 -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/automation-card.cjs +1 -1
- package/dist/components/features/automations/automation-card.cjs.map +1 -1
- package/dist/components/features/automations/automation-card.js +39 -38
- package/dist/components/features/automations/automation-card.js.map +1 -1
- package/dist/components/features/automations/automation-list-row.cjs +1 -1
- package/dist/components/features/automations/automation-list-row.cjs.map +1 -1
- package/dist/components/features/automations/automation-list-row.js +73 -72
- package/dist/components/features/automations/automation-list-row.js.map +1 -1
- package/dist/components/features/automations/build-automation-menu-items.cjs +1 -1
- package/dist/components/features/automations/build-automation-menu-items.cjs.map +1 -1
- package/dist/components/features/automations/build-automation-menu-items.d.ts +3 -1
- package/dist/components/features/automations/build-automation-menu-items.js +12 -11
- package/dist/components/features/automations/build-automation-menu-items.js.map +1 -1
- package/dist/components/features/automations/detail/configuration-section.d.ts +7 -1
- package/dist/components/features/automations/detail/detail-header.d.ts +8 -5
- package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +112 -112
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +62 -61
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
- package/dist/components/features/chat/model-messages.cjs +1 -1
- package/dist/components/features/chat/model-messages.cjs.map +1 -1
- package/dist/components/features/chat/model-messages.js +27 -26
- package/dist/components/features/chat/model-messages.js.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.d.ts +1 -2
- package/dist/components/features/conversation-panel/budget-display.js +12 -19
- package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +45 -44
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/home/featured-automations/build-home-automation-menu-items.d.ts +1 -2
- package/dist/components/features/home/featured-automations/build-pinned-automation-menu-items.d.ts +0 -1
- 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/images/image-lightbox.cjs +2 -0
- package/dist/components/features/images/image-lightbox.cjs.map +1 -0
- package/dist/components/features/images/image-lightbox.d.ts +11 -0
- package/dist/components/features/images/image-lightbox.js +37 -0
- package/dist/components/features/images/image-lightbox.js.map +1 -0
- package/dist/components/features/images/image-preview.cjs +1 -1
- package/dist/components/features/images/image-preview.cjs.map +1 -1
- package/dist/components/features/images/image-preview.d.ts +2 -1
- package/dist/components/features/images/image-preview.js +33 -13
- package/dist/components/features/images/image-preview.js.map +1 -1
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +3 -4
- package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
- package/dist/components/features/settings/cloud-settings-link.cjs +1 -1
- package/dist/components/features/settings/cloud-settings-link.cjs.map +1 -1
- package/dist/components/features/settings/cloud-settings-link.d.ts +3 -1
- package/dist/components/features/settings/cloud-settings-link.js +22 -21
- package/dist/components/features/settings/cloud-settings-link.js.map +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -1
- package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.js +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.d.ts +2 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +143 -142
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +28 -27
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.js +33 -29
- package/dist/components/providers/agent-server-ui-providers.js.map +1 -1
- package/dist/components/shared/buttons/remove-button.cjs +1 -1
- package/dist/components/shared/buttons/remove-button.cjs.map +1 -1
- package/dist/components/shared/buttons/remove-button.d.ts +2 -1
- package/dist/components/shared/buttons/remove-button.js +2 -1
- package/dist/components/shared/buttons/remove-button.js.map +1 -1
- package/dist/components/shared/free-models-note.cjs +2 -0
- package/dist/components/shared/free-models-note.cjs.map +1 -0
- package/dist/components/shared/free-models-note.d.ts +3 -0
- package/dist/components/shared/free-models-note.js +20 -0
- package/dist/components/shared/free-models-note.js.map +1 -0
- package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.js +102 -112
- package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +7 -0
- 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/chat/use-slash-command.cjs +1 -1
- package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
- package/dist/hooks/chat/use-slash-command.js +63 -62
- package/dist/hooks/chat/use-slash-command.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/query/use-free-models.cjs +2 -0
- package/dist/hooks/query/use-free-models.cjs.map +1 -0
- package/dist/hooks/query/use-free-models.d.ts +23 -0
- package/dist/hooks/query/use-free-models.js +67 -0
- package/dist/hooks/query/use-free-models.js.map +1 -0
- package/dist/hooks/query/use-local-git-info.cjs.map +1 -1
- package/dist/hooks/query/use-local-git-info.js.map +1 -1
- package/dist/hooks/query/use-provider-models.cjs +1 -1
- package/dist/hooks/query/use-provider-models.cjs.map +1 -1
- package/dist/hooks/query/use-provider-models.js +34 -25
- package/dist/hooks/query/use-provider-models.js.map +1 -1
- package/dist/hooks/query/use-search-providers.cjs +1 -1
- package/dist/hooks/query/use-search-providers.cjs.map +1 -1
- package/dist/hooks/query/use-search-providers.js +31 -19
- package/dist/hooks/query/use-search-providers.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/hooks/use-home-automation-actions.cjs +1 -1
- package/dist/hooks/use-home-automation-actions.cjs.map +1 -1
- package/dist/hooks/use-home-automation-actions.d.ts +1 -2
- package/dist/hooks/use-home-automation-actions.js +0 -1
- package/dist/hooks/use-home-automation-actions.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 +16 -2
- 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 +255 -17
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +16 -2
- package/dist/locales/ca/openhands.json +16 -2
- package/dist/locales/de/openhands.json +16 -2
- package/dist/locales/en/openhands.json +16 -2
- package/dist/locales/es/openhands.json +16 -2
- package/dist/locales/fr/openhands.json +16 -2
- package/dist/locales/it/openhands.json +16 -2
- package/dist/locales/ja/openhands.json +16 -2
- package/dist/locales/ko-KR/openhands.json +16 -2
- package/dist/locales/no/openhands.json +16 -2
- package/dist/locales/pt/openhands.json +16 -2
- package/dist/locales/tr/openhands.json +16 -2
- package/dist/locales/uk/openhands.json +16 -2
- package/dist/locales/zh-CN/openhands.json +16 -2
- package/dist/locales/zh-TW/openhands.json +16 -2
- 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/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/desktop-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-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/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/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 -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 +2 -2
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +5 -0
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +52 -47
- package/dist/routes/app-settings.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +137 -145
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/stores/free-models-store.cjs +2 -0
- package/dist/stores/free-models-store.cjs.map +1 -0
- package/dist/stores/free-models-store.d.ts +30 -0
- package/dist/stores/free-models-store.js +22 -0
- package/dist/stores/free-models-store.js.map +1 -0
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +23 -1
- 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/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +27 -6
- package/dist/utils/format-model-name.js +14 -6
- package/dist/utils/format-model-name.js.map +1 -1
- 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 +2 -2
- package/scripts/check-sdk-version-sync.mjs +79 -8
- package/scripts/dev-safe.mjs +1 -1
- package/scripts/static-server.mjs +24 -7
- package/build/assets/acp-providers-DrjNsPOH.js +0 -1
- package/build/assets/active-backend-context-rZiLJRUc.js +0 -2
- package/build/assets/agent-profiles-settings-x6RvPsq7.js +0 -1
- package/build/assets/agent-server-client-options-BikiNwTa.js +0 -1
- package/build/assets/agent-server-conversation-service.api-DYFsNHKf.js +0 -88
- package/build/assets/agent-settings-BJyovpJ_.js +0 -1
- package/build/assets/agent-settings-CpY3zObk.js +0 -2
- package/build/assets/alert-banner-vARz1idS.js +0 -1
- package/build/assets/api-key-entry-screen-CsMuBhoP.js +0 -1
- package/build/assets/app-settings-BaJ7nfHt.js +0 -1
- package/build/assets/automation-detail-CVoGDrKq.js +0 -3
- package/build/assets/automation-git-sync-CRMP9Bbm.js +0 -1
- package/build/assets/automation-setup-route-072beLz1.js +0 -3
- package/build/assets/automations-list-xuqTSQL4.js +0 -1
- package/build/assets/backend-form-modal-0aJmWdsa.js +0 -1
- package/build/assets/backend-synced-settings-badge-B7rKWBir.js +0 -1
- package/build/assets/badge-CcGx2TaV.js +0 -1
- package/build/assets/browser-C-_qBasq.js +0 -46
- package/build/assets/browser-tab-DZanIw5m.js +0 -1
- package/build/assets/canvas-extension-page-o_cWgE9B.js +0 -1
- package/build/assets/canvas-extensions-DSgNlCha.js +0 -1
- package/build/assets/check-fDEfgSzj.js +0 -1
- package/build/assets/chevron-down-CFrWHqu8.js +0 -1
- package/build/assets/chevron-right-C5roOrJu.js +0 -1
- package/build/assets/circle-check-ClTzJTdb.js +0 -1
- package/build/assets/circle-plus-check-toggle-Fr-h-mbL.js +0 -1
- package/build/assets/command-menu-BT3Ia5Ru.js +0 -1
- package/build/assets/commits-tab-2jhtaohl.js +0 -1
- package/build/assets/confirmation-modal-gIFHeZt6.js +0 -1
- package/build/assets/conversation-DZ578rOX.js +0 -1
- package/build/assets/conversation-panel-DZ578rOX.js +0 -1
- package/build/assets/conversation-state-store-D1_G_9I-.js +0 -1
- package/build/assets/conversation-store-DVVfkCsk.js +0 -6
- package/build/assets/copy-to-clipboard-button-B3w0X7WH.js +0 -1
- package/build/assets/device-verify-BfkCzyFB.js +0 -1
- package/build/assets/edit-automation-modal-BwhJ39JT.js +0 -1
- package/build/assets/empty-state-RZz0OfnY.js +0 -1
- package/build/assets/enum-filter-dropdown-C4pW0ORd.js +0 -1
- package/build/assets/environment-switch-overlay-P2ZAuzov.js +0 -1
- package/build/assets/error-state-B_5cgNPJ.js +0 -1
- package/build/assets/extensions-hub-DsaUr4ca.js +0 -1
- package/build/assets/extensions-navigation-CRMZd-FE.js +0 -1
- package/build/assets/files-tab-CCgAcVdc.js +0 -1
- package/build/assets/format-model-name-CasAP3nd.js +0 -1
- package/build/assets/get-git-path-EHrSDxTM.js +0 -1
- package/build/assets/git-repo-dropdown-D2WEQ97X.js +0 -1
- package/build/assets/git-repo-dropdown-DVeCUUXG.js +0 -1
- package/build/assets/highlighted-source-view-DjHO3SdW.js +0 -1
- package/build/assets/home-BorS_vdS.js +0 -1
- package/build/assets/home-aIMbHw5M.js +0 -1
- package/build/assets/home-automation-run-tooltip-CpHNFiFl.js +0 -1
- package/build/assets/home-store-DyXz0w6d.js +0 -1
- package/build/assets/hooks-service-C6dpRtZM.js +0 -1
- package/build/assets/index-home-zKFuKK2B.js +0 -1
- package/build/assets/info-CTIdjttz.js +0 -1
- package/build/assets/install-server-modal-DUiZMc8u.js +0 -1
- package/build/assets/kebab-menu-item-content-mm04SBD3.js +0 -1
- package/build/assets/launch-BSIf9KEg.js +0 -1
- package/build/assets/link-external-BNZzCM1I.js +0 -1
- package/build/assets/list-filter-CNpqTWVY.js +0 -1
- package/build/assets/llm-not-configured-banner-z_QRSeV0.js +0 -27
- package/build/assets/llm-settings-B-5AHMiX.js +0 -1
- package/build/assets/llm-settings-B3SjHDmA.js +0 -1
- package/build/assets/loader-circle-Dex47vVW.js +0 -1
- package/build/assets/manage-backends-modal-q1NdFisr.js +0 -1
- package/build/assets/manifest-8920b615.js +0 -1
- package/build/assets/manifest-subpage-layout-BQQy5ipR.js +0 -1
- package/build/assets/markdown-renderer-rivLvYh-.js +0 -8
- package/build/assets/mcp-CEXDhQWn.js +0 -1
- package/build/assets/mcp-marketplace-utils-Cn_NIMWM.js +0 -1
- package/build/assets/mcp-page-LGYIICMG.js +0 -9
- package/build/assets/messages-DUSeANAh.js +0 -41
- package/build/assets/modal-close-button-B9j4nasm.js +0 -1
- package/build/assets/onboarding-BjFebfs5.js +0 -1
- package/build/assets/onboarding-modal-DDTjOpyd.js +0 -1
- package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
- package/build/assets/planner-tab-D8f2Y3rn.js +0 -1
- package/build/assets/plus-B3wvU06-.js +0 -1
- package/build/assets/providers-2gIIkz2N.js +0 -1
- package/build/assets/proxy-CBgMd2zf.js +0 -1
- package/build/assets/recommended-automations-launcher-YLAQTp4s.js +0 -1
- package/build/assets/root-Bye_XmEL.js +0 -2
- package/build/assets/root-Cnwwzgo0.css +0 -1
- package/build/assets/root-layout-CSAwxBGM.js +0 -2
- package/build/assets/schema-field-CK0xYNbO.js +0 -1
- package/build/assets/sdk-section-page-Da73Rs_o.js +0 -1
- package/build/assets/secret-form-CB2VwYYg.js +0 -1
- package/build/assets/secrets-settings-Bh0udeKv.js +0 -1
- package/build/assets/settings-DmyIgRxO.js +0 -1
- package/build/assets/settings-dropdown-input-DVpyD87C.js +0 -1
- package/build/assets/settings-index-BSJUFmjE.js +0 -1
- package/build/assets/settings-input-C0dd8Utu.js +0 -1
- package/build/assets/settings-modal-yStgEh2o.js +0 -1
- package/build/assets/settings-switch-B78Khmyz.js +0 -1
- package/build/assets/shared-conversation-DM96X4KV.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-D5GR5xT9.js +0 -1
- package/build/assets/sidebar-store-CSDFK0W5.js +0 -1
- package/build/assets/skill-card-pill-row-989y15jV.js +0 -1
- package/build/assets/skill-scope-Dz3kPH3P.js +0 -1
- package/build/assets/skills-plugins-e3CYGdUJ.js +0 -1
- package/build/assets/skills-settings-3e-FuHw_.js +0 -1
- package/build/assets/task-list-tab-3Jg8ywch.js +0 -1
- package/build/assets/trash-B6OIe4yX.js +0 -1
- package/build/assets/usage-tab-Cm-9j3UK.js +0 -1
- package/build/assets/use-acp-credential-form-BARcvjYE.js +0 -1
- package/build/assets/use-agent-profiles-1P91KSXz.js +0 -1
- package/build/assets/use-create-secret-D8p9ybQj.js +0 -1
- package/build/assets/use-is-authed-BRPjCRKM.js +0 -1
- package/build/assets/use-llm-configured-DGm8FiRR.js +0 -1
- package/build/assets/use-llm-profiles-BTTtpW4z.js +0 -1
- package/build/assets/use-save-agent-profile-CxyO9YG-.js +0 -1
- package/build/assets/use-settings-nav-items-vrjxTqcu.js +0 -16
- package/build/assets/use-tracking-B9prBsrq.js +0 -3
- package/build/assets/useQueries-CykmpT-a.js +0 -1
- package/build/assets/useQuery-S6j94er1.js +0 -1
- package/build/assets/utils-BOco8mxR.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~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js +0 -185
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js +0 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-DkPlXWl9.js +0 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js +0 -1
|
@@ -1,37 +1,46 @@
|
|
|
1
1
|
import { useQuery as e } from "../../node_modules/@tanstack/react-query/build/modern/useQuery.js";
|
|
2
|
-
import t from "../../
|
|
3
|
-
import
|
|
2
|
+
import { useActiveBackend as t } from "../../contexts/active-backend-context.js";
|
|
3
|
+
import n from "../../api/config-service/config-service.api.js";
|
|
4
|
+
import { VERIFIED_MODELS_GC_TIME as r, VERIFIED_MODELS_QUERY_KEY as i, VERIFIED_MODELS_STALE_TIME as a, fetchVerifiedModelsByProvider as o } from "./use-verified-models.js";
|
|
4
5
|
//#region src/hooks/query/use-provider-models.ts
|
|
5
|
-
var
|
|
6
|
-
async function
|
|
7
|
-
if (i >=
|
|
8
|
-
let a = await
|
|
6
|
+
var s = 10;
|
|
7
|
+
async function c(e, t, r, i = 0) {
|
|
8
|
+
if (i >= s) throw Error(`Too many pagination requests for provider ${e}`);
|
|
9
|
+
let a = await n.searchModels({
|
|
9
10
|
provider__eq: e,
|
|
10
11
|
limit: 100,
|
|
11
12
|
page_id: r
|
|
12
|
-
},
|
|
13
|
+
}, t);
|
|
13
14
|
if (a.next_page_id) {
|
|
14
|
-
let
|
|
15
|
-
return [...a.items, ...
|
|
15
|
+
let n = await c(e, t, a.next_page_id, i + 1);
|
|
16
|
+
return [...a.items, ...n];
|
|
16
17
|
}
|
|
17
18
|
return a.items;
|
|
18
19
|
}
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
queryKey:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
var l = (n) => {
|
|
21
|
+
let { backend: s, orgId: l } = t(), u = [
|
|
22
|
+
s.id,
|
|
23
|
+
s.connectionRevision ?? 0,
|
|
24
|
+
l
|
|
25
|
+
];
|
|
26
|
+
return e({
|
|
27
|
+
queryKey: [
|
|
28
|
+
"config",
|
|
29
|
+
"models",
|
|
30
|
+
n,
|
|
31
|
+
...u
|
|
32
|
+
],
|
|
33
|
+
queryFn: async ({ client: e }) => c(n, await e.fetchQuery({
|
|
34
|
+
queryKey: [...i, ...u],
|
|
35
|
+
queryFn: o,
|
|
36
|
+
staleTime: a
|
|
37
|
+
})),
|
|
38
|
+
enabled: !!n,
|
|
39
|
+
staleTime: a,
|
|
40
|
+
gcTime: r
|
|
41
|
+
});
|
|
42
|
+
};
|
|
34
43
|
//#endregion
|
|
35
|
-
export {
|
|
44
|
+
export { l as useProviderModels };
|
|
36
45
|
|
|
37
46
|
//# sourceMappingURL=use-provider-models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-provider-models.js","names":[],"sources":["../../../src/hooks/query/use-provider-models.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport ConfigService from \"#/api/config-service/config-service.api\";\nimport type { LLMModel } from \"#/api/config-service/config-service.types\";\nimport {\n VERIFIED_MODELS_GC_TIME,\n VERIFIED_MODELS_QUERY_KEY,\n VERIFIED_MODELS_STALE_TIME,\n fetchVerifiedModelsByProvider,\n} from \"./use-verified-models\";\n\nconst MAX_PAGINATION_DEPTH = 10;\n\nasync function fetchPage(\n provider: string,\n verifiedByProvider: Record<string, string[]>,\n pageId?: string,\n depth = 0,\n): Promise<LLMModel[]> {\n if (depth >= MAX_PAGINATION_DEPTH) {\n throw new Error(`Too many pagination requests for provider ${provider}`);\n }\n\n const page = await ConfigService.searchModels(\n {\n provider__eq: provider,\n limit: 100,\n page_id: pageId,\n },\n verifiedByProvider,\n );\n\n if (page.next_page_id) {\n const rest = await fetchPage(\n provider,\n verifiedByProvider,\n page.next_page_id,\n depth + 1,\n );\n return [...page.items, ...rest];\n }\n return page.items;\n}\n\nexport const useProviderModels = (provider: string | null)
|
|
1
|
+
{"version":3,"file":"use-provider-models.js","names":[],"sources":["../../../src/hooks/query/use-provider-models.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport ConfigService from \"#/api/config-service/config-service.api\";\nimport type { LLMModel } from \"#/api/config-service/config-service.types\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n VERIFIED_MODELS_GC_TIME,\n VERIFIED_MODELS_QUERY_KEY,\n VERIFIED_MODELS_STALE_TIME,\n fetchVerifiedModelsByProvider,\n} from \"./use-verified-models\";\n\nconst MAX_PAGINATION_DEPTH = 10;\n\nasync function fetchPage(\n provider: string,\n verifiedByProvider: Record<string, string[]>,\n pageId?: string,\n depth = 0,\n): Promise<LLMModel[]> {\n if (depth >= MAX_PAGINATION_DEPTH) {\n throw new Error(`Too many pagination requests for provider ${provider}`);\n }\n\n const page = await ConfigService.searchModels(\n {\n provider__eq: provider,\n limit: 100,\n page_id: pageId,\n },\n verifiedByProvider,\n );\n\n if (page.next_page_id) {\n const rest = await fetchPage(\n provider,\n verifiedByProvider,\n page.next_page_id,\n depth + 1,\n );\n return [...page.items, ...rest];\n }\n return page.items;\n}\n\nexport const useProviderModels = (provider: string | null) => {\n // `ActiveBackendProvider` deliberately does not blanket-invalidate on\n // backend/org switches, so the query key must carry the active backend\n // identity (id, connection revision, org id). Otherwise React Query serves\n // the previous backend/org's cached page — including DB-driven `free`/\n // `default`/`verified` flags — for the full stale window after a switch.\n const { backend, orgId } = useActiveBackend();\n const backendScope = [\n backend.id,\n backend.connectionRevision ?? 0,\n orgId,\n ] as const;\n\n return useQuery({\n queryKey: [\"config\", \"models\", provider, ...backendScope],\n queryFn: async ({ client }) => {\n const verifiedByProvider = await client.fetchQuery({\n queryKey: [...VERIFIED_MODELS_QUERY_KEY, ...backendScope],\n queryFn: fetchVerifiedModelsByProvider,\n staleTime: VERIFIED_MODELS_STALE_TIME,\n });\n return fetchPage(provider!, verifiedByProvider);\n },\n enabled: !!provider,\n staleTime: VERIFIED_MODELS_STALE_TIME,\n gcTime: VERIFIED_MODELS_GC_TIME,\n });\n};\n"],"mappings":";;;;;AAWA,IAAM,IAAuB;AAE7B,eAAe,EACb,GACA,GACA,GACA,IAAQ,GACa;CACrB,IAAI,KAAS,GACX,MAAU,MAAM,6CAA6C,GAAU;CAGzE,IAAM,IAAO,MAAM,EAAc,aAC/B;EACE,cAAc;EACd,OAAO;EACP,SAAS;CACX,GACA,CACF;CAEA,IAAI,EAAK,cAAc;EACrB,IAAM,IAAO,MAAM,EACjB,GACA,GACA,EAAK,cACL,IAAQ,CACV;EACA,OAAO,CAAC,GAAG,EAAK,OAAO,GAAG,CAAI;CAChC;CACA,OAAO,EAAK;AACd;AAEA,IAAa,KAAqB,MAA4B;CAM5D,IAAM,EAAE,YAAS,aAAU,EAAiB,GACtC,IAAe;EACnB,EAAQ;EACR,EAAQ,sBAAsB;EAC9B;CACF;CAEA,OAAO,EAAS;EACd,UAAU;GAAC;GAAU;GAAU;GAAU,GAAG;EAAY;EACxD,SAAS,OAAO,EAAE,gBAMT,EAAU,GAAW,MALK,EAAO,WAAW;GACjD,UAAU,CAAC,GAAG,GAA2B,GAAG,CAAY;GACxD,SAAS;GACT,WAAW;EACb,CAAC,CAC6C;EAEhD,SAAS,CAAC,CAAC;EACX,WAAW;EACX,QAAQ;CACV,CAAC;AACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),t=require("../../api/config-service/config-service.api.cjs"),
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs"),t=require("../../contexts/active-backend-context.cjs"),n=require("../../api/config-service/config-service.api.cjs"),r=require("./use-verified-models.cjs");var i=10;async function a(e,t,r,o){if(o>=i)throw Error(`Too many pagination requests while fetching providers (depth=${o})`);let s=await n.default.searchProviders(t?{page_id:t}:{},e);if(!s.next_page_id)return s.items;if(r.has(s.next_page_id))throw Error(`Repeated page id while fetching providers: ${s.next_page_id}`);r.add(s.next_page_id);let c=await a(e,s.next_page_id,r,o+1);return[...s.items,...c]}var o=()=>{let{backend:n,orgId:i}=t.useActiveBackend(),o=[n.id,n.connectionRevision??0,i];return e.useQuery({queryKey:[`config`,`providers`,...o],queryFn:async({client:e})=>a(await e.fetchQuery({queryKey:[...r.VERIFIED_MODELS_QUERY_KEY,...o],queryFn:r.fetchVerifiedModelsByProvider,staleTime:r.VERIFIED_MODELS_STALE_TIME}),null,new Set,0),staleTime:r.VERIFIED_MODELS_STALE_TIME,gcTime:r.VERIFIED_MODELS_GC_TIME})};exports.useSearchProviders=o;
|
|
2
2
|
//# sourceMappingURL=use-search-providers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-providers.cjs","names":[],"sources":["../../../src/hooks/query/use-search-providers.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport ConfigService from \"#/api/config-service/config-service.api\";\nimport type { LLMProvider } from \"#/api/config-service/config-service.types\";\nimport {\n VERIFIED_MODELS_GC_TIME,\n VERIFIED_MODELS_QUERY_KEY,\n VERIFIED_MODELS_STALE_TIME,\n fetchVerifiedModelsByProvider,\n} from \"./use-verified-models\";\n\n// Cloud backends paginate `/api/v1/config/providers/search` with a default\n// page size smaller than the provider list (~150 entries from litellm), so a\n// single-page fetch silently drops everything past the cut. Cap the walk\n// in case the cursor ever drifts (e.g. the cloud service returns an unstable\n// `next_page_id` that loops back).\nconst MAX_PAGINATION_DEPTH = 10;\n\nasync function fetchAllProviders(\n verifiedByProvider: Record<string, string[]>,\n pageId: string | null | undefined,\n seenPageIds: Set<string>,\n depth: number,\n): Promise<LLMProvider[]> {\n if (depth >= MAX_PAGINATION_DEPTH) {\n throw new Error(\n `Too many pagination requests while fetching providers (depth=${depth})`,\n );\n }\n\n const page = await ConfigService.searchProviders(\n pageId ? { page_id: pageId } : {},\n verifiedByProvider,\n );\n\n if (!page.next_page_id) {\n return page.items;\n }\n\n // Cycle guard: the cloud backend is out of our control — if `next_page_id`\n // repeats, refuse to hang the settings page. Mirrors `use-search-subdirs`.\n if (seenPageIds.has(page.next_page_id)) {\n throw new Error(\n `Repeated page id while fetching providers: ${page.next_page_id}`,\n );\n }\n seenPageIds.add(page.next_page_id);\n\n const rest = await fetchAllProviders(\n verifiedByProvider,\n page.next_page_id,\n seenPageIds,\n depth + 1,\n );\n return [...page.items, ...rest];\n}\n\nexport const useSearchProviders = ()
|
|
1
|
+
{"version":3,"file":"use-search-providers.cjs","names":[],"sources":["../../../src/hooks/query/use-search-providers.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport ConfigService from \"#/api/config-service/config-service.api\";\nimport type { LLMProvider } from \"#/api/config-service/config-service.types\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n VERIFIED_MODELS_GC_TIME,\n VERIFIED_MODELS_QUERY_KEY,\n VERIFIED_MODELS_STALE_TIME,\n fetchVerifiedModelsByProvider,\n} from \"./use-verified-models\";\n\n// Cloud backends paginate `/api/v1/config/providers/search` with a default\n// page size smaller than the provider list (~150 entries from litellm), so a\n// single-page fetch silently drops everything past the cut. Cap the walk\n// in case the cursor ever drifts (e.g. the cloud service returns an unstable\n// `next_page_id` that loops back).\nconst MAX_PAGINATION_DEPTH = 10;\n\nasync function fetchAllProviders(\n verifiedByProvider: Record<string, string[]>,\n pageId: string | null | undefined,\n seenPageIds: Set<string>,\n depth: number,\n): Promise<LLMProvider[]> {\n if (depth >= MAX_PAGINATION_DEPTH) {\n throw new Error(\n `Too many pagination requests while fetching providers (depth=${depth})`,\n );\n }\n\n const page = await ConfigService.searchProviders(\n pageId ? { page_id: pageId } : {},\n verifiedByProvider,\n );\n\n if (!page.next_page_id) {\n return page.items;\n }\n\n // Cycle guard: the cloud backend is out of our control — if `next_page_id`\n // repeats, refuse to hang the settings page. Mirrors `use-search-subdirs`.\n if (seenPageIds.has(page.next_page_id)) {\n throw new Error(\n `Repeated page id while fetching providers: ${page.next_page_id}`,\n );\n }\n seenPageIds.add(page.next_page_id);\n\n const rest = await fetchAllProviders(\n verifiedByProvider,\n page.next_page_id,\n seenPageIds,\n depth + 1,\n );\n return [...page.items, ...rest];\n}\n\nexport const useSearchProviders = () => {\n // `ActiveBackendProvider` deliberately does not blanket-invalidate on\n // backend/org switches, so the query key must carry the active backend\n // identity (id, connection revision, org id). Otherwise React Query serves\n // the previous backend/org's cached provider list — including DB-driven\n // `verified` flags — for the full stale window after a switch.\n const { backend, orgId } = useActiveBackend();\n const backendScope = [\n backend.id,\n backend.connectionRevision ?? 0,\n orgId,\n ] as const;\n\n return useQuery({\n queryKey: [\"config\", \"providers\", ...backendScope],\n queryFn: async ({ client }): Promise<LLMProvider[]> => {\n const verifiedByProvider = await client.fetchQuery({\n queryKey: [...VERIFIED_MODELS_QUERY_KEY, ...backendScope],\n queryFn: fetchVerifiedModelsByProvider,\n staleTime: VERIFIED_MODELS_STALE_TIME,\n });\n // The local backend returns a single page with `next_page_id: null`\n // so this loop is a no-op there; on the cloud backend it walks the\n // cursor to exhaustion.\n return fetchAllProviders(verifiedByProvider, null, new Set(), 0);\n },\n staleTime: VERIFIED_MODELS_STALE_TIME,\n gcTime: VERIFIED_MODELS_GC_TIME,\n });\n};\n"],"mappings":"iSAgBA,IAAM,EAAuB,GAE7B,eAAe,EACb,EACA,EACA,EACA,EACwB,CACxB,GAAI,GAAS,EACX,MAAU,MACR,gEAAgE,EAAM,EACxE,EAGF,IAAM,EAAO,MAAM,EAAA,QAAc,gBAC/B,EAAS,CAAE,QAAS,CAAO,EAAI,CAAC,EAChC,CACF,EAEA,GAAI,CAAC,EAAK,aACR,OAAO,EAAK,MAKd,GAAI,EAAY,IAAI,EAAK,YAAY,EACnC,MAAU,MACR,8CAA8C,EAAK,cACrD,EAEF,EAAY,IAAI,EAAK,YAAY,EAEjC,IAAM,EAAO,MAAM,EACjB,EACA,EAAK,aACL,EACA,EAAQ,CACV,EACA,MAAO,CAAC,GAAG,EAAK,MAAO,GAAG,CAAI,CAChC,CAEA,IAAa,MAA2B,CAMtC,GAAM,CAAE,UAAS,SAAU,EAAA,iBAAiB,EACtC,EAAe,CACnB,EAAQ,GACR,EAAQ,oBAAsB,EAC9B,CACF,EAEA,OAAO,EAAA,SAAS,CACd,SAAU,CAAC,SAAU,YAAa,GAAG,CAAY,EACjD,QAAS,MAAO,CAAE,YAST,EAAkB,MARQ,EAAO,WAAW,CACjD,SAAU,CAAC,GAAG,EAAA,0BAA2B,GAAG,CAAY,EACxD,QAAS,EAAA,8BACT,UAAW,EAAA,0BACb,CAAC,EAI4C,KAAM,IAAI,IAAO,CAAC,EAEjE,UAAW,EAAA,2BACX,OAAQ,EAAA,uBACV,CAAC,CACH"}
|
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
import { useQuery as e } from "../../node_modules/@tanstack/react-query/build/modern/useQuery.js";
|
|
2
|
-
import t from "../../
|
|
3
|
-
import
|
|
2
|
+
import { useActiveBackend as t } from "../../contexts/active-backend-context.js";
|
|
3
|
+
import n from "../../api/config-service/config-service.api.js";
|
|
4
|
+
import { VERIFIED_MODELS_GC_TIME as r, VERIFIED_MODELS_QUERY_KEY as i, VERIFIED_MODELS_STALE_TIME as a, fetchVerifiedModelsByProvider as o } from "./use-verified-models.js";
|
|
4
5
|
//#region src/hooks/query/use-search-providers.ts
|
|
5
|
-
var
|
|
6
|
-
async function
|
|
7
|
-
if (i >=
|
|
8
|
-
let a = await
|
|
6
|
+
var s = 10;
|
|
7
|
+
async function c(e, t, r, i) {
|
|
8
|
+
if (i >= s) throw Error(`Too many pagination requests while fetching providers (depth=${i})`);
|
|
9
|
+
let a = await n.searchProviders(t ? { page_id: t } : {}, e);
|
|
9
10
|
if (!a.next_page_id) return a.items;
|
|
10
11
|
if (r.has(a.next_page_id)) throw Error(`Repeated page id while fetching providers: ${a.next_page_id}`);
|
|
11
12
|
r.add(a.next_page_id);
|
|
12
|
-
let
|
|
13
|
-
return [...a.items, ...
|
|
13
|
+
let o = await c(e, a.next_page_id, r, i + 1);
|
|
14
|
+
return [...a.items, ...o];
|
|
14
15
|
}
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
var l = () => {
|
|
17
|
+
let { backend: n, orgId: s } = t(), l = [
|
|
18
|
+
n.id,
|
|
19
|
+
n.connectionRevision ?? 0,
|
|
20
|
+
s
|
|
21
|
+
];
|
|
22
|
+
return e({
|
|
23
|
+
queryKey: [
|
|
24
|
+
"config",
|
|
25
|
+
"providers",
|
|
26
|
+
...l
|
|
27
|
+
],
|
|
28
|
+
queryFn: async ({ client: e }) => c(await e.fetchQuery({
|
|
29
|
+
queryKey: [...i, ...l],
|
|
30
|
+
queryFn: o,
|
|
31
|
+
staleTime: a
|
|
32
|
+
}), null, /* @__PURE__ */ new Set(), 0),
|
|
33
|
+
staleTime: a,
|
|
34
|
+
gcTime: r
|
|
35
|
+
});
|
|
36
|
+
};
|
|
25
37
|
//#endregion
|
|
26
|
-
export {
|
|
38
|
+
export { l as useSearchProviders };
|
|
27
39
|
|
|
28
40
|
//# sourceMappingURL=use-search-providers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-providers.js","names":[],"sources":["../../../src/hooks/query/use-search-providers.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport ConfigService from \"#/api/config-service/config-service.api\";\nimport type { LLMProvider } from \"#/api/config-service/config-service.types\";\nimport {\n VERIFIED_MODELS_GC_TIME,\n VERIFIED_MODELS_QUERY_KEY,\n VERIFIED_MODELS_STALE_TIME,\n fetchVerifiedModelsByProvider,\n} from \"./use-verified-models\";\n\n// Cloud backends paginate `/api/v1/config/providers/search` with a default\n// page size smaller than the provider list (~150 entries from litellm), so a\n// single-page fetch silently drops everything past the cut. Cap the walk\n// in case the cursor ever drifts (e.g. the cloud service returns an unstable\n// `next_page_id` that loops back).\nconst MAX_PAGINATION_DEPTH = 10;\n\nasync function fetchAllProviders(\n verifiedByProvider: Record<string, string[]>,\n pageId: string | null | undefined,\n seenPageIds: Set<string>,\n depth: number,\n): Promise<LLMProvider[]> {\n if (depth >= MAX_PAGINATION_DEPTH) {\n throw new Error(\n `Too many pagination requests while fetching providers (depth=${depth})`,\n );\n }\n\n const page = await ConfigService.searchProviders(\n pageId ? { page_id: pageId } : {},\n verifiedByProvider,\n );\n\n if (!page.next_page_id) {\n return page.items;\n }\n\n // Cycle guard: the cloud backend is out of our control — if `next_page_id`\n // repeats, refuse to hang the settings page. Mirrors `use-search-subdirs`.\n if (seenPageIds.has(page.next_page_id)) {\n throw new Error(\n `Repeated page id while fetching providers: ${page.next_page_id}`,\n );\n }\n seenPageIds.add(page.next_page_id);\n\n const rest = await fetchAllProviders(\n verifiedByProvider,\n page.next_page_id,\n seenPageIds,\n depth + 1,\n );\n return [...page.items, ...rest];\n}\n\nexport const useSearchProviders = ()
|
|
1
|
+
{"version":3,"file":"use-search-providers.js","names":[],"sources":["../../../src/hooks/query/use-search-providers.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport ConfigService from \"#/api/config-service/config-service.api\";\nimport type { LLMProvider } from \"#/api/config-service/config-service.types\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport {\n VERIFIED_MODELS_GC_TIME,\n VERIFIED_MODELS_QUERY_KEY,\n VERIFIED_MODELS_STALE_TIME,\n fetchVerifiedModelsByProvider,\n} from \"./use-verified-models\";\n\n// Cloud backends paginate `/api/v1/config/providers/search` with a default\n// page size smaller than the provider list (~150 entries from litellm), so a\n// single-page fetch silently drops everything past the cut. Cap the walk\n// in case the cursor ever drifts (e.g. the cloud service returns an unstable\n// `next_page_id` that loops back).\nconst MAX_PAGINATION_DEPTH = 10;\n\nasync function fetchAllProviders(\n verifiedByProvider: Record<string, string[]>,\n pageId: string | null | undefined,\n seenPageIds: Set<string>,\n depth: number,\n): Promise<LLMProvider[]> {\n if (depth >= MAX_PAGINATION_DEPTH) {\n throw new Error(\n `Too many pagination requests while fetching providers (depth=${depth})`,\n );\n }\n\n const page = await ConfigService.searchProviders(\n pageId ? { page_id: pageId } : {},\n verifiedByProvider,\n );\n\n if (!page.next_page_id) {\n return page.items;\n }\n\n // Cycle guard: the cloud backend is out of our control — if `next_page_id`\n // repeats, refuse to hang the settings page. Mirrors `use-search-subdirs`.\n if (seenPageIds.has(page.next_page_id)) {\n throw new Error(\n `Repeated page id while fetching providers: ${page.next_page_id}`,\n );\n }\n seenPageIds.add(page.next_page_id);\n\n const rest = await fetchAllProviders(\n verifiedByProvider,\n page.next_page_id,\n seenPageIds,\n depth + 1,\n );\n return [...page.items, ...rest];\n}\n\nexport const useSearchProviders = () => {\n // `ActiveBackendProvider` deliberately does not blanket-invalidate on\n // backend/org switches, so the query key must carry the active backend\n // identity (id, connection revision, org id). Otherwise React Query serves\n // the previous backend/org's cached provider list — including DB-driven\n // `verified` flags — for the full stale window after a switch.\n const { backend, orgId } = useActiveBackend();\n const backendScope = [\n backend.id,\n backend.connectionRevision ?? 0,\n orgId,\n ] as const;\n\n return useQuery({\n queryKey: [\"config\", \"providers\", ...backendScope],\n queryFn: async ({ client }): Promise<LLMProvider[]> => {\n const verifiedByProvider = await client.fetchQuery({\n queryKey: [...VERIFIED_MODELS_QUERY_KEY, ...backendScope],\n queryFn: fetchVerifiedModelsByProvider,\n staleTime: VERIFIED_MODELS_STALE_TIME,\n });\n // The local backend returns a single page with `next_page_id: null`\n // so this loop is a no-op there; on the cloud backend it walks the\n // cursor to exhaustion.\n return fetchAllProviders(verifiedByProvider, null, new Set(), 0);\n },\n staleTime: VERIFIED_MODELS_STALE_TIME,\n gcTime: VERIFIED_MODELS_GC_TIME,\n });\n};\n"],"mappings":";;;;;AAgBA,IAAM,IAAuB;AAE7B,eAAe,EACb,GACA,GACA,GACA,GACwB;CACxB,IAAI,KAAS,GACX,MAAU,MACR,gEAAgE,EAAM,EACxE;CAGF,IAAM,IAAO,MAAM,EAAc,gBAC/B,IAAS,EAAE,SAAS,EAAO,IAAI,CAAC,GAChC,CACF;CAEA,IAAI,CAAC,EAAK,cACR,OAAO,EAAK;CAKd,IAAI,EAAY,IAAI,EAAK,YAAY,GACnC,MAAU,MACR,8CAA8C,EAAK,cACrD;CAEF,EAAY,IAAI,EAAK,YAAY;CAEjC,IAAM,IAAO,MAAM,EACjB,GACA,EAAK,cACL,GACA,IAAQ,CACV;CACA,OAAO,CAAC,GAAG,EAAK,OAAO,GAAG,CAAI;AAChC;AAEA,IAAa,UAA2B;CAMtC,IAAM,EAAE,YAAS,aAAU,EAAiB,GACtC,IAAe;EACnB,EAAQ;EACR,EAAQ,sBAAsB;EAC9B;CACF;CAEA,OAAO,EAAS;EACd,UAAU;GAAC;GAAU;GAAa,GAAG;EAAY;EACjD,SAAS,OAAO,EAAE,gBAST,EAAkB,MARQ,EAAO,WAAW;GACjD,UAAU,CAAC,GAAG,GAA2B,GAAG,CAAY;GACxD,SAAS;GACT,WAAW;EACb,CAAC,GAI4C,sBAAM,IAAI,IAAI,GAAG,CAAC;EAEjE,WAAW;EACX,QAAQ;CACV,CAAC;AACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("../utils/constants.cjs");const e=require("../utils/utils.cjs");var t=2,n=120,r=()=>{let e=document.getElementById(`resize-grip`)?.parentElement??null;return e?e.getBoundingClientRect().bottom>=window.innerHeight-n:!0},i=({elementRef:n,minHeight:i,maxHeight:a,onGripDragStart:o,onGripDragEnd:s,onHeightChange:c,onReachedMinHeight:l})=>{let u=e=>`touches`in e&&e.touches.length>0?e.touches[0].clientY:e.clientY,d=(e,t)=>{let n=document.getElementById(`resize-grip`);
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs"),require("../utils/constants.cjs");const e=require("../utils/utils.cjs");var t=2,n=120,r=()=>{let e=document.getElementById(`resize-grip`)?.parentElement??null;return e?e.getBoundingClientRect().bottom>=window.innerHeight-n:!0},i=({elementRef:n,minHeight:i,maxHeight:a,onGripDragStart:o,onGripDragEnd:s,onHeightChange:c,onReachedMinHeight:l})=>{let u=e=>`touches`in e&&e.touches.length>0?e.touches[0].clientY:e.clientY,d=(e,t)=>{let n=document.getElementById(`resize-grip`);if(n)return n.addEventListener(`touchmove`,e,{passive:!1,capture:!0}),n.addEventListener(`touchend`,t,{capture:!0}),n},f=(e,t)=>{document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t)},p=r=>{let p=e.isMobileDevice(),m=n.current?.offsetHeight||i,h=!1,g,_=e=>{if(e.preventDefault(),!h){let n=u(e);if(Math.abs(n-r)<t)return;h=!0,o?.()}let s=u(e)-r,d=Math.max(i,Math.min(a,m-s)),f=n.current;if(!f)return;f.style.height=`${d}px`;let p=f.scrollHeight>d||d>=a;f.style.overflowY=p?`auto`:`hidden`,c&&c(d),l&&Math.abs(d-i)<=1.5&&l()},v=()=>{if(h&&s?.(),p){if(!g)return;g.removeEventListener(`touchmove`,_,!0),g.removeEventListener(`touchend`,v,!0)}else document.removeEventListener(`mousemove`,_),document.removeEventListener(`mouseup`,v),document.removeEventListener(`touchmove`,_),document.removeEventListener(`touchend`,v)};p?g=d(_,v):f(_,v)};return{handleGripMouseDown:e=>{e.preventDefault(),r()&&p(e.clientY)},handleGripTouchStart:e=>{e.preventDefault(),r()&&p(e.touches[0].clientY)}}};exports.isBottomAnchored=r,exports.useDragResize=i;
|
|
2
2
|
//# sourceMappingURL=use-drag-resize.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drag-resize.cjs","names":[],"sources":["../../src/hooks/use-drag-resize.ts"],"sourcesContent":["import type {\n RefObject,\n MouseEvent as ReactMouseEvent,\n TouchEvent as ReactTouchEvent,\n} from \"react\";\nimport { EPS } from \"#/utils/constants\";\nimport { isMobileDevice } from \"#/utils/utils\";\n\n/** Movement required before a pointer gesture is treated as a resize drag. */\nconst DRAG_COMMIT_PX = 2;\n\n/**\n * Distance (px) from the viewport bottom within which we consider the chat\n * input to be \"bottom-anchored\" by its parent's flexbox. When the input is\n * bottom-anchored (e.g. the conversation page), dragging the top grip makes\n * the box grow upward — the expected behaviour. When it is NOT\n * bottom-anchored (e.g. the home page where the input sits in the centre of\n * the screen), the same drag would make the box grow downward, which is\n * confusing, so we disable manual resizing entirely in that case.\n */\nconst BOTTOM_ANCHORED_THRESHOLD = 120;\n\n/**\n * Determine whether the chat input is anchored to the bottom of the viewport\n * by its parent layout (e.g. the conversation page uses a flex column with a\n * growing scroll area above the input). When true, dragging the top grip\n * makes the box grow upward, which is the expected behaviour. When false,\n * the drag would grow the box downward, so we disable it.\n */\nexport const isBottomAnchored = (): boolean => {\n const grip = document.getElementById(\"resize-grip\");\n const wrapper = grip?.parentElement ?? null;\n if (!wrapper) return true; // fall back to allowing the drag\n const rect = wrapper.getBoundingClientRect();\n return rect.bottom >= window.innerHeight - BOTTOM_ANCHORED_THRESHOLD;\n};\n\n// Drag handling hook\ninterface UseDragResizeOptions {\n elementRef: RefObject<HTMLElement | null>;\n minHeight: number;\n maxHeight: number;\n onGripDragStart?: () => void;\n onGripDragEnd?: () => void;\n onHeightChange?: (height: number) => void;\n onReachedMinHeight?: () => void; // Notify when user drags to minimum height\n}\n\nexport const useDragResize = ({\n elementRef,\n minHeight,\n maxHeight,\n onGripDragStart,\n onGripDragEnd,\n onHeightChange,\n onReachedMinHeight,\n}: UseDragResizeOptions) => {\n const getClientY = (event: MouseEvent | TouchEvent): number => {\n if (\"touches\" in event && event.touches.length > 0) {\n return event.touches[0].clientY;\n }\n return (event as MouseEvent).clientY;\n };\n\n // Setup event listeners for mobile devices\n const setupMobileEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n const resizeGrip = document.getElementById(\"resize-grip\");\n\n if (!resizeGrip) {\n return;\n }\n\n resizeGrip.addEventListener(\"touchmove\", handleDragMove, {\n passive: false,\n capture: true,\n });\n resizeGrip.addEventListener(\"touchend\", handleDragEnd, {\n capture: true,\n });\n };\n\n // Setup event listeners for desktop devices\n const setupDesktopEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n document.addEventListener(\"mousemove\", handleDragMove);\n document.addEventListener(\"mouseup\", handleDragEnd);\n };\n\n // Start drag operation\n const startDrag = (startY: number) => {\n const isMobile = isMobileDevice();\n const startHeight = elementRef.current?.offsetHeight || minHeight;\n let dragCommitted = false;\n\n const handleDragMove = (moveEvent: MouseEvent | TouchEvent) => {\n moveEvent.preventDefault();\n\n if (!dragCommitted) {\n const y = getClientY(moveEvent);\n if (Math.abs(y - startY) < DRAG_COMMIT_PX) {\n return;\n }\n dragCommitted = true;\n onGripDragStart?.();\n }\n\n const deltaY = getClientY(moveEvent) - startY;\n // Invert deltaY so moving up increases height and moving down decreases height\n const newHeight = Math.max(\n minHeight,\n Math.min(maxHeight, startHeight - deltaY),\n );\n\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n element.style.height = `${newHeight}px`;\n\n // Check if content exceeds the new height to determine scrollbar visibility\n const contentHeight = element.scrollHeight;\n const shouldShowScrollbar =\n contentHeight > newHeight || newHeight >= maxHeight;\n element.style.overflowY = shouldShowScrollbar ? \"auto\" : \"hidden\";\n\n // Call the height change callback if provided\n if (onHeightChange) {\n onHeightChange(newHeight);\n }\n\n // Notify when dragged to minimum height to clear manual mode\n if (onReachedMinHeight && Math.abs(newHeight - minHeight) <= EPS) {\n onReachedMinHeight();\n }\n };\n\n const handleDragEnd = () => {\n if (dragCommitted) {\n onGripDragEnd?.();\n }\n\n if (isMobile) {\n
|
|
1
|
+
{"version":3,"file":"use-drag-resize.cjs","names":[],"sources":["../../src/hooks/use-drag-resize.ts"],"sourcesContent":["import type {\n RefObject,\n MouseEvent as ReactMouseEvent,\n TouchEvent as ReactTouchEvent,\n} from \"react\";\nimport { EPS } from \"#/utils/constants\";\nimport { isMobileDevice } from \"#/utils/utils\";\n\n/** Movement required before a pointer gesture is treated as a resize drag. */\nconst DRAG_COMMIT_PX = 2;\n\n/**\n * Distance (px) from the viewport bottom within which we consider the chat\n * input to be \"bottom-anchored\" by its parent's flexbox. When the input is\n * bottom-anchored (e.g. the conversation page), dragging the top grip makes\n * the box grow upward — the expected behaviour. When it is NOT\n * bottom-anchored (e.g. the home page where the input sits in the centre of\n * the screen), the same drag would make the box grow downward, which is\n * confusing, so we disable manual resizing entirely in that case.\n */\nconst BOTTOM_ANCHORED_THRESHOLD = 120;\n\n/**\n * Determine whether the chat input is anchored to the bottom of the viewport\n * by its parent layout (e.g. the conversation page uses a flex column with a\n * growing scroll area above the input). When true, dragging the top grip\n * makes the box grow upward, which is the expected behaviour. When false,\n * the drag would grow the box downward, so we disable it.\n */\nexport const isBottomAnchored = (): boolean => {\n const grip = document.getElementById(\"resize-grip\");\n const wrapper = grip?.parentElement ?? null;\n if (!wrapper) return true; // fall back to allowing the drag\n const rect = wrapper.getBoundingClientRect();\n return rect.bottom >= window.innerHeight - BOTTOM_ANCHORED_THRESHOLD;\n};\n\n// Drag handling hook\ninterface UseDragResizeOptions {\n elementRef: RefObject<HTMLElement | null>;\n minHeight: number;\n maxHeight: number;\n onGripDragStart?: () => void;\n onGripDragEnd?: () => void;\n onHeightChange?: (height: number) => void;\n onReachedMinHeight?: () => void; // Notify when user drags to minimum height\n}\n\nexport const useDragResize = ({\n elementRef,\n minHeight,\n maxHeight,\n onGripDragStart,\n onGripDragEnd,\n onHeightChange,\n onReachedMinHeight,\n}: UseDragResizeOptions) => {\n const getClientY = (event: MouseEvent | TouchEvent): number => {\n if (\"touches\" in event && event.touches.length > 0) {\n return event.touches[0].clientY;\n }\n return (event as MouseEvent).clientY;\n };\n\n // Setup event listeners for mobile devices\n const setupMobileEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n const resizeGrip = document.getElementById(\"resize-grip\");\n\n if (!resizeGrip) {\n return;\n }\n\n resizeGrip.addEventListener(\"touchmove\", handleDragMove, {\n passive: false,\n capture: true,\n });\n resizeGrip.addEventListener(\"touchend\", handleDragEnd, {\n capture: true,\n });\n return resizeGrip;\n };\n\n // Setup event listeners for desktop devices\n const setupDesktopEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n document.addEventListener(\"mousemove\", handleDragMove);\n document.addEventListener(\"mouseup\", handleDragEnd);\n };\n\n // Start drag operation\n const startDrag = (startY: number) => {\n const isMobile = isMobileDevice();\n const startHeight = elementRef.current?.offsetHeight || minHeight;\n let dragCommitted = false;\n let resizeGrip: HTMLElement | undefined;\n\n const handleDragMove = (moveEvent: MouseEvent | TouchEvent) => {\n moveEvent.preventDefault();\n\n if (!dragCommitted) {\n const y = getClientY(moveEvent);\n if (Math.abs(y - startY) < DRAG_COMMIT_PX) {\n return;\n }\n dragCommitted = true;\n onGripDragStart?.();\n }\n\n const deltaY = getClientY(moveEvent) - startY;\n // Invert deltaY so moving up increases height and moving down decreases height\n const newHeight = Math.max(\n minHeight,\n Math.min(maxHeight, startHeight - deltaY),\n );\n\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n element.style.height = `${newHeight}px`;\n\n // Check if content exceeds the new height to determine scrollbar visibility\n const contentHeight = element.scrollHeight;\n const shouldShowScrollbar =\n contentHeight > newHeight || newHeight >= maxHeight;\n element.style.overflowY = shouldShowScrollbar ? \"auto\" : \"hidden\";\n\n // Call the height change callback if provided\n if (onHeightChange) {\n onHeightChange(newHeight);\n }\n\n // Notify when dragged to minimum height to clear manual mode\n if (onReachedMinHeight && Math.abs(newHeight - minHeight) <= EPS) {\n onReachedMinHeight();\n }\n };\n\n const handleDragEnd = () => {\n if (dragCommitted) {\n onGripDragEnd?.();\n }\n\n if (isMobile) {\n if (!resizeGrip) {\n return;\n }\n\n resizeGrip.removeEventListener(\"touchmove\", handleDragMove, true);\n resizeGrip.removeEventListener(\"touchend\", handleDragEnd, true);\n } else {\n document.removeEventListener(\"mousemove\", handleDragMove);\n document.removeEventListener(\"mouseup\", handleDragEnd);\n document.removeEventListener(\"touchmove\", handleDragMove);\n document.removeEventListener(\"touchend\", handleDragEnd);\n }\n };\n\n // Setup event listeners based on device type\n if (isMobile) {\n resizeGrip = setupMobileEventListeners(handleDragMove, handleDragEnd);\n } else {\n setupDesktopEventListeners(handleDragMove, handleDragEnd);\n }\n };\n\n // Handle mouse down on grip for manual resizing\n const handleGripMouseDown = (e: ReactMouseEvent) => {\n e.preventDefault();\n // Only allow manual resizing when the input is bottom-anchored (e.g. the\n // conversation page). On the home page the input is centred and dragging\n // the top grip would grow the box downward, which is confusing.\n if (!isBottomAnchored()) return;\n startDrag(e.clientY);\n };\n\n // Handle touch start on grip for manual resizing\n const handleGripTouchStart = (e: ReactTouchEvent) => {\n e.preventDefault();\n if (!isBottomAnchored()) return;\n startDrag(e.touches[0].clientY);\n };\n\n return {\n handleGripMouseDown,\n handleGripTouchStart,\n };\n};\n"],"mappings":"qHASA,IAAM,EAAiB,EAWjB,EAA4B,IASrB,MAAkC,CAE7C,IAAM,EADO,SAAS,eAAe,aACrB,GAAM,eAAiB,KAGvC,OAFK,EACQ,EAAQ,sBACd,EAAK,QAAU,OAAO,YAAc,EAFtB,EAGvB,EAaa,GAAiB,CAC5B,aACA,YACA,YACA,kBACA,gBACA,iBACA,wBAC0B,CAC1B,IAAM,EAAc,GACd,YAAa,GAAS,EAAM,QAAQ,OAAS,EACxC,EAAM,QAAQ,GAAG,QAElB,EAAqB,QAIzB,GACJ,EACA,IACG,CACH,IAAM,EAAa,SAAS,eAAe,aAAa,EAEnD,KAWL,OAPA,EAAW,iBAAiB,YAAa,EAAgB,CACvD,QAAS,GACT,QAAS,EACX,CAAC,EACD,EAAW,iBAAiB,WAAY,EAAe,CACrD,QAAS,EACX,CAAC,EACM,CACT,EAGM,GACJ,EACA,IACG,CACH,SAAS,iBAAiB,YAAa,CAAc,EACrD,SAAS,iBAAiB,UAAW,CAAa,CACpD,EAGM,EAAa,GAAmB,CACpC,IAAM,EAAW,EAAA,eAAe,EAC1B,EAAc,EAAW,SAAS,cAAgB,EACpD,EAAgB,GAChB,EAEE,EAAkB,GAAuC,CAG7D,GAFA,EAAU,eAAe,EAErB,CAAC,EAAe,CAClB,IAAM,EAAI,EAAW,CAAS,EAC9B,GAAI,KAAK,IAAI,EAAI,CAAM,EAAI,EACzB,OAEF,EAAgB,GAChB,IAAkB,CACpB,CAEA,IAAM,EAAS,EAAW,CAAS,EAAI,EAEjC,EAAY,KAAK,IACrB,EACA,KAAK,IAAI,EAAW,EAAc,CAAM,CAC1C,EAEM,EAAU,EAAW,QAE3B,GAAI,CAAC,EACH,OAGF,EAAQ,MAAM,OAAS,GAAG,EAAU,IAIpC,IAAM,EADgB,EAAQ,aAEZ,GAAa,GAAa,EAC5C,EAAQ,MAAM,UAAY,EAAsB,OAAS,SAGrD,GACF,EAAe,CAAS,EAItB,GAAsB,KAAK,IAAI,EAAY,CAAS,GAAA,KACtD,EAAmB,CAEvB,EAEM,MAAsB,CAK1B,GAJI,GACF,IAAgB,EAGd,EAAU,CACZ,GAAI,CAAC,EACH,OAGF,EAAW,oBAAoB,YAAa,EAAgB,EAAI,EAChE,EAAW,oBAAoB,WAAY,EAAe,EAAI,CAChE,MACE,SAAS,oBAAoB,YAAa,CAAc,EACxD,SAAS,oBAAoB,UAAW,CAAa,EACrD,SAAS,oBAAoB,YAAa,CAAc,EACxD,SAAS,oBAAoB,WAAY,CAAa,CAE1D,EAGI,EACF,EAAa,EAA0B,EAAgB,CAAa,EAEpE,EAA2B,EAAgB,CAAa,CAE5D,EAmBA,MAAO,CACL,oBAjB2B,GAAuB,CAClD,EAAE,eAAe,EAIZ,EAAiB,GACtB,EAAU,EAAE,OAAO,CACrB,EAWE,qBAR4B,GAAuB,CACnD,EAAE,eAAe,EACZ,EAAiB,GACtB,EAAU,EAAE,QAAQ,GAAG,OAAO,CAChC,CAKA,CACF"}
|
|
@@ -7,14 +7,14 @@ var t = 2, n = 120, r = () => {
|
|
|
7
7
|
}, i = ({ elementRef: n, minHeight: i, maxHeight: a, onGripDragStart: o, onGripDragEnd: s, onHeightChange: c, onReachedMinHeight: l }) => {
|
|
8
8
|
let u = (e) => "touches" in e && e.touches.length > 0 ? e.touches[0].clientY : e.clientY, d = (e, t) => {
|
|
9
9
|
let n = document.getElementById("resize-grip");
|
|
10
|
-
n
|
|
10
|
+
if (n) return n.addEventListener("touchmove", e, {
|
|
11
11
|
passive: !1,
|
|
12
12
|
capture: !0
|
|
13
|
-
}), n.addEventListener("touchend", t, { capture: !0 })
|
|
13
|
+
}), n.addEventListener("touchend", t, { capture: !0 }), n;
|
|
14
14
|
}, f = (e, t) => {
|
|
15
15
|
document.addEventListener("mousemove", e), document.addEventListener("mouseup", t);
|
|
16
16
|
}, p = (r) => {
|
|
17
|
-
let p = e(), m = n.current?.offsetHeight || i, h = !1, g = (e) => {
|
|
17
|
+
let p = e(), m = n.current?.offsetHeight || i, h = !1, g, _ = (e) => {
|
|
18
18
|
if (e.preventDefault(), !h) {
|
|
19
19
|
let n = u(e);
|
|
20
20
|
if (Math.abs(n - r) < t) return;
|
|
@@ -25,14 +25,13 @@ var t = 2, n = 120, r = () => {
|
|
|
25
25
|
f.style.height = `${d}px`;
|
|
26
26
|
let p = f.scrollHeight > d || d >= a;
|
|
27
27
|
f.style.overflowY = p ? "auto" : "hidden", c && c(d), l && Math.abs(d - i) <= 1.5 && l();
|
|
28
|
-
},
|
|
28
|
+
}, v = () => {
|
|
29
29
|
if (h && s?.(), p) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} else document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", _), document.removeEventListener("touchmove", g), document.removeEventListener("touchend", _);
|
|
30
|
+
if (!g) return;
|
|
31
|
+
g.removeEventListener("touchmove", _, !0), g.removeEventListener("touchend", v, !0);
|
|
32
|
+
} else document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", v), document.removeEventListener("touchmove", _), document.removeEventListener("touchend", v);
|
|
34
33
|
};
|
|
35
|
-
p ? d(
|
|
34
|
+
p ? g = d(_, v) : f(_, v);
|
|
36
35
|
};
|
|
37
36
|
return {
|
|
38
37
|
handleGripMouseDown: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-drag-resize.js","names":[],"sources":["../../src/hooks/use-drag-resize.ts"],"sourcesContent":["import type {\n RefObject,\n MouseEvent as ReactMouseEvent,\n TouchEvent as ReactTouchEvent,\n} from \"react\";\nimport { EPS } from \"#/utils/constants\";\nimport { isMobileDevice } from \"#/utils/utils\";\n\n/** Movement required before a pointer gesture is treated as a resize drag. */\nconst DRAG_COMMIT_PX = 2;\n\n/**\n * Distance (px) from the viewport bottom within which we consider the chat\n * input to be \"bottom-anchored\" by its parent's flexbox. When the input is\n * bottom-anchored (e.g. the conversation page), dragging the top grip makes\n * the box grow upward — the expected behaviour. When it is NOT\n * bottom-anchored (e.g. the home page where the input sits in the centre of\n * the screen), the same drag would make the box grow downward, which is\n * confusing, so we disable manual resizing entirely in that case.\n */\nconst BOTTOM_ANCHORED_THRESHOLD = 120;\n\n/**\n * Determine whether the chat input is anchored to the bottom of the viewport\n * by its parent layout (e.g. the conversation page uses a flex column with a\n * growing scroll area above the input). When true, dragging the top grip\n * makes the box grow upward, which is the expected behaviour. When false,\n * the drag would grow the box downward, so we disable it.\n */\nexport const isBottomAnchored = (): boolean => {\n const grip = document.getElementById(\"resize-grip\");\n const wrapper = grip?.parentElement ?? null;\n if (!wrapper) return true; // fall back to allowing the drag\n const rect = wrapper.getBoundingClientRect();\n return rect.bottom >= window.innerHeight - BOTTOM_ANCHORED_THRESHOLD;\n};\n\n// Drag handling hook\ninterface UseDragResizeOptions {\n elementRef: RefObject<HTMLElement | null>;\n minHeight: number;\n maxHeight: number;\n onGripDragStart?: () => void;\n onGripDragEnd?: () => void;\n onHeightChange?: (height: number) => void;\n onReachedMinHeight?: () => void; // Notify when user drags to minimum height\n}\n\nexport const useDragResize = ({\n elementRef,\n minHeight,\n maxHeight,\n onGripDragStart,\n onGripDragEnd,\n onHeightChange,\n onReachedMinHeight,\n}: UseDragResizeOptions) => {\n const getClientY = (event: MouseEvent | TouchEvent): number => {\n if (\"touches\" in event && event.touches.length > 0) {\n return event.touches[0].clientY;\n }\n return (event as MouseEvent).clientY;\n };\n\n // Setup event listeners for mobile devices\n const setupMobileEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n const resizeGrip = document.getElementById(\"resize-grip\");\n\n if (!resizeGrip) {\n return;\n }\n\n resizeGrip.addEventListener(\"touchmove\", handleDragMove, {\n passive: false,\n capture: true,\n });\n resizeGrip.addEventListener(\"touchend\", handleDragEnd, {\n capture: true,\n });\n };\n\n // Setup event listeners for desktop devices\n const setupDesktopEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n document.addEventListener(\"mousemove\", handleDragMove);\n document.addEventListener(\"mouseup\", handleDragEnd);\n };\n\n // Start drag operation\n const startDrag = (startY: number) => {\n const isMobile = isMobileDevice();\n const startHeight = elementRef.current?.offsetHeight || minHeight;\n let dragCommitted = false;\n\n const handleDragMove = (moveEvent: MouseEvent | TouchEvent) => {\n moveEvent.preventDefault();\n\n if (!dragCommitted) {\n const y = getClientY(moveEvent);\n if (Math.abs(y - startY) < DRAG_COMMIT_PX) {\n return;\n }\n dragCommitted = true;\n onGripDragStart?.();\n }\n\n const deltaY = getClientY(moveEvent) - startY;\n // Invert deltaY so moving up increases height and moving down decreases height\n const newHeight = Math.max(\n minHeight,\n Math.min(maxHeight, startHeight - deltaY),\n );\n\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n element.style.height = `${newHeight}px`;\n\n // Check if content exceeds the new height to determine scrollbar visibility\n const contentHeight = element.scrollHeight;\n const shouldShowScrollbar =\n contentHeight > newHeight || newHeight >= maxHeight;\n element.style.overflowY = shouldShowScrollbar ? \"auto\" : \"hidden\";\n\n // Call the height change callback if provided\n if (onHeightChange) {\n onHeightChange(newHeight);\n }\n\n // Notify when dragged to minimum height to clear manual mode\n if (onReachedMinHeight && Math.abs(newHeight - minHeight) <= EPS) {\n onReachedMinHeight();\n }\n };\n\n const handleDragEnd = () => {\n if (dragCommitted) {\n onGripDragEnd?.();\n }\n\n if (isMobile) {\n
|
|
1
|
+
{"version":3,"file":"use-drag-resize.js","names":[],"sources":["../../src/hooks/use-drag-resize.ts"],"sourcesContent":["import type {\n RefObject,\n MouseEvent as ReactMouseEvent,\n TouchEvent as ReactTouchEvent,\n} from \"react\";\nimport { EPS } from \"#/utils/constants\";\nimport { isMobileDevice } from \"#/utils/utils\";\n\n/** Movement required before a pointer gesture is treated as a resize drag. */\nconst DRAG_COMMIT_PX = 2;\n\n/**\n * Distance (px) from the viewport bottom within which we consider the chat\n * input to be \"bottom-anchored\" by its parent's flexbox. When the input is\n * bottom-anchored (e.g. the conversation page), dragging the top grip makes\n * the box grow upward — the expected behaviour. When it is NOT\n * bottom-anchored (e.g. the home page where the input sits in the centre of\n * the screen), the same drag would make the box grow downward, which is\n * confusing, so we disable manual resizing entirely in that case.\n */\nconst BOTTOM_ANCHORED_THRESHOLD = 120;\n\n/**\n * Determine whether the chat input is anchored to the bottom of the viewport\n * by its parent layout (e.g. the conversation page uses a flex column with a\n * growing scroll area above the input). When true, dragging the top grip\n * makes the box grow upward, which is the expected behaviour. When false,\n * the drag would grow the box downward, so we disable it.\n */\nexport const isBottomAnchored = (): boolean => {\n const grip = document.getElementById(\"resize-grip\");\n const wrapper = grip?.parentElement ?? null;\n if (!wrapper) return true; // fall back to allowing the drag\n const rect = wrapper.getBoundingClientRect();\n return rect.bottom >= window.innerHeight - BOTTOM_ANCHORED_THRESHOLD;\n};\n\n// Drag handling hook\ninterface UseDragResizeOptions {\n elementRef: RefObject<HTMLElement | null>;\n minHeight: number;\n maxHeight: number;\n onGripDragStart?: () => void;\n onGripDragEnd?: () => void;\n onHeightChange?: (height: number) => void;\n onReachedMinHeight?: () => void; // Notify when user drags to minimum height\n}\n\nexport const useDragResize = ({\n elementRef,\n minHeight,\n maxHeight,\n onGripDragStart,\n onGripDragEnd,\n onHeightChange,\n onReachedMinHeight,\n}: UseDragResizeOptions) => {\n const getClientY = (event: MouseEvent | TouchEvent): number => {\n if (\"touches\" in event && event.touches.length > 0) {\n return event.touches[0].clientY;\n }\n return (event as MouseEvent).clientY;\n };\n\n // Setup event listeners for mobile devices\n const setupMobileEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n const resizeGrip = document.getElementById(\"resize-grip\");\n\n if (!resizeGrip) {\n return;\n }\n\n resizeGrip.addEventListener(\"touchmove\", handleDragMove, {\n passive: false,\n capture: true,\n });\n resizeGrip.addEventListener(\"touchend\", handleDragEnd, {\n capture: true,\n });\n return resizeGrip;\n };\n\n // Setup event listeners for desktop devices\n const setupDesktopEventListeners = (\n handleDragMove: (event: MouseEvent | TouchEvent) => void,\n handleDragEnd: () => void,\n ) => {\n document.addEventListener(\"mousemove\", handleDragMove);\n document.addEventListener(\"mouseup\", handleDragEnd);\n };\n\n // Start drag operation\n const startDrag = (startY: number) => {\n const isMobile = isMobileDevice();\n const startHeight = elementRef.current?.offsetHeight || minHeight;\n let dragCommitted = false;\n let resizeGrip: HTMLElement | undefined;\n\n const handleDragMove = (moveEvent: MouseEvent | TouchEvent) => {\n moveEvent.preventDefault();\n\n if (!dragCommitted) {\n const y = getClientY(moveEvent);\n if (Math.abs(y - startY) < DRAG_COMMIT_PX) {\n return;\n }\n dragCommitted = true;\n onGripDragStart?.();\n }\n\n const deltaY = getClientY(moveEvent) - startY;\n // Invert deltaY so moving up increases height and moving down decreases height\n const newHeight = Math.max(\n minHeight,\n Math.min(maxHeight, startHeight - deltaY),\n );\n\n const element = elementRef.current;\n\n if (!element) {\n return;\n }\n\n element.style.height = `${newHeight}px`;\n\n // Check if content exceeds the new height to determine scrollbar visibility\n const contentHeight = element.scrollHeight;\n const shouldShowScrollbar =\n contentHeight > newHeight || newHeight >= maxHeight;\n element.style.overflowY = shouldShowScrollbar ? \"auto\" : \"hidden\";\n\n // Call the height change callback if provided\n if (onHeightChange) {\n onHeightChange(newHeight);\n }\n\n // Notify when dragged to minimum height to clear manual mode\n if (onReachedMinHeight && Math.abs(newHeight - minHeight) <= EPS) {\n onReachedMinHeight();\n }\n };\n\n const handleDragEnd = () => {\n if (dragCommitted) {\n onGripDragEnd?.();\n }\n\n if (isMobile) {\n if (!resizeGrip) {\n return;\n }\n\n resizeGrip.removeEventListener(\"touchmove\", handleDragMove, true);\n resizeGrip.removeEventListener(\"touchend\", handleDragEnd, true);\n } else {\n document.removeEventListener(\"mousemove\", handleDragMove);\n document.removeEventListener(\"mouseup\", handleDragEnd);\n document.removeEventListener(\"touchmove\", handleDragMove);\n document.removeEventListener(\"touchend\", handleDragEnd);\n }\n };\n\n // Setup event listeners based on device type\n if (isMobile) {\n resizeGrip = setupMobileEventListeners(handleDragMove, handleDragEnd);\n } else {\n setupDesktopEventListeners(handleDragMove, handleDragEnd);\n }\n };\n\n // Handle mouse down on grip for manual resizing\n const handleGripMouseDown = (e: ReactMouseEvent) => {\n e.preventDefault();\n // Only allow manual resizing when the input is bottom-anchored (e.g. the\n // conversation page). On the home page the input is centred and dragging\n // the top grip would grow the box downward, which is confusing.\n if (!isBottomAnchored()) return;\n startDrag(e.clientY);\n };\n\n // Handle touch start on grip for manual resizing\n const handleGripTouchStart = (e: ReactTouchEvent) => {\n e.preventDefault();\n if (!isBottomAnchored()) return;\n startDrag(e.touches[0].clientY);\n };\n\n return {\n handleGripMouseDown,\n handleGripTouchStart,\n };\n};\n"],"mappings":";;;AASA,IAAM,IAAiB,GAWjB,IAA4B,KASrB,UAAkC;CAE7C,IAAM,IADO,SAAS,eAAe,aACrB,GAAM,iBAAiB;CAGvC,OAFK,IACQ,EAAQ,sBACd,EAAK,UAAU,OAAO,cAAc,IAFtB;AAGvB,GAaa,KAAiB,EAC5B,eACA,cACA,cACA,oBACA,kBACA,mBACA,4BAC0B;CAC1B,IAAM,KAAc,MACd,aAAa,KAAS,EAAM,QAAQ,SAAS,IACxC,EAAM,QAAQ,GAAG,UAElB,EAAqB,SAIzB,KACJ,GACA,MACG;EACH,IAAM,IAAa,SAAS,eAAe,aAAa;EAEnD,OAWL,OAPA,EAAW,iBAAiB,aAAa,GAAgB;GACvD,SAAS;GACT,SAAS;EACX,CAAC,GACD,EAAW,iBAAiB,YAAY,GAAe,EACrD,SAAS,GACX,CAAC,GACM;CACT,GAGM,KACJ,GACA,MACG;EAEH,AADA,SAAS,iBAAiB,aAAa,CAAc,GACrD,SAAS,iBAAiB,WAAW,CAAa;CACpD,GAGM,KAAa,MAAmB;EACpC,IAAM,IAAW,EAAe,GAC1B,IAAc,EAAW,SAAS,gBAAgB,GACpD,IAAgB,IAChB,GAEE,KAAkB,MAAuC;GAG7D,IAFA,EAAU,eAAe,GAErB,CAAC,GAAe;IAClB,IAAM,IAAI,EAAW,CAAS;IAC9B,IAAI,KAAK,IAAI,IAAI,CAAM,IAAI,GACzB;IAGF,AADA,IAAgB,IAChB,IAAkB;GACpB;GAEA,IAAM,IAAS,EAAW,CAAS,IAAI,GAEjC,IAAY,KAAK,IACrB,GACA,KAAK,IAAI,GAAW,IAAc,CAAM,CAC1C,GAEM,IAAU,EAAW;GAE3B,IAAI,CAAC,GACH;GAGF,EAAQ,MAAM,SAAS,GAAG,EAAU;GAIpC,IAAM,IADgB,EAAQ,eAEZ,KAAa,KAAa;GAS5C,AARA,EAAQ,MAAM,YAAY,IAAsB,SAAS,UAGrD,KACF,EAAe,CAAS,GAItB,KAAsB,KAAK,IAAI,IAAY,CAAS,KAAA,OACtD,EAAmB;EAEvB,GAEM,UAAsB;GAK1B,IAJI,KACF,IAAgB,GAGd,GAAU;IACZ,IAAI,CAAC,GACH;IAIF,AADA,EAAW,oBAAoB,aAAa,GAAgB,EAAI,GAChE,EAAW,oBAAoB,YAAY,GAAe,EAAI;GAChE,OAIE,AAHA,SAAS,oBAAoB,aAAa,CAAc,GACxD,SAAS,oBAAoB,WAAW,CAAa,GACrD,SAAS,oBAAoB,aAAa,CAAc,GACxD,SAAS,oBAAoB,YAAY,CAAa;EAE1D;EAGA,AAAI,IACF,IAAa,EAA0B,GAAgB,CAAa,IAEpE,EAA2B,GAAgB,CAAa;CAE5D;CAmBA,OAAO;EACL,sBAjB2B,MAAuB;GAClD,EAAE,eAAe,GAIZ,EAAiB,KACtB,EAAU,EAAE,OAAO;EACrB;EAWE,uBAR4B,MAAuB;GACnD,EAAE,eAAe,GACZ,EAAiB,KACtB,EAAU,EAAE,QAAQ,GAAG,OAAO;EAChC;CAKA;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../_virtual/_rolldown/runtime.cjs"),require("../context/navigation-context.cjs"),require("../utils/custom-toast-handlers.cjs")
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs"),require("../context/navigation-context.cjs"),require("../utils/custom-toast-handlers.cjs");const e=require("../types/automation.cjs");require("./use-automation-permissions.cjs"),require("./query/use-automations.cjs"),require("../fixtures/home-automations-demo.cjs"),require("react");function t(t){return t?.status===e.AutomationRunStatus.PENDING||t?.status===e.AutomationRunStatus.RUNNING}exports.isInFlightAutomationRun=t;
|
|
2
2
|
//# sourceMappingURL=use-home-automation-actions.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-home-automation-actions.cjs","names":[],"sources":["../../src/hooks/use-home-automation-actions.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {
|
|
1
|
+
{"version":3,"file":"use-home-automation-actions.cjs","names":[],"sources":["../../src/hooks/use-home-automation-actions.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigation } from \"#/context/navigation-context\";\nimport {\n useCancelAutomationRun,\n useDispatchAutomation,\n useToggleAutomation,\n} from \"#/hooks/query/use-automations\";\nimport {\n useAutomationPermissions,\n useIsAutomationOwner,\n} from \"#/hooks/use-automation-permissions\";\nimport { isHomeAutomationsDemoEnabled } from \"#/fixtures/home-automations-demo\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport {\n AutomationRunStatus,\n type Automation,\n type AutomationRun,\n} from \"#/types/automation\";\nimport { getApiErrorMessage } from \"#/utils/api-error-message\";\nimport {\n displayErrorToast,\n displaySuccessToast,\n} from \"#/utils/custom-toast-handlers\";\n\nexport function isInFlightAutomationRun(\n run: AutomationRun | null | undefined,\n): boolean {\n return (\n run?.status === AutomationRunStatus.PENDING ||\n run?.status === AutomationRunStatus.RUNNING\n );\n}\n\n/**\n * Shared home-surface actions for pinned cards and activity rows:\n * run now, view, edit, turn off (with confirm), cancel in-flight.\n */\nexport function useHomeAutomationActions(\n automation: Automation,\n latestRun: AutomationRun | null,\n) {\n const { t } = useTranslation(\"openhands\");\n const { navigate } = useNavigation();\n const { canManage: hasManagePermission } = useAutomationPermissions();\n const isOwner = useIsAutomationOwner(automation);\n // Write actions on a specific automation are allowed when the user has\n // manage permission OR is the automation's creator (creator escape hatch).\n const canManage = hasManagePermission || isOwner;\n const isDemo = isHomeAutomationsDemoEnabled();\n\n const dispatchMutation = useDispatchAutomation();\n const toggleMutation = useToggleAutomation();\n const cancelMutation = useCancelAutomationRun();\n\n const [editOpen, setEditOpen] = useState(false);\n const [turnOffConfirmOpen, setTurnOffConfirmOpen] = useState(false);\n\n const isRunPending =\n dispatchMutation.isPending && dispatchMutation.variables === automation.id;\n const isCancelPending =\n cancelMutation.isPending &&\n cancelMutation.variables?.runId === latestRun?.id;\n const canCancel = canManage && isInFlightAutomationRun(latestRun);\n\n const runNow = useCallback(() => {\n if (isDemo) {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$RUN_NOW_SUCCESS));\n return;\n }\n dispatchMutation.mutate(automation.id, {\n onSuccess: () => {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$RUN_NOW_SUCCESS));\n },\n onError: (error) => {\n displayErrorToast(\n getApiErrorMessage(error, t(I18nKey.AUTOMATIONS$RUN_NOW_ERROR)),\n );\n },\n });\n }, [automation.id, dispatchMutation, isDemo, t]);\n\n const viewDetails = useCallback(() => {\n navigate?.(`/automations/${automation.id}`);\n }, [automation.id, navigate]);\n\n const openEdit = useCallback(() => {\n setEditOpen(true);\n }, []);\n\n const requestTurnOff = useCallback(() => {\n setTurnOffConfirmOpen(true);\n }, []);\n\n const confirmTurnOff = useCallback(() => {\n setTurnOffConfirmOpen(false);\n if (isDemo) return;\n toggleMutation.mutate(\n { id: automation.id, enabled: false },\n {\n onError: (error) => {\n displayErrorToast(\n getApiErrorMessage(error, t(I18nKey.AUTOMATIONS$TURN_OFF_ERROR)),\n );\n },\n },\n );\n }, [automation.id, isDemo, t, toggleMutation]);\n\n const cancelTurnOff = useCallback(() => {\n setTurnOffConfirmOpen(false);\n }, []);\n\n const cancelRun = useCallback(() => {\n if (!latestRun || !isInFlightAutomationRun(latestRun)) return;\n if (isDemo) {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$CANCEL_RUN_SUCCESS));\n return;\n }\n cancelMutation.mutate(\n { automationId: automation.id, runId: latestRun.id },\n {\n onSuccess: () => {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$CANCEL_RUN_SUCCESS));\n },\n onError: (error) => {\n displayErrorToast(\n getApiErrorMessage(error, t(I18nKey.AUTOMATIONS$CANCEL_RUN_ERROR)),\n );\n },\n },\n );\n }, [automation.id, cancelMutation, isDemo, latestRun, t]);\n\n return {\n canManage,\n isRunPending,\n isCancelPending,\n canCancel,\n editOpen,\n setEditOpen,\n turnOffConfirmOpen,\n runNow,\n viewDetails,\n openEdit,\n requestTurnOff,\n confirmTurnOff,\n cancelTurnOff,\n cancelRun,\n };\n}\n"],"mappings":"wUAyBA,SAAgB,EACd,EACS,CACT,OACE,GAAK,SAAW,EAAA,oBAAoB,SACpC,GAAK,SAAW,EAAA,oBAAoB,OAExC"}
|
|
@@ -2,11 +2,10 @@ import { type Automation, type AutomationRun } from "#/types/automation";
|
|
|
2
2
|
export declare function isInFlightAutomationRun(run: AutomationRun | null | undefined): boolean;
|
|
3
3
|
/**
|
|
4
4
|
* Shared home-surface actions for pinned cards and activity rows:
|
|
5
|
-
* run now, view, edit
|
|
5
|
+
* run now, view, edit, turn off (with confirm), cancel in-flight.
|
|
6
6
|
*/
|
|
7
7
|
export declare function useHomeAutomationActions(automation: Automation, latestRun: AutomationRun | null): {
|
|
8
8
|
canManage: boolean;
|
|
9
|
-
canEdit: boolean;
|
|
10
9
|
isRunPending: boolean;
|
|
11
10
|
isCancelPending: boolean;
|
|
12
11
|
canCancel: boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "../context/navigation-context.js";
|
|
2
2
|
import "../utils/custom-toast-handlers.js";
|
|
3
|
-
import "../contexts/active-backend-context.js";
|
|
4
3
|
import { AutomationRunStatus as e } from "../types/automation.js";
|
|
5
4
|
import "./use-automation-permissions.js";
|
|
6
5
|
import "./query/use-automations.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-home-automation-actions.js","names":[],"sources":["../../src/hooks/use-home-automation-actions.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {
|
|
1
|
+
{"version":3,"file":"use-home-automation-actions.js","names":[],"sources":["../../src/hooks/use-home-automation-actions.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { useNavigation } from \"#/context/navigation-context\";\nimport {\n useCancelAutomationRun,\n useDispatchAutomation,\n useToggleAutomation,\n} from \"#/hooks/query/use-automations\";\nimport {\n useAutomationPermissions,\n useIsAutomationOwner,\n} from \"#/hooks/use-automation-permissions\";\nimport { isHomeAutomationsDemoEnabled } from \"#/fixtures/home-automations-demo\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport {\n AutomationRunStatus,\n type Automation,\n type AutomationRun,\n} from \"#/types/automation\";\nimport { getApiErrorMessage } from \"#/utils/api-error-message\";\nimport {\n displayErrorToast,\n displaySuccessToast,\n} from \"#/utils/custom-toast-handlers\";\n\nexport function isInFlightAutomationRun(\n run: AutomationRun | null | undefined,\n): boolean {\n return (\n run?.status === AutomationRunStatus.PENDING ||\n run?.status === AutomationRunStatus.RUNNING\n );\n}\n\n/**\n * Shared home-surface actions for pinned cards and activity rows:\n * run now, view, edit, turn off (with confirm), cancel in-flight.\n */\nexport function useHomeAutomationActions(\n automation: Automation,\n latestRun: AutomationRun | null,\n) {\n const { t } = useTranslation(\"openhands\");\n const { navigate } = useNavigation();\n const { canManage: hasManagePermission } = useAutomationPermissions();\n const isOwner = useIsAutomationOwner(automation);\n // Write actions on a specific automation are allowed when the user has\n // manage permission OR is the automation's creator (creator escape hatch).\n const canManage = hasManagePermission || isOwner;\n const isDemo = isHomeAutomationsDemoEnabled();\n\n const dispatchMutation = useDispatchAutomation();\n const toggleMutation = useToggleAutomation();\n const cancelMutation = useCancelAutomationRun();\n\n const [editOpen, setEditOpen] = useState(false);\n const [turnOffConfirmOpen, setTurnOffConfirmOpen] = useState(false);\n\n const isRunPending =\n dispatchMutation.isPending && dispatchMutation.variables === automation.id;\n const isCancelPending =\n cancelMutation.isPending &&\n cancelMutation.variables?.runId === latestRun?.id;\n const canCancel = canManage && isInFlightAutomationRun(latestRun);\n\n const runNow = useCallback(() => {\n if (isDemo) {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$RUN_NOW_SUCCESS));\n return;\n }\n dispatchMutation.mutate(automation.id, {\n onSuccess: () => {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$RUN_NOW_SUCCESS));\n },\n onError: (error) => {\n displayErrorToast(\n getApiErrorMessage(error, t(I18nKey.AUTOMATIONS$RUN_NOW_ERROR)),\n );\n },\n });\n }, [automation.id, dispatchMutation, isDemo, t]);\n\n const viewDetails = useCallback(() => {\n navigate?.(`/automations/${automation.id}`);\n }, [automation.id, navigate]);\n\n const openEdit = useCallback(() => {\n setEditOpen(true);\n }, []);\n\n const requestTurnOff = useCallback(() => {\n setTurnOffConfirmOpen(true);\n }, []);\n\n const confirmTurnOff = useCallback(() => {\n setTurnOffConfirmOpen(false);\n if (isDemo) return;\n toggleMutation.mutate(\n { id: automation.id, enabled: false },\n {\n onError: (error) => {\n displayErrorToast(\n getApiErrorMessage(error, t(I18nKey.AUTOMATIONS$TURN_OFF_ERROR)),\n );\n },\n },\n );\n }, [automation.id, isDemo, t, toggleMutation]);\n\n const cancelTurnOff = useCallback(() => {\n setTurnOffConfirmOpen(false);\n }, []);\n\n const cancelRun = useCallback(() => {\n if (!latestRun || !isInFlightAutomationRun(latestRun)) return;\n if (isDemo) {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$CANCEL_RUN_SUCCESS));\n return;\n }\n cancelMutation.mutate(\n { automationId: automation.id, runId: latestRun.id },\n {\n onSuccess: () => {\n displaySuccessToast(t(I18nKey.AUTOMATIONS$CANCEL_RUN_SUCCESS));\n },\n onError: (error) => {\n displayErrorToast(\n getApiErrorMessage(error, t(I18nKey.AUTOMATIONS$CANCEL_RUN_ERROR)),\n );\n },\n },\n );\n }, [automation.id, cancelMutation, isDemo, latestRun, t]);\n\n return {\n canManage,\n isRunPending,\n isCancelPending,\n canCancel,\n editOpen,\n setEditOpen,\n turnOffConfirmOpen,\n runNow,\n viewDetails,\n openEdit,\n requestTurnOff,\n confirmTurnOff,\n cancelTurnOff,\n cancelRun,\n };\n}\n"],"mappings":";;;;;;;;AAyBA,SAAgB,EACd,GACS;CACT,OACE,GAAK,WAAW,EAAoB,WACpC,GAAK,WAAW,EAAoB;AAExC"}
|