@openhands/agent-canvas 1.17.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-DrjNsPOH.js → acp-providers-DcY_mKYa.js} +1 -1
- package/build/assets/active-backend-context-BnH4-L8h.js +2 -0
- package/build/assets/{agent-context-settings-CJUrcBut.js → agent-context-settings-D3peZkjX.js} +1 -1
- package/build/assets/{agent-profiles-service.api-Biieml2L.js → agent-profiles-service.api-DkeZaqIl.js} +1 -1
- package/build/assets/agent-profiles-settings-7yMWYjGF.js +1 -0
- package/build/assets/agent-server-client-options-EHB23gyx.js +1 -0
- package/build/assets/agent-server-config-C_x8Otd9.js +1 -0
- package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +88 -0
- package/build/assets/{agent-settings-CpY3zObk.js → agent-settings-BF8hM6wb.js} +1 -1
- package/build/assets/agent-settings-YPutBAeR.js +1 -0
- package/build/assets/alert-banner-eYyqvHL3.js +1 -0
- package/build/assets/{api-error-message-Ve79qDcN.js → api-error-message-BXo0lCI5.js} +1 -1
- package/build/assets/api-key-entry-screen-CCBvBD8u.js +1 -0
- package/build/assets/app-settings-BtYDs-Be.js +1 -0
- package/build/assets/automation-detail-BxXhb_m2.js +3 -0
- package/build/assets/{automation-export-DxY47m3T.js → automation-export-BJsfi7n2.js} +1 -1
- package/build/assets/automation-git-sync-B7o_Nbl-.js +1 -0
- package/build/assets/automation-setup-route-qaJ6lLCf.js +3 -0
- package/build/assets/{automation-templates-4C4PM8K7.js → automation-templates-Bb98r-kx.js} +1 -1
- package/build/assets/automations-list-DEPVNud3.js +1 -0
- package/build/assets/{back-nav-button-B8tH0BEp.js → back-nav-button-B2yBiVMB.js} +1 -1
- package/build/assets/backend-form-modal-DxisQV_6.js +1 -0
- package/build/assets/backend-synced-settings-badge-DLEp6cq7.js +1 -0
- package/build/assets/badge-ehL-kgeO.js +1 -0
- package/build/assets/{base-modal-DTULovNc.js → base-modal-C1a0TsSx.js} +1 -1
- package/build/assets/{bot-CLMxGFaq.js → bot-ByolqPEr.js} +1 -1
- package/build/assets/{brand-button-DxPO4Lf8.js → brand-button-CUMfjb99.js} +1 -1
- package/build/assets/{browser-C-_qBasq.js → browser-SE24Tk8g.js} +6 -6
- package/build/assets/browser-tab-HjJxHA0V.js +1 -0
- package/build/assets/canvas-extension-page-BsUGBb1T.js +1 -0
- package/build/assets/canvas-extensions-C9Tm6s_E.js +1 -0
- package/build/assets/{canvas-extensions-runtime-DdnkgJXV.js → canvas-extensions-runtime-B8kxM4rO.js} +1 -1
- package/build/assets/{chat-send-button-B3SFSIg5.js → chat-send-button-CGvc2wpE.js} +1 -1
- package/build/assets/check-Bo8s5Ylg.js +1 -0
- package/build/assets/chevron-down-Cr6Fn_wS.js +1 -0
- package/build/assets/chevron-right-CfdfRn-8.js +1 -0
- package/build/assets/circle-check-5pH3qCji.js +1 -0
- package/build/assets/circle-plus-check-toggle-BDX_ctNs.js +1 -0
- package/build/assets/{cloud-funnel-analytics-BQanUEEC.js → cloud-funnel-analytics-D5uJ_4JE.js} +1 -1
- package/build/assets/{cog-VBlRo6iw.js → cog-CAEugqtV.js} +1 -1
- package/build/assets/command-menu-CQxs4mtX.js +1 -0
- package/build/assets/commits-tab-D0xgjipP.js +1 -0
- package/build/assets/{condenser-settings-eVKFMvap.js → condenser-settings-D63NJRBT.js} +1 -1
- package/build/assets/confirmation-modal-78sd9Vny.js +1 -0
- package/build/assets/{context-menu-list-item-DDROe12Z.js → context-menu-list-item-Cm7-7Y-7.js} +1 -1
- package/build/assets/{conversation-BnjJSFf5.js → conversation-B_nweu5p.js} +8 -8
- package/build/assets/conversation-edjzrv5w.js +1 -0
- package/build/assets/conversation-panel-edjzrv5w.js +1 -0
- package/build/assets/conversation-state-store-9D_3P7q4.js +1 -0
- package/build/assets/conversation-store-DC-JlJuq.js +6 -0
- package/build/assets/{conversation-tab-empty-state-DKlzAz5c.js → conversation-tab-empty-state-B3dpJXX0.js} +1 -1
- package/build/assets/copy-to-clipboard-button-B1ljgNxO.js +1 -0
- package/build/assets/device-verify-D5QRIS_x.js +1 -0
- package/build/assets/{dropdown-classes-B9kJVDIk.js → dropdown-classes-BGvOvW2_.js} +1 -1
- package/build/assets/edit-automation-modal-D_JWSmxT.js +1 -0
- package/build/assets/empty-state-FK_s1B60.js +1 -0
- package/build/assets/{entry.client-Ds8LVp-E.js → entry.client-BMafTpjO.js} +2 -2
- package/build/assets/enum-filter-dropdown-UNaom12H.js +1 -0
- package/build/assets/environment-switch-overlay-COibRUA-.js +1 -0
- package/build/assets/error-state-Cf8LRuuY.js +1 -0
- package/build/assets/extensions-hub-C_6ahIua.js +1 -0
- package/build/assets/extensions-navigation-C5GfpzFe.js +1 -0
- package/build/assets/{external-link-DQtv7eTh.js → external-link-Bd7Tga-1.js} +1 -1
- package/build/assets/files-tab-D5PPIWI1.js +1 -0
- package/build/assets/{form-control-classes-B-z85REi.js → form-control-classes-Dbq-7YP_.js} +1 -1
- package/build/assets/format-model-name-Dfh9Udrx.js +1 -0
- package/build/assets/get-git-path-jU2zjqIB.js +1 -0
- package/build/assets/git-repo-dropdown-BoDDWXfX.js +1 -0
- package/build/assets/git-repo-dropdown-uxlFw2gn.js +1 -0
- package/build/assets/highlighted-source-view-C7pAXrT0.js +1 -0
- package/build/assets/home-BM5_Wz_R.js +1 -0
- package/build/assets/home-Ivfm7KC4.js +1 -0
- package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +1 -0
- package/build/assets/home-store-DCbei3DX.js +1 -0
- package/build/assets/hooks-service-Dnmhqc0Z.js +1 -0
- package/build/assets/index-home-td9BN2T3.js +1 -0
- package/build/assets/info-BcajzHn1.js +1 -0
- package/build/assets/install-server-modal-B81I-5OE.js +1 -0
- package/build/assets/kebab-menu-item-content-SCJBwZnp.js +1 -0
- package/build/assets/{key-CfXbJa8w.js → key-O84CMFHb.js} +1 -1
- package/build/assets/launch-ZLxI4opd.js +1 -0
- package/build/assets/list-filter-B8PQk3RA.js +1 -0
- package/build/assets/{list-todo-ByXMdY4W.js → list-todo-Caa8E1X_.js} +1 -1
- package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +27 -0
- package/build/assets/llm-settings-CODhjQzy.js +1 -0
- package/build/assets/llm-settings-CZaXYgtw.js +1 -0
- package/build/assets/{llm-subscription-service-aDNBQ7Gq.js → llm-subscription-service-CgIDc38n.js} +1 -1
- package/build/assets/loader-circle-BxJgk73D.js +1 -0
- package/build/assets/{loading-spinner-DfHI77BA.js → loading-spinner-BeLV0IXf.js} +1 -1
- package/build/assets/manage-backends-modal-cMXqCb-B.js +1 -0
- package/build/assets/manifest-bfeccb98.js +1 -0
- package/build/assets/manifest-subpage-layout-CVZgVKoY.js +1 -0
- package/build/assets/{map-provider-DXvssjw9.js → map-provider-iRs80q_6.js} +1 -1
- package/build/assets/markdown-renderer-DyFl9-mL.js +8 -0
- package/build/assets/mcp-CraxoXQv.js +1 -0
- package/build/assets/{mcp-marketplace-utils-Cn_NIMWM.js → mcp-marketplace-utils-C7PYr293.js} +1 -1
- package/build/assets/mcp-page-CteH_K0N.js +9 -0
- package/build/assets/messages-Bk1xhbU2.js +41 -0
- package/build/assets/{modal-body-DJw4xBki.js → modal-body-C24WsdFb.js} +1 -1
- package/build/assets/{modal-classes-Dg0ngBPO.js → modal-classes-B0b9eiL8.js} +1 -1
- package/build/assets/modal-close-button-DfqfB2Nj.js +1 -0
- package/build/assets/{mouse-pointer-click-DEhsSUpu.js → mouse-pointer-click-BXlRN92t.js} +1 -1
- package/build/assets/onboarding-DXFBRqEy.js +1 -0
- package/build/assets/onboarding-modal-BT3Gx_sZ.js +1 -0
- package/build/assets/{organization-service.api-Cyg1Tn03.js → organization-service.api-B5CvmnYQ.js} +1 -1
- package/build/assets/{pencil-D5c47kyN.js → pencil-q-ihqDYv.js} +1 -1
- package/build/assets/{pin-C7vMagvf.js → pin-BdroVQdN.js} +1 -1
- package/build/assets/planner-tab-CstoOlAB.js +1 -0
- package/build/assets/{plug-CeaqeF6u.js → plug-7ACOEbMs.js} +1 -1
- package/build/assets/{plugins-management-service-Bh_pBuf-.js → plugins-management-service-5rqVPEGN.js} +1 -1
- package/build/assets/plus-C2e21TFC.js +1 -0
- package/build/assets/{profiles-service.api-BbOK0EkF.js → profiles-service.api-D1XKMgr0.js} +1 -1
- package/build/assets/providers-XmZ9HM4Q.js +1 -0
- package/build/assets/proxy-XP6U1Dhv.js +1 -0
- package/build/assets/{puzzle-DdAqbUrb.js → puzzle-LJYnuxKe.js} +1 -1
- package/build/assets/react-BX7IV650.js +1 -0
- package/build/assets/recommended-automations-launcher-DEHRKIAg.js +1 -0
- package/build/assets/{refresh-cw-DEQdPCpH.js → refresh-cw-BtdC3T8P.js} +1 -1
- package/build/assets/root-CM6IZHlg.css +1 -0
- package/build/assets/root-DdFkodKW.js +2 -0
- package/build/assets/root-layout-DUquNZTU.js +2 -0
- package/build/assets/schema-field-Y3F8JvXd.js +1 -0
- package/build/assets/sdk-section-page-CNZTLwH9.js +1 -0
- package/build/assets/secret-form-9-BoGA40.js +1 -0
- package/build/assets/{secrets-service-Cr8g8xuv.js → secrets-service-BOIsfD9j.js} +1 -1
- package/build/assets/secrets-settings-CBJgFr42.js +1 -0
- package/build/assets/settings-D4hdToD4.js +1 -0
- package/build/assets/settings-dropdown-input-DBvsZ7-Q.js +1 -0
- package/build/assets/settings-index-DeQphyBK.js +1 -0
- package/build/assets/settings-input-dVuzapBA.js +1 -0
- package/build/assets/{settings-list-classes-Ds4jPBHK.js → settings-list-classes-DhAPuXm6.js} +1 -1
- package/build/assets/settings-modal-tHiJ8iYV.js +1 -0
- package/build/assets/settings-nav-GAQjW1a-.js +16 -0
- package/build/assets/{settings-service.api-9_xdv_mh.js → settings-service.api-C1vZH9Vh.js} +1 -1
- package/build/assets/settings-switch-DDd1cQ8t.js +1 -0
- package/build/assets/{settings-utils-8GIIgOQL.js → settings-utils-BTaaRhLZ.js} +1 -1
- package/build/assets/shared-conversation-Cyg7m7ns.js +1 -0
- package/build/assets/{shield-check-DO7wa_eu.js → shield-check-C3Rl0NF8.js} +1 -1
- package/build/assets/{sidebar-layout-EPfWxk11.js → sidebar-layout-DH0E-5KW.js} +1 -1
- package/build/assets/sidebar-mobile-menu-toggle-CQ4iky__.js +1 -0
- package/build/assets/{sidebar-nav-link-_t4_Ef-9.js → sidebar-nav-link-oLQiKUBu.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-DbDX-Wvj.js → sidebar-onboarding-checklist-storage-TfvNNnnr.js} +1 -1
- package/build/assets/sidebar-store-DAZVH-DR.js +1 -0
- package/build/assets/skill-card-pill-row-DfjIfj0K.js +1 -0
- package/build/assets/{skill-filter-BBeZ4JEP.js → skill-filter-DsNLmn76.js} +2 -2
- package/build/assets/{skill-icon-badge-BDhQ-tQ0.js → skill-icon-badge-0MK_68Nc.js} +1 -1
- package/build/assets/skill-scope-BE-H9TSZ.js +1 -0
- package/build/assets/skills-plugins-vzSdxSk_.js +1 -0
- package/build/assets/skills-settings-BiPOH9H9.js +1 -0
- package/build/assets/{styled-tooltip-Pd22BIvr.js → styled-tooltip-CejG0rqv.js} +1 -1
- package/build/assets/task-list-tab-OkZSqnTp.js +1 -0
- package/build/assets/{terminal-onXx0_Qz.js → terminal-Dph60VFZ.js} +1 -1
- package/build/assets/{toggle-switch-lwQtxDcm.js → toggle-switch-B2uXaAUS.js} +1 -1
- package/build/assets/{trash-2-ZhKuTLiz.js → trash-2-Bb40zQzs.js} +1 -1
- package/build/assets/trash-Ckh7yCaB.js +1 -0
- package/build/assets/{triangle-alert-BajLPpQg.js → triangle-alert-DEdu-b_L.js} +1 -1
- package/build/assets/{typography-HLLg_FAn.js → typography-DgcLGdHk.js} +1 -1
- package/build/assets/usage-tab-MCmNRAnR.js +1 -0
- package/build/assets/use-acp-credential-form-ychoGqjC.js +1 -0
- package/build/assets/{use-activate-agent-profile-BLKML6vQ.js → use-activate-agent-profile-8L8Xdghy.js} +1 -1
- package/build/assets/use-agent-profiles-Bi8hSkze.js +1 -0
- package/build/assets/{use-automation-health-BZkQNEA8.js → use-automation-health-U99vvHxx.js} +1 -1
- package/build/assets/{use-automation-permissions-B_RpvL-s.js → use-automation-permissions-Buus0R6h.js} +1 -1
- package/build/assets/{use-automations-Cg0PDIZr.js → use-automations-Bq5hVuv0.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BbN6KfDr.js → use-can-manage-org-profiles-MzIeEV8F.js} +1 -1
- package/build/assets/{use-canvas-extensions-CFUpHat6.js → use-canvas-extensions-Ca9KoVEm.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-Dk0rjr63.js → use-cloud-current-user-id-B4ZLUZSa.js} +1 -1
- package/build/assets/{use-config-DpafU_QP.js → use-config-l5tkDHyD.js} +1 -1
- package/build/assets/{use-create-conversation-1YgmAHt-.js → use-create-conversation-i_PdFdIs.js} +1 -1
- package/build/assets/use-create-secret-CjWq0J4O.js +1 -0
- package/build/assets/use-free-models-gCsJ5BV0.js +1 -0
- package/build/assets/{use-get-secrets-CQ4b0qK8.js → use-get-secrets-CMTuWEp_.js} +1 -1
- package/build/assets/use-is-authed-A2Yinlt0.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-DeYa1tFM.js → use-launch-skill-in-chat-QbXDhiHr.js} +1 -1
- package/build/assets/use-llm-configured-Dl4zg8ht.js +1 -0
- package/build/assets/use-llm-profiles-SWsuFmFu.js +1 -0
- package/build/assets/{use-manifest-capabilities-AOWGcu0j.js → use-manifest-capabilities-CdqYfUAC.js} +1 -1
- package/build/assets/{use-onboarding-completion-CoINurkm.js → use-onboarding-completion-Xl63ZvzQ.js} +1 -1
- package/build/assets/{use-pinned-home-route-D6krwXjy.js → use-pinned-home-route-BXDIUaxQ.js} +1 -1
- package/build/assets/{use-plugins-marketplace-mLsIDhBv.js → use-plugins-marketplace-BIIaPiaB.js} +1 -1
- package/build/assets/use-save-agent-profile-D-ZHHE94.js +1 -0
- package/build/assets/{use-save-settings-3U5K9-8x.js → use-save-settings-Dapkf4cC.js} +1 -1
- package/build/assets/{use-settings-Dn00UISA.js → use-settings-C2KKQKVC.js} +1 -1
- package/build/assets/use-settings-nav-items-TOc0Rsfd.js +1 -0
- package/build/assets/{use-tracking-B9prBsrq.js → use-tracking-j4uo9VEW.js} +1 -1
- package/build/assets/{use-user-conversation-ZWlXtbZb.js → use-user-conversation-5UFqMoO4.js} +1 -1
- package/build/assets/{useInfiniteQuery-BzrRqjLg.js → useInfiniteQuery-CtSRG7uW.js} +1 -1
- package/build/assets/{useMutation-CJuK90oc.js → useMutation-Cszf8mKy.js} +1 -1
- package/build/assets/useQueries-pUohFMSP.js +1 -0
- package/build/assets/useQuery-DAAacS7O.js +1 -0
- package/build/assets/useTranslation-CCgUjPJF.js +1 -0
- package/build/assets/utils-BgLSZdyy.js +1 -0
- package/build/assets/{vendor~conversation-panel~conversation-4eJ0tml3.js → vendor~conversation-panel~conversation-C22sJuWZ.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js +185 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js +1 -0
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-CSFLzmTN.js → vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js} +1 -1
- package/build/assets/{vendor~root-layout-n8XCEXG8.js → vendor~root-layout-CcdIqs-C.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-3Idg1_U3.js → vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js} +1 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js +1 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-DgQ564nC.js → vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js} +1 -1
- package/build/assets/{verification-settings-u2POabjH.js → verification-settings-DdBpaVPz.js} +1 -1
- package/build/assets/{wrench-CkgI4rxA.js → wrench-B8Wg_nbp.js} +1 -1
- package/build/assets/{x-By6qCmtY.js → x-CX8lVGwm.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +6 -2
- package/build/locales/ca/openhands.json +6 -2
- package/build/locales/de/openhands.json +6 -2
- package/build/locales/en/openhands.json +6 -2
- package/build/locales/es/openhands.json +6 -2
- package/build/locales/fr/openhands.json +6 -2
- package/build/locales/it/openhands.json +6 -2
- package/build/locales/ja/openhands.json +6 -2
- package/build/locales/ko-KR/openhands.json +6 -2
- package/build/locales/no/openhands.json +6 -2
- package/build/locales/pt/openhands.json +6 -2
- package/build/locales/tr/openhands.json +6 -2
- package/build/locales/uk/openhands.json +6 -2
- package/build/locales/zh-CN/openhands.json +6 -2
- package/build/locales/zh-TW/openhands.json +6 -2
- package/config/defaults.json +1 -1
- package/dist/api/cloud/organization-service.api.cjs.map +1 -1
- package/dist/api/cloud/organization-service.api.d.ts +9 -1
- package/dist/api/cloud/organization-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.api.cjs +1 -1
- package/dist/api/config-service/config-service.api.cjs.map +1 -1
- package/dist/api/config-service/config-service.api.js +6 -2
- package/dist/api/config-service/config-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.types.d.ts +13 -0
- package/dist/components/features/automations/automation-card.cjs +1 -1
- package/dist/components/features/automations/automation-card.cjs.map +1 -1
- package/dist/components/features/automations/automation-card.js +39 -38
- package/dist/components/features/automations/automation-card.js.map +1 -1
- package/dist/components/features/automations/automation-list-row.cjs +1 -1
- package/dist/components/features/automations/automation-list-row.cjs.map +1 -1
- package/dist/components/features/automations/automation-list-row.js +73 -72
- package/dist/components/features/automations/automation-list-row.js.map +1 -1
- package/dist/components/features/automations/build-automation-menu-items.cjs +1 -1
- package/dist/components/features/automations/build-automation-menu-items.cjs.map +1 -1
- package/dist/components/features/automations/build-automation-menu-items.d.ts +3 -1
- package/dist/components/features/automations/build-automation-menu-items.js +12 -11
- package/dist/components/features/automations/build-automation-menu-items.js.map +1 -1
- package/dist/components/features/automations/detail/configuration-section.d.ts +7 -1
- package/dist/components/features/automations/detail/detail-header.d.ts +8 -5
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +112 -112
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +62 -61
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
- package/dist/components/features/chat/model-messages.cjs +1 -1
- package/dist/components/features/chat/model-messages.cjs.map +1 -1
- package/dist/components/features/chat/model-messages.js +27 -26
- package/dist/components/features/chat/model-messages.js.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.d.ts +1 -2
- package/dist/components/features/conversation-panel/budget-display.js +12 -19
- package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +45 -44
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/home/featured-automations/build-home-automation-menu-items.d.ts +1 -2
- package/dist/components/features/home/featured-automations/build-pinned-automation-menu-items.d.ts +0 -1
- package/dist/components/features/images/image-lightbox.cjs +2 -0
- package/dist/components/features/images/image-lightbox.cjs.map +1 -0
- package/dist/components/features/images/image-lightbox.d.ts +11 -0
- package/dist/components/features/images/image-lightbox.js +37 -0
- package/dist/components/features/images/image-lightbox.js.map +1 -0
- package/dist/components/features/images/image-preview.cjs +1 -1
- package/dist/components/features/images/image-preview.cjs.map +1 -1
- package/dist/components/features/images/image-preview.d.ts +2 -1
- package/dist/components/features/images/image-preview.js +33 -13
- package/dist/components/features/images/image-preview.js.map +1 -1
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +3 -4
- package/dist/components/features/settings/cloud-settings-link.cjs +1 -1
- package/dist/components/features/settings/cloud-settings-link.cjs.map +1 -1
- package/dist/components/features/settings/cloud-settings-link.d.ts +3 -1
- package/dist/components/features/settings/cloud-settings-link.js +22 -21
- package/dist/components/features/settings/cloud-settings-link.js.map +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -1
- package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.js +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.d.ts +2 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +143 -142
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +28 -27
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.js +33 -29
- package/dist/components/providers/agent-server-ui-providers.js.map +1 -1
- package/dist/components/shared/buttons/remove-button.cjs +1 -1
- package/dist/components/shared/buttons/remove-button.cjs.map +1 -1
- package/dist/components/shared/buttons/remove-button.d.ts +2 -1
- package/dist/components/shared/buttons/remove-button.js +2 -1
- package/dist/components/shared/buttons/remove-button.js.map +1 -1
- package/dist/components/shared/free-models-note.cjs +2 -0
- package/dist/components/shared/free-models-note.cjs.map +1 -0
- package/dist/components/shared/free-models-note.d.ts +3 -0
- package/dist/components/shared/free-models-note.js +20 -0
- package/dist/components/shared/free-models-note.js.map +1 -0
- package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.js +102 -112
- package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +12 -0
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/hooks/chat/use-slash-command.cjs +1 -1
- package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
- package/dist/hooks/chat/use-slash-command.js +63 -62
- package/dist/hooks/chat/use-slash-command.js.map +1 -1
- package/dist/hooks/query/use-free-models.cjs +2 -0
- package/dist/hooks/query/use-free-models.cjs.map +1 -0
- package/dist/hooks/query/use-free-models.d.ts +23 -0
- package/dist/hooks/query/use-free-models.js +67 -0
- package/dist/hooks/query/use-free-models.js.map +1 -0
- package/dist/hooks/query/use-local-git-info.cjs.map +1 -1
- package/dist/hooks/query/use-local-git-info.js.map +1 -1
- package/dist/hooks/query/use-provider-models.cjs +1 -1
- package/dist/hooks/query/use-provider-models.cjs.map +1 -1
- package/dist/hooks/query/use-provider-models.js +34 -25
- package/dist/hooks/query/use-provider-models.js.map +1 -1
- package/dist/hooks/query/use-search-providers.cjs +1 -1
- package/dist/hooks/query/use-search-providers.cjs.map +1 -1
- package/dist/hooks/query/use-search-providers.js +31 -19
- package/dist/hooks/query/use-search-providers.js.map +1 -1
- package/dist/hooks/use-home-automation-actions.cjs +1 -1
- package/dist/hooks/use-home-automation-actions.cjs.map +1 -1
- package/dist/hooks/use-home-automation-actions.d.ts +1 -2
- package/dist/hooks/use-home-automation-actions.js +0 -1
- package/dist/hooks/use-home-automation-actions.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +6 -2
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +85 -17
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +6 -2
- package/dist/locales/ca/openhands.json +6 -2
- package/dist/locales/de/openhands.json +6 -2
- package/dist/locales/en/openhands.json +6 -2
- package/dist/locales/es/openhands.json +6 -2
- package/dist/locales/fr/openhands.json +6 -2
- package/dist/locales/it/openhands.json +6 -2
- package/dist/locales/ja/openhands.json +6 -2
- package/dist/locales/ko-KR/openhands.json +6 -2
- package/dist/locales/no/openhands.json +6 -2
- package/dist/locales/pt/openhands.json +6 -2
- package/dist/locales/tr/openhands.json +6 -2
- package/dist/locales/uk/openhands.json +6 -2
- package/dist/locales/zh-CN/openhands.json +6 -2
- package/dist/locales/zh-TW/openhands.json +6 -2
- 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/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +52 -47
- package/dist/routes/app-settings.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +137 -145
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/stores/free-models-store.cjs +2 -0
- package/dist/stores/free-models-store.cjs.map +1 -0
- package/dist/stores/free-models-store.d.ts +30 -0
- package/dist/stores/free-models-store.js +22 -0
- package/dist/stores/free-models-store.js.map +1 -0
- package/dist/utils/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +27 -6
- package/dist/utils/format-model-name.js +14 -6
- package/dist/utils/format-model-name.js.map +1 -1
- package/package.json +1 -1
- package/build/assets/active-backend-context-rZiLJRUc.js +0 -2
- package/build/assets/agent-profiles-settings-x6RvPsq7.js +0 -1
- package/build/assets/agent-server-client-options-BikiNwTa.js +0 -1
- package/build/assets/agent-server-conversation-service.api-DYFsNHKf.js +0 -88
- package/build/assets/agent-settings-BJyovpJ_.js +0 -1
- package/build/assets/alert-banner-vARz1idS.js +0 -1
- package/build/assets/api-key-entry-screen-CsMuBhoP.js +0 -1
- package/build/assets/app-settings-BaJ7nfHt.js +0 -1
- package/build/assets/automation-detail-CVoGDrKq.js +0 -3
- package/build/assets/automation-git-sync-CRMP9Bbm.js +0 -1
- package/build/assets/automation-setup-route-072beLz1.js +0 -3
- package/build/assets/automations-list-xuqTSQL4.js +0 -1
- package/build/assets/backend-form-modal-0aJmWdsa.js +0 -1
- package/build/assets/backend-synced-settings-badge-B7rKWBir.js +0 -1
- package/build/assets/badge-CcGx2TaV.js +0 -1
- package/build/assets/browser-tab-DZanIw5m.js +0 -1
- package/build/assets/canvas-extension-page-o_cWgE9B.js +0 -1
- package/build/assets/canvas-extensions-DSgNlCha.js +0 -1
- package/build/assets/check-fDEfgSzj.js +0 -1
- package/build/assets/chevron-down-CFrWHqu8.js +0 -1
- package/build/assets/chevron-right-C5roOrJu.js +0 -1
- package/build/assets/circle-check-ClTzJTdb.js +0 -1
- package/build/assets/circle-plus-check-toggle-Fr-h-mbL.js +0 -1
- package/build/assets/command-menu-BT3Ia5Ru.js +0 -1
- package/build/assets/commits-tab-2jhtaohl.js +0 -1
- package/build/assets/confirmation-modal-gIFHeZt6.js +0 -1
- package/build/assets/conversation-DZ578rOX.js +0 -1
- package/build/assets/conversation-panel-DZ578rOX.js +0 -1
- package/build/assets/conversation-state-store-D1_G_9I-.js +0 -1
- package/build/assets/conversation-store-DVVfkCsk.js +0 -6
- package/build/assets/copy-to-clipboard-button-B3w0X7WH.js +0 -1
- package/build/assets/device-verify-BfkCzyFB.js +0 -1
- package/build/assets/edit-automation-modal-BwhJ39JT.js +0 -1
- package/build/assets/empty-state-RZz0OfnY.js +0 -1
- package/build/assets/enum-filter-dropdown-C4pW0ORd.js +0 -1
- package/build/assets/environment-switch-overlay-P2ZAuzov.js +0 -1
- package/build/assets/error-state-B_5cgNPJ.js +0 -1
- package/build/assets/extensions-hub-DsaUr4ca.js +0 -1
- package/build/assets/extensions-navigation-CRMZd-FE.js +0 -1
- package/build/assets/files-tab-CCgAcVdc.js +0 -1
- package/build/assets/format-model-name-CasAP3nd.js +0 -1
- package/build/assets/get-git-path-EHrSDxTM.js +0 -1
- package/build/assets/git-repo-dropdown-D2WEQ97X.js +0 -1
- package/build/assets/git-repo-dropdown-DVeCUUXG.js +0 -1
- package/build/assets/highlighted-source-view-DjHO3SdW.js +0 -1
- package/build/assets/home-BorS_vdS.js +0 -1
- package/build/assets/home-aIMbHw5M.js +0 -1
- package/build/assets/home-automation-run-tooltip-CpHNFiFl.js +0 -1
- package/build/assets/home-store-DyXz0w6d.js +0 -1
- package/build/assets/hooks-service-C6dpRtZM.js +0 -1
- package/build/assets/index-home-zKFuKK2B.js +0 -1
- package/build/assets/info-CTIdjttz.js +0 -1
- package/build/assets/install-server-modal-DUiZMc8u.js +0 -1
- package/build/assets/kebab-menu-item-content-mm04SBD3.js +0 -1
- package/build/assets/launch-BSIf9KEg.js +0 -1
- package/build/assets/list-filter-CNpqTWVY.js +0 -1
- package/build/assets/llm-not-configured-banner-z_QRSeV0.js +0 -27
- package/build/assets/llm-settings-B-5AHMiX.js +0 -1
- package/build/assets/llm-settings-B3SjHDmA.js +0 -1
- package/build/assets/loader-circle-Dex47vVW.js +0 -1
- package/build/assets/manage-backends-modal-q1NdFisr.js +0 -1
- package/build/assets/manifest-8920b615.js +0 -1
- package/build/assets/manifest-subpage-layout-BQQy5ipR.js +0 -1
- package/build/assets/markdown-renderer-rivLvYh-.js +0 -8
- package/build/assets/mcp-CEXDhQWn.js +0 -1
- package/build/assets/mcp-page-LGYIICMG.js +0 -9
- package/build/assets/messages-DUSeANAh.js +0 -41
- package/build/assets/modal-close-button-B9j4nasm.js +0 -1
- package/build/assets/onboarding-BjFebfs5.js +0 -1
- package/build/assets/onboarding-modal-DDTjOpyd.js +0 -1
- package/build/assets/planner-tab-D8f2Y3rn.js +0 -1
- package/build/assets/plus-B3wvU06-.js +0 -1
- package/build/assets/providers-2gIIkz2N.js +0 -1
- package/build/assets/proxy-CBgMd2zf.js +0 -1
- package/build/assets/recommended-automations-launcher-YLAQTp4s.js +0 -1
- package/build/assets/root-Bye_XmEL.js +0 -2
- package/build/assets/root-Cnwwzgo0.css +0 -1
- package/build/assets/root-layout-CSAwxBGM.js +0 -2
- package/build/assets/schema-field-CK0xYNbO.js +0 -1
- package/build/assets/sdk-section-page-Da73Rs_o.js +0 -1
- package/build/assets/secret-form-CB2VwYYg.js +0 -1
- package/build/assets/secrets-settings-Bh0udeKv.js +0 -1
- package/build/assets/settings-DmyIgRxO.js +0 -1
- package/build/assets/settings-dropdown-input-DVpyD87C.js +0 -1
- package/build/assets/settings-index-BSJUFmjE.js +0 -1
- package/build/assets/settings-input-C0dd8Utu.js +0 -1
- package/build/assets/settings-modal-yStgEh2o.js +0 -1
- package/build/assets/settings-switch-B78Khmyz.js +0 -1
- package/build/assets/shared-conversation-DM96X4KV.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-D5GR5xT9.js +0 -1
- package/build/assets/sidebar-store-CSDFK0W5.js +0 -1
- package/build/assets/skill-card-pill-row-989y15jV.js +0 -1
- package/build/assets/skill-scope-Dz3kPH3P.js +0 -1
- package/build/assets/skills-plugins-e3CYGdUJ.js +0 -1
- package/build/assets/skills-settings-3e-FuHw_.js +0 -1
- package/build/assets/task-list-tab-3Jg8ywch.js +0 -1
- package/build/assets/trash-B6OIe4yX.js +0 -1
- package/build/assets/usage-tab-Cm-9j3UK.js +0 -1
- package/build/assets/use-acp-credential-form-BARcvjYE.js +0 -1
- package/build/assets/use-agent-profiles-1P91KSXz.js +0 -1
- package/build/assets/use-create-secret-D8p9ybQj.js +0 -1
- package/build/assets/use-is-authed-BRPjCRKM.js +0 -1
- package/build/assets/use-llm-configured-DGm8FiRR.js +0 -1
- package/build/assets/use-llm-profiles-BTTtpW4z.js +0 -1
- package/build/assets/use-save-agent-profile-CxyO9YG-.js +0 -1
- package/build/assets/use-settings-nav-items-vrjxTqcu.js +0 -16
- package/build/assets/useQueries-CykmpT-a.js +0 -1
- package/build/assets/useQuery-S6j94er1.js +0 -1
- package/build/assets/utils-BOco8mxR.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js +0 -185
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js +0 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-DkPlXWl9.js +0 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,n as t}from"./agent-server-client-options-BikiNwTa.js";import{f as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as r}from"./proxy-CBgMd2zf.js";import{t as i}from"./settings-CKqk8ZnH.js";var a=[`none`,`api_key`,`bearer`,`basic`,`header`,`oauth2`],o=e=>!!e&&typeof e==`object`&&!Array.isArray(e),s=e=>o(e)&&typeof e.strategy==`string`&&a.includes(e.strategy),c=/^[a-zA-Z0-9_-]+$/;function l(e){return c.test(e)}function u(e,t=`mcp`){return e.trim().replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}var d=`**********`,f=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function p(e){if(!f(e))return null;let t=e.mcpServers;return f(t)&&!(`url`in t)&&!(`command`in t)?t:e}function m(e){if(!f(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0}function h(e){return e===`**********`?!0:Array.isArray(e)?e.some(h):f(e)?Object.values(e).some(h):!1}var g=e=>e.enabled===!1?!1:void 0,_=e=>{if(e===`stdio`||e===`sse`||e===`streamable-http`)return e;if(e===`http`||e===`shttp`||e===void 0)return`http`};function v(e){let t=p(e);if(!t)return{};let n={};for(let[e,r]of Object.entries(t)){if(!f(r))continue;if(typeof r.command==`string`){n[e]={transport:`stdio`,command:r.command,...Array.isArray(r.args)&&r.args.every(e=>typeof e==`string`)&&{args:r.args},...m(r.env)&&{env:m(r.env)},...typeof r.cwd==`string`&&{cwd:r.cwd},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...r.enabled===!1&&{enabled:!1}};continue}if(typeof r.url!=`string`)continue;let t=_(r.transport);!t||t===`stdio`||(n[e]={transport:t,url:r.url,...m(r.headers)&&{headers:m(r.headers)},...s(r.auth)&&{auth:r.auth},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...typeof r.sse_read_timeout==`number`&&{sse_read_timeout:r.sse_read_timeout},...typeof r.keep_alive==`boolean`&&{keep_alive:r.keep_alive},...r.enabled===!1&&{enabled:!1}})}return n}function ee(e){return e.type===`stdio`?{transport:`stdio`,command:e.command,...e.args?.length?{args:e.args}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.enabled===!1&&{enabled:!1}}:{transport:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0?{headers:e.headers}:{},...e.auth?{auth:e.auth}:{},...e.type===`shttp`&&e.timeout!==void 0?{timeout:e.timeout}:{},...e.enabled===!1&&{enabled:!1}}}var te=(e,t)=>t.enabled===!1?{enabled:!1}:g(e)===!1?{enabled:!0}:{},y=(e,t)=>{if(!t)return e?null:void 0;let n={};for(let[e,r]of Object.entries(t))r!==`**********`&&(n[e]=r);for(let r of Object.keys(e??{}))r in t||(n[r]=null);return Object.keys(n).length>0?n:void 0},b=[`client_auth_method`,`scopes`,`client_id`,`client_secret`],x=(e,t)=>{if(t===`**********`||t===void 0)return;if(t===null)return null;if(Array.isArray(t))return h(t)||JSON.stringify(e)===JSON.stringify(t)?void 0:t;if(!f(t))return Object.is(e,t)?void 0:t;let n=f(e)?e:{},r={};for(let[e,i]of Object.entries(t)){let t=x(n[e],i);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:void 0},S=(e,t)=>{if(t===void 0)return;if(t===null)return null;let n=x(e,t),r=f(n)?{...n}:{},i=f(e)?e:{};for(let e of b)e in i&&!(e in t)&&(r[e]=null);if(Object.keys(r).length!==0)return{type:`oauth`,...r}},C=(e,t)=>{if(!e||e.strategy===t.strategy)return t;let n={...t};for(let t of Object.keys(e))t!==`strategy`&&!(t in n)&&(n[t]=null);return n},w=`Removing an individual header from header authentication is not supported yet. Replace the credential or clear authentication, then re-enter the headers you want to keep.`,T=(e,t)=>{let n=y(e?.strategy===`header`?e.headers:void 0,t.headers);if(n){if(Object.values(n).some(e=>e===null))throw Error(w);return{strategy:`header`,headers:n}}},E=(e,t)=>{let n=e?.strategy===`oauth2`?e:void 0,r=S(n?.authentication,t.authentication),i=x(n?.state,t.state);if(!(n&&r===void 0&&i===void 0))return C(e,{strategy:`oauth2`,...r!==void 0&&{authentication:r},...i!==void 0&&{state:i}})};function D(e,t){let n=te(e,t);if(t.type===`stdio`){let r=y(e.transport===`stdio`?e.env:void 0,t.env);return{transport:`stdio`,command:t.command,...t.args?.length?{args:t.args}:e.transport===`stdio`&&e.args?{args:null}:{},...r===void 0?{}:{env:r},...n}}let r=e.transport===`stdio`?void 0:e,i={transport:t.type===`sse`?`sse`:`http`,url:t.url,...n};if(t.type===`shttp`&&(t.timeout===void 0?r?.timeout!==void 0&&(i.timeout=null):i.timeout=t.timeout),t.auth)if(t.auth.strategy===`oauth2`){let e=E(r?.auth,t.auth);e!==void 0&&(i.auth=e)}else if(t.auth.strategy===`header`&&r?.auth?.strategy===`header`){let e=T(r.auth,t.auth);e!==void 0&&(i.auth=e)}else h(t.auth)||(i.auth=C(r?.auth,t.auth));else r?.auth&&(i.auth=null);return i}var O=(e,t)=>{let n=(e,t)=>{let r=f(e)?{...e}:{};if(!f(t))return r;for(let[e,i]of Object.entries(t))i===null?delete r[e]:f(i)?r[e]=n(r[e],i):r[e]=i;return r};return n(e,t)},k=`Replace or clear the stored credential before renaming this MCP server.`;function ne(e,t,n,r){if(h(n.transport===`stdio`?n.env:{auth:n.auth,headers:n.headers}))throw Error(k);let i=O(n,D(n,r));return{[e]:null,[t]:i}}function re(e,t,n){let r=u(t||n);if(!(r in e))return r;let i=1;for(;`${r}_${i}`in e;)i+=1;return`${r}_${i}`}function A(){let t=e().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function j(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),e.mcp_config&&Object.keys(e.mcp_config).length>0&&(t.mcp_config=e.mcp_config),t}function M(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function N(){let e=await r({backend:A(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:j(e),conversation_settings:M(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function P(e){let t=A(),n={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(n.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(n.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,r]of Object.entries(e.app_preferences))r!==void 0&&(n[t]=r);await r({backend:t,method:`POST`,path:`/api/v1/settings`,body:n})}async function F(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function I(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var L=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`,`enabled_skills`],R=new Set(L),z=e=>R.has(e),B=e=>{let t={},n={};for(let[r,i]of Object.entries(e))z(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},V=e=>JSON.parse(JSON.stringify(e)),H=(e,t)=>({...e??{},...t??{}});async function U(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var W={redacted:null,encrypted:null,timestamp:0},G=300*1e3,K=()=>Date.now()-W.timestamp<G,q=()=>{W={redacted:null,encrypted:null,timestamp:0}},J=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Y=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,ie=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:Y(e.username,e.password)};case`header`:return m(e.headers)??{};case`oauth2`:{let t=J(e.state)?e.state.tokens:void 0;return!J(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},X=async t=>{if(!J(t))return t;let n=J(t.mcpServers),r=n?t.mcpServers:t,i=Object.values(r).some(e=>J(e)&&J(e.auth)&&e.auth!==null)&&e().backend.kind===`cloud`,a=new Map;if(i)try{let e=await N(),t=J(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(J(n)){let t=m(n.headers);t&&a.set(e,t)}}catch{}let o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!J(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!J(t.auth))return[e,t];let n=ie(t.auth);if(n===null)return[e,t];let r={...t},i={...m(t.headers)??{},...n},o=a.get(e);if(o)for(let e of Object.keys(o))e in i||(i[e]=null);return delete r.auth,Object.keys(i).length>0?r.headers=i:delete r.headers,[e,r]}));return n?{...t,mcpServers:o}:o},Z=e=>{let t=e.misc_settings?.app_preferences,n=t?.disabled_skills,r=t?.enabled_skills;return{disabledSkills:Array.isArray(n)?n:[],enabledSkills:Array.isArray(r)?r:void 0}},Q=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of L){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=H(i.agent_settings??{},e.agent_settings??{}),n=H(i.conversation_settings??{},e.conversation_settings??{}),r={...V(i),...e,provider_tokens_set:{...i.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(r.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(r.llm_model=a.model),typeof a?.base_url==`string`&&(r.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(r.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(r.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(r.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(r.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(r.max_iterations=n.max_iterations),r.search_api_key_set=!!r.search_api_key,r},ae=class r{static async fetchSettingsFromApi(e){return U(()=>new n(t()).getSettings({exposeSecrets:e}))}static async getSettings(){if(e().backend.kind===`cloud`)try{return $(await U(()=>N()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(K()&&W.redacted)return $(Q(W.redacted));try{let e=await this.fetchSettingsFromApi();return W.redacted=e,W.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(K()&&W.encrypted)return{agentSettings:W.encrypted.agent_settings,conversationSettings:W.encrypted.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(W.encrypted)};let e=await this.fetchSettingsFromApi(`encrypted`);return W.encrypted=e,W.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(e)}}static async getSettingsSchema(){return e().backend.kind===`cloud`?await F():await new n(t()).getAgentSchema()}static async getConversationSettingsSchema(){return e().backend.kind===`cloud`?await I():await new n(t()).getConversationSchema()}static async patchMcpConfig(r){if(e().backend.kind===`cloud`){let e=await X(r);await U(()=>P({agent_settings_diff:{mcp_config:e}}))}else await U(()=>new n(t()).updateSettings({agent_settings_diff:{mcp_config:r}}));return q(),!0}static async patchMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).patchMcpServer(i,a)),q(),!0)}static async createMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).createMcpServer(i,a)),q(),!0)}static async deleteMcpServer(i){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await U(()=>new n(t()).deleteMcpServer(i)),q(),!0)}static async saveSettings(r){let{extracted:i,rest:a}=B(r),o=Object.keys(i).length>0,s={},c=a.agent_settings_diff;c&&Object.keys(c).length>0&&(s.agent_settings_diff=c);let l=a.conversation_settings_diff;if(l&&Object.keys(l).length>0&&(s.conversation_settings_diff=l),o&&(s.misc_settings_diff={app_preferences:i}),e().backend.kind===`cloud`){if(!(s.agent_settings_diff||s.conversation_settings_diff||o))return!0;let e={};s.agent_settings_diff&&(e.agent_settings_diff={...s.agent_settings_diff},`mcp_config`in e.agent_settings_diff&&(e.agent_settings_diff.mcp_config=await X(e.agent_settings_diff.mcp_config))),s.conversation_settings_diff&&(e.conversation_settings_diff=s.conversation_settings_diff),o&&(e.app_preferences=i),await U(()=>P(e))}else{if(!(s.agent_settings_diff||s.conversation_settings_diff||s.misc_settings_diff))return!0;await U(()=>new n(t()).updateSettings(s))}return q(),!0}static invalidateCache(){q()}};export{D as a,h as c,c as d,l as f,re as i,v as l,s as m,k as n,ne as o,u as p,d as r,g as s,ae as t,ee as u};
|
|
1
|
+
import{c as e,n as t}from"./agent-server-client-options-EHB23gyx.js";import{f as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as r}from"./proxy-XP6U1Dhv.js";import{t as i}from"./settings-CKqk8ZnH.js";var a=[`none`,`api_key`,`bearer`,`basic`,`header`,`oauth2`],o=e=>!!e&&typeof e==`object`&&!Array.isArray(e),s=e=>o(e)&&typeof e.strategy==`string`&&a.includes(e.strategy),c=/^[a-zA-Z0-9_-]+$/;function l(e){return c.test(e)}function u(e,t=`mcp`){return e.trim().replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}var d=`**********`,f=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function p(e){if(!f(e))return null;let t=e.mcpServers;return f(t)&&!(`url`in t)&&!(`command`in t)?t:e}function m(e){if(!f(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0}function h(e){return e===`**********`?!0:Array.isArray(e)?e.some(h):f(e)?Object.values(e).some(h):!1}var g=e=>e.enabled===!1?!1:void 0,_=e=>{if(e===`stdio`||e===`sse`||e===`streamable-http`)return e;if(e===`http`||e===`shttp`||e===void 0)return`http`};function v(e){let t=p(e);if(!t)return{};let n={};for(let[e,r]of Object.entries(t)){if(!f(r))continue;if(typeof r.command==`string`){n[e]={transport:`stdio`,command:r.command,...Array.isArray(r.args)&&r.args.every(e=>typeof e==`string`)&&{args:r.args},...m(r.env)&&{env:m(r.env)},...typeof r.cwd==`string`&&{cwd:r.cwd},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...r.enabled===!1&&{enabled:!1}};continue}if(typeof r.url!=`string`)continue;let t=_(r.transport);!t||t===`stdio`||(n[e]={transport:t,url:r.url,...m(r.headers)&&{headers:m(r.headers)},...s(r.auth)&&{auth:r.auth},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...typeof r.sse_read_timeout==`number`&&{sse_read_timeout:r.sse_read_timeout},...typeof r.keep_alive==`boolean`&&{keep_alive:r.keep_alive},...r.enabled===!1&&{enabled:!1}})}return n}function ee(e){return e.type===`stdio`?{transport:`stdio`,command:e.command,...e.args?.length?{args:e.args}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.enabled===!1&&{enabled:!1}}:{transport:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0?{headers:e.headers}:{},...e.auth?{auth:e.auth}:{},...e.type===`shttp`&&e.timeout!==void 0?{timeout:e.timeout}:{},...e.enabled===!1&&{enabled:!1}}}var te=(e,t)=>t.enabled===!1?{enabled:!1}:g(e)===!1?{enabled:!0}:{},y=(e,t)=>{if(!t)return e?null:void 0;let n={};for(let[e,r]of Object.entries(t))r!==`**********`&&(n[e]=r);for(let r of Object.keys(e??{}))r in t||(n[r]=null);return Object.keys(n).length>0?n:void 0},b=[`client_auth_method`,`scopes`,`client_id`,`client_secret`],x=(e,t)=>{if(t===`**********`||t===void 0)return;if(t===null)return null;if(Array.isArray(t))return h(t)||JSON.stringify(e)===JSON.stringify(t)?void 0:t;if(!f(t))return Object.is(e,t)?void 0:t;let n=f(e)?e:{},r={};for(let[e,i]of Object.entries(t)){let t=x(n[e],i);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:void 0},S=(e,t)=>{if(t===void 0)return;if(t===null)return null;let n=x(e,t),r=f(n)?{...n}:{},i=f(e)?e:{};for(let e of b)e in i&&!(e in t)&&(r[e]=null);if(Object.keys(r).length!==0)return{type:`oauth`,...r}},C=(e,t)=>{if(!e||e.strategy===t.strategy)return t;let n={...t};for(let t of Object.keys(e))t!==`strategy`&&!(t in n)&&(n[t]=null);return n},w=`Removing an individual header from header authentication is not supported yet. Replace the credential or clear authentication, then re-enter the headers you want to keep.`,T=(e,t)=>{let n=y(e?.strategy===`header`?e.headers:void 0,t.headers);if(n){if(Object.values(n).some(e=>e===null))throw Error(w);return{strategy:`header`,headers:n}}},E=(e,t)=>{let n=e?.strategy===`oauth2`?e:void 0,r=S(n?.authentication,t.authentication),i=x(n?.state,t.state);if(!(n&&r===void 0&&i===void 0))return C(e,{strategy:`oauth2`,...r!==void 0&&{authentication:r},...i!==void 0&&{state:i}})};function D(e,t){let n=te(e,t);if(t.type===`stdio`){let r=y(e.transport===`stdio`?e.env:void 0,t.env);return{transport:`stdio`,command:t.command,...t.args?.length?{args:t.args}:e.transport===`stdio`&&e.args?{args:null}:{},...r===void 0?{}:{env:r},...n}}let r=e.transport===`stdio`?void 0:e,i={transport:t.type===`sse`?`sse`:`http`,url:t.url,...n};if(t.type===`shttp`&&(t.timeout===void 0?r?.timeout!==void 0&&(i.timeout=null):i.timeout=t.timeout),t.auth)if(t.auth.strategy===`oauth2`){let e=E(r?.auth,t.auth);e!==void 0&&(i.auth=e)}else if(t.auth.strategy===`header`&&r?.auth?.strategy===`header`){let e=T(r.auth,t.auth);e!==void 0&&(i.auth=e)}else h(t.auth)||(i.auth=C(r?.auth,t.auth));else r?.auth&&(i.auth=null);return i}var O=(e,t)=>{let n=(e,t)=>{let r=f(e)?{...e}:{};if(!f(t))return r;for(let[e,i]of Object.entries(t))i===null?delete r[e]:f(i)?r[e]=n(r[e],i):r[e]=i;return r};return n(e,t)},k=`Replace or clear the stored credential before renaming this MCP server.`;function ne(e,t,n,r){if(h(n.transport===`stdio`?n.env:{auth:n.auth,headers:n.headers}))throw Error(k);let i=O(n,D(n,r));return{[e]:null,[t]:i}}function re(e,t,n){let r=u(t||n);if(!(r in e))return r;let i=1;for(;`${r}_${i}`in e;)i+=1;return`${r}_${i}`}function A(){let t=e().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function j(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),e.mcp_config&&Object.keys(e.mcp_config).length>0&&(t.mcp_config=e.mcp_config),t}function M(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function N(){let e=await r({backend:A(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:j(e),conversation_settings:M(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function P(e){let t=A(),n={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(n.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(n.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,r]of Object.entries(e.app_preferences))r!==void 0&&(n[t]=r);await r({backend:t,method:`POST`,path:`/api/v1/settings`,body:n})}async function F(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function I(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var L=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`,`enabled_skills`],R=new Set(L),z=e=>R.has(e),B=e=>{let t={},n={};for(let[r,i]of Object.entries(e))z(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},V=e=>JSON.parse(JSON.stringify(e)),H=(e,t)=>({...e??{},...t??{}});async function U(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var W={redacted:null,encrypted:null,timestamp:0},G=300*1e3,K=()=>Date.now()-W.timestamp<G,q=()=>{W={redacted:null,encrypted:null,timestamp:0}},J=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Y=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,ie=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:Y(e.username,e.password)};case`header`:return m(e.headers)??{};case`oauth2`:{let t=J(e.state)?e.state.tokens:void 0;return!J(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},X=async t=>{if(!J(t))return t;let n=J(t.mcpServers),r=n?t.mcpServers:t,i=Object.values(r).some(e=>J(e)&&J(e.auth)&&e.auth!==null)&&e().backend.kind===`cloud`,a=new Map;if(i)try{let e=await N(),t=J(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(J(n)){let t=m(n.headers);t&&a.set(e,t)}}catch{}let o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!J(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!J(t.auth))return[e,t];let n=ie(t.auth);if(n===null)return[e,t];let r={...t},i={...m(t.headers)??{},...n},o=a.get(e);if(o)for(let e of Object.keys(o))e in i||(i[e]=null);return delete r.auth,Object.keys(i).length>0?r.headers=i:delete r.headers,[e,r]}));return n?{...t,mcpServers:o}:o},Z=e=>{let t=e.misc_settings?.app_preferences,n=t?.disabled_skills,r=t?.enabled_skills;return{disabledSkills:Array.isArray(n)?n:[],enabledSkills:Array.isArray(r)?r:void 0}},Q=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of L){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=H(i.agent_settings??{},e.agent_settings??{}),n=H(i.conversation_settings??{},e.conversation_settings??{}),r={...V(i),...e,provider_tokens_set:{...i.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(r.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(r.llm_model=a.model),typeof a?.base_url==`string`&&(r.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(r.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(r.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(r.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(r.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(r.max_iterations=n.max_iterations),r.search_api_key_set=!!r.search_api_key,r},ae=class r{static async fetchSettingsFromApi(e){return U(()=>new n(t()).getSettings({exposeSecrets:e}))}static async getSettings(){if(e().backend.kind===`cloud`)try{return $(await U(()=>N()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(K()&&W.redacted)return $(Q(W.redacted));try{let e=await this.fetchSettingsFromApi();return W.redacted=e,W.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(K()&&W.encrypted)return{agentSettings:W.encrypted.agent_settings,conversationSettings:W.encrypted.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(W.encrypted)};let e=await this.fetchSettingsFromApi(`encrypted`);return W.encrypted=e,W.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(e)}}static async getSettingsSchema(){return e().backend.kind===`cloud`?await F():await new n(t()).getAgentSchema()}static async getConversationSettingsSchema(){return e().backend.kind===`cloud`?await I():await new n(t()).getConversationSchema()}static async patchMcpConfig(r){if(e().backend.kind===`cloud`){let e=await X(r);await U(()=>P({agent_settings_diff:{mcp_config:e}}))}else await U(()=>new n(t()).updateSettings({agent_settings_diff:{mcp_config:r}}));return q(),!0}static async patchMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).patchMcpServer(i,a)),q(),!0)}static async createMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).createMcpServer(i,a)),q(),!0)}static async deleteMcpServer(i){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await U(()=>new n(t()).deleteMcpServer(i)),q(),!0)}static async saveSettings(r){let{extracted:i,rest:a}=B(r),o=Object.keys(i).length>0,s={},c=a.agent_settings_diff;c&&Object.keys(c).length>0&&(s.agent_settings_diff=c);let l=a.conversation_settings_diff;if(l&&Object.keys(l).length>0&&(s.conversation_settings_diff=l),o&&(s.misc_settings_diff={app_preferences:i}),e().backend.kind===`cloud`){if(!(s.agent_settings_diff||s.conversation_settings_diff||o))return!0;let e={};s.agent_settings_diff&&(e.agent_settings_diff={...s.agent_settings_diff},`mcp_config`in e.agent_settings_diff&&(e.agent_settings_diff.mcp_config=await X(e.agent_settings_diff.mcp_config))),s.conversation_settings_diff&&(e.conversation_settings_diff=s.conversation_settings_diff),o&&(e.app_preferences=i),await U(()=>P(e))}else{if(!(s.agent_settings_diff||s.conversation_settings_diff||s.misc_settings_diff))return!0;await U(()=>new n(t()).updateSettings(s))}return q(),!0}static invalidateCache(){q()}};export{D as a,h as c,c as d,l as f,re as i,v as l,s as m,k as n,ne as o,u as p,d as r,g as s,ae as t,ee as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{n as o}from"./toggle-switch-B2uXaAUS.js";var s=e(t(),1),c=n();function l({children:e,testId:t,name:n,onToggle:l,defaultIsToggled:u,isToggled:d,isBeta:f,isDisabled:p,togglePosition:m=`left`}){let{t:h}=r(`openhands`),[g,_]=s.useState(u??!1),v=e=>{p||(_(e),l?.(e))},y=(0,c.jsx)(`input`,{hidden:!0,"data-testid":t,name:n,type:`checkbox`,onChange:e=>v(e.target.checked),checked:d??g,disabled:p}),b=(0,c.jsx)(o,{enabled:d??g}),x=e||f?(0,c.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(`span`,{className:`text-sm`,children:e}),f&&(0,c.jsx)(`span`,{className:`text-[11px] leading-4 text-base font-[500] tracking-tighter bg-primary px-1 rounded-full`,children:h(i.BADGE$BETA)})]}):null;return(0,c.jsxs)(`label`,{className:a(`flex items-center gap-2`,m===`right`?`w-full justify-between`:`w-fit`,p?`cursor-not-allowed opacity-50`:`cursor-pointer`),children:[y,m===`right`?(0,c.jsxs)(c.Fragment,{children:[x,b]}):(0,c.jsxs)(c.Fragment,{children:[b,x]})]})}export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./map-provider-
|
|
1
|
+
import{t as e}from"./map-provider-iRs80q_6.js";var t=t=>{let n=t.get(`llm-provider-input`)?.toString(),r=n?e(n):void 0,i=t.get(`llm-model-input`)?.toString();return{llmModel:r&&i?`${r}/${i}`:void 0,llmApiKey:t.get(`llm-api-key-input`)?.toString(),agent:t.get(`agent`)?.toString(),language:t.get(`language`)?.toString()}},n=e=>{let{llmModel:n,llmApiKey:r,agent:i,language:a}=t(e),o={};n&&(o.model=n),r!==void 0&&(o.api_key=r);let s={};return Object.keys(o).length>0&&(s.llm=o),i&&(s.agent=i),{...Object.keys(s).length>0?{agent_settings_diff:s}:{},...a?{language:a}:{}}};function r(e,t){return!!(t?.hide_llm_settings&&e===`/settings/llm`)}function i(e){return[{path:`/settings/agents`,hidden:!1},{path:`/settings/llm`,hidden:!!e?.hide_llm_settings},{path:`/settings`,hidden:!!e?.hide_llm_settings},{path:`/settings/app`,hidden:!1},{path:`/settings/secrets`,hidden:!1}].find(e=>!e.hidden)?.path??null}export{i as n,r,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{B as r,U as i,c as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as o}from"./useInfiniteQuery-CtSRG7uW.js";import{t as s}from"./useQuery-DAAacS7O.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{K as l}from"./utils-BgLSZdyy.js";import{n as u}from"./agent-server-client-options-EHB23gyx.js";import{t as d}from"./messages-Bk1xhbU2.js";import{c as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as p}from"./loading-spinner-BeLV0IXf.js";import{t as m}from"./openhands-logo-BS-Epajy.js";import{O as h,m as g}from"./markdown-renderer-DyFl9-mL.js";var _=e(t(),1),v=e=>s({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new f(u()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>o({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new f(u()).searchSharedEvents({conversationId:e,limit:100,pageId:t})},initialPageParam:void 0,getNextPageParam:e=>e.next_page_id??void 0,enabled:!!e,retry:!1}),b=({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:n,threshold:r=100})=>{let i=(0,_.useRef)(null),a=(0,_.useCallback)(()=>{if(!i.current||t||!e)return;let{scrollTop:a,scrollHeight:o,clientHeight:s}=i.current;a+s>=o-r&&n()},[e,t,n,r]);return(0,_.useEffect)(()=>{let e=i.current;if(e)return e.addEventListener(`scroll`,a),()=>{e.removeEventListener(`scroll`,a)}},[a]),i},x=n(),S=i(function(){let{t:e}=c(`openhands`),{conversationId:t}=r(),{data:n,isLoading:i,error:o}=v(t),{data:s,isLoading:u,error:f,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=i||u,E=o||f,D=_.useMemo(()=>s?.pages?s.pages.flatMap(e=>e.items):[],[s?.pages]),O=_.useMemo(()=>D.reduce((e,t)=>h(t,e),[]).filter(g),[D]),k=b({hasNextPage:!!S,isFetchingNextPage:w,fetchNextPage:C});return T?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(p,{size:`large`})}):E||!n?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(`div`,{className:`text-white`,children:e(l.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(a,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(l.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(m,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(l.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(d,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(l.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(p,{size:`small`})})]})})]})});export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-
|
|
1
|
+
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";var t=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./utils-
|
|
1
|
+
import{t as e}from"./utils-BgLSZdyy.js";var t=`transition-none motion-reduce:transition-none`,n=`flex h-9 w-[18px] shrink-0 items-center justify-center`,r=`relative h-9 min-h-9 max-h-9 w-full shrink-0`;function i(t){return e(`flex h-10 min-h-10 shrink-0 items-center w-full`,t?`px-0`:`gap-2 pl-2.5 pr-2.5`)}var a={active:`bg-tertiary text-white font-normal`,idle:`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`};function o(t){return e(`flex flex-col gap-0.5 w-full shrink-0 items-stretch`,!t&&`pr-2.5`)}function s(n){let{indent:r=!1,collapsed:i=!1}=n??{};return e(`flex h-9 min-h-9 min-w-0 items-center rounded-md`,t,`text-sm leading-5 w-full`,i?`group gap-0 px-0 overflow-visible bg-transparent hover:bg-transparent`:`gap-2 px-2.5 overflow-hidden`,r&&!i&&`pl-7`)}function c(n){return e(`pointer-events-none absolute inset-0 z-0 rounded-md`,t,n?`bg-tertiary`:`bg-transparent group-hover:bg-[var(--oh-surface-raised)]`)}function l(t){return e(`relative z-[1] flex h-full w-full items-center justify-start pl-2.5 [&_svg]:shrink-0`,t?`text-white font-normal`:`text-[var(--oh-muted)] group-hover:text-white`)}function u(e){return e?`sr-only`:`min-w-0 truncate`}var d=e(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,t,`cursor-pointer`),f=e(`relative hidden md:block shrink-0 overflow-visible`,r),p=e(`absolute left-1/2 top-1/2 hidden h-7 w-7 -translate-x-1/2 -translate-y-1/2 md:inline-flex`,`items-center justify-center rounded-md`,t,`cursor-pointer`,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`);export{n as a,l as c,o as d,s as f,d as i,i as l,f as n,a as o,p as r,c as s,r as t,u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-BgLSZdyy.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{n as u}from"./modal-body-C24WsdFb.js";import{n as d,r as f}from"./base-modal-C1a0TsSx.js";import{_ as p,u as m}from"./form-control-classes-Dbq-7YP_.js";import{t as h}from"./brand-button-CUMfjb99.js";import{t as g}from"./agent-server-conversation-service.api-jiCopc2E.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:i}){let{t:c}=o(`openhands`),p;return p=i??(n?(0,v.jsx)(a,{ns:`openhands`,i18nKey:s.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):c(s.CONVERSATION$DELETE_WARNING)),(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:r??c(s.CONVERSATION$CONFIRM_DELETE)}),(0,v.jsx)(d,{children:p})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:c(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:c(s.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=o(`openhands`);return(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:n(s.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(s.CONVERSATION$CLOSE_CONVERSATION_WARNING)})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:n(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(s.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return i({mutationFn:e=>g.updateConversationTitle(e.conversationId,e.newTitle),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,title:t.newTitle}:e)),e.setQueryData([`user`,`conversation`,t.conversationId],e=>e&&{...e,title:t.newTitle}),{previousConversations:n}},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})};function S(e){if(!e)return null;try{let t=new URL(e);return t.hostname===`localhost`&&window.location.hostname!==`localhost`?(t.hostname=window.location.hostname,t.toString()):e}catch{return e}}var C=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{d:`M12 2C12.5523 2 13 2.44772 13 3V13.5858L15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929C7.68342 10.9024 8.31658 10.9024 8.70711 11.2929L11 13.5858V3C11 2.44772 11.4477 2 12 2ZM5 17C5.55228 17 6 17.4477 6 18V20H18V18C18 17.4477 18.4477 17 19 17C19.5523 17 20 17.4477 20 18V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V18C4 17.4477 4.44772 17 5 17Z`,fill:`currentColor`})}),w=_.createContext(null);function T({children:e}){let[t,n]=_.useState(!1),r=_.useCallback(()=>n(!0),[]),i=_.useCallback(()=>n(!1),[]),a=_.useCallback(()=>n(e=>!e),[]),o=_.useMemo(()=>({isOpen:t,open:r,close:i,toggle:a}),[t,r,i,a]);return(0,v.jsx)(w.Provider,{value:o,children:e})}function E(){let e=_.useContext(w);if(!e)throw Error(`useSidebarMobileNav must be used within SidebarMobileNavProvider`);return e}var D=c(`inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)]`,p,m),O=`size-5 shrink-0`,k=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 5.5H18C18.2761 5.5 18.5 5.72386 18.5 6V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 5.5ZM8.5 5.5H6C5.72386 5.5 5.5 5.72386 5.5 6V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 5.5ZM18 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4Z`,fill:`currentColor`})});function A(){let{t:e}=o(`openhands`),{isOpen:t,toggle:n}=E();return(0,v.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-menu-toggle`,onClick:n,"aria-expanded":t,"aria-label":e(t?s.SIDEBAR$CLOSE_MENU:s.SIDEBAR$OPEN_MENU),className:D,children:(0,v.jsx)(k,{className:O,"aria-hidden":!0})})}export{T as a,S as c,y as d,O as i,x as l,k as n,E as o,D as r,C as s,A as t,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-
|
|
1
|
+
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-BgLSZdyy.js";import{t as r}from"./pin-BdroVQdN.js";import{n as i}from"./navigation-context-CQZwH_tC.js";import{t as a}from"./navigation-link-Bxo3-4vo.js";import{a as o,c as s,f as c,o as l,s as u,t as d,u as f}from"./sidebar-layout-DH0E-5KW.js";import{t as p}from"./styled-tooltip-CejG0rqv.js";e();var m=t();function h({active:e,className:t,children:r}){return(0,m.jsxs)(`span`,{className:n(d,t),children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:u(e)}),(0,m.jsx)(`span`,{className:s(e),children:r})]})}var g=[`[@media(hover:hover)_and_(pointer:fine)]:pointer-events-none`,`[@media(hover:hover)_and_(pointer:fine)]:invisible`,`[@media(hover:hover)_and_(pointer:fine)]:opacity-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:pointer-events-auto`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:visible`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:opacity-100`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:pointer-events-auto`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:visible`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:opacity-100`],_=[`[@media(hover:hover)_and_(pointer:fine)]:opacity-100`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:opacity-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:opacity-0`],v=[`[@media(hover:hover)_and_(pointer:fine)]:min-w-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:min-w-[3.75rem]`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:min-w-[3.75rem]`],y=[`[@media(hover:hover)_and_(pointer:fine)]:flex`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:hidden`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:hidden`];function b(e=!1){return e?`pointer-events-auto visible opacity-100`:n(`pointer-events-auto visible opacity-100`,...g)}function x(e=!1){return e?`opacity-0`:n(`opacity-0`,..._)}function S(e=!1){return e?`min-w-[3.75rem]`:n(`min-w-[3.75rem]`,...v)}function C(e=!1){return e?`hidden`:n(`hidden`,...y)}function w(e,t,n){return t===`/`||n?e===t:e===t||e.startsWith(`${t}/`)}function T({to:e,label:t,end:s=!1,indent:u=!1,testId:d,disabled:g=!1,icon:_,collapsed:v=!1,hoverContent:y,forceActive:x=!1,pinAction:S}){let{currentPath:C}=i(),T=x||w(C,e,s),E=!v&&S!=null,D=(0,m.jsxs)(a,{to:e,end:s,"data-testid":d,tabIndex:g?-1:0,"aria-label":v?t:void 0,"aria-disabled":g||void 0,onClick:e=>{g&&e.preventDefault()},className:n(c({indent:u,collapsed:v}),!v&&(T?l.active:l.idle),g&&`opacity-50`,g&&`pointer-events-none`,E&&`pr-9`),children:[_?v?(0,m.jsx)(h,{active:T,children:_}):(0,m.jsx)(`span`,{className:o,children:_}):null,(0,m.jsx)(`span`,{className:f(v),children:t})]});return v?(0,m.jsx)(p,{content:y??t,placement:`right`,tooltipClassName:y?`p-0 bg-tertiary text-white`:void 0,children:D}):S?(0,m.jsxs)(`div`,{className:`group relative`,children:[D,(0,m.jsx)(`button`,{type:`button`,"data-testid":S.testId,"aria-pressed":S.pinned,"aria-label":S.label,onClick:e=>{e.preventDefault(),e.stopPropagation(),S.onToggle()},className:n(`absolute right-1.5 top-1/2 -translate-y-1/2`,`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`,b(S.pinned)),children:(0,m.jsx)(r,{className:n(`h-3.5 w-3.5`,S.pinned&&`fill-current`),"aria-hidden":!0})})]}):D}export{x as a,S as i,b as n,h as o,C as r,T as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{K as e}from"./utils-
|
|
1
|
+
import{K as e}from"./utils-BgLSZdyy.js";var t=`https://docs.openhands.dev/openhands/usage/agent-canvas/prebuilt-automations`,n=`https://openhands.dev/joinslack`,r=`openhands-sidebar-onboarding-checklist-dismissed`,i=`openhands-sidebar-onboarding-checklist-dismissed-change`,a=`openhands-sidebar-onboarding-checklist-minimized`,o=`openhands-sidebar-onboarding-checklist-customize-explored`,s=`openhands-sidebar-onboarding-checklist-slack-joined`,c=[`configure-llm`,`start-conversation`,`schedule-task`,`customize-agent`,`connect-mcp`,`join-slack`],l={"configure-llm":`/settings/llm`,"connect-mcp":`/mcp`,"start-conversation":`/conversations`,"schedule-task":`/automations`,"customize-agent":`/settings/agents`},u={"configure-llm":`configure_llm`,"start-conversation":`start_conversation`,"schedule-task":`schedule_task`,"customize-agent":`customize_agent`,"connect-mcp":`connect_mcp`,"join-slack":`join_slack`},d={"configure-llm":`settings`,"start-conversation":`conversation`,"schedule-task":`automation`,"customize-agent":`settings`,"connect-mcp":`integration`,"join-slack":`community`};function f(e){return e===`join-slack`}function p(e){return f(e)?{kind:`external`,href:n}:{kind:`internal`,href:l[e]}}var m={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_CONFIGURE_LLM,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_CONNECT_MCP,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_START_CHAT,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_SCHEDULE_TASK,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_CUSTOMIZE,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_JOIN_SLACK},h={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_CONFIGURE_LLM_DESC,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_CONNECT_MCP_DESC,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_START_CHAT_DESC,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_SCHEDULE_TASK_DESC,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_CUSTOMIZE_DESC,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_JOIN_SLACK_DESC},g={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CONFIGURE_LLM,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CONNECT_MCP,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_START_CHAT,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_SCHEDULE_TASK,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CUSTOMIZE,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_JOIN_SLACK},_={"configure-llm":`https://docs.openhands.dev/openhands/usage/settings/llm-settings#llm-profiles`,"start-conversation":`https://docs.openhands.dev/openhands/usage/agent-canvas/backends`,"schedule-task":t,"customize-agent":`https://docs.openhands.dev/openhands/usage/agent-canvas/customize-and-settings`,"connect-mcp":`https://docs.openhands.dev/overview/model-context-protocol`,"join-slack":`https://docs.openhands.dev/overview/community`};function v(e){return e===`/settings/agents`||e.startsWith(`/settings/agents/`)}function y(){return typeof window>`u`?!1:window.localStorage.getItem(r)===`true`}function b(){return y()}function x(e){let t=()=>e();return window.addEventListener(`storage`,t),window.addEventListener(i,t),()=>{window.removeEventListener(`storage`,t),window.removeEventListener(i,t)}}function S(e){window.localStorage.setItem(r,e?`true`:`false`),window.dispatchEvent(new Event(i))}function C(){return typeof window>`u`?!1:window.localStorage.getItem(a)===`true`}function w(e){window.localStorage.setItem(a,e?`true`:`false`)}function T(){return typeof window>`u`?!1:window.localStorage.getItem(o)===`true`}function E(e){window.localStorage.setItem(o,e?`true`:`false`)}function D(){return typeof window>`u`?!1:window.localStorage.getItem(s)===`true`}function O(e){window.localStorage.setItem(s,e?`true`:`false`)}export{u as _,D as a,f as b,S as c,g as d,h as f,c as g,m as h,C as i,w as l,_ as m,T as n,x as o,d as p,y as r,E as s,b as t,O as u,p as v,v as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t}from"./react-BX7IV650.js";import{g as n,m as r}from"./conversation-store-DC-JlJuq.js";var i=e(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),a=e(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),o=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),s=t(e=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e(e=>({isOpen:!e.isOpen}))})),c=`openhands-sidebar`,l=`openhands-sidebar-collapsed`,u=t()(n(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:c,storage:r(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(l);window.localStorage.getItem(c)===null&&(e===`true`||e===`false`)&&u.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(l)}catch{}export{i as a,a as i,s as n,o as r,u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-BgLSZdyy.js";import{i as s}from"./extension-module-card-classes-DpeaYhYo.js";var c=e(t(),1),l=e(n(),1),u=r(),d=s,f=6,p=8,m=4;function h(e,t){let n=window.innerWidth-p-t,r=e.left;return r>n&&(r=e.right-t),r=Math.min(Math.max(p,r),Math.max(p,n)),{top:e.bottom+m,left:r}}function g(e,t){if(e.length===0||t<=0)return 0;let n=0;for(let r=0;r<e.length;r+=1){let i=e[r],a=r>0?f:0,o=e.length-r-1>0?46:0;if(n+a+i+o>t)return Math.max(1,r);n+=a+i}return e.length}function _({pills:e,testId:t}){let{t:n}=i(`openhands`),r=c.useRef(null),d=c.useRef(null),f=c.useRef(null),p=c.useRef(null),[m,_]=c.useState(e.length),[v,y]=c.useState(!1),[b,x]=c.useState(null),S=c.useCallback(()=>{let e=r.current,t=d.current;!e||!t||_(g(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]),C=e.map(e=>e.id).join(``),w=c.useRef(null);c.useLayoutEffect(()=>{w.current!==C&&(w.current=C,y(!1),S())},[C,S]),c.useEffect(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>S());return t.observe(e),()=>t.disconnect()},[S]);let T=c.useCallback(()=>{let e=f.current;if(!e)return;let t=h(e.getBoundingClientRect(),p.current?.offsetWidth??e.offsetWidth);x(e=>e?.top===t.top&&e?.left===t.left?e:t)},[]);if(c.useLayoutEffect(()=>{if(!v){x(null);return}return T(),window.addEventListener(`resize`,T),window.addEventListener(`scroll`,T,!0),()=>{window.removeEventListener(`resize`,T),window.removeEventListener(`scroll`,T,!0)}},[v,T]),c.useLayoutEffect(()=>{v&&b&&p.current&&T()},[v,T,b]),c.useEffect(()=>{if(!v)return;let e=e=>{let t=e.target;f.current?.contains(t)||p.current?.contains(t)||y(!1)},t=e=>{e.key===`Escape`&&y(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]),e.length===0)return null;let E=Math.max(0,e.length-m),D=e.slice(m),O=e=>{e.stopPropagation()};return(0,u.jsxs)(`div`,{"data-testid":`${t}-wrap`,className:`min-w-0 overflow-hidden`,children:[(0,u.jsx)(`div`,{ref:d,"aria-hidden":!0,className:`pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex flex-nowrap items-center gap-1.5 opacity-0`,children:e.map(e=>(0,u.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id))}),(0,u.jsxs)(`div`,{ref:r,"data-testid":t,className:`flex w-full min-w-0 max-w-full flex-nowrap items-center gap-1.5 overflow-hidden`,children:[e.slice(0,m).map(e=>(0,u.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id)),E>0?(0,u.jsx)(`button`,{ref:f,type:`button`,"data-testid":`${t}-overflow`,"aria-expanded":v,"aria-haspopup":`dialog`,"aria-label":n(a.SETTINGS$SKILLS_PILLS_OVERFLOW_ARIA,{count:E}),onMouseDown:O,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(e=>!e)},onKeyDown:O,className:o(s,`cursor-pointer font-medium text-tertiary-alt hover:text-white`),children:n(a.SETTINGS$SKILLS_PILLS_MORE,{count:E})}):null]}),v&&b&&typeof document<`u`&&(0,l.createPortal)((0,u.jsx)(`div`,{ref:p,role:`dialog`,"data-testid":`${t}-overflow-popover`,className:o(`z-[9999] flex w-max max-w-[20rem] flex-col gap-1.5`,`rounded-md border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface)] p-2 shadow-lg`),style:{position:`fixed`,top:b.top,left:b.left},onMouseDown:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:D.map(e=>(0,u.jsx)(`div`,{"data-testid":`${t}-overflow-item`,className:`min-w-0`,children:e.node},e.id))}),document.body)]})}export{_ as n,d as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{
|
|
2
|
-
`).length)),className:s(`bg-[var(--oh-surface-raised)] border border-[var(--oh-border-subtle)] w-full min-w-0 rounded-sm p-2 text-sm`,`cursor-not-allowed resize-none custom-scrollbar`)})]})}function De({skill:e,enabled:t,onToggle:n,onClose:i}){let{t:a}=r(`openhands`),s=de(),[c,l]=D.useState(!1),u=D.useMemo(()=>Te(e),[e]),d=k(e),f=D.useMemo(()=>I(e,a,{variant:`detail`,testIdPrefix:`skill-modal-pill`}),[e,a]),p=L(e.source);return D.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,A.jsx)(m,{onClose:i,"aria-label":e.name,children:(0,A.jsxs)(`div`,{"data-testid":`skill-detail-modal`,"data-skill-name":e.name,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col overflow-hidden rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,A.jsx)(v,{onClose:i,testId:`skill-detail-modal-close`}),(0,A.jsxs)(`header`,{className:`flex flex-shrink-0 items-start gap-3 pb-4 pl-6 pr-12 pt-6`,children:[(0,A.jsx)(E,{skillName:e.name}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{"data-testid":`skill-modal-name-${e.name}`,className:g,children:e.name}),e.source?(0,A.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,A.jsx)(`p`,{"data-testid":`skill-modal-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),p?(0,A.jsx)(`button`,{type:`button`,"data-testid":`skill-modal-copy-source-${e.name}`,"aria-label":a(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async()=>{e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,A.jsx)(b,{width:12,height:12}):(0,A.jsx)(x,{width:12,height:12})}):null]}):null]})]}),(0,A.jsxs)(`div`,{"data-testid":`skill-detail-modal-content`,className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain px-6 custom-scrollbar-always`,children:[(0,A.jsx)(`div`,{"data-testid":`skill-modal-enable-row-${e.name}`,className:`flex w-full items-center rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:(0,A.jsx)(ce,{testId:`skill-modal-toggle-${e.name}`,isToggled:t,onToggle:n,togglePosition:`right`,children:a(t?o.SETTINGS$SKILLS_ENABLED:o.SETTINGS$SKILLS_DISABLED)})}),d?(0,A.jsx)(`p`,{"data-testid":`skill-modal-description-${e.name}`,className:`break-words whitespace-pre-line text-xs text-tertiary-light`,children:d}):null,f.length>0?(0,A.jsx)(S,{pills:f,testId:`skill-modal-pills-${e.name}`}):null,e.content?(0,A.jsx)(Ee,{testId:`skill-modal-field-content-${e.name}`,label:a(o.SETTINGS$SKILLS_CONTENT),value:e.content}):null]}),(0,A.jsxs)(`footer`,{"data-testid":`skill-detail-modal-actions`,className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,A.jsx)(_,{type:`button`,variant:`secondary`,onClick:i,testId:`skill-detail-close`,children:a(o.BUTTON$CLOSE)}),(0,A.jsx)(_,{type:`button`,variant:`primary`,isDisabled:!t,onClick:()=>s(u,i),testId:`skill-detail-use-skill-${e.name}`,startContent:(0,A.jsx)(T,{className:`size-4`,"aria-hidden":!0}),children:a(o.SETTINGS$SKILLS_USE_SKILL_BUTTON)})]})]})})}var Oe=[o.SETTINGS$SKILLS_ADD_MODAL_STEP_1,o.SETTINGS$SKILLS_ADD_MODAL_STEP_2,o.SETTINGS$SKILLS_ADD_MODAL_STEP_3,o.SETTINGS$SKILLS_ADD_MODAL_STEP_4,o.SETTINGS$SKILLS_ADD_MODAL_STEP_5],z={cmd:(0,A.jsx)(B,{}),path:(0,A.jsx)(B,{}),env:(0,A.jsx)(B,{})};function B({children:e}){return(0,A.jsx)(`code`,{className:s(`mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white`),children:e})}function V(){let{t:e}=r(`openhands`),[t,n]=D.useState(!1);return D.useEffect(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`pre`,{"data-testid":`add-skill-modal-example`,className:s(`overflow-x-auto rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] p-2 pr-10 text-xs text-white`),children:R}),(0,A.jsx)(`button`,{type:`button`,"data-testid":`add-skill-modal-example-copy`,"aria-label":e(t?o.BUTTON$COPIED:o.BUTTON$COPY),disabled:t,onClick:async()=>{await navigator.clipboard.writeText(R),n(!0)},className:s(`absolute right-2 top-2 cursor-pointer rounded-sm border border-[var(--oh-border-subtle)]`,`bg-base-secondary p-1 text-tertiary-alt transition-colors`,`hover:bg-[var(--oh-surface)] hover:text-white disabled:cursor-default [&_path]:fill-current`),children:t?(0,A.jsx)(b,{width:14,height:14}):(0,A.jsx)(x,{width:14,height:14})})]})}function H({i18nKey:e}){return(0,A.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:(0,A.jsx)(a,{ns:`openhands`,i18nKey:e,components:z})})}function ke({onClose:e}){let{t}=r(`openhands`);return(0,A.jsx)(m,{onClose:e,"aria-label":t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE),children:(0,A.jsxs)(`div`,{"data-testid":`add-skill-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,A.jsx)(v,{onClose:e,testId:`add-skill-modal-close`}),(0,A.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,A.jsx)(`h2`,{className:s(`pr-6`,g),children:t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE)}),(0,A.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_INTRO)})]}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,A.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}),(0,A.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}),(0,A.jsx)(V,{}),(0,A.jsx)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light`,children:Oe.map(e=>(0,A.jsx)(`li`,{children:e===o.SETTINGS$SKILLS_ADD_MODAL_STEP_3?(0,A.jsx)(a,{ns:`openhands`,i18nKey:e,components:z}):t(e)},e))})]}),(0,A.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}),(0,A.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)})]}),(0,A.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY})]}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}),(0,A.jsx)(`a`,{href:we,target:`_blank`,rel:`noreferrer`,"data-testid":`add-skill-modal-docs-link`,className:`self-start text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)})]}),(0,A.jsx)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:(0,A.jsx)(_,{type:`button`,variant:`secondary`,onClick:e,testId:`add-skill-modal-dismiss`,children:t(o.BUTTON$CLOSE)})})]})})}function Ae({search:e,onSearchChange:t,activeFilterCount:n,onOpenFilters:i}){let{t:a}=r(`openhands`);return(0,A.jsxs)(`div`,{"data-testid":`skills-toolbar`,className:`flex items-stretch gap-2`,children:[(0,A.jsxs)(`div`,{className:s(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,A.jsx)(te,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,A.jsx)(`input`,{"data-testid":`skills-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:a(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),"aria-label":a(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),className:s(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,A.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":a(o.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,A.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,A.jsxs)(`button`,{type:`button`,"data-testid":`skills-filters-button`,onClick:i,className:s(`flex shrink-0 items-center gap-2 rounded-lg px-3 py-2 text-sm md:hidden`,`border border-[var(--oh-border)] bg-base-secondary text-white`,`cursor-pointer hover:bg-[var(--oh-interactive-hover)]`),children:[(0,A.jsx)(p,{className:`size-4 shrink-0`,"aria-hidden":!0}),a(o.SETTINGS$SKILLS_FILTERS_BUTTON),n>0?(0,A.jsx)(`span`,{className:`rounded-full bg-white px-1.5 text-[11px] font-medium text-black`,children:n}):null]})]})}function je({labelKey:e,count:t,checked:n,disabled:i,icon:a,testId:o,onToggle:c}){let{t:u}=r(`openhands`),d=u(e);return(0,A.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":n,"data-testid":o,disabled:i,onClick:c,className:s(`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm`,i?`cursor-default text-tertiary-alt/40`:`cursor-pointer hover:bg-[var(--oh-surface-raised)] hover:text-white`,n?`text-white`:`text-tertiary-light`),children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:s(`flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border`,n?`border-white bg-white text-black`:`border-[var(--oh-border)]`),children:n?(0,A.jsx)(l,{className:`size-2.5`,strokeWidth:3}):null}),a?(0,A.jsx)(a,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,(0,A.jsx)(`span`,{title:d,className:`min-w-0 flex-1 truncate`,children:d}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-tertiary-alt`,children:t})]})}function Me(e,t){if(e===`category`)return N[t]}function U({groups:e,onToggle:t,className:n}){let{t:i}=r(`openhands`);return e.length===0?null:(0,A.jsx)(`div`,{"data-testid":`skill-facet-rail`,className:s(`flex min-w-0 flex-col gap-5`,n),children:e.map(e=>{let n=`skill-facet-group-${e.id}-title`;return(0,A.jsxs)(`div`,{"data-testid":`skill-facet-group-${e.id}`,role:`group`,"aria-labelledby":n,className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{id:n,className:`px-1 text-[11px] font-semibold uppercase tracking-wider text-tertiary-alt`,children:i(e.labelKey)}),e.rows.map(n=>(0,A.jsx)(je,{testId:`skill-facet-${e.id}-${n.value}`,labelKey:n.labelKey,count:n.count,checked:n.checked,disabled:n.disabled,icon:Me(e.id,n.value),onToggle:()=>t(e.id,n.value)},n.value))]},e.id)})})}function Ne({groups:e,activeCount:t,onToggle:n,onClearAll:i,onClose:a}){let{t:c}=r(`openhands`);return(0,A.jsx)(m,{onClose:a,"aria-label":c(o.SETTINGS$SKILLS_FILTERS_MODAL_TITLE),children:(0,A.jsxs)(ae,{testID:`skill-filters-modal`,className:s(`items-stretch`,h),children:[(0,A.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:c(o.SETTINGS$SKILLS_FILTERS_MODAL_TITLE)}),(0,A.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto custom-scrollbar-always`,children:(0,A.jsx)(U,{groups:e,onToggle:n})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[t>0?(0,A.jsx)(_,{type:`button`,variant:`secondary`,testId:`skill-filters-modal-clear`,onClick:i,children:c(o.SETTINGS$SKILLS_CLEAR_FILTERS)}):null,(0,A.jsx)(_,{type:`button`,variant:`primary`,testId:`skill-filters-modal-done`,onClick:a,children:c(o.BUTTON$CLOSE)})]})]})})}var Pe=`source`,Fe=`category`,Ie=`type`,Le=`state`,Re=`recommendation`,W=[`enabled`,`disabled`],G=[`recommended`,`other`],K=[`agentskills`,`knowledge`,`repo`],q={query:``,sources:new Set,categories:new Set,types:new Set,states:new Set,recommendations:new Set};function J(e,t){return e.map(e=>({value:e,labelKey:t[e]}))}function Y(e,t){return new Set(e.filter(e=>t.has(e)))}var ze={project:o.SETTINGS$SKILLS_SOURCE_PROJECT,personal:o.SETTINGS$SKILLS_SOURCE_PERSONAL,public:o.SETTINGS$SKILLS_SOURCE_PUBLIC},Be={agentskills:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS,knowledge:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE,repo:o.SETTINGS$SKILLS_TYPE_REPO},Ve={enabled:o.SETTINGS$SKILLS_ENABLED,disabled:o.SETTINGS$SKILLS_DISABLED},He={recommended:o.SETTINGS$SKILLS_RECOMMENDED,other:o.SETTINGS$SKILLS_RECOMMENDATION_OTHER},X=[{id:`state`,labelKey:o.SETTINGS$SKILLS_FACET_STATE,param:Le,values:J(W,Ve),valueOf:(e,t)=>t(e)?`enabled`:`disabled`,selected:e=>e.states,withSelected:(e,t)=>({...e,states:Y(W,t)})},{id:`recommendation`,labelKey:o.SETTINGS$SKILLS_FACET_RECOMMENDATION,param:Re,values:J(G,He),valueOf:e=>y(e.name)?`recommended`:`other`,selected:e=>e.recommendations,withSelected:(e,t)=>({...e,recommendations:Y(G,t)})},{id:`source`,labelKey:o.SETTINGS$SKILLS_FACET_SOURCE,param:Pe,values:J(w,ze),valueOf:e=>ue(e),selected:e=>e.sources,withSelected:(e,t)=>({...e,sources:Y(w,t)})},{id:`category`,labelKey:o.SETTINGS$SKILLS_FACET_CATEGORY,param:Fe,values:J(j,M),valueOf:e=>P(e),selected:e=>e.categories,withSelected:(e,t)=>({...e,categories:Y(j,t)})},{id:`type`,labelKey:o.SETTINGS$SKILLS_FACET_TYPE,param:Ie,values:J(K,Be),valueOf:e=>e.type,selected:e=>e.types,withSelected:(e,t)=>({...e,types:Y(K,t)})}];function Ue(e){let t=X.find(t=>t.id===e);if(!t)throw Error(`Unknown skill facet group: ${e}`);return t}function We(e,t){let n=new Set(t.values.map(({value:e})=>e));return new Set(e.map(e=>e.trim()).filter(e=>n.has(e)))}function Ge(e){return X.reduce((t,n)=>n.withSelected(t,We(e.getAll(n.param),n)),{...q,query:e.get(`q`)??``})}function Ke(e){let t=new URLSearchParams;e.query&&t.set(`q`,e.query);for(let n of X){let r=n.selected(e);for(let{value:e}of n.values)r.has(e)&&t.append(n.param,e)}return t}function Z(e,t){let n=t.trim();if(!n)return!0;let r=[e.name,k(e),e.description??``,e.content??``,e.license??``,e.compatibility??``,...e.triggers??[],...e.allowed_tools??[]],i=n.toLowerCase();return r.some(e=>e.toLowerCase().includes(i))}function Q(e,t,n,r){return X.every(i=>{if(i.id===r)return!0;let a=i.selected(n);return a.size===0?!0:a.has(i.valueOf(e,t))})}function qe(e,t,n){return e.filter(e=>Z(e,n.query)&&Q(e,t,n))}function $(e,t,n){let r={};for(let i of e){let e=t.valueOf(i,n);r[e]=(r[e]??0)+1}return r}function Je(e,t,n,r,i){let a=$(t,e,r),o=e.values.filter(({value:e})=>(a[e]??0)>0),s=e.selected(i);if(o.length<2&&s.size===0)return null;let c=e.values.filter(({value:e})=>(a[e]??0)>0||s.has(e)),l=$(n.filter(t=>Q(t,r,i,e.id)),e,r);return{id:e.id,labelKey:e.labelKey,rows:c.map(({value:e,labelKey:t})=>{let n=l[e]??0,r=s.has(e);return{value:e,labelKey:t,count:n,checked:r,disabled:n===0&&!r}})}}function Ye(e,t,n){let r=e.filter(e=>Z(e,n.query));return X.map(i=>Je(i,e,r,t,n)).filter(e=>e!==null)}function Xe(e,t,n){let r=Ue(t);if(!r.values.some(e=>e.value===n))return e;let i=new Set(r.selected(e));return i.has(n)?i.delete(n):i.add(n),r.withSelected(e,i)}function Ze(e){return{...q,query:e.query}}function Qe(e){return X.reduce((t,n)=>t+n.selected(e).size,0)}export{Qe as a,Xe as c,Ae as d,ke as f,Ze as i,Ne as l,Ce as m,qe as n,Ge as o,De as p,Ye as r,Ke as s,q as t,U as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{i as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{t as c}from"./bot-ByolqPEr.js";import{t as l}from"./check-Bo8s5Ylg.js";import{n as u,r as d,t as f}from"./wrench-B8Wg_nbp.js";import{t as p}from"./list-filter-B8PQk3RA.js";import{t as ee}from"./plug-7ACOEbMs.js";import{n as te,t as ne}from"./x-CX8lVGwm.js";import{t as re}from"./shield-check-C3Rl0NF8.js";import{r as ie}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";import{t as m}from"./modal-backdrop-BSzNhM4r.js";import{n as ae,t as h}from"./modal-body-C24WsdFb.js";import{n as g}from"./modal-classes-B0b9eiL8.js";import{t as _}from"./brand-button-CUMfjb99.js";import{t as v}from"./modal-close-button-DfqfB2Nj.js";import{a as y}from"./skill-enablement-DXeaImBz.js";import{t as b}from"./checkmark-XZyokq_Y.js";import{t as x}from"./copy-Drmhc2jD.js";import{a as oe,r as se}from"./extension-module-card-classes-DpeaYhYo.js";import{t as ce}from"./settings-switch-DDd1cQ8t.js";import{n as S,t as C}from"./skill-card-pill-row-DfjIfj0K.js";import{n as le}from"./circle-plus-check-toggle-BDX_ctNs.js";import{n as ue,t as w}from"./skill-scope-BE-H9TSZ.js";import{n as T,t as de}from"./use-launch-skill-in-chat-QbXDhiHr.js";import{t as E}from"./skill-icon-badge-0MK_68Nc.js";var fe=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),pe=r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),me=r(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),D=e(t(),1),O=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function he(e){let t=e.match(/^description:\s*\|\s*\r?\n((?:[ \t].*(?:\r?\n|$))+)/m);if(t)return t[1].replace(/^[ \t]+/gm,``).trim();let n=e.match(/^description:\s*['"](.+?)['"]\s*$/m);if(n)return n[1].trim();let r=e.match(/^description:\s*(.+)\s*$/m);return r?r[1].trim():null}function ge(e){let t=e.match(O);return t?e.slice(t[0].length).trim():e.trim()}function _e(e){let t=e.replace(/^#+\s+[^\n]+\n+/,``).trim();return t.split(/\n\s*\n/).map(e=>e.replace(/\s+/g,` `).trim()).find(e=>e.length>0)??t.replace(/\s+/g,` `).trim()}function k(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(O);if(r){let e=he(r[1]);if(e)return e}return _e(ge(n))}var A=n(),ve=`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-text-secondary/35 bg-text-secondary/12 px-2 py-0.5 text-[11px] font-medium leading-4 text-tertiary-light`,ye={agentskills:{labelKey:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:o.SETTINGS$SKILLS_TYPE_REPO}};function be({type:e}){let{t}=a(`openhands`),n=ye[e];return(0,A.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:ve,children:t(n.labelKey)})}var j=[`automations`,`environment`,`code-hosting`,`agent-authoring`,`code-quality`,`integrations`,`writing`,`design`,`other`],M={automations:o.SETTINGS$SKILLS_CATEGORY_AUTOMATIONS,environment:o.SETTINGS$SKILLS_CATEGORY_ENVIRONMENT,"code-hosting":o.SETTINGS$SKILLS_CATEGORY_CODE_HOSTING,"agent-authoring":o.SETTINGS$SKILLS_CATEGORY_AGENT_AUTHORING,"code-quality":o.SETTINGS$SKILLS_CATEGORY_CODE_QUALITY,integrations:o.SETTINGS$SKILLS_CATEGORY_INTEGRATIONS,writing:o.SETTINGS$SKILLS_CATEGORY_WRITING,design:o.SETTINGS$SKILLS_CATEGORY_DESIGN,other:o.SETTINGS$SKILLS_CATEGORY_OTHER},N={automations:u,environment:f,"code-hosting":d,"agent-authoring":c,"code-quality":re,integrations:ee,writing:me,design:pe,other:fe},xe=`other`,Se=new Set(ie);function P(e){let t=e.category;return t&&Se.has(t)?t:xe}function F(e,t,n){if(e)return`${e}-${t}-${n}`}function I(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=P(e),c=[{id:`type-${e.type}`,node:(0,A.jsx)(be,{type:e.type})}];if(y(e.name)&&c.push({id:`recommended`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`recommended`)??`skill-recommended-${e.name}`,className:C,children:t(o.SETTINGS$SKILLS_RECOMMENDED)})}),a!==`other`&&c.push({id:`category-${a}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`category`)??`skill-category-${e.name}`,className:C,children:t(M[a])})}),e.version&&c.push({id:`version-${e.version}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`version`)??`skill-version-${e.name}`,className:C,children:t(o.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&c.push({id:`license-${e.license}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`license`),className:C,children:e.license})}),r===`detail`&&e.compatibility&&c.push({id:`compatibility-${e.compatibility}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`compatibility`),className:C,children:e.compatibility})}),e.disable_model_invocation&&c.push({id:`disable-model-invocation`,node:(0,A.jsxs)(`span`,{"data-testid":F(i,e.name,`disable-model-invocation`)??`skill-disable-model-invocation-${e.name}`,className:`inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium leading-4 text-[#fca5a5]`,children:[(0,A.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(o.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)c.push({id:`allowed-tool-${t}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`tool-${t}`),className:s(C,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))c.push({id:`metadata-${t}`,node:(0,A.jsxs)(`span`,{"data-testid":F(i,e.name,`metadata-${t}`),className:C,children:[(0,A.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])c.push({id:`trigger-${t}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`trigger-${t}`),className:C,children:t})});return c}function L(e){let t=e?.trim();return t?!!(/^https?:\/\//i.test(t)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`~`)||/^[A-Za-z]:[\\/]/.test(t)||t.includes(`/`)||t.includes(`\\`)):!1}function Ce({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[c,l]=D.useState(!1),u=k(e),d=D.useMemo(()=>I(e,i),[e,i]),f=L(e.source);return D.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,A.jsx)(`div`,{"data-testid":`skill-card-${e.name}`,role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:s(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,oe,se),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(E,{skillName:e.name}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,A.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,A.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,A.jsx)(`p`,{"data-testid":`skill-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),f?(0,A.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,A.jsx)(b,{width:12,height:12}):(0,A.jsx)(x,{width:12,height:12})}):null]}):null]}),(0,A.jsx)(le,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:o.COMMON$DISABLE})]}),u?(0,A.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,A.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:u})}):null,d.length>0?(0,A.jsx)(S,{pills:d,testId:`skill-triggers-${e.name}`}):null]})]})})}var we=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,R=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`;function Te(e){return e.name===`add-skill`?R:`/${e.name} `}function Ee({testId:e,label:t,value:n}){return(0,A.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,A.jsx)(`span`,{className:`text-sm`,children:t}),(0,A.jsx)(`textarea`,{"data-testid":e,readOnly:!0,value:n,rows:Math.min(12,Math.max(4,n.split(`
|
|
2
|
+
`).length)),className:s(`bg-[var(--oh-surface-raised)] border border-[var(--oh-border-subtle)] w-full min-w-0 rounded-sm p-2 text-sm`,`cursor-not-allowed resize-none custom-scrollbar`)})]})}function De({skill:e,enabled:t,onToggle:n,onClose:r}){let{t:i}=a(`openhands`),s=de(),[c,l]=D.useState(!1),u=D.useMemo(()=>Te(e),[e]),d=k(e),f=D.useMemo(()=>I(e,i,{variant:`detail`,testIdPrefix:`skill-modal-pill`}),[e,i]),p=L(e.source);return D.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,A.jsx)(m,{onClose:r,"aria-label":e.name,children:(0,A.jsxs)(`div`,{"data-testid":`skill-detail-modal`,"data-skill-name":e.name,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col overflow-hidden rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,A.jsx)(v,{onClose:r,testId:`skill-detail-modal-close`}),(0,A.jsxs)(`header`,{className:`flex flex-shrink-0 items-start gap-3 pb-4 pl-6 pr-12 pt-6`,children:[(0,A.jsx)(E,{skillName:e.name}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{"data-testid":`skill-modal-name-${e.name}`,className:g,children:e.name}),e.source?(0,A.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,A.jsx)(`p`,{"data-testid":`skill-modal-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),p?(0,A.jsx)(`button`,{type:`button`,"data-testid":`skill-modal-copy-source-${e.name}`,"aria-label":i(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async()=>{e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,A.jsx)(b,{width:12,height:12}):(0,A.jsx)(x,{width:12,height:12})}):null]}):null]})]}),(0,A.jsxs)(`div`,{"data-testid":`skill-detail-modal-content`,className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain px-6 custom-scrollbar-always`,children:[(0,A.jsx)(`div`,{"data-testid":`skill-modal-enable-row-${e.name}`,className:`flex w-full items-center rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:(0,A.jsx)(ce,{testId:`skill-modal-toggle-${e.name}`,isToggled:t,onToggle:n,togglePosition:`right`,children:i(t?o.SETTINGS$SKILLS_ENABLED:o.SETTINGS$SKILLS_DISABLED)})}),d?(0,A.jsx)(`p`,{"data-testid":`skill-modal-description-${e.name}`,className:`break-words whitespace-pre-line text-xs text-tertiary-light`,children:d}):null,f.length>0?(0,A.jsx)(S,{pills:f,testId:`skill-modal-pills-${e.name}`}):null,e.content?(0,A.jsx)(Ee,{testId:`skill-modal-field-content-${e.name}`,label:i(o.SETTINGS$SKILLS_CONTENT),value:e.content}):null]}),(0,A.jsxs)(`footer`,{"data-testid":`skill-detail-modal-actions`,className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,A.jsx)(_,{type:`button`,variant:`secondary`,onClick:r,testId:`skill-detail-close`,children:i(o.BUTTON$CLOSE)}),(0,A.jsx)(_,{type:`button`,variant:`primary`,isDisabled:!t,onClick:()=>s(u,r),testId:`skill-detail-use-skill-${e.name}`,startContent:(0,A.jsx)(T,{className:`size-4`,"aria-hidden":!0}),children:i(o.SETTINGS$SKILLS_USE_SKILL_BUTTON)})]})]})})}var Oe=[o.SETTINGS$SKILLS_ADD_MODAL_STEP_1,o.SETTINGS$SKILLS_ADD_MODAL_STEP_2,o.SETTINGS$SKILLS_ADD_MODAL_STEP_3,o.SETTINGS$SKILLS_ADD_MODAL_STEP_4,o.SETTINGS$SKILLS_ADD_MODAL_STEP_5],z={cmd:(0,A.jsx)(B,{}),path:(0,A.jsx)(B,{}),env:(0,A.jsx)(B,{})};function B({children:e}){return(0,A.jsx)(`code`,{className:s(`mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white`),children:e})}function V(){let{t:e}=a(`openhands`),[t,n]=D.useState(!1);return D.useEffect(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`pre`,{"data-testid":`add-skill-modal-example`,className:s(`overflow-x-auto rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] p-2 pr-10 text-xs text-white`),children:R}),(0,A.jsx)(`button`,{type:`button`,"data-testid":`add-skill-modal-example-copy`,"aria-label":e(t?o.BUTTON$COPIED:o.BUTTON$COPY),disabled:t,onClick:async()=>{await navigator.clipboard.writeText(R),n(!0)},className:s(`absolute right-2 top-2 cursor-pointer rounded-sm border border-[var(--oh-border-subtle)]`,`bg-base-secondary p-1 text-tertiary-alt transition-colors`,`hover:bg-[var(--oh-surface)] hover:text-white disabled:cursor-default [&_path]:fill-current`),children:t?(0,A.jsx)(b,{width:14,height:14}):(0,A.jsx)(x,{width:14,height:14})})]})}function H({i18nKey:e}){return(0,A.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:(0,A.jsx)(i,{ns:`openhands`,i18nKey:e,components:z})})}function ke({onClose:e}){let{t}=a(`openhands`);return(0,A.jsx)(m,{onClose:e,"aria-label":t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE),children:(0,A.jsxs)(`div`,{"data-testid":`add-skill-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,A.jsx)(v,{onClose:e,testId:`add-skill-modal-close`}),(0,A.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,A.jsx)(`h2`,{className:s(`pr-6`,g),children:t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE)}),(0,A.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_INTRO)})]}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,A.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}),(0,A.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}),(0,A.jsx)(V,{}),(0,A.jsx)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light`,children:Oe.map(e=>(0,A.jsx)(`li`,{children:e===o.SETTINGS$SKILLS_ADD_MODAL_STEP_3?(0,A.jsx)(i,{ns:`openhands`,i18nKey:e,components:z}):t(e)},e))})]}),(0,A.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}),(0,A.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)})]}),(0,A.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY})]}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}),(0,A.jsx)(`a`,{href:we,target:`_blank`,rel:`noreferrer`,"data-testid":`add-skill-modal-docs-link`,className:`self-start text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)})]}),(0,A.jsx)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:(0,A.jsx)(_,{type:`button`,variant:`secondary`,onClick:e,testId:`add-skill-modal-dismiss`,children:t(o.BUTTON$CLOSE)})})]})})}function Ae({search:e,onSearchChange:t,activeFilterCount:n,onOpenFilters:r}){let{t:i}=a(`openhands`);return(0,A.jsxs)(`div`,{"data-testid":`skills-toolbar`,className:`flex items-stretch gap-2`,children:[(0,A.jsxs)(`div`,{className:s(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,A.jsx)(te,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,A.jsx)(`input`,{"data-testid":`skills-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),"aria-label":i(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),className:s(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,A.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(o.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,A.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,A.jsxs)(`button`,{type:`button`,"data-testid":`skills-filters-button`,onClick:r,className:s(`flex shrink-0 items-center gap-2 rounded-lg px-3 py-2 text-sm md:hidden`,`border border-[var(--oh-border)] bg-base-secondary text-white`,`cursor-pointer hover:bg-[var(--oh-interactive-hover)]`),children:[(0,A.jsx)(p,{className:`size-4 shrink-0`,"aria-hidden":!0}),i(o.SETTINGS$SKILLS_FILTERS_BUTTON),n>0?(0,A.jsx)(`span`,{className:`rounded-full bg-white px-1.5 text-[11px] font-medium text-black`,children:n}):null]})]})}function je({labelKey:e,count:t,checked:n,disabled:r,icon:i,testId:o,onToggle:c}){let{t:u}=a(`openhands`),d=u(e);return(0,A.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":n,"data-testid":o,disabled:r,onClick:c,className:s(`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm`,r?`cursor-default text-tertiary-alt/40`:`cursor-pointer hover:bg-[var(--oh-surface-raised)] hover:text-white`,n?`text-white`:`text-tertiary-light`),children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:s(`flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border`,n?`border-white bg-white text-black`:`border-[var(--oh-border)]`),children:n?(0,A.jsx)(l,{className:`size-2.5`,strokeWidth:3}):null}),i?(0,A.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,(0,A.jsx)(`span`,{title:d,className:`min-w-0 flex-1 truncate`,children:d}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-tertiary-alt`,children:t})]})}function Me(e,t){if(e===`category`)return N[t]}function U({groups:e,onToggle:t,className:n}){let{t:r}=a(`openhands`);return e.length===0?null:(0,A.jsx)(`div`,{"data-testid":`skill-facet-rail`,className:s(`flex min-w-0 flex-col gap-5`,n),children:e.map(e=>{let n=`skill-facet-group-${e.id}-title`;return(0,A.jsxs)(`div`,{"data-testid":`skill-facet-group-${e.id}`,role:`group`,"aria-labelledby":n,className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{id:n,className:`px-1 text-[11px] font-semibold uppercase tracking-wider text-tertiary-alt`,children:r(e.labelKey)}),e.rows.map(n=>(0,A.jsx)(je,{testId:`skill-facet-${e.id}-${n.value}`,labelKey:n.labelKey,count:n.count,checked:n.checked,disabled:n.disabled,icon:Me(e.id,n.value),onToggle:()=>t(e.id,n.value)},n.value))]},e.id)})})}function Ne({groups:e,activeCount:t,onToggle:n,onClearAll:r,onClose:i}){let{t:c}=a(`openhands`);return(0,A.jsx)(m,{onClose:i,"aria-label":c(o.SETTINGS$SKILLS_FILTERS_MODAL_TITLE),children:(0,A.jsxs)(ae,{testID:`skill-filters-modal`,className:s(`items-stretch`,h),children:[(0,A.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:c(o.SETTINGS$SKILLS_FILTERS_MODAL_TITLE)}),(0,A.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto custom-scrollbar-always`,children:(0,A.jsx)(U,{groups:e,onToggle:n})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[t>0?(0,A.jsx)(_,{type:`button`,variant:`secondary`,testId:`skill-filters-modal-clear`,onClick:r,children:c(o.SETTINGS$SKILLS_CLEAR_FILTERS)}):null,(0,A.jsx)(_,{type:`button`,variant:`primary`,testId:`skill-filters-modal-done`,onClick:i,children:c(o.BUTTON$CLOSE)})]})]})})}var Pe=`source`,Fe=`category`,Ie=`type`,Le=`state`,Re=`recommendation`,W=[`enabled`,`disabled`],G=[`recommended`,`other`],K=[`agentskills`,`knowledge`,`repo`],q={query:``,sources:new Set,categories:new Set,types:new Set,states:new Set,recommendations:new Set};function J(e,t){return e.map(e=>({value:e,labelKey:t[e]}))}function Y(e,t){return new Set(e.filter(e=>t.has(e)))}var ze={project:o.SETTINGS$SKILLS_SOURCE_PROJECT,personal:o.SETTINGS$SKILLS_SOURCE_PERSONAL,public:o.SETTINGS$SKILLS_SOURCE_PUBLIC},Be={agentskills:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS,knowledge:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE,repo:o.SETTINGS$SKILLS_TYPE_REPO},Ve={enabled:o.SETTINGS$SKILLS_ENABLED,disabled:o.SETTINGS$SKILLS_DISABLED},He={recommended:o.SETTINGS$SKILLS_RECOMMENDED,other:o.SETTINGS$SKILLS_RECOMMENDATION_OTHER},X=[{id:`state`,labelKey:o.SETTINGS$SKILLS_FACET_STATE,param:Le,values:J(W,Ve),valueOf:(e,t)=>t(e)?`enabled`:`disabled`,selected:e=>e.states,withSelected:(e,t)=>({...e,states:Y(W,t)})},{id:`recommendation`,labelKey:o.SETTINGS$SKILLS_FACET_RECOMMENDATION,param:Re,values:J(G,He),valueOf:e=>y(e.name)?`recommended`:`other`,selected:e=>e.recommendations,withSelected:(e,t)=>({...e,recommendations:Y(G,t)})},{id:`source`,labelKey:o.SETTINGS$SKILLS_FACET_SOURCE,param:Pe,values:J(w,ze),valueOf:e=>ue(e),selected:e=>e.sources,withSelected:(e,t)=>({...e,sources:Y(w,t)})},{id:`category`,labelKey:o.SETTINGS$SKILLS_FACET_CATEGORY,param:Fe,values:J(j,M),valueOf:e=>P(e),selected:e=>e.categories,withSelected:(e,t)=>({...e,categories:Y(j,t)})},{id:`type`,labelKey:o.SETTINGS$SKILLS_FACET_TYPE,param:Ie,values:J(K,Be),valueOf:e=>e.type,selected:e=>e.types,withSelected:(e,t)=>({...e,types:Y(K,t)})}];function Ue(e){let t=X.find(t=>t.id===e);if(!t)throw Error(`Unknown skill facet group: ${e}`);return t}function We(e,t){let n=new Set(t.values.map(({value:e})=>e));return new Set(e.map(e=>e.trim()).filter(e=>n.has(e)))}function Ge(e){return X.reduce((t,n)=>n.withSelected(t,We(e.getAll(n.param),n)),{...q,query:e.get(`q`)??``})}function Ke(e){let t=new URLSearchParams;e.query&&t.set(`q`,e.query);for(let n of X){let r=n.selected(e);for(let{value:e}of n.values)r.has(e)&&t.append(n.param,e)}return t}function Z(e,t){let n=t.trim();if(!n)return!0;let r=[e.name,k(e),e.description??``,e.content??``,e.license??``,e.compatibility??``,...e.triggers??[],...e.allowed_tools??[]],i=n.toLowerCase();return r.some(e=>e.toLowerCase().includes(i))}function Q(e,t,n,r){return X.every(i=>{if(i.id===r)return!0;let a=i.selected(n);return a.size===0?!0:a.has(i.valueOf(e,t))})}function qe(e,t,n){return e.filter(e=>Z(e,n.query)&&Q(e,t,n))}function $(e,t,n){let r={};for(let i of e){let e=t.valueOf(i,n);r[e]=(r[e]??0)+1}return r}function Je(e,t,n,r,i){let a=$(t,e,r),o=e.values.filter(({value:e})=>(a[e]??0)>0),s=e.selected(i);if(o.length<2&&s.size===0)return null;let c=e.values.filter(({value:e})=>(a[e]??0)>0||s.has(e)),l=$(n.filter(t=>Q(t,r,i,e.id)),e,r);return{id:e.id,labelKey:e.labelKey,rows:c.map(({value:e,labelKey:t})=>{let n=l[e]??0,r=s.has(e);return{value:e,labelKey:t,count:n,checked:r,disabled:n===0&&!r}})}}function Ye(e,t,n){let r=e.filter(e=>Z(e,n.query));return X.map(i=>Je(i,e,r,t,n)).filter(e=>e!==null)}function Xe(e,t,n){let r=Ue(t);if(!r.values.some(e=>e.value===n))return e;let i=new Set(r.selected(e));return i.has(n)?i.delete(n):i.add(n),r.withSelected(e,i)}function Ze(e){return{...q,query:e.query}}function Qe(e){return X.reduce((t,n)=>t+n.selected(e).size,0)}export{Qe as a,Xe as c,Ae as d,ke as f,Ze as i,Ne as l,Ce as m,qe as n,Ge as o,De as p,Ye as r,Ke as s,q as t,U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-
|
|
1
|
+
import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-BgLSZdyy.js";import{t as n}from"./skills-B0IliMxw.js";var r=e();function i({skillName:e,className:i}){return(0,r.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:t(`inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden`,`rounded-lg border border-white/10 bg-surface-raised text-white`,`shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,`[&>svg]:h-5 [&>svg]:w-5`,i),children:(0,r.jsx)(n,{})})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useTranslation-CCgUjPJF.js";import{dt as r,n as i,st as a}from"./active-backend-context-BnH4-L8h.js";import{K as o}from"./utils-BgLSZdyy.js";import{c as s,n as c}from"./agent-server-client-options-EHB23gyx.js";import{s as l}from"./agent-server-config-C_x8Otd9.js";import{d as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as d}from"./proxy-XP6U1Dhv.js";import{n as f}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";import{n as p}from"./use-settings-C2KKQKVC.js";import{t as m}from"./use-save-settings-Dapkf4cC.js";import{i as h,n as g,s as _,t as v}from"./skill-enablement-DXeaImBz.js";var y=100;function b(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud skills call requires a cloud backend.`);return e}async function x(){let e=b(),t=[],n=null;do{let r=new URLSearchParams({limit:String(y)});n&&r.set(`page_id`,n);let i=await d({backend:e,method:`GET`,path:`/api/v1/skills/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}async function S(e){return((await d({backend:b(),method:`GET`,path:`/api/v1/app-conversations/${e}/skills`}))?.skills??[]).map(e=>({...e,source:null}))}function C(e){return{name:e.name,type:`knowledge`,source:`public`,description:e.description,triggers:e.triggers,category:e.category,content:e.content,license:e.license??null,compatibility:e.compatibility??null}}var w=f.map(C),T=class{static async getSkills(e){if(s().backend.kind===`cloud`)return x();let t=[];try{t=(await new u(c()).getSkills({load_public:!1,load_user:!0,load_project:!0,load_org:!1,project_dir:e??l()})).skills??[]}catch{}return[...t,...w]}static getConversationSkills(e){return S(e)}},E=e(t(),1);function D(e,t){return{enabledSkills:t?e?.enabled_skills:[...v],disabledSkills:e?.disabled_skills??[]}}function O(){let{backend:e}=i(),{data:t}=p(),n=e.kind!==`cloud`;return E.useMemo(()=>{let e=g(D(t,n));return t=>e(t.name)},[t?.enabled_skills,t?.disabled_skills,n])}function k(e){return JSON.stringify([[..._(e)].sort(),[...e.disabledSkills??[]].sort()])}function A(e,t,n){return e.includes(t)===n?e:n?[...e,t]:e.filter(e=>e!==t)}function j(){let{t:e}=n(`openhands`),{backend:t}=i(),s=t.kind!==`cloud`,{data:c,isLoading:l}=p(),{mutate:u}=m(),[d,f]=E.useState({}),v=E.useRef(null);return E.useEffect(()=>{if(l||!c)return;let e=D(c,s);v.current=k(e),f(e)},[l,c?.enabled_skills,c?.disabled_skills,s]),E.useEffect(()=>{let t=k(d);if(v.current===null||v.current===t)return;v.current=t;let n=d.disabledSkills??[];u(s?{enabled_skills:_(d),disabled_skills:n}:{disabled_skills:n},{onError:t=>{a(r(t)||e(o.ERROR$GENERIC))}})},[d,s,u,e]),{isEnabled:E.useMemo(()=>{let e=g(d);return t=>e(t.name)},[d]),setEnabled:E.useCallback((e,t)=>{f(n=>{let r=s&&h(e);return{enabledSkills:r?A(_(n),e,t):n.enabledSkills,disabledSkills:A(n.disabledSkills??[],e,!t&&!r)}})},[s])}}var M=[`project`,`personal`,`public`],N=[`/.agents/skills/`,`/.openhands/skills/`,`/.openhands/microagents/`];function P(e){return e.replace(/\\/g,`/`)}function F(e){let t=P(e).toLowerCase();return t===`public`?!0:t.includes(`public-skills`)||t.includes(`/.openhands/cache/skills/`)}function I(e){let t=P(e);return/^\/Users\/[^/]+\/\.(agents|openhands)\//.test(t)||/^\/home\/[^/]+\/\.(agents|openhands)\//.test(t)?!0:N.some(e=>{let n=t.indexOf(e);if(n===-1)return!1;let r=t.slice(0,n);return/^\/Users\/[^/]+$/.test(r)||/^\/home\/[^/]+$/.test(r)})}function L(e,t){let n=P(e);if(!N.some(e=>n.includes(e))||I(e))return!1;if(t){let e=P(t).replace(/\/$/,``);if(n.startsWith(e))return!0}return!0}function R(e,t){let n=e.source?.trim();if(!n)return e.type===`repo`?`project`:`public`;let r=n.toLowerCase();return F(n)?`public`:r===`user`||r===`global`?`personal`:r===`project`||r===`repo`||r===`sandbox`?`project`:I(n)?`personal`:L(n,t)?`project`:`public`}function z(e,t){let n={project:[],personal:[],public:[]};for(let r of e)n[R(r,t)].push(r);for(let e of M)n[e].sort((e,t)=>e.name.localeCompare(t.name));return n}export{j as a,O as i,R as n,T as o,z as r,M as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as a}from"./useMutation-Cszf8mKy.js";import{t as o}from"./useQuery-DAAacS7O.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{R as c,ct as l,dt as u,n as d,st as f}from"./active-backend-context-BnH4-L8h.js";import{K as p,t as m}from"./utils-BgLSZdyy.js";import{n as h}from"./extensions-navigation-C5GfpzFe.js";import{n as g,t as _}from"./x-CX8lVGwm.js";import{t as v}from"./loading-spinner-BeLV0IXf.js";import{t as y}from"./modal-backdrop-BSzNhM4r.js";import{n as b}from"./modal-classes-B0b9eiL8.js";import{t as x}from"./brand-button-CUMfjb99.js";import{n as S}from"./navigation-context-CQZwH_tC.js";import{t as C}from"./modal-close-button-DfqfB2Nj.js";import{t as w}from"./settings-input-dVuzapBA.js";import{t as T}from"./plugins-management-service-5rqVPEGN.js";import{a as E,i as D,r as O}from"./extension-module-card-classes-DpeaYhYo.js";import{t as k}from"./settings-switch-DDd1cQ8t.js";import{n as A}from"./circle-plus-check-toggle-BDX_ctNs.js";import{n as j,t as M}from"./use-plugins-marketplace-BIIaPiaB.js";import{t as N}from"./skill-icon-badge-0MK_68Nc.js";import{n as P}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";import{n as F,t as I}from"./highlighted-source-view-C7pAXrT0.js";var L=e(t(),1),R=n();function z({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:a}){let{t:o}=s(`openhands`);return(0,R.jsxs)(`div`,{"data-testid":`plugin-card-${e.name}`,role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:m(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,E,O),children:[(0,R.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,R.jsx)(`p`,{"data-testid":`plugin-source-${e.name}`,className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}):null]}),e.installed?(0,R.jsx)(A,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:a,disableTooltipKey:p.COMMON$DISABLE}):e.isLocal?(0,R.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:m(D,`flex-shrink-0`),children:o(p.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:o(t?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,R.jsx)(`p`,{"data-testid":`plugin-description-${e.name}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null,(e.installed||e.isLocal)&&e.version?(0,R.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:m(D,`self-start`),children:o(p.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var B=[{value:`all`,labelKey:p.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:p.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:p.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:p.SETTINGS$PLUGINS_FILTER_LOCAL}];function V({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=s(`openhands`);return(0,R.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,R.jsxs)(`div`,{className:m(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,R.jsx)(g,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,R.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(p.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(p.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:m(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(p.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,R.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,R.jsx)(`div`,{"data-testid":`plugins-status-filter`,className:`flex shrink-0 items-center gap-1 rounded-lg border border-[var(--oh-border)] bg-base-secondary p-1`,children:B.map(e=>(0,R.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:m(`cursor-pointer rounded-md px-3 py-1 text-xs transition-colors`,n===e.value?`bg-surface-raised text-white`:`text-tertiary-alt hover:text-white`),children:i(e.labelKey)},e.value))})]})}var H=(e,t)=>{let{backend:n,orgId:r}=d();return o({queryKey:[`plugin-file-content`,e,t,n.id,r],queryFn:()=>{if(!e||!t)throw Error(`No file selected`);return j.getPluginFileContent(e,t)},enabled:!!(e&&t),retry:!1,staleTime:1e3*60*10,refetchOnWindowFocus:!1})};function U({basePath:e,files:t}){let{t:n}=s(`openhands`),[r,i]=L.useState(null),a=r&&t.includes(r)?r:null,{data:o,isLoading:c,isError:l}=H(a?e:null,a);return(0,R.jsxs)(`section`,{"data-testid":`plugin-files-section`,className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:n(p.COMMON$FILES)}),(0,R.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)]`,children:[(0,R.jsx)(`div`,{className:`max-h-48 overflow-y-auto custom-scrollbar`,children:(0,R.jsx)(F,{paths:t,selectedPath:a,onSelectFile:e=>i(t=>t===e?null:e)})}),a?(0,R.jsxs)(`div`,{"data-testid":`plugin-file-content`,className:`flex h-60 min-w-0 flex-col border-t border-[var(--oh-border)]`,children:[(0,R.jsx)(`p`,{className:`truncate px-3 py-2 text-xs text-tertiary-alt`,title:a,children:a}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1`,children:c?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(v,{size:`small`})}):l?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(p.FILES$LOAD_ERROR)}):o?.kind===`binary`?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(p.FILES$BINARY_FALLBACK)}):(0,R.jsx)(I,{path:a,text:o?.text??``})})]}):null]})]})}function W({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:a,onRefresh:o,onClose:c,onStartConversation:l}){let{t:u}=s(`openhands`),d=n||t;return(0,R.jsx)(y,{onClose:c,"aria-label":e.name,children:(0,R.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[640px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,R.jsx)(C,{onClose:c,testId:`plugin-detail-modal-close`}),(0,R.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,R.jsx)(`h2`,{className:m(`pr-6`,b),children:e.name}),e.source?(0,R.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,R.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,R.jsx)(`span`,{className:D,children:u(p.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,R.jsx)(`span`,{className:D,children:u(p.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,R.jsxs)(`span`,{className:D,children:[u(p.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,R.jsxs)(`span`,{className:D,children:[u(p.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,R.jsx)(k,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?p.SETTINGS$SKILLS_ENABLED:p.SETTINGS$SKILLS_DISABLED)}):null,e.skills?.length?(0,R.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:u(p.SETTINGS$PLUGINS_SKILLS_IN_BUNDLE)}),(0,R.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:e.skills.map(e=>(0,R.jsxs)(`li`,{"data-testid":`plugin-bundled-skill-${e.name}`,className:`flex items-start gap-3 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:[(0,R.jsx)(N,{skillName:e.name}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),e.description?(0,R.jsx)(`p`,{className:`mt-0.5 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null]})]},e.name))})]}):null,e.path&&e.files?.length?(0,R.jsx)(U,{basePath:e.path,files:e.files}):null]}),(0,R.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:o,children:u(p.SETTINGS$PLUGINS_REFRESH)}),(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:a,children:u(p.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)}),e.source&&l?(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-start-conversation-${e.name}`,onClick:l,children:u(p.COMMON$START_CONVERSATION)}):null,(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:c,children:u(p.BUTTON$CLOSE)})]})]})})}function G(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),e.invalidateQueries({queryKey:c.marketplace}),l(t(p.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function K({onClose:e,onInstalled:t}){let{t:n}=s(`openhands`),r=G(),[i,a]=L.useState(``),[o,c]=L.useState(``),[l,u]=L.useState(``),d=i.trim(),f=d.length>0&&!r.isPending;return(0,R.jsx)(y,{onClose:e,"aria-label":n(p.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,R.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),f&&r.mutate({source:d,ref:o.trim()||null,repo_path:l.trim()||null},{onSuccess:()=>{t?.(),e()}})},"data-testid":`add-plugin-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,R.jsx)(C,{onClose:e,testId:`add-plugin-modal-close`}),(0,R.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,R.jsx)(`h2`,{className:m(`pr-6`,b),children:n(p.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,R.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(p.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,R.jsx)(w,{testId:`add-plugin-source-input`,label:n(p.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:a,placeholder:n(p.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,R.jsx)(w,{testId:`add-plugin-ref-input`,label:n(p.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:o,onChange:c,showOptionalTag:!0}),(0,R.jsx)(w,{testId:`add-plugin-repo-path-input`,label:n(p.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:l,onChange:u,showOptionalTag:!0})]}),(0,R.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,R.jsx)(x,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(p.BUTTON$CLOSE)}),(0,R.jsx)(x,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!f,children:n(r.isPending?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)})]})]})})}function q(e,t,n=void 0){let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,description:t.description,source:t.source,ref:t.ref??null,repoPath:t.repo_path??null,installed:t.installed,enabled:!1,version:null,inCatalog:!0,isLocal:!1,path:t.path??null,skills:t.skills??null,files:t.files??null});for(let e of t??[]){let t=r.get(e.name),n=e.skills!=null||e.files!=null;r.set(e.name,{name:e.name,description:t?.description??e.description??null,source:e.source??t?.source??null,ref:e.resolved_ref??t?.ref??null,repoPath:e.repo_path??t?.repoPath??null,installed:!0,enabled:e.enabled,version:e.version??null,inCatalog:t?.inCatalog??!1,isLocal:!1,path:n?e.install_path:t?.path??null,skills:n?e.skills??null:t?.skills??null,files:n?e.files??null:t?.files??null})}for(let e of n??[])r.has(e.name)||r.set(e.name,{name:e.name,description:e.description||null,source:null,ref:null,repoPath:null,installed:!1,enabled:!1,version:e.version||null,inCatalog:!1,isLocal:!0,path:e.path??null,skills:e.skills??null,files:e.files??null});let i=e=>e.installed?0:e.isLocal?1:2;return Array.from(r.values()).sort((e,t)=>{let n=i(e)-i(t);return n===0?e.name.localeCompare(t.name):n})}function J(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description??``,e.source??``,e.repoPath??``,e.ref??``].some(e=>e.toLowerCase().includes(n)):!0}function Y(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var X=()=>{let{backend:e,orgId:t}=d();return o({queryKey:[...c.installed,e.id,t],queryFn:()=>T.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1})},Z=()=>{let{backend:e,orgId:t}=d();return o({queryKey:[...c.local,e.id,t],queryFn:()=>j.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1})};function Q(){let e=i(),{t}=s(`openhands`);return a({mutationFn:({name:e,enabled:t})=>T.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed})},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function ee(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),e.invalidateQueries({queryKey:c.marketplace}),l(t(p.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function te(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),l(t(p.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function ne(e){let t=btoa(JSON.stringify(e));return`/launch?${new URLSearchParams({plugins:t}).toString()}`}var $=r(function(){let{t:e}=s(`openhands`),{backend:t}=d(),{navigate:n}=S(),r=t.kind===`local`,{data:i,isLoading:a}=M(),{data:o,isLoading:c}=X(),{data:l,isLoading:u}=Z(),f=G(),g=Q(),_=ee(),v=te(),[y,b]=L.useState(``),[C,w]=L.useState(`all`),[T,E]=L.useState(null),[D,O]=L.useState(!1),k=L.useMemo(()=>q(i,o,l),[i,o,l]),A=L.useMemo(()=>k.filter(e=>Y(e,C)&&J(e,y)),[k,C,y]),j=T?k.find(e=>e.name===T)??null:null,N=a||c||u,F=(g.isPending?g.variables?.name:void 0)??(_.isPending?_.variables:void 0)??(v.isPending?v.variables:void 0)??null,I=e=>F===e.name||f.isPending&&f.variables?.source===e.source,B=e=>{e.source&&f.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},H=(e,t)=>{g.mutate({name:e.name,enabled:t})},U=e=>{_.mutate(e.name,{onSuccess:()=>E(null)})},$=e=>{v.mutate(e.name)},re=e=>{e.source&&n(ne([{source:e.source,ref:e.ref,repo_path:e.repoPath}]))};return(0,R.jsxs)(`div`,{"data-testid":`skills-plugins-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,R.jsx)(h,{}),(0,R.jsx)(`main`,{className:m(P,`h-full`),children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(p.SETTINGS$PLUGINS_TITLE)}),(0,R.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!r,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>O(!0),children:e(p.SETTINGS$PLUGINS_ADD_BUTTON)})]}),N&&(0,R.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!N&&k.length===0&&(0,R.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_NO_PLUGINS)})}),!N&&k.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(V,{search:y,onSearchChange:b,statusFilter:C,onStatusFilterChange:w}),A.length===0?(0,R.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_NO_MATCH)})}):(0,R.jsx)(`section`,{className:m(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,R.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:A.map(e=>(0,R.jsx)(z,{plugin:e,isBusy:I(e),isDisabled:!r,onOpen:()=>E(e.name),onInstall:()=>B(e),onToggle:t=>H(e,t)},e.name))})})]}),j&&(0,R.jsx)(W,{plugin:j,isBusy:I(j),isDisabled:!r,onToggle:e=>H(j,e),onInstall:()=>B(j),onUninstall:()=>U(j),onRefresh:()=>$(j),onStartConversation:()=>re(j),onClose:()=>E(null)}),D&&(0,R.jsx)(K,{onClose:()=>O(!1)})]})})]})});export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-BgLSZdyy.js";import{n as l}from"./extensions-navigation-C5GfpzFe.js";import{a as u,c as ee,d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,u as x}from"./skill-filter-DsNLmn76.js";import{n as S}from"./use-settings-C2KKQKVC.js";import{t as C}from"./brand-button-CUMfjb99.js";import{n as w,o as T,t as E}from"./extension-module-card-classes-DpeaYhYo.js";import{a as D,o as O}from"./skill-scope-BE-H9TSZ.js";import{n as te}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var k=e(t(),1),A=e=>a({queryKey:[`skills`,e??null],queryFn:()=>O.getSkills(e),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),j=n(),M=300;function N(){let{t:e}=o(`openhands`),{data:t,isLoading:n}=S(),{data:i,isLoading:a}=A(),{isEnabled:O,setEnabled:N}=D(),[P,F]=r(),[I,L]=k.useState(()=>P.get(`q`)??``),R=k.useRef(I),[z,B]=k.useState(null),[V,H]=k.useState(!1),[U,W]=k.useState(!1),G=n||a||!t,K=i??[],q=k.useMemo(()=>({..._(P),query:I}),[P,I]),J=k.useMemo(()=>y(K,O,q),[K,O,q]),Y=k.useMemo(()=>g(K,O,q),[K,O,q]),X=u(q);k.useEffect(()=>{let e=P.get(`q`)??``;e!==R.current&&(R.current=e,L(e))},[P]),k.useEffect(()=>{if((P.get(`q`)??``)===I)return;let e=setTimeout(()=>{R.current=I,F(e=>{let t=new URLSearchParams(e);return I?t.set(`q`,I):t.delete(`q`),t},{replace:!0})},M);return()=>clearTimeout(e)},[I,P,F]);let Z=e=>{e.query!==q.query&&L(e.query),b({...e,query:``}).toString()!==b({...q,query:``}).toString()&&F(b(e))},Q=(e,t)=>Z(ee(q,e,t)),$=()=>Z(p(q));return(0,j.jsxs)(`div`,{"data-testid":`skills-settings-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,j.jsx)(l,{}),(0,j.jsxs)(`main`,{className:c(te,`h-full`),children:[(0,j.jsxs)(`div`,{"data-testid":`skills-page`,className:`mx-auto flex w-full min-w-0 max-w-[1100px] flex-col gap-6`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,j.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(s.SETTINGS$SKILLS_TITLE)}),(0,j.jsx)(`div`,{"data-testid":`skills-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_PAGE_DESCRIPTION)}),(0,j.jsx)(`div`,{"data-testid":`skills-new-conversation-notice`,className:`max-w-2xl text-xs text-tertiary-alt`,children:e(s.SETTINGS$SKILLS_NEW_CONVERSATION_NOTICE)})]}),(0,j.jsx)(C,{type:`button`,variant:`secondary`,testId:`skills-add-skill-button`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>H(!0),children:e(s.SETTINGS$SKILLS_ADD_BUTTON)})]}),G?(0,j.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,j.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}):null,!G&&K.length===0?(0,j.jsx)(`div`,{"data-testid":`skills-empty`,className:T,children:(0,j.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_NO_SKILLS)})}):null,!G&&K.length>0?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d,{search:q.query,onSearchChange:e=>Z({...q,query:e}),activeFilterCount:X,onOpenFilters:()=>W(!0)}),(0,j.jsxs)(`div`,{className:`flex min-w-0 gap-6`,children:[(0,j.jsx)(x,{groups:J,onToggle:Q,className:`hidden w-[240px] shrink-0 self-start md:flex`}),(0,j.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-tertiary-light`,children:[(0,j.jsx)(`span`,{"data-testid":`skills-result-summary`,children:e(s.SETTINGS$SKILLS_RESULT_COUNT,{count:Y.length})}),X>0?(0,j.jsx)(`button`,{type:`button`,"data-testid":`skills-clear-filters`,onClick:$,className:`cursor-pointer underline hover:text-white`,children:e(s.SETTINGS$SKILLS_CLEAR_FILTERS)}):null]}),Y.length===0?(0,j.jsx)(`div`,{"data-testid":`skills-no-match`,className:T,children:(0,j.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_NO_MATCH)})}):(0,j.jsx)(`div`,{className:c(w),children:(0,j.jsx)(`div`,{className:E,children:Y.map(e=>(0,j.jsx)(h,{skill:e,enabled:O(e),onOpen:()=>B(e),onToggle:t=>N(e.name,t)},e.name))})})]})]}),U?(0,j.jsx)(m,{groups:J,activeCount:X,onToggle:Q,onClearAll:$,onClose:()=>W(!1)}):null]}):null]}),z&&(0,j.jsx)(v,{skill:z,enabled:O(z),onToggle:e=>N(z.name,e),onClose:()=>B(null)}),V&&(0,j.jsx)(f,{onClose:()=>H(!1)})]})]})}var P=i(N);export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./utils-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./utils-BgLSZdyy.js";var a=e(t(),1),o=r();function s(e){return a.Children.count(e)===1&&a.isValidElement(e)?e:(0,o.jsx)(`span`,{className:`inline-flex`,children:e})}function c({children:e,content:t,tooltipClassName:r,placement:a=`right`,showArrow:c=!1,closeDelay:l=100,shouldFlip:u,offset:d=7,isOpen:f}){return(0,o.jsx)(n,{content:t,closeDelay:l,placement:a,offset:d,shouldFlip:u,isOpen:f,className:i(`bg-white text-black`,r),showArrow:c,disableAnimation:!1,classNames:{content:i(`z-[9999] rounded-md px-2 py-1 text-xs font-medium shadow-md`,`!bg-white !text-black`,r)},children:s(e)})}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{a as o,o as s}from"./messages-Bk1xhbU2.js";import{r as c}from"./typography-DgcLGdHk.js";import{t as l}from"./u-check-circle-BKn1spCL.js";import{i as u}from"./conversation-B_nweu5p.js";import{t as d}from"./conversation-tab-empty-state-B3dpJXX0.js";var f=e(t(),1),p=n();function m({task:e}){let{t}=r(`openhands`),n=(0,f.useMemo)(()=>{switch(e.status){case`todo`:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,p.jsx)(o,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,p.jsx)(l,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),u=e.status===`done`;return(0,p.jsxs)(`div`,{className:`flex gap-2 items-center w-full`,"data-name":`item`,children:[(0,p.jsx)(`div`,{className:`shrink-0`,children:n}),(0,p.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[16px] text-nowrap whitespace-pre font-normal`,children:[(0,p.jsx)(c.Text,{className:a(`text-[12px]`,u?`text-[var(--oh-muted)]`:`text-white`),children:e.title}),e.notes&&(0,p.jsxs)(c.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(i.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function h(){let{t:e}=r(`openhands`),{taskList:t}=u();return t.length===0?(0,p.jsx)(d,{icon:(0,p.jsx)(l,{}),children:e(i.COMMON$NO_TASKS)}):(0,p.jsx)(`main`,{className:`h-full overflow-y-auto flex flex-col custom-scrollbar-always`,children:t.map(e=>(0,p.jsx)(`div`,{"data-active":e.status===`in_progress`?`true`:`false`,className:a(`px-4 py-2`,e.status===`in_progress`&&`bg-[var(--oh-surface-raised)]`),children:(0,p.jsx)(m,{task:e})},e.id))})}export{h as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{A as i,K as a,t as o}from"./utils-BgLSZdyy.js";import{c as s}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{m as c}from"./llm-not-configured-banner-Dh_ajcM8.js";import{$ as l,w as u}from"./markdown-renderer-DyFl9-mL.js";import{n as d,t as f}from"./vendor~terminal-BVSbSr6V.js";import{t as p}from"./conversation-tab-empty-state-B3dpJXX0.js";var m=e(t(),1),h=`[Python Interpreter: `,g=e=>{let t=e.indexOf(h);if(t<0)return e;let n=t+21;return e.indexOf(`]`,n)<=n?e:e.substring(0,t).trim()},_=(e,t,n=!1)=>{let{content:r,type:i}=e;if(i===`input`&&n)return;let a=(r||``).replaceAll(`
|
|
2
2
|
`,`\r
|
|
3
3
|
`).trim();a&&t.writeln(g(a))},v=(e,t,n)=>{if(!e||!t||!n||window.getComputedStyle(n).display===`none`)return!1;let{clientWidth:r,clientHeight:i}=n;return!(r===0||i===0||!e.element)};function y(e){let t=e.ownerDocument.createElement(`span`);t.style.color=`var(--oh-surface-foreground)`,t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.pointerEvents=`none`,e.appendChild(t);let n=getComputedStyle(t).color;return t.remove(),n&&n!==`rgba(0, 0, 0, 0)`?n:getComputedStyle(e).color}var b={current:0},x=()=>{let e=u(e=>e.commands),t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),i=b,a=m.useRef(!1),o=e=>new f({fontFamily:`Menlo, Monaco, 'Courier New', monospace`,fontSize:14,scrollback:1e4,scrollSensitivity:1,fastScrollSensitivity:5,disableStdin:!0,allowTransparency:!0,theme:{background:`rgba(0, 0, 0, 0)`,foreground:y(e)}}),s=m.useCallback(()=>{a.current||v(t.current,n.current,r.current)&&n.current.fit()},[]),c=()=>{t.current&&(n.current&&t.current.loadAddon(n.current),r.current&&(t.current.open(r.current),t.current.write(`\x1B[?25l`),s()))};return m.useEffect(()=>{a.current=!1;let s=r.current;if(s){if(t.current=o(s),n.current=new d,r.current&&(c(),e.length>0)){for(let n=0;n<e.length;n+=1)e[n].type===`input`&&t.current.write(`$ `),_(e[n],t.current,!1);i.current=e.length}return()=>{a.current=!0,t.current?.dispose(),i.current=0}}},[]),m.useEffect(()=>{if(t.current&&e.length>0&&i.current<e.length){for(let n=i.current;n<e.length;n+=1)e[n].type===`input`&&t.current.write(`$ `),_(e[n],t.current,!1);i.current=e.length}},[e]),m.useEffect(()=>{let e=null;return e=new ResizeObserver(()=>{requestAnimationFrame(()=>{s()})}),r.current&&e.observe(r.current),()=>{e?.disconnect()}},[s]),r},S=n();function C({className:e,testId:t}){return(0,S.jsx)(c,{testId:t,className:e})}function w(){let{t:e}=r(`openhands`);return(0,S.jsx)(p,{className:`h-full`,icon:(0,S.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(a.TERMINAL$NO_OUTPUT)})}function T(){let{curAgentState:e}=l(),t=u(e=>e.commands),n=i.includes(e),r=t.length>0,a=n||!r,s=x();return(0,S.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[n&&(0,S.jsx)(C,{className:`pt-16`}),!n&&!r&&(0,S.jsx)(w,{}),(0,S.jsx)(`div`,{className:o(`flex-1 min-h-0 p-4`,a&&`pointer-events-none absolute inset-0 h-0 w-0 overflow-hidden p-0 opacity-0`),children:(0,S.jsx)(`div`,{ref:s,className:`h-full w-full`})})]})}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-
|
|
1
|
+
import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-BgLSZdyy.js";var n=e();function r({enabled:e,size:r=`md`,className:i}){let a=r===`sm`;return(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t(`relative inline-flex shrink-0 items-center rounded-full`,`transition-colors duration-200 ease-in-out motion-reduce:transition-none`,a?`h-3.5 w-6 p-[3px]`:`h-[22px] w-[40px] border`,e?a?`bg-white`:`border-white bg-white`:a?`bg-[var(--oh-border)]`:`border-[var(--oh-border)] bg-surface-raised`,i),children:(0,n.jsx)(`span`,{className:t(`inline-block rounded-full`,`transition-transform duration-200 ease-in-out motion-reduce:transition-none`,a?`size-2`:`size-4`,e?a?`translate-x-[10px] bg-base-secondary`:`translate-x-[21px] bg-base-secondary`:a?`translate-x-0 bg-[var(--oh-muted)]`:`translate-x-[2px] bg-[var(--oh-muted)]`)})})}function i({enabled:e,label:i,onToggle:a,className:o}){return(0,n.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":i,onClick:e=>{e.stopPropagation(),a()},className:t(`cursor-pointer`,o),children:(0,n.jsx)(r,{enabled:e})})}export{r as n,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-
|
|
1
|
+
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";var t=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-BgLSZdyy.js";import{t as s}from"./kebab-menu-item-content-SCJBwZnp.js";import{n as c,t as l}from"./context-menu-list-item-Cm7-7Y-7.js";import{r as u}from"./dropdown-classes-BGvOvW2_.js";var d=e(n(),1),f=e(t()),p=r(),m=e=>(0,p.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 20 20`,...e,children:(0,p.jsx)(`path`,{d:`M10 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z`})}),h=o(`inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,u);function g({items:e,triggerClassName:t}){let{t:n}=i(`openhands`),[r,u]=(0,f.useState)(!1),[g,_]=(0,f.useState)(),v=(0,f.useRef)(null),y=(0,f.useRef)(null);(0,f.useLayoutEffect)(()=>{if(!r||!v.current)return;let t=()=>{let t=v.current?.getBoundingClientRect();if(!t)return;let n=(y.current?.getBoundingClientRect().height??0)||e.length*36;_({position:`fixed`,zIndex:9999,...t.bottom+4+n>window.innerHeight?{bottom:window.innerHeight-t.top+4}:{top:t.bottom+4},right:window.innerWidth-t.right})};t();let n=window.requestAnimationFrame(t);return window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.cancelAnimationFrame(n),window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[r,e.length]),(0,f.useEffect)(()=>{if(!r)return;let e=e=>{let t=e.target;v.current?.contains(t)||y.current?.contains(t)||u(!1)},t=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let b=r&&g?(0,p.jsx)(c,{ref:y,theme:`popover`,className:`min-w-[10rem]`,children:e.map(e=>(0,p.jsx)(`li`,{children:(0,p.jsx)(l,{onClick:t=>{t.stopPropagation(),e.onClick(),u(!1)},isDisabled:e.disabled,className:`group`,children:(0,p.jsx)(s,{icon:e.icon,label:e.label})})},e.label))}):null;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`button`,{ref:v,type:`button`,onClick:e=>{e.stopPropagation(),u(e=>!e)},className:o(h,t),"aria-label":n(a.AUTOMATIONS$ACTIONS_MENU),"aria-expanded":r,"aria-haspopup":`menu`,children:(0,p.jsx)(m,{className:`size-4`})}),r&&g&&typeof document<`u`?d.createPortal((0,p.jsx)(`div`,{style:g,children:b}),document.body):null]})}var _=e=>(0,p.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,p.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})});export{g as n,h as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-
|
|
1
|
+
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-
|
|
1
|
+
import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-BgLSZdyy.js";import{t as n}from"./dist-Bl64nBZL.js";var r=e(),i=n(``,{variants:{variant:{h1:`text-[32px] text-white font-medium leading-5`,h2:`text-xl font-medium leading-6 -tracking-[0.02em] text-white`,h3:`text-sm font-medium text-[var(--oh-text-tertiary)]`,span:`text-sm font-normal text-white leading-5.5`,p:`text-sm font-normal text-white leading-5.5`,codeBlock:`font-mono text-sm leading-relaxed text-[var(--oh-text-tertiary)] whitespace-pre-wrap`}},defaultVariants:{variant:`h1`}});function a({variant:e,className:n,testId:a,children:o}){return(0,r.jsx)(e,{"data-testid":a,className:t(i({variant:e}),n),children:o})}function o({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h1`,className:e,testId:t,children:n})}function s({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h2`,className:e,testId:t,children:n})}function c({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h3`,className:e,testId:t,children:n})}function l({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`span`,className:e,testId:t,children:n})}function u({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`codeBlock`,className:e,testId:t,children:n})}function d({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`p`,className:e,testId:t,children:n})}a.H1=o,a.H2=s,a.H3=c,a.Text=l,a.CodeBlock=u,a.Paragraph=d;export{l as n,a as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useQuery-DAAacS7O.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{n as a}from"./active-backend-context-BnH4-L8h.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{n as c}from"./agent-server-client-options-EHB23gyx.js";import{r as l}from"./vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js";import{r as u}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{t as d}from"./info-BcajzHn1.js";import{t as f}from"./loader-circle-BxJgk73D.js";import{t as p}from"./refresh-cw-BtdC3T8P.js";import{o as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as h}from"./brand-button-CUMfjb99.js";import{t as g}from"./styled-tooltip-CejG0rqv.js";import{d as _,f as v,l as y,u as b}from"./llm-not-configured-banner-Dh_ajcM8.js";import{g as x,tt as S}from"./markdown-renderer-DyFl9-mL.js";import{t as C}from"./conversation-tab-empty-state-B3dpJXX0.js";var w=e(t(),1);function T(e=!0){let t=x(e=>e.cost),n=x(e=>e.max_budget_per_task),r=x(e=>e.usage),{data:i}=S(),{data:a}=v(i?.id,i?.conversation_url,i?.session_api_key,e);return(0,w.useMemo)(()=>t!==null||r!==null?{cost:t,max_budget_per_task:n,usage:r}:a?{cost:a.accumulated_cost,max_budget_per_task:a.max_budget_per_task,usage:a.accumulated_token_usage?{prompt_tokens:a.accumulated_token_usage.prompt_tokens??0,completion_tokens:a.accumulated_token_usage.completion_tokens??0,cache_read_tokens:a.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:a.accumulated_token_usage.cache_write_tokens??0,context_window:a.accumulated_token_usage.context_window??0,per_turn_token:a.accumulated_token_usage.per_turn_token??0}:null}:{cost:null,max_budget_per_task:null,usage:null},[a,t,n,r])}var E=n();function D({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,E.jsx)(`div`,{className:`relative mt-1 h-1.5 w-full rounded-full bg-tertiary`,children:(0,E.jsx)(`div`,{className:s(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function O({currentCost:e,maxBudget:t}){let{t:n}=i(`openhands`),r=e/t*100;return(0,E.jsx)(`div`,{className:`flex justify-end`,children:(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(o.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:r.toFixed(2),used:n(o.CONVERSATION$USED)})})})}function k({cost:e,maxBudgetPerTask:t}){return e===null||t===null||t<=0?null:(0,E.jsxs)(`div`,{children:[(0,E.jsx)(D,{currentCost:e,maxBudget:t}),(0,E.jsx)(O,{currentCost:e,maxBudget:t})]})}function A({cost:e,maxBudgetPerTask:t}){let{t:n}=i(`openhands`);return e===null?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(k,{cost:e,maxBudgetPerTask:t}),(0,E.jsxs)(`div`,{className:`flex justify-between items-center border-t border-[var(--oh-border-subtle)] pt-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:n(o.CONVERSATION$TOTAL_COST)}),(0,E.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]})]})}function j({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`,showBorder:i=!0}){return(0,E.jsxs)(`div`,{className:s(`flex justify-between items-center pb-2`,i&&`border-b border-[var(--oh-border-subtle)]`),children:[(0,E.jsx)(`span`,{className:n,children:e}),(0,E.jsx)(`span`,{className:r,children:t})]})}function M({usage:e}){let{t}=i(`openhands`);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(j,{label:t(o.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(o.CONVERSATION$CACHE_HIT)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(o.CONVERSATION$CACHE_WRITE)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,E.jsx)(j,{label:t(o.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,E.jsx)(j,{label:t(o.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`,showBorder:!1})]})}function N({fillPercent:e,perTurnToken:t=0}){let{t:n}=i(`openhands`),{handleCompact:r,isCompacting:a,isDisabled:s,description:c}=b(t),u=e>70;return(0,E.jsxs)(`div`,{"data-testid":`compact-context-section`,className:`flex flex-col gap-2 border-t border-[var(--oh-border-subtle)] pt-3`,children:[u&&(0,E.jsx)(`span`,{className:`text-xs text-amber-500`,children:n(o.CONVERSATION$CONTEXT_FILLING_UP)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(h,{testId:`compact-context-button`,type:`button`,variant:u?`primary`:`secondary`,isDisabled:s,"aria-busy":a,onClick:r,startContent:a?(0,E.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):(0,E.jsx)(l,{className:`h-4 w-4`,"aria-hidden":!0}),className:`w-fit`,children:n(o.CONVERSATION$COMPACT_CONTEXT)}),(0,E.jsx)(g,{content:c,placement:`top`,tooltipClassName:`max-w-[220px] text-xs font-normal leading-relaxed whitespace-normal`,children:(0,E.jsx)(`button`,{type:`button`,"data-testid":`compact-context-info`,"aria-label":c,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] transition-colors cursor-help`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":!0})})})]})]})}var P=`/api/llm/balance`,F=1e4;function I(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function L(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function R(e){return I(e)&&(e.name===`TimeoutError`||e.name===`AbortError`)}function z(e){return!I(e)||typeof e.provider!=`string`?null:{provider:e.provider,limit:L(e.limit),limitRemaining:L(e.limit_remaining),usage:L(e.usage)??0,usageDaily:L(e.usage_daily),usageWeekly:L(e.usage_weekly),usageMonthly:L(e.usage_monthly),isFreeTier:e.is_free_tier===!0}}var B=class{static async getBalance(){let{host:e,apiKey:t}=c(),n=new m({host:e,apiKey:t,timeout:F});try{return z(await n.get(P,{acceptableStatusCodes:new Set([200]),responseType:`json`,timeoutSeconds:Math.floor(F/1e3)}))}catch(e){if(e instanceof Error&&`status`in e&&e.status===404)return null;if(R(e))throw Error(`Balance request timed out after ${F}ms`);let t=e instanceof Error&&`status`in e&&e.status;throw Error(t?`Balance request failed with ${t}`:`Balance request failed: ${e instanceof Error?e.message:String(e)}`)}finally{n.close()}}},V=e=>{let{backend:t}=a();return r({queryKey:[`llm-balance`,t.id,e],queryFn:()=>B.getBalance(),enabled:t.kind!==`cloud`&&!!e,staleTime:1/0,gcTime:1e3*60*5,retry:!1,refetchOnWindowFocus:!1})};function H(e){return`$${e.toFixed(2)}`}function U(){let{t:e}=i(`openhands`),{data:t}=S(),{data:n,isError:r,isFetching:a,refetch:c}=V(t?.id);if(!n||r)return null;let l=n.limit!==null&&n.limitRemaining!==null;return(0,E.jsxs)(`div`,{"data-testid":`provider-balance-card`,className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between pb-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:e(o.CONVERSATION$PROVIDER_BALANCE)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[n.provider,n.isFreeTier?` · ${e(o.CONVERSATION$FREE_TIER)}`:null]}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`provider-balance-refresh`,"aria-label":e(o.BUTTON$REFRESH),disabled:a,onClick:()=>c(),className:`cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default`,children:(0,E.jsx)(p,{className:s(`h-3.5 w-3.5`,a&&`animate-spin`)})})]})]}),(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[l?(0,E.jsx)(j,{label:e(o.CONVERSATION$CREDITS_REMAINING),value:H(n.limitRemaining??0)}):null,(0,E.jsx)(j,{label:e(o.CONVERSATION$CREDITS_USED),value:H(n.usage),valueClassName:l?``:`font-semibold`,labelClassName:l?`text-[var(--oh-muted)]`:``})]})]})}function W(){let{t:e}=i(`openhands`),t=T(),{data:n}=S(),r=n?.agent_kind===`acp`,{usage:a}=t;return t.cost!==null||a!==null?(0,E.jsxs)(`main`,{"data-testid":`usage-panel`,className:`h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3`,children:[a!==null&&(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(y,{perTurnToken:a.per_turn_token,contextWindow:a.context_window}),(0,E.jsx)(N,{fillPercent:_(a.per_turn_token,a.context_window),perTurnToken:a.per_turn_token})]})}),(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(`div`,{className:`flex justify-between items-center pb-2`,children:(0,E.jsx)(`span`,{className:`text-lg font-semibold`,children:e(o.CONVERSATION$TOKEN_USAGE)})}),r&&(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:e(o.CONVERSATION$PLAN_USAGE_NOTE)}),a!==null&&(0,E.jsx)(M,{usage:a}),(0,E.jsx)(A,{cost:t.cost,maxBudgetPerTask:t.max_budget_per_task})]})}),(0,E.jsx)(U,{})]}):(0,E.jsx)(C,{icon:(0,E.jsx)(u,{}),children:e(o.CONVERSATION$NO_METRICS)})}function G(){return(0,E.jsx)(W,{})}export{G as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,dt as c,n as l,st as u,ut as d}from"./active-backend-context-BnH4-L8h.js";import{K as f,t as p}from"./utils-BgLSZdyy.js";import{n as m}from"./agent-server-client-options-EHB23gyx.js";import{t as h}from"./check-Bo8s5Ylg.js";import{t as g}from"./loader-circle-BxJgk73D.js";import{b as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{l as v}from"./form-control-classes-Dbq-7YP_.js";import{n as y,t as b}from"./settings-input-dVuzapBA.js";import{a as x,l as S}from"./acp-providers-DcY_mKYa.js";import{t as C}from"./use-get-secrets-CMTuWEp_.js";import{t as w}from"./use-create-secret-CjWq0J4O.js";var T=i(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),E=e(t(),1),D=n();function O({conflicts:e}){let{t}=o(`openhands`);return(0,D.jsx)(D.Fragment,{children:e.map(([e,n])=>(0,D.jsx)(`p`,{"data-testid":`acp-credential-conflict-warning`,className:`text-sm text-amber-300`,children:t(f.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function k({status:e,isChecking:t,credentialsConfigured:n}){return e===`authenticated`?`signed-in`:t?`checking`:n?`configured`:`none`}function A({status:e,isChecking:t,providerName:n,credentialsConfigured:r=!1,testIdPrefix:i}){let{t:a}=o(`openhands`),s=k({status:e,isChecking:t,credentialsConfigured:r});return s===`signed-in`?(0,D.jsxs)(`div`,{"data-testid":`${i}-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,D.jsx)(h,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_AUTH_DETECTED,{provider:n})})]}):s===`checking`?(0,D.jsxs)(`div`,{"data-testid":`${i}-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,D.jsx)(g,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):s===`configured`?(0,D.jsxs)(`div`,{"data-testid":`${i}-configured`,className:`flex items-start gap-2 rounded-xl border border-blue-500/40 bg-blue-500/10 px-4 py-3 text-sm text-blue-200`,children:[(0,D.jsx)(T,{className:`mt-0.5 size-4 shrink-0 text-blue-400`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_CREDENTIALS_CONFIGURED,{provider:n})})]}):null}function j({field:e,value:t,onChange:n,alreadySet:r,testId:i,showOptionalTag:a}){let{t:s}=o(`openhands`),c=r?s(f.ONBOARDING$ACP_SECRET_ALREADY_SET):``;return(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.multiline?(0,D.jsxs)(`label`,{className:`flex flex-col gap-2.5`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`text-sm font-mono text-white`,children:e.name}),a&&(0,D.jsx)(y,{})]}),(0,D.jsx)(`textarea`,{"data-testid":i,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:c,onChange:e=>n(e.target.value),className:p(v,`font-mono text-xs`)})]}):(0,D.jsx)(b,{testId:i,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:a,placeholder:c}),(0,D.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:s(e.hint_key,e.hint_values)})]})}var M=10;function N(e){return`${e.stdout??``}\n${e.stderr??``}`}function P(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function F(e){let t=N(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function I(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var L={"claude-code":{command:`claude auth status --json`,classify:P},codex:{command:`codex login status`,classify:F},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:I}},R=class{static async getAuthStatus(e){let t=L[e];if(!t)return`unknown`;let n=await new _(m()).executeCommand(t.command,void 0,M);return t.classify(n)}};async function z(e){try{return await R.getAuthStatus(e)}catch{return`unknown`}}function B(e,t={}){let{enabled:n=!0}=t,r=l(),i=r.backend.kind===`local`,o=n&&i&&!!e,s=a({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>z(e),enabled:o,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:o&&s.isFetching&&s.data===void 0,isSupported:i}}function V(e,t){let{t:n}=o(`openhands`),i=r(),{mutateAsync:a}=w(),[l,p]=E.useState(!1);return{saveFilled:async(r,{silent:o=!1}={})=>{let l=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(l.length===0)return!0;p(!0);try{for(let{field:e,value:t}of l)await a({name:e.name,value:t});return await i.invalidateQueries({queryKey:[`secrets-search`]}),await i.invalidateQueries({queryKey:[`secrets`]}),!t&&l.some(({field:e})=>e.multiline)?d(n(f.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):o||s(n(f.SETTINGS$SAVED)),!0}catch(e){return u(c(e)||n(f.ERROR$GENERIC)),!1}finally{p(!1)}},isSaving:l}}function H(e){let{data:t}=C(),n=E.useMemo(()=>S(e),[e]),[r,i]=E.useState({}),{saveFilled:a,isSaving:o}=V(n,!0);E.useEffect(()=>{i({})},[e]);let s=E.useCallback(e=>(t??[]).some(t=>t.name===e),[t]),c=E.useCallback(e=>!!r[e]?.trim()||s(e),[r,s]),l=E.useCallback((e,t)=>i(n=>({...n,[e]:t})),[]),u=E.useCallback(()=>i({}),[]);return{fields:n,values:r,setValue:l,secretExists:s,hasValueFor:c,conflicts:x(e,c),credentialsConfigured:n.some(e=>e.secret===!0&&s(e.name)),consumesFileCredentials:!0,isDirty:n.some(e=>!!r[e.name]?.trim()),save:e=>a(r,e),reset:u,isSaving:o}}export{O as a,A as i,B as n,T as o,j as r,H as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{O as n,V as r}from"./active-backend-context-BnH4-L8h.js";import{t as i}from"./settings-service.api-C1vZH9Vh.js";import{t as a}from"./agent-profiles-service.api-DkeZaqIl.js";var o=[`activate-agent-profile`];function s(){let s=e();return t({mutationKey:o,mutationFn:e=>a.activateProfile(e),onMutate:async e=>{await s.cancelQueries({queryKey:n.all});let t=s.getQueriesData({queryKey:n.all});return s.setQueriesData({queryKey:n.all},t=>t&&{...t,active_agent_profile_id:e}),{snapshots:t}},onError:(e,t,n)=>{n?.snapshots?.forEach(([e,t])=>{s.setQueryData(e,t)})},onSuccess:async()=>{i.invalidateCache(),await s.invalidateQueries({queryKey:n.all}),await s.invalidateQueries({queryKey:r.personal()})}})}export{s as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./useQuery-DAAacS7O.js";import{M as t,O as n,k as r,n as i}from"./active-backend-context-BnH4-L8h.js";import{t as a}from"./agent-profiles-service.api-DkeZaqIl.js";function o(o={}){let{backend:s,orgId:c}=i();return e({queryKey:[...n.all,s.id,c],queryFn:a.listProfiles,...t,...r,enabled:o.enabled??!0,meta:{disableToast:!0}})}export{o as t};
|
package/build/assets/{use-automation-health-BZkQNEA8.js → use-automation-health-U99vvHxx.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useQuery-
|
|
1
|
+
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BnH4-L8h.js";import{n as i}from"./use-tracking-j4uo9VEW.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),s=[`automation-health`];function c(){let e=r();return n({queryKey:[...s,e.backend.id,e.orgId],queryFn:()=>i.checkHealth(),staleTime:30*1e3,retry:!1})}export{o as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useQuery-
|
|
1
|
+
import{t as e}from"./useQuery-DAAacS7O.js";import{n as t}from"./active-backend-context-BnH4-L8h.js";import{t as n}from"./organization-service.api-B5CvmnYQ.js";import{t as r}from"./use-cloud-current-user-id-B4ZLUZSa.js";var i=`view_automations`,a=`manage_automations`;function o(){let{backend:r,orgId:o}=t(),s=r.kind===`cloud`,{data:c,isLoading:l}=e({queryKey:[`cloud-current-user`,r.id,o,r.connectionRevision??0],queryFn:()=>n(o,r),enabled:s&&!!o,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});if(!s)return{canView:!0,canManage:!0,isLoading:!1};if(l||!c)return{canView:!1,canManage:!1,isLoading:l};if(c.permissions)return{canView:c.permissions.includes(i),canManage:c.permissions.includes(a),isLoading:!1};let u=c.role===`owner`||c.role===`admin`;return{canView:u||c.role===`member`,canManage:u,isLoading:!1}}function s(e){let{backend:n}=t(),i=r();if(n.kind!==`cloud`)return!0;let a=i[n.id];return!a||a.isLoading||!a.userId?!1:e.user_id===a.userId}export{s as n,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BnH4-L8h.js";import{n as i,t as a}from"./use-tracking-j4uo9VEW.js";import{t as o}from"./automation-C_eCrGyP.js";var s=[`automation-detail`],c=[`automation-runs`];function l(e){let{id:t,enabled:a=!0}=e,o=r();return n({queryKey:[...s,t,o.backend.id,o.orgId],queryFn:()=>i.getAutomation(t),staleTime:300*1e3,enabled:!!t&&a})}function u(e){let{id:t,limit:a=20,offset:s=0,enabled:l=!0}=e,u=r();return n({queryKey:[...c,t,{limit:a,offset:s},u.backend.id,u.orgId],queryFn:()=>i.getAutomationRuns(t,a,s),staleTime:60*1e3,enabled:!!t&&l,refetchInterval:e=>{let t=e.state.data;return t&&t.runs.some(e=>e.status===o.PENDING||e.status===o.RUNNING)?3e3:!1}})}var d=[`automations`];function f(e={}){let{limit:t=50,offset:a=0,enabled:o=!0}=e,s=r();return n({queryKey:[...d,{limit:t,offset:a},s.backend.id,s.orgId],queryFn:()=>i.getAutomations(t,a),staleTime:0,enabled:o})}function p(){let n=e(),o=r(),{trackAutomationDisableButton:c}=a();return t({mutationFn:({id:e,enabled:t})=>i.toggleAutomation(e,t),onSuccess:(e,t)=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),t.enabled||c({backendKind:o.backend.kind})}})}function m(){let n=e(),o=r(),{trackAutomationImported:s}=a();return t({mutationFn:e=>i.createAutomation({...e,enabled:!1}),onSuccess:()=>{n.invalidateQueries({queryKey:d}),s({backendKind:o.backend.kind})}})}function h(){let n=e(),o=r(),{trackAutomationEdited:c}=a();return t({mutationFn:({id:e,body:t})=>i.updateAutomation(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),c({backendKind:o.backend.kind})}})}function g(){let n=e(),o=r(),{trackAutomationDeleted:s}=a();return t({mutationFn:e=>i.deleteAutomation(e),onSuccess:()=>{n.invalidateQueries({queryKey:d}),s({backendKind:o.backend.kind})}})}function _(){let n=e(),o=r(),{trackAutomationExecuted:l}=a();return t({mutationFn:e=>i.dispatchAutomation(e),onSuccess:(e,t)=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),n.invalidateQueries({queryKey:[...c,t]}),n.invalidateQueries({queryKey:[`user`,`conversations`]}),l({backendKind:o.backend.kind})}})}function v(){let n=e();return t({mutationFn:({runId:e})=>i.cancelAutomationRun(e),onSuccess:(e,{automationId:t})=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),n.invalidateQueries({queryKey:[...c,t]}),n.invalidateQueries({queryKey:[`user`,`conversations`]})}})}export{m as a,c,_ as i,l,v as n,p as o,g as r,h as s,f as t,u};
|