@openhands/agent-canvas 1.0.0-beta.6 → 1.0.0-beta.8
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 +24 -7
- package/README.windows.md +27 -0
- package/bin/agent-canvas.mjs +26 -3
- package/build/assets/{QueryClientProvider-CkGuhXg-.js → QueryClientProvider-Cnr-Yl3j.js} +1 -1
- package/build/assets/{Trans-Cvm_-SMi.js → Trans-4jmk54WC.js} +1 -1
- package/build/assets/acp-providers-BAX8OU5C.js +1 -0
- package/build/assets/{acp-route-guard-B2yoBZ_4.js → acp-route-guard-HPk6TV-L.js} +1 -1
- package/build/assets/active-backend-context-BSPE-W72.js +1 -0
- package/build/assets/add-backend-modal-mXKmfMI2.js +1 -0
- package/build/assets/agent-server-client-options-9agOSarV.js +1 -0
- package/build/assets/agent-server-compatibility-B7QStIcH.js +1 -0
- package/build/assets/agent-server-conversation-service.api-B9TUYJon.js +5 -0
- package/build/assets/{agent-settings-CnGSCmK8.js → agent-settings-g3F623RJ.js} +1 -1
- package/build/assets/{alert-banner-DtzAX654.js → alert-banner-DFnn_lC6.js} +1 -1
- package/build/assets/{analytics-consent-form-modal-CHZ3I37v.js → analytics-consent-form-modal-BQCNeNVt.js} +1 -1
- package/build/assets/api-key-entry-screen-myuWMqzW.js +1 -0
- package/build/assets/{app-settings-Db9ITeJH.js → app-settings-CCcX8ZEH.js} +1 -1
- package/build/assets/automation-detail-BDHLHSJd.js +1 -0
- package/build/assets/automations-list-CiNtQhq_.js +1 -0
- package/build/assets/back-nav-button-7dQJ2k3O.js +1 -0
- package/build/assets/backend-form-modal-D3bDMO3C.js +1 -0
- package/build/assets/{backend-synced-settings-badge-Dc6c7GT4.js → backend-synced-settings-badge-BkW5evM0.js} +1 -1
- package/build/assets/base-modal-C2oy2EBG.js +1 -0
- package/build/assets/brand-button-DJ_S16rO.js +1 -0
- package/build/assets/{browser-D810xUYt.js → browser-CGM-k-sH.js} +2 -2
- package/build/assets/browser-store-DAsixKdU.js +1 -0
- package/build/assets/{browser-tab-B-aIqXRl.js → browser-tab-dvSPdvkm.js} +1 -1
- package/build/assets/{checkmark-DL7acQA7.js → checkmark-Dus0b6jt.js} +1 -1
- package/build/assets/{chevron-left-small-CVWf8TI6.js → chevron-left-small-_uvG7RVM.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-P7ZZToV4.js → circle-plus-check-toggle-DKS8MAVV.js} +1 -1
- package/build/assets/{close-B5LROHR3.js → close-BU5iTc66.js} +1 -1
- package/build/assets/code-tag-BzyqOtPD.js +1 -0
- package/build/assets/combobox-caret-BJC7XJsz.js +1 -0
- package/build/assets/{command-store-DFN_17p1.js → command-store-CE1weJy8.js} +1 -1
- package/build/assets/{condenser-settings-wnEKhBof.js → condenser-settings-DCTulgLO.js} +1 -1
- package/build/assets/{confirmation-modal-Dau3w_sa.js → confirmation-modal-B5Ca6qFE.js} +1 -1
- package/build/assets/context-menu-list-item-7tAcm2c3.js +1 -0
- package/build/assets/conversation-BKhikfYl.js +1 -0
- package/build/assets/conversation-DTn8jN8L.js +19 -0
- package/build/assets/conversation-panel-DfHR42mG.js +1 -0
- package/build/assets/conversation-service.api-B6CkzaKD.js +1 -0
- package/build/assets/conversation-state-store-D-w0uurj.js +1 -0
- package/build/assets/conversation-store-CC-isCnP.js +1 -0
- package/build/assets/{conversation-tab-empty-state-DyssnnWa.js → conversation-tab-empty-state-CStQLPVW.js} +1 -1
- package/build/assets/conversation-websocket-context-DShEuLjh.js +3 -0
- package/build/assets/{copy-DYgmUdIw.js → copy-Chg-sFu3.js} +1 -1
- package/build/assets/{custom-toast-handlers-C-SZFmto.js → custom-toast-handlers-ufGJ6_Rc.js} +1 -1
- package/build/assets/declaration-CR6HMp29.js +1 -0
- package/build/assets/{device-verify-DqDlphsG.js → device-verify-C6mj28zv.js} +1 -1
- package/build/assets/dist-DNeWJ2bh.js +1 -0
- package/build/assets/dropdown-classes-BsVmxlNG.js +1 -0
- package/build/assets/edit-automation-modal-DamwL0s0.js +1 -0
- package/build/assets/ellipsis-button-Vh5MvRZa.js +1 -0
- package/build/assets/entry.client-Cn71WM8q.js +2 -0
- package/build/assets/enum-filter-dropdown-5JeF2RLb.js +1 -0
- package/build/assets/{environment-switch-overlay-XL8yCGP6.js → environment-switch-overlay-Tf_BIfeR.js} +1 -1
- package/build/assets/extensions-hub-CUEmfvGy.js +1 -0
- package/build/assets/{extensions-navigation-BYR8Giqq.js → extensions-navigation-VQ-3umJ7.js} +1 -1
- package/build/assets/file-BTY6Gyy9.js +1 -0
- package/build/assets/files-tab-C47fQEeL.js +1 -0
- package/build/assets/files-tab-store-m0ARqX_E.js +1 -0
- package/build/assets/{folder-ZZJVGgd7.js → folder-D1T2W1cj.js} +1 -1
- package/build/assets/git-control-bar-branch-button-BT0aWH-o.js +27 -0
- package/build/assets/git-provider-icon-Pi-Cxpgv.js +1 -0
- package/build/assets/globe-Bzj_0oXT.js +1 -0
- package/build/assets/home-C3k6sFvB.js +1 -0
- package/build/assets/{i18n-CTohRuoO.js → i18n-DET2iOyh.js} +1 -1
- package/build/assets/install-server-modal-6fuq-TU6.js +1 -0
- package/build/assets/launch-DGghLfGx.js +1 -0
- package/build/assets/{lesson-plan-dH5Bj0pN.js → lesson-plan-duSsqWVs.js} +1 -1
- package/build/assets/link-external-DGxVm4Ps.js +1 -0
- package/build/assets/{llm-client-DaH1TuyR.js → llm-client-BqyLKgUN.js} +1 -1
- package/build/assets/llm-settings-BKraGtOu.js +1 -0
- package/build/assets/llm-settings-DRQTgOF1.js +1 -0
- package/build/assets/{loading-spinner-BPtYORNK.js → loading-spinner-5GT9q1xy.js} +1 -1
- package/build/assets/manage-backends-modal-CRMwyU0t.js +1 -0
- package/build/assets/manage-workspaces-modal-BYmGD1W7.js +1 -0
- package/build/assets/manifest-99b06a11.js +1 -0
- package/build/assets/{markdown-renderer-DMzf2i4x.js → markdown-renderer-B3IAVfv4.js} +1 -1
- package/build/assets/mcp-CfDRAmPn.js +9 -0
- package/build/assets/messages-Ba1vaw6t.js +36 -0
- package/build/assets/{modal-backdrop-BAbgYsqB.js → modal-backdrop-RfNCrSpK.js} +1 -1
- package/build/assets/{modal-body-BI6Ru2Qr.js → modal-body-aoa2fx5W.js} +1 -1
- package/build/assets/modal-classes-6YqcqA6y.js +1 -0
- package/build/assets/{modal-close-button-t1Gh3qmL.js → modal-close-button-CtWOUMmw.js} +1 -1
- package/build/assets/{model-selector-SM9IUz-q.js → model-selector-DcztJSxT.js} +1 -1
- package/build/assets/{navigation-context-D0YWpT8d.js → navigation-context-BdKYH32C.js} +1 -1
- package/build/assets/{navigation-link-Cn7KP3c5.js → navigation-link-U4vY9i_C.js} +1 -1
- package/build/assets/{openhands-logo-CnrF6LKb.js → openhands-logo-CCo0wJZX.js} +1 -1
- package/build/assets/{option-service.api-KvY_mZMY.js → option-service.api-CGNANEcT.js} +1 -1
- package/build/assets/{organization-service.api-DzYTHTYC.js → organization-service.api-BeuMC9QL.js} +1 -1
- package/build/assets/{path-utils-C3bQf6lJ.js → path-utils-z12iCrQO.js} +1 -1
- package/build/assets/{plan-components-atxXCF0R.js → plan-components-CRDMQzsS.js} +1 -1
- package/build/assets/{planner-tab-BlrCpv-7.js → planner-tab-Dte6Vzza.js} +1 -1
- package/build/assets/{profiles-client-D6IkTJof.js → profiles-client-BrqNmaDV.js} +1 -1
- package/build/assets/{providers-Bx6EfrzZ.js → providers-eUyo6pgr.js} +1 -1
- package/build/assets/proxy-BqDMnUY-.js +1 -0
- package/build/assets/{query-client-config-B7u9asM0.js → query-client-config-CRnGSujB.js} +1 -1
- package/build/assets/{recommended-automations-launcher-CgV8FyPK.js → recommended-automations-launcher-D5ADbXao.js} +3 -3
- package/build/assets/{root-dNntxffj.js → root-BmhaEJJ8.js} +2 -2
- package/build/assets/root-Z2VHU4R3.css +1 -0
- package/build/assets/root-layout-CNggm0d8.js +2 -0
- package/build/assets/{sdk-section-page-DOIKvwSL.js → sdk-section-page-CRCRY3PG.js} +1 -1
- package/build/assets/{sdk-settings-schema-DsUf9wu1.js → sdk-settings-schema-CLmJ9sho.js} +1 -1
- package/build/assets/{search-27Owlc3A.js → search-SuJctqNJ.js} +1 -1
- package/build/assets/secrets-service-B9AFn9OE.js +1 -0
- package/build/assets/secrets-settings-0UrKMS60.js +1 -0
- package/build/assets/{server-client-DyAQ3NZ_.js → server-client-DYv_GHPl.js} +1 -1
- package/build/assets/{settings-BYkVX7vW.js → settings-6t6LGW04.js} +1 -1
- package/build/assets/{settings-dropdown-input-BJYvGdg-.js → settings-dropdown-input-BtoovFre.js} +1 -1
- package/build/assets/{settings-gear-C77PgE_O.js → settings-gear-Dd8K2_8B.js} +1 -1
- package/build/assets/settings-index-CR6Ou73o.js +1 -0
- package/build/assets/{settings-input-Bn7F5C75.js → settings-input-CehsXnb3.js} +1 -1
- package/build/assets/settings-list-classes-E3v_f6QG.js +1 -0
- package/build/assets/settings-modal-T_Yk1Zfo.js +1 -0
- package/build/assets/{settings-section-header-context-BgZe5YkE.js → settings-section-header-context-DewwJ0-F.js} +1 -1
- package/build/assets/settings-service.api-DwtyDeGh.js +1 -0
- package/build/assets/{settings-switch-BeIKrWms.js → settings-switch-BiBuS3xa.js} +1 -1
- package/build/assets/{settings-utils-B6Nl07io.js → settings-utils-DY04tWG1.js} +1 -1
- package/build/assets/{shared-conversation-AMyqXvpk.js → shared-conversation-BzccsVej.js} +1 -1
- package/build/assets/sidebar-mobile-menu-toggle-DGlRg6jG.js +1 -0
- package/build/assets/{sidebar-nav-link-BGjiJq-4.js → sidebar-nav-link-dgVb8Fpy.js} +1 -1
- package/build/assets/{sidebar-store-Uy3v0AOV.js → sidebar-store-DnQAJAE5.js} +1 -1
- package/build/assets/{skill-card-pill-row-DF1axQCG.js → skill-card-pill-row-BW9qvhoK.js} +1 -1
- package/build/assets/{skills-ChIKZPK4.js → skills-0GRKX5Xj.js} +1 -1
- package/build/assets/{skills-plugins-CcI_19lM.js → skills-plugins-DctDrZ8Y.js} +1 -1
- package/build/assets/skills-settings-rvxImDj_.js +2 -0
- package/build/assets/{styled-tooltip-CBzrri6o.js → styled-tooltip-hdfMXPQC.js} +1 -1
- package/build/assets/{switch-skeleton-DnC9wLp7.js → switch-skeleton-DSKqSx2A.js} +1 -1
- package/build/assets/{task-list-tab-DUJn1sgz.js → task-list-tab-DT6_zfUs.js} +1 -1
- package/build/assets/{terminal-RmuaSdhJ.js → terminal-CPYWdo4j.js} +1 -1
- package/build/assets/{terminal-DgQk1Ay6.js → terminal-KldRPIRT.js} +2 -2
- package/build/assets/{toggle-switch-Pvyp2RAN.js → toggle-switch-T2v6sJ6l.js} +1 -1
- package/build/assets/{typography-gpuWmrQO.js → typography-BDgnT7Yp.js} +1 -1
- package/build/assets/{u-check-circle-IUIfACQQ.js → u-check-circle-DOauqQKb.js} +1 -1
- package/build/assets/{u-check-circle-half-C1YxB6py.js → u-check-circle-half-steSK_JB.js} +1 -1
- package/build/assets/{u-circuit-BmVikJHu.js → u-circuit-x3ExjBbU.js} +1 -1
- package/build/assets/{u-edit-CFvXHqZk.js → u-edit-BbrptMCa.js} +1 -1
- package/build/assets/{use-active-conversation-BEFNwnFk.js → use-active-conversation-sPgfSkql.js} +1 -1
- package/build/assets/use-agent-settings-schema-B66kGIi_.js +1 -0
- package/build/assets/{use-agent-state-Bkrd1FZq.js → use-agent-state-Dp3pD1h3.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-CvkXFnTT.js → use-cloud-current-user-id-ClKFPjFz.js} +1 -1
- package/build/assets/{use-config-Co1O8-Ey.js → use-config-C9pvb0Sm.js} +1 -1
- package/build/assets/{use-create-conversation-CEgXpkfH.js → use-create-conversation-B-lwTnfE.js} +1 -1
- package/build/assets/{use-event-store-BT_gV3ut.js → use-event-store-BomO7ywK.js} +1 -1
- package/build/assets/{use-get-secrets-DuhdIA59.js → use-get-secrets-oyC7PFRz.js} +1 -1
- package/build/assets/{use-handle-plan-click-Ckkm5eIY.js → use-handle-plan-click-DP6Rs-YP.js} +1 -1
- package/build/assets/use-is-authed-dw2026rR.js +1 -0
- package/build/assets/{use-is-creating-conversation-BZ5hB_Bg.js → use-is-creating-conversation-DX2qSlfL.js} +1 -1
- package/build/assets/{use-launch-skill-in-chat-fNN_xGZG.js → use-launch-skill-in-chat-sQNEOLGD.js} +1 -1
- package/build/assets/use-llm-profiles-Bh5JqZUZ.js +1 -0
- package/build/assets/use-runtime-is-ready-BakOUVU-.js +1 -0
- package/build/assets/{use-save-settings-VUrj_QNG.js → use-save-settings-uXXkqvD7.js} +1 -1
- package/build/assets/use-settings-DeO7nvpM.js +1 -0
- package/build/assets/{use-settings-nav-items-1ZvovKSr.js → use-settings-nav-items-BGMFn25b.js} +1 -1
- package/build/assets/{use-skills-DAMLFjKU.js → use-skills-DWIK3l3a.js} +1 -1
- package/build/assets/{use-task-list-CLJbuJgM.js → use-task-list-CsT10CBb.js} +1 -1
- package/build/assets/{use-unified-vscode-url-DdSRw-6P.js → use-unified-vscode-url-DXPtB317.js} +1 -1
- package/build/assets/use-user-conversation-DJen4YIP.js +1 -0
- package/build/assets/{useMutation-DqrumCWD.js → useMutation-GSSKKebK.js} +1 -1
- package/build/assets/{useTranslation-DCOdSSMl.js → useTranslation-B6voJV4y.js} +1 -1
- package/build/assets/utils-DCVfKFRt.js +1 -0
- package/build/assets/{vendor~browser-BNjNhjFU.js → vendor~browser-BrOJLj3y.js} +1 -1
- package/build/assets/vendor~conversation-panel~conversation-C9o-K1hW.js +1 -0
- package/build/assets/vendor~conversation-panel~conversation~index-RXYdJYxU.js +1 -0
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DpAdkv8m.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-6ByzelMS.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B92czPCF.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BED5W_c4.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-By5W2oHN.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CCbqAFiI.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BbFOrAjI.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CG96FCly.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-smY2r837.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-E4d6IEfI.js} +1 -1
- package/build/assets/{vendor~home~mcp~automations-list-Cs-TO3fK.js → vendor~home~mcp~automations-list-CZSK-lT2.js} +1 -1
- package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-Z3nsiNNq.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js} +1 -1
- package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-DbfELDJu.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js} +2 -2
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js → vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js} +1 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js +1 -0
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js +9 -0
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BkQGKpye.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-Bbs7UJ5U.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js} +2 -2
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js} +1 -1
- package/build/assets/{vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js → vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js} +1 -1
- package/build/assets/{verification-settings-CsbvQcYS.js → verification-settings-C_zHuDx9.js} +1 -1
- package/build/assets/{vscode-tab-DjNArCgY.js → vscode-tab-DH9x7xXS.js} +1 -1
- package/build/assets/{waiting-for-runtime-message-CntjExbU.js → waiting-for-runtime-message-CdK3btDZ.js} +1 -1
- package/build/assets/{x-mark-CrpjscNc.js → x-mark-BrkSPIiT.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +20 -2
- package/build/locales/ca/openhands.json +20 -2
- package/build/locales/de/openhands.json +20 -2
- package/build/locales/en/openhands.json +20 -2
- package/build/locales/es/openhands.json +20 -2
- package/build/locales/fr/openhands.json +20 -2
- package/build/locales/it/openhands.json +20 -2
- package/build/locales/ja/openhands.json +20 -2
- package/build/locales/ko-KR/openhands.json +20 -2
- package/build/locales/no/openhands.json +20 -2
- package/build/locales/pt/openhands.json +20 -2
- package/build/locales/tr/openhands.json +20 -2
- package/build/locales/uk/openhands.json +20 -2
- package/build/locales/zh-CN/openhands.json +20 -2
- package/build/locales/zh-TW/openhands.json +20 -2
- package/dist/api/acp-service/acp-service.api.d.ts +18 -0
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.js +54 -55
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/agent-server-client-options.cjs +1 -1
- package/dist/api/agent-server-client-options.cjs.map +1 -1
- package/dist/api/agent-server-client-options.d.ts +4 -0
- package/dist/api/agent-server-client-options.js +18 -12
- package/dist/api/agent-server-client-options.js.map +1 -1
- package/dist/api/agent-server-compatibility.cjs +1 -1
- package/dist/api/agent-server-compatibility.cjs.map +1 -1
- package/dist/api/agent-server-compatibility.d.ts +1 -1
- package/dist/api/agent-server-compatibility.js +30 -25
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/agent-server-config.cjs +1 -1
- package/dist/api/agent-server-config.cjs.map +1 -1
- package/dist/api/agent-server-config.d.ts +15 -48
- package/dist/api/agent-server-config.js +25 -69
- package/dist/api/agent-server-config.js.map +1 -1
- package/dist/api/backend-registry/active-store.cjs +1 -1
- package/dist/api/backend-registry/active-store.cjs.map +1 -1
- package/dist/api/backend-registry/active-store.d.ts +11 -5
- package/dist/api/backend-registry/active-store.js +36 -27
- package/dist/api/backend-registry/active-store.js.map +1 -1
- package/dist/api/backend-registry/auth.cjs +1 -1
- package/dist/api/backend-registry/auth.cjs.map +1 -1
- package/dist/api/backend-registry/auth.js +3 -9
- package/dist/api/backend-registry/auth.js.map +1 -1
- package/dist/api/backend-registry/default-backend.cjs +1 -1
- package/dist/api/backend-registry/default-backend.cjs.map +1 -1
- package/dist/api/backend-registry/default-backend.d.ts +9 -16
- package/dist/api/backend-registry/default-backend.js +5 -4
- package/dist/api/backend-registry/default-backend.js.map +1 -1
- package/dist/api/backend-registry/storage.cjs +1 -1
- package/dist/api/backend-registry/storage.cjs.map +1 -1
- package/dist/api/backend-registry/storage.js +67 -34
- package/dist/api/backend-registry/storage.js.map +1 -1
- package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
- package/dist/api/cloud/conversation-service.api.d.ts +8 -13
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/cloud/organization-service.api.cjs.map +1 -1
- package/dist/api/cloud/organization-service.api.d.ts +1 -2
- package/dist/api/cloud/organization-service.api.js.map +1 -1
- package/dist/api/cloud/proxy.cjs +1 -1
- package/dist/api/cloud/proxy.cjs.map +1 -1
- package/dist/api/cloud/proxy.d.ts +6 -6
- package/dist/api/cloud/proxy.js +33 -24
- package/dist/api/cloud/proxy.js.map +1 -1
- package/dist/api/cloud/sandbox-service.api.cjs.map +1 -1
- package/dist/api/cloud/sandbox-service.api.d.ts +3 -3
- package/dist/api/cloud/sandbox-service.api.js.map +1 -1
- package/dist/api/cloud/secrets-service.api.cjs.map +1 -1
- package/dist/api/cloud/secrets-service.api.d.ts +3 -4
- package/dist/api/cloud/secrets-service.api.js.map +1 -1
- package/dist/api/cloud/settings-service.api.cjs +1 -1
- package/dist/api/cloud/settings-service.api.cjs.map +1 -1
- package/dist/api/cloud/settings-service.api.js +5 -1
- package/dist/api/cloud/settings-service.api.js.map +1 -1
- package/dist/api/cloud/skills-service.api.cjs.map +1 -1
- package/dist/api/cloud/skills-service.api.d.ts +5 -5
- package/dist/api/cloud/skills-service.api.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +115 -108
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/device-flow-client.cjs +1 -1
- package/dist/api/device-flow-client.cjs.map +1 -1
- package/dist/api/device-flow-client.d.ts +3 -5
- package/dist/api/device-flow-client.js +55 -66
- package/dist/api/device-flow-client.js.map +1 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.cjs.map +1 -1
- package/dist/api/event-service/event-service.api.d.ts +3 -3
- package/dist/api/event-service/event-service.api.js +17 -17
- package/dist/api/event-service/event-service.api.js.map +1 -1
- package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
- package/dist/api/git-service/agent-server-git-service.api.js +11 -11
- package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
- package/dist/api/runtime-service/agent-server-runtime-service.js +6 -6
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.cjs +2 -2
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.js +10 -10
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.d.ts +5 -5
- package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
- package/dist/components/features/automations/automation-action-button-classes.d.ts +2 -2
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.d.ts +1 -0
- package/dist/components/features/backends/backend-form-modal.js +203 -140
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +117 -105
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/backends/backend-status-dot.cjs +1 -1
- package/dist/components/features/backends/backend-status-dot.cjs.map +1 -1
- package/dist/components/features/backends/backend-status-dot.d.ts +1 -1
- package/dist/components/features/backends/backend-status-dot.js +1 -1
- package/dist/components/features/backends/backend-status-dot.js.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.js +81 -70
- package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
- package/dist/components/features/chat/change-agent-button.cjs +1 -1
- package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
- package/dist/components/features/chat/change-agent-button.js +59 -57
- package/dist/components/features/chat/change-agent-button.js.map +1 -1
- package/dist/components/features/chat/change-agent-context-menu.cjs +1 -1
- package/dist/components/features/chat/change-agent-context-menu.cjs.map +1 -1
- package/dist/components/features/chat/change-agent-context-menu.d.ts +3 -1
- package/dist/components/features/chat/change-agent-context-menu.js +30 -25
- package/dist/components/features/chat/change-agent-context-menu.js.map +1 -1
- package/dist/components/features/chat/chat-add-file-button.cjs +1 -1
- package/dist/components/features/chat/chat-add-file-button.cjs.map +1 -1
- package/dist/components/features/chat/chat-add-file-button.js +39 -38
- package/dist/components/features/chat/chat-add-file-button.js.map +1 -1
- package/dist/components/features/chat/chat-message.cjs +1 -1
- package/dist/components/features/chat/chat-message.cjs.map +1 -1
- package/dist/components/features/chat/chat-message.d.ts +2 -1
- package/dist/components/features/chat/chat-message.js +185 -57
- package/dist/components/features/chat/chat-message.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +113 -113
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-model.js +52 -51
- package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
- package/dist/components/features/chat/components/slash-command-menu.cjs +2 -2
- package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
- package/dist/components/features/chat/components/slash-command-menu.js +38 -34
- package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
- package/dist/components/features/chat/git-control-bar-pr-button.cjs +1 -1
- package/dist/components/features/chat/git-control-bar-pr-button.cjs.map +1 -1
- package/dist/components/features/chat/git-control-bar-pr-button.js +16 -15
- package/dist/components/features/chat/git-control-bar-pr-button.js.map +1 -1
- package/dist/components/features/chat/git-control-bar-pull-button.cjs +1 -1
- package/dist/components/features/chat/git-control-bar-pull-button.cjs.map +1 -1
- package/dist/components/features/chat/git-control-bar-pull-button.js +16 -15
- package/dist/components/features/chat/git-control-bar-pull-button.js.map +1 -1
- package/dist/components/features/chat/git-control-bar-push-button.cjs +1 -1
- package/dist/components/features/chat/git-control-bar-push-button.cjs.map +1 -1
- package/dist/components/features/chat/git-control-bar-push-button.js +16 -15
- package/dist/components/features/chat/git-control-bar-push-button.js.map +1 -1
- package/dist/components/features/chat/git-control-bar.cjs +1 -1
- package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
- package/dist/components/features/chat/git-control-bar.js +63 -62
- package/dist/components/features/chat/git-control-bar.js.map +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
- package/dist/components/features/chat/pending-user-messages.js +27 -23
- package/dist/components/features/chat/pending-user-messages.js.map +1 -1
- package/dist/components/features/chat/switch-profile-button.cjs +1 -1
- package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
- package/dist/components/features/chat/switch-profile-button.js +26 -25
- package/dist/components/features/chat/switch-profile-button.js.map +1 -1
- package/dist/components/features/chat/switch-profile-context-menu.cjs +1 -1
- package/dist/components/features/chat/switch-profile-context-menu.cjs.map +1 -1
- package/dist/components/features/chat/switch-profile-context-menu.js +77 -67
- package/dist/components/features/chat/switch-profile-context-menu.js.map +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs.map +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text-with-description.d.ts +2 -1
- package/dist/components/features/context-menu/context-menu-icon-text-with-description.js +3 -2
- package/dist/components/features/context-menu/context-menu-icon-text-with-description.js.map +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text.cjs +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text.cjs.map +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text.d.ts +2 -1
- package/dist/components/features/context-menu/context-menu-icon-text.js +20 -10
- package/dist/components/features/context-menu/context-menu-icon-text.js.map +1 -1
- package/dist/components/features/context-menu/context-menu-list-item.cjs +1 -1
- package/dist/components/features/context-menu/context-menu-list-item.cjs.map +1 -1
- package/dist/components/features/context-menu/context-menu-list-item.js +10 -9
- package/dist/components/features/context-menu/context-menu-list-item.js.map +1 -1
- package/dist/components/features/controls/agent-status.cjs +1 -1
- package/dist/components/features/controls/agent-status.js +12 -12
- package/dist/components/features/controls/git-tools-submenu.cjs +1 -1
- package/dist/components/features/controls/git-tools-submenu.cjs.map +1 -1
- package/dist/components/features/controls/git-tools-submenu.js +1 -1
- package/dist/components/features/controls/git-tools-submenu.js.map +1 -1
- package/dist/components/features/controls/macros-submenu.cjs +1 -1
- package/dist/components/features/controls/macros-submenu.cjs.map +1 -1
- package/dist/components/features/controls/macros-submenu.js +1 -1
- package/dist/components/features/controls/macros-submenu.js.map +1 -1
- package/dist/components/features/controls/server-status-context-menu-icon-text.cjs +1 -1
- package/dist/components/features/controls/server-status-context-menu-icon-text.cjs.map +1 -1
- package/dist/components/features/controls/server-status-context-menu-icon-text.js +14 -15
- package/dist/components/features/controls/server-status-context-menu-icon-text.js.map +1 -1
- package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
- package/dist/components/features/controls/server-status-context-menu.js +4 -4
- package/dist/components/features/controls/server-status.cjs +1 -1
- package/dist/components/features/controls/server-status.js +7 -7
- package/dist/components/features/controls/tools-context-menu-icon-text.cjs +1 -1
- package/dist/components/features/controls/tools-context-menu-icon-text.cjs.map +1 -1
- package/dist/components/features/controls/tools-context-menu-icon-text.js +16 -16
- package/dist/components/features/controls/tools-context-menu-icon-text.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js +11 -11
- package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.js +11 -11
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +60 -47
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js +86 -82
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +4 -4
- 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.js +9 -9
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +93 -93
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +177 -177
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/conversation-panel/ellipsis-button.cjs +1 -1
- package/dist/components/features/conversation-panel/ellipsis-button.cjs.map +1 -1
- package/dist/components/features/conversation-panel/ellipsis-button.js +13 -13
- package/dist/components/features/conversation-panel/ellipsis-button.js.map +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.js +57 -53
- package/dist/components/features/conversation-panel/local-new-conversation-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs +1 -1
- package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs.map +1 -1
- package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js +3 -2
- package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js.map +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs.map +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js +11 -8
- package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js.map +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tab-content.cjs.map +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tab-content.d.ts +2 -5
- package/dist/components/features/conversation-panel/system-message-modal/tab-content.js.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
- package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
- package/dist/components/features/files-tab/file-content-viewer.js +45 -42
- package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
- package/dist/components/features/home/llm-not-configured-banner.d.ts +11 -0
- package/dist/components/features/home/shared/dropdown-item.cjs +1 -1
- package/dist/components/features/home/shared/dropdown-item.cjs.map +1 -1
- package/dist/components/features/home/shared/dropdown-item.js +20 -16
- package/dist/components/features/home/shared/dropdown-item.js.map +1 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.cjs +1 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.cjs.map +1 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.js +23 -22
- package/dist/components/features/home/shared/generic-dropdown-menu.js.map +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs.map +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js +103 -102
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js.map +1 -1
- package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs +1 -1
- package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs.map +1 -1
- package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js +68 -67
- package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +62 -60
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/mcp-page/index.cjs +1 -1
- package/dist/components/features/mcp-page/index.d.ts +1 -0
- package/dist/components/features/mcp-page/index.js +1 -0
- package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.js +141 -121
- package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
- package/dist/components/features/mcp-page/save-as-secret-toggle.cjs +2 -0
- package/dist/components/features/mcp-page/save-as-secret-toggle.cjs.map +1 -0
- package/dist/components/features/mcp-page/save-as-secret-toggle.d.ts +7 -0
- package/dist/components/features/mcp-page/save-as-secret-toggle.js +50 -0
- package/dist/components/features/mcp-page/save-as-secret-toggle.js.map +1 -0
- package/dist/components/features/onboarding/onboarding-modal.d.ts +2 -2
- package/dist/components/features/onboarding/steps/check-backend-step.d.ts +1 -1
- package/dist/components/features/onboarding/steps/choose-agent-step.d.ts +2 -1
- package/dist/components/features/onboarding/steps/setup-acp-secrets-step.d.ts +19 -10
- 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.d.ts +5 -0
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -0
- package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
- package/dist/components/features/skills/extensions-navigation.js +1 -1
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/components/shared/buttons/back-nav-button.cjs +2 -0
- package/dist/components/shared/buttons/back-nav-button.cjs.map +1 -0
- package/dist/components/shared/buttons/back-nav-button.d.ts +17 -0
- package/dist/components/shared/buttons/back-nav-button.js +33 -0
- package/dist/components/shared/buttons/back-nav-button.js.map +1 -0
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.js +5 -5
- package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
- package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
- package/dist/components/shared/filters/enum-filter-dropdown.js +32 -31
- package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.js +14 -13
- package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
- package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
- package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
- package/dist/components/shared/modals/settings/settings-modal.js +17 -16
- package/dist/components/shared/modals/settings/settings-modal.js.map +1 -1
- package/dist/components/shared/text-shimmer.cjs +2 -0
- package/dist/components/shared/text-shimmer.cjs.map +1 -0
- package/dist/components/shared/text-shimmer.d.ts +11 -0
- package/dist/components/shared/text-shimmer.js +43 -0
- package/dist/components/shared/text-shimmer.js.map +1 -0
- package/dist/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +16 -3
- package/dist/constants/acp-providers.js +0 -1
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/contexts/active-backend-context.cjs +1 -1
- package/dist/contexts/active-backend-context.cjs.map +1 -1
- package/dist/contexts/active-backend-context.js +32 -32
- package/dist/contexts/active-backend-context.js.map +1 -1
- package/dist/hooks/chat/use-chat-input-logic.cjs +1 -1
- package/dist/hooks/chat/use-chat-input-logic.cjs.map +1 -1
- package/dist/hooks/chat/use-chat-input-logic.js +13 -6
- package/dist/hooks/chat/use-chat-input-logic.js.map +1 -1
- package/dist/hooks/mutation/use-save-fields-as-secrets.cjs +2 -0
- package/dist/hooks/mutation/use-save-fields-as-secrets.cjs.map +1 -0
- package/dist/hooks/mutation/use-save-fields-as-secrets.d.ts +9 -0
- package/dist/hooks/mutation/use-save-fields-as-secrets.js +24 -0
- package/dist/hooks/mutation/use-save-fields-as-secrets.js.map +1 -0
- package/dist/hooks/mutation/use-unified-start-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-unified-start-conversation.js +8 -8
- package/dist/hooks/mutation/use-unified-stop-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-unified-stop-conversation.js +15 -15
- package/dist/hooks/query/use-acp-auth-status.d.ts +36 -0
- package/dist/hooks/query/use-agent-settings-schema.cjs +1 -1
- package/dist/hooks/query/use-agent-settings-schema.cjs.map +1 -1
- package/dist/hooks/query/use-agent-settings-schema.js +26 -16
- package/dist/hooks/query/use-agent-settings-schema.js.map +1 -1
- package/dist/hooks/query/use-backends-health.cjs +1 -1
- package/dist/hooks/query/use-backends-health.cjs.map +1 -1
- package/dist/hooks/query/use-backends-health.d.ts +2 -0
- package/dist/hooks/query/use-backends-health.js +31 -21
- package/dist/hooks/query/use-backends-health.js.map +1 -1
- package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
- package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
- package/dist/hooks/query/use-paginated-conversations.js +15 -14
- package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
- package/dist/hooks/query/use-settings.cjs +1 -1
- package/dist/hooks/query/use-settings.cjs.map +1 -1
- package/dist/hooks/query/use-settings.js +65 -52
- package/dist/hooks/query/use-settings.js.map +1 -1
- package/dist/hooks/query/use-user-conversation.cjs +1 -1
- package/dist/hooks/query/use-user-conversation.cjs.map +1 -1
- package/dist/hooks/query/use-user-conversation.js +20 -11
- package/dist/hooks/query/use-user-conversation.js.map +1 -1
- package/dist/hooks/use-agent-state.cjs +1 -1
- package/dist/hooks/use-agent-state.js +13 -13
- package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
- package/dist/hooks/use-conversation-name-context-menu.js +10 -10
- package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
- package/dist/hooks/use-llm-configured.d.ts +25 -0
- package/dist/hooks/use-runtime-is-ready.cjs +1 -1
- package/dist/hooks/use-runtime-is-ready.js +5 -5
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +19 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +3 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +321 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/stop-circle.cjs +1 -1
- package/dist/icons/stop-circle.cjs.map +1 -1
- package/dist/icons/stop-circle.js +7 -10
- package/dist/icons/stop-circle.js.map +1 -1
- package/dist/locales/ar/openhands.json +20 -2
- package/dist/locales/ca/openhands.json +20 -2
- package/dist/locales/de/openhands.json +20 -2
- package/dist/locales/en/openhands.json +20 -2
- package/dist/locales/es/openhands.json +20 -2
- package/dist/locales/fr/openhands.json +20 -2
- package/dist/locales/it/openhands.json +20 -2
- package/dist/locales/ja/openhands.json +20 -2
- package/dist/locales/ko-KR/openhands.json +20 -2
- package/dist/locales/no/openhands.json +20 -2
- package/dist/locales/pt/openhands.json +20 -2
- package/dist/locales/tr/openhands.json +20 -2
- package/dist/locales/uk/openhands.json +20 -2
- package/dist/locales/zh-CN/openhands.json +20 -2
- package/dist/locales/zh-TW/openhands.json +20 -2
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs +2 -0
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs.map +1 -0
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/routes/conversation.cjs +1 -1
- package/dist/routes/conversation.cjs.map +1 -1
- package/dist/routes/conversation.js +1 -1
- package/dist/routes/conversation.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 +55 -54
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/routes/secrets-settings.cjs +1 -1
- package/dist/routes/secrets-settings.cjs.map +1 -1
- package/dist/routes/secrets-settings.js +19 -27
- package/dist/routes/secrets-settings.js.map +1 -1
- package/dist/stores/conversation-store.cjs +1 -1
- package/dist/stores/conversation-store.cjs.map +1 -1
- package/dist/stores/conversation-store.d.ts +4 -0
- package/dist/stores/conversation-store.js +6 -0
- package/dist/stores/conversation-store.js.map +1 -1
- package/dist/types/agent-server/core/events/acp-tool-call-event.d.ts +6 -4
- package/dist/types/agent-server/core/events/system-event.d.ts +5 -0
- package/dist/types/automation.d.ts +15 -0
- package/dist/types/settings.d.ts +3 -1
- package/dist/ui/combobox-caret.cjs +1 -1
- package/dist/ui/combobox-caret.cjs.map +1 -1
- package/dist/ui/combobox-caret.d.ts +1 -1
- package/dist/ui/combobox-caret.js +9 -8
- package/dist/ui/combobox-caret.js.map +1 -1
- package/dist/ui/context-menu.cjs +1 -1
- package/dist/ui/context-menu.cjs.map +1 -1
- package/dist/ui/context-menu.js +9 -8
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/dropdown/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown/dropdown-menu.cjs.map +1 -1
- package/dist/ui/dropdown/dropdown-menu.js +21 -17
- package/dist/ui/dropdown/dropdown-menu.js.map +1 -1
- package/dist/ui/dropdown/dropdown.cjs +1 -1
- package/dist/ui/dropdown/dropdown.cjs.map +1 -1
- package/dist/ui/dropdown/dropdown.js +2 -2
- package/dist/ui/dropdown/dropdown.js.map +1 -1
- package/dist/utils/automation-schedule.d.ts +1 -0
- package/dist/utils/dropdown-classes.cjs +2 -0
- package/dist/utils/dropdown-classes.cjs.map +1 -0
- package/dist/utils/dropdown-classes.d.ts +32 -0
- package/dist/utils/dropdown-classes.js +8 -0
- package/dist/utils/dropdown-classes.js.map +1 -0
- package/dist/utils/form-control-classes.cjs +1 -1
- package/dist/utils/form-control-classes.cjs.map +1 -1
- package/dist/utils/form-control-classes.d.ts +18 -2
- package/dist/utils/form-control-classes.js +4 -3
- package/dist/utils/form-control-classes.js.map +1 -1
- package/dist/utils/git-control-bar-classes.cjs +2 -0
- package/dist/utils/git-control-bar-classes.cjs.map +1 -0
- package/dist/utils/git-control-bar-classes.d.ts +4 -0
- package/dist/utils/git-control-bar-classes.js +14 -0
- package/dist/utils/git-control-bar-classes.js.map +1 -0
- package/dist/utils/handle-event-for-ui.cjs.map +1 -1
- package/dist/utils/handle-event-for-ui.d.ts +6 -3
- package/dist/utils/handle-event-for-ui.js.map +1 -1
- package/dist/utils/mobile-top-bar-icon-button-classes.cjs +1 -1
- package/dist/utils/mobile-top-bar-icon-button-classes.cjs.map +1 -1
- package/dist/utils/mobile-top-bar-icon-button-classes.js +3 -3
- package/dist/utils/mobile-top-bar-icon-button-classes.js.map +1 -1
- package/dist/utils/modal-classes.cjs +2 -0
- package/dist/utils/modal-classes.cjs.map +1 -0
- package/dist/utils/modal-classes.d.ts +8 -0
- package/dist/utils/modal-classes.js +7 -0
- package/dist/utils/modal-classes.js.map +1 -0
- package/dist/utils/openhands-llm.cjs +2 -0
- package/dist/utils/openhands-llm.cjs.map +1 -0
- package/dist/utils/openhands-llm.d.ts +2 -0
- package/dist/utils/openhands-llm.js +9 -0
- package/dist/utils/openhands-llm.js.map +1 -0
- package/dist/utils/redact-custom-secrets.cjs +2 -0
- package/dist/utils/redact-custom-secrets.cjs.map +1 -0
- package/dist/utils/redact-custom-secrets.d.ts +6 -0
- package/dist/utils/redact-custom-secrets.js +10 -0
- package/dist/utils/redact-custom-secrets.js.map +1 -0
- package/dist/utils/status.cjs +1 -1
- package/dist/utils/status.cjs.map +1 -1
- package/dist/utils/status.d.ts +2 -1
- package/dist/utils/status.js +9 -8
- package/dist/utils/status.js.map +1 -1
- package/dist/utils/system-message-adapter.cjs +1 -1
- package/dist/utils/system-message-adapter.cjs.map +1 -1
- package/dist/utils/system-message-adapter.js +10 -7
- package/dist/utils/system-message-adapter.js.map +1 -1
- package/dist/utils/utils.cjs +1 -1
- package/dist/utils/utils.cjs.map +1 -1
- package/dist/utils/utils.d.ts +2 -1
- package/dist/utils/utils.js +21 -20
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -1
- package/scripts/dev-safe.mjs +3 -1
- package/scripts/dev-static.mjs +2 -2
- package/scripts/dev-with-automation.mjs +283 -108
- package/scripts/static-build.mjs +20 -19
- package/scripts/static-server.mjs +65 -6
- package/build/assets/acp-providers-CbiRekh9.js +0 -1
- package/build/assets/active-backend-context-cCM1vYYZ.js +0 -1
- package/build/assets/add-backend-modal-DIUQzMPa.js +0 -1
- package/build/assets/agent-server-client-options-Bc5ZorQZ.js +0 -1
- package/build/assets/agent-server-compatibility-BlkUsrX2.js +0 -1
- package/build/assets/agent-server-conversation-service.api-C2V5SlHu.js +0 -5
- package/build/assets/api-key-entry-screen-B2gynaCp.js +0 -1
- package/build/assets/automation-detail-DJvbVSYK.js +0 -1
- package/build/assets/automations-list-6FDbI5dc.js +0 -1
- package/build/assets/backend-form-modal-Dnk33xA_.js +0 -1
- package/build/assets/base-modal-_dYTw1ri.js +0 -1
- package/build/assets/brand-button-Br7f0kZJ.js +0 -1
- package/build/assets/browser-store-Couc4S5D.js +0 -1
- package/build/assets/clock-BRjCgHTc.js +0 -1
- package/build/assets/combobox-caret-to1O8irE.js +0 -1
- package/build/assets/context-menu-list-item-CWNFpuiC.js +0 -1
- package/build/assets/conversation-DVrKU0oz.js +0 -19
- package/build/assets/conversation-Dlys-D5A.js +0 -1
- package/build/assets/conversation-panel-iF09WjZ4.js +0 -1
- package/build/assets/conversation-service.api-CCfztilW.js +0 -1
- package/build/assets/conversation-state-store-u5jepov0.js +0 -1
- package/build/assets/conversation-store-Z5iMCRpc.js +0 -1
- package/build/assets/conversation-websocket-context-DhJhqUna.js +0 -3
- package/build/assets/declaration-BNMqORFE.js +0 -1
- package/build/assets/dist-BxBP7tFD.js +0 -1
- package/build/assets/edit-automation-modal-BGzR3nfZ.js +0 -1
- package/build/assets/ellipsis-button-ZyLMPURn.js +0 -1
- package/build/assets/entry.client-1VMHpktY.js +0 -2
- package/build/assets/enum-filter-dropdown-CEgCdu4A.js +0 -1
- package/build/assets/extensions-hub-C651jsVh.js +0 -1
- package/build/assets/files-tab-R5z0lLdY.js +0 -1
- package/build/assets/files-tab-store-CDyVTXNT.js +0 -1
- package/build/assets/git-control-bar-branch-button-COdRAYHb.js +0 -27
- package/build/assets/git-provider-icon-BzLbc0yC.js +0 -1
- package/build/assets/home-e-egNUXZ.js +0 -1
- package/build/assets/install-server-modal-DHlbgqVH.js +0 -1
- package/build/assets/launch-CshDse3e.js +0 -1
- package/build/assets/link-external-D2POYx4c.js +0 -1
- package/build/assets/llm-settings-Bql-vydt.js +0 -1
- package/build/assets/llm-settings-C_tal6Ds.js +0 -1
- package/build/assets/manage-backends-modal-l7RkKfwX.js +0 -1
- package/build/assets/manage-workspaces-modal-DhKF_8z3.js +0 -1
- package/build/assets/manifest-3bf30d69.js +0 -1
- package/build/assets/mcp-ByeBfdfU.js +0 -9
- package/build/assets/messages-D0rWot7s.js +0 -36
- package/build/assets/proxy-CxydCnis.js +0 -1
- package/build/assets/root-DHeCXo9N.css +0 -1
- package/build/assets/root-layout-Czo9Ma6Q.js +0 -2
- package/build/assets/secrets-service-BsnKFc2x.js +0 -1
- package/build/assets/secrets-settings-Bz_UohPJ.js +0 -1
- package/build/assets/settings-client-C73C7IgV.js +0 -1
- package/build/assets/settings-index-Dz0BmdJD.js +0 -1
- package/build/assets/settings-list-classes-Bf80tWtc.js +0 -1
- package/build/assets/settings-modal-Brzgh5Yw.js +0 -1
- package/build/assets/settings-service.api-CZ3uWx4v.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-Do_aA9Zm.js +0 -1
- package/build/assets/skills-settings-DlA5hlXw.js +0 -2
- package/build/assets/status-hp6M6E7E.js +0 -1
- package/build/assets/use-agent-settings-schema-33Un7UF2.js +0 -1
- package/build/assets/use-is-authed-BggE5wPj.js +0 -1
- package/build/assets/use-llm-profiles-DDOol3gK.js +0 -1
- package/build/assets/use-runtime-is-ready-B7EF4BKU.js +0 -1
- package/build/assets/use-settings-DQIZmIov.js +0 -1
- package/build/assets/use-user-conversation-C6hrMMtn.js +0 -1
- package/build/assets/utils-i18rdUj2.js +0 -1
- package/build/assets/vendor~conversation-panel~conversation-a9SyrrhV.js +0 -1
- package/build/assets/vendor~conversation-panel~conversation~index-C23ZXO4R.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-BebWhFNT.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DzIXV3Ui.js +0 -9
- /package/build/assets/{automation-IdgZq6ZK.js → automation-XDPAjiZi.js} +0 -0
- /package/build/assets/{color-themes-DSaoIL6A.js → color-themes-B9pm9c-R.js} +0 -0
- /package/build/assets/{common-DR1t-EeP.js → common-DqjLSBOt.js} +0 -0
- /package/build/assets/{conversation-local-storage-UYl-SX-r.js → conversation-local-storage-YmOVXxxW.js} +0 -0
- /package/build/assets/{dist-C6t0EXL7.js → dist-C3NfioQC.js} +0 -0
- /package/build/assets/{environment-switch-store-C4ulFJKp.js → environment-switch-store-CiurvTtK.js} +0 -0
- /package/build/assets/{health-store-BDC2rM-X.js → health-store-B5f0S2FY.js} +0 -0
- /package/build/assets/{map-provider-COBVzZYo.js → map-provider-BJ_8KZKU.js} +0 -0
- /package/build/assets/{middleware-BC9EwbB9.js → middleware-CfatjPYZ.js} +0 -0
- /package/build/assets/{objectWithoutPropertiesLoose-Du6eBn-V.js → objectWithoutPropertiesLoose-DSQKyRhw.js} +0 -0
- /package/build/assets/{react-Do0CT17Y.js → react-Dy05vyj5.js} +0 -0
- /package/build/assets/{sdk-settings-field-metadata-CBPmeqYa.js → sdk-settings-field-metadata-DQiaIBie.js} +0 -0
- /package/build/assets/{settings-D_H-qsRm.js → settings-DGY6n4J2.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-I0BDBEoq.js → settings-like-page-layout-classes-D7YjdTd0.js} +0 -0
- /package/build/assets/{use-breakpoint-DbJ6FkQ-.js → use-breakpoint-DF_RiQ6s.js} +0 -0
- /package/build/assets/{use-click-outside-element-DffgWWoZ.js → use-click-outside-element-DhxCUyWl.js} +0 -0
- /package/build/assets/{v4-CNn21NXa.js → v4-khGvL7i2.js} +0 -0
- /package/build/assets/{vendor~browser-DDiZgqD3.js → vendor~browser-DisFGEp9.js} +0 -0
- /package/build/assets/{vendor~browser-tab-BgwV1mxF.js → vendor~browser-tab-BxhTtM9_.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DbvX3OcM.js → vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js} +0 -0
- /package/build/assets/{vendor~files-tab-BGKayPiK.js → vendor~files-tab-BtkpAiMX.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BW6261Sb.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CyZ-3lDQ.js} +0 -0
- /package/build/assets/{vendor~home~mcp~automations-list-DoPfwaXj.js → vendor~home~mcp~automations-list-BgV86Sti.js} +0 -0
- /package/build/assets/{vendor~launch-vdeRTWFu.js → vendor~launch-BXgl67Re.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js} +0 -0
- /package/build/assets/{vendor~terminal-DUrOWGFE.js → vendor~terminal-DZaJIY8A.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact-custom-secrets.js","names":[],"sources":["../../src/utils/redact-custom-secrets.ts"],"sourcesContent":["const MASKED_PLACEHOLDER = \"<secret-hidden>\";\n\n/**\n * Defensive backstop: redact any unmasked value inside a `<CUSTOM_SECRETS>`\n * block before showing dynamic context in the UI, in case backend masking\n * regresses. Text outside the block is untouched.\n */\nexport function redactCustomSecrets(text: string): string {\n // Regexes are local: the `g` flag makes them stateful, and keeping them\n // scoped to this call avoids cross-call `lastIndex` surprises.\n\n // Closing tag is optional so a truncated block is still redacted, not leaked.\n const customSecretsBlock =\n /(<CUSTOM_SECRETS>)([\\s\\S]*?)(<\\/CUSTOM_SECRETS>|$)/gi;\n\n // `KEY: value` / `KEY=value`, capturing key + separator so only the value changes.\n const secretLine = /^(\\s*[^=:\\n]+?\\s*[:=]\\s*)(.+?)\\s*$/gm;\n\n return text.replace(\n customSecretsBlock,\n (_match, open: string, body: string, close: string) => {\n const redactedBody = body.replace(\n secretLine,\n (lineMatch, prefix: string, value: string) =>\n value === MASKED_PLACEHOLDER\n ? lineMatch\n : `${prefix}${MASKED_PLACEHOLDER}`,\n );\n return `${open}${redactedBody}${close}`;\n },\n );\n}\n"],"mappings":";AAAA,IAAM,IAAqB;AAO3B,SAAgB,EAAoB,GAAsB;CAKxD,IAAM,IACJ,wDAGI,IAAa;AAEnB,QAAO,EAAK,QACV,IACC,GAAQ,GAAc,GAAc,MAQ5B,GAAG,IAPW,EAAK,QACxB,IACC,GAAW,GAAgB,MAC1B,MAAU,IACN,IACA,GAAG,IAAS,IAEH,GAAe,IAEnC"}
|
package/dist/utils/status.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../i18n/declaration.cjs`),t=require(`../types/agent-server/core/base/common.cjs`);var n=new Set([t.ExecutionStatus.IDLE,t.ExecutionStatus.RUNNING,t.ExecutionStatus.WAITING_FOR_CONFIRMATION,t.ExecutionStatus.FINISHED]);function r(e){return!!e&&n.has(e)}function i(e){return e===t.ExecutionStatus.PAUSED}function a(e){return e===t.ExecutionStatus.ERROR||e===t.ExecutionStatus.STUCK}function o(
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../i18n/declaration.cjs`),t=require(`../types/agent-server/core/base/common.cjs`);var n=new Set([t.ExecutionStatus.IDLE,t.ExecutionStatus.RUNNING,t.ExecutionStatus.WAITING_FOR_CONFIRMATION,t.ExecutionStatus.FINISHED]);function r(e){return!!e&&n.has(e)}function i(e){return e===t.ExecutionStatus.PAUSED}function a(e){return e===t.ExecutionStatus.ERROR||e===t.ExecutionStatus.STUCK}function o(t){switch(t){case`WAITING_FOR_SANDBOX`:return e.I18nKey.COMMON$WAITING_FOR_SANDBOX;case`SETTING_UP_GIT_HOOKS`:return e.I18nKey.STATUS$SETTING_UP_GIT_HOOKS;case`SETTING_UP_SKILLS`:return e.I18nKey.STATUS$SETTING_UP_SKILLS;case`READY`:return e.I18nKey.CONVERSATION$READY;case`ERROR`:return e.I18nKey.COMMON$ERROR;default:return e.I18nKey.CONVERSATION$STARTING_CONVERSATION}}function s(n,r,i,a){if(i===`ERROR`||a===`ERROR`||r===`error`)return e.I18nKey.AGENT_STATUS$ERROR_OCCURRED;if(i&&i!==`READY`)return o(i);if(r===t.ExecutionStatus.PAUSED)return e.I18nKey.CHAT_INTERFACE$STOPPED;if(n&&n!==`OPEN`)switch(n){case`CLOSED`:case`CLOSING`:return e.I18nKey.CHAT_INTERFACE$DISCONNECTED;case`CONNECTING`:return e.I18nKey.CHAT_INTERFACE$CONNECTING;default:throw Error(`Unknown WebsocketConnectionState: ${n}`)}if(r&&r!==t.ExecutionStatus.STUCK)switch(r){case t.ExecutionStatus.IDLE:return e.I18nKey.AGENT_STATUS$WAITING_FOR_TASK;case t.ExecutionStatus.RUNNING:return e.I18nKey.AGENT_STATUS$RUNNING_TASK;case t.ExecutionStatus.WAITING_FOR_CONFIRMATION:return e.I18nKey.AGENT_STATUS$WAITING_FOR_USER_CONFIRMATION;case t.ExecutionStatus.FINISHED:return e.I18nKey.CHAT_INTERFACE$AGENT_FINISHED_MESSAGE;default:throw Error(`Unknown executionStatus: ${r}`)}return e.I18nKey.CHAT_INTERFACE$AGENT_ERROR_MESSAGE}exports.getStatusCode=s,exports.getTaskStatusI18nKey=o,exports.isExecutionActive=r,exports.isExecutionErrored=a,exports.isExecutionPaused=i;
|
|
2
2
|
//# sourceMappingURL=status.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.cjs","names":[],"sources":["../../src/utils/status.ts"],"sourcesContent":["import { I18nKey } from \"#/i18n/declaration\";\nimport { AppConversationStartTaskStatus } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { WebSocketConnectionState } from \"#/contexts/conversation-websocket-context\";\n\nconst ACTIVE_EXECUTION_STATUSES: ReadonlySet<ExecutionStatus> = new Set([\n ExecutionStatus.IDLE,\n ExecutionStatus.RUNNING,\n ExecutionStatus.WAITING_FOR_CONFIRMATION,\n ExecutionStatus.FINISHED,\n]);\n\nexport function isExecutionActive(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return !!status && ACTIVE_EXECUTION_STATUSES.has(status);\n}\n\nexport function isExecutionPaused(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.PAUSED;\n}\n\nexport function isExecutionErrored(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.ERROR || status === ExecutionStatus.STUCK;\n}\n\nexport function
|
|
1
|
+
{"version":3,"file":"status.cjs","names":[],"sources":["../../src/utils/status.ts"],"sourcesContent":["import { I18nKey } from \"#/i18n/declaration\";\nimport { AppConversationStartTaskStatus } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { WebSocketConnectionState } from \"#/contexts/conversation-websocket-context\";\n\nconst ACTIVE_EXECUTION_STATUSES: ReadonlySet<ExecutionStatus> = new Set([\n ExecutionStatus.IDLE,\n ExecutionStatus.RUNNING,\n ExecutionStatus.WAITING_FOR_CONFIRMATION,\n ExecutionStatus.FINISHED,\n]);\n\nexport function isExecutionActive(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return !!status && ACTIVE_EXECUTION_STATUSES.has(status);\n}\n\nexport function isExecutionPaused(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.PAUSED;\n}\n\nexport function isExecutionErrored(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.ERROR || status === ExecutionStatus.STUCK;\n}\n\nexport function getTaskStatusI18nKey(\n taskStatus: AppConversationStartTaskStatus,\n): I18nKey {\n switch (taskStatus) {\n case \"WAITING_FOR_SANDBOX\":\n return I18nKey.COMMON$WAITING_FOR_SANDBOX;\n case \"SETTING_UP_GIT_HOOKS\":\n return I18nKey.STATUS$SETTING_UP_GIT_HOOKS;\n case \"SETTING_UP_SKILLS\":\n return I18nKey.STATUS$SETTING_UP_SKILLS;\n // Terminal states map to their own localized keys so any caller that\n // delegates here (now or in the future) gets a correct label instead of\n // silently falling through to STARTING_CONVERSATION. Callers that need a\n // context-specific terminal label (e.g. getStatusCode's\n // AGENT_STATUS$ERROR_OCCURRED, or getStatusText's taskDetail precedence)\n // still handle these states before delegating.\n case \"READY\":\n return I18nKey.CONVERSATION$READY;\n case \"ERROR\":\n return I18nKey.COMMON$ERROR;\n // These collapse to the generic \"Starting\" label. `default` is unreachable\n // for the typed union but is kept as a runtime safety net: the start-task\n // API may report a new status before this enum is updated, in which case we\n // degrade to \"Starting\" rather than throwing (see FUTURE_STATUS_FROM_CLOUD).\n case \"STARTING_CONVERSATION\":\n case \"WORKING\":\n case \"PREPARING_REPOSITORY\":\n case \"RUNNING_SETUP_SCRIPT\":\n default:\n return I18nKey.CONVERSATION$STARTING_CONVERSATION;\n }\n}\n\nexport function getStatusCode(\n webSocketConnectionState: WebSocketConnectionState,\n executionStatus: ExecutionStatus | null,\n taskStatus?: AppConversationStartTaskStatus | null,\n subConversationTaskStatus?: AppConversationStartTaskStatus | null,\n) {\n if (\n taskStatus === \"ERROR\" ||\n subConversationTaskStatus === \"ERROR\" ||\n executionStatus === \"error\"\n ) {\n return I18nKey.AGENT_STATUS$ERROR_OCCURRED;\n }\n\n if (taskStatus && taskStatus !== \"READY\") {\n return getTaskStatusI18nKey(taskStatus);\n }\n\n if (executionStatus === ExecutionStatus.PAUSED) {\n return I18nKey.CHAT_INTERFACE$STOPPED;\n }\n\n // Websocket has disconnected...\n if (webSocketConnectionState && webSocketConnectionState !== \"OPEN\") {\n switch (webSocketConnectionState) {\n case \"CLOSED\":\n case \"CLOSING\":\n return I18nKey.CHAT_INTERFACE$DISCONNECTED;\n case \"CONNECTING\":\n return I18nKey.CHAT_INTERFACE$CONNECTING;\n default:\n throw new Error(\n `Unknown WebsocketConnectionState: ${webSocketConnectionState}`,\n );\n }\n }\n\n if (executionStatus && executionStatus !== ExecutionStatus.STUCK) {\n switch (executionStatus) {\n case ExecutionStatus.IDLE:\n return I18nKey.AGENT_STATUS$WAITING_FOR_TASK;\n case ExecutionStatus.RUNNING:\n return I18nKey.AGENT_STATUS$RUNNING_TASK;\n case ExecutionStatus.WAITING_FOR_CONFIRMATION:\n return I18nKey.AGENT_STATUS$WAITING_FOR_USER_CONFIRMATION;\n case ExecutionStatus.FINISHED:\n return I18nKey.CHAT_INTERFACE$AGENT_FINISHED_MESSAGE;\n default:\n throw new Error(`Unknown executionStatus: ${executionStatus}`);\n }\n }\n\n return I18nKey.CHAT_INTERFACE$AGENT_ERROR_MESSAGE;\n}\n"],"mappings":"gJAKA,IAAM,EAA0D,IAAI,IAAI,CACtE,EAAA,gBAAgB,KAChB,EAAA,gBAAgB,QAChB,EAAA,gBAAgB,yBAChB,EAAA,gBAAgB,SACjB,CAAC,CAEF,SAAgB,EACd,EACS,CACT,MAAO,CAAC,CAAC,GAAU,EAA0B,IAAI,EAAO,CAG1D,SAAgB,EACd,EACS,CACT,OAAO,IAAW,EAAA,gBAAgB,OAGpC,SAAgB,EACd,EACS,CACT,OAAO,IAAW,EAAA,gBAAgB,OAAS,IAAW,EAAA,gBAAgB,MAGxE,SAAgB,EACd,EACS,CACT,OAAQ,EAAR,CACE,IAAK,sBACH,OAAO,EAAA,QAAQ,2BACjB,IAAK,uBACH,OAAO,EAAA,QAAQ,4BACjB,IAAK,oBACH,OAAO,EAAA,QAAQ,yBAOjB,IAAK,QACH,OAAO,EAAA,QAAQ,mBACjB,IAAK,QACH,OAAO,EAAA,QAAQ,aASjB,QACE,OAAO,EAAA,QAAQ,oCAIrB,SAAgB,EACd,EACA,EACA,EACA,EACA,CACA,GACE,IAAe,SACf,IAA8B,SAC9B,IAAoB,QAEpB,OAAO,EAAA,QAAQ,4BAGjB,GAAI,GAAc,IAAe,QAC/B,OAAO,EAAqB,EAAW,CAGzC,GAAI,IAAoB,EAAA,gBAAgB,OACtC,OAAO,EAAA,QAAQ,uBAIjB,GAAI,GAA4B,IAA6B,OAC3D,OAAQ,EAAR,CACE,IAAK,SACL,IAAK,UACH,OAAO,EAAA,QAAQ,4BACjB,IAAK,aACH,OAAO,EAAA,QAAQ,0BACjB,QACE,MAAU,MACR,qCAAqC,IACtC,CAIP,GAAI,GAAmB,IAAoB,EAAA,gBAAgB,MACzD,OAAQ,EAAR,CACE,KAAK,EAAA,gBAAgB,KACnB,OAAO,EAAA,QAAQ,8BACjB,KAAK,EAAA,gBAAgB,QACnB,OAAO,EAAA,QAAQ,0BACjB,KAAK,EAAA,gBAAgB,yBACnB,OAAO,EAAA,QAAQ,2CACjB,KAAK,EAAA,gBAAgB,SACnB,OAAO,EAAA,QAAQ,sCACjB,QACE,MAAU,MAAM,4BAA4B,IAAkB,CAIpE,OAAO,EAAA,QAAQ"}
|
package/dist/utils/status.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ import { WebSocketConnectionState } from "#/contexts/conversation-websocket-cont
|
|
|
5
5
|
export declare function isExecutionActive(status: ExecutionStatus | null | undefined): boolean;
|
|
6
6
|
export declare function isExecutionPaused(status: ExecutionStatus | null | undefined): boolean;
|
|
7
7
|
export declare function isExecutionErrored(status: ExecutionStatus | null | undefined): boolean;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function getTaskStatusI18nKey(taskStatus: AppConversationStartTaskStatus): I18nKey;
|
|
9
|
+
export declare function getStatusCode(webSocketConnectionState: WebSocketConnectionState, executionStatus: ExecutionStatus | null, taskStatus?: AppConversationStartTaskStatus | null, subConversationTaskStatus?: AppConversationStartTaskStatus | null): I18nKey;
|
package/dist/utils/status.js
CHANGED
|
@@ -16,18 +16,19 @@ function i(e) {
|
|
|
16
16
|
function a(e) {
|
|
17
17
|
return e === t.ERROR || e === t.STUCK;
|
|
18
18
|
}
|
|
19
|
-
function o(
|
|
20
|
-
|
|
21
|
-
if (i && i !== "READY") switch (i) {
|
|
19
|
+
function o(t) {
|
|
20
|
+
switch (t) {
|
|
22
21
|
case "WAITING_FOR_SANDBOX": return e.COMMON$WAITING_FOR_SANDBOX;
|
|
23
22
|
case "SETTING_UP_GIT_HOOKS": return e.STATUS$SETTING_UP_GIT_HOOKS;
|
|
24
23
|
case "SETTING_UP_SKILLS": return e.STATUS$SETTING_UP_SKILLS;
|
|
25
|
-
case "
|
|
26
|
-
case "
|
|
27
|
-
case "PREPARING_REPOSITORY":
|
|
28
|
-
case "RUNNING_SETUP_SCRIPT": return e.CONVERSATION$STARTING_CONVERSATION;
|
|
24
|
+
case "READY": return e.CONVERSATION$READY;
|
|
25
|
+
case "ERROR": return e.COMMON$ERROR;
|
|
29
26
|
default: return e.CONVERSATION$STARTING_CONVERSATION;
|
|
30
27
|
}
|
|
28
|
+
}
|
|
29
|
+
function s(n, r, i, a) {
|
|
30
|
+
if (i === "ERROR" || a === "ERROR" || r === "error") return e.AGENT_STATUS$ERROR_OCCURRED;
|
|
31
|
+
if (i && i !== "READY") return o(i);
|
|
31
32
|
if (r === t.PAUSED) return e.CHAT_INTERFACE$STOPPED;
|
|
32
33
|
if (n && n !== "OPEN") switch (n) {
|
|
33
34
|
case "CLOSED":
|
|
@@ -45,6 +46,6 @@ function o(n, r, i, a) {
|
|
|
45
46
|
return e.CHAT_INTERFACE$AGENT_ERROR_MESSAGE;
|
|
46
47
|
}
|
|
47
48
|
//#endregion
|
|
48
|
-
export {
|
|
49
|
+
export { s as getStatusCode, o as getTaskStatusI18nKey, r as isExecutionActive, a as isExecutionErrored, i as isExecutionPaused };
|
|
49
50
|
|
|
50
51
|
//# sourceMappingURL=status.js.map
|
package/dist/utils/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","names":[],"sources":["../../src/utils/status.ts"],"sourcesContent":["import { I18nKey } from \"#/i18n/declaration\";\nimport { AppConversationStartTaskStatus } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { WebSocketConnectionState } from \"#/contexts/conversation-websocket-context\";\n\nconst ACTIVE_EXECUTION_STATUSES: ReadonlySet<ExecutionStatus> = new Set([\n ExecutionStatus.IDLE,\n ExecutionStatus.RUNNING,\n ExecutionStatus.WAITING_FOR_CONFIRMATION,\n ExecutionStatus.FINISHED,\n]);\n\nexport function isExecutionActive(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return !!status && ACTIVE_EXECUTION_STATUSES.has(status);\n}\n\nexport function isExecutionPaused(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.PAUSED;\n}\n\nexport function isExecutionErrored(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.ERROR || status === ExecutionStatus.STUCK;\n}\n\nexport function
|
|
1
|
+
{"version":3,"file":"status.js","names":[],"sources":["../../src/utils/status.ts"],"sourcesContent":["import { I18nKey } from \"#/i18n/declaration\";\nimport { AppConversationStartTaskStatus } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { ExecutionStatus } from \"#/types/agent-server/core/base/common\";\nimport { WebSocketConnectionState } from \"#/contexts/conversation-websocket-context\";\n\nconst ACTIVE_EXECUTION_STATUSES: ReadonlySet<ExecutionStatus> = new Set([\n ExecutionStatus.IDLE,\n ExecutionStatus.RUNNING,\n ExecutionStatus.WAITING_FOR_CONFIRMATION,\n ExecutionStatus.FINISHED,\n]);\n\nexport function isExecutionActive(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return !!status && ACTIVE_EXECUTION_STATUSES.has(status);\n}\n\nexport function isExecutionPaused(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.PAUSED;\n}\n\nexport function isExecutionErrored(\n status: ExecutionStatus | null | undefined,\n): boolean {\n return status === ExecutionStatus.ERROR || status === ExecutionStatus.STUCK;\n}\n\nexport function getTaskStatusI18nKey(\n taskStatus: AppConversationStartTaskStatus,\n): I18nKey {\n switch (taskStatus) {\n case \"WAITING_FOR_SANDBOX\":\n return I18nKey.COMMON$WAITING_FOR_SANDBOX;\n case \"SETTING_UP_GIT_HOOKS\":\n return I18nKey.STATUS$SETTING_UP_GIT_HOOKS;\n case \"SETTING_UP_SKILLS\":\n return I18nKey.STATUS$SETTING_UP_SKILLS;\n // Terminal states map to their own localized keys so any caller that\n // delegates here (now or in the future) gets a correct label instead of\n // silently falling through to STARTING_CONVERSATION. Callers that need a\n // context-specific terminal label (e.g. getStatusCode's\n // AGENT_STATUS$ERROR_OCCURRED, or getStatusText's taskDetail precedence)\n // still handle these states before delegating.\n case \"READY\":\n return I18nKey.CONVERSATION$READY;\n case \"ERROR\":\n return I18nKey.COMMON$ERROR;\n // These collapse to the generic \"Starting\" label. `default` is unreachable\n // for the typed union but is kept as a runtime safety net: the start-task\n // API may report a new status before this enum is updated, in which case we\n // degrade to \"Starting\" rather than throwing (see FUTURE_STATUS_FROM_CLOUD).\n case \"STARTING_CONVERSATION\":\n case \"WORKING\":\n case \"PREPARING_REPOSITORY\":\n case \"RUNNING_SETUP_SCRIPT\":\n default:\n return I18nKey.CONVERSATION$STARTING_CONVERSATION;\n }\n}\n\nexport function getStatusCode(\n webSocketConnectionState: WebSocketConnectionState,\n executionStatus: ExecutionStatus | null,\n taskStatus?: AppConversationStartTaskStatus | null,\n subConversationTaskStatus?: AppConversationStartTaskStatus | null,\n) {\n if (\n taskStatus === \"ERROR\" ||\n subConversationTaskStatus === \"ERROR\" ||\n executionStatus === \"error\"\n ) {\n return I18nKey.AGENT_STATUS$ERROR_OCCURRED;\n }\n\n if (taskStatus && taskStatus !== \"READY\") {\n return getTaskStatusI18nKey(taskStatus);\n }\n\n if (executionStatus === ExecutionStatus.PAUSED) {\n return I18nKey.CHAT_INTERFACE$STOPPED;\n }\n\n // Websocket has disconnected...\n if (webSocketConnectionState && webSocketConnectionState !== \"OPEN\") {\n switch (webSocketConnectionState) {\n case \"CLOSED\":\n case \"CLOSING\":\n return I18nKey.CHAT_INTERFACE$DISCONNECTED;\n case \"CONNECTING\":\n return I18nKey.CHAT_INTERFACE$CONNECTING;\n default:\n throw new Error(\n `Unknown WebsocketConnectionState: ${webSocketConnectionState}`,\n );\n }\n }\n\n if (executionStatus && executionStatus !== ExecutionStatus.STUCK) {\n switch (executionStatus) {\n case ExecutionStatus.IDLE:\n return I18nKey.AGENT_STATUS$WAITING_FOR_TASK;\n case ExecutionStatus.RUNNING:\n return I18nKey.AGENT_STATUS$RUNNING_TASK;\n case ExecutionStatus.WAITING_FOR_CONFIRMATION:\n return I18nKey.AGENT_STATUS$WAITING_FOR_USER_CONFIRMATION;\n case ExecutionStatus.FINISHED:\n return I18nKey.CHAT_INTERFACE$AGENT_FINISHED_MESSAGE;\n default:\n throw new Error(`Unknown executionStatus: ${executionStatus}`);\n }\n }\n\n return I18nKey.CHAT_INTERFACE$AGENT_ERROR_MESSAGE;\n}\n"],"mappings":";;;AAKA,IAAM,IAA0D,IAAI,IAAI;CACtE,EAAgB;CAChB,EAAgB;CAChB,EAAgB;CAChB,EAAgB;CACjB,CAAC;AAEF,SAAgB,EACd,GACS;AACT,QAAO,CAAC,CAAC,KAAU,EAA0B,IAAI,EAAO;;AAG1D,SAAgB,EACd,GACS;AACT,QAAO,MAAW,EAAgB;;AAGpC,SAAgB,EACd,GACS;AACT,QAAO,MAAW,EAAgB,SAAS,MAAW,EAAgB;;AAGxE,SAAgB,EACd,GACS;AACT,SAAQ,GAAR;EACE,KAAK,sBACH,QAAO,EAAQ;EACjB,KAAK,uBACH,QAAO,EAAQ;EACjB,KAAK,oBACH,QAAO,EAAQ;EAOjB,KAAK,QACH,QAAO,EAAQ;EACjB,KAAK,QACH,QAAO,EAAQ;EASjB,QACE,QAAO,EAAQ;;;AAIrB,SAAgB,EACd,GACA,GACA,GACA,GACA;AACA,KACE,MAAe,WACf,MAA8B,WAC9B,MAAoB,QAEpB,QAAO,EAAQ;AAGjB,KAAI,KAAc,MAAe,QAC/B,QAAO,EAAqB,EAAW;AAGzC,KAAI,MAAoB,EAAgB,OACtC,QAAO,EAAQ;AAIjB,KAAI,KAA4B,MAA6B,OAC3D,SAAQ,GAAR;EACE,KAAK;EACL,KAAK,UACH,QAAO,EAAQ;EACjB,KAAK,aACH,QAAO,EAAQ;EACjB,QACE,OAAU,MACR,qCAAqC,IACtC;;AAIP,KAAI,KAAmB,MAAoB,EAAgB,MACzD,SAAQ,GAAR;EACE,KAAK,EAAgB,KACnB,QAAO,EAAQ;EACjB,KAAK,EAAgB,QACnB,QAAO,EAAQ;EACjB,KAAK,EAAgB,yBACnB,QAAO,EAAQ;EACjB,KAAK,EAAgB,SACnB,QAAO,EAAQ;EACjB,QACE,OAAU,MAAM,4BAA4B,IAAkB;;AAIpE,QAAO,EAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../types/agent-server/type-guards.cjs`);function
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../types/agent-server/type-guards.cjs`),t=require(`./redact-custom-secrets.cjs`);function n(n){let r=n.find(e.isSystemPromptEvent);if(!r)return null;let i=r.dynamic_context?.text;return{content:i?`${r.system_prompt.text.trimEnd()}\n\n${t.redactCustomSecrets(i)}`:r.system_prompt.text,tools:r.tools??null,openhands_version:null,agent_class:null}}exports.adaptSystemMessage=n;
|
|
2
2
|
//# sourceMappingURL=system-message-adapter.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-message-adapter.cjs","names":[],"sources":["../../src/utils/system-message-adapter.ts"],"sourcesContent":["import { OHEvent } from \"#/stores/use-event-store\";\nimport { ChatCompletionToolParam } from \"#/types/agent-server/core\";\nimport { isSystemPromptEvent } from \"#/types/agent-server/type-guards\";\n\nexport interface SystemMessageForModal {\n content: string;\n tools: ChatCompletionToolParam[] | Record<string, unknown>[] | null;\n openhands_version: string | null;\n agent_class: string | null;\n}\n\nexport function adaptSystemMessage(\n events: OHEvent[],\n): SystemMessageForModal | null {\n const systemPromptEvent = events.find(isSystemPromptEvent);\n\n if (!systemPromptEvent) {\n return null;\n }\n\n
|
|
1
|
+
{"version":3,"file":"system-message-adapter.cjs","names":[],"sources":["../../src/utils/system-message-adapter.ts"],"sourcesContent":["import { OHEvent } from \"#/stores/use-event-store\";\nimport { ChatCompletionToolParam } from \"#/types/agent-server/core\";\nimport { isSystemPromptEvent } from \"#/types/agent-server/type-guards\";\nimport { redactCustomSecrets } from \"#/utils/redact-custom-secrets\";\n\nexport interface SystemMessageForModal {\n content: string;\n tools: ChatCompletionToolParam[] | Record<string, unknown>[] | null;\n openhands_version: string | null;\n agent_class: string | null;\n}\n\nexport function adaptSystemMessage(\n events: OHEvent[],\n): SystemMessageForModal | null {\n const systemPromptEvent = events.find(isSystemPromptEvent);\n\n if (!systemPromptEvent) {\n return null;\n }\n\n // dynamic_context is the runtime-injected tail of the same system prompt the\n // model receives, so append it to show the full message as one block.\n const dynamicContextText = systemPromptEvent.dynamic_context?.text;\n const content = dynamicContextText\n ? `${systemPromptEvent.system_prompt.text.trimEnd()}\\n\\n${redactCustomSecrets(dynamicContextText)}`\n : systemPromptEvent.system_prompt.text;\n\n return {\n content,\n tools: systemPromptEvent.tools ?? null,\n openhands_version: null,\n agent_class: null,\n };\n}\n"],"mappings":"+IAYA,SAAgB,EACd,EAC8B,CAC9B,IAAM,EAAoB,EAAO,KAAK,EAAA,oBAAoB,CAE1D,GAAI,CAAC,EACH,OAAO,KAKT,IAAM,EAAqB,EAAkB,iBAAiB,KAK9D,MAAO,CACL,QALc,EACZ,GAAG,EAAkB,cAAc,KAAK,SAAS,CAAC,MAAM,EAAA,oBAAoB,EAAmB,GAC/F,EAAkB,cAAc,KAIlC,MAAO,EAAkB,OAAS,KAClC,kBAAmB,KACnB,YAAa,KACd"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { isSystemPromptEvent as e } from "../types/agent-server/type-guards.js";
|
|
2
|
+
import { redactCustomSecrets as t } from "./redact-custom-secrets.js";
|
|
2
3
|
//#region src/utils/system-message-adapter.ts
|
|
3
|
-
function
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function n(n) {
|
|
5
|
+
let r = n.find(e);
|
|
6
|
+
if (!r) return null;
|
|
7
|
+
let i = r.dynamic_context?.text;
|
|
8
|
+
return {
|
|
9
|
+
content: i ? `${r.system_prompt.text.trimEnd()}\n\n${t(i)}` : r.system_prompt.text,
|
|
10
|
+
tools: r.tools ?? null,
|
|
8
11
|
openhands_version: null,
|
|
9
12
|
agent_class: null
|
|
10
|
-
}
|
|
13
|
+
};
|
|
11
14
|
}
|
|
12
15
|
//#endregion
|
|
13
|
-
export {
|
|
16
|
+
export { n as adaptSystemMessage };
|
|
14
17
|
|
|
15
18
|
//# sourceMappingURL=system-message-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-message-adapter.js","names":[],"sources":["../../src/utils/system-message-adapter.ts"],"sourcesContent":["import { OHEvent } from \"#/stores/use-event-store\";\nimport { ChatCompletionToolParam } from \"#/types/agent-server/core\";\nimport { isSystemPromptEvent } from \"#/types/agent-server/type-guards\";\n\nexport interface SystemMessageForModal {\n content: string;\n tools: ChatCompletionToolParam[] | Record<string, unknown>[] | null;\n openhands_version: string | null;\n agent_class: string | null;\n}\n\nexport function adaptSystemMessage(\n events: OHEvent[],\n): SystemMessageForModal | null {\n const systemPromptEvent = events.find(isSystemPromptEvent);\n\n if (!systemPromptEvent) {\n return null;\n }\n\n
|
|
1
|
+
{"version":3,"file":"system-message-adapter.js","names":[],"sources":["../../src/utils/system-message-adapter.ts"],"sourcesContent":["import { OHEvent } from \"#/stores/use-event-store\";\nimport { ChatCompletionToolParam } from \"#/types/agent-server/core\";\nimport { isSystemPromptEvent } from \"#/types/agent-server/type-guards\";\nimport { redactCustomSecrets } from \"#/utils/redact-custom-secrets\";\n\nexport interface SystemMessageForModal {\n content: string;\n tools: ChatCompletionToolParam[] | Record<string, unknown>[] | null;\n openhands_version: string | null;\n agent_class: string | null;\n}\n\nexport function adaptSystemMessage(\n events: OHEvent[],\n): SystemMessageForModal | null {\n const systemPromptEvent = events.find(isSystemPromptEvent);\n\n if (!systemPromptEvent) {\n return null;\n }\n\n // dynamic_context is the runtime-injected tail of the same system prompt the\n // model receives, so append it to show the full message as one block.\n const dynamicContextText = systemPromptEvent.dynamic_context?.text;\n const content = dynamicContextText\n ? `${systemPromptEvent.system_prompt.text.trimEnd()}\\n\\n${redactCustomSecrets(dynamicContextText)}`\n : systemPromptEvent.system_prompt.text;\n\n return {\n content,\n tools: systemPromptEvent.tools ?? null,\n openhands_version: null,\n agent_class: null,\n };\n}\n"],"mappings":";;;AAYA,SAAgB,EACd,GAC8B;CAC9B,IAAM,IAAoB,EAAO,KAAK,EAAoB;AAE1D,KAAI,CAAC,EACH,QAAO;CAKT,IAAM,IAAqB,EAAkB,iBAAiB;AAK9D,QAAO;EACL,SALc,IACZ,GAAG,EAAkB,cAAc,KAAK,SAAS,CAAC,MAAM,EAAoB,EAAmB,KAC/F,EAAkB,cAAc;EAIlC,OAAO,EAAkB,SAAS;EAClC,mBAAmB;EACnB,aAAa;EACd"}
|
package/dist/utils/utils.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../i18n/declaration.cjs`),t=require(`../node_modules/clsx/dist/clsx.cjs`),n=require(`../node_modules/tailwind-merge/dist/bundle-mjs.cjs`),r=require(`../types/agent-state.cjs`),i=require(`../constants/status-colors.cjs`);function
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../i18n/declaration.cjs`),t=require(`../node_modules/clsx/dist/clsx.cjs`),n=require(`../node_modules/tailwind-merge/dist/bundle-mjs.cjs`),r=require(`../types/agent-state.cjs`),i=require(`./status.cjs`),a=require(`../constants/status-colors.cjs`);function o(...e){return n.twMerge(t.default(e))}var s=(e,t)=>{let n=window.URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)},c=(e,t)=>{let n=parseFloat(e.style.height||``);return Number.isFinite(n)?n:t},l=(e,t)=>{e.style.setProperty(`height`,`${t}px`)},u=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?!0:`ontouchstart`in window||navigator.maxTouchPoints>0?typeof window.matchMedia==`function`?!window.matchMedia(`(pointer: fine)`).matches:!0:!1,d=e=>e.split(`.`).pop()?.toUpperCase()||`FILE`,f=(e,t)=>{if(!e)return!1;switch(e){case`bitbucket`:case`bitbucket_data_center`:return!0;case`github`:return t===`cloud`;default:return!1}},p=(e,t)=>{if(t&&t.trim()!==``)return t.startsWith(`http`)?t:`https://${t}`;switch(e){case`github`:return`https://github.com`;case`gitlab`:return`https://gitlab.com`;case`bitbucket`:return`https://bitbucket.org`;case`azure_devops`:return`https://dev.azure.com`;case`forgejo`:return`https://codeberg.org`;default:return``}},m=e=>e===`gitlab`?`GitLab`:e===`bitbucket`?`Bitbucket`:e===`bitbucket_data_center`?`Bitbucket Data Center`:e===`azure_devops`?`Azure DevOps`:e===`forgejo`?`Forgejo`:`GitHub`,h=e=>e?`merge request`:`pull request`,g=e=>e?`MR`:`PR`,_=(e,t,n)=>{let r=p(e,n);if(e===`bitbucket_data_center`){let[e,n]=t.split(`/`);return`${r}/projects/${e}/repos/${n}`}return`${r}/${t}`},v=(e,t,n,r)=>{let i=p(e,r);switch(e){case`github`:return`${i}/${t}/tree/${n}`;case`forgejo`:return`${i}/${t}/src/branch/${n}`;case`gitlab`:return`${i}/${t}/-/tree/${n}`;case`bitbucket`:return`${i}/${t}/src/${n}`;case`bitbucket_data_center`:{let e=t.split(`/`);if(e.length>=2){let[t,r]=e;return`${i}/projects/${t}/repos/${r}/browse?at=refs/heads/${n}`}return``}case`azure_devops`:{let e=t.split(`/`);if(e.length===3){let[t,r,a]=e;return`${i}/${t}/${r}/_git/${a}?version=GB${n}`}return``}default:return``}},y=()=>`Please pull the latest code from the repository.`,b=e=>`Please push the changes to a remote branch on ${m(e)}, but do NOT create a ${h(e===`gitlab`)}. Check your current branch name first - if it's main, master, deploy, or another common default branch name, create a new branch with a descriptive name related to your changes. Otherwise, use the exact SAME branch name as the one you are currently on.`,x=e=>{let t=m(e),n=h(e===`gitlab`);return`Please push the changes to ${t} and open a ${n}. If you're on a default branch (e.g., main, master, deploy), create a new branch with a descriptive name otherwise use the current branch. If a ${n} template exists in the repository, please follow it when creating the ${g(e===`gitlab`)} description.`},S=()=>`Please create a new branch with a descriptive name related to the work you plan to do.`,C=e=>!!e&&e!==`ERROR`&&e!==`READY`,w=e=>{let{isPausing:t,isTask:n,taskStatus:i,isStartingStatus:o,isStopStatus:s,curAgentState:c}=e;return t?`#FFD600`:n&&i?i===`ERROR`?a.OH_STATUS_ERROR_COLOR:`#FFD600`:o?`#FFD600`:s?`#ffffff`:c===r.AgentState.ERROR?a.OH_STATUS_ERROR_COLOR:a.OH_STATUS_SUCCESS_COLOR};function T({isPausing:t=!1,isTask:n,taskStatus:a,taskDetail:o,isStartingStatus:s,isStopStatus:c,curAgentState:l,errorMessage:u,t:d}){return t?d(e.I18nKey.COMMON$STOPPING):n&&a?a===`ERROR`?o||d(e.I18nKey.CONVERSATION$ERROR_STARTING_CONVERSATION):a===`READY`?d(e.I18nKey.CONVERSATION$READY):o||d(i.getTaskStatusI18nKey(a)):s?d(e.I18nKey.COMMON$STARTING):c?d(e.I18nKey.COMMON$SERVER_STOPPED):l===r.AgentState.ERROR?u||d(e.I18nKey.COMMON$ERROR):d(e.I18nKey.COMMON$RUNNING)}exports.cn=o,exports.constructBranchUrl=v,exports.constructRepositoryUrl=_,exports.downloadBlob=s,exports.getCreateNewBranchPrompt=S,exports.getCreatePRPrompt=x,exports.getFileExtension=d,exports.getGitPullPrompt=y,exports.getGitPushPrompt=b,exports.getStatusColor=w,exports.getStatusText=T,exports.getStyleHeightPx=c,exports.isMobileDevice=u,exports.isTaskPolling=C,exports.setStyleHeightPx=l,exports.shouldUseInstallationRepos=f;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/utils/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/utils/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Provider } from \"#/types/settings\";\nimport { SuggestedTaskGroup } from \"#/utils/types\";\nimport { ConversationStatus } from \"#/types/conversation-status\";\nimport { GitRepository } from \"#/types/git\";\nimport { sanitizeQuery } from \"#/utils/sanitize-query\";\nimport { PRODUCT_URL } from \"#/utils/constants\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport {\n OH_STATUS_ERROR_COLOR,\n OH_STATUS_SUCCESS_COLOR,\n} from \"#/constants/status-colors\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Trigger a download for a provided Blob with the given filename\n */\nexport const downloadBlob = (blob: Blob, filename: string): void => {\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n};\n\n/**\n * Get the numeric height value from an element's style property\n * @param el The HTML element to get the height from\n * @param fallback The fallback value to return if style height is invalid\n * @returns The numeric height value in pixels, or the fallback value\n *\n * @example\n * getStyleHeightPx(element, 20) // Returns 20 if element.style.height is \"auto\" or invalid\n * getStyleHeightPx(element, 20) // Returns 100 if element.style.height is \"100px\"\n */\nexport const getStyleHeightPx = (el: HTMLElement, fallback: number): number => {\n const elementHeight = parseFloat(el.style.height || \"\");\n return Number.isFinite(elementHeight) ? elementHeight : fallback;\n};\n\n/**\n * Set the height style property of an element to a specific pixel value\n * @param el The HTML element to set the height for\n * @param height The height value in pixels to set\n *\n * @example\n * setStyleHeightPx(element, 100) // Sets element.style.height to \"100px\"\n * setStyleHeightPx(textarea, 200) // Sets textarea.style.height to \"200px\"\n */\nexport const setStyleHeightPx = (el: HTMLElement, height: number): void => {\n el.style.setProperty(\"height\", `${height}px`);\n};\n\n/**\n * Detect if the user is on a mobile device.\n * Touch support alone is not sufficient — touchscreen laptops have touch\n * but use a mouse/trackpad as primary input. We check that the primary\n * pointing device is coarse (finger) to avoid false positives.\n */\nexport const isMobileDevice = (): boolean => {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent,\n )\n )\n return true;\n\n const hasTouch = \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n if (!hasTouch) return false;\n\n // If matchMedia is available, check whether the primary pointer is fine\n // (mouse/trackpad). Touchscreen laptops report fine, real mobile devices don't.\n if (typeof window.matchMedia === \"function\") {\n return !window.matchMedia(\"(pointer: fine)\").matches;\n }\n\n // Fallback: touch present but no matchMedia — assume mobile\n return true;\n};\n\n/**\n * Checks if the current domain is the production domain\n * @returns True if the current domain matches the production URL\n */\nexport const isProductionDomain = (): boolean =>\n window.location.origin === PRODUCT_URL.PRODUCTION;\n\ninterface EventActionHistory {\n args?: {\n LLM_API_KEY?: string;\n [key: string]: unknown;\n };\n extras?: {\n open_page_urls: string[];\n active_page_index: number;\n dom_object: Record<string, unknown>;\n axtree_object: Record<string, unknown>;\n extra_element_properties: Record<string, unknown>;\n last_browser_action: string;\n last_browser_action_error: unknown;\n focused_element_bid: string;\n };\n [key: string]: unknown;\n}\n\nexport const removeUnwantedKeys = (\n data: EventActionHistory[],\n): EventActionHistory[] => {\n const UNDESIRED_KEYS = [\n \"open_page_urls\",\n \"active_page_index\",\n \"dom_object\",\n \"axtree_object\",\n \"extra_element_properties\",\n \"last_browser_action\",\n \"last_browser_action_error\",\n \"focused_element_bid\",\n ];\n\n return data\n .filter((item) => {\n // Skip items that have a status key\n if (\"status\" in item) {\n return false;\n }\n return true;\n })\n .map((item) => {\n // Create a shallow copy of item\n const newItem = { ...item };\n\n // Check if extras exists and delete it from a new extras object\n if (newItem.extras) {\n const newExtras = { ...newItem.extras };\n UNDESIRED_KEYS.forEach((key) => {\n delete newExtras[key as keyof typeof newExtras];\n });\n newItem.extras = newExtras;\n }\n\n return newItem;\n });\n};\n\n/**\n * Get file extension from file name in uppercase format\n * @param fileName The file name to extract extension from\n * @returns The file extension in uppercase, or \"FILE\" if no extension found\n *\n * @example\n * getFileExtension(\"document.pdf\") // \"PDF\"\n * getFileExtension(\"image.jpeg\") // \"JPEG\"\n * getFileExtension(\"noextension\") // \"FILE\"\n */\nexport const getFileExtension = (fileName: string): string => {\n const extension = fileName.split(\".\").pop()?.toUpperCase();\n return extension || \"FILE\";\n};\n\n/**\n * Whether to use the installation-scoped repo flow\n * (`/api/v1/git/installations/search` → `/api/v1/git/repositories/search?installation_id=…`)\n * for the given provider/backend combo.\n *\n * Mirrors OpenHands' cloud frontend (parameterized by `app_mode`):\n * - bitbucket / bitbucket_data_center → always installation-based\n * - github → installation-based ONLY when the active backend is cloud\n * - gitlab / azure_devops / forgejo → direct (search) flow\n *\n * `appMode` accepts the active backend `kind` (\"local\" | \"cloud\") so call\n * sites can hand it through directly.\n */\nexport const shouldUseInstallationRepos = (\n provider: Provider | null | undefined,\n appMode?: \"local\" | \"cloud\",\n) => {\n if (!provider) return false;\n\n switch (provider) {\n case \"bitbucket\":\n case \"bitbucket_data_center\":\n return true;\n case \"github\":\n return appMode === \"cloud\";\n default:\n return false;\n }\n};\n\nexport const getGitProviderBaseUrl = (\n gitProvider: Provider,\n host?: string | null,\n): string => {\n // If custom host provided, use it (with https:// prefix if needed)\n if (host && host.trim() !== \"\") {\n return host.startsWith(\"http\") ? host : `https://${host}`;\n }\n\n // Fall back to defaults\n switch (gitProvider) {\n case \"github\":\n return \"https://github.com\";\n case \"gitlab\":\n return \"https://gitlab.com\";\n case \"bitbucket\":\n return \"https://bitbucket.org\";\n case \"azure_devops\":\n return \"https://dev.azure.com\";\n case \"forgejo\":\n // Default UI links to Codeberg unless a custom host is available in settings\n // Note: UI link builders don't currently receive host; consider plumbing settings if needed\n return \"https://codeberg.org\";\n default:\n return \"\";\n }\n};\n\n/**\n * Get the name of the git provider\n * @param gitProvider The git provider\n * @returns The name of the git provider\n */\nexport const getProviderName = (gitProvider: Provider) => {\n if (gitProvider === \"gitlab\") return \"GitLab\";\n if (gitProvider === \"bitbucket\") return \"Bitbucket\";\n if (gitProvider === \"bitbucket_data_center\") return \"Bitbucket Data Center\";\n if (gitProvider === \"azure_devops\") return \"Azure DevOps\";\n if (gitProvider === \"forgejo\") return \"Forgejo\";\n return \"GitHub\";\n};\n\n/**\n * Get the name of the PR\n * @param isGitLab Whether the git provider is GitLab\n * @returns The name of the PR\n */\nexport const getPR = (isGitLab: boolean) =>\n isGitLab ? \"merge request\" : \"pull request\";\n\n/**\n * Get the short name of the PR\n * @param isGitLab Whether the git provider is GitLab\n * @returns The short name of the PR\n */\nexport const getPRShort = (isGitLab: boolean) => (isGitLab ? \"MR\" : \"PR\");\n\n/**\n * Construct the pull request (merge request) URL for different providers\n * @param prNumber The pull request number\n * @param provider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @returns The pull request URL\n *\n * @example\n * constructPullRequestUrl(123, \"github\", \"owner/repo\") // \"https://github.com/owner/repo/pull/123\"\n * constructPullRequestUrl(456, \"gitlab\", \"owner/repo\") // \"https://gitlab.com/owner/repo/-/merge_requests/456\"\n * constructPullRequestUrl(789, \"bitbucket\", \"owner/repo\") // \"https://bitbucket.org/owner/repo/pull-requests/789\"\n * constructPullRequestUrl(789, \"bitbucket\", \"PROJECT/repo\", \"server.com\") // \"https://server.com/projects/PROJECT/repos/repo/pull-requests/789\"\n */\nexport const constructPullRequestUrl = (\n prNumber: number,\n provider: Provider,\n repositoryName: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(provider, host);\n\n switch (provider) {\n case \"github\":\n return `${baseUrl}/${repositoryName}/pull/${prNumber}`;\n case \"forgejo\":\n return `${baseUrl}/${repositoryName}/pull/${prNumber}`;\n case \"gitlab\":\n return `${baseUrl}/${repositoryName}/-/merge_requests/${prNumber}`;\n case \"bitbucket\":\n return `${baseUrl}/${repositoryName}/pull-requests/${prNumber}`;\n case \"bitbucket_data_center\": {\n const [project, repo] = repositoryName.split(\"/\");\n return `${baseUrl}/projects/${project}/repos/${repo}/pull-requests/${prNumber}`;\n }\n case \"azure_devops\": {\n // Azure DevOps format: org/project/repo\n const parts = repositoryName.split(\"/\");\n if (parts.length === 3) {\n const [org, project, repo] = parts;\n return `${baseUrl}/${org}/${project}/_git/${repo}/pullrequest/${prNumber}`;\n }\n return \"\";\n }\n default:\n return \"\";\n }\n};\n\n/**\n * Construct the microagent URL for different providers\n * @param gitProvider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @param microagentPath The path to the microagent in the repository\n * @returns The URL to the microagent file in the Git provider\n *\n * @example\n * constructMicroagentUrl(\"github\", \"owner/repo\", \".openhands/microagents/tell-me-a-joke.md\")\n * // \"https://github.com/owner/repo/blob/main/.openhands/microagents/tell-me-a-joke.md\"\n * constructMicroagentUrl(\"gitlab\", \"owner/repo\", \"microagents/git-helper.md\")\n * // \"https://gitlab.com/owner/repo/-/blob/main/microagents/git-helper.md\"\n * constructMicroagentUrl(\"bitbucket\", \"owner/repo\", \".openhands/microagents/docker-helper.md\")\n * // \"https://bitbucket.org/owner/repo/src/main/.openhands/microagents/docker-helper.md\"\n */\nexport const constructMicroagentUrl = (\n gitProvider: Provider,\n repositoryName: string,\n microagentPath: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(gitProvider, host);\n\n switch (gitProvider) {\n case \"github\":\n return `${baseUrl}/${repositoryName}/blob/main/${microagentPath}`;\n case \"forgejo\":\n return `${baseUrl}/${repositoryName}/src/branch/main/${microagentPath}`;\n case \"gitlab\":\n return `${baseUrl}/${repositoryName}/-/blob/main/${microagentPath}`;\n case \"bitbucket\":\n return `${baseUrl}/${repositoryName}/src/main/${microagentPath}`;\n case \"bitbucket_data_center\": {\n const [project, repo] = repositoryName.split(\"/\");\n return `${baseUrl}/projects/${project}/repos/${repo}/browse/${microagentPath}?at=refs/heads/main`;\n }\n case \"azure_devops\": {\n // Azure DevOps format: org/project/repo\n const parts = repositoryName.split(\"/\");\n if (parts.length === 3) {\n const [org, project, repo] = parts;\n return `${baseUrl}/${org}/${project}/_git/${repo}?path=/${microagentPath}&version=GBmain`;\n }\n return \"\";\n }\n default:\n return \"\";\n }\n};\n\n/**\n * Extract repository owner, repo name, and file path from repository and microagent data\n * @param selectedRepository The selected repository object with full_name property\n * @param microagent The microagent object with path property\n * @returns Object containing owner, repo, and filePath\n *\n * @example\n * const { owner, repo, filePath } = extractRepositoryInfo(selectedRepository, microagent);\n */\nexport const extractRepositoryInfo = (\n selectedRepository: { full_name?: string } | null | undefined,\n microagent: { path?: string } | null | undefined,\n) => {\n const [owner, repo] = selectedRepository?.full_name?.split(\"/\") || [];\n const filePath = microagent?.path || \"\";\n\n return { owner, repo, filePath };\n};\n\n/**\n * Construct the repository URL for different providers\n * @param provider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @returns The repository URL\n *\n * @example\n * constructRepositoryUrl(\"github\", \"owner/repo\") // \"https://github.com/owner/repo\"\n * constructRepositoryUrl(\"gitlab\", \"owner/repo\") // \"https://gitlab.com/owner/repo\"\n * constructRepositoryUrl(\"bitbucket\", \"owner/repo\") // \"https://bitbucket.org/owner/repo\"\n */\nexport const constructRepositoryUrl = (\n provider: Provider,\n repositoryName: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(provider, host);\n if (provider === \"bitbucket_data_center\") {\n const [project, repo] = repositoryName.split(\"/\");\n return `${baseUrl}/projects/${project}/repos/${repo}`;\n }\n return `${baseUrl}/${repositoryName}`;\n};\n\n/**\n * Construct the branch URL for different providers\n * @param provider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @param branchName The branch name\n * @param host Optional custom host for self-hosted instances\n * @returns The branch URL\n *\n * @example\n * constructBranchUrl(\"github\", \"owner/repo\", \"main\") // \"https://github.com/owner/repo/tree/main\"\n * constructBranchUrl(\"gitlab\", \"owner/repo\", \"develop\") // \"https://gitlab.com/owner/repo/-/tree/develop\"\n * constructBranchUrl(\"bitbucket\", \"owner/repo\", \"feature\") // \"https://bitbucket.org/owner/repo/src/feature\"\n * constructBranchUrl(\"bitbucket\", \"PROJECT/repo\", \"feature\", \"server.com\") // \"https://server.com/projects/PROJECT/repos/repo/browse?at=refs/heads/feature\"\n */\nexport const constructBranchUrl = (\n provider: Provider,\n repositoryName: string,\n branchName: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(provider, host);\n\n switch (provider) {\n case \"github\":\n return `${baseUrl}/${repositoryName}/tree/${branchName}`;\n case \"forgejo\":\n return `${baseUrl}/${repositoryName}/src/branch/${branchName}`;\n case \"gitlab\":\n return `${baseUrl}/${repositoryName}/-/tree/${branchName}`;\n case \"bitbucket\":\n return `${baseUrl}/${repositoryName}/src/${branchName}`;\n case \"bitbucket_data_center\": {\n // Bitbucket Server format: /projects/{PROJECT}/repos/{repo}/browse?at=refs/heads/{branch}\n const parts = repositoryName.split(\"/\");\n if (parts.length >= 2) {\n const [project, repo] = parts;\n return `${baseUrl}/projects/${project}/repos/${repo}/browse?at=refs/heads/${branchName}`;\n }\n return \"\";\n }\n case \"azure_devops\": {\n // Azure DevOps format: org/project/repo\n const parts = repositoryName.split(\"/\");\n if (parts.length === 3) {\n const [org, project, repo] = parts;\n return `${baseUrl}/${org}/${project}/_git/${repo}?version=GB${branchName}`;\n }\n return \"\";\n }\n default:\n return \"\";\n }\n};\n\n// Git Action Prompts\n\n/**\n * Generate a git pull prompt\n * @returns The git pull prompt\n */\nexport const getGitPullPrompt = (): string =>\n \"Please pull the latest code from the repository.\";\n\n/**\n * Generate a git push prompt\n * @param gitProvider The git provider\n * @returns The git push prompt\n */\nexport const getGitPushPrompt = (gitProvider: Provider): string => {\n const providerName = getProviderName(gitProvider);\n const pr = getPR(gitProvider === \"gitlab\");\n\n return `Please push the changes to a remote branch on ${providerName}, but do NOT create a ${pr}. Check your current branch name first - if it's main, master, deploy, or another common default branch name, create a new branch with a descriptive name related to your changes. Otherwise, use the exact SAME branch name as the one you are currently on.`;\n};\n\n/**\n * Generate a create pull request prompt\n * @param gitProvider The git provider\n * @returns The create PR prompt\n */\nexport const getCreatePRPrompt = (gitProvider: Provider): string => {\n const providerName = getProviderName(gitProvider);\n const pr = getPR(gitProvider === \"gitlab\");\n const prShort = getPRShort(gitProvider === \"gitlab\");\n\n return `Please push the changes to ${providerName} and open a ${pr}. If you're on a default branch (e.g., main, master, deploy), create a new branch with a descriptive name otherwise use the current branch. If a ${pr} template exists in the repository, please follow it when creating the ${prShort} description.`;\n};\n\n/**\n * Generate a push to existing PR prompt\n * @param gitProvider The git provider\n * @returns The push to PR prompt\n */\nexport const getPushToPRPrompt = (gitProvider: Provider): string => {\n const pr = getPR(gitProvider === \"gitlab\");\n\n return `Please push the latest changes to the existing ${pr}.`;\n};\n\n/**\n * Generate a create new branch prompt\n * @returns The create new branch prompt\n */\nexport const getCreateNewBranchPrompt = (): string =>\n \"Please create a new branch with a descriptive name related to the work you plan to do.\";\n\n// Helper functions\nexport function getTotalTaskCount(\n suggestedTasks: SuggestedTaskGroup[] | undefined,\n): number {\n if (!suggestedTasks) return 0;\n return suggestedTasks.flatMap((group) => group.tasks).length;\n}\n\nexport function getLimitedTaskGroups(\n suggestedTasks: SuggestedTaskGroup[],\n maxTasks: number,\n): SuggestedTaskGroup[] {\n const limitedGroups: SuggestedTaskGroup[] = [];\n let taskCount = 0;\n\n for (const group of suggestedTasks) {\n if (taskCount >= maxTasks) break;\n\n const remainingTasksNeeded = maxTasks - taskCount;\n const tasksToShow = group.tasks.slice(0, remainingTasksNeeded);\n\n if (tasksToShow.length > 0) {\n limitedGroups.push({\n ...group,\n tasks: tasksToShow,\n });\n taskCount += tasksToShow.length;\n }\n }\n\n return limitedGroups;\n}\n\nexport function getDisplayedTaskGroups(\n suggestedTasks: SuggestedTaskGroup[] | undefined,\n isExpanded: boolean,\n): SuggestedTaskGroup[] {\n if (!suggestedTasks || suggestedTasks.length === 0) {\n return [];\n }\n\n if (isExpanded) {\n return suggestedTasks;\n }\n\n return getLimitedTaskGroups(suggestedTasks, 3);\n}\n\n/**\n * Get the repository markdown creation prompt with additional PR creation instructions\n * @param gitProvider The git provider to use for generating provider-specific text\n * @param query Optional custom query to use instead of the default prompt\n * @returns The complete prompt for creating repository markdown and PR instructions\n */\nexport const getRepoMdCreatePrompt = (\n gitProvider: Provider,\n query?: string,\n): string => {\n const providerName = getProviderName(gitProvider);\n const pr = getPR(gitProvider === \"gitlab\");\n const prShort = getPRShort(gitProvider === \"gitlab\");\n\n return `Please explore this repository. Create the file .openhands/microagents/repo.md with:\n ${\n query\n ? `- ${query}`\n : `- A description of the project\n - An overview of the file structure\n - Any information on how to run tests or other relevant commands\n - Any other information that would be helpful to a brand new developer\n Keep it short--just a few paragraphs will do.`\n }\n\nPlease push the changes to your branch on ${providerName} and create a ${pr}. Please create a meaningful branch name that describes the changes. If a ${pr} template exists in the repository, please follow it when creating the ${prShort} description.`;\n};\n\n/**\n * Get the label for a conversation status\n * @param status The conversation status\n * @returns The localized label for the status\n */\nexport const getConversationStatusLabel = (\n status: ConversationStatus,\n): string => {\n switch (status) {\n case \"STOPPED\":\n return \"COMMON$STOPPED\";\n case \"RUNNING\":\n return \"COMMON$RUNNING\";\n case \"STARTING\":\n return \"COMMON$STARTING\";\n case \"ERROR\":\n return \"COMMON$ERROR\";\n case \"ARCHIVED\":\n return \"COMMON$ARCHIVED\"; // Use STOPPED for archived conversations\n default:\n return \"COMMON$UNKNOWN\";\n }\n};\n\n// Task Tracking Utility Functions\n\n/**\n * Get the status icon for a task status\n * @param status The task status\n * @returns The emoji icon for the status\n */\nexport const getStatusIcon = (status: string) => {\n switch (status) {\n case \"todo\":\n return \"⏳\";\n case \"in_progress\":\n return \"🔄\";\n case \"done\":\n return \"✅\";\n default:\n return \"❓\";\n }\n};\n\n/**\n * Get the CSS class names for a task status badge\n * @param status The task status\n * @returns The CSS class names for styling the status badge\n */\nexport const getStatusClassName = (status: string) => {\n if (status === \"done\") {\n return \"bg-green-800 text-green-200\";\n }\n if (status === \"in_progress\") {\n return \"bg-yellow-800 text-yellow-200\";\n }\n return \"bg-tertiary text-[var(--oh-text-tertiary)]\";\n};\n\n/**\n * Helper function to apply client-side filtering based on search query\n * @param repo The Git repository to check\n * @param searchQuery The search query string\n * @returns True if the repository should be included based on the search query\n */\nexport const shouldIncludeRepository = (\n repo: GitRepository,\n searchQuery: string,\n): boolean => {\n if (!searchQuery.trim()) {\n return true;\n }\n\n const sanitizedQuery = sanitizeQuery(searchQuery);\n const sanitizedRepoName = sanitizeQuery(repo.full_name);\n return sanitizedRepoName.includes(sanitizedQuery);\n};\n\n/**\n * Get the OpenHands query string based on the provider\n * @param provider The git provider\n * @returns The query string for searching OpenHands repositories\n */\nexport const getOpenHandsQuery = (provider: Provider | null): string => {\n const providerRepositorySuffix: Record<string, string> = {\n gitlab: \"openhands-config\",\n azure_devops: \"openhands-config\",\n default: \".openhands\",\n } as const;\n\n return provider && provider in providerRepositorySuffix\n ? providerRepositorySuffix[provider]\n : providerRepositorySuffix.default;\n};\n\n/**\n * Check if a repository has the OpenHands suffix based on the provider\n * @param repo The Git repository to check\n * @param provider The git provider\n * @returns True if the repository has the OpenHands suffix\n */\nexport const hasOpenHandsSuffix = (\n repo: GitRepository,\n provider: Provider | null,\n): boolean => repo.full_name.endsWith(`/${getOpenHandsQuery(provider)}`);\n\n/**\n * Build headers for V1 API requests that require session authentication\n * @param sessionApiKey Session API key for authentication\n * @returns Headers object with X-Session-API-Key if provided\n */\nexport const buildSessionHeaders = (\n sessionApiKey?: string | null,\n): Record<string, string> => {\n const headers: Record<string, string> = {};\n if (sessionApiKey) {\n headers[\"X-Session-API-Key\"] = sessionApiKey;\n }\n return headers;\n};\n\n/**\n * Check if a task is currently being polled (loading state)\n * @param taskStatus The task status string (e.g., \"WORKING\", \"ERROR\", \"READY\")\n * @returns True if the task is in a loading state (not ERROR and not READY)\n *\n * @example\n * isTaskPolling(\"WORKING\") // Returns true\n * isTaskPolling(\"PREPARING_REPOSITORY\") // Returns true\n * isTaskPolling(\"READY\") // Returns false\n * isTaskPolling(\"ERROR\") // Returns false\n * isTaskPolling(null) // Returns false\n * isTaskPolling(undefined) // Returns false\n */\nexport const isTaskPolling = (taskStatus: string | null | undefined): boolean =>\n !!taskStatus && taskStatus !== \"ERROR\" && taskStatus !== \"READY\";\n\n/**\n * Get the appropriate color based on agent status\n * @param options Configuration object for status color calculation\n * @param options.isPausing Whether the agent is currently pausing\n * @param options.isTask Whether we're polling a task\n * @param options.taskStatus The task status string (e.g., \"ERROR\", \"READY\")\n * @param options.isStartingStatus Whether the agent is in a starting state (LOADING or INIT)\n * @param options.isStopStatus Whether the conversation status is STOPPED\n * @param options.curAgentState The current agent state\n * @returns The hex color code for the status\n *\n * @example\n * getStatusColor({\n * isPausing: false,\n * isTask: false,\n * taskStatus: undefined,\n * isStartingStatus: false,\n * isStopStatus: false,\n * curAgentState: AgentState.RUNNING\n * }) // Returns \"var(--oh-status-success)\"\n */\nexport const getStatusColor = (options: {\n isPausing: boolean;\n isTask: boolean;\n taskStatus?: string | null;\n isStartingStatus: boolean;\n isStopStatus: boolean;\n curAgentState: AgentState;\n}): string => {\n const {\n isPausing,\n isTask,\n taskStatus,\n isStartingStatus,\n isStopStatus,\n curAgentState,\n } = options;\n\n // Show pausing status\n if (isPausing) {\n return \"#FFD600\";\n }\n\n // Show task status if we're polling a task\n if (isTask && taskStatus) {\n if (taskStatus === \"ERROR\") {\n return OH_STATUS_ERROR_COLOR;\n }\n return \"#FFD600\";\n }\n\n if (isStartingStatus) {\n return \"#FFD600\";\n }\n if (isStopStatus) {\n return \"#ffffff\";\n }\n if (curAgentState === AgentState.ERROR) {\n return OH_STATUS_ERROR_COLOR;\n }\n return OH_STATUS_SUCCESS_COLOR;\n};\n\ninterface GetStatusTextArgs {\n isPausing: boolean;\n isTask: boolean;\n taskStatus?: string | null;\n taskDetail?: string | null;\n isStartingStatus: boolean;\n isStopStatus: boolean;\n curAgentState: AgentState;\n errorMessage?: string | null;\n t: (t: string) => string;\n}\n\n/**\n * Get the server status text based on agent and task state\n *\n * @param options Configuration object for status text calculation\n * @param options.isPausing Whether the agent is currently pausing\n * @param options.isTask Whether we're polling a task\n * @param options.taskStatus The task status string (e.g., \"ERROR\", \"READY\")\n * @param options.taskDetail Optional task-specific detail text\n * @param options.isStartingStatus Whether the conversation is in STARTING state\n * @param options.isStopStatus Whether the conversation is STOPPED\n * @param options.curAgentState The current agent state\n * @param options.errorMessage Optional agent error message\n * @returns Localized human-readable status text\n *\n * @example\n * getStatusText({\n * isPausing: false,\n * isTask: true,\n * taskStatus: \"STARTING_CONVERSATION\",\n * taskDetail: null,\n * isStartingStatus: false,\n * isStopStatus: false,\n * curAgentState: AgentState.RUNNING\n * }) // Returns \"Starting conversation\"\n */\nexport function getStatusText({\n isPausing = false,\n isTask,\n taskStatus,\n taskDetail,\n isStartingStatus,\n isStopStatus,\n curAgentState,\n errorMessage,\n t,\n}: GetStatusTextArgs): string {\n // Show pausing status\n if (isPausing) {\n return t(I18nKey.COMMON$STOPPING);\n }\n\n // Show task status if we're polling a task\n if (isTask && taskStatus) {\n if (taskStatus === \"ERROR\") {\n return taskDetail || t(I18nKey.CONVERSATION$ERROR_STARTING_CONVERSATION);\n }\n\n if (taskStatus === \"READY\") {\n return t(I18nKey.CONVERSATION$READY);\n }\n\n return (\n taskDetail ||\n taskStatus\n .toLowerCase()\n .replace(/_/g, \" \")\n .replace(/^\\w/, (c) => c.toUpperCase())\n );\n }\n\n if (isStartingStatus) {\n return t(I18nKey.COMMON$STARTING);\n }\n\n if (isStopStatus) {\n return t(I18nKey.COMMON$SERVER_STOPPED);\n }\n\n if (curAgentState === AgentState.ERROR) {\n return errorMessage || t(I18nKey.COMMON$ERROR);\n }\n\n return t(I18nKey.COMMON$RUNNING);\n}\n"],"mappings":"0RAeA,SAAgB,EAAG,GAAG,EAAsB,CAC1C,OAAO,EAAA,QAAQ,EAAA,QAAK,EAAO,CAAC,CAM9B,IAAa,GAAgB,EAAY,IAA2B,CAClE,IAAM,EAAM,OAAO,IAAI,gBAAgB,EAAK,CACtC,EAAO,SAAS,cAAc,IAAI,CACxC,EAAK,KAAO,EACZ,EAAK,SAAW,EAChB,SAAS,KAAK,YAAY,EAAK,CAC/B,EAAK,OAAO,CACZ,SAAS,KAAK,YAAY,EAAK,CAC/B,OAAO,IAAI,gBAAgB,EAAI,EAapB,GAAoB,EAAiB,IAA6B,CAC7E,IAAM,EAAgB,WAAW,EAAG,MAAM,QAAU,GAAG,CACvD,OAAO,OAAO,SAAS,EAAc,CAAG,EAAgB,GAY7C,GAAoB,EAAiB,IAAyB,CACzE,EAAG,MAAM,YAAY,SAAU,GAAG,EAAO,IAAI,EASlC,MAET,iEAAiE,KAC/D,UAAU,UACX,CAEM,GAEQ,iBAAkB,QAAU,UAAU,eAAiB,EAKpE,OAAO,OAAO,YAAe,WACxB,CAAC,OAAO,WAAW,kBAAkB,CAAC,QAIxC,GATe,GAsFX,EAAoB,GACb,EAAS,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa,EACtC,OAgBT,GACX,EACA,IACG,CACH,GAAI,CAAC,EAAU,MAAO,GAEtB,OAAQ,EAAR,CACE,IAAK,YACL,IAAK,wBACH,MAAO,GACT,IAAK,SACH,OAAO,IAAY,QACrB,QACE,MAAO,KAIA,GACX,EACA,IACW,CAEX,GAAI,GAAQ,EAAK,MAAM,GAAK,GAC1B,OAAO,EAAK,WAAW,OAAO,CAAG,EAAO,WAAW,IAIrD,OAAQ,EAAR,CACE,IAAK,SACH,MAAO,qBACT,IAAK,SACH,MAAO,qBACT,IAAK,YACH,MAAO,wBACT,IAAK,eACH,MAAO,wBACT,IAAK,UAGH,MAAO,uBACT,QACE,MAAO,KASA,EAAmB,GAC1B,IAAgB,SAAiB,SACjC,IAAgB,YAAoB,YACpC,IAAgB,wBAAgC,wBAChD,IAAgB,eAAuB,eACvC,IAAgB,UAAkB,UAC/B,SAQI,EAAS,GACpB,EAAW,gBAAkB,eAOlB,EAAc,GAAuB,EAAW,KAAO,KAkIvD,GACX,EACA,EACA,IACW,CACX,IAAM,EAAU,EAAsB,EAAU,EAAK,CACrD,GAAI,IAAa,wBAAyB,CACxC,GAAM,CAAC,EAAS,GAAQ,EAAe,MAAM,IAAI,CACjD,MAAO,GAAG,EAAQ,YAAY,EAAQ,SAAS,IAEjD,MAAO,GAAG,EAAQ,GAAG,KAiBV,GACX,EACA,EACA,EACA,IACW,CACX,IAAM,EAAU,EAAsB,EAAU,EAAK,CAErD,OAAQ,EAAR,CACE,IAAK,SACH,MAAO,GAAG,EAAQ,GAAG,EAAe,QAAQ,IAC9C,IAAK,UACH,MAAO,GAAG,EAAQ,GAAG,EAAe,cAAc,IACpD,IAAK,SACH,MAAO,GAAG,EAAQ,GAAG,EAAe,UAAU,IAChD,IAAK,YACH,MAAO,GAAG,EAAQ,GAAG,EAAe,OAAO,IAC7C,IAAK,wBAAyB,CAE5B,IAAM,EAAQ,EAAe,MAAM,IAAI,CACvC,GAAI,EAAM,QAAU,EAAG,CACrB,GAAM,CAAC,EAAS,GAAQ,EACxB,MAAO,GAAG,EAAQ,YAAY,EAAQ,SAAS,EAAK,wBAAwB,IAE9E,MAAO,GAET,IAAK,eAAgB,CAEnB,IAAM,EAAQ,EAAe,MAAM,IAAI,CACvC,GAAI,EAAM,SAAW,EAAG,CACtB,GAAM,CAAC,EAAK,EAAS,GAAQ,EAC7B,MAAO,GAAG,EAAQ,GAAG,EAAI,GAAG,EAAQ,QAAQ,EAAK,aAAa,IAEhE,MAAO,GAET,QACE,MAAO,KAUA,MACX,mDAOW,EAAoB,GAIxB,iDAHc,EAAgB,EAGmB,CAAa,wBAF1D,EAAM,IAAgB,SAE4D,CAAG,+PAQrF,EAAqB,GAAkC,CAClE,IAAM,EAAe,EAAgB,EAAY,CAC3C,EAAK,EAAM,IAAgB,SAAS,CAG1C,MAAO,8BAA8B,EAAa,cAAc,EAAG,mJAAmJ,EAAG,yEAFzM,EAAW,IAAgB,SAEuP,CAAQ,gBAkB/R,MACX,yFAoNW,EAAiB,GAC5B,CAAC,CAAC,GAAc,IAAe,SAAW,IAAe,QAuB9C,EAAkB,GAOjB,CACZ,GAAM,CACJ,YACA,SACA,aACA,mBACA,eACA,iBACE,EAwBJ,OArBI,EACK,UAIL,GAAU,EACR,IAAe,QACV,EAAA,sBAEF,UAGL,EACK,UAEL,EACK,UAEL,IAAkB,EAAA,WAAW,MACxB,EAAA,sBAEF,EAAA,yBAwCT,SAAgB,EAAc,CAC5B,YAAY,GACZ,SACA,aACA,aACA,mBACA,eACA,gBACA,eACA,KAC4B,CAqC5B,OAnCI,EACK,EAAE,EAAA,QAAQ,gBAAgB,CAI/B,GAAU,EACR,IAAe,QACV,GAAc,EAAE,EAAA,QAAQ,yCAAyC,CAGtE,IAAe,QACV,EAAE,EAAA,QAAQ,mBAAmB,CAIpC,GACA,EACG,aAAa,CACb,QAAQ,KAAM,IAAI,CAClB,QAAQ,MAAQ,GAAM,EAAE,aAAa,CAAC,CAIzC,EACK,EAAE,EAAA,QAAQ,gBAAgB,CAG/B,EACK,EAAE,EAAA,QAAQ,sBAAsB,CAGrC,IAAkB,EAAA,WAAW,MACxB,GAAgB,EAAE,EAAA,QAAQ,aAAa,CAGzC,EAAE,EAAA,QAAQ,eAAe"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","names":[],"sources":["../../src/utils/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Provider } from \"#/types/settings\";\nimport { SuggestedTaskGroup } from \"#/utils/types\";\nimport { ConversationStatus } from \"#/types/conversation-status\";\nimport { GitRepository } from \"#/types/git\";\nimport { sanitizeQuery } from \"#/utils/sanitize-query\";\nimport { PRODUCT_URL } from \"#/utils/constants\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport { getTaskStatusI18nKey } from \"#/utils/status\";\nimport type { AppConversationStartTaskStatus } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport {\n OH_STATUS_ERROR_COLOR,\n OH_STATUS_SUCCESS_COLOR,\n} from \"#/constants/status-colors\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Trigger a download for a provided Blob with the given filename\n */\nexport const downloadBlob = (blob: Blob, filename: string): void => {\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n};\n\n/**\n * Get the numeric height value from an element's style property\n * @param el The HTML element to get the height from\n * @param fallback The fallback value to return if style height is invalid\n * @returns The numeric height value in pixels, or the fallback value\n *\n * @example\n * getStyleHeightPx(element, 20) // Returns 20 if element.style.height is \"auto\" or invalid\n * getStyleHeightPx(element, 20) // Returns 100 if element.style.height is \"100px\"\n */\nexport const getStyleHeightPx = (el: HTMLElement, fallback: number): number => {\n const elementHeight = parseFloat(el.style.height || \"\");\n return Number.isFinite(elementHeight) ? elementHeight : fallback;\n};\n\n/**\n * Set the height style property of an element to a specific pixel value\n * @param el The HTML element to set the height for\n * @param height The height value in pixels to set\n *\n * @example\n * setStyleHeightPx(element, 100) // Sets element.style.height to \"100px\"\n * setStyleHeightPx(textarea, 200) // Sets textarea.style.height to \"200px\"\n */\nexport const setStyleHeightPx = (el: HTMLElement, height: number): void => {\n el.style.setProperty(\"height\", `${height}px`);\n};\n\n/**\n * Detect if the user is on a mobile device.\n * Touch support alone is not sufficient — touchscreen laptops have touch\n * but use a mouse/trackpad as primary input. We check that the primary\n * pointing device is coarse (finger) to avoid false positives.\n */\nexport const isMobileDevice = (): boolean => {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent,\n )\n )\n return true;\n\n const hasTouch = \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n if (!hasTouch) return false;\n\n // If matchMedia is available, check whether the primary pointer is fine\n // (mouse/trackpad). Touchscreen laptops report fine, real mobile devices don't.\n if (typeof window.matchMedia === \"function\") {\n return !window.matchMedia(\"(pointer: fine)\").matches;\n }\n\n // Fallback: touch present but no matchMedia — assume mobile\n return true;\n};\n\n/**\n * Checks if the current domain is the production domain\n * @returns True if the current domain matches the production URL\n */\nexport const isProductionDomain = (): boolean =>\n window.location.origin === PRODUCT_URL.PRODUCTION;\n\ninterface EventActionHistory {\n args?: {\n LLM_API_KEY?: string;\n [key: string]: unknown;\n };\n extras?: {\n open_page_urls: string[];\n active_page_index: number;\n dom_object: Record<string, unknown>;\n axtree_object: Record<string, unknown>;\n extra_element_properties: Record<string, unknown>;\n last_browser_action: string;\n last_browser_action_error: unknown;\n focused_element_bid: string;\n };\n [key: string]: unknown;\n}\n\nexport const removeUnwantedKeys = (\n data: EventActionHistory[],\n): EventActionHistory[] => {\n const UNDESIRED_KEYS = [\n \"open_page_urls\",\n \"active_page_index\",\n \"dom_object\",\n \"axtree_object\",\n \"extra_element_properties\",\n \"last_browser_action\",\n \"last_browser_action_error\",\n \"focused_element_bid\",\n ];\n\n return data\n .filter((item) => {\n // Skip items that have a status key\n if (\"status\" in item) {\n return false;\n }\n return true;\n })\n .map((item) => {\n // Create a shallow copy of item\n const newItem = { ...item };\n\n // Check if extras exists and delete it from a new extras object\n if (newItem.extras) {\n const newExtras = { ...newItem.extras };\n UNDESIRED_KEYS.forEach((key) => {\n delete newExtras[key as keyof typeof newExtras];\n });\n newItem.extras = newExtras;\n }\n\n return newItem;\n });\n};\n\n/**\n * Get file extension from file name in uppercase format\n * @param fileName The file name to extract extension from\n * @returns The file extension in uppercase, or \"FILE\" if no extension found\n *\n * @example\n * getFileExtension(\"document.pdf\") // \"PDF\"\n * getFileExtension(\"image.jpeg\") // \"JPEG\"\n * getFileExtension(\"noextension\") // \"FILE\"\n */\nexport const getFileExtension = (fileName: string): string => {\n const extension = fileName.split(\".\").pop()?.toUpperCase();\n return extension || \"FILE\";\n};\n\n/**\n * Whether to use the installation-scoped repo flow\n * (`/api/v1/git/installations/search` → `/api/v1/git/repositories/search?installation_id=…`)\n * for the given provider/backend combo.\n *\n * Mirrors OpenHands' cloud frontend (parameterized by `app_mode`):\n * - bitbucket / bitbucket_data_center → always installation-based\n * - github → installation-based ONLY when the active backend is cloud\n * - gitlab / azure_devops / forgejo → direct (search) flow\n *\n * `appMode` accepts the active backend `kind` (\"local\" | \"cloud\") so call\n * sites can hand it through directly.\n */\nexport const shouldUseInstallationRepos = (\n provider: Provider | null | undefined,\n appMode?: \"local\" | \"cloud\",\n) => {\n if (!provider) return false;\n\n switch (provider) {\n case \"bitbucket\":\n case \"bitbucket_data_center\":\n return true;\n case \"github\":\n return appMode === \"cloud\";\n default:\n return false;\n }\n};\n\nexport const getGitProviderBaseUrl = (\n gitProvider: Provider,\n host?: string | null,\n): string => {\n // If custom host provided, use it (with https:// prefix if needed)\n if (host && host.trim() !== \"\") {\n return host.startsWith(\"http\") ? host : `https://${host}`;\n }\n\n // Fall back to defaults\n switch (gitProvider) {\n case \"github\":\n return \"https://github.com\";\n case \"gitlab\":\n return \"https://gitlab.com\";\n case \"bitbucket\":\n return \"https://bitbucket.org\";\n case \"azure_devops\":\n return \"https://dev.azure.com\";\n case \"forgejo\":\n // Default UI links to Codeberg unless a custom host is available in settings\n // Note: UI link builders don't currently receive host; consider plumbing settings if needed\n return \"https://codeberg.org\";\n default:\n return \"\";\n }\n};\n\n/**\n * Get the name of the git provider\n * @param gitProvider The git provider\n * @returns The name of the git provider\n */\nexport const getProviderName = (gitProvider: Provider) => {\n if (gitProvider === \"gitlab\") return \"GitLab\";\n if (gitProvider === \"bitbucket\") return \"Bitbucket\";\n if (gitProvider === \"bitbucket_data_center\") return \"Bitbucket Data Center\";\n if (gitProvider === \"azure_devops\") return \"Azure DevOps\";\n if (gitProvider === \"forgejo\") return \"Forgejo\";\n return \"GitHub\";\n};\n\n/**\n * Get the name of the PR\n * @param isGitLab Whether the git provider is GitLab\n * @returns The name of the PR\n */\nexport const getPR = (isGitLab: boolean) =>\n isGitLab ? \"merge request\" : \"pull request\";\n\n/**\n * Get the short name of the PR\n * @param isGitLab Whether the git provider is GitLab\n * @returns The short name of the PR\n */\nexport const getPRShort = (isGitLab: boolean) => (isGitLab ? \"MR\" : \"PR\");\n\n/**\n * Construct the pull request (merge request) URL for different providers\n * @param prNumber The pull request number\n * @param provider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @returns The pull request URL\n *\n * @example\n * constructPullRequestUrl(123, \"github\", \"owner/repo\") // \"https://github.com/owner/repo/pull/123\"\n * constructPullRequestUrl(456, \"gitlab\", \"owner/repo\") // \"https://gitlab.com/owner/repo/-/merge_requests/456\"\n * constructPullRequestUrl(789, \"bitbucket\", \"owner/repo\") // \"https://bitbucket.org/owner/repo/pull-requests/789\"\n * constructPullRequestUrl(789, \"bitbucket\", \"PROJECT/repo\", \"server.com\") // \"https://server.com/projects/PROJECT/repos/repo/pull-requests/789\"\n */\nexport const constructPullRequestUrl = (\n prNumber: number,\n provider: Provider,\n repositoryName: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(provider, host);\n\n switch (provider) {\n case \"github\":\n return `${baseUrl}/${repositoryName}/pull/${prNumber}`;\n case \"forgejo\":\n return `${baseUrl}/${repositoryName}/pull/${prNumber}`;\n case \"gitlab\":\n return `${baseUrl}/${repositoryName}/-/merge_requests/${prNumber}`;\n case \"bitbucket\":\n return `${baseUrl}/${repositoryName}/pull-requests/${prNumber}`;\n case \"bitbucket_data_center\": {\n const [project, repo] = repositoryName.split(\"/\");\n return `${baseUrl}/projects/${project}/repos/${repo}/pull-requests/${prNumber}`;\n }\n case \"azure_devops\": {\n // Azure DevOps format: org/project/repo\n const parts = repositoryName.split(\"/\");\n if (parts.length === 3) {\n const [org, project, repo] = parts;\n return `${baseUrl}/${org}/${project}/_git/${repo}/pullrequest/${prNumber}`;\n }\n return \"\";\n }\n default:\n return \"\";\n }\n};\n\n/**\n * Construct the microagent URL for different providers\n * @param gitProvider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @param microagentPath The path to the microagent in the repository\n * @returns The URL to the microagent file in the Git provider\n *\n * @example\n * constructMicroagentUrl(\"github\", \"owner/repo\", \".openhands/microagents/tell-me-a-joke.md\")\n * // \"https://github.com/owner/repo/blob/main/.openhands/microagents/tell-me-a-joke.md\"\n * constructMicroagentUrl(\"gitlab\", \"owner/repo\", \"microagents/git-helper.md\")\n * // \"https://gitlab.com/owner/repo/-/blob/main/microagents/git-helper.md\"\n * constructMicroagentUrl(\"bitbucket\", \"owner/repo\", \".openhands/microagents/docker-helper.md\")\n * // \"https://bitbucket.org/owner/repo/src/main/.openhands/microagents/docker-helper.md\"\n */\nexport const constructMicroagentUrl = (\n gitProvider: Provider,\n repositoryName: string,\n microagentPath: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(gitProvider, host);\n\n switch (gitProvider) {\n case \"github\":\n return `${baseUrl}/${repositoryName}/blob/main/${microagentPath}`;\n case \"forgejo\":\n return `${baseUrl}/${repositoryName}/src/branch/main/${microagentPath}`;\n case \"gitlab\":\n return `${baseUrl}/${repositoryName}/-/blob/main/${microagentPath}`;\n case \"bitbucket\":\n return `${baseUrl}/${repositoryName}/src/main/${microagentPath}`;\n case \"bitbucket_data_center\": {\n const [project, repo] = repositoryName.split(\"/\");\n return `${baseUrl}/projects/${project}/repos/${repo}/browse/${microagentPath}?at=refs/heads/main`;\n }\n case \"azure_devops\": {\n // Azure DevOps format: org/project/repo\n const parts = repositoryName.split(\"/\");\n if (parts.length === 3) {\n const [org, project, repo] = parts;\n return `${baseUrl}/${org}/${project}/_git/${repo}?path=/${microagentPath}&version=GBmain`;\n }\n return \"\";\n }\n default:\n return \"\";\n }\n};\n\n/**\n * Extract repository owner, repo name, and file path from repository and microagent data\n * @param selectedRepository The selected repository object with full_name property\n * @param microagent The microagent object with path property\n * @returns Object containing owner, repo, and filePath\n *\n * @example\n * const { owner, repo, filePath } = extractRepositoryInfo(selectedRepository, microagent);\n */\nexport const extractRepositoryInfo = (\n selectedRepository: { full_name?: string } | null | undefined,\n microagent: { path?: string } | null | undefined,\n) => {\n const [owner, repo] = selectedRepository?.full_name?.split(\"/\") || [];\n const filePath = microagent?.path || \"\";\n\n return { owner, repo, filePath };\n};\n\n/**\n * Construct the repository URL for different providers\n * @param provider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @returns The repository URL\n *\n * @example\n * constructRepositoryUrl(\"github\", \"owner/repo\") // \"https://github.com/owner/repo\"\n * constructRepositoryUrl(\"gitlab\", \"owner/repo\") // \"https://gitlab.com/owner/repo\"\n * constructRepositoryUrl(\"bitbucket\", \"owner/repo\") // \"https://bitbucket.org/owner/repo\"\n */\nexport const constructRepositoryUrl = (\n provider: Provider,\n repositoryName: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(provider, host);\n if (provider === \"bitbucket_data_center\") {\n const [project, repo] = repositoryName.split(\"/\");\n return `${baseUrl}/projects/${project}/repos/${repo}`;\n }\n return `${baseUrl}/${repositoryName}`;\n};\n\n/**\n * Construct the branch URL for different providers\n * @param provider The git provider\n * @param repositoryName The repository name in format \"owner/repo\"\n * @param branchName The branch name\n * @param host Optional custom host for self-hosted instances\n * @returns The branch URL\n *\n * @example\n * constructBranchUrl(\"github\", \"owner/repo\", \"main\") // \"https://github.com/owner/repo/tree/main\"\n * constructBranchUrl(\"gitlab\", \"owner/repo\", \"develop\") // \"https://gitlab.com/owner/repo/-/tree/develop\"\n * constructBranchUrl(\"bitbucket\", \"owner/repo\", \"feature\") // \"https://bitbucket.org/owner/repo/src/feature\"\n * constructBranchUrl(\"bitbucket\", \"PROJECT/repo\", \"feature\", \"server.com\") // \"https://server.com/projects/PROJECT/repos/repo/browse?at=refs/heads/feature\"\n */\nexport const constructBranchUrl = (\n provider: Provider,\n repositoryName: string,\n branchName: string,\n host?: string | null,\n): string => {\n const baseUrl = getGitProviderBaseUrl(provider, host);\n\n switch (provider) {\n case \"github\":\n return `${baseUrl}/${repositoryName}/tree/${branchName}`;\n case \"forgejo\":\n return `${baseUrl}/${repositoryName}/src/branch/${branchName}`;\n case \"gitlab\":\n return `${baseUrl}/${repositoryName}/-/tree/${branchName}`;\n case \"bitbucket\":\n return `${baseUrl}/${repositoryName}/src/${branchName}`;\n case \"bitbucket_data_center\": {\n // Bitbucket Server format: /projects/{PROJECT}/repos/{repo}/browse?at=refs/heads/{branch}\n const parts = repositoryName.split(\"/\");\n if (parts.length >= 2) {\n const [project, repo] = parts;\n return `${baseUrl}/projects/${project}/repos/${repo}/browse?at=refs/heads/${branchName}`;\n }\n return \"\";\n }\n case \"azure_devops\": {\n // Azure DevOps format: org/project/repo\n const parts = repositoryName.split(\"/\");\n if (parts.length === 3) {\n const [org, project, repo] = parts;\n return `${baseUrl}/${org}/${project}/_git/${repo}?version=GB${branchName}`;\n }\n return \"\";\n }\n default:\n return \"\";\n }\n};\n\n// Git Action Prompts\n\n/**\n * Generate a git pull prompt\n * @returns The git pull prompt\n */\nexport const getGitPullPrompt = (): string =>\n \"Please pull the latest code from the repository.\";\n\n/**\n * Generate a git push prompt\n * @param gitProvider The git provider\n * @returns The git push prompt\n */\nexport const getGitPushPrompt = (gitProvider: Provider): string => {\n const providerName = getProviderName(gitProvider);\n const pr = getPR(gitProvider === \"gitlab\");\n\n return `Please push the changes to a remote branch on ${providerName}, but do NOT create a ${pr}. Check your current branch name first - if it's main, master, deploy, or another common default branch name, create a new branch with a descriptive name related to your changes. Otherwise, use the exact SAME branch name as the one you are currently on.`;\n};\n\n/**\n * Generate a create pull request prompt\n * @param gitProvider The git provider\n * @returns The create PR prompt\n */\nexport const getCreatePRPrompt = (gitProvider: Provider): string => {\n const providerName = getProviderName(gitProvider);\n const pr = getPR(gitProvider === \"gitlab\");\n const prShort = getPRShort(gitProvider === \"gitlab\");\n\n return `Please push the changes to ${providerName} and open a ${pr}. If you're on a default branch (e.g., main, master, deploy), create a new branch with a descriptive name otherwise use the current branch. If a ${pr} template exists in the repository, please follow it when creating the ${prShort} description.`;\n};\n\n/**\n * Generate a push to existing PR prompt\n * @param gitProvider The git provider\n * @returns The push to PR prompt\n */\nexport const getPushToPRPrompt = (gitProvider: Provider): string => {\n const pr = getPR(gitProvider === \"gitlab\");\n\n return `Please push the latest changes to the existing ${pr}.`;\n};\n\n/**\n * Generate a create new branch prompt\n * @returns The create new branch prompt\n */\nexport const getCreateNewBranchPrompt = (): string =>\n \"Please create a new branch with a descriptive name related to the work you plan to do.\";\n\n// Helper functions\nexport function getTotalTaskCount(\n suggestedTasks: SuggestedTaskGroup[] | undefined,\n): number {\n if (!suggestedTasks) return 0;\n return suggestedTasks.flatMap((group) => group.tasks).length;\n}\n\nexport function getLimitedTaskGroups(\n suggestedTasks: SuggestedTaskGroup[],\n maxTasks: number,\n): SuggestedTaskGroup[] {\n const limitedGroups: SuggestedTaskGroup[] = [];\n let taskCount = 0;\n\n for (const group of suggestedTasks) {\n if (taskCount >= maxTasks) break;\n\n const remainingTasksNeeded = maxTasks - taskCount;\n const tasksToShow = group.tasks.slice(0, remainingTasksNeeded);\n\n if (tasksToShow.length > 0) {\n limitedGroups.push({\n ...group,\n tasks: tasksToShow,\n });\n taskCount += tasksToShow.length;\n }\n }\n\n return limitedGroups;\n}\n\nexport function getDisplayedTaskGroups(\n suggestedTasks: SuggestedTaskGroup[] | undefined,\n isExpanded: boolean,\n): SuggestedTaskGroup[] {\n if (!suggestedTasks || suggestedTasks.length === 0) {\n return [];\n }\n\n if (isExpanded) {\n return suggestedTasks;\n }\n\n return getLimitedTaskGroups(suggestedTasks, 3);\n}\n\n/**\n * Get the repository markdown creation prompt with additional PR creation instructions\n * @param gitProvider The git provider to use for generating provider-specific text\n * @param query Optional custom query to use instead of the default prompt\n * @returns The complete prompt for creating repository markdown and PR instructions\n */\nexport const getRepoMdCreatePrompt = (\n gitProvider: Provider,\n query?: string,\n): string => {\n const providerName = getProviderName(gitProvider);\n const pr = getPR(gitProvider === \"gitlab\");\n const prShort = getPRShort(gitProvider === \"gitlab\");\n\n return `Please explore this repository. Create the file .openhands/microagents/repo.md with:\n ${\n query\n ? `- ${query}`\n : `- A description of the project\n - An overview of the file structure\n - Any information on how to run tests or other relevant commands\n - Any other information that would be helpful to a brand new developer\n Keep it short--just a few paragraphs will do.`\n }\n\nPlease push the changes to your branch on ${providerName} and create a ${pr}. Please create a meaningful branch name that describes the changes. If a ${pr} template exists in the repository, please follow it when creating the ${prShort} description.`;\n};\n\n/**\n * Get the label for a conversation status\n * @param status The conversation status\n * @returns The localized label for the status\n */\nexport const getConversationStatusLabel = (\n status: ConversationStatus,\n): string => {\n switch (status) {\n case \"STOPPED\":\n return \"COMMON$STOPPED\";\n case \"RUNNING\":\n return \"COMMON$RUNNING\";\n case \"STARTING\":\n return \"COMMON$STARTING\";\n case \"ERROR\":\n return \"COMMON$ERROR\";\n case \"ARCHIVED\":\n return \"COMMON$ARCHIVED\"; // Use STOPPED for archived conversations\n default:\n return \"COMMON$UNKNOWN\";\n }\n};\n\n// Task Tracking Utility Functions\n\n/**\n * Get the status icon for a task status\n * @param status The task status\n * @returns The emoji icon for the status\n */\nexport const getStatusIcon = (status: string) => {\n switch (status) {\n case \"todo\":\n return \"⏳\";\n case \"in_progress\":\n return \"🔄\";\n case \"done\":\n return \"✅\";\n default:\n return \"❓\";\n }\n};\n\n/**\n * Get the CSS class names for a task status badge\n * @param status The task status\n * @returns The CSS class names for styling the status badge\n */\nexport const getStatusClassName = (status: string) => {\n if (status === \"done\") {\n return \"bg-green-800 text-green-200\";\n }\n if (status === \"in_progress\") {\n return \"bg-yellow-800 text-yellow-200\";\n }\n return \"bg-tertiary text-[var(--oh-text-tertiary)]\";\n};\n\n/**\n * Helper function to apply client-side filtering based on search query\n * @param repo The Git repository to check\n * @param searchQuery The search query string\n * @returns True if the repository should be included based on the search query\n */\nexport const shouldIncludeRepository = (\n repo: GitRepository,\n searchQuery: string,\n): boolean => {\n if (!searchQuery.trim()) {\n return true;\n }\n\n const sanitizedQuery = sanitizeQuery(searchQuery);\n const sanitizedRepoName = sanitizeQuery(repo.full_name);\n return sanitizedRepoName.includes(sanitizedQuery);\n};\n\n/**\n * Get the OpenHands query string based on the provider\n * @param provider The git provider\n * @returns The query string for searching OpenHands repositories\n */\nexport const getOpenHandsQuery = (provider: Provider | null): string => {\n const providerRepositorySuffix: Record<string, string> = {\n gitlab: \"openhands-config\",\n azure_devops: \"openhands-config\",\n default: \".openhands\",\n } as const;\n\n return provider && provider in providerRepositorySuffix\n ? providerRepositorySuffix[provider]\n : providerRepositorySuffix.default;\n};\n\n/**\n * Check if a repository has the OpenHands suffix based on the provider\n * @param repo The Git repository to check\n * @param provider The git provider\n * @returns True if the repository has the OpenHands suffix\n */\nexport const hasOpenHandsSuffix = (\n repo: GitRepository,\n provider: Provider | null,\n): boolean => repo.full_name.endsWith(`/${getOpenHandsQuery(provider)}`);\n\n/**\n * Build headers for V1 API requests that require session authentication\n * @param sessionApiKey Session API key for authentication\n * @returns Headers object with X-Session-API-Key if provided\n */\nexport const buildSessionHeaders = (\n sessionApiKey?: string | null,\n): Record<string, string> => {\n const headers: Record<string, string> = {};\n if (sessionApiKey) {\n headers[\"X-Session-API-Key\"] = sessionApiKey;\n }\n return headers;\n};\n\n/**\n * Check if a task is currently being polled (loading state)\n * @param taskStatus The task status string (e.g., \"WORKING\", \"ERROR\", \"READY\")\n * @returns True if the task is in a loading state (not ERROR and not READY)\n *\n * @example\n * isTaskPolling(\"WORKING\") // Returns true\n * isTaskPolling(\"PREPARING_REPOSITORY\") // Returns true\n * isTaskPolling(\"READY\") // Returns false\n * isTaskPolling(\"ERROR\") // Returns false\n * isTaskPolling(null) // Returns false\n * isTaskPolling(undefined) // Returns false\n */\nexport const isTaskPolling = (taskStatus: string | null | undefined): boolean =>\n !!taskStatus && taskStatus !== \"ERROR\" && taskStatus !== \"READY\";\n\n/**\n * Get the appropriate color based on agent status\n * @param options Configuration object for status color calculation\n * @param options.isPausing Whether the agent is currently pausing\n * @param options.isTask Whether we're polling a task\n * @param options.taskStatus The task status string (e.g., \"ERROR\", \"READY\")\n * @param options.isStartingStatus Whether the agent is in a starting state (LOADING or INIT)\n * @param options.isStopStatus Whether the conversation status is STOPPED\n * @param options.curAgentState The current agent state\n * @returns The hex color code for the status\n *\n * @example\n * getStatusColor({\n * isPausing: false,\n * isTask: false,\n * taskStatus: undefined,\n * isStartingStatus: false,\n * isStopStatus: false,\n * curAgentState: AgentState.RUNNING\n * }) // Returns \"var(--oh-status-success)\"\n */\nexport const getStatusColor = (options: {\n isPausing: boolean;\n isTask: boolean;\n taskStatus?: string | null;\n isStartingStatus: boolean;\n isStopStatus: boolean;\n curAgentState: AgentState;\n}): string => {\n const {\n isPausing,\n isTask,\n taskStatus,\n isStartingStatus,\n isStopStatus,\n curAgentState,\n } = options;\n\n // Show pausing status\n if (isPausing) {\n return \"#FFD600\";\n }\n\n // Show task status if we're polling a task\n if (isTask && taskStatus) {\n if (taskStatus === \"ERROR\") {\n return OH_STATUS_ERROR_COLOR;\n }\n return \"#FFD600\";\n }\n\n if (isStartingStatus) {\n return \"#FFD600\";\n }\n if (isStopStatus) {\n return \"#ffffff\";\n }\n if (curAgentState === AgentState.ERROR) {\n return OH_STATUS_ERROR_COLOR;\n }\n return OH_STATUS_SUCCESS_COLOR;\n};\n\ninterface GetStatusTextArgs {\n isPausing: boolean;\n isTask: boolean;\n taskStatus?: AppConversationStartTaskStatus | null;\n taskDetail?: string | null;\n isStartingStatus: boolean;\n isStopStatus: boolean;\n curAgentState: AgentState;\n errorMessage?: string | null;\n t: (t: string) => string;\n}\n\n/**\n * Get the server status text based on agent and task state\n *\n * @param options Configuration object for status text calculation\n * @param options.isPausing Whether the agent is currently pausing\n * @param options.isTask Whether we're polling a task\n * @param options.taskStatus The task status string (e.g., \"ERROR\", \"READY\")\n * @param options.taskDetail Optional task-specific detail text\n * @param options.isStartingStatus Whether the conversation is in STARTING state\n * @param options.isStopStatus Whether the conversation is STOPPED\n * @param options.curAgentState The current agent state\n * @param options.errorMessage Optional agent error message\n * @returns Localized human-readable status text\n *\n * @example\n * getStatusText({\n * isPausing: false,\n * isTask: true,\n * taskStatus: \"STARTING_CONVERSATION\",\n * taskDetail: null,\n * isStartingStatus: false,\n * isStopStatus: false,\n * curAgentState: AgentState.RUNNING\n * }) // Returns \"Starting conversation\"\n */\nexport function getStatusText({\n isPausing = false,\n isTask,\n taskStatus,\n taskDetail,\n isStartingStatus,\n isStopStatus,\n curAgentState,\n errorMessage,\n t,\n}: GetStatusTextArgs): string {\n // Show pausing status\n if (isPausing) {\n return t(I18nKey.COMMON$STOPPING);\n }\n\n // Show task status if we're polling a task\n if (isTask && taskStatus) {\n if (taskStatus === \"ERROR\") {\n return taskDetail || t(I18nKey.CONVERSATION$ERROR_STARTING_CONVERSATION);\n }\n\n if (taskStatus === \"READY\") {\n return t(I18nKey.CONVERSATION$READY);\n }\n\n return taskDetail || t(getTaskStatusI18nKey(taskStatus));\n }\n\n if (isStartingStatus) {\n return t(I18nKey.COMMON$STARTING);\n }\n\n if (isStopStatus) {\n return t(I18nKey.COMMON$SERVER_STOPPED);\n }\n\n if (curAgentState === AgentState.ERROR) {\n return errorMessage || t(I18nKey.COMMON$ERROR);\n }\n\n return t(I18nKey.COMMON$RUNNING);\n}\n"],"mappings":"oTAiBA,SAAgB,EAAG,GAAG,EAAsB,CAC1C,OAAO,EAAA,QAAQ,EAAA,QAAK,EAAO,CAAC,CAM9B,IAAa,GAAgB,EAAY,IAA2B,CAClE,IAAM,EAAM,OAAO,IAAI,gBAAgB,EAAK,CACtC,EAAO,SAAS,cAAc,IAAI,CACxC,EAAK,KAAO,EACZ,EAAK,SAAW,EAChB,SAAS,KAAK,YAAY,EAAK,CAC/B,EAAK,OAAO,CACZ,SAAS,KAAK,YAAY,EAAK,CAC/B,OAAO,IAAI,gBAAgB,EAAI,EAapB,GAAoB,EAAiB,IAA6B,CAC7E,IAAM,EAAgB,WAAW,EAAG,MAAM,QAAU,GAAG,CACvD,OAAO,OAAO,SAAS,EAAc,CAAG,EAAgB,GAY7C,GAAoB,EAAiB,IAAyB,CACzE,EAAG,MAAM,YAAY,SAAU,GAAG,EAAO,IAAI,EASlC,MAET,iEAAiE,KAC/D,UAAU,UACX,CAEM,GAEQ,iBAAkB,QAAU,UAAU,eAAiB,EAKpE,OAAO,OAAO,YAAe,WACxB,CAAC,OAAO,WAAW,kBAAkB,CAAC,QAIxC,GATe,GAsFX,EAAoB,GACb,EAAS,MAAM,IAAI,CAAC,KAAK,EAAE,aAAa,EACtC,OAgBT,GACX,EACA,IACG,CACH,GAAI,CAAC,EAAU,MAAO,GAEtB,OAAQ,EAAR,CACE,IAAK,YACL,IAAK,wBACH,MAAO,GACT,IAAK,SACH,OAAO,IAAY,QACrB,QACE,MAAO,KAIA,GACX,EACA,IACW,CAEX,GAAI,GAAQ,EAAK,MAAM,GAAK,GAC1B,OAAO,EAAK,WAAW,OAAO,CAAG,EAAO,WAAW,IAIrD,OAAQ,EAAR,CACE,IAAK,SACH,MAAO,qBACT,IAAK,SACH,MAAO,qBACT,IAAK,YACH,MAAO,wBACT,IAAK,eACH,MAAO,wBACT,IAAK,UAGH,MAAO,uBACT,QACE,MAAO,KASA,EAAmB,GAC1B,IAAgB,SAAiB,SACjC,IAAgB,YAAoB,YACpC,IAAgB,wBAAgC,wBAChD,IAAgB,eAAuB,eACvC,IAAgB,UAAkB,UAC/B,SAQI,EAAS,GACpB,EAAW,gBAAkB,eAOlB,EAAc,GAAuB,EAAW,KAAO,KAkIvD,GACX,EACA,EACA,IACW,CACX,IAAM,EAAU,EAAsB,EAAU,EAAK,CACrD,GAAI,IAAa,wBAAyB,CACxC,GAAM,CAAC,EAAS,GAAQ,EAAe,MAAM,IAAI,CACjD,MAAO,GAAG,EAAQ,YAAY,EAAQ,SAAS,IAEjD,MAAO,GAAG,EAAQ,GAAG,KAiBV,GACX,EACA,EACA,EACA,IACW,CACX,IAAM,EAAU,EAAsB,EAAU,EAAK,CAErD,OAAQ,EAAR,CACE,IAAK,SACH,MAAO,GAAG,EAAQ,GAAG,EAAe,QAAQ,IAC9C,IAAK,UACH,MAAO,GAAG,EAAQ,GAAG,EAAe,cAAc,IACpD,IAAK,SACH,MAAO,GAAG,EAAQ,GAAG,EAAe,UAAU,IAChD,IAAK,YACH,MAAO,GAAG,EAAQ,GAAG,EAAe,OAAO,IAC7C,IAAK,wBAAyB,CAE5B,IAAM,EAAQ,EAAe,MAAM,IAAI,CACvC,GAAI,EAAM,QAAU,EAAG,CACrB,GAAM,CAAC,EAAS,GAAQ,EACxB,MAAO,GAAG,EAAQ,YAAY,EAAQ,SAAS,EAAK,wBAAwB,IAE9E,MAAO,GAET,IAAK,eAAgB,CAEnB,IAAM,EAAQ,EAAe,MAAM,IAAI,CACvC,GAAI,EAAM,SAAW,EAAG,CACtB,GAAM,CAAC,EAAK,EAAS,GAAQ,EAC7B,MAAO,GAAG,EAAQ,GAAG,EAAI,GAAG,EAAQ,QAAQ,EAAK,aAAa,IAEhE,MAAO,GAET,QACE,MAAO,KAUA,MACX,mDAOW,EAAoB,GAIxB,iDAHc,EAAgB,EAGmB,CAAa,wBAF1D,EAAM,IAAgB,SAE4D,CAAG,+PAQrF,EAAqB,GAAkC,CAClE,IAAM,EAAe,EAAgB,EAAY,CAC3C,EAAK,EAAM,IAAgB,SAAS,CAG1C,MAAO,8BAA8B,EAAa,cAAc,EAAG,mJAAmJ,EAAG,yEAFzM,EAAW,IAAgB,SAEuP,CAAQ,gBAkB/R,MACX,yFAoNW,EAAiB,GAC5B,CAAC,CAAC,GAAc,IAAe,SAAW,IAAe,QAuB9C,EAAkB,GAOjB,CACZ,GAAM,CACJ,YACA,SACA,aACA,mBACA,eACA,iBACE,EAwBJ,OArBI,EACK,UAIL,GAAU,EACR,IAAe,QACV,EAAA,sBAEF,UAGL,EACK,UAEL,EACK,UAEL,IAAkB,EAAA,WAAW,MACxB,EAAA,sBAEF,EAAA,yBAwCT,SAAgB,EAAc,CAC5B,YAAY,GACZ,SACA,aACA,aACA,mBACA,eACA,gBACA,eACA,KAC4B,CA+B5B,OA7BI,EACK,EAAE,EAAA,QAAQ,gBAAgB,CAI/B,GAAU,EACR,IAAe,QACV,GAAc,EAAE,EAAA,QAAQ,yCAAyC,CAGtE,IAAe,QACV,EAAE,EAAA,QAAQ,mBAAmB,CAG/B,GAAc,EAAE,EAAA,qBAAqB,EAAW,CAAC,CAGtD,EACK,EAAE,EAAA,QAAQ,gBAAgB,CAG/B,EACK,EAAE,EAAA,QAAQ,sBAAsB,CAGrC,IAAkB,EAAA,WAAW,MACxB,GAAgB,EAAE,EAAA,QAAQ,aAAa,CAGzC,EAAE,EAAA,QAAQ,eAAe"}
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { SuggestedTaskGroup } from "#/utils/types";
|
|
|
4
4
|
import { ConversationStatus } from "#/types/conversation-status";
|
|
5
5
|
import { GitRepository } from "#/types/git";
|
|
6
6
|
import { AgentState } from "#/types/agent-state";
|
|
7
|
+
import type { AppConversationStartTaskStatus } from "#/api/conversation-service/agent-server-conversation-service.types";
|
|
7
8
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
8
9
|
/**
|
|
9
10
|
* Trigger a download for a provided Blob with the given filename
|
|
@@ -307,7 +308,7 @@ export declare const getStatusColor: (options: {
|
|
|
307
308
|
interface GetStatusTextArgs {
|
|
308
309
|
isPausing: boolean;
|
|
309
310
|
isTask: boolean;
|
|
310
|
-
taskStatus?:
|
|
311
|
+
taskStatus?: AppConversationStartTaskStatus | null;
|
|
311
312
|
taskDetail?: string | null;
|
|
312
313
|
isStartingStatus: boolean;
|
|
313
314
|
isStopStatus: boolean;
|
package/dist/utils/utils.js
CHANGED
|
@@ -2,20 +2,21 @@ import { I18nKey as e } from "../i18n/declaration.js";
|
|
|
2
2
|
import t from "../node_modules/clsx/dist/clsx.js";
|
|
3
3
|
import { twMerge as n } from "../node_modules/tailwind-merge/dist/bundle-mjs.js";
|
|
4
4
|
import { AgentState as r } from "../types/agent-state.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getTaskStatusI18nKey as i } from "./status.js";
|
|
6
|
+
import { OH_STATUS_ERROR_COLOR as a, OH_STATUS_SUCCESS_COLOR as o } from "../constants/status-colors.js";
|
|
6
7
|
//#region src/utils/utils.ts
|
|
7
|
-
function
|
|
8
|
+
function s(...e) {
|
|
8
9
|
return n(t(e));
|
|
9
10
|
}
|
|
10
|
-
var
|
|
11
|
+
var c = (e, t) => {
|
|
11
12
|
let n = window.URL.createObjectURL(e), r = document.createElement("a");
|
|
12
13
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), window.URL.revokeObjectURL(n);
|
|
13
|
-
},
|
|
14
|
+
}, l = (e, t) => {
|
|
14
15
|
let n = parseFloat(e.style.height || "");
|
|
15
16
|
return Number.isFinite(n) ? n : t;
|
|
16
|
-
},
|
|
17
|
+
}, u = (e, t) => {
|
|
17
18
|
e.style.setProperty("height", `${t}px`);
|
|
18
|
-
},
|
|
19
|
+
}, d = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? !0 : "ontouchstart" in window || navigator.maxTouchPoints > 0 ? typeof window.matchMedia == "function" ? !window.matchMedia("(pointer: fine)").matches : !0 : !1, f = (e) => e.split(".").pop()?.toUpperCase() || "FILE", p = (e, t) => {
|
|
19
20
|
if (!e) return !1;
|
|
20
21
|
switch (e) {
|
|
21
22
|
case "bitbucket":
|
|
@@ -23,7 +24,7 @@ var s = (e, t) => {
|
|
|
23
24
|
case "github": return t === "cloud";
|
|
24
25
|
default: return !1;
|
|
25
26
|
}
|
|
26
|
-
},
|
|
27
|
+
}, m = (e, t) => {
|
|
27
28
|
if (t && t.trim() !== "") return t.startsWith("http") ? t : `https://${t}`;
|
|
28
29
|
switch (e) {
|
|
29
30
|
case "github": return "https://github.com";
|
|
@@ -33,15 +34,15 @@ var s = (e, t) => {
|
|
|
33
34
|
case "forgejo": return "https://codeberg.org";
|
|
34
35
|
default: return "";
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
-
let r =
|
|
37
|
+
}, h = (e) => e === "gitlab" ? "GitLab" : e === "bitbucket" ? "Bitbucket" : e === "bitbucket_data_center" ? "Bitbucket Data Center" : e === "azure_devops" ? "Azure DevOps" : e === "forgejo" ? "Forgejo" : "GitHub", g = (e) => e ? "merge request" : "pull request", _ = (e) => e ? "MR" : "PR", v = (e, t, n) => {
|
|
38
|
+
let r = m(e, n);
|
|
38
39
|
if (e === "bitbucket_data_center") {
|
|
39
40
|
let [e, n] = t.split("/");
|
|
40
41
|
return `${r}/projects/${e}/repos/${n}`;
|
|
41
42
|
}
|
|
42
43
|
return `${r}/${t}`;
|
|
43
|
-
},
|
|
44
|
-
let i =
|
|
44
|
+
}, y = (e, t, n, r) => {
|
|
45
|
+
let i = m(e, r);
|
|
45
46
|
switch (e) {
|
|
46
47
|
case "github": return `${i}/${t}/tree/${n}`;
|
|
47
48
|
case "forgejo": return `${i}/${t}/src/branch/${n}`;
|
|
@@ -65,17 +66,17 @@ var s = (e, t) => {
|
|
|
65
66
|
}
|
|
66
67
|
default: return "";
|
|
67
68
|
}
|
|
68
|
-
},
|
|
69
|
-
let t =
|
|
70
|
-
return `Please push the changes to ${t} and open a ${n}. If you're on a default branch (e.g., main, master, deploy), create a new branch with a descriptive name otherwise use the current branch. If a ${n} template exists in the repository, please follow it when creating the ${
|
|
71
|
-
},
|
|
72
|
-
let { isPausing: t, isTask: n, taskStatus:
|
|
73
|
-
return t ? "#FFD600" : n &&
|
|
69
|
+
}, b = () => "Please pull the latest code from the repository.", x = (e) => `Please push the changes to a remote branch on ${h(e)}, but do NOT create a ${g(e === "gitlab")}. Check your current branch name first - if it's main, master, deploy, or another common default branch name, create a new branch with a descriptive name related to your changes. Otherwise, use the exact SAME branch name as the one you are currently on.`, S = (e) => {
|
|
70
|
+
let t = h(e), n = g(e === "gitlab");
|
|
71
|
+
return `Please push the changes to ${t} and open a ${n}. If you're on a default branch (e.g., main, master, deploy), create a new branch with a descriptive name otherwise use the current branch. If a ${n} template exists in the repository, please follow it when creating the ${_(e === "gitlab")} description.`;
|
|
72
|
+
}, C = () => "Please create a new branch with a descriptive name related to the work you plan to do.", w = (e) => !!e && e !== "ERROR" && e !== "READY", T = (e) => {
|
|
73
|
+
let { isPausing: t, isTask: n, taskStatus: i, isStartingStatus: s, isStopStatus: c, curAgentState: l } = e;
|
|
74
|
+
return t ? "#FFD600" : n && i ? i === "ERROR" ? a : "#FFD600" : s ? "#FFD600" : c ? "#ffffff" : l === r.ERROR ? a : o;
|
|
74
75
|
};
|
|
75
|
-
function
|
|
76
|
-
return t ?
|
|
76
|
+
function E({ isPausing: t = !1, isTask: n, taskStatus: a, taskDetail: o, isStartingStatus: s, isStopStatus: c, curAgentState: l, errorMessage: u, t: d }) {
|
|
77
|
+
return t ? d(e.COMMON$STOPPING) : n && a ? a === "ERROR" ? o || d(e.CONVERSATION$ERROR_STARTING_CONVERSATION) : a === "READY" ? d(e.CONVERSATION$READY) : o || d(i(a)) : s ? d(e.COMMON$STARTING) : c ? d(e.COMMON$SERVER_STOPPED) : l === r.ERROR ? u || d(e.COMMON$ERROR) : d(e.COMMON$RUNNING);
|
|
77
78
|
}
|
|
78
79
|
//#endregion
|
|
79
|
-
export {
|
|
80
|
+
export { s as cn, y as constructBranchUrl, v as constructRepositoryUrl, c as downloadBlob, C as getCreateNewBranchPrompt, S as getCreatePRPrompt, f as getFileExtension, b as getGitPullPrompt, x as getGitPushPrompt, T as getStatusColor, E as getStatusText, l as getStyleHeightPx, d as isMobileDevice, w as isTaskPolling, u as setStyleHeightPx, p as shouldUseInstallationRepos };
|
|
80
81
|
|
|
81
82
|
//# sourceMappingURL=utils.js.map
|