@openhands/agent-canvas 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{Trans-De9RwQhA.js → Trans-DY6toRDu.js} +1 -1
- package/build/assets/{acp-providers-D_D8VUpP.js → acp-providers-Djl6vNn-.js} +1 -1
- package/build/assets/active-backend-context-B3umL5R-.js +1 -0
- package/build/assets/{add-backend-modal-DzuB9zlG.js → add-backend-modal-DljoP9lc.js} +1 -1
- package/build/assets/{agent-profiles-settings-BfAwTshW.js → agent-profiles-settings-BJMmTZgv.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-DfH2k6Sx.js → agent-server-conversation-service.api-D_ZvtJjG.js} +3 -3
- package/build/assets/agent-settings-BVVFzBWS.js +1 -0
- package/build/assets/{agent-settings-DjVlKgaP.js → agent-settings-lUknCeaF.js} +1 -1
- package/build/assets/{alert-banner-BW0wRYw6.js → alert-banner-Bpf2NQJq.js} +1 -1
- package/build/assets/{api-key-entry-screen-O8gS-fnF.js → api-key-entry-screen-CWEHcPJA.js} +1 -1
- package/build/assets/{app-settings-SlZvaXlk.js → app-settings-Dj90qosy.js} +1 -1
- package/build/assets/automation-detail-CXJU0_gF.js +2 -0
- package/build/assets/automation-export-FWY9LPsG.js +2 -0
- package/build/assets/automations-list-DDGBkWLC.js +1 -0
- package/build/assets/{back-nav-button-BYmxFxGt.js → back-nav-button-CUS2mi-U.js} +1 -1
- package/build/assets/{backend-form-modal-D2EDGVAc.js → backend-form-modal-DSbrafX2.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-6OCwIuLY.js → backend-synced-settings-badge-CanzmG12.js} +1 -1
- package/build/assets/{base-modal-CC5Pp8CF.js → base-modal-BuF2f0YL.js} +1 -1
- package/build/assets/{brand-button-DKPMEKcW.js → brand-button-vMVuyDXu.js} +1 -1
- package/build/assets/{browser-B39N74jU.js → browser-BifzWIBd.js} +1 -1
- package/build/assets/{browser-tab-aiDg7aEn.js → browser-tab-CkkqJnqw.js} +1 -1
- package/build/assets/{chat-send-button-DxuZIoW8.js → chat-send-button-B_jc5z5C.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-T3eAIuPQ.js → circle-plus-check-toggle-C5YxjxvI.js} +1 -1
- package/build/assets/{color-themes-Dd1sO5U6.js → color-themes-DPBzNtVg.js} +3 -3
- package/build/assets/{combobox-caret-CLGvOs32.js → combobox-caret-DoObzqf4.js} +1 -1
- package/build/assets/{command-menu-DKrLCRla.js → command-menu-D-JV3Wqm.js} +1 -1
- package/build/assets/{condenser-settings-BhxvlfoY.js → condenser-settings-30cX9SK6.js} +1 -1
- package/build/assets/{confirmation-modal-BK1F0A68.js → confirmation-modal-BGLu6XJN.js} +1 -1
- package/build/assets/{context-menu-list-item-DBFzplWW.js → context-menu-list-item-BD5_EaKN.js} +1 -1
- package/build/assets/conversation-BltULtFA.js +89 -0
- package/build/assets/conversation-e0a0_X4S.js +1 -0
- package/build/assets/conversation-panel-Cr9_ZGI-.js +1 -0
- package/build/assets/{conversation-service.api-Ch9kR9aE.js → conversation-service.api-DQaKzIRj.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-m8IUkfMj.js → conversation-tab-empty-state-B2dDYEwf.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-Aj9wFmt2.js → copy-to-clipboard-button-CaR52OnA.js} +1 -1
- package/build/assets/declaration-gq8V5eTU.js +1 -0
- package/build/assets/{device-verify-B5YCrvSu.js → device-verify-BsznkV-a.js} +1 -1
- package/build/assets/{dropdown-classes-CgQ45JmQ.js → dropdown-classes-DJSXeLqc.js} +1 -1
- package/build/assets/{ellipsis-button-1BV9Sga8.js → ellipsis-button-C5Z-tPFp.js} +1 -1
- package/build/assets/{entry.client-BgWj9jL_.js → entry.client-JixNvFrr.js} +2 -2
- package/build/assets/{enum-filter-dropdown-DCITiYVi.js → enum-filter-dropdown-DXbVwiNZ.js} +1 -1
- package/build/assets/{environment-switch-overlay-DUnKILNH.js → environment-switch-overlay-DZQfRGTx.js} +1 -1
- package/build/assets/{extensions-hub-MtC8lK3A.js → extensions-hub-DfvgqzTc.js} +1 -1
- package/build/assets/{extensions-navigation-BtV14oQL.js → extensions-navigation-D9i0DL62.js} +1 -1
- package/build/assets/files-tab-DDtEJcGE.js +1 -0
- package/build/assets/{form-control-classes-9rkU4usZ.js → form-control-classes-ChpNBe9n.js} +1 -1
- package/build/assets/{git-provider-icon-CGU7_KiU.js → git-provider-icon-BjkecAuV.js} +1 -1
- package/build/assets/home-BCKWpKpf.js +1 -0
- package/build/assets/{install-server-modal-J_eQ6lhG.js → install-server-modal-BIugLhVB.js} +1 -1
- package/build/assets/{launch-DamfAY5L.js → launch-BgIlZLSX.js} +1 -1
- package/build/assets/lesson-plan-DgpP80mJ.js +4 -0
- package/build/assets/{llm-not-configured-banner-DTrLsVr_.js → llm-not-configured-banner-BlX8NifC.js} +4 -4
- package/build/assets/llm-settings-DJmbryaE.js +1 -0
- package/build/assets/{llm-settings-BgSFkbHC.js → llm-settings-kU5v0H1Z.js} +1 -1
- package/build/assets/{loading-spinner-DHAIPZkP.js → loading-spinner-BLdswi6q.js} +1 -1
- package/build/assets/{manage-backends-modal-BUzj5_Lq.js → manage-backends-modal-C8FJQIZR.js} +1 -1
- package/build/assets/manifest-56d40d7c.js +1 -0
- package/build/assets/{markdown-renderer-D8mayGjI.js → markdown-renderer-DMT7Zkpd.js} +1 -1
- package/build/assets/{mcp-DvqJYDbz.js → mcp-CHkklDMv.js} +1 -1
- package/build/assets/{messages-C4KEFkPk.js → messages-B3RugH7P.js} +11 -11
- package/build/assets/{modal-body-Dcu5McCa.js → modal-body-DouOE5KH.js} +1 -1
- package/build/assets/{modal-classes-DPqxSyuP.js → modal-classes-Cf-4tbHz.js} +1 -1
- package/build/assets/{modal-close-button-CTCX4nCH.js → modal-close-button-B6CfxxJj.js} +1 -1
- package/build/assets/{model-selector-VDHBytb6.js → model-selector-BOj1wBlq.js} +1 -1
- package/build/assets/onboarding-DYhDxmI9.js +1 -0
- package/build/assets/{onboarding-modal-CGHPoMp7.js → onboarding-modal-CP_WxDC9.js} +1 -1
- package/build/assets/{option-service.api-Dz7Eomnx.js → option-service.api-C0tYT4-r.js} +1 -1
- package/build/assets/{path-utils-CBaRYg35.js → path-utils-DWcgCGen.js} +1 -1
- package/build/assets/{plan-components-j9X4AxYM.js → plan-components-CcCBmCzW.js} +1 -1
- package/build/assets/{planner-tab-G4j36bJk.js → planner-tab-CCqdXxkL.js} +1 -1
- package/build/assets/providers-BxCuC9bZ.js +1 -0
- package/build/assets/recommended-automations-launcher-CVEF_1pc.js +58 -0
- package/build/assets/root-V8fkplMy.css +1 -0
- package/build/assets/root-layout-CttG_lQi.js +2 -0
- package/build/assets/{root-S6CfVoNm.js → root-uJ2t9rCQ.js} +2 -2
- package/build/assets/{runtime-waiting-state-DkzLgvMn.js → runtime-waiting-state-BsXLElvN.js} +1 -1
- package/build/assets/{schema-field-DwUzlw6b.js → schema-field-xUr6rDd6.js} +1 -1
- package/build/assets/{sdk-section-page-BUXONTx6.js → sdk-section-page-CbLrVUa3.js} +1 -1
- package/build/assets/{sdk-settings-schema-BjBkMHzZ.js → sdk-settings-schema-Cv7M9eSe.js} +1 -1
- package/build/assets/{secrets-settings-ZxyfRBgx.js → secrets-settings-DxTx9HgU.js} +1 -1
- package/build/assets/{segmented-toggle-Cen5AMUc.js → segmented-toggle-DyQqPhoD.js} +1 -1
- package/build/assets/{settings-Bx6vn-g8.js → settings-DnlfS09K.js} +1 -1
- package/build/assets/{settings-dropdown-input-xzoZwgUe.js → settings-dropdown-input-BjunGXJb.js} +1 -1
- package/build/assets/{settings-index-D4SM26d5.js → settings-index-BjeuYFFa.js} +1 -1
- package/build/assets/{settings-input-DYs7t3oK.js → settings-input-bD6npsDm.js} +1 -1
- package/build/assets/{settings-list-classes-DvQr5jVS.js → settings-list-classes-Dp_OgzN0.js} +1 -1
- package/build/assets/{settings-modal-BoC8oMlg.js → settings-modal-DfTcL-mV.js} +1 -1
- package/build/assets/settings-service.api-K4ncGlBv.js +1 -0
- package/build/assets/{settings-switch-C2N2xqEb.js → settings-switch-5cuxl8Dc.js} +1 -1
- package/build/assets/{shared-conversation-DMiaQFsj.js → shared-conversation-DWtBkJv7.js} +1 -1
- package/build/assets/{sidebar-layout-BtpUSN3j.js → sidebar-layout-DuzJMMw-.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CaV3tQFF.js → sidebar-mobile-menu-toggle-CMmAYkh8.js} +1 -1
- package/build/assets/{sidebar-nav-link-CIB3NBRW.js → sidebar-nav-link-5AlTT5-j.js} +1 -1
- package/build/assets/{skill-card-pill-row-D2bUe2kB.js → skill-card-pill-row-eTIkE4nz.js} +1 -1
- package/build/assets/{skills-plugins-D2WkrXkr.js → skills-plugins-BJ040luO.js} +1 -1
- package/build/assets/{skills-settings-CZGVOp_t.js → skills-settings-BYn4-AQQ.js} +1 -1
- package/build/assets/{styled-tooltip-DsKsFjuq.js → styled-tooltip-CgX2oRaK.js} +1 -1
- package/build/assets/{task-list-tab-BAThr9Ex.js → task-list-tab-0k9PhuqO.js} +1 -1
- package/build/assets/{terminal-B0aL_iDZ.js → terminal-BsGcSpRS.js} +1 -1
- package/build/assets/{toggle-switch-DBlOOzBr.js → toggle-switch-2j5wwR85.js} +1 -1
- package/build/assets/{typography-YGPBGzOG.js → typography-D8mHDeNG.js} +1 -1
- package/build/assets/{use-acp-credential-form-rzaqkJ1n.js → use-acp-credential-form-EtnbtYt0.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DY0txItX.js → use-activate-agent-profile-WaAZYz4E.js} +1 -1
- package/build/assets/{use-active-agent-profile-Cp5AFONR.js → use-active-agent-profile-CYY3vGar.js} +1 -1
- package/build/assets/{use-active-conversation-DvcFBqFe.js → use-active-conversation-D-r929nx.js} +1 -1
- package/build/assets/{use-agent-profiles-DnH16_Vm.js → use-agent-profiles-DEAMFp-W.js} +1 -1
- package/build/assets/{use-agent-state-BvRcEzY4.js → use-agent-state-DijdVAQ0.js} +1 -1
- package/build/assets/{use-backends-health-e-Ull4wz.js → use-backends-health-DkC7tKkC.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-OIhplvQ0.js → use-can-manage-org-profiles-BEo0peGn.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-ekU7UXDT.js → use-cloud-current-user-id-Dm99wXp2.js} +1 -1
- package/build/assets/{use-config-Dwf5gla-.js → use-config-CHzNIHpv.js} +1 -1
- package/build/assets/{use-create-conversation-CvAXfA3T.js → use-create-conversation-CTsvZ96U.js} +1 -1
- package/build/assets/{use-create-secret-BKeXCo__.js → use-create-secret-D5O5qdWC.js} +1 -1
- package/build/assets/{use-event-store-YSOxy9FC.js → use-event-store-DjgU4wfO.js} +1 -1
- package/build/assets/{use-handle-plan-click-cAXS-Hft.js → use-handle-plan-click-Mn_SNTCh.js} +1 -1
- package/build/assets/{use-llm-profiles-BcLibtGb.js → use-llm-profiles-BMhPDlwQ.js} +1 -1
- package/build/assets/use-runtime-is-ready-CC-KrLKe.js +1 -0
- package/build/assets/{use-save-agent-profile-DFjxHhNx.js → use-save-agent-profile-CLMmbx_X.js} +1 -1
- package/build/assets/{use-save-settings-5xPYpSQM.js → use-save-settings-D1HoCDbn.js} +1 -1
- package/build/assets/{use-settings-B07msZ2Z.js → use-settings-BReAMxCG.js} +1 -1
- package/build/assets/{use-settings-nav-items-CswsOEyw.js → use-settings-nav-items-xe1YgLnE.js} +1 -1
- package/build/assets/{use-skills-Aoaoq_ei.js → use-skills-Dqo-pDDx.js} +1 -1
- package/build/assets/{use-task-list-CmWGElgb.js → use-task-list-AVBLbbcR.js} +1 -1
- package/build/assets/{use-tracking-CqODdfO4.js → use-tracking-2ZwQwpg_.js} +1 -1
- package/build/assets/{use-user-conversation-BPHQ-dm-.js → use-user-conversation-OAfenBRG.js} +1 -1
- package/build/assets/{useTranslation-Cgy4JA_g.js → useTranslation-CDRCKC9-.js} +1 -1
- package/build/assets/{utils-CE0lDWtb.js → utils-D3U3rlqr.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-DJHl5b-B.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js} +267 -27
- package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js +1 -0
- package/build/assets/{verification-settings-DZQ-JvKH.js → verification-settings-DnXS6VWv.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +24 -0
- package/build/locales/ca/openhands.json +24 -0
- package/build/locales/de/openhands.json +24 -0
- package/build/locales/en/openhands.json +24 -0
- package/build/locales/es/openhands.json +24 -0
- package/build/locales/fr/openhands.json +24 -0
- package/build/locales/it/openhands.json +24 -0
- package/build/locales/ja/openhands.json +24 -0
- package/build/locales/ko-KR/openhands.json +24 -0
- package/build/locales/no/openhands.json +24 -0
- package/build/locales/pt/openhands.json +24 -0
- package/build/locales/tr/openhands.json +24 -0
- package/build/locales/uk/openhands.json +24 -0
- package/build/locales/zh-CN/openhands.json +24 -0
- package/build/locales/zh-TW/openhands.json +24 -0
- package/config/defaults.json +4 -4
- package/dist/api/automation-service/automation-service.api.d.ts +2 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.cjs.map +1 -1
- package/dist/api/event-service/event-service.api.js +1 -1
- package/dist/api/event-service/event-service.api.js.map +1 -1
- package/dist/api/event-service/event-service.types.d.ts +6 -0
- package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
- package/dist/api/git-service/agent-server-git-service.api.cjs.map +1 -1
- package/dist/api/git-service/agent-server-git-service.api.js +2 -2
- package/dist/api/git-service/agent-server-git-service.api.js.map +1 -1
- package/dist/api/git-service/git-service.api.cjs +1 -1
- package/dist/api/git-service/git-service.api.cjs.map +1 -1
- package/dist/api/git-service/git-service.api.js +2 -2
- package/dist/api/git-service/git-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/event-thought-helpers.cjs +1 -1
- package/dist/components/conversation-events/chat/event-thought-helpers.js +1 -1
- package/dist/components/features/automations/automation-card.d.ts +2 -1
- package/dist/components/features/automations/automation-group.d.ts +2 -1
- package/dist/components/features/automations/automation-list-row.d.ts +2 -1
- package/dist/components/features/automations/build-automation-menu-items.d.ts +2 -1
- package/dist/components/features/automations/detail/detail-header.d.ts +3 -1
- package/dist/components/features/automations/import-automation-modal.d.ts +10 -0
- package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.d.ts +2 -1
- package/dist/components/features/conversation/conversation-name-context-menu.js +74 -63
- package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-name.cjs +1 -1
- package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name.js +73 -61
- package/dist/components/features/conversation/conversation-name.js.map +1 -1
- package/dist/components/features/conversation/transcript-export-modal.cjs +2 -0
- package/dist/components/features/conversation/transcript-export-modal.cjs.map +1 -0
- package/dist/components/features/conversation/transcript-export-modal.d.ts +10 -0
- package/dist/components/features/conversation/transcript-export-modal.js +140 -0
- package/dist/components/features/conversation/transcript-export-modal.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
- package/dist/components/features/home/shared/dropdown-item.cjs +1 -1
- package/dist/components/features/home/shared/dropdown-item.cjs.map +1 -1
- package/dist/components/features/home/shared/dropdown-item.d.ts +7 -1
- package/dist/components/features/home/shared/dropdown-item.js +2 -1
- package/dist/components/features/home/shared/dropdown-item.js.map +1 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.cjs +1 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.cjs.map +1 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.d.ts +8 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.js +18 -10
- package/dist/components/features/home/shared/generic-dropdown-menu.js.map +1 -1
- package/dist/components/features/home/workspace-dropdown/workspace-dropdown.d.ts +11 -2
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +4 -4
- package/dist/config/defaults.js.map +1 -1
- package/dist/hooks/query/use-automations.d.ts +2 -1
- package/dist/hooks/query/use-resolved-workspaces.cjs +1 -1
- package/dist/hooks/query/use-resolved-workspaces.cjs.map +1 -1
- package/dist/hooks/query/use-resolved-workspaces.d.ts +9 -1
- package/dist/hooks/query/use-resolved-workspaces.js +1 -0
- package/dist/hooks/query/use-resolved-workspaces.js.map +1 -1
- package/dist/hooks/query/use-workspace-file-content.cjs +1 -1
- package/dist/hooks/query/use-workspace-file-content.cjs.map +1 -1
- package/dist/hooks/query/use-workspace-file-content.js +61 -55
- package/dist/hooks/query/use-workspace-file-content.js.map +1 -1
- package/dist/hooks/query/use-workspace-files.cjs +1 -1
- package/dist/hooks/query/use-workspace-files.cjs.map +1 -1
- package/dist/hooks/query/use-workspace-files.d.ts +11 -4
- package/dist/hooks/query/use-workspace-files.js +39 -18
- package/dist/hooks/query/use-workspace-files.js.map +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.cjs +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.cjs.map +1 -1
- package/dist/hooks/use-auto-refresh-files-on-edit.d.ts +9 -0
- package/dist/hooks/use-auto-refresh-files-on-edit.js +15 -11
- package/dist/hooks/use-auto-refresh-files-on-edit.js.map +1 -1
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +7 -0
- package/dist/hooks/use-tracking.js +9 -0
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +24 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +1 -1
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +408 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +24 -0
- package/dist/locales/ca/openhands.json +24 -0
- package/dist/locales/de/openhands.json +24 -0
- package/dist/locales/en/openhands.json +24 -0
- package/dist/locales/es/openhands.json +24 -0
- package/dist/locales/fr/openhands.json +24 -0
- package/dist/locales/it/openhands.json +24 -0
- package/dist/locales/ja/openhands.json +24 -0
- package/dist/locales/ko-KR/openhands.json +24 -0
- package/dist/locales/no/openhands.json +24 -0
- package/dist/locales/pt/openhands.json +24 -0
- package/dist/locales/tr/openhands.json +24 -0
- package/dist/locales/uk/openhands.json +24 -0
- package/dist/locales/zh-CN/openhands.json +24 -0
- package/dist/locales/zh-TW/openhands.json +24 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js +70 -3
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +27 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js +33 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +48 -46
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +267 -27
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +36 -30
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/dist/routes/files-tab.cjs +1 -1
- package/dist/routes/files-tab.js +10 -10
- package/dist/themes/color-themes.cjs +3 -3
- package/dist/themes/color-themes.cjs.map +1 -1
- package/dist/themes/color-themes.d.ts +13 -2
- package/dist/themes/color-themes.js +2 -2
- package/dist/themes/color-themes.js.map +1 -1
- package/dist/types/automation.d.ts +8 -0
- package/dist/utils/custom-toast-handlers.cjs.map +1 -1
- package/dist/utils/custom-toast-handlers.d.ts +1 -0
- package/dist/utils/custom-toast-handlers.js.map +1 -1
- package/dist/utils/mcp-server-name.cjs +1 -1
- package/dist/utils/mcp-server-name.cjs.map +1 -1
- package/dist/utils/mcp-server-name.js +2 -2
- package/dist/utils/mcp-server-name.js.map +1 -1
- package/dist/utils/transcript-export/index.cjs +72 -0
- package/dist/utils/transcript-export/index.cjs.map +1 -0
- package/dist/utils/transcript-export/index.d.ts +10 -0
- package/dist/utils/transcript-export/index.js +302 -0
- package/dist/utils/transcript-export/index.js.map +1 -0
- package/dist/utils/transcript-export/load-complete-events.cjs +2 -0
- package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -0
- package/dist/utils/transcript-export/load-complete-events.d.ts +22 -0
- package/dist/utils/transcript-export/load-complete-events.js +39 -0
- package/dist/utils/transcript-export/load-complete-events.js.map +1 -0
- package/package.json +2 -2
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +2 -2
- package/build/assets/active-backend-context-DRFevVIj.js +0 -1
- package/build/assets/agent-settings-CMMms-0q.js +0 -1
- package/build/assets/automation-detail-CwsNJ9AM.js +0 -2
- package/build/assets/automations-list-B9cPtugh.js +0 -1
- package/build/assets/conversation-B8prFAZF.js +0 -19
- package/build/assets/conversation-DGVDwGn8.js +0 -1
- package/build/assets/conversation-panel-C7DC4Cxx.js +0 -1
- package/build/assets/declaration-B9kpCaYl.js +0 -1
- package/build/assets/edit-automation-modal-BoibW8cd.js +0 -1
- package/build/assets/files-tab-DHqtsKLy.js +0 -1
- package/build/assets/home-BgjWP_UN.js +0 -1
- package/build/assets/lesson-plan-HD886V64.js +0 -4
- package/build/assets/llm-settings-Bkc8C5Bi.js +0 -1
- package/build/assets/manifest-4d6a1552.js +0 -1
- package/build/assets/onboarding-gGIqoxvA.js +0 -1
- package/build/assets/providers-CPoq0VXm.js +0 -1
- package/build/assets/recommended-automations-launcher-CXaEK1rW.js +0 -50
- package/build/assets/root-CxWZUXTQ.css +0 -1
- package/build/assets/root-layout-CvxdHJ6j.js +0 -2
- package/build/assets/settings-service.api-DldkFI1x.js +0 -1
- package/build/assets/use-runtime-is-ready-CBFe69Ew.js +0 -1
- package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-L2sdihTY.js +0 -1
package/dist/package.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`./_virtual/_rolldown/runtime.cjs`);var e={name:`@openhands/agent-canvas`,version:`1.
|
|
1
|
+
require(`./_virtual/_rolldown/runtime.cjs`);var e={name:`@openhands/agent-canvas`,version:`1.3.0`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/agent-canvas`},homepage:`https://github.com/OpenHands/agent-canvas#readme`,bugs:{url:`https://github.com/OpenHands/agent-canvas/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.20`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`0.9.0`,"@openhands/typescript-client":`1.32.1`,"@react-router/node":`7.17.0`,"@react-router/serve":`7.17.0`,"@tailwindcss/vite":`4.2.4`,"@tanstack/react-query":`5.100.9`,"@types/shell-quote":`1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.16.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,httpxy:`0.5.3`,i18next:`26.0.8`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.0`,isbot:`5.1.39`,"lucide-react":`1.14.0`,"monaco-editor":`0.55.1`,"posthog-js":`1.372.6`,react:`19.2.5`,"react-dom":`19.2.5`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.6`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.17.0`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`1.8.4`,sirv:`3.0.2`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.5.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.10`,winston:`3.19.0`,"winston-daily-rotate-file":`5.0.0`,zustand:`5.0.12`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test:coverage":`npm run make-i18n && vitest run --coverage`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true VITE_APP_ENV=production vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`,"example:acp-docker:env":`node scripts/gen-acp-docker-env.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`node scripts/run-staged-typecheck.mjs`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.1`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.59.1`,"@react-router/dev":`7.17.0`,"@tailwindcss/typography":`0.5.19`,"@tanstack/eslint-plugin-query":`5.100.9`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`6.9.1`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`25.6.0`,"@types/react":`19.2.14`,"@types/react-dom":`19.2.3`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.59.2`,"@typescript-eslint/parser":`8.59.2`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.5`,"cross-env":`10.1.0`,eslint:`9.39.4`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.4`,"eslint-plugin-i18next":`6.1.4`,"eslint-plugin-import-x":`4.16.2`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.5`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`29.1.1`,"lint-staged":`16.4.0`,msw:`2.14.2`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.2.4`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.5`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.7`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.17.0`}};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=package.cjs.map
|
package/dist/package.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.3.0\",\n \"description\": \"Agent Canvas UI for OpenHands - run AI coding agents with a visual interface\",\n \"license\": \"MIT\",\n \"private\": false,\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/OpenHands/agent-canvas\"\n },\n \"homepage\": \"https://github.com/OpenHands/agent-canvas#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/OpenHands/agent-canvas/issues\"\n },\n \"bin\": {\n \"agent-canvas\": \"bin/agent-canvas.mjs\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"dependencies\": {\n \"@heroui/react\": \"2.8.10\",\n \"@microlink/react-json-view\": \"1.31.20\",\n \"@monaco-editor/react\": \"4.7.0\",\n \"@openhands/extensions\": \"0.9.0\",\n \"@openhands/typescript-client\": \"1.32.1\",\n \"@react-router/node\": \"7.17.0\",\n \"@react-router/serve\": \"7.17.0\",\n \"@tailwindcss/vite\": \"4.2.4\",\n \"@tanstack/react-query\": \"5.100.9\",\n \"@types/shell-quote\": \"1.7.5\",\n \"@uidotdev/usehooks\": \"2.4.1\",\n \"@xterm/addon-fit\": \"0.11.0\",\n \"@xterm/xterm\": \"6.0.0\",\n \"axios\": \"1.16.0\",\n \"class-variance-authority\": \"0.7.1\",\n \"clsx\": \"2.1.1\",\n \"downshift\": \"9.3.2\",\n \"framer-motion\": \"12.38.0\",\n \"httpxy\": \"0.5.3\",\n \"i18next\": \"26.0.8\",\n \"i18next-browser-languagedetector\": \"8.2.1\",\n \"i18next-http-backend\": \"4.0.0\",\n \"isbot\": \"5.1.39\",\n \"lucide-react\": \"1.14.0\",\n \"monaco-editor\": \"0.55.1\",\n \"posthog-js\": \"1.372.6\",\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-hot-toast\": \"2.6.0\",\n \"react-i18next\": \"17.0.6\",\n \"react-icons\": \"5.6.0\",\n \"react-markdown\": \"10.1.0\",\n \"react-router\": \"7.17.0\",\n \"react-syntax-highlighter\": \"16.1.1\",\n \"rehype-raw\": \"7.0.0\",\n \"rehype-sanitize\": \"6.0.0\",\n \"remark-breaks\": \"4.0.0\",\n \"remark-gfm\": \"4.0.1\",\n \"shell-quote\": \"1.8.4\",\n \"sirv\": \"3.0.2\",\n \"sirv-cli\": \"3.0.1\",\n \"socket.io-client\": \"4.8.3\",\n \"tailwind-merge\": \"3.5.0\",\n \"tailwind-scrollbar\": \"4.0.2\",\n \"unist-util-visit\": \"5.1.0\",\n \"uuid\": \"14.0.0\",\n \"vite\": \"8.0.10\",\n \"winston\": \"3.19.0\",\n \"winston-daily-rotate-file\": \"5.0.0\",\n \"zustand\": \"5.0.12\"\n },\n \"scripts\": {\n \"dev\": \"node --env-file-if-exists=.env scripts/dev-with-automation.mjs\",\n \"dev:static\": \"node --env-file-if-exists=.env scripts/dev-static.mjs\",\n \"dev:extra-backend\": \"node --env-file-if-exists=.env scripts/dev-extra-backend.mjs\",\n \"dev:minimal\": \"node --env-file-if-exists=.env scripts/dev-safe.mjs\",\n \"dev:frontend\": \"npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev\",\n \"dev:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev\",\n \"build\": \"npm run build:app\",\n \"build:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router build\",\n \"start\": \"npx sirv-cli build/ --single\",\n \"test\": \"npm run make-i18n && vitest run\",\n \"test:e2e\": \"playwright test --pass-with-no-tests\",\n \"test:e2e:live\": \"node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs\",\n \"test:e2e:mock-llm\": \"playwright test --config=playwright.mock-llm.config.ts\",\n \"test:e2e:mock-llm:docker\": \"playwright test --config=playwright.mock-llm-docker.config.ts\",\n \"test:coverage\": \"npm run make-i18n && vitest run --coverage\",\n \"dev_wsl\": \"VITE_WATCH_USE_POLLING=true vite\",\n \"preview\": \"vite preview\",\n \"make-i18n\": \"node scripts/make-i18n-translations.cjs\",\n \"prelint\": \"npm run make-i18n\",\n \"lint\": \"npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}\",\n \"lint:fix\": \"eslint src --fix && prettier --write src/**/*.{ts,tsx}\",\n \"prepare\": \"husky\",\n \"typecheck\": \"react-router typegen && tsc\",\n \"typecheck:staged\": \"react-router typegen && npx tsc --noEmit --skipLibCheck\",\n \"check-translation-completeness\": \"node scripts/check-translation-completeness.cjs\",\n \"build:app\": \"npm run make-i18n && react-router build\",\n \"build:lib\": \"npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true VITE_APP_ENV=production vite build && tsc -p tsconfig.lib.json\",\n \"build:docker\": \"node scripts/docker-build.mjs\",\n \"example:acp-docker:env\": \"node scripts/gen-acp-docker-env.mjs\"\n },\n \"lint-staged\": {\n \"src/**/*.{ts,tsx,js}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"src/**/*.{ts,tsx}\": [\n \"node scripts/run-staged-typecheck.mjs\"\n ],\n \"src/**/*\": [\n \"npm run check-translation-completeness\"\n ]\n },\n \"devDependencies\": {\n \"@eslint/eslintrc\": \"3.3.1\",\n \"@eslint/js\": \"9.39.4\",\n \"@mswjs/socket.io-binding\": \"0.2.0\",\n \"@playwright/test\": \"1.59.1\",\n \"@react-router/dev\": \"7.17.0\",\n \"@tailwindcss/typography\": \"0.5.19\",\n \"@tanstack/eslint-plugin-query\": \"5.100.9\",\n \"@testing-library/dom\": \"10.4.1\",\n \"@testing-library/jest-dom\": \"6.9.1\",\n \"@testing-library/react\": \"16.3.2\",\n \"@testing-library/user-event\": \"14.6.1\",\n \"@types/mdast\": \"4.0.4\",\n \"@types/node\": \"25.6.0\",\n \"@types/react\": \"19.2.14\",\n \"@types/react-dom\": \"19.2.3\",\n \"@types/react-syntax-highlighter\": \"15.5.13\",\n \"@typescript-eslint/eslint-plugin\": \"8.59.2\",\n \"@typescript-eslint/parser\": \"8.59.2\",\n \"@vercel/react-router\": \"1.3.0\",\n \"@vitest/coverage-v8\": \"4.1.5\",\n \"cross-env\": \"10.1.0\",\n \"eslint\": \"9.39.4\",\n \"eslint-config-prettier\": \"10.1.8\",\n \"eslint-import-resolver-typescript\": \"4.4.4\",\n \"eslint-plugin-i18next\": \"6.1.4\",\n \"eslint-plugin-import-x\": \"4.16.2\",\n \"eslint-plugin-jsx-a11y\": \"6.10.2\",\n \"eslint-plugin-prettier\": \"5.5.5\",\n \"eslint-plugin-react\": \"7.37.5\",\n \"eslint-plugin-react-hooks\": \"7.1.1\",\n \"eslint-plugin-unused-imports\": \"4.4.1\",\n \"globals\": \"16.5.0\",\n \"husky\": \"9.1.7\",\n \"jsdom\": \"29.1.1\",\n \"lint-staged\": \"16.4.0\",\n \"msw\": \"2.14.2\",\n \"postcss-prefix-selector\": \"2.1.1\",\n \"prettier\": \"3.8.3\",\n \"tailwindcss\": \"4.2.4\",\n \"typescript\": \"6.0.3\",\n \"vite-plugin-svgr\": \"5.2.0\",\n \"vitest\": \"4.1.5\"\n },\n \"packageManager\": \"npm@10.5.0\",\n \"volta\": {\n \"node\": \"22.12.0\"\n },\n \"msw\": {\n \"workerDirectory\": [\n \"public\"\n ]\n },\n \"overrides\": {\n \"@vercel/static-config\": {\n \"ajv\": \"8.20.0\"\n },\n \"dompurify\": \"3.4.7\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"bin\",\n \"build\",\n \"config\",\n \"scripts\",\n \"tools\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./browser\": {\n \"types\": \"./dist/components/browser/index.d.ts\",\n \"import\": \"./dist/components/browser/index.js\",\n \"require\": \"./dist/components/browser/index.cjs\"\n },\n \"./conversation\": {\n \"types\": \"./dist/components/conversation/index.d.ts\",\n \"import\": \"./dist/components/conversation/index.js\",\n \"require\": \"./dist/components/conversation/index.cjs\"\n },\n \"./files\": {\n \"types\": \"./dist/components/files/index.d.ts\",\n \"import\": \"./dist/components/files/index.js\",\n \"require\": \"./dist/components/files/index.cjs\"\n },\n \"./settings\": {\n \"types\": \"./dist/components/settings/index.d.ts\",\n \"import\": \"./dist/components/settings/index.js\",\n \"require\": \"./dist/components/settings/index.cjs\"\n },\n \"./sidebar\": {\n \"types\": \"./dist/components/sidebar/index.d.ts\",\n \"import\": \"./dist/components/sidebar/index.js\",\n \"require\": \"./dist/components/sidebar/index.cjs\"\n },\n \"./terminal\": {\n \"types\": \"./dist/components/terminal/index.d.ts\",\n \"import\": \"./dist/components/terminal/index.js\",\n \"require\": \"./dist/components/terminal/index.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.js\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"peerDependencies\": {\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-router\": \"7.17.0\"\n }\n}\n"],"mappings":""}
|
package/dist/package.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var e = {
|
|
2
2
|
name: "@openhands/agent-canvas",
|
|
3
|
-
version: "1.
|
|
3
|
+
version: "1.3.0",
|
|
4
4
|
description: "Agent Canvas UI for OpenHands - run AI coding agents with a visual interface",
|
|
5
5
|
license: "MIT",
|
|
6
6
|
private: !1,
|
|
@@ -17,7 +17,7 @@ var e = {
|
|
|
17
17
|
"@heroui/react": "2.8.10",
|
|
18
18
|
"@microlink/react-json-view": "1.31.20",
|
|
19
19
|
"@monaco-editor/react": "4.7.0",
|
|
20
|
-
"@openhands/extensions": "0.
|
|
20
|
+
"@openhands/extensions": "0.9.0",
|
|
21
21
|
"@openhands/typescript-client": "1.32.1",
|
|
22
22
|
"@react-router/node": "7.17.0",
|
|
23
23
|
"@react-router/serve": "7.17.0",
|
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@openhands/agent-canvas\",\n \"version\": \"1.3.0\",\n \"description\": \"Agent Canvas UI for OpenHands - run AI coding agents with a visual interface\",\n \"license\": \"MIT\",\n \"private\": false,\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/OpenHands/agent-canvas\"\n },\n \"homepage\": \"https://github.com/OpenHands/agent-canvas#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/OpenHands/agent-canvas/issues\"\n },\n \"bin\": {\n \"agent-canvas\": \"bin/agent-canvas.mjs\"\n },\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"dependencies\": {\n \"@heroui/react\": \"2.8.10\",\n \"@microlink/react-json-view\": \"1.31.20\",\n \"@monaco-editor/react\": \"4.7.0\",\n \"@openhands/extensions\": \"0.9.0\",\n \"@openhands/typescript-client\": \"1.32.1\",\n \"@react-router/node\": \"7.17.0\",\n \"@react-router/serve\": \"7.17.0\",\n \"@tailwindcss/vite\": \"4.2.4\",\n \"@tanstack/react-query\": \"5.100.9\",\n \"@types/shell-quote\": \"1.7.5\",\n \"@uidotdev/usehooks\": \"2.4.1\",\n \"@xterm/addon-fit\": \"0.11.0\",\n \"@xterm/xterm\": \"6.0.0\",\n \"axios\": \"1.16.0\",\n \"class-variance-authority\": \"0.7.1\",\n \"clsx\": \"2.1.1\",\n \"downshift\": \"9.3.2\",\n \"framer-motion\": \"12.38.0\",\n \"httpxy\": \"0.5.3\",\n \"i18next\": \"26.0.8\",\n \"i18next-browser-languagedetector\": \"8.2.1\",\n \"i18next-http-backend\": \"4.0.0\",\n \"isbot\": \"5.1.39\",\n \"lucide-react\": \"1.14.0\",\n \"monaco-editor\": \"0.55.1\",\n \"posthog-js\": \"1.372.6\",\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-hot-toast\": \"2.6.0\",\n \"react-i18next\": \"17.0.6\",\n \"react-icons\": \"5.6.0\",\n \"react-markdown\": \"10.1.0\",\n \"react-router\": \"7.17.0\",\n \"react-syntax-highlighter\": \"16.1.1\",\n \"rehype-raw\": \"7.0.0\",\n \"rehype-sanitize\": \"6.0.0\",\n \"remark-breaks\": \"4.0.0\",\n \"remark-gfm\": \"4.0.1\",\n \"shell-quote\": \"1.8.4\",\n \"sirv\": \"3.0.2\",\n \"sirv-cli\": \"3.0.1\",\n \"socket.io-client\": \"4.8.3\",\n \"tailwind-merge\": \"3.5.0\",\n \"tailwind-scrollbar\": \"4.0.2\",\n \"unist-util-visit\": \"5.1.0\",\n \"uuid\": \"14.0.0\",\n \"vite\": \"8.0.10\",\n \"winston\": \"3.19.0\",\n \"winston-daily-rotate-file\": \"5.0.0\",\n \"zustand\": \"5.0.12\"\n },\n \"scripts\": {\n \"dev\": \"node --env-file-if-exists=.env scripts/dev-with-automation.mjs\",\n \"dev:static\": \"node --env-file-if-exists=.env scripts/dev-static.mjs\",\n \"dev:extra-backend\": \"node --env-file-if-exists=.env scripts/dev-extra-backend.mjs\",\n \"dev:minimal\": \"node --env-file-if-exists=.env scripts/dev-safe.mjs\",\n \"dev:frontend\": \"npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev\",\n \"dev:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev\",\n \"build\": \"npm run build:app\",\n \"build:mock\": \"npm run make-i18n && cross-env VITE_MOCK_API=true react-router build\",\n \"start\": \"npx sirv-cli build/ --single\",\n \"test\": \"npm run make-i18n && vitest run\",\n \"test:e2e\": \"playwright test --pass-with-no-tests\",\n \"test:e2e:live\": \"node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs\",\n \"test:e2e:mock-llm\": \"playwright test --config=playwright.mock-llm.config.ts\",\n \"test:e2e:mock-llm:docker\": \"playwright test --config=playwright.mock-llm-docker.config.ts\",\n \"test:coverage\": \"npm run make-i18n && vitest run --coverage\",\n \"dev_wsl\": \"VITE_WATCH_USE_POLLING=true vite\",\n \"preview\": \"vite preview\",\n \"make-i18n\": \"node scripts/make-i18n-translations.cjs\",\n \"prelint\": \"npm run make-i18n\",\n \"lint\": \"npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}\",\n \"lint:fix\": \"eslint src --fix && prettier --write src/**/*.{ts,tsx}\",\n \"prepare\": \"husky\",\n \"typecheck\": \"react-router typegen && tsc\",\n \"typecheck:staged\": \"react-router typegen && npx tsc --noEmit --skipLibCheck\",\n \"check-translation-completeness\": \"node scripts/check-translation-completeness.cjs\",\n \"build:app\": \"npm run make-i18n && react-router build\",\n \"build:lib\": \"npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true VITE_APP_ENV=production vite build && tsc -p tsconfig.lib.json\",\n \"build:docker\": \"node scripts/docker-build.mjs\",\n \"example:acp-docker:env\": \"node scripts/gen-acp-docker-env.mjs\"\n },\n \"lint-staged\": {\n \"src/**/*.{ts,tsx,js}\": [\n \"eslint --fix\",\n \"prettier --write\"\n ],\n \"src/**/*.{ts,tsx}\": [\n \"node scripts/run-staged-typecheck.mjs\"\n ],\n \"src/**/*\": [\n \"npm run check-translation-completeness\"\n ]\n },\n \"devDependencies\": {\n \"@eslint/eslintrc\": \"3.3.1\",\n \"@eslint/js\": \"9.39.4\",\n \"@mswjs/socket.io-binding\": \"0.2.0\",\n \"@playwright/test\": \"1.59.1\",\n \"@react-router/dev\": \"7.17.0\",\n \"@tailwindcss/typography\": \"0.5.19\",\n \"@tanstack/eslint-plugin-query\": \"5.100.9\",\n \"@testing-library/dom\": \"10.4.1\",\n \"@testing-library/jest-dom\": \"6.9.1\",\n \"@testing-library/react\": \"16.3.2\",\n \"@testing-library/user-event\": \"14.6.1\",\n \"@types/mdast\": \"4.0.4\",\n \"@types/node\": \"25.6.0\",\n \"@types/react\": \"19.2.14\",\n \"@types/react-dom\": \"19.2.3\",\n \"@types/react-syntax-highlighter\": \"15.5.13\",\n \"@typescript-eslint/eslint-plugin\": \"8.59.2\",\n \"@typescript-eslint/parser\": \"8.59.2\",\n \"@vercel/react-router\": \"1.3.0\",\n \"@vitest/coverage-v8\": \"4.1.5\",\n \"cross-env\": \"10.1.0\",\n \"eslint\": \"9.39.4\",\n \"eslint-config-prettier\": \"10.1.8\",\n \"eslint-import-resolver-typescript\": \"4.4.4\",\n \"eslint-plugin-i18next\": \"6.1.4\",\n \"eslint-plugin-import-x\": \"4.16.2\",\n \"eslint-plugin-jsx-a11y\": \"6.10.2\",\n \"eslint-plugin-prettier\": \"5.5.5\",\n \"eslint-plugin-react\": \"7.37.5\",\n \"eslint-plugin-react-hooks\": \"7.1.1\",\n \"eslint-plugin-unused-imports\": \"4.4.1\",\n \"globals\": \"16.5.0\",\n \"husky\": \"9.1.7\",\n \"jsdom\": \"29.1.1\",\n \"lint-staged\": \"16.4.0\",\n \"msw\": \"2.14.2\",\n \"postcss-prefix-selector\": \"2.1.1\",\n \"prettier\": \"3.8.3\",\n \"tailwindcss\": \"4.2.4\",\n \"typescript\": \"6.0.3\",\n \"vite-plugin-svgr\": \"5.2.0\",\n \"vitest\": \"4.1.5\"\n },\n \"packageManager\": \"npm@10.5.0\",\n \"volta\": {\n \"node\": \"22.12.0\"\n },\n \"msw\": {\n \"workerDirectory\": [\n \"public\"\n ]\n },\n \"overrides\": {\n \"@vercel/static-config\": {\n \"ajv\": \"8.20.0\"\n },\n \"dompurify\": \"3.4.7\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"bin\",\n \"build\",\n \"config\",\n \"scripts\",\n \"tools\"\n ],\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./browser\": {\n \"types\": \"./dist/components/browser/index.d.ts\",\n \"import\": \"./dist/components/browser/index.js\",\n \"require\": \"./dist/components/browser/index.cjs\"\n },\n \"./conversation\": {\n \"types\": \"./dist/components/conversation/index.d.ts\",\n \"import\": \"./dist/components/conversation/index.js\",\n \"require\": \"./dist/components/conversation/index.cjs\"\n },\n \"./files\": {\n \"types\": \"./dist/components/files/index.d.ts\",\n \"import\": \"./dist/components/files/index.js\",\n \"require\": \"./dist/components/files/index.cjs\"\n },\n \"./settings\": {\n \"types\": \"./dist/components/settings/index.d.ts\",\n \"import\": \"./dist/components/settings/index.js\",\n \"require\": \"./dist/components/settings/index.cjs\"\n },\n \"./sidebar\": {\n \"types\": \"./dist/components/sidebar/index.d.ts\",\n \"import\": \"./dist/components/sidebar/index.js\",\n \"require\": \"./dist/components/sidebar/index.cjs\"\n },\n \"./terminal\": {\n \"types\": \"./dist/components/terminal/index.d.ts\",\n \"import\": \"./dist/components/terminal/index.js\",\n \"require\": \"./dist/components/terminal/index.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.js\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"peerDependencies\": {\n \"react\": \"19.2.5\",\n \"react-dom\": \"19.2.5\",\n \"react-router\": \"7.17.0\"\n }\n}\n"],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/react-i18next/dist/es/useTranslation.cjs`),t=require(`../i18n/declaration.cjs`),n=require(`../hooks/use-conversation-id.cjs`),r=require(`../utils/conversation-local-storage.cjs`),i=require(`../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs`),a=require(`../stores/files-tab-store.cjs`),o=require(`../icons/link-external.cjs`),s=require(`../components/features/files-tab/segmented-toggle.cjs`),c=require(`../components/features/files-tab/no-file-selected-message.cjs`),l=require(`../hooks/query/use-workspace-files.cjs`),
|
|
1
|
+
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/react-i18next/dist/es/useTranslation.cjs`),t=require(`../i18n/declaration.cjs`),n=require(`../hooks/use-conversation-id.cjs`),r=require(`../utils/conversation-local-storage.cjs`),i=require(`../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs`),a=require(`../stores/files-tab-store.cjs`),o=require(`../icons/link-external.cjs`),s=require(`../components/features/files-tab/segmented-toggle.cjs`),c=require(`../components/features/files-tab/no-file-selected-message.cjs`),l=require(`../hooks/query/use-unified-get-git-changes.cjs`),u=require(`../hooks/query/use-workspace-files.cjs`),d=require(`../stores/use-workspace-mutation-counter.cjs`),f=require(`../hooks/query/use-workspace-file-content.cjs`),p=require(`../hooks/use-has-attached-source.cjs`),m=require(`../hooks/query/use-has-git-commits.cjs`),h=require(`../hooks/use-auto-refresh-files-on-edit.cjs`),g=require(`../utils/file-priority.cjs`),_=require(`../components/features/files-tab/file-quick-row.cjs`),v=require(`../components/features/files-tab/file-tree-view.cjs`),y=require(`../components/features/files-tab/file-content-viewer.cjs`),b=require(`../icons/u-refresh.cjs`),x=require(`./changes-tab.cjs`);let S=require(`react`),C=require(`react/jsx-runtime`);function w(){let{t:w}=e.useTranslation(`openhands`);h.useAutoRefreshFilesOnEdit();let{hasAttachedSource:T,isLoading:E}=p.useHasAttachedSource(),{hasCommits:D}=m.useHasGitCommits({enabled:T}),{conversationId:O}=n.useOptionalConversationId(),{state:k,setFilesTabDiffView:A,setFilesTabContentViewMode:j}=r.useConversationLocalStorageState(O??``),M=(T||E)&&D!==!1,N=k.filesTabDiffView??M,P=k.filesTabContentViewMode,[F,I]=(0,S.useState)(!1),L=u.useWorkspaceFiles(),R=(0,S.useMemo)(()=>L.data??[],[L.data]),z=a.useFilesTabStore(e=>e.selectedPath),B=a.useFilesTabStore(e=>e.selectedConversationId),V=a.useFilesTabStore(e=>e.setSelectedPath),H=B===O?z:null,U=(0,S.useCallback)(e=>V(e,O),[O,V]),W=f.useWorkspaceFileContent(H),G=d.useWorkspaceMutationCounter(e=>e.count),K=d.withWorkspaceCacheBuster(W.data?.staticUrl??null,G);(0,S.useEffect)(()=>{B!==O&&V(null,O)},[B,O,V]),(0,S.useEffect)(()=>{if(H||R.length===0)return;let[e]=g.sortFilesByPriority(R);e&&V(e,O)},[R,H,O,V]);let q=i.useQueryClient(),{refetch:J,isFetching:Y}=l.useUnifiedGetGitChanges();return(0,C.jsxs)(`main`,{className:`h-full w-full flex flex-col items-stretch`,"data-testid":`files-tab`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]`,children:[(0,C.jsx)(s.SegmentedToggle,{ariaLabel:w(t.I18nKey.FILES$DIFF_VIEW),testId:`files-tab-diff-toggle`,value:N?`on`:`off`,options:[{value:`on`,label:w(t.I18nKey.FILES$DIFF_VIEW)},{value:`off`,label:w(t.I18nKey.COMMON$FILES)}],onChange:e=>A(e===`on`)}),!N&&(0,C.jsx)(s.SegmentedToggle,{ariaLabel:w(t.I18nKey.FILES$RICH),testId:`files-tab-content-mode-toggle`,value:P,options:[{value:`rich`,label:w(t.I18nKey.FILES$RICH)},{value:`plain`,label:w(t.I18nKey.FILES$PLAIN)}],onChange:j}),(0,C.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[!N&&K&&(0,C.jsx)(`a`,{href:K,target:`_blank`,rel:`noopener noreferrer`,"aria-label":w(t.I18nKey.FILES$OPEN_IN_NEW_WINDOW),title:w(t.I18nKey.FILES$OPEN_IN_NEW_WINDOW),"data-testid":`files-tab-open-in-new-window`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white`,children:(0,C.jsx)(o.default,{width:14,height:14})}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>{J(),q.invalidateQueries({queryKey:[`workspace-files`]}),q.invalidateQueries({queryKey:[`workspace-file-content`]})},disabled:Y,"aria-label":w(t.I18nKey.FILES$REFRESH),title:w(t.I18nKey.FILES$REFRESH),"data-testid":`files-tab-refresh`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,C.jsx)(b.default,{width:12.75,height:15,color:`#ffffff`,className:Y?`animate-spin`:``})})]})]}),N?(0,C.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,C.jsx)(x.default,{})}):(0,C.jsx)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:L.isLoading?(0,C.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]`,children:w(t.I18nKey.FILES$LOADING_FILES)}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(_.FileQuickRow,{paths:R,selectedPath:H,onSelectFile:U,isTreeVisible:F,onToggleTree:()=>I(e=>!e)}),(0,C.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1`,children:[F&&(0,C.jsx)(`aside`,{className:`w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always`,"data-testid":`files-tab-tree`,children:(0,C.jsx)(v.FileTreeView,{paths:R,selectedPath:H,onSelectFile:U})}),(0,C.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,"data-testid":`files-tab-content`,children:H?(0,C.jsx)(y.FileContentViewer,{path:H,viewMode:P}):(0,C.jsx)(c.NoFileSelectedMessage,{})})]})]})})]})}exports.default=w;
|
|
2
2
|
//# sourceMappingURL=files-tab.cjs.map
|
package/dist/routes/files-tab.js
CHANGED
|
@@ -7,13 +7,13 @@ import { useFilesTabStore as a } from "../stores/files-tab-store.js";
|
|
|
7
7
|
import o from "../icons/link-external.js";
|
|
8
8
|
import { SegmentedToggle as s } from "../components/features/files-tab/segmented-toggle.js";
|
|
9
9
|
import { NoFileSelectedMessage as c } from "../components/features/files-tab/no-file-selected-message.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
10
|
+
import { useUnifiedGetGitChanges as l } from "../hooks/query/use-unified-get-git-changes.js";
|
|
11
|
+
import { useWorkspaceFiles as u } from "../hooks/query/use-workspace-files.js";
|
|
12
|
+
import { useWorkspaceMutationCounter as d, withWorkspaceCacheBuster as f } from "../stores/use-workspace-mutation-counter.js";
|
|
13
|
+
import { useWorkspaceFileContent as p } from "../hooks/query/use-workspace-file-content.js";
|
|
14
|
+
import { useHasAttachedSource as m } from "../hooks/use-has-attached-source.js";
|
|
15
|
+
import { useHasGitCommits as h } from "../hooks/query/use-has-git-commits.js";
|
|
16
|
+
import { useAutoRefreshFilesOnEdit as g } from "../hooks/use-auto-refresh-files-on-edit.js";
|
|
17
17
|
import { sortFilesByPriority as _ } from "../utils/file-priority.js";
|
|
18
18
|
import { FileQuickRow as v } from "../components/features/files-tab/file-quick-row.js";
|
|
19
19
|
import { FileTreeView as y } from "../components/features/files-tab/file-tree-view.js";
|
|
@@ -25,8 +25,8 @@ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
|
25
25
|
//#region src/routes/files-tab.tsx
|
|
26
26
|
function k() {
|
|
27
27
|
let { t: k } = e("openhands");
|
|
28
|
-
|
|
29
|
-
let { hasAttachedSource: A, isLoading: j } =
|
|
28
|
+
g();
|
|
29
|
+
let { hasAttachedSource: A, isLoading: j } = m(), { hasCommits: M } = h({ enabled: A }), { conversationId: N } = n(), { state: P, setFilesTabDiffView: F, setFilesTabContentViewMode: I } = r(N ?? ""), L = (A || j) && M !== !1, R = P.filesTabDiffView ?? L, z = P.filesTabContentViewMode, [B, V] = T(!1), H = u(), U = w(() => H.data ?? [], [H.data]), W = a((e) => e.selectedPath), G = a((e) => e.selectedConversationId), K = a((e) => e.setSelectedPath), q = G === N ? W : null, J = ee((e) => K(e, N), [N, K]), Y = p(q), X = d((e) => e.count), Z = f(Y.data?.staticUrl ?? null, X);
|
|
30
30
|
C(() => {
|
|
31
31
|
G !== N && K(null, N);
|
|
32
32
|
}, [
|
|
@@ -43,7 +43,7 @@ function k() {
|
|
|
43
43
|
N,
|
|
44
44
|
K
|
|
45
45
|
]);
|
|
46
|
-
let Q = i(), { refetch: te, isFetching: $ } =
|
|
46
|
+
let Q = i(), { refetch: te, isFetching: $ } = l();
|
|
47
47
|
return /* @__PURE__ */ O("main", {
|
|
48
48
|
className: "h-full w-full flex flex-col items-stretch",
|
|
49
49
|
"data-testid": "files-tab",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../styles/agent-server-ui-style-scope.cjs`);var t={50:`0 0% 96.86%`,100:`0 0% 92.55%`,200:`0 0% 86.27%`,300:`0 0% 74.51%`,400:`0 0% 59.22%`,500:`0 0% 45.1%`,600:`0 0% 33.73%`,700:`0 0% 25.1%`,800:`0 0% 19.22%`,850:`0 0% 15.69%`,900:`0 0% 12.55%`,950:`0 0% 9.41%`,975:`0 0% 6.27%`},n={"--cool-grey-50":`#F7F7F7`,"--cool-grey-100":`#ECECEC`,"--cool-grey-200":`#DCDCDC`,"--cool-grey-300":`#BEBEBE`,"--cool-grey-400":`#979797`,"--cool-grey-500":`#737373`,"--cool-grey-600":`#565656`,"--cool-grey-700":`#404040`,"--cool-grey-800":`#313131`,"--cool-grey-900":`#282828`,"--cool-grey-925":`#202020`,"--cool-grey-950":`#181818`,"--cool-grey-975":`#101010`},r={"--heroui-background":t[950],"--heroui-background-foreground":t[50],"--heroui-foreground-50":t[975],"--heroui-foreground-100":t[950],"--heroui-foreground-200":t[900],"--heroui-foreground-300":t[850],"--heroui-foreground-400":t[800],"--heroui-foreground-500":t[700],"--heroui-foreground-600":t[600],"--heroui-foreground-700":t[500],"--heroui-foreground-800":t[400],"--heroui-foreground-900":t[300],"--heroui-foreground":t[300],"--heroui-content1":t[900],"--heroui-content1-foreground":t[100],"--heroui-content2":t[850],"--heroui-content2-foreground":t[200],"--heroui-content3":t[800],"--heroui-content3-foreground":t[300],"--heroui-content4":t[700],"--heroui-content4-foreground":t[400],"--heroui-default-50":t[975],"--heroui-default-100":t[950],"--heroui-default-200":t[900],"--heroui-default-300":t[850],"--heroui-default-400":t[800],"--heroui-default-500":t[700],"--heroui-default-600":t[600],"--heroui-default-700":t[500],"--heroui-default-800":t[400],"--heroui-default-900":t[300],"--heroui-default-foreground":t[50],"--heroui-default":t[800]},i=e.AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES,a={"openhands-deepsea":{label:`OpenHands-DeepSea`,scale:{"--cool-grey-50":`#F7F9FC`,"--cool-grey-100":`#EEF2F7`,"--cool-grey-200":`#DCE3EE`,"--cool-grey-300":`#C3CDDC`,"--cool-grey-400":`#A3B0C4`,"--cool-grey-500":`#7E8A9E`,"--cool-grey-600":`#626D82`,"--cool-grey-700":`#4B5468`,"--cool-grey-800":`#383F50`,"--cool-grey-900":`#2C313F`,"--cool-grey-925":`#21252F`,"--cool-grey-950":`#0B0E14`,"--cool-grey-975":`#05070A`},heroui:{"--heroui-background":`220 29.03% 6.08%`,"--heroui-background-foreground":`216 45.45% 97.84%`,"--heroui-foreground-50":`216 33.33% 2.94%`,"--heroui-foreground-100":`220 29.03% 6.08%`,"--heroui-foreground-200":`222.86 17.5% 15.69%`,"--heroui-foreground-300":`224.21 17.76% 20.98%`,"--heroui-foreground-400":`222.5 17.65% 26.67%`,"--heroui-foreground-500":`221.38 16.2% 35.1%`,"--heroui-foreground-600":`219.38 14.04% 44.71%`,"--heroui-foreground-700":`217.5 14.16% 55.69%`,"--heroui-foreground-800":`216.36 21.85% 70.39%`,"--heroui-foreground-900":`216 26.32% 81.37%`,"--heroui-foreground":`216 26.32% 81.37%`,"--heroui-content1":`222.86 17.5% 15.69%`,"--heroui-content1-foreground":`213.33 36% 95.1%`,"--heroui-content2":`224.21 17.76% 20.98%`,"--heroui-content2-foreground":`216.67 34.62% 89.8%`,"--heroui-content3":`222.5 17.65% 26.67%`,"--heroui-content3-foreground":`216 26.32% 81.37%`,"--heroui-content4":`221.38 16.2% 35.1%`,"--heroui-content4-foreground":`216.36 21.85% 70.39%`,"--heroui-default-50":`216 33.33% 2.94%`,"--heroui-default-100":`220 29.03% 6.08%`,"--heroui-default-200":`222.86 17.5% 15.69%`,"--heroui-default-300":`224.21 17.76% 20.98%`,"--heroui-default-400":`222.5 17.65% 26.67%`,"--heroui-default-500":`221.38 16.2% 35.1%`,"--heroui-default-600":`219.38 14.04% 44.71%`,"--heroui-default-700":`217.5 14.16% 55.69%`,"--heroui-default-800":`216.36 21.85% 70.39%`,"--heroui-default-900":`216 26.32% 81.37%`,"--heroui-default-foreground":`216 45.45% 97.84%`,"--heroui-default":`222.5 17.65% 26.67%`}},"openhands-neutral":{label:`OpenHands-Neutral`,scale:n,heroui:r},"openhands-neo":{label:`OpenHands-Neo`,scale:n,heroui:r,tokens:{"--oh-color-primary":`#ffffff`,"--oh-accent":`#ffffff`,"--oh-warning":`#ffffff`}}},o=`openhands-neutral`,s=Object.entries(a).map(([e,t])=>({key:e,label:t.label})),c=`openhands-color-theme`;function l(){if(typeof window>`u`)return o;try{let e=window.localStorage.getItem(c);if(e&&e in a)return e}catch{}return o}function u(e){try{window.localStorage.setItem(c,e)}catch{}}var d=`oh-color-theme-override`;function f(e){if(typeof document>`u`)return;let{scale:t,heroui:n,tokens:r={}}=a[e],i=Object.entries(t).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
2
2
|
`),o=Object.entries(n).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
3
|
-
`),s=[`[data-agent-server-ui] {\n${i}\n${o}\n${Object.entries(r).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
4
|
-
`)}\n}`,`[data-theme=dark] {\n${o}\n}`].join(`
|
|
5
|
-
`),c=document.getElementById(d);c||(c=document.createElement(`style`),c.id=d,document.head.appendChild(c)
|
|
3
|
+
`),s=[`[data-agent-server-ui][data-agent-server-ui] {\n${i}\n${o}\n${Object.entries(r).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
4
|
+
`)}\n}`,`[data-theme=dark][data-theme=dark] {\n${o}\n}`].join(`
|
|
5
|
+
`),c=document.getElementById(d);c||(c=document.createElement(`style`),c.id=d),c.textContent=s,document.head.appendChild(c),p(r)}function p(e){let t=document.querySelectorAll(`[data-agent-server-ui]`);for(let n of t)if(n instanceof HTMLElement)for(let t of i){let r=e[t];r?n.style.setProperty(t,r):n.style.removeProperty(t)}}exports.AVAILABLE_COLOR_THEMES=s,exports.applyColorTheme=f,exports.persistColorTheme=u,exports.readPersistedColorTheme=l;
|
|
6
6
|
//# sourceMappingURL=color-themes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-themes.cjs","names":[],"sources":["../../src/themes/color-themes.ts"],"sourcesContent":["export type ColorThemeKey =\n | \"openhands-deepsea\"\n | \"openhands-neutral\"\n | \"openhands-neo\";\n\nexport interface ColorThemeDefinition {\n label: string;\n /** Overrides for --cool-grey-* CSS custom properties (our semantic scale) */\n scale: Record<string, string>;\n /**\n * Overrides for --heroui-* CSS custom properties.\n * HeroUI stores colors as space-separated HSL channels (\"H S% L%\") so Tailwind\n * utilities like bg-default-200 resolve to hsl(var(--heroui-default-200)).\n * These vars are set by the heroui() plugin on :root, [data-theme=dark] at\n * build time, so they must be overridden at the same or lower specificity\n * from a later stylesheet to pick up theme changes at runtime.\n */\n heroui: Record<string, string>;\n /** Overrides for --oh-* semantic tokens such as brand / button colors. */\n tokens?: Record<string, string>;\n}\n\n// HSL channel strings for the neutral grey palette (H=0, S=0%, L=hex/255*100)\n// prettier-ignore\nconst NEUTRAL_HSL = {\n 50: \"0 0% 96.86%\", // #F7F7F7\n 100: \"0 0% 92.55%\", // #ECECEC\n 200: \"0 0% 86.27%\", // #DCDCDC\n 300: \"0 0% 74.51%\", // #BEBEBE\n 400: \"0 0% 59.22%\", // #979797\n 500: \"0 0% 45.1%\", // #737373\n 600: \"0 0% 33.73%\", // #565656\n 700: \"0 0% 25.1%\", // #404040\n 800: \"0 0% 19.22%\", // #313131\n 850: \"0 0% 15.69%\", // #282828\n 900: \"0 0% 12.55%\", // #202020\n 950: \"0 0% 9.41%\", // #181818\n 975: \"0 0% 6.27%\", // #101010\n};\n\nconst NEUTRAL_SCALE = {\n \"--cool-grey-50\": \"#F7F7F7\",\n \"--cool-grey-100\": \"#ECECEC\",\n \"--cool-grey-200\": \"#DCDCDC\",\n \"--cool-grey-300\": \"#BEBEBE\",\n \"--cool-grey-400\": \"#979797\",\n \"--cool-grey-500\": \"#737373\",\n \"--cool-grey-600\": \"#565656\",\n \"--cool-grey-700\": \"#404040\",\n \"--cool-grey-800\": \"#313131\",\n \"--cool-grey-900\": \"#282828\",\n \"--cool-grey-925\": \"#202020\",\n \"--cool-grey-950\": \"#181818\",\n \"--cool-grey-975\": \"#101010\",\n};\n\nconst NEUTRAL_HEROUI = {\n \"--heroui-background\": NEUTRAL_HSL[950],\n \"--heroui-background-foreground\": NEUTRAL_HSL[50],\n \"--heroui-foreground-50\": NEUTRAL_HSL[975],\n \"--heroui-foreground-100\": NEUTRAL_HSL[950],\n \"--heroui-foreground-200\": NEUTRAL_HSL[900],\n \"--heroui-foreground-300\": NEUTRAL_HSL[850],\n \"--heroui-foreground-400\": NEUTRAL_HSL[800],\n \"--heroui-foreground-500\": NEUTRAL_HSL[700],\n \"--heroui-foreground-600\": NEUTRAL_HSL[600],\n \"--heroui-foreground-700\": NEUTRAL_HSL[500],\n \"--heroui-foreground-800\": NEUTRAL_HSL[400],\n \"--heroui-foreground-900\": NEUTRAL_HSL[300],\n \"--heroui-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content1\": NEUTRAL_HSL[900],\n \"--heroui-content1-foreground\": NEUTRAL_HSL[100],\n \"--heroui-content2\": NEUTRAL_HSL[850],\n \"--heroui-content2-foreground\": NEUTRAL_HSL[200],\n \"--heroui-content3\": NEUTRAL_HSL[800],\n \"--heroui-content3-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content4\": NEUTRAL_HSL[700],\n \"--heroui-content4-foreground\": NEUTRAL_HSL[400],\n \"--heroui-default-50\": NEUTRAL_HSL[975],\n \"--heroui-default-100\": NEUTRAL_HSL[950],\n \"--heroui-default-200\": NEUTRAL_HSL[900],\n \"--heroui-default-300\": NEUTRAL_HSL[850],\n \"--heroui-default-400\": NEUTRAL_HSL[800],\n \"--heroui-default-500\": NEUTRAL_HSL[700],\n \"--heroui-default-600\": NEUTRAL_HSL[600],\n \"--heroui-default-700\": NEUTRAL_HSL[500],\n \"--heroui-default-800\": NEUTRAL_HSL[400],\n \"--heroui-default-900\": NEUTRAL_HSL[300],\n \"--heroui-default-foreground\": NEUTRAL_HSL[50],\n \"--heroui-default\": NEUTRAL_HSL[800],\n};\n\nimport { AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES } from \"#/styles/agent-server-ui-style-scope\";\n\n/** CSS custom properties overridden by color themes (see applyColorTheme). */\nexport const COLOR_THEME_TOKEN_KEYS = AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES;\n\n/** White primary/accent tokens — used by OpenHands-Neo for button surfaces. */\nconst NEO_WHITE_BUTTON_TOKENS: Record<\n (typeof COLOR_THEME_TOKEN_KEYS)[number],\n string\n> = {\n \"--oh-color-primary\": \"#ffffff\",\n \"--oh-accent\": \"#ffffff\",\n \"--oh-warning\": \"#ffffff\",\n};\n\nexport const COLOR_THEMES: Record<ColorThemeKey, ColorThemeDefinition> = {\n \"openhands-deepsea\": {\n label: \"OpenHands-DeepSea\",\n // Matches the values already set by index.css; included so switching back\n // from another theme restores the original palette explicitly.\n scale: {\n \"--cool-grey-50\": \"#F7F9FC\",\n \"--cool-grey-100\": \"#EEF2F7\",\n \"--cool-grey-200\": \"#DCE3EE\",\n \"--cool-grey-300\": \"#C3CDDC\",\n \"--cool-grey-400\": \"#A3B0C4\",\n \"--cool-grey-500\": \"#7E8A9E\",\n \"--cool-grey-600\": \"#626D82\",\n \"--cool-grey-700\": \"#4B5468\",\n \"--cool-grey-800\": \"#383F50\",\n \"--cool-grey-900\": \"#2C313F\",\n \"--cool-grey-925\": \"#21252F\",\n \"--cool-grey-950\": \"#0B0E14\",\n \"--cool-grey-975\": \"#05070A\",\n },\n // Values generated by heroui() from hero.ts — restore them explicitly when\n // switching back from another theme.\n heroui: {\n \"--heroui-background\": \"220 29.03% 6.08%\",\n \"--heroui-background-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-foreground-50\": \"216 33.33% 2.94%\",\n \"--heroui-foreground-100\": \"220 29.03% 6.08%\",\n \"--heroui-foreground-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-foreground-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-foreground-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-foreground-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-foreground-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-foreground-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-foreground-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-foreground-900\": \"216 26.32% 81.37%\",\n \"--heroui-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content1\": \"222.86 17.5% 15.69%\",\n \"--heroui-content1-foreground\": \"213.33 36% 95.1%\",\n \"--heroui-content2\": \"224.21 17.76% 20.98%\",\n \"--heroui-content2-foreground\": \"216.67 34.62% 89.8%\",\n \"--heroui-content3\": \"222.5 17.65% 26.67%\",\n \"--heroui-content3-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content4\": \"221.38 16.2% 35.1%\",\n \"--heroui-content4-foreground\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-50\": \"216 33.33% 2.94%\",\n \"--heroui-default-100\": \"220 29.03% 6.08%\",\n \"--heroui-default-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-default-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-default-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-default-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-default-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-default-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-default-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-900\": \"216 26.32% 81.37%\",\n \"--heroui-default-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-default\": \"222.5 17.65% 26.67%\",\n },\n },\n\n \"openhands-neutral\": {\n label: \"OpenHands-Neutral\",\n scale: NEUTRAL_SCALE,\n // Each stop follows the same positional mapping as hero.ts:\n // heroui-default-100 ← cool-grey-950 position ← neutral-950 (#181818)\n // heroui-default-200 ← cool-grey-925 position ← neutral-900 (#202020)\n // ...etc.\n heroui: NEUTRAL_HEROUI,\n },\n\n \"openhands-neo\": {\n label: \"OpenHands-Neo\",\n scale: NEUTRAL_SCALE,\n heroui: NEUTRAL_HEROUI,\n tokens: NEO_WHITE_BUTTON_TOKENS,\n },\n};\n\nexport const DEFAULT_COLOR_THEME: ColorThemeKey = \"openhands-neutral\";\n\nexport const AVAILABLE_COLOR_THEMES = Object.entries(COLOR_THEMES).map(\n ([key, def]) => ({ key: key as ColorThemeKey, label: def.label }),\n);\n\nconst STORAGE_KEY = \"openhands-color-theme\";\n\n/** Read the persisted theme key from localStorage, falling back to the default. */\nexport function readPersistedColorTheme(): ColorThemeKey {\n if (typeof window === \"undefined\") return DEFAULT_COLOR_THEME;\n try {\n const stored = window.localStorage.getItem(STORAGE_KEY);\n if (stored && stored in COLOR_THEMES) return stored as ColorThemeKey;\n } catch {\n // ignore quota / privacy-mode failures\n }\n return DEFAULT_COLOR_THEME;\n}\n\n/** Persist the theme key to localStorage. */\nexport function persistColorTheme(key: ColorThemeKey): void {\n try {\n window.localStorage.setItem(STORAGE_KEY, key);\n } catch {\n // ignore\n }\n}\n\nconst THEME_STYLE_TAG_ID = \"oh-color-theme-override\";\n\n/**\n * Apply a theme by injecting (or replacing) a <style> tag that overrides\n * both our custom --cool-grey-* primitives and HeroUI's --heroui-* tokens.\n *\n * Why a <style> tag:\n * PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*\n * is set on EVERY element carrying that attribute. A body inline-style only\n * overrides body itself — inner matching elements keep the stylesheet value.\n * Injecting a stylesheet appended to <head> wins on equal specificity because\n * later sheets take precedence in the cascade.\n *\n * Why heroui variables:\n * HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].\n * They reference their own token system and are unaffected by --cool-grey-*\n * changes, so we override them from the same injected sheet.\n */\nexport function applyColorTheme(key: ColorThemeKey): void {\n if (typeof document === \"undefined\") return;\n const { scale, heroui, tokens = {} } = COLOR_THEMES[key];\n\n const scaleDecls = Object.entries(scale)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const herouiDecls = Object.entries(heroui)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const tokenDecls = Object.entries(tokens)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n // Target both selectors for heroui vars:\n // [data-agent-server-ui] — covers document.body (portal destination) so\n // portalled popover/listbox content inherits the overridden values.\n // [data-theme=dark] — covers the inner AgentServerUIRoot wrapper so\n // components scoped inside the dark theme wrapper also pick them up.\n const css = [\n `[data-agent-server-ui] {\\n${scaleDecls}\\n${herouiDecls}\\n${tokenDecls}\\n}`,\n `[data-theme=dark] {\\n${herouiDecls}\\n}`,\n ].join(\"\\n\");\n\n let styleEl = document.getElementById(\n THEME_STYLE_TAG_ID,\n ) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = document.createElement(\"style\");\n styleEl.id = THEME_STYLE_TAG_ID;\n document.head.appendChild(styleEl);\n }\n styleEl.textContent = css;\n\n syncColorThemeTokensOnScopeRoots(tokens);\n}\n\nfunction syncColorThemeTokensOnScopeRoots(\n tokens: Record<string, string>,\n): void {\n const roots = document.querySelectorAll(\"[data-agent-server-ui]\");\n for (const root of roots) {\n if (!(root instanceof HTMLElement)) continue;\n\n for (const key of COLOR_THEME_TOKEN_KEYS) {\n const value = tokens[key];\n if (value) {\n root.style.setProperty(key, value);\n } else {\n root.style.removeProperty(key);\n }\n }\n }\n}\n"],"mappings":"0GAwBA,IAAM,EAAc,CAClB,GAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,aACL,IAAK,cACL,IAAK,aACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,aACL,IAAK,aACN,CAEK,EAAgB,CACpB,iBAAkB,UAClB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACpB,CAEK,EAAiB,CACrB,sBAAuB,EAAY,KACnC,iCAAkC,EAAY,IAC9C,yBAA0B,EAAY,KACtC,0BAA2B,EAAY,KACvC,0BA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AQsD,CAAW,KACvE,wBAAwB,EAAY,KACrC,CAAC,KAAK;EAAK,CAER,EAAU,SAAS,eACrB,EACD,CACI,IACH,EAAU,SAAS,cAAc,QAAQ,CACzC,EAAQ,GAAK,EACb,SAAS,KAAK,YAAY,EAAQ,EAEpC,EAAQ,YAAc,EAEtB,EAAiC,EAAO,CAG1C,SAAS,EACP,EACM,CACN,IAAM,EAAQ,SAAS,iBAAiB,yBAAyB,CACjE,IAAK,IAAM,KAAQ,EACX,gBAAgB,YAEtB,IAAK,IAAM,KAAO,EAAwB,CACxC,IAAM,EAAQ,EAAO,GACjB,EACF,EAAK,MAAM,YAAY,EAAK,EAAM,CAElC,EAAK,MAAM,eAAe,EAAI"}
|
|
1
|
+
{"version":3,"file":"color-themes.cjs","names":[],"sources":["../../src/themes/color-themes.ts"],"sourcesContent":["export type ColorThemeKey =\n | \"openhands-deepsea\"\n | \"openhands-neutral\"\n | \"openhands-neo\";\n\nexport interface ColorThemeDefinition {\n label: string;\n /** Overrides for --cool-grey-* CSS custom properties (our semantic scale) */\n scale: Record<string, string>;\n /**\n * Overrides for --heroui-* CSS custom properties.\n * HeroUI stores colors as space-separated HSL channels (\"H S% L%\") so Tailwind\n * utilities like bg-default-200 resolve to hsl(var(--heroui-default-200)).\n * These vars are set by the heroui() plugin on :root, [data-theme=dark] at\n * build time, so they must be overridden at the same or lower specificity\n * from a later stylesheet to pick up theme changes at runtime.\n */\n heroui: Record<string, string>;\n /** Overrides for --oh-* semantic tokens such as brand / button colors. */\n tokens?: Record<string, string>;\n}\n\n// HSL channel strings for the neutral grey palette (H=0, S=0%, L=hex/255*100)\n// prettier-ignore\nconst NEUTRAL_HSL = {\n 50: \"0 0% 96.86%\", // #F7F7F7\n 100: \"0 0% 92.55%\", // #ECECEC\n 200: \"0 0% 86.27%\", // #DCDCDC\n 300: \"0 0% 74.51%\", // #BEBEBE\n 400: \"0 0% 59.22%\", // #979797\n 500: \"0 0% 45.1%\", // #737373\n 600: \"0 0% 33.73%\", // #565656\n 700: \"0 0% 25.1%\", // #404040\n 800: \"0 0% 19.22%\", // #313131\n 850: \"0 0% 15.69%\", // #282828\n 900: \"0 0% 12.55%\", // #202020\n 950: \"0 0% 9.41%\", // #181818\n 975: \"0 0% 6.27%\", // #101010\n};\n\nconst NEUTRAL_SCALE = {\n \"--cool-grey-50\": \"#F7F7F7\",\n \"--cool-grey-100\": \"#ECECEC\",\n \"--cool-grey-200\": \"#DCDCDC\",\n \"--cool-grey-300\": \"#BEBEBE\",\n \"--cool-grey-400\": \"#979797\",\n \"--cool-grey-500\": \"#737373\",\n \"--cool-grey-600\": \"#565656\",\n \"--cool-grey-700\": \"#404040\",\n \"--cool-grey-800\": \"#313131\",\n \"--cool-grey-900\": \"#282828\",\n \"--cool-grey-925\": \"#202020\",\n \"--cool-grey-950\": \"#181818\",\n \"--cool-grey-975\": \"#101010\",\n};\n\nconst NEUTRAL_HEROUI = {\n \"--heroui-background\": NEUTRAL_HSL[950],\n \"--heroui-background-foreground\": NEUTRAL_HSL[50],\n \"--heroui-foreground-50\": NEUTRAL_HSL[975],\n \"--heroui-foreground-100\": NEUTRAL_HSL[950],\n \"--heroui-foreground-200\": NEUTRAL_HSL[900],\n \"--heroui-foreground-300\": NEUTRAL_HSL[850],\n \"--heroui-foreground-400\": NEUTRAL_HSL[800],\n \"--heroui-foreground-500\": NEUTRAL_HSL[700],\n \"--heroui-foreground-600\": NEUTRAL_HSL[600],\n \"--heroui-foreground-700\": NEUTRAL_HSL[500],\n \"--heroui-foreground-800\": NEUTRAL_HSL[400],\n \"--heroui-foreground-900\": NEUTRAL_HSL[300],\n \"--heroui-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content1\": NEUTRAL_HSL[900],\n \"--heroui-content1-foreground\": NEUTRAL_HSL[100],\n \"--heroui-content2\": NEUTRAL_HSL[850],\n \"--heroui-content2-foreground\": NEUTRAL_HSL[200],\n \"--heroui-content3\": NEUTRAL_HSL[800],\n \"--heroui-content3-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content4\": NEUTRAL_HSL[700],\n \"--heroui-content4-foreground\": NEUTRAL_HSL[400],\n \"--heroui-default-50\": NEUTRAL_HSL[975],\n \"--heroui-default-100\": NEUTRAL_HSL[950],\n \"--heroui-default-200\": NEUTRAL_HSL[900],\n \"--heroui-default-300\": NEUTRAL_HSL[850],\n \"--heroui-default-400\": NEUTRAL_HSL[800],\n \"--heroui-default-500\": NEUTRAL_HSL[700],\n \"--heroui-default-600\": NEUTRAL_HSL[600],\n \"--heroui-default-700\": NEUTRAL_HSL[500],\n \"--heroui-default-800\": NEUTRAL_HSL[400],\n \"--heroui-default-900\": NEUTRAL_HSL[300],\n \"--heroui-default-foreground\": NEUTRAL_HSL[50],\n \"--heroui-default\": NEUTRAL_HSL[800],\n};\n\nimport { AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES } from \"#/styles/agent-server-ui-style-scope\";\n\n/** CSS custom properties overridden by color themes (see applyColorTheme). */\nexport const COLOR_THEME_TOKEN_KEYS = AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES;\n\n/** White primary/accent tokens — used by OpenHands-Neo for button surfaces. */\nconst NEO_WHITE_BUTTON_TOKENS: Record<\n (typeof COLOR_THEME_TOKEN_KEYS)[number],\n string\n> = {\n \"--oh-color-primary\": \"#ffffff\",\n \"--oh-accent\": \"#ffffff\",\n \"--oh-warning\": \"#ffffff\",\n};\n\nexport const COLOR_THEMES: Record<ColorThemeKey, ColorThemeDefinition> = {\n \"openhands-deepsea\": {\n label: \"OpenHands-DeepSea\",\n // Matches the values already set by index.css; included so switching back\n // from another theme restores the original palette explicitly.\n scale: {\n \"--cool-grey-50\": \"#F7F9FC\",\n \"--cool-grey-100\": \"#EEF2F7\",\n \"--cool-grey-200\": \"#DCE3EE\",\n \"--cool-grey-300\": \"#C3CDDC\",\n \"--cool-grey-400\": \"#A3B0C4\",\n \"--cool-grey-500\": \"#7E8A9E\",\n \"--cool-grey-600\": \"#626D82\",\n \"--cool-grey-700\": \"#4B5468\",\n \"--cool-grey-800\": \"#383F50\",\n \"--cool-grey-900\": \"#2C313F\",\n \"--cool-grey-925\": \"#21252F\",\n \"--cool-grey-950\": \"#0B0E14\",\n \"--cool-grey-975\": \"#05070A\",\n },\n // Values generated by heroui() from hero.ts — restore them explicitly when\n // switching back from another theme.\n heroui: {\n \"--heroui-background\": \"220 29.03% 6.08%\",\n \"--heroui-background-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-foreground-50\": \"216 33.33% 2.94%\",\n \"--heroui-foreground-100\": \"220 29.03% 6.08%\",\n \"--heroui-foreground-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-foreground-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-foreground-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-foreground-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-foreground-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-foreground-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-foreground-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-foreground-900\": \"216 26.32% 81.37%\",\n \"--heroui-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content1\": \"222.86 17.5% 15.69%\",\n \"--heroui-content1-foreground\": \"213.33 36% 95.1%\",\n \"--heroui-content2\": \"224.21 17.76% 20.98%\",\n \"--heroui-content2-foreground\": \"216.67 34.62% 89.8%\",\n \"--heroui-content3\": \"222.5 17.65% 26.67%\",\n \"--heroui-content3-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content4\": \"221.38 16.2% 35.1%\",\n \"--heroui-content4-foreground\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-50\": \"216 33.33% 2.94%\",\n \"--heroui-default-100\": \"220 29.03% 6.08%\",\n \"--heroui-default-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-default-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-default-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-default-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-default-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-default-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-default-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-900\": \"216 26.32% 81.37%\",\n \"--heroui-default-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-default\": \"222.5 17.65% 26.67%\",\n },\n },\n\n \"openhands-neutral\": {\n label: \"OpenHands-Neutral\",\n scale: NEUTRAL_SCALE,\n // Each stop follows the same positional mapping as hero.ts:\n // heroui-default-100 ← cool-grey-950 position ← neutral-950 (#181818)\n // heroui-default-200 ← cool-grey-925 position ← neutral-900 (#202020)\n // ...etc.\n heroui: NEUTRAL_HEROUI,\n },\n\n \"openhands-neo\": {\n label: \"OpenHands-Neo\",\n scale: NEUTRAL_SCALE,\n heroui: NEUTRAL_HEROUI,\n tokens: NEO_WHITE_BUTTON_TOKENS,\n },\n};\n\nexport const DEFAULT_COLOR_THEME: ColorThemeKey = \"openhands-neutral\";\n\nexport const AVAILABLE_COLOR_THEMES = Object.entries(COLOR_THEMES).map(\n ([key, def]) => ({ key: key as ColorThemeKey, label: def.label }),\n);\n\nconst STORAGE_KEY = \"openhands-color-theme\";\n\n/** Read the persisted theme key from localStorage, falling back to the default. */\nexport function readPersistedColorTheme(): ColorThemeKey {\n if (typeof window === \"undefined\") return DEFAULT_COLOR_THEME;\n try {\n const stored = window.localStorage.getItem(STORAGE_KEY);\n if (stored && stored in COLOR_THEMES) return stored as ColorThemeKey;\n } catch {\n // ignore quota / privacy-mode failures\n }\n return DEFAULT_COLOR_THEME;\n}\n\n/** Persist the theme key to localStorage. */\nexport function persistColorTheme(key: ColorThemeKey): void {\n try {\n window.localStorage.setItem(STORAGE_KEY, key);\n } catch {\n // ignore\n }\n}\n\nconst THEME_STYLE_TAG_ID = \"oh-color-theme-override\";\n\n/**\n * Apply a theme by injecting (or replacing) a <style> tag that overrides\n * both our custom --cool-grey-* primitives and HeroUI's --heroui-* tokens.\n *\n * Why a <style> tag:\n * PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*\n * is set on EVERY element carrying that attribute. A body inline-style only\n * overrides body itself — inner matching elements keep the stylesheet value.\n *\n * Why heroui variables:\n * HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].\n * They reference their own token system and are unaffected by --cool-grey-*\n * changes, so we override them from the same injected sheet.\n *\n * Why doubled selectors + re-append on every call:\n * \"Later sheet wins the tie\" cannot be relied on: in the built SPA\n * (ssr:false, prerendered shell) React 19 re-creates the <head> elements it\n * manages (<Meta/>/<Links/>) whenever the tree above the router remounts —\n * e.g. PostHogWrapper swapping in <PostHogProvider> once the analytics key\n * resolves, which only happens in builds with VITE_POSTHOG_CLIENT_KEY baked\n * (the published npm package / tagged Docker images). That re-inserts the\n * base stylesheet <link> AFTER this tag, which would let the base sheet's\n * unlayered [data-agent-server-ui] variable rules (0,1,0) win every tie.\n * Doubling the attribute selectors ([x][x], 0,2,0) beats them from any\n * position in <head>; re-appending on each apply keeps document order\n * favorable as well.\n */\nexport function applyColorTheme(key: ColorThemeKey): void {\n if (typeof document === \"undefined\") return;\n const { scale, heroui, tokens = {} } = COLOR_THEMES[key];\n\n const scaleDecls = Object.entries(scale)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const herouiDecls = Object.entries(heroui)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const tokenDecls = Object.entries(tokens)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n // Target both selectors for heroui vars:\n // [data-agent-server-ui] — covers document.body (portal destination) so\n // portalled popover/listbox content inherits the overridden values.\n // [data-theme=dark] — covers the inner AgentServerUIRoot wrapper so\n // components scoped inside the dark theme wrapper also pick them up.\n // Both are doubled to out-specify the base sheet regardless of stylesheet\n // order (see the doc comment above).\n const css = [\n `[data-agent-server-ui][data-agent-server-ui] {\\n${scaleDecls}\\n${herouiDecls}\\n${tokenDecls}\\n}`,\n `[data-theme=dark][data-theme=dark] {\\n${herouiDecls}\\n}`,\n ].join(\"\\n\");\n\n let styleEl = document.getElementById(\n THEME_STYLE_TAG_ID,\n ) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = document.createElement(\"style\");\n styleEl.id = THEME_STYLE_TAG_ID;\n }\n styleEl.textContent = css;\n // Re-append even when the tag already exists (appendChild relocates a\n // connected node) so the override also stays after any re-inserted <link>.\n document.head.appendChild(styleEl);\n\n syncColorThemeTokensOnScopeRoots(tokens);\n}\n\nfunction syncColorThemeTokensOnScopeRoots(\n tokens: Record<string, string>,\n): void {\n const roots = document.querySelectorAll(\"[data-agent-server-ui]\");\n for (const root of roots) {\n if (!(root instanceof HTMLElement)) continue;\n\n for (const key of COLOR_THEME_TOKEN_KEYS) {\n const value = tokens[key];\n if (value) {\n root.style.setProperty(key, value);\n } else {\n root.style.removeProperty(key);\n }\n }\n }\n}\n"],"mappings":"0GAwBA,IAAM,EAAc,CAClB,GAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,aACL,IAAK,cACL,IAAK,aACL,IAAK,cACL,IAAK,cACL,IAAK,cACL,IAAK,aACL,IAAK,aACN,CAEK,EAAgB,CACpB,iBAAkB,UAClB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACnB,kBAAmB,UACpB,CAEK,EAAiB,CACrB,sBAAuB,EAAY,KACnC,iCAAkC,EAAY,IAC9C,yBAA0B,EAAY,KACtC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,0BAA2B,EAAY,KACvC,sBAAuB,EAAY,KACnC,oBAAq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AAQ,CAElC,EAAiC,EAAO,CAG1C,SAAS,EACP,EACM,CACN,IAAM,EAAQ,SAAS,iBAAiB,yBAAyB,CACjE,IAAK,IAAM,KAAQ,EACX,gBAAgB,YAEtB,IAAK,IAAM,KAAO,EAAwB,CACxC,IAAM,EAAQ,EAAO,GACjB,EACF,EAAK,MAAM,YAAY,EAAK,EAAM,CAElC,EAAK,MAAM,eAAe,EAAI"}
|
|
@@ -35,12 +35,23 @@ export declare function persistColorTheme(key: ColorThemeKey): void;
|
|
|
35
35
|
* PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*
|
|
36
36
|
* is set on EVERY element carrying that attribute. A body inline-style only
|
|
37
37
|
* overrides body itself — inner matching elements keep the stylesheet value.
|
|
38
|
-
* Injecting a stylesheet appended to <head> wins on equal specificity because
|
|
39
|
-
* later sheets take precedence in the cascade.
|
|
40
38
|
*
|
|
41
39
|
* Why heroui variables:
|
|
42
40
|
* HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].
|
|
43
41
|
* They reference their own token system and are unaffected by --cool-grey-*
|
|
44
42
|
* changes, so we override them from the same injected sheet.
|
|
43
|
+
*
|
|
44
|
+
* Why doubled selectors + re-append on every call:
|
|
45
|
+
* "Later sheet wins the tie" cannot be relied on: in the built SPA
|
|
46
|
+
* (ssr:false, prerendered shell) React 19 re-creates the <head> elements it
|
|
47
|
+
* manages (<Meta/>/<Links/>) whenever the tree above the router remounts —
|
|
48
|
+
* e.g. PostHogWrapper swapping in <PostHogProvider> once the analytics key
|
|
49
|
+
* resolves, which only happens in builds with VITE_POSTHOG_CLIENT_KEY baked
|
|
50
|
+
* (the published npm package / tagged Docker images). That re-inserts the
|
|
51
|
+
* base stylesheet <link> AFTER this tag, which would let the base sheet's
|
|
52
|
+
* unlayered [data-agent-server-ui] variable rules (0,1,0) win every tie.
|
|
53
|
+
* Doubling the attribute selectors ([x][x], 0,2,0) beats them from any
|
|
54
|
+
* position in <head>; re-appending on each apply keeps document order
|
|
55
|
+
* favorable as well.
|
|
45
56
|
*/
|
|
46
57
|
export declare function applyColorTheme(key: ColorThemeKey): void;
|
|
@@ -151,8 +151,8 @@ function u(e) {
|
|
|
151
151
|
var d = "oh-color-theme-override";
|
|
152
152
|
function f(e) {
|
|
153
153
|
if (typeof document > "u") return;
|
|
154
|
-
let { scale: t, heroui: n, tokens: r = {} } = a[e], i = Object.entries(t).map(([e, t]) => ` ${e}: ${t};`).join("\n"), o = Object.entries(n).map(([e, t]) => ` ${e}: ${t};`).join("\n"), s = [`[data-agent-server-ui] {\n${i}\n${o}\n${Object.entries(r).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`, `[data-theme=dark] {\n${o}\n}`].join("\n"), c = document.getElementById(d);
|
|
155
|
-
c || (c = document.createElement("style"), c.id = d, document.head.appendChild(c)
|
|
154
|
+
let { scale: t, heroui: n, tokens: r = {} } = a[e], i = Object.entries(t).map(([e, t]) => ` ${e}: ${t};`).join("\n"), o = Object.entries(n).map(([e, t]) => ` ${e}: ${t};`).join("\n"), s = [`[data-agent-server-ui][data-agent-server-ui] {\n${i}\n${o}\n${Object.entries(r).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`, `[data-theme=dark][data-theme=dark] {\n${o}\n}`].join("\n"), c = document.getElementById(d);
|
|
155
|
+
c || (c = document.createElement("style"), c.id = d), c.textContent = s, document.head.appendChild(c), p(r);
|
|
156
156
|
}
|
|
157
157
|
function p(e) {
|
|
158
158
|
let t = document.querySelectorAll("[data-agent-server-ui]");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-themes.js","names":[],"sources":["../../src/themes/color-themes.ts"],"sourcesContent":["export type ColorThemeKey =\n | \"openhands-deepsea\"\n | \"openhands-neutral\"\n | \"openhands-neo\";\n\nexport interface ColorThemeDefinition {\n label: string;\n /** Overrides for --cool-grey-* CSS custom properties (our semantic scale) */\n scale: Record<string, string>;\n /**\n * Overrides for --heroui-* CSS custom properties.\n * HeroUI stores colors as space-separated HSL channels (\"H S% L%\") so Tailwind\n * utilities like bg-default-200 resolve to hsl(var(--heroui-default-200)).\n * These vars are set by the heroui() plugin on :root, [data-theme=dark] at\n * build time, so they must be overridden at the same or lower specificity\n * from a later stylesheet to pick up theme changes at runtime.\n */\n heroui: Record<string, string>;\n /** Overrides for --oh-* semantic tokens such as brand / button colors. */\n tokens?: Record<string, string>;\n}\n\n// HSL channel strings for the neutral grey palette (H=0, S=0%, L=hex/255*100)\n// prettier-ignore\nconst NEUTRAL_HSL = {\n 50: \"0 0% 96.86%\", // #F7F7F7\n 100: \"0 0% 92.55%\", // #ECECEC\n 200: \"0 0% 86.27%\", // #DCDCDC\n 300: \"0 0% 74.51%\", // #BEBEBE\n 400: \"0 0% 59.22%\", // #979797\n 500: \"0 0% 45.1%\", // #737373\n 600: \"0 0% 33.73%\", // #565656\n 700: \"0 0% 25.1%\", // #404040\n 800: \"0 0% 19.22%\", // #313131\n 850: \"0 0% 15.69%\", // #282828\n 900: \"0 0% 12.55%\", // #202020\n 950: \"0 0% 9.41%\", // #181818\n 975: \"0 0% 6.27%\", // #101010\n};\n\nconst NEUTRAL_SCALE = {\n \"--cool-grey-50\": \"#F7F7F7\",\n \"--cool-grey-100\": \"#ECECEC\",\n \"--cool-grey-200\": \"#DCDCDC\",\n \"--cool-grey-300\": \"#BEBEBE\",\n \"--cool-grey-400\": \"#979797\",\n \"--cool-grey-500\": \"#737373\",\n \"--cool-grey-600\": \"#565656\",\n \"--cool-grey-700\": \"#404040\",\n \"--cool-grey-800\": \"#313131\",\n \"--cool-grey-900\": \"#282828\",\n \"--cool-grey-925\": \"#202020\",\n \"--cool-grey-950\": \"#181818\",\n \"--cool-grey-975\": \"#101010\",\n};\n\nconst NEUTRAL_HEROUI = {\n \"--heroui-background\": NEUTRAL_HSL[950],\n \"--heroui-background-foreground\": NEUTRAL_HSL[50],\n \"--heroui-foreground-50\": NEUTRAL_HSL[975],\n \"--heroui-foreground-100\": NEUTRAL_HSL[950],\n \"--heroui-foreground-200\": NEUTRAL_HSL[900],\n \"--heroui-foreground-300\": NEUTRAL_HSL[850],\n \"--heroui-foreground-400\": NEUTRAL_HSL[800],\n \"--heroui-foreground-500\": NEUTRAL_HSL[700],\n \"--heroui-foreground-600\": NEUTRAL_HSL[600],\n \"--heroui-foreground-700\": NEUTRAL_HSL[500],\n \"--heroui-foreground-800\": NEUTRAL_HSL[400],\n \"--heroui-foreground-900\": NEUTRAL_HSL[300],\n \"--heroui-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content1\": NEUTRAL_HSL[900],\n \"--heroui-content1-foreground\": NEUTRAL_HSL[100],\n \"--heroui-content2\": NEUTRAL_HSL[850],\n \"--heroui-content2-foreground\": NEUTRAL_HSL[200],\n \"--heroui-content3\": NEUTRAL_HSL[800],\n \"--heroui-content3-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content4\": NEUTRAL_HSL[700],\n \"--heroui-content4-foreground\": NEUTRAL_HSL[400],\n \"--heroui-default-50\": NEUTRAL_HSL[975],\n \"--heroui-default-100\": NEUTRAL_HSL[950],\n \"--heroui-default-200\": NEUTRAL_HSL[900],\n \"--heroui-default-300\": NEUTRAL_HSL[850],\n \"--heroui-default-400\": NEUTRAL_HSL[800],\n \"--heroui-default-500\": NEUTRAL_HSL[700],\n \"--heroui-default-600\": NEUTRAL_HSL[600],\n \"--heroui-default-700\": NEUTRAL_HSL[500],\n \"--heroui-default-800\": NEUTRAL_HSL[400],\n \"--heroui-default-900\": NEUTRAL_HSL[300],\n \"--heroui-default-foreground\": NEUTRAL_HSL[50],\n \"--heroui-default\": NEUTRAL_HSL[800],\n};\n\nimport { AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES } from \"#/styles/agent-server-ui-style-scope\";\n\n/** CSS custom properties overridden by color themes (see applyColorTheme). */\nexport const COLOR_THEME_TOKEN_KEYS = AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES;\n\n/** White primary/accent tokens — used by OpenHands-Neo for button surfaces. */\nconst NEO_WHITE_BUTTON_TOKENS: Record<\n (typeof COLOR_THEME_TOKEN_KEYS)[number],\n string\n> = {\n \"--oh-color-primary\": \"#ffffff\",\n \"--oh-accent\": \"#ffffff\",\n \"--oh-warning\": \"#ffffff\",\n};\n\nexport const COLOR_THEMES: Record<ColorThemeKey, ColorThemeDefinition> = {\n \"openhands-deepsea\": {\n label: \"OpenHands-DeepSea\",\n // Matches the values already set by index.css; included so switching back\n // from another theme restores the original palette explicitly.\n scale: {\n \"--cool-grey-50\": \"#F7F9FC\",\n \"--cool-grey-100\": \"#EEF2F7\",\n \"--cool-grey-200\": \"#DCE3EE\",\n \"--cool-grey-300\": \"#C3CDDC\",\n \"--cool-grey-400\": \"#A3B0C4\",\n \"--cool-grey-500\": \"#7E8A9E\",\n \"--cool-grey-600\": \"#626D82\",\n \"--cool-grey-700\": \"#4B5468\",\n \"--cool-grey-800\": \"#383F50\",\n \"--cool-grey-900\": \"#2C313F\",\n \"--cool-grey-925\": \"#21252F\",\n \"--cool-grey-950\": \"#0B0E14\",\n \"--cool-grey-975\": \"#05070A\",\n },\n // Values generated by heroui() from hero.ts — restore them explicitly when\n // switching back from another theme.\n heroui: {\n \"--heroui-background\": \"220 29.03% 6.08%\",\n \"--heroui-background-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-foreground-50\": \"216 33.33% 2.94%\",\n \"--heroui-foreground-100\": \"220 29.03% 6.08%\",\n \"--heroui-foreground-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-foreground-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-foreground-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-foreground-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-foreground-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-foreground-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-foreground-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-foreground-900\": \"216 26.32% 81.37%\",\n \"--heroui-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content1\": \"222.86 17.5% 15.69%\",\n \"--heroui-content1-foreground\": \"213.33 36% 95.1%\",\n \"--heroui-content2\": \"224.21 17.76% 20.98%\",\n \"--heroui-content2-foreground\": \"216.67 34.62% 89.8%\",\n \"--heroui-content3\": \"222.5 17.65% 26.67%\",\n \"--heroui-content3-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content4\": \"221.38 16.2% 35.1%\",\n \"--heroui-content4-foreground\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-50\": \"216 33.33% 2.94%\",\n \"--heroui-default-100\": \"220 29.03% 6.08%\",\n \"--heroui-default-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-default-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-default-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-default-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-default-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-default-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-default-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-900\": \"216 26.32% 81.37%\",\n \"--heroui-default-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-default\": \"222.5 17.65% 26.67%\",\n },\n },\n\n \"openhands-neutral\": {\n label: \"OpenHands-Neutral\",\n scale: NEUTRAL_SCALE,\n // Each stop follows the same positional mapping as hero.ts:\n // heroui-default-100 ← cool-grey-950 position ← neutral-950 (#181818)\n // heroui-default-200 ← cool-grey-925 position ← neutral-900 (#202020)\n // ...etc.\n heroui: NEUTRAL_HEROUI,\n },\n\n \"openhands-neo\": {\n label: \"OpenHands-Neo\",\n scale: NEUTRAL_SCALE,\n heroui: NEUTRAL_HEROUI,\n tokens: NEO_WHITE_BUTTON_TOKENS,\n },\n};\n\nexport const DEFAULT_COLOR_THEME: ColorThemeKey = \"openhands-neutral\";\n\nexport const AVAILABLE_COLOR_THEMES = Object.entries(COLOR_THEMES).map(\n ([key, def]) => ({ key: key as ColorThemeKey, label: def.label }),\n);\n\nconst STORAGE_KEY = \"openhands-color-theme\";\n\n/** Read the persisted theme key from localStorage, falling back to the default. */\nexport function readPersistedColorTheme(): ColorThemeKey {\n if (typeof window === \"undefined\") return DEFAULT_COLOR_THEME;\n try {\n const stored = window.localStorage.getItem(STORAGE_KEY);\n if (stored && stored in COLOR_THEMES) return stored as ColorThemeKey;\n } catch {\n // ignore quota / privacy-mode failures\n }\n return DEFAULT_COLOR_THEME;\n}\n\n/** Persist the theme key to localStorage. */\nexport function persistColorTheme(key: ColorThemeKey): void {\n try {\n window.localStorage.setItem(STORAGE_KEY, key);\n } catch {\n // ignore\n }\n}\n\nconst THEME_STYLE_TAG_ID = \"oh-color-theme-override\";\n\n/**\n * Apply a theme by injecting (or replacing) a <style> tag that overrides\n * both our custom --cool-grey-* primitives and HeroUI's --heroui-* tokens.\n *\n * Why a <style> tag:\n * PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*\n * is set on EVERY element carrying that attribute. A body inline-style only\n * overrides body itself — inner matching elements keep the stylesheet value.\n * Injecting a stylesheet appended to <head> wins on equal specificity because\n * later sheets take precedence in the cascade.\n *\n * Why heroui variables:\n * HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].\n * They reference their own token system and are unaffected by --cool-grey-*\n * changes, so we override them from the same injected sheet.\n */\nexport function applyColorTheme(key: ColorThemeKey): void {\n if (typeof document === \"undefined\") return;\n const { scale, heroui, tokens = {} } = COLOR_THEMES[key];\n\n const scaleDecls = Object.entries(scale)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const herouiDecls = Object.entries(heroui)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const tokenDecls = Object.entries(tokens)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n // Target both selectors for heroui vars:\n // [data-agent-server-ui] — covers document.body (portal destination) so\n // portalled popover/listbox content inherits the overridden values.\n // [data-theme=dark] — covers the inner AgentServerUIRoot wrapper so\n // components scoped inside the dark theme wrapper also pick them up.\n const css = [\n `[data-agent-server-ui] {\\n${scaleDecls}\\n${herouiDecls}\\n${tokenDecls}\\n}`,\n `[data-theme=dark] {\\n${herouiDecls}\\n}`,\n ].join(\"\\n\");\n\n let styleEl = document.getElementById(\n THEME_STYLE_TAG_ID,\n ) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = document.createElement(\"style\");\n styleEl.id = THEME_STYLE_TAG_ID;\n document.head.appendChild(styleEl);\n }\n styleEl.textContent = css;\n\n syncColorThemeTokensOnScopeRoots(tokens);\n}\n\nfunction syncColorThemeTokensOnScopeRoots(\n tokens: Record<string, string>,\n): void {\n const roots = document.querySelectorAll(\"[data-agent-server-ui]\");\n for (const root of roots) {\n if (!(root instanceof HTMLElement)) continue;\n\n for (const key of COLOR_THEME_TOKEN_KEYS) {\n const value = tokens[key];\n if (value) {\n root.style.setProperty(key, value);\n } else {\n root.style.removeProperty(key);\n }\n }\n }\n}\n"],"mappings":";;AAwBA,IAAM,IAAc;CAClB,IAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACN,EAEK,IAAgB;CACpB,kBAAkB;CAClB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACpB,EAEK,IAAiB;CACrB,uBAAuB,EAAY;CACnC,kCAAkC,EAAY;CAC9C,0BAA0B,EAAY;CACtC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACv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iC,EAAO;;AAG1C,SAAS,EACP,GACM;CACN,IAAM,IAAQ,SAAS,iBAAiB,yBAAyB;AACjE,MAAK,IAAM,KAAQ,EACX,kBAAgB,YAEtB,MAAK,IAAM,KAAO,GAAwB;EACxC,IAAM,IAAQ,EAAO;AACrB,EAAI,IACF,EAAK,MAAM,YAAY,GAAK,EAAM,GAElC,EAAK,MAAM,eAAe,EAAI"}
|
|
1
|
+
{"version":3,"file":"color-themes.js","names":[],"sources":["../../src/themes/color-themes.ts"],"sourcesContent":["export type ColorThemeKey =\n | \"openhands-deepsea\"\n | \"openhands-neutral\"\n | \"openhands-neo\";\n\nexport interface ColorThemeDefinition {\n label: string;\n /** Overrides for --cool-grey-* CSS custom properties (our semantic scale) */\n scale: Record<string, string>;\n /**\n * Overrides for --heroui-* CSS custom properties.\n * HeroUI stores colors as space-separated HSL channels (\"H S% L%\") so Tailwind\n * utilities like bg-default-200 resolve to hsl(var(--heroui-default-200)).\n * These vars are set by the heroui() plugin on :root, [data-theme=dark] at\n * build time, so they must be overridden at the same or lower specificity\n * from a later stylesheet to pick up theme changes at runtime.\n */\n heroui: Record<string, string>;\n /** Overrides for --oh-* semantic tokens such as brand / button colors. */\n tokens?: Record<string, string>;\n}\n\n// HSL channel strings for the neutral grey palette (H=0, S=0%, L=hex/255*100)\n// prettier-ignore\nconst NEUTRAL_HSL = {\n 50: \"0 0% 96.86%\", // #F7F7F7\n 100: \"0 0% 92.55%\", // #ECECEC\n 200: \"0 0% 86.27%\", // #DCDCDC\n 300: \"0 0% 74.51%\", // #BEBEBE\n 400: \"0 0% 59.22%\", // #979797\n 500: \"0 0% 45.1%\", // #737373\n 600: \"0 0% 33.73%\", // #565656\n 700: \"0 0% 25.1%\", // #404040\n 800: \"0 0% 19.22%\", // #313131\n 850: \"0 0% 15.69%\", // #282828\n 900: \"0 0% 12.55%\", // #202020\n 950: \"0 0% 9.41%\", // #181818\n 975: \"0 0% 6.27%\", // #101010\n};\n\nconst NEUTRAL_SCALE = {\n \"--cool-grey-50\": \"#F7F7F7\",\n \"--cool-grey-100\": \"#ECECEC\",\n \"--cool-grey-200\": \"#DCDCDC\",\n \"--cool-grey-300\": \"#BEBEBE\",\n \"--cool-grey-400\": \"#979797\",\n \"--cool-grey-500\": \"#737373\",\n \"--cool-grey-600\": \"#565656\",\n \"--cool-grey-700\": \"#404040\",\n \"--cool-grey-800\": \"#313131\",\n \"--cool-grey-900\": \"#282828\",\n \"--cool-grey-925\": \"#202020\",\n \"--cool-grey-950\": \"#181818\",\n \"--cool-grey-975\": \"#101010\",\n};\n\nconst NEUTRAL_HEROUI = {\n \"--heroui-background\": NEUTRAL_HSL[950],\n \"--heroui-background-foreground\": NEUTRAL_HSL[50],\n \"--heroui-foreground-50\": NEUTRAL_HSL[975],\n \"--heroui-foreground-100\": NEUTRAL_HSL[950],\n \"--heroui-foreground-200\": NEUTRAL_HSL[900],\n \"--heroui-foreground-300\": NEUTRAL_HSL[850],\n \"--heroui-foreground-400\": NEUTRAL_HSL[800],\n \"--heroui-foreground-500\": NEUTRAL_HSL[700],\n \"--heroui-foreground-600\": NEUTRAL_HSL[600],\n \"--heroui-foreground-700\": NEUTRAL_HSL[500],\n \"--heroui-foreground-800\": NEUTRAL_HSL[400],\n \"--heroui-foreground-900\": NEUTRAL_HSL[300],\n \"--heroui-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content1\": NEUTRAL_HSL[900],\n \"--heroui-content1-foreground\": NEUTRAL_HSL[100],\n \"--heroui-content2\": NEUTRAL_HSL[850],\n \"--heroui-content2-foreground\": NEUTRAL_HSL[200],\n \"--heroui-content3\": NEUTRAL_HSL[800],\n \"--heroui-content3-foreground\": NEUTRAL_HSL[300],\n \"--heroui-content4\": NEUTRAL_HSL[700],\n \"--heroui-content4-foreground\": NEUTRAL_HSL[400],\n \"--heroui-default-50\": NEUTRAL_HSL[975],\n \"--heroui-default-100\": NEUTRAL_HSL[950],\n \"--heroui-default-200\": NEUTRAL_HSL[900],\n \"--heroui-default-300\": NEUTRAL_HSL[850],\n \"--heroui-default-400\": NEUTRAL_HSL[800],\n \"--heroui-default-500\": NEUTRAL_HSL[700],\n \"--heroui-default-600\": NEUTRAL_HSL[600],\n \"--heroui-default-700\": NEUTRAL_HSL[500],\n \"--heroui-default-800\": NEUTRAL_HSL[400],\n \"--heroui-default-900\": NEUTRAL_HSL[300],\n \"--heroui-default-foreground\": NEUTRAL_HSL[50],\n \"--heroui-default\": NEUTRAL_HSL[800],\n};\n\nimport { AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES } from \"#/styles/agent-server-ui-style-scope\";\n\n/** CSS custom properties overridden by color themes (see applyColorTheme). */\nexport const COLOR_THEME_TOKEN_KEYS = AGENT_SERVER_UI_THEMEABLE_BRAND_VARIABLES;\n\n/** White primary/accent tokens — used by OpenHands-Neo for button surfaces. */\nconst NEO_WHITE_BUTTON_TOKENS: Record<\n (typeof COLOR_THEME_TOKEN_KEYS)[number],\n string\n> = {\n \"--oh-color-primary\": \"#ffffff\",\n \"--oh-accent\": \"#ffffff\",\n \"--oh-warning\": \"#ffffff\",\n};\n\nexport const COLOR_THEMES: Record<ColorThemeKey, ColorThemeDefinition> = {\n \"openhands-deepsea\": {\n label: \"OpenHands-DeepSea\",\n // Matches the values already set by index.css; included so switching back\n // from another theme restores the original palette explicitly.\n scale: {\n \"--cool-grey-50\": \"#F7F9FC\",\n \"--cool-grey-100\": \"#EEF2F7\",\n \"--cool-grey-200\": \"#DCE3EE\",\n \"--cool-grey-300\": \"#C3CDDC\",\n \"--cool-grey-400\": \"#A3B0C4\",\n \"--cool-grey-500\": \"#7E8A9E\",\n \"--cool-grey-600\": \"#626D82\",\n \"--cool-grey-700\": \"#4B5468\",\n \"--cool-grey-800\": \"#383F50\",\n \"--cool-grey-900\": \"#2C313F\",\n \"--cool-grey-925\": \"#21252F\",\n \"--cool-grey-950\": \"#0B0E14\",\n \"--cool-grey-975\": \"#05070A\",\n },\n // Values generated by heroui() from hero.ts — restore them explicitly when\n // switching back from another theme.\n heroui: {\n \"--heroui-background\": \"220 29.03% 6.08%\",\n \"--heroui-background-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-foreground-50\": \"216 33.33% 2.94%\",\n \"--heroui-foreground-100\": \"220 29.03% 6.08%\",\n \"--heroui-foreground-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-foreground-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-foreground-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-foreground-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-foreground-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-foreground-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-foreground-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-foreground-900\": \"216 26.32% 81.37%\",\n \"--heroui-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content1\": \"222.86 17.5% 15.69%\",\n \"--heroui-content1-foreground\": \"213.33 36% 95.1%\",\n \"--heroui-content2\": \"224.21 17.76% 20.98%\",\n \"--heroui-content2-foreground\": \"216.67 34.62% 89.8%\",\n \"--heroui-content3\": \"222.5 17.65% 26.67%\",\n \"--heroui-content3-foreground\": \"216 26.32% 81.37%\",\n \"--heroui-content4\": \"221.38 16.2% 35.1%\",\n \"--heroui-content4-foreground\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-50\": \"216 33.33% 2.94%\",\n \"--heroui-default-100\": \"220 29.03% 6.08%\",\n \"--heroui-default-200\": \"222.86 17.5% 15.69%\",\n \"--heroui-default-300\": \"224.21 17.76% 20.98%\",\n \"--heroui-default-400\": \"222.5 17.65% 26.67%\",\n \"--heroui-default-500\": \"221.38 16.2% 35.1%\",\n \"--heroui-default-600\": \"219.38 14.04% 44.71%\",\n \"--heroui-default-700\": \"217.5 14.16% 55.69%\",\n \"--heroui-default-800\": \"216.36 21.85% 70.39%\",\n \"--heroui-default-900\": \"216 26.32% 81.37%\",\n \"--heroui-default-foreground\": \"216 45.45% 97.84%\",\n \"--heroui-default\": \"222.5 17.65% 26.67%\",\n },\n },\n\n \"openhands-neutral\": {\n label: \"OpenHands-Neutral\",\n scale: NEUTRAL_SCALE,\n // Each stop follows the same positional mapping as hero.ts:\n // heroui-default-100 ← cool-grey-950 position ← neutral-950 (#181818)\n // heroui-default-200 ← cool-grey-925 position ← neutral-900 (#202020)\n // ...etc.\n heroui: NEUTRAL_HEROUI,\n },\n\n \"openhands-neo\": {\n label: \"OpenHands-Neo\",\n scale: NEUTRAL_SCALE,\n heroui: NEUTRAL_HEROUI,\n tokens: NEO_WHITE_BUTTON_TOKENS,\n },\n};\n\nexport const DEFAULT_COLOR_THEME: ColorThemeKey = \"openhands-neutral\";\n\nexport const AVAILABLE_COLOR_THEMES = Object.entries(COLOR_THEMES).map(\n ([key, def]) => ({ key: key as ColorThemeKey, label: def.label }),\n);\n\nconst STORAGE_KEY = \"openhands-color-theme\";\n\n/** Read the persisted theme key from localStorage, falling back to the default. */\nexport function readPersistedColorTheme(): ColorThemeKey {\n if (typeof window === \"undefined\") return DEFAULT_COLOR_THEME;\n try {\n const stored = window.localStorage.getItem(STORAGE_KEY);\n if (stored && stored in COLOR_THEMES) return stored as ColorThemeKey;\n } catch {\n // ignore quota / privacy-mode failures\n }\n return DEFAULT_COLOR_THEME;\n}\n\n/** Persist the theme key to localStorage. */\nexport function persistColorTheme(key: ColorThemeKey): void {\n try {\n window.localStorage.setItem(STORAGE_KEY, key);\n } catch {\n // ignore\n }\n}\n\nconst THEME_STYLE_TAG_ID = \"oh-color-theme-override\";\n\n/**\n * Apply a theme by injecting (or replacing) a <style> tag that overrides\n * both our custom --cool-grey-* primitives and HeroUI's --heroui-* tokens.\n *\n * Why a <style> tag:\n * PostCSS transforms :root / body to [data-agent-server-ui], so --cool-grey-*\n * is set on EVERY element carrying that attribute. A body inline-style only\n * overrides body itself — inner matching elements keep the stylesheet value.\n *\n * Why heroui variables:\n * HeroUI stores colors as HSL channels in --heroui-* vars on [data-theme=dark].\n * They reference their own token system and are unaffected by --cool-grey-*\n * changes, so we override them from the same injected sheet.\n *\n * Why doubled selectors + re-append on every call:\n * \"Later sheet wins the tie\" cannot be relied on: in the built SPA\n * (ssr:false, prerendered shell) React 19 re-creates the <head> elements it\n * manages (<Meta/>/<Links/>) whenever the tree above the router remounts —\n * e.g. PostHogWrapper swapping in <PostHogProvider> once the analytics key\n * resolves, which only happens in builds with VITE_POSTHOG_CLIENT_KEY baked\n * (the published npm package / tagged Docker images). That re-inserts the\n * base stylesheet <link> AFTER this tag, which would let the base sheet's\n * unlayered [data-agent-server-ui] variable rules (0,1,0) win every tie.\n * Doubling the attribute selectors ([x][x], 0,2,0) beats them from any\n * position in <head>; re-appending on each apply keeps document order\n * favorable as well.\n */\nexport function applyColorTheme(key: ColorThemeKey): void {\n if (typeof document === \"undefined\") return;\n const { scale, heroui, tokens = {} } = COLOR_THEMES[key];\n\n const scaleDecls = Object.entries(scale)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const herouiDecls = Object.entries(heroui)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n const tokenDecls = Object.entries(tokens)\n .map(([p, v]) => ` ${p}: ${v};`)\n .join(\"\\n\");\n\n // Target both selectors for heroui vars:\n // [data-agent-server-ui] — covers document.body (portal destination) so\n // portalled popover/listbox content inherits the overridden values.\n // [data-theme=dark] — covers the inner AgentServerUIRoot wrapper so\n // components scoped inside the dark theme wrapper also pick them up.\n // Both are doubled to out-specify the base sheet regardless of stylesheet\n // order (see the doc comment above).\n const css = [\n `[data-agent-server-ui][data-agent-server-ui] {\\n${scaleDecls}\\n${herouiDecls}\\n${tokenDecls}\\n}`,\n `[data-theme=dark][data-theme=dark] {\\n${herouiDecls}\\n}`,\n ].join(\"\\n\");\n\n let styleEl = document.getElementById(\n THEME_STYLE_TAG_ID,\n ) as HTMLStyleElement | null;\n if (!styleEl) {\n styleEl = document.createElement(\"style\");\n styleEl.id = THEME_STYLE_TAG_ID;\n }\n styleEl.textContent = css;\n // Re-append even when the tag already exists (appendChild relocates a\n // connected node) so the override also stays after any re-inserted <link>.\n document.head.appendChild(styleEl);\n\n syncColorThemeTokensOnScopeRoots(tokens);\n}\n\nfunction syncColorThemeTokensOnScopeRoots(\n tokens: Record<string, string>,\n): void {\n const roots = document.querySelectorAll(\"[data-agent-server-ui]\");\n for (const root of roots) {\n if (!(root instanceof HTMLElement)) continue;\n\n for (const key of COLOR_THEME_TOKEN_KEYS) {\n const value = tokens[key];\n if (value) {\n root.style.setProperty(key, value);\n } else {\n root.style.removeProperty(key);\n }\n }\n }\n}\n"],"mappings":";;AAwBA,IAAM,IAAc;CAClB,IAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACN,EAEK,IAAgB;CACpB,kBAAkB;CAClB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACpB,EAEK,IAAiB;CACrB,uBAAuB,EAAY;CACnC,kCAAkC,EAAY;CAC9C,0BAA0B,EAAY;CACtC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,2BAA2B,EAAY;CACvC,uBAAuB,EAAY;CACnC,qBAAqB,EAAY;CACjC,gCAAgC,EAAY;CAC5C,qBAAqB,EAAY;CACjC,gCAAgC,EAAY;CAC5C,qBAAqB,EAAY;CACjC,gCAAgC,EAAY;CAC5C,qBAAqB,EAAY;CACjC,gCAAgC,EAAY;CAC5C,uBAAuB,EAAY;CACnC,wBAAwB,EAA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,EAAK,MAAM,eAAe,EAAI"}
|
|
@@ -11,6 +11,8 @@ export interface AutomationTrigger {
|
|
|
11
11
|
schedule?: string;
|
|
12
12
|
/** Human-readable schedule description (schedule triggers only). */
|
|
13
13
|
schedule_human?: string;
|
|
14
|
+
/** IANA timezone name (schedule triggers only). */
|
|
15
|
+
timezone?: string;
|
|
14
16
|
/** Event source, e.g. "github" (event triggers only). */
|
|
15
17
|
source?: string;
|
|
16
18
|
/** Event key pattern(s) to match, e.g. "pull_request.opened" or ["push", "release.*"]. */
|
|
@@ -35,6 +37,12 @@ export interface Automation {
|
|
|
35
37
|
timezone?: string;
|
|
36
38
|
last_triggered_at?: string | null;
|
|
37
39
|
}
|
|
40
|
+
export type AutomationSpec = Omit<Automation, "id" | "created_at" | "updated_at" | "last_triggered_at">;
|
|
41
|
+
export interface AutomationExportFile {
|
|
42
|
+
version: 1;
|
|
43
|
+
kind: "automation";
|
|
44
|
+
spec: AutomationSpec;
|
|
45
|
+
}
|
|
38
46
|
export interface AutomationsResponse {
|
|
39
47
|
automations: Automation[];
|
|
40
48
|
total: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-toast-handlers.cjs","names":[],"sources":["../../src/utils/custom-toast-handlers.tsx"],"sourcesContent":["import React, { CSSProperties, ReactNode } from \"react\";\nimport { CircleX } from \"lucide-react\";\nimport toast, { ToastOptions } from \"react-hot-toast\";\nimport { OH_STATUS_ERROR_COLOR } from \"#/constants/status-colors\";\nimport { calculateToastDuration } from \"./toast-duration\";\nimport { cn } from \"#/utils/utils\";\nimport i18n from \"#/i18n\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport {\n isBackendRequestTimeoutMessage,\n isCorsOrNetworkErrorMessage,\n} from \"./user-facing-error\";\n\n// react-hot-toast accepts only CSSProperties via the style option — cannot use className\nconst TOAST_STYLE: CSSProperties = {\n background: \"var(--oh-color-tertiary)\",\n border: \"1px solid var(--oh-border-input)\",\n color: \"#fff\",\n borderRadius: \"var(--oh-radius)\",\n maxWidth: \"400px\",\n wordBreak: \"break-word\",\n overflowWrap: \"anywhere\",\n whiteSpace: \"pre-wrap\",\n};\n\nexport const TOAST_OPTIONS: ToastOptions = {\n position: \"top-right\",\n style: TOAST_STYLE,\n};\n\nconst ERROR_TOAST_STYLE: CSSProperties = {\n ...TOAST_STYLE,\n color: \"var(--oh-muted)\",\n};\n\n/** Icon + message row; center icon for single-line text, top-align when wrapped. */\nexport function ErrorToastContent({ message }: { message: ReactNode }) {\n const contentRef = React.useRef<HTMLSpanElement>(null);\n const [isMultiLine, setIsMultiLine] = React.useState(false);\n\n React.useLayoutEffect(() => {\n const content = contentRef.current;\n if (!content) {\n return undefined;\n }\n\n const updateIsMultiLine = () => {\n const lineHeight = Number.parseFloat(\n getComputedStyle(content).lineHeight,\n );\n if (!Number.isFinite(lineHeight) || lineHeight <= 0) {\n setIsMultiLine(false);\n return;\n }\n\n setIsMultiLine(content.getBoundingClientRect().height > lineHeight * 1.5);\n };\n\n updateIsMultiLine();\n\n const observer = new ResizeObserver(updateIsMultiLine);\n observer.observe(content);\n\n return () => observer.disconnect();\n }, [message]);\n\n return (\n <div\n className={cn(\n \"flex min-w-0 gap-2\",\n isMultiLine ? \"items-start\" : \"items-center\",\n )}\n >\n <CircleX\n aria-hidden\n className=\"h-4 w-4 shrink-0\"\n strokeWidth={2}\n style={{ color: OH_STATUS_ERROR_COLOR }}\n />\n <span\n ref={contentRef}\n className=\"min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]\"\n >\n {message}\n </span>\n </div>\n );\n}\n\nexport const ERROR_TOAST_OPTIONS: ToastOptions = {\n ...TOAST_OPTIONS,\n icon: null,\n style: ERROR_TOAST_STYLE,\n};\n\nexport const displayErrorToast = (error: string | null | undefined) => {\n let errorMessage = error || i18n.t(I18nKey.STATUS$ERROR);\n if (isCorsOrNetworkErrorMessage(errorMessage)) {\n errorMessage = i18n.t(I18nKey.ERROR$CORS_OR_NETWORK);\n } else if (isBackendRequestTimeoutMessage(errorMessage)) {\n errorMessage = i18n.t(I18nKey.ERROR$BACKEND_REQUEST_TIMEOUT);\n }\n const duration = calculateToastDuration(errorMessage, 4000);\n toast(<ErrorToastContent message={errorMessage} />, {\n ...ERROR_TOAST_OPTIONS,\n duration,\n });\n};\n\nexport const displaySuccessToast = (message: string) => {\n const duration = calculateToastDuration(message, 5000);\n toast.success(\n <span className=\"[word-break:break-word] [overflow-wrap:anywhere]\">\n {message}\n </span>,\n { ...TOAST_OPTIONS, duration },\n );\n};\n\n/**\n * Neutral, non-success notice — used when an action completed but the outcome\n * is qualified (e.g. a secret was saved but the active backend can't consume it\n * yet). Renders without the success checkmark so it doesn't read as \"all good\".\n */\nexport const displayWarningToast = (message: string) => {\n const duration = calculateToastDuration(message, 6000);\n toast(\n <span className=\"[word-break:break-word] [overflow-wrap:anywhere]\">\n {message}\n </span>,\n { ...TOAST_OPTIONS, icon: \"⚠️\", duration },\n );\n};\n"],"mappings":"kdAcA,IAAM,EAA6B,CACjC,WAAY,2BACZ,OAAQ,mCACR,MAAO,OACP,aAAc,mBACd,SAAU,QACV,UAAW,aACX,aAAc,WACd,WAAY,WACb,CAEY,EAA8B,CACzC,SAAU,YACV,MAAO,EACR,CAEK,EAAmC,CACvC,GAAG,EACH,MAAO,kBACR,CAGD,SAAgB,EAAkB,CAAE,WAAmC,CACrE,IAAM,EAAa,EAAA,QAAM,OAAwB,KAAK,CAChD,CAAC,EAAa,GAAkB,EAAA,QAAM,SAAS,GAAM,CA4B3D,OA1BA,EAAA,QAAM,oBAAsB,CAC1B,IAAM,EAAU,EAAW,QAC3B,GAAI,CAAC,EACH,OAGF,IAAM,MAA0B,CAC9B,IAAM,EAAa,OAAO,WACxB,iBAAiB,EAAQ,CAAC,WAC3B,CACD,GAAI,CAAC,OAAO,SAAS,EAAW,EAAI,GAAc,EAAG,CACnD,EAAe,GAAM,CACrB,OAGF,EAAe,EAAQ,uBAAuB,CAAC,OAAS,EAAa,IAAI,EAG3E,GAAmB,CAEnB,IAAM,EAAW,IAAI,eAAe,EAAkB,CAGtD,OAFA,EAAS,QAAQ,EAAQ,KAEZ,EAAS,YAAY,EACjC,CAAC,EAAQ,CAAC,EAGX,EAAA,EAAA,MAAC,MAAD,CACE,UAAW,EAAA,GACT,qBACA,EAAc,cAAgB,eAC/B,UAJH,EAME,EAAA,EAAA,KAAC,EAAA,QAAD,CACE,cAAA,GACA,UAAU,mBACV,YAAa,EACb,MAAO,CAAE,MAAO,EAAA,sBAAuB,CACvC,CAAA,EACF,EAAA,EAAA,KAAC,OAAD,CACE,IAAK,EACL,UAAU,6FAET,EACI,CAAA,CACH,GAIV,IAAa,EAAoC,CAC/C,GAAG,EACH,KAAM,KACN,MAAO,EACR,CAEY,EAAqB,GAAqC,CACrE,IAAI,EAAe,GAAS,EAAA,QAAK,EAAE,EAAA,QAAQ,aAAa,CACpD,EAAA,4BAA4B,EAAa,CAC3C,EAAe,EAAA,QAAK,EAAE,EAAA,QAAQ,sBAAsB,CAC3C,EAAA,+BAA+B,EAAa,GACrD,EAAe,EAAA,QAAK,EAAE,EAAA,QAAQ,8BAA8B,EAE9D,IAAM,EAAW,EAAA,uBAAuB,EAAc,IAAK,CAC3D,EAAA,IAAM,EAAA,EAAA,KAAC,EAAD,CAAmB,QAAS,EAAgB,CAAA,CAAE,CAClD,GAAG,EACH,WACD,CAAC,EAGS,EAAuB,GAAoB,CACtD,IAAM,EAAW,EAAA,uBAAuB,EAAS,IAAK,CACtD,EAAA,GAAM,SACJ,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4DACb,EACI,CAAA,CACP,CAAE,GAAG,EAAe,WAAU,CAC/B"}
|
|
1
|
+
{"version":3,"file":"custom-toast-handlers.cjs","names":[],"sources":["../../src/utils/custom-toast-handlers.tsx"],"sourcesContent":["import React, { CSSProperties, ReactNode } from \"react\";\nimport { CircleX } from \"lucide-react\";\nimport toast, { ToastOptions } from \"react-hot-toast\";\nimport { OH_STATUS_ERROR_COLOR } from \"#/constants/status-colors\";\nimport { calculateToastDuration } from \"./toast-duration\";\nimport { cn } from \"#/utils/utils\";\nimport i18n from \"#/i18n\";\nimport { I18nKey } from \"#/i18n/declaration\";\nimport {\n isBackendRequestTimeoutMessage,\n isCorsOrNetworkErrorMessage,\n} from \"./user-facing-error\";\n\n// react-hot-toast accepts only CSSProperties via the style option — cannot use className\nconst TOAST_STYLE: CSSProperties = {\n background: \"var(--oh-color-tertiary)\",\n border: \"1px solid var(--oh-border-input)\",\n color: \"#fff\",\n borderRadius: \"var(--oh-radius)\",\n maxWidth: \"400px\",\n wordBreak: \"break-word\",\n overflowWrap: \"anywhere\",\n whiteSpace: \"pre-wrap\",\n};\n\nexport const TOAST_OPTIONS: ToastOptions = {\n position: \"top-right\",\n style: TOAST_STYLE,\n};\n\nconst ERROR_TOAST_STYLE: CSSProperties = {\n ...TOAST_STYLE,\n color: \"var(--oh-muted)\",\n};\n\n/** Icon + message row; center icon for single-line text, top-align when wrapped. */\nexport function ErrorToastContent({ message }: { message: ReactNode }) {\n const contentRef = React.useRef<HTMLSpanElement>(null);\n const [isMultiLine, setIsMultiLine] = React.useState(false);\n\n React.useLayoutEffect(() => {\n const content = contentRef.current;\n if (!content) {\n return undefined;\n }\n\n const updateIsMultiLine = () => {\n const lineHeight = Number.parseFloat(\n getComputedStyle(content).lineHeight,\n );\n if (!Number.isFinite(lineHeight) || lineHeight <= 0) {\n setIsMultiLine(false);\n return;\n }\n\n setIsMultiLine(content.getBoundingClientRect().height > lineHeight * 1.5);\n };\n\n updateIsMultiLine();\n\n const observer = new ResizeObserver(updateIsMultiLine);\n observer.observe(content);\n\n return () => observer.disconnect();\n }, [message]);\n\n return (\n <div\n className={cn(\n \"flex min-w-0 gap-2\",\n isMultiLine ? \"items-start\" : \"items-center\",\n )}\n >\n <CircleX\n aria-hidden\n className=\"h-4 w-4 shrink-0\"\n strokeWidth={2}\n style={{ color: OH_STATUS_ERROR_COLOR }}\n />\n <span\n ref={contentRef}\n className=\"min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]\"\n >\n {message}\n </span>\n </div>\n );\n}\n\nexport const ERROR_TOAST_OPTIONS: ToastOptions = {\n ...TOAST_OPTIONS,\n icon: null,\n style: ERROR_TOAST_STYLE,\n};\n\nexport const displayErrorToast = (error: string | null | undefined) => {\n let errorMessage = error || i18n.t(I18nKey.STATUS$ERROR);\n if (isCorsOrNetworkErrorMessage(errorMessage)) {\n errorMessage = i18n.t(I18nKey.ERROR$CORS_OR_NETWORK);\n } else if (isBackendRequestTimeoutMessage(errorMessage)) {\n errorMessage = i18n.t(I18nKey.ERROR$BACKEND_REQUEST_TIMEOUT);\n }\n const duration = calculateToastDuration(errorMessage, 4000);\n toast(<ErrorToastContent message={errorMessage} />, {\n ...ERROR_TOAST_OPTIONS,\n duration,\n });\n};\n\nexport const displaySuccessToast = (message: string) => {\n const duration = calculateToastDuration(message, 5000);\n toast.success(\n <span className=\"[word-break:break-word] [overflow-wrap:anywhere]\">\n {message}\n </span>,\n { ...TOAST_OPTIONS, duration },\n );\n};\n\nexport const displaySuccessToastWithLink = (\n message: string,\n linkLabel: string,\n href: string,\n) => {\n const duration = calculateToastDuration(`${message} ${linkLabel}`, 5000);\n toast.success(\n <span className=\"[word-break:break-word] [overflow-wrap:anywhere]\">\n {message}{\" \"}\n <a className=\"underline hover:no-underline\" href={href}>\n {linkLabel}\n </a>\n </span>,\n { ...TOAST_OPTIONS, duration },\n );\n};\n\n/**\n * Neutral, non-success notice — used when an action completed but the outcome\n * is qualified (e.g. a secret was saved but the active backend can't consume it\n * yet). Renders without the success checkmark so it doesn't read as \"all good\".\n */\nexport const displayWarningToast = (message: string) => {\n const duration = calculateToastDuration(message, 6000);\n toast(\n <span className=\"[word-break:break-word] [overflow-wrap:anywhere]\">\n {message}\n </span>,\n { ...TOAST_OPTIONS, icon: \"⚠️\", duration },\n );\n};\n"],"mappings":"kdAcA,IAAM,EAA6B,CACjC,WAAY,2BACZ,O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a,GACrD,EAAe,EAAA,QAAK,EAAE,EAAA,QAAQ,8BAA8B,EAE9D,IAAM,EAAW,EAAA,uBAAuB,EAAc,IAAK,CAC3D,EAAA,IAAM,EAAA,EAAA,KAAC,EAAD,CAAmB,QAAS,EAAgB,CAAA,CAAE,CAClD,GAAG,EACH,WACD,CAAC,EAGS,EAAuB,GAAoB,CACtD,IAAM,EAAW,EAAA,uBAAuB,EAAS,IAAK,CACtD,EAAA,GAAM,SACJ,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,4DACb,EACI,CAAA,CACP,CAAE,GAAG,EAAe,WAAU,CAC/B"}
|
|
@@ -8,6 +8,7 @@ export declare function ErrorToastContent({ message }: {
|
|
|
8
8
|
export declare const ERROR_TOAST_OPTIONS: ToastOptions;
|
|
9
9
|
export declare const displayErrorToast: (error: string | null | undefined) => void;
|
|
10
10
|
export declare const displaySuccessToast: (message: string) => void;
|
|
11
|
+
export declare const displaySuccessToastWithLink: (message: string, linkLabel: string, href: string) => void;
|
|
11
12
|
/**
|
|
12
13
|
* Neutral, non-success notice — used when an action completed but the outcome
|
|
13
14
|
* is qualified (e.g. a secret was saved but the active backend can't consume it
|