@openhands/agent-canvas 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +17 -6
- package/build/assets/{add-backend-modal-KMmPQNZU.js → add-backend-modal-FsnpTTgO.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-DSl9G5UR.js → agent-server-conversation-service.api-BZmUqtiO.js} +1 -1
- package/build/assets/{automation-detail-g5-RZ0da.js → automation-detail-R-99FUce.js} +1 -1
- package/build/assets/{automations-list-DHoq_0MM.js → automations-list-Dfu2c-_D.js} +1 -1
- package/build/assets/backend-form-modal-DxYjqqAK.js +1 -0
- package/build/assets/browser-HrYc5Gce.js +5 -0
- package/build/assets/conversation--ldUK72N.js +19 -0
- package/build/assets/conversation-eNrhH94O.js +1 -0
- package/build/assets/conversation-panel-B49Jpqpb.js +1 -0
- package/build/assets/{conversation-service.api-C8pYCyV6.js → conversation-service.api--f8WglOC.js} +1 -1
- package/build/assets/conversation-websocket-context-BW68-J8o.js +3 -0
- package/build/assets/{entry.client-D9uR9Blz.js → entry.client-CqqXOSvd.js} +2 -2
- package/build/assets/{files-tab-B3A1NDlZ.js → files-tab-CQHdWpQt.js} +1 -1
- package/build/assets/git-control-bar-branch-button-C8u5rzjc.js +27 -0
- package/build/assets/{git-provider-icon-DYE9n7fs.js → git-provider-icon-D-a-rcLm.js} +1 -1
- package/build/assets/{home-dIzxi5Dd.js → home-DD0GroCu.js} +1 -1
- package/build/assets/{launch-hZ0ifhcV.js → launch-B2mbfOSm.js} +1 -1
- package/build/assets/llm-settings-BEyqixPI.js +1 -0
- package/build/assets/{llm-settings-CcHqGOYL.js → llm-settings-BdiaGFbg.js} +1 -1
- package/build/assets/{manage-backends-modal-rYeyGx7j.js → manage-backends-modal-s22zCdEW.js} +1 -1
- package/build/assets/{manifest-97e839da.js → manifest-9d1c34fb.js} +1 -1
- package/build/assets/{messages-T2ewVkbp.js → messages-6aOyUu3r.js} +1 -1
- package/build/assets/{path-utils-CqJboYxo.js → path-utils-BVbe598W.js} +1 -1
- package/build/assets/{planner-tab-BrntFmb1.js → planner-tab-bN6r1G-1.js} +1 -1
- package/build/assets/{recommended-automations-launcher-BI9NhG8Y.js → recommended-automations-launcher-mJhK6Atl.js} +1 -1
- package/build/assets/{root-BS1Td78t.js → root-3t9rxEpE.js} +2 -2
- package/build/assets/{root-layout-BLjAEgle.js → root-layout-BjVwHmta.js} +2 -2
- package/build/assets/{shared-conversation-a0QV8o99.js → shared-conversation-EZV0FRIf.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DTUNI1WQ.js → sidebar-mobile-menu-toggle-BnbzzpQl.js} +1 -1
- package/build/assets/{skills-settings-DOnMn9q1.js → skills-settings-CG2hu34D.js} +1 -1
- package/build/assets/{task-list-tab-Day9nhRT.js → task-list-tab-465DDju0.js} +1 -1
- package/build/assets/{terminal-ro4SNjUU.js → terminal-CcgBEVnC.js} +1 -1
- package/build/assets/{use-active-conversation-D15D9GgR.js → use-active-conversation-DS5j9R4q.js} +1 -1
- package/build/assets/{use-agent-state-DE5dlEXJ.js → use-agent-state-D2C9SeGw.js} +1 -1
- package/build/assets/{use-create-conversation-DW7AGgLA.js → use-create-conversation-BEZg__Vv.js} +1 -1
- package/build/assets/{use-event-store-CQZCcVz-.js → use-event-store-BT_gV3ut.js} +1 -1
- package/build/assets/{use-handle-plan-click-DpgEQDAV.js → use-handle-plan-click-uOpew2LO.js} +1 -1
- package/build/assets/{use-runtime-is-ready-XFbT16BD.js → use-runtime-is-ready-pGSbPddC.js} +1 -1
- package/build/assets/{use-skills-Xe0vjPMt.js → use-skills-BIvlWblA.js} +1 -1
- package/build/assets/{use-task-list-Bs90uF2N.js → use-task-list-DDeNHprj.js} +1 -1
- package/build/assets/{use-unified-vscode-url-BOsIOd-b.js → use-unified-vscode-url-wAMzv8Sn.js} +1 -1
- package/build/assets/{use-user-conversation-Mc0mQgkl.js → use-user-conversation-B_zDoSeh.js} +1 -1
- package/build/assets/{vscode-tab-C0ShhiSU.js → vscode-tab-B0vdh9gU.js} +1 -1
- package/build/index.html +4 -4
- package/dist/api/agent-server-adapter.cjs +1 -1
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.js +1 -0
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/skills-service.cjs +1 -1
- package/dist/api/skills-service.cjs.map +1 -1
- package/dist/api/skills-service.d.ts +1 -1
- package/dist/api/skills-service.js +2 -2
- package/dist/api/skills-service.js.map +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.js +149 -142
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
- package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
- package/dist/components/features/conversation-panel/skills-modal.js +1 -1
- package/dist/components/features/conversation-panel/skills-modal.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 +97 -89
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/chat/use-slash-command.cjs +1 -1
- package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
- package/dist/hooks/chat/use-slash-command.js +1 -1
- package/dist/hooks/chat/use-slash-command.js.map +1 -1
- package/dist/hooks/query/use-conversation-skills.cjs +2 -0
- package/dist/hooks/query/use-conversation-skills.cjs.map +1 -0
- package/dist/hooks/query/use-conversation-skills.d.ts +7 -0
- package/dist/hooks/query/use-conversation-skills.js +8 -0
- package/dist/hooks/query/use-conversation-skills.js.map +1 -0
- package/dist/hooks/query/use-skills.cjs +1 -1
- package/dist/hooks/query/use-skills.cjs.map +1 -1
- package/dist/hooks/query/use-skills.d.ts +6 -1
- package/dist/hooks/query/use-skills.js +3 -3
- package/dist/hooks/query/use-skills.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/conversation.cjs +1 -1
- package/dist/routes/conversation.cjs.map +1 -1
- package/dist/routes/conversation.js +61 -63
- package/dist/routes/conversation.js.map +1 -1
- package/dist/stores/use-event-store.cjs +1 -1
- package/dist/stores/use-event-store.cjs.map +1 -1
- package/dist/stores/use-event-store.d.ts +22 -0
- package/dist/stores/use-event-store.js +9 -1
- package/dist/stores/use-event-store.js.map +1 -1
- package/dist/ui/context-menu.d.ts +1 -1
- package/dist/ui/help-link.d.ts +1 -1
- package/package.json +3 -3
- package/scripts/dev-safe.mjs +35 -17
- package/scripts/dev-with-automation.mjs +24 -49
- package/build/assets/backend-form-modal-K6IMCr3p.js +0 -1
- package/build/assets/browser-DKG63inJ.js +0 -5
- package/build/assets/conversation-BD5WemJI.js +0 -19
- package/build/assets/conversation-C47K62n8.js +0 -1
- package/build/assets/conversation-panel-Dn-S56Gk.js +0 -1
- package/build/assets/conversation-websocket-context-Ywrxd_9p.js +0 -3
- package/build/assets/git-control-bar-branch-button-CcIpmyfM.js +0 -27
- package/build/assets/llm-settings-2036m7Wt.js +0 -1
- /package/build/assets/{link-external-Df8J52xI.js → link-external-C9d6Fo3x.js} +0 -0
- /package/build/assets/{use-llm-profiles-D3-KXwQ0.js → use-llm-profiles-O4a9V6RC.js} +0 -0
|
@@ -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-CqJboYxo.js";import{t as r}from"./useMutation-B4OUESdw.js";import{o as i,t as a}from"./declaration-D378OjpZ.js";import{t as o}from"./Trans-1j65oy9O.js";import{t as s}from"./useTranslation-CpIcQBq6.js";import{a as c}from"./i18n-DjAGhTis.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-Ywrxd_9p.js";import{T as g,_,t as v}from"./utils-D-HX7JCe.js";import{t as y}from"./use-config-BSu_53GL.js";import{t as ee}from"./styled-tooltip-CS3mB_1X.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-ZyAO5dyK.js";import{t as ae}from"./close-BdmyeRqS.js";import{n as S,t as oe}from"./use-conversation-id-DajhCn2A.js";import{t as se}from"./use-active-conversation-D15D9GgR.js";import{t as ce}from"./use-agent-state-DE5dlEXJ.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-CQZCcVz-.js";import{r as O}from"./typography-vVUMoNUg.js";import{t as k}from"./lesson-plan-DRYG5SLI.js";import{n as fe,t as A}from"./markdown-renderer-CEX4Becj.js";import{t as pe}from"./u-check-circle-DplbarS5.js";import{n as me,r as he,t as ge}from"./plan-components-DEjMuDDG.js";import{n as _e,t as ve}from"./u-check-circle-half-yDuiSZHC.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-BVbe598W.js";import{t as r}from"./useMutation-B4OUESdw.js";import{o as i,t as a}from"./declaration-D378OjpZ.js";import{t as o}from"./Trans-1j65oy9O.js";import{t as s}from"./useTranslation-CpIcQBq6.js";import{a as c}from"./i18n-DjAGhTis.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-BW68-J8o.js";import{T as g,_,t as v}from"./utils-D-HX7JCe.js";import{t as y}from"./use-config-BSu_53GL.js";import{t as ee}from"./styled-tooltip-CS3mB_1X.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-ZyAO5dyK.js";import{t as ae}from"./close-BdmyeRqS.js";import{n as S,t as oe}from"./use-conversation-id-DajhCn2A.js";import{t as se}from"./use-active-conversation-DS5j9R4q.js";import{t as ce}from"./use-agent-state-D2C9SeGw.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-vVUMoNUg.js";import{t as k}from"./lesson-plan-DRYG5SLI.js";import{n as fe,t as A}from"./markdown-renderer-CEX4Becj.js";import{t as pe}from"./u-check-circle-DplbarS5.js";import{n as me,r as he,t as ge}from"./plan-components-DEjMuDDG.js";import{n as _e,t as ve}from"./u-check-circle-half-yDuiSZHC.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~b4cctr4k-B7YVdv1X.js";import{d as n,n as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-CyUbhpbm.js";import{t as i}from"./createLucideIcon-Ddu8jDOQ.js";import{c as a,t as o}from"./agent-server-client-options-DT2GP6VJ.js";import{r as s,s as c,t as l}from"./agent-server-conversation-service.api-
|
|
1
|
+
import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~b4cctr4k-B7YVdv1X.js";import{d as n,n as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-CyUbhpbm.js";import{t as i}from"./createLucideIcon-Ddu8jDOQ.js";import{c as a,t as o}from"./agent-server-client-options-DT2GP6VJ.js";import{r as s,s as c,t as l}from"./agent-server-conversation-service.api-BZmUqtiO.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 s(r),{success:!0}}return new c(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new c(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new c(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-D378OjpZ.js";import{t as i}from"./useTranslation-CpIcQBq6.js";import{t as a}from"./brand-button-C2nEKopC.js";import{t as o}from"./conversation-store-Z5iMCRpc.js";import{t as s}from"./lesson-plan-DRYG5SLI.js";import{t as c}from"./use-handle-plan-click-
|
|
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-D378OjpZ.js";import{t as i}from"./useTranslation-CpIcQBq6.js";import{t as a}from"./brand-button-C2nEKopC.js";import{t as o}from"./conversation-store-Z5iMCRpc.js";import{t as s}from"./lesson-plan-DRYG5SLI.js";import{t as c}from"./use-handle-plan-click-uOpew2LO.js";import{t as l}from"./markdown-renderer-CEX4Becj.js";import{n as u,r as d}from"./plan-components-DEjMuDDG.js";import{t as f}from"./conversation-tab-empty-state-D8dNvo-V.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-D378OjpZ.js";import{t as i}from"./use-is-creating-conversation-DhDeeWfA.js";import{t as a}from"./useTranslation-CpIcQBq6.js";import{r as o}from"./vendor~home~mcp~automations-list-C5PoHCy6.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-qs8Va1cC.js";import{t as p}from"./utils-D-HX7JCe.js";import{n as m}from"./active-backend-context-TVbjnvmP.js";import{n as h}from"./navigation-context-DeIPtGPp.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-DQ7Oo1Hj.js";import{t as x}from"./use-create-conversation-
|
|
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-D378OjpZ.js";import{t as i}from"./use-is-creating-conversation-DhDeeWfA.js";import{t as a}from"./useTranslation-CpIcQBq6.js";import{r as o}from"./vendor~home~mcp~automations-list-C5PoHCy6.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-qs8Va1cC.js";import{t as p}from"./utils-D-HX7JCe.js";import{n as m}from"./active-backend-context-TVbjnvmP.js";import{n as h}from"./navigation-context-DeIPtGPp.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-DQ7Oo1Hj.js";import{t as x}from"./use-create-conversation-BEZg__Vv.js";import{c as S,f as C,i as w,m as T,o as E,t as D,u as O}from"./install-server-modal-z5VaHeXd.js";import{n as k}from"./skill-card-pill-row-tZ599jli.js";import{t as A}from"./clock-ZR4Kn-_Y.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.
|
|
@@ -1,2 +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-
|
|
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-D378OjpZ.js";import{t as d}from"./useTranslation-CpIcQBq6.js";import{r as f}from"./providers-DXvCAN_u.js";import{i as p,t as m}from"./custom-toast-handlers-BOc3qeQ7.js";import{n as h}from"./agent-server-compatibility-2aOx5iWd.js";import{t as g}from"./modal-backdrop-DTYGVmOR.js";import{n as _}from"./modal-body-YElmM1dV.js";import{n as v,r as y}from"./base-modal-CQRvRHu1.js";import{t as b}from"./brand-button-C2nEKopC.js";import{t as x}from"./loading-spinner-C04FGh14.js";import{t as S}from"./use-config-BSu_53GL.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.8`,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#39711065f53166c52608462f60a4c8507253ce56`,"@openhands/typescript-client":`1.24.0`,"@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: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`}},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-rYeyGx7j.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=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],ae=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],oe=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,oe as default,ie as links,ae as meta};
|
|
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-s22zCdEW.js","assets/agent-server-client-options-DT2GP6VJ.js","assets/server-client-C3mC8Hl3.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-CyUbhpbm.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~b4cctr4k-B7YVdv1X.js","assets/QueryClientProvider-B7kl84Kj.js","assets/declaration-D378OjpZ.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-CpIcQBq6.js","assets/context-CEQZwATj.js","assets/backend-form-modal-DxYjqqAK.js","assets/organization-service.api-COwMPFg5.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~pfbaerbd-zhv9fooy.js","assets/proxy-CurRmrqf.js","assets/health-store-BDC2rM-X.js","assets/brand-button-C2nEKopC.js","assets/utils-D-HX7JCe.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i9dbt75i-CI82Did1.js","assets/settings-input-DBywAnA7.js","assets/modal-backdrop-DTYGVmOR.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-YElmM1dV.js","assets/modal-close-button-C_GpQt9F.js","assets/navigation-context-DeIPtGPp.js","assets/active-backend-context-TVbjnvmP.js","assets/confirmation-modal-C9-La0h3.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-D378OjpZ.js";import{t as d}from"./useTranslation-CpIcQBq6.js";import{r as f}from"./providers-DXvCAN_u.js";import{i as p,t as m}from"./custom-toast-handlers-BOc3qeQ7.js";import{n as h}from"./agent-server-compatibility-2aOx5iWd.js";import{t as g}from"./modal-backdrop-DTYGVmOR.js";import{n as _}from"./modal-body-YElmM1dV.js";import{n as v,r as y}from"./base-modal-CQRvRHu1.js";import{t as b}from"./brand-button-C2nEKopC.js";import{t as x}from"./loading-spinner-C04FGh14.js";import{t as S}from"./use-config-BSu_53GL.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.9`,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: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`}},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-s22zCdEW.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])));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=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],ae=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],oe=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,oe as default,ie as links,ae as meta};
|