@openhands/agent-canvas 1.0.0-beta.1 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +2 -2
  2. package/build/assets/{agent-server-conversation-service.api-DFvqqEDo.js → agent-server-conversation-service.api-C2V5SlHu.js} +1 -1
  3. package/build/assets/{automation-detail-Di7EOIZD.js → automation-detail-DJvbVSYK.js} +1 -1
  4. package/build/assets/{automations-list-IsIWdDiw.js → automations-list-rMki-8au.js} +1 -1
  5. package/build/assets/{conversation-HlncOV7n.js → conversation-DVrKU0oz.js} +3 -3
  6. package/build/assets/conversation-Dlys-D5A.js +1 -0
  7. package/build/assets/conversation-panel-iF09WjZ4.js +1 -0
  8. package/build/assets/{conversation-service.api-nb5W1PqR.js → conversation-service.api-CCfztilW.js} +1 -1
  9. package/build/assets/{conversation-websocket-context-C8_PkGLi.js → conversation-websocket-context-DhJhqUna.js} +1 -1
  10. package/build/assets/{files-tab-BhnLgimi.js → files-tab-R5z0lLdY.js} +1 -1
  11. package/build/assets/{git-control-bar-branch-button-M34A5_vX.js → git-control-bar-branch-button-COdRAYHb.js} +1 -1
  12. package/build/assets/{git-provider-icon-D5dCNy-k.js → git-provider-icon-BzLbc0yC.js} +1 -1
  13. package/build/assets/{home-CYQv7yc_.js → home-XxBpNOVq.js} +1 -1
  14. package/build/assets/{launch-DHEUYn2A.js → launch-CshDse3e.js} +1 -1
  15. package/build/assets/{manifest-9fee01b9.js → manifest-a1d22045.js} +1 -1
  16. package/build/assets/{messages-BMzyOW2V.js → messages-D0rWot7s.js} +1 -1
  17. package/build/assets/{path-utils-YohAYyMv.js → path-utils-C3bQf6lJ.js} +1 -1
  18. package/build/assets/{planner-tab-CFc-hV07.js → planner-tab-BlrCpv-7.js} +1 -1
  19. package/build/assets/{recommended-automations-launcher-sgvfU62c.js → recommended-automations-launcher-BQChv2rc.js} +2 -2
  20. package/build/assets/root-35yk2E_M.js +2 -0
  21. package/build/assets/{root-layout-DVepR4To.js → root-layout-Czo9Ma6Q.js} +1 -1
  22. package/build/assets/{shared-conversation-DChOdb0t.js → shared-conversation-AMyqXvpk.js} +1 -1
  23. package/build/assets/{sidebar-mobile-menu-toggle-BWuf4PRH.js → sidebar-mobile-menu-toggle-Do_aA9Zm.js} +1 -1
  24. package/build/assets/{terminal-CRf9S0Z2.js → terminal-DgQk1Ay6.js} +1 -1
  25. package/build/assets/{use-active-conversation-Db3IWSPK.js → use-active-conversation-BEFNwnFk.js} +1 -1
  26. package/build/assets/{use-agent-state-Bn8vS5sY.js → use-agent-state-Bkrd1FZq.js} +1 -1
  27. package/build/assets/{use-create-conversation-CKS3EAHu.js → use-create-conversation-CEgXpkfH.js} +1 -1
  28. package/build/assets/{use-handle-plan-click-C9zJpK8A.js → use-handle-plan-click-Ckkm5eIY.js} +1 -1
  29. package/build/assets/{use-runtime-is-ready-CQCE3xZC.js → use-runtime-is-ready-B7EF4BKU.js} +1 -1
  30. package/build/assets/{use-unified-vscode-url-sZt29HrC.js → use-unified-vscode-url-DdSRw-6P.js} +1 -1
  31. package/build/assets/{use-user-conversation-DfgEB6RW.js → use-user-conversation-C6hrMMtn.js} +1 -1
  32. package/build/assets/{vscode-tab-Zb-QbTuV.js → vscode-tab-DjNArCgY.js} +1 -1
  33. package/build/index.html +3 -3
  34. package/dist/api/agent-server-adapter.cjs +1 -1
  35. package/dist/api/agent-server-adapter.cjs.map +1 -1
  36. package/dist/api/agent-server-adapter.js +1 -1
  37. package/dist/api/agent-server-adapter.js.map +1 -1
  38. package/dist/package.cjs +1 -1
  39. package/dist/package.cjs.map +1 -1
  40. package/dist/package.js +2 -1
  41. package/dist/package.js.map +1 -1
  42. package/package.json +2 -1
  43. package/scripts/dev-safe.mjs +1 -1
  44. package/build/assets/conversation-MtnkpqA9.js +0 -1
  45. package/build/assets/conversation-panel-DxnM6tRe.js +0 -1
  46. package/build/assets/root-BXWU99D-.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-YohAYyMv.js";import{t as r}from"./useMutation-DqrumCWD.js";import{o as i,t as a}from"./declaration-BNMqORFE.js";import{t as o}from"./Trans-Cvm_-SMi.js";import{t as s}from"./useTranslation-DCOdSSMl.js";import{a as c}from"./i18n-CTohRuoO.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-C8_PkGLi.js";import{T as g,_,t as v}from"./utils-i18rdUj2.js";import{t as y}from"./use-config-Co1O8-Ey.js";import{t as ee}from"./styled-tooltip-CBzrri6o.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-DR1t-EeP.js";import{n as re}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DW31UyBp.js";import{t as ie}from"./skills-ChIKZPK4.js";import{t as ae}from"./close-B5LROHR3.js";import{n as oe,r as S,t as se}from"./use-active-conversation-Db3IWSPK.js";import{t as ce}from"./use-agent-state-Bn8vS5sY.js";import{C as le,a as C,g as ue,i as w,r as T,t as de,v as E,y as D}from"./use-event-store-BT_gV3ut.js";import{r as O}from"./typography-gpuWmrQO.js";import{t as k}from"./lesson-plan-dH5Bj0pN.js";import{n as fe,t as A}from"./markdown-renderer-DMzf2i4x.js";import{t as pe}from"./u-check-circle-IUIfACQQ.js";import{n as me,r as he,t as ge}from"./plan-components-atxXCF0R.js";import{n as _e,t as ve}from"./u-check-circle-half-C1YxB6py.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 be(){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 N(e,t,n,r){return{action:M.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var P=i(),F=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.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`})}),I=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function xe({status:e}){return(0,P.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,P.jsx)(re,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function L({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,P.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,P.jsx)(I,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,P.jsx)(F,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,P.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&l,o,(0,P.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,P.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,P.jsx)(xe,{status:n})]})]}),s&&(typeof t==`string`?(0,P.jsx)(A,{children:t}):t)]})}var Se=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,P.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,P.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,P.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsx)(`defs`,{children:(0,P.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,P.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function Ce({profile:e}){let[t,r]=j.useState(!1);return(0,P.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,P.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,P.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,P.jsx)(u,{size:14}):(0,P.jsx)(n,{size:14})}),(0,P.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`border-neutral-700`}),(0,P.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 we({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,P.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,P.jsx)(L,{title:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Se,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,P.jsx)(o,{i18nKey:a.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,P.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,P.jsx)(L,{title:(0,P.jsx)(`span`,{children:t?(0,P.jsx)(o,{i18nKey:a.MODEL$NO_SAVED_PROFILES}):(0,P.jsx)(o,{i18nKey:a.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,P.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,P.jsx)(o,{i18nKey:a.MODEL$NO_PROFILES_HINT})}):(0,P.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,P.jsx)(Ce,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var R=(0,j.createContext)(void 0);function Te({children:e,value:t}){let n=he(j.useRef(null)),r=t||n;return(0,P.jsx)(R.Provider,{value:r,children:e})}function Ee(){let e=(0,j.useContext)(R);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function De(){return(0,j.useContext)(R)}var Oe=()=>{let{setConversationMode:e}=b(),{send:t}=be(),{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(N(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}};function ke(){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,Ae=ge(`shine-text`);function je({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=ke(),{handleBuildPlanClick:o}=Oe(),{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,P.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,P.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,P.jsx)(k,{width:18,height:18,color:`var(--oh-muted)`}),(0,P.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$PLAN_MD)}),(0,P.jsx)(`div`,{className:`flex-1`}),(0,P.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,P.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$VIEW)}),(0,P.jsx)(ye,{className:`text-white`,size:18})]})]}),(0,P.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:d&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(A,{includeStandard:!0,components:t?Ae:me,children:d}),e&&e.length>z&&(0,P.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,P.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,P.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,P.jsxs)(O.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(a.COMMON$BUILD),` `,(0,P.jsx)(O.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function Me({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=j.useState(!1);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&c.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,P.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,P.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,P.jsx)(F,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,P.jsx)(A,{children:t})]})}function Ne({event:e}){return C(e)?(0,P.jsx)(Me,{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,P.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,P.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,P.jsx)(ee,{content:e.tooltip,placement:`top`,children:(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,P.jsx)(fe,{isHidden:!u,isDisabled:f,onClick:async()=>{await navigator.clipboard.writeText(t),p(!0)},mode:f?`copied`:`copy`})]}),(0,P.jsx)(`div`,{className:`text-sm whitespace-normal [word-break:break-word]`,children:(0,P.jsx)(A,{includeStandard:!0,includeHeadings:!0,children:t})}),o===`sending`&&(0,P.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,P.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,P.jsx)(`button`,{type:`button`,onClick:c,className:`underline cursor-pointer`,"data-testid":`chat-message-retry`,children:l(a.CHAT_INTERFACE$MESSAGE_RETRY)})]}),n]})}function Pe({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.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 Fe({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.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 Ie({onClick:e,className:t}){return(0,P.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,P.jsx)(ae,{width:18,height:18})})}function Le({src:e,size:t=`small`}){return(0,P.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 Re({src:e,onRemove:t,size:n=`small`}){return(0,P.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,P.jsx)(Le,{src:e,size:n}),t&&(0,P.jsx)(Ie,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function ze({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,P.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,P.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(Pe,{active:!o})}),(0,P.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,P.jsx)(Re,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,P.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(Fe,{active:!c})})]})}function Be({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,P.jsx)(ee,{closeDelay:100,content:o,children:(0,P.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 Ve({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,P.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,P.jsx)(`span`,{className:``,children:n}),(0,P.jsx)(`span`,{className:`font-bold`,children:i}),(0,P.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var He=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,P.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,P.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,P.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`})]}),V=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 H(){let e=V(e=>e.submittedEventIds),t=V(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=se(),{curAgentState:i}=ce(),{mutate:o}=Ue(),c=de(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,P.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(w(c)?c.security_risk:x.UNKNOWN)===x.HIGH&&(0,P.jsx)(Ve,{content:n(a.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,P.jsx)(He,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(a.COMMON$HIGH_RISK)}),(0,P.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,P.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(a.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(Be,{type:`reject`,onClick:()=>l(!1)}),(0,P.jsx)(Be,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var We=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-C3bQf6lJ.js";import{t as r}from"./useMutation-DqrumCWD.js";import{o as i,t as a}from"./declaration-BNMqORFE.js";import{t as o}from"./Trans-Cvm_-SMi.js";import{t as s}from"./useTranslation-DCOdSSMl.js";import{a as c}from"./i18n-CTohRuoO.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-DhJhqUna.js";import{T as g,_,t as v}from"./utils-i18rdUj2.js";import{t as y}from"./use-config-Co1O8-Ey.js";import{t as ee}from"./styled-tooltip-CBzrri6o.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-DR1t-EeP.js";import{n as re}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DW31UyBp.js";import{t as ie}from"./skills-ChIKZPK4.js";import{t as ae}from"./close-B5LROHR3.js";import{n as oe,r as S,t as se}from"./use-active-conversation-BEFNwnFk.js";import{t as ce}from"./use-agent-state-Bkrd1FZq.js";import{C as le,a as C,g as ue,i as w,r as T,t as de,v as E,y as D}from"./use-event-store-BT_gV3ut.js";import{r as O}from"./typography-gpuWmrQO.js";import{t as k}from"./lesson-plan-dH5Bj0pN.js";import{n as fe,t as A}from"./markdown-renderer-DMzf2i4x.js";import{t as pe}from"./u-check-circle-IUIfACQQ.js";import{n as me,r as he,t as ge}from"./plan-components-atxXCF0R.js";import{n as _e,t as ve}from"./u-check-circle-half-C1YxB6py.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 be(){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 N(e,t,n,r){return{action:M.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var P=i(),F=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.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`})}),I=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function xe({status:e}){return(0,P.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,P.jsx)(re,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function L({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,P.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,P.jsx)(I,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,P.jsx)(F,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,P.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&l,o,(0,P.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,P.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,P.jsx)(xe,{status:n})]})]}),s&&(typeof t==`string`?(0,P.jsx)(A,{children:t}):t)]})}var Se=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,P.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,P.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,P.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsx)(`defs`,{children:(0,P.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,P.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function Ce({profile:e}){let[t,r]=j.useState(!1);return(0,P.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,P.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,P.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,P.jsx)(u,{size:14}):(0,P.jsx)(n,{size:14})}),(0,P.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`border-neutral-700`}),(0,P.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 we({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,P.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,P.jsx)(L,{title:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Se,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,P.jsx)(o,{i18nKey:a.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,P.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,P.jsx)(L,{title:(0,P.jsx)(`span`,{children:t?(0,P.jsx)(o,{i18nKey:a.MODEL$NO_SAVED_PROFILES}):(0,P.jsx)(o,{i18nKey:a.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,P.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,P.jsx)(o,{i18nKey:a.MODEL$NO_PROFILES_HINT})}):(0,P.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,P.jsx)(Ce,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var R=(0,j.createContext)(void 0);function Te({children:e,value:t}){let n=he(j.useRef(null)),r=t||n;return(0,P.jsx)(R.Provider,{value:r,children:e})}function Ee(){let e=(0,j.useContext)(R);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function De(){return(0,j.useContext)(R)}var Oe=()=>{let{setConversationMode:e}=b(),{send:t}=be(),{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(N(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}};function ke(){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,Ae=ge(`shine-text`);function je({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=ke(),{handleBuildPlanClick:o}=Oe(),{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,P.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,P.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,P.jsx)(k,{width:18,height:18,color:`var(--oh-muted)`}),(0,P.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$PLAN_MD)}),(0,P.jsx)(`div`,{className:`flex-1`}),(0,P.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,P.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$VIEW)}),(0,P.jsx)(ye,{className:`text-white`,size:18})]})]}),(0,P.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:d&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(A,{includeStandard:!0,components:t?Ae:me,children:d}),e&&e.length>z&&(0,P.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,P.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,P.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,P.jsxs)(O.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(a.COMMON$BUILD),` `,(0,P.jsx)(O.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function Me({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=j.useState(!1);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&c.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,P.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,P.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,P.jsx)(F,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,P.jsx)(A,{children:t})]})}function Ne({event:e}){return C(e)?(0,P.jsx)(Me,{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,P.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,P.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,P.jsx)(ee,{content:e.tooltip,placement:`top`,children:(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,P.jsx)(fe,{isHidden:!u,isDisabled:f,onClick:async()=>{await navigator.clipboard.writeText(t),p(!0)},mode:f?`copied`:`copy`})]}),(0,P.jsx)(`div`,{className:`text-sm whitespace-normal [word-break:break-word]`,children:(0,P.jsx)(A,{includeStandard:!0,includeHeadings:!0,children:t})}),o===`sending`&&(0,P.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,P.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,P.jsx)(`button`,{type:`button`,onClick:c,className:`underline cursor-pointer`,"data-testid":`chat-message-retry`,children:l(a.CHAT_INTERFACE$MESSAGE_RETRY)})]}),n]})}function Pe({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.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 Fe({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.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 Ie({onClick:e,className:t}){return(0,P.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,P.jsx)(ae,{width:18,height:18})})}function Le({src:e,size:t=`small`}){return(0,P.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 Re({src:e,onRemove:t,size:n=`small`}){return(0,P.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,P.jsx)(Le,{src:e,size:n}),t&&(0,P.jsx)(Ie,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function ze({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,P.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,P.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(Pe,{active:!o})}),(0,P.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,P.jsx)(Re,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,P.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(Fe,{active:!c})})]})}function Be({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,P.jsx)(ee,{closeDelay:100,content:o,children:(0,P.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 Ve({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,P.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,P.jsx)(`span`,{className:``,children:n}),(0,P.jsx)(`span`,{className:`font-bold`,children:i}),(0,P.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var He=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,P.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,P.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,P.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`})]}),V=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 H(){let e=V(e=>e.submittedEventIds),t=V(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=se(),{curAgentState:i}=ce(),{mutate:o}=Ue(),c=de(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,P.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(w(c)?c.security_risk:x.UNKNOWN)===x.HIGH&&(0,P.jsx)(Ve,{content:n(a.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,P.jsx)(He,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(a.COMMON$HIGH_RISK)}),(0,P.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,P.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(a.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(Be,{type:`reject`,onClick:()=>l(!1)}),(0,P.jsx)(Be,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var We=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 U({event:e,isLastMessage:t,isFromPlanningAgent:n}){let r=We(e),i=[];return Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&i.push(...e.image_urls)}),(0,P.jsxs)(B,{type:e.source,message:r,isFromPlanningAgent:n,children:[i.length>0&&(0,P.jsx)(ze,{size:`small`,images:i}),t&&(0,P.jsx)(H,{})]})}var Ge=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 Ge.error(String(t)),e}};return Array.isArray(t)?(0,P.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,P.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,P.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,P.jsx)(`span`,{className:`font-mono`,title:t,children:Xe(t)})}catch(t){return Ge.error(String(t)),(0,P.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,P.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,P.jsx)(`strong`,{children:n(t)}):(0,P.jsx)(`strong`,{className:`font-mono`,children:t})}var W=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`)}},G=()=>``,et=e=>e.name?`**Skill:** \`${e.name}\``:G(),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
  `):G()},nt=e=>{if(e.command!==`create`||!e.file_text)return G();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,W)}...`),`${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 +1 @@
1
- import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~g56ukk6u-DsSvIDZQ.js";import{d as n,n as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js";import{t as i}from"./createLucideIcon-Ddu8jDOQ.js";import{c as a,t as o}from"./agent-server-client-options-Bc5ZorQZ.js";import{o as s,r as c,t as l}from"./agent-server-conversation-service.api-DFvqqEDo.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},m=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await p(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},_=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},v=(e,t,n)=>_(e,t,{execution_status:n}),y=(e,t,n)=>_(e,t,{llm_model:n}),b=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},x=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},S=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{_ as a,v as c,d,b as i,y as l,x as n,m as o,h as r,g as s,S as t,f as u};
1
+ import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~g56ukk6u-DsSvIDZQ.js";import{d as n,n as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js";import{t as i}from"./createLucideIcon-Ddu8jDOQ.js";import{c as a,t as o}from"./agent-server-client-options-Bc5ZorQZ.js";import{o as s,r as c,t as l}from"./agent-server-conversation-service.api-C2V5SlHu.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},m=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await p(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},_=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},v=(e,t,n)=>_(e,t,{execution_status:n}),y=(e,t,n)=>_(e,t,{llm_model:n}),b=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},x=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},S=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{_ as a,v as c,d,b as i,y as l,x as n,m as o,h as r,g as s,S as t,f as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-BNMqORFE.js";import{t as i}from"./useTranslation-DCOdSSMl.js";import{t as a}from"./brand-button-Br7f0kZJ.js";import{t as o}from"./conversation-store-Z5iMCRpc.js";import{t as s}from"./lesson-plan-dH5Bj0pN.js";import{t as c}from"./use-handle-plan-click-C9zJpK8A.js";import{t as l}from"./markdown-renderer-DMzf2i4x.js";import{n as u,r as d}from"./plan-components-atxXCF0R.js";import{t as f}from"./conversation-tab-empty-state-DyssnnWa.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=o();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{}),action:(0,m.jsx)(a,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-BNMqORFE.js";import{t as i}from"./useTranslation-DCOdSSMl.js";import{t as a}from"./brand-button-Br7f0kZJ.js";import{t as o}from"./conversation-store-Z5iMCRpc.js";import{t as s}from"./lesson-plan-dH5Bj0pN.js";import{t as c}from"./use-handle-plan-click-Ckkm5eIY.js";import{t as l}from"./markdown-renderer-DMzf2i4x.js";import{n as u,r as d}from"./plan-components-atxXCF0R.js";import{t as f}from"./conversation-tab-empty-state-DyssnnWa.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=o();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{}),action:(0,m.jsx)(a,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-BNMqORFE.js";import{t as i}from"./use-is-creating-conversation-BZ5hB_Bg.js";import{t as a}from"./useTranslation-DCOdSSMl.js";import{r as o}from"./vendor~home~mcp~automations-list-Ccy2I0KU.js";import{a as s,i as c,o as l,r as u,s as d,t as f}from"./circle-plus-check-toggle-P7ZZToV4.js";import{t as p}from"./utils-i18rdUj2.js";import{n as m}from"./active-backend-context-cCM1vYYZ.js";import{n as h}from"./navigation-context-D0YWpT8d.js";import{a as g,o as _}from"./conversation-local-storage-UYl-SX-r.js";import{t as v}from"./conversation-store-Z5iMCRpc.js";import{i as y,r as b}from"./use-settings-DQIZmIov.js";import{t as x}from"./use-create-conversation-CKS3EAHu.js";import{f as S,i as C,l as w,m as T,o as E,t as D,u as O}from"./install-server-modal-f31_CLrW.js";import{n as k}from"./skill-card-pill-row-DF1axQCG.js";import{t as A}from"./clock-BRjCgHTc.js";var j=e(t(),1),M=[{id:`github-pr-reviewer`,name:`GitHub PR review copilot`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`Create an automation that reviews GitHub pull requests when they are opened or updated. Use the GitHub MCP to inspect the PR diff, changed files, tests, and existing discussion. Post a short review that highlights correctness risks, security issues, missing tests, and concrete next steps. Ask me for the repositories, filters, review tone, and whether comments should be posted automatically or drafted first.`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-BNMqORFE.js";import{t as i}from"./use-is-creating-conversation-BZ5hB_Bg.js";import{t as a}from"./useTranslation-DCOdSSMl.js";import{r as o}from"./vendor~home~mcp~automations-list-Ccy2I0KU.js";import{a as s,i as c,o as l,r as u,s as d,t as f}from"./circle-plus-check-toggle-P7ZZToV4.js";import{t as p}from"./utils-i18rdUj2.js";import{n as m}from"./active-backend-context-cCM1vYYZ.js";import{n as h}from"./navigation-context-D0YWpT8d.js";import{a as g,o as _}from"./conversation-local-storage-UYl-SX-r.js";import{t as v}from"./conversation-store-Z5iMCRpc.js";import{i as y,r as b}from"./use-settings-DQIZmIov.js";import{t as x}from"./use-create-conversation-CEgXpkfH.js";import{f as S,i as C,l as w,m as T,o as E,t as D,u as O}from"./install-server-modal-f31_CLrW.js";import{n as k}from"./skill-card-pill-row-DF1axQCG.js";import{t as A}from"./clock-BRjCgHTc.js";var j=e(t(),1),M=[{id:`github-pr-reviewer`,name:`GitHub PR review copilot`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`Create an automation that reviews GitHub pull requests when they are opened or updated. Use the GitHub MCP to inspect the PR diff, changed files, tests, and existing discussion. Post a short review that highlights correctness risks, security issues, missing tests, and concrete next steps. Ask me for the repositories, filters, review tone, and whether comments should be posted automatically or drafted first.`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
2
2
  Required MCP: GitHub
3
3
 
4
4
  1. Read repository, pull_request, and sender from the event payload.
@@ -48,5 +48,5 @@ Required MCPs: Slack, Linear, Notion
48
48
  3. TODO: define the incident identifier format and approved Notion template.
49
49
  4. Build a timeline, impact summary, root-cause hypotheses, and action items.
50
50
  5. Publish a draft retrospective and notify the incident owner.`}],N=n(),P=`inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`;function F(e){return e.slice(0,4)}function I({entries:e,className:t,testId:n}){let r=F(e);if(r.length===0)return(0,N.jsx)(C,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,N.jsx)(C,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,N.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:p(P,`items-center justify-center`,t),children:(0,N.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,N.jsx)(C,{entry:e,size:`sm`,className:`ring-2 ring-surface-raised`},e.id))})});let i=[r[0]??null,r[1]??null,r[2]??null,r[3]??null];return(0,N.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:p(P,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,N.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,N.jsx)(C,{entry:e,size:`xs`})},e.id):(0,N.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function L({count:e}){return(0,N.jsx)(`span`,{className:`ml-2 inline-flex items-center justify-center rounded-full bg-surface-raised px-2 py-0.5 text-xs text-foreground`,children:e})}function R(e){return e.map((e,t)=>({automation:e,index:t})).sort((e,t)=>(t.automation.popularityRank??0)-(e.automation.popularityRank??0)||e.index-t.index).map(({automation:e})=>e)}var z=R(M);function B(e){let t=O(o);return e.requiredIntegrationIds.map(e=>w(e,t)).filter(e=>!!e)}function V(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,e.prompt,...t.map(e=>e.name),...t.flatMap(e=>e.keywords??[])].join(` `).toLowerCase().includes(r):!0}function H(e,t){return B(e).every(e=>S(e,t))}function U(e,t,n,i,a){let o=t.map(e=>{let t=!!E(e,n);return{id:`mcp-${e.id}`,node:(0,N.jsxs)(`span`,{className:p(l,`gap-1`),children:[(0,N.jsx)(C,{entry:e,size:`xs`}),e.name,t?(0,N.jsx)(`span`,{className:`text-white`,children:a(r.RECOMMENDED_AUTOMATIONS$CONNECTED)}):null]})}});return o.push({id:`setup-minutes`,node:(0,N.jsxs)(`span`,{className:p(l,`gap-1`),children:[(0,N.jsx)(A,{className:`size-3 shrink-0`}),a(r.RECOMMENDED_AUTOMATIONS$MINUTES,{count:e.estimatedSetupMinutes})]})}),i>0&&o.push({id:`missing-connect`,node:(0,N.jsx)(`span`,{className:l,children:a(r.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:i})})}),o}function W({backendKind:e,installedServers:t,query:n=``,onSelect:i}){let{t:o}=a(`openhands`),l=z.filter(t=>{let r=B(t);return H(t,e)&&V(t,r,n)});return l.length===0?null:(0,N.jsxs)(`section`,{"data-testid":`recommended-automations-section`,children:[(0,N.jsxs)(`div`,{className:`flex items-center`,children:[(0,N.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:o(r.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,N.jsx)(L,{count:l.length})]}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:o(r.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,N.jsx)(`div`,{className:p(`mt-3`,c),children:(0,N.jsx)(`div`,{className:u,children:l.map(e=>{let n=B(e),r=n.filter(e=>!E(e,t)).length;return(0,N.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>i(e),className:p(`flex min-w-0 overflow-hidden p-4 text-left`,d,s),children:(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,N.jsx)(I,{entries:n,testId:`recommended-automation-icon-${e.id}`}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,N.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,N.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,N.jsx)(f,{testId:`recommended-automation-plus-${e.id}`})]}),(0,N.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,N.jsx)(k,{pills:U(e,n,t,r,o),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})})]})}function G(e){let t=O(o);return e.requiredIntegrationIds.map(e=>w(e,t)).filter(e=>!!e)}function K(e){return e.replace(/\/+$/,``)}function q(e,t,n){return t===`cloud`?[e,``,`---`,`**Which API to use:** Create this automation using the active OpenHands Cloud Automations API.`,`- Endpoint: \`${n?`POST ${K(n)}/api/automation/v1/preset/prompt`:`POST /api/automation/v1/preset/prompt on the active OpenHands Cloud backend`}\``,"- Auth: `Authorization: Bearer $OPENHANDS_API_KEY`"].join(`
51
- `):[e,``,`---`,`**Which API to use:** Create this automation using the **local** OpenHands Automations API that is running alongside this agent.`,"- Read the Automation backend URL from the `<RUNTIME_SERVICES>` block in your system context.","- Endpoint path: `POST /api/automation/v1/preset/prompt`","- Auth: `X-API-Key: $OPENHANDS_AUTOMATION_API_KEY`","- If no local Automation backend is listed in `<RUNTIME_SERVICES>`, stop and ask me to start the full local automation stack instead of using any remote/cloud automation API."].join(`
51
+ `):[e,``,`---`,`**Which API to use:** Create this automation using the **local** OpenHands Automations API that is running alongside this agent.`,"- Read the Automation backend URL from the `<RUNTIME_SERVICES>` block in your system context.","- Endpoint path: `POST /api/automation/v1/preset/prompt`","- Auth: `X-Session-API-Key: $OPENHANDS_AUTOMATION_API_KEY`","- If no local Automation backend is listed in `<RUNTIME_SERVICES>`, stop and ask me to start the full local automation stack instead of using any remote/cloud automation API."].join(`
52
52
  `)}function J({query:e,onLaunched:t}){let n=m(),{navigate:r}=h(),{data:a}=b(),o=x(),s=i(),c=v(e=>e.setMessageToSend),[l,u]=(0,j.useState)(null),[d,f]=(0,j.useState)([]),p=(0,j.useRef)(!1),S=(0,j.useRef)(!1),C=(0,j.useMemo)(()=>T(y(a?.agent_settings?.mcp_config)),[a?.agent_settings?.mcp_config]),w=(0,j.useCallback)(e=>{if(S.current||o.isPending||s)return;S.current=!0;let i=q(e.prompt,n.backend.kind,n.backend.host);o.mutate({},{onSuccess:e=>{e.conversation_id.startsWith(`task-`)&&e.task_id?_(e.task_id,i):g(e.conversation_id,{draftMessage:i}),t?.(),r?.(`/conversations/${e.conversation_id}`),window.setTimeout(()=>c(i),0)},onError:()=>{S.current=!1}})},[n.backend.kind,o,s,r,t,c]),O=(0,j.useCallback)(e=>G(e).filter(e=>!E(e,C)),[C]),k=e=>{if(S.current||o.isPending||s||d.length>0)return;let t=O(e);if(t.length===0){w(e);return}u(e),f(t)},A=()=>{if(p.current){p.current=!1;return}u(null),f([])},M=()=>{p.current=!0,f(e=>{let t=e.slice(1);if(t.length===0){let e=l;window.setTimeout(()=>{u(null),e&&w(e)},0)}return t})},P=d[0]??null;return n.backend.kind===`cloud`?null:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(W,{backendKind:n.backend.kind,installedServers:C,query:e,onSelect:k}),P&&(0,N.jsx)(D,{entry:P,onClose:A,onSuccess:M},P.id)]})}export{L as n,J as t};
@@ -0,0 +1,2 @@
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-l7RkKfwX.js","assets/agent-server-client-options-Bc5ZorQZ.js","assets/server-client-DyAQ3NZ_.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~g56ukk6u-DsSvIDZQ.js","assets/QueryClientProvider-CkGuhXg-.js","assets/declaration-BNMqORFE.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-DCOdSSMl.js","assets/context-CEQZwATj.js","assets/backend-form-modal-Dnk33xA_.js","assets/organization-service.api-DzYTHTYC.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js","assets/proxy-CxydCnis.js","assets/health-store-BDC2rM-X.js","assets/brand-button-Br7f0kZJ.js","assets/utils-i18rdUj2.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~hkqzh1hb-BZ0HXuHD.js","assets/settings-input-Bn7F5C75.js","assets/modal-backdrop-BAbgYsqB.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-BI6Ru2Qr.js","assets/modal-close-button-t1Gh3qmL.js","assets/navigation-context-D0YWpT8d.js","assets/active-backend-context-cCM1vYYZ.js","assets/confirmation-modal-Dau3w_sa.js","assets/api-key-entry-screen-B2gynaCp.js","assets/settings-client-C73C7IgV.js","assets/agent-server-compatibility-BlkUsrX2.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-BNMqORFE.js";import{t as d}from"./useTranslation-DCOdSSMl.js";import{r as f}from"./providers-Bx6EfrzZ.js";import{i as p,t as m}from"./custom-toast-handlers-C-SZFmto.js";import{w as h}from"./agent-server-client-options-Bc5ZorQZ.js";import{r as g,t as _}from"./agent-server-compatibility-BlkUsrX2.js";import{t as v}from"./modal-backdrop-BAbgYsqB.js";import{n as y}from"./modal-body-BI6Ru2Qr.js";import{n as b,r as x}from"./base-modal-_dYTw1ri.js";import{t as S}from"./brand-button-Br7f0kZJ.js";import{t as ee}from"./loading-spinner-BPtYORNK.js";import{t as C}from"./use-config-Co1O8-Ey.js";import{i as w,n as te}from"./color-themes-DSaoIL6A.js";var T=e(t(),1),E={name:`@openhands/agent-canvas`,version:`1.0.0-beta.4`,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#e14f740c59b4bfd7369d4bb6aea5eeb33dd05909`,"@openhands/typescript-client":`1.24.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:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test: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`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.14.2`}},D=`openhands-telemetry-consent`,O=`openhands-telemetry-first-use`,k=`openhands-telemetry-session`,A=`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,j=`https://z.openhands.dev`,M=`https://us.posthog.com`,N=!1,P=null;function F(){return typeof window<`u`&&typeof localStorage<`u`}async function I(){if(!F())return null;if(P)return P;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 P=e,e}catch{return null}}function L(){return typeof process<`u`&&{}?.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`)}async function R(e=!1){if(N)return P;let t=await I();return t?(t.init(A,{api_host:j,ui_host:M,opt_out_capturing_by_default:!e,capture_pageview:!1,autocapture:!1,persistence:`localStorage`,disable_session_recording:!0,loaded:e=>{e.register({package_name:E.name,package_version:E.version})}}),N=!0,t):null}function z(){if(!F())return`pending`;if(L())return`denied`;try{let e=localStorage.getItem(D);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}async function B(e){if(F())try{localStorage.setItem(D,e);let t=await R();if(!t)return;e===`granted`?t.opt_in_capturing():t.opt_out_capturing()}catch{}}function V(){return z()===`granted`}function H(){if(!F())return!1;try{return localStorage.getItem(O)===`true`}catch{return!1}}function U(){if(F())try{localStorage.setItem(O,`true`)}catch{}}async function W(){if(L()||H())return;let e=await R(!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}),U(),z()!==`granted`&&e.opt_out_capturing())}function G(){if(!F())return!1;try{return sessionStorage.getItem(k)===`true`}catch{return!1}}function K(){if(F())try{sessionStorage.setItem(k,`true`)}catch{}}async function q(){if(!V()||G())return;let e=await R();e&&(e.capture(`canvas_new_session`,{is_first_use:!H()}),K())}async function J(e,t={}){if(!V())return;let n=await R();n&&n.capture(e,t)}async function Y(){if(F())try{localStorage.removeItem(D),localStorage.removeItem(O),sessionStorage.removeItem(k),N&&P&&P.reset()}catch{}}function X(){let[e,t]=(0,T.useState)(()=>z()),n=(0,T.useRef)(!1);(0,T.useEffect)(()=>{n.current||(n.current=!0,W())},[]),(0,T.useEffect)(()=>{e===`granted`&&q()},[e]);let r=(0,T.useCallback)(async()=>{await B(`granted`),t(`granted`)},[]),i=(0,T.useCallback)(async()=>{await B(`denied`),t(`denied`)},[]),a=(0,T.useCallback)((t,n)=>{e===`granted`&&J(t,n)},[e]),o=(0,T.useCallback)(()=>{Y(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var Z=l();function Q({onChoice:e}){let{t,ready:n}=d(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=X(),[o,s]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,Z.jsx)(v,{"aria-label":t(u.TELEMETRY$CONSENT_TITLE),children:(0,Z.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,Z.jsxs)(y,{className:`border border-[var(--oh-border)]`,children:[(0,Z.jsx)(x,{title:t(u.TELEMETRY$CONSENT_TITLE)}),(0,Z.jsx)(b,{children:t(u.TELEMETRY$CONSENT_DESCRIPTION)}),(0,Z.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,Z.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(u.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,Z.jsx)(S,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(u.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function ne(){return T.useEffect(()=>{te(w())},[]),null}var re=T.lazy(()=>n(()=>import(`./manage-backends-modal-l7RkKfwX.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,31]))),ie=T.lazy(()=>n(()=>import(`./api-key-entry-screen-B2gynaCp.js`),__vite__mapDeps([32,1,3,33,8,14,15,9,34,4,16,17,6,5,7,18,19,20,21,22,23,24,25,26,27,28,29,30])));function ae({children:e}){return(0,Z.jsxs)(`html`,{lang:`en`,children:[(0,Z.jsxs)(`head`,{children:[(0,Z.jsx)(`meta`,{charSet:`utf-8`}),(0,Z.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,Z.jsx)(i,{}),(0,Z.jsx)(c,{})]}),(0,Z.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,Z.jsxs)(f,{contentClassName:`min-h-screen`,children:[(0,Z.jsx)(ne,{}),e,(0,Z.jsx)(p,{toastOptions:m}),(0,Z.jsx)(Q,{}),(0,Z.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,Z.jsx)(s,{}),(0,Z.jsx)(o,{})]})]})}function $(){return(0,Z.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,Z.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,Z.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,Z.jsx)(ee,{size:`large`})})})})}function oe(){let e=T.useCallback(()=>{},[]);return(0,Z.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,Z.jsx)(T.Suspense,{fallback:null,children:(0,Z.jsx)(re,{onClose:e})})})}var se=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],ce=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],le=r(function(){let e=h(),t=C({enabled:!e});return e||_(t.error)?(0,Z.jsx)(T.Suspense,{fallback:(0,Z.jsx)($,{}),children:(0,Z.jsx)(ie,{})}):t.isPending||t.isLoading?(0,Z.jsx)($,{}):g(t.error)?(0,Z.jsx)(oe,{}):(0,Z.jsx)(a,{})});export{ae as Layout,le as default,se as links,ce as meta};