@openhands/agent-canvas 1.7.1 → 1.7.2

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 (107) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{active-backend-context-B9942JGX.js → active-backend-context-BlZPzZNU.js} +1 -1
  4. package/build/assets/{agent-context-settings-BwAakl29.js → agent-context-settings-CTaN-Iw9.js} +1 -1
  5. package/build/assets/{agent-profiles-settings-BYU6aWus.js → agent-profiles-settings-CR4VTqv_.js} +1 -1
  6. package/build/assets/{agent-server-conversation-service.api-D7qh9amG.js → agent-server-conversation-service.api-Btmi4q6d.js} +3 -3
  7. package/build/assets/{agent-settings-DEPFl5hR.js → agent-settings-BIOsUglV.js} +1 -1
  8. package/build/assets/agent-settings-KQs-occT.js +1 -0
  9. package/build/assets/{api-key-entry-screen-B2kVLRDQ.js → api-key-entry-screen-BhR24gkM.js} +1 -1
  10. package/build/assets/{app-settings-B92bjTei.js → app-settings-Bs4sY8WP.js} +1 -1
  11. package/build/assets/{automation-detail-DoVSHQLs.js → automation-detail-CwDnJbYR.js} +1 -1
  12. package/build/assets/{automation-export-Ca2ehC-k.js → automation-export-Bu-r-EzL.js} +1 -1
  13. package/build/assets/{automations-list-ZHQSW8qD.js → automations-list-CYw7_6FR.js} +1 -1
  14. package/build/assets/{backend-form-modal-C0CIsQvd.js → backend-form-modal-Ce-KRHOJ.js} +1 -1
  15. package/build/assets/{backend-synced-settings-badge-DdUfuSN8.js → backend-synced-settings-badge-BNpEylNP.js} +1 -1
  16. package/build/assets/{badge-B6q3sVom.js → badge-DwgrwohM.js} +1 -1
  17. package/build/assets/{browser-tab-Cir7KbAL.js → browser-tab-CEApjoEV.js} +1 -1
  18. package/build/assets/client-source-1v-kWLNU.js +1 -0
  19. package/build/assets/{cloud-funnel-analytics-CnCkPgQa.js → cloud-funnel-analytics-CasMM7EO.js} +1 -1
  20. package/build/assets/{condenser-settings-jNGOKFGz.js → condenser-settings-Czi8cKxV.js} +1 -1
  21. package/build/assets/conversation-C25pc2dT.js +1 -0
  22. package/build/assets/{conversation-DceG4LFS.js → conversation-CObLYSJd.js} +3 -3
  23. package/build/assets/conversation-panel-C25pc2dT.js +1 -0
  24. package/build/assets/{conversation-state-store-BORusMiV.js → conversation-state-store-DTq4hFoP.js} +1 -1
  25. package/build/assets/{entry.client-CCrlta8r.js → entry.client-DETaouwO.js} +1 -1
  26. package/build/assets/{extensions-hub-B2WudOET.js → extensions-hub-BKftOQ-X.js} +1 -1
  27. package/build/assets/{extensions-navigation-CYjIM65d.js → extensions-navigation-DF24q1H1.js} +1 -1
  28. package/build/assets/{files-tab-LSBijbEi.js → files-tab-SAiFCnS5.js} +1 -1
  29. package/build/assets/{git-provider-icon-DeQUgZVE.js → git-provider-icon-BREx-yUX.js} +1 -1
  30. package/build/assets/home-EPNFgzUh.js +1 -0
  31. package/build/assets/{home-BZclW6kd.js → home-sN90Xcxp.js} +1 -1
  32. package/build/assets/index-home-EPNFgzUh.js +1 -0
  33. package/build/assets/{install-server-modal-xCf76eim.js → install-server-modal-BI8yUfmr.js} +1 -1
  34. package/build/assets/{launch-Bik37u9Y.js → launch-Ccnhte5b.js} +1 -1
  35. package/build/assets/{llm-not-configured-banner-znJFsW_O.js → llm-not-configured-banner-DTWzISnk.js} +1 -1
  36. package/build/assets/llm-settings-BXk5_Pac.js +1 -0
  37. package/build/assets/{llm-settings-BYo9SN0I.js → llm-settings-C1vpgWam.js} +1 -1
  38. package/build/assets/{llm-subscription-service-_QUsVybQ.js → llm-subscription-service-W5BprsNA.js} +1 -1
  39. package/build/assets/{manage-backends-modal-n6PtHOER.js → manage-backends-modal-DhflyGTf.js} +1 -1
  40. package/build/assets/{manifest-e9bbad7b.js → manifest-8082e879.js} +1 -1
  41. package/build/assets/{markdown-renderer-Dkmjmx_d.js → markdown-renderer-CvOO0YIr.js} +1 -1
  42. package/build/assets/{mcp-BJUOnO6v.js → mcp-CxLPda-W.js} +1 -1
  43. package/build/assets/{messages-CYztjKLQ.js → messages-DINDkPNK.js} +1 -1
  44. package/build/assets/{onboarding-9pEMFGtN.js → onboarding-BegDrOKn.js} +1 -1
  45. package/build/assets/{onboarding-modal-dYsjXJwx.js → onboarding-modal-DdvE6rzw.js} +1 -1
  46. package/build/assets/{organization-service.api-HsxJhNCf.js → organization-service.api-CT2OQlLz.js} +1 -1
  47. package/build/assets/{planner-tab-Dr8B-ZBI.js → planner-tab-w6HT0N_A.js} +1 -1
  48. package/build/assets/{plugins-management-service-DEjBqDoT.js → plugins-management-service-DVkoM3eA.js} +1 -1
  49. package/build/assets/{profiles-service.api-BddMsEhq.js → profiles-service.api-CBafmAPO.js} +1 -1
  50. package/build/assets/{providers-BxJi3BMO.js → providers-9UzRB9mT.js} +1 -1
  51. package/build/assets/{proxy-CN3HaaOW.js → proxy-C79PCMjo.js} +1 -1
  52. package/build/assets/{recommended-automations-launcher-Dye8Li08.js → recommended-automations-launcher-BF2mtAKw.js} +1 -1
  53. package/build/assets/{root-D4hpCAq9.js → root-Sj7W28yE.js} +2 -2
  54. package/build/assets/{root-layout-a4-4sfbh.js → root-layout-DbhKVoc7.js} +3 -3
  55. package/build/assets/{schema-field-CZSs0hQP.js → schema-field-CV6bFnoL.js} +1 -1
  56. package/build/assets/{sdk-section-page-Di5mT86Y.js → sdk-section-page-BW-i45yr.js} +1 -1
  57. package/build/assets/{secrets-service-i4CCd-UN.js → secrets-service-BjK-bPN2.js} +1 -1
  58. package/build/assets/{secrets-settings-DPlA3moO.js → secrets-settings-D7U1ErCH.js} +1 -1
  59. package/build/assets/{settings-SHSt9Rq2.js → settings-Bj5Oo45A.js} +1 -1
  60. package/build/assets/{settings-index-D5dDKrDt.js → settings-index-COAdxm2Q.js} +1 -1
  61. package/build/assets/{settings-modal-DsJk2THd.js → settings-modal-CFnbQ8_4.js} +1 -1
  62. package/build/assets/{settings-service.api-i_HHIqJP.js → settings-service.api-DryhKdSr.js} +1 -1
  63. package/build/assets/{shared-conversation-DU1kwDTF.js → shared-conversation-CnMxy7p_.js} +1 -1
  64. package/build/assets/{sidebar-mobile-menu-toggle-BlmI8OrA.js → sidebar-mobile-menu-toggle-U78hQRJ1.js} +1 -1
  65. package/build/assets/{skills-plugins-YJSV6A0M.js → skills-plugins-BPhaNpfx.js} +1 -1
  66. package/build/assets/{skills-settings-BbREHv_-.js → skills-settings-CcwMtnnJ.js} +1 -1
  67. package/build/assets/{task-list-tab-Dzim5ftn.js → task-list-tab-BmaTwjaS.js} +1 -1
  68. package/build/assets/{telemetry-B-2fXtqV.js → telemetry-cmCL3o6Z.js} +1 -1
  69. package/build/assets/{terminal-CYFAMiXx.js → terminal-BRcoba5B.js} +1 -1
  70. package/build/assets/{use-acp-credential-form-CuBXKNvP.js → use-acp-credential-form-B0_pZ_uS.js} +1 -1
  71. package/build/assets/{use-activate-agent-profile-CXDcjVt8.js → use-activate-agent-profile-DH33MvVj.js} +1 -1
  72. package/build/assets/{use-agent-profiles-CliaHofi.js → use-agent-profiles-Dmd_4H8q.js} +1 -1
  73. package/build/assets/{use-can-manage-org-profiles-Uai-HHx2.js → use-can-manage-org-profiles-CrG1km7R.js} +1 -1
  74. package/build/assets/{use-cloud-current-user-id-BzamKpu-.js → use-cloud-current-user-id-B6DP3s47.js} +1 -1
  75. package/build/assets/{use-config-DPEYpfIj.js → use-config-Csy8EAP9.js} +1 -1
  76. package/build/assets/{use-create-conversation-DzcM79TE.js → use-create-conversation-Dsa4nzU9.js} +1 -1
  77. package/build/assets/{use-create-secret-2YLjoQw-.js → use-create-secret-BnxuAjDt.js} +1 -1
  78. package/build/assets/{use-llm-profiles-Ci3zAVzV.js → use-llm-profiles-BMQoc612.js} +1 -1
  79. package/build/assets/{use-onboarding-completion-STApsofr.js → use-onboarding-completion-B-2BTS-y.js} +1 -1
  80. package/build/assets/{use-plugins-marketplace-CzzdrUSK.js → use-plugins-marketplace-PBc_XNz_.js} +1 -1
  81. package/build/assets/{use-save-agent-profile-Q2M72WgR.js → use-save-agent-profile-2Mk9ZX37.js} +1 -1
  82. package/build/assets/{use-save-settings-BZK7zVsK.js → use-save-settings-BRh9p_fv.js} +1 -1
  83. package/build/assets/{use-settings-BKpkUS4y.js → use-settings-DBI44RnH.js} +1 -1
  84. package/build/assets/{use-settings-nav-items-BlXge_bf.js → use-settings-nav-items-Cva28C-c.js} +1 -1
  85. package/build/assets/{use-skills-BltA9XrV.js → use-skills-RQsCtdzN.js} +1 -1
  86. package/build/assets/{use-tracking-De7qByD4.js → use-tracking-CN1nIMnY.js} +1 -1
  87. package/build/assets/{use-user-conversation-43duhf7D.js → use-user-conversation-GnGhs_Ob.js} +1 -1
  88. package/build/assets/{verification-settings-B4DL3Tez.js → verification-settings-CaCzojbc.js} +1 -1
  89. package/build/index.html +4 -4
  90. package/config/defaults.json +1 -1
  91. package/dist/config/defaults.cjs +1 -1
  92. package/dist/config/defaults.cjs.map +1 -1
  93. package/dist/config/defaults.js +1 -1
  94. package/dist/config/defaults.js.map +1 -1
  95. package/dist/package.cjs +1 -1
  96. package/dist/package.cjs.map +1 -1
  97. package/dist/package.js +6 -1
  98. package/dist/package.js.map +1 -1
  99. package/package.json +6 -1
  100. package/scripts/stryker-diff.mjs +137 -0
  101. package/build/assets/agent-settings-BbNLRtoh.js +0 -1
  102. package/build/assets/client-source-D8jWKBfE.js +0 -1
  103. package/build/assets/conversation-Do2Vg7uo.js +0 -1
  104. package/build/assets/conversation-panel-Do2Vg7uo.js +0 -1
  105. package/build/assets/home-C_R5pEbs.js +0 -1
  106. package/build/assets/index-home-C_R5pEbs.js +0 -1
  107. package/build/assets/llm-settings-BaM0zJg5.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as o}from"./useMutation-DyQXZFEF.js";import{it as s,n as c,p as l,rt as u,st as d}from"./active-backend-context-B9942JGX.js";import{t as f,z as p}from"./utils-qjs_KuS4.js";import{t as m}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{t as h}from"./puzzle-DXWdfaa7.js";import{t as g}from"./search-sKuYKllf.js";import{t as _}from"./trash-2-Bq4lHbTB.js";import{t as v}from"./x-EjvKGawc.js";import{a as y,c as b,i as x,l as S,o as C,s as w,t as T,u as E}from"./settings-service.api-i_HHIqJP.js";import{n as D}from"./use-settings-BKpkUS4y.js";import{t as O}from"./modal-backdrop-X-vKo61e.js";import{n as k}from"./modal-classes-YaEEa5eZ.js";import{l as A}from"./form-control-classes-CSPevi7c.js";import{t as j}from"./brand-button-CQO8oqVo.js";import{t as M}from"./modal-close-button-turIYn0t.js";import{n as N,t as P}from"./settings-input-BjW_zyTN.js";import{t as F}from"./confirmation-modal-gZtbojCm.js";import{t as I}from"./settings-dropdown-input-Dx6vlkgf.js";import{a as L,n as R,o as z,r as B,t as V}from"./extension-module-card-classes-Bo43vY5V.js";import{C as ee,S as H,_ as U,a as W,b as G,c as K,d as q,f as J,h as Y,i as X,l as te,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le,v as ue,x as de}from"./install-server-modal-xCf76eim.js";import{n as fe}from"./circle-plus-check-toggle-E3Ecb_gg.js";import{n as pe}from"./extensions-navigation-CYjIM65d.js";import{t as me}from"./enum-filter-dropdown-paB-lFSP.js";import{n as he}from"./settings-like-page-layout-classes-DyxyJ0k4.js";var Z=e(t(),1);function ge(){let e=i(),{data:t}=D();return o({mutationFn:async e=>{let n=x(t?.agent_settings?.mcp_config),r={sse_servers:[...n.sse_servers],stdio_servers:[...n.stdio_servers],shttp_servers:[...n.shttp_servers]},i=e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`&&`url`in e){let t=e.url;return typeof t==`string`?t:void 0}};if(e.type===`sse`){if(!e.url)return;let t=r.sse_servers.findIndex(t=>i(t)===e.url);t>=0&&r.sse_servers.splice(t,1)}else if(e.type===`shttp`){if(!e.url)return;let t=r.shttp_servers.findIndex(t=>i(t)===e.url);t>=0&&r.shttp_servers.splice(t,1)}else if(e.type===`stdio`){if(!e.name||!e.command)return;let t=r.stdio_servers.findIndex(t=>t.name===e.name&&t.command===e.command&&JSON.stringify(t.args??[])===JSON.stringify(e.args??[]));t>=0&&r.stdio_servers.splice(t,1)}else return;await T.saveSettings({agent_settings_diff:{mcp_config:b(r)}})},onSuccess:(t,n)=>{K(q(n)),e.invalidateQueries({queryKey:l.personal()})}})}function _e(e){return e.name?.trim()||void 0}function ve(e,t){let n=_e(e);return n&&n!==t?.id?n:t?.name?t.name:e.type===`stdio`?n??e.command??``:e.url??``}function ye(){let e=i(),{data:t}=D();return o({mutationFn:async({serverId:e,server:n})=>{let r=x(t?.agent_settings?.mcp_config),i={sse_servers:[...r.sse_servers],stdio_servers:[...r.stdio_servers],shttp_servers:[...r.shttp_servers]},a=await ae(n),[o,s]=e.split(`-`),c=parseInt(s,10);o===`sse`?i.sse_servers[c]=C(a):o===`stdio`?i.stdio_servers[c]=w(a):o===`shttp`&&(i.shttp_servers[c]=y(a)),await T.saveSettings({agent_settings_diff:{mcp_config:b(i)}})},onSuccess:(t,n)=>{K(q(n.server)),e.invalidateQueries({queryKey:l.personal()})}})}var be={status:`unchecked`};function xe(e){let t=q(e),n=Z.useSyncExternalStore(le,()=>te()[t]??be),r=Z.useRef(e);return r.current=e,{health:n,probe:Z.useCallback(()=>W(r.current),[]),reauthorize:Z.useCallback(()=>ie(r.current),[])}}var Q=n(),Se={unchecked:`bg-[var(--oh-text-tertiary)]`,checking:`bg-[var(--oh-interactive-selected)] animate-pulse`,healthy:`bg-[var(--oh-status-success)]`,failed:`bg-red-500`},$=`text-xs text-[var(--oh-muted)] underline transition-colors hover:text-white disabled:cursor-not-allowed disabled:opacity-60`;function Ce(e){return e.status===`healthy`?e.verification===`verified`?`healthy`:`healthy-connectivity`:e.status}function we(e,t){switch(t.status){case`checking`:return e(p.MCP$HEALTH_STATUS_CHECKING);case`healthy`:return t.verification===`verified`?e(p.MCP$HEALTH_STATUS_VERIFIED,{count:t.toolCount}):e(p.MCP$HEALTH_STATUS_CONNECTIVITY_ONLY);case`failed`:return re(e,t.kind,t.error);default:return e(p.MCP$HEALTH_STATUS_UNCHECKED)}}function Te({server:e,catalog:t,onEdit:n}){let{t:r}=a(`openhands`),{backend:i}=c(),{health:o,probe:s,reauthorize:l}=xe(e),{mutate:m}=ye();if(i.kind===`cloud`)return null;let h=o.status===`checking`,g=o.status===`failed`,_=we(r,o),v=async()=>{let t=await l();if(!t?.ok||!t.oauth_state||e.auth?.strategy!==`oauth2`)return;let n={...e,auth:{...e.auth,state:t.oauth_state}};m({serverId:e.id,server:n},{onSuccess:()=>se(n,t,[]),onError:e=>u(d(e)||r(p.ERROR$GENERIC))})};return(0,Q.jsxs)(`div`,{"data-testid":`mcp-server-health-${e.id}`,role:`presentation`,className:`flex flex-col gap-1.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{"data-testid":`mcp-health-dot`,"data-status":Ce(o),"aria-hidden":`true`,className:f(`inline-block h-2 w-2 shrink-0 rounded-full`,Se[o.status])}),(0,Q.jsx)(`p`,{"data-testid":`mcp-health-label-${e.id}`,className:f(`line-clamp-2 break-words text-xs`,g?`text-red-500`:`text-tertiary-alt`),title:_,children:_})]}),o.status===`healthy`&&o.verification===`connectivity-only`?(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(p.MCP$HEALTH_CONNECTIVITY_ONLY_HINT)}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-probe-${e.id}`,className:$,onClick:()=>void s(),disabled:h,children:r(g?p.MCP$HEALTH_RETRY:p.MCP$TEST_BUTTON)}),g&&o.kind===`credentials`?(0,Q.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-update-credentials-${e.id}`,className:$,onClick:n,children:r(p.MCP$HEALTH_UPDATE_CREDENTIALS)}):null,g&&e.auth?.strategy===`oauth2`?(0,Q.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-reauthorize-${e.id}`,className:$,onClick:()=>void v(),children:r(p.MCP$HEALTH_REAUTHORIZE)}):null,g&&t?.docsUrl?(0,Q.jsx)(`a`,{href:t.docsUrl,target:`_blank`,rel:`noreferrer`,className:$,children:r(p.MCP$VIEW_DOCS)}):null]})]})}function Ee(e){switch(e){case`sse`:return`SSE`;case`shttp`:return`HTTP`;case`stdio`:return`STDIO`;default:return e}}function De(e){if(e.type===`stdio`){let t=e.args&&e.args.length>0?` ${e.args.join(` `)}`:``;return`${e.command??``}${t}`.trim()}return e.url??``}function Oe({server:e,onEdit:t,onDelete:n}){let{t:r}=a(`openhands`),i=Y(e,G(m)),o=ve(e,i),s=De(e),c=Ee(e.type);return(0,Q.jsx)(`div`,{"data-testid":`mcp-server-item`,"data-server-id":e.id,role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"aria-label":r(p.MCP$EDIT_SERVER_ARIA,{name:o}),className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,L,B),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(ne,{entry:i,fallback:(0,Q.jsx)(h,{strokeWidth:2.25})}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,title:o,children:o}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:c})]}),(0,Q.jsx)(fe,{testId:`mcp-installed-toggle-${e.id}`,isSelected:!0,onToggle:e=>{e||n()},enableLabelKey:p.MCP$TOGGLE_ADD_SERVER,disableLabelKey:p.MCP$TOGGLE_REMOVE_SERVER})]}),i?.description?(0,Q.jsx)(`p`,{"data-testid":`mcp-server-description-${e.id}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:i.description}):null,s?(0,Q.jsx)(`p`,{"data-testid":`mcp-server-detail-${e.id}`,className:`truncate text-xs text-tertiary-alt`,title:s,children:s}):null,(0,Q.jsx)(Te,{server:e,catalog:i,onEdit:t})]})]})})}function ke({servers:e,hasAnyInstalled:t,query:n=``,onEdit:r,onDelete:i}){let{t:o}=a(`openhands`);return e.length===0?t&&n.trim().length>0?(0,Q.jsx)(`div`,{"data-testid":`mcp-installed-empty-search`,className:`rounded-xl border border-[var(--oh-border)] p-6 text-center`,children:(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:o(p.MCP$SEARCH_EMPTY)})}):(0,Q.jsxs)(`div`,{"data-testid":`mcp-installed-empty`,className:z,children:[(0,Q.jsx)(`p`,{className:`text-sm text-white`,children:o(p.MCP$INSTALLED_EMPTY_TITLE)}),(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light mt-1`,children:o(p.MCP$INSTALLED_EMPTY_HINT)})]}):(0,Q.jsx)(`div`,{className:R,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:V,children:e.map(e=>(0,Q.jsx)(Oe,{server:e,onEdit:()=>r(e),onDelete:()=>i(e.id)},e.id))})})}function Ae({entry:e,onClick:t,onAdd:n}){let r=U(e),i=(()=>{switch(r?.kind){case`stdio`:return`STDIO`;case`shttp`:return`HTTP`;case`sse`:return`SSE`;default:return``}})();return(0,Q.jsx)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"data-testid":`mcp-marketplace-card-${e.id}`,className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,L,B),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(ne,{entry:e}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:i})]}),(0,Q.jsx)(fe,{testId:`mcp-marketplace-toggle-${e.id}`,isSelected:!1,onToggle:e=>{e&&n()},enableLabelKey:p.MCP$TOGGLE_ADD_SERVER,disableLabelKey:p.MCP$TOGGLE_ADD_SERVER})]}),(0,Q.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})})}function je({onSelect:e,onAdd:t,query:n=``}){let{t:r}=a(`openhands`),i=ue(G(m)).filter(e=>H(e,n));return(0,Q.jsxs)(`section`,{"data-testid":`mcp-marketplace-section`,className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:r(p.MCP$LIBRARY_TITLE)}),i.length===0?(0,Q.jsx)(`div`,{"data-testid":`mcp-marketplace-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-6 text-center`,children:(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(p.MCP$SEARCH_EMPTY)})}):(0,Q.jsx)(`div`,{className:R,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:V,children:i.map(n=>(0,Q.jsx)(Ae,{entry:n,onClick:()=>e(n),onAdd:()=>t(n)},n.id))})})]})}function Me({mode:e,server:t,existingServers:n,onSubmit:r,onCancel:i,onDelete:o,isActionDisabled:s=!1,onTest:c,isTestPending:l=!1,testMessage:u=null}){let{t:d}=a(`openhands`),[m,h]=Z.useState(t?.type||`sse`),[g,v]=Z.useState(()=>t?.auth?.strategy===`oauth2`?`oauth2`:t?.auth?.strategy===`header`?`header`:t?.auth?.strategy===`bearer`||t?.auth?.strategy===`api_key`?`bearer`:`none`),[y,b]=Z.useState(()=>t?.auth?.strategy===`oauth2`?t.auth.authentication?.client_auth_method??`auto`:`auto`),[x,C]=Z.useState(null),w=Z.useRef(null),T=[{key:`sse`,label:d(p.SETTINGS$MCP_SERVER_TYPE_SSE)},{key:`stdio`,label:d(p.SETTINGS$MCP_SERVER_TYPE_STDIO)},{key:`shttp`,label:d(p.SETTINGS$MCP_SERVER_TYPE_SHTTP)}],D=[{key:`none`,label:d(p.SETTINGS$MCP_AUTH_MODE_NONE)},{key:`bearer`,label:d(p.SETTINGS$MCP_AUTH_MODE_BEARER)},{key:`header`,label:d(p.SETTINGS$MCP_AUTH_MODE_HEADER)},{key:`oauth2`,label:d(p.SETTINGS$MCP_AUTH_MODE_OAUTH)}],O=[{key:`auto`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_AUTO)},{key:`none`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_NONE)},{key:`client_secret_post`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_POST)},{key:`client_secret_basic`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_BASIC)},{key:`private_key_jwt`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_PRIVATE_KEY_JWT)}],k=e=>{if(!e)return d(p.SETTINGS$MCP_ERROR_URL_REQUIRED);try{let t=new URL(e);if(![`http:`,`https:`].includes(t.protocol))return d(p.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL)}catch{return d(p.SETTINGS$MCP_ERROR_URL_INVALID)}return null},M=e=>e?E(e)?null:d(p.SETTINGS$MCP_ERROR_NAME_INVALID):d(p.SETTINGS$MCP_ERROR_NAME_REQUIRED),F=r=>!n||!(e===`add`||e===`edit`&&t?.name!==r)?null:n.filter(e=>e.type===`stdio`).map(e=>e.name).filter(Boolean).includes(r)?d(p.SETTINGS$MCP_ERROR_NAME_DUPLICATE):null,L=e=>e?e.includes(` `)?d(p.SETTINGS$MCP_ERROR_COMMAND_NO_SPACES):null:d(p.SETTINGS$MCP_ERROR_COMMAND_REQUIRED),R=r=>{if(!n)return null;let i=t?.url;return(e===`add`||e===`edit`&&i!==r)&&n.some(e=>(e.type===`sse`||e.type===`shttp`)&&e.url===r)?d(p.SETTINGS$MCP_ERROR_URL_DUPLICATE):null},z=e=>{if(!e.trim())return null;let t=e.split(`
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as o}from"./useMutation-DyQXZFEF.js";import{it as s,n as c,p as l,rt as u,st as d}from"./active-backend-context-BlZPzZNU.js";import{t as f,z as p}from"./utils-qjs_KuS4.js";import{t as m}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{t as h}from"./puzzle-DXWdfaa7.js";import{t as g}from"./search-sKuYKllf.js";import{t as _}from"./trash-2-Bq4lHbTB.js";import{t as v}from"./x-EjvKGawc.js";import{a as y,c as b,i as x,l as S,o as C,s as w,t as T,u as E}from"./settings-service.api-DryhKdSr.js";import{n as D}from"./use-settings-DBI44RnH.js";import{t as O}from"./modal-backdrop-X-vKo61e.js";import{n as k}from"./modal-classes-YaEEa5eZ.js";import{l as A}from"./form-control-classes-CSPevi7c.js";import{t as j}from"./brand-button-CQO8oqVo.js";import{t as M}from"./modal-close-button-turIYn0t.js";import{n as N,t as P}from"./settings-input-BjW_zyTN.js";import{t as F}from"./confirmation-modal-gZtbojCm.js";import{t as I}from"./settings-dropdown-input-Dx6vlkgf.js";import{a as L,n as R,o as z,r as B,t as V}from"./extension-module-card-classes-Bo43vY5V.js";import{C as ee,S as H,_ as U,a as W,b as G,c as K,d as q,f as J,h as Y,i as X,l as te,m as ne,n as re,o as ie,p as ae,r as oe,s as se,t as ce,u as le,v as ue,x as de}from"./install-server-modal-BI8yUfmr.js";import{n as fe}from"./circle-plus-check-toggle-E3Ecb_gg.js";import{n as pe}from"./extensions-navigation-DF24q1H1.js";import{t as me}from"./enum-filter-dropdown-paB-lFSP.js";import{n as he}from"./settings-like-page-layout-classes-DyxyJ0k4.js";var Z=e(t(),1);function ge(){let e=i(),{data:t}=D();return o({mutationFn:async e=>{let n=x(t?.agent_settings?.mcp_config),r={sse_servers:[...n.sse_servers],stdio_servers:[...n.stdio_servers],shttp_servers:[...n.shttp_servers]},i=e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`&&`url`in e){let t=e.url;return typeof t==`string`?t:void 0}};if(e.type===`sse`){if(!e.url)return;let t=r.sse_servers.findIndex(t=>i(t)===e.url);t>=0&&r.sse_servers.splice(t,1)}else if(e.type===`shttp`){if(!e.url)return;let t=r.shttp_servers.findIndex(t=>i(t)===e.url);t>=0&&r.shttp_servers.splice(t,1)}else if(e.type===`stdio`){if(!e.name||!e.command)return;let t=r.stdio_servers.findIndex(t=>t.name===e.name&&t.command===e.command&&JSON.stringify(t.args??[])===JSON.stringify(e.args??[]));t>=0&&r.stdio_servers.splice(t,1)}else return;await T.saveSettings({agent_settings_diff:{mcp_config:b(r)}})},onSuccess:(t,n)=>{K(q(n)),e.invalidateQueries({queryKey:l.personal()})}})}function _e(e){return e.name?.trim()||void 0}function ve(e,t){let n=_e(e);return n&&n!==t?.id?n:t?.name?t.name:e.type===`stdio`?n??e.command??``:e.url??``}function ye(){let e=i(),{data:t}=D();return o({mutationFn:async({serverId:e,server:n})=>{let r=x(t?.agent_settings?.mcp_config),i={sse_servers:[...r.sse_servers],stdio_servers:[...r.stdio_servers],shttp_servers:[...r.shttp_servers]},a=await ae(n),[o,s]=e.split(`-`),c=parseInt(s,10);o===`sse`?i.sse_servers[c]=C(a):o===`stdio`?i.stdio_servers[c]=w(a):o===`shttp`&&(i.shttp_servers[c]=y(a)),await T.saveSettings({agent_settings_diff:{mcp_config:b(i)}})},onSuccess:(t,n)=>{K(q(n.server)),e.invalidateQueries({queryKey:l.personal()})}})}var be={status:`unchecked`};function xe(e){let t=q(e),n=Z.useSyncExternalStore(le,()=>te()[t]??be),r=Z.useRef(e);return r.current=e,{health:n,probe:Z.useCallback(()=>W(r.current),[]),reauthorize:Z.useCallback(()=>ie(r.current),[])}}var Q=n(),Se={unchecked:`bg-[var(--oh-text-tertiary)]`,checking:`bg-[var(--oh-interactive-selected)] animate-pulse`,healthy:`bg-[var(--oh-status-success)]`,failed:`bg-red-500`},$=`text-xs text-[var(--oh-muted)] underline transition-colors hover:text-white disabled:cursor-not-allowed disabled:opacity-60`;function Ce(e){return e.status===`healthy`?e.verification===`verified`?`healthy`:`healthy-connectivity`:e.status}function we(e,t){switch(t.status){case`checking`:return e(p.MCP$HEALTH_STATUS_CHECKING);case`healthy`:return t.verification===`verified`?e(p.MCP$HEALTH_STATUS_VERIFIED,{count:t.toolCount}):e(p.MCP$HEALTH_STATUS_CONNECTIVITY_ONLY);case`failed`:return re(e,t.kind,t.error);default:return e(p.MCP$HEALTH_STATUS_UNCHECKED)}}function Te({server:e,catalog:t,onEdit:n}){let{t:r}=a(`openhands`),{backend:i}=c(),{health:o,probe:s,reauthorize:l}=xe(e),{mutate:m}=ye();if(i.kind===`cloud`)return null;let h=o.status===`checking`,g=o.status===`failed`,_=we(r,o),v=async()=>{let t=await l();if(!t?.ok||!t.oauth_state||e.auth?.strategy!==`oauth2`)return;let n={...e,auth:{...e.auth,state:t.oauth_state}};m({serverId:e.id,server:n},{onSuccess:()=>se(n,t,[]),onError:e=>u(d(e)||r(p.ERROR$GENERIC))})};return(0,Q.jsxs)(`div`,{"data-testid":`mcp-server-health-${e.id}`,role:`presentation`,className:`flex flex-col gap-1.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{"data-testid":`mcp-health-dot`,"data-status":Ce(o),"aria-hidden":`true`,className:f(`inline-block h-2 w-2 shrink-0 rounded-full`,Se[o.status])}),(0,Q.jsx)(`p`,{"data-testid":`mcp-health-label-${e.id}`,className:f(`line-clamp-2 break-words text-xs`,g?`text-red-500`:`text-tertiary-alt`),title:_,children:_})]}),o.status===`healthy`&&o.verification===`connectivity-only`?(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(p.MCP$HEALTH_CONNECTIVITY_ONLY_HINT)}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-probe-${e.id}`,className:$,onClick:()=>void s(),disabled:h,children:r(g?p.MCP$HEALTH_RETRY:p.MCP$TEST_BUTTON)}),g&&o.kind===`credentials`?(0,Q.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-update-credentials-${e.id}`,className:$,onClick:n,children:r(p.MCP$HEALTH_UPDATE_CREDENTIALS)}):null,g&&e.auth?.strategy===`oauth2`?(0,Q.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-reauthorize-${e.id}`,className:$,onClick:()=>void v(),children:r(p.MCP$HEALTH_REAUTHORIZE)}):null,g&&t?.docsUrl?(0,Q.jsx)(`a`,{href:t.docsUrl,target:`_blank`,rel:`noreferrer`,className:$,children:r(p.MCP$VIEW_DOCS)}):null]})]})}function Ee(e){switch(e){case`sse`:return`SSE`;case`shttp`:return`HTTP`;case`stdio`:return`STDIO`;default:return e}}function De(e){if(e.type===`stdio`){let t=e.args&&e.args.length>0?` ${e.args.join(` `)}`:``;return`${e.command??``}${t}`.trim()}return e.url??``}function Oe({server:e,onEdit:t,onDelete:n}){let{t:r}=a(`openhands`),i=Y(e,G(m)),o=ve(e,i),s=De(e),c=Ee(e.type);return(0,Q.jsx)(`div`,{"data-testid":`mcp-server-item`,"data-server-id":e.id,role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"aria-label":r(p.MCP$EDIT_SERVER_ARIA,{name:o}),className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,L,B),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(ne,{entry:i,fallback:(0,Q.jsx)(h,{strokeWidth:2.25})}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,title:o,children:o}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:c})]}),(0,Q.jsx)(fe,{testId:`mcp-installed-toggle-${e.id}`,isSelected:!0,onToggle:e=>{e||n()},enableLabelKey:p.MCP$TOGGLE_ADD_SERVER,disableLabelKey:p.MCP$TOGGLE_REMOVE_SERVER})]}),i?.description?(0,Q.jsx)(`p`,{"data-testid":`mcp-server-description-${e.id}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:i.description}):null,s?(0,Q.jsx)(`p`,{"data-testid":`mcp-server-detail-${e.id}`,className:`truncate text-xs text-tertiary-alt`,title:s,children:s}):null,(0,Q.jsx)(Te,{server:e,catalog:i,onEdit:t})]})]})})}function ke({servers:e,hasAnyInstalled:t,query:n=``,onEdit:r,onDelete:i}){let{t:o}=a(`openhands`);return e.length===0?t&&n.trim().length>0?(0,Q.jsx)(`div`,{"data-testid":`mcp-installed-empty-search`,className:`rounded-xl border border-[var(--oh-border)] p-6 text-center`,children:(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:o(p.MCP$SEARCH_EMPTY)})}):(0,Q.jsxs)(`div`,{"data-testid":`mcp-installed-empty`,className:z,children:[(0,Q.jsx)(`p`,{className:`text-sm text-white`,children:o(p.MCP$INSTALLED_EMPTY_TITLE)}),(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light mt-1`,children:o(p.MCP$INSTALLED_EMPTY_HINT)})]}):(0,Q.jsx)(`div`,{className:R,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:V,children:e.map(e=>(0,Q.jsx)(Oe,{server:e,onEdit:()=>r(e),onDelete:()=>i(e.id)},e.id))})})}function Ae({entry:e,onClick:t,onAdd:n}){let r=U(e),i=(()=>{switch(r?.kind){case`stdio`:return`STDIO`;case`shttp`:return`HTTP`;case`sse`:return`SSE`;default:return``}})();return(0,Q.jsx)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"data-testid":`mcp-marketplace-card-${e.id}`,className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,L,B),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(ne,{entry:e}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:i})]}),(0,Q.jsx)(fe,{testId:`mcp-marketplace-toggle-${e.id}`,isSelected:!1,onToggle:e=>{e&&n()},enableLabelKey:p.MCP$TOGGLE_ADD_SERVER,disableLabelKey:p.MCP$TOGGLE_ADD_SERVER})]}),(0,Q.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})})}function je({onSelect:e,onAdd:t,query:n=``}){let{t:r}=a(`openhands`),i=ue(G(m)).filter(e=>H(e,n));return(0,Q.jsxs)(`section`,{"data-testid":`mcp-marketplace-section`,className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:r(p.MCP$LIBRARY_TITLE)}),i.length===0?(0,Q.jsx)(`div`,{"data-testid":`mcp-marketplace-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-6 text-center`,children:(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(p.MCP$SEARCH_EMPTY)})}):(0,Q.jsx)(`div`,{className:R,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:V,children:i.map(n=>(0,Q.jsx)(Ae,{entry:n,onClick:()=>e(n),onAdd:()=>t(n)},n.id))})})]})}function Me({mode:e,server:t,existingServers:n,onSubmit:r,onCancel:i,onDelete:o,isActionDisabled:s=!1,onTest:c,isTestPending:l=!1,testMessage:u=null}){let{t:d}=a(`openhands`),[m,h]=Z.useState(t?.type||`sse`),[g,v]=Z.useState(()=>t?.auth?.strategy===`oauth2`?`oauth2`:t?.auth?.strategy===`header`?`header`:t?.auth?.strategy===`bearer`||t?.auth?.strategy===`api_key`?`bearer`:`none`),[y,b]=Z.useState(()=>t?.auth?.strategy===`oauth2`?t.auth.authentication?.client_auth_method??`auto`:`auto`),[x,C]=Z.useState(null),w=Z.useRef(null),T=[{key:`sse`,label:d(p.SETTINGS$MCP_SERVER_TYPE_SSE)},{key:`stdio`,label:d(p.SETTINGS$MCP_SERVER_TYPE_STDIO)},{key:`shttp`,label:d(p.SETTINGS$MCP_SERVER_TYPE_SHTTP)}],D=[{key:`none`,label:d(p.SETTINGS$MCP_AUTH_MODE_NONE)},{key:`bearer`,label:d(p.SETTINGS$MCP_AUTH_MODE_BEARER)},{key:`header`,label:d(p.SETTINGS$MCP_AUTH_MODE_HEADER)},{key:`oauth2`,label:d(p.SETTINGS$MCP_AUTH_MODE_OAUTH)}],O=[{key:`auto`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_AUTO)},{key:`none`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_NONE)},{key:`client_secret_post`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_POST)},{key:`client_secret_basic`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_BASIC)},{key:`private_key_jwt`,label:d(p.SETTINGS$MCP_OAUTH_CLIENT_AUTH_PRIVATE_KEY_JWT)}],k=e=>{if(!e)return d(p.SETTINGS$MCP_ERROR_URL_REQUIRED);try{let t=new URL(e);if(![`http:`,`https:`].includes(t.protocol))return d(p.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL)}catch{return d(p.SETTINGS$MCP_ERROR_URL_INVALID)}return null},M=e=>e?E(e)?null:d(p.SETTINGS$MCP_ERROR_NAME_INVALID):d(p.SETTINGS$MCP_ERROR_NAME_REQUIRED),F=r=>!n||!(e===`add`||e===`edit`&&t?.name!==r)?null:n.filter(e=>e.type===`stdio`).map(e=>e.name).filter(Boolean).includes(r)?d(p.SETTINGS$MCP_ERROR_NAME_DUPLICATE):null,L=e=>e?e.includes(` `)?d(p.SETTINGS$MCP_ERROR_COMMAND_NO_SPACES):null:d(p.SETTINGS$MCP_ERROR_COMMAND_REQUIRED),R=r=>{if(!n)return null;let i=t?.url;return(e===`add`||e===`edit`&&i!==r)&&n.some(e=>(e.type===`sse`||e.type===`shttp`)&&e.url===r)?d(p.SETTINGS$MCP_ERROR_URL_DUPLICATE):null},z=e=>{if(!e.trim())return null;let t=e.split(`
2
2
  `);for(let e=0;e<t.length;e+=1){let n=t[e].trim();if(n){let e=n.indexOf(`=`);if(e===-1||!n.substring(0,e).trim())return d(p.SETTINGS$MCP_ERROR_ENV_INVALID_FORMAT)}}return null},B=e=>{if(g===`header`){let t=e.get(`headers`)?.toString()||``;return t.trim()?z(t):d(p.SETTINGS$MCP_ERROR_HEADER_REQUIRED)}if(g===`oauth2`){let t=e.get(`oauth_client_id`)?.toString().trim();if(e.get(`oauth_client_secret`)?.toString().trim()&&!t)return d(p.SETTINGS$MCP_ERROR_OAUTH_SECRET_REQUIRES_ID)}return null},V=e=>{if(!e.trim())return null;let t=parseInt(e.trim(),10);return Number.isNaN(t)?d(p.SETTINGS$MCP_ERROR_TIMEOUT_INVALID_NUMBER):t<=0?d(p.SETTINGS$MCP_ERROR_TIMEOUT_POSITIVE):t>3600?d(p.SETTINGS$MCP_ERROR_TIMEOUT_MAX_EXCEEDED):null},ee=e=>{let t=e.get(`name`)?.toString().trim()||``,n=e.get(`command`)?.toString().trim()||``,r=e.get(`env`)?.toString()||``;return M(t)||F(t)||L(n)||z(r)||null},H=e=>{if(m===`sse`||m===`shttp`){let t=e.get(`url`)?.toString().trim()||``,n=k(t);if(n)return n;let r=R(t);if(r)return r;let i=e.get(`name`)?.toString().trim()||``;if(i&&!E(i))return d(p.SETTINGS$MCP_ERROR_NAME_INVALID);if(m===`shttp`){let t=V(e.get(`timeout`)?.toString()||``);if(t)return t}return B(e)}return m===`stdio`?ee(e):null},U=e=>{let t={},n=e.trim();if(!n)return t;for(let e of n.split(`
3
3
  `)){let n=e.trim(),r=n.indexOf(`=`),i=r>=0?n.substring(0,r).trim():``;n&&r!==-1&&i&&(t[i]=n.substring(r+1).trim())}return t},W=e=>e?Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
4
4
  `):``,G=e=>e?.strategy===`bearer`||e?.strategy===`api_key`?e.value??``:``,K=e=>e?.strategy===`header`?W(e.headers):``,q=t?.auth?.strategy===`oauth2`?t.auth.authentication:void 0,J=t?.auth?.strategy===`oauth2`?t.auth.state:void 0,Y=e=>{if(g===`none`)return;if(g===`bearer`){let n=e.get(`api_key`)?.toString().trim();return n?t?.auth?.strategy===`api_key`?{...t.auth,value:n}:{strategy:`bearer`,value:n}:void 0}if(g===`header`)return{strategy:`header`,headers:U(e.get(`headers`)?.toString()||``)};let n=e.get(`oauth_scopes`)?.toString().trim(),r=e.get(`oauth_client_id`)?.toString().trim(),i=e.get(`oauth_client_secret`)?.toString().trim();return{strategy:`oauth2`,authentication:{type:`oauth`,...y!==`auto`&&{client_auth_method:y},...n&&{scopes:n},...r&&{client_id:r},...i&&{client_secret:i}},...J&&{state:J}}},X=e=>{let n={id:t?.id||`${m}-${Date.now()}`,type:m};if(m===`sse`||m===`shttp`){let t=e.get(`name`)?.toString().trim(),r=e.get(`url`)?.toString().trim(),i=e.get(`timeout`)?.toString().trim(),a=Y(e),o={...n,...t&&{name:t},url:r,...a&&{auth:a}};if(m===`shttp`&&i){let e=parseInt(i,10);Number.isNaN(e)||(o.timeout=e)}return o}let r=e.get(`name`)?.toString().trim(),i=e.get(`command`)?.toString().trim(),a=e.get(`args`)?.toString().trim(),o=e.get(`env`)?.toString().trim(),s=a?a.split(`
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,j as i,yt as a}from"./vendor-styling-Bcgpimp9.js";import{n as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{l as c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js";import{E as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as u}from"./useMutation-DyQXZFEF.js";import{t as d}from"./Trans-DP5rcauH.js";import{gt as f,n as p,rt as m}from"./active-backend-context-B9942JGX.js";import{P as h,T as g,t as _,w as v,z as y}from"./utils-qjs_KuS4.js";import{t as b}from"./chevron-down-CV1zZP_K.js";import{t as ee}from"./loader-circle-6zlEYCJw.js";import{t as te}from"./use-config-DPEYpfIj.js";import{n as ne}from"./use-settings-BKpkUS4y.js";import{n as re,o as x}from"./form-control-classes-CSPevi7c.js";import{n as S}from"./navigation-context-BOGzIng3.js";import{ot as C,st as ie}from"./vendor-markdown-BML7QbqS.js";import{t as ae}from"./styled-tooltip-DsjDnR_W.js";import{c as oe,f as se,t as w}from"./conversation-store-C6hSXHw0.js";import{r as ce,t as le}from"./agent-server-conversation-service.api-D7qh9amG.js";import{a as ue,d as de,h as fe,i as pe,p as me}from"./conversation-state-store-BORusMiV.js";import{n as he}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js";import{t as ge}from"./skills-CYFLsN5U.js";import{t as _e}from"./close-CDAVqnTn.js";import{t as ve}from"./copy-to-clipboard-button-C4l3CMSd.js";import{r as T}from"./typography-C6fuRTTT.js";import{t as ye}from"./u-check-circle-DBEvndTS.js";import{D as be,E as xe,F as Se,G as Ce,H as we,J as E,K as Te,L as D,M as Ee,O,P as De,R as Oe,T as ke,a as Ae,g as je,j as Me,k as Ne,m as Pe,n as Fe,p as Ie,q as Le,r as Re,t as k,w as ze,x as Be,y as Ve,z as He}from"./markdown-renderer-Dkmjmx_d.js";import{t as Ue}from"./syntax-highlighter-B92AFGMy.js";var We=l(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),A=e(r(),1);function Ge(){!t.current&&i();let[e]=(0,A.useState)(n.current);return e}var j=a(),Ke=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}(Ke||{});function qe(){let{conversationId:e}=E(),t=Ae();return{send:(0,A.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 Je(e,t,n,r){return{action:Ke.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var M=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,j.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`})}),N=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,j.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 Ye({status:e}){return(0,j.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,j.jsx)(he,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function P({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:c}=s(`openhands`),[l,u]=A.useState(r),d=t?(0,j.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`cursor-pointer text-left`,"aria-label":c(l?y.BUTTON$COLLAPSE:y.BUTTON$EXPAND),children:l?(0,j.jsx)(N,{className:_(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,j.jsx)(M,{className:_(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&d,o,(0,j.jsx)(`span`,{children:e}),i===`after`&&d]}),(0,j.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,j.jsx)(Ye,{status:n})]})]}),l&&(typeof t==`string`?(0,j.jsx)(k,{children:t}):t)]})}var Xe=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,j.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),Ze=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,j.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),Qe={running:y.GOAL$STATUS_RUNNING,complete:y.GOAL$STATUS_COMPLETE,capped:y.GOAL$STATUS_CAPPED,interrupted:y.GOAL$STATUS_INTERRUPTED};function $e({status:e}){let{t}=s(`openhands`),{conversationId:n}=E(),r=je(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,A.useState)(!1),{active:o,objective:c,iteration:l,max_iterations:u,verdict:d}=e,f=d?Math.round(d.score*100):null,p=d?.missing?t(y.GOAL$MISSING,{missing:d.missing}):``,h=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){m(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},g=()=>h(async e=>{await fe(e),await de(e)},y.GOAL$STOP_FAILED),v=()=>h(me,y.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,j.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:g,className:_(re,x),children:t(y.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,j.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:v,className:_(re,x),children:t(y.GOAL$RESUME)})),(0,j.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,j.jsx)(P,{title:(0,j.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,j.jsx)(`span`,{className:`opacity-60`,children:t(y.GOAL$PREFIX)}),(0,j.jsx)(`span`,{children:c}),(0,j.jsx)(`span`,{className:`opacity-60`,children:t(y.GOAL$ROUND,{iteration:l,max:u})}),(0,j.jsx)(`span`,{children:t(Qe[e.status])}),f!==null&&(0,j.jsx)(`span`,{className:`opacity-60`,children:t(y.GOAL$SCORE,{score:f})}),o?(0,j.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,j.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,j.jsx)(Xe,{className:`w-3.5 h-3.5 fill-success`})}):(0,j.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,j.jsx)(Ze,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:p,initiallyExpanded:!o,chevronPosition:`before`})})}var et=e=>(0,j.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,j.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,j.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,j.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,j.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,j.jsx)(`defs`,{children:(0,j.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,j.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function tt({profile:e}){let[t,n]=A.useState(!1);return(0,j.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,j.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,j.jsx)(b,{size:14}):(0,j.jsx)(c,{size:14})}),(0,j.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`hr`,{className:`border-neutral-700`}),(0,j.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 nt({conversationId:e,anchorEventId:t}){let n=Pe(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,j.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,j.jsx)(P,{title:(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,j.jsx)(et,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,j.jsx)(d,{i18nKey:y.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,j.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,j.jsx)(P,{title:(0,j.jsx)(`span`,{children:t?(0,j.jsx)(d,{i18nKey:y.MODEL$NO_SAVED_PROFILES}):(0,j.jsx)(d,{i18nKey:y.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,j.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,j.jsx)(d,{i18nKey:y.MODEL$NO_PROFILES_HINT})}):(0,j.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,j.jsx)(tt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function rt(e){let[t,n]=(0,A.useState)(!0),[r,i]=(0,A.useState)(!0),a=(0,A.useRef)(0),o=(0,A.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,A.useCallback)(e=>{let t=o(e);i(t);let r=e.scrollTop,s=r<a.current;a.current=r,s&&n(!1),t&&n(!0)},[o]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,A.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var F=(0,A.createContext)(void 0);function it({children:e,value:t}){let n=rt(A.useRef(null)),r=t||n;return(0,j.jsx)(F.Provider,{value:r,children:e})}function at(){let e=(0,A.useContext)(F);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function ot(){return(0,A.useContext)(F)}var st=()=>{let{setConversationMode:e}=w(),{send:t}=qe(),{conversationId:n}=E(),r=Ve(e=>e.enqueuePendingMessage),i=Ve(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,A.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(Je(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},ct=`200%`,I=8,lt=I*2;function ut({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Ge(),c=`oh-text-shimmer-${(0,A.useId)().replace(/:/g,``)}`,l=(0,A.useMemo)(()=>Math.min(I/2-1,1+i/2),[i]),u=(0,A.useMemo)(()=>{let e=I/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${I}%)`,backgroundSize:`${ct} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,j.jsx)(t,{className:_(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${lt}% center}to{background-position:0% center}}`}}),(0,j.jsx)(t,{className:_(`relative inline-block`,n),style:u,...o,children:e})]})}var dt=A.memo(ut);function ft({className:e}){return(0,j.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,j.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var pt=5,mt=360,ht={p:({children:e})=>(0,j.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function gt({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),a=A.useRef(null),[o,c]=A.useState(!1);A.useEffect(()=>{r(o)},[o,r]),A.useLayoutEffect(()=>{let t=a.current;if(!t||n){c(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=pt*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;c(t.scrollHeight>r+1||i>=pt||e.trim().length>mt)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let l=o&&!n;return(0,j.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,j.jsx)(`div`,{ref:a,className:_(`text-sm leading-6 whitespace-normal [word-break:break-word]`,l&&`line-clamp-5`),children:(0,j.jsx)(k,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:ht,children:e})}),l?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,j.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:_(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(y.COMMON$VIEW_MORE)})]}):null]})}function L({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onStop:c}){let{t:l}=s(`openhands`),[u,d]=A.useState(!1),[f,p]=A.useState(!1),[m,h]=A.useState(!1),[g,v]=A.useState(!1),[b,ee]=A.useState(!0),te=A.useRef(null);A.useEffect(()=>{h(!1)},[t]);let ne=async()=>{await navigator.clipboard.writeText(t),p(!0)};A.useEffect(()=>{let e;return f&&(e=setTimeout(()=>{p(!1)},2e3)),()=>{clearTimeout(e)}},[f]);let re=e===`user`&&(a===`error`||a===`sending`),x=a===`sending`&&c!=null,S=x&&u,C=e===`user`&&a==null,ie=C&&g&&!m,oe=A.Children.count(n)>0;A.useLayoutEffect(()=>{if(!x||C)return;let e=te.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;ee(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,x,C]);let se=C?(0,j.jsx)(gt,{message:t,isHovering:u,isExpanded:m,onTruncatableChange:v}):(0,j.jsx)(`div`,{ref:te,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,j.jsx)(k,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:ht,children:t})}),w=(0,j.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:_(`rounded-xl relative w-fit max-w-full flex flex-col`,oe&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!re&&`last:mb-4`),children:[(0,j.jsxs)(`div`,{className:_(`absolute -top-2.5 -right-2.5 z-10`,!u||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,j.jsx)(ae,{content:e.tooltip,placement:`top`,children:(0,j.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,j.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,j.jsx)(ve,{isHidden:!u,isDisabled:f,onClick:ne,mode:f?`copied`:`copy`})]}),se,x?(0,j.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c?.()},"data-testid":`chat-message-stop`,"aria-label":l(y.BUTTON$STOP),"aria-hidden":!S,tabIndex:S?0:-1,className:_(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,b?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,S?`opacity-100`:`pointer-events-none opacity-0`),children:(0,j.jsx)(ft,{className:`block h-7 w-7 max-w-none`})}):null,ie?(0,j.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":l(y.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>h(!0)}):null,n]});return e===`user`&&a===`error`?(0,j.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[w,(0,j.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,j.jsx)(`span`,{children:l(y.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,j.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:l(y.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,j.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[w,(0,j.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,j.jsx)(dt,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:l(y.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):w}function _t(){let{conversationId:e}=Le(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=w(),{setSelectedTab:a}=oe(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}}function vt(e){return{h1:({children:t,className:n})=>(0,j.jsx)(`h1`,{className:_(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,j.jsx)(`h2`,{className:_(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,j.jsx)(`h3`,{className:_(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,j.jsx)(`h4`,{className:_(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,j.jsx)(`h5`,{className:_(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,j.jsx)(`h6`,{className:_(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,j.jsx)(`p`,{className:_(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,j.jsx)(`ul`,{className:_(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,j.jsx)(`ol`,{className:_(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,j.jsx)(`li`,{className:_(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,j.jsx)(`a`,{className:_(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,j.jsx)(`code`,{className:_(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var yt=vt(),R=300,bt=vt(`shine-text`);function xt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=_t(),{handleBuildPlanClick:a}=st(),{scrollDomToBottom:o}=at(),c=()=>{i(`planner`)},l=(0,A.useCallback)(e=>{a(e),o()},[a,o]),u=(0,A.useMemo)(()=>e?e.length<=R?e:`${e.slice(0,R)}...`:``,[e]);return e?(0,j.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,j.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,j.jsx)(Re,{width:18,height:18,color:`var(--oh-muted)`}),(0,j.jsx)(T.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(y.COMMON$PLAN_MD)}),(0,j.jsx)(`div`,{className:`flex-1`}),(0,j.jsxs)(`button`,{type:`button`,onClick:c,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,j.jsx)(T.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(y.COMMON$VIEW)}),(0,j.jsx)(We,{className:`text-white`,size:18})]})]}),(0,j.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:u&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{includeStandard:!0,components:t?bt:yt,children:u}),e&&e.length>R&&(0,j.jsx)(`button`,{type:`button`,onClick:c,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(y.COMMON$READ_MORE)})]})}),(0,j.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,j.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:_(`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,j.jsxs)(T.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(y.COMMON$BUILD),` `,(0,j.jsx)(T.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function St({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=A.useState(!1);return(0,j.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,j.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&f.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,j.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,j.jsx)(N,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,j.jsx)(M,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,j.jsx)(k,{children:t})]})}function Ct({event:e}){return Ne(e)?(0,j.jsx)(St,{errorId:e.id,defaultMessage:e.error}):null}function wt({width:e=20,height:t=20,active:n}){return(0,j.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,j.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Tt({width:e=20,height:t=20,active:n}){return(0,j.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,j.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Et({onClick:e,className:t}){return(0,j.jsx)(`button`,{type:`button`,onClick:e,className:_(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,j.jsx)(_e,{width:18,height:18})})}function Dt({src:e,size:t=`small`}){return(0,j.jsx)(`img`,{role:`img`,alt:``,src:e,className:_(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ot({src:e,onRemove:t,size:n=`small`}){return(0,j.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,j.jsx)(Dt,{src:e,size:n}),t&&(0,j.jsx)(Et,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function kt({size:e=`small`,images:t,onRemove:n}){let r=A.useRef(null),[i,a]=A.useState(!1),[o,s]=A.useState(!0),[c,l]=A.useState(!1);return A.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,j.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,j.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,j.jsx)(wt,{active:!o})}),(0,j.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:_(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,j.jsx)(Ot,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,j.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,j.jsx)(Tt,{active:!c})})]})}function At({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?y.ACTION$CONFIRM:y.ACTION$REJECT),a=n(r?y.CHAT_INTERFACE$USER_CONFIRMED:y.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(y.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(y.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,j.jsx)(ae,{closeDelay:100,content:a,children:(0,j.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:_(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function jt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,j.jsxs)(`div`,{className:_(`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,j.jsx)(`span`,{className:``,children:n}),(0,j.jsx)(`span`,{className:`font-bold`,children:i}),(0,j.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Mt=e=>(0,j.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,j.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,j.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,j.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Nt=se(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Pt=()=>u({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return Ie.respondToConfirmation(e,t,i,n)}});function Ft(){let e=Nt(e=>e.submittedEventIds),t=Nt(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=Te(),{curAgentState:i}=Ce(),{mutate:a}=Pt(),o=Be(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===g.AWAITING_USER_CONFIRMATION:!1),c=(0,A.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,A.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),c(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),c(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,c]),i!==g.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,j.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(O(o)?o.security_risk:v.UNKNOWN)===v.HIGH&&(0,j.jsx)(jt,{content:n(y.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,j.jsx)(Mt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(y.COMMON$HIGH_RISK)}),(0,j.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,j.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(y.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(At,{type:`reject`,onClick:()=>c(!1)}),(0,j.jsx)(At,{type:`confirm`,onClick:()=>c(!0)})]})]})]})}var It=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,j as i,yt as a}from"./vendor-styling-Bcgpimp9.js";import{n as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{l as c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js";import{E as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as u}from"./useMutation-DyQXZFEF.js";import{t as d}from"./Trans-DP5rcauH.js";import{gt as f,n as p,rt as m}from"./active-backend-context-BlZPzZNU.js";import{P as h,T as g,t as _,w as v,z as y}from"./utils-qjs_KuS4.js";import{t as b}from"./chevron-down-CV1zZP_K.js";import{t as ee}from"./loader-circle-6zlEYCJw.js";import{t as te}from"./use-config-Csy8EAP9.js";import{n as ne}from"./use-settings-DBI44RnH.js";import{n as re,o as x}from"./form-control-classes-CSPevi7c.js";import{n as S}from"./navigation-context-BOGzIng3.js";import{ot as C,st as ie}from"./vendor-markdown-BML7QbqS.js";import{t as ae}from"./styled-tooltip-DsjDnR_W.js";import{c as oe,f as se,t as w}from"./conversation-store-C6hSXHw0.js";import{r as ce,t as le}from"./agent-server-conversation-service.api-Btmi4q6d.js";import{a as ue,d as de,h as fe,i as pe,p as me}from"./conversation-state-store-DTq4hFoP.js";import{n as he}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js";import{t as ge}from"./skills-CYFLsN5U.js";import{t as _e}from"./close-CDAVqnTn.js";import{t as ve}from"./copy-to-clipboard-button-C4l3CMSd.js";import{r as T}from"./typography-C6fuRTTT.js";import{t as ye}from"./u-check-circle-DBEvndTS.js";import{D as be,E as xe,F as Se,G as Ce,H as we,J as E,K as Te,L as D,M as Ee,O,P as De,R as Oe,T as ke,a as Ae,g as je,j as Me,k as Ne,m as Pe,n as Fe,p as Ie,q as Le,r as Re,t as k,w as ze,x as Be,y as Ve,z as He}from"./markdown-renderer-CvOO0YIr.js";import{t as Ue}from"./syntax-highlighter-B92AFGMy.js";var We=l(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),A=e(r(),1);function Ge(){!t.current&&i();let[e]=(0,A.useState)(n.current);return e}var j=a(),Ke=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}(Ke||{});function qe(){let{conversationId:e}=E(),t=Ae();return{send:(0,A.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 Je(e,t,n,r){return{action:Ke.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var M=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,j.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`})}),N=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,j.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 Ye({status:e}){return(0,j.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,j.jsx)(he,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function P({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:c}=s(`openhands`),[l,u]=A.useState(r),d=t?(0,j.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`cursor-pointer text-left`,"aria-label":c(l?y.BUTTON$COLLAPSE:y.BUTTON$EXPAND),children:l?(0,j.jsx)(N,{className:_(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,j.jsx)(M,{className:_(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,j.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&d,o,(0,j.jsx)(`span`,{children:e}),i===`after`&&d]}),(0,j.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,j.jsx)(Ye,{status:n})]})]}),l&&(typeof t==`string`?(0,j.jsx)(k,{children:t}):t)]})}var Xe=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,j.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),Ze=e=>(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,j.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),Qe={running:y.GOAL$STATUS_RUNNING,complete:y.GOAL$STATUS_COMPLETE,capped:y.GOAL$STATUS_CAPPED,interrupted:y.GOAL$STATUS_INTERRUPTED};function $e({status:e}){let{t}=s(`openhands`),{conversationId:n}=E(),r=je(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,A.useState)(!1),{active:o,objective:c,iteration:l,max_iterations:u,verdict:d}=e,f=d?Math.round(d.score*100):null,p=d?.missing?t(y.GOAL$MISSING,{missing:d.missing}):``,h=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){m(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},g=()=>h(async e=>{await fe(e),await de(e)},y.GOAL$STOP_FAILED),v=()=>h(me,y.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,j.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:g,className:_(re,x),children:t(y.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,j.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:v,className:_(re,x),children:t(y.GOAL$RESUME)})),(0,j.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,j.jsx)(P,{title:(0,j.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,j.jsx)(`span`,{className:`opacity-60`,children:t(y.GOAL$PREFIX)}),(0,j.jsx)(`span`,{children:c}),(0,j.jsx)(`span`,{className:`opacity-60`,children:t(y.GOAL$ROUND,{iteration:l,max:u})}),(0,j.jsx)(`span`,{children:t(Qe[e.status])}),f!==null&&(0,j.jsx)(`span`,{className:`opacity-60`,children:t(y.GOAL$SCORE,{score:f})}),o?(0,j.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,j.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,j.jsx)(Xe,{className:`w-3.5 h-3.5 fill-success`})}):(0,j.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,j.jsx)(Ze,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:p,initiallyExpanded:!o,chevronPosition:`before`})})}var et=e=>(0,j.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,j.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,j.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,j.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,j.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,j.jsx)(`defs`,{children:(0,j.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,j.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function tt({profile:e}){let[t,n]=A.useState(!1);return(0,j.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,j.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,j.jsx)(b,{size:14}):(0,j.jsx)(c,{size:14})}),(0,j.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`hr`,{className:`border-neutral-700`}),(0,j.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 nt({conversationId:e,anchorEventId:t}){let n=Pe(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,j.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,j.jsx)(P,{title:(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,j.jsx)(et,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,j.jsx)(d,{i18nKey:y.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,j.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,j.jsx)(P,{title:(0,j.jsx)(`span`,{children:t?(0,j.jsx)(d,{i18nKey:y.MODEL$NO_SAVED_PROFILES}):(0,j.jsx)(d,{i18nKey:y.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,j.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,j.jsx)(d,{i18nKey:y.MODEL$NO_PROFILES_HINT})}):(0,j.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,j.jsx)(tt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function rt(e){let[t,n]=(0,A.useState)(!0),[r,i]=(0,A.useState)(!0),a=(0,A.useRef)(0),o=(0,A.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,A.useCallback)(e=>{let t=o(e);i(t);let r=e.scrollTop,s=r<a.current;a.current=r,s&&n(!1),t&&n(!0)},[o]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,A.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var F=(0,A.createContext)(void 0);function it({children:e,value:t}){let n=rt(A.useRef(null)),r=t||n;return(0,j.jsx)(F.Provider,{value:r,children:e})}function at(){let e=(0,A.useContext)(F);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function ot(){return(0,A.useContext)(F)}var st=()=>{let{setConversationMode:e}=w(),{send:t}=qe(),{conversationId:n}=E(),r=Ve(e=>e.enqueuePendingMessage),i=Ve(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,A.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(Je(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},ct=`200%`,I=8,lt=I*2;function ut({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Ge(),c=`oh-text-shimmer-${(0,A.useId)().replace(/:/g,``)}`,l=(0,A.useMemo)(()=>Math.min(I/2-1,1+i/2),[i]),u=(0,A.useMemo)(()=>{let e=I/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${I}%)`,backgroundSize:`${ct} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,j.jsx)(t,{className:_(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${lt}% center}to{background-position:0% center}}`}}),(0,j.jsx)(t,{className:_(`relative inline-block`,n),style:u,...o,children:e})]})}var dt=A.memo(ut);function ft({className:e}){return(0,j.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,j.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,j.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var pt=5,mt=360,ht={p:({children:e})=>(0,j.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function gt({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),a=A.useRef(null),[o,c]=A.useState(!1);A.useEffect(()=>{r(o)},[o,r]),A.useLayoutEffect(()=>{let t=a.current;if(!t||n){c(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=pt*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;c(t.scrollHeight>r+1||i>=pt||e.trim().length>mt)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let l=o&&!n;return(0,j.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,j.jsx)(`div`,{ref:a,className:_(`text-sm leading-6 whitespace-normal [word-break:break-word]`,l&&`line-clamp-5`),children:(0,j.jsx)(k,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:ht,children:e})}),l?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,j.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:_(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(y.COMMON$VIEW_MORE)})]}):null]})}function L({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onStop:c}){let{t:l}=s(`openhands`),[u,d]=A.useState(!1),[f,p]=A.useState(!1),[m,h]=A.useState(!1),[g,v]=A.useState(!1),[b,ee]=A.useState(!0),te=A.useRef(null);A.useEffect(()=>{h(!1)},[t]);let ne=async()=>{await navigator.clipboard.writeText(t),p(!0)};A.useEffect(()=>{let e;return f&&(e=setTimeout(()=>{p(!1)},2e3)),()=>{clearTimeout(e)}},[f]);let re=e===`user`&&(a===`error`||a===`sending`),x=a===`sending`&&c!=null,S=x&&u,C=e===`user`&&a==null,ie=C&&g&&!m,oe=A.Children.count(n)>0;A.useLayoutEffect(()=>{if(!x||C)return;let e=te.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;ee(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,x,C]);let se=C?(0,j.jsx)(gt,{message:t,isHovering:u,isExpanded:m,onTruncatableChange:v}):(0,j.jsx)(`div`,{ref:te,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,j.jsx)(k,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:ht,children:t})}),w=(0,j.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),className:_(`rounded-xl relative w-fit max-w-full flex flex-col`,oe&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!re&&`last:mb-4`),children:[(0,j.jsxs)(`div`,{className:_(`absolute -top-2.5 -right-2.5 z-10`,!u||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,j.jsx)(ae,{content:e.tooltip,placement:`top`,children:(0,j.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,j.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,j.jsx)(ve,{isHidden:!u,isDisabled:f,onClick:ne,mode:f?`copied`:`copy`})]}),se,x?(0,j.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c?.()},"data-testid":`chat-message-stop`,"aria-label":l(y.BUTTON$STOP),"aria-hidden":!S,tabIndex:S?0:-1,className:_(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,b?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,S?`opacity-100`:`pointer-events-none opacity-0`),children:(0,j.jsx)(ft,{className:`block h-7 w-7 max-w-none`})}):null,ie?(0,j.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":l(y.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>h(!0)}):null,n]});return e===`user`&&a===`error`?(0,j.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[w,(0,j.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,j.jsx)(`span`,{children:l(y.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,j.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:l(y.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,j.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[w,(0,j.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,j.jsx)(dt,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:l(y.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):w}function _t(){let{conversationId:e}=Le(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=w(),{setSelectedTab:a}=oe(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}}function vt(e){return{h1:({children:t,className:n})=>(0,j.jsx)(`h1`,{className:_(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,j.jsx)(`h2`,{className:_(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,j.jsx)(`h3`,{className:_(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,j.jsx)(`h4`,{className:_(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,j.jsx)(`h5`,{className:_(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,j.jsx)(`h6`,{className:_(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,j.jsx)(`p`,{className:_(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,j.jsx)(`ul`,{className:_(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,j.jsx)(`ol`,{className:_(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,j.jsx)(`li`,{className:_(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,j.jsx)(`a`,{className:_(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,j.jsx)(`code`,{className:_(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var yt=vt(),R=300,bt=vt(`shine-text`);function xt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=_t(),{handleBuildPlanClick:a}=st(),{scrollDomToBottom:o}=at(),c=()=>{i(`planner`)},l=(0,A.useCallback)(e=>{a(e),o()},[a,o]),u=(0,A.useMemo)(()=>e?e.length<=R?e:`${e.slice(0,R)}...`:``,[e]);return e?(0,j.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,j.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,j.jsx)(Re,{width:18,height:18,color:`var(--oh-muted)`}),(0,j.jsx)(T.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(y.COMMON$PLAN_MD)}),(0,j.jsx)(`div`,{className:`flex-1`}),(0,j.jsxs)(`button`,{type:`button`,onClick:c,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,j.jsx)(T.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(y.COMMON$VIEW)}),(0,j.jsx)(We,{className:`text-white`,size:18})]})]}),(0,j.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:u&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(k,{includeStandard:!0,components:t?bt:yt,children:u}),e&&e.length>R&&(0,j.jsx)(`button`,{type:`button`,onClick:c,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(y.COMMON$READ_MORE)})]})}),(0,j.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,j.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:_(`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,j.jsxs)(T.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(y.COMMON$BUILD),` `,(0,j.jsx)(T.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function St({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=A.useState(!1);return(0,j.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,j.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&f.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,j.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,j.jsx)(N,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,j.jsx)(M,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,j.jsx)(k,{children:t})]})}function Ct({event:e}){return Ne(e)?(0,j.jsx)(St,{errorId:e.id,defaultMessage:e.error}):null}function wt({width:e=20,height:t=20,active:n}){return(0,j.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,j.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Tt({width:e=20,height:t=20,active:n}){return(0,j.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,j.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Et({onClick:e,className:t}){return(0,j.jsx)(`button`,{type:`button`,onClick:e,className:_(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,j.jsx)(_e,{width:18,height:18})})}function Dt({src:e,size:t=`small`}){return(0,j.jsx)(`img`,{role:`img`,alt:``,src:e,className:_(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ot({src:e,onRemove:t,size:n=`small`}){return(0,j.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,j.jsx)(Dt,{src:e,size:n}),t&&(0,j.jsx)(Et,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function kt({size:e=`small`,images:t,onRemove:n}){let r=A.useRef(null),[i,a]=A.useState(!1),[o,s]=A.useState(!0),[c,l]=A.useState(!1);return A.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,j.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,j.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,j.jsx)(wt,{active:!o})}),(0,j.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:_(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,j.jsx)(Ot,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,j.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,j.jsx)(Tt,{active:!c})})]})}function At({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?y.ACTION$CONFIRM:y.ACTION$REJECT),a=n(r?y.CHAT_INTERFACE$USER_CONFIRMED:y.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(y.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(y.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,j.jsx)(ae,{closeDelay:100,content:a,children:(0,j.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:_(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function jt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,j.jsxs)(`div`,{className:_(`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,j.jsx)(`span`,{className:``,children:n}),(0,j.jsx)(`span`,{className:`font-bold`,children:i}),(0,j.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Mt=e=>(0,j.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,j.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,j.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,j.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Nt=se(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Pt=()=>u({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return Ie.respondToConfirmation(e,t,i,n)}});function Ft(){let e=Nt(e=>e.submittedEventIds),t=Nt(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=Te(),{curAgentState:i}=Ce(),{mutate:a}=Pt(),o=Be(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===g.AWAITING_USER_CONFIRMATION:!1),c=(0,A.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,A.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),c(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),c(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,c]),i!==g.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,j.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(O(o)?o.security_risk:v.UNKNOWN)===v.HIGH&&(0,j.jsx)(jt,{content:n(y.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,j.jsx)(Mt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(y.COMMON$HIGH_RISK)}),(0,j.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,j.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(y.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(At,{type:`reject`,onClick:()=>c(!1)}),(0,j.jsx)(At,{type:`confirm`,onClick:()=>c(!0)})]})]})]})}var It=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
2
2
  `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=f.t(y.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function Lt(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Rt(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function zt(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Bt(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Vt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ht(e){let t=e?.verification;if(!Vt(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function Ut({feature:e}){let t=Math.round(e.probability*100),n=Bt(e.probability);return(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,j.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,j.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function z({label:e,features:t}){return!t||t.length===0?null:(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,j.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,j.jsxs)(A.Fragment,{children:[t>0&&(0,j.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,j.jsx)(Ut,{feature:e})]},e.name))]})}function Wt({categorized:e}){let{t}=s(),n=e.agent_behavioral_issues&&e.agent_behavioral_issues.length>0,r=e.user_followup_patterns&&e.user_followup_patterns.length>0,i=e.infrastructure_issues&&e.infrastructure_issues.length>0,a=e.other&&e.other.length>0;return!n&&!r&&!i&&!a?null:(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,j.jsx)(z,{label:t(y.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,j.jsx)(z,{label:t(y.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,j.jsx)(z,{label:t(y.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,j.jsx)(z,{label:t(y.CRITIC$OTHER),features:e.other})]})}function Gt({criticResult:e}){let{t}=s(),{data:n}=ne(),[r,i]=A.useState(!1),a=Lt(e.score),{filled:o,empty:c}=Rt(a),l=zt(a),u=(a*100).toFixed(1),d=Ht(n?.agent_settings)===!1,f=e.metadata?.categorized_features,p=f!=null&&((f.agent_behavioral_issues??[]).length>0||(f.user_followup_patterns??[]).length>0||(f.infrastructure_issues??[]).length>0||(f.other??[]).length>0);return(0,j.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(y.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,j.jsxs)(`span`,{className:`${l} text-xs tracking-wide`,"aria-label":`Score: ${u}%`,children:[`★`.repeat(o),`☆`.repeat(c)]}),(0,j.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,u,`%)`]}),p&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":t(r?y.BUTTON$COLLAPSE_DETAILS:y.BUTTON$EXPAND_DETAILS),children:r?(0,j.jsx)(N,{className:`h-3 w-3 inline fill-neutral-400`}):(0,j.jsx)(M,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&p&&(0,j.jsx)(Wt,{categorized:f}),d&&(0,j.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(y.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}var Kt=e=>(0,j.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,j.jsx)(`path`,{d:`M11.3931 1.88021C10.78 1.37593 10.062 1.01489 9.29157 0.823438C8.52113 0.631981 7.71767 0.614934 6.9398 0.773542C5.90405 0.982756 4.95379 1.49492 4.20959 2.24506C3.46538 2.9952 2.96078 3.9495 2.7598 4.98688C2.61303 5.76469 2.6397 6.56531 2.83791 7.33163C3.03611 8.09795 3.40097 8.8111 3.90647 9.42021C4.37559 9.94959 4.64449 10.6266 4.66647 11.3335V13.3335C4.66647 13.864 4.87718 14.3727 5.25225 14.7478C5.62732 15.1228 6.13603 15.3335 6.66647 15.3335H9.33313C9.86356 15.3335 10.3723 15.1228 10.7473 14.7478C11.1224 14.3727 11.3331 13.864 11.3331 13.3335V11.4602C11.3555 10.6797 11.6423 9.92983 12.1465 9.33354C13.0299 8.24073 13.4463 6.84342 13.3052 5.44529C13.1642 4.04716 12.477 2.7612 11.3931 1.86687V1.88021ZM9.9998 13.3335C9.9998 13.5104 9.92956 13.6799 9.80454 13.8049C9.67951 13.93 9.50994 14.0002 9.33313 14.0002H6.66647C6.48965 14.0002 6.32009 13.93 6.19506 13.8049C6.07004 13.6799 5.9998 13.5104 5.9998 13.3335V12.6669H9.9998V13.3335ZM11.1131 8.50688C10.4428 9.30194 10.0517 10.2949 9.9998 11.3335H8.66647V9.33354C8.66647 9.15673 8.59623 8.98716 8.4712 8.86214C8.34618 8.73711 8.17661 8.66688 7.9998 8.66688C7.82299 8.66688 7.65342 8.73711 7.52839 8.86214C7.40337 8.98716 7.33313 9.15673 7.33313 9.33354V11.3335H5.9998C5.98221 10.3123 5.60443 9.33005 4.93313 8.56021C4.49023 8.02954 4.19239 7.39316 4.06867 6.71311C3.94495 6.03306 3.99957 5.33255 4.22719 4.6799C4.45481 4.02724 4.84768 3.4447 5.36748 2.98909C5.88728 2.53348 6.51627 2.22034 7.19313 2.08021C7.77483 1.96044 8.37591 1.9717 8.95271 2.11319C9.52952 2.25467 10.0676 2.52282 10.5278 2.89818C10.9881 3.27353 11.359 3.74666 11.6136 4.28322C11.8682 4.81978 12.0001 5.4063 11.9998 6.00021C12.0047 6.91345 11.6912 7.79985 11.1131 8.50688Z`,fill:`currentColor`})});function B({content:e}){let{t}=s(`openhands`),[n,r]=A.useState(!1);if(!e.trim())return null;let i=n?N:M;return(0,j.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-label":t(n?y.THINKING$COLLAPSE:y.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,j.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,j.jsx)(Kt,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,j.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(y.THINKING$TITLE)})]}),n&&(0,j.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,j.jsx)(k,{children:e})})]})}var qt=()=>{let e=o();return u({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await le.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await le.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function Jt({event:e,isLastMessage:t,isFromPlanningAgent:n}){let{t:r}=s(`openhands`),{navigate:i}=S(),{conversationId:a}=E(),o=p().backend.kind===`cloud`,{mutate:c,isPending:l}=qt(),u=w(e=>e.setMessageToSend),d=A.useRef(!1),f=It(e),{reasoning:h,message:g}=e.source===`agent`?xe(f):{reasoning:``,message:f},_=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&_.push(...e.image_urls)});let v=!o&&a?[{icon:(0,j.jsx)(pe,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!a||l||d.current)return;d.current=!0;let t=ue.getCurrentConversation(),n=t?.id===a?t.title:void 0,r=n?`${n} (branch)`:void 0,o=e.source===`user`&&g.length>0;c({sourceConversationId:a,eventId:e.id,...o?{editText:g}:{},...r?{title:r}:{}},{onSuccess:({info:e,excluded:t})=>{i(`/conversations/${e.id}`),t&&window.setTimeout(()=>u(g),0)},onError:e=>m(e instanceof Error?e.message:null),onSettled:()=>{d.current=!1}})},tooltip:r(y.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,j.jsxs)(j.Fragment,{children:[h&&(0,j.jsx)(B,{content:h}),(0,j.jsxs)(L,{type:e.source,message:g,isFromPlanningAgent:n,actions:v,children:[_.length>0&&(0,j.jsx)(kt,{size:`small`,images:_}),t&&(0,j.jsx)(Ft,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,j.jsx)(Gt,{criticResult:e.critic_result})]})}var Yt=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)}},Xt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function Zt(e){let{children:t}=e,n=e=>{try{return Xt(e)}catch(t){return Yt.error(String(t)),e}};return Array.isArray(t)?(0,j.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,j.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,j.jsx)(`strong`,{className:`font-mono`,children:t})}var Qt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},$t=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,en=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return $t(e)&&!n.endsWith(`/`)?`${n}/`:n};function tn(e){let{children:t}=e,n=e=>{try{let t=Qt(e);return(0,j.jsx)(`span`,{className:`font-mono`,title:t,children:en(t)})}catch(t){return Yt.error(String(t)),(0,j.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,j.jsx)(`strong`,{className:`font-mono`,children:t.map((e,t)=>typeof e==`string`?(0,j.jsx)(`span`,{children:n(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,j.jsx)(`strong`,{children:n(t)}):(0,j.jsx)(`strong`,{className:`font-mono`,children:t})}var V=1e3,nn=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,rn=e=>{switch(e){case v.LOW:return f.t(y.SECURITY$LOW_RISK);case v.MEDIUM:return f.t(y.SECURITY$MEDIUM_RISK);case v.HIGH:return f.t(y.SECURITY$HIGH_RISK);case v.UNKNOWN:default:return f.t(y.SECURITY$UNKNOWN_RISK)}},H=()=>``,an=e=>e.name?`**Skill:** \`${e.name}\``:H(),on=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
  `):H()},sn=e=>{if(e.command!==`create`||!e.file_text)return H();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,V)}...`),`${e.path}\n${t}`},cn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===v.HIGH||e.security_risk===v.MEDIUM)&&(t+=`\n\n${rn(e.security_risk)}`),t},ln=e=>{let t=`**MCP Tool Call**
4
4
 
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{F as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{E as o,g as s,h as c,o as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as u}from"./useMutation-DyQXZFEF.js";import{t as d}from"./useQueries-B3T1a7qt.js";import{t as f}from"./useQuery-B38jBavx.js";import{D as p,n as m,u as h}from"./active-backend-context-B9942JGX.js";import{t as g,z as _}from"./utils-qjs_KuS4.js";import{t as v}from"./onboarding-modal-dYsjXJwx.js";import{t as y}from"./use-onboarding-completion-STApsofr.js";import{n as b}from"./use-settings-BKpkUS4y.js";import{t as x}from"./modal-backdrop-X-vKo61e.js";import{r as S,t as C}from"./modal-body-DQhiw-AR.js";import{r as w}from"./base-modal-CSHhJTSr.js";import{i as T}from"./modal-classes-YaEEa5eZ.js";import{t as E}from"./brand-button-CQO8oqVo.js";import{t as D}from"./confirmation-modal-gZtbojCm.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as k}from"./folder-C86qXV7M.js";import{t as A}from"./close-CDAVqnTn.js";var j=o(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),M=o(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]);function N(){return new l(p())}function P(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var F=class{static async listWorkspaces(){return P(await N().listWorkspaces())}static async addWorkspaces(e){return P(await N().addWorkspaces(e))}static async removeWorkspace(e){await N().deleteWorkspace(e)}static async addWorkspaceParents(e){return P(await N().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await N().deleteWorkspaceParent(e)}};function ee(){let e=i();return u({mutationFn:e=>F.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function te(){let e=i();return u({mutationFn:e=>F.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function I(){let e=i();return u({mutationFn:e=>F.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function L(){let e=i();return u({mutationFn:e=>F.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}var R=e(t(),1);function z({enabled:e=!0}={}){return f({queryKey:h.all,queryFn:()=>F.listWorkspaces(),enabled:e,retry:(e,t)=>!c(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function B(){return new s(p())}async function V(e,t=B()){let n=[],r=new Set,i;for(;;){let a=await t.searchSubdirectories(e,i?{pageId:i}:void 0);if(n.push(...a.items),i=a.next_page_id,!i)return{items:n,next_page_id:null};if(r.has(i))throw Error(`File search returned a repeated page id`);r.add(i)}}var ne=e=>{let t=m();return f({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},re=()=>{let e=m();return f({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>B().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function ie(){let{data:e,isLoading:t,isError:n,error:r}=z(),i=c(r),a=e?.workspaces??[],o=e?.workspaceParents??[],s=(0,R.useMemo)(()=>{let e=new Set(o.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?o:[...o,...t]},[o,i]),l=d({queries:i?[]:s.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>V(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),f=n||l.some(e=>e.isError);return{workspaces:(0,R.useMemo)(()=>{let e=new Map,t=new Map(s.map((e,t)=>[e.path,l[t]]));return s.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,s,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),parents:s,isLoading:u,isError:f,error:r}}function H(e,t){return c(e)?t(_.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var U=n(),W=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,U.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),G=`/projects`;function K({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,U.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,U.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,U.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:g(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,U.jsx)(k,{width:14,height:14,className:`shrink-0`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function q(e){let t=Y(e);if(!t||t===`/`||J(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function J(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function Y(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function X(e){return e?.home===`/home/openhands`}function ae({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=a(`openhands`),[o,s]=(0,R.useState)(null),c=m(),{data:l}=re();(0,R.useEffect)(()=>{e&&l?.home&&o===null&&s(X(l)?G:l.home),e||s(null)},[e,l?.home,o]),(0,R.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:d,isError:f,error:p}=ne(e?o:null),h=(0,R.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:Y(l.home)||l.home},...l.favorites??[]];return X(l)&&!e.some(e=>e.path===G)&&e.push({label:G,path:G}),e},[l]),v=l?.locations??[];if(!e)return null;let y=u?.items??[],b=o?q(o):null,D=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&o===l?.home&&!d&&!f&&y.length===0,O=e=>{let t=Y(e);if(!t)return`/`;if(t===`/`||J(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,U.jsx)(x,{onClose:t,"aria-label":i(_.HOME$ADD_WORKSPACES_TITLE),children:(0,U.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`xl`),C,`h-[480px]`),children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,U.jsx)(w,{className:T,title:i(_.HOME$ADD_WORKSPACES_TITLE)})}),(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,U.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,U.jsx)(K,{label:i(_.HOME$FAVORITES),entries:h,currentPath:o,onPick:s}),(0,U.jsx)(K,{label:i(_.HOME$LOCATIONS),entries:v,currentPath:o,onPick:s})]}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,U.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>b&&s(b),disabled:!b,"aria-label":i(_.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,U.jsx)(W,{width:16,height:16})}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:o??``})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,U.jsx)(`span`,{children:i(_.HOME$NAME)}),(0,U.jsx)(`span`,{children:i(_.HOME$KIND)})]}),(0,U.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[d&&(0,U.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(_.HOME$LOADING)}),f&&(0,U.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:p?.message??i(_.COMMON$FAILED_TO_LOAD)}),!d&&!f&&y.length===0&&(0,U.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":D?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(D?_.HOME$HOST_HOME_NOT_MOUNTED_HINT:_.HOME$NO_WORKSPACES)}),y.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,U.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(_.HOME$FOLDER)})]})},e.path))]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,U.jsx)(E,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(_.HOME$CANCEL)}),r&&(0,U.jsx)(E,{type:`button`,variant:`secondary`,onClick:()=>{!o||!r||(r([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-add-all-subdirs`,children:i(_.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,U.jsx)(E,{type:`button`,variant:`primary`,onClick:()=>{o&&(n([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-use`,children:i(_.HOME$ADD_THIS_DIRECTORY)})]})]})})}function oe({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:o}){let{t:s}=a(`openhands`),[c,l]=R.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let f=u.length>0||n.length>0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(x,{onClose:r,"aria-label":s(_.HOME$MANAGE_WORKSPACES),children:(0,U.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`lg`),C,`max-h-[70vh]`),children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,U.jsx)(w,{className:T,title:s(_.HOME$MANAGE_WORKSPACES)})}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!f&&(0,U.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(_.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,U.jsx)(`ul`,{children:u.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,U.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,U.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(_.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,U.jsx)(A,{width:12,height:12}),(0,U.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,U.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,U.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(_.HOME$WORKSPACE_PARENTS)}),(0,U.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,U.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,U.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,U.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),o&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(_.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,U.jsx)(A,{width:12,height:12}),(0,U.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,U.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,U.jsx)(k,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,U.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,U.jsx)(E,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(_.HOME$DONE)})})]})}),c&&(0,U.jsx)(D,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):o?.(c.path),l(null))},onCancel:()=>l(null)})]})}var se=`previewOnboardingStep`,ce=3;function Z(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(se);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ce?null:n}function Q(e=typeof window<`u`?window.location.search:``){return Z(e)!=null}function le(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.trim().length>0,r=e?.llm_api_key_set===!0||O(t);return n&&r}function $(){let e=r(),t=Z(e.search),n=Q(e.search),{isCompleted:i,markCompleted:a}=y(),{backend:o}=m(),s=b(),c=o.kind===`cloud`;return!n&&(i||c&&s.isLoading||c&&le(s.data))?null:(0,U.jsx)(v,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{H as a,I as c,L as d,M as f,ae as i,ee as l,Q as n,ie as o,j as p,oe as r,z as s,$ as t,te as u};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{F as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{E as o,g as s,h as c,o as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as u}from"./useMutation-DyQXZFEF.js";import{t as d}from"./useQueries-B3T1a7qt.js";import{t as f}from"./useQuery-B38jBavx.js";import{D as p,n as m,u as h}from"./active-backend-context-BlZPzZNU.js";import{t as g,z as _}from"./utils-qjs_KuS4.js";import{t as v}from"./onboarding-modal-DdvE6rzw.js";import{t as y}from"./use-onboarding-completion-B-2BTS-y.js";import{n as b}from"./use-settings-DBI44RnH.js";import{t as x}from"./modal-backdrop-X-vKo61e.js";import{r as S,t as C}from"./modal-body-DQhiw-AR.js";import{r as w}from"./base-modal-CSHhJTSr.js";import{i as T}from"./modal-classes-YaEEa5eZ.js";import{t as E}from"./brand-button-CQO8oqVo.js";import{t as D}from"./confirmation-modal-gZtbojCm.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as k}from"./folder-C86qXV7M.js";import{t as A}from"./close-CDAVqnTn.js";var j=o(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),M=o(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]);function N(){return new l(p())}function P(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var F=class{static async listWorkspaces(){return P(await N().listWorkspaces())}static async addWorkspaces(e){return P(await N().addWorkspaces(e))}static async removeWorkspace(e){await N().deleteWorkspace(e)}static async addWorkspaceParents(e){return P(await N().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await N().deleteWorkspaceParent(e)}};function ee(){let e=i();return u({mutationFn:e=>F.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function te(){let e=i();return u({mutationFn:e=>F.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function I(){let e=i();return u({mutationFn:e=>F.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function L(){let e=i();return u({mutationFn:e=>F.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}var R=e(t(),1);function z({enabled:e=!0}={}){return f({queryKey:h.all,queryFn:()=>F.listWorkspaces(),enabled:e,retry:(e,t)=>!c(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function B(){return new s(p())}async function V(e,t=B()){let n=[],r=new Set,i;for(;;){let a=await t.searchSubdirectories(e,i?{pageId:i}:void 0);if(n.push(...a.items),i=a.next_page_id,!i)return{items:n,next_page_id:null};if(r.has(i))throw Error(`File search returned a repeated page id`);r.add(i)}}var ne=e=>{let t=m();return f({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},re=()=>{let e=m();return f({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>B().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function ie(){let{data:e,isLoading:t,isError:n,error:r}=z(),i=c(r),a=e?.workspaces??[],o=e?.workspaceParents??[],s=(0,R.useMemo)(()=>{let e=new Set(o.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?o:[...o,...t]},[o,i]),l=d({queries:i?[]:s.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>V(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),f=n||l.some(e=>e.isError);return{workspaces:(0,R.useMemo)(()=>{let e=new Map,t=new Map(s.map((e,t)=>[e.path,l[t]]));return s.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,s,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),parents:s,isLoading:u,isError:f,error:r}}function H(e,t){return c(e)?t(_.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var U=n(),W=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,U.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),G=`/projects`;function K({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,U.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,U.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,U.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:g(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,U.jsx)(k,{width:14,height:14,className:`shrink-0`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function q(e){let t=Y(e);if(!t||t===`/`||J(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function J(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function Y(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function X(e){return e?.home===`/home/openhands`}function ae({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=a(`openhands`),[o,s]=(0,R.useState)(null),c=m(),{data:l}=re();(0,R.useEffect)(()=>{e&&l?.home&&o===null&&s(X(l)?G:l.home),e||s(null)},[e,l?.home,o]),(0,R.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:d,isError:f,error:p}=ne(e?o:null),h=(0,R.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:Y(l.home)||l.home},...l.favorites??[]];return X(l)&&!e.some(e=>e.path===G)&&e.push({label:G,path:G}),e},[l]),v=l?.locations??[];if(!e)return null;let y=u?.items??[],b=o?q(o):null,D=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&o===l?.home&&!d&&!f&&y.length===0,O=e=>{let t=Y(e);if(!t)return`/`;if(t===`/`||J(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,U.jsx)(x,{onClose:t,"aria-label":i(_.HOME$ADD_WORKSPACES_TITLE),children:(0,U.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`xl`),C,`h-[480px]`),children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,U.jsx)(w,{className:T,title:i(_.HOME$ADD_WORKSPACES_TITLE)})}),(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,U.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,U.jsx)(K,{label:i(_.HOME$FAVORITES),entries:h,currentPath:o,onPick:s}),(0,U.jsx)(K,{label:i(_.HOME$LOCATIONS),entries:v,currentPath:o,onPick:s})]}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,U.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>b&&s(b),disabled:!b,"aria-label":i(_.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,U.jsx)(W,{width:16,height:16})}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:o??``})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,U.jsx)(`span`,{children:i(_.HOME$NAME)}),(0,U.jsx)(`span`,{children:i(_.HOME$KIND)})]}),(0,U.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[d&&(0,U.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(_.HOME$LOADING)}),f&&(0,U.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:p?.message??i(_.COMMON$FAILED_TO_LOAD)}),!d&&!f&&y.length===0&&(0,U.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":D?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(D?_.HOME$HOST_HOME_NOT_MOUNTED_HINT:_.HOME$NO_WORKSPACES)}),y.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,U.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(_.HOME$FOLDER)})]})},e.path))]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,U.jsx)(E,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(_.HOME$CANCEL)}),r&&(0,U.jsx)(E,{type:`button`,variant:`secondary`,onClick:()=>{!o||!r||(r([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-add-all-subdirs`,children:i(_.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,U.jsx)(E,{type:`button`,variant:`primary`,onClick:()=>{o&&(n([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-use`,children:i(_.HOME$ADD_THIS_DIRECTORY)})]})]})})}function oe({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:o}){let{t:s}=a(`openhands`),[c,l]=R.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let f=u.length>0||n.length>0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(x,{onClose:r,"aria-label":s(_.HOME$MANAGE_WORKSPACES),children:(0,U.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`lg`),C,`max-h-[70vh]`),children:[(0,U.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,U.jsx)(w,{className:T,title:s(_.HOME$MANAGE_WORKSPACES)})}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!f&&(0,U.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(_.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,U.jsx)(`ul`,{children:u.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,U.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,U.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(_.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,U.jsx)(A,{width:12,height:12}),(0,U.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,U.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,U.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(_.HOME$WORKSPACE_PARENTS)}),(0,U.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,U.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,U.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,U.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),o&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(_.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,U.jsx)(A,{width:12,height:12}),(0,U.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,U.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,U.jsx)(k,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,U.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,U.jsx)(E,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(_.HOME$DONE)})})]})}),c&&(0,U.jsx)(D,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):o?.(c.path),l(null))},onCancel:()=>l(null)})]})}var se=`previewOnboardingStep`,ce=3;function Z(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(se);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ce?null:n}function Q(e=typeof window<`u`?window.location.search:``){return Z(e)!=null}function le(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.trim().length>0,r=e?.llm_api_key_set===!0||O(t);return n&&r}function $(){let e=r(),t=Z(e.search),n=Q(e.search),{isCompleted:i,markCompleted:a}=y(),{backend:o}=m(),s=b(),c=o.kind===`cloud`;return!n&&(i||c&&s.isLoading||c&&le(s.data))?null:(0,U.jsx)(v,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{H as a,I as c,L as d,M as f,ae as i,ee as l,Q as n,ie as o,j as p,oe as r,z as s,$ as t,te as u};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{E as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as o}from"./use-is-creating-conversation-CIAcnd8M.js";import{B as s,J as c,W as l,Y as u,Z as d,it as f,n as p,r as m,rt as h,st as g,z as _}from"./active-backend-context-B9942JGX.js";import{t as v,z as y}from"./utils-qjs_KuS4.js";import{t as b}from"./chat-send-button-D4614wUz.js";import{t as x}from"./check-BMOG005H.js";import{t as S}from"./circle-check-lvN_jFN5.js";import{t as C}from"./loader-circle-6zlEYCJw.js";import{a as w,r as T,t as E}from"./llm-settings-BYo9SN0I.js";import{o as D}from"./use-onboarding-completion-STApsofr.js";import{t as O}from"./use-tracking-De7qByD4.js";import{n as k}from"./use-settings-BKpkUS4y.js";import{t as A}from"./use-save-settings-BZK7zVsK.js";import{t as j}from"./modal-backdrop-X-vKo61e.js";import{r as M,t as N}from"./modal-body-DQhiw-AR.js";import{t as P}from"./brand-button-CQO8oqVo.js";import{n as F}from"./navigation-context-BOGzIng3.js";import{t as I}from"./openhands-logo-CmYvJXBa.js";import{c as L,s as R,t as z}from"./backend-form-modal-C0CIsQvd.js";import{c as B,i as V,n as H,o as U}from"./acp-providers-BHKZvEm5.js";import{n as W,r as G}from"./use-agent-profiles-CliaHofi.js";import{n as K}from"./use-create-conversation-DzcM79TE.js";import{t as ee}from"./terminal-cMS3RgVE.js";import{a as te}from"./badge-B6q3sVom.js";import{t as ne}from"./use-save-agent-profile-Q2M72WgR.js";import{n as re}from"./use-activate-agent-profile-CXDcjVt8.js";import{a as ie,i as ae,n as oe,r as se,t as ce}from"./use-acp-credential-form-CuBXKNvP.js";import{t as le}from"./recommended-automations-launcher-Dye8Li08.js";var ue=a(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),q=e(n(),1),J=r(),de=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,fe=`0 0 100 100`,pe=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,me=`0 0 12 12`,he=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,ge=`0 0 24 24`,_e=3/2;function Y({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,J.jsx)(I,{width:Math.round(t*_e),height:t,className:v(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:fe,width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:de})}):e===`codex`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:me,width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:pe,fill:`currentColor`})}):e===`gemini`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ge,width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:he})}):(0,J.jsx)(ee,{width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ve({currentStep:e,totalSteps:t,className:n}){return(0,J.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:v(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,J.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:v(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function ye(e){return e===`openhands`?`openhands`:H.find(({key:t})=>t===e)?.icon??`cli-generic`}function be({id:e,muted:t}){let n=ye(e);return n===`openhands`?(0,J.jsx)(Y,{kind:`openhands`,size:16,className:v(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,J.jsx)(Y,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function xe(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:y.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...H.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Se({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),{mutate:o,isPending:s}=A();return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(y.ONBOARDING$AGENT_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$AGENT_SUBTITLE)})]}),(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":a(y.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:xe().map(n=>{let r=n.id===e;return(0,J.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:v(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(be,{id:n.id,muted:!1}),(0,J.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(n.descriptionKey)})]}),(0,J.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,J.jsx)(x,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,J.jsxs)(`div`,{className:v(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,J.jsx)(P,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:s,children:a(y.ONBOARDING$BACK)}):null,(0,J.jsx)(P,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:s,onClick:()=>{let t=V(e);if(!t){r();return}o({agent_settings_diff:t},{onError:e=>{h(g(e)||a(y.ERROR$GENERIC))},onSuccess:()=>{f(a(y.SETTINGS$SAVED)),r()}})},children:a(s?y.SETTINGS$SAVING:y.ONBOARDING$NEXT)})]})]})}function Ce({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:v(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,J.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(y.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(y.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=R(r,e,{isConnected:t,lastError:n});return(0,J.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,J.jsx)(ue,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,J.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(y.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,J.jsx)(C,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,J.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(y.ONBOARDING$BACKEND_CHECKING)})]})}function we({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:a,addBackend:o,setActive:f,updateBackend:p}=m(),{trackBackendAdded:h}=O(),{backend:g}=a,b=_(g),x=c(),S=x!==null&&!b&&!(g.kind===`cloud`&&d(g.host,x)),C=b||S,w=q.useMemo(()=>l(),[]),T=C?{id:`onboarding-local-backend-draft`,name:s,host:w.baseUrl,apiKey:w.sessionApiKey,kind:`local`}:g,E=D(b?[]:[g]),k=C?null:E[g.id]?.isConnected??null,A=C?null:E[g.id]?.lastError??null,[j,M]=q.useState(!1);q.useEffect(()=>{k===!0&&M(!1)},[k]);let N=k===!0&&!j,F=q.useCallback((e,r)=>{if(b)o(e);else{let t=e.host!==g.host;p(g.id,e),t&&a.orgId!==null&&f(g.id,null)}h({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),x!==null&&e.kind===`cloud`&&n?n():t()},[a.orgId,o,g.host,g.id,x,b,n,t,f,h,p]),I=v(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(C?x?y.ONBOARDING$LOGIN_TO_CLOUD_TITLE:y.BACKEND$ADD_TITLE:y.ONBOARDING$BACKEND_TITLE)}),C?null:(0,J.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(y.ONBOARDING$BACKEND_SUBTITLE)})]}),C?null:(0,J.jsx)(Ce,{backend:T,isConnected:k,lastError:A}),k===!0?(0,J.jsxs)(`button`,{type:`button`,onClick:()=>M(e=>!e),"aria-expanded":j,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,J.jsx)(`span`,{children:r(j?y.ONBOARDING$BACKEND_HIDE_CONFIGURATION:y.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,J.jsx)(L,{className:v(`h-4 w-4 shrink-0 text-muted transition-transform`,j&&`rotate-180`),"aria-hidden":!0})]}):null,(0,J.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:N?null:(0,J.jsx)(z,{onConnected:F,testIdRoot:`onboarding-backend`,initialManualBackend:T,requireManualApiKey:u(),manualSubmitLabel:r(y.ONBOARDING$NEXT),manualSubmittingLabel:r(y.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),N?(0,J.jsxs)(`div`,{className:I,children:[e?(0,J.jsx)(P,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(y.ONBOARDING$BACK)}):null,(0,J.jsx)(P,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(y.ONBOARDING$NEXT)})]}):null]})}var X=G;function Z(){let e=ne(),t=re();return(0,q.useCallback)(async n=>{try{await e.mutateAsync({name:X,profile:n});let r=(await W.getProfile(X)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Te=`openai/gpt-5.5`;function Ee({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=p(),a=r.kind===`local`,o=T(),s=w(),c=Z(),[l,u]=q.useState(null),[d,f]=q.useState(!1),m=q.useCallback(async()=>{if(!a||!l)return null;let e=l.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=te(t),c={model:t};n&&(c.api_key=n),r&&(c.base_url=r);try{return await o.mutateAsync({name:i,request:{llm:c,include_secrets:!0}}),await s.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[a,l,o,s]),h=q.useCallback(async()=>{f(!0);try{let e=await m();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{f(!1),t()}},[m,c,t]);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(y.ONBOARDING$LLM_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(y.ONBOARDING$LLM_SUBTITLE)})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,J.jsx)(E,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Te},onSaveSuccess:h,onSaveControlChange:u})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(y.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(l?.isSaving??!1)||d,onClick:()=>{if(l?.isDirty){l.save();return}t()},children:n(y.ONBOARDING$NEXT)})]})]})}function De({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),o=p(),{status:s,isChecking:c}=oe(e,{enabled:t}),{fields:l,values:u,setValue:d,secretExists:f,hasValueFor:m,conflicts:h,consumesFileCredentials:g,save:_,isSaving:v}=ce(e),b=Z(),x=B(e)??e,S=s===`authenticated`,C=Oe(o.backend.kind,s),w=S||l.some(e=>e.secret&&(!e.multiline||g)&&m(e.name)),T=C&&!w,E=v||T||c&&!w;return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(y.ONBOARDING$ACP_SECRETS_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):s!==`authenticated`&&(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,J.jsx)(ae,{status:s,isChecking:c,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,J.jsx)(se,{field:e,value:u[e.name]??``,onChange:t=>d(e.name,t),alreadySet:f(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,J.jsx)(ie,{conflicts:h}),T?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:a(y.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:v,children:a(y.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await _()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:U(e)??void 0}),r())},children:a(v?y.SETTINGS$SAVING:y.ONBOARDING$NEXT)})]})]})}function Oe(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function ke({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:a}=F(),{backend:s}=p(),c=s.kind!==`cloud`,l=r(y.ONBOARDING$HELLO_DEFAULT_MESSAGE),[u,d]=q.useState(l),{mutate:f,isPending:m,isSuccess:h}=K(),g=o(),_=m||h||g,v=q.useRef(!1),x=u.trim().length>0&&!_&&!v.current,S=()=>{!x||v.current||(v.current=!0,f({query:u.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`),n()},onError:()=>{v.current=!1}}))};return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,J.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(y.ONBOARDING$HELLO_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(y.ONBOARDING$HELLO_SUBTITLE)})]}),(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),S()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,J.jsx)(`div`,{className:`relative w-full`,children:(0,J.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,J.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(y.ONBOARDING$HELLO_TITLE),type:`text`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),S())},placeholder:l,disabled:_,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,J.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,J.jsx)(b,{buttonClassName:``,handleSubmit:S,disabled:!x})})]}),c?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,J.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(y.LANDING$OR)}),(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(le,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:_,children:r(y.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:_,children:r(y.BUTTON$CLOSE)})]})]})}var Ae=t({OnboardingModal:()=>Ne}),Q=[`backend`,`agent`,`setup`,`hello`],je=[`agent`,`setup`,`hello`],Me=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,J.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:v(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ne({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:a}=k(),o=a?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:l,trackOnboardingCompleted:u,trackOnboardingSkipped:f}=O(),{active:p}=m(),{backend:h}=p,g=_(h),b=D(g?[]:[h]),x=c(),S=x!==null&&h.kind===`cloud`&&d(h.host,x),C=!g&&b[h.id]?.isConnected===!0&&(x===null||S),w=C?je:Q,[T,E]=q.useState(()=>Q[Math.min(Math.max(t,0),Q.length-1)]),[A,P]=q.useState(`openhands`);q.useEffect(()=>{w.includes(T)||E(w[0])},[T,w]);let F=w.length,I=w.includes(T)?T:w[0],L=w.indexOf(I),R=g||b[h.id]?.isConnected!==void 0,z=A===`openhands`,B=L===0&&c()!==null,V=q.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[w]),H=q.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[w]),U=q.useRef(!1);q.useEffect(()=>{n||!o||U.current||window.sessionStorage.getItem(Me)||(U.current=!0,window.sessionStorage.setItem(Me,`1`),s())},[n,o]);let W=q.useRef(null);q.useEffect(()=>{n||!o||!R||W.current!==I&&(W.current=I,l({step:I,stepIndex:L,totalSteps:F,agent:A}))},[n,o,R,I,L,F,A]);let G=()=>{u({agent:A}),e()},K=()=>{f({step:I,stepIndex:L,totalSteps:F,agent:A}),e()};return(0,J.jsx)(j,{"aria-label":r(y.ONBOARDING$TITLE),children:(0,J.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,J.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":L,"data-preview":n?`true`:void 0,className:v(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,M(`lg`),N,`max-h-[90vh]`),children:[(0,J.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,J.jsx)(ve,{currentStep:L,totalSteps:F})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,J.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":L,className:`relative overflow-clip`,children:[C?null:(0,J.jsx)($,{index:w.indexOf(`backend`),currentStep:L,children:(0,J.jsx)(we,{onNext:V,onClose:e})}),(0,J.jsx)($,{index:w.indexOf(`agent`),currentStep:L,children:(0,J.jsx)(Se,{selectedAgentId:A,onSelect:P,onBack:C?void 0:H,onNext:V})}),(0,J.jsx)($,{index:w.indexOf(`setup`),currentStep:L,children:z?(0,J.jsx)(Ee,{onBack:H,onNext:V}):(0,J.jsx)(De,{providerKey:A,isActive:I===`setup`,onBack:H,onNext:V})}),(0,J.jsx)($,{index:w.indexOf(`hello`),currentStep:L,children:(0,J.jsx)(ke,{onBack:H,onClose:K,onLaunched:G})})]})})]}),L<F-1&&!B?(0,J.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:K,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(y.ONBOARDING$SKIP)}):null]})})}export{Ae as n,Y as r,Ne as t};
1
+ import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{E as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as o}from"./use-is-creating-conversation-CIAcnd8M.js";import{B as s,J as c,W as l,Y as u,Z as d,it as f,n as p,r as m,rt as h,st as g,z as _}from"./active-backend-context-BlZPzZNU.js";import{t as v,z as y}from"./utils-qjs_KuS4.js";import{t as b}from"./chat-send-button-D4614wUz.js";import{t as x}from"./check-BMOG005H.js";import{t as S}from"./circle-check-lvN_jFN5.js";import{t as C}from"./loader-circle-6zlEYCJw.js";import{a as w,r as T,t as E}from"./llm-settings-C1vpgWam.js";import{o as D}from"./use-onboarding-completion-B-2BTS-y.js";import{t as O}from"./use-tracking-CN1nIMnY.js";import{n as k}from"./use-settings-DBI44RnH.js";import{t as A}from"./use-save-settings-BRh9p_fv.js";import{t as j}from"./modal-backdrop-X-vKo61e.js";import{r as M,t as N}from"./modal-body-DQhiw-AR.js";import{t as P}from"./brand-button-CQO8oqVo.js";import{n as F}from"./navigation-context-BOGzIng3.js";import{t as I}from"./openhands-logo-CmYvJXBa.js";import{c as L,s as R,t as z}from"./backend-form-modal-Ce-KRHOJ.js";import{c as B,i as V,n as H,o as U}from"./acp-providers-BHKZvEm5.js";import{n as W,r as G}from"./use-agent-profiles-Dmd_4H8q.js";import{n as K}from"./use-create-conversation-Dsa4nzU9.js";import{t as ee}from"./terminal-cMS3RgVE.js";import{a as te}from"./badge-DwgrwohM.js";import{t as ne}from"./use-save-agent-profile-2Mk9ZX37.js";import{n as re}from"./use-activate-agent-profile-DH33MvVj.js";import{a as ie,i as ae,n as oe,r as se,t as ce}from"./use-acp-credential-form-B0_pZ_uS.js";import{t as le}from"./recommended-automations-launcher-BF2mtAKw.js";var ue=a(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),q=e(n(),1),J=r(),de=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,fe=`0 0 100 100`,pe=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,me=`0 0 12 12`,he=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,ge=`0 0 24 24`,_e=3/2;function Y({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,J.jsx)(I,{width:Math.round(t*_e),height:t,className:v(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:fe,width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:de})}):e===`codex`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:me,width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:pe,fill:`currentColor`})}):e===`gemini`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ge,width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:he})}):(0,J.jsx)(ee,{width:t,height:t,className:v(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ve({currentStep:e,totalSteps:t,className:n}){return(0,J.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:v(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,J.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:v(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function ye(e){return e===`openhands`?`openhands`:H.find(({key:t})=>t===e)?.icon??`cli-generic`}function be({id:e,muted:t}){let n=ye(e);return n===`openhands`?(0,J.jsx)(Y,{kind:`openhands`,size:16,className:v(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,J.jsx)(Y,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function xe(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:y.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...H.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Se({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),{mutate:o,isPending:s}=A();return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(y.ONBOARDING$AGENT_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$AGENT_SUBTITLE)})]}),(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":a(y.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:xe().map(n=>{let r=n.id===e;return(0,J.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:v(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(be,{id:n.id,muted:!1}),(0,J.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(n.descriptionKey)})]}),(0,J.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,J.jsx)(x,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,J.jsxs)(`div`,{className:v(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,J.jsx)(P,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:s,children:a(y.ONBOARDING$BACK)}):null,(0,J.jsx)(P,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:s,onClick:()=>{let t=V(e);if(!t){r();return}o({agent_settings_diff:t},{onError:e=>{h(g(e)||a(y.ERROR$GENERIC))},onSuccess:()=>{f(a(y.SETTINGS$SAVED)),r()}})},children:a(s?y.SETTINGS$SAVING:y.ONBOARDING$NEXT)})]})]})}function Ce({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:v(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,J.jsx)(S,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(y.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(y.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=R(r,e,{isConnected:t,lastError:n});return(0,J.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,J.jsx)(ue,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,J.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(y.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,J.jsx)(C,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,J.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(y.ONBOARDING$BACKEND_CHECKING)})]})}function we({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:a,addBackend:o,setActive:f,updateBackend:p}=m(),{trackBackendAdded:h}=O(),{backend:g}=a,b=_(g),x=c(),S=x!==null&&!b&&!(g.kind===`cloud`&&d(g.host,x)),C=b||S,w=q.useMemo(()=>l(),[]),T=C?{id:`onboarding-local-backend-draft`,name:s,host:w.baseUrl,apiKey:w.sessionApiKey,kind:`local`}:g,E=D(b?[]:[g]),k=C?null:E[g.id]?.isConnected??null,A=C?null:E[g.id]?.lastError??null,[j,M]=q.useState(!1);q.useEffect(()=>{k===!0&&M(!1)},[k]);let N=k===!0&&!j,F=q.useCallback((e,r)=>{if(b)o(e);else{let t=e.host!==g.host;p(g.id,e),t&&a.orgId!==null&&f(g.id,null)}h({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),x!==null&&e.kind===`cloud`&&n?n():t()},[a.orgId,o,g.host,g.id,x,b,n,t,f,h,p]),I=v(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(C?x?y.ONBOARDING$LOGIN_TO_CLOUD_TITLE:y.BACKEND$ADD_TITLE:y.ONBOARDING$BACKEND_TITLE)}),C?null:(0,J.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(y.ONBOARDING$BACKEND_SUBTITLE)})]}),C?null:(0,J.jsx)(Ce,{backend:T,isConnected:k,lastError:A}),k===!0?(0,J.jsxs)(`button`,{type:`button`,onClick:()=>M(e=>!e),"aria-expanded":j,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,J.jsx)(`span`,{children:r(j?y.ONBOARDING$BACKEND_HIDE_CONFIGURATION:y.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,J.jsx)(L,{className:v(`h-4 w-4 shrink-0 text-muted transition-transform`,j&&`rotate-180`),"aria-hidden":!0})]}):null,(0,J.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:N?null:(0,J.jsx)(z,{onConnected:F,testIdRoot:`onboarding-backend`,initialManualBackend:T,requireManualApiKey:u(),manualSubmitLabel:r(y.ONBOARDING$NEXT),manualSubmittingLabel:r(y.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),N?(0,J.jsxs)(`div`,{className:I,children:[e?(0,J.jsx)(P,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(y.ONBOARDING$BACK)}):null,(0,J.jsx)(P,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(y.ONBOARDING$NEXT)})]}):null]})}var X=G;function Z(){let e=ne(),t=re();return(0,q.useCallback)(async n=>{try{await e.mutateAsync({name:X,profile:n});let r=(await W.getProfile(X)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Te=`openai/gpt-5.5`;function Ee({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=p(),a=r.kind===`local`,o=T(),s=w(),c=Z(),[l,u]=q.useState(null),[d,f]=q.useState(!1),m=q.useCallback(async()=>{if(!a||!l)return null;let e=l.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=te(t),c={model:t};n&&(c.api_key=n),r&&(c.base_url=r);try{return await o.mutateAsync({name:i,request:{llm:c,include_secrets:!0}}),await s.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[a,l,o,s]),h=q.useCallback(async()=>{f(!0);try{let e=await m();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{f(!1),t()}},[m,c,t]);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(y.ONBOARDING$LLM_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(y.ONBOARDING$LLM_SUBTITLE)})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,J.jsx)(E,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Te},onSaveSuccess:h,onSaveControlChange:u})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(y.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(l?.isSaving??!1)||d,onClick:()=>{if(l?.isDirty){l.save();return}t()},children:n(y.ONBOARDING$NEXT)})]})]})}function De({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),o=p(),{status:s,isChecking:c}=oe(e,{enabled:t}),{fields:l,values:u,setValue:d,secretExists:f,hasValueFor:m,conflicts:h,consumesFileCredentials:g,save:_,isSaving:v}=ce(e),b=Z(),x=B(e)??e,S=s===`authenticated`,C=Oe(o.backend.kind,s),w=S||l.some(e=>e.secret&&(!e.multiline||g)&&m(e.name)),T=C&&!w,E=v||T||c&&!w;return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(y.ONBOARDING$ACP_SECRETS_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):s!==`authenticated`&&(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(y.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,J.jsx)(ae,{status:s,isChecking:c,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,J.jsx)(se,{field:e,value:u[e.name]??``,onChange:t=>d(e.name,t),alreadySet:f(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,J.jsx)(ie,{conflicts:h}),T?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:a(y.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:v,children:a(y.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await _()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:U(e)??void 0}),r())},children:a(v?y.SETTINGS$SAVING:y.ONBOARDING$NEXT)})]})]})}function Oe(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function ke({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:a}=F(),{backend:s}=p(),c=s.kind!==`cloud`,l=r(y.ONBOARDING$HELLO_DEFAULT_MESSAGE),[u,d]=q.useState(l),{mutate:f,isPending:m,isSuccess:h}=K(),g=o(),_=m||h||g,v=q.useRef(!1),x=u.trim().length>0&&!_&&!v.current,S=()=>{!x||v.current||(v.current=!0,f({query:u.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`),n()},onError:()=>{v.current=!1}}))};return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,J.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(y.ONBOARDING$HELLO_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(y.ONBOARDING$HELLO_SUBTITLE)})]}),(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),S()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,J.jsx)(`div`,{className:`relative w-full`,children:(0,J.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,J.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(y.ONBOARDING$HELLO_TITLE),type:`text`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),S())},placeholder:l,disabled:_,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,J.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,J.jsx)(b,{buttonClassName:``,handleSubmit:S,disabled:!x})})]}),c?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,J.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(y.LANDING$OR)}),(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(le,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:_,children:r(y.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:_,children:r(y.BUTTON$CLOSE)})]})]})}var Ae=t({OnboardingModal:()=>Ne}),Q=[`backend`,`agent`,`setup`,`hello`],je=[`agent`,`setup`,`hello`],Me=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,J.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:v(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ne({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:a}=k(),o=a?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:l,trackOnboardingCompleted:u,trackOnboardingSkipped:f}=O(),{active:p}=m(),{backend:h}=p,g=_(h),b=D(g?[]:[h]),x=c(),S=x!==null&&h.kind===`cloud`&&d(h.host,x),C=!g&&b[h.id]?.isConnected===!0&&(x===null||S),w=C?je:Q,[T,E]=q.useState(()=>Q[Math.min(Math.max(t,0),Q.length-1)]),[A,P]=q.useState(`openhands`);q.useEffect(()=>{w.includes(T)||E(w[0])},[T,w]);let F=w.length,I=w.includes(T)?T:w[0],L=w.indexOf(I),R=g||b[h.id]?.isConnected!==void 0,z=A===`openhands`,B=L===0&&c()!==null,V=q.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[w]),H=q.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[w]),U=q.useRef(!1);q.useEffect(()=>{n||!o||U.current||window.sessionStorage.getItem(Me)||(U.current=!0,window.sessionStorage.setItem(Me,`1`),s())},[n,o]);let W=q.useRef(null);q.useEffect(()=>{n||!o||!R||W.current!==I&&(W.current=I,l({step:I,stepIndex:L,totalSteps:F,agent:A}))},[n,o,R,I,L,F,A]);let G=()=>{u({agent:A}),e()},K=()=>{f({step:I,stepIndex:L,totalSteps:F,agent:A}),e()};return(0,J.jsx)(j,{"aria-label":r(y.ONBOARDING$TITLE),children:(0,J.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,J.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":L,"data-preview":n?`true`:void 0,className:v(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,M(`lg`),N,`max-h-[90vh]`),children:[(0,J.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,J.jsx)(ve,{currentStep:L,totalSteps:F})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,J.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":L,className:`relative overflow-clip`,children:[C?null:(0,J.jsx)($,{index:w.indexOf(`backend`),currentStep:L,children:(0,J.jsx)(we,{onNext:V,onClose:e})}),(0,J.jsx)($,{index:w.indexOf(`agent`),currentStep:L,children:(0,J.jsx)(Se,{selectedAgentId:A,onSelect:P,onBack:C?void 0:H,onNext:V})}),(0,J.jsx)($,{index:w.indexOf(`setup`),currentStep:L,children:z?(0,J.jsx)(Ee,{onBack:H,onNext:V}):(0,J.jsx)(De,{providerKey:A,isActive:I===`setup`,onBack:H,onNext:V})}),(0,J.jsx)($,{index:w.indexOf(`hello`),currentStep:L,children:(0,J.jsx)(ke,{onBack:H,onClose:K,onLaunched:G})})]})})]}),L<F-1&&!B?(0,J.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:K,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(y.ONBOARDING$SKIP)}):null]})})}export{Ae as n,Y as r,Ne as t};
@@ -1 +1 @@
1
- import{S as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{I as t}from"./active-backend-context-B9942JGX.js";import"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js";import{t as n}from"./proxy-CN3HaaOW.js";function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(e){if(e)return e;let n=t().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(t){let r=i(t);try{return{orgId:(await n({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(t){if(t instanceof e&&t.status===400)return{orgId:null,isLegacyKey:!0};throw t}}async function s(e,t){let r=await n({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id??``,role:r?.role??null,permissions:Array.isArray(r?.permissions)?r.permissions:null}}export{a as n,o as r,s as t};
1
+ import{S as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{I as t}from"./active-backend-context-BlZPzZNU.js";import"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js";import{t as n}from"./proxy-C79PCMjo.js";function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(e){if(e)return e;let n=t().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(t){let r=i(t);try{return{orgId:(await n({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(t){if(t instanceof e&&t.status===400)return{orgId:null,isLegacyKey:!0};throw t}}async function s(e,t){let r=await n({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id??``,role:r?.role??null,permissions:Array.isArray(r?.permissions)?r.permissions:null}}export{a as n,o as r,s as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{z as i}from"./utils-qjs_KuS4.js";import{b as a,p as o}from"./messages-CYztjKLQ.js";import{t as s}from"./list-todo-_BXQzOiB.js";import{t as c}from"./brand-button-CQO8oqVo.js";import{t as l}from"./conversation-store-C6hSXHw0.js";import{P as u}from"./llm-not-configured-banner-znJFsW_O.js";import{t as d}from"./markdown-renderer-Dkmjmx_d.js";import{t as f}from"./conversation-tab-empty-state-BCMHkGQk.js";var p=e(t(),1),m=n();function h(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=a(p.useRef(null)),{planContent:_,conversationMode:v}=l();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=u();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(c,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(d,{includeStandard:!0,components:o,children:_})})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{z as i}from"./utils-qjs_KuS4.js";import{b as a,p as o}from"./messages-DINDkPNK.js";import{t as s}from"./list-todo-_BXQzOiB.js";import{t as c}from"./brand-button-CQO8oqVo.js";import{t as l}from"./conversation-store-C6hSXHw0.js";import{P as u}from"./llm-not-configured-banner-DTWzISnk.js";import{t as d}from"./markdown-renderer-CvOO0YIr.js";import{t as f}from"./conversation-tab-empty-state-BCMHkGQk.js";var p=e(t(),1),m=n();function h(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=a(p.useRef(null)),{planContent:_,conversationMode:v}=l();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=u();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(c,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(d,{includeStandard:!0,components:o,children:_})})}export{h as default};
@@ -1 +1 @@
1
- import{l as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{D as t,I as n}from"./active-backend-context-B9942JGX.js";function r(){return n().backend.kind===`cloud`}function i(){return new e(t())}var a=class{static async listInstalledPlugins(){if(r())return[];try{return(await i().listInstalledPlugins()).plugins??[]}catch{return[]}}static async installPlugin(e){if(r())throw Error(`Installing plugins is only available on a local backend.`);return i().installPlugin(e)}static async setPluginEnabled(e,t){if(r())throw Error(`Enabling and disabling plugins is only available on a local backend.`);return i().setPluginEnabled(e,t)}static async uninstallPlugin(e){if(r())throw Error(`Uninstalling plugins is only available on a local backend.`);return i().uninstallPlugin(e)}static async refreshPlugin(e){if(r())throw Error(`Refreshing plugins is only available on a local backend.`);return i().refreshPlugin(e)}};export{a as t};
1
+ import{l as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{D as t,I as n}from"./active-backend-context-BlZPzZNU.js";function r(){return n().backend.kind===`cloud`}function i(){return new e(t())}var a=class{static async listInstalledPlugins(){if(r())return[];try{return(await i().listInstalledPlugins()).plugins??[]}catch{return[]}}static async installPlugin(e){if(r())throw Error(`Installing plugins is only available on a local backend.`);return i().installPlugin(e)}static async setPluginEnabled(e,t){if(r())throw Error(`Enabling and disabling plugins is only available on a local backend.`);return i().setPluginEnabled(e,t)}static async uninstallPlugin(e){if(r())throw Error(`Uninstalling plugins is only available on a local backend.`);return i().uninstallPlugin(e)}static async refreshPlugin(e){if(r())throw Error(`Refreshing plugins is only available on a local backend.`);return i().refreshPlugin(e)}};export{a as t};
@@ -1 +1 @@
1
- import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{D as t,I as n}from"./active-backend-context-B9942JGX.js";import{t as r}from"./proxy-CN3HaaOW.js";var i=`/api/v1/settings/profiles`;function a(){let{backend:e,orgId:t}=n();if(e.kind!==`cloud`)throw Error(`Cloud profiles call requires a cloud backend.`);return{backend:e,base:t?`/api/organizations/${encodeURIComponent(t)}/profiles`:i}}async function o(){let{backend:e,base:t}=a();return r({backend:e,method:`GET`,path:t})}async function s(e){let{backend:t,base:n}=a(),i=await r({backend:t,method:`GET`,path:`${n}/${encodeURIComponent(e)}`});return{name:i.name,config:i.config??i.llm??{},api_key_set:i.api_key_set??!1}}async function c(e,t){let{backend:n,base:i}=a();return r({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}`,body:t})}async function l(e){let{backend:t,base:n}=a();return r({backend:t,method:`DELETE`,path:`${n}/${encodeURIComponent(e)}`})}async function u(e,t){let{backend:n,base:i}=a();return r({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function d(e){let{backend:t,base:n}=a(),i=await r({backend:t,method:`POST`,path:`${n}/${encodeURIComponent(e)}/activate`,body:{}});return{name:i.name,message:i.message,llm_applied:i.model!=null||i.llm!=null}}function f(){return n().backend.kind===`cloud`}var p=class{static async listProfiles(){return f()?o():new e(t()).listProfiles()}static async getProfile(n,r){if(f())return s(n);let i=r?{exposeSecrets:r}:{};return new e(t()).getProfile(n,i)}static async saveProfile(n,r){return f()?c(n,r):new e(t()).saveProfile(n,r)}static async deleteProfile(n){return f()?l(n):new e(t()).deleteProfile(n)}static async renameProfile(n,r){return f()?u(n,r):new e(t()).renameProfile(n,r)}static async activateProfile(n){return f()?d(n):new e(t()).activateProfile(n)}};export{p as t};
1
+ import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{D as t,I as n}from"./active-backend-context-BlZPzZNU.js";import{t as r}from"./proxy-C79PCMjo.js";var i=`/api/v1/settings/profiles`;function a(){let{backend:e,orgId:t}=n();if(e.kind!==`cloud`)throw Error(`Cloud profiles call requires a cloud backend.`);return{backend:e,base:t?`/api/organizations/${encodeURIComponent(t)}/profiles`:i}}async function o(){let{backend:e,base:t}=a();return r({backend:e,method:`GET`,path:t})}async function s(e){let{backend:t,base:n}=a(),i=await r({backend:t,method:`GET`,path:`${n}/${encodeURIComponent(e)}`});return{name:i.name,config:i.config??i.llm??{},api_key_set:i.api_key_set??!1}}async function c(e,t){let{backend:n,base:i}=a();return r({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}`,body:t})}async function l(e){let{backend:t,base:n}=a();return r({backend:t,method:`DELETE`,path:`${n}/${encodeURIComponent(e)}`})}async function u(e,t){let{backend:n,base:i}=a();return r({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function d(e){let{backend:t,base:n}=a(),i=await r({backend:t,method:`POST`,path:`${n}/${encodeURIComponent(e)}/activate`,body:{}});return{name:i.name,message:i.message,llm_applied:i.model!=null||i.llm!=null}}function f(){return n().backend.kind===`cloud`}var p=class{static async listProfiles(){return f()?o():new e(t()).listProfiles()}static async getProfile(n,r){if(f())return s(n);let i=r?{exposeSecrets:r}:{};return new e(t()).getProfile(n,i)}static async saveProfile(n,r){return f()?c(n,r):new e(t()).saveProfile(n,r)}static async deleteProfile(n){return f()?l(n):new e(t()).deleteProfile(n)}static async renameProfile(n,r){return f()?u(n,r):new e(t()).renameProfile(n,r)}static async activateProfile(n){return f()?d(n):new e(t()).activateProfile(n)}};export{p as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{F as a,M as o,N as s,_t as c,ht as l,mt as u,pt as d,t as f}from"./active-backend-context-B9942JGX.js";import{t as p}from"./utils-qjs_KuS4.js";import{_ as m,f as h,g,i as _,l as v,m as y,n as b,o as x,p as S,r as C}from"./telemetry-B-2fXtqV.js";import{n as w,t as T}from"./agent-server-ui-style-scope-DdG0ZAHu.js";var E=e(t());function D({i18n:e,defaultNS:t,children:n}){let i=(0,E.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,E.createElement)(r.Provider,{value:i},n)}function O(){let e=(0,E.useSyncExternalStore)(S,x,()=>`pending`),t=(0,E.useRef)(!1);(0,E.useEffect)(()=>{t.current||(t.current=!0,g())},[]),(0,E.useEffect)(()=>{e===`granted`&&m()},[e]);let n=(0,E.useCallback)(()=>h(`granted`),[]),r=(0,E.useCallback)(()=>h(`denied`),[]),i=(0,E.useCallback)((e,t)=>{y(e,t)},[]),a=(0,E.useCallback)(()=>b(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:a}}var k=n(),A=`posthog_bootstrap`;function j(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.distinctID==`string`&&typeof t.sessionID==`string`}function M(){if(typeof window>`u`||typeof sessionStorage>`u`)return;let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`distinct_id`),n=e.get(`session_id`);if(t&&n){let e={distinctID:t,sessionID:n};try{sessionStorage.setItem(A,JSON.stringify(e))}catch{}try{window.history.replaceState(null,``,window.location.pathname+window.location.search)}catch{}return e}try{let e=sessionStorage.getItem(A);if(!e)return;sessionStorage.removeItem(A);let t=JSON.parse(e);return j(t)?t:void 0}catch{try{sessionStorage.removeItem(A)}catch{}return}}function N(){return O(),null}function P({children:e,config:t={}}){let n=E.useRef(!1),r=t!==!1,i=t===!1?void 0:t.apiKey,a=t===!1?void 0:t.apiHost,o=t===!1?void 0:t.uiHost;return E.useLayoutEffect(()=>{_(r?{apiKey:i,apiHost:a,uiHost:o}:!1),n.current||=(C(M()),!0)},[r,a,i,o]),E.useEffect(()=>{r&&v().catch(()=>{})},[r,a,i,o]),(0,k.jsxs)(k.Fragment,{children:[r?(0,k.jsx)(N,{}):null,e]})}function F({children:e,theme:t=w,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=E.useMemo(()=>({...T,...i,...r}),[r,i]);return(0,k.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,k.jsx)(`div`,{className:p(t,a,`text-foreground`),"data-theme":t,children:e})})}var I={provider:`posthog`};function L({children:e,queryClient:t,analytics:n,i18n:r,className:p,contentClassName:m,style:h,styleOverrides:g,theme:_,withStyleRoot:v=!0}){let y=E.useMemo(()=>t??o(),[t]),b=E.useMemo(()=>r??u(),[r]),x=E.useRef(null);x.current||={queryClient:s(),i18n:l()},a(y),c(b),E.useEffect(()=>()=>{x.current&&(a(x.current.queryClient),c(x.current.i18n))},[]);let S=(0,k.jsx)(P,{config:n&&n.provider===`posthog`?{apiKey:n.apiKey,apiHost:n.apiHost,uiHost:n.uiHost}:!1,children:e});return(0,k.jsx)(D,{i18n:b,defaultNS:d,children:(0,k.jsx)(i,{client:y,children:(0,k.jsx)(f,{children:v?(0,k.jsx)(F,{className:p,contentClassName:m,style:h,styleOverrides:g,theme:_,children:S}):S})})})}export{I as n,F as r,L as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{F as a,M as o,N as s,_t as c,ht as l,mt as u,pt as d,t as f}from"./active-backend-context-BlZPzZNU.js";import{t as p}from"./utils-qjs_KuS4.js";import{_ as m,f as h,g,i as _,l as v,m as y,n as b,o as x,p as S,r as C}from"./telemetry-cmCL3o6Z.js";import{n as w,t as T}from"./agent-server-ui-style-scope-DdG0ZAHu.js";var E=e(t());function D({i18n:e,defaultNS:t,children:n}){let i=(0,E.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,E.createElement)(r.Provider,{value:i},n)}function O(){let e=(0,E.useSyncExternalStore)(S,x,()=>`pending`),t=(0,E.useRef)(!1);(0,E.useEffect)(()=>{t.current||(t.current=!0,g())},[]),(0,E.useEffect)(()=>{e===`granted`&&m()},[e]);let n=(0,E.useCallback)(()=>h(`granted`),[]),r=(0,E.useCallback)(()=>h(`denied`),[]),i=(0,E.useCallback)((e,t)=>{y(e,t)},[]),a=(0,E.useCallback)(()=>b(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:a}}var k=n(),A=`posthog_bootstrap`;function j(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.distinctID==`string`&&typeof t.sessionID==`string`}function M(){if(typeof window>`u`||typeof sessionStorage>`u`)return;let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`distinct_id`),n=e.get(`session_id`);if(t&&n){let e={distinctID:t,sessionID:n};try{sessionStorage.setItem(A,JSON.stringify(e))}catch{}try{window.history.replaceState(null,``,window.location.pathname+window.location.search)}catch{}return e}try{let e=sessionStorage.getItem(A);if(!e)return;sessionStorage.removeItem(A);let t=JSON.parse(e);return j(t)?t:void 0}catch{try{sessionStorage.removeItem(A)}catch{}return}}function N(){return O(),null}function P({children:e,config:t={}}){let n=E.useRef(!1),r=t!==!1,i=t===!1?void 0:t.apiKey,a=t===!1?void 0:t.apiHost,o=t===!1?void 0:t.uiHost;return E.useLayoutEffect(()=>{_(r?{apiKey:i,apiHost:a,uiHost:o}:!1),n.current||=(C(M()),!0)},[r,a,i,o]),E.useEffect(()=>{r&&v().catch(()=>{})},[r,a,i,o]),(0,k.jsxs)(k.Fragment,{children:[r?(0,k.jsx)(N,{}):null,e]})}function F({children:e,theme:t=w,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=E.useMemo(()=>({...T,...i,...r}),[r,i]);return(0,k.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,k.jsx)(`div`,{className:p(t,a,`text-foreground`),"data-theme":t,children:e})})}var I={provider:`posthog`};function L({children:e,queryClient:t,analytics:n,i18n:r,className:p,contentClassName:m,style:h,styleOverrides:g,theme:_,withStyleRoot:v=!0}){let y=E.useMemo(()=>t??o(),[t]),b=E.useMemo(()=>r??u(),[r]),x=E.useRef(null);x.current||={queryClient:s(),i18n:l()},a(y),c(b),E.useEffect(()=>()=>{x.current&&(a(x.current.queryClient),c(x.current.i18n))},[]);let S=(0,k.jsx)(P,{config:n&&n.provider===`posthog`?{apiKey:n.apiKey,apiHost:n.apiHost,uiHost:n.uiHost}:!1,children:e});return(0,k.jsx)(D,{i18n:b,defaultNS:d,children:(0,k.jsx)(i,{client:y,children:(0,k.jsx)(f,{children:v?(0,k.jsx)(F,{className:p,contentClassName:m,style:h,styleOverrides:g,theme:_,children:S}):S})})})}export{I as n,F as r,L as t};
@@ -1 +1 @@
1
- import{t as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{E as t,G as n,I as r,U as i}from"./active-backend-context-B9942JGX.js";function a(e){if(e)return e;let t=r().backend;if(t.kind!==`cloud`)throw Error(`Cloud calls require a cloud backend.`);return t}function o(e){let t=r();return t.backend.id===e.id?t.orgId:null}function s(t){let r=a(t),s=i(),c=s?n():{};return new e({host:r.host,apiKey:r.apiKey,orgId:o(r),timeout:3e4,...s?{proxy:{host:s,headers:c}}:{}})}function c(e){let n=s(e);if(!n.proxy)throw new t;return n}async function l(e){return(e.hostOverride?c(e.backend):s(e.backend)).request({method:e.method,path:e.path,body:e.body,headers:e.headers,timeoutSeconds:e.timeoutSeconds,hostOverride:e.hostOverride,authMode:e.authMode===void 0||e.authMode===`bearer`?`bearer`:e.authMode,sessionApiKey:e.sessionApiKey,responseType:e.responseType})}export{l as t};
1
+ import{t as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{E as t,G as n,I as r,U as i}from"./active-backend-context-BlZPzZNU.js";function a(e){if(e)return e;let t=r().backend;if(t.kind!==`cloud`)throw Error(`Cloud calls require a cloud backend.`);return t}function o(e){let t=r();return t.backend.id===e.id?t.orgId:null}function s(t){let r=a(t),s=i(),c=s?n():{};return new e({host:r.host,apiKey:r.apiKey,orgId:o(r),timeout:3e4,...s?{proxy:{host:s,headers:c}}:{}})}function c(e){let n=s(e);if(!n.proxy)throw new t;return n}async function l(e){return(e.hostOverride?c(e.backend):s(e.backend)).request({method:e.method,path:e.path,body:e.body,headers:e.headers,timeoutSeconds:e.timeoutSeconds,hostOverride:e.hostOverride,authMode:e.authMode===void 0||e.authMode===`bearer`?`bearer`:e.authMode,sessionApiKey:e.sessionApiKey,responseType:e.responseType})}export{l as t};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i}from"./use-is-creating-conversation-CIAcnd8M.js";import{n as a}from"./active-backend-context-B9942JGX.js";import{I as o,t as s,z as c}from"./utils-qjs_KuS4.js";import{t as l}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{t as u}from"./use-tracking-De7qByD4.js";import{i as d}from"./settings-service.api-i_HHIqJP.js";import{n as f}from"./use-settings-BKpkUS4y.js";import{t as p}from"./modal-backdrop-X-vKo61e.js";import{n as m}from"./modal-classes-YaEEa5eZ.js";import{t as h}from"./brand-button-CQO8oqVo.js";import{n as g}from"./navigation-context-BOGzIng3.js";import{o as _,s as v,t as y}from"./conversation-store-C6hSXHw0.js";import{t as b}from"./modal-close-button-turIYn0t.js";import{n as x}from"./use-create-conversation-DzcM79TE.js";import{i as S,n as C,r as w,t as T}from"./extension-module-card-classes-Bo43vY5V.js";import{C as E,b as D,g as O,m as k,t as A,y as j}from"./install-server-modal-xCf76eim.js";import{n as M}from"./skill-card-pill-row-D7XCz5uk.js";import{t as N}from"./circle-plus-check-toggle-E3Ecb_gg.js";var P=e(t(),1),F=`${o.PRODUCTION}/settings/integrations`,I=[`github`,`slack`];function L(e){let t=e.requiredIntegrationIds;return t.length>0&&t.every(e=>I.includes(e))}function R(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:c.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:c.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:c.RESPONDER_DEPLOYMENT$LOCAL_ACTION,primaryActionTestId:`responder-deployment-continue-local`,action:{kind:`launch-local`}};case`openhands-cloud`:return{target:e,testId:`responder-deployment-option-openhands-cloud`,titleKey:c.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:c.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:c.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:F}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var z=[`local`,`openhands-cloud`],B=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch for a configurable label on GitHub pull requests, inspect full PR and repository context, and post an AI review comment once per label event.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: cron polling for open GitHub PRs with a configured label such as openhands-review
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i}from"./use-is-creating-conversation-CIAcnd8M.js";import{n as a}from"./active-backend-context-BlZPzZNU.js";import{I as o,t as s,z as c}from"./utils-qjs_KuS4.js";import{t as l}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{t as u}from"./use-tracking-CN1nIMnY.js";import{i as d}from"./settings-service.api-DryhKdSr.js";import{n as f}from"./use-settings-DBI44RnH.js";import{t as p}from"./modal-backdrop-X-vKo61e.js";import{n as m}from"./modal-classes-YaEEa5eZ.js";import{t as h}from"./brand-button-CQO8oqVo.js";import{n as g}from"./navigation-context-BOGzIng3.js";import{o as _,s as v,t as y}from"./conversation-store-C6hSXHw0.js";import{t as b}from"./modal-close-button-turIYn0t.js";import{n as x}from"./use-create-conversation-Dsa4nzU9.js";import{i as S,n as C,r as w,t as T}from"./extension-module-card-classes-Bo43vY5V.js";import{C as E,b as D,g as O,m as k,t as A,y as j}from"./install-server-modal-BI8yUfmr.js";import{n as M}from"./skill-card-pill-row-D7XCz5uk.js";import{t as N}from"./circle-plus-check-toggle-E3Ecb_gg.js";var P=e(t(),1),F=`${o.PRODUCTION}/settings/integrations`,I=[`github`,`slack`];function L(e){let t=e.requiredIntegrationIds;return t.length>0&&t.every(e=>I.includes(e))}function R(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:c.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:c.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:c.RESPONDER_DEPLOYMENT$LOCAL_ACTION,primaryActionTestId:`responder-deployment-continue-local`,action:{kind:`launch-local`}};case`openhands-cloud`:return{target:e,testId:`responder-deployment-option-openhands-cloud`,titleKey:c.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:c.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:c.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:F}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var z=[`local`,`openhands-cloud`],B=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch for a configurable label on GitHub pull requests, inspect full PR and repository context, and post an AI review comment once per label event.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: cron polling for open GitHub PRs with a configured label such as openhands-review
2
2
  Required secret: GITHUB_PERSONAL_ACCESS_TOKEN
3
3
 
4
4
  1. Read repository, trigger label, review tone, and polling schedule from setup.