@openhands/agent-canvas 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{active-backend-context-DRFevVIj.js → active-backend-context-u2tdYRgH.js} +1 -1
- package/build/assets/{add-backend-modal-DzuB9zlG.js → add-backend-modal-DIEyAkA4.js} +1 -1
- package/build/assets/{agent-profiles-settings-BfAwTshW.js → agent-profiles-settings-BovdV4N8.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-DfH2k6Sx.js → agent-server-conversation-service.api-BP73yONA.js} +1 -1
- package/build/assets/agent-settings-FGL3Yvkp.js +1 -0
- package/build/assets/{agent-settings-DjVlKgaP.js → agent-settings-Ofbh6UTD.js} +1 -1
- package/build/assets/{api-key-entry-screen-O8gS-fnF.js → api-key-entry-screen-CZIdRmUJ.js} +1 -1
- package/build/assets/{app-settings-SlZvaXlk.js → app-settings-BHJ9nKti.js} +1 -1
- package/build/assets/{automation-detail-CwsNJ9AM.js → automation-detail-DwYGzLkp.js} +1 -1
- package/build/assets/{automations-list-B9cPtugh.js → automations-list-CuAfJmMW.js} +1 -1
- package/build/assets/{backend-form-modal-D2EDGVAc.js → backend-form-modal-BiaOB2C4.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-6OCwIuLY.js → backend-synced-settings-badge-Bs3FSXsS.js} +1 -1
- package/build/assets/{color-themes-Dd1sO5U6.js → color-themes-DPBzNtVg.js} +3 -3
- package/build/assets/{condenser-settings-BhxvlfoY.js → condenser-settings-D_5vY4m3.js} +1 -1
- package/build/assets/conversation-DnVC6vRV.js +1 -0
- package/build/assets/conversation-panel-ZEz-z3az.js +1 -0
- package/build/assets/{conversation-service.api-Ch9kR9aE.js → conversation-service.api-CqZcHr1c.js} +1 -1
- package/build/assets/{conversation-B8prFAZF.js → conversation-xkBS3AHC.js} +3 -3
- package/build/assets/{edit-automation-modal-BoibW8cd.js → edit-automation-modal-B6U96gVV.js} +1 -1
- package/build/assets/{entry.client-BgWj9jL_.js → entry.client-Dy--3GeA.js} +1 -1
- package/build/assets/{extensions-hub-MtC8lK3A.js → extensions-hub-CksKNpP9.js} +1 -1
- package/build/assets/{extensions-navigation-BtV14oQL.js → extensions-navigation-Di9rJ-b5.js} +1 -1
- package/build/assets/{files-tab-DHqtsKLy.js → files-tab-61Vaihc6.js} +1 -1
- package/build/assets/{git-provider-icon-CGU7_KiU.js → git-provider-icon-aQRcUVI-.js} +1 -1
- package/build/assets/{home-BgjWP_UN.js → home-5gOtUe-n.js} +1 -1
- package/build/assets/{install-server-modal-J_eQ6lhG.js → install-server-modal-BRab9inF.js} +1 -1
- package/build/assets/{launch-DamfAY5L.js → launch-1TJRKkkX.js} +1 -1
- package/build/assets/{lesson-plan-HD886V64.js → lesson-plan-BtrZUCuj.js} +1 -1
- package/build/assets/{llm-not-configured-banner-DTrLsVr_.js → llm-not-configured-banner-BrU5uHto.js} +1 -1
- package/build/assets/{llm-settings-BgSFkbHC.js → llm-settings-BpdU51Jo.js} +1 -1
- package/build/assets/llm-settings-DsInf6yD.js +1 -0
- package/build/assets/{manage-backends-modal-BUzj5_Lq.js → manage-backends-modal-BREySP-J.js} +1 -1
- package/build/assets/{manifest-4d6a1552.js → manifest-a5bb7568.js} +1 -1
- package/build/assets/{mcp-DvqJYDbz.js → mcp-XXf8k6mb.js} +1 -1
- package/build/assets/{messages-C4KEFkPk.js → messages-D2oZb47Z.js} +1 -1
- package/build/assets/{onboarding-gGIqoxvA.js → onboarding-D32kiGME.js} +1 -1
- package/build/assets/{onboarding-modal-CGHPoMp7.js → onboarding-modal-C084vkv7.js} +1 -1
- package/build/assets/{option-service.api-Dz7Eomnx.js → option-service.api-Cl5VLGyw.js} +1 -1
- package/build/assets/{path-utils-CBaRYg35.js → path-utils-BeOmjIcE.js} +1 -1
- package/build/assets/{planner-tab-G4j36bJk.js → planner-tab-AZMjJx31.js} +1 -1
- package/build/assets/{providers-CPoq0VXm.js → providers-vX9jk9Vy.js} +1 -1
- package/build/assets/recommended-automations-launcher-Bk8tQ-Cn.js +58 -0
- package/build/assets/{root-layout-CvxdHJ6j.js → root-layout-CoWw4kpz.js} +2 -2
- package/build/assets/{root-S6CfVoNm.js → root-tuEPDx-i.js} +2 -2
- package/build/assets/{schema-field-DwUzlw6b.js → schema-field-nvq_Juo2.js} +1 -1
- package/build/assets/{sdk-section-page-BUXONTx6.js → sdk-section-page-CgT70FaZ.js} +1 -1
- package/build/assets/{secrets-settings-ZxyfRBgx.js → secrets-settings-BCxk9p9s.js} +1 -1
- package/build/assets/{settings-Bx6vn-g8.js → settings-CedTdtb5.js} +1 -1
- package/build/assets/{settings-index-D4SM26d5.js → settings-index-Cct3PJSP.js} +1 -1
- package/build/assets/{settings-modal-BoC8oMlg.js → settings-modal-DwLybV_O.js} +1 -1
- package/build/assets/{shared-conversation-DMiaQFsj.js → shared-conversation-DnDwfLgg.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CaV3tQFF.js → sidebar-mobile-menu-toggle-B8k3qu84.js} +1 -1
- package/build/assets/{skills-plugins-D2WkrXkr.js → skills-plugins-B68ay6Pu.js} +1 -1
- package/build/assets/{skills-settings-CZGVOp_t.js → skills-settings-A6sUy0T7.js} +1 -1
- package/build/assets/{terminal-B0aL_iDZ.js → terminal-BmT0_gIH.js} +1 -1
- package/build/assets/{use-acp-credential-form-rzaqkJ1n.js → use-acp-credential-form-Bs6s0DTU.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DY0txItX.js → use-activate-agent-profile-CKtTToSx.js} +1 -1
- package/build/assets/{use-active-agent-profile-Cp5AFONR.js → use-active-agent-profile-CWLPpOtK.js} +1 -1
- package/build/assets/{use-active-conversation-DvcFBqFe.js → use-active-conversation-DI5S5M1w.js} +1 -1
- package/build/assets/{use-agent-profiles-DnH16_Vm.js → use-agent-profiles-DPcaYLpm.js} +1 -1
- package/build/assets/{use-agent-state-BvRcEzY4.js → use-agent-state-Buh3bQDh.js} +1 -1
- package/build/assets/{use-backends-health-e-Ull4wz.js → use-backends-health-CxkvJy2N.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-OIhplvQ0.js → use-can-manage-org-profiles-DeX2Mfje.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-ekU7UXDT.js → use-cloud-current-user-id-D_PQGfmT.js} +1 -1
- package/build/assets/{use-config-Dwf5gla-.js → use-config-ur0RbjCP.js} +1 -1
- package/build/assets/{use-create-conversation-CvAXfA3T.js → use-create-conversation-D9OWYcte.js} +1 -1
- package/build/assets/{use-create-secret-BKeXCo__.js → use-create-secret-CVFSlhlR.js} +1 -1
- package/build/assets/{use-handle-plan-click-cAXS-Hft.js → use-handle-plan-click-Dug8egQl.js} +1 -1
- package/build/assets/{use-llm-profiles-BcLibtGb.js → use-llm-profiles-DjackuP1.js} +1 -1
- package/build/assets/use-runtime-is-ready-Diiq65Q-.js +1 -0
- package/build/assets/{use-save-agent-profile-DFjxHhNx.js → use-save-agent-profile-aKKLqDJM.js} +1 -1
- package/build/assets/{use-save-settings-5xPYpSQM.js → use-save-settings-CChDyjOB.js} +1 -1
- package/build/assets/{use-settings-B07msZ2Z.js → use-settings-dX4fKUPF.js} +1 -1
- package/build/assets/{use-settings-nav-items-CswsOEyw.js → use-settings-nav-items-D6pHnvxg.js} +1 -1
- package/build/assets/{use-skills-Aoaoq_ei.js → use-skills-Dqo-pDDx.js} +1 -1
- package/build/assets/{use-tracking-CqODdfO4.js → use-tracking-GtXCHmTv.js} +1 -1
- package/build/assets/{use-user-conversation-BPHQ-dm-.js → use-user-conversation-6uOXFP95.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-DJHl5b-B.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js} +267 -27
- package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js +1 -0
- package/build/assets/{verification-settings-DZQ-JvKH.js → verification-settings-D_zsNB_c.js} +1 -1
- package/build/index.html +4 -4
- package/config/defaults.json +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js +70 -3
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +27 -2
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js +33 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +48 -46
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +267 -27
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +36 -30
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/dist/themes/color-themes.cjs +3 -3
- package/dist/themes/color-themes.cjs.map +1 -1
- package/dist/themes/color-themes.d.ts +13 -2
- package/dist/themes/color-themes.js +2 -2
- package/dist/themes/color-themes.js.map +1 -1
- package/package.json +2 -2
- package/build/assets/agent-settings-CMMms-0q.js +0 -1
- package/build/assets/conversation-DGVDwGn8.js +0 -1
- package/build/assets/conversation-panel-C7DC4Cxx.js +0 -1
- package/build/assets/llm-settings-Bkc8C5Bi.js +0 -1
- package/build/assets/recommended-automations-launcher-CXaEK1rW.js +0 -50
- package/build/assets/use-runtime-is-ready-CBFe69Ew.js +0 -1
- package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-L2sdihTY.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,M as n,N as r,P as i,bt as a}from"./vendor-styling-CI0PQ3ab.js";import{n as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{d as s,l as c,m as l,r as u,s as d}from"./path-utils-CBaRYg35.js";import{t as f}from"./useMutation-DCE9RcgK.js";import{t as p}from"./Trans-De9RwQhA.js";import{t as m}from"./useTranslation-Cgy4JA_g.js";import{t as h}from"./declaration-B9kpCaYl.js";import{A as g,H as _,n as v}from"./active-backend-context-DRFevVIj.js";import{t as y}from"./createLucideIcon-CVAsW2Yo.js";import{t as b}from"./chevron-down-CI8A6tet.js";import{t as ee}from"./loader-circle-BEykUKYG.js";import{C as x,M as S,t as C}from"./utils-CE0lDWtb.js";import{n as w}from"./common-Dh7OqABE.js";import{n as T,o as E}from"./form-control-classes-9rkU4usZ.js";import{t as te}from"./use-config-Dwf5gla-.js";import{n as ne}from"./navigation-context-DPs2G0X8.js";import{t as re}from"./styled-tooltip-DsKsFjuq.js";import{t as ie}from"./react-DPDgL6du.js";import{s as D}from"./conversation-local-storage-F6zVMM--.js";import{t as O}from"./conversation-store-LptbOvKa.js";import{r as ae}from"./use-settings-B07msZ2Z.js";import{t as oe}from"./agent-server-conversation-service.api-DfH2k6Sx.js";import{t as se}from"./conversation-service.api-Ch9kR9aE.js";import{n as ce}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js";import{t as le}from"./skills-9cDZONKh.js";import{t as ue}from"./close-p3Op5lxI.js";import{t as de}from"./copy-to-clipboard-button-Aj9wFmt2.js";import{r as k}from"./typography-YGPBGzOG.js";import{t as fe}from"./u-check-circle-BqoIxNz_.js";import{n as pe,r as A,t as me}from"./use-active-conversation-DvcFBqFe.js";import{n as he}from"./files-tab-store-DJsPxYdg.js";import{t as ge}from"./use-agent-state-BvRcEzY4.js";import{d as _e,f as ve,m as ye,p as be,r as xe,t as Se}from"./lesson-plan-HD886V64.js";import{C as Ce,O as we,S as j,T as Te,a as Ee,b as De,c as Oe,i as ke,m as Ae,o as je,r as Me,s as M,t as Ne,y as Pe}from"./use-event-store-YSOxy9FC.js";import{ot as Fe,st as Ie}from"./vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js";import{n as Le,t as N}from"./markdown-renderer-D8mayGjI.js";import{n as Re,r as ze,t as Be}from"./plan-components-j9X4AxYM.js";import{n as Ve,t as He}from"./get-language-from-path-CPNnuVhI.js";import{n as Ue,t as We}from"./u-check-circle-half-LiwZkuFe.js";var Ge=y(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(t(),1);function Ke(){!r.current&&n();let[e]=(0,P.useState)(i.current);return e}var F=a(),qe=function(e){return e.INIT=`initialize`,e.MESSAGE=`message`,e.SYSTEM=`system`,e.READ=`read`,e.WRITE=`write`,e.RUN=`run`,e.RUN_IPYTHON=`run_ipython`,e.BROWSE=`browse`,e.BROWSE_INTERACTIVE=`browse_interactive`,e.DELEGATE=`delegate`,e.THINK=`think`,e.FINISH=`finish`,e.REJECT=`reject`,e.CHANGE_AGENT_STATE=`change_agent_state`,e.MCP=`call_tool_mcp`,e.TASK_TRACKING=`task_tracking`,e}(qe||{});function Je(){let{conversationId:e}=A(),t=xe();return{send:(0,P.useCallback)(async e=>{if(t){let{action:n,args:r}=e;if(n===`message`&&r?.content){let e=[{type:`text`,text:r.content}];return r.image_urls&&r.image_urls.length>0&&e.push({type:`image`,image_urls:r.image_urls}),await t.sendMessage({role:`user`,content:e})}return{queued:!1}}return{queued:!1}},[t,e])}}function Ye(e,t,n,r){return{action:qe.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),L=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function Xe({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(ce,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:s}=m(`openhands`),[c,l]=P.useState(r),u=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`cursor-pointer text-left`,"aria-label":s(c?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:c?(0,F.jsx)(L,{className:C(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:C(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&u,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&u]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(Xe,{status:n})]})]}),c&&(typeof t==`string`?(0,F.jsx)(N,{children:t}):t)]})}var Ze=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),Qe=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),$e={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function et({status:e}){let{t}=m(`openhands`),{conversationId:n}=A(),r=be(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,P.useState)(!1),{active:o,objective:l,iteration:u,max_iterations:f,verdict:p}=e,_=p?Math.round(p.score*100):null,v=p?.missing?t(h.GOAL$MISSING,{missing:p.missing}):``,y=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){g(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},b=()=>y(async e=>{await s(e),await d(e)},h.GOAL$STOP_FAILED),ee=()=>y(c,h.GOAL$RESUME_FAILED),x=null;return n&&o?x=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:b,className:C(T,E),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(x=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:ee,className:C(T,E),children:t(h.GOAL$RESUME)})),(0,F.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:l}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:u,max:f})}),(0,F.jsx)(`span`,{children:t($e[e.status])}),_!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:_})}),o?(0,F.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,F.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,F.jsx)(Ze,{className:`w-3.5 h-3.5 fill-success`})}):(0,F.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,F.jsx)(Qe,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:x,details:v,initiallyExpanded:!o,chevronPosition:`before`})})}var tt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,F.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,F.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function nt({profile:e}){let[t,n]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,F.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,F.jsx)(b,{size:14}):(0,F.jsx)(l,{size:14})}),(0,F.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-neutral-700`}),(0,F.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function rt({conversationId:e,anchorEventId:t}){let n=ve(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,F.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(tt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(p,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,F.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,F.jsx)(R,{title:(0,F.jsx)(`span`,{children:t?(0,F.jsx)(p,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(p,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,F.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,F.jsx)(p,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(nt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var it=(0,P.createContext)(void 0);function at({children:e,value:t}){let n=ze(P.useRef(null)),r=t||n;return(0,F.jsx)(it.Provider,{value:r,children:e})}function ot(){let e=(0,P.useContext)(it);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function st(){return(0,P.useContext)(it)}var ct=()=>{let{setConversationMode:e}=O(),{send:t}=Je(),{conversationId:n}=A(),r=ye(e=>e.enqueuePendingMessage),i=ye(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,P.useCallback)(a=>{a?.preventDefault(),a?.stopPropagation(),e(`code`);let o=`Execute the plan based on the .agents_tmp/PLAN.md file.`,s=new Date().toISOString(),c=n?r({conversationId:n,text:o,timestamp:s}):null;t(Ye(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},lt=`200%`,z=8,ut=z*2;function dt({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Ke(),c=`oh-text-shimmer-${(0,P.useId)().replace(/:/g,``)}`,l=(0,P.useMemo)(()=>Math.min(z/2-1,1+i/2),[i]),u=(0,P.useMemo)(()=>{let e=z/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${z}%)`,backgroundSize:`${lt} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,F.jsx)(t,{className:C(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${ut}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:C(`relative inline-block`,n),style:u,...o,children:e})]})}var ft=P.memo(dt);function pt({className:e}){return(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var mt=5,ht=360,gt={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function _t({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=m(`openhands`),a=P.useRef(null),[o,s]=P.useState(!1);P.useEffect(()=>{r(o)},[o,r]),P.useLayoutEffect(()=>{let t=a.current;if(!t||n){s(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=mt*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;s(t.scrollHeight>r+1||i>=mt||e.trim().length>ht)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let c=o&&!n;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsx)(`div`,{ref:a,className:C(`text-sm leading-6 whitespace-normal [word-break:break-word]`,c&&`line-clamp-5`),children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:gt,children:e})}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,F.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:C(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(h.COMMON$VIEW_MORE)})]}):null]})}function B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onStop:s}){let{t:c}=m(`openhands`),[l,u]=P.useState(!1),[d,f]=P.useState(!1),[p,g]=P.useState(!1),[_,v]=P.useState(!1),[y,b]=P.useState(!0),ee=P.useRef(null);P.useEffect(()=>{g(!1)},[t]);let x=async()=>{await navigator.clipboard.writeText(t),f(!0)};P.useEffect(()=>{let e;return d&&(e=setTimeout(()=>{f(!1)},2e3)),()=>{clearTimeout(e)}},[d]);let S=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&s!=null,T=w&&l,E=e===`user`&&a==null,te=E&&_&&!p,ne=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!w||E)return;let e=ee.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,w,E]);let ie=E?(0,F.jsx)(_t,{message:t,isHovering:l,isExpanded:p,onTruncatableChange:v}):(0,F.jsx)(`div`,{ref:ee,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:gt,children:t})}),D=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:C(`rounded-xl relative w-fit max-w-full flex flex-col`,ne&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!S&&`last:mb-4`),children:[(0,F.jsxs)(`div`,{className:C(`absolute -top-2.5 -right-2.5 z-10`,!l||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(re,{content:e.tooltip,placement:`top`,children:(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,F.jsx)(de,{isHidden:!l,isDisabled:d,onClick:x,mode:d?`copied`:`copy`})]}),ie,w?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s?.()},"data-testid":`chat-message-stop`,"aria-label":c(h.BUTTON$STOP),"aria-hidden":!T,tabIndex:T?0:-1,className:C(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,y?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,T?`opacity-100`:`pointer-events-none opacity-0`),children:(0,F.jsx)(pt,{className:`block h-7 w-7 max-w-none`})}):null,te?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":c(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>g(!0)}):null,n]});return e===`user`&&a===`error`?(0,F.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[D,(0,F.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,F.jsx)(`span`,{children:c(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:c(h.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,F.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[D,(0,F.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,F.jsx)(ft,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:c(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function vt(){let{conversationId:e}=pe(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=O(),{setSelectedTab:a}=D(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var yt=300,bt=Be(`shine-text`);function xt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=m(`openhands`),{navigateToTab:i}=vt(),{handleBuildPlanClick:a}=ct(),{scrollDomToBottom:o}=ot(),s=()=>{i(`planner`)},c=(0,P.useCallback)(e=>{a(e),o()},[a,o]),l=(0,P.useMemo)(()=>e?e.length<=yt?e:`${e.slice(0,yt)}...`:``,[e]);return e?(0,F.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,F.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,F.jsx)(Se,{width:18,height:18,color:`var(--oh-muted)`}),(0,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsxs)(`button`,{type:`button`,onClick:s,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$VIEW)}),(0,F.jsx)(Ge,{className:`text-white`,size:18})]})]}),(0,F.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:l&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(N,{includeStandard:!0,components:t?bt:Re,children:l}),e&&e.length>yt&&(0,F.jsx)(`button`,{type:`button`,onClick:s,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(h.COMMON$READ_MORE)})]})}),(0,F.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:c,disabled:n,className:C(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,F.jsxs)(k.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,F.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function St({errorId:e,defaultMessage:t}){let{t:n}=m(`openhands`),[r,i]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&_.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,F.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,F.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,F.jsx)(N,{children:t})]})}function Ct({event:e}){return Oe(e)?(0,F.jsx)(St,{errorId:e.id,defaultMessage:e.error}):null}function wt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Tt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Et({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:C(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(ue,{width:18,height:18})})}function Dt({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:C(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ot({src:e,onRemove:t,size:n=`small`}){return(0,F.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,F.jsx)(Dt,{src:e,size:n}),t&&(0,F.jsx)(Et,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function kt({size:e=`small`,images:t,onRemove:n}){let r=P.useRef(null),[i,a]=P.useState(!1),[o,s]=P.useState(!0),[c,l]=P.useState(!1);return P.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,F.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,F.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(wt,{active:!o})}),(0,F.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:C(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Ot,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,F.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(Tt,{active:!c})})]})}function At({type:e,onClick:t}){let{t:n}=m(`openhands`),r=e===`confirm`,i=n(r?h.ACTION$CONFIRM:h.ACTION$REJECT),a=n(r?h.CHAT_INTERFACE$USER_CONFIRMED:h.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(h.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(h.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(re,{closeDelay:100,content:a,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:C(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function jt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:C(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,F.jsx)(`span`,{className:``,children:n}),(0,F.jsx)(`span`,{className:`font-bold`,children:i}),(0,F.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Mt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Nt=ie(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Pt=()=>f({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return _e.respondToConfirmation(e,t,i,n)}});function Ft(){let e=Nt(e=>e.submittedEventIds),t=Nt(e=>e.addSubmittedEventId),{t:n}=m(`openhands`),{data:r}=me(),{curAgentState:i}=ge(),{mutate:a}=Pt(),o=Ne(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===x.AWAITING_USER_CONFIRMATION:!1),s=(0,P.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,P.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),s(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),s(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,s]),i!==x.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(M(o)?o.security_risk:w.UNKNOWN)===w.HIGH&&(0,F.jsx)(jt,{content:n(h.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Mt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(h.COMMON$HIGH_RISK)}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(h.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(At,{type:`reject`,onClick:()=>s(!1)}),(0,F.jsx)(At,{type:`confirm`,onClick:()=>s(!0)})]})]})]})}var It=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,M as n,N as r,P as i,bt as a}from"./vendor-styling-CI0PQ3ab.js";import{n as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{d as s,l as c,m as l,r as u,s as d}from"./path-utils-BeOmjIcE.js";import{t as f}from"./useMutation-DCE9RcgK.js";import{t as p}from"./Trans-De9RwQhA.js";import{t as m}from"./useTranslation-Cgy4JA_g.js";import{t as h}from"./declaration-B9kpCaYl.js";import{A as g,H as _,n as v}from"./active-backend-context-u2tdYRgH.js";import{t as y}from"./createLucideIcon-CVAsW2Yo.js";import{t as b}from"./chevron-down-CI8A6tet.js";import{t as ee}from"./loader-circle-BEykUKYG.js";import{C as x,M as S,t as C}from"./utils-CE0lDWtb.js";import{n as w}from"./common-Dh7OqABE.js";import{n as T,o as E}from"./form-control-classes-9rkU4usZ.js";import{t as te}from"./use-config-ur0RbjCP.js";import{n as ne}from"./navigation-context-DPs2G0X8.js";import{t as re}from"./styled-tooltip-DsKsFjuq.js";import{t as ie}from"./react-DPDgL6du.js";import{s as D}from"./conversation-local-storage-F6zVMM--.js";import{t as O}from"./conversation-store-LptbOvKa.js";import{r as ae}from"./use-settings-dX4fKUPF.js";import{t as oe}from"./agent-server-conversation-service.api-BP73yONA.js";import{t as se}from"./conversation-service.api-CqZcHr1c.js";import{n as ce}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js";import{t as le}from"./skills-9cDZONKh.js";import{t as ue}from"./close-p3Op5lxI.js";import{t as de}from"./copy-to-clipboard-button-Aj9wFmt2.js";import{r as k}from"./typography-YGPBGzOG.js";import{t as fe}from"./u-check-circle-BqoIxNz_.js";import{n as pe,r as A,t as me}from"./use-active-conversation-DI5S5M1w.js";import{n as he}from"./files-tab-store-DJsPxYdg.js";import{t as ge}from"./use-agent-state-Buh3bQDh.js";import{d as _e,f as ve,m as ye,p as be,r as xe,t as Se}from"./lesson-plan-BtrZUCuj.js";import{C as Ce,O as we,S as j,T as Te,a as Ee,b as De,c as Oe,i as ke,m as Ae,o as je,r as Me,s as M,t as Ne,y as Pe}from"./use-event-store-YSOxy9FC.js";import{ot as Fe,st as Ie}from"./vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js";import{n as Le,t as N}from"./markdown-renderer-D8mayGjI.js";import{n as Re,r as ze,t as Be}from"./plan-components-j9X4AxYM.js";import{n as Ve,t as He}from"./get-language-from-path-CPNnuVhI.js";import{n as Ue,t as We}from"./u-check-circle-half-LiwZkuFe.js";var Ge=y(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(t(),1);function Ke(){!r.current&&n();let[e]=(0,P.useState)(i.current);return e}var F=a(),qe=function(e){return e.INIT=`initialize`,e.MESSAGE=`message`,e.SYSTEM=`system`,e.READ=`read`,e.WRITE=`write`,e.RUN=`run`,e.RUN_IPYTHON=`run_ipython`,e.BROWSE=`browse`,e.BROWSE_INTERACTIVE=`browse_interactive`,e.DELEGATE=`delegate`,e.THINK=`think`,e.FINISH=`finish`,e.REJECT=`reject`,e.CHANGE_AGENT_STATE=`change_agent_state`,e.MCP=`call_tool_mcp`,e.TASK_TRACKING=`task_tracking`,e}(qe||{});function Je(){let{conversationId:e}=A(),t=xe();return{send:(0,P.useCallback)(async e=>{if(t){let{action:n,args:r}=e;if(n===`message`&&r?.content){let e=[{type:`text`,text:r.content}];return r.image_urls&&r.image_urls.length>0&&e.push({type:`image`,image_urls:r.image_urls}),await t.sendMessage({role:`user`,content:e})}return{queued:!1}}return{queued:!1}},[t,e])}}function Ye(e,t,n,r){return{action:qe.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),L=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function Xe({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(ce,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:s}=m(`openhands`),[c,l]=P.useState(r),u=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`cursor-pointer text-left`,"aria-label":s(c?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:c?(0,F.jsx)(L,{className:C(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:C(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&u,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&u]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(Xe,{status:n})]})]}),c&&(typeof t==`string`?(0,F.jsx)(N,{children:t}):t)]})}var Ze=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),Qe=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),$e={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function et({status:e}){let{t}=m(`openhands`),{conversationId:n}=A(),r=be(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,P.useState)(!1),{active:o,objective:l,iteration:u,max_iterations:f,verdict:p}=e,_=p?Math.round(p.score*100):null,v=p?.missing?t(h.GOAL$MISSING,{missing:p.missing}):``,y=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){g(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},b=()=>y(async e=>{await s(e),await d(e)},h.GOAL$STOP_FAILED),ee=()=>y(c,h.GOAL$RESUME_FAILED),x=null;return n&&o?x=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:b,className:C(T,E),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(x=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:ee,className:C(T,E),children:t(h.GOAL$RESUME)})),(0,F.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:l}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:u,max:f})}),(0,F.jsx)(`span`,{children:t($e[e.status])}),_!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:_})}),o?(0,F.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,F.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,F.jsx)(Ze,{className:`w-3.5 h-3.5 fill-success`})}):(0,F.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,F.jsx)(Qe,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:x,details:v,initiallyExpanded:!o,chevronPosition:`before`})})}var tt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,F.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,F.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function nt({profile:e}){let[t,n]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,F.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,F.jsx)(b,{size:14}):(0,F.jsx)(l,{size:14})}),(0,F.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-neutral-700`}),(0,F.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function rt({conversationId:e,anchorEventId:t}){let n=ve(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,F.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(tt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(p,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,F.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,F.jsx)(R,{title:(0,F.jsx)(`span`,{children:t?(0,F.jsx)(p,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(p,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,F.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,F.jsx)(p,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(nt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var it=(0,P.createContext)(void 0);function at({children:e,value:t}){let n=ze(P.useRef(null)),r=t||n;return(0,F.jsx)(it.Provider,{value:r,children:e})}function ot(){let e=(0,P.useContext)(it);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function st(){return(0,P.useContext)(it)}var ct=()=>{let{setConversationMode:e}=O(),{send:t}=Je(),{conversationId:n}=A(),r=ye(e=>e.enqueuePendingMessage),i=ye(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,P.useCallback)(a=>{a?.preventDefault(),a?.stopPropagation(),e(`code`);let o=`Execute the plan based on the .agents_tmp/PLAN.md file.`,s=new Date().toISOString(),c=n?r({conversationId:n,text:o,timestamp:s}):null;t(Ye(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},lt=`200%`,z=8,ut=z*2;function dt({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Ke(),c=`oh-text-shimmer-${(0,P.useId)().replace(/:/g,``)}`,l=(0,P.useMemo)(()=>Math.min(z/2-1,1+i/2),[i]),u=(0,P.useMemo)(()=>{let e=z/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${z}%)`,backgroundSize:`${lt} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,F.jsx)(t,{className:C(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${ut}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:C(`relative inline-block`,n),style:u,...o,children:e})]})}var ft=P.memo(dt);function pt({className:e}){return(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var mt=5,ht=360,gt={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function _t({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=m(`openhands`),a=P.useRef(null),[o,s]=P.useState(!1);P.useEffect(()=>{r(o)},[o,r]),P.useLayoutEffect(()=>{let t=a.current;if(!t||n){s(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=mt*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;s(t.scrollHeight>r+1||i>=mt||e.trim().length>ht)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let c=o&&!n;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsx)(`div`,{ref:a,className:C(`text-sm leading-6 whitespace-normal [word-break:break-word]`,c&&`line-clamp-5`),children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:gt,children:e})}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,F.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:C(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(h.COMMON$VIEW_MORE)})]}):null]})}function B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onStop:s}){let{t:c}=m(`openhands`),[l,u]=P.useState(!1),[d,f]=P.useState(!1),[p,g]=P.useState(!1),[_,v]=P.useState(!1),[y,b]=P.useState(!0),ee=P.useRef(null);P.useEffect(()=>{g(!1)},[t]);let x=async()=>{await navigator.clipboard.writeText(t),f(!0)};P.useEffect(()=>{let e;return d&&(e=setTimeout(()=>{f(!1)},2e3)),()=>{clearTimeout(e)}},[d]);let S=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&s!=null,T=w&&l,E=e===`user`&&a==null,te=E&&_&&!p,ne=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!w||E)return;let e=ee.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,w,E]);let ie=E?(0,F.jsx)(_t,{message:t,isHovering:l,isExpanded:p,onTruncatableChange:v}):(0,F.jsx)(`div`,{ref:ee,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:gt,children:t})}),D=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:C(`rounded-xl relative w-fit max-w-full flex flex-col`,ne&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!S&&`last:mb-4`),children:[(0,F.jsxs)(`div`,{className:C(`absolute -top-2.5 -right-2.5 z-10`,!l||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(re,{content:e.tooltip,placement:`top`,children:(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,F.jsx)(de,{isHidden:!l,isDisabled:d,onClick:x,mode:d?`copied`:`copy`})]}),ie,w?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s?.()},"data-testid":`chat-message-stop`,"aria-label":c(h.BUTTON$STOP),"aria-hidden":!T,tabIndex:T?0:-1,className:C(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,y?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,T?`opacity-100`:`pointer-events-none opacity-0`),children:(0,F.jsx)(pt,{className:`block h-7 w-7 max-w-none`})}):null,te?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":c(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>g(!0)}):null,n]});return e===`user`&&a===`error`?(0,F.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[D,(0,F.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,F.jsx)(`span`,{children:c(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:c(h.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,F.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[D,(0,F.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,F.jsx)(ft,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:c(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function vt(){let{conversationId:e}=pe(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=O(),{setSelectedTab:a}=D(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var yt=300,bt=Be(`shine-text`);function xt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=m(`openhands`),{navigateToTab:i}=vt(),{handleBuildPlanClick:a}=ct(),{scrollDomToBottom:o}=ot(),s=()=>{i(`planner`)},c=(0,P.useCallback)(e=>{a(e),o()},[a,o]),l=(0,P.useMemo)(()=>e?e.length<=yt?e:`${e.slice(0,yt)}...`:``,[e]);return e?(0,F.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,F.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,F.jsx)(Se,{width:18,height:18,color:`var(--oh-muted)`}),(0,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsxs)(`button`,{type:`button`,onClick:s,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$VIEW)}),(0,F.jsx)(Ge,{className:`text-white`,size:18})]})]}),(0,F.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:l&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(N,{includeStandard:!0,components:t?bt:Re,children:l}),e&&e.length>yt&&(0,F.jsx)(`button`,{type:`button`,onClick:s,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(h.COMMON$READ_MORE)})]})}),(0,F.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:c,disabled:n,className:C(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,F.jsxs)(k.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,F.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function St({errorId:e,defaultMessage:t}){let{t:n}=m(`openhands`),[r,i]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&_.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,F.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,F.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,F.jsx)(N,{children:t})]})}function Ct({event:e}){return Oe(e)?(0,F.jsx)(St,{errorId:e.id,defaultMessage:e.error}):null}function wt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Tt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Et({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:C(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(ue,{width:18,height:18})})}function Dt({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:C(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ot({src:e,onRemove:t,size:n=`small`}){return(0,F.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,F.jsx)(Dt,{src:e,size:n}),t&&(0,F.jsx)(Et,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function kt({size:e=`small`,images:t,onRemove:n}){let r=P.useRef(null),[i,a]=P.useState(!1),[o,s]=P.useState(!0),[c,l]=P.useState(!1);return P.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,F.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,F.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(wt,{active:!o})}),(0,F.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:C(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Ot,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,F.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(Tt,{active:!c})})]})}function At({type:e,onClick:t}){let{t:n}=m(`openhands`),r=e===`confirm`,i=n(r?h.ACTION$CONFIRM:h.ACTION$REJECT),a=n(r?h.CHAT_INTERFACE$USER_CONFIRMED:h.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(h.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(h.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(re,{closeDelay:100,content:a,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:C(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function jt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:C(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,F.jsx)(`span`,{className:``,children:n}),(0,F.jsx)(`span`,{className:`font-bold`,children:i}),(0,F.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Mt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Nt=ie(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Pt=()=>f({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return _e.respondToConfirmation(e,t,i,n)}});function Ft(){let e=Nt(e=>e.submittedEventIds),t=Nt(e=>e.addSubmittedEventId),{t:n}=m(`openhands`),{data:r}=me(),{curAgentState:i}=ge(),{mutate:a}=Pt(),o=Ne(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===x.AWAITING_USER_CONFIRMATION:!1),s=(0,P.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,P.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),s(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),s(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,s]),i!==x.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(M(o)?o.security_risk:w.UNKNOWN)===w.HIGH&&(0,F.jsx)(jt,{content:n(h.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Mt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(h.COMMON$HIGH_RISK)}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(h.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(At,{type:`reject`,onClick:()=>s(!1)}),(0,F.jsx)(At,{type:`confirm`,onClick:()=>s(!0)})]})]})]})}var It=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
2
2
|
`):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=_.t(h.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function Lt(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Rt(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function zt(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Bt(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Vt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ht(e){let t=e?.verification;if(!Vt(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function Ut({feature:e}){let t=Math.round(e.probability*100),n=Bt(e.probability);return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,F.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function V({label:e,features:t}){return!t||t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[t>0&&(0,F.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,F.jsx)(Ut,{feature:e})]},e.name))]})}function Wt({categorized:e}){let{t}=m(),n=e.agent_behavioral_issues&&e.agent_behavioral_issues.length>0,r=e.user_followup_patterns&&e.user_followup_patterns.length>0,i=e.infrastructure_issues&&e.infrastructure_issues.length>0,a=e.other&&e.other.length>0;return!n&&!r&&!i&&!a?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,F.jsx)(V,{label:t(h.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,F.jsx)(V,{label:t(h.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,F.jsx)(V,{label:t(h.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,F.jsx)(V,{label:t(h.CRITIC$OTHER),features:e.other})]})}function Gt({criticResult:e}){let{t}=m(),{data:n}=ae(),[r,i]=P.useState(!1),a=Lt(e.score),{filled:o,empty:s}=Rt(a),c=zt(a),l=(a*100).toFixed(1),u=Ht(n?.agent_settings)===!1,d=e.metadata?.categorized_features,f=d!=null&&((d.agent_behavioral_issues??[]).length>0||(d.user_followup_patterns??[]).length>0||(d.infrastructure_issues??[]).length>0||(d.other??[]).length>0);return(0,F.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(h.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,F.jsxs)(`span`,{className:`${c} text-xs tracking-wide`,"aria-label":`Score: ${l}%`,children:[`★`.repeat(o),`☆`.repeat(s)]}),(0,F.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,l,`%)`]}),f&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":t(r?h.BUTTON$COLLAPSE_DETAILS:h.BUTTON$EXPAND_DETAILS),children:r?(0,F.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`}):(0,F.jsx)(I,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&f&&(0,F.jsx)(Wt,{categorized:d}),u&&(0,F.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(h.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}function H({content:e}){let{t}=m(`openhands`),[n,r]=P.useState(!1);if(!e.trim())return null;let i=n?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-label":t(n?h.THINKING$COLLAPSE:h.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,F.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(Ve,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(h.THINKING$TITLE)})]}),n&&(0,F.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,F.jsx)(N,{children:e})})]})}var Kt=()=>{let e=o();return f({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await oe.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await oe.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function qt({event:e,isLastMessage:t,isFromPlanningAgent:n}){let{t:r}=m(`openhands`),{navigate:i}=ne(),{conversationId:a}=A(),o=v().backend.kind===`cloud`,{mutate:s,isPending:c}=Kt(),l=O(e=>e.setMessageToSend),d=P.useRef(!1),f=It(e),{reasoning:p,message:_}=e.source===`agent`?Ee(f):{reasoning:``,message:f},y=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&y.push(...e.image_urls)});let b=!o&&a?[{icon:(0,F.jsx)(u,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!a||c||d.current)return;d.current=!0;let t=se.getCurrentConversation(),n=t?.id===a?t.title:void 0,r=n?`${n} (branch)`:void 0,o=e.source===`user`&&_.length>0;s({sourceConversationId:a,eventId:e.id,...o?{editText:_}:{},...r?{title:r}:{}},{onSuccess:({info:e,excluded:t})=>{i(`/conversations/${e.id}`),t&&window.setTimeout(()=>l(_),0)},onError:e=>g(e instanceof Error?e.message:null),onSettled:()=>{d.current=!1}})},tooltip:r(h.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,F.jsxs)(F.Fragment,{children:[p&&(0,F.jsx)(H,{content:p}),(0,F.jsxs)(B,{type:e.source,message:_,isFromPlanningAgent:n,actions:b,children:[y.length>0&&(0,F.jsx)(kt,{size:`small`,images:y}),t&&(0,F.jsx)(Ft,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,F.jsx)(Gt,{criticResult:e.critic_result})]})}var Jt=class{static isDevMode=!1;static message(e){this.isDevMode&&console.warn(JSON.stringify(JSON.parse(e.data.toString()),null,2))}static event(e,t){this.isDevMode&&console.warn(t||`EVENT`,e)}static warning(e){this.isDevMode&&console.warn(e)}static error(e){this.isDevMode&&console.error(e)}},Yt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function Xt(e){let{children:t}=e,n=e=>{try{return Yt(e)}catch(t){return Jt.error(String(t)),e}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var Zt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},Qt=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,$t=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return Qt(e)&&!n.endsWith(`/`)?`${n}/`:n};function en(e){let{children:t}=e,n=e=>{try{let t=Zt(e);return(0,F.jsx)(`span`,{className:`font-mono`,title:t,children:$t(t)})}catch(t){return Jt.error(String(t)),(0,F.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map((e,t)=>typeof e==`string`?(0,F.jsx)(`span`,{children:n(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var U=1e3,tn=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,nn=e=>{switch(e){case w.LOW:return _.t(h.SECURITY$LOW_RISK);case w.MEDIUM:return _.t(h.SECURITY$MEDIUM_RISK);case w.HIGH:return _.t(h.SECURITY$HIGH_RISK);case w.UNKNOWN:default:return _.t(h.SECURITY$UNKNOWN_RISK)}},W=()=>``,rn=e=>e.name?`**Skill:** \`${e.name}\``:W(),an=e=>{let{action:t}=e,n=[];return t.pattern&&n.push(`**Pattern:** \`${t.pattern}\``),t.path&&n.push(`**Path:** \`${t.path}\``),`include`in t&&t.include&&n.push(`**Include:** \`${t.include}\``),n.length>0?n.join(`
|
|
3
3
|
`):W()},on=e=>{if(e.command!==`create`||!e.file_text)return W();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,U)}...`),`${e.path}\n${t}`},sn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===w.HIGH||e.security_risk===w.MEDIUM)&&(t+=`\n\n${nn(e.security_risk)}`),t},cn=e=>{let t=`**MCP Tool Call**
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{k as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useQueries-CRzaAqzH.js";import{t as s}from"./useQuery-CpjHYtZc.js";import{t as c}from"./useTranslation-Cgy4JA_g.js";import{t as l}from"./declaration-B9kpCaYl.js";import{d as u,t as d,u as f}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{l as p,n as m}from"./active-backend-context-DRFevVIj.js";import{t as h}from"./createLucideIcon-CVAsW2Yo.js";import{t as g}from"./onboarding-modal-CGHPoMp7.js";import{t as _}from"./utils-CE0lDWtb.js";import{n as v}from"./agent-server-client-options-DVLRd9sw.js";import{t as y}from"./modal-backdrop-zVwfOJZr.js";import{r as b,t as x}from"./modal-body-Dcu5McCa.js";import{r as S}from"./base-modal-CC5Pp8CF.js";import{i as C}from"./modal-classes-DPqxSyuP.js";import{t as w}from"./brand-button-DKPMEKcW.js";import{t as T}from"./use-onboarding-completion-C_Swglzp.js";import{t as E}from"./confirmation-modal-BK1F0A68.js";import{t as D}from"./folder-mMWFvaw0.js";import{t as O}from"./close-p3Op5lxI.js";var k=h(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),A=h(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]);function j(){return new d(v())}function M(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var N=class{static async listWorkspaces(){return M(await j().listWorkspaces())}static async addWorkspaces(e){return M(await j().addWorkspaces(e))}static async removeWorkspace(e){await j().deleteWorkspace(e)}static async addWorkspaceParents(e){return M(await j().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await j().deleteWorkspaceParent(e)}};function P(){let e=i();return a({mutationFn:e=>N.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function ee(){let e=i();return a({mutationFn:e=>N.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function F(){let e=i();return a({mutationFn:e=>N.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function I(){let e=i();return a({mutationFn:e=>N.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}var L=e(t(),1);function R({enabled:e=!0}={}){return s({queryKey:p.all,queryFn:()=>N.listWorkspaces(),enabled:e,retry:(e,t)=>!f(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function z(){let{data:e,isLoading:t,isError:n,error:r}=R(),i=f(r),a=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,L.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,i]),l=o({queries:i?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new u(v()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),d=t||l.some(e=>e.isLoading),p=n||l.some(e=>e.isError);return{workspaces:(0,L.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:d,isError:p,error:r}}function B(e,t){return f(e)?t(l.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function V(){return new u(v())}var te=e=>{let t=m();return s({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},ne=()=>{let e=m();return s({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>V().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},H=n(),U=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),W=`/projects`;function G({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,H.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,H.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,H.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:_(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,H.jsx)(D,{width:14,height:14,className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function K(e){let t=J(e);if(!t||t===`/`||q(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function q(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function J(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function Y(e){return e?.home===`/home/openhands`}function X({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=c(`openhands`),[a,o]=(0,L.useState)(null),s=m(),{data:u}=ne();(0,L.useEffect)(()=>{e&&u?.home&&a===null&&o(Y(u)?W:u.home),e||o(null)},[e,u?.home,a]),(0,L.useEffect)(()=>{o(null)},[s.backend.id,s.orgId]);let{data:d,isLoading:f,isError:p,error:h}=te(e?a:null),g=(0,L.useMemo)(()=>{if(!u?.home)return[];let e=[{label:`Home`,path:J(u.home)||u.home},...u.favorites??[]];return Y(u)&&!e.some(e=>e.path===W)&&e.push({label:W,path:W}),e},[u]),v=u?.locations??[];if(!e)return null;let T=d?.items??[],E=a?K(a):null,O=u?.home===`/home/openhands`&&(u?.favorites?.length??0)===0&&a===u?.home&&!f&&!p&&T.length===0,k=e=>{let t=J(e);if(!t)return`/`;if(t===`/`||q(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,H.jsx)(y,{onClose:t,"aria-label":i(l.HOME$ADD_WORKSPACES_TITLE),children:(0,H.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:_(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,b(`xl`),x,`h-[480px]`),children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,H.jsx)(S,{className:C,title:i(l.HOME$ADD_WORKSPACES_TITLE)})}),(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,H.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,H.jsx)(G,{label:i(l.HOME$FAVORITES),entries:g,currentPath:a,onPick:o}),(0,H.jsx)(G,{label:i(l.HOME$LOCATIONS),entries:v,currentPath:a,onPick:o})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,H.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>E&&o(E),disabled:!E,"aria-label":i(l.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,H.jsx)(U,{width:16,height:16})}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,H.jsx)(`span`,{children:i(l.HOME$NAME)}),(0,H.jsx)(`span`,{children:i(l.HOME$KIND)})]}),(0,H.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[f&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(l.HOME$LOADING)}),p&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:h?.message??i(l.COMMON$FAILED_TO_LOAD)}),!f&&!p&&T.length===0&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":O?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(O?l.HOME$HOST_HOME_NOT_MOUNTED_HINT:l.HOME$NO_WORKSPACES)}),T.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,H.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(l.HOME$FOLDER)})]})},e.path))]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,H.jsx)(w,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(l.HOME$CANCEL)}),r&&(0,H.jsx)(w,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-add-all-subdirs`,children:i(l.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,H.jsx)(w,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-use`,children:i(l.HOME$ADD_THIS_DIRECTORY)})]})]})})}function re({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:o}=c(`openhands`),[s,u]=L.useState(null);if(!e)return null;let d=t.filter(e=>!e.parentPath),f=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=f.get(e.parentPath)??[];t.push(e),f.set(e.parentPath,t)});let p=d.length>0||n.length>0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(y,{onClose:r,"aria-label":o(l.HOME$MANAGE_WORKSPACES),children:(0,H.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:_(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,b(`lg`),x,`max-h-[70vh]`),children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,H.jsx)(S,{className:C,title:o(l.HOME$MANAGE_WORKSPACES)})}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,H.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:o(l.HOME$MANAGE_WORKSPACES_EMPTY)}),d.length>0&&(0,H.jsx)(`ul`,{children:d.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u({type:`workspace`,path:e.path,text:o(l.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":o(l.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,H.jsx)(O,{width:12,height:12}),(0,H.jsx)(`span`,{children:o(l.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,H.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,H.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:o(l.HOME$WORKSPACE_PARENTS)}),(0,H.jsx)(`ul`,{children:n.map(e=>{let t=f.get(e.path)??[];return(0,H.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u({type:`parent`,path:e.path,text:o(l.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":o(l.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,H.jsx)(O,{width:12,height:12}),(0,H.jsx)(`span`,{children:o(l.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,H.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,H.jsx)(D,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,H.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,H.jsx)(w,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:o(l.HOME$DONE)})})]})}),s&&(0,H.jsx)(E,{text:s.text,onConfirm:()=>{s&&(s.type===`workspace`?i(s.path):a?.(s.path),u(null))},onCancel:()=>u(null)})]})}var Z=`previewOnboardingStep`,ie=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(Z);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ie?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function ae(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=T();return!n&&i?null:(0,H.jsx)(g,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{B as a,F as c,I as d,A as f,X as i,P as l,$ as n,z as o,k as p,re as r,R as s,ae as t,ee as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{k as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useQueries-CRzaAqzH.js";import{t as s}from"./useQuery-CpjHYtZc.js";import{t as c}from"./useTranslation-Cgy4JA_g.js";import{t as l}from"./declaration-B9kpCaYl.js";import{d as u,t as d,u as f}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{l as p,n as m}from"./active-backend-context-u2tdYRgH.js";import{t as h}from"./createLucideIcon-CVAsW2Yo.js";import{t as g}from"./onboarding-modal-C084vkv7.js";import{t as _}from"./utils-CE0lDWtb.js";import{n as v}from"./agent-server-client-options-DVLRd9sw.js";import{t as y}from"./modal-backdrop-zVwfOJZr.js";import{r as b,t as x}from"./modal-body-Dcu5McCa.js";import{r as S}from"./base-modal-CC5Pp8CF.js";import{i as C}from"./modal-classes-DPqxSyuP.js";import{t as w}from"./brand-button-DKPMEKcW.js";import{t as T}from"./use-onboarding-completion-C_Swglzp.js";import{t as E}from"./confirmation-modal-BK1F0A68.js";import{t as D}from"./folder-mMWFvaw0.js";import{t as O}from"./close-p3Op5lxI.js";var k=h(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),A=h(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]);function j(){return new d(v())}function M(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var N=class{static async listWorkspaces(){return M(await j().listWorkspaces())}static async addWorkspaces(e){return M(await j().addWorkspaces(e))}static async removeWorkspace(e){await j().deleteWorkspace(e)}static async addWorkspaceParents(e){return M(await j().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await j().deleteWorkspaceParent(e)}};function P(){let e=i();return a({mutationFn:e=>N.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function ee(){let e=i();return a({mutationFn:e=>N.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function F(){let e=i();return a({mutationFn:e=>N.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function I(){let e=i();return a({mutationFn:e=>N.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}var L=e(t(),1);function R({enabled:e=!0}={}){return s({queryKey:p.all,queryFn:()=>N.listWorkspaces(),enabled:e,retry:(e,t)=>!f(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function z(){let{data:e,isLoading:t,isError:n,error:r}=R(),i=f(r),a=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,L.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,i]),l=o({queries:i?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new u(v()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),d=t||l.some(e=>e.isLoading),p=n||l.some(e=>e.isError);return{workspaces:(0,L.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:d,isError:p,error:r}}function B(e,t){return f(e)?t(l.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function V(){return new u(v())}var te=e=>{let t=m();return s({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},ne=()=>{let e=m();return s({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>V().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},H=n(),U=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),W=`/projects`;function G({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,H.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,H.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,H.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:_(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,H.jsx)(D,{width:14,height:14,className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function K(e){let t=J(e);if(!t||t===`/`||q(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function q(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function J(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function Y(e){return e?.home===`/home/openhands`}function X({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=c(`openhands`),[a,o]=(0,L.useState)(null),s=m(),{data:u}=ne();(0,L.useEffect)(()=>{e&&u?.home&&a===null&&o(Y(u)?W:u.home),e||o(null)},[e,u?.home,a]),(0,L.useEffect)(()=>{o(null)},[s.backend.id,s.orgId]);let{data:d,isLoading:f,isError:p,error:h}=te(e?a:null),g=(0,L.useMemo)(()=>{if(!u?.home)return[];let e=[{label:`Home`,path:J(u.home)||u.home},...u.favorites??[]];return Y(u)&&!e.some(e=>e.path===W)&&e.push({label:W,path:W}),e},[u]),v=u?.locations??[];if(!e)return null;let T=d?.items??[],E=a?K(a):null,O=u?.home===`/home/openhands`&&(u?.favorites?.length??0)===0&&a===u?.home&&!f&&!p&&T.length===0,k=e=>{let t=J(e);if(!t)return`/`;if(t===`/`||q(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,H.jsx)(y,{onClose:t,"aria-label":i(l.HOME$ADD_WORKSPACES_TITLE),children:(0,H.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:_(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,b(`xl`),x,`h-[480px]`),children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,H.jsx)(S,{className:C,title:i(l.HOME$ADD_WORKSPACES_TITLE)})}),(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,H.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,H.jsx)(G,{label:i(l.HOME$FAVORITES),entries:g,currentPath:a,onPick:o}),(0,H.jsx)(G,{label:i(l.HOME$LOCATIONS),entries:v,currentPath:a,onPick:o})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,H.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>E&&o(E),disabled:!E,"aria-label":i(l.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,H.jsx)(U,{width:16,height:16})}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,H.jsx)(`span`,{children:i(l.HOME$NAME)}),(0,H.jsx)(`span`,{children:i(l.HOME$KIND)})]}),(0,H.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[f&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(l.HOME$LOADING)}),p&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:h?.message??i(l.COMMON$FAILED_TO_LOAD)}),!f&&!p&&T.length===0&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":O?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(O?l.HOME$HOST_HOME_NOT_MOUNTED_HINT:l.HOME$NO_WORKSPACES)}),T.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,H.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(l.HOME$FOLDER)})]})},e.path))]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,H.jsx)(w,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(l.HOME$CANCEL)}),r&&(0,H.jsx)(w,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-add-all-subdirs`,children:i(l.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,H.jsx)(w,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-use`,children:i(l.HOME$ADD_THIS_DIRECTORY)})]})]})})}function re({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:o}=c(`openhands`),[s,u]=L.useState(null);if(!e)return null;let d=t.filter(e=>!e.parentPath),f=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=f.get(e.parentPath)??[];t.push(e),f.set(e.parentPath,t)});let p=d.length>0||n.length>0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(y,{onClose:r,"aria-label":o(l.HOME$MANAGE_WORKSPACES),children:(0,H.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:_(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,b(`lg`),x,`max-h-[70vh]`),children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,H.jsx)(S,{className:C,title:o(l.HOME$MANAGE_WORKSPACES)})}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,H.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:o(l.HOME$MANAGE_WORKSPACES_EMPTY)}),d.length>0&&(0,H.jsx)(`ul`,{children:d.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u({type:`workspace`,path:e.path,text:o(l.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":o(l.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,H.jsx)(O,{width:12,height:12}),(0,H.jsx)(`span`,{children:o(l.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,H.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,H.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:o(l.HOME$WORKSPACE_PARENTS)}),(0,H.jsx)(`ul`,{children:n.map(e=>{let t=f.get(e.path)??[];return(0,H.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u({type:`parent`,path:e.path,text:o(l.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":o(l.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,H.jsx)(O,{width:12,height:12}),(0,H.jsx)(`span`,{children:o(l.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,H.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,H.jsx)(D,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,H.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,H.jsx)(w,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:o(l.HOME$DONE)})})]})}),s&&(0,H.jsx)(E,{text:s.text,onConfirm:()=>{s&&(s.type===`workspace`?i(s.path):a?.(s.path),u(null))},onCancel:()=>u(null)})]})}var Z=`previewOnboardingStep`,ie=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(Z);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ie?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function ae(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=T();return!n&&i?null:(0,H.jsx)(g,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{B as a,F as c,I as d,A as f,X as i,P as l,$ as n,z as o,k as p,re as r,R as s,ae as t,ee as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{Ct as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{t as a}from"./declaration-B9kpCaYl.js";import{A as o,N as s,j as c,n as l,r as u}from"./active-backend-context-DRFevVIj.js";import{t as d}from"./createLucideIcon-CVAsW2Yo.js";import{n as f,t as p}from"./chat-send-button-DxuZIoW8.js";import{t as m}from"./check-Bvi71siz.js";import{t as h}from"./loader-circle-BEykUKYG.js";import{i as g,r as _,t as v}from"./llm-settings-BgSFkbHC.js";import{t as y}from"./utils-CE0lDWtb.js";import{E as b,O as x,S,T as C,_ as w,p as T}from"./agent-server-client-options-DVLRd9sw.js";import{a as E}from"./use-backends-health-e-Ull4wz.js";import{t as D}from"./modal-backdrop-zVwfOJZr.js";import{r as O,t as k}from"./modal-body-Dcu5McCa.js";import{t as A}from"./brand-button-DKPMEKcW.js";import{n as j}from"./navigation-context-DPs2G0X8.js";import{t as M}from"./openhands-logo-bcNw5bkY.js";import{o as N,s as P,t as F}from"./backend-form-modal-D2EDGVAc.js";import{r as I}from"./use-settings-B07msZ2Z.js";import{t as ee}from"./use-tracking-CqODdfO4.js";import{c as L,i as R,n as z,o as B}from"./acp-providers-D_D8VUpP.js";import{n as V,r as H}from"./use-agent-profiles-DnH16_Vm.js";import{t as U}from"./use-create-conversation-CvAXfA3T.js";import{r as W,t as G}from"./recommended-automations-launcher-CXaEK1rW.js";import{t as te}from"./terminal-BuLtIrb9.js";import{t as ne}from"./use-save-settings-5xPYpSQM.js";import{o as re}from"./use-can-manage-org-profiles-OIhplvQ0.js";import{t as ie}from"./use-save-agent-profile-DFjxHhNx.js";import{n as ae}from"./use-activate-agent-profile-DY0txItX.js";import{a as oe,i as se,n as ce,r as le,t as ue}from"./use-acp-credential-form-rzaqkJ1n.js";var de=d(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),K=e(n(),1),q=r(),fe=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,pe=`0 0 100 100`,me=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,he=`0 0 12 12`,ge=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,_e=`0 0 24 24`,ve=3/2;function J({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,q.jsx)(M,{width:Math.round(t*ve),height:t,className:y(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:pe,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:fe})}):e===`codex`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:he,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:me,fill:`currentColor`})}):e===`gemini`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:_e,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:ge})}):(0,q.jsx)(te,{width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ye({currentStep:e,totalSteps:t,className:n}){return(0,q.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:y(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,q.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:y(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function be(e){return e===`openhands`?`openhands`:z.find(({key:t})=>t===e)?.icon??`cli-generic`}function xe({id:e,muted:t}){let n=be(e);return n===`openhands`?(0,q.jsx)(J,{kind:`openhands`,size:16,className:y(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,q.jsx)(J,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Se(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:a.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...z.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ce({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:l}=i(`openhands`),{mutate:u,isPending:d}=ne();return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:l(a.ONBOARDING$AGENT_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:l(a.ONBOARDING$AGENT_SUBTITLE)})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":l(a.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Se().map(n=>{let r=n.id===e;return(0,q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:y(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(xe,{id:n.id,muted:!1}),(0,q.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,q.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:l(n.descriptionKey)})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,q.jsx)(m,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,q.jsxs)(`div`,{className:y(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,q.jsx)(A,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:d,children:l(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:d,onClick:()=>{let t=R(e);if(!t){r();return}u({agent_settings_diff:t},{onError:e=>{o(s(e)||l(a.ERROR$GENERIC))},onSuccess:()=>{c(l(a.SETTINGS$SAVED)),r()}})},children:l(d?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function we({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:y(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,q.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(a.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,q.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(a.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=N(r,e,{isConnected:t,lastError:n});return(0,q.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,q.jsx)(de,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,q.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(a.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,q.jsx)(h,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,q.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(a.ONBOARDING$BACKEND_CHECKING)})]})}function Te({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:o,addBackend:s,setActive:c,updateBackend:l}=u(),{backend:d}=o,f=T(d),p=C(),m=p!==null&&!f&&!(d.kind===`cloud`&&x(d.host,p)),h=f||m,g=K.useMemo(()=>S(),[]),_=h?{id:`onboarding-local-backend-draft`,name:w,host:g.baseUrl,apiKey:g.sessionApiKey,kind:`local`}:d,v=E(f?[]:[d]),D=h?null:v[d.id]?.isConnected??null,O=h?null:v[d.id]?.lastError??null,[k,j]=K.useState(!1);K.useEffect(()=>{D===!0&&j(!1)},[D]);let M=D===!0&&!k,N=K.useCallback(e=>{if(f)s(e);else{let t=e.host!==d.host;l(d.id,e),t&&o.orgId!==null&&c(d.id,null)}p!==null&&e.kind===`cloud`&&n?n():t()},[o.orgId,s,d.host,d.id,p,f,n,t,c,l]),I=y(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(h?p?a.ONBOARDING$LOGIN_TO_CLOUD_TITLE:a.BACKEND$ADD_TITLE:a.ONBOARDING$BACKEND_TITLE)}),h?null:(0,q.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$BACKEND_SUBTITLE)})]}),h?null:(0,q.jsx)(we,{backend:_,isConnected:D,lastError:O}),D===!0?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>j(e=>!e),"aria-expanded":k,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,q.jsx)(`span`,{children:r(k?a.ONBOARDING$BACKEND_HIDE_CONFIGURATION:a.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,q.jsx)(P,{className:y(`h-4 w-4 shrink-0 text-muted transition-transform`,k&&`rotate-180`),"aria-hidden":!0})]}):null,(0,q.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:M?null:(0,q.jsx)(F,{onConnected:N,testIdRoot:`onboarding-backend`,initialManualBackend:_,requireManualApiKey:b(),manualSubmitLabel:r(a.ONBOARDING$NEXT),manualSubmittingLabel:r(a.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`})}),M?(0,q.jsxs)(`div`,{className:I,children:[e?(0,q.jsx)(A,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(a.ONBOARDING$NEXT)})]}):null]})}var Y=H;function X(){let e=ie(),t=ae();return(0,K.useCallback)(async n=>{try{await e.mutateAsync({name:Y,profile:n});let r=(await V.getProfile(Y)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Ee=`openai/gpt-5.5`;function De({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=l(),o=r.kind===`local`,s=_(),c=g(),u=X(),[d,f]=K.useState(null),[p,m]=K.useState(!1),h=K.useCallback(async()=>{if(!o||!d)return null;let e=d.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=re(t),a={model:t};n&&(a.api_key=n),r&&(a.base_url=r);try{return await s.mutateAsync({name:i,request:{llm:a,include_secrets:!0}}),await c.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[o,d,s,c]),y=K.useCallback(async()=>{m(!0);try{let e=await h();e&&await u({agent_kind:`openhands`,llm_profile_ref:e})}finally{m(!1),t()}},[h,u,t]);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(a.ONBOARDING$LLM_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(a.ONBOARDING$LLM_SUBTITLE)})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,q.jsx)(v,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Ee},onSaveSuccess:y,onSaveControlChange:f})}),(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(d?.isSaving??!1)||p,onClick:()=>{if(d?.isDirty){d.save();return}t()},children:n(a.ONBOARDING$NEXT)})]})]})}function Oe({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:o}=i(`openhands`),s=l(),{status:c,isChecking:u}=ce(e,{enabled:t}),{fields:d,values:f,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,consumesFileCredentials:_,save:v,isSaving:y}=ue(e),b=X(),x=L(e)??e,S=c===`authenticated`,C=ke(s.backend.kind,c),w=S||d.some(e=>e.secret&&(!e.multiline||_)&&h(e.name)),T=C&&!w,E=y||T||u&&!w;return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:o(a.ONBOARDING$ACP_SECRETS_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):c!==`authenticated`&&(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,q.jsx)(se,{status:c,isChecking:u,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-5`,children:d.map(e=>(0,q.jsx)(le,{field:e,value:f[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,q.jsx)(oe,{conflicts:g}),T?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:y,children:o(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await v()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:B(e)??void 0}),r())},children:o(y?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function ke(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Ae({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:o}=j(),{backend:s}=l(),c=s.kind!==`cloud`,u=r(a.ONBOARDING$HELLO_DEFAULT_MESSAGE),[d,f]=K.useState(u),{mutate:m,isPending:h,isSuccess:g}=U(),_=W(),v=h||g||_,y=K.useRef(!1),b=d.trim().length>0&&!v&&!y.current,x=()=>{!b||y.current||(y.current=!0,m({query:d.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{o(`/conversations/${e.conversation_id}`),n()},onError:()=>{y.current=!1}}))};return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,q.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(a.ONBOARDING$HELLO_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$HELLO_SUBTITLE)})]}),(0,q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,q.jsx)(`div`,{className:`relative w-full`,children:(0,q.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,q.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(a.ONBOARDING$HELLO_TITLE),type:`text`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())},placeholder:u,disabled:v,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,q.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,q.jsx)(p,{buttonClassName:``,handleSubmit:x,disabled:!b})})]}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,q.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(a.LANDING$OR)}),(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,q.jsx)(G,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:v,children:r(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:v,children:r(a.BUTTON$CLOSE)})]})]})}var je=t({OnboardingModal:()=>Ne}),Z=[`backend`,`agent`,`setup`,`hello`],Me=[`agent`,`setup`,`hello`],Q=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,q.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:y(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ne({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:o}=I(),s=o?.user_consents_to_analytics===!0,{trackOnboardingStarted:c,trackOnboardingStepViewed:l,trackOnboardingCompleted:d,trackOnboardingSkipped:f}=ee(),{active:p}=u(),{backend:m}=p,h=T(m),g=E(h?[]:[m]),_=C(),v=_!==null&&m.kind===`cloud`&&x(m.host,_),b=!h&&g[m.id]?.isConnected===!0&&(_===null||v),S=b?Me:Z,[w,A]=K.useState(()=>Z[Math.min(Math.max(t,0),Z.length-1)]),[j,M]=K.useState(`openhands`);K.useEffect(()=>{S.includes(w)||A(S[0])},[w,S]);let N=S.length,P=S.includes(w)?w:S[0],F=S.indexOf(P),L=h||g[m.id]?.isConnected!==void 0,R=j===`openhands`,z=F===0&&C()!==null,B=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[S]),V=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[S]),H=K.useRef(!1);K.useEffect(()=>{n||!s||H.current||window.sessionStorage.getItem(Q)||(H.current=!0,window.sessionStorage.setItem(Q,`1`),c())},[n,s]);let U=K.useRef(null);K.useEffect(()=>{n||!s||!L||U.current!==P&&(U.current=P,l({step:P,stepIndex:F,totalSteps:N,agent:j}))},[n,s,L,P,F,N,j]);let W=()=>{d({agent:j}),e()},G=()=>{f({step:P,stepIndex:F,totalSteps:N,agent:j}),e()};return(0,q.jsx)(D,{"aria-label":r(a.ONBOARDING$TITLE),children:(0,q.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,q.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":F,"data-preview":n?`true`:void 0,className:y(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,O(`lg`),k,`max-h-[90vh]`),children:[(0,q.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,q.jsx)(ye,{currentStep:F,totalSteps:N})}),(0,q.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,q.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":F,className:`relative overflow-clip`,children:[b?null:(0,q.jsx)($,{index:S.indexOf(`backend`),currentStep:F,children:(0,q.jsx)(Te,{onNext:B,onClose:e})}),(0,q.jsx)($,{index:S.indexOf(`agent`),currentStep:F,children:(0,q.jsx)(Ce,{selectedAgentId:j,onSelect:M,onBack:b?void 0:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`setup`),currentStep:F,children:R?(0,q.jsx)(De,{onBack:V,onNext:B}):(0,q.jsx)(Oe,{providerKey:j,isActive:P===`setup`,onBack:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`hello`),currentStep:F,children:(0,q.jsx)(Ae,{onBack:V,onClose:G,onLaunched:W})})]})})]}),F<N-1&&!z?(0,q.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:G,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(a.ONBOARDING$SKIP)}):null]})})}export{je as n,J as r,Ne as t};
|
|
1
|
+
import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{Ct as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{t as a}from"./declaration-B9kpCaYl.js";import{A as o,N as s,j as c,n as l,r as u}from"./active-backend-context-u2tdYRgH.js";import{t as d}from"./createLucideIcon-CVAsW2Yo.js";import{n as f,t as p}from"./chat-send-button-DxuZIoW8.js";import{t as m}from"./check-Bvi71siz.js";import{t as h}from"./loader-circle-BEykUKYG.js";import{i as g,r as _,t as v}from"./llm-settings-BpdU51Jo.js";import{t as y}from"./utils-CE0lDWtb.js";import{E as b,O as x,S,T as C,_ as w,p as T}from"./agent-server-client-options-DVLRd9sw.js";import{a as E}from"./use-backends-health-CxkvJy2N.js";import{t as D}from"./modal-backdrop-zVwfOJZr.js";import{r as O,t as k}from"./modal-body-Dcu5McCa.js";import{t as A}from"./brand-button-DKPMEKcW.js";import{n as j}from"./navigation-context-DPs2G0X8.js";import{t as M}from"./openhands-logo-bcNw5bkY.js";import{o as N,s as P,t as F}from"./backend-form-modal-BiaOB2C4.js";import{r as I}from"./use-settings-dX4fKUPF.js";import{t as ee}from"./use-tracking-GtXCHmTv.js";import{c as L,i as R,n as z,o as B}from"./acp-providers-D_D8VUpP.js";import{n as V,r as H}from"./use-agent-profiles-DPcaYLpm.js";import{t as U}from"./use-create-conversation-D9OWYcte.js";import{r as W,t as G}from"./recommended-automations-launcher-Bk8tQ-Cn.js";import{t as te}from"./terminal-BuLtIrb9.js";import{t as ne}from"./use-save-settings-CChDyjOB.js";import{o as re}from"./use-can-manage-org-profiles-DeX2Mfje.js";import{t as ie}from"./use-save-agent-profile-aKKLqDJM.js";import{n as ae}from"./use-activate-agent-profile-CKtTToSx.js";import{a as oe,i as se,n as ce,r as le,t as ue}from"./use-acp-credential-form-Bs6s0DTU.js";var de=d(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),K=e(n(),1),q=r(),fe=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,pe=`0 0 100 100`,me=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,he=`0 0 12 12`,ge=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,_e=`0 0 24 24`,ve=3/2;function J({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,q.jsx)(M,{width:Math.round(t*ve),height:t,className:y(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:pe,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:fe})}):e===`codex`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:he,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:me,fill:`currentColor`})}):e===`gemini`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:_e,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:ge})}):(0,q.jsx)(te,{width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ye({currentStep:e,totalSteps:t,className:n}){return(0,q.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:y(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,q.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:y(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function be(e){return e===`openhands`?`openhands`:z.find(({key:t})=>t===e)?.icon??`cli-generic`}function xe({id:e,muted:t}){let n=be(e);return n===`openhands`?(0,q.jsx)(J,{kind:`openhands`,size:16,className:y(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,q.jsx)(J,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Se(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:a.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...z.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ce({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:l}=i(`openhands`),{mutate:u,isPending:d}=ne();return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:l(a.ONBOARDING$AGENT_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:l(a.ONBOARDING$AGENT_SUBTITLE)})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":l(a.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Se().map(n=>{let r=n.id===e;return(0,q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:y(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(xe,{id:n.id,muted:!1}),(0,q.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,q.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:l(n.descriptionKey)})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,q.jsx)(m,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,q.jsxs)(`div`,{className:y(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,q.jsx)(A,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:d,children:l(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:d,onClick:()=>{let t=R(e);if(!t){r();return}u({agent_settings_diff:t},{onError:e=>{o(s(e)||l(a.ERROR$GENERIC))},onSuccess:()=>{c(l(a.SETTINGS$SAVED)),r()}})},children:l(d?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function we({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:y(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,q.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(a.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,q.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(a.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=N(r,e,{isConnected:t,lastError:n});return(0,q.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,q.jsx)(de,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,q.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(a.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,q.jsx)(h,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,q.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(a.ONBOARDING$BACKEND_CHECKING)})]})}function Te({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:o,addBackend:s,setActive:c,updateBackend:l}=u(),{backend:d}=o,f=T(d),p=C(),m=p!==null&&!f&&!(d.kind===`cloud`&&x(d.host,p)),h=f||m,g=K.useMemo(()=>S(),[]),_=h?{id:`onboarding-local-backend-draft`,name:w,host:g.baseUrl,apiKey:g.sessionApiKey,kind:`local`}:d,v=E(f?[]:[d]),D=h?null:v[d.id]?.isConnected??null,O=h?null:v[d.id]?.lastError??null,[k,j]=K.useState(!1);K.useEffect(()=>{D===!0&&j(!1)},[D]);let M=D===!0&&!k,N=K.useCallback(e=>{if(f)s(e);else{let t=e.host!==d.host;l(d.id,e),t&&o.orgId!==null&&c(d.id,null)}p!==null&&e.kind===`cloud`&&n?n():t()},[o.orgId,s,d.host,d.id,p,f,n,t,c,l]),I=y(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(h?p?a.ONBOARDING$LOGIN_TO_CLOUD_TITLE:a.BACKEND$ADD_TITLE:a.ONBOARDING$BACKEND_TITLE)}),h?null:(0,q.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$BACKEND_SUBTITLE)})]}),h?null:(0,q.jsx)(we,{backend:_,isConnected:D,lastError:O}),D===!0?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>j(e=>!e),"aria-expanded":k,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,q.jsx)(`span`,{children:r(k?a.ONBOARDING$BACKEND_HIDE_CONFIGURATION:a.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,q.jsx)(P,{className:y(`h-4 w-4 shrink-0 text-muted transition-transform`,k&&`rotate-180`),"aria-hidden":!0})]}):null,(0,q.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:M?null:(0,q.jsx)(F,{onConnected:N,testIdRoot:`onboarding-backend`,initialManualBackend:_,requireManualApiKey:b(),manualSubmitLabel:r(a.ONBOARDING$NEXT),manualSubmittingLabel:r(a.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`})}),M?(0,q.jsxs)(`div`,{className:I,children:[e?(0,q.jsx)(A,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(a.ONBOARDING$NEXT)})]}):null]})}var Y=H;function X(){let e=ie(),t=ae();return(0,K.useCallback)(async n=>{try{await e.mutateAsync({name:Y,profile:n});let r=(await V.getProfile(Y)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Ee=`openai/gpt-5.5`;function De({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=l(),o=r.kind===`local`,s=_(),c=g(),u=X(),[d,f]=K.useState(null),[p,m]=K.useState(!1),h=K.useCallback(async()=>{if(!o||!d)return null;let e=d.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=re(t),a={model:t};n&&(a.api_key=n),r&&(a.base_url=r);try{return await s.mutateAsync({name:i,request:{llm:a,include_secrets:!0}}),await c.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[o,d,s,c]),y=K.useCallback(async()=>{m(!0);try{let e=await h();e&&await u({agent_kind:`openhands`,llm_profile_ref:e})}finally{m(!1),t()}},[h,u,t]);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(a.ONBOARDING$LLM_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(a.ONBOARDING$LLM_SUBTITLE)})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,q.jsx)(v,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Ee},onSaveSuccess:y,onSaveControlChange:f})}),(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(d?.isSaving??!1)||p,onClick:()=>{if(d?.isDirty){d.save();return}t()},children:n(a.ONBOARDING$NEXT)})]})]})}function Oe({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:o}=i(`openhands`),s=l(),{status:c,isChecking:u}=ce(e,{enabled:t}),{fields:d,values:f,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,consumesFileCredentials:_,save:v,isSaving:y}=ue(e),b=X(),x=L(e)??e,S=c===`authenticated`,C=ke(s.backend.kind,c),w=S||d.some(e=>e.secret&&(!e.multiline||_)&&h(e.name)),T=C&&!w,E=y||T||u&&!w;return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:o(a.ONBOARDING$ACP_SECRETS_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):c!==`authenticated`&&(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,q.jsx)(se,{status:c,isChecking:u,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-5`,children:d.map(e=>(0,q.jsx)(le,{field:e,value:f[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,q.jsx)(oe,{conflicts:g}),T?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:y,children:o(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await v()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:B(e)??void 0}),r())},children:o(y?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function ke(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Ae({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:o}=j(),{backend:s}=l(),c=s.kind!==`cloud`,u=r(a.ONBOARDING$HELLO_DEFAULT_MESSAGE),[d,f]=K.useState(u),{mutate:m,isPending:h,isSuccess:g}=U(),_=W(),v=h||g||_,y=K.useRef(!1),b=d.trim().length>0&&!v&&!y.current,x=()=>{!b||y.current||(y.current=!0,m({query:d.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{o(`/conversations/${e.conversation_id}`),n()},onError:()=>{y.current=!1}}))};return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,q.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(a.ONBOARDING$HELLO_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$HELLO_SUBTITLE)})]}),(0,q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,q.jsx)(`div`,{className:`relative w-full`,children:(0,q.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,q.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(a.ONBOARDING$HELLO_TITLE),type:`text`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())},placeholder:u,disabled:v,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,q.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,q.jsx)(p,{buttonClassName:``,handleSubmit:x,disabled:!b})})]}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,q.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(a.LANDING$OR)}),(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,q.jsx)(G,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:v,children:r(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:v,children:r(a.BUTTON$CLOSE)})]})]})}var je=t({OnboardingModal:()=>Ne}),Z=[`backend`,`agent`,`setup`,`hello`],Me=[`agent`,`setup`,`hello`],Q=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,q.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:y(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ne({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:o}=I(),s=o?.user_consents_to_analytics===!0,{trackOnboardingStarted:c,trackOnboardingStepViewed:l,trackOnboardingCompleted:d,trackOnboardingSkipped:f}=ee(),{active:p}=u(),{backend:m}=p,h=T(m),g=E(h?[]:[m]),_=C(),v=_!==null&&m.kind===`cloud`&&x(m.host,_),b=!h&&g[m.id]?.isConnected===!0&&(_===null||v),S=b?Me:Z,[w,A]=K.useState(()=>Z[Math.min(Math.max(t,0),Z.length-1)]),[j,M]=K.useState(`openhands`);K.useEffect(()=>{S.includes(w)||A(S[0])},[w,S]);let N=S.length,P=S.includes(w)?w:S[0],F=S.indexOf(P),L=h||g[m.id]?.isConnected!==void 0,R=j===`openhands`,z=F===0&&C()!==null,B=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[S]),V=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[S]),H=K.useRef(!1);K.useEffect(()=>{n||!s||H.current||window.sessionStorage.getItem(Q)||(H.current=!0,window.sessionStorage.setItem(Q,`1`),c())},[n,s]);let U=K.useRef(null);K.useEffect(()=>{n||!s||!L||U.current!==P&&(U.current=P,l({step:P,stepIndex:F,totalSteps:N,agent:j}))},[n,s,L,P,F,N,j]);let W=()=>{d({agent:j}),e()},G=()=>{f({step:P,stepIndex:F,totalSteps:N,agent:j}),e()};return(0,q.jsx)(D,{"aria-label":r(a.ONBOARDING$TITLE),children:(0,q.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,q.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":F,"data-preview":n?`true`:void 0,className:y(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,O(`lg`),k,`max-h-[90vh]`),children:[(0,q.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,q.jsx)(ye,{currentStep:F,totalSteps:N})}),(0,q.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,q.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":F,className:`relative overflow-clip`,children:[b?null:(0,q.jsx)($,{index:S.indexOf(`backend`),currentStep:F,children:(0,q.jsx)(Te,{onNext:B,onClose:e})}),(0,q.jsx)($,{index:S.indexOf(`agent`),currentStep:F,children:(0,q.jsx)(Ce,{selectedAgentId:j,onSelect:M,onBack:b?void 0:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`setup`),currentStep:F,children:R?(0,q.jsx)(De,{onBack:V,onNext:B}):(0,q.jsx)(Oe,{providerKey:j,isActive:P===`setup`,onBack:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`hello`),currentStep:F,children:(0,q.jsx)(Ae,{onBack:V,onClose:G,onLaunched:W})})]})})]}),F<N-1&&!z?(0,q.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:G,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(a.ONBOARDING$SKIP)}):null]})})}export{je as n,J as r,Ne as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{b as t}from"./active-backend-context-
|
|
1
|
+
import{l as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{b as t}from"./active-backend-context-u2tdYRgH.js";import{n}from"./agent-server-client-options-DVLRd9sw.js";var r=class{static async getModels(){let t=new e(n()),[r,i,a]=await Promise.all([t.getModels(),t.getVerifiedModels(),t.getProviders()]),o=Object.keys(i??{}).sort(),s=o.flatMap(e=>i[e]??[]);return{models:r??[],verified_models:s,verified_providers:a?.filter(e=>o.includes(e))??o,default_model:s[0]??r?.[0]??``}}static async getConfig(){return await t(),{posthog_client_key:`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}};export{r as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{a as n,o as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{u as i}from"./suspense-X5dBsJzn.js";import{n as a}from"./useQuery-CpjHYtZc.js";import{f as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{t as s}from"./createLucideIcon-CVAsW2Yo.js";import{c,n as l}from"./agent-server-client-options-DVLRd9sw.js";import{r as u,t as d}from"./agent-server-conversation-service.api-
|
|
1
|
+
import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{a as n,o as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{u as i}from"./suspense-X5dBsJzn.js";import{n as a}from"./useQuery-CpjHYtZc.js";import{f as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{t as s}from"./createLucideIcon-CVAsW2Yo.js";import{c,n as l}from"./agent-server-client-options-DVLRd9sw.js";import{r as u,t as d}from"./agent-server-conversation-service.api-BP73yONA.js";var f=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:i}=e,a=super.createResult(e,t),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:n(t,i.data),hasPreviousPage:r(t,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function p(e,t){return a(e,f,t)}var m=s(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),h=async e=>{let t=(await d.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},g=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await h(e);if(c().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await u(r),{success:!0}}return new o(l({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},_=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await h(e);return new o(l({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},v=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await h(e);await new o(l({conversationUrl:n,sessionApiKey:r})).startGoal(e,t)},y=async e=>{let{conversationUrl:t,sessionApiKey:n}=await h(e);await new o(l({conversationUrl:t,sessionApiKey:n})).stopGoal(e)},b=async e=>{let{conversationUrl:t,sessionApiKey:n}=await h(e);await new o(l({conversationUrl:t,sessionApiKey:n})).resumeGoal(e)},x=async e=>{let{conversationUrl:t,sessionApiKey:n}=await h(e);return new o(l({conversationUrl:t,sessionApiKey:n})).runConversation(e)},S=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},C=(e,t,n)=>S(e,t,{execution_status:n}),w=(e,t,n)=>S(e,t,{llm_model:n}),T=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})};e();var E=t(),D=e=>(0,E.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,E.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`})}),O=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},k=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{T as a,x as c,y as d,C as f,p as h,_ as i,b as l,m,O as n,S as o,w as p,D as r,g as s,k as t,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useTranslation-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{t as a}from"./list-todo-BfH6yYUK.js";import{t as o}from"./brand-button-DKPMEKcW.js";import{t as s}from"./conversation-store-LptbOvKa.js";import{t as c}from"./use-handle-plan-click-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useTranslation-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{t as a}from"./list-todo-BfH6yYUK.js";import{t as o}from"./brand-button-DKPMEKcW.js";import{t as s}from"./conversation-store-LptbOvKa.js";import{t as c}from"./use-handle-plan-click-Dug8egQl.js";import{t as l}from"./markdown-renderer-D8mayGjI.js";import{n as u,r as d}from"./plan-components-j9X4AxYM.js";import{t as f}from"./conversation-tab-empty-state-m8IUkfMj.js";var p=e(t(),1),m=n();function h(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=s();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(a,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(o,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r,t as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{n as a}from"./declaration-B9kpCaYl.js";import{B as o,S as s,U as c,V as l,d as u,o as d,t as f,w as p,x as m,z as h}from"./active-backend-context-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r,t as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{n as a}from"./declaration-B9kpCaYl.js";import{B as o,S as s,U as c,V as l,d as u,o as d,t as f,w as p,x as m,z as h}from"./active-backend-context-u2tdYRgH.js";import{t as g}from"./utils-CE0lDWtb.js";import{t as _}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~nn5zty47-Zl0G1QCy.js";import{t as v}from"./option-service.api-Cl5VLGyw.js";import{n as y,t as b}from"./agent-server-ui-style-scope-COnDHTm5.js";var x=e(t());function S({i18n:e,defaultNS:t,children:n}){let r=(0,x.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,x.createElement)(a.Provider,{value:r},n)}var C=n(),w=`posthog_bootstrap`;function T(){let e=window.location.hash.substring(1),t=new URLSearchParams(e),n=t.get(`distinct_id`),r=t.get(`session_id`);if(n&&r){let e={distinctID:n,sessionID:r};return sessionStorage.setItem(w,JSON.stringify(e)),window.history.replaceState(null,``,window.location.pathname+window.location.search),e}let i=sessionStorage.getItem(w);if(i)return sessionStorage.removeItem(w),JSON.parse(i)}function E({children:e}){let t=r(),[n,i]=x.useState(null),[a,o]=x.useState(!0),s=x.useMemo(()=>T(),[]);return x.useEffect(()=>{(async()=>{try{i((await t.fetchQuery({queryKey:u.WEB_CLIENT_CONFIG,queryFn:v.getConfig,meta:{disableToast:!0},...d})).posthog_client_key)}catch{}finally{o(!1)}})()},[t]),a||!n?e:(0,C.jsx)(_,{apiKey:n,options:{api_host:`https://us.i.posthog.com`,person_profiles:`identified_only`,bootstrap:s},children:e})}function D({children:e,theme:t=y,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=x.useMemo(()=>({...b,...i,...r}),[r,i]);return(0,C.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,C.jsx)(`div`,{className:g(t,a,`text-foreground`),"data-theme":t,children:e})})}var O={provider:`posthog`};function k({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:u,style:d,styleOverrides:g,theme:_,withStyleRoot:v=!0}){let y=x.useMemo(()=>t??m(),[t]),b=x.useMemo(()=>r??o(),[r]),w=x.useRef(null);w.current||={queryClient:s(),i18n:l()},p(y),c(b),x.useEffect(()=>()=>{w.current&&(p(w.current.queryClient),c(w.current.i18n))},[]);let T=n&&n.provider===`posthog`?(0,C.jsx)(E,{children:e}):e;return(0,C.jsx)(S,{i18n:b,defaultNS:h,children:(0,C.jsx)(i,{client:y,children:(0,C.jsx)(f,{children:v?(0,C.jsx)(D,{className:a,contentClassName:u,style:d,styleOverrides:g,theme:_,children:T}):T})})})}export{O as n,D as r,k as t};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useMutationState-BUab8Kxr.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{t as a}from"./declaration-B9kpCaYl.js";import{n as o}from"./active-backend-context-u2tdYRgH.js";import{P as s,t as c}from"./utils-CE0lDWtb.js";import{t as l}from"./modal-backdrop-zVwfOJZr.js";import{n as u}from"./modal-classes-DPqxSyuP.js";import{t as d}from"./brand-button-DKPMEKcW.js";import{n as f}from"./navigation-context-DPs2G0X8.js";import{a as p,o as ee}from"./conversation-local-storage-F6zVMM--.js";import{t as m}from"./conversation-store-LptbOvKa.js";import{t as h}from"./modal-close-button-CTCX4nCH.js";import{i as g}from"./settings-service.api-DldkFI1x.js";import{r as _}from"./use-settings-dX4fKUPF.js";import{t as v}from"./use-tracking-GtXCHmTv.js";import{t as y}from"./use-create-conversation-D9OWYcte.js";import{i as b,n as x,r as S,t as C}from"./extension-module-card-classes-9V3J9J_b.js";import{c as w,d as T,f as E,h as D,o as O,t as k}from"./install-server-modal-BRab9inF.js";import{t as A}from"./vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js";import{n as j}from"./skill-card-pill-row-D2bUe2kB.js";import{t as M}from"./circle-plus-check-toggle-T3eAIuPQ.js";var N=e(t(),1),P=()=>{let e=f(),t=r({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},F=`${s.PRODUCTION}/settings/integrations`,I=[`github`,`slack`];function L(e){let t=e.requiredIntegrationIds;return t.length>0&&t.every(e=>I.includes(e))}function R(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:a.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:a.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:a.RESPONDER_DEPLOYMENT$LOCAL_ACTION,primaryActionTestId:`responder-deployment-continue-local`,action:{kind:`launch-local`}};case`openhands-cloud`:return{target:e,testId:`responder-deployment-option-openhands-cloud`,titleKey:a.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:a.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:a.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:F}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var z=[`local`,`openhands-cloud`],B=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch for a configurable label on GitHub pull requests, inspect full PR and repository context, and post an AI review comment once per label event.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: cron polling for open GitHub PRs with a configured label such as openhands-review
|
|
2
|
+
Required secret: GITHUB_PERSONAL_ACCESS_TOKEN
|
|
3
|
+
|
|
4
|
+
1. Read repository, trigger label, review tone, and polling schedule from setup.
|
|
5
|
+
2. List open PRs and find the latest matching GitHub labeled issue event for each labeled PR.
|
|
6
|
+
3. Deduplicate on the label event ID so every label application queues exactly one review.
|
|
7
|
+
4. Start an OpenHands conversation that clones the repo, checks out the exact PR head SHA, and inspects PR discussion, review comments, changed files, diff, and surrounding code.
|
|
8
|
+
5. Post an acknowledgement with the conversation link, then post the final AI review comment only if the PR is still open and the head SHA has not changed.`},{id:`github-repo-monitor`,name:`GitHub repository monitor`,category:`Developer tools`,description:`Watch a repository for @OpenHands mentions in issues and PR comments, start a conversation, and post the agent's reply back to GitHub.`,requiredIntegrationIds:[`github`],popularityRank:98,estimatedSetupMinutes:5,prompt:`/github-monitor:poll`,exampleImplementation:`Trigger: cron, every minute (configurable)
|
|
9
|
+
Required secret: GITHUB_PERSONAL_ACCESS_TOKEN
|
|
10
|
+
|
|
11
|
+
1. Poll GitHub for new issue and PR comments since the last run.
|
|
12
|
+
2. Match comments containing the trigger phrase (case-insensitive, default: @OpenHands).
|
|
13
|
+
3. Post an acknowledgment comment with a link to the new OpenHands conversation.
|
|
14
|
+
4. Forward follow-up replies in the same thread to the running conversation.
|
|
15
|
+
5. Post the agent's final response back to GitHub when the conversation completes.`},{id:`slack-standup-digest`,name:`Slack standup digest`,category:`Team updates`,description:`Summarize yesterday’s Slack activity into an async standup note with blockers, decisions, and owners.`,requiredIntegrationIds:[`slack`],popularityRank:94,estimatedSetupMinutes:5,prompt:`/standup-digest:setup`,exampleImplementation:`Trigger: cron, weekday mornings
|
|
16
|
+
Required MCP: Slack
|
|
17
|
+
|
|
18
|
+
1. Search configured channels for messages since the last digest window.
|
|
19
|
+
2. Cluster updates into shipped work, active work, blockers, and decisions.
|
|
20
|
+
3. TODO: choose a safe allowlist for channels and whether DMs are excluded.
|
|
21
|
+
4. Draft a Slack message with owners, links, and unanswered questions.
|
|
22
|
+
5. Optionally post to the configured standup channel.`},{id:`slack-channel-monitor`,name:`Slack channel monitor`,category:`Team communication`,description:`Watch Slack channels for @openhands mentions, open a conversation with the message context, reply when the agent finishes, and continue the same conversation from triggered Slack thread follow-ups.`,requiredIntegrationIds:[`slack`],popularityRank:92,estimatedSetupMinutes:7,prompt:`/slack-monitor:poll`,exampleImplementation:`Trigger: cron, every minute
|
|
23
|
+
Required secret: SLACK_BOT_TOKEN or SLACK_USER_TOKEN
|
|
24
|
+
|
|
25
|
+
1. Poll up to 10 configured Slack channels for new messages since the last run.
|
|
26
|
+
2. Match messages containing the trigger phrase (default: @openhands).
|
|
27
|
+
3. React with 👀 and start an OpenHands conversation with the message and recent channel context.
|
|
28
|
+
4. Post a thread reply with a link to the conversation, then post the agent response when done.
|
|
29
|
+
5. Keep the thread in a short follow-up watch window and forward only replies that repeat the trigger phrase to the same conversation, with per-thread backoff for quiet threads.`},{id:`linear-triage-assistant`,name:`Linear issue triage assistant`,category:`Project management`,description:`Classify new Linear issues, suggest labels, find duplicates, and ask clarifying questions.`,requiredIntegrationIds:[`linear`],popularityRank:90,estimatedSetupMinutes:3,prompt:`/linear-triage:setup`,exampleImplementation:`Trigger: linear Issue create
|
|
30
|
+
Required MCP: Linear
|
|
31
|
+
|
|
32
|
+
1. Load the new issue, team context, project, labels, and recent similar issues.
|
|
33
|
+
2. Score priority and classify the request as bug, feature, support, or chore.
|
|
34
|
+
3. TODO: map local team labels and priority conventions.
|
|
35
|
+
4. Add a triage comment with rationale and suggested next actions.
|
|
36
|
+
5. Optionally update labels, priority, and assignee.`},{id:`research-brief-writer`,name:`Research brief writer`,category:`Research`,description:`Monitor a topic, gather sources from the web, and publish a short brief for your team.`,requiredIntegrationIds:[`tavily`,`notion`],popularityRank:84,estimatedSetupMinutes:7,prompt:`/research-brief:setup`,exampleImplementation:`Trigger: cron, weekly or daily
|
|
37
|
+
Required MCPs: Tavily, Notion
|
|
38
|
+
|
|
39
|
+
1. Run focused Tavily searches for configured topics and competitors.
|
|
40
|
+
2. Deduplicate sources and rank them by freshness and authority.
|
|
41
|
+
3. TODO: confirm citation format and destination Notion database schema.
|
|
42
|
+
4. Write an executive summary, implications, and recommended actions.
|
|
43
|
+
5. Create or update a Notion page with citations and source links.`},{id:`incident-retrospective-drafter`,name:`Incident retrospective drafter`,category:`Reliability`,description:`Collect incident chatter and issue updates, then draft a timeline and follow-up checklist.`,requiredIntegrationIds:[`slack`,`linear`,`notion`],popularityRank:78,estimatedSetupMinutes:8,prompt:`/incident-retro:setup`,exampleImplementation:`Trigger: manual, cron, or incident label added
|
|
44
|
+
Required MCPs: Slack, Linear, Notion
|
|
45
|
+
|
|
46
|
+
1. Gather incident messages, timestamps, and linked issue references.
|
|
47
|
+
2. Pull Linear follow-up tickets, owners, and status.
|
|
48
|
+
3. TODO: define the incident identifier format and approved Notion template.
|
|
49
|
+
4. Build a timeline, impact summary, root-cause hypotheses, and action items.
|
|
50
|
+
5. Publish a draft retrospective and notify the incident owner.`},{id:`jira-issue-to-pr`,name:`Jira issue to GitHub PR`,category:`Project management`,description:`Watch a Jira Cloud project for issues with a configurable label and automatically open a GitHub pull request for each new issue found. The target GitHub repo is read from the ticket body - no repo parameter required at deploy time.`,requiredIntegrationIds:[`jira`,`github`],popularityRank:85,estimatedSetupMinutes:5,prompt:`Set up a Jira automation to create pull requests`,exampleImplementation:`Trigger: cron polling (e.g. every 5 minutes)
|
|
51
|
+
Required secrets: Jira API token, GitHub personal access token (repo + workflow scope)
|
|
52
|
+
|
|
53
|
+
1. Collect Jira base URL, email, API token secret name, label to watch, and cron schedule from the user. No GitHub repo is needed at deploy time - each ticket must include the target repo (owner/repo) in its body.
|
|
54
|
+
2. Poll POST /rest/api/3/search/jql on the Jira Cloud instance to find open issues carrying the configured label.
|
|
55
|
+
3. Deduplicate against a KV-store-backed set of already-processed issue keys so re-runs never create duplicate PRs.
|
|
56
|
+
4. For each new issue, start an independent OpenHands agent conversation that extracts the GitHub repo from the ticket body, clones it, creates a branch named after the Jira key, implements or scaffolds the requested change, and opens a pull request.
|
|
57
|
+
5. Immediately after the conversation is created, post a Jira comment on the issue: 'I'm on it: <conversation URL>'.
|
|
58
|
+
6. Persist the processed issue key immediately after dispatching so the next poll skips it.`}],V=n(),H=`inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`;function U(e){return e.slice(0,4)}function W({entries:e,className:t,testId:n}){let r=U(e);if(r.length===0)return(0,V.jsx)(O,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,V.jsx)(O,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,V.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:c(H,`items-center justify-center`,t),children:(0,V.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,V.jsx)(O,{entry:e,size:`sm`,className:`ring-2 ring-surface-raised`},e.id))})});let i=[r[0]??null,r[1]??null,r[2]??null,r[3]??null];return(0,V.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:c(H,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,V.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,V.jsx)(O,{entry:e,size:`xs`})},e.id):(0,V.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function G({count:e}){return(0,V.jsx)(`span`,{className:`ml-2 inline-flex items-center justify-center rounded-full bg-surface-raised px-2 py-0.5 text-xs text-foreground`,children:e})}function K(e){return e.map((e,t)=>({automation:e,index:t})).sort((e,t)=>(t.automation.popularityRank??0)-(e.automation.popularityRank??0)||e.index-t.index).map(({automation:e})=>e)}var q=K(B),J=[`github-pr-reviewer`,`github-repo-monitor`,`slack-channel-monitor`];function Y(e){return J.includes(e.id)}function X(e){let t=E(A);return e.requiredIntegrationIds.map(e=>T(e,t)).filter(e=>!!e)}function Z(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,e.prompt,...t.map(e=>e.name),...t.flatMap(e=>e.keywords??[])].join(` `).toLowerCase().includes(r):!0}function Q(e){return X(e).length>0}function te(e,t,n,r){let i=e.map(e=>{let n=!!w(e,t);return{id:`mcp-${e.id}`,node:(0,V.jsxs)(`span`,{className:c(b,`gap-1`),children:[(0,V.jsx)(O,{entry:e,size:`xs`}),e.name,n?(0,V.jsx)(`span`,{className:`text-white`,children:r(a.RECOMMENDED_AUTOMATIONS$CONNECTED)}):null]})}});return n>0&&i.push({id:`missing-connect`,node:(0,V.jsx)(`span`,{className:b,children:r(a.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:n})})}),i}function $({automations:e,installedServers:t,onSelect:n,translate:r}){return(0,V.jsx)(`div`,{className:c(`mt-3`,C),children:e.map(e=>{let i=X(e),a=i.filter(e=>!w(e,t)).length;return(0,V.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>n(e),className:c(`flex min-w-0 overflow-hidden p-4 text-left rounded-xl bg-surface-raised`,S),children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,V.jsx)(W,{entries:i,testId:`recommended-automation-icon-${e.id}`}),(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,V.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,V.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,V.jsx)(M,{testId:`recommended-automation-plus-${e.id}`})]}),(0,V.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,V.jsx)(j,{pills:te(i,t,a,r),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})}function ne({backendKind:e,installedServers:t,query:n=``,onSelect:r,scrollableGrid:o=!1}){let{t:s}=i(`openhands`),l=q.filter(e=>{let t=X(e);return Q(e)&&Z(e,t,n)});if(l.length===0)return null;let u=l.filter(Y),d=l.filter(e=>!Y(e));return(0,V.jsx)(`section`,{"data-testid":`recommended-automations-section`,className:c(o&&`flex min-h-0 flex-1 flex-col`),children:(0,V.jsxs)(`div`,{"data-testid":o?`recommended-automations-scroll-area`:void 0,className:c(`mt-3`,x,o&&`min-h-0 flex-1 overflow-y-auto custom-scrollbar-always`),children:[u.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center`,children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:s(a.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,V.jsx)(G,{count:u.length})]}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:s(a.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,V.jsx)($,{automations:u,installedServers:t,onSelect:r,translate:s})]}),d.length>0&&(0,V.jsxs)(`section`,{"data-testid":`recommended-automations-beta-section`,className:c(u.length>0&&`mt-8`),children:[(0,V.jsxs)(`div`,{"data-testid":`recommended-automations-beta-heading`,className:`flex items-center`,children:[(0,V.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:s(a.RECOMMENDED_AUTOMATIONS$BETA_LABEL)}),(0,V.jsx)(G,{count:d.length})]}),(0,V.jsx)($,{automations:d,installedServers:t,onSelect:r,translate:s})]})]})})}function re({isOpen:e,onClose:t,onContinueLocal:n,onOpenUrl:r}){let{t:o}=i(`openhands`);return e?(0,V.jsx)(l,{onClose:t,"aria-label":o(a.RESPONDER_DEPLOYMENT$TITLE),children:(0,V.jsxs)(`div`,{"data-testid":`responder-deployment-modal`,className:`relative flex w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,V.jsx)(h,{onClose:t,testId:`responder-deployment-modal-close`}),(0,V.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,V.jsx)(`h2`,{className:c(`pr-6`,u),children:o(a.RESPONDER_DEPLOYMENT$TITLE)}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:o(a.RESPONDER_DEPLOYMENT$DESCRIPTION)})]}),(0,V.jsx)(`div`,{className:`flex flex-col gap-3 px-6 pb-6 sm:flex-row`,children:z.map(e=>{let t=R(e),{action:i}=t;return(0,V.jsxs)(`div`,{"data-testid":t.testId,className:`flex flex-1 flex-col gap-3 rounded-xl border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:o(t.titleKey)}),(0,V.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:o(t.descriptionKey)})]}),(0,V.jsx)(d,{type:`button`,variant:`primary`,className:`mt-auto`,testId:t.primaryActionTestId,onClick:()=>{i.kind===`launch-local`?n():r(i.url)},children:o(t.primaryActionKey)})]},t.target)})})]})}):null}function ie(e){let t=E(A);return e.requiredIntegrationIds.map(e=>T(e,t)).filter(e=>!!e)}function ae(e){return e}function oe({query:e,onLaunched:t,scrollableGrid:n=!1}){let r=o(),{navigate:i}=f(),{data:a}=_(),{trackPrebuiltAutomationEnabled:s}=v(),c=y(),l=P(),u=m(e=>e.setMessageToSend),[d,h]=(0,N.useState)(null),[b,x]=(0,N.useState)(null),[S,C]=(0,N.useState)([]),T=(0,N.useRef)(!1),E=(0,N.useRef)(!1),O=(0,N.useMemo)(()=>D(g(a?.agent_settings?.mcp_config)),[a?.agent_settings?.mcp_config]),A=(0,N.useCallback)(e=>{if(E.current||c.isPending||l)return;E.current=!0;let n=ae(e.prompt);c.mutate({},{onSuccess:r=>{s({automationName:e.name,automationCategory:e.category}),r.conversation_id.startsWith(`task-`)&&r.task_id?ee(r.task_id,n):p(r.conversation_id,{draftMessage:n}),i?.(`/conversations/${r.conversation_id}`),t?.(),window.setTimeout(()=>u(n),0)},onError:()=>{E.current=!1}})},[r.backend.kind,c,l,i,t,u,s]),j=(0,N.useCallback)(e=>ie(e).filter(e=>!w(e,O)),[O]),M=e=>{let t=j(e);if(t.length===0){A(e);return}h(e),C(t)},F=e=>{if(!(E.current||c.isPending||l||S.length>0||b!==null)){if(L(e)){x(e);return}M(e)}},I=()=>{let e=b;x(null),e&&M(e)},R=e=>{x(null),window.open(e,`_blank`,`noopener,noreferrer`)},z=()=>{x(null)},B=()=>{if(T.current){T.current=!1;return}h(null),C([])},H=()=>{T.current=!0,C(e=>{let t=e.slice(1);if(t.length===0){let e=d;window.setTimeout(()=>{h(null),e&&A(e)},0)}return t})},U=S[0]??null;return r.backend.kind===`cloud`?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ne,{backendKind:r.backend.kind,installedServers:O,query:e,onSelect:F,scrollableGrid:n}),U&&(0,V.jsx)(k,{entry:U,onClose:B,onSuccess:H},U.id),(0,V.jsx)(re,{isOpen:b!==null,onClose:z,onContinueLocal:I,onOpenUrl:R})]})}export{G as n,P as r,oe as t};
|