@openhands/agent-canvas 1.0.0-rc.2 → 1.0.0-rc.4
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/acp-providers-C55k29rf.js +1 -0
- package/build/assets/{add-backend-modal-CIfhseZn.js → add-backend-modal-BdYxoUdL.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-js3oYcdU.js +5 -0
- package/build/assets/{agent-settings-B6htMeS2.js → agent-settings-BNrffu3I.js} +1 -1
- package/build/assets/{alert-banner-D41ZKDZT.js → alert-banner-BzU93oDh.js} +1 -1
- package/build/assets/{analytics-consent-form-modal-TINgM_jV.js → analytics-consent-form-modal-DIfCKp6g.js} +1 -1
- package/build/assets/{api-key-entry-screen-Di1vHgIU.js → api-key-entry-screen-CGyS-Cna.js} +1 -1
- package/build/assets/{app-settings-CjCa1MOB.js → app-settings-DmOs4oik.js} +1 -1
- package/build/assets/{automation-detail-DPoxzTdV.js → automation-detail-DLbCVJCw.js} +1 -1
- package/build/assets/{automations-list-DwUEe2Ea.js → automations-list-CoYj4o97.js} +1 -1
- package/build/assets/{backend-form-modal-B6q897ZX.js → backend-form-modal-BUy-PzZN.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-BwTawSCE.js → backend-synced-settings-badge-1A63yxGs.js} +1 -1
- package/build/assets/browser-B8bp1IqT.js +5 -0
- package/build/assets/{browser-tab-DiRTKik8.js → browser-tab-CiBRWB4X.js} +1 -1
- package/build/assets/chat-send-button-qKFZuB9E.js +1 -0
- package/build/assets/{circle-plus-check-toggle-B3_W6-nt.js → circle-plus-check-toggle-CboDp7XB.js} +1 -1
- package/build/assets/{condenser-settings-DczjwkIp.js → condenser-settings-FCBjvqSo.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-store-CiYGBud3.js +6 -0
- package/build/assets/conversation-vNuLKgz6.js +19 -0
- package/build/assets/conversation-websocket-context-Bb4XBXoc.js +3 -0
- package/build/assets/{device-verify-BVl4GEvt.js → device-verify-BOQz2LJQ.js} +1 -1
- package/build/assets/{edit-automation-modal-kc_FzbzK.js → edit-automation-modal-C-oC5tis.js} +1 -1
- package/build/assets/{entry.client-CWkbusD1.js → entry.client-Db3BpFL_.js} +2 -2
- package/build/assets/{enum-filter-dropdown-DlY0Q3fj.js → enum-filter-dropdown-DFwoVtOw.js} +1 -1
- package/build/assets/{extensions-hub-NbQnt-cn.js → extensions-hub-BxZbAtjP.js} +1 -1
- package/build/assets/extensions-navigation-BIb-vAa2.js +1 -0
- package/build/assets/{files-tab-mK7Mdyuf.js → files-tab-DpulQlIo.js} +1 -1
- package/build/assets/{git-control-bar-branch-button-C1qmab0K.js → git-control-bar-branch-button-D1uam-nI.js} +1 -1
- package/build/assets/home-D77Xasws.js +1 -0
- package/build/assets/install-server-modal-BjmEphcZ.js +1 -0
- package/build/assets/{launch-BADsYeGp.js → launch-DgtB1JTX.js} +1 -1
- package/build/assets/llm-settings-B8kPJ0Of.js +1 -0
- package/build/assets/llm-settings-CjUpPsvA.js +1 -0
- package/build/assets/{manage-backends-modal-sH7l5NgI.js → manage-backends-modal-CTA-2x4F.js} +1 -1
- package/build/assets/manifest-510dd26f.js +1 -0
- package/build/assets/{markdown-renderer-CZq_UdmE.js → markdown-renderer-oOUs3tw5.js} +1 -1
- package/build/assets/{mcp-DdQ72_AO.js → mcp-CiokQDek.js} +2 -2
- package/build/assets/messages-BFJXB6MW.js +36 -0
- package/build/assets/model-selector-z_QOzaRV.js +1 -0
- package/build/assets/{onboarding-DCL9stdH.js → onboarding-CGUaLHfQ.js} +1 -1
- package/build/assets/{path-utils-CNd_jqv_.js → path-utils-0KWEiRs9.js} +1 -1
- package/build/assets/{planner-tab-QBnZgIXd.js → planner-tab-CNmJiZ22.js} +1 -1
- package/build/assets/{recommended-automations-launcher-B01jchhe.js → recommended-automations-launcher-C1_CKGHa.js} +8 -10
- package/build/assets/{root-BBV8Ew9E.js → root-DXsSPxni.js} +2 -2
- package/build/assets/root-layout-N4s3RLlj.js +2 -0
- package/build/assets/{sdk-section-page-BQKe3asw.js → sdk-section-page-DTyvCc52.js} +1 -1
- package/build/assets/{sdk-settings-schema-DoRnefvb.js → sdk-settings-schema-B0KrqqPX.js} +1 -1
- package/build/assets/{secrets-settings-D2EfzdpC.js → secrets-settings-BQNSDLKS.js} +1 -1
- package/build/assets/{settings-B7jVceyu.js → settings-BUlJrO_h.js} +1 -1
- package/build/assets/{settings-dropdown-input-BD7ziSoR.js → settings-dropdown-input-BUk4m23x.js} +1 -1
- package/build/assets/{settings-index-Xj0v9Oas.js → settings-index-DE91Eahc.js} +1 -1
- package/build/assets/{settings-modal-CDBy1S9S.js → settings-modal-CCaPYVqW.js} +1 -1
- package/build/assets/{settings-service.api-CTQ-LpAA.js → settings-service.api-4u2RKC8k.js} +1 -1
- package/build/assets/{settings-switch-CSHSqH99.js → settings-switch-BQiAS9ga.js} +1 -1
- package/build/assets/{settings-utils-BCbzc6-u.js → settings-utils-chxTa1vn.js} +1 -1
- package/build/assets/{shared-conversation-BHEbOdHj.js → shared-conversation-sBPLAawM.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-YYPXGikp.js → sidebar-mobile-menu-toggle-BDXWzhyB.js} +1 -1
- package/build/assets/{sidebar-nav-link-CiXbBMQx.js → sidebar-nav-link-Bhlzlhp8.js} +1 -1
- package/build/assets/{skill-card-pill-row-BXILn-GK.js → skill-card-pill-row-Bg5joQf6.js} +1 -1
- package/build/assets/{skills-plugins-Bs5HiF1O.js → skills-plugins-fihjo1KZ.js} +1 -1
- package/build/assets/{skills-settings-CQYxMmWf.js → skills-settings-NQnuMwZP.js} +1 -1
- package/build/assets/{styled-tooltip-DEr7oa0m.js → styled-tooltip-GXy1qxsO.js} +1 -1
- package/build/assets/{task-list-tab-R9N3Wd-U.js → task-list-tab-Hl9BuVfq.js} +1 -1
- package/build/assets/telemetry-BoedM0mF.js +2 -0
- package/build/assets/{terminal-BTM3UFcQ.js → terminal-DRwe8--D.js} +1 -1
- package/build/assets/{use-active-conversation-BY5F6A1G.js → use-active-conversation-DJGoI9Mc.js} +1 -1
- package/build/assets/{use-agent-settings-schema-CsuMq16G.js → use-agent-settings-schema-DtusObuC.js} +1 -1
- package/build/assets/{use-agent-state-DX5NKEa_.js → use-agent-state-BXgWhFh6.js} +1 -1
- package/build/assets/{use-create-conversation-4iJytCT1.js → use-create-conversation-CzvaVA5A.js} +1 -1
- package/build/assets/use-event-store-DSpvASbC.js +1 -0
- package/build/assets/{use-get-secrets-BMnFFBUx.js → use-get-secrets-DiLgP147.js} +1 -1
- package/build/assets/use-handle-plan-click-CUZwmKIk.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-BoqKmEHC.js → use-launch-skill-in-chat-ClRJlIx7.js} +1 -1
- package/build/assets/use-runtime-is-ready-CWkGQFsb.js +1 -0
- package/build/assets/{use-save-settings-hK6LYt0s.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-oZ-BlOWX.js → use-settings-nav-items-C6YxUn4h.js} +1 -1
- package/build/assets/{use-task-list-DydbuRFM.js → use-task-list-JPudBRv3.js} +1 -1
- package/build/assets/{use-tracking-DQU60djN.js → use-tracking-CjLZgh8X.js} +1 -1
- package/build/assets/{use-unified-vscode-url-D2Buvmxj.js → use-unified-vscode-url-DSn2tT08.js} +1 -1
- package/build/assets/{use-user-conversation-DwOGM1lc.js → use-user-conversation-CQ5IwnZk.js} +1 -1
- package/build/assets/{vendor~browser-3J6WDaAB.js → vendor~browser-Dwwc84Zf.js} +1 -1
- package/build/assets/{vendor~browser-tab-DYZ-OmbT.js → vendor~browser-tab-Bhohe29F.js} +1 -1
- package/build/assets/{vendor~files-tab-Diy4WrQz.js → vendor~files-tab-B447_Zns.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CWwn0K2j.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-dZ3D8RVL.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-BighOCzm.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-D13hiNGV.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-ojk_J4bB.js} +1 -1
- package/build/assets/{vendor~launch-D65Vw0VZ.js → vendor~launch-BdXJCmwc.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-BJPgfJoU.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-BkicN-14.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-Cwz6a1DC.js → vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-BaCzvZac.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-C37jLHRk.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-JQ-neDIa.js → vendor~root-layout~home~mcp~automations-list-CtdIEhjQ.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~automations-list-BTTZ58Mb.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-UYEKKX0Y.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js} +2 -2
- package/build/assets/{verification-settings-Rabe5TpK.js → verification-settings-Cm02KmeI.js} +1 -1
- package/build/assets/{vscode-tab-zLD5Z-PP.js → vscode-tab-AF70Yke0.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +1 -1
- package/build/locales/ca/openhands.json +1 -1
- package/build/locales/de/openhands.json +1 -1
- package/build/locales/en/openhands.json +1 -1
- package/build/locales/es/openhands.json +1 -1
- package/build/locales/fr/openhands.json +1 -1
- package/build/locales/it/openhands.json +1 -1
- package/build/locales/ja/openhands.json +1 -1
- package/build/locales/ko-KR/openhands.json +1 -1
- package/build/locales/no/openhands.json +1 -1
- package/build/locales/pt/openhands.json +1 -1
- package/build/locales/tr/openhands.json +1 -1
- package/build/locales/uk/openhands.json +1 -1
- package/build/locales/zh-CN/openhands.json +1 -1
- package/build/locales/zh-TW/openhands.json +1 -1
- package/config/defaults.json +2 -6
- 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 +90 -85
- 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/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +19 -14
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +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/home/workspace-selection-form.d.ts +1 -0
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +63 -62
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +8 -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 -1
- package/dist/components/features/skills/extensions-navigation.js +27 -29
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/i18n/translation.cjs +1 -1
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +15 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +1 -1
- package/dist/locales/ca/openhands.json +1 -1
- package/dist/locales/de/openhands.json +1 -1
- package/dist/locales/en/openhands.json +1 -1
- package/dist/locales/es/openhands.json +1 -1
- package/dist/locales/fr/openhands.json +1 -1
- package/dist/locales/it/openhands.json +1 -1
- package/dist/locales/ja/openhands.json +1 -1
- package/dist/locales/ko-KR/openhands.json +1 -1
- package/dist/locales/no/openhands.json +1 -1
- package/dist/locales/pt/openhands.json +1 -1
- package/dist/locales/tr/openhands.json +1 -1
- package/dist/locales/uk/openhands.json +1 -1
- package/dist/locales/zh-CN/openhands.json +1 -1
- package/dist/locales/zh-TW/openhands.json +1 -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 +5 -3
- 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/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 +5 -3
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +83 -124
- package/scripts/dev-with-automation.mjs +83 -5
- package/scripts/logger.mjs +77 -0
- package/scripts/runtime-services-info.mjs +199 -0
- package/scripts/static-server.mjs +42 -4
- package/build/assets/acp-providers-DZEi8wDz.js +0 -1
- package/build/assets/agent-server-conversation-service.api-B82pNNTm.js +0 -5
- package/build/assets/browser-DTei6kki.js +0 -5
- package/build/assets/chat-send-button-06dIuWXm.js +0 -1
- package/build/assets/conversation-CBlJiDaV.js +0 -19
- package/build/assets/conversation-Dss8XCN_.js +0 -1
- package/build/assets/conversation-panel-B5sVpsz5.js +0 -1
- package/build/assets/conversation-service.api-B4s-xIOK.js +0 -1
- package/build/assets/conversation-store-kHcewy1E.js +0 -1
- package/build/assets/conversation-websocket-context-C2yKCqvj.js +0 -3
- package/build/assets/extensions-navigation-oOk5yl8X.js +0 -1
- package/build/assets/home-ChuA06Hv.js +0 -1
- package/build/assets/install-server-modal--lZ1HSHB.js +0 -1
- package/build/assets/llm-settings-D477P0Lg.js +0 -1
- package/build/assets/llm-settings-DtlQ7i4C.js +0 -1
- package/build/assets/manifest-17af0b17.js +0 -1
- package/build/assets/messages-luW9zf1w.js +0 -36
- package/build/assets/middleware-B5rcobhi.js +0 -6
- package/build/assets/model-selector-DzQRgNGZ.js +0 -1
- package/build/assets/root-layout-pQASEqtQ.js +0 -2
- package/build/assets/sidebar-store-B76R2gP8.js +0 -1
- package/build/assets/telemetry-DCrd7gnV.js +0 -2
- package/build/assets/use-event-store-Rw1YbvLm.js +0 -1
- package/build/assets/use-handle-plan-click-DYd5a6zN.js +0 -1
- package/build/assets/use-runtime-is-ready-DP-KKHO6.js +0 -1
- package/build/assets/use-settings-Clf0Y_P3.js +0 -1
- /package/build/assets/{automation-LZB0MjdV.js → automation-BzmydDjr.js} +0 -0
- /package/build/assets/{browser-store-BjhV_9wS.js → browser-store-C5uQbbIi.js} +0 -0
- /package/build/assets/{checkmark-BB7QCG5T.js → checkmark-SEZPnU2I.js} +0 -0
- /package/build/assets/{chevron-left-small-CuuwpRi9.js → chevron-left-small-x9_-ucHG.js} +0 -0
- /package/build/assets/{close-Cz0OAgTy.js → close-CbOsKMRg.js} +0 -0
- /package/build/assets/{code-tag-Cz9AIz-X.js → code-tag-C0vR_IQH.js} +0 -0
- /package/build/assets/{command-store-DAd3K0d_.js → command-store-BUWgE-vZ.js} +0 -0
- /package/build/assets/{confirmation-modal-C_lds1Tb.js → confirmation-modal-BPgWqWRI.js} +0 -0
- /package/build/assets/{context-menu-list-item-DhG1Ln5m.js → context-menu-list-item-CHWCx1Mc.js} +0 -0
- /package/build/assets/{conversation-state-store-BUU90dVq.js → conversation-state-store-DpgQaK_O.js} +0 -0
- /package/build/assets/{conversation-tab-empty-state-5bW9CQke.js → conversation-tab-empty-state-Ba5hbJhn.js} +0 -0
- /package/build/assets/{copy-CA1Dblua.js → copy-CAxUvM-U.js} +0 -0
- /package/build/assets/{dist-CBUfAk0Z.js → dist-CeJSjcAI.js} +0 -0
- /package/build/assets/{ellipsis-button-DRRmCrWi.js → ellipsis-button-CiLx8dqc.js} +0 -0
- /package/build/assets/{environment-switch-overlay-BrHKX6_Z.js → environment-switch-overlay-Cow6h62p.js} +0 -0
- /package/build/assets/{file-DM0ihEsO.js → file-BJCSojij.js} +0 -0
- /package/build/assets/{files-tab-store-QlUCuW8b.js → files-tab-store-CZAEwv3x.js} +0 -0
- /package/build/assets/{folder-UGYUKpqb.js → folder-wShAU0y7.js} +0 -0
- /package/build/assets/{git-status-mapper-N4-7eaeC.js → git-status-mapper-C3rfzUex.js} +0 -0
- /package/build/assets/{globe-2otpEmVh.js → globe-CQ_5xwpo.js} +0 -0
- /package/build/assets/{handle-capture-consent-OitMkDHc.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
- /package/build/assets/{iconBase-B_5IRYeZ.js → iconBase-1A_WRQ4E.js} +0 -0
- /package/build/assets/{lesson-plan-5O2tVbD1.js → lesson-plan-B607buca.js} +0 -0
- /package/build/assets/{link-external-kU6aFXU6.js → link-external-DCsHkAj4.js} +0 -0
- /package/build/assets/{map-provider-BHow6ugd.js → map-provider-XSFHmdDs.js} +0 -0
- /package/build/assets/{modal-close-button-BCvw9IUN.js → modal-close-button-DY-rVmld.js} +0 -0
- /package/build/assets/{plan-components-BRiIX8Wn.js → plan-components-DsiDjcDi.js} +0 -0
- /package/build/assets/{sdk-settings-field-metadata-CtO73dY6.js → sdk-settings-field-metadata-CETNItbo.js} +0 -0
- /package/build/assets/{search-Cbh-hHBu.js → search-BqXT2Ied.js} +0 -0
- /package/build/assets/{secrets-service-DEIB-Cfk.js → secrets-service-rJqZtDmI.js} +0 -0
- /package/build/assets/{settings-KgLvVrSm.js → settings-BgL2HUsU.js} +0 -0
- /package/build/assets/{settings-gear-xGs_SPgZ.js → settings-gear-DFmoMp-6.js} +0 -0
- /package/build/assets/{settings-input-CPr7vX81.js → settings-input-DsoZj8Dm.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-GknosJgv.js → settings-like-page-layout-classes-DENKlZpD.js} +0 -0
- /package/build/assets/{settings-list-classes-CYDn4jUg.js → settings-list-classes-D8VAVZmi.js} +0 -0
- /package/build/assets/{settings-section-header-context-aD2iq1gD.js → settings-section-header-context-D61smD-W.js} +0 -0
- /package/build/assets/{skills-CCaEu1KQ.js → skills-BDOWVle-.js} +0 -0
- /package/build/assets/{switch-skeleton-C87Tx3Tc.js → switch-skeleton-QpdcdxRP.js} +0 -0
- /package/build/assets/{terminal-DQJ6IJUd.js → terminal-BUww3Ssl.js} +0 -0
- /package/build/assets/{toggle-switch-C-7juZ1u.js → toggle-switch-DDr-DnEc.js} +0 -0
- /package/build/assets/{typography-U1gkzkXo.js → typography-Cx7uw7z3.js} +0 -0
- /package/build/assets/{u-check-circle-lbkXL2z4.js → u-check-circle-CftRwky1.js} +0 -0
- /package/build/assets/{u-check-circle-half-CirnoxXG.js → u-check-circle-half-sGVk0BtL.js} +0 -0
- /package/build/assets/{u-circuit-Danff2ks.js → u-circuit-Cg9tH5qb.js} +0 -0
- /package/build/assets/{u-edit-CH5nNya1.js → u-edit-foF02hwH.js} +0 -0
- /package/build/assets/{use-breakpoint-2sN462wJ.js → use-breakpoint-Dt2knceC.js} +0 -0
- /package/build/assets/{use-click-outside-element-_vianyPb.js → use-click-outside-element-Bu2A3s59.js} +0 -0
- /package/build/assets/{use-is-authed-DrocXcet.js → use-is-authed-fNsj-Adj.js} +0 -0
- /package/build/assets/{use-llm-profiles-BhZRf-NX.js → use-llm-profiles-CyNVoVqm.js} +0 -0
- /package/build/assets/{use-skills-v8pQ02ze.js → use-skills-BWHATXK-.js} +0 -0
- /package/build/assets/{v4-BMWDcIWQ.js → v4-BygpdDmc.js} +0 -0
- /package/build/assets/{vendor~browser-C3GKF4mj.js → vendor~browser-BYEwwJqV.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DMcFTqbt.js → vendor~conversation-panel~conversation~alert-banner-BnHToS5O.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Cntsv2EN.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B4oeCCli.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DTosGXG7.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D8cqyq4k.js} +0 -0
- /package/build/assets/{vendor~terminal-CnKZILnC.js → vendor~terminal-aeP3PnKf.js} +0 -0
- /package/build/assets/{vscode-url-helper-CwQPl6QN.js → vscode-url-helper-DOCkV_-G.js} +0 -0
- /package/build/assets/{waiting-for-runtime-message-B1Dzhtj5.js → waiting-for-runtime-message-Bg27u9JB.js} +0 -0
- /package/build/assets/{x-mark-CmcVOTk2.js → x-mark-Cn-YJVbN.js} +0 -0
|
@@ -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-IA661TBv.js";import{t}from"./vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-Cwz6a1DC.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,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-DEIB-Cfk.js","assets/rolldown-runtime-BFRubm34.js","assets/settings-client-BUlG0Gzq.js","assets/agent-server-client-options-Dvgeb3x4.js","assets/proxy-wIasY2Po.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./preload-helper-CT1Z6Pdu.js";import{t}from"./common-Cfviy7yT.js";import{D as n,a as r,b as i,c as a,n as o,t as s,u as c,w as l}from"./agent-server-client-options-Dvgeb3x4.js";import{n as ee,r as u}from"./settings-client-BUlG0Gzq.js";import{c as d,n as f,s as p}from"./vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-Cwz6a1DC.js";import{t as m}from"./profiles-client-CesbAK-7.js";import{n as h}from"./agent-server-compatibility-BANjmMTo.js";import{n as g,t as _}from"./proxy-wIasY2Po.js";import{t as v}from"./v4-BMWDcIWQ.js";import{t as y}from"./settings-KgLvVrSm.js";import{a as b,u as x}from"./acp-providers-DZEi8wDz.js";import{t as S}from"./settings-service.api-CTQ-LpAA.js";var C=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new ee({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 u&&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=o(e),n=t.host,r=w.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new d(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 ie(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?ne(n)?n:re(await T(t),n):T(t)}var E=`openhands-agent-server-conversation-metadata`,D=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(E);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},O=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(E);return}window.localStorage.setItem(E,JSON.stringify(e))}},k=e=>D()[e]??null,A=(e,t)=>{let n=D();n[e]=t,O(n)},j=e=>{let t=D();e in t&&(delete t[e],O(t))};function M(e){if(!e?.id)return e;let t=k(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 N(){let e=a().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function ae(e=20,t){let n=N(),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=>M(e)),next_page_id:i?.next_page_id??null}}async function P(e){if(e.length===0)return[];let t=N(),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(M)}async function oe(e){return await _({backend:N(),method:`POST`,path:`/api/v1/app-conversations`,body:e})}async function se(e){return _({backend:N(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function ce(e){await _({backend:N(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function le(e,t){return await _({backend:N(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function ue(e){await _({backend:N(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function de(e){await _({backend:N(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function fe(e,t){let n=N(),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 pe(e){let t=N(),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 F=`canvas_ui`,me=`canvas_ui_tool`,he=[`terminal`,`file_editor`,`task_tracker`,F],I=`browser_tool_set`,L=`task_tool_set`;function ge(){return!0}function _e(){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 ve(){let e=_e();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 ye(e){let{host:t}=o();return`${t}/api/conversations/${e}`}function R(e){return`Conversation ${e.slice(0,5)}`}function z(e){let n=k(e.id),r=e.agent?.kind===`ACPAgent`,i=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,active_profile:n?.active_profile??null,title:e.title?.trim()?e.title:R(e.id),trigger:null,pr_number:[],agent_kind:r?`acp`:`openhands`,acp_server:i,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:ye(e.id),session_api_key:o().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??l()},public:!1,sub_conversation_ids:[]}}function be(e){return{items:e.items.map(z),next_page_id:e.next_page_id??null}}var B=[`acp_command`,`acp_args`,`acp_model`,`acp_session_mode`,`acp_prompt_timeout`],xe=`acpserver`,Se=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function V(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function H(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Ce(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function we(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function Te(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function U(e,t){return e===I?ge()&&h(e):e===L?t.enable_sub_agents===!0&&h(e):!0}function Ee(e){let t=new Map;for(let e of he)t.set(e,{name:e,params:{}});for(let n of[I,L])U(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>Te(e)))for(let r of n)U(r.name,e)&&t.set(r.name,{name:r.name,params:V(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=ve();return{...V(e.agent_context),load_public_skills:n(),load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function G(e){return V(e.agent_settings).agent_kind===`acp`}function Oe(e){let t=V(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=V(e.agent_settings),n={agent_kind:`acp`,agent_context:W(t)};for(let e of B){if(e===`acp_model`)continue;let r=e===`acp_command`?ke(t):t[e];r!=null&&(n[e]=r)}let r=V(t.mcp_config);Object.keys(r).length>0&&`mcpServers`in r&&(n.mcp_config=r);let i=b(typeof t.acp_server==`string`?t.acp_server:void 0),a=x({configured:t.acp_model,providerDefault:i?.default_model});return a&&(n.acp_model=a),n}function je(e){let t=V(e.agent_settings),n=V(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:y.llm_model;let r=H(n.api_key);r?n.api_key=r:delete n.api_key;let i=H(n.base_url);i?n.base_url=i:delete n.base_url;let a=V(t.mcp_config);(Object.keys(a).length===0||!(`mcpServers`in a))&&delete t.mcp_config,delete t.acp_server;for(let e of B)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:i,workingDir:a}=e,o=V(t.conversation_settings),s=De(n,r);return Se.forEach(e=>delete o[e]),{...o,workspace:{kind:`LocalWorkspace`,working_dir:a??l()},...s?{initial_message:s}:{},...i?.length?{plugins:i.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:Ce(a),max_iterations:typeof a.max_iterations==`number`?a.max_iterations:500,stuck_detection:!0,autotitle:!0,worktree:!0};i&&(o.tags={[xe]:i}),e.secretsEncrypted&&(o.secrets_encrypted=!0),e.conversationId&&(o.conversation_id=e.conversationId);let s=we(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={[F]:me,...a.tool_module_qualnames??{}},a.agent_definitions&&(o.agent_definitions=a.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=c(),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-DEIB-Cfk.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4,5])),[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 i=a().backend,s=n?.conversationUrl??null,c=n?.sessionApiKey??null;if(i.kind===`cloud`){if(!s||!c){let[t]=await P([e]);s=t?.conversation_url?.trim()??null,c=t?.session_api_key?.trim()??null}if(!s||!c)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await _({backend:i,method:`POST`,hostOverride:r(s),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:c}),t}return await new C(o({conversationUrl:s,sessionApiKey:c})).sendEvent(e,t,{run:!0}),t}static async createConversation(e,t,n,r,l,ee,u,d){if(a().backend.kind===`cloud`)return oe({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:t??null,selected_repository:r?.selected_repository??null,selected_branch:r?.selected_branch??null,git_provider:r?.git_provider??null,plugins:n??null,parent_conversation_id:ee??null,agent_type:u,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 ie(l??i(p))}),h=await new C(o()).createConversation(m),g=c();if(!g)throw new s;return(r?.selected_repository||l)&&A(h.id,{selected_repository:r?.selected_repository??null,selected_branch:r?.selected_branch??null,git_provider:r?.git_provider??null,selected_workspace:l??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 a().backend.kind===`cloud`?pe(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new p(o({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??l()}static async batchGetAppConversations(e){return e.length===0?[]:a().backend.kind===`cloud`?P(e):$(await new C(o()).getConversations(e)).map(e=>z(e))}static async updateConversationPublicFlag(e,t){if(a().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return le(e,t)}static async updateConversationRepository(e,t,n,r){t?A(e,{...k(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):j(e);let[i]=await this.batchGetAppConversations([e]);return Ye(i,e)}static async readConversationFile(e,t){if(a().backend.kind===`cloud`)return fe(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 d(o()).downloadTextFile(r)}static async downloadConversation(e){return a().backend.kind===`cloud`?se(e):new d(o()).downloadTrajectory(e)}static async getHooks(e){return Ie()}static async getRuntimeConversation(e,t,n){let i=a().backend,s=i.kind===`cloud`&&t?await _({backend:i,method:`GET`,hostOverride:r(t),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:n}):await new C(o({conversationUrl:t,sessionApiKey:n})).getConversation(e),c=Ge(s),l=q(s)?s.stats:null;return{id:c.id,title:c.title?.trim()?c.title:R(c.id),metrics:Q(c.metrics),created_at:c.created_at,updated_at:c.updated_at,status:Je(c.execution_status),stats:q(l)?l:{usage_to_metrics:{}}}}static async searchConversations(e=20,t){return a().backend.kind===`cloud`?ae(e,t):be(Ke(await new C(o()).searchConversations({limit:e,page_id:t,sort_order:f.UPDATED_AT_DESC})))}static async deleteConversation(e){a().backend.kind===`cloud`?await ce(e):await new C(o()).deleteConversation(e),j(e)}static async updateConversationTitle(e,t){await new C(o()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return Ye(n,e)}static async switchProfile(e,t){if(a().backend.kind===`cloud`)throw Error(`LLM profile switching is only supported for local agent-server backends.`);if(!e){await new m(o()).activateProfile(t);return}let n=o(),r=new C(n),i=await new m(n).getProfile(t,{exposeSecrets:`encrypted`}),s=typeof i.config.model==`string`?i.config.model:``;if(!s)throw Error(`Profile '${t}' has no model.`);await r.switchLLM(e,{...i.config,model:s,usage_id:`profile:${t}:${v()}`})}static async switchAcpModel(e,t){if(a().backend.kind===`cloud`)throw Error(`ACP model switching is only supported for local agent-server backends.`);await new C(o()).switchAcpModel(e,t)}};export{k as a,C as c,de as i,P as n,A as o,ue as r,ie as s,Xe as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./common-Cfviy7yT.js";import{t}from"./settings-KgLvVrSm.js";import{t as n}from"./automation-LZB0MjdV.js";import{i as r,n as i,r as a,t as o}from"./vendor~browser-3J6WDaAB.js";var s=[`file1.txt`,`file2.txt`,`file3.txt`],c=[`reboot_skynet.exe`,`target_list.txt`,`terminator_blueprint.txt`],l={home:`/home/openhands`,favorites:[{label:`Downloads`,path:`/home/openhands/Downloads`}],locations:[]},u={"/projects":[{name:`demo-app`,path:`/projects/demo-app`},{name:`sample-tools`,path:`/projects/sample-tools`},{name:`notes-service`,path:`/projects/notes-service`}],"/projects/demo-app":[{name:`web-client`,path:`/projects/demo-app/web-client`},{name:`api-service`,path:`/projects/demo-app/api-service`}],"/projects/demo-app/web-client":[]},d=[i.all(`*/api/bash/execute_bash_command`,async()=>r.json({command:``,exit_code:0,output:``})),i.get(`*/api/file/home`,async()=>r.json(l)),i.get(`*/api/file/search_subdirs`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`)??``,n=u[t]??[];return r.json({path:t,items:n,subdirs:n,next_page_id:null})}),i.get(`*/api/file/:path`,async({params:e})=>r.json({path:`/${e.path?.toString()??`home`}`,subdirs:[]})),i.get(`/api/conversations/:conversationId/list-files`,async({params:e})=>{await o();let t=e.conversationId?.toString();return t?t===`test-conversation-id-2`?r.json(c):r.json(s):r.json(null,{status:400})}),i.get(`/api/conversations/:conversationId/select-file`,async({request:e})=>{await o();let t=new URL(e.url).searchParams.get(`file`)?.toString();return t?r.json({code:`Content of ${t}`}):r.json(null,{status:404})})],f=[{issue_number:6968,title:`Fix merge conflicts`,repo:`octocat/hello-world`,task_type:`MERGE_CONFLICTS`,git_provider:`github`}],p=[{issue_number:268,title:`Fix broken CI checks`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:281,title:`Fix issue`,repo:`octocat/earth`,task_type:`UNRESOLVED_COMMENTS`,git_provider:`github`},{issue_number:293,title:`Update documentation`,repo:`octocat/earth`,task_type:`OPEN_ISSUE`,git_provider:`github`},{issue_number:305,title:`Refactor user service`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:312,title:`Fix styling bug`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:327,title:`Add unit tests`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:331,title:`Implement dark mode`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:345,title:`Optimize build process`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`},{issue_number:352,title:`Update dependencies`,repo:`octocat/earth`,task_type:`FAILING_CHECKS`,git_provider:`github`}],m=[...f,...p],h=[i.get(`*/api/v1/git/suggested-tasks/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`limit`),i=t.searchParams.get(`page_id`),a=[...m];if(i||n){let e=n?parseInt(n,10):30;a=a.slice(0,e)}return r.json({items:a,next_page_id:null})})],g=new Map([[`OpenAI_API_Key`,{value:`test-123`,description:`OpenAI API Key`}],[`Google_Maps_API_Key`,{value:`test-123`,description:`Google Maps API Key`}]]),_=[i.get(`*/api/settings/secrets`,async({request:e})=>{if(new URL(e.url).pathname.split(`/`).filter(Boolean).length>3)return;let t=Array.from(g.entries()).map(([e,{description:t}])=>({name:e,description:t}));return r.json({secrets:t})}),i.get(`*/api/settings/secrets/:name`,async({params:e})=>{let{name:t}=e;if(typeof t!=`string`)return r.json({detail:`Invalid name`},{status:400});let n=g.get(t);return n?new r(n.value,{headers:{"Content-Type":`text/plain`}}):r.json({detail:`Secret not found`},{status:404})}),i.put(`*/api/settings/secrets`,async({request:e})=>{let t=await e.json();return!t?.name||!t?.value?r.json({detail:`name and value are required`},{status:400}):(g.set(t.name,{value:t.value,description:t.description}),r.json({name:t.name,description:t.description}))}),i.delete(`*/api/settings/secrets/:name`,async({params:e})=>{let{name:t}=e;return typeof t==`string`?g.delete(t)?r.json({deleted:!0}):r.json({detail:`Secret not found`},{status:404}):r.json({detail:`Invalid name`},{status:400})})],v=(e,t)=>Array.from({length:e},(e,n)=>({id:`${n+1}`,full_name:`user/repo-${n+1}`,git_provider:t,is_public:Math.random()>.3,stargazers_count:Math.floor(Math.random()*1e3),pushed_at:new Date(Date.now()-Math.random()*90*24*60*60*1e3).toISOString()})),ee=e=>Array.from({length:e},(e,t)=>({name:t===0?`main`:t===1?`develop`:`feature/branch-${t}`,commit_sha:`abc123${t.toString().padStart(3,`0`)}`,protected:t===0,last_push_date:new Date(Date.now()-Math.random()*7*24*60*60*1e3).toISOString()})),y={github:v(120,`github`),gitlab:v(120,`gitlab`),bitbucket:v(120,`bitbucket`)},b=ee(25),x=[{path:`src/components/hello.tsx`,status:`UPDATED`},{path:`src/utils/new-helper.ts`,status:`ADDED`},{path:`src/old-module.py`,status:`DELETED`}];typeof window<`u`&&(window.__setMockGitChanges__=e=>{x=e});var S=[i.get(`*/api/user/repositories`,async({request:e})=>{await o(500);let t=new URL(e.url),n=t.searchParams.get(`selected_provider`),i=parseInt(t.searchParams.get(`page`)||`1`,10),a=parseInt(t.searchParams.get(`per_page`)||`30`,10),s=t.searchParams.get(`sort`)||`pushed`,c=t.searchParams.get(`installation_id`);if(!n)return r.json(`Git provider token required. (such as GitHub).`,{status:401});let l=[...y[n]||[]];if(s===`pushed`?l.sort((e,t)=>new Date(t.pushed_at).getTime()-new Date(e.pushed_at).getTime()):s===`stars`&&l.sort((e,t)=>(t.stargazers_count||0)-(e.stargazers_count||0)),c&&n===`github`){let e=(parseInt(c,10)||0)*20;l=l.slice(e,e+20)}let u=(i-1)*a,d=u+a,f=l.slice(u,d),p=d<l.length,m=i>1,h=Math.ceil(l.length/a),g=``;if(p||m){let e=[];m&&e.push(`</api/user/repositories?page=${i-1}&per_page=${a}>; rel="prev"`),p&&e.push(`</api/user/repositories?page=${i+1}&per_page=${a}>; rel="next"`),e.push(`</api/user/repositories?page=${h}&per_page=${a}>; rel="last"`),e.push(`</api/user/repositories?page=1&per_page=${a}>; rel="first"`),g=e.join(`, `)}let _=[...f];return _.length>0&&g&&(_[0]={..._[0],link_header:g}),r.json(_)}),i.get(`*/api/user/search/repositories`,async({request:e})=>{await o(300);let t=new URL(e.url),n=t.searchParams.get(`query`)||``,i=t.searchParams.get(`selected_provider`),a=parseInt(t.searchParams.get(`per_page`)||`5`,10),s=t.searchParams.get(`sort`)||`stars`,c=t.searchParams.get(`order`)||`desc`;if(!i)return r.json(`Git provider token required.`,{status:401});let l=[...(y[i]||[]).filter(e=>e.full_name.toLowerCase().includes(n.toLowerCase()))];s===`stars`&&l.sort((e,t)=>{let n=e.stargazers_count||0,r=t.stargazers_count||0;return c===`desc`?r-n:n-r});let u=l.slice(0,a);return r.json(u)}),i.get(`*/api/user/repository/branches`,async({request:e})=>{await o(300);let t=new URL(e.url),n=t.searchParams.get(`repository`),i=parseInt(t.searchParams.get(`page`)||`1`,10),a=parseInt(t.searchParams.get(`per_page`)||`30`,10);if(!n)return r.json(`Repository parameter is required`,{status:400});let s=(i-1)*a,c=s+a,l={branches:b.slice(s,c),has_next_page:c<b.length,current_page:i,per_page:a,total_count:b.length};return r.json(l)}),i.get(`*/api/user/search/branches`,async({request:e})=>{await o(200);let t=new URL(e.url),n=t.searchParams.get(`repository`),i=t.searchParams.get(`query`)||``,a=parseInt(t.searchParams.get(`per_page`)||`30`,10);if(!n)return r.json(`Repository parameter is required`,{status:400});let s=b.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())).slice(0,a);return r.json(s)}),i.get(`*/api/git/changes`,async()=>r.json(x)),i.get(`*/api/git/diff`,async()=>r.json({original:`def greet(name):
|
|
2
|
-
return f"Hello, {name}!"
|
|
3
|
-
`,modified:`def greet(name: str) -> str:
|
|
4
|
-
return f"Hello, {name}! Welcome."
|
|
5
|
-
`}))];function C(e,t){let n={...e};for(let[e,r]of Object.entries(t))typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!=null&&!Array.isArray(n[e])?n[e]=C(n[e],r):n[e]=r;return n}var w=t.agent_settings??{},T=w.llm,E=typeof T?.model==`string`?T.model:`openhands/claude-opus-4-5-20251101`,D={model_name:`AgentSettings`,sections:[{key:`general`,label:`General`,fields:[{key:`enable_sub_agents`,label:`Enable sub-agents`,description:`Allow the agent to delegate work to specialized built-in sub-agents.`,section:`general`,section_label:`General`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]},{key:`llm`,label:`LLM`,fields:[{key:`llm.model`,label:`Model`,description:`Select the model to use for this conversation.`,section:`llm`,section_label:`LLM`,value_type:`string`,default:E,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{key:`llm.api_key`,label:`API Key`,description:`Provide the API key used to authenticate requests for the selected model.`,section:`llm`,section_label:`LLM`,value_type:`string`,default:null,choices:[],depends_on:[],prominence:`critical`,secret:!0,required:!1},{key:`llm.base_url`,description:`Override the model provider's default API base URL when needed.`,label:`Base URL`,section:`llm`,section_label:`LLM`,value_type:`string`,default:null,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!1},{key:`llm.temperature`,label:`Temperature`,description:`Adjust randomness for non-deterministic model outputs.`,section:`llm`,section_label:`LLM`,value_type:`number`,default:null,choices:[],depends_on:[],prominence:`minor`,secret:!1,required:!1}]},{key:`critic`,label:`Critic`,fields:[{description:`Enable an additional critic pass to review the agent's work.`,key:`critic.enabled`,label:`Enable critic`,section:`critic`,section_label:`Critic`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{description:`Choose when the critic should review and intervene.`,key:`critic.mode`,label:`Mode`,section:`critic`,section_label:`Critic`,value_type:`string`,default:`finish_and_message`,choices:[{label:`finish_and_message`,value:`finish_and_message`},{label:`all_actions`,value:`all_actions`}],depends_on:[`critic.enabled`],prominence:`minor`,secret:!1,required:!0}]},{key:`condenser`,label:`Condenser`,fields:[{description:`Enable the default LLM-based condenser to summarize long conversation histories.`,key:`condenser.enable_default_condenser`,label:`Enable default condenser`,section:`condenser`,section_label:`Condenser`,value_type:`boolean`,default:!0,choices:[],depends_on:[],prominence:`critical`,secret:!1,required:!0},{description:`Maximum number of tokens the condenser keeps after summarization. Leave blank for unlimited.`,key:`condenser.condenser_max_size`,label:`Condenser max size`,section:`condenser`,section_label:`Condenser`,value_type:`integer`,default:null,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!1}]}]},O={model_name:`ConversationSettings`,sections:[{key:`general`,label:`General`,fields:[{key:`max_iterations`,label:`Max iterations`,section:`general`,description:`Maximum number of agent steps allowed before the conversation stops.`,section_label:`General`,value_type:`integer`,default:500,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!0}]},{key:`verification`,label:`Verification`,fields:[{key:`confirmation_mode`,label:`Confirmation mode`,description:`Pause for confirmation before the agent performs high-risk actions.`,section:`verification`,section_label:`Verification`,value_type:`boolean`,default:!1,choices:[],depends_on:[],prominence:`major`,secret:!1,required:!0},{key:`security_analyzer`,label:`Security analyzer`,description:`Choose how OpenHands should analyze actions before asking for confirmation.`,section:`verification`,section_label:`Verification`,value_type:`string`,default:`llm`,choices:[{label:`llm`,value:`llm`},{label:`none`,value:`none`}],depends_on:[`confirmation_mode`],prominence:`major`,secret:!1,required:!1}]}]},k={...t,provider_tokens_set:{},agent_settings_schema:D,agent_settings:{...w,critic:{mode:`finish_and_message`,enabled:!1},llm:{...T??{},api_key:null,model:E},condenser:{enable_default_condenser:!0,condenser_max_size:null},enable_sub_agents:!1},conversation_settings_schema:O,conversation_settings:{...t.conversation_settings??{}}},A={settings:structuredClone(k)},j={profiles:new Map,activeProfile:null},M=e=>decodeURIComponent(String(Array.isArray(e)?e[0]??``:e??``)),te=e=>({name:e.name,model:typeof e.config.model==`string`?e.config.model:null,base_url:typeof e.config.base_url==`string`?e.config.base_url:null,api_key_set:e.api_key_set}),N=e=>{let t=A.settings||structuredClone(k);A.settings={...t,agent_settings:{...t.agent_settings??{},llm:structuredClone(e.config)},llm_api_key_set:e.api_key_set}},ne=(e,t)=>{let n=structuredClone(e.config);return e.api_key_set&&`api_key`in n&&(t===`encrypted`?n.api_key=`gAAAAA_mock_encrypted_${e.name}`:t===`plaintext`||(n.api_key=null)),{name:e.name,config:n,api_key_set:e.api_key_set}},re=(e,t)=>{let n=structuredClone(t.llm??{});if(typeof n.model!=`string`||n.model.trim().length===0)return null;let r={name:e,config:n,api_key_set:typeof n.api_key==`string`&&n.api_key.trim().length>0};return j.profiles.set(e,r),j.activeProfile===e&&N(r),r},P=[`anthropic/claude-3.5`,`anthropic/claude-sonnet-4-20250514`,`anthropic/claude-sonnet-4-5-20250929`,`anthropic/claude-haiku-4-5-20251001`,`anthropic/claude-opus-4-5-20251101`,`anthropic/claude-opus-4-8`,`openai/gpt-3.5-turbo`,`openai/gpt-4o`,`openai/gpt-4o-mini`,`openhands/claude-sonnet-4-20250514`,`openhands/claude-sonnet-4-5-20250929`,`openhands/claude-haiku-4-5-20251001`,`openhands/claude-opus-4-5-20251101`,`openhands/minimax-m2.7`,`sambanova/Meta-Llama-3.1-8B-Instruct`],F=new Set([`anthropic/claude-opus-4-5-20251101`,`anthropic/claude-opus-4-8`,`anthropic/claude-sonnet-4-5-20250929`,`openhands/claude-opus-4-5-20251101`,`openhands/claude-sonnet-4-5-20250929`,`openhands/minimax-m2.7`]),I=[`openhands`,`anthropic`,`openai`,`mistral`,`gemini`,`deepseek`,`moonshot`,`minimax`],L=Array.from(new Set(P.map(e=>e.split(`/`)[0]).filter(e=>!!e))),ie=P.reduce((e,t)=>{if(!F.has(t))return e;let[n,...r]=t.split(`/`);return!n||r.length===0?e:(e[n]??=[],e[n].push(r.join(`/`)),e)},{}),ae=`1.24.0`,oe=[i.get(`*/server_info`,async()=>r.json({uptime:0,idle_time:0,version:ae,usable_tools:[`terminal`,`file_editor`,`task_tracker`,`browser_tool_set`],agents:[`CodeActAgent`],default_agent:`CodeActAgent`,models:P,security_analyzers:[`llm`,`none`]})),i.get(`*/api/llm/models`,async()=>r.json({models:P})),i.get(`*/api/llm/models/verified`,async()=>r.json({models:ie})),i.get(`*/api/llm/providers`,async()=>r.json({providers:L})),i.get(`*/api/options/models`,async()=>r.json({models:P,verified_models:[`claude-opus-4-5-20251101`,`claude-sonnet-4-5-20250929`],verified_providers:I,default_model:`openhands/minimax-m2.7`})),i.get(`*/api/v1/config/providers/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`query`)?.toLowerCase(),i=t.searchParams.get(`verified__eq`),a=new Set,o=[];for(let e of P){let[t]=e.split(`/`);t&&!a.has(t)&&(a.add(t),o.push({name:t,verified:I.includes(t)}))}if(n&&(o=o.filter(e=>e.name.toLowerCase().includes(n))),i!=null){let e=i===`true`;o=o.filter(t=>t.verified===e)}return r.json({items:o,next_page_id:null})}),i.get(`*/api/v1/config/models/search`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.get(`query`)?.toLowerCase(),i=t.searchParams.get(`verified__eq`),a=t.searchParams.get(`provider__eq`),o=P.map(e=>{let[t,...n]=e.split(`/`),r=n.join(`/`);return{provider:t||null,name:r,verified:F.has(e)}});if(a&&(o=o.filter(e=>e.provider===a)),n&&(o=o.filter(e=>e.name.toLowerCase().includes(n))),i!=null){let e=i===`true`;o=o.filter(t=>t.verified===e)}return r.json({items:o,next_page_id:null})}),i.get(`*/api/options/security-analyzers`,async()=>r.json([`llm`,`none`])),i.get(`*/api/profiles`,async()=>r.json({profiles:Array.from(j.profiles.values()).map(te),active_profile:j.activeProfile})),i.get(`*/api/profiles/:name`,async({params:e,request:t})=>{let n=M(e.name),i=j.profiles.get(n);return i?r.json(ne(i,t.headers.get(`X-Expose-Secrets`))):r.json({detail:`Profile '${n}' not found`},{status:404})}),i.post(`*/api/profiles/:name`,async({params:e,request:t})=>{let n=M(e.name),i=await t.json();if(!i)return r.json({detail:`Empty body`},{status:400});let a=re(n,i);return a?r.json({name:a.name,message:`Profile '${a.name}' saved`},{status:201}):r.json({detail:`Profile requires llm.model`},{status:400})}),i.delete(`*/api/profiles/:name`,async({params:e})=>{let t=M(e.name);return j.profiles.delete(t),j.activeProfile===t&&(j.activeProfile=null),r.json({name:t,message:`Profile '${t}' deleted`})}),i.post(`*/api/profiles/:name/rename`,async({params:e,request:t})=>{let n=M(e.name),i=(await t.json())?.new_name?.trim()??``,a=j.profiles.get(n);if(!a)return r.json({detail:`Profile '${n}' not found`},{status:404});if(!i)return r.json({detail:`new_name is required`},{status:400});if(i!==n&&j.profiles.has(i))return r.json({detail:`Profile '${i}' already exists`},{status:409});j.profiles.delete(n);let o={...a,name:i};return j.profiles.set(i,o),j.activeProfile===n&&(j.activeProfile=i,N(o)),r.json({name:i,message:`Profile '${n}' renamed to '${i}'`})}),i.post(`*/api/profiles/:name/activate`,async({params:e})=>{let t=M(e.name),n=j.profiles.get(t);return n?(j.activeProfile=t,N(n),r.json({name:t,message:`Profile '${t}' activated and applied to current settings`,llm_applied:!0})):r.json({detail:`Profile '${t}' not found`},{status:404})}),i.get(`*/api/v1/web-client/config`,()=>{let e={posthog_client_key:`fake-posthog-client-key`,feature_flags:{hide_llm_settings:!1,hide_users_page:!1},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()};return r.json(e)}),i.get(`*/api/settings/conversation-schema`,async()=>(await o(),r.json(O))),i.get(`*/api/v1/settings/conversation-schema`,async()=>(await o(),r.json(O))),i.get(`*/api/v1/settings`,async()=>{await o();let{settings:e}=A;return e?r.json(e):r.json(null,{status:404})}),i.get(`*/api/settings`,async({request:e})=>{if(new URL(e.url).pathname.split(`/`).filter(Boolean).length>2)return;await o();let{settings:t}=A;if(!t)return r.json({agent_settings:{},conversation_settings:{},llm_api_key_is_set:!1});let n=e.headers.get(`X-Expose-Secrets`),i=structuredClone(t.agent_settings??{}),a=i.llm;a?.api_key&&(n===`encrypted`?a.api_key=`gAAAAA_mock_encrypted_${String(a.api_key).slice(0,8)}`:n===`plaintext`||(a.api_key=`**********`));let s=!!t.llm_api_key_set||!!t.agent_settings?.llm&&!!t.agent_settings.llm?.api_key;return r.json({agent_settings:i,conversation_settings:t.conversation_settings??{},llm_api_key_is_set:s})}),i.patch(`*/api/settings`,async({request:e})=>{await o();let t=await e.json();if(!t)return r.json({error:`Empty body`},{status:400});if(!t.agent_settings_diff&&!t.conversation_settings_diff)return r.json({error:`At least one of agent_settings_diff or conversation_settings_diff must be provided`},{status:400});let n=A.settings||structuredClone(k),i={...n};if(t.agent_settings_diff){let e=C(n.agent_settings??{},t.agent_settings_diff);i.agent_settings=e;let r=e.llm;r?.api_key&&typeof r.api_key==`string`&&r.api_key.trim().length>0&&(i.llm_api_key_set=!0)}return t.conversation_settings_diff&&(i.conversation_settings={...n.conversation_settings??{},...t.conversation_settings_diff}),A.settings=i,r.json({agent_settings:i.agent_settings??{},conversation_settings:i.conversation_settings??{},llm_api_key_is_set:i.llm_api_key_set??!1})}),i.post(`*/api/mcp/test`,async()=>(await o(),r.json({ok:!0,tools:[`mock_tool`]}))),i.get(`*/api/settings/agent-schema`,async()=>(await o(),r.json(D))),i.get(`*/api/v1/settings/agent-schema`,async()=>(await o(),r.json(D))),i.post(`*/api/v1/settings`,async({request:e})=>{await o();let t=await e.json();if(t){let e=A.settings||structuredClone(k);if(`agent_settings`in t||`conversation_settings`in t)return r.json({error:`Use *_diff nested settings payloads`,keys:[`agent_settings`,`conversation_settings`].filter(e=>e in t)},{status:422});let n={...e},i=t.agent_settings_diff;i&&(n.agent_settings=C(e.agent_settings??{},i));let a=t.conversation_settings_diff;a&&(n.conversation_settings={...e.conversation_settings??{},...a});for(let[e,r]of Object.entries(t))e!==`agent_settings_diff`&&e!==`conversation_settings_diff`&&e!==`agent_settings_schema`&&e!==`conversation_settings_schema`&&(n[e]=r);return A.settings=n,r.json(null,{status:200})}return r.json(null,{status:400})})],se={},R=Date.now(),z=`pagination-local`,B=`pagination-cloud`,ce=100,le=500,ue=Date.UTC(2026,4,13,0,0,0),V=[{id:`1`,title:`My New Project`,created_at:new Date(R).toISOString(),updated_at:new Date(R).toISOString(),execution_status:`waiting_for_confirmation`},{id:`2`,title:`Repo Testing`,created_at:new Date(R-2880*60*1e3).toISOString(),updated_at:new Date(R-2880*60*1e3).toISOString(),execution_status:`idle`,selected_repository:`octocat/hello-world`,git_provider:`github`},{id:`3`,title:`Another Project`,created_at:new Date(R-7200*60*1e3).toISOString(),updated_at:new Date(R-7200*60*1e3).toISOString(),execution_status:`idle`,selected_repository:`octocat/earth`,selected_branch:`main`},{id:`4`,title:`Archived Project`,created_at:new Date(R-14400*60*1e3).toISOString(),updated_at:new Date(R-14400*60*1e3).toISOString(),execution_status:`idle`,sandbox_status:`MISSING`},{id:`5`,title:`Errored Project`,created_at:new Date(R-10080*60*1e3).toISOString(),updated_at:new Date(R-10080*60*1e3).toISOString(),execution_status:`idle`,sandbox_status:`ERROR`},{id:z,title:`Local pagination fixture`,created_at:new Date(R-8640*60*1e3).toISOString(),updated_at:new Date(R-8640*60*1e3).toISOString(),execution_status:`idle`,workspace:{working_dir:`/workspace/project`}}],H=new Map(V.map(e=>[e.id,e])),de=new Map([[z,U(`Local pagination message`)],[B,U(`Cloud pagination message`)]]);function fe(e,t){return{id:`${t.toLowerCase().replaceAll(` `,`-`)}-${e}`,timestamp:new Date(ue+e*6e4).toISOString(),source:`agent`,llm_message:{role:`assistant`,content:[{type:`text`,text:`${t} ${e}`}]},activated_microagents:[],extended_content:[]}}function U(e){return Array.from({length:ce},(t,n)=>fe(n+1,e))}function pe(e,t){let n=Number(t.get(`limit`)??`100`),r=t.get(`timestamp__lt`),i=t.get(`sort_order`),a=[...r?e.filter(e=>e.timestamp<r):e].sort((e,t)=>i===`TIMESTAMP_DESC`?t.timestamp.localeCompare(e.timestamp):e.timestamp.localeCompare(t.timestamp));return{items:a.slice(0,n),next_page_id:a.length>n?`next-page`:null}}async function W(e,t){let n=de.get(e);return n?(t.has(`timestamp__lt`)&&await o(le),pe(n,t)):null}function me(){let t=new Date(R-8640*60*1e3).toISOString();return{id:B,created_by_user_id:null,selected_repository:null,selected_branch:null,git_provider:null,title:`Cloud pagination fixture`,trigger:null,pr_number:[],llm_model:`openhands/claude-haiku-4-5-20251001`,metrics:null,created_at:t,updated_at:t,execution_status:e.IDLE,conversation_url:null,session_api_key:null,sandbox_id:null,workspace:{working_dir:`/workspace/project`},public:!1,sub_conversation_ids:[]}}var G=me();function K(e){return{id:e.id,title:e.title??null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??`idle`,sandbox_status:e.sandbox_status??null,metrics:e.metrics??null,agent:e.agent??null,workspace:e.workspace??null}}function he(e){return!e||e.length===0?Array.from(H.values()).map(K):e.map(e=>{let t=H.get(e);return t?K(t):null})}var ge=[i.get(`*/api/conversations/search`,async({request:e})=>{let t=new URL(e.url),n=Number(t.searchParams.get(`limit`)??`20`),i=Array.from(H.values()).sort((e,t)=>t.updated_at.localeCompare(e.updated_at)).slice(0,n).map(K);return r.json({items:i,next_page_id:null})}),i.get(`*/api/conversations`,async({request:e})=>{let t=new URL(e.url),n=t.searchParams.getAll(`ids[]`).length>0?t.searchParams.getAll(`ids[]`):t.searchParams.getAll(`ids`);return r.json(he(n))}),i.get(`*/api/conversations/:conversationId`,async({params:e})=>{let t=e.conversationId,n=H.get(t);return n?r.json(K(n)):r.json(null,{status:404})}),i.post(`*/api/conversations`,async()=>{await o();let e={id:`${Math.floor(Math.random()*1e5)}`,title:`New Conversation`,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),execution_status:`idle`};return H.set(e.id,e),r.json(K(e),{status:201})}),i.patch(`/api/conversations/:conversationId`,async({params:e,request:t})=>{let n=e.conversationId,i=H.get(n);if(i){let e=await t.json();if(e?.title)return H.set(n,{...i,title:e.title,updated_at:new Date().toISOString()}),r.json(null,{status:200})}return r.json(null,{status:404})}),i.delete(`*/api/conversations/:conversationId`,async({params:e})=>{let t=e.conversationId;return H.has(t)?(H.delete(t),r.json(null,{status:200})):r.json(null,{status:404})}),i.get(`*/api/conversations/:conversationId/events/count`,async()=>r.json(0)),i.get(`*/api/conversations/:conversationId/events/search`,async({params:e,request:t})=>{let n=e.conversationId,i=await W(n,new URL(t.url).searchParams);if(i)return r.json(i);let a=se[n]??[];return r.json({items:a,next_page_id:null})}),i.post(`*/api/conversations/:conversationId/events`,async()=>r.json({ok:!0})),i.post(`*/api/conversations/:conversationId/pause`,async()=>r.json({success:!0})),i.post(`*/api/conversations/:conversationId/interrupt`,async()=>r.json({success:!0})),i.post(`*/api/conversations/:conversationId/run`,async()=>r.json({success:!0})),i.post(`*/api/cloud-proxy`,async({request:e})=>{let t=(await e.json()).path??`/`,n=new URL(t,`https://mock-cloud.test`);if(n.pathname===`/api/v1/app-conversations`){let e=n.searchParams.getAll(`ids`);if(e.length>0)return r.json(e.map(e=>e===B?G:null))}if(n.pathname===`/api/v1/app-conversations/search`)return r.json({items:[G],next_page_id:null});if(n.pathname===`/api/v1/conversation/${B}/events/search`){let e=await W(B,n.searchParams);return r.json(e)}return n.pathname===`/api/v1/settings`?r.json({llm_model:`openhands/claude-haiku-4-5-20251001`,llm_base_url:``,llm_api_key:null,llm_api_key_set:!1,search_api_key_set:!1,agent:`CodeActAgent`,language:`en`,user_consents_to_analytics:!1,provider_tokens_set:{github:``}}):n.pathname===`/api/keys/current`?r.json({id:`mock-key`,name:`Mock key`,org_id:`org-1`,user_id:`user-1`,auth_type:`api_key`}):n.pathname===`/api/organizations`?r.json({items:[{id:`org-1`,name:`Mock Org`,is_personal:!0}],current_org_id:`org-1`}):n.pathname===`/api/organizations/org-1/me`?r.json({org_id:`org-1`,user_id:`org-1`}):n.pathname===`/api/authenticate`?r.json({ok:!0}):r.json({})}),i.post(`*/api/conversations/:conversationId/ask_agent`,async()=>r.json({response:`Mock agent response`})),i.get(`*/api/vscode/url`,async()=>r.json({url:null})),i.post(`*/api/skills`,async()=>r.json({skills:[]})),i.post(`/api/v1/conversations/:conversationId/pending-messages`,async()=>r.json({id:`mock-pending-id`,position:0})),i.get(`*/api/conversations/:conversationId/microagents`,async()=>r.json({microagents:[{name:`init`,type:`agentskills`,content:`Initialize an AGENTS.md file for the repository`,triggers:[`/init`]},{name:`releasenotes`,type:`agentskills`,content:`Generate a changelog from the most recent release`,triggers:[`/releasenotes`]},{name:`test-runner`,type:`agentskills`,content:`Run the test suite and report results`,triggers:[`/test`]},{name:`code-search`,type:`knowledge`,content:`Search the codebase semantically`,triggers:[`/search`]},{name:`docker`,type:`agentskills`,content:`Docker usage guide for container environments`,triggers:[`docker`,`container`]},{name:`github`,type:`agentskills`,content:`GitHub API interaction guide`,triggers:[`github`,`git`]},{name:`work_hosts`,type:`repo`,content:`Available hosts for web applications`,triggers:[]}]}))],_e=[i.post(`*/api/cloud-proxy`,()=>r.json({error:`cloud proxy not available in mock mode`},{status:503})),i.get(`*/api/user/info`,()=>r.json({id:`1`,login:`octocat`,avatar_url:`https://avatars.githubusercontent.com/u/583231?v=4`,company:`GitHub`,email:`placeholder@placeholder.placeholder`,name:`monalisa octocat`})),i.post(`*/api/authenticate`,async()=>r.json({message:`Authenticated`})),i.post(`*/api/logout`,()=>r.json(null,{status:200}))],ve=[i.post(`*/api/submit-feedback`,async()=>(await o(1200),r.json({statusCode:200,body:{message:`Success`,link:`fake-url.com`,password:`abc123`}}))),i.post(`*/api/submit-feedback`,async()=>r.json({statusCode:200},{status:200}))],ye=[i.post(`https://us.i.posthog.com/e`,async()=>r.json(null,{status:200})),i.post(`https://z.openhands.dev/*`,async()=>r.json(null,{status:200}))],q=new Date().toISOString(),J=e=>new Date(Date.now()-e*864e5).toISOString(),be={automations:[{id:`a1000000-0000-0000-0000-000000000001`,name:`PR Triage Digest`,trigger:{type:`cron`,schedule:`0 9 * * 1-5`,schedule_human:`Weekdays at 09:00`},enabled:!0,repository:`acme/frontend-app`,model:`triage-fast`,created_at:J(90),updated_at:q,prompt:`Review newly opened pull requests in acme/frontend-app, identify risky changes, summarize likely impact, and prepare a concise digest with priority ordering for the engineering review channel.`,branch:`main`,plugins:[`GitHub`,`Slack`,`Linear`],notification:`Slack digest to #eng-reviews`,timezone:`America/Los_Angeles`,last_triggered_at:J(0)},{id:`a1000000-0000-0000-0000-000000000002`,name:`Nightly Security Pass`,trigger:{type:`cron`,schedule:`30 1 * * *`,schedule_human:`Daily at 01:30`},enabled:!0,repository:`acme/backend-api`,model:`security-careful`,created_at:J(60),updated_at:q,prompt:`Scan the acme/backend-api repository for known security vulnerabilities, outdated dependencies, and insecure code patterns. Produce a prioritized remediation summary.`,branch:`main`,plugins:[`GitHub`],notification:`Email to security-team@acme.com`,timezone:`UTC`,last_triggered_at:J(0)},{id:`a1000000-0000-0000-0000-000000000003`,name:`Docs Sync on Push`,trigger:{type:`cron`,schedule:`*/5 * * * *`,schedule_human:`Runs on every push`},enabled:!0,repository:`acme/docs`,model:`docs-fast`,created_at:J(45),updated_at:q,prompt:`Monitor acme/docs for new pushes. For each push, generate a changelog-ready summary of what changed and why.`,branch:`main`,plugins:[`GitHub`,`Slack`],notification:`Slack to #docs-updates`,timezone:`America/New_York`,last_triggered_at:J(1)},{id:`a1000000-0000-0000-0000-000000000004`,name:`Release Readiness Review`,trigger:{type:`cron`,schedule:`0 11 * * 5`,schedule_human:`Fridays at 11:00`},enabled:!1,repository:`acme/realtime-service`,model:`release-review`,created_at:J(80),updated_at:q,prompt:`Compile a release readiness report: list open blockers, active incidents, and pending approvals for acme/realtime-service.`,branch:`release`,plugins:[`GitHub`,`Linear`],notification:`Slack to #releases`,timezone:`America/Chicago`,last_triggered_at:J(14)},{id:`a1000000-0000-0000-0000-000000000005`,name:`Incident Webhook Summary`,trigger:{type:`cron`,schedule:`0 */2 * * *`,schedule_human:`On incident webhook`},enabled:!1,repository:`acme/incident-service`,model:`incident-summary`,created_at:J(30),updated_at:q,prompt:`Summarize incoming incident webhooks, categorize by severity, and post a digest to the on-call Slack channel.`,branch:`main`,plugins:[`Slack`],notification:`Slack to #oncall`,timezone:`UTC`,last_triggered_at:null},{id:`a1000000-0000-0000-0000-000000000006`,name:`PR Review on Open`,trigger:{type:`event`,source:`github`,on:`pull_request.opened`,filter:`repository.full_name == 'acme/frontend-app'`},enabled:!0,repository:`acme/frontend-app`,model:`review-fast`,created_at:J(15),updated_at:q,prompt:`When a new PR is opened, perform a thorough code review focusing on correctness, security, and performance. Post findings as inline comments.`,branch:`main`,plugins:[`GitHub`],notification:`GitHub PR comment`,last_triggered_at:J(0)},{id:`a1000000-0000-0000-0000-000000000007`,name:`Release Notes Generator`,trigger:{type:`event`,source:`github`,on:`release.published`,filter:`glob(release.tag_name, 'v*') && !release.prerelease`},enabled:!0,repository:`acme/backend-api`,model:`docs-fast`,created_at:J(10),updated_at:q,prompt:`Generate comprehensive release notes from the commits since the last release. Include breaking changes, new features, and bug fixes.`,branch:`main`,plugins:[`GitHub`],notification:`GitHub release body update`,last_triggered_at:J(3)}],total:7},xe=(e,t=9)=>{let n=new Date(Date.now()-e*864e5);return n.setHours(t,0,0,0),n.toISOString()};function Y(e,t,r,i=9,a=!0){let o=xe(r,i);return{id:e,status:t,conversation_id:a?`conv-${e}`:null,bash_command_id:a?`cmd-${e}`:null,error_detail:t===n.FAILED?`Process exited with code 1`:null,started_at:o,completed_at:new Date(new Date(o).getTime()+12e4).toISOString()}}var Se={"a1000000-0000-0000-0000-000000000001":[Y(`r1-01`,n.COMPLETED,0),Y(`r1-02`,n.COMPLETED,1),Y(`r1-03`,n.FAILED,2),Y(`r1-04`,n.COMPLETED,3),Y(`r1-05`,n.COMPLETED,4),Y(`r1-06`,n.COMPLETED,7),Y(`r1-07`,n.FAILED,8),Y(`r1-08`,n.COMPLETED,9),Y(`r1-09`,n.COMPLETED,10),Y(`r1-10`,n.COMPLETED,11)],"a1000000-0000-0000-0000-000000000002":[Y(`r2-01`,n.COMPLETED,0,1),Y(`r2-02`,n.COMPLETED,1,1),Y(`r2-03`,n.COMPLETED,2,1),Y(`r2-04`,n.FAILED,3,1),Y(`r2-05`,n.COMPLETED,4,1)],"a1000000-0000-0000-0000-000000000003":[Y(`r3-01`,n.COMPLETED,1),Y(`r3-02`,n.COMPLETED,2),Y(`r3-03`,n.COMPLETED,3)],"a1000000-0000-0000-0000-000000000004":[Y(`r4-01`,n.FAILED,14,11,!1),Y(`r4-02`,n.COMPLETED,21,11)],"a1000000-0000-0000-0000-000000000005":[],"a1000000-0000-0000-0000-000000000006":[Y(`r6-01`,n.COMPLETED,0,14),Y(`r6-02`,n.COMPLETED,0,11),Y(`r6-03`,n.FAILED,1,16),Y(`r6-04`,n.COMPLETED,2,10),Y(`r6-05`,n.COMPLETED,3,9)],"a1000000-0000-0000-0000-000000000007":[Y(`r7-01`,n.COMPLETED,3,15),Y(`r7-02`,n.COMPLETED,10,12)]},X=new Map(be.automations.map(e=>[e.id,{...e}])),Ce=[i.get(`*/api/automation/health`,async()=>(await o(100),r.json({status:`ok`}))),i.get(`*/api/automation/v1`,async({request:e})=>{await o(300);let t=new URL(e.url),n=Number(t.searchParams.get(`limit`)??`50`),i=Number(t.searchParams.get(`offset`)??`0`),a=Array.from(X.values()),s={automations:a.slice(i,i+n),total:a.length};return r.json(s)}),i.get(`*/api/automation/v1/:id/runs`,async({params:e,request:t})=>{await o(200);let n=e.id;if(!X.has(n))return r.json({detail:`Automation not found`},{status:404});let i=new URL(t.url),a=Number(i.searchParams.get(`limit`)??`50`),s=Number(i.searchParams.get(`offset`)??`0`),c=Se[n]??[],l={runs:c.slice(s,s+a),total:c.length};return r.json(l)}),i.get(`*/api/automation/v1/:id`,async({params:e})=>{await o(200);let t=X.get(e.id);return t?r.json(t):r.json({detail:`Automation not found`},{status:404})}),i.patch(`*/api/automation/v1/:id`,async({params:e,request:t})=>{await o(200);let n=e.id,i=await t.clone().json(),a=X.get(n);if(!a)return r.json({detail:`Automation not found`},{status:404});let s={...a,...i,updated_at:new Date().toISOString()};return X.set(n,s),r.json(s)}),i.post(`*/api/automation/v1/:id/dispatch`,async({params:e})=>{await o(200);let t=e.id;if(!X.get(t))return r.json({detail:`Automation not found`},{status:404});let i={id:crypto.randomUUID(),status:n.PENDING,conversation_id:null,bash_command_id:null,error_detail:null,started_at:new Date().toISOString(),completed_at:null};return r.json(i,{status:201})}),i.delete(`*/api/automation/v1/:id`,async({params:e})=>{await o(200);let t=e.id;return X.has(t)?(X.delete(t),new r(null,{status:204})):r.json({detail:`Automation not found`},{status:404})})],we={ok:!0,tools:[]},Te=[i.post(`*/api/mcp/test`,async()=>r.json(we))],Z=[],Q=[];function $(){return{workspaces:Z.map(e=>({...e})),workspaceParents:Q.map(e=>({...e}))}}var Ee=[i.get(`*/api/workspaces`,async()=>r.json($())),i.post(`*/api/workspaces`,async({request:e})=>{let t=await e.json();for(let e of t.workspaces??[]){let t=Z.findIndex(t=>t.path===e.path);t>=0?Z[t]={...e}:Z.push({...e})}return r.json($())}),i.delete(`*/api/workspaces`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`),n=Z.length;return Z=Z.filter(e=>e.path!==t),r.json({deleted:Z.length!==n})}),i.post(`*/api/workspaces/parents`,async({request:e})=>{let t=await e.json();for(let e of t.parents??[]){let t=Q.findIndex(t=>t.path===e.path);t>=0?Q[t]={...e}:Q.push({...e})}return r.json($())}),i.delete(`*/api/workspaces/parents`,async({request:e})=>{let t=new URL(e.url).searchParams.get(`path`),n=Q.length;return Q=Q.filter(e=>e.path!==t),r.json({deleted:Q.length!==n})}),i.post(`*/api/auth/workspace-session`,async()=>r.json({ok:!0})),i.delete(`*/api/auth/workspace-session`,async()=>new r(null,{status:204}))],De=a(...d,...h,..._,...S,...oe,...ge,..._e,...ve,...ye,...Ce,...Te,...Ee);export{De as worker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{a as n,f as r,o as i}from"./path-utils-CNd_jqv_.js";import{t as a}from"./useMutation-7hG0GuPx.js";import{o,t as s}from"./declaration-IA661TBv.js";import{n as c}from"./QueryClientProvider-7oLZ1RtQ.js";import{t as l}from"./useQuery-JDs8UaWj.js";import{t as u}from"./useTranslation-CbJtty1g.js";import{r as d}from"./vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js";import{a as f,n as p,t as m}from"./custom-toast-handlers-fgD4IYsu.js";import{g as h,i as g,t as _}from"./utils-CVcuFUYj.js";import{t as v}from"./common-Cfviy7yT.js";import{c as y,n as b}from"./agent-server-client-options-Dvgeb3x4.js";import{n as x}from"./active-backend-context-CQTk4wD8.js";import{r as S}from"./vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-Cwz6a1DC.js";import{t as C}from"./agent-server-conversation-service.api-B82pNNTm.js";import{n as ee}from"./navigation-context-CszaA-CJ.js";import{t as te}from"./dist-B-SKiGDl.js";import{t as w}from"./proxy-wIasY2Po.js";import{t as T}from"./react-CuAHzoGi.js";import{r as ne,t as E}from"./middleware-B5rcobhi.js";import{t as re}from"./conversation-local-storage-D5Tre_GA.js";import{t as D}from"./use-is-authed-DrocXcet.js";import{r as ie}from"./use-settings-Clf0Y_P3.js";import{t as ae}from"./use-tracking-DQU60djN.js";import{o as oe,s as se,t as O}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-C37jLHRk.js";import{t as k}from"./git-status-mapper-N4-7eaeC.js";var A=o(),j=te(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function M({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,A.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,A.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,A.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(j({orientation:e,color:t,size:n,inset:r}),i)})}var N=()=>{let e=c();return a({mutationFn:e=>C.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{re(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},P=()=>{let{t:e}=u(`openhands`),t=c(),{conversationId:r,navigate:o}=ee();return a({mutationKey:[`stop-conversation`],mutationFn:async e=>i(e.conversationId),onMutate:async()=>{let n=f.loading(e(s.TOAST$STOPPING_CONVERSATION),m);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&f.dismiss(i.toastId),p(e(s.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(i,a,c)=>{c?.toastId&&f.dismiss(c.toastId),f.success(e(s.TOAST$CONVERSATION_STOPPED),m),n(t,a.conversationId,{execution_status:v.PAUSED,sandbox_status:`PAUSED`}),r===a.conversationId&&o(`/conversations`)}})},F=e(t()),I=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),L=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),R=e=>(0,A.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,A.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),z=e=>(0,A.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,A.jsx)(`path`,{d:`M21.0004 6.00001C21.0016 5.43668 20.8441 4.88442 20.5459 4.40644C20.2478 3.92846 19.8212 3.54406 19.3148 3.29726C18.8084 3.05046 18.2428 2.95122 17.6826 3.0109C17.1224 3.07059 16.5904 3.28678 16.1474 3.63473C15.7044 3.98269 15.3683 4.44835 15.1776 4.97841C14.9869 5.50848 14.9493 6.08152 15.0691 6.63197C15.1888 7.18241 15.4612 7.688 15.8549 8.09088C16.2487 8.49375 16.7479 8.77762 17.2954 8.91001V10.5C17.2978 10.6372 17.261 10.7722 17.1892 10.8891C17.1175 11.006 17.0138 11.1 16.8904 11.16L12.7354 13.32L8.59544 11.22C8.46356 11.1544 8.35443 11.0507 8.28221 10.9223C8.21 10.7939 8.17802 10.6468 8.19044 10.5V8.91001C8.89743 8.72746 9.51358 8.29333 9.92339 7.689C10.3332 7.08467 10.5085 6.35161 10.4165 5.62725C10.3245 4.90289 9.97149 4.23695 9.42361 3.75426C8.87573 3.27157 8.17062 3.00527 7.44044 3.00527C6.71026 3.00527 6.00514 3.27157 5.45726 3.75426C4.90938 4.23695 4.55635 4.90289 4.46435 5.62725C4.37234 6.35161 4.54768 7.08467 4.95749 7.689C5.36729 8.29333 5.98344 8.72746 6.69044 8.91001V10.5C6.6913 10.9156 6.80651 11.323 7.02346 11.6776C7.24041 12.0321 7.55073 12.3201 7.92044 12.51L12.0004 14.61V16.59C11.2934 16.7726 10.6773 17.2067 10.2675 17.811C9.85768 18.4153 9.68234 19.1484 9.77435 19.8728C9.86635 20.5971 10.2194 21.2631 10.7673 21.7457C11.3151 22.2284 12.0203 22.4947 12.7504 22.4947C13.4806 22.4947 14.1857 22.2284 14.7336 21.7457C15.2815 21.2631 15.6345 20.5971 15.7265 19.8728C15.8185 19.1484 15.6432 18.4153 15.2334 17.811C14.8236 17.2067 14.2074 16.7726 13.5004 16.59V14.61L17.5504 12.57C17.9317 12.3784 18.2501 12.0816 18.468 11.7148C18.686 11.348 18.7944 10.9265 18.7804 10.5V8.88001C19.4147 8.70922 19.9755 8.33496 20.3765 7.81469C20.7776 7.29442 20.9967 6.6569 21.0004 6.00001ZM6.00044 6.00001C6.00044 5.60218 6.15847 5.22065 6.43978 4.93934C6.72108 4.65804 7.10261 4.5 7.50044 4.5C7.89826 4.5 8.27979 4.65804 8.5611 4.93934C8.8424 5.22065 9.00044 5.60218 9.00044 6.00001C9.00044 6.39783 8.8424 6.77936 8.5611 7.06067C8.27979 7.34197 7.89826 7.50001 7.50044 7.50001C7.10261 7.50001 6.72108 7.34197 6.43978 7.06067C6.15847 6.77936 6.00044 6.39783 6.00044 6.00001ZM14.2054 19.5C14.2054 19.8978 14.0474 20.2794 13.7661 20.5607C13.4848 20.842 13.1033 21 12.7054 21C12.3076 21 11.9261 20.842 11.6448 20.5607C11.3635 20.2794 11.2054 19.8978 11.2054 19.5C11.2054 19.1022 11.3635 18.7207 11.6448 18.4393C11.9261 18.158 12.3076 18 12.7054 18C13.1033 18 13.4848 18.158 13.7661 18.4393C14.0474 18.7207 14.2054 19.1022 14.2054 19.5ZM18.0004 7.50001C17.6026 7.50001 17.2211 7.34197 16.9398 7.06067C16.6585 6.77936 16.5004 6.39783 16.5004 6.00001C16.5004 5.60218 16.6585 5.22065 16.9398 4.93934C17.2211 4.65804 17.6026 4.5 18.0004 4.5C18.3983 4.5 18.7798 4.65804 19.0611 4.93934C19.3424 5.22065 19.5004 5.60218 19.5004 6.00001C19.5004 6.39783 19.3424 6.77936 19.0611 7.06067C18.7798 7.34197 18.3983 7.50001 18.0004 7.50001Z`,fill:`currentColor`})}),B=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),V=()=>{let{trackDownloadTrajectoryButtonClicked:e}=ae(),{t}=u(`openhands`);return a({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),g(await C.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{p(t(s.CONVERSATION$DOWNLOAD_ERROR))}})},H=e=>(0,A.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,A.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),U=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},W=()=>{let{data:e,isLoading:t}=ie();return{providers:F.useMemo(()=>U(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function G(){let e=y().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function K(e){let t=G(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await w({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function ce(e){let t=G(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await w({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function q(e){let t=G(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await w({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var J=e=>e,Y=()=>y().backend.kind===`cloud`,X=e=>!e||e===`undefined`||e===`null`,Z={items:[],next_page_id:null},Q={items:[],next_page_id:null},le={items:[],next_page_id:null},$=class{static async searchGitRepositories(e,t,n=100,r,i){return X(t)||!Y()?Z:K({provider:J(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return X(e)||!Y()?Z:K({provider:J(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(X(e)||!Y())return Z;let a=n[t];return a?K({provider:J(e),installationId:a,limit:i,pageId:r}):Z}static async getRepositoryBranches(e,t,n=``,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return X(e)||!Y()?le:ce({provider:J(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await C.resolveConversationWorkingDir(e);return(await new S(b({workingDir:t})).gitChanges(t,{ref:`HEAD`})).map(e=>({path:e.path,status:k(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new S(b()).gitDiff(t,{ref:`HEAD`});return{modified:n.modified??``,original:n.original??``}}},ue=e=>{let{data:t}=D(),{providers:n}=W(),r=x();return l({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&h(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function de(e){let{provider:t,pageSize:n=30,enabled:i=!0}=e,{providers:a}=W(),{data:o}=ue(t),s=o?.items,c=x(),l=t?h(t,c.backend.kind):!1,u=r({queryKey:[`repositories`,t,l,n,c.backend.id,c.orgId,...l?[s||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!s)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,s,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&s){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<s.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:i&&(a||[]).length>0&&!!t&&(!l||Array.isArray(s)&&s.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:u.data,isLoading:u.isLoading,isError:u.isError,hasNextPage:u.hasNextPage,isFetchingNextPage:u.isFetchingNextPage,fetchNextPage:u.fetchNextPage,onLoadMore:()=>{u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()}}}function fe(e,t,n,r=100){return l({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await $.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,staleTime:1e3*60*5,gcTime:1e3*60*15})}function pe(e,t){let[n,r]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var me={recentRepositories:[],lastSelectedProvider:null},he=T()(ne((e,t)=>({...me,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:E(()=>localStorage)}));function ge({gitProvider:e,className:t}){return(0,A.jsxs)(A.Fragment,{children:[e===`github`&&(0,A.jsx)(oe,{size:14,className:t}),e===`gitlab`&&(0,A.jsx)(se,{size:14,className:t}),e===`bitbucket`&&(0,A.jsx)(O,{size:14,className:t}),e===`bitbucket_data_center`&&(0,A.jsx)(O,{size:14,className:t}),e===`azure_devops`&&(0,A.jsx)(R,{className:_(t,`w-[14px] h-[14px]`)})]})}function _e({buttonClassName:e,handleSubmit:t,disabled:n}){return(0,A.jsx)(`button`,{type:`button`,className:_(`flex items-center justify-center rounded-full border border-white size-8`,n?`cursor-not-allowed border-[var(--oh-muted)]`:`cursor-pointer hover:bg-white/10`,e),"data-name":`arrow-up-circle-fill`,"data-testid":`submit-button`,onClick:t,disabled:n,children:(0,A.jsx)(d,{className:`w-4 h-4`,color:n?`var(--oh-muted)`:`white`})})}export{N as _,fe as a,W as c,B as d,z as f,P as g,I as h,pe as i,H as l,L as m,ge as n,de as o,R as p,he as r,$ as s,_e as t,V as u,M as v};
|