@openhands/agent-canvas 1.0.0-alpha.5 → 1.0.0-alpha.7
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 +41 -7
- package/bin/agent-canvas.mjs +9 -2
- package/build/assets/automation-detail-D7GEU0vR.js +1 -0
- package/build/assets/automations-list-CkVNsgzm.js +1 -0
- package/build/assets/conversation-COZAKz_K.js +1 -0
- package/build/assets/{conversation-D8scXOe7.js → conversation-DWcvnmds.js} +3 -1
- package/build/assets/conversation-panel-CZDStT0b.js +1 -0
- package/build/assets/conversation-websocket-context-DulnrIHh.js +3 -0
- package/build/assets/edit-automation-modal-C3bFxS2f.js +1 -0
- package/build/assets/git-control-bar-branch-button-Bm6rzSpo.js +27 -0
- package/build/assets/{home-D9fJfhQA.js → home-DR11ejqB.js} +1 -1
- package/build/assets/{manifest-f141dc70.js → manifest-f041e61a.js} +1 -1
- package/build/assets/{messages-BfaEAG2q.js → messages-v-q35ObG.js} +1 -1
- package/build/assets/{root-luPHQiBx.js → root-D2PVd51i.js} +1 -1
- package/build/assets/root-layout-B4QioBS6.js +2 -0
- package/build/assets/{shared-conversation-BfZNCsvo.js → shared-conversation-DQlzwdpo.js} +1 -1
- package/build/index.html +3 -3
- package/config/defaults.json +38 -0
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +95 -95
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +118 -118
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/slash-command-menu.cjs +1 -1
- package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
- package/dist/components/features/chat/components/slash-command-menu.js +1 -1
- package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.d.ts +1 -2
- package/dist/components/features/sidebar/sidebar-rail-body.js +104 -104
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +82 -83
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +36 -36
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/query/use-local-git-info.cjs +3 -1
- package/dist/hooks/query/use-local-git-info.cjs.map +1 -1
- package/dist/hooks/query/use-local-git-info.d.ts +2 -2
- package/dist/hooks/query/use-local-git-info.js +27 -24
- package/dist/hooks/query/use-local-git-info.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +2 -1
- package/dist/package.js.map +1 -1
- package/dist/stores/error-message-store.cjs +1 -1
- package/dist/stores/error-message-store.cjs.map +1 -1
- package/dist/stores/error-message-store.d.ts +10 -1
- package/dist/stores/error-message-store.js +16 -3
- package/dist/stores/error-message-store.js.map +1 -1
- package/package.json +2 -1
- package/scripts/dev-static.mjs +8 -1
- package/scripts/dev-with-automation.mjs +30 -49
- package/scripts/static-build.mjs +2 -6
- package/scripts/static-server.mjs +85 -4
- package/build/assets/automation-detail-ZQs6D2d3.js +0 -1
- package/build/assets/automations-list-CqHXGwSw.js +0 -1
- package/build/assets/conversation-CeGMBOyB.js +0 -1
- package/build/assets/conversation-panel-DMz46ji-.js +0 -1
- package/build/assets/conversation-websocket-context-B0Gd3yiT.js +0 -3
- package/build/assets/edit-automation-modal-DgW0Q8vr.js +0 -1
- package/build/assets/git-control-bar-branch-button-DhpPgadK.js +0 -27
- package/build/assets/root-layout-DvYGxAnr.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{u as n}from"./path-utils-D1ZtqFC7.js";import{t as r}from"./useMutation-CRJwk4cR.js";import{o as i,t as a}from"./declaration-C9nuq2Dj.js";import{t as o}from"./Trans-D43bd3yR.js";import{t as s}from"./useTranslation-01pF7z10.js";import{a as c}from"./i18n-DkYgs32x.js";import{t as l}from"./createLucideIcon-Ddu8jDOQ.js";import{t as u}from"./chevron-down-Bnmd5iG-.js";import{d,l as f,m as p,n as m,u as h}from"./conversation-websocket-context-B0Gd3yiT.js";import{T as g,_,t as v}from"./utils-Czcl6buL.js";import{t as y}from"./use-config-Bcz2JL2t.js";import{t as ee}from"./styled-tooltip-Awq4HMw3.js";import{t as te}from"./react-Do0CT17Y.js";import{s as ne}from"./conversation-local-storage-UYl-SX-r.js";import{t as b}from"./conversation-store-Z5iMCRpc.js";import{n as x}from"./common-SMkEaBSr.js";import{n as re}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DrXgiSCq.js";import{t as ie}from"./skills-BN8atjgW.js";import{t as ae}from"./close-SnIy2eLD.js";import{n as S,t as oe}from"./use-conversation-id-BOaaZahn.js";import{t as se}from"./use-active-conversation-Bu5J9iLy.js";import{t as C}from"./use-agent-state-DN9Nc5pP.js";import{C as w,a as ce,g as le,i as T,r as E,t as ue,v as D,y as O}from"./use-event-store-CQZCcVz-.js";import{r as k}from"./typography-BbaUAC4V.js";import{t as de}from"./lesson-plan-CmkRbe6Z.js";import{n as fe,t as A}from"./markdown-renderer-wZnLDbA1.js";import{t as pe}from"./u-check-circle-DHGiAi-w.js";import{n as me,r as he,t as ge}from"./plan-components-gOm-daR3.js";import{n as _e,t as ve}from"./u-check-circle-half-BPcWtWwv.js";var ye=l(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),j=e(t(),1),M=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}(M||{});function N(){let{conversationId:e}=S(),t=m();return{send:(0,j.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 P(e,t,n,r){return{action:M.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var F=i(),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 be({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(re,{"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[s,c]=j.useState(r),l=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,F.jsx)(L,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:v(`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`&&l,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(be,{status:n})]})]}),s&&(typeof t==`string`?(0,F.jsx)(A,{children:t}):t)]})}var xe=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 Se({profile:e}){let[t,r]=j.useState(!1);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(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)(u,{size:14}):(0,F.jsx)(n,{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 Ce({conversationId:e,anchorEventId:t}){let n=h(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)(xe,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(o,{i18nKey:a.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)(o,{i18nKey:a.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(o,{i18nKey:a.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)(o,{i18nKey:a.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(Se,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var we=(0,j.createContext)(void 0);function Te({children:e,value:t}){let n=he(j.useRef(null)),r=t||n;return(0,F.jsx)(we.Provider,{value:r,children:e})}function Ee(){let e=(0,j.useContext)(we);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}var De=()=>{let{setConversationMode:e}=b(),{send:t}=N(),{conversationId:n}=S(),r=d(e=>e.enqueuePendingMessage),i=d(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,j.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(P(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}};function Oe(){let{conversationId:e}=oe(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=b(),{setSelectedTab:a}=ne(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 z=300,ke=ge(`shine-text`);function Ae({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=Oe(),{handleBuildPlanClick:o}=De(),{scrollDomToBottom:c}=Ee(),l=()=>{i(`planner`)},u=(0,j.useCallback)(e=>{o(e),c()},[o,c]),d=(0,j.useMemo)(()=>e?e.length<=z?e:`${e.slice(0,z)}...`:``,[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)(de,{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(a.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsxs)(`button`,{type:`button`,onClick:l,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(a.COMMON$VIEW)}),(0,F.jsx)(ye,{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:d&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(A,{includeStandard:!0,components:t?ke:me,children:d}),e&&e.length>z&&(0,F.jsx)(`button`,{type:`button`,onClick:l,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(a.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:u,disabled:n,className:v(`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(a.COMMON$BUILD),` `,(0,F.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function je({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=j.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&&c.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)(A,{children:t})]})}function Me({event:e}){return ce(e)?(0,F.jsx)(je,{errorId:e.id,defaultMessage:e.error}):null}function B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:o,onRetry:c}){let{t:l}=s(`openhands`),[u,d]=j.useState(!1),[f,p]=j.useState(!1);return j.useEffect(()=>{let e;return f&&(e=setTimeout(()=>{p(!1)},2e3)),()=>{clearTimeout(e)}},[f]),(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:v(`rounded-xl relative w-fit max-w-full last:mb-4`,`flex flex-col gap-2`,e===`user`&&`p-4 bg-tertiary self-end`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,o===`sending`&&`opacity-60`,o===`error`&&`border border-status-fail-border`),children:[(0,F.jsxs)(`div`,{className:v(`absolute -top-2.5 -right-2.5`,u?`flex`:`hidden`,`items-center gap-1`),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(ee,{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)(fe,{isHidden:!u,isDisabled:f,onClick:async()=>{await navigator.clipboard.writeText(t),p(!0)},mode:f?`copied`:`copy`})]}),(0,F.jsx)(`div`,{className:`text-sm whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(A,{includeStandard:!0,includeHeadings:!0,children:t})}),o===`sending`&&(0,F.jsx)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`self-end text-xs italic text-content-muted`,children:l(a.CHAT_INTERFACE$MESSAGE_SENDING)}),o===`error`&&(0,F.jsxs)(`span`,{role:`alert`,"data-testid":`chat-message-error`,className:`self-end text-xs text-status-fail-text`,children:[l(a.CHAT_INTERFACE$MESSAGE_SEND_FAILED),` `,c&&(0,F.jsx)(`button`,{type:`button`,onClick:c,className:`underline cursor-pointer`,"data-testid":`chat-message-retry`,children:l(a.CHAT_INTERFACE$MESSAGE_RETRY)})]}),n]})}function Ne({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 Pe({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 Fe({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:v(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(ae,{width:18,height:18})})}function Ie({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:v(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Le({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)(Ie,{src:e,size:n}),t&&(0,F.jsx)(Fe,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function Re({size:e=`small`,images:t,onRemove:n}){let r=j.useRef(null),[i,a]=j.useState(!1),[o,s]=j.useState(!0),[c,l]=j.useState(!1);return j.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)(Ne,{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:v(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Le,{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)(Pe,{active:!c})})]})}function ze({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?a.ACTION$CONFIRM:a.ACTION$REJECT),o=n(r?a.CHAT_INTERFACE$USER_CONFIRMED:a.CHAT_INTERFACE$USER_REJECTED),c=r?`${n(a.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(a.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(ee,{closeDelay:100,content:o,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:v(`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:c})})}function Be({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:v(`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 Ve=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`})]}),He=te(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Ue=()=>r({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return f.respondToConfirmation(e,t,i,n)}});function We(){let e=He(e=>e.submittedEventIds),t=He(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=se(),{curAgentState:i}=C(),{mutate:o}=Ue(),c=ue(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===_.AWAITING_USER_CONFIRMATION:!1),l=(0,j.useCallback)(e=>{!c||!r||(t(c.id),o({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[c,r,t,o]);return(0,j.useEffect)(()=>{if(!c)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),l(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),l(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[c,l]),i!==_.AWAITING_USER_CONFIRMATION||!c||e.includes(c.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(T(c)?c.security_risk:x.UNKNOWN)===x.HIGH&&(0,F.jsx)(Be,{content:n(a.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Ve,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(a.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(a.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(ze,{type:`reject`,onClick:()=>l(!1)}),(0,F.jsx)(ze,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var Ge=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{t}from"./react-CM_dJw1Z.js";import{u as n}from"./path-utils-D1ZtqFC7.js";import{t as r}from"./useMutation-CRJwk4cR.js";import{o as i,t as a}from"./declaration-C9nuq2Dj.js";import{t as o}from"./Trans-D43bd3yR.js";import{t as s}from"./useTranslation-01pF7z10.js";import{a as c}from"./i18n-DkYgs32x.js";import{t as l}from"./createLucideIcon-Ddu8jDOQ.js";import{t as u}from"./chevron-down-Bnmd5iG-.js";import{d,l as f,m as p,n as m,u as h}from"./conversation-websocket-context-DulnrIHh.js";import{T as g,_,t as v}from"./utils-Czcl6buL.js";import{t as y}from"./use-config-Bcz2JL2t.js";import{t as ee}from"./styled-tooltip-Awq4HMw3.js";import{t as te}from"./react-Do0CT17Y.js";import{s as ne}from"./conversation-local-storage-UYl-SX-r.js";import{t as b}from"./conversation-store-Z5iMCRpc.js";import{n as x}from"./common-SMkEaBSr.js";import{n as re}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DrXgiSCq.js";import{t as ie}from"./skills-BN8atjgW.js";import{t as ae}from"./close-SnIy2eLD.js";import{n as S,t as oe}from"./use-conversation-id-BOaaZahn.js";import{t as se}from"./use-active-conversation-Bu5J9iLy.js";import{t as C}from"./use-agent-state-DN9Nc5pP.js";import{C as w,a as ce,g as le,i as T,r as E,t as ue,v as D,y as O}from"./use-event-store-CQZCcVz-.js";import{r as k}from"./typography-BbaUAC4V.js";import{t as de}from"./lesson-plan-CmkRbe6Z.js";import{n as fe,t as A}from"./markdown-renderer-wZnLDbA1.js";import{t as pe}from"./u-check-circle-DHGiAi-w.js";import{n as me,r as he,t as ge}from"./plan-components-gOm-daR3.js";import{n as _e,t as ve}from"./u-check-circle-half-BPcWtWwv.js";var ye=l(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),j=e(t(),1),M=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}(M||{});function N(){let{conversationId:e}=S(),t=m();return{send:(0,j.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 P(e,t,n,r){return{action:M.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var F=i(),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 be({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(re,{"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[s,c]=j.useState(r),l=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,F.jsx)(L,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:v(`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`&&l,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(be,{status:n})]})]}),s&&(typeof t==`string`?(0,F.jsx)(A,{children:t}):t)]})}var xe=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 Se({profile:e}){let[t,r]=j.useState(!1);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(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)(u,{size:14}):(0,F.jsx)(n,{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 Ce({conversationId:e,anchorEventId:t}){let n=h(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)(xe,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(o,{i18nKey:a.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)(o,{i18nKey:a.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(o,{i18nKey:a.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)(o,{i18nKey:a.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(Se,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var we=(0,j.createContext)(void 0);function Te({children:e,value:t}){let n=he(j.useRef(null)),r=t||n;return(0,F.jsx)(we.Provider,{value:r,children:e})}function Ee(){let e=(0,j.useContext)(we);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}var De=()=>{let{setConversationMode:e}=b(),{send:t}=N(),{conversationId:n}=S(),r=d(e=>e.enqueuePendingMessage),i=d(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,j.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(P(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}};function Oe(){let{conversationId:e}=oe(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=b(),{setSelectedTab:a}=ne(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 z=300,ke=ge(`shine-text`);function Ae({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=Oe(),{handleBuildPlanClick:o}=De(),{scrollDomToBottom:c}=Ee(),l=()=>{i(`planner`)},u=(0,j.useCallback)(e=>{o(e),c()},[o,c]),d=(0,j.useMemo)(()=>e?e.length<=z?e:`${e.slice(0,z)}...`:``,[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)(de,{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(a.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsxs)(`button`,{type:`button`,onClick:l,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(a.COMMON$VIEW)}),(0,F.jsx)(ye,{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:d&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(A,{includeStandard:!0,components:t?ke:me,children:d}),e&&e.length>z&&(0,F.jsx)(`button`,{type:`button`,onClick:l,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(a.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:u,disabled:n,className:v(`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(a.COMMON$BUILD),` `,(0,F.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function je({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=j.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&&c.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)(A,{children:t})]})}function Me({event:e}){return ce(e)?(0,F.jsx)(je,{errorId:e.id,defaultMessage:e.error}):null}function B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:o,onRetry:c}){let{t:l}=s(`openhands`),[u,d]=j.useState(!1),[f,p]=j.useState(!1);return j.useEffect(()=>{let e;return f&&(e=setTimeout(()=>{p(!1)},2e3)),()=>{clearTimeout(e)}},[f]),(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:v(`rounded-xl relative w-fit max-w-full last:mb-4`,`flex flex-col gap-2`,e===`user`&&`p-4 bg-tertiary self-end`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,o===`sending`&&`opacity-60`,o===`error`&&`border border-status-fail-border`),children:[(0,F.jsxs)(`div`,{className:v(`absolute -top-2.5 -right-2.5`,u?`flex`:`hidden`,`items-center gap-1`),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(ee,{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)(fe,{isHidden:!u,isDisabled:f,onClick:async()=>{await navigator.clipboard.writeText(t),p(!0)},mode:f?`copied`:`copy`})]}),(0,F.jsx)(`div`,{className:`text-sm whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(A,{includeStandard:!0,includeHeadings:!0,children:t})}),o===`sending`&&(0,F.jsx)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`self-end text-xs italic text-content-muted`,children:l(a.CHAT_INTERFACE$MESSAGE_SENDING)}),o===`error`&&(0,F.jsxs)(`span`,{role:`alert`,"data-testid":`chat-message-error`,className:`self-end text-xs text-status-fail-text`,children:[l(a.CHAT_INTERFACE$MESSAGE_SEND_FAILED),` `,c&&(0,F.jsx)(`button`,{type:`button`,onClick:c,className:`underline cursor-pointer`,"data-testid":`chat-message-retry`,children:l(a.CHAT_INTERFACE$MESSAGE_RETRY)})]}),n]})}function Ne({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 Pe({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 Fe({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:v(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(ae,{width:18,height:18})})}function Ie({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:v(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Le({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)(Ie,{src:e,size:n}),t&&(0,F.jsx)(Fe,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function Re({size:e=`small`,images:t,onRemove:n}){let r=j.useRef(null),[i,a]=j.useState(!1),[o,s]=j.useState(!0),[c,l]=j.useState(!1);return j.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)(Ne,{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:v(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Le,{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)(Pe,{active:!c})})]})}function ze({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?a.ACTION$CONFIRM:a.ACTION$REJECT),o=n(r?a.CHAT_INTERFACE$USER_CONFIRMED:a.CHAT_INTERFACE$USER_REJECTED),c=r?`${n(a.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(a.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(ee,{closeDelay:100,content:o,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:v(`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:c})})}function Be({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:v(`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 Ve=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`})]}),He=te(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Ue=()=>r({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return f.respondToConfirmation(e,t,i,n)}});function We(){let e=He(e=>e.submittedEventIds),t=He(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=se(),{curAgentState:i}=C(),{mutate:o}=Ue(),c=ue(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===_.AWAITING_USER_CONFIRMATION:!1),l=(0,j.useCallback)(e=>{!c||!r||(t(c.id),o({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[c,r,t,o]);return(0,j.useEffect)(()=>{if(!c)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),l(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),l(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[c,l]),i!==_.AWAITING_USER_CONFIRMATION||!c||e.includes(c.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(T(c)?c.security_risk:x.UNKNOWN)===x.HIGH&&(0,F.jsx)(Be,{content:n(a.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Ve,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(a.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(a.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(ze,{type:`reject`,onClick:()=>l(!1)}),(0,F.jsx)(ze,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var Ge=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=c.t(`CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE`);return n.split(r)[0]};function V({event:e,isLastMessage:t,isFromPlanningAgent:n}){let r=Ge(e),i=[];return Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&i.push(...e.image_urls)}),(0,F.jsxs)(B,{type:e.source,message:r,isFromPlanningAgent:n,children:[i.length>0&&(0,F.jsx)(Re,{size:`small`,images:i}),t&&(0,F.jsx)(We,{})]})}var H=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)}},Ke=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function qe(e){let{children:t}=e,n=e=>{try{return Ke(e)}catch(t){return H.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 Je=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},Ye=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,Xe=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return Ye(e)&&!n.endsWith(`/`)?`${n}/`:n};function Ze(e){let{children:t}=e,n=e=>{try{let t=Je(e);return(0,F.jsx)(`span`,{className:`font-mono`,title:t,children:Xe(t)})}catch(t){return H.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=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var U=1e3,Qe=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,$e=e=>{switch(e){case x.LOW:return c.t(`SECURITY$LOW_RISK`);case x.MEDIUM:return c.t(`SECURITY$MEDIUM_RISK`);case x.HIGH:return c.t(`SECURITY$HIGH_RISK`);case x.UNKNOWN:default:return c.t(`SECURITY$UNKNOWN_RISK`)}},W=()=>``,et=e=>e.name?`**Skill:** \`${e.name}\``:W(),tt=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()},nt=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}`},rt=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===x.HIGH||e.security_risk===x.MEDIUM)&&(t+=`\n\n${$e(e.security_risk)}`),t},it=e=>{let t=`**MCP Tool Call**
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js","assets/rolldown-runtime-BFRubm34.js","assets/manage-backends-modal-DqpzcxdI.js","assets/agent-server-client-options-8OJSXbm8.js","assets/server-client-CG1zHqph.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~b4cctr4k-B7YVdv1X.js","assets/QueryClientProvider-DITRCGAK.js","assets/declaration-C9nuq2Dj.js","assets/react-CM_dJw1Z.js","assets/pencil-Dr0b2jL1.js","assets/createLucideIcon-Ddu8jDOQ.js","assets/plus-DT-M0FA1.js","assets/trash-2-CbVljPko.js","assets/useTranslation-01pF7z10.js","assets/context-CEQZwATj.js","assets/backend-form-modal-KudhWUX8.js","assets/organization-service.api-Ct2dZF8M.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~pfbaerbd-zhv9fooy.js","assets/proxy-BMZyC45G.js","assets/health-store-BDC2rM-X.js","assets/brand-button-8fVVei4i.js","assets/utils-Czcl6buL.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i9dbt75i-CI82Did1.js","assets/settings-input-BWCZt9g2.js","assets/modal-backdrop-B04pVYAD.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-CgUoFQA1.js","assets/modal-close-button-SM_WXzDY.js","assets/active-backend-context-CkP3ZEJs.js","assets/confirmation-modal-B-DOYMUH.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as l,t as u}from"./declaration-C9nuq2Dj.js";import{t as d}from"./useTranslation-01pF7z10.js";import{r as f}from"./providers-C2T07PM3.js";import{i as p,t as m}from"./custom-toast-handlers-BYxhSr3t.js";import{n as h}from"./agent-server-compatibility-DvKtnXHw.js";import{t as g}from"./modal-backdrop-B04pVYAD.js";import{n as _}from"./modal-body-CgUoFQA1.js";import{n as v,r as y}from"./base-modal-B4HvlFHE.js";import{t as b}from"./brand-button-8fVVei4i.js";import{t as x}from"./loading-spinner-91b5FiMQ.js";import{t as S}from"./use-config-Bcz2JL2t.js";import{i as ee,n as C}from"./color-themes-DSaoIL6A.js";var w=e(t(),1),T={name:`@openhands/agent-canvas`,version:`1.0.0-alpha.5`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/agent-canvas`},homepage:`https://github.com/OpenHands/agent-canvas#readme`,bugs:{url:`https://github.com/OpenHands/agent-canvas/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.20`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`git+https://github.com/OpenHands/extensions.git#b8c1869ec9dea4467bb27d5754dc695d14e27889`,"@openhands/typescript-client":`1.23.3`,"@react-router/node":`7.14.2`,"@react-router/serve":`7.14.2`,"@tailwindcss/vite":`4.2.4`,"@tanstack/react-query":`5.100.9`,"@types/shell-quote":`^1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.16.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,i18next:`26.0.8`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.0`,isbot:`5.1.39`,"lucide-react":`1.14.0`,"monaco-editor":`0.55.1`,"posthog-js":`1.372.6`,react:`19.2.5`,"react-dom":`19.2.5`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.6`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.14.2`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`^1.8.3`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.5.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.10`,zustand:`5.0.12`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:snapshots":`playwright test tests/e2e/snapshots --project=chromium --retries=0`,"test:e2e:snapshots:update":`playwright test tests/e2e/snapshots --project=chromium --update-snapshots`,"test:coverage":`npm run make-i18n && vitest run --coverage`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true VITE_APP_ENV=production vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`bash -c 'npm run typecheck:staged'`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.1`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.59.1`,"@react-router/dev":`7.14.2`,"@tailwindcss/typography":`0.5.19`,"@tanstack/eslint-plugin-query":`5.100.9`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`6.9.1`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`25.6.0`,"@types/react":`19.2.14`,"@types/react-dom":`19.2.3`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.59.2`,"@typescript-eslint/parser":`8.59.2`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.5`,"cross-env":`10.1.0`,eslint:`9.39.4`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.4`,"eslint-plugin-i18next":`6.1.4`,"eslint-plugin-import-x":`4.16.2`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.5`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`29.1.1`,"lint-staged":`16.4.0`,msw:`2.14.2`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.2.4`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.5`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{dompurify:`3.3.2`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`scripts`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.14.2`}},E=`openhands-telemetry-consent`,D=`openhands-telemetry-first-use`,O=`openhands-telemetry-session`,k=`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,A=`https://z.openhands.dev`,j=`https://us.posthog.com`,M=!1,N=null;function P(){return typeof window<`u`&&typeof localStorage<`u`}async function F(){if(!P())return null;if(N)return N;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1]));return N=e,e}catch{return null}}function I(){return typeof process<`u`&&{}?.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`)}async function L(e=!1){if(M)return N;let t=await F();return t?(t.init(k,{api_host:A,ui_host:j,opt_out_capturing_by_default:!e,capture_pageview:!1,autocapture:!1,persistence:`localStorage`,disable_session_recording:!0,loaded:e=>{e.register({package_name:T.name,package_version:T.version})}}),M=!0,t):null}function R(){if(!P())return`pending`;if(I())return`denied`;try{let e=localStorage.getItem(E);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}async function z(e){if(P())try{localStorage.setItem(E,e);let t=await L();if(!t)return;e===`granted`?t.opt_in_capturing():t.opt_out_capturing()}catch{}}function B(){return R()===`granted`}function V(){if(!P())return!1;try{return localStorage.getItem(D)===`true`}catch{return!1}}function H(){if(P())try{localStorage.setItem(D,`true`)}catch{}}async function U(){if(I()||V())return;let e=await L(!0);e&&((e.has_opted_out_capturing?.()??!1)&&e.opt_in_capturing(),e.capture(`canvas_install`,{platform:typeof navigator<`u`?navigator.platform:`unknown`,user_agent:typeof navigator<`u`?navigator.userAgent:`unknown`,referrer:typeof document<`u`?document.referrer:``,url_origin:typeof window<`u`?window.location.origin:``,embedded:typeof window<`u`&&window.self!==window.top}),H(),R()!==`granted`&&e.opt_out_capturing())}function W(){if(!P())return!1;try{return sessionStorage.getItem(O)===`true`}catch{return!1}}function G(){if(P())try{sessionStorage.setItem(O,`true`)}catch{}}async function K(){if(!B()||W())return;let e=await L();e&&(e.capture(`canvas_new_session`,{is_first_use:!V()}),G())}async function q(e,t={}){if(!B())return;let n=await L();n&&n.capture(e,t)}async function J(){if(P())try{localStorage.removeItem(E),localStorage.removeItem(D),sessionStorage.removeItem(O),M&&N&&N.reset()}catch{}}function Y(){let[e,t]=(0,w.useState)(()=>R()),n=(0,w.useRef)(!1);(0,w.useEffect)(()=>{n.current||(n.current=!0,U())},[]),(0,w.useEffect)(()=>{e===`granted`&&K()},[e]);let r=(0,w.useCallback)(async()=>{await z(`granted`),t(`granted`)},[]),i=(0,w.useCallback)(async()=>{await z(`denied`),t(`denied`)},[]),a=(0,w.useCallback)((t,n)=>{e===`granted`&&q(t,n)},[e]),o=(0,w.useCallback)(()=>{J(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var X=l();function Z({onChoice:e}){let{t,ready:n}=d(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=Y(),[o,s]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,X.jsx)(g,{"aria-label":t(u.TELEMETRY$CONSENT_TITLE),children:(0,X.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,X.jsxs)(_,{className:`border border-[var(--oh-border)]`,children:[(0,X.jsx)(y,{title:t(u.TELEMETRY$CONSENT_TITLE)}),(0,X.jsx)(v,{children:t(u.TELEMETRY$CONSENT_DESCRIPTION)}),(0,X.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,X.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(u.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,X.jsx)(b,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(u.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function Q(){return w.useEffect(()=>{C(ee())},[]),null}var $=w.lazy(()=>n(()=>import(`./manage-backends-modal-DqpzcxdI.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])));function te({children:e}){return(0,X.jsxs)(`html`,{lang:`en`,children:[(0,X.jsxs)(`head`,{children:[(0,X.jsx)(`meta`,{charSet:`utf-8`}),(0,X.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,X.jsx)(i,{}),(0,X.jsx)(c,{})]}),(0,X.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,X.jsxs)(f,{contentClassName:`min-h-screen`,children:[(0,X.jsx)(Q,{}),e,(0,X.jsx)(p,{toastOptions:m}),(0,X.jsx)(Z,{}),(0,X.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,X.jsx)(s,{}),(0,X.jsx)(o,{})]})]})}function ne(){return(0,X.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,X.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,X.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,X.jsx)(x,{size:`large`})})})})}function re(){let e=w.useCallback(()=>{},[]);return(0,X.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(w.Suspense,{fallback:null,children:(0,X.jsx)($,{onClose:e})})})}var ie=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],ae=r(function(){let e=S();return e.isPending||e.isLoading?(0,X.jsx)(ne,{}):h(e.error)?(0,X.jsx)(re,{}):(0,X.jsx)(a,{})});export{te as Layout,ae as default,ie as meta};
|
|
2
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as l,t as u}from"./declaration-C9nuq2Dj.js";import{t as d}from"./useTranslation-01pF7z10.js";import{r as f}from"./providers-C2T07PM3.js";import{i as p,t as m}from"./custom-toast-handlers-BYxhSr3t.js";import{n as h}from"./agent-server-compatibility-DvKtnXHw.js";import{t as g}from"./modal-backdrop-B04pVYAD.js";import{n as _}from"./modal-body-CgUoFQA1.js";import{n as v,r as y}from"./base-modal-B4HvlFHE.js";import{t as b}from"./brand-button-8fVVei4i.js";import{t as x}from"./loading-spinner-91b5FiMQ.js";import{t as S}from"./use-config-Bcz2JL2t.js";import{i as ee,n as C}from"./color-themes-DSaoIL6A.js";var w=e(t(),1),T={name:`@openhands/agent-canvas`,version:`1.0.0-alpha.7`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/agent-canvas`},homepage:`https://github.com/OpenHands/agent-canvas#readme`,bugs:{url:`https://github.com/OpenHands/agent-canvas/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.20`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`git+https://github.com/OpenHands/extensions.git#b8c1869ec9dea4467bb27d5754dc695d14e27889`,"@openhands/typescript-client":`1.23.3`,"@react-router/node":`7.14.2`,"@react-router/serve":`7.14.2`,"@tailwindcss/vite":`4.2.4`,"@tanstack/react-query":`5.100.9`,"@types/shell-quote":`^1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.16.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,i18next:`26.0.8`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.0`,isbot:`5.1.39`,"lucide-react":`1.14.0`,"monaco-editor":`0.55.1`,"posthog-js":`1.372.6`,react:`19.2.5`,"react-dom":`19.2.5`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.6`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.14.2`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`^1.8.3`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.5.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.10`,zustand:`5.0.12`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:snapshots":`playwright test tests/e2e/snapshots --project=chromium --retries=0`,"test:e2e:snapshots:update":`playwright test tests/e2e/snapshots --project=chromium --update-snapshots`,"test:coverage":`npm run make-i18n && vitest run --coverage`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true VITE_APP_ENV=production vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`bash -c 'npm run typecheck:staged'`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.1`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.59.1`,"@react-router/dev":`7.14.2`,"@tailwindcss/typography":`0.5.19`,"@tanstack/eslint-plugin-query":`5.100.9`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`6.9.1`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`25.6.0`,"@types/react":`19.2.14`,"@types/react-dom":`19.2.3`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.59.2`,"@typescript-eslint/parser":`8.59.2`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.5`,"cross-env":`10.1.0`,eslint:`9.39.4`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.4`,"eslint-plugin-i18next":`6.1.4`,"eslint-plugin-import-x":`4.16.2`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.5`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`29.1.1`,"lint-staged":`16.4.0`,msw:`2.14.2`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.2.4`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.5`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{dompurify:`3.3.2`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.14.2`}},E=`openhands-telemetry-consent`,D=`openhands-telemetry-first-use`,O=`openhands-telemetry-session`,k=`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,A=`https://z.openhands.dev`,j=`https://us.posthog.com`,M=!1,N=null;function P(){return typeof window<`u`&&typeof localStorage<`u`}async function F(){if(!P())return null;if(N)return N;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1]));return N=e,e}catch{return null}}function I(){return typeof process<`u`&&{}?.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`)}async function L(e=!1){if(M)return N;let t=await F();return t?(t.init(k,{api_host:A,ui_host:j,opt_out_capturing_by_default:!e,capture_pageview:!1,autocapture:!1,persistence:`localStorage`,disable_session_recording:!0,loaded:e=>{e.register({package_name:T.name,package_version:T.version})}}),M=!0,t):null}function R(){if(!P())return`pending`;if(I())return`denied`;try{let e=localStorage.getItem(E);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}async function z(e){if(P())try{localStorage.setItem(E,e);let t=await L();if(!t)return;e===`granted`?t.opt_in_capturing():t.opt_out_capturing()}catch{}}function B(){return R()===`granted`}function V(){if(!P())return!1;try{return localStorage.getItem(D)===`true`}catch{return!1}}function H(){if(P())try{localStorage.setItem(D,`true`)}catch{}}async function U(){if(I()||V())return;let e=await L(!0);e&&((e.has_opted_out_capturing?.()??!1)&&e.opt_in_capturing(),e.capture(`canvas_install`,{platform:typeof navigator<`u`?navigator.platform:`unknown`,user_agent:typeof navigator<`u`?navigator.userAgent:`unknown`,referrer:typeof document<`u`?document.referrer:``,url_origin:typeof window<`u`?window.location.origin:``,embedded:typeof window<`u`&&window.self!==window.top}),H(),R()!==`granted`&&e.opt_out_capturing())}function W(){if(!P())return!1;try{return sessionStorage.getItem(O)===`true`}catch{return!1}}function G(){if(P())try{sessionStorage.setItem(O,`true`)}catch{}}async function K(){if(!B()||W())return;let e=await L();e&&(e.capture(`canvas_new_session`,{is_first_use:!V()}),G())}async function q(e,t={}){if(!B())return;let n=await L();n&&n.capture(e,t)}async function J(){if(P())try{localStorage.removeItem(E),localStorage.removeItem(D),sessionStorage.removeItem(O),M&&N&&N.reset()}catch{}}function Y(){let[e,t]=(0,w.useState)(()=>R()),n=(0,w.useRef)(!1);(0,w.useEffect)(()=>{n.current||(n.current=!0,U())},[]),(0,w.useEffect)(()=>{e===`granted`&&K()},[e]);let r=(0,w.useCallback)(async()=>{await z(`granted`),t(`granted`)},[]),i=(0,w.useCallback)(async()=>{await z(`denied`),t(`denied`)},[]),a=(0,w.useCallback)((t,n)=>{e===`granted`&&q(t,n)},[e]),o=(0,w.useCallback)(()=>{J(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var X=l();function Z({onChoice:e}){let{t,ready:n}=d(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=Y(),[o,s]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,X.jsx)(g,{"aria-label":t(u.TELEMETRY$CONSENT_TITLE),children:(0,X.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,X.jsxs)(_,{className:`border border-[var(--oh-border)]`,children:[(0,X.jsx)(y,{title:t(u.TELEMETRY$CONSENT_TITLE)}),(0,X.jsx)(v,{children:t(u.TELEMETRY$CONSENT_DESCRIPTION)}),(0,X.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,X.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(u.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,X.jsx)(b,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(u.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function Q(){return w.useEffect(()=>{C(ee())},[]),null}var $=w.lazy(()=>n(()=>import(`./manage-backends-modal-DqpzcxdI.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])));function te({children:e}){return(0,X.jsxs)(`html`,{lang:`en`,children:[(0,X.jsxs)(`head`,{children:[(0,X.jsx)(`meta`,{charSet:`utf-8`}),(0,X.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,X.jsx)(i,{}),(0,X.jsx)(c,{})]}),(0,X.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,X.jsxs)(f,{contentClassName:`min-h-screen`,children:[(0,X.jsx)(Q,{}),e,(0,X.jsx)(p,{toastOptions:m}),(0,X.jsx)(Z,{}),(0,X.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,X.jsx)(s,{}),(0,X.jsx)(o,{})]})]})}function ne(){return(0,X.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,X.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,X.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,X.jsx)(x,{size:`large`})})})})}function re(){let e=w.useCallback(()=>{},[]);return(0,X.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(w.Suspense,{fallback:null,children:(0,X.jsx)($,{onClose:e})})})}var ie=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],ae=r(function(){let e=S();return e.isPending||e.isLoading?(0,X.jsx)(ne,{}):h(e.error)?(0,X.jsx)(re,{}):(0,X.jsx)(a,{})});export{te as Layout,ae as default,ie as meta};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-Cv2YWSUY.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-7id-Uirf.js","assets/vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-BQPOygpY.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-CuGq_cxH.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-CFpDeb9o.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i9dbt75i-CI82Did1.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-BebWhFNT.js","assets/declaration-C9nuq2Dj.js","assets/react-CM_dJw1Z.js","assets/vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CyYIBiBk.js","assets/react-dom-hVBnwgwZ.js","assets/agent-server-client-options-8OJSXbm8.js","assets/llm-client-BpIfxETv.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~b4cctr4k-B7YVdv1X.js","assets/QueryClientProvider-DITRCGAK.js","assets/useTranslation-01pF7z10.js","assets/context-CEQZwATj.js","assets/brand-button-8fVVei4i.js","assets/utils-Czcl6buL.js","assets/combobox-caret-BMsz5mQX.js","assets/sdk-settings-schema-BY8dOy3a.js","assets/dist-DZHSA2e6.js","assets/sdk-settings-field-metadata-CBPmeqYa.js","assets/map-provider-COBVzZYo.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js","assets/settings-input-BWCZt9g2.js","assets/base-modal-B4HvlFHE.js","assets/modal-body-CgUoFQA1.js","assets/modal-backdrop-B04pVYAD.js","assets/navigation-context-BFjstyH6.js","assets/use-save-settings-5m3w89Ph.js","assets/useMutation-CRJwk4cR.js","assets/mutation-Cz7N4XAo.js","assets/settings-service.api-Z6x0l0GU.js","assets/settings-client-CkXDJwIY.js","assets/proxy-BMZyC45G.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~pfbaerbd-zhv9fooy.js","assets/settings-D5am1n6X.js","assets/query-keys-tAsQcc_9.js","assets/use-settings-DzG0C3vO.js","assets/active-backend-context-CkP3ZEJs.js","assets/health-store-BDC2rM-X.js","assets/settings-utils-BBozxqqi.js","assets/add-backend-modal-CqjNjGqY.js","assets/backend-form-modal-KudhWUX8.js","assets/server-client-CG1zHqph.js","assets/organization-service.api-Ct2dZF8M.js","assets/modal-close-button-SM_WXzDY.js","assets/manage-backends-modal-DqpzcxdI.js","assets/pencil-Dr0b2jL1.js","assets/createLucideIcon-Ddu8jDOQ.js","assets/plus-DT-M0FA1.js","assets/trash-2-CbVljPko.js","assets/confirmation-modal-B-DOYMUH.js","assets/environment-switch-overlay-DQ1n6Iu6.js","assets/environment-switch-store-C4ulFJKp.js","assets/analytics-consent-form-modal-BKgT9i2w.js","assets/handle-capture-consent-BfZATzpI.js","assets/alert-banner-CvTYN73l.js","assets/vendor~conversation-panel~conversation~alert-banner-Df7_G0zR.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BP1SKG0F.js","assets/iconBase-C7N9pPOs.js","assets/close-SnIy2eLD.js","assets/typography-BbaUAC4V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{t as h}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{d as g,t as _,u as v}from"./path-utils-D1ZtqFC7.js";import{o as y,t as b}from"./declaration-C9nuq2Dj.js";import{t as x}from"./use-is-creating-conversation-DhoM7UAB.js";import{t as S}from"./useTranslation-01pF7z10.js";import{a as C}from"./i18n-DkYgs32x.js";import{t as w}from"./createLucideIcon-Ddu8jDOQ.js";import{n as T,r as E,t as D}from"./git-branch-DQS2nMK4.js";import{t as O}from"./check-CYxAHs85.js";import{a as k,c as A,d as j,f as M,i as N,l as P,o as ee,r as F,s as I,t as L,u as R}from"./sidebar-mobile-menu-toggle-DXplko7u.js";import{n as te,r as ne}from"./custom-toast-handlers-BYxhSr3t.js";import{t as re}from"./plus-DT-M0FA1.js";import{t as ie}from"./trash-2-CbVljPko.js";import{t as ae}from"./x-JOBEVLW0.js";import{t as z}from"./utils-Czcl6buL.js";import{n as oe,r as se}from"./active-backend-context-CkP3ZEJs.js";import{n as ce}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js";import{t as le}from"./agent-server-conversation-service.api-BdEre_71.js";import{t as ue}from"./modal-backdrop-B04pVYAD.js";import{n as de}from"./modal-body-CgUoFQA1.js";import{i as fe,r as pe}from"./base-modal-B4HvlFHE.js";import{c as me,d as he,i as ge}from"./brand-button-8fVVei4i.js";import{t as _e}from"./loading-spinner-91b5FiMQ.js";import{t as ve}from"./use-config-Bcz2JL2t.js";import{t as ye}from"./openhands-logo-DkDp75rC.js";import{n as be,t as xe}from"./navigation-context-BFjstyH6.js";import{t as B}from"./navigation-link-DFQ7YcWq.js";import{a as Se,d as Ce,f as we,i as Te,m as V,n as Ee,o as H,p as U,s as De,t as Oe}from"./use-cloud-current-user-id-B_rMUiu8.js";import{n as W,t as ke}from"./sidebar-nav-link-B4h8naZ7.js";import{t as Ae}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-C1p8-pMr.js";import{t as je}from"./vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js";import{t as G}from"./styled-tooltip-Awq4HMw3.js";import{r as Me,t as Ne}from"./combobox-caret-BMsz5mQX.js";import{_ as Pe,a as Fe,c as Ie,d as Le,f as Re,g as ze,h as Be,i as Ve,l as He,m as Ue,n as We,p as Ge,r as Ke,s as qe,t as Je,u as Ye}from"./git-provider-icon-D8RE4unY.js";import{i as Xe,r as Ze}from"./backend-form-modal-KudhWUX8.js";import{s as Qe}from"./environment-switch-store-C4ulFJKp.js";import{t as $e}from"./react-Do0CT17Y.js";import{r as et,t as tt}from"./middleware-BC9EwbB9.js";import{t as nt}from"./conversation-store-Z5iMCRpc.js";import{t as rt}from"./add-backend-modal-CqjNjGqY.js";import{t as it}from"./manage-backends-modal-DqpzcxdI.js";import{t as K}from"./common-SMkEaBSr.js";import{c as at,o as ot,s as st}from"./acp-providers-SCPK1BIU.js";import{t as ct}from"./use-is-authed-BFoh8Ogh.js";import{t as lt}from"./use-click-outside-element-835W9pC6.js";import{i as ut,n as dt}from"./status-DDL-ipIP.js";import{r as ft,t as pt}from"./use-settings-DzG0C3vO.js";import{t as mt}from"./use-create-conversation-BWFA_FId.js";import{t as ht}from"./vscode-url-helper-jesbpos5.js";import{t as gt}from"./conversation-service.api-YTGTw0pz.js";import{r as _t,t as vt}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DrXgiSCq.js";import{n as yt,t as q}from"./context-menu-list-item-DzjPB8aC.js";import{i as J,r as bt,t as xt}from"./ellipsis-button-BoU2-xlG.js";import{t as St}from"./u-edit-BPFJBd34.js";import{t as Ct}from"./skills-BN8atjgW.js";import{a as wt,c as Tt,i as Et,l as Dt,n as Ot,o as kt,r as At,s as jt,t as Mt,u as Nt}from"./manage-workspaces-modal-eG6XgAvw.js";import{o as Pt,s as Ft,t as It}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BP1SKG0F.js";import{t as Lt}from"./search-BCAF9EDS.js";import{t as Rt}from"./sidebar-store-cOeaKmIm.js";import{t as zt}from"./handle-capture-consent-BfZATzpI.js";import{t as Bt}from"./use-save-settings-5m3w89Ph.js";import{t as Vt}from"./use-user-conversation-BCYpbPT1.js";import{t as Ht}from"./conversation-state-store-Bc0slAjL.js";var Ut=w(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),Wt=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Gt=w(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),Kt=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),qt=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Jt=w(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`}]]),Yt=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Xt=w(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Zt=w(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Qt=w(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),$t=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=y(),en=46,tn=30;function nn({className:e,logoClassName:t,logoWidth:n=en,logoHeight:r=tn}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(B,{to:`/conversations`,"aria-label":i(b.BRANDING$OPENHANDS_LOGO),className:z(e),children:(0,X.jsx)(ye,{width:n,height:r,className:z(`shrink-0`,t)})})}function rn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-white/20 border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function an({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(ae,{size:14})})}function on({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:z(Me,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(Ne,{})})}function sn({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,X.jsxs)(`div`,{className:z(`absolute z-50 overflow-hidden text-white`,c?`min-w-full w-max`:`w-full`,s?`bottom-full mb-1`:`mt-1`,`bg-tertiary rounded-[6px] context-menu-box-shadow p-1`,`max-h-60 overflow-auto`,!e&&`hidden`),children:[(0,X.jsxs)(`ul`,{...i({className:`p-0`}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:z(`px-2 py-2 cursor-pointer text-sm rounded`,`text-white focus:outline-none font-normal`,`flex items-center gap-2`,n?.value===e.value?`bg-[var(--oh-interactive-selected)] text-white`:`hover:bg-[var(--oh-interactive-hover)]`)}),children:[e.prefix,(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pe,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function cn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:z(`outline-none bg-transparent text-white not-italic`,i?`w-auto field-sizing-content whitespace-nowrap text-sm`:`flex-1 min-w-0`,r&&`placeholder:italic placeholder:text-tertiary-alt`,!r&&`placeholder:text-tertiary-alt`,ge,`px-0 not-italic text-inherit`)})})}var ln={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function un({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=je({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===je.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes,initialIsOpen:p,onInputValueChange:({inputValue:e})=>{y(e??``),x(e??``)},defaultSelectedItem:o,onSelectedItemChange:({selectedItem:e})=>{s?.(e??null)},onIsOpenChange:({isOpen:e,selectedItem:t})=>{e?(y(``),x(``)):(y(t?.label??``),x(``))}}),M=r||i,N=w?e.find(e=>e.value===w.value)??w:null,P=e=>j({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:z(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current=setTimeout(()=>D(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...P({"aria-label":a??`Filter options`,tabIndex:-1}),style:ln}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:ln,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:z(`bg-tertiary border border-[var(--oh-border-input)] rounded p-2`,`flex items-center gap-2`,g?`w-auto`:`w-full`,me,`group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white`,M&&`cursor-not-allowed opacity-60`,l),children:[N?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:N.prefix}):null,(0,X.jsx)(cn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(rn,{}),n&&w&&(0,X.jsx)(an,{onClear:()=>T(null)}),(0,X.jsx)(on,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(sn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var dn=`::`;function fn(e,t){return t?`${e}${dn}${t}`:e}function pn(e){let[t,n]=e.split(dn);return{backendId:t,orgId:n??null}}function mn(e){return(0,X.jsx)(Ze,{isConnected:e?.isConnected??null})}function hn(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:fn(e.id,null),label:e.name,prefix:mn(i[e.id])});for(let e of s){let o=n[e.id],s=mn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:fn(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:fn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function gn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=se(),p=Ee(),m=Oe(),h=Xe(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),y=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(b.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>hn(u,D,p,m,h),[u,D,p,m,h]),k=fn(d.backend.id,d.orgId),A=O.find(e=>e.value===k),j=!!(_||v),M=l(b.SIDEBAR$SETTINGS),N=nt(e=>e.isRightPanelShown),P=!c||y&&N?`top`:`left`,ee=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f]);let F=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),I=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),L=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),R=(0,X.jsxs)(`div`,{className:`flex flex-col`,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:L,onClick:F,className:`flex w-full items-center gap-2 px-2 py-2 rounded-md text-sm cursor-pointer text-white hover:bg-[var(--oh-interactive-hover)]`,children:[(0,X.jsx)(re,{width:16,height:16,className:`text-white shrink-0`}),l(b.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:L,onClick:I,className:`flex w-full items-center gap-2 px-2 py-2 rounded-md text-sm cursor-pointer text-white hover:bg-[var(--oh-interactive-hover)]`,children:[(0,X.jsx)(Qt,{width:16,height:16,className:`text-white shrink-0`}),l(b.BACKEND$MANAGE)]})]}),te=Y.useCallback(async e=>{if(e===k)return;let{backendId:t,orgId:n}=pn(e),r=u.find(e=>e.id===t);r&&(Qe(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[k,u,y,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(un,{testId:`backend-selector`,defaultValue:A??{value:k,label:d.backend.name,prefix:mn(h[d.backend.id])},footer:R,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&te(e.value)},placeholder:d.backend.name,loading:ee,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${k}-${A?.label??``}`)}),t?null:(0,X.jsx)(G,{content:M,placement:P,offset:10,children:(0,X.jsx)(B,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":j,"aria-label":M,className:z(j?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,he),children:(0,X.jsx)(Qt,{width:16,height:16})})})]}),C?(0,X.jsx)(rt,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(it,{onClose:()=>E(!1)}):null]})}var _n=(e=20)=>{let{data:t}=ct(),n=oe();return g({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await le.searchConversations(e,t),enabled:!!t,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},vn=(e=10)=>h({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function yn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(ue,{onClose:n,children:(0,X.jsxs)(de,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(pe,{title:r(b.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(fe,{text:r(b.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(fe,{text:r(b.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var bn=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),xn=e=>{let t=typeof e==`string`?bn(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Sn({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`conversation-card-title`,onClick:e=>{e.preventDefault(),e.stopPropagation()},onBlur:e=>{n(e.currentTarget?.value?.trim?.()??``)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:t,className:`text-sm leading-6 font-semibold bg-transparent w-full`}):(0,X.jsx)(`p`,{"data-testid":`conversation-card-title`,className:z(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var Cn=e=>{switch(e){case K.FINISHED:return`check`;case K.RUNNING:return`working`;case K.IDLE:case K.WAITING_FOR_CONFIRMATION:return`active`;case K.PAUSED:return`paused`;case K.ERROR:case K.STUCK:return`error`;default:return`unknown`}},wn=(e,t)=>{if(t)return`COMMON$ARCHIVED`;switch(e){case`check`:return`COMMON$FINISHED`;case`working`:case`active`:return`COMMON$WORKING`;case`paused`:return`COMMON$PAUSED`;case`error`:return`COMMON$ERROR`;default:return`COMMON$STOPPED`}};function Tn(e){switch(e){case`check`:return(0,X.jsx)(`svg`,{"data-testid":`conversation-status-check`,viewBox:`0 0 12 12`,className:`w-2.5 h-2.5 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-working`,className:`w-1.5 h-1.5 rounded-full animate-pulse bg-[var(--oh-status-success)]`});case`active`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-active`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-success)]`});case`paused`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function En({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:Cn(e),o=r(wn(a,i)),s=(0,X.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,X.jsx)(vt,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):Tn(a)});return n?(0,X.jsx)(G,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Dn({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(En,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Sn,{title:e,titleMode:t,onSave:n,isConversationArchived:i===`MISSING`||i===`ERROR`})]})}var On=e(m(),1);function kn({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=oe(),m=lt(e,d),h=p.kind===`cloud`?b.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:b.COMMON$STOP_CONVERSATION,g=(0,Y.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,X.jsx)(Y.Fragment,{children:r},t):(0,X.jsxs)(Y.Fragment,{children:[r,(0,X.jsx)(Pe,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(yt,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(St,{width:16,height:16}),text:f(b.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Ue,{width:16,height:16}),text:f(b.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Ct,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(b.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Ge,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(A,{width:16,height:16}),text:f(b.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(A,{width:16,height:16}),text:f(b.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(I,{width:16,height:16}),text:f(b.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(bt,{width:16,height:16}),text:f(b.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function An({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ut(s),d=dt(s),f=(0,Y.useRef)(null),[,p]=(0,Y.useReducer)(e=>e+1,0);(0,Y.useLayoutEffect)(()=>{if(!e)return;p();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,p()})};return window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{t&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]);let m=(()=>{if(!e||!f.current)return;let t=f.current.getBoundingClientRect(),n=Number(window.innerWidth)||0,r=Number(window.innerHeight)||0,i=Number(t.bottom)||0,a=Number(t.right)||0;return{position:`fixed`,top:i+280+8>r?Math.max(8,t.top-280-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),h=typeof document<`u`?document.body:null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(xt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:z(u&&`opacity-60`)}),e&&m&&h?(0,On.createPortal)((0,X.jsx)(kn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var jn={bitbucket:It,bitbucket_data_center:It,github:Pt,gitlab:Ft};function Mn({selectedRepository:e}){let t=e.git_provider?jn[e.git_provider]:null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[t&&(0,X.jsx)(t,{size:14,className:`shrink-0 text-[var(--oh-muted)]`}),e.git_provider===`azure_devops`&&(0,X.jsx)(Re,{className:`h-[14px] w-[14px] shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-repository`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_repository})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(_t,{size:12,className:`shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-branch`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_branch})]})]})}function Nn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?_(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Le,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(b.COMMON$NO_REPOSITORY)})]})}function Pn({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=ut(r),p=null;if(c)if(l===`acp`){let e=ot(u)??d(b.CONVERSATION$ACP_AGENT_GENERIC),t=st(u,s),n=t??e;p={kind:at(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:z(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(Nt,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:z(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Mn,{selectedRepository:e}):(0,X.jsx)(Nn,{workspaceWorkingDir:i})),(0,X.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,X.jsx)(`time`,{children:`${xn(t??n)} ${d(b.CONVERSATION$AGO)}`})})})]})]})}function Fn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(Ye,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(b.COMMON$ERROR)})]})}function In({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let x=ce(),[S,C]=Y.useState(`view`),{mutateAsync:w}=He(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x.capture(`download_via_vscode_button_clicked`),l)try{let e=await gt.getVSCodeUrl(l);if(e.vscode_url){let t=ht(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:z(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Dn,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Fn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:z(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:xn(s??c)})}),j&&(0,X.jsx)(`div`,{className:z(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(An,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(Pn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function Ln({taskStatus:e}){return(0,X.jsx)(`div`,{className:z(`w-2 h-2 rounded-full flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500`;case`ERROR`:return`bg-red-500`;case`WORKING`:case`WAITING_FOR_SANDBOX`:case`PREPARING_REPOSITORY`:case`RUNNING_SETUP_SCRIPT`:case`SETTING_UP_GIT_HOOKS`:case`SETTING_UP_SKILLS`:case`STARTING_CONVERSATION`:return`bg-yellow-500 animate-pulse`;default:return`bg-[var(--oh-interactive-selected)]`}})()),"aria-label":`Task status: ${e}`})}function Rn({taskStatus:e}){return e===`WORKING`?null:(0,X.jsx)(`span`,{className:z(`text-xs font-medium px-2 py-0.5 rounded border flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500/10 text-green-400 border-green-500/20`;case`ERROR`:return`bg-red-500/10 text-red-400 border-red-500/20`;default:return`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`}})()),children:(e=>e.toLowerCase().replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()))(e)})}function zn({title:e,taskStatus:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,X.jsx)(`div`,{className:`flex items-center`,children:(0,X.jsx)(Ln,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Rn,{taskStatus:t})]})}function Bn({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:z(`flex flex-col gap-1 mt-1`),children:[(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,X.jsx)(Mn,{selectedRepository:e}):(0,X.jsx)(Nn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${xn(t)} ${r(b.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function Vn({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(b.CONVERSATION$STARTING_CONVERSATION),i=e.request.selected_repository?{selected_repository:e.request.selected_repository,selected_branch:e.request.selected_branch||null,git_provider:e.request.git_provider||null}:null;return(0,X.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:z(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,X.jsx)(zn,{title:r,taskStatus:e.status})}),(0,X.jsx)(Bn,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function Hn({compact:e=!1}){return e?(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton-compact`,className:`skeleton-stagger flex flex-col items-center gap-1.5 py-1`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton`,className:`skeleton-stagger flex flex-col gap-1.5 py-0.5`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function Un({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Ae,{content:(0,X.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(En,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(Pn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(B,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>z(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(En,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var Wn={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=$e()(et(e=>({...Wn,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:tt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),Gn=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,Kn=`px-2 pb-1 pt-1`,qn=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Jn({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:z(Kn,qn),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:z(`flex items-baseline justify-between gap-2`,Kn),children:[(0,X.jsx)(`span`,{className:z(`min-w-0 truncate text-left`,qn),children:e}),t]})}function Yn(){return(0,X.jsx)(Pe,{inset:`menu`})}function Q({icon:e,label:t,selected:n,onClick:r,testId:i,disabled:a}){return(0,X.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,"aria-checked":n===void 0?void 0:!!n,"data-testid":i,disabled:a,onClick:r,className:z(`group flex w-full items-center gap-2 rounded px-2 py-2 text-left text-sm text-[var(--oh-foreground)]`,`hover:bg-[var(--oh-interactive-hover)] disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,X.jsx)(e,{className:z(`h-3.5 w-3.5 shrink-0 text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)]`,he),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(O,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-[var(--oh-foreground)]`,"aria-hidden":!0}):null]})}function Xn({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),y=v(r===`local`?b.CONVERSATION_PANEL$BY_WORKSPACE:b.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(b.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:z(`inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`,he),children:(0,X.jsx)(Yt,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(b.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,children:[(0,X.jsx)(Jn,{children:v(b.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:T,label:y,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:Wt,label:v(b.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Yn,{}),(0,X.jsx)(Jn,{children:v(b.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:Ut,label:v(b.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:Gt,label:v(b.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Yn,{}),(0,X.jsx)(Jn,{children:v(b.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:Xt,label:v(b.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:$t,label:v(b.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Yn,{}),(0,X.jsx)(Jn,{children:v(b.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:E,label:v(b.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:D,label:v(b.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Yn,{}),(0,X.jsx)(Jn,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(b.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(b.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?Kt:qt,label:Gn(v(u?b.CONVERSATION$HIDE:b.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Yn,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ie,label:Gn(v(b.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var Zn=z(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`);function Qn(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=Y.useState(null),s=Y.useCallback(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(i,window.innerWidth-16),a=n.right-r;a<8&&(a=8),a+r>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-8-r)),o({top:n.bottom+4,left:a,width:r})},[e,i]);return Y.useLayoutEffect(()=>{if(!n||!r){o(null);return}return s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}},[n,r,s]),a}function $n({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=be(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Qn(u,{open:s,enabled:i}),{data:f,error:p}=wt(),m=f?.workspaceParents??[],{mutate:h}=jt(),{mutate:g}=Tt(),{mutate:_}=kt(),{mutate:v}=Dt(),{workspaces:y}=Et(),C=At(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=mt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=z(`flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-left text-sm text-white`,`font-normal transition-colors hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-60`),P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ee=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!C,L=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,R=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&T(!0)},className:N,children:a(b.HOME$ADD_WORKSPACES)}),te=C?(0,X.jsx)(G,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:R})}):R;return(0,X.jsxs)(`div`,{className:z(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:ee,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),F&&(0,X.jsxs)(`div`,{"data-testid":r,className:z(Zn,!i&&z(`absolute top-full mt-0`,n)),style:L,children:[(0,X.jsxs)(`ul`,{className:`flex max-h-[40vh] flex-col overflow-y-auto sm:max-h-[280px]`,children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(b.HOME$NO_WORKSPACE_OPTION)})})}),y.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(Ie,{width:14,height:14,className:`shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:`flex flex-col`,"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(Pe,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),te,(y.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(b.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(Ot,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(Mt,{isOpen:E,workspaces:y,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function er({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,X.jsx)(Ie,{width:14,height:14,className:`shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function tr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=be(),{providers:s}=qe(),{lastSelectedProvider:c,setLastSelectedProvider:l}=We(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Qn(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),y=Ke(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=Fe({provider:h}),{data:k,isLoading:A}=Ve(y,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=y?k??[]:j,{mutate:N,isPending:P}=mt(),ee=x(),F=P||ee;Y.useEffect(()=>{if(!u)return;let e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),Y.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let I=e=>{F||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},L=e=>{g(e),l(e),v(``)},R=z(`flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-left text-sm text-white`,`font-normal transition-colors hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-60`);Y.useEffect(()=>{u&&(y||!E||D||w||M.length===0||M.length>=10||O())},[u,y,E,D,w,M.length,O]);let te=y?A:w,ne=!y&&E&&M.length>0,re=Y.useCallback(()=>{d(e=>!e)},[]),ie=u&&(!i||m!==null),ae=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:z(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:re,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),ie&&(0,X.jsxs)(`div`,{"data-testid":r,className:z(Zn,!i&&z(`absolute top-full mt-0`,n)),style:ae,children:[s.length>1&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 px-1 py-1`,"data-testid":`cloud-provider-tabs`,children:s.map(e=>{let t=e===h;return(0,X.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>L(e),className:z(`flex items-center gap-1 rounded px-2 py-1 text-xs`,`border transition-colors`,t?`border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white`:`border-transparent text-[var(--oh-text-secondary)] hover:text-white`),children:[(0,X.jsx)(Je,{gitProvider:e}),(0,X.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,X.jsx)(`div`,{className:`px-2`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(Lt,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(b.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:z(`w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white`,`outline-none placeholder:text-[var(--oh-muted)]`,`focus:outline-none focus:ring-0`,`disabled:cursor-not-allowed disabled:opacity-60`)})]})}),(0,X.jsx)(Pe,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:`flex max-h-[40vh] flex-col overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,children:[te&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(b.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(b.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!te&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(b.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(er,{repo:e,disabled:F,onSelect:I,itemClass:R},`${e.git_provider}:${e.id}`)),ne&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:R,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?b.HOME$LOADING_MORE_REPOSITORIES:b.CONVERSATION$LOAD_MORE)})})})]})]})]})}var nr=z(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`);function rr({backendKind:e}){let{t}=S(`openhands`),n=t(b.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(Jt,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)($n,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:nr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,X.jsx)(tr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:nr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function ir(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function ar(e,t,n){if(t===`local`)return e===`__none_workspace`?{}:e.startsWith(`ws:`)?{workingDir:e.slice(3)}:{};if(e===`__none_repo`)return{};if(e.startsWith(`repo:`)){let t=e.slice(5),r=n[0];return{repository:{name:t,gitProvider:r?.git_provider??`github`,branch:r?.selected_branch??`main`}}}return{}}function or(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function sr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>or(t[n])-or(e[n]))}function cr(e){let t=e.selected_workspace?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_workspace`,label:``};let n=t.split(`/`).filter(Boolean).pop()??t;return{id:`ws:${t}`,label:n}}function lr(e){let t=e.selected_repository?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_repo`,label:``};let n=t.split(`/`).filter(Boolean),r=n.length?(n[n.length-1]??t).replace(/\.git$/,``):t.replace(/\.git$/,``);return{id:`repo:${t}`,label:r}}function ur(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?cr(n):lr(n),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:a,s=i.get(e);s?s.conversations.push(n):i.set(e,{label:o,conversations:[n]})}let a=[...i.entries()].map(([e,r])=>{let i=sr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:ar(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,or(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var dr=()=>{},fr=3600*1e3,pr=e=>{let t=Date.now()-fr,n=[],r=[];for(let i of e){let e=i.updated_at?Date.parse(i.updated_at):NaN;Number.isFinite(e)&&e<t?r.push(i):n.push(i)}return{recent:n,older:r}};function mr({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=be(),{backend:a}=oe(),o=lt(e??dr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),y=Z(e=>e.showLlmProfiles),C=Z(e=>e.toggleShowLlmProfiles),w=Z(e=>e.organizeMode),E=Z(e=>e.setOrganizeMode),D=Z(e=>e.conversationSort),O=Z(e=>e.setConversationSort),k=Z(e=>e.threadScope),A=Z(e=>e.setThreadScope),[M,N]=Y.useState(!1),[ee,F]=Y.useState(!1),I=lt(()=>{N(!1)}),[L,ie]=Y.useState(()=>new Set),[ae,se]=Y.useState(()=>new Set),ce=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),le=Y.useCallback(e=>{se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{w!==`grouped`&&(ie(new Set),se(new Set))},[w]);let ue=Y.useRef(null),[de,fe]=Y.useState(null),[pe,me]=Y.useState(null),[he,ge]=Y.useState(null),{data:ve,isLoading:ye,isFetched:xe,hasNextPage:Se,isFetchingNextPage:Ce,fetchNextPage:we}=_n(),{data:Te}=vn(),V=Y.useMemo(()=>ve?.pages.flatMap(e=>e.items)??[],[ve]),Ee=Y.useMemo(()=>k===`relevant`?V.filter(e=>dt(e.execution_status)):V,[V,k]),{recent:H,older:U}=Y.useMemo(()=>pr(Ee),[Ee]),De=Y.useMemo(()=>sr(h?[...H,...U]:H,D),[H,U,h,D]),Oe=Y.useMemo(()=>({emptyWorkspace:n(b.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(b.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),W=Y.useMemo(()=>t||w!==`grouped`?null:ur([...H,...h?U:[]],a.kind,D,Oe),[a.kind,t,D,Oe,U,w,H,h]),ke=Y.useMemo(()=>sr(H.filter(e=>dt(e.execution_status)),D),[D,H]),Ae=De.length,je=Y.useMemo(()=>W?W.reduce((e,t)=>e+t.conversations.length,0):0,[W]),G=w===`grouped`&&!t?je===0:Ae===0,{mutate:Me,mutateAsync:Ne}=ze(),{mutate:Pe}=Be(),{mutate:Fe}=P(),Ie=U.length>0&&!h,Le=!!Se&&!Ie&&!t&&!G,{mutate:Re}=mt(),Ve=x(),He=Y.useCallback(e=>{Ve||Re({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[Re,Ve,i]),Ue=Y.useCallback((e,t)=>{c(!0),fe(e),me(t)},[]),We=Y.useCallback(e=>{u(!0),fe(e)},[]),Ge=Y.useCallback((e,t)=>{Fe({conversationId:e,newTitle:t},{onSuccess:()=>{ne(n(b.CONVERSATION$TITLE_UPDATED))}})},[n,Fe]),Ke=()=>{de&&Me({conversationId:de},{onSuccess:()=>{de===r&&i(`/conversations`)}})},qe=()=>{de&&Pe({conversationId:de})},Je=async()=>{let e=V.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Ne({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&te(`${a} conversation${a===1?``:`s`} could not be deleted.`)},Ye=Y.useCallback(n=>t?(0,X.jsx)(Un,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:y,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(B,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(In,{onDelete:()=>Ue(n.id,n.title??``),onStop:()=>We(n.id),onChangeTitle:e=>Ge(n.id,e),title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},lastUpdatedAt:n.updated_at,createdAt:n.created_at,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,conversationId:n.id,contextMenuOpen:he===n.id,onContextMenuToggle:e=>ge(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:y,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,Ge,Ue,We,e,he,_,y]),Xe=ye||!xe,Ze=xe&&!ye&&!t&&G&&!Te?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:z(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,ee?`border-[var(--oh-border)]`:`border-transparent`),children:(0,X.jsxs)(`div`,{"data-testid":`older-conversations-summary`,className:`flex min-w-0 flex-nowrap items-center gap-x-2 py-2 pl-4 pr-2.5 text-[var(--oh-muted)]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(b.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(rr,{backendKind:a.kind}),(0,X.jsx)(Xn,{filterMenuOpen:M,setFilterMenuOpen:N,menuRef:I,backendKind:a.kind,organizeMode:w,setOrganizeMode:E,conversationSort:D,setConversationSort:O,threadScope:k,setThreadScope:A,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:y,toggleShowLlmProfiles:C,totalConversationsCount:V.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:ue,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{F(e.currentTarget.scrollTop>0)},className:z(`flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always`,!t&&`conversation-panel-list-scroll`),children:[Xe&&(0,X.jsx)(Hn,{compact:t}),!t&&Ze&&(0,X.jsx)(`div`,{"data-testid":`conversation-panel-empty-state`,className:`flex min-h-0 flex-1 flex-col items-center justify-center px-4 py-8`,children:(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(b.CONVERSATION$NO_CONVERSATIONS)})}),!t&&Te?.map(t=>(0,X.jsx)(B,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Vn,{task:t})},t.id)),!Xe&&t?ke.map(Ye):null,!Xe&&!t&&w===`grouped`&&W&&W.length>0?(0,X.jsx)(`nav`,{"aria-label":n(b.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:W.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!L.has(e.id),o=ae.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=ir(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:z(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>ce(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(T,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:z(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Ve,"aria-label":n(b.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),He(e.launch)},children:(0,X.jsx)(re,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(Ye),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>le(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?b.CONVERSATION_PANEL$LESS:b.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!Xe&&!t&&w===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:De.map(Ye)}):null,Le&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:Ce?(0,X.jsx)(_e,{size:`small`}):(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:()=>we(),className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(b.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(j,{onConfirm:()=>{Ke(),c(!1),me(null)},onCancel:()=>{c(!1),me(null)},conversationTitle:pe??void 0}),p&&(0,X.jsx)(j,{title:n(b.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(b.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:V.length}),onConfirm:async()=>{await Je(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(R,{onConfirm:()=>{qe(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(yn,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function hr({collapsed:e}){return e?null:(0,X.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,X.jsx)(mr,{})})})}var gr=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,X.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,X.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,X.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,X.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 16.5455C13.615 16.5455 16.5455 13.615 16.5455 10C16.5455 6.38509 13.615 3.45459 10 3.45459C6.38509 3.45459 3.45459 6.38509 3.45459 10C3.45459 13.615 6.38509 16.5455 10 16.5455Z`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M12.5854 9.77916L8.80545 7.59461C8.63363 7.49643 8.41272 7.61916 8.41272 7.81552V12.1846C8.41272 12.381 8.62545 12.5119 8.80545 12.4055L12.5854 10.221C12.7573 10.1228 12.7573 9.86916 12.5854 9.77098V9.77916Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`})]})]}),$=18,_r=34,vr=Math.round(_r*30/46);function yr({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:h,onOpenAddBackend:g,onOpenManageBackends:_}){let{t:y}=S(`openhands`),x=h;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Ce(e),children:[(0,X.jsxs)(`div`,{className:z(e&&t?Te:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:z(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(nn,{logoWidth:_r,logoHeight:vr,logoClassName:`max-w-none`,className:z(De,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:z(Se,c?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(v,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:o,className:z(`hidden md:inline-flex ml-auto`,H,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(M,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":y(b.SIDEBAR$CLOSE_MENU),className:z(`inline-flex ml-auto`,H,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(M,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:U(e),children:[(0,X.jsx)(ke,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(re,{width:$,height:$})}),(0,X.jsx)(ke,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(ke,{to:`/automations`,label:y(b.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(gr,{width:$,height:$})})]}),(0,X.jsx)(hr,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:z(U(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(G,{content:y(b.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(B,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":y(b.SIDEBAR$SETTINGS),className:V({collapsed:!0}),children:[(0,X.jsx)(W,{active:u.startsWith(`/settings`),children:(0,X.jsx)(Qt,{width:$,height:$})}),(0,X.jsx)(`span`,{className:we(!0),children:y(b.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":y(b.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:z(V({collapsed:!0}),`relative`),children:[(0,X.jsx)(W,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(Ze,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(Zt,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:we(!0),children:y(b.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(gn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:g,onOpenManageBackends:_})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:z(`flex flex-col items-stretch max-w-none box-border shrink-0`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:(0,X.jsx)(gn,{sidebarCollapsed:e,openUpward:!0})})]})}var br=Y.lazy(()=>n(()=>import(`./settings-modal-Cv2YWSUY.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46]))),xr=Y.lazy(()=>n(()=>import(`./add-backend-modal-CqjNjGqY.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([47,1,9,48,13,49,50,16,15,17,10,40,39,18,19,45,20,21,7,29,32,12,31,51,44]))),Sr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-DqpzcxdI.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([52,1,13,49,15,16,17,9,10,53,54,55,56,18,19,48,50,40,39,45,20,21,7,29,32,12,31,51,44,57]))),Cr=250;function wr(){let{t:e}=S(`openhands`),{currentPath:t}=be(),{data:n}=ve(),{data:r,error:i,isError:a,isFetching:o}=ft(),{backends:s,active:c}=se(),l=Xe(s)[c.backend.id],u=Rt(e=>e.collapsed),d=Rt(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[y,x]=Y.useState(!1),[C,w]=Y.useState(!1),T=Y.useRef(!1),[,E]=Y.useReducer(e=>e+1,0),{isOpen:D,close:O}=ee(),[k,A]=Y.useState(!1),[j,M]=Y.useState(!1),N=lt(()=>h(!1)),P=pt(i);Y.useEffect(()=>{O()},[t,O]),Y.useEffect(()=>{if(D){A(!0);let e=requestAnimationFrame(()=>{M(!0)});return()=>cancelAnimationFrame(e)}M(!1);let e=window.setTimeout(()=>{A(!1)},Cr);return()=>window.clearTimeout(e)},[D]),Y.useEffect(()=>{if(!D)return;let e=e=>{e.key===`Escape`&&O()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D,O]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&P!==404?te(`Something went wrong while fetching settings. Please reload the page.`):P===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,P,n?.feature_flags?.hide_llm_settings]);let F=r?.email_verified===!1,I=e(u?b.SIDEBAR$EXPAND:b.SIDEBAR$COLLAPSE),L=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),R={linkDisabled:F,collapseToggleLabel:I,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,E(),d(!0),window.setTimeout(()=>{T.current=!1,E()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:N,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:L,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:z(`max-md:hidden flex bg-base flex-col min-h-0 transition-[width,min-width] duration-200`,`md:border-r md:border-[var(--oh-border)] md:h-full`,u?`md:w-[60px] md:min-w-[60px] md:px-2.5`:`md:w-[300px] md:min-w-[300px] pb-2 md:pl-2.5 md:pr-0`,t===`/`&&`md:pb-3`),children:(0,X.jsx)(yr,{collapsed:u,showCollapseToggle:!0,...R})}),k?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:z(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,j?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${Cr}ms`},onClick:O,"aria-hidden":!j}),(0,X.jsx)(`aside`,{"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!j,className:z(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,j?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${Cr}ms`},children:(0,X.jsx)(yr,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:O,...R})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(br,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(xr,{onClose:()=>v(!1)})}),y&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Sr,{onClose:()=>x(!1)})})]})}var Tr=`/settings`,Er=`/customize`,Dr=[`/skills`,`/mcp`,`/plugins`];function Or(e){return e===Tr?{mode:`menu`}:e.startsWith(`${Tr}/`)&&e.length>9?{mode:`back`,backTo:Tr,backLabelKey:b.SETTINGS$TITLE}:e===Er?{mode:`menu`}:Dr.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Er,backLabelKey:b.NAV$EXTENSIONS}:{mode:`menu`}}function kr(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=be(),r=Or(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(L,{}),r.mode===`back`&&r.backTo?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??b.COMMON$BACK),className:F,children:(0,X.jsx)(M,{size:20,className:N,"aria-hidden":!0,strokeWidth:2})}):null]})}var Ar=()=>{let e=ce(),{mutate:t}=Bt();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{zt(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}},jr=()=>{let e=ce(),{data:t}=ft(),n=Y.useRef(!1);Y.useEffect(()=>{if(!e||t===void 0||n.current)return;let r=t.user_consents_to_analytics;if(r!==null){let t=e.has_opted_in_capturing(),i=e.has_opted_out_capturing();(r===!0&&!t||r===!1&&!i)&&zt(e,r),n.current=!0}},[e,t])};function Mr(e){switch(e){case K.RUNNING:return`🟢`;case K.FINISHED:case K.IDLE:case K.WAITING_FOR_CONFIRMATION:return`✅`;case K.PAUSED:return`⚪`;case K.ERROR:case K.STUCK:return`🔴`;default:return null}}var Nr=`OpenHands`,Pr=()=>{let{conversationId:e}=l(),{data:t}=Vt(e??null),n=Ht(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Nr}`:Nr;if(!e)return i;let a=Mr(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Fr({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(xe,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Ir=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-DQ1n6Iu6.js`),__vite__mapDeps([58,1,12,10,9,18,19,59]))),Lr=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-BKgT9i2w.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([60,27,1,28,10,9,18,19,20,21,7,30,31,32,12,34,35,16,36,17,37,13,38,39,40,41,42,43,15,44,45,61]))),Rr=Y.lazy(()=>n(()=>import(`./alert-banner-CvTYN73l.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([62,1,63,10,9,18,19,64,65,21,7,33,66,67,24]))),zr=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(b.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(b.ERROR$UNKNOWN)})})}),Br=o(function(){let e=p(),t=Pr(),{data:n}=ft(),{migrateUserConsent:r}=Ar(),i=ve(),[a,o]=Y.useState(!1);if(jr(),Y.useEffect(()=>{n?.language&&C.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(_e,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname);return(0,X.jsx)(Fr,{children:(0,X.jsxs)(k,{children:[(0,X.jsxs)(`div`,{"data-testid":`root-layout`,className:`h-screen lg:min-w-5xl flex flex-col md:flex-row bg-base overflow-hidden p-0`,children:[(0,X.jsx)(`title`,{children:t}),(0,X.jsx)(wr,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(kr,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Rr,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Lr,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Ir,{})})]})})});export{zr as ErrorBoundary,Br as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,P as r,r as i}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as a}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{d as o}from"./path-utils-D1ZtqFC7.js";import{o as s,t as c}from"./declaration-C9nuq2Dj.js";import{t as l}from"./useTranslation-01pF7z10.js";import{t as u}from"./messages-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,P as r,r as i}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as a}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{d as o}from"./path-utils-D1ZtqFC7.js";import{o as s,t as c}from"./declaration-C9nuq2Dj.js";import{t as l}from"./useTranslation-01pF7z10.js";import{t as u}from"./messages-v-q35ObG.js";import{o as d}from"./conversation-websocket-context-DulnrIHh.js";import{t as f}from"./agent-server-client-options-8OJSXbm8.js";import{o as p}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js";import{t as m}from"./loading-spinner-91b5FiMQ.js";import{t as h}from"./openhands-logo-DkDp75rC.js";import{n as g}from"./use-event-store-CQZCcVz-.js";var _=e(t(),1),v=e=>a({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new p(f()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>o({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new p(f()).searchSharedEvents({conversationId:e,limit:100,pageId:t})},initialPageParam:void 0,getNextPageParam:e=>e.next_page_id??void 0,enabled:!!e,retry:!1}),b=({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:n,threshold:r=100})=>{let i=(0,_.useRef)(null),a=(0,_.useCallback)(()=>{if(!i.current||t||!e)return;let{scrollTop:a,scrollHeight:o,clientHeight:s}=i.current;a+s>=o-r&&n()},[e,t,n,r]);return(0,_.useEffect)(()=>{let e=i.current;if(e)return e.addEventListener(`scroll`,a),()=>{e.removeEventListener(`scroll`,a)}},[a]),i},x=s(),S=n(function(){let{t:e}=l(`openhands`),{conversationId:t}=r(),{data:n,isLoading:a,error:o}=v(t),{data:s,isLoading:f,error:p,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=a||f,E=o||p,D=_.useMemo(()=>s?.pages?s.pages.flatMap(e=>e.items):[],[s?.pages]),O=_.useMemo(()=>D.reduce((e,t)=>g(t,e),[]).filter(d),[D]),k=b({hasNextPage:!!S,isFetchingNextPage:w,fetchNextPage:C});return T?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(m,{size:`large`})}):E||!n?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(`div`,{className:`text-white`,children:e(c.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(i,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(c.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(h,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(c.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(c.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(c.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(c.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(u,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(c.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(m,{size:`small`})})]})})]})});export{S as default};
|
package/build/index.html
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>OpenHands</title><meta name="description" content="Let's Start Building!"/><link rel="modulepreload" href="/assets/manifest-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>OpenHands</title><meta name="description" content="Let's Start Building!"/><link rel="modulepreload" href="/assets/manifest-f041e61a.js"/><link rel="modulepreload" href="/assets/entry.client-DU7-q4ZU.js"/><link rel="modulepreload" href="/assets/rolldown-runtime-BFRubm34.js"/><link rel="modulepreload" href="/assets/preload-helper-CT1Z6Pdu.js"/><link rel="modulepreload" href="/assets/vendor~entry.client-CySJvEhK.js"/><link rel="modulepreload" href="/assets/providers-C2T07PM3.js"/><link rel="modulepreload" href="/assets/declaration-C9nuq2Dj.js"/><link rel="modulepreload" href="/assets/vendor~entry.client-Du9GpFmX.js"/><link rel="modulepreload" href="/assets/react-CM_dJw1Z.js"/><link rel="modulepreload" href="/assets/i18n-DkYgs32x.js"/><link rel="modulepreload" href="/assets/react-dom-hVBnwgwZ.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js"/><link rel="modulepreload" href="/assets/query-client-config-CiK0GJJO.js"/><link rel="modulepreload" href="/assets/QueryClientProvider-DITRCGAK.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js"/><link rel="modulepreload" href="/assets/context-CEQZwATj.js"/><link rel="modulepreload" href="/assets/option-service.api-DN0ZcGjw.js"/><link rel="modulepreload" href="/assets/utils-Czcl6buL.js"/><link rel="modulepreload" href="/assets/active-backend-context-CkP3ZEJs.js"/><link rel="modulepreload" href="/assets/query-keys-tAsQcc_9.js"/><link rel="modulepreload" href="/assets/agent-server-ui-style-scope-BwIZYdC1.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~b4cctr4k-B7YVdv1X.js"/><link rel="modulepreload" href="/assets/mutation-Cz7N4XAo.js"/><link rel="modulepreload" href="/assets/custom-toast-handlers-BYxhSr3t.js"/><link rel="modulepreload" href="/assets/health-store-BDC2rM-X.js"/><link rel="modulepreload" href="/assets/retrieve-axios-error-message-BY-yIkIq.js"/><link rel="modulepreload" href="/assets/createLucideIcon-Ddu8jDOQ.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i9dbt75i-CI82Did1.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js"/><link rel="modulepreload" href="/assets/agent-server-client-options-8OJSXbm8.js"/><link rel="modulepreload" href="/assets/llm-client-BpIfxETv.js"/><link rel="modulepreload" href="/assets/agent-server-compatibility-DvKtnXHw.js"/><link rel="modulepreload" href="/assets/server-client-CG1zHqph.js"/><link rel="modulepreload" href="/assets/root-D2PVd51i.js"/><link rel="modulepreload" href="/assets/useTranslation-01pF7z10.js"/><link rel="modulepreload" href="/assets/brand-button-8fVVei4i.js"/><link rel="modulepreload" href="/assets/base-modal-B4HvlFHE.js"/><link rel="modulepreload" href="/assets/loading-spinner-91b5FiMQ.js"/><link rel="modulepreload" href="/assets/modal-backdrop-B04pVYAD.js"/><link rel="modulepreload" href="/assets/modal-body-CgUoFQA1.js"/><link rel="modulepreload" href="/assets/use-config-Bcz2JL2t.js"/><link rel="modulepreload" href="/assets/color-themes-DSaoIL6A.js"/><link rel="modulepreload" href="/assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js"/><link rel="stylesheet" href="/assets/root-DEotKI6b.css"/></head><body data-agent-server-ui="" class="m-0"><div data-agent-server-ui="" style="--oh-color-logo:#cfb755;--oh-color-base:var(--cool-grey-950);--oh-color-base-secondary:var(--cool-grey-925);--oh-color-danger:#e76a5e;--oh-color-success:#a5e75e;--oh-color-basic:var(--cool-grey-400);--oh-color-tertiary:var(--cool-grey-800);--oh-color-tertiary-light:var(--cool-grey-300);--oh-color-content:var(--cool-grey-100);--oh-color-content-2:var(--cool-grey-50);--oh-background:var(--cool-grey-950);--oh-foreground:var(--cool-grey-100);--oh-surface:var(--cool-grey-925);--oh-surface-foreground:var(--cool-grey-100);--oh-surface-raised:var(--cool-grey-900);--oh-surface-deep:var(--cool-grey-975);--oh-overlay:var(--cool-grey-925);--oh-overlay-foreground:var(--cool-grey-100);--oh-muted:var(--cool-grey-400);--oh-text-secondary:var(--cool-grey-300);--oh-text-tertiary:var(--cool-grey-200);--oh-text-dim:var(--cool-grey-500);--oh-text-subtle:var(--cool-grey-600);--oh-interactive-hover:var(--cool-grey-700);--oh-interactive-hover-low:var(--cool-grey-900);--oh-interactive-active:var(--cool-grey-800);--oh-interactive-selected:var(--cool-grey-600);--oh-scrollbar:color-mix(in srgb, var(--cool-grey-400) 30%, transparent);--oh-scrollbar-hover:color-mix(in srgb, var(--cool-grey-400) 50%, transparent);--oh-default:var(--cool-grey-800);--oh-default-foreground:var(--cool-grey-100);--oh-accent-foreground:var(--cool-grey-950);--oh-success:#a5e75e;--oh-success-foreground:var(--cool-grey-950);--oh-warning-foreground:var(--cool-grey-950);--oh-danger:#e76a5e;--oh-danger-foreground:var(--cool-grey-50);--oh-segment:var(--cool-grey-925);--oh-segment-foreground:var(--cool-grey-100);--oh-border-width:1px;--oh-field-border-width:1px;--oh-border:var(--cool-grey-700);--oh-border-input:var(--cool-grey-600);--oh-border-subtle:var(--cool-grey-800);--oh-separator:rgba(113, 120, 136, 0.5);--oh-focus:#ffffff;--oh-status-success:#1FBD53;--oh-status-error:#FF684E;--oh-link:var(--cool-grey-100);--oh-radius:8px;--oh-field-radius:8px;--oh-surface-shadow:none;--oh-overlay-shadow:none;--oh-field-shadow:none;--oh-bg-dark:var(--cool-grey-950);--oh-bg-light:var(--cool-grey-900);--oh-bg-input:var(--cool-grey-800);--oh-bg-workspace:var(--cool-grey-925);--oh-text-editor-base:var(--cool-grey-400);--oh-text-editor-active:var(--cool-grey-300);--oh-bg-editor-sidebar:var(--cool-grey-925);--oh-bg-editor-active:var(--cool-grey-900);--oh-border-editor-sidebar:var(--cool-grey-800);--oh-bg-neutral-muted:color-mix(in srgb, var(--cool-grey-300) 20%, transparent)"><div class="dark min-h-screen text-foreground" data-theme="dark"><script>
|
|
2
2
|
console.log(
|
|
3
3
|
"💿 Hey developer 👋. You can provide a way better UX than this " +
|
|
4
4
|
"when your app is loading JS modules and/or running `clientLoader` " +
|
|
5
5
|
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
6
6
|
"for more information."
|
|
7
7
|
);
|
|
8
|
-
</script><div data-rht-toaster="" style="position:fixed;z-index:9999;top:16px;left:16px;right:16px;bottom:16px;pointer-events:none"></div><div id="modal-portal-exit"></div></div></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_optimizeDeps":false,"unstable_passThroughRequests":false,"unstable_subResourceIntegrity":false,"unstable_trailingSlashAwareDataRequests":false,"unstable_previewServerPrerendering":false,"v8_middleware":false,"v8_splitRouteModules":false,"v8_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-
|
|
9
|
-
import * as route0 from "/assets/root-
|
|
8
|
+
</script><div data-rht-toaster="" style="position:fixed;z-index:9999;top:16px;left:16px;right:16px;bottom:16px;pointer-events:none"></div><div id="modal-portal-exit"></div></div></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_optimizeDeps":false,"unstable_passThroughRequests":false,"unstable_subResourceIntegrity":false,"unstable_trailingSlashAwareDataRequests":false,"unstable_previewServerPrerendering":false,"v8_middleware":false,"v8_splitRouteModules":false,"v8_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-f041e61a.js";
|
|
9
|
+
import * as route0 from "/assets/root-D2PVd51i.js";
|
|
10
10
|
|
|
11
11
|
window.__reactRouterRouteModules = {"root":route0};
|
|
12
12
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.",
|
|
3
|
+
|
|
4
|
+
"versions": {
|
|
5
|
+
"agentServer": "1.23.1",
|
|
6
|
+
"automation": "1.0.0a5",
|
|
7
|
+
"automationSdk": "1.22.1"
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
"images": {
|
|
11
|
+
"agentServer": "ghcr.io/openhands/agent-server",
|
|
12
|
+
"agentCanvas": "ghcr.io/openhands/agent-canvas"
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"ports": {
|
|
16
|
+
"agentServer": 18000,
|
|
17
|
+
"automation": 18001,
|
|
18
|
+
"proxy": 8000
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
"paths": {
|
|
22
|
+
"stateSubdir": "agent-canvas",
|
|
23
|
+
"conversations": "agent-canvas/conversations",
|
|
24
|
+
"bashEvents": "agent-canvas/bash_events",
|
|
25
|
+
"automationDb": "automation/automations.db"
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"packages": {
|
|
29
|
+
"agentServer": "openhands-agent-server",
|
|
30
|
+
"automation": "openhands-automation",
|
|
31
|
+
"tools": "openhands-tools",
|
|
32
|
+
"workspace": "openhands-workspace"
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
"defaults": {
|
|
36
|
+
"secretKey": "openhands-dev-secret-key-change-in-prod"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../../../i18n/declaration.cjs`),r=require(`../../../utils/utils.cjs`),i=require(`../../../stores/conversation-store.cjs`),a=require(`../../../contexts/active-backend-context.cjs`),o=require(`../../../node_modules/lucide-react/dist/esm/icons/plus.cjs`),s=require(`../../../node_modules/lucide-react/dist/esm/icons/settings.cjs`),c=require(`../../../utils/form-control-classes.cjs`),l=require(`../../shared/buttons/styled-tooltip.cjs`),u=require(`../../../hooks/query/use-cloud-organizations.cjs`),
|
|
1
|
+
const e=require(`../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../node_modules/react-i18next/dist/es/useTranslation.cjs`),n=require(`../../../i18n/declaration.cjs`),r=require(`../../../utils/utils.cjs`),i=require(`../../../stores/conversation-store.cjs`),a=require(`../../../contexts/active-backend-context.cjs`),o=require(`../../../node_modules/lucide-react/dist/esm/icons/plus.cjs`),s=require(`../../../node_modules/lucide-react/dist/esm/icons/settings.cjs`),c=require(`../../../utils/form-control-classes.cjs`),l=require(`../../shared/buttons/styled-tooltip.cjs`),u=require(`../../shared/navigation-link.cjs`),d=require(`../../../hooks/query/use-cloud-organizations.cjs`),f=require(`../../../hooks/query/use-cloud-current-user-id.cjs`),p=require(`../../../ui/dropdown/dropdown.cjs`),m=require(`../../../hooks/query/use-backends-health.cjs`),h=require(`./environment-switch-store.cjs`),g=require(`./backend-status-dot.cjs`),_=require(`./add-backend-modal.cjs`),v=require(`./manage-backends-modal.cjs`);let y=require(`react`);y=e.__toESM(y,1);let b=require(`react/jsx-runtime`),x=require(`react-router`);var S=`::`;function C(e,t){return t?`${e}${S}${t}`:e}function w(e){let[t,n]=e.split(S);return{backendId:t,orgId:n??null}}function T(e){return(0,b.jsx)(g.BackendStatusDot,{isConnected:e?.isConnected??null})}function E(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:C(e.id,null),label:e.name,prefix:T(i[e.id])});for(let e of s){let o=n[e.id],s=T(i[e.id]);if(!o||o.orgs.length===0)a.push({value:C(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:C(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function D({openUpward:e=!1,hideTrigger:g=!1,defaultOpen:S=!1,onSelectOption:D,onOpenAddBackend:O,onOpenManageBackends:k,sidebarCollapsed:A=!1}={}){let{t:j}=t.useTranslation(`openhands`),{backends:M,active:N,setActive:P}=a.useActiveBackendContext(),F=d.useAllCloudOrganizations(),I=f.useCloudCurrentUserId(),L=m.useBackendsHealth(M),R=(0,x.useNavigate)(),z=(0,x.useMatch)(`/settings`),B=(0,x.useMatch)(`/settings/*`),V=(0,x.useMatch)(`/conversations/:conversationId`),H=(0,x.useMatch)(`/automations/:automationId`),[U,W]=y.default.useState(!1),[G,K]=y.default.useState(!1),q=j(n.I18nKey.BACKEND$PERSONAL_WORKSPACE),J=y.default.useMemo(()=>E(M,q,F,I,L),[M,q,F,I,L]),Y=C(N.backend.id,N.orgId),X=J.find(e=>e.value===Y),Z=!!(z||B),Q=j(n.I18nKey.SIDEBAR$SETTINGS),ee=i.useConversationStore(e=>e.isRightPanelShown),te=!A||V&&ee?`top`:`left`,ne=Object.values(F).some(e=>e.isLoading);y.default.useEffect(()=>{if(N.backend.kind!==`cloud`||N.orgId)return;let{backend:e}=N,t=F[e.id];if(!t||t.orgs.length===0)return;let n=I[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&P(e.id,r.id)},[N,F,I,P]);let re=y.default.useCallback(()=>{if(O){O(),D?.();return}W(!0)},[O,D]),ie=y.default.useCallback(()=>{if(k){k(),D?.();return}K(!0)},[k,D]),$=y.default.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ae=(0,b.jsxs)(`div`,{className:`flex flex-col`,children:[(0,b.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:$,onClick:re,className:`flex w-full items-center gap-2 px-2 py-2 rounded-md text-sm cursor-pointer text-white hover:bg-[var(--oh-interactive-hover)]`,children:[(0,b.jsx)(o.Plus,{width:16,height:16,className:`text-white shrink-0`}),j(n.I18nKey.BACKEND$ADD)]}),(0,b.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:$,onClick:ie,className:`flex w-full items-center gap-2 px-2 py-2 rounded-md text-sm cursor-pointer text-white hover:bg-[var(--oh-interactive-hover)]`,children:[(0,b.jsx)(s.Settings,{width:16,height:16,className:`text-white shrink-0`}),j(n.I18nKey.BACKEND$MANAGE)]})]}),oe=y.default.useCallback(async e=>{if(e===Y)return;let{backendId:t,orgId:n}=w(e),r=M.find(e=>e.id===t);r&&(h.triggerEnvironmentSwitch(J.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),V?R(`/conversations`):H&&R(`/automations`),P(r.id,n),D?.())},[Y,M,V,H,R,J,P,j,D]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,b.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,b.jsx)(p.Dropdown,{testId:`backend-selector`,defaultValue:X??{value:Y,label:N.backend.name,prefix:T(L[N.backend.id])},footer:ae,openUpward:e,hideTrigger:g,defaultOpen:S,openOnHover:!g,onChange:e=>{e&&oe(e.value)},placeholder:N.backend.name,loading:ne,options:J,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${Y}-${X?.label??``}`)}),g?null:(0,b.jsx)(l.StyledTooltip,{content:Q,placement:te,offset:10,children:(0,b.jsx)(u.NavigationLink,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":Z,"aria-label":Q,className:Z?r.cn(`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`,c.formControlTransitionClassName):r.cn(`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,c.formControlTransitionClassName),children:(0,b.jsx)(s.Settings,{width:16,height:16})})})]}),U?(0,b.jsx)(_.AddBackendModal,{onClose:()=>W(!1)}):null,G?(0,b.jsx)(v.ManageBackendsModal,{onClose:()=>K(!1)}):null]})}exports.BackendSelector=D;
|
|
2
2
|
//# sourceMappingURL=backend-selector.cjs.map
|