@openhands/agent-canvas 1.0.0-rc.1 → 1.0.0-rc.3
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 +2 -2
- package/README.windows.md +2 -2
- package/build/assets/{QueryClientProvider-w1cZWY41.js → QueryClientProvider-7oLZ1RtQ.js} +1 -1
- package/build/assets/{Trans-BJeYqz2A.js → Trans-rF21Jwln.js} +1 -1
- package/build/assets/acp-providers-C55k29rf.js +1 -0
- package/build/assets/active-backend-context-CQTk4wD8.js +1 -0
- package/build/assets/add-backend-modal-BdYxoUdL.js +1 -0
- package/build/assets/agent-server-client-options-Dvgeb3x4.js +1 -0
- package/build/assets/agent-server-compatibility-BANjmMTo.js +1 -0
- package/build/assets/agent-server-conversation-service.api-js3oYcdU.js +5 -0
- package/build/assets/{agent-settings-BXBaybB_.js → agent-settings-BNrffu3I.js} +1 -1
- package/build/assets/{alert-banner-NeUl1-PQ.js → alert-banner-BzU93oDh.js} +1 -1
- package/build/assets/{analytics-consent-form-modal-DxkThW4K.js → analytics-consent-form-modal-Ce-_Skcd.js} +1 -1
- package/build/assets/api-key-entry-screen-CGyS-Cna.js +1 -0
- package/build/assets/{app-settings-C-U6jONZ.js → app-settings-DmOs4oik.js} +1 -1
- package/build/assets/automation-detail-DLbCVJCw.js +1 -0
- package/build/assets/{automations-list-BLJzAd-p.js → automations-list-Ces5shz5.js} +1 -1
- package/build/assets/{back-nav-button-DgkK0Ka6.js → back-nav-button-BDM9vr_o.js} +1 -1
- package/build/assets/backend-form-modal-BUy-PzZN.js +1 -0
- package/build/assets/{backend-synced-settings-badge-BktJcGgH.js → backend-synced-settings-badge-1A63yxGs.js} +1 -1
- package/build/assets/{base-modal-DZCNv0A4.js → base-modal-Ba5WcNb6.js} +1 -1
- package/build/assets/{brand-button-LBFNic99.js → brand-button-BoiPxAGm.js} +1 -1
- package/build/assets/browser-B8bp1IqT.js +5 -0
- package/build/assets/browser-store-C5uQbbIi.js +1 -0
- package/build/assets/{browser-tab-be3QvXg9.js → browser-tab-CiBRWB4X.js} +1 -1
- package/build/assets/chat-send-button-qKFZuB9E.js +1 -0
- package/build/assets/check-BDAbW7je.js +1 -0
- package/build/assets/{checkmark-Rmpruj7q.js → checkmark-SEZPnU2I.js} +1 -1
- package/build/assets/{chevron-down-KhWYEjeW.js → chevron-down-DUxWwzTm.js} +1 -1
- package/build/assets/{chevron-left-small-6nyFCWVQ.js → chevron-left-small-x9_-ucHG.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-DquBwJ_6.js → circle-plus-check-toggle-CboDp7XB.js} +1 -1
- package/build/assets/{close-D_o3d8QM.js → close-CbOsKMRg.js} +1 -1
- package/build/assets/{code-tag-DhsjDB-v.js → code-tag-C0vR_IQH.js} +1 -1
- package/build/assets/{color-themes-0biOprdo.js → color-themes-B9n7pBQl.js} +1 -1
- package/build/assets/{combobox-caret-CO7eozIY.js → combobox-caret-DwMmhrrA.js} +1 -1
- package/build/assets/{command-store-UzKGSUC2.js → command-store-BUWgE-vZ.js} +1 -1
- package/build/assets/{condenser-settings-BulzYEuW.js → condenser-settings-FCBjvqSo.js} +1 -1
- package/build/assets/{confirmation-modal-CMAtd9R0.js → confirmation-modal-BPgWqWRI.js} +1 -1
- package/build/assets/{context-menu-list-item-D0swnhFt.js → context-menu-list-item-CHWCx1Mc.js} +1 -1
- package/build/assets/conversation-CT8AvxEH.js +1 -0
- package/build/assets/conversation-panel-DqDDs4WZ.js +1 -0
- package/build/assets/conversation-service.api-y_eB_43m.js +1 -0
- package/build/assets/conversation-state-store-DpgQaK_O.js +1 -0
- package/build/assets/conversation-store-CiYGBud3.js +6 -0
- package/build/assets/{conversation-tab-empty-state-DYjKsg_c.js → conversation-tab-empty-state-Ba5hbJhn.js} +1 -1
- package/build/assets/conversation-vNuLKgz6.js +19 -0
- package/build/assets/conversation-websocket-context-Bb4XBXoc.js +3 -0
- package/build/assets/{copy-BM0RpLez.js → copy-CAxUvM-U.js} +1 -1
- package/build/assets/{custom-toast-handlers-BohXx7uh.js → custom-toast-handlers-fgD4IYsu.js} +1 -1
- package/build/assets/{declaration-DaUdB2Wg.js → declaration-IA661TBv.js} +1 -1
- package/build/assets/{device-verify-DiEJqpJb.js → device-verify-BOQz2LJQ.js} +1 -1
- package/build/assets/{dist-xtCm0O6P.js → dist-B-SKiGDl.js} +1 -1
- package/build/assets/dist-CeJSjcAI.js +1 -0
- package/build/assets/{dropdown-classes-Vqz86I0R.js → dropdown-classes-lT1LUsbO.js} +1 -1
- package/build/assets/edit-automation-modal-C-oC5tis.js +1 -0
- package/build/assets/ellipsis-button-CiLx8dqc.js +1 -0
- package/build/assets/{entry.client-BvKgdCQ9.js → entry.client-Db3BpFL_.js} +2 -2
- package/build/assets/{enum-filter-dropdown-DdFgk0EM.js → enum-filter-dropdown-DFwoVtOw.js} +1 -1
- package/build/assets/{environment-switch-overlay-CuBuZOaa.js → environment-switch-overlay-Cow6h62p.js} +1 -1
- package/build/assets/{extensions-hub-Dayqvv0n.js → extensions-hub-BxZbAtjP.js} +1 -1
- package/build/assets/extensions-navigation-BIb-vAa2.js +1 -0
- package/build/assets/{file-DwHCkWZT.js → file-BJCSojij.js} +1 -1
- package/build/assets/files-tab-DpulQlIo.js +1 -0
- package/build/assets/files-tab-store-CZAEwv3x.js +1 -0
- package/build/assets/{folder-2h1hR1Qb.js → folder-wShAU0y7.js} +1 -1
- package/build/assets/git-control-bar-branch-button-D1uam-nI.js +27 -0
- package/build/assets/{globe-qFjFNG6J.js → globe-CQ_5xwpo.js} +1 -1
- package/build/assets/home-sJAFzI6v.js +1 -0
- package/build/assets/{i18n-zDndR1Ne.js → i18n-CyvU1o95.js} +1 -1
- package/build/assets/install-server-modal-BjEzlLF5.js +1 -0
- package/build/assets/{launch-I00QV8YT.js → launch-DgtB1JTX.js} +1 -1
- package/build/assets/{lesson-plan-C18uB_56.js → lesson-plan-B607buca.js} +1 -1
- package/build/assets/{link-external-DtcdPFbw.js → link-external-DCsHkAj4.js} +1 -1
- package/build/assets/llm-client-BnqeDPua.js +1 -0
- package/build/assets/llm-settings-B8kPJ0Of.js +1 -0
- package/build/assets/llm-settings-CjUpPsvA.js +1 -0
- package/build/assets/{loading-spinner-DNwR4--Z.js → loading-spinner-CFuA0UNt.js} +1 -1
- package/build/assets/manage-backends-modal-CTA-2x4F.js +1 -0
- package/build/assets/manifest-d3e8504d.js +1 -0
- package/build/assets/{markdown-renderer-D6B-u2nM.js → markdown-renderer-oOUs3tw5.js} +1 -1
- package/build/assets/mcp-client-xEdbDxOL.js +1 -0
- package/build/assets/mcp-kJYdM8aJ.js +9 -0
- package/build/assets/messages-BFJXB6MW.js +36 -0
- package/build/assets/{modal-backdrop-BDqI1zBV.js → modal-backdrop-B1si6TUd.js} +1 -1
- package/build/assets/{modal-body-CCLCqX1J.js → modal-body-2Po2nl1e.js} +1 -1
- package/build/assets/{modal-classes-DwTdT3IK.js → modal-classes-9XTtWCtF.js} +1 -1
- package/build/assets/{modal-close-button-gQgKqUf-.js → modal-close-button-DY-rVmld.js} +1 -1
- package/build/assets/model-selector-z_QOzaRV.js +1 -0
- package/build/assets/{navigation-context-aNGUUtdq.js → navigation-context-CszaA-CJ.js} +1 -1
- package/build/assets/{navigation-link-CYkF2y3K.js → navigation-link-DXg4oo29.js} +1 -1
- package/build/assets/onboarding-CZ_7nd-M.js +1 -0
- package/build/assets/{openhands-logo-CHmtDV-t.js → openhands-logo-B-IDE1ER.js} +1 -1
- package/build/assets/{option-service.api-CGNANEcT.js → option-service.api-DHOGfYKh.js} +1 -1
- package/build/assets/organization-service.api-D79cdERN.js +1 -0
- package/build/assets/path-utils-0KWEiRs9.js +1 -0
- package/build/assets/{pencil-Dr0b2jL1.js → pencil-COslZGUC.js} +1 -1
- package/build/assets/{plan-components--aLlpASH.js → plan-components-DsiDjcDi.js} +1 -1
- package/build/assets/{planner-tab-B-5EeCEm.js → planner-tab-CNmJiZ22.js} +1 -1
- package/build/assets/plus-D8aJZRkD.js +1 -0
- package/build/assets/profiles-client-CesbAK-7.js +1 -0
- package/build/assets/{providers-DknP6O2g.js → providers-Bpq3xFRA.js} +1 -1
- package/build/assets/proxy-wIasY2Po.js +1 -0
- package/build/assets/{query-client-config-CWWGQWvw.js → query-client-config-CITeuHD7.js} +1 -1
- package/build/assets/{recommended-automations-launcher-BIul0osB.js → recommended-automations-launcher-B1kfmFTQ.js} +8 -10
- package/build/assets/root-CIZ7Rv1X.js +2 -0
- package/build/assets/root-layout-B5ijp9At.js +2 -0
- package/build/assets/{sdk-section-page-VmtJWH3A.js → sdk-section-page-DTyvCc52.js} +1 -1
- package/build/assets/{sdk-settings-schema-DFievvEK.js → sdk-settings-schema-B0KrqqPX.js} +1 -1
- package/build/assets/{search-BeVRXvX7.js → search-BqXT2Ied.js} +1 -1
- package/build/assets/secrets-service-rJqZtDmI.js +1 -0
- package/build/assets/{secrets-settings-BLMvCkKm.js → secrets-settings-BQNSDLKS.js} +1 -1
- package/build/assets/server-client-Cz8PyIbN.js +1 -0
- package/build/assets/settings-BUlJrO_h.js +1 -0
- package/build/assets/settings-client-BUlG0Gzq.js +1 -0
- package/build/assets/{settings-dropdown-input-DA_pzHWE.js → settings-dropdown-input-BUk4m23x.js} +1 -1
- package/build/assets/{settings-gear-aNebYlCy.js → settings-gear-DFmoMp-6.js} +1 -1
- package/build/assets/{settings-index-CycvkOoq.js → settings-index-DE91Eahc.js} +1 -1
- package/build/assets/{settings-input-8y5p4kze.js → settings-input-DsoZj8Dm.js} +1 -1
- package/build/assets/{settings-list-classes-Qk7zl0Wu.js → settings-list-classes-D8VAVZmi.js} +1 -1
- package/build/assets/{settings-modal-DdntdOGP.js → settings-modal-CCaPYVqW.js} +1 -1
- package/build/assets/{settings-section-header-context-B77tsYlx.js → settings-section-header-context-D61smD-W.js} +1 -1
- package/build/assets/settings-service.api-4u2RKC8k.js +1 -0
- package/build/assets/{settings-switch-ba4DuiNO.js → settings-switch-BQiAS9ga.js} +1 -1
- package/build/assets/{settings-utils-BxzHqLmZ.js → settings-utils-chxTa1vn.js} +1 -1
- package/build/assets/shared-conversation-sBPLAawM.js +1 -0
- package/build/assets/{sidebar-mobile-menu-toggle-C0mmabKj.js → sidebar-mobile-menu-toggle-BDXWzhyB.js} +1 -1
- package/build/assets/{sidebar-nav-link-BsYdDFfb.js → sidebar-nav-link-Bhlzlhp8.js} +1 -1
- package/build/assets/{skill-card-pill-row-BhUlGcYB.js → skill-card-pill-row-Bg5joQf6.js} +1 -1
- package/build/assets/{skills-TYjOUQ2d.js → skills-BDOWVle-.js} +1 -1
- package/build/assets/skills-client-Cr9F5306.js +1 -0
- package/build/assets/{skills-plugins-D0pdqgKa.js → skills-plugins-fihjo1KZ.js} +1 -1
- package/build/assets/{skills-settings-VqKTkmVl.js → skills-settings-NQnuMwZP.js} +1 -1
- package/build/assets/{styled-tooltip-TCp7svY3.js → styled-tooltip-GXy1qxsO.js} +1 -1
- package/build/assets/suspense-C9MBE_9N.js +1 -0
- package/build/assets/{switch-skeleton-cKrdaYGj.js → switch-skeleton-QpdcdxRP.js} +1 -1
- package/build/assets/{task-list-tab-BiizRsY3.js → task-list-tab-Hl9BuVfq.js} +1 -1
- package/build/assets/telemetry-j9SLrtY7.js +2 -0
- package/build/assets/{terminal-BSYITdM0.js → terminal-BUww3Ssl.js} +1 -1
- package/build/assets/{terminal-CpgZx6go.js → terminal-DRwe8--D.js} +1 -1
- package/build/assets/{toggle-switch-CUgOZqZu.js → toggle-switch-DDr-DnEc.js} +1 -1
- package/build/assets/{trash-2-CbVljPko.js → trash-2-DAKXV2Wm.js} +1 -1
- package/build/assets/{typography-Bvw0IxaN.js → typography-Cx7uw7z3.js} +1 -1
- package/build/assets/{u-check-circle-u9QiS4Fr.js → u-check-circle-CftRwky1.js} +1 -1
- package/build/assets/{u-check-circle-half-DjpjzWu3.js → u-check-circle-half-sGVk0BtL.js} +1 -1
- package/build/assets/{u-circuit-DlBlOwx9.js → u-circuit-Cg9tH5qb.js} +1 -1
- package/build/assets/{u-edit-BIYzjs3v.js → u-edit-foF02hwH.js} +1 -1
- package/build/assets/{use-active-conversation-q1wT8LI5.js → use-active-conversation-DJGoI9Mc.js} +1 -1
- package/build/assets/use-agent-settings-schema-DtusObuC.js +1 -0
- package/build/assets/{use-agent-state-CCHlVqvY.js → use-agent-state-BXgWhFh6.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-BAKf91Zx.js → use-cloud-current-user-id-e1Pk7NxQ.js} +1 -1
- package/build/assets/use-config-DSzkljTq.js +1 -0
- package/build/assets/use-create-conversation-CzvaVA5A.js +1 -0
- package/build/assets/use-event-store-DSpvASbC.js +1 -0
- package/build/assets/use-get-secrets-DiLgP147.js +1 -0
- package/build/assets/use-handle-plan-click-CUZwmKIk.js +1 -0
- package/build/assets/use-is-authed-fNsj-Adj.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-3ydwpi_M.js → use-launch-skill-in-chat-ClRJlIx7.js} +1 -1
- package/build/assets/use-llm-profiles-CyNVoVqm.js +1 -0
- package/build/assets/use-runtime-is-ready-CWkGQFsb.js +1 -0
- package/build/assets/{use-save-settings-rE9aA29R.js → use-save-settings-CP23emUY.js} +1 -1
- package/build/assets/use-settings-0qFqC-r6.js +1 -0
- package/build/assets/{use-settings-nav-items-C7MOWj09.js → use-settings-nav-items-C6YxUn4h.js} +1 -1
- package/build/assets/use-skills-BWHATXK-.js +1 -0
- package/build/assets/{use-task-list-YMkSzdDv.js → use-task-list-JPudBRv3.js} +1 -1
- package/build/assets/{use-tracking-DQYdZpxi.js → use-tracking-CjLZgh8X.js} +1 -1
- package/build/assets/use-unified-vscode-url-DSn2tT08.js +1 -0
- package/build/assets/use-user-conversation-CQ5IwnZk.js +1 -0
- package/build/assets/{useMutation-DDo48A8t.js → useMutation-7hG0GuPx.js} +1 -1
- package/build/assets/useQuery-JDs8UaWj.js +1 -0
- package/build/assets/{useTranslation-CEcjrme-.js → useTranslation-CbJtty1g.js} +1 -1
- package/build/assets/{utils-CdgBzLA7.js → utils-CVcuFUYj.js} +1 -1
- package/build/assets/{vendor~browser-DWk6fNtJ.js → vendor~browser-Dwwc84Zf.js} +1 -1
- package/build/assets/{vendor~browser-tab-NZdVoI2Z.js → vendor~browser-tab-Bhohe29F.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation-gp03cWZW.js → vendor~conversation-panel~conversation-DYHL7QoY.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation~index-BZ5C6Xpz.js → vendor~conversation-panel~conversation~index-Be58Romv.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js} +1 -1
- package/build/assets/{vendor~files-tab-Buz36Y-q.js → vendor~files-tab-B447_Zns.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation-DG0H5SkJ.js → vendor~home~conversation-panel~conversation-DZ-F7J6T.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CXivI4Ym.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B4oeCCli.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9Il_wz8U.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CQQAW8hY.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-1pTajrpX.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DFsI4CLy.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Ceeqkj0k.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DcvlNgbn.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B7I1ZxCx.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-ojk_J4bB.js} +1 -1
- package/build/assets/{vendor~launch-DXL78kBf.js → vendor~launch-BdXJCmwc.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-CfAc3nMS.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DkwcKRtv.js → vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DSqEbr0N.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Dr8Ly0at.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BC9XTECT.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-DveauQfg.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-D0XUSHNN.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-zdl_Rltz.js} +2 -2
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-BaCzvZac.js +48 -0
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~automations-list-cNHi83v_.js → vendor~root-layout~home~mcp~automations-list-CtdIEhjQ.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~automations-list-BnIlGhjl.js → vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BGWUbqUq.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-CbuXadI-.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BuCSnjsW.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js} +2 -2
- package/build/assets/{verification-settings-CIqtxWat.js → verification-settings-Cm02KmeI.js} +1 -1
- package/build/assets/{vscode-tab-DEt72yJX.js → vscode-tab-AF70Yke0.js} +1 -1
- package/build/assets/{waiting-for-runtime-message-DSjJfeoj.js → waiting-for-runtime-message-Bg27u9JB.js} +1 -1
- package/build/assets/x-8AbJWTbX.js +1 -0
- package/build/assets/{x-mark-DsJ9tDD0.js → x-mark-Cn-YJVbN.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +2 -1
- package/build/locales/ca/openhands.json +2 -1
- package/build/locales/de/openhands.json +2 -1
- package/build/locales/en/openhands.json +2 -1
- package/build/locales/es/openhands.json +2 -1
- package/build/locales/fr/openhands.json +2 -1
- package/build/locales/it/openhands.json +2 -1
- package/build/locales/ja/openhands.json +2 -1
- package/build/locales/ko-KR/openhands.json +2 -1
- package/build/locales/no/openhands.json +2 -1
- package/build/locales/pt/openhands.json +2 -1
- package/build/locales/tr/openhands.json +2 -1
- package/build/locales/uk/openhands.json +2 -1
- package/build/locales/zh-CN/openhands.json +2 -1
- package/build/locales/zh-TW/openhands.json +2 -1
- package/config/defaults.json +1 -1
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.js +94 -86
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/app-preferences-store.cjs.map +1 -1
- package/dist/api/app-preferences-store.d.ts +6 -2
- package/dist/api/app-preferences-store.js.map +1 -1
- package/dist/api/cloud/proxy.cjs +1 -1
- package/dist/api/cloud/proxy.cjs.map +1 -1
- package/dist/api/cloud/proxy.d.ts +18 -6
- package/dist/api/cloud/proxy.js +1 -1
- package/dist/api/cloud/proxy.js.map +1 -1
- package/dist/api/conversation-metadata-store.cjs.map +1 -1
- package/dist/api/conversation-metadata-store.d.ts +8 -0
- package/dist/api/conversation-metadata-store.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +9 -0
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +9 -9
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message.cjs +1 -1
- package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-message.js +80 -71
- package/dist/components/conversation-events/chat/event-message.js.map +1 -1
- package/dist/components/features/automations/recommended-automations-launcher.d.ts +7 -1
- package/dist/components/features/chat/switch-profile-button.cjs +1 -1
- package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
- package/dist/components/features/chat/switch-profile-button.js +5 -5
- package/dist/components/features/chat/switch-profile-button.js.map +1 -1
- package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
- package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
- package/dist/components/features/conversation-panel/skills-modal.js +34 -37
- package/dist/components/features/conversation-panel/skills-modal.js.map +1 -1
- package/dist/components/features/home/workspace-selection-form.d.ts +1 -0
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +8 -0
- package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.js +6 -6
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
- package/dist/components/features/skills/extensions-navigation.d.ts +1 -9
- package/dist/components/features/skills/extensions-navigation.js +31 -50
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.js +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +26 -14
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.js +26 -15
- package/dist/hooks/mutation/use-switch-llm-profile-and-log.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 +1 -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 +32 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +10 -10
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/locales/ar/openhands.json +2 -1
- package/dist/locales/ca/openhands.json +2 -1
- package/dist/locales/de/openhands.json +2 -1
- package/dist/locales/en/openhands.json +2 -1
- package/dist/locales/es/openhands.json +2 -1
- package/dist/locales/fr/openhands.json +2 -1
- package/dist/locales/it/openhands.json +2 -1
- package/dist/locales/ja/openhands.json +2 -1
- package/dist/locales/ko-KR/openhands.json +2 -1
- package/dist/locales/no/openhands.json +2 -1
- package/dist/locales/pt/openhands.json +2 -1
- package/dist/locales/tr/openhands.json +2 -1
- package/dist/locales/uk/openhands.json +2 -1
- package/dist/locales/zh-CN/openhands.json +2 -1
- package/dist/locales/zh-TW/openhands.json +2 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js +10 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp.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/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +21 -21
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.d.ts +0 -1
- package/dist/routes/mcp.js +0 -1
- package/dist/routes/mcp.js.map +1 -1
- package/dist/types/agent-server/core/events/index.d.ts +1 -0
- package/dist/types/agent-server/core/events/streaming-delta-event.d.ts +7 -0
- package/dist/types/agent-server/core/openhands-event.d.ts +2 -2
- package/dist/types/agent-server/type-guards.cjs +1 -1
- package/dist/types/agent-server/type-guards.cjs.map +1 -1
- package/dist/types/agent-server/type-guards.d.ts +2 -0
- package/dist/types/agent-server/type-guards.js +3 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/utils/handle-event-for-ui.cjs +1 -1
- package/dist/utils/handle-event-for-ui.cjs.map +1 -1
- package/dist/utils/handle-event-for-ui.js +69 -13
- package/dist/utils/handle-event-for-ui.js.map +1 -1
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.js +27 -19
- package/dist/utils/mcp-config.js.map +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
- package/dist/utils/mcp-marketplace-utils.js +38 -18
- package/dist/utils/mcp-marketplace-utils.js.map +1 -1
- package/dist/utils/normalize-display-model.cjs +1 -1
- package/dist/utils/normalize-display-model.cjs.map +1 -1
- package/dist/utils/normalize-display-model.js +8 -7
- package/dist/utils/normalize-display-model.js.map +1 -1
- package/dist/utils/openhands-llm.cjs +1 -1
- package/dist/utils/openhands-llm.cjs.map +1 -1
- package/dist/utils/openhands-llm.d.ts +13 -0
- package/dist/utils/openhands-llm.js +9 -3
- package/dist/utils/openhands-llm.js.map +1 -1
- package/package.json +2 -2
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +71 -120
- package/scripts/dev-with-automation.mjs +58 -4
- package/scripts/runtime-services-info.mjs +199 -0
- package/scripts/static-server.mjs +42 -4
- package/build/assets/acp-providers-DJr8DlNG.js +0 -1
- package/build/assets/acp-route-guard-A__sWgbc.js +0 -1
- package/build/assets/active-backend-context-I2w666XY.js +0 -1
- package/build/assets/add-backend-modal-BDBDBXsJ.js +0 -1
- package/build/assets/agent-server-client-options-9agOSarV.js +0 -1
- package/build/assets/agent-server-compatibility-B7QStIcH.js +0 -1
- package/build/assets/agent-server-conversation-service.api-Cagoqq1V.js +0 -5
- package/build/assets/api-key-entry-screen-ByXA4hXH.js +0 -1
- package/build/assets/automation-detail-Dbmgt974.js +0 -1
- package/build/assets/backend-form-modal-CeB983Sj.js +0 -1
- package/build/assets/browser-D08Sp3ZY.js +0 -5
- package/build/assets/browser-store-JRrcGdlk.js +0 -1
- package/build/assets/chat-send-button-5qz0zj6R.js +0 -1
- package/build/assets/check-CZhEL6rP.js +0 -1
- package/build/assets/conversation-BrjF2-Ky.js +0 -1
- package/build/assets/conversation-HgR_TTPE.js +0 -19
- package/build/assets/conversation-panel-BlRcO5AC.js +0 -1
- package/build/assets/conversation-service.api-B_Pdmwsa.js +0 -1
- package/build/assets/conversation-state-store-D-w0uurj.js +0 -1
- package/build/assets/conversation-store-CC-isCnP.js +0 -1
- package/build/assets/conversation-websocket-context-G95yfL81.js +0 -3
- package/build/assets/dist-Bl-1K5Tv.js +0 -1
- package/build/assets/edit-automation-modal-CNZgSSiH.js +0 -1
- package/build/assets/extensions-navigation-yFLAU06N.js +0 -1
- package/build/assets/files-tab-CMredyYX.js +0 -1
- package/build/assets/files-tab-store-DLU28g8C.js +0 -1
- package/build/assets/git-control-bar-branch-button-D8blTNXh.js +0 -27
- package/build/assets/home-CWw845Rz.js +0 -1
- package/build/assets/install-server-modal-D8Q0xZcN.js +0 -1
- package/build/assets/llm-client-BqyLKgUN.js +0 -1
- package/build/assets/llm-settings-CAnFYAEG.js +0 -1
- package/build/assets/llm-settings-DotqpmCF.js +0 -1
- package/build/assets/manage-backends-modal-Ceo_SOcf.js +0 -1
- package/build/assets/manifest-61ec2d68.js +0 -1
- package/build/assets/mcp-EvrLVTla.js +0 -9
- package/build/assets/messages-Bz9TWjlh.js +0 -36
- package/build/assets/middleware-CfatjPYZ.js +0 -6
- package/build/assets/model-selector-CZOi4V7r.js +0 -1
- package/build/assets/onboarding-CPCKYvFh.js +0 -1
- package/build/assets/organization-service.api-Dn74hBTH.js +0 -1
- package/build/assets/path-utils-BjxzIGLp.js +0 -1
- package/build/assets/plus-DT-M0FA1.js +0 -1
- package/build/assets/profiles-client-BrqNmaDV.js +0 -1
- package/build/assets/proxy-sRh0WKI7.js +0 -1
- package/build/assets/root-CklXEh3W.js +0 -2
- package/build/assets/root-layout-BCA_X8XL.js +0 -2
- package/build/assets/secrets-service-DVtlLWY8.js +0 -1
- package/build/assets/server-client-DYv_GHPl.js +0 -1
- package/build/assets/settings-CXvJUx_j.js +0 -1
- package/build/assets/settings-service.api-DxIEtvx6.js +0 -1
- package/build/assets/shared-conversation-x41nZQi7.js +0 -1
- package/build/assets/sidebar-store-DnQAJAE5.js +0 -1
- package/build/assets/telemetry-fQFd-8V3.js +0 -2
- package/build/assets/use-agent-settings-schema-Yxf7KGyG.js +0 -1
- package/build/assets/use-config-DwfigQ_Y.js +0 -1
- package/build/assets/use-create-conversation-BEzddjXn.js +0 -1
- package/build/assets/use-event-store-Cxqc45Sw.js +0 -1
- package/build/assets/use-get-secrets-BlO1BfUo.js +0 -1
- package/build/assets/use-handle-plan-click-Bfl0zIBr.js +0 -1
- package/build/assets/use-is-authed-hHndEep7.js +0 -1
- package/build/assets/use-llm-profiles-E-jjZMZw.js +0 -1
- package/build/assets/use-runtime-is-ready-DBWzvAmc.js +0 -1
- package/build/assets/use-settings-BPTbE7lg.js +0 -1
- package/build/assets/use-skills-QhoaIYGF.js +0 -1
- package/build/assets/use-unified-vscode-url-DFtNIC1Q.js +0 -1
- package/build/assets/use-user-conversation-BRAseenw.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js +0 -48
- package/build/assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js +0 -1
- package/build/assets/x-JOBEVLW0.js +0 -1
- package/dist/components/features/conversation-panel/skills-runtime-waiting-state.cjs +0 -2
- package/dist/components/features/conversation-panel/skills-runtime-waiting-state.cjs.map +0 -1
- package/dist/components/features/conversation-panel/skills-runtime-waiting-state.d.ts +0 -1
- package/dist/components/features/conversation-panel/skills-runtime-waiting-state.js +0 -21
- package/dist/components/features/conversation-panel/skills-runtime-waiting-state.js.map +0 -1
- package/dist/utils/acp-route-guard.cjs +0 -1
- package/dist/utils/acp-route-guard.d.ts +0 -26
- package/dist/utils/acp-route-guard.js +0 -4
- /package/build/assets/{agent-server-ui-style-scope-BwIZYdC1.js → agent-server-ui-style-scope-Bhc5vpWO.js} +0 -0
- /package/build/assets/{automation-DJ_3GeXD.js → automation-BzmydDjr.js} +0 -0
- /package/build/assets/{common-DqjLSBOt.js → common-Cfviy7yT.js} +0 -0
- /package/build/assets/{context-CEQZwATj.js → context-BBqptpXX.js} +0 -0
- /package/build/assets/{conversation-local-storage-YmOVXxxW.js → conversation-local-storage-D5Tre_GA.js} +0 -0
- /package/build/assets/{createLucideIcon-Ddu8jDOQ.js → createLucideIcon-C9OEnwvX.js} +0 -0
- /package/build/assets/{environment-switch-store-CiurvTtK.js → environment-switch-store-BpKxp6Xq.js} +0 -0
- /package/build/assets/{git-status-mapper-DnL9OC8_.js → git-status-mapper-C3rfzUex.js} +0 -0
- /package/build/assets/{handle-capture-consent-3XrjZ8wi.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
- /package/build/assets/{health-store-B5f0S2FY.js → health-store-d-d2ssv4.js} +0 -0
- /package/build/assets/{iconBase-BVhFI-0E.js → iconBase-1A_WRQ4E.js} +0 -0
- /package/build/assets/{map-provider-C3Z5Dx2J.js → map-provider-XSFHmdDs.js} +0 -0
- /package/build/assets/{objectWithoutPropertiesLoose-DSQKyRhw.js → objectWithoutPropertiesLoose-B-IA9dU9.js} +0 -0
- /package/build/assets/{query-keys-tAsQcc_9.js → query-keys-CQaji0wJ.js} +0 -0
- /package/build/assets/{react-Dy05vyj5.js → react-CuAHzoGi.js} +0 -0
- /package/build/assets/{retrieve-axios-error-message-BY-yIkIq.js → retrieve-axios-error-message-DbnSBc_1.js} +0 -0
- /package/build/assets/{sdk-settings-field-metadata-C6KMD-jZ.js → sdk-settings-field-metadata-CETNItbo.js} +0 -0
- /package/build/assets/{settings-DGY6n4J2.js → settings-BgL2HUsU.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-DNg2vKSM.js → settings-like-page-layout-classes-DENKlZpD.js} +0 -0
- /package/build/assets/{use-breakpoint-DpxHDmuH.js → use-breakpoint-Dt2knceC.js} +0 -0
- /package/build/assets/{use-click-outside-element-DhxCUyWl.js → use-click-outside-element-Bu2A3s59.js} +0 -0
- /package/build/assets/{v4-khGvL7i2.js → v4-BygpdDmc.js} +0 -0
- /package/build/assets/{vendor~browser-BDNLFng6.js → vendor~browser-BYEwwJqV.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-D_hRW_zc.js → vendor~conversation-panel~conversation~alert-banner-BnHToS5O.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-OFpe9fX_.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BPuuVEqr.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-87v-LliW.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dr3Ow7Ms.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D8cqyq4k.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-B1TKKuuH.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DspdqGPW.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js} +0 -0
- /package/build/assets/{vendor~terminal-0ObOedYm.js → vendor~terminal-aeP3PnKf.js} +0 -0
- /package/build/assets/{vscode-url-helper-BMq8JBhB.js → vscode-url-helper-DOCkV_-G.js} +0 -0
|
@@ -119,6 +119,38 @@ function logError(message) {
|
|
|
119
119
|
console.error(`${c.red}✗${c.reset} ${message}`);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Parse one JSON log line produced by the SDK's JsonFormatter and return a
|
|
124
|
+
* single-line human-readable string + an appropriate ANSI color.
|
|
125
|
+
*
|
|
126
|
+
* Returns null for non-JSON lines so callers can fall back to the raw text.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} rawLine
|
|
129
|
+
* @returns {{ text: string; color: string } | null}
|
|
130
|
+
*/
|
|
131
|
+
function parseAgentServerLogLine(rawLine) {
|
|
132
|
+
try {
|
|
133
|
+
const obj = JSON.parse(rawLine);
|
|
134
|
+
if (!obj.levelname || obj.message === undefined) return null;
|
|
135
|
+
const level = obj.levelname.padEnd(8);
|
|
136
|
+
const location =
|
|
137
|
+
obj.filename && obj.lineno ? ` ${obj.filename}:${obj.lineno}` : "";
|
|
138
|
+
const text = `${level} ${obj.message}${location}`;
|
|
139
|
+
const lvl = obj.levelname;
|
|
140
|
+
const color =
|
|
141
|
+
lvl === "DEBUG"
|
|
142
|
+
? c.dim
|
|
143
|
+
: lvl === "WARNING"
|
|
144
|
+
? c.yellow
|
|
145
|
+
: lvl === "ERROR" || lvl === "CRITICAL"
|
|
146
|
+
? c.red
|
|
147
|
+
: c.blue;
|
|
148
|
+
return { text, color };
|
|
149
|
+
} catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
122
154
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
123
155
|
// Configuration
|
|
124
156
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -521,6 +553,7 @@ function spawnService(name, command, args, options = {}) {
|
|
|
521
553
|
);
|
|
522
554
|
|
|
523
555
|
const color = options.color || c.reset;
|
|
556
|
+
const parseLogLine = options.parseLogLine;
|
|
524
557
|
|
|
525
558
|
proc.stdout.on("data", (data) => {
|
|
526
559
|
data
|
|
@@ -528,7 +561,8 @@ function spawnService(name, command, args, options = {}) {
|
|
|
528
561
|
.split("\n")
|
|
529
562
|
.filter(Boolean)
|
|
530
563
|
.forEach((line) => {
|
|
531
|
-
|
|
564
|
+
const parsed = parseLogLine ? parseLogLine(line.trim()) : null;
|
|
565
|
+
logService(name, parsed ? parsed.text : line.trim(), parsed ? parsed.color : color);
|
|
532
566
|
});
|
|
533
567
|
});
|
|
534
568
|
|
|
@@ -538,7 +572,8 @@ function spawnService(name, command, args, options = {}) {
|
|
|
538
572
|
.split("\n")
|
|
539
573
|
.filter(Boolean)
|
|
540
574
|
.forEach((line) => {
|
|
541
|
-
|
|
575
|
+
const parsed = parseLogLine ? parseLogLine(line.trim()) : null;
|
|
576
|
+
logService(name, parsed ? parsed.text : line.trim(), parsed ? parsed.color : c.yellow);
|
|
542
577
|
});
|
|
543
578
|
});
|
|
544
579
|
|
|
@@ -699,6 +734,11 @@ function startAgentServer(config) {
|
|
|
699
734
|
// Ensure the agent-server uses the resolved key from config. This is
|
|
700
735
|
// LOCAL_BACKEND_API_KEY when set, or the auto-generated persisted key.
|
|
701
736
|
OH_SESSION_API_KEYS_0: config.sessionApiKey,
|
|
737
|
+
// Emit structured JSON log lines instead of Rich-formatted output.
|
|
738
|
+
// Rich wraps long messages across multiple lines and prepends its own
|
|
739
|
+
// timestamp; LOG_JSON=true produces one JSON object per record which
|
|
740
|
+
// parseAgentServerLogLine re-formats into a clean single-line entry.
|
|
741
|
+
LOG_JSON: "true",
|
|
702
742
|
};
|
|
703
743
|
|
|
704
744
|
spawnService(
|
|
@@ -715,6 +755,7 @@ function startAgentServer(config) {
|
|
|
715
755
|
cwd: safeConfig.workspacesPath,
|
|
716
756
|
env: agentServerEnv,
|
|
717
757
|
color: c.blue,
|
|
758
|
+
parseLogLine: parseAgentServerLogLine,
|
|
718
759
|
},
|
|
719
760
|
);
|
|
720
761
|
}
|
|
@@ -796,8 +837,10 @@ function startAutomationBackend(config) {
|
|
|
796
837
|
join(config.stateDir, "workspaces"),
|
|
797
838
|
// Session API key for self-hosted auth — shared with agent-server via X-Session-API-Key header
|
|
798
839
|
AUTOMATION_LOCAL_API_KEY: config.sessionApiKey,
|
|
799
|
-
// CORS: allow localhost origins for dev
|
|
800
|
-
AUTOMATION_CORS_ORIGINS:
|
|
840
|
+
// CORS: allow localhost origins for dev, unless explicitly overridden.
|
|
841
|
+
AUTOMATION_CORS_ORIGINS:
|
|
842
|
+
process.env.AUTOMATION_CORS_ORIGINS ||
|
|
843
|
+
`http://localhost:${config.ingressPort},http://127.0.0.1:${config.ingressPort},http://localhost:3001,http://127.0.0.1:3001`,
|
|
801
844
|
FILE_STORE: "local",
|
|
802
845
|
LOCAL_STORAGE_PATH: join(config.stateDir, "storage"),
|
|
803
846
|
OPENHANDS_SUPPRESS_BANNER: "1",
|
|
@@ -1269,6 +1312,13 @@ function startStaticFrontend(config, staticDir) {
|
|
|
1269
1312
|
logService("static", `Starting on port ${config.vitePort}...`, c.magenta);
|
|
1270
1313
|
logService("static", `Serving from: ${staticDir}`, c.dim);
|
|
1271
1314
|
|
|
1315
|
+
// Build the runtime-services info JSON so the pre-built frontend can
|
|
1316
|
+
// populate the agent's <RUNTIME_SERVICES> system-prompt block without
|
|
1317
|
+
// VITE_RUNTIME_SERVICES_INFO baked in at build time.
|
|
1318
|
+
const runtimeServicesInfo = config.launchAgentServer
|
|
1319
|
+
? JSON.stringify(buildAutomationRuntimeServicesInfo(config))
|
|
1320
|
+
: null;
|
|
1321
|
+
|
|
1272
1322
|
const staticServerScript = join(projectRoot, "scripts", "static-server.mjs");
|
|
1273
1323
|
spawnService(
|
|
1274
1324
|
"static",
|
|
@@ -1288,6 +1338,10 @@ function startStaticFrontend(config, staticDir) {
|
|
|
1288
1338
|
...(config.launchAgentServer && config.isPublic
|
|
1289
1339
|
? ["--auth-required"]
|
|
1290
1340
|
: []),
|
|
1341
|
+
// Inject runtime-services info so the agent knows what's reachable.
|
|
1342
|
+
...(runtimeServicesInfo
|
|
1343
|
+
? ["--runtime-services-info", runtimeServicesInfo]
|
|
1344
|
+
: []),
|
|
1291
1345
|
// Proxy routes only to services that this launch mode started.
|
|
1292
1346
|
...buildRouteArgs(getLocalServiceRoutes(config)),
|
|
1293
1347
|
// Reject known API prefixes that have no backend — returns 503
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the `<RUNTIME_SERVICES>` block.
|
|
3
|
+
*
|
|
4
|
+
* Builds a structured description of the services that are reachable from
|
|
5
|
+
* inside the agent's sandbox. The frontend forwards it (verbatim, as a JSON
|
|
6
|
+
* string) and renders it into the system prompt via
|
|
7
|
+
* `AgentContext.system_message_suffix`, so the agent sees a
|
|
8
|
+
* `<RUNTIME_SERVICES>` block listing what's available without having to probe.
|
|
9
|
+
*
|
|
10
|
+
* Two callers share this one definition:
|
|
11
|
+
* - the dev launchers (scripts/dev-*.mjs), which know the stack as a set of
|
|
12
|
+
* ports and bake the result into `VITE_RUNTIME_SERVICES_INFO` at build time;
|
|
13
|
+
* - docker/entrypoint.sh, which runs this file as a CLI (see the bottom of
|
|
14
|
+
* this module) because in a container the URLs are *runtime* config — the
|
|
15
|
+
* ports and base URLs are overridable at `docker run` and therefore cannot
|
|
16
|
+
* be baked into the image at build time. The JSON it prints is injected
|
|
17
|
+
* into index.html at serve time by scripts/static-server.mjs.
|
|
18
|
+
*
|
|
19
|
+
* URLs are written from the *agent's* point of view (i.e. as the agent should
|
|
20
|
+
* curl/fetch them from inside its sandbox), which is deliberately not the
|
|
21
|
+
* browser's point of view.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import process from "node:process";
|
|
25
|
+
import { pathToFileURL } from "node:url";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param {object} options
|
|
29
|
+
* @param {string} [options.mode] - Human-readable mode label (e.g. "dev:safe").
|
|
30
|
+
* @param {string} [options.agentHostAlias="localhost"] - Hostname the agent
|
|
31
|
+
* uses to reach host-side services (ingress, frontend, port-derived
|
|
32
|
+
* automation). Also surfaced as `agent_host_alias`.
|
|
33
|
+
* @param {number} [options.agentServerPort] - Port the agent-server listens on.
|
|
34
|
+
* Used to derive the agent_server URL when `agentServerUrl` is not given.
|
|
35
|
+
* @param {string} [options.agentServerUrl] - Explicit agent_server URL, from
|
|
36
|
+
* the agent's POV. Takes precedence over `agentServerPort`; used by the
|
|
37
|
+
* Docker image, which serves over `127.0.0.1` to avoid IPv6 loopback issues
|
|
38
|
+
* and honors an overridable `AGENT_SERVER_URL`. One of `agentServerUrl` /
|
|
39
|
+
* `agentServerPort` is required (else the URL would be `:undefined`).
|
|
40
|
+
* @param {number} [options.ingressPort] - Ingress port (omit if no ingress).
|
|
41
|
+
* @param {number} [options.frontendPort] - Frontend port (Vite dev server
|
|
42
|
+
* or static-file server). Omit if no frontend is exposed.
|
|
43
|
+
* @param {number} [options.vitePort] - Deprecated alias for `frontendPort`,
|
|
44
|
+
* accepted for backward compat with older launchers. Remove after one release.
|
|
45
|
+
* @param {"vite"|"static"} [options.frontendKind="vite"] - Whether the
|
|
46
|
+
* frontend port hosts Vite or a static build. Only affects the description.
|
|
47
|
+
* @param {object} [options.automation] - Automation backend info. Skipped
|
|
48
|
+
* entirely unless `.url` or `.port` is provided, so passing `{}` is safe.
|
|
49
|
+
* @param {string} [options.automation.url] - Explicit automation base URL, from
|
|
50
|
+
* the agent's POV. Takes precedence over `.port`; used by the Docker image to
|
|
51
|
+
* honor an overridable `AUTOMATION_BASE_URL`.
|
|
52
|
+
* @param {number} [options.automation.port] - Automation backend port (used to
|
|
53
|
+
* derive the base URL when `.url` is not given).
|
|
54
|
+
* @param {string} [options.automation.apiPrefix="/api/automation"] - Path
|
|
55
|
+
* prefix all automation routes are mounted under.
|
|
56
|
+
* @param {string} [options.automation.authEnvVar="OPENHANDS_AUTOMATION_API_KEY"]
|
|
57
|
+
* - Env var holding the API key.
|
|
58
|
+
* @returns {object} A JSON-serializable runtime services info object.
|
|
59
|
+
*/
|
|
60
|
+
export function buildRuntimeServicesInfo(options) {
|
|
61
|
+
const {
|
|
62
|
+
mode,
|
|
63
|
+
agentHostAlias = "localhost",
|
|
64
|
+
agentServerPort,
|
|
65
|
+
agentServerUrl,
|
|
66
|
+
ingressPort,
|
|
67
|
+
// Accept legacy `vitePort` for one release so external callers keep working.
|
|
68
|
+
vitePort,
|
|
69
|
+
frontendPort = vitePort,
|
|
70
|
+
frontendKind = "vite",
|
|
71
|
+
automation,
|
|
72
|
+
} = options;
|
|
73
|
+
|
|
74
|
+
// Prefer an explicit URL (containers reach the agent-server over a specific
|
|
75
|
+
// host/scheme), else derive it from the port. From the agent's POV the
|
|
76
|
+
// agent-server it's *inside* is on the loopback host, regardless of where
|
|
77
|
+
// the host machine is.
|
|
78
|
+
const agentServerUrlResolved =
|
|
79
|
+
agentServerUrl ??
|
|
80
|
+
(agentServerPort != null ? `http://localhost:${agentServerPort}` : null);
|
|
81
|
+
if (!agentServerUrlResolved) {
|
|
82
|
+
// Without this the URL becomes `http://localhost:undefined` and ends up
|
|
83
|
+
// verbatim in the agent's system prompt, which is worse than failing fast.
|
|
84
|
+
throw new Error(
|
|
85
|
+
"buildRuntimeServicesInfo: agentServerPort or agentServerUrl is required " +
|
|
86
|
+
"(otherwise the agent_server URL would be `http://localhost:undefined`).",
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const services = {
|
|
91
|
+
agent_server: {
|
|
92
|
+
description:
|
|
93
|
+
"The OpenHands Agent Server this agent is running inside. " +
|
|
94
|
+
"Tool calls (terminal, file_editor, browser, etc.) execute here.",
|
|
95
|
+
url_from_agent: agentServerUrlResolved,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
if (ingressPort !== undefined) {
|
|
100
|
+
services.ingress = {
|
|
101
|
+
description:
|
|
102
|
+
"Unified entry point. Routes /api/automation/* to the automation " +
|
|
103
|
+
"backend, /api/* and /sockets to the agent-server, and /* to the " +
|
|
104
|
+
"frontend.",
|
|
105
|
+
url_from_agent: `http://${agentHostAlias}:${ingressPort}`,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (frontendPort !== undefined) {
|
|
110
|
+
services.frontend = {
|
|
111
|
+
kind: frontendKind,
|
|
112
|
+
description:
|
|
113
|
+
frontendKind === "static"
|
|
114
|
+
? "Static-file server hosting the agent-canvas production build."
|
|
115
|
+
: "Vite dev server hosting the agent-canvas frontend.",
|
|
116
|
+
url_from_agent: `http://${agentHostAlias}:${frontendPort}`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Prefer an explicit base URL, else derive from the port. Require one of the
|
|
121
|
+
// two so we don't bake `:undefined` into the URL when the caller passes
|
|
122
|
+
// `automation: {}`.
|
|
123
|
+
const automationBaseUrl =
|
|
124
|
+
automation?.url ??
|
|
125
|
+
(automation?.port != null
|
|
126
|
+
? `http://${agentHostAlias}:${automation.port}`
|
|
127
|
+
: null);
|
|
128
|
+
if (automationBaseUrl) {
|
|
129
|
+
const apiPrefix = automation.apiPrefix ?? "/api/automation";
|
|
130
|
+
const authEnvVar = automation.authEnvVar ?? "OPENHANDS_AUTOMATION_API_KEY";
|
|
131
|
+
services.automation = {
|
|
132
|
+
description:
|
|
133
|
+
"OpenHands Automations service. All routes are mounted under " +
|
|
134
|
+
`'${apiPrefix}'. Authenticate with header ` +
|
|
135
|
+
`'X-Session-API-Key: $${authEnvVar}'.`,
|
|
136
|
+
url_from_agent: automationBaseUrl,
|
|
137
|
+
api_prefix: apiPrefix,
|
|
138
|
+
docs_url: `${automationBaseUrl}${apiPrefix}/docs`,
|
|
139
|
+
openapi_url: `${automationBaseUrl}${apiPrefix}/openapi.json`,
|
|
140
|
+
auth_env_var: authEnvVar,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return {
|
|
145
|
+
mode,
|
|
146
|
+
agent_host_alias: agentHostAlias,
|
|
147
|
+
services,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
152
|
+
// CLI — used by docker/entrypoint.sh to emit the JSON at container startup.
|
|
153
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
154
|
+
|
|
155
|
+
export function parseArgs(argv) {
|
|
156
|
+
const options = { automation: {} };
|
|
157
|
+
for (let i = 0; i < argv.length; i++) {
|
|
158
|
+
const flag = argv[i];
|
|
159
|
+
switch (flag) {
|
|
160
|
+
case "--mode":
|
|
161
|
+
options.mode = argv[++i];
|
|
162
|
+
break;
|
|
163
|
+
case "--agent-host-alias":
|
|
164
|
+
options.agentHostAlias = argv[++i];
|
|
165
|
+
break;
|
|
166
|
+
case "--agent-server-url":
|
|
167
|
+
options.agentServerUrl = argv[++i] || undefined;
|
|
168
|
+
break;
|
|
169
|
+
case "--automation-url":
|
|
170
|
+
options.automation.url = argv[++i] || undefined;
|
|
171
|
+
break;
|
|
172
|
+
case "--automation-api-prefix":
|
|
173
|
+
options.automation.apiPrefix = argv[++i];
|
|
174
|
+
break;
|
|
175
|
+
case "--automation-auth-env":
|
|
176
|
+
options.automation.authEnvVar = argv[++i];
|
|
177
|
+
break;
|
|
178
|
+
default:
|
|
179
|
+
throw new Error(`Unknown flag: ${flag}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Omit the automation entry entirely when no URL was supplied, rather than
|
|
183
|
+
// advertising a backend the agent cannot reach.
|
|
184
|
+
if (!options.automation.url) delete options.automation;
|
|
185
|
+
return options;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const isMainModule =
|
|
189
|
+
process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
190
|
+
|
|
191
|
+
if (isMainModule) {
|
|
192
|
+
try {
|
|
193
|
+
const options = parseArgs(process.argv.slice(2));
|
|
194
|
+
process.stdout.write(JSON.stringify(buildRuntimeServicesInfo(options)));
|
|
195
|
+
} catch (err) {
|
|
196
|
+
console.error(err instanceof Error ? err.message : err);
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -75,6 +75,7 @@ export function parseArgs(argv = process.argv.slice(2)) {
|
|
|
75
75
|
rejectPrefixes: [],
|
|
76
76
|
sessionApiKey: null,
|
|
77
77
|
authRequired: false,
|
|
78
|
+
runtimeServicesInfo: null,
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -110,6 +111,9 @@ export function parseArgs(argv = process.argv.slice(2)) {
|
|
|
110
111
|
case "--session-api-key":
|
|
111
112
|
config.sessionApiKey = argv[++i] || null;
|
|
112
113
|
break;
|
|
114
|
+
case "--runtime-services-info":
|
|
115
|
+
config.runtimeServicesInfo = argv[++i] || null;
|
|
116
|
+
break;
|
|
113
117
|
case "--auth-required":
|
|
114
118
|
config.authRequired = true;
|
|
115
119
|
break;
|
|
@@ -167,6 +171,12 @@ OPTIONS:
|
|
|
167
171
|
--auth-required Inject authRequired flag into index.html so the
|
|
168
172
|
pre-built frontend shows the API key entry screen
|
|
169
173
|
(public mode) without VITE_AUTH_REQUIRED baked in.
|
|
174
|
+
--runtime-services-info <json>
|
|
175
|
+
Inject a JSON description of the local runtime
|
|
176
|
+
services into index.html so the pre-built
|
|
177
|
+
frontend can populate the agent's
|
|
178
|
+
<RUNTIME_SERVICES> system-prompt block without
|
|
179
|
+
VITE_RUNTIME_SERVICES_INFO baked in.
|
|
170
180
|
--reject-prefix <prefix> Return 503 for requests matching <prefix>
|
|
171
181
|
instead of SPA-fallbacking to index.html;
|
|
172
182
|
may be repeated. Useful in --frontend-only
|
|
@@ -208,8 +218,19 @@ ROUTING:
|
|
|
208
218
|
* - `authRequired`: sets `window.__AGENT_CANVAS_AUTH_REQUIRED__ = true` so the
|
|
209
219
|
* pre-built frontend shows the API key entry screen (public mode) without
|
|
210
220
|
* VITE_AUTH_REQUIRED baked in.
|
|
221
|
+
*
|
|
222
|
+
* - `runtimeServicesInfo`: a JSON string describing the local services
|
|
223
|
+
* (agent-server, automation, …), exposed as
|
|
224
|
+
* `window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__`. Read by
|
|
225
|
+
* `parseRuntimeServicesInfo()` in `agent-server-adapter.ts` as a fallback
|
|
226
|
+
* when `VITE_RUNTIME_SERVICES_INFO` is empty, so static builds (Docker /
|
|
227
|
+
* published binary) still populate the agent's `<RUNTIME_SERVICES>` block.
|
|
211
228
|
*/
|
|
212
|
-
function makeConfigInjectionScript(
|
|
229
|
+
function makeConfigInjectionScript(
|
|
230
|
+
sessionApiKey,
|
|
231
|
+
authRequired,
|
|
232
|
+
runtimeServicesInfo,
|
|
233
|
+
) {
|
|
213
234
|
const parts = [];
|
|
214
235
|
|
|
215
236
|
if (sessionApiKey) {
|
|
@@ -236,6 +257,16 @@ function makeConfigInjectionScript(sessionApiKey, authRequired) {
|
|
|
236
257
|
parts.push(`window.__AGENT_CANVAS_AUTH_REQUIRED__=true;`);
|
|
237
258
|
}
|
|
238
259
|
|
|
260
|
+
if (runtimeServicesInfo) {
|
|
261
|
+
// Stored as the raw JSON string so the browser-side parser
|
|
262
|
+
// (parseRuntimeServicesInfo) can JSON.parse it exactly like the
|
|
263
|
+
// VITE_RUNTIME_SERVICES_INFO env var. JSON.stringify produces a safe JS
|
|
264
|
+
// string literal for the inline <script>.
|
|
265
|
+
parts.push(
|
|
266
|
+
`window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__=${JSON.stringify(runtimeServicesInfo)};`,
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
239
270
|
if (parts.length === 0) return "";
|
|
240
271
|
|
|
241
272
|
return `<script>(function(){${parts.join("")}}());</script>`;
|
|
@@ -249,7 +280,7 @@ async function serveInjectedIndexHtml(
|
|
|
249
280
|
req,
|
|
250
281
|
res,
|
|
251
282
|
indexPath,
|
|
252
|
-
{ sessionApiKey, authRequired } = {},
|
|
283
|
+
{ sessionApiKey, authRequired, runtimeServicesInfo } = {},
|
|
253
284
|
) {
|
|
254
285
|
let content;
|
|
255
286
|
try {
|
|
@@ -258,7 +289,11 @@ async function serveInjectedIndexHtml(
|
|
|
258
289
|
return false;
|
|
259
290
|
}
|
|
260
291
|
|
|
261
|
-
const script = makeConfigInjectionScript(
|
|
292
|
+
const script = makeConfigInjectionScript(
|
|
293
|
+
sessionApiKey,
|
|
294
|
+
authRequired,
|
|
295
|
+
runtimeServicesInfo,
|
|
296
|
+
);
|
|
262
297
|
// Inject right before </head> so the key is available before any app code runs.
|
|
263
298
|
// replace() targets the first (and only) </head> in well-formed HTML.
|
|
264
299
|
const injected = content.includes("</head>")
|
|
@@ -500,7 +535,9 @@ async function handleStatic(
|
|
|
500
535
|
}
|
|
501
536
|
|
|
502
537
|
const needsInjection =
|
|
503
|
-
injectionOpts.sessionApiKey ||
|
|
538
|
+
injectionOpts.sessionApiKey ||
|
|
539
|
+
injectionOpts.authRequired ||
|
|
540
|
+
injectionOpts.runtimeServicesInfo;
|
|
504
541
|
|
|
505
542
|
// Serve index.html with runtime config injection when configured.
|
|
506
543
|
if (needsInjection && filePath.endsWith("index.html")) {
|
|
@@ -553,6 +590,7 @@ export function startStaticServer(config) {
|
|
|
553
590
|
const injectionOpts = {
|
|
554
591
|
sessionApiKey: config.sessionApiKey || null,
|
|
555
592
|
authRequired: config.authRequired || false,
|
|
593
|
+
runtimeServicesInfo: config.runtimeServicesInfo || null,
|
|
556
594
|
};
|
|
557
595
|
const rejectPrefixes = config.rejectPrefixes ?? [];
|
|
558
596
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./declaration-DaUdB2Wg.js";import{t}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";var n=`cli-generic`,r=new Set([`default`,`default (recommended)`]);function i(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||r.has(t.toLowerCase())||t===`acp-managed`?null:t}function a(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=i(t);if(e)return e}return e.providerDefault??null}var o={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}},s=Object.entries(o).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:r?.available_models?.map(e=>({id:e.id,label:e.label})),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),c=`custom`;function l(n){let r=n?t(n):null;if(!r)return[];let i=[];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function u(e){if(e)return s.find(t=>t.key===e)}function d(e){let t=u(e);return t?t.display_name:null}function f(e){return u(e)?.icon??`cli-generic`}function p(e,t){return t?u(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function m(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===c,r=n?void 0:u(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?r?.default_model??null:t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{u as a,p as c,m as i,f as l,s as n,d as o,n as r,l as s,c as t,a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as e}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{r as t}from"./query-client-config-CWWGQWvw.js";import{d as n}from"./agent-server-client-options-9agOSarV.js";import{a as r}from"./query-keys-tAsQcc_9.js";import{n as i}from"./use-settings-BPTbE7lg.js";async function a(){try{let a=n();if((await t.fetchQuery({queryKey:[...r.byScope(`personal`),a.backend.id,a.orgId],queryFn:()=>i(`personal`),staleTime:0}))?.agent_settings?.agent_kind===`acp`)return e(`/settings/agent`)}catch{}return null}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-DaUdB2Wg.js";import{a as r,t as i}from"./health-store-B5f0S2FY.js";import{_ as a,f as o,h as s,m as c,u as l,v as u,x as d,y as f}from"./agent-server-client-options-9agOSarV.js";var p=e(t(),1),m=n(),h=p.createContext(null);function g(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function _({children:e}){let t=p.useSyncExternalStore(f,s,s),n=p.useCallback((e,t)=>{let n=o()?.backendId??null,r=o()?.orgId??null,i=t??null;e===n&&i===r||a({backendId:e,orgId:i})},[]),l=p.useCallback(e=>{let t={...e,id:g()};return u([...c(),t]),a({backendId:t.id}),t},[]),d=p.useCallback((e,t)=>{let n=c().find(t=>t.id===e);u(c().map(n=>n.id===e?{...n,...t}:n));let i=t.host!==void 0&&n!==void 0&&t.host!==n.host,a=t.apiKey!==void 0&&n!==void 0&&t.apiKey!==n.apiKey;(i||a)&&r(e)},[]),_=p.useCallback(e=>{u(c().filter(t=>t.id!==e)),i(e)},[]),v=p.useMemo(()=>({backends:t.backends,active:t.active,setActive:n,addBackend:l,updateBackend:d,removeBackend:_}),[t,n,l,d,_]);return(0,m.jsx)(h.Provider,{value:v,children:e})}function v(){let e=p.useContext(h);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function y(){let e=p.useContext(h);return e?e.active:{backend:d()??l,orgId:null}}export{y as n,v as r,_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-BFRubm34.js";import{o as t}from"./declaration-DaUdB2Wg.js";import{n}from"./backend-form-modal-CeB983Sj.js";var r=e({AddBackendModal:()=>a}),i=t();function a({onClose:e}){return(0,i.jsx)(n,{mode:`add`,onClose:e})}export{r as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`workspace/project`;function t(e){return e?.trim()||null}function n(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function r(){return n(void 0)}function i(){let e=t(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return t(e)}return null}function a(){return{baseUrl:o()??``,sessionApiKey:s()??``}}function o(){return r()||(typeof window<`u`?window.location.origin:null)}function s(){return i()}function c(){return(void 0)?.trim()||e}function ee(e){return`${c().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function l(){let e=s();return e?{"X-Session-API-Key":e}:{}}function te(){return!0}function u(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function ne(){return u()?!s():!1}var d=`default-local`,f=`Local`;function p(){let e=o(),t=s();return!e||!t?null:{id:d,name:f,host:e,apiKey:t,kind:`local`}}var m=`openhands-backends`,h=`openhands-active-backend`,g=`openhands-agent-server-config`;function _(e){return e===`local`||e===`cloud`}function v(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&_(t.kind)}function re(e){if(typeof e!=`string`)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`http://${t}`:null}function y(){let e=window.localStorage.getItem(g);if(!e)return null;try{let t=JSON.parse(e),n=re(t.baseUrl),r=typeof t.sessionApiKey==`string`?t.sessionApiKey.trim():``;return!n||!r?null:{id:d,name:f,host:n,apiKey:r,kind:`local`}}catch{return null}}function b(){window.localStorage.removeItem(g)}function x(e){return T(e),b(),e}function S(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function C(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||S(e.host)&&S(t.host)}function w(e){let t=p();if(!t)return e;let n=!1,r=e.map(e=>!C(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(T(r),r):e}function T(e){if(!(typeof window>`u`))try{window.localStorage.setItem(m,JSON.stringify(e))}catch{}}function E(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(m);if(e===null){let e=y();if(e)return x([e]);let t=p();return t?x([t]):[]}let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=t.filter(v);if(n.length===0){let e=p();return e?x([e]):[]}let r=w(n);return b(),r}catch{return[]}}function D(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(h);if(!e)return null;let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function O(e){if(!(typeof window>`u`))try{if(!e){window.localStorage.removeItem(h);return}window.localStorage.setItem(h,JSON.stringify({backendId:e.backendId,orgId:e.orgId??null}))}catch{}}var k=`no-backend`,A={id:k,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function j(e){return e.id===k}function ie(e){return e[0]??A}function M(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=ie(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var N=M(E(),D()),P=new Set;function F(){P.forEach(e=>e())}function I(){return N.active}function L(){let e=N.active.backend;return e.kind===`local`&&!j(e)?e:null}function R(){return N.backends}function z(){return N.selection}function B(){return N}function V(e){O(e),N=M(N.backends,e),F()}function H(e){T(e);let t=N.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,O(null)),N=M(e,t),F()}function U(e){return P.add(e),()=>{P.delete(e)}}var W=class extends Error{constructor(e,t,n,r){super(r||`HTTP ${e}: ${t}`),this.status=e,this.statusText=t,this.response=n,this.name=`HttpError`}},G=class{constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.apiKey=e.apiKey,this.timeout=e.timeout||6e4}async request(e){let t=e.url.startsWith(`/`)?e.url.slice(1):e.url,n=new URL(t,this.baseUrl+`/`);e.params&&Object.entries(e.params).forEach(([e,t])=>{t!=null&&(Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,String(t))):n.searchParams.append(e,String(t)))});let r={"Content-Type":`application/json`,...e.headers};this.apiKey&&(r[`X-Session-API-Key`]=this.apiKey);let i={method:e.method,headers:r,signal:AbortSignal.timeout(e.timeout||this.timeout)};e.credentials&&(i.credentials=e.credentials),e.data&&e.method!==`GET`&&(e.data instanceof FormData?(delete r[`Content-Type`],i.body=e.data):i.body=JSON.stringify(e.data));try{let t=await fetch(n.toString(),i);if(!(e.acceptableStatusCodes?.has(t.status)||!e.acceptableStatusCodes&&t.ok)){let e;try{e=t.headers.get(`content-type`)?.includes(`application/json`)?await t.json():await t.text()}catch{e=null}throw new W(t.status,t.statusText,e,`HTTP request failed (${t.status} ${t.statusText}): ${JSON.stringify(e)}`)}let r=await this.parseResponse(t,e.responseType||`auto`),a={};return t.headers.forEach((e,t)=>{a[t]=e}),{data:r,status:t.status,statusText:t.statusText,headers:a}}catch(t){throw t instanceof W?t:t instanceof Error?t.name===`AbortError`?Error(`Request timeout after ${e.timeout||this.timeout}ms`,{cause:t}):Error(`Request failed: ${t.message}`,{cause:t}):Error(`Unknown request error`,{cause:t})}}async parseResponse(e,t){return t===`json`?await e.json():t===`text`?await e.text():t===`blob`?await e.blob():t===`arrayBuffer`?await e.arrayBuffer():e.headers.get(`content-type`)?.includes(`application/json`)?await e.json():await e.text()}async get(e,t){return this.request({method:`GET`,url:e,...t})}async post(e,t,n){return this.request({method:`POST`,url:e,data:t,...n})}async put(e,t,n){return this.request({method:`PUT`,url:e,data:t,...n})}async patch(e,t,n){return this.request({method:`PATCH`,url:e,data:t,...n})}async delete(e,t){return this.request({method:`DELETE`,url:e,...t})}close(){}},K=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new G({baseUrl:this.host,apiKey:this.apiKey,timeout:e.timeout||6e4})}async getAgentSchema(){return(await this.client.get(`/api/settings/agent-schema`)).data}async getSettings(e={}){return(await this.client.get(`/api/settings`,{headers:e.exposeSecrets?{"X-Expose-Secrets":e.exposeSecrets}:void 0})).data}async updateSettings(e){return(await this.client.patch(`/api/settings`,e)).data}async listSecrets(){return(await this.client.get(`/api/settings/secrets`)).data}async upsertSecret(e){return(await this.client.put(`/api/settings/secrets`,e)).data}async getSecret(e){return(await this.client.get(`/api/settings/secrets/${encodeURIComponent(e)}`,{responseType:`text`})).data}async deleteSecret(e){return(await this.client.delete(`/api/settings/secrets/${encodeURIComponent(e)}`)).data}async getConversationSchema(){return(await this.client.get(`/api/settings/conversation-schema`)).data}async listProfiles(){return(await this.client.get(`/api/profiles`)).data}async getProfile(e,t={}){return(await this.client.get(`/api/profiles/${encodeURIComponent(e)}`,{headers:t.exposeSecrets?{"X-Expose-Secrets":t.exposeSecrets}:void 0})).data}async saveProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}`,t)).data}async deleteProfile(e){return(await this.client.delete(`/api/profiles/${encodeURIComponent(e)}`)).data}async renameProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/rename`,{new_name:t})).data}close(){this.client.close()}};function q(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function J(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function Y(e){let t=q(e),n=J(e);return`${window.location.protocol===`https:`?`https:`:`http:`}//${t}${n}`}function X(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function ae(e,t){let n=q(e),r=J(e),i=window.location.protocol===`https:`,a=X(e)===`https:`,o=`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/bash-events`;return t?`${o}?session_api_key=${encodeURIComponent(t)}`:o}function oe(e,t){if(!e)return null;let n=q(t),r=J(t),i=window.location.protocol===`https:`,a=X(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var Z=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function Q(e){return e.replace(/\/+$/,``)}function se(e,t){return e.host?Q(e.host):e.conversationUrl?Q(Y(e.conversationUrl)):Q(t?.host??``)}function $(e={}){let t=L();if(!t&&!e.host&&!e.conversationUrl)throw new Z;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:se(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??c(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function ce(e){let{host:t,apiKey:n,timeout:r}=$(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}export{te as A,ee as C,c as D,l as E,u as O,e as S,a as T,V as _,Y as a,f as b,G as c,I as d,z as f,j as g,B as h,ae as i,ne as k,W as l,R as m,$ as n,oe as o,L as p,ce as r,K as s,Z as t,A as u,H as v,o as w,p as x,U as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as e,d as t,g as n,n as r,p as i,s as a}from"./agent-server-client-options-9agOSarV.js";import{t as o}from"./server-client-DYv_GHPl.js";var s=5e3,c=null,l=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,u=class extends Error{details;constructor(e){super(`Agent server not found. Could not connect to the configured agent server. Start a compatible agent server and reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null}},d=e=>e instanceof u||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,f=t=>e()&&g(t,401);function p(){c=null}function m(e){let t=l(c);return Array.isArray(t)?t.includes(e):!0}function h(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function g(e,t){return h(e)&&e.status===t}async function _(){let l=i();if(!l){if(p(),n(t().backend))throw new u(`No backend configured`);return null}let d=r({host:l.host,sessionApiKey:l.apiKey||null,timeout:s}),f;try{f=await new o(d).getServerInfo()}catch(e){throw p(),g(e,401)?e:new u(e instanceof Error?e.message:null)}if(e())try{await new a(d).getSettings()}catch(e){if(g(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return c=f,f}export{_ as a,g as i,m as n,d as r,f as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-DVtlLWY8.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-9agOSarV.js","assets/proxy-sRh0WKI7.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./preload-helper-CT1Z6Pdu.js";import{t}from"./common-DqjLSBOt.js";import{A as n,C as r,D as i,a,c as o,d as s,l as c,n as l,p as u,t as ee}from"./agent-server-client-options-9agOSarV.js";import{n as d,s as f,u as p}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{t as m}from"./profiles-client-BrqNmaDV.js";import{n as h}from"./agent-server-compatibility-B7QStIcH.js";import{n as g,t as _}from"./proxy-sRh0WKI7.js";import{t as v}from"./v4-khGvL7i2.js";import{t as y}from"./settings-DGY6n4J2.js";import{a as b,u as x}from"./acp-providers-DJr8DlNG.js";import{t as S}from"./settings-service.api-DxIEtvx6.js";var C=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new o({baseUrl:this.host,apiKey:this.apiKey,timeout:e.timeout||6e4})}async createConversation(e){return(await this.client.post(`/api/conversations`,e)).data}async searchConversations(e={}){return(await this.client.get(`/api/conversations/search`,{params:e})).data}async countConversations(e={}){return(await this.client.get(`/api/conversations/count`,{params:e})).data}async getConversations(e){return(await this.client.get(`/api/conversations`,{params:{ids:e}})).data}async getConversation(e){return(await this.client.get(`/api/conversations/${e}`)).data}async searchEvents(e,t={}){return(await this.client.get(`/api/conversations/${e}/events/search`,{params:t})).data}async getEvent(e,t){return(await this.client.get(`/api/conversations/${e}/events/${t}`)).data}async getEvents(e,t){return Promise.all(t.map(async t=>{try{return await this.getEvent(e,t)}catch(e){if(e instanceof c&&e.status===404)return null;throw e}}))}async sendEvent(e,t,n={}){await this.client.post(`/api/conversations/${e}/events`,{...t,...n.run===void 0?{}:{run:n.run}})}async pauseConversation(e){return(await this.client.post(`/api/conversations/${e}/pause`,{})).data}async interruptConversation(e){return(await this.client.post(`/api/conversations/${e}/interrupt`,{})).data}async runConversation(e){return(await this.client.post(`/api/conversations/${e}/run`,{})).data}async askAgent(e,t){return(await this.client.post(`/api/conversations/${e}/ask_agent`,{question:t})).data}async getEventCount(e,t={}){return(await this.client.get(`/api/conversations/${e}/events/count`,{params:t})).data}async respondToConfirmation(e,t){return(await this.client.post(`/api/conversations/${e}/events/respond_to_confirmation`,t)).data}async getAgentFinalResponse(e){return(await this.client.get(`/api/conversations/${e}/agent_final_response`)).data}async setConfirmationPolicy(e,t){let n=`policy`in t?t:{policy:t};return(await this.client.post(`/api/conversations/${e}/confirmation_policy`,n)).data}async condenseConversation(e){return(await this.client.post(`/api/conversations/${e}/condense`,{})).data}async setSecurityAnalyzer(e,t){let n=te(t)?t:{security_analyzer:t};return(await this.client.post(`/api/conversations/${e}/security_analyzer`,n)).data}async updateSecrets(e,t){return(await this.client.post(`/api/conversations/${e}/secrets`,t)).data}async forkConversation(e,t={},n={}){return(await this.client.post(`/api/conversations/${e}/fork`,t,{params:n.includeSkills===void 0?void 0:{include_skills:n.includeSkills}})).data}async switchProfile(e,t){await this.client.post(`/api/conversations/${e}/switch_profile`,{profile_name:t})}async switchLLM(e,t){await this.client.post(`/api/conversations/${e}/switch_llm`,{llm:t})}async switchAcpModel(e,t){await this.client.post(`/api/conversations/${e}/switch_acp_model`,{model:t})}async deleteConversation(e){await this.client.delete(`/api/conversations/${e}`)}async updateConversation(e,t){return(await this.client.patch(`/api/conversations/${e}`,t)).data}close(){this.client.close()}};function te(e){return typeof e==`object`&&!!e&&`security_analyzer`in e}var w=new Map;function ne(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function re(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function T(e={}){let t=l(e),n=t.host,r=w.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new p(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();w.set(n,i);try{return await i}catch(e){throw w.delete(n),e}}async function E(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?ne(n)?n:re(await T(t),n):T(t)}var D=`openhands-agent-server-conversation-metadata`,O=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(D);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},k=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(D);return}window.localStorage.setItem(D,JSON.stringify(e))}},A=e=>O()[e]??null,j=(e,t)=>{let n=O();n[e]=t,k(n)},M=e=>{let t=O();e in t&&(delete t[e],k(t))};function N(e){if(!e?.id)return e;let t=A(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function P(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function ie(e=20,t){let n=P(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>N(e)),next_page_id:i?.next_page_id??null}}async function F(e){if(e.length===0)return[];let t=P(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(N)}async function ae(e){return await _({backend:P(),method:`POST`,path:`/api/v1/app-conversations`,body:e})}async function oe(e){return _({backend:P(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function se(e){await _({backend:P(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function ce(e,t){return await _({backend:P(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function le(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function ue(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function de(e,t){let n=P(),r=new URLSearchParams;return r.append(`file_path`,t),await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function fe(e){let t=P(),n=new URLSearchParams;return n.set(`ids`,e),(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}var I=`canvas_ui`,pe=`canvas_ui_tool`,me=[`terminal`,`file_editor`,`task_tracker`,I],L=`browser_tool_set`,R=`task_tool_set`;function he(){return!0}function ge(){let e=(void 0)?.trim();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function _e(){let e=ge();if(!e?.services)return;let t=[];t.push(`<RUNTIME_SERVICES>`),e.mode?t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`):t.push(`You are running inside an agent-canvas dev stack.`),t.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:n,ingress:r,automation:i}=e.services,a=e.services.frontend??e.services.vite;n?.url_from_agent&&t.push(`* Agent Server (you): ${n.url_from_agent}`,` ${n.description??`The agent-server hosting your tool calls.`}`),r?.url_from_agent&&t.push(`* Ingress: ${r.url_from_agent}`,` ${r.description??`Unified entry point for browser-facing traffic.`}`),a?.url_from_agent&&t.push(`* Frontend: ${a.url_from_agent}`,` ${a.description??`Frontend dev server.`}`),i?.url_from_agent?(t.push(`* Automation backend: ${i.url_from_agent}`,` ${i.description??`OpenHands Automations service.`}`),i.docs_url&&t.push(` Docs: ${i.docs_url}`),i.openapi_url&&t.push(` OpenAPI: ${i.openapi_url}`),i.auth_env_var&&t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)):t.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let o=n?.url_from_agent;return t.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),o&&t.push(`In particular, ${o} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),t.push(`</RUNTIME_SERVICES>`),t.join(`
|
|
3
|
-
`)}function ve(e){let{host:t}=l();return`${t}/api/conversations/${e}`}function z(e){return`Conversation ${e.slice(0,5)}`}function B(e){let n=A(e.id),r=e.agent?.kind===`ACPAgent`,a=r?e.tags?.acpserver??null:null;return{id:e.id,created_by_user_id:null,selected_repository:n?.selected_repository??null,selected_branch:n?.selected_branch??null,git_provider:n?.git_provider??null,selected_workspace:n?.selected_workspace??null,title:e.title?.trim()?e.title:z(e.id),trigger:null,pr_number:[],agent_kind:r?`acp`:`openhands`,acp_server:a,llm_model:r?x({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??y.llm_model,metrics:e.metrics?{accumulated_cost:e.metrics.accumulated_cost??null,max_budget_per_task:e.metrics.max_budget_per_task??null,accumulated_token_usage:e.metrics.accumulated_token_usage?{prompt_tokens:e.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:e.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:e.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:e.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:e.metrics.accumulated_token_usage.context_window??0,per_turn_token:e.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??t.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:ve(e.id),session_api_key:l().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??i()},public:!1,sub_conversation_ids:[]}}function ye(e){return{items:e.items.map(B),next_page_id:e.next_page_id??null}}var V=[`acp_command`,`acp_args`,`acp_model`,`acp_session_mode`,`acp_prompt_timeout`],be=`acpserver`,xe=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function H(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function U(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Se(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Ce(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function we(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function Te(e,t){return e===L?he()&&h(e):e===R?t.enable_sub_agents===!0&&h(e):!0}function Ee(e){let t=new Map;for(let e of me)t.set(e,{name:e,params:{}});for(let n of[L,R])Te(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>we(e)))for(let r of n)Te(r.name,e)&&t.set(r.name,{name:r.name,params:H(r.params)});return Array.from(t.values())}function De(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
|
|
4
|
-
|
|
5
|
-
`)}],run:!0}}function W(e){let t=_e();return{...H(e.agent_context),load_public_skills:n(),load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function G(e){return H(e.agent_settings).agent_kind===`acp`}function Oe(e){let t=H(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function ke(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=b(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Ae(e){let t=H(e.agent_settings),n={agent_kind:`acp`,agent_context:W(t)};for(let e of V){if(e===`acp_model`)continue;let r=e===`acp_command`?ke(t):t[e];r!=null&&(n[e]=r)}let r=b(typeof t.acp_server==`string`?t.acp_server:void 0),i=x({configured:t.acp_model,providerDefault:r?.default_model});return i&&(n.acp_model=i),n}function je(e){let t=H(e.agent_settings),n=H(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:y.llm_model;let r=U(n.api_key);r?n.api_key=r:delete n.api_key;let i=U(n.base_url);i?n.base_url=i:delete n.base_url;let a=H(t.mcp_config);(Object.keys(a).length===0||!(`mcpServers`in a))&&delete t.mcp_config,delete t.acp_server;for(let e of V)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:W(t),tools:Ee(t)}}function Me(e){return G(e)?Ae(e):je(e)}function Ne(e){let{settings:t,query:n,conversationInstructions:r,plugins:a,workingDir:o}=e,s=H(t.conversation_settings),c=De(n,r);return xe.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??i()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Pe(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=G(t),r=Me(t),i=n?Oe(t):void 0,a=Ne(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),o={agent_settings:r,workspace:a.workspace,confirmation_policy:Se(a),max_iterations:typeof a.max_iterations==`number`?a.max_iterations:500,stuck_detection:!0,autotitle:!0,worktree:!0};i&&(o.tags={[be]:i}),e.secretsEncrypted&&(o.secrets_encrypted=!0),e.conversationId&&(o.conversation_id=e.conversationId);let s=Ce(a);if(s&&(o.security_analyzer=s),a.initial_message&&(o.initial_message=a.initial_message),a.plugins&&(o.plugins=a.plugins),a.hook_config&&(o.hook_config=a.hook_config),o.tool_module_qualnames={[I]:pe,...a.tool_module_qualnames??{}},a.agent_definitions&&(o.agent_definitions=a.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=u(),r=t?g(t):{},i={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(r).length>0&&(e.headers=r),i[t.name]=e}o.secrets=i,n&&(o.agent_settings.agent_context={...o.agent_settings.agent_context,secrets:i})}return o}async function Fe(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-DVtlLWY8.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4])),[r,i]=await Promise.all([S.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return Pe({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Ie(){return{hooks:[]}}var Le=`1970-01-01T00:00:00.000Z`,Re=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function K(){return Error(Re)}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e){return typeof e==`number`?e:null}function Y(e){return typeof e==`number`?e:0}function X(e){return typeof e==`string`?e:null}function Z(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Le}function ze(e){return q(e)?{prompt_tokens:Y(e.prompt_tokens),completion_tokens:Y(e.completion_tokens),cache_read_tokens:Y(e.cache_read_tokens),cache_write_tokens:Y(e.cache_write_tokens),context_window:Y(e.context_window),per_turn_token:Y(e.per_turn_token)}:null}function Q(e){return q(e)?{accumulated_cost:J(e.accumulated_cost),max_budget_per_task:J(e.max_budget_per_task),accumulated_token_usage:ze(e.accumulated_token_usage)}:null}function Be(e){if(!q(e))return null;let t=q(e.llm)?{model:X(e.llm.model)}:null;return{kind:X(e.kind),acp_model:X(e.acp_model),llm:t}}function Ve(e){return q(e)?{working_dir:X(e.working_dir)}:null}function He(e){if(!q(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function Ue(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function We(e,t){let n=Ue(e),r=Ue(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function Ge(e){if(!q(e)||typeof e.id!=`string`||!e.id.trim())throw K();return{id:e.id.trim(),title:X(e.title),created_at:Z(e,`created_at`,`createdAt`),updated_at:Z(e,`updated_at`,`updatedAt`),execution_status:X(e.execution_status),sandbox_status:X(e.sandbox_status),metrics:Q(e.metrics),agent:Be(e.agent),workspace:Ve(e.workspace),tags:He(e.tags),current_model_id:X(e.current_model_id),current_model_name:X(e.current_model_name)}}function $(e){if(!Array.isArray(e))throw K();return e.map(Ge)}function Ke(e){if(Array.isArray(e))return{items:$(e),next_page_id:null};if(!q(e))throw K();return{items:$(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var qe=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function Je(e){let t=e??`idle`;return qe.has(t)?t:`idle`}function Ye(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var Xe=class{static async sendMessage(e,t,n){let r=s().backend,i=n?.conversationUrl??null,o=n?.sessionApiKey??null;if(r.kind===`cloud`){if(!i||!o){let[t]=await F([e]);i=t?.conversation_url?.trim()??null,o=t?.session_api_key?.trim()??null}if(!i||!o)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await _({backend:r,method:`POST`,hostOverride:a(i),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:o}),t}return await new C(l({conversationUrl:i,sessionApiKey:o})).sendEvent(e,t,{run:!0}),t}static async createConversation(e,t,n,i,a,o,c,d){if(s().backend.kind===`cloud`)return ae({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:t??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:n??null,parent_conversation_id:o??null,agent_type:c,sandbox_id:d??null});let f=await S.getSettings(),p=v(),m=await Fe({settings:f,query:e,conversationInstructions:t,plugins:n,conversationId:p,workingDir:await E(a??r(p))}),h=await new C(l()).createConversation(m),g=u();if(!g)throw new ee;return(i?.selected_repository||a)&&j(h.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:a??null}),{id:h.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:h.id,agent_server_url:g.host,request:{initial_message:m.initial_message,plugins:n??null},created_at:h.created_at,updated_at:h.updated_at}}static async getStartTask(e){return s().backend.kind===`cloud`?fe(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new f(l({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??i()}static async batchGetAppConversations(e){return e.length===0?[]:s().backend.kind===`cloud`?F(e):$(await new C(l()).getConversations(e)).map(e=>B(e))}static async updateConversationPublicFlag(e,t){if(s().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return ce(e,t)}static async updateConversationRepository(e,t,n,r){t?j(e,{...A(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):M(e);let[i]=await this.batchGetAppConversations([e]);return Ye(i,e)}static async readConversationFile(e,t){if(s().backend.kind===`cloud`)return de(e,We(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=We(t??`${n}/.agents_tmp/PLAN.md`,n);return new p(l()).downloadTextFile(r)}static async downloadConversation(e){return s().backend.kind===`cloud`?oe(e):new p(l()).downloadTrajectory(e)}static async getHooks(e){return Ie()}static async getRuntimeConversation(e,t,n){let r=s().backend,i=r.kind===`cloud`&&t?await _({backend:r,method:`GET`,hostOverride:a(t),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:n}):await new C(l({conversationUrl:t,sessionApiKey:n})).getConversation(e),o=Ge(i),c=q(i)?i.stats:null;return{id:o.id,title:o.title?.trim()?o.title:z(o.id),metrics:Q(o.metrics),created_at:o.created_at,updated_at:o.updated_at,status:Je(o.execution_status),stats:q(c)?c:{usage_to_metrics:{}}}}static async searchConversations(e=20,t){return s().backend.kind===`cloud`?ie(e,t):ye(Ke(await new C(l()).searchConversations({limit:e,page_id:t,sort_order:d.UPDATED_AT_DESC})))}static async deleteConversation(e){s().backend.kind===`cloud`?await se(e):await new C(l()).deleteConversation(e),M(e)}static async updateConversationTitle(e,t){await new C(l()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return Ye(n,e)}static async switchProfile(e,t){if(s().backend.kind===`cloud`)throw Error(`LLM profile switching is only supported for local agent-server backends.`);if(!e){await new m(l()).activateProfile(t);return}let n=l(),r=new C(n),i=await new m(n).getProfile(t,{exposeSecrets:`encrypted`}),a=typeof i.config.model==`string`?i.config.model:``;if(!a)throw Error(`Profile '${t}' has no model.`);await r.switchLLM(e,{...i.config,model:a,usage_id:`profile:${t}:${v()}`})}static async switchAcpModel(e,t){if(s().backend.kind===`cloud`)throw Error(`ACP model switching is only supported for local agent-server backends.`);await new C(l()).switchAcpModel(e,t)}};export{A as a,ue as i,F as n,E as o,le as r,C as s,Xe as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-DaUdB2Wg.js";import{t as i}from"./useTranslation-CEcjrme-.js";import{t as a}from"./utils-CdgBzLA7.js";import{g as o,n as s,s as c}from"./agent-server-client-options-9agOSarV.js";import{r as l}from"./active-backend-context-I2w666XY.js";import{i as u}from"./agent-server-compatibility-B7QStIcH.js";import{r as d,t as f}from"./modal-body-CCLCqX1J.js";import{t as p}from"./brand-button-LBFNic99.js";import{r as m,t as h}from"./backend-form-modal-CeB983Sj.js";var g=e(t(),1),_=n();function v(){let{t:e}=i(`openhands`),{active:t,addBackend:n,updateBackend:v}=l(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async i=>{x(!0),C(`idle`),T(null);try{await new c(s({host:i.host,sessionApiKey:i.apiKey,timeout:5e3})).getSettings(),C(`success`),o(t.backend)?n(i):v(t.backend.id,i),window.location.reload()}catch(t){if(C(`error`),u(t,401))T(e(r.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(r.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:a(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,d(`md`),f),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(r.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(h,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(m,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(r.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(p,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?r.ONBOARDING$BACKEND_STATUS_CHECKING:r.BACKEND$CONNECT)})]})})})]})})}export{v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,P as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as i}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{o as a,t as o}from"./declaration-DaUdB2Wg.js";import{t as s}from"./useTranslation-CEcjrme-.js";import{t as c}from"./back-nav-button-DgkK0Ka6.js";import{n as l,r as u}from"./custom-toast-handlers-BohXx7uh.js";import{t as d}from"./utils-CdgBzLA7.js";import{a as f,d as p,n as m}from"./agent-server-client-options-9agOSarV.js";import{n as h}from"./active-backend-context-I2w666XY.js";import{f as g}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{r as _}from"./modal-classes-DwTdT3IK.js";import{n as v}from"./navigation-context-aNGUUtdq.js";import{n as y,r as b}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js";import{t as x}from"./proxy-sRh0WKI7.js";import{t as S}from"./use-tracking-DQYdZpxi.js";import{t as C}from"./u-edit-BIYzjs3v.js";import{t as w}from"./terminal-BSYITdM0.js";import{t as T}from"./use-user-conversation-BRAseenw.js";import{t as E}from"./toggle-switch-CUgOZqZu.js";import{t as D}from"./x-mark-DsJ9tDD0.js";import{t as O}from"./code-tag-DhsjDB-v.js";import{t as k}from"./link-external-DtcdPFbw.js";import{t as A}from"./globe-qFjFNG6J.js";import{C as j,S as M,a as N,b as ee,c as P,d as F,f as te,g as ne,i as re,l as I,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as L,v as ue,x as de,y as fe}from"./edit-automation-modal-CNZgSSiH.js";import{t as R}from"./automation-DJ_3GeXD.js";var z=e(t()),B=a();function V(){let{t:e}=s(`openhands`);return(0,B.jsx)(c,{to:`/automations`,children:e(o.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var pe=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function me({active:e}){let{t}=s(`openhands`);return(0,B.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:d(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?o.AUTOMATIONS$DETAIL$ACTIVE:o.AUTOMATIONS$DETAIL$INACTIVE)})}function he({automation:e,onToggle:t,onEdit:n,onDelete:r,onRunNow:i,isRunningNow:a=!1}){let{t:c}=s(`openhands`),l=te(`manage_automations`),u=[...n?[{label:c(o.AUTOMATIONS$EDIT),icon:(0,B.jsx)(C,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),icon:(0,B.jsx)(ce,{className:`size-4`}),onClick:t},{label:c(o.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,B.jsx)(pe,{className:`size-4`}),onClick:()=>{j.downloadTarball(e.id,e.name)}},{label:c(o.AUTOMATIONS$DELETE),icon:(0,B.jsx)(ae,{className:`size-4`}),onClick:r}];return(0,B.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,B.jsx)(me,{active:e.enabled})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&i&&(0,B.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:a||!e.enabled,onClick:i,children:[(0,B.jsx)(F,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),a?`Starting…`:c(o.AUTOMATIONS$RUN_NOW)]}),l&&(0,B.jsx)(E,{enabled:e.enabled,label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),onToggle:t}),l&&(0,B.jsx)(oe,{items:u})]})]})})}function H({icon:e,title:t,children:n}){return(0,B.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,B.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,B.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,B.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var ge=240,_e=`max-h-60`;function ve({prompt:e}){let{t}=s(`openhands`),[n,r]=z.useState(!1),[i,a]=z.useState(!1),c=z.useRef(null),l=i&&!n;return z.useLayoutEffect(()=>{let e=c.current;if(!e)return;let t=()=>{a(e.scrollHeight>ge)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,B.jsx)(H,{icon:(0,B.jsx)(w,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PROMPT),children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(`p`,{ref:c,className:d(`whitespace-pre-wrap text-sm leading-6 text-content`,l&&d(_e,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),l?(0,B.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,B.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?o.COMMON$VIEW_LESS:o.COMMON$VIEW_MORE)}):null]})})}var ye=e=>(0,B.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),be=e=>(0,B.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,B.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,B.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,B.jsx)(`circle`,{cx:9,cy:18,r:2})]}),U=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),W=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),xe=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function G({icon:e,label:t,children:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,B.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,B.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function Se({branch:e}){return(0,B.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}var K=60;function Ce({filter:e}){let{t}=s(`openhands`),[n,r]=(0,z.useState)(!1),i=e.length>K;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`break-all`,children:i&&!n?`${e.slice(0,K)}…`:e}),i&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?o.SETTINGS$SKILLS_SHOW_LESS:o.SETTINGS$SKILLS_SHOW_MORE)})]})}function we({automation:e}){let{t}=s(`openhands`),n=e.trigger.type===`event`,r=e.trigger.schedule??``;e.trigger.schedule_human&&(r=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let i=t(n?o.AUTOMATIONS$DETAIL$TRIGGER_EVENT:o.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,B.jsx)(H,{icon:(0,B.jsx)(ye,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,B.jsx)(G,{icon:(0,B.jsx)(be,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,B.jsx)(Se,{branch:e.branch})]})}),(0,B.jsx)(G,{icon:(0,B.jsx)(U,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,B.jsx)(G,{icon:(0,B.jsx)(W,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,B.jsx)(G,{icon:(0,B.jsx)(A,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,B.jsx)(G,{icon:(0,B.jsx)(k,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$EVENT_TYPE),children:P(e.trigger.on)}),n&&e.trigger.filter&&(0,B.jsx)(G,{icon:(0,B.jsx)(O,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,B.jsx)(Ce,{filter:e.trigger.filter})}),(0,B.jsx)(G,{icon:(0,B.jsx)(I,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$MODEL),children:e.model??`Active profile`}),e.notification&&(0,B.jsx)(G,{icon:(0,B.jsx)(xe,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var Te=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function Ee({name:e}){return(0,B.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function De({plugins:e}){let{t}=s(`openhands`);return(0,B.jsx)(H,{icon:(0,B.jsx)(Te,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PLUGINS),children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,B.jsx)(Ee,{name:e},e))})})}var q=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function J(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function Oe(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),s=Math.floor(r/864e5);return i<1?n(o.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(o.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(o.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):s===1?n(o.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(o.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):J(e,t)}function ke({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=s(`openhands`),i=r.language;return(0,B.jsx)(H,{icon:(0,B.jsx)(q,{className:`size-4`}),title:n(o.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,B.jsx)(G,{icon:(0,B.jsx)(W,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$CREATED),children:J(e,i)}),(0,B.jsx)(G,{icon:(0,B.jsx)(L,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$LAST_RUN),children:t?Oe(t,i,n):n(o.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Ae=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),je={[R.COMPLETED]:{label:o.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[R.FAILED]:{label:o.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[R.PENDING]:{label:o.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[R.RUNNING]:{label:o.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function Me({status:e}){switch(e){case R.COMPLETED:return(0,B.jsx)(U,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case R.FAILED:return(0,B.jsx)(Ae,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,B.jsx)(L,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Ne({status:e}){let{t}=s(`openhands`),n=je[e];return(0,B.jsxs)(`span`,{className:d(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,B.jsx)(Me,{status:e}),t(n.label)]})}var Pe=20;function Fe(e){return e.kind===`BashOutput`}var Ie=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<Pe;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{Fe(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=p().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),x({backend:r,method:`GET`,hostOverride:f(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new g(m({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Le=[`bash-command-logs`];function Re(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function Y(e){if(!b.isAxiosError(e))return null;if(!e.response)return`unreachable`;let t=e.response.status;return t===404||t>=500?`unreachable`:null}function ze(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,a=h(),o=T(r?t??null:null),s=o.data,c=s?.conversation_url??null,l=s?.session_api_key??null,u=a.backend.kind===`cloud`,d=o.isFetched,f=null,p=!1;u&&d&&(s?f=Re(s.sandbox_status)??(s.conversation_url?null:`missing`):p=!0);let m=r&&!!n&&(u?!!c:!0)&&!f&&!p,g=i({queryKey:[...Le,n,c,l,a.backend.id,a.orgId],queryFn:()=>Ie.listOutputs(c,l,n),enabled:m,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Y(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&o.isPending,conversationMissing:p,sandboxIssue:v}}var Be={missing:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function X(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function Ve({conversationId:e,bashCommandId:t,isOpen:n,onClose:r}){let{t:i}=s(`openhands`),[a,c]=(0,z.useState)(`stdout`),{data:l,isFetching:u,isResolvingConversation:f,sandboxIssue:p,conversationMissing:m,error:h}=ze({conversationId:e,bashCommandId:t,enabled:n});(0,z.useEffect)(()=>{n&&c(`stdout`)},[n,t]),(0,z.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:g,stderr:v}=(0,z.useMemo)(()=>l?{stdout:X(l,`stdout`),stderr:X(l,`stderr`)}:{stdout:``,stderr:``},[l]);if(!n)return null;let y=f||u&&!l,b=!t,x=a===`stdout`?g:v,S=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,C=`border-[var(--oh-primary)] text-white`,w=`border-transparent text-muted hover:text-content`;return(0,B.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,B.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,B.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,B.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":i(o.AUTOMATIONS$CANCEL),children:(0,B.jsx)(D,{className:`size-5`})}),(0,B.jsx)(`h2`,{className:d(`pr-8`,_),children:i(o.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,B.jsxs)(`div`,{role:`tablist`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,B.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:a===`stdout`?0:-1,onClick:()=>c(`stdout`),className:`${S} ${a===`stdout`?C:w}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,B.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:a===`stderr`?0:-1,onClick:()=>c(`stderr`),className:`${S} ${a===`stderr`?C:w}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${a}`,"aria-labelledby":`run-logs-tab-${a}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[b&&(0,B.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!b&&m&&(0,B.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!b&&!m&&p&&(0,B.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${p}`,className:`text-muted italic`,children:i(Be[p])}),!b&&!m&&!p&&y&&(0,B.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!b&&!m&&!p&&!y&&h&&!l&&(0,B.jsxs)(`p`,{className:`text-danger`,children:[i(o.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(h)]}),!y&&!p&&l&&(0,B.jsx)(`pre`,{"data-testid":`run-logs-output-${a}`,className:`whitespace-pre-wrap break-words ${a===`stderr`?`text-danger`:`text-content`}`,children:x.length>0?x:(0,B.jsx)(`span`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]})]})]})}function He(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Ue(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function We(e){return`/conversations/${e}`}function Ge({run:e}){let{t,i18n:n}=s(`openhands`),r=!!e.conversation_id,i=!!e.bash_command_id,a=e.status===R.COMPLETED||e.status===R.FAILED,c=!r&&a,[l,u]=(0,z.useState)(!1),[d]=(0,z.useState)(()=>new Date().toISOString()),f=He(Ue(e.started_at)?d:e.started_at,n.language),p=i?(0,B.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),u(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":t(o.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:f}),title:t(o.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,B.jsx)(w,{className:`size-4`})}):null,m=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`text-sm text-content`,children:f}),c&&(0,B.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,t(o.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,B.jsx)(Ne,{status:e.status})]})]});return(0,B.jsxs)(B.Fragment,{children:[r&&e.conversation_id?(0,B.jsx)(`a`,{href:We(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":`View conversation for run at ${f}`,children:m}):(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:m}),i&&(0,B.jsx)(Ve,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:l,onClose:()=>u(!1)})]})}var Z=20;function Ke({automationId:e}){let{t}=s(`openhands`),[n,r]=(0,z.useState)(Z),{data:i,isLoading:a}=M({id:e,limit:n,offset:0}),c=i?i.total>i.runs.length:!1;return(0,B.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,B.jsx)(`span`,{className:`size-4 text-muted`,children:(0,B.jsx)(q,{className:`size-4`})}),(0,B.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(o.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),a&&(0,B.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,B.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,B.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!a&&i?.runs.length===0&&(0,B.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(o.AUTOMATIONS$DETAIL$NO_RUNS)}),!a&&i&&i.runs.length>0&&(0,B.jsxs)(`div`,{children:[i.runs.map((e,t)=>(0,B.jsx)(`div`,{className:t>0?`border-t border-[var(--oh-border)]`:``,children:(0,B.jsx)(Ge,{run:e})},e.id)),c&&(0,B.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+Z),className:`text-sm text-muted hover:text-foreground`,children:t(o.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function Q({className:e}){return(0,B.jsx)(`div`,{className:d(`animate-pulse rounded bg-surface-raised`,e)})}function $(){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,B.jsx)(Q,{className:`h-5 w-40`}),(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Q,{className:`h-6 w-48`}),(0,B.jsx)(Q,{className:`h-6 w-16 rounded-full`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Q,{className:`h-6 w-11 rounded-full`}),(0,B.jsx)(Q,{className:`h-8 w-8`})]})]}),(0,B.jsx)(Q,{className:`h-5 w-96`}),(0,B.jsx)(Q,{className:`h-36 w-full rounded-2xl`}),(0,B.jsx)(Q,{className:`h-72 w-full rounded-2xl`}),(0,B.jsx)(Q,{className:`h-32 w-full rounded-2xl`}),(0,B.jsx)(Q,{className:`h-40 w-full rounded-2xl`})]})}function qe(){let{t:e}=s(`openhands`);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,B.jsx)(N,{className:`size-12 text-muted`}),(0,B.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsx)(V,{})})]})}var Je=n(function(){let{t:e}=s(`openhands`),{automationId:t}=r(),{navigate:n}=v(),[i,a]=(0,z.useState)(!1),[c,d]=(0,z.useState)(!1),{data:f,isLoading:p,refetch:m}=ne(),g=f?.status===`ok`,_=h(),b=(0,z.useRef)(_.backend.id).current!==_.backend.id,{data:x,isLoading:C,isError:w,error:T,refetch:E}=de({id:t??``,enabled:g&&!b}),{trackPrebuiltAutomationEnabled:D}=S(),O=ee(),k=ue(),A=fe(),j=w&&y(T)&&T.response?.status===404;if(p)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)($,{})})});if(!g)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(se,{onRetry:m})})});if(C)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)($,{})})});if(j)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(qe,{})})});if(w||!x)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(re,{onRetry:()=>E()})})});let M=()=>{let e=!x.enabled;O.mutate({id:x.id,enabled:e}),e&&D({automationId:x.id,automationName:x.name})},N=()=>{k.mutate(x.id,{onSuccess:()=>{n?.(`/automations`)}})},P=()=>{A.mutate(x.id,{onSuccess:()=>{u(e(o.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{l(y(t)?t.response?.data?.message||t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR):t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR))}})},F=_.backend.kind===`local`;return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(V,{}),(0,B.jsx)(he,{automation:x,onToggle:M,onEdit:F?()=>d(!0):void 0,onDelete:()=>a(!0),onRunNow:P,isRunningNow:A.isPending}),x.prompt&&(0,B.jsx)(ve,{prompt:x.prompt}),(0,B.jsx)(we,{automation:x}),x.plugins&&x.plugins.length>0&&(0,B.jsx)(De,{plugins:x.plugins}),(0,B.jsx)(ke,{createdAt:x.created_at,lastRunAt:x.last_triggered_at}),(0,B.jsx)(Ke,{automationId:x.id}),(0,B.jsx)(ie,{automationName:x.name,isOpen:i,onConfirm:N,onCancel:()=>a(!1)}),F&&(0,B.jsx)(le,{automation:x,isOpen:c,onClose:()=>d(!1)})]})})})});export{Je as default};
|