@openhands/agent-canvas 1.0.0-rc.8 → 1.0.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BqUvf67Q.js → acp-providers-Dzb4nxxB.js} +1 -1
  4. package/build/assets/{active-backend-context-CNF2lPkA.js → active-backend-context-B2OSC-qe.js} +1 -1
  5. package/build/assets/{add-backend-modal-BywVr6uq.js → add-backend-modal-lG8XDYjr.js} +1 -1
  6. package/build/assets/{agent-server-adapter-k8veH-1O.js → agent-server-adapter-BPpZcLOE.js} +3 -3
  7. package/build/assets/agent-server-client-options-wXLeJYeM.js +1 -0
  8. package/build/assets/{agent-server-conversation-service.api-CGbkhsLj.js → agent-server-conversation-service.api-C4Fc9Jnp.js} +1 -1
  9. package/build/assets/{agent-settings-DoHXHcoA.js → agent-settings-Blipgztd.js} +1 -1
  10. package/build/assets/{analytics-consent-form-modal-CVhsAREx.js → analytics-consent-form-modal-Cujm1lCj.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-Dnr5TcV0.js → api-key-entry-screen-BarZU9nr.js} +1 -1
  12. package/build/assets/{app-settings-Bgm2-yOM.js → app-settings-CofRfixq.js} +1 -1
  13. package/build/assets/{automation-detail-86M_yMqz.js → automation-detail-BV4Cn0O8.js} +1 -1
  14. package/build/assets/{automations-list-BWUILrqY.js → automations-list-BaJ61q7P.js} +1 -1
  15. package/build/assets/{backend-form-modal-Dl29wkF5.js → backend-form-modal-B3BCZDPq.js} +1 -1
  16. package/build/assets/{backend-synced-settings-badge-Dcd4712m.js → backend-synced-settings-badge-Da0G6Lwv.js} +1 -1
  17. package/build/assets/{chat-send-button-BhoO7T0s.js → chat-send-button-DzRpAQr4.js} +1 -1
  18. package/build/assets/{condenser-settings-DgQ0rsAf.js → condenser-settings-Bo07FAEi.js} +1 -1
  19. package/build/assets/{conversation-CayU5Lrr.js → conversation-DDdRyW4z.js} +3 -3
  20. package/build/assets/conversation-panel-Dww2uJOd.js +1 -0
  21. package/build/assets/conversation-rGQV1Eym.js +1 -0
  22. package/build/assets/{conversation-service.api-shHWtFwu.js → conversation-service.api-ByRiRU1e.js} +1 -1
  23. package/build/assets/{edit-automation-modal-8y9Uctxo.js → edit-automation-modal-CpA_JKLY.js} +1 -1
  24. package/build/assets/{entry.client-D_wtryHT.js → entry.client-DUpefbBp.js} +1 -1
  25. package/build/assets/{extensions-hub-CoWO3SzQ.js → extensions-hub-BYCLWP3d.js} +1 -1
  26. package/build/assets/{extensions-navigation-D5w2sFQe.js → extensions-navigation-3FLKfb6g.js} +1 -1
  27. package/build/assets/{files-tab-CxdtgkIe.js → files-tab-CBUPwSV1.js} +1 -1
  28. package/build/assets/{home-3joHMYSR.js → home-BDCL0Psk.js} +1 -1
  29. package/build/assets/{install-server-modal-_7l1gcjd.js → install-server-modal-CWZhBKwH.js} +1 -1
  30. package/build/assets/{launch-fU77utLO.js → launch-CMZknx1e.js} +1 -1
  31. package/build/assets/{lesson-plan-CHGc-B8Y.js → lesson-plan-y520IDs6.js} +1 -1
  32. package/build/assets/{llm-client-P9f2gKeW.js → llm-client-D6EtdLBs.js} +1 -1
  33. package/build/assets/{llm-not-configured-banner-BMGzpBPV.js → llm-not-configured-banner-CJyURBCm.js} +1 -1
  34. package/build/assets/llm-settings-BW6yW2Go.js +1 -0
  35. package/build/assets/{llm-settings-yDgbXP6Q.js → llm-settings-CiY22Wzi.js} +1 -1
  36. package/build/assets/{manage-backends-modal-tfdzTXWU.js → manage-backends-modal-v5POMal5.js} +1 -1
  37. package/build/assets/{manifest-bbc1374e.js → manifest-eccb7f46.js} +1 -1
  38. package/build/assets/{mcp-Dopstf0t.js → mcp-DgPFZ_Dv.js} +1 -1
  39. package/build/assets/{messages-CsFUrAen.js → messages-Dq6AQ8mp.js} +1 -1
  40. package/build/assets/{model-selector-sioC8xP4.js → model-selector-CdZs21EZ.js} +1 -1
  41. package/build/assets/{onboarding-CQh50i2z.js → onboarding-Cdwu8QIy.js} +1 -1
  42. package/build/assets/{option-service.api-DjPvPAtd.js → option-service.api-CdYnKVsu.js} +1 -1
  43. package/build/assets/{organization-service.api-BNc9Kn6n.js → organization-service.api-CzMvXIQT.js} +1 -1
  44. package/build/assets/{path-utils-YlkpoImJ.js → path-utils-DKu3CNkH.js} +1 -1
  45. package/build/assets/{planner-tab-DjIFIQDk.js → planner-tab-YkOp7QXt.js} +1 -1
  46. package/build/assets/{profiles-client-BNvHck-I.js → profiles-client-BjUo3q05.js} +1 -1
  47. package/build/assets/{providers-BiWSYwRT.js → providers-CbpQft-X.js} +1 -1
  48. package/build/assets/{proxy--Uy1iGsW.js → proxy-Bx3NeKeo.js} +1 -1
  49. package/build/assets/{recommended-automations-launcher-DCi0RXIj.js → recommended-automations-launcher-WxaZcjRD.js} +1 -1
  50. package/build/assets/{root-DrHpnAqU.js → root-CiNoOVrb.js} +2 -2
  51. package/build/assets/{root-layout-Cf7FC9DC.js → root-layout-DUw-s9LS.js} +2 -2
  52. package/build/assets/{sdk-section-page-COlGKv4E.js → sdk-section-page-DPBwwLle.js} +1 -1
  53. package/build/assets/{secrets-service-D6Gcymcs.js → secrets-service-Skzza9sx.js} +1 -1
  54. package/build/assets/{secrets-settings-DYfTc5c8.js → secrets-settings-DmpsTC9V.js} +1 -1
  55. package/build/assets/{settings-DRmVFdOc.js → settings-ChsRtIJQ.js} +1 -1
  56. package/build/assets/{settings-index-B035V2pu.js → settings-index-BLfmrKRl.js} +1 -1
  57. package/build/assets/{settings-modal-CeRvS5Bc.js → settings-modal-Cth7Zb-I.js} +1 -1
  58. package/build/assets/{settings-service.api-CFt5HmXD.js → settings-service.api-CcpckquT.js} +1 -1
  59. package/build/assets/{shared-conversation-CBbpyPaD.js → shared-conversation-Y0C8zqdr.js} +1 -1
  60. package/build/assets/{sidebar-mobile-menu-toggle-SKcwsEtD.js → sidebar-mobile-menu-toggle-BvcBXvLY.js} +1 -1
  61. package/build/assets/{sidebar-nav-link-CPWuQ_c6.js → sidebar-nav-link-BekRAssb.js} +1 -1
  62. package/build/assets/{skills-client-Ui_9FvXp.js → skills-client-CgraS-wA.js} +1 -1
  63. package/build/assets/{skills-plugins-Dc4ec3CW.js → skills-plugins-rIza_fUf.js} +1 -1
  64. package/build/assets/{skills-settings-B6HwvA0S.js → skills-settings-Dvl7gpEx.js} +1 -1
  65. package/build/assets/{telemetry-DCFAqpIA.js → telemetry-CAWBJ_rB.js} +1 -1
  66. package/build/assets/{terminal-CltMeLv4.js → terminal-BFypysgZ.js} +1 -1
  67. package/build/assets/{use-acp-credential-form-LjCIhMSK.js → use-acp-credential-form-Dj7Jkhgp.js} +1 -1
  68. package/build/assets/{use-active-conversation-B0_rXnqa.js → use-active-conversation-BkohEtaN.js} +1 -1
  69. package/build/assets/{use-agent-settings-schema-D8x5LJVS.js → use-agent-settings-schema-Lf_lBAky.js} +1 -1
  70. package/build/assets/{use-agent-state-BuOzLeFN.js → use-agent-state-DITv5qV7.js} +1 -1
  71. package/build/assets/{use-cloud-current-user-id-DVZXa_WH.js → use-cloud-current-user-id-CSm3kgqy.js} +1 -1
  72. package/build/assets/{use-config-5zEjywCL.js → use-config-DVU9HaPf.js} +1 -1
  73. package/build/assets/{use-create-conversation-pV2eA-e9.js → use-create-conversation-CJUAOf1q.js} +1 -1
  74. package/build/assets/{use-create-secret-ClPpLBgD.js → use-create-secret-LObNBU3M.js} +1 -1
  75. package/build/assets/{use-handle-plan-click-CwN_nNib.js → use-handle-plan-click-BdcdMWbv.js} +1 -1
  76. package/build/assets/{use-llm-profiles-CWLfWjav.js → use-llm-profiles-BBTR-OsK.js} +1 -1
  77. package/build/assets/use-runtime-is-ready-BOQpqCvp.js +1 -0
  78. package/build/assets/{use-save-settings-Xp8DD-jf.js → use-save-settings-7_MLft-Y.js} +1 -1
  79. package/build/assets/{use-settings-0SeqaDeW.js → use-settings-CNsxccvQ.js} +1 -1
  80. package/build/assets/{use-settings-nav-items-DVrMNk0I.js → use-settings-nav-items-ykMjd_NG.js} +1 -1
  81. package/build/assets/{use-skills-Bv8LXrys.js → use-skills-_unimM2d.js} +1 -1
  82. package/build/assets/{use-tracking-BhyV5A9i.js → use-tracking-C9P88zSo.js} +1 -1
  83. package/build/assets/{use-user-conversation-6yFVEXiG.js → use-user-conversation-2jZZ-MLA.js} +1 -1
  84. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-CGm-Jxp5.js → vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-DQE89epK.js} +1 -1
  85. package/build/assets/{verification-settings-Be6NxjuT.js → verification-settings-EUkt_CkZ.js} +1 -1
  86. package/build/index.html +4 -4
  87. package/config/defaults.json +1 -6
  88. package/dist/package.cjs +1 -1
  89. package/dist/package.cjs.map +1 -1
  90. package/dist/package.js +1 -1
  91. package/dist/package.js.map +1 -1
  92. package/dist/utils/websocket-url.cjs +1 -1
  93. package/dist/utils/websocket-url.cjs.map +1 -1
  94. package/dist/utils/websocket-url.js +2 -2
  95. package/dist/utils/websocket-url.js.map +1 -1
  96. package/package.json +1 -1
  97. package/build/assets/agent-server-client-options-B-C8JaTb.js +0 -1
  98. package/build/assets/conversation-erinyBqT.js +0 -1
  99. package/build/assets/conversation-panel-DiI4q-8-.js +0 -1
  100. package/build/assets/llm-settings-BRotm_g6.js +0 -1
  101. package/build/assets/use-runtime-is-ready-Bbory9-s.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as r}from"./useMutation-Dm84WAKR.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{n as o}from"./QueryClientProvider-XcSjsfpb.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{g as c,m as l,p as u}from"./query-client-config-Ca3tW1AH.js";import{t as d}from"./createLucideIcon-CkGTf9Qj.js";import{r as f}from"./vendor~root-layout~home~mcp~automations-list-D40jgugf.js";import{n as p,r as m}from"./circle-plus-check-toggle-AO9DWyDX.js";import{t as h}from"./trash-2-C-RvV8WA.js";import{t as g}from"./x-CCfDppg5.js";import{t as _}from"./utils-eXk6yerZ.js";import{c as v,n as y}from"./active-backend-context-CNF2lPkA.js";import{t as b}from"./modal-backdrop-_VbcKk5K.js";import{n as x}from"./modal-classes-CNm4ovfm.js";import{c as S,t as C}from"./brand-button-9SOzmqPP.js";import{t as w}from"./modal-close-button-Dbo0NAMt.js";import{n as T,t as E}from"./settings-input-BM8ANxDb.js";import{t as D}from"./confirmation-modal-Cq3eqvqH.js";import{t as O}from"./settings-service.api-CFt5HmXD.js";import{a as k,i as A,r as j}from"./use-settings-0SeqaDeW.js";import{a as M,n as N,o as P,r as F,t as I}from"./extension-module-card-classes-DP5J6ngE.js";import{t as ee}from"./settings-dropdown-input-BP-arqjU.js";import{a as L,c as R,d as z,f as te,i as B,m as ne,n as re,p as V,r as H,s as U,t as W,u as G}from"./install-server-modal-_7l1gcjd.js";import{n as K}from"./extensions-navigation-D5w2sFQe.js";import{t as q}from"./enum-filter-dropdown-COqUq3mB.js";import{n as J}from"./settings-like-page-layout-classes-C335ikW2.js";var Y=d(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),X=e(t(),1);function Z(){let e=o(),{data:t}=j();return r({mutationFn:async e=>{let n=A(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 O.saveSettings({agent_settings_diff:{mcp_config:k(r)}})},onSuccess:()=>{e.invalidateQueries({queryKey:v.personal()})}})}var Q=i();function ie(e){switch(e){case`sse`:return`SSE`;case`shttp`:return`HTTP`;case`stdio`:return`STDIO`;default:return e}}function ae(e){return e.type===`stdio`?e.name??e.command??``:e.url??``}function oe(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 se({server:e,onEdit:t,onDelete:n}){let{t:r}=s(`openhands`),i=L(e,G(f)),o=i?.name??ae(e),c=oe(e),l=ie(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(a.MCP$EDIT_SERVER_ARIA,{name:o}),className:_(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,M,F),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(B,{entry:i,fallback:(0,Q.jsx)(Y,{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:l})]}),(0,Q.jsx)(p,{testId:`mcp-installed-toggle-${e.id}`,isSelected:!0,onToggle:e=>{e||n()},enableLabelKey:a.MCP$TOGGLE_ADD_SERVER,disableLabelKey:a.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,c?(0,Q.jsx)(`p`,{"data-testid":`mcp-server-detail-${e.id}`,className:`truncate text-xs text-tertiary-alt`,title:c,children:c}):null]})]})})}function ce({servers:e,hasAnyInstalled:t,query:n=``,onEdit:r,onDelete:i}){let{t:o}=s(`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(a.MCP$SEARCH_EMPTY)})}):(0,Q.jsxs)(`div`,{"data-testid":`mcp-installed-empty`,className:P,children:[(0,Q.jsx)(`p`,{className:`text-sm text-white`,children:o(a.MCP$INSTALLED_EMPTY_TITLE)}),(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light mt-1`,children:o(a.MCP$INSTALLED_EMPTY_HINT)})]}):(0,Q.jsx)(`div`,{className:N,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:I,children:e.map(e=>(0,Q.jsx)(se,{server:e,onEdit:()=>r(e),onDelete:()=>i(e.id)},e.id))})})}function le({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)(`button`,{type:`button`,onClick:t,"data-testid":`mcp-marketplace-card-${e.id}`,className:_(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,M,F),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(B,{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)(p,{testId:`mcp-marketplace-toggle-${e.id}`,isSelected:!1,onToggle:e=>{e&&n()},enableLabelKey:a.MCP$TOGGLE_ADD_SERVER,disableLabelKey:a.MCP$TOGGLE_ADD_SERVER})]}),(0,Q.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})})}function ue({backendKind:e,onSelect:t,onAdd:n,query:r=``}){let{t:i}=s(`openhands`),o=R(G(f)).filter(t=>te(t,e)&&V(t,r));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:i(a.MCP$LIBRARY_TITLE)}),o.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:i(a.MCP$SEARCH_EMPTY)})}):(0,Q.jsx)(`div`,{className:N,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:I,children:o.map(e=>(0,Q.jsx)(le,{entry:e,onClick:()=>t(e),onAdd:()=>n(e)},e.id))})})]})}function de({mode:e,server:t,existingServers:n,onSubmit:r,onCancel:i,onDelete:o,isActionDisabled:c=!1,onTest:l,isTestPending:u=!1,testMessage:d=null}){let{t:f}=s(`openhands`),[p,m]=X.useState(t?.type||`sse`),[g,v]=X.useState(null),y=X.useRef(null),b=[{key:`sse`,label:f(a.SETTINGS$MCP_SERVER_TYPE_SSE)},{key:`stdio`,label:f(a.SETTINGS$MCP_SERVER_TYPE_STDIO)},{key:`shttp`,label:f(a.SETTINGS$MCP_SERVER_TYPE_SHTTP)}],x=e=>{if(!e)return f(a.SETTINGS$MCP_ERROR_URL_REQUIRED);try{let t=new URL(e);if(![`http:`,`https:`].includes(t.protocol))return f(a.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL)}catch{return f(a.SETTINGS$MCP_ERROR_URL_INVALID)}return null},w=e=>e?/^[a-zA-Z0-9_-]+$/.test(e)?null:f(a.SETTINGS$MCP_ERROR_NAME_INVALID):f(a.SETTINGS$MCP_ERROR_NAME_REQUIRED),D=r=>!n||!(e===`add`||e===`edit`&&t?.name!==r)?null:n.filter(e=>e.type===`stdio`).map(e=>e.name).filter(Boolean).includes(r)?f(a.SETTINGS$MCP_ERROR_NAME_DUPLICATE):null,O=e=>e?e.includes(` `)?f(a.SETTINGS$MCP_ERROR_COMMAND_NO_SPACES):null:f(a.SETTINGS$MCP_ERROR_COMMAND_REQUIRED),k=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)?f(a.SETTINGS$MCP_ERROR_URL_DUPLICATE):null},A=e=>{if(!e.trim())return null;let t=e.split(`
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as r}from"./useMutation-Dm84WAKR.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{n as o}from"./QueryClientProvider-XcSjsfpb.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{g as c,m as l,p as u}from"./query-client-config-Ca3tW1AH.js";import{t as d}from"./createLucideIcon-CkGTf9Qj.js";import{r as f}from"./vendor~root-layout~home~mcp~automations-list-D40jgugf.js";import{n as p,r as m}from"./circle-plus-check-toggle-AO9DWyDX.js";import{t as h}from"./trash-2-C-RvV8WA.js";import{t as g}from"./x-CCfDppg5.js";import{t as _}from"./utils-eXk6yerZ.js";import{c as v,n as y}from"./active-backend-context-B2OSC-qe.js";import{t as b}from"./modal-backdrop-_VbcKk5K.js";import{n as x}from"./modal-classes-CNm4ovfm.js";import{c as S,t as C}from"./brand-button-9SOzmqPP.js";import{t as w}from"./modal-close-button-Dbo0NAMt.js";import{n as T,t as E}from"./settings-input-BM8ANxDb.js";import{t as D}from"./confirmation-modal-Cq3eqvqH.js";import{t as O}from"./settings-service.api-CcpckquT.js";import{a as k,i as A,r as j}from"./use-settings-CNsxccvQ.js";import{a as M,n as N,o as P,r as F,t as I}from"./extension-module-card-classes-DP5J6ngE.js";import{t as ee}from"./settings-dropdown-input-BP-arqjU.js";import{a as L,c as R,d as z,f as te,i as B,m as ne,n as re,p as V,r as H,s as U,t as W,u as G}from"./install-server-modal-CWZhBKwH.js";import{n as K}from"./extensions-navigation-3FLKfb6g.js";import{t as q}from"./enum-filter-dropdown-COqUq3mB.js";import{n as J}from"./settings-like-page-layout-classes-C335ikW2.js";var Y=d(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),X=e(t(),1);function Z(){let e=o(),{data:t}=j();return r({mutationFn:async e=>{let n=A(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 O.saveSettings({agent_settings_diff:{mcp_config:k(r)}})},onSuccess:()=>{e.invalidateQueries({queryKey:v.personal()})}})}var Q=i();function ie(e){switch(e){case`sse`:return`SSE`;case`shttp`:return`HTTP`;case`stdio`:return`STDIO`;default:return e}}function ae(e){return e.type===`stdio`?e.name??e.command??``:e.url??``}function oe(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 se({server:e,onEdit:t,onDelete:n}){let{t:r}=s(`openhands`),i=L(e,G(f)),o=i?.name??ae(e),c=oe(e),l=ie(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(a.MCP$EDIT_SERVER_ARIA,{name:o}),className:_(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,M,F),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(B,{entry:i,fallback:(0,Q.jsx)(Y,{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:l})]}),(0,Q.jsx)(p,{testId:`mcp-installed-toggle-${e.id}`,isSelected:!0,onToggle:e=>{e||n()},enableLabelKey:a.MCP$TOGGLE_ADD_SERVER,disableLabelKey:a.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,c?(0,Q.jsx)(`p`,{"data-testid":`mcp-server-detail-${e.id}`,className:`truncate text-xs text-tertiary-alt`,title:c,children:c}):null]})]})})}function ce({servers:e,hasAnyInstalled:t,query:n=``,onEdit:r,onDelete:i}){let{t:o}=s(`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(a.MCP$SEARCH_EMPTY)})}):(0,Q.jsxs)(`div`,{"data-testid":`mcp-installed-empty`,className:P,children:[(0,Q.jsx)(`p`,{className:`text-sm text-white`,children:o(a.MCP$INSTALLED_EMPTY_TITLE)}),(0,Q.jsx)(`p`,{className:`text-xs text-tertiary-light mt-1`,children:o(a.MCP$INSTALLED_EMPTY_HINT)})]}):(0,Q.jsx)(`div`,{className:N,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:I,children:e.map(e=>(0,Q.jsx)(se,{server:e,onEdit:()=>r(e),onDelete:()=>i(e.id)},e.id))})})}function le({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)(`button`,{type:`button`,onClick:t,"data-testid":`mcp-marketplace-card-${e.id}`,className:_(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,M,F),children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(B,{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)(p,{testId:`mcp-marketplace-toggle-${e.id}`,isSelected:!1,onToggle:e=>{e&&n()},enableLabelKey:a.MCP$TOGGLE_ADD_SERVER,disableLabelKey:a.MCP$TOGGLE_ADD_SERVER})]}),(0,Q.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})})}function ue({backendKind:e,onSelect:t,onAdd:n,query:r=``}){let{t:i}=s(`openhands`),o=R(G(f)).filter(t=>te(t,e)&&V(t,r));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:i(a.MCP$LIBRARY_TITLE)}),o.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:i(a.MCP$SEARCH_EMPTY)})}):(0,Q.jsx)(`div`,{className:N,children:(0,Q.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:I,children:o.map(e=>(0,Q.jsx)(le,{entry:e,onClick:()=>t(e),onAdd:()=>n(e)},e.id))})})]})}function de({mode:e,server:t,existingServers:n,onSubmit:r,onCancel:i,onDelete:o,isActionDisabled:c=!1,onTest:l,isTestPending:u=!1,testMessage:d=null}){let{t:f}=s(`openhands`),[p,m]=X.useState(t?.type||`sse`),[g,v]=X.useState(null),y=X.useRef(null),b=[{key:`sse`,label:f(a.SETTINGS$MCP_SERVER_TYPE_SSE)},{key:`stdio`,label:f(a.SETTINGS$MCP_SERVER_TYPE_STDIO)},{key:`shttp`,label:f(a.SETTINGS$MCP_SERVER_TYPE_SHTTP)}],x=e=>{if(!e)return f(a.SETTINGS$MCP_ERROR_URL_REQUIRED);try{let t=new URL(e);if(![`http:`,`https:`].includes(t.protocol))return f(a.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL)}catch{return f(a.SETTINGS$MCP_ERROR_URL_INVALID)}return null},w=e=>e?/^[a-zA-Z0-9_-]+$/.test(e)?null:f(a.SETTINGS$MCP_ERROR_NAME_INVALID):f(a.SETTINGS$MCP_ERROR_NAME_REQUIRED),D=r=>!n||!(e===`add`||e===`edit`&&t?.name!==r)?null:n.filter(e=>e.type===`stdio`).map(e=>e.name).filter(Boolean).includes(r)?f(a.SETTINGS$MCP_ERROR_NAME_DUPLICATE):null,O=e=>e?e.includes(` `)?f(a.SETTINGS$MCP_ERROR_COMMAND_NO_SPACES):null:f(a.SETTINGS$MCP_ERROR_COMMAND_REQUIRED),k=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)?f(a.SETTINGS$MCP_ERROR_URL_DUPLICATE):null},A=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 f(a.SETTINGS$MCP_ERROR_ENV_INVALID_FORMAT)}}return null},j=e=>{if(!e.trim())return null;let t=parseInt(e.trim(),10);return Number.isNaN(t)?f(a.SETTINGS$MCP_ERROR_TIMEOUT_INVALID_NUMBER):t<=0?f(a.SETTINGS$MCP_ERROR_TIMEOUT_POSITIVE):t>3600?f(a.SETTINGS$MCP_ERROR_TIMEOUT_MAX_EXCEEDED):null},M=e=>{let t=e.get(`name`)?.toString().trim()||``,n=e.get(`command`)?.toString().trim()||``,r=e.get(`env`)?.toString()||``;return w(t)||D(t)||O(n)||A(r)||null},N=e=>{if(p===`sse`||p===`shttp`){let t=e.get(`url`)?.toString().trim()||``,n=x(t);if(n)return n;let r=k(t);if(r)return r;if(p===`shttp`){let t=j(e.get(`timeout`)?.toString()||``);if(t)return t}return null}return p===`stdio`?M(e):null},P=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},F=e=>e?Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
4
4
  `):``,I=e=>{let n={id:t?.id||`${p}-${Date.now()}`,type:p};if(p===`sse`||p===`shttp`){let t=e.get(`url`)?.toString().trim(),r=e.get(`api_key`)?.toString().trim(),i=e.get(`timeout`)?.toString().trim(),a={...n,url:t,...r&&{api_key:r}};if(p===`shttp`&&i){let e=parseInt(i,10);Number.isNaN(e)||(a.timeout=e)}return a}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-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{u as n}from"./path-utils-YlkpoImJ.js";import{t as r}from"./useMutation-Dm84WAKR.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{t as o}from"./Trans-sy4l4TyQ.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{x as c}from"./query-client-config-Ca3tW1AH.js";import{t as l}from"./createLucideIcon-CkGTf9Qj.js";import{t as u}from"./chevron-down-B9j6lcFg.js";import{t as d}from"./loader-circle-1XB9nbwF.js";import{A as f,S as p,t as m}from"./utils-eXk6yerZ.js";import{n as h}from"./common-Dh7OqABE.js";import{t as g}from"./use-config-5zEjywCL.js";import{f as _,m as v,p as y}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-BmZcy_kH.js";import{t as ee}from"./styled-tooltip-X61SEwqk.js";import{t as te}from"./react-Dy05vyj5.js";import{t as b}from"./conversation-store-FQmakEd-.js";import{s as x}from"./conversation-local-storage-an3MiIiJ.js";import{r as ne}from"./use-settings-0SeqaDeW.js";import{n as re}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-COLUW-6M.js";import{t as S}from"./skills-BE5HJuGM.js";import{t as C}from"./close--W-tHn1h.js";import{r as w}from"./typography-BLSEGjph.js";import{t as ie}from"./u-check-circle-dG_VJqx5.js";import{n as ae,r as T,t as E}from"./use-active-conversation-B0_rXnqa.js";import{n as oe}from"./files-tab-store-DSKUhziI.js";import{t as se}from"./use-agent-state-BuOzLeFN.js";import{d as ce,f as le,p as ue,r as de,t as fe}from"./lesson-plan-CHGc-B8Y.js";import{a as pe,g as me,i as D,r as O,t as he,v as k,w as ge,x as _e,y as A}from"./use-event-store-DNSmyzUh.js";import{ot as ve,st as ye}from"./vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dqpi2xyZ.js";import{n as j,r as be,t as M}from"./markdown-renderer-z446oW0Z.js";import{n as xe,r as Se,t as Ce}from"./plan-components-CutRBi0G.js";import{n as we,t as Te}from"./u-check-circle-half-D-5ZPRnd.js";import{n as Ee,t as De}from"./lightbulb-S616sGEL.js";var Oe=l(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),N=e(t(),1);function ke(){!y.current&&_();let[e]=(0,N.useState)(v.current);return e}var P=i(),F=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}(F||{});function Ae(){let{conversationId:e}=T(),t=de();return{send:(0,N.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:F.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),L=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function Me({status:e}){return(0,P.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,P.jsx)(re,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let[s,c]=N.useState(r),l=t?(0,P.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,P.jsx)(L,{className:m(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,P.jsx)(I,{className:m(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,P.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&l,o,(0,P.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,P.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,P.jsx)(Me,{status:n})]})]}),s&&(typeof t==`string`?(0,P.jsx)(M,{children:t}):t)]})}var Ne=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,P.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,P.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsx)(`defs`,{children:(0,P.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,P.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function Pe({profile:e}){let[t,r]=N.useState(!1);return(0,P.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,P.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,P.jsx)(u,{size:14}):(0,P.jsx)(n,{size:14})}),(0,P.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`border-neutral-700`}),(0,P.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function Fe({conversationId:e,anchorEventId:t}){let n=le(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,P.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,P.jsx)(R,{title:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Ne,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,P.jsx)(o,{i18nKey:a.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,P.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,P.jsx)(R,{title:(0,P.jsx)(`span`,{children:t?(0,P.jsx)(o,{i18nKey:a.MODEL$NO_SAVED_PROFILES}):(0,P.jsx)(o,{i18nKey:a.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,P.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,P.jsx)(o,{i18nKey:a.MODEL$NO_PROFILES_HINT})}):(0,P.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,P.jsx)(Pe,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var z=(0,N.createContext)(void 0);function Ie({children:e,value:t}){let n=Se(N.useRef(null)),r=t||n;return(0,P.jsx)(z.Provider,{value:r,children:e})}function Le(){let e=(0,N.useContext)(z);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function Re(){return(0,N.useContext)(z)}var ze=()=>{let{setConversationMode:e}=b(),{send:t}=Ae(),{conversationId:n}=T(),r=ue(e=>e.enqueuePendingMessage),i=ue(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,N.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])}},Be=`200%`,B=8,Ve=B*2;function He({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=ke(),c=`oh-text-shimmer-${(0,N.useId)().replace(/:/g,``)}`,l=(0,N.useMemo)(()=>Math.min(B/2-1,1+i/2),[i]),u=(0,N.useMemo)(()=>{let e=B/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) ${B}%)`,backgroundSize:`${Be} 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,P.jsx)(t,{className:m(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${Ve}% center}to{background-position:0% center}}`}}),(0,P.jsx)(t,{className:m(`relative inline-block`,n),style:u,...o,children:e})]})}var Ue=N.memo(He),We=3,Ge=24;function Ke({className:e}){return(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,P.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,P.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var qe={p:({children:e})=>(0,P.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function Je({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),o=N.useRef(null),[c,l]=N.useState(!1);N.useLayoutEffect(()=>{let t=o.current;if(!t||n){l(!1),r(!1);return}let i=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),i=We*(Number.isFinite(n)&&n>0?n:Ge),a=(e.match(/\n/g)??[]).length,o=t.scrollHeight>i+1||a>=We||e.trim().length>220;l(e=>(e!==o&&r(o),o))};i();let a=new ResizeObserver(i);return a.observe(t),()=>a.disconnect()},[e,n,r]);let u=c&&!n;return(0,P.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,P.jsx)(`div`,{ref:o,className:m(`text-sm leading-6 whitespace-normal [word-break:break-word]`,u&&`line-clamp-3`),children:(0,P.jsx)(M,{includeStandard:!0,includeHeadings:!0,components:qe,children:e})}),u?(0,P.jsxs)(P.Fragment,{children:[(0,P.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,P.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:m(`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(a.COMMON$VIEW_MORE)})]}):null]})}function V({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:o,onRetry:c,onStop:l}){let{t:u}=s(`openhands`),[d,f]=N.useState(!1),[p,h]=N.useState(!1),[g,_]=N.useState(!1),[v,y]=N.useState(!1),[te,b]=N.useState(!0),x=N.useRef(null);N.useEffect(()=>{_(!1)},[t]);let ne=async()=>{await navigator.clipboard.writeText(t),h(!0)};N.useEffect(()=>{let e;return p&&(e=setTimeout(()=>{h(!1)},2e3)),()=>{clearTimeout(e)}},[p]);let re=e===`user`&&(o===`error`||o===`sending`),S=o===`sending`&&l!=null,C=S&&d,w=e===`user`&&o==null,ie=w&&v&&!g,ae=N.Children.count(n)>0;N.useLayoutEffect(()=>{if(!S||w)return;let e=x.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:Ge;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,S,w]);let T=w?(0,P.jsx)(Je,{message:t,isHovering:d,isExpanded:g,onTruncatableChange:y}):(0,P.jsx)(`div`,{ref:x,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,P.jsx)(M,{includeStandard:!0,includeHeadings:!0,components:qe,children:t})}),E=(0,P.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":o,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:m(`rounded-xl relative w-fit max-w-full flex flex-col`,ae&&`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`,o===`error`&&`border border-[var(--oh-status-error)]/40`,!re&&`last:mb-4`),children:[(0,P.jsxs)(`div`,{className:m(`absolute -top-2.5 -right-2.5 z-10`,!d||o===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,P.jsx)(ee,{content:e.tooltip,placement:`top`,children:(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,P.jsx)(be,{isHidden:!d,isDisabled:p,onClick:ne,mode:p?`copied`:`copy`})]}),T,S?(0,P.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":u(a.BUTTON$STOP),"aria-hidden":!C,tabIndex:C?0:-1,className:m(`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`,te?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,C?`opacity-100`:`pointer-events-none opacity-0`),children:(0,P.jsx)(Ke,{className:`block h-7 w-7 max-w-none`})}):null,ie?(0,P.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":u(a.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>_(!0)}):null,n]});return e===`user`&&o===`error`?(0,P.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[E,(0,P.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,P.jsx)(`span`,{children:u(a.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),c?(0,P.jsx)(`button`,{type:`button`,onClick:c,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:u(a.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&o===`sending`?(0,P.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[E,(0,P.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,P.jsx)(Ue,{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:u(a.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):E}function Ye(){let{conversationId:e}=ae(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=b(),{setSelectedTab:a}=x(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var Xe=300,Ze=Ce(`shine-text`);function Qe({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=Ye(),{handleBuildPlanClick:o}=ze(),{scrollDomToBottom:c}=Le(),l=()=>{i(`planner`)},u=(0,N.useCallback)(e=>{o(e),c()},[o,c]),d=(0,N.useMemo)(()=>e?e.length<=Xe?e:`${e.slice(0,Xe)}...`:``,[e]);return e?(0,P.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,P.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,P.jsx)(fe,{width:18,height:18,color:`var(--oh-muted)`}),(0,P.jsx)(w.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$PLAN_MD)}),(0,P.jsx)(`div`,{className:`flex-1`}),(0,P.jsxs)(`button`,{type:`button`,onClick:l,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,P.jsx)(w.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$VIEW)}),(0,P.jsx)(Oe,{className:`text-white`,size:18})]})]}),(0,P.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:d&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(M,{includeStandard:!0,components:t?Ze:xe,children:d}),e&&e.length>Xe&&(0,P.jsx)(`button`,{type:`button`,onClick:l,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(a.COMMON$READ_MORE)})]})}),(0,P.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,P.jsx)(`button`,{type:`button`,onClick:u,disabled:n,className:m(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,P.jsxs)(w.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(a.COMMON$BUILD),` `,(0,P.jsx)(w.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function $e({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=N.useState(!1);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&c.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,P.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,P.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,P.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,P.jsx)(M,{children:t})]})}function et({event:e}){return pe(e)?(0,P.jsx)($e,{errorId:e.id,defaultMessage:e.error}):null}function tt({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function nt({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function rt({onClick:e,className:t}){return(0,P.jsx)(`button`,{type:`button`,onClick:e,className:m(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,P.jsx)(C,{width:18,height:18})})}function it({src:e,size:t=`small`}){return(0,P.jsx)(`img`,{role:`img`,alt:``,src:e,className:m(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function at({src:e,onRemove:t,size:n=`small`}){return(0,P.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,P.jsx)(it,{src:e,size:n}),t&&(0,P.jsx)(rt,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function ot({size:e=`small`,images:t,onRemove:n}){let r=N.useRef(null),[i,a]=N.useState(!1),[o,s]=N.useState(!0),[c,l]=N.useState(!1);return N.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,P.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,P.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(tt,{active:!o})}),(0,P.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:m(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,P.jsx)(at,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,P.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(nt,{active:!c})})]})}function st({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?a.ACTION$CONFIRM:a.ACTION$REJECT),o=n(r?a.CHAT_INTERFACE$USER_CONFIRMED:a.CHAT_INTERFACE$USER_REJECTED),c=r?`${n(a.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(a.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,P.jsx)(ee,{closeDelay:100,content:o,children:(0,P.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:m(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:c})})}function ct({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,P.jsxs)(`div`,{className:m(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,P.jsx)(`span`,{className:``,children:n}),(0,P.jsx)(`span`,{className:`font-bold`,children:i}),(0,P.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var lt=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,P.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,P.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,P.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),ut=te(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),dt=()=>r({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return ce.respondToConfirmation(e,t,i,n)}});function ft(){let e=ut(e=>e.submittedEventIds),t=ut(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=E(),{curAgentState:i}=se(),{mutate:o}=dt(),c=he(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===p.AWAITING_USER_CONFIRMATION:!1),l=(0,N.useCallback)(e=>{!c||!r||(t(c.id),o({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[c,r,t,o]);return(0,N.useEffect)(()=>{if(!c)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),l(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),l(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[c,l]),i!==p.AWAITING_USER_CONFIRMATION||!c||e.includes(c.id)?null:(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(D(c)?c.security_risk:h.UNKNOWN)===h.HIGH&&(0,P.jsx)(ct,{content:n(a.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,P.jsx)(lt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(a.COMMON$HIGH_RISK)}),(0,P.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,P.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(a.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(st,{type:`reject`,onClick:()=>l(!1)}),(0,P.jsx)(st,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var pt=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{u as n}from"./path-utils-DKu3CNkH.js";import{t as r}from"./useMutation-Dm84WAKR.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{t as o}from"./Trans-sy4l4TyQ.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{x as c}from"./query-client-config-Ca3tW1AH.js";import{t as l}from"./createLucideIcon-CkGTf9Qj.js";import{t as u}from"./chevron-down-B9j6lcFg.js";import{t as d}from"./loader-circle-1XB9nbwF.js";import{A as f,S as p,t as m}from"./utils-eXk6yerZ.js";import{n as h}from"./common-Dh7OqABE.js";import{t as g}from"./use-config-DVU9HaPf.js";import{f as _,m as v,p as y}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-BmZcy_kH.js";import{t as ee}from"./styled-tooltip-X61SEwqk.js";import{t as te}from"./react-Dy05vyj5.js";import{t as b}from"./conversation-store-FQmakEd-.js";import{s as x}from"./conversation-local-storage-an3MiIiJ.js";import{r as ne}from"./use-settings-CNsxccvQ.js";import{n as re}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-COLUW-6M.js";import{t as S}from"./skills-BE5HJuGM.js";import{t as C}from"./close--W-tHn1h.js";import{r as w}from"./typography-BLSEGjph.js";import{t as ie}from"./u-check-circle-dG_VJqx5.js";import{n as ae,r as T,t as E}from"./use-active-conversation-BkohEtaN.js";import{n as oe}from"./files-tab-store-DSKUhziI.js";import{t as se}from"./use-agent-state-DITv5qV7.js";import{d as ce,f as le,p as ue,r as de,t as fe}from"./lesson-plan-y520IDs6.js";import{a as pe,g as me,i as D,r as O,t as he,v as k,w as ge,x as _e,y as A}from"./use-event-store-DNSmyzUh.js";import{ot as ve,st as ye}from"./vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dqpi2xyZ.js";import{n as j,r as be,t as M}from"./markdown-renderer-z446oW0Z.js";import{n as xe,r as Se,t as Ce}from"./plan-components-CutRBi0G.js";import{n as we,t as Te}from"./u-check-circle-half-D-5ZPRnd.js";import{n as Ee,t as De}from"./lightbulb-S616sGEL.js";var Oe=l(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),N=e(t(),1);function ke(){!y.current&&_();let[e]=(0,N.useState)(v.current);return e}var P=i(),F=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}(F||{});function Ae(){let{conversationId:e}=T(),t=de();return{send:(0,N.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:F.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),L=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,P.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function Me({status:e}){return(0,P.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,P.jsx)(re,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let[s,c]=N.useState(r),l=t?(0,P.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`cursor-pointer text-left`,"aria-label":s?`Collapse`:`Expand`,children:s?(0,P.jsx)(L,{className:m(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,P.jsx)(I,{className:m(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,P.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&l,o,(0,P.jsx)(`span`,{children:e}),i===`after`&&l]}),(0,P.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,P.jsx)(Me,{status:n})]})]}),s&&(typeof t==`string`?(0,P.jsx)(M,{children:t}):t)]})}var Ne=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,P.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,P.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,P.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,P.jsx)(`defs`,{children:(0,P.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,P.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function Pe({profile:e}){let[t,r]=N.useState(!1);return(0,P.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,P.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,P.jsx)(u,{size:14}):(0,P.jsx)(n,{size:14})}),(0,P.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`hr`,{className:`border-neutral-700`}),(0,P.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function Fe({conversationId:e,anchorEventId:t}){let n=le(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,P.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,P.jsx)(R,{title:(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,P.jsx)(Ne,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,P.jsx)(o,{i18nKey:a.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,P.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,P.jsx)(R,{title:(0,P.jsx)(`span`,{children:t?(0,P.jsx)(o,{i18nKey:a.MODEL$NO_SAVED_PROFILES}):(0,P.jsx)(o,{i18nKey:a.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,P.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,P.jsx)(o,{i18nKey:a.MODEL$NO_PROFILES_HINT})}):(0,P.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,P.jsx)(Pe,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var z=(0,N.createContext)(void 0);function Ie({children:e,value:t}){let n=Se(N.useRef(null)),r=t||n;return(0,P.jsx)(z.Provider,{value:r,children:e})}function Le(){let e=(0,N.useContext)(z);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function Re(){return(0,N.useContext)(z)}var ze=()=>{let{setConversationMode:e}=b(),{send:t}=Ae(),{conversationId:n}=T(),r=ue(e=>e.enqueuePendingMessage),i=ue(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,N.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])}},Be=`200%`,B=8,Ve=B*2;function He({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=ke(),c=`oh-text-shimmer-${(0,N.useId)().replace(/:/g,``)}`,l=(0,N.useMemo)(()=>Math.min(B/2-1,1+i/2),[i]),u=(0,N.useMemo)(()=>{let e=B/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) ${B}%)`,backgroundSize:`${Be} 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,P.jsx)(t,{className:m(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${Ve}% center}to{background-position:0% center}}`}}),(0,P.jsx)(t,{className:m(`relative inline-block`,n),style:u,...o,children:e})]})}var Ue=N.memo(He),We=3,Ge=24;function Ke({className:e}){return(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,P.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,P.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var qe={p:({children:e})=>(0,P.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function Je({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),o=N.useRef(null),[c,l]=N.useState(!1);N.useLayoutEffect(()=>{let t=o.current;if(!t||n){l(!1),r(!1);return}let i=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),i=We*(Number.isFinite(n)&&n>0?n:Ge),a=(e.match(/\n/g)??[]).length,o=t.scrollHeight>i+1||a>=We||e.trim().length>220;l(e=>(e!==o&&r(o),o))};i();let a=new ResizeObserver(i);return a.observe(t),()=>a.disconnect()},[e,n,r]);let u=c&&!n;return(0,P.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,P.jsx)(`div`,{ref:o,className:m(`text-sm leading-6 whitespace-normal [word-break:break-word]`,u&&`line-clamp-3`),children:(0,P.jsx)(M,{includeStandard:!0,includeHeadings:!0,components:qe,children:e})}),u?(0,P.jsxs)(P.Fragment,{children:[(0,P.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,P.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:m(`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(a.COMMON$VIEW_MORE)})]}):null]})}function V({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:o,onRetry:c,onStop:l}){let{t:u}=s(`openhands`),[d,f]=N.useState(!1),[p,h]=N.useState(!1),[g,_]=N.useState(!1),[v,y]=N.useState(!1),[te,b]=N.useState(!0),x=N.useRef(null);N.useEffect(()=>{_(!1)},[t]);let ne=async()=>{await navigator.clipboard.writeText(t),h(!0)};N.useEffect(()=>{let e;return p&&(e=setTimeout(()=>{h(!1)},2e3)),()=>{clearTimeout(e)}},[p]);let re=e===`user`&&(o===`error`||o===`sending`),S=o===`sending`&&l!=null,C=S&&d,w=e===`user`&&o==null,ie=w&&v&&!g,ae=N.Children.count(n)>0;N.useLayoutEffect(()=>{if(!S||w)return;let e=x.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:Ge;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,S,w]);let T=w?(0,P.jsx)(Je,{message:t,isHovering:d,isExpanded:g,onTruncatableChange:y}):(0,P.jsx)(`div`,{ref:x,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,P.jsx)(M,{includeStandard:!0,includeHeadings:!0,components:qe,children:t})}),E=(0,P.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":o,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:m(`rounded-xl relative w-fit max-w-full flex flex-col`,ae&&`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`,o===`error`&&`border border-[var(--oh-status-error)]/40`,!re&&`last:mb-4`),children:[(0,P.jsxs)(`div`,{className:m(`absolute -top-2.5 -right-2.5 z-10`,!d||o===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,P.jsx)(ee,{content:e.tooltip,placement:`top`,children:(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,P.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,P.jsx)(be,{isHidden:!d,isDisabled:p,onClick:ne,mode:p?`copied`:`copy`})]}),T,S?(0,P.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":u(a.BUTTON$STOP),"aria-hidden":!C,tabIndex:C?0:-1,className:m(`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`,te?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,C?`opacity-100`:`pointer-events-none opacity-0`),children:(0,P.jsx)(Ke,{className:`block h-7 w-7 max-w-none`})}):null,ie?(0,P.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":u(a.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>_(!0)}):null,n]});return e===`user`&&o===`error`?(0,P.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[E,(0,P.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,P.jsx)(`span`,{children:u(a.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),c?(0,P.jsx)(`button`,{type:`button`,onClick:c,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:u(a.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&o===`sending`?(0,P.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[E,(0,P.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,P.jsx)(Ue,{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:u(a.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):E}function Ye(){let{conversationId:e}=ae(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=b(),{setSelectedTab:a}=x(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var Xe=300,Ze=Ce(`shine-text`);function Qe({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=Ye(),{handleBuildPlanClick:o}=ze(),{scrollDomToBottom:c}=Le(),l=()=>{i(`planner`)},u=(0,N.useCallback)(e=>{o(e),c()},[o,c]),d=(0,N.useMemo)(()=>e?e.length<=Xe?e:`${e.slice(0,Xe)}...`:``,[e]);return e?(0,P.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,P.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,P.jsx)(fe,{width:18,height:18,color:`var(--oh-muted)`}),(0,P.jsx)(w.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$PLAN_MD)}),(0,P.jsx)(`div`,{className:`flex-1`}),(0,P.jsxs)(`button`,{type:`button`,onClick:l,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,P.jsx)(w.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(a.COMMON$VIEW)}),(0,P.jsx)(Oe,{className:`text-white`,size:18})]})]}),(0,P.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:d&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(M,{includeStandard:!0,components:t?Ze:xe,children:d}),e&&e.length>Xe&&(0,P.jsx)(`button`,{type:`button`,onClick:l,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(a.COMMON$READ_MORE)})]})}),(0,P.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,P.jsx)(`button`,{type:`button`,onClick:u,disabled:n,className:m(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,P.jsxs)(w.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(a.COMMON$BUILD),` `,(0,P.jsx)(w.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function $e({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=N.useState(!1);return(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,P.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&c.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,P.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,P.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,P.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,P.jsx)(M,{children:t})]})}function et({event:e}){return pe(e)?(0,P.jsx)($e,{errorId:e.id,defaultMessage:e.error}):null}function tt({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function nt({width:e=20,height:t=20,active:n}){return(0,P.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function rt({onClick:e,className:t}){return(0,P.jsx)(`button`,{type:`button`,onClick:e,className:m(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,P.jsx)(C,{width:18,height:18})})}function it({src:e,size:t=`small`}){return(0,P.jsx)(`img`,{role:`img`,alt:``,src:e,className:m(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function at({src:e,onRemove:t,size:n=`small`}){return(0,P.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,P.jsx)(it,{src:e,size:n}),t&&(0,P.jsx)(rt,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function ot({size:e=`small`,images:t,onRemove:n}){let r=N.useRef(null),[i,a]=N.useState(!1),[o,s]=N.useState(!0),[c,l]=N.useState(!1);return N.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,P.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,P.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(tt,{active:!o})}),(0,P.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:m(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,P.jsx)(at,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,P.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,P.jsx)(nt,{active:!c})})]})}function st({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?a.ACTION$CONFIRM:a.ACTION$REJECT),o=n(r?a.CHAT_INTERFACE$USER_CONFIRMED:a.CHAT_INTERFACE$USER_REJECTED),c=r?`${n(a.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(a.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,P.jsx)(ee,{closeDelay:100,content:o,children:(0,P.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:m(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:c})})}function ct({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,P.jsxs)(`div`,{className:m(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,P.jsx)(`span`,{className:``,children:n}),(0,P.jsx)(`span`,{className:`font-bold`,children:i}),(0,P.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var lt=e=>(0,P.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,P.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,P.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,P.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),ut=te(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),dt=()=>r({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return ce.respondToConfirmation(e,t,i,n)}});function ft(){let e=ut(e=>e.submittedEventIds),t=ut(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=E(),{curAgentState:i}=se(),{mutate:o}=dt(),c=he(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===p.AWAITING_USER_CONFIRMATION:!1),l=(0,N.useCallback)(e=>{!c||!r||(t(c.id),o({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[c,r,t,o]);return(0,N.useEffect)(()=>{if(!c)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),l(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),l(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[c,l]),i!==p.AWAITING_USER_CONFIRMATION||!c||e.includes(c.id)?null:(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(D(c)?c.security_risk:h.UNKNOWN)===h.HIGH&&(0,P.jsx)(ct,{content:n(a.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,P.jsx)(lt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(a.COMMON$HIGH_RISK)}),(0,P.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,P.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(a.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,P.jsx)(st,{type:`reject`,onClick:()=>l(!1)}),(0,P.jsx)(st,{type:`confirm`,onClick:()=>l(!0)})]})]})]})}var pt=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
2
2
  `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=c.t(a.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function mt(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function ht(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function gt(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function _t(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 yt(e){let t=e?.verification;if(!vt(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function bt({feature:e}){let t=Math.round(e.probability*100),n=_t(e.probability);return(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,P.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function H({label:e,features:t}){return!t||t.length===0?null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,P.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,P.jsxs)(N.Fragment,{children:[t>0&&(0,P.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,P.jsx)(bt,{feature:e})]},e.name))]})}function xt({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,o=e.other&&e.other.length>0;return!n&&!r&&!i&&!o?null:(0,P.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,P.jsx)(H,{label:t(a.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,P.jsx)(H,{label:t(a.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,P.jsx)(H,{label:t(a.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),o&&(0,P.jsx)(H,{label:t(a.CRITIC$OTHER),features:e.other})]})}function St({criticResult:e}){let{t}=s(),{data:n}=ne(),[r,i]=N.useState(!1),o=mt(e.score),{filled:c,empty:l}=ht(o),u=gt(o),d=(o*100).toFixed(1),f=yt(n?.agent_settings)===!1,p=e.metadata?.categorized_features,m=p!=null&&((p.agent_behavioral_issues??[]).length>0||(p.user_followup_patterns??[]).length>0||(p.infrastructure_issues??[]).length>0||(p.other??[]).length>0);return(0,P.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,P.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(a.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,P.jsxs)(`span`,{className:`${u} text-xs tracking-wide`,"aria-label":`Score: ${d}%`,children:[`★`.repeat(c),`☆`.repeat(l)]}),(0,P.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,d,`%)`]}),m&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":r?`Collapse details`:`Expand details`,children:r?(0,P.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`}):(0,P.jsx)(I,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&m&&(0,P.jsx)(xt,{categorized:p}),f&&(0,P.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(a.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}function Ct({event:e,isLastMessage:t,isFromPlanningAgent:n}){let r=pt(e),i=[];return Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&i.push(...e.image_urls)}),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(V,{type:e.source,message:r,isFromPlanningAgent:n,children:[i.length>0&&(0,P.jsx)(ot,{size:`small`,images:i}),t&&(0,P.jsx)(ft,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,P.jsx)(St,{criticResult:e.critic_result})]})}var wt=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)}},Tt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function Et(e){let{children:t}=e,n=e=>{try{return Tt(e)}catch(t){return wt.error(String(t)),e}};return Array.isArray(t)?(0,P.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,P.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,P.jsx)(`strong`,{className:`font-mono`,children:t})}var Dt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},Ot=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,kt=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return Ot(e)&&!n.endsWith(`/`)?`${n}/`:n};function At(e){let{children:t}=e,n=e=>{try{let t=Dt(e);return(0,P.jsx)(`span`,{className:`font-mono`,title:t,children:kt(t)})}catch(t){return wt.error(String(t)),(0,P.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,P.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,P.jsx)(`strong`,{children:n(t)}):(0,P.jsx)(`strong`,{className:`font-mono`,children:t})}var U=1e3,jt=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,Mt=e=>{switch(e){case h.LOW:return c.t(a.SECURITY$LOW_RISK);case h.MEDIUM:return c.t(a.SECURITY$MEDIUM_RISK);case h.HIGH:return c.t(a.SECURITY$HIGH_RISK);case h.UNKNOWN:default:return c.t(a.SECURITY$UNKNOWN_RISK)}},W=()=>``,Nt=e=>e.name?`**Skill:** \`${e.name}\``:W(),Pt=e=>{let{action:t}=e,n=[];return t.pattern&&n.push(`**Pattern:** \`${t.pattern}\``),t.path&&n.push(`**Path:** \`${t.path}\``),`include`in t&&t.include&&n.push(`**Include:** \`${t.include}\``),n.length>0?n.join(`
3
3
  `):W()},Ft=e=>{if(e.command!==`create`||!e.file_text)return W();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,U)}...`),`${e.path}\n${t}`},It=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===h.HIGH||e.security_risk===h.MEDIUM)&&(t+=`\n\n${Mt(e.security_risk)}`),t},Lt=e=>{let t=`**MCP Tool Call**
4
4
 
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-D9ucT0fq.js";import{t as i}from"./useQuery-DGRSm7IT.js";import{t as a}from"./useTranslation-CL6FTf1b.js";import{M as o,t as s}from"./utils-eXk6yerZ.js";import{a as c,n as l}from"./agent-server-client-options-B-C8JaTb.js";import{t as u}from"./llm-client-P9f2gKeW.js";import{d}from"./brand-button-9SOzmqPP.js";import{n as f,t as p}from"./vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js";import{i as m}from"./combobox-caret-C9BNHfSu.js";import{t as h}from"./proxy--Uy1iGsW.js";import{n as g}from"./map-provider-BM2SJarp.js";import{d as _}from"./sdk-settings-schema-Big50zDH.js";var v=e(t(),1);function y(e){return null}y.getCollectionNode=function*(e){let{children:t,title:n,items:r}=e;yield{type:`section`,props:e,hasChildNodes:!0,rendered:n,"aria-label":e[`aria-label`],*childNodes(){if(typeof t==`function`){if(!r)throw Error(`props.children was a function but props.items is missing`);for(let e of r)yield{type:`item`,value:e,renderer:t}}else{let e=[];v.Children.forEach(t,t=>{e.push({type:`item`,element:t})}),yield*e}}}};var b=y,x=e=>{let[t,...n]=e.split(`/`);return!t||n.length===0?{provider:``,model:e,separator:``}:{provider:t,model:n.join(`/`),separator:`/`}};function S(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function C(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function w(e,t){return!t||t<=0?e:e.slice(0,t)}function T(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var E=class{static async searchModels(e={},t){let n=c();if(n.backend.kind===`cloud`){let t=T({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return h({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new u(l()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getModels(),i]),s=e.provider__eq??null,d=new Set(s?o?.[s]??[]:[]),f=[...d].map(e=>({provider:s,name:e,verified:!0})),p=s?(a??[]).filter(e=>e.startsWith(`${s}/`)).map(e=>e.slice(s.length+1)).filter(e=>e.length>0&&!d.has(e)).map(e=>({provider:s,name:e,verified:!1})):[];return{items:w(C(S([...f,...p],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=c();if(n.backend.kind===`cloud`){let t=T({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return h({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new u(l()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getProviders(),i]),s=new Set(Object.keys(o??{}));return{items:w(C(S([...new Set([...s,...a??[]])].map(e=>({name:e,verified:s.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},D=[`config`,`verified-models`],O=1e3*60*5,k=1e3*60*15;async function A(){return c().backend.kind===`cloud`?{}:await new u(l()).getVerifiedModels()??{}}var j=()=>i({queryKey:[`config`,`providers`],queryFn:async({client:e})=>{let t=await e.fetchQuery({queryKey:D,queryFn:A,staleTime:O});return(await E.searchProviders({limit:100},t)).items},staleTime:O,gcTime:k}),M=10;async function N(e,t,n,r=0){if(r>=M)throw Error(`Too many pagination requests for provider ${e}`);let i=await E.searchModels({provider__eq:e,limit:100,page_id:n},t);if(i.next_page_id){let n=await N(e,t,i.next_page_id,r+1);return[...i.items,...n]}return i.items}var P=e=>i({queryKey:[`config`,`models`,e],queryFn:async({client:t})=>N(e,await t.fetchQuery({queryKey:D,queryFn:A,staleTime:O})),enabled:!!e,staleTime:O,gcTime:k}),F=()=>i({queryKey:D,queryFn:A,select:e=>e?.openhands??[],staleTime:O,gcTime:k}),I=`https://llm-proxy.app.all-hands.dev/`,L=new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`]),R=`litellm_proxy/`;function z(e){return typeof e==`string`&&e.startsWith(`openhands/`)}function B(e){return typeof e==`string`&&L.has(e.trim().replace(/\/+$/,``))}function V(e,t){return z(e)?!0:typeof e==`string`&&e.startsWith(R)&&B(t)}var H=`litellm_proxy/`;function U(e,t,n){if(!e)return``;if(!e.startsWith(H)||!B(t))return e;let r=e.slice(14);return n.includes(r)?`openhands/${r}`:e}var W=n();function G({isDisabled:e,currentModel:t,currentBaseUrl:n,onChange:i,onDefaultValuesChanged:c,wrapperClassName:l,labelClassName:u}){let[,h]=v.useState(null),[y,S]=v.useState(null),[C,w]=v.useState(null),{data:T=[]}=j(),{data:E}=F(),{data:D=[],isLoading:O,error:k}=P(y),A=v.useMemo(()=>T.filter(e=>e.verified),[T]),M=v.useMemo(()=>T.filter(e=>!e.verified),[T]),N=v.useMemo(()=>D.filter(e=>e.verified),[D]),I=v.useMemo(()=>D.filter(e=>!e.verified),[D]);v.useEffect(()=>{if(t&&E!==void 0){let e=U(t,n,E),{provider:r,model:i}=x(e);h(e),S(r||null),w(i),c?.(r||null,i)}},[t,n,E]);let L=e=>{S(e),w(null),h(`${e}/`),i?.(e,null)},R=e=>{let t=`${y}/${e}`;y===`openai`&&(t=e),h(t),w(e),i?.(y,e)},z=()=>{S(null),h(null)},{t:B}=a(`openhands`);return(0,W.jsxs)(`div`,{className:s(`flex flex-col md:flex-row w-full min-w-0 justify-between gap-4 md:gap-[46px]`,l),children:[(0,W.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,W.jsx)(`label`,{className:s(`text-sm`,u),children:B(r.LLM$PROVIDER)}),(0,W.jsxs)(p,{"data-testid":`llm-provider-input`,isRequired:!0,isVirtualized:!1,name:`llm-provider-input`,isDisabled:e,"aria-label":B(r.LLM$PROVIDER),isClearable:!1,onSelectionChange:e=>{e?.toString()&&L(e.toString())},onInputChange:e=>!e&&z(),defaultSelectedKey:y??void 0,selectedKey:y,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:m},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:d}},children:[(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:A.map(e=>(0,W.jsx)(f,{"data-testid":`provider-item-${e.name}`,children:g(e.name)},e.name))}),M.length>0?(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:M.map(e=>(0,W.jsx)(f,{children:g(e.name)},e.name))}):null]})]}),y===`openhands`&&(0,W.jsx)(_,{testId:`openhands-account-help`,text:B(r.SETTINGS$NEED_OPENHANDS_ACCOUNT),linkText:B(r.SETTINGS$CLICK_HERE),href:o.PRODUCTION,size:`settings`,linkColor:`white`}),(0,W.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,W.jsx)(`label`,{className:s(`text-sm`,u),children:B(r.LLM$MODEL)}),(0,W.jsxs)(p,{"data-testid":`llm-model-input`,isRequired:!0,isVirtualized:!1,isLoading:O,name:`llm-model-input`,"aria-label":B(r.LLM$MODEL),isClearable:!1,onSelectionChange:e=>{e?.toString()&&R(e.toString())},isDisabled:e||!y,selectedKey:C,defaultSelectedKey:C??void 0,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:m},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:d}},children:[(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:N.map(e=>(0,W.jsx)(f,{children:e.name},e.name))}),I.length>0?(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:I.map(e=>(0,W.jsx)(f,{"data-testid":`model-item-${e.name}`,children:e.name},e.name))}):null]}),k&&(0,W.jsx)(`p`,{"data-testid":`models-error`,className:`text-danger text-xs`,children:B(r.CONFIGURATION$ERROR_FETCH_MODELS)})]})]})}export{x as i,I as n,V as r,G as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-D9ucT0fq.js";import{t as i}from"./useQuery-DGRSm7IT.js";import{t as a}from"./useTranslation-CL6FTf1b.js";import{M as o,t as s}from"./utils-eXk6yerZ.js";import{a as c,n as l}from"./agent-server-client-options-wXLeJYeM.js";import{t as u}from"./llm-client-D6EtdLBs.js";import{d}from"./brand-button-9SOzmqPP.js";import{n as f,t as p}from"./vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js";import{i as m}from"./combobox-caret-C9BNHfSu.js";import{t as h}from"./proxy-Bx3NeKeo.js";import{n as g}from"./map-provider-BM2SJarp.js";import{d as _}from"./sdk-settings-schema-Big50zDH.js";var v=e(t(),1);function y(e){return null}y.getCollectionNode=function*(e){let{children:t,title:n,items:r}=e;yield{type:`section`,props:e,hasChildNodes:!0,rendered:n,"aria-label":e[`aria-label`],*childNodes(){if(typeof t==`function`){if(!r)throw Error(`props.children was a function but props.items is missing`);for(let e of r)yield{type:`item`,value:e,renderer:t}}else{let e=[];v.Children.forEach(t,t=>{e.push({type:`item`,element:t})}),yield*e}}}};var b=y,x=e=>{let[t,...n]=e.split(`/`);return!t||n.length===0?{provider:``,model:e,separator:``}:{provider:t,model:n.join(`/`),separator:`/`}};function S(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function C(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function w(e,t){return!t||t<=0?e:e.slice(0,t)}function T(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var E=class{static async searchModels(e={},t){let n=c();if(n.backend.kind===`cloud`){let t=T({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return h({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new u(l()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getModels(),i]),s=e.provider__eq??null,d=new Set(s?o?.[s]??[]:[]),f=[...d].map(e=>({provider:s,name:e,verified:!0})),p=s?(a??[]).filter(e=>e.startsWith(`${s}/`)).map(e=>e.slice(s.length+1)).filter(e=>e.length>0&&!d.has(e)).map(e=>({provider:s,name:e,verified:!1})):[];return{items:w(C(S([...f,...p],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=c();if(n.backend.kind===`cloud`){let t=T({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return h({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new u(l()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getProviders(),i]),s=new Set(Object.keys(o??{}));return{items:w(C(S([...new Set([...s,...a??[]])].map(e=>({name:e,verified:s.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},D=[`config`,`verified-models`],O=1e3*60*5,k=1e3*60*15;async function A(){return c().backend.kind===`cloud`?{}:await new u(l()).getVerifiedModels()??{}}var j=()=>i({queryKey:[`config`,`providers`],queryFn:async({client:e})=>{let t=await e.fetchQuery({queryKey:D,queryFn:A,staleTime:O});return(await E.searchProviders({limit:100},t)).items},staleTime:O,gcTime:k}),M=10;async function N(e,t,n,r=0){if(r>=M)throw Error(`Too many pagination requests for provider ${e}`);let i=await E.searchModels({provider__eq:e,limit:100,page_id:n},t);if(i.next_page_id){let n=await N(e,t,i.next_page_id,r+1);return[...i.items,...n]}return i.items}var P=e=>i({queryKey:[`config`,`models`,e],queryFn:async({client:t})=>N(e,await t.fetchQuery({queryKey:D,queryFn:A,staleTime:O})),enabled:!!e,staleTime:O,gcTime:k}),F=()=>i({queryKey:D,queryFn:A,select:e=>e?.openhands??[],staleTime:O,gcTime:k}),I=`https://llm-proxy.app.all-hands.dev/`,L=new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`]),R=`litellm_proxy/`;function z(e){return typeof e==`string`&&e.startsWith(`openhands/`)}function B(e){return typeof e==`string`&&L.has(e.trim().replace(/\/+$/,``))}function V(e,t){return z(e)?!0:typeof e==`string`&&e.startsWith(R)&&B(t)}var H=`litellm_proxy/`;function U(e,t,n){if(!e)return``;if(!e.startsWith(H)||!B(t))return e;let r=e.slice(14);return n.includes(r)?`openhands/${r}`:e}var W=n();function G({isDisabled:e,currentModel:t,currentBaseUrl:n,onChange:i,onDefaultValuesChanged:c,wrapperClassName:l,labelClassName:u}){let[,h]=v.useState(null),[y,S]=v.useState(null),[C,w]=v.useState(null),{data:T=[]}=j(),{data:E}=F(),{data:D=[],isLoading:O,error:k}=P(y),A=v.useMemo(()=>T.filter(e=>e.verified),[T]),M=v.useMemo(()=>T.filter(e=>!e.verified),[T]),N=v.useMemo(()=>D.filter(e=>e.verified),[D]),I=v.useMemo(()=>D.filter(e=>!e.verified),[D]);v.useEffect(()=>{if(t&&E!==void 0){let e=U(t,n,E),{provider:r,model:i}=x(e);h(e),S(r||null),w(i),c?.(r||null,i)}},[t,n,E]);let L=e=>{S(e),w(null),h(`${e}/`),i?.(e,null)},R=e=>{let t=`${y}/${e}`;y===`openai`&&(t=e),h(t),w(e),i?.(y,e)},z=()=>{S(null),h(null)},{t:B}=a(`openhands`);return(0,W.jsxs)(`div`,{className:s(`flex flex-col md:flex-row w-full min-w-0 justify-between gap-4 md:gap-[46px]`,l),children:[(0,W.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,W.jsx)(`label`,{className:s(`text-sm`,u),children:B(r.LLM$PROVIDER)}),(0,W.jsxs)(p,{"data-testid":`llm-provider-input`,isRequired:!0,isVirtualized:!1,name:`llm-provider-input`,isDisabled:e,"aria-label":B(r.LLM$PROVIDER),isClearable:!1,onSelectionChange:e=>{e?.toString()&&L(e.toString())},onInputChange:e=>!e&&z(),defaultSelectedKey:y??void 0,selectedKey:y,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:m},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:d}},children:[(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:A.map(e=>(0,W.jsx)(f,{"data-testid":`provider-item-${e.name}`,children:g(e.name)},e.name))}),M.length>0?(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:M.map(e=>(0,W.jsx)(f,{children:g(e.name)},e.name))}):null]})]}),y===`openhands`&&(0,W.jsx)(_,{testId:`openhands-account-help`,text:B(r.SETTINGS$NEED_OPENHANDS_ACCOUNT),linkText:B(r.SETTINGS$CLICK_HERE),href:o.PRODUCTION,size:`settings`,linkColor:`white`}),(0,W.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,W.jsx)(`label`,{className:s(`text-sm`,u),children:B(r.LLM$MODEL)}),(0,W.jsxs)(p,{"data-testid":`llm-model-input`,isRequired:!0,isVirtualized:!1,isLoading:O,name:`llm-model-input`,"aria-label":B(r.LLM$MODEL),isClearable:!1,onSelectionChange:e=>{e?.toString()&&R(e.toString())},isDisabled:e||!y,selectedKey:C,defaultSelectedKey:C??void 0,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:m},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:d}},children:[(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:N.map(e=>(0,W.jsx)(f,{children:e.name},e.name))}),I.length>0?(0,W.jsx)(b,{title:B(r.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:I.map(e=>(0,W.jsx)(f,{"data-testid":`model-item-${e.name}`,children:e.name},e.name))}):null]}),k&&(0,W.jsx)(`p`,{"data-testid":`models-error`,className:`text-danger text-xs`,children:B(r.CONFIGURATION$ERROR_FETCH_MODELS)})]})]})}export{x as i,I as n,V as r,G as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{k as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as r}from"./useMutation-Dm84WAKR.js";import{i}from"./organization-service.api-BNc9Kn6n.js";import{o as a,t as o}from"./declaration-D9ucT0fq.js";import{n as s}from"./QueryClientProvider-XcSjsfpb.js";import{t as c}from"./useQuery-DGRSm7IT.js";import{r as l,t as u}from"./recommended-automations-launcher-DCi0RXIj.js";import{t as d}from"./useTranslation-CL6FTf1b.js";import{g as f,m as p,p as m}from"./query-client-config-Ca3tW1AH.js";import{t as h}from"./createLucideIcon-CkGTf9Qj.js";import{n as g}from"./vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js";import{t as _}from"./check-BhnsMsWy.js";import{t as v}from"./loader-circle-1XB9nbwF.js";import{a as y,i as b,r as x,t as S}from"./llm-settings-yDgbXP6Q.js";import{t as C}from"./utils-eXk6yerZ.js";import{S as w,m as ee,n as T,u as te,y as ne}from"./agent-server-client-options-B-C8JaTb.js";import{n as E,o as D,r as re}from"./active-backend-context-CNF2lPkA.js";import{d as O,o as ie,u as k}from"./vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-CGm-Jxp5.js";import{t as A}from"./modal-backdrop-_VbcKk5K.js";import{r as j,t as M}from"./modal-body-Cd-PtMHr.js";import{r as N}from"./base-modal-DvuGYyu1.js";import{i as P}from"./modal-classes-CNm4ovfm.js";import{t as F}from"./brand-button-9SOzmqPP.js";import{t as ae}from"./openhands-logo-Dzm-d_V_.js";import{n as oe}from"./navigation-context-BpAOh_t5.js";import{t as se}from"./chat-send-button-BhoO7T0s.js";import{i as ce,o as le,t as ue}from"./backend-form-modal-Dl29wkF5.js";import{t as de}from"./confirmation-modal-Cq3eqvqH.js";import{c as fe,i as pe,n as I}from"./acp-providers-BqUvf67Q.js";import{t as me}from"./use-create-conversation-pV2eA-e9.js";import{t as he}from"./terminal-B92mACR5.js";import{t as L}from"./folder-DPTBlxWb.js";import{t as R}from"./close--W-tHn1h.js";import{t as ge}from"./use-save-settings-Xp8DD-jf.js";import{a as _e,i as ve,n as ye,r as be,t as xe}from"./use-acp-credential-form-LjCIhMSK.js";var Se=h(`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`}]]),z=e(t(),1),B=a(),Ce=`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`,we=`0 0 100 100`,Te=`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`,Ee=`0 0 12 12`,De=`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`,Oe=`0 0 24 24`,ke=3/2;function V({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,B.jsx)(ae,{width:Math.round(t*ke),height:t,className:C(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:we,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:Ce})}):e===`codex`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Ee,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:Te,fill:`currentColor`})}):e===`gemini`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Oe,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:De})}):(0,B.jsx)(he,{width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function H(){return new ie(T())}function U(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var W=class{static async listWorkspaces(){return U(await H().listWorkspaces())}static async addWorkspaces(e){return U(await H().addWorkspaces(e))}static async removeWorkspace(e){await H().deleteWorkspace(e)}static async addWorkspaceParents(e){return U(await H().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await H().deleteWorkspaceParent(e)}};function Ae(){let e=s();return r({mutationFn:e=>W.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function je(){let e=s();return r({mutationFn:e=>W.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function Me(){let e=s();return r({mutationFn:e=>W.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function Ne(){let e=s();return r({mutationFn:e=>W.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function G({enabled:e=!0}={}){return c({queryKey:D.all,queryFn:()=>W.listWorkspaces(),enabled:e,retry:(e,t)=>!O(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function Pe(){let{data:e,isLoading:t,isError:n,error:r}=G(),a=O(r),o=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,z.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,a]),l=i({queries:a?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new k(T()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,z.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),o.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[o,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:u,isError:d,error:r}}function Fe(e,t){return O(e)?t(o.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function K(){return new k(T())}var Ie=e=>{let t=E();return c({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>K().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},Le=()=>{let e=E();return c({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>K().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},Re=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,B.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`})}),q=`/projects`;function J({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,B.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,B.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:C(`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,B.jsx)(L,{width:14,height:14,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function ze(e){let t=e.replace(/\/+$/,``);if(!t||t===`/`)return null;let n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function Y(e){return e?.home===`/home/openhands`}function Be({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=d(`openhands`),[a,s]=(0,z.useState)(null),c=E(),{data:l}=Le();(0,z.useEffect)(()=>{e&&l?.home&&a===null&&s(Y(l)?q:l.home),e||s(null)},[e,l?.home,a]),(0,z.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:f,isError:p,error:m}=Ie(e?a:null),h=(0,z.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:l.home.replace(/[\\/]+$/,``)||l.home},...l.favorites??[]];return Y(l)&&!e.some(e=>e.path===q)&&e.push({label:q,path:q}),e},[l]),g=l?.locations??[];if(!e)return null;let _=u?.items??[],v=a?ze(a):null,y=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&a===l?.home&&!f&&!p&&_.length===0,b=e=>{let t=e.replace(/\/+$/,``);if(!t)return`/`;let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1)||`/`:t};return(0,B.jsx)(A,{onClose:t,"aria-label":i(o.HOME$ADD_WORKSPACES_TITLE),children:(0,B.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`xl`),M,`h-[480px]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:i(o.HOME$ADD_WORKSPACES_TITLE)})}),(0,B.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,B.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,B.jsx)(J,{label:i(o.HOME$FAVORITES),entries:h,currentPath:a,onPick:s}),(0,B.jsx)(J,{label:i(o.HOME$LOCATIONS),entries:g,currentPath:a,onPick:s})]}),(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,B.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>v&&s(v),disabled:!v,"aria-label":`Up`,className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,B.jsx)(Re,{width:16,height:16})}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,B.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,B.jsx)(`span`,{children:i(o.HOME$NAME)}),(0,B.jsx)(`span`,{children:i(o.HOME$KIND)})]}),(0,B.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[f&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(o.HOME$LOADING)}),p&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:m?.message??`Failed to load`}),!f&&!p&&_.length===0&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":y?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(y?o.HOME$HOST_HOME_NOT_MOUNTED_HINT:o.HOME$NO_WORKSPACES)}),_.map(e=>(0,B.jsx)(`li`,{children:(0,B.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,B.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(o.HOME$FOLDER)})]})},e.path))]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(o.HOME$CANCEL)}),r&&(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-add-all-subdirs`,children:i(o.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-use`,children:i(o.HOME$ADD_THIS_DIRECTORY)})]})]})})}function Ve({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:s}=d(`openhands`),[c,l]=z.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),f=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=f.get(e.parentPath)??[];t.push(e),f.set(e.parentPath,t)});let p=u.length>0||n.length>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:r,"aria-label":s(o.HOME$MANAGE_WORKSPACES),children:(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`lg`),M,`max-h-[70vh]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:s(o.HOME$MANAGE_WORKSPACES)})}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,B.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(o.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,B.jsx)(`ul`,{children:u.map(e=>(0,B.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,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(o.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,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,B.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(o.HOME$WORKSPACE_PARENTS)}),(0,B.jsx)(`ul`,{children:n.map(e=>{let t=f.get(e.path)??[];return(0,B.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(o.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,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,B.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,B.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,B.jsx)(L,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,B.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(o.HOME$DONE)})})]})}),c&&(0,B.jsx)(de,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):a?.(c.path),l(null))},onCancel:()=>l(null)})]})}function He({currentStep:e,totalSteps:t,className:n}){return(0,B.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:C(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,B.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:C(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function Ue(e){return e===`openhands`?`openhands`:I.find(({key:t})=>t===e)?.icon??`cli-generic`}function We({id:e,muted:t}){let n=Ue(e);return n===`openhands`?(0,B.jsx)(V,{kind:`openhands`,size:16,className:C(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,B.jsx)(V,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Ge(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:o.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...I.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ke({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:i}=d(`openhands`),{mutate:a,isPending:s}=ge();return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(o.ONBOARDING$AGENT_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$AGENT_SUBTITLE)})]}),(0,B.jsx)(`div`,{role:`radiogroup`,"aria-label":i(o.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Ge().map(n=>{let r=n.id===e;return(0,B.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:C(`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,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(We,{id:n.id,muted:!1}),(0,B.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:i(n.descriptionKey)})]}),(0,B.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,B.jsx)(_,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,B.jsx)(F,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:s,children:i(o.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:s,onClick:()=>{let t=pe(e);if(!t){r();return}a({agent_settings_diff:t},{onError:e=>{m(f(e)||i(o.ERROR$GENERIC))},onSuccess:()=>{p(i(o.SETTINGS$SAVED)),r()}})},children:i(s?o.SETTINGS$SAVING:o.ONBOARDING$NEXT)})]})]})}function qe({isConnected:e}){let{t}=d(`openhands`);return e===!0?(0,B.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:C(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,B.jsx)(g,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:t(o.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-green-200/80`,children:t(o.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]}):e===!1?(0,B.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,B.jsx)(Se,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:t(o.ONBOARDING$BACKEND_DISCONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-red-200/80`,children:t(o.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]}):(0,B.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,B.jsx)(v,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,B.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:t(o.ONBOARDING$BACKEND_CHECKING)})]})}function Je({onBack:e,onNext:t}){let{t:n}=d(`openhands`),{active:r}=re(),{backend:i}=r,a=te(i),s=z.useMemo(()=>ne(),[]),c=a?{id:`onboarding-local-backend-draft`,name:ee,host:s.baseUrl,apiKey:s.sessionApiKey,kind:`local`}:i,l=le(a?[]:[i]),u=a?!1:l[i.id]?.isConnected??null,[f,p]=z.useState(!1);z.useEffect(()=>{u===!0&&p(!1)},[u]);let m=u===!0&&!f;return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(o.ONBOARDING$BACKEND_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(o.ONBOARDING$BACKEND_SUBTITLE)})]}),(0,B.jsx)(qe,{isConnected:u}),u===!0?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-expanded":f,"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,B.jsx)(`span`,{children:n(f?o.ONBOARDING$BACKEND_HIDE_CONFIGURATION:o.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,B.jsx)(ce,{className:C(`h-4 w-4 shrink-0 text-muted transition-transform`,f&&`rotate-180`),"aria-hidden":!0})]}):null,(0,B.jsx)(ue,{mode:a?`add`:`edit`,backend:c,onSubmitted:t,testIdRoot:`onboarding-backend`,requireApiKey:w(),hideConfigurationFields:m,renderActions:({canSubmit:t,isSubmitting:r})=>(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`),children:[e?(0,B.jsx)(F,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:r,children:n(o.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-backend-next`,type:`submit`,variant:`primary`,isDisabled:!t||r,children:n(r?o.SETTINGS$SAVING:o.ONBOARDING$NEXT)})]})})]})}var Ye={"llm.model":`openai/gpt-5.5`};function Xe({onBack:e,onNext:t}){let{t:n}=d(`openhands`),{backend:r}=E(),i=r.kind===`local`,a=x(),s=y(),[c,l]=z.useState(null),[u,f]=z.useState(!1),p=z.useCallback(async()=>{if(!i||!c)return;let e=c.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,o=b(t),l={model:t};n&&(l.api_key=n),r&&(l.base_url=r);try{await a.mutateAsync({name:o,request:{llm:l,include_secrets:!0}}),await s.mutateAsync(o)}catch(e){console.error(`Failed to persist onboarding LLM as profile:`,e)}},[i,c,a,s]),m=z.useCallback(async()=>{f(!0);try{await p()}finally{f(!1),t()}},[p,t]);return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(o.ONBOARDING$LLM_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(o.ONBOARDING$LLM_SUBTITLE)})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,B.jsx)(S,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:Ye,onSaveSuccess:m,onSaveControlChange:l})}),(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(o.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(c?.isSaving??!1)||u,onClick:()=>{if(c?.isDirty){c.save();return}t()},children:n(o.ONBOARDING$NEXT)})]})]})}function Ze({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:i}=d(`openhands`),a=E(),{status:s,isChecking:c}=ye(e,{enabled:t}),{fields:l,values:u,setValue:f,secretExists:p,hasValueFor:m,conflicts:h,consumesFileCredentials:g,save:_,isSaving:v}=xe(e),y=fe(e)??e,b=s===`authenticated`,x=Qe(a.backend.kind,s),S=b||l.some(e=>e.secret&&(!e.multiline||g)&&m(e.name)),C=x&&!S,w=v||C||c&&!S;return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(o.ONBOARDING$ACP_SECRETS_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:y})}),x&&!b?(0,B.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:y})}):s!==`authenticated`&&(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,B.jsx)(ve,{status:s,isChecking:c,providerName:y,testIdPrefix:`onboarding-acp-auth`}),(0,B.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,B.jsx)(be,{field:e,value:u[e.name]??``,onChange:t=>f(e.name,t),alreadySet:p(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,B.jsx)(_e,{conflicts:h}),C?(0,B.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:i(o.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:v,children:i(o.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:w,onClick:async()=>{await _()&&r()},children:i(v?o.SETTINGS$SAVING:o.ONBOARDING$NEXT)})]})]})}function Qe(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function $e({onBack:e,onClose:t,onLaunched:n}){let{t:r}=d(`openhands`),{navigate:i}=oe(),a=r(o.ONBOARDING$HELLO_DEFAULT_MESSAGE),[s,c]=z.useState(a),{mutate:f,isPending:p,isSuccess:m}=me(),h=l(),g=p||m||h,_=z.useRef(!1),v=s.trim().length>0&&!g&&!_.current,y=()=>{!v||_.current||(_.current=!0,f({query:s.trim()},{onSuccess:e=>{n(),i(`/conversations/${e.conversation_id}`)},onError:()=>{_.current=!1}}))};return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(o.ONBOARDING$HELLO_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(o.ONBOARDING$HELLO_SUBTITLE)})]}),(0,B.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),y()},"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,B.jsx)(`div`,{className:`relative w-full`,children:(0,B.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,B.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(o.ONBOARDING$HELLO_TITLE),type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},placeholder:a,disabled:g,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,B.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,B.jsx)(se,{buttonClassName:``,handleSubmit:y,disabled:!v})})]}),(0,B.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,B.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(o.LANDING$OR)}),(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,B.jsx)(u,{onLaunched:n,scrollableGrid:!0})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:g,children:r(o.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:g,children:r(o.BUTTON$CLOSE)})]})]})}var X=4,Z=2;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,B.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:C(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function et({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=d(`openhands`),[i,a]=z.useState(()=>Math.min(Math.max(t,0),X-1)),[s,c]=z.useState(`openhands`),l=s===`openhands`,u=z.useCallback(()=>a(e=>Math.min(e+1,X-1)),[]),f=z.useCallback(()=>a(e=>Math.max(e-1,0)),[]);return(0,B.jsx)(A,{"aria-label":r(o.ONBOARDING$TITLE),children:(0,B.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,B.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":i,"data-preview":n?`true`:void 0,className:C(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,j(`lg`),M,`max-h-[90vh]`),children:[(0,B.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,B.jsx)(He,{currentStep:i,totalSteps:X})}),(0,B.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,B.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":i,className:`relative overflow-clip`,children:[(0,B.jsx)(Q,{index:0,currentStep:i,children:(0,B.jsx)(Ke,{selectedAgentId:s,onSelect:c,onNext:u})}),(0,B.jsx)(Q,{index:1,currentStep:i,children:(0,B.jsx)(Je,{onBack:f,onNext:u})}),(0,B.jsx)(Q,{index:Z,currentStep:i,children:l?(0,B.jsx)(Xe,{onBack:f,onNext:u}):(0,B.jsx)(Ze,{providerKey:s,isActive:i===Z,onBack:f,onNext:u})}),(0,B.jsx)(Q,{index:3,currentStep:i,children:(0,B.jsx)($e,{onBack:f,onClose:e,onLaunched:e})})]})})]}),i<X-1?(0,B.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:e,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(o.ONBOARDING$SKIP)}):null]})})}var tt=`previewOnboardingStep`,nt=3;function $(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(tt);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>nt?null:n}function rt(e=typeof window<`u`?window.location.search:``){return $(e)!=null}var it=`openhands-onboarded`;function at(){if(typeof window>`u`)return!0;try{return window.localStorage.getItem(it)!==null}catch{return!0}}function ot(){let[e,t]=z.useState(()=>at());return z.useEffect(()=>{let e=e=>{e.key===`openhands-onboarded`&&t(at())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{isCompleted:e,markCompleted:z.useCallback(()=>{try{window.localStorage.setItem(it,`1`)}catch{}t(!0)},[])}}function st(){let e=n(),t=$(e.search),r=rt(e.search),{isCompleted:i,markCompleted:a}=ot();return!r&&i?null:(0,B.jsx)(et,{onClose:()=>{r||a()},initialStep:t??0,isPreview:r})}export{Fe as a,Me as c,Ne as d,V as f,Be as i,Ae as l,rt as n,Pe as o,Ve as r,G as s,st as t,je as u};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{k as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as r}from"./useMutation-Dm84WAKR.js";import{i}from"./organization-service.api-CzMvXIQT.js";import{o as a,t as o}from"./declaration-D9ucT0fq.js";import{n as s}from"./QueryClientProvider-XcSjsfpb.js";import{t as c}from"./useQuery-DGRSm7IT.js";import{r as l,t as u}from"./recommended-automations-launcher-WxaZcjRD.js";import{t as d}from"./useTranslation-CL6FTf1b.js";import{g as f,m as p,p as m}from"./query-client-config-Ca3tW1AH.js";import{t as h}from"./createLucideIcon-CkGTf9Qj.js";import{n as g}from"./vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js";import{t as _}from"./check-BhnsMsWy.js";import{t as v}from"./loader-circle-1XB9nbwF.js";import{a as y,i as b,r as x,t as S}from"./llm-settings-CiY22Wzi.js";import{t as C}from"./utils-eXk6yerZ.js";import{S as w,m as ee,n as T,u as te,y as ne}from"./agent-server-client-options-wXLeJYeM.js";import{n as E,o as D,r as re}from"./active-backend-context-B2OSC-qe.js";import{d as O,o as ie,u as k}from"./vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-DQE89epK.js";import{t as A}from"./modal-backdrop-_VbcKk5K.js";import{r as j,t as M}from"./modal-body-Cd-PtMHr.js";import{r as N}from"./base-modal-DvuGYyu1.js";import{i as P}from"./modal-classes-CNm4ovfm.js";import{t as F}from"./brand-button-9SOzmqPP.js";import{t as ae}from"./openhands-logo-Dzm-d_V_.js";import{n as oe}from"./navigation-context-BpAOh_t5.js";import{t as se}from"./chat-send-button-DzRpAQr4.js";import{i as ce,o as le,t as ue}from"./backend-form-modal-B3BCZDPq.js";import{t as de}from"./confirmation-modal-Cq3eqvqH.js";import{c as fe,i as pe,n as I}from"./acp-providers-Dzb4nxxB.js";import{t as me}from"./use-create-conversation-CJUAOf1q.js";import{t as he}from"./terminal-B92mACR5.js";import{t as L}from"./folder-DPTBlxWb.js";import{t as R}from"./close--W-tHn1h.js";import{t as ge}from"./use-save-settings-7_MLft-Y.js";import{a as _e,i as ve,n as ye,r as be,t as xe}from"./use-acp-credential-form-Dj7Jkhgp.js";var Se=h(`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`}]]),z=e(t(),1),B=a(),Ce=`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`,we=`0 0 100 100`,Te=`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`,Ee=`0 0 12 12`,De=`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`,Oe=`0 0 24 24`,ke=3/2;function V({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,B.jsx)(ae,{width:Math.round(t*ke),height:t,className:C(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:we,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:Ce})}):e===`codex`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Ee,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:Te,fill:`currentColor`})}):e===`gemini`?(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:Oe,width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,B.jsx)(`path`,{fill:`currentColor`,d:De})}):(0,B.jsx)(he,{width:t,height:t,className:C(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function H(){return new ie(T())}function U(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var W=class{static async listWorkspaces(){return U(await H().listWorkspaces())}static async addWorkspaces(e){return U(await H().addWorkspaces(e))}static async removeWorkspace(e){await H().deleteWorkspace(e)}static async addWorkspaceParents(e){return U(await H().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await H().deleteWorkspaceParent(e)}};function Ae(){let e=s();return r({mutationFn:e=>W.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function je(){let e=s();return r({mutationFn:e=>W.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function Me(){let e=s();return r({mutationFn:e=>W.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function Ne(){let e=s();return r({mutationFn:e=>W.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:D.all})})}function G({enabled:e=!0}={}){return c({queryKey:D.all,queryFn:()=>W.listWorkspaces(),enabled:e,retry:(e,t)=>!O(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function Pe(){let{data:e,isLoading:t,isError:n,error:r}=G(),a=O(r),o=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,z.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,a]),l=i({queries:a?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new k(T()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,z.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),o.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[o,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:u,isError:d,error:r}}function Fe(e,t){return O(e)?t(o.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function K(){return new k(T())}var Ie=e=>{let t=E();return c({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>K().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},Le=()=>{let e=E();return c({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>K().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},Re=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,B.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`})}),q=`/projects`;function J({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,B.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,B.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:C(`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,B.jsx)(L,{width:14,height:14,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function ze(e){let t=e.replace(/\/+$/,``);if(!t||t===`/`)return null;let n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function Y(e){return e?.home===`/home/openhands`}function Be({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=d(`openhands`),[a,s]=(0,z.useState)(null),c=E(),{data:l}=Le();(0,z.useEffect)(()=>{e&&l?.home&&a===null&&s(Y(l)?q:l.home),e||s(null)},[e,l?.home,a]),(0,z.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:f,isError:p,error:m}=Ie(e?a:null),h=(0,z.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:l.home.replace(/[\\/]+$/,``)||l.home},...l.favorites??[]];return Y(l)&&!e.some(e=>e.path===q)&&e.push({label:q,path:q}),e},[l]),g=l?.locations??[];if(!e)return null;let _=u?.items??[],v=a?ze(a):null,y=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&a===l?.home&&!f&&!p&&_.length===0,b=e=>{let t=e.replace(/\/+$/,``);if(!t)return`/`;let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1)||`/`:t};return(0,B.jsx)(A,{onClose:t,"aria-label":i(o.HOME$ADD_WORKSPACES_TITLE),children:(0,B.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`xl`),M,`h-[480px]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:i(o.HOME$ADD_WORKSPACES_TITLE)})}),(0,B.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,B.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,B.jsx)(J,{label:i(o.HOME$FAVORITES),entries:h,currentPath:a,onPick:s}),(0,B.jsx)(J,{label:i(o.HOME$LOCATIONS),entries:g,currentPath:a,onPick:s})]}),(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,B.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>v&&s(v),disabled:!v,"aria-label":`Up`,className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,B.jsx)(Re,{width:16,height:16})}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,B.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,B.jsx)(`span`,{children:i(o.HOME$NAME)}),(0,B.jsx)(`span`,{children:i(o.HOME$KIND)})]}),(0,B.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[f&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(o.HOME$LOADING)}),p&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:m?.message??`Failed to load`}),!f&&!p&&_.length===0&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":y?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(y?o.HOME$HOST_HOME_NOT_MOUNTED_HINT:o.HOME$NO_WORKSPACES)}),_.map(e=>(0,B.jsx)(`li`,{children:(0,B.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,B.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(o.HOME$FOLDER)})]})},e.path))]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(o.HOME$CANCEL)}),r&&(0,B.jsx)(F,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-add-all-subdirs`,children:i(o.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:b(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-use`,children:i(o.HOME$ADD_THIS_DIRECTORY)})]})]})})}function Ve({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:s}=d(`openhands`),[c,l]=z.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),f=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=f.get(e.parentPath)??[];t.push(e),f.set(e.parentPath,t)});let p=u.length>0||n.length>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:r,"aria-label":s(o.HOME$MANAGE_WORKSPACES),children:(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:C(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,j(`lg`),M,`max-h-[70vh]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(N,{className:P,title:s(o.HOME$MANAGE_WORKSPACES)})}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,B.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(o.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,B.jsx)(`ul`,{children:u.map(e=>(0,B.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,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(o.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,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,B.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(o.HOME$WORKSPACE_PARENTS)}),(0,B.jsx)(`ul`,{children:n.map(e=>{let t=f.get(e.path)??[];return(0,B.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,B.jsx)(L,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(o.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,B.jsx)(R,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,B.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,B.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,B.jsx)(L,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,B.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,B.jsx)(F,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(o.HOME$DONE)})})]})}),c&&(0,B.jsx)(de,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):a?.(c.path),l(null))},onCancel:()=>l(null)})]})}function He({currentStep:e,totalSteps:t,className:n}){return(0,B.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:C(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,B.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:C(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function Ue(e){return e===`openhands`?`openhands`:I.find(({key:t})=>t===e)?.icon??`cli-generic`}function We({id:e,muted:t}){let n=Ue(e);return n===`openhands`?(0,B.jsx)(V,{kind:`openhands`,size:16,className:C(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,B.jsx)(V,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Ge(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:o.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...I.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ke({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:i}=d(`openhands`),{mutate:a,isPending:s}=ge();return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(o.ONBOARDING$AGENT_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$AGENT_SUBTITLE)})]}),(0,B.jsx)(`div`,{role:`radiogroup`,"aria-label":i(o.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Ge().map(n=>{let r=n.id===e;return(0,B.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:C(`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,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(We,{id:n.id,muted:!1}),(0,B.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:i(n.descriptionKey)})]}),(0,B.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,B.jsx)(_,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,B.jsx)(F,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:s,children:i(o.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:s,onClick:()=>{let t=pe(e);if(!t){r();return}a({agent_settings_diff:t},{onError:e=>{m(f(e)||i(o.ERROR$GENERIC))},onSuccess:()=>{p(i(o.SETTINGS$SAVED)),r()}})},children:i(s?o.SETTINGS$SAVING:o.ONBOARDING$NEXT)})]})]})}function qe({isConnected:e}){let{t}=d(`openhands`);return e===!0?(0,B.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:C(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,B.jsx)(g,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:t(o.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-green-200/80`,children:t(o.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]}):e===!1?(0,B.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,B.jsx)(Se,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:t(o.ONBOARDING$BACKEND_DISCONNECTED_TITLE)}),(0,B.jsx)(`span`,{className:`text-xs text-red-200/80`,children:t(o.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]}):(0,B.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,B.jsx)(v,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,B.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:t(o.ONBOARDING$BACKEND_CHECKING)})]})}function Je({onBack:e,onNext:t}){let{t:n}=d(`openhands`),{active:r}=re(),{backend:i}=r,a=te(i),s=z.useMemo(()=>ne(),[]),c=a?{id:`onboarding-local-backend-draft`,name:ee,host:s.baseUrl,apiKey:s.sessionApiKey,kind:`local`}:i,l=le(a?[]:[i]),u=a?!1:l[i.id]?.isConnected??null,[f,p]=z.useState(!1);z.useEffect(()=>{u===!0&&p(!1)},[u]);let m=u===!0&&!f;return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(o.ONBOARDING$BACKEND_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(o.ONBOARDING$BACKEND_SUBTITLE)})]}),(0,B.jsx)(qe,{isConnected:u}),u===!0?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-expanded":f,"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,B.jsx)(`span`,{children:n(f?o.ONBOARDING$BACKEND_HIDE_CONFIGURATION:o.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,B.jsx)(ce,{className:C(`h-4 w-4 shrink-0 text-muted transition-transform`,f&&`rotate-180`),"aria-hidden":!0})]}):null,(0,B.jsx)(ue,{mode:a?`add`:`edit`,backend:c,onSubmitted:t,testIdRoot:`onboarding-backend`,requireApiKey:w(),hideConfigurationFields:m,renderActions:({canSubmit:t,isSubmitting:r})=>(0,B.jsxs)(`div`,{className:C(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`),children:[e?(0,B.jsx)(F,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:r,children:n(o.ONBOARDING$BACK)}):null,(0,B.jsx)(F,{testId:`onboarding-backend-next`,type:`submit`,variant:`primary`,isDisabled:!t||r,children:n(r?o.SETTINGS$SAVING:o.ONBOARDING$NEXT)})]})})]})}var Ye={"llm.model":`openai/gpt-5.5`};function Xe({onBack:e,onNext:t}){let{t:n}=d(`openhands`),{backend:r}=E(),i=r.kind===`local`,a=x(),s=y(),[c,l]=z.useState(null),[u,f]=z.useState(!1),p=z.useCallback(async()=>{if(!i||!c)return;let e=c.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,o=b(t),l={model:t};n&&(l.api_key=n),r&&(l.base_url=r);try{await a.mutateAsync({name:o,request:{llm:l,include_secrets:!0}}),await s.mutateAsync(o)}catch(e){console.error(`Failed to persist onboarding LLM as profile:`,e)}},[i,c,a,s]),m=z.useCallback(async()=>{f(!0);try{await p()}finally{f(!1),t()}},[p,t]);return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(o.ONBOARDING$LLM_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(o.ONBOARDING$LLM_SUBTITLE)})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,B.jsx)(S,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:Ye,onSaveSuccess:m,onSaveControlChange:l})}),(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(o.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(c?.isSaving??!1)||u,onClick:()=>{if(c?.isDirty){c.save();return}t()},children:n(o.ONBOARDING$NEXT)})]})]})}function Ze({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:i}=d(`openhands`),a=E(),{status:s,isChecking:c}=ye(e,{enabled:t}),{fields:l,values:u,setValue:f,secretExists:p,hasValueFor:m,conflicts:h,consumesFileCredentials:g,save:_,isSaving:v}=xe(e),y=fe(e)??e,b=s===`authenticated`,x=Qe(a.backend.kind,s),S=b||l.some(e=>e.secret&&(!e.multiline||g)&&m(e.name)),C=x&&!S,w=v||C||c&&!S;return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,B.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(o.ONBOARDING$ACP_SECRETS_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:y})}),x&&!b?(0,B.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:y})}):s!==`authenticated`&&(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(o.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,B.jsx)(ve,{status:s,isChecking:c,providerName:y,testIdPrefix:`onboarding-acp-auth`}),(0,B.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,B.jsx)(be,{field:e,value:u[e.name]??``,onChange:t=>f(e.name,t),alreadySet:p(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,B.jsx)(_e,{conflicts:h}),C?(0,B.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:i(o.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,B.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:v,children:i(o.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:w,onClick:async()=>{await _()&&r()},children:i(v?o.SETTINGS$SAVING:o.ONBOARDING$NEXT)})]})]})}function Qe(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function $e({onBack:e,onClose:t,onLaunched:n}){let{t:r}=d(`openhands`),{navigate:i}=oe(),a=r(o.ONBOARDING$HELLO_DEFAULT_MESSAGE),[s,c]=z.useState(a),{mutate:f,isPending:p,isSuccess:m}=me(),h=l(),g=p||m||h,_=z.useRef(!1),v=s.trim().length>0&&!g&&!_.current,y=()=>{!v||_.current||(_.current=!0,f({query:s.trim()},{onSuccess:e=>{n(),i(`/conversations/${e.conversation_id}`)},onError:()=>{_.current=!1}}))};return(0,B.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,B.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,B.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(o.ONBOARDING$HELLO_TITLE)}),(0,B.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(o.ONBOARDING$HELLO_SUBTITLE)})]}),(0,B.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),y()},"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,B.jsx)(`div`,{className:`relative w-full`,children:(0,B.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,B.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(o.ONBOARDING$HELLO_TITLE),type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},placeholder:a,disabled:g,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,B.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,B.jsx)(se,{buttonClassName:``,handleSubmit:y,disabled:!v})})]}),(0,B.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,B.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(o.LANDING$OR)}),(0,B.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,B.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,B.jsx)(u,{onLaunched:n,scrollableGrid:!0})}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,B.jsx)(F,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:g,children:r(o.ONBOARDING$BACK)}),(0,B.jsx)(F,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:g,children:r(o.BUTTON$CLOSE)})]})]})}var X=4,Z=2;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,B.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:C(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function et({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=d(`openhands`),[i,a]=z.useState(()=>Math.min(Math.max(t,0),X-1)),[s,c]=z.useState(`openhands`),l=s===`openhands`,u=z.useCallback(()=>a(e=>Math.min(e+1,X-1)),[]),f=z.useCallback(()=>a(e=>Math.max(e-1,0)),[]);return(0,B.jsx)(A,{"aria-label":r(o.ONBOARDING$TITLE),children:(0,B.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,B.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":i,"data-preview":n?`true`:void 0,className:C(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,j(`lg`),M,`max-h-[90vh]`),children:[(0,B.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,B.jsx)(He,{currentStep:i,totalSteps:X})}),(0,B.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,B.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":i,className:`relative overflow-clip`,children:[(0,B.jsx)(Q,{index:0,currentStep:i,children:(0,B.jsx)(Ke,{selectedAgentId:s,onSelect:c,onNext:u})}),(0,B.jsx)(Q,{index:1,currentStep:i,children:(0,B.jsx)(Je,{onBack:f,onNext:u})}),(0,B.jsx)(Q,{index:Z,currentStep:i,children:l?(0,B.jsx)(Xe,{onBack:f,onNext:u}):(0,B.jsx)(Ze,{providerKey:s,isActive:i===Z,onBack:f,onNext:u})}),(0,B.jsx)(Q,{index:3,currentStep:i,children:(0,B.jsx)($e,{onBack:f,onClose:e,onLaunched:e})})]})})]}),i<X-1?(0,B.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:e,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(o.ONBOARDING$SKIP)}):null]})})}var tt=`previewOnboardingStep`,nt=3;function $(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(tt);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>nt?null:n}function rt(e=typeof window<`u`?window.location.search:``){return $(e)!=null}var it=`openhands-onboarded`;function at(){if(typeof window>`u`)return!0;try{return window.localStorage.getItem(it)!==null}catch{return!0}}function ot(){let[e,t]=z.useState(()=>at());return z.useEffect(()=>{let e=e=>{e.key===`openhands-onboarded`&&t(at())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{isCompleted:e,markCompleted:z.useCallback(()=>{try{window.localStorage.setItem(it,`1`)}catch{}t(!0)},[])}}function st(){let e=n(),t=$(e.search),r=rt(e.search),{isCompleted:i,markCompleted:a}=ot();return!r&&i?null:(0,B.jsx)(et,{onClose:()=>{r||a()},initialStep:t??0,isPreview:r})}export{Fe as a,Me as c,Ne as d,V as f,Be as i,Ae as l,rt as n,Pe as o,Ve as r,G as s,st as t,je as u};
@@ -1 +1 @@
1
- import{n as e}from"./agent-server-client-options-B-C8JaTb.js";import{m as t}from"./active-backend-context-CNF2lPkA.js";import{t as n}from"./llm-client-P9f2gKeW.js";var r=class{static async getModels(){let t=new n(e()),[r,i,a]=await Promise.all([t.getModels(),t.getVerifiedModels(),t.getProviders()]),o=Object.keys(i??{}).sort(),s=o.flatMap(e=>i[e]??[]);return{models:r??[],verified_models:s,verified_providers:a?.filter(e=>o.includes(e))??o,default_model:s[0]??r?.[0]??``}}static async getConfig(){return await t(),{posthog_client_key:null,feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}};export{r as t};
1
+ import{n as e}from"./agent-server-client-options-wXLeJYeM.js";import{m as t}from"./active-backend-context-B2OSC-qe.js";import{t as n}from"./llm-client-D6EtdLBs.js";var r=class{static async getModels(){let t=new n(e()),[r,i,a]=await Promise.all([t.getModels(),t.getVerifiedModels(),t.getProviders()]),o=Object.keys(i??{}).sort(),s=o.flatMap(e=>i[e]??[]);return{models:r??[],verified_models:s,verified_providers:a?.filter(e=>o.includes(e))??o,default_model:s[0]??r?.[0]??``}}static async getConfig(){return await t(),{posthog_client_key:null,feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}};export{r as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{C as n,_ as r,b as i,c as a,k as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{a as s,c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./suspense-Bqb0V0q1.js";import{n as g}from"./QueryClientProvider-XcSjsfpb.js";import{a as _}from"./agent-server-client-options-B-C8JaTb.js";import{r as v}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js";import{t as y}from"./proxy--Uy1iGsW.js";function b(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function x(e,t,n){let r=e.slice(0);return r[t]=n,r}var S=class extends o{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,a.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),i=r.map(e=>e.getCurrentResult()),a=e.length!==r.length,o=r.some((t,n)=>t!==e[n]),s=a||o,c=s?!0:i.some((e,t)=>{let r=this.#t[t];return!r||!n(e,r)});!s&&!c||(s&&(this.#l=t,this.#i=r),this.#t=i,this.hasListeners()&&(s&&(b(e,r).forEach(e=>{e.destroy()}),b(r,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,a=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||a||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=i(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new h(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=x(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&a.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},C=e(t(),1);function w({queries:e,...t},n){let i=g(n),o=l(),_=c(),v=C.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=o?`isRestoring`:`optimistic`,t}),[e,i,o]);v.forEach(e=>{m(e),s(e,_,i.getQueryCache().get(e.queryHash))}),p(_);let[y]=C.useState(()=>new S(i,v,t)),[b,x,w]=y.getOptimisticResult(v,t.combine),T=!o&&t.subscribed!==!1;C.useSyncExternalStore(C.useCallback(e=>T?y.subscribe(a.batchCalls(e)):r,[y,T]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),C.useEffect(()=>{y.setQueries(v,t)},[v,t,y]);let E=b.some((e,t)=>f(v[t],e))?b.flatMap((e,t)=>{let n=v[t];return n&&f(n,e)?u(n,new h(i,n),_):[]}):[];if(E.length>0)throw Promise.all(E);let D=b.find((e,t)=>{let n=v[t];return n&&d({result:e,errorResetBoundary:_,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(D?.error)throw D.error;return x(w())}function T(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function E(e){if(e)return e;let t=_().backend;if(t.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return t}async function D(e){return T(await y({backend:E(e),method:`GET`,path:`/api/organizations`}))}async function O(e){let t=E(e);try{return{orgId:(await y({backend:t,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(e){if(v.isAxiosError(e)&&e.response?.status===400)return{orgId:null,isLegacyKey:!0};throw e}}async function k(e,t){let n=await y({backend:E(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:n?.org_id??e,userId:n?.user_id??``}}export{w as i,D as n,O as r,k as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{C as n,_ as r,b as i,c as a,k as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{a as s,c,l,n as u,o as d,r as f,s as p,t as m,u as h}from"./suspense-Bqb0V0q1.js";import{n as g}from"./QueryClientProvider-XcSjsfpb.js";import{a as _}from"./agent-server-client-options-wXLeJYeM.js";import{r as v}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js";import{t as y}from"./proxy-Bx3NeKeo.js";function b(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function x(e,t,n){let r=e.slice(0);return r[t]=n,r}var S=class extends o{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,a.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let r=t.map(e=>e.observer),i=r.map(e=>e.getCurrentResult()),a=e.length!==r.length,o=r.some((t,n)=>t!==e[n]),s=a||o,c=s?!0:i.some((e,t)=>{let r=this.#t[t];return!r||!n(e,r)});!s&&!c||(s&&(this.#l=t,this.#i=r),this.#t=i,this.hasListeners()&&(s&&(b(e,r).forEach(e=>{e.destroy()}),b(r,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,a=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||a||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=i(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new h(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=x(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&a.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},C=e(t(),1);function w({queries:e,...t},n){let i=g(n),o=l(),_=c(),v=C.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=o?`isRestoring`:`optimistic`,t}),[e,i,o]);v.forEach(e=>{m(e),s(e,_,i.getQueryCache().get(e.queryHash))}),p(_);let[y]=C.useState(()=>new S(i,v,t)),[b,x,w]=y.getOptimisticResult(v,t.combine),T=!o&&t.subscribed!==!1;C.useSyncExternalStore(C.useCallback(e=>T?y.subscribe(a.batchCalls(e)):r,[y,T]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),C.useEffect(()=>{y.setQueries(v,t)},[v,t,y]);let E=b.some((e,t)=>f(v[t],e))?b.flatMap((e,t)=>{let n=v[t];return n&&f(n,e)?u(n,new h(i,n),_):[]}):[];if(E.length>0)throw Promise.all(E);let D=b.find((e,t)=>{let n=v[t];return n&&d({result:e,errorResetBoundary:_,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(D?.error)throw D.error;return x(w())}function T(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function E(e){if(e)return e;let t=_().backend;if(t.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return t}async function D(e){return T(await y({backend:E(e),method:`GET`,path:`/api/organizations`}))}async function O(e){let t=E(e);try{return{orgId:(await y({backend:t,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(e){if(v.isAxiosError(e)&&e.response?.status===400)return{orgId:null,isLegacyKey:!0};throw e}}async function k(e,t){let n=await y({backend:E(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:n?.org_id??e,userId:n?.user_id??``}}export{w as i,D as n,O as r,k as t};
@@ -1 +1 @@
1
- import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{u as n}from"./suspense-Bqb0V0q1.js";import{n as r}from"./useQuery-DGRSm7IT.js";import{t as i}from"./createLucideIcon-CkGTf9Qj.js";import{a,n as o}from"./agent-server-client-options-B-C8JaTb.js";import{o as s,r as c,t as l}from"./agent-server-conversation-service.api-CGbkhsLj.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},m=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await p(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},_=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},v=(e,t,n)=>_(e,t,{execution_status:n}),y=(e,t,n)=>_(e,t,{llm_model:n}),b=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},x=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},S=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{_ as a,v as c,d,b as i,y as l,x as n,m as o,h as r,g as s,S as t,f as u};
1
+ import{i as e,r as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{u as n}from"./suspense-Bqb0V0q1.js";import{n as r}from"./useQuery-DGRSm7IT.js";import{t as i}from"./createLucideIcon-CkGTf9Qj.js";import{a,n as o}from"./agent-server-client-options-wXLeJYeM.js";import{o as s,r as c,t as l}from"./agent-server-conversation-service.api-C4Fc9Jnp.js";var u=class extends n{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(n,r){let{state:i}=n,a=super.createResult(n,r),{isFetching:o,isRefetching:s,isError:c,isRefetchError:l}=a,u=i.fetchMeta?.fetchMore?.direction,d=c&&u===`forward`,f=o&&u===`forward`,p=c&&u===`backward`,m=o&&u===`backward`;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:t(r,i.data),hasPreviousPage:e(r,i.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:l&&!d&&!p,isRefetching:s&&!f&&!m}}};function d(e,t){return r(e,u,t)}var f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=async e=>{let t=(await l.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},m=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:r}=await p(e);if(a().backend.kind===`cloud`){if(!r)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await c(r),{success:!0}}return new s(o({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},h=async(e,t)=>{let{conversationUrl:n,sessionApiKey:r}=await p(e);return new s(o({conversationUrl:n,sessionApiKey:r})).askAgent(e,t)},g=async e=>{let{conversationUrl:t,sessionApiKey:n}=await p(e);return new s(o({conversationUrl:t,sessionApiKey:n})).runConversation(e)},_=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},v=(e,t,n)=>_(e,t,{execution_status:n}),y=(e,t,n)=>_(e,t,{llm_model:n}),b=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},x=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},S=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n};export{_ as a,v as c,d,b as i,y as l,x as n,m as o,h as r,g as s,S as t,f as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-D9ucT0fq.js";import{t as i}from"./useTranslation-CL6FTf1b.js";import{t as a}from"./list-todo-nCa9zxVE.js";import{t as o}from"./brand-button-9SOzmqPP.js";import{t as s}from"./conversation-store-FQmakEd-.js";import{t as c}from"./use-handle-plan-click-CwN_nNib.js";import{t as l}from"./markdown-renderer-z446oW0Z.js";import{n as u,r as d}from"./plan-components-CutRBi0G.js";import{t as f}from"./conversation-tab-empty-state-C8tztloo.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=s();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(a,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(o,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-D9ucT0fq.js";import{t as i}from"./useTranslation-CL6FTf1b.js";import{t as a}from"./list-todo-nCa9zxVE.js";import{t as o}from"./brand-button-9SOzmqPP.js";import{t as s}from"./conversation-store-FQmakEd-.js";import{t as c}from"./use-handle-plan-click-BdcdMWbv.js";import{t as l}from"./markdown-renderer-z446oW0Z.js";import{n as u,r as d}from"./plan-components-CutRBi0G.js";import{t as f}from"./conversation-tab-empty-state-C8tztloo.js";var p=e(t(),1),m=n();function h(){let{t:e}=i(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=d(p.useRef(null)),{planContent:_,conversationMode:v}=s();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=c();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(a,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(o,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(r.COMMON$CREATE_A_PLAN)}),children:e(r.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(l,{includeStandard:!0,components:u,children:_})})}export{h as default};
@@ -1 +1 @@
1
- import{O as e}from"./agent-server-client-options-B-C8JaTb.js";var t=class{constructor(t){this.host=t.host.replace(/\/$/,``),this.apiKey=t.apiKey,this.client=new e({baseUrl:this.host,apiKey:this.apiKey,timeout:t.timeout||6e4})}async listProfiles(){return(await this.client.get(`/api/profiles`)).data}async getProfile(e,t={}){let n={};return t.exposeSecrets&&(n[`X-Expose-Secrets`]=t.exposeSecrets),(await this.client.get(`/api/profiles/${encodeURIComponent(e)}`,{headers:n})).data}async saveProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}`,t)).data}async deleteProfile(e){return(await this.client.delete(`/api/profiles/${encodeURIComponent(e)}`)).data}async renameProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/rename`,{new_name:t})).data}async activateProfile(e){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/activate`,{})).data}close(){this.client.close()}};export{t};
1
+ import{O as e}from"./agent-server-client-options-wXLeJYeM.js";var t=class{constructor(t){this.host=t.host.replace(/\/$/,``),this.apiKey=t.apiKey,this.client=new e({baseUrl:this.host,apiKey:this.apiKey,timeout:t.timeout||6e4})}async listProfiles(){return(await this.client.get(`/api/profiles`)).data}async getProfile(e,t={}){let n={};return t.exposeSecrets&&(n[`X-Expose-Secrets`]=t.exposeSecrets),(await this.client.get(`/api/profiles/${encodeURIComponent(e)}`,{headers:n})).data}async saveProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}`,t)).data}async deleteProfile(e){return(await this.client.delete(`/api/profiles/${encodeURIComponent(e)}`)).data}async renameProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/rename`,{new_name:t})).data}async activateProfile(e){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/activate`,{})).data}close(){this.client.close()}};export{t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-D9ucT0fq.js";import{n as r,t as i}from"./QueryClientProvider-XcSjsfpb.js";import{t as a}from"./context-CI9FqkUp.js";import{S as o,a as s,b as c,n as l,t as u,v as d,y as f}from"./query-client-config-Ca3tW1AH.js";import{t as p}from"./utils-eXk6yerZ.js";import{i as m,s as h,t as g}from"./active-backend-context-CNF2lPkA.js";import{t as _}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js";import{t as v}from"./option-service.api-DjPvPAtd.js";import{n as y,t as b}from"./agent-server-ui-style-scope-BwIZYdC1.js";var x=e(t());function S({i18n:e,defaultNS:t,children:n}){let r=(0,x.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,x.createElement)(a.Provider,{value:r},n)}var C=n(),w=`posthog_bootstrap`;function T(){let e=window.location.hash.substring(1),t=new URLSearchParams(e),n=t.get(`distinct_id`),r=t.get(`session_id`);if(n&&r){let e={distinctID:n,sessionID:r};return sessionStorage.setItem(w,JSON.stringify(e)),window.history.replaceState(null,``,window.location.pathname+window.location.search),e}let i=sessionStorage.getItem(w);if(i)return sessionStorage.removeItem(w),JSON.parse(i)}function E({children:e}){let t=r(),[n,i]=x.useState(null),[a,o]=x.useState(!0),s=x.useMemo(()=>T(),[]);return x.useEffect(()=>{(async()=>{try{i((await t.fetchQuery({queryKey:h.WEB_CLIENT_CONFIG,queryFn:v.getConfig,meta:{disableToast:!0},...m})).posthog_client_key)}catch{}finally{o(!1)}})()},[t]),a||!n?e:(0,C.jsx)(_,{apiKey:n,options:{api_host:`https://us.i.posthog.com`,person_profiles:`identified_only`,bootstrap:s},children:e})}function D({children:e,theme:t=y,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=x.useMemo(()=>({...b,...i,...r}),[r,i]);return(0,C.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,C.jsx)(`div`,{className:p(t,a,`text-foreground`),"data-theme":t,children:e})})}var O={provider:`posthog`};function k({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,withStyleRoot:v=!0}){let y=x.useMemo(()=>t??u(),[t]),b=x.useMemo(()=>r??f(),[r]),w=x.useRef(null);w.current||={queryClient:l(),i18n:c()},s(y),o(b),x.useEffect(()=>()=>{w.current&&(s(w.current.queryClient),o(w.current.i18n))},[]);let T=n&&n.provider===`posthog`?(0,C.jsx)(E,{children:e}):e;return(0,C.jsx)(S,{i18n:b,defaultNS:d,children:(0,C.jsx)(i,{client:y,children:(0,C.jsx)(g,{children:v?(0,C.jsx)(D,{className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,children:T}):T})})})}export{O as n,D as r,k as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-D9ucT0fq.js";import{n as r,t as i}from"./QueryClientProvider-XcSjsfpb.js";import{t as a}from"./context-CI9FqkUp.js";import{S as o,a as s,b as c,n as l,t as u,v as d,y as f}from"./query-client-config-Ca3tW1AH.js";import{t as p}from"./utils-eXk6yerZ.js";import{i as m,s as h,t as g}from"./active-backend-context-B2OSC-qe.js";import{t as _}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js";import{t as v}from"./option-service.api-CdYnKVsu.js";import{n as y,t as b}from"./agent-server-ui-style-scope-BwIZYdC1.js";var x=e(t());function S({i18n:e,defaultNS:t,children:n}){let r=(0,x.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,x.createElement)(a.Provider,{value:r},n)}var C=n(),w=`posthog_bootstrap`;function T(){let e=window.location.hash.substring(1),t=new URLSearchParams(e),n=t.get(`distinct_id`),r=t.get(`session_id`);if(n&&r){let e={distinctID:n,sessionID:r};return sessionStorage.setItem(w,JSON.stringify(e)),window.history.replaceState(null,``,window.location.pathname+window.location.search),e}let i=sessionStorage.getItem(w);if(i)return sessionStorage.removeItem(w),JSON.parse(i)}function E({children:e}){let t=r(),[n,i]=x.useState(null),[a,o]=x.useState(!0),s=x.useMemo(()=>T(),[]);return x.useEffect(()=>{(async()=>{try{i((await t.fetchQuery({queryKey:h.WEB_CLIENT_CONFIG,queryFn:v.getConfig,meta:{disableToast:!0},...m})).posthog_client_key)}catch{}finally{o(!1)}})()},[t]),a||!n?e:(0,C.jsx)(_,{apiKey:n,options:{api_host:`https://us.i.posthog.com`,person_profiles:`identified_only`,bootstrap:s},children:e})}function D({children:e,theme:t=y,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=x.useMemo(()=>({...b,...i,...r}),[r,i]);return(0,C.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,C.jsx)(`div`,{className:p(t,a,`text-foreground`),"data-theme":t,children:e})})}var O={provider:`posthog`};function k({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,withStyleRoot:v=!0}){let y=x.useMemo(()=>t??u(),[t]),b=x.useMemo(()=>r??f(),[r]),w=x.useRef(null);w.current||={queryClient:l(),i18n:c()},s(y),o(b),x.useEffect(()=>()=>{w.current&&(s(w.current.queryClient),o(w.current.i18n))},[]);let T=n&&n.provider===`posthog`?(0,C.jsx)(E,{children:e}):e;return(0,C.jsx)(S,{i18n:b,defaultNS:d,children:(0,C.jsx)(i,{client:y,children:(0,C.jsx)(g,{children:v?(0,C.jsx)(D,{className:a,contentClassName:p,style:m,styleOverrides:h,theme:_,children:T}):T})})})}export{O as n,D as r,k as t};
@@ -1 +1 @@
1
- import{a as e,b as t,t as n,v as r}from"./agent-server-client-options-B-C8JaTb.js";import{r as i}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js";function a(e){return e.apiKey?e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}:{}}function o(e){let t=e.authMode??`bearer`;return t===`bearer`?a(e.backend):t===`session-api-key`&&e.sessionApiKey?{"X-Session-API-Key":e.sessionApiKey}:{}}async function s(a){let s=e(),c=s.backend.id===a.backend.id&&s.orgId?{"X-Org-Id":s.orgId}:{},l={...o(a),...c,...a.headers??{}},u=a.hostOverride??a.backend.host;if(!a.hostOverride&&!a.forceProxy)return(await i.request({url:`${u.replace(/\/+$/,``)}${a.path}`,method:a.method,headers:l,...a.body===void 0?{}:{data:a.body},timeout:(a.timeoutSeconds??30)*1e3,...a.responseType?{responseType:a.responseType}:{}})).data;let d=r();if(!d)throw new n;let f=t();return(await i.post(`${d.replace(/\/+$/,``)}/api/cloud-proxy`,{host:u,method:a.method,path:a.path,headers:l,body:a.body??null,...a.timeoutSeconds?{timeout_seconds:a.timeoutSeconds}:{}},{headers:f,timeout:3e4,...a.responseType?{responseType:a.responseType}:{}})).data}export{a as n,s as t};
1
+ import{a as e,b as t,t as n,v as r}from"./agent-server-client-options-wXLeJYeM.js";import{r as i}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js";function a(e){return e.apiKey?e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}:{}}function o(e){let t=e.authMode??`bearer`;return t===`bearer`?a(e.backend):t===`session-api-key`&&e.sessionApiKey?{"X-Session-API-Key":e.sessionApiKey}:{}}async function s(a){let s=e(),c=s.backend.id===a.backend.id&&s.orgId?{"X-Org-Id":s.orgId}:{},l={...o(a),...c,...a.headers??{}},u=a.hostOverride??a.backend.host;if(!a.hostOverride&&!a.forceProxy)return(await i.request({url:`${u.replace(/\/+$/,``)}${a.path}`,method:a.method,headers:l,...a.body===void 0?{}:{data:a.body},timeout:(a.timeoutSeconds??30)*1e3,...a.responseType?{responseType:a.responseType}:{}})).data;let d=r();if(!d)throw new n;let f=t();return(await i.post(`${d.replace(/\/+$/,``)}/api/cloud-proxy`,{host:u,method:a.method,path:a.path,headers:l,body:a.body??null,...a.timeoutSeconds?{timeout_seconds:a.timeoutSeconds}:{}},{headers:f,timeout:3e4,...a.responseType?{responseType:a.responseType}:{}})).data}export{a as n,s as t};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{b as n,c as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{n as o}from"./QueryClientProvider-XcSjsfpb.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{r as c}from"./vendor~root-layout~home~mcp~automations-list-D40jgugf.js";import{t as l}from"./circle-plus-check-toggle-AO9DWyDX.js";import{t as u}from"./utils-eXk6yerZ.js";import{n as d}from"./active-backend-context-CNF2lPkA.js";import{n as f}from"./navigation-context-BpAOh_t5.js";import{t as p}from"./conversation-store-FQmakEd-.js";import{a as m,o as h}from"./conversation-local-storage-an3MiIiJ.js";import{i as g,r as _}from"./use-settings-0SeqaDeW.js";import{t as v}from"./use-tracking-BhyV5A9i.js";import{t as y}from"./use-create-conversation-pV2eA-e9.js";import{i as b,n as x,r as S,t as C}from"./extension-module-card-classes-DP5J6ngE.js";import{f as w,i as T,l as E,m as D,o as O,t as k,u as A}from"./install-server-modal-_7l1gcjd.js";import{n as j}from"./skill-card-pill-row-DeodrwPG.js";var M=e(t(),1);function N(e,t){let n=o(t);return F({filters:{...e,status:`pending`}},n).length}function P(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function F(e={},t){let i=o(t).getMutationCache(),a=M.useRef(e),s=M.useRef(null);return s.current===null&&(s.current=P(i,e)),M.useEffect(()=>{a.current=e}),M.useSyncExternalStore(M.useCallback(e=>i.subscribe(()=>{let t=n(s.current,P(i,a.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var I=()=>{let e=f(),t=N({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},L=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{b as n,c as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js";import{o as i,t as a}from"./declaration-D9ucT0fq.js";import{n as o}from"./QueryClientProvider-XcSjsfpb.js";import{t as s}from"./useTranslation-CL6FTf1b.js";import{r as c}from"./vendor~root-layout~home~mcp~automations-list-D40jgugf.js";import{t as l}from"./circle-plus-check-toggle-AO9DWyDX.js";import{t as u}from"./utils-eXk6yerZ.js";import{n as d}from"./active-backend-context-B2OSC-qe.js";import{n as f}from"./navigation-context-BpAOh_t5.js";import{t as p}from"./conversation-store-FQmakEd-.js";import{a as m,o as h}from"./conversation-local-storage-an3MiIiJ.js";import{i as g,r as _}from"./use-settings-CNsxccvQ.js";import{t as v}from"./use-tracking-C9P88zSo.js";import{t as y}from"./use-create-conversation-CJUAOf1q.js";import{i as b,n as x,r as S,t as C}from"./extension-module-card-classes-DP5J6ngE.js";import{f as w,i as T,l as E,m as D,o as O,t as k,u as A}from"./install-server-modal-CWZhBKwH.js";import{n as j}from"./skill-card-pill-row-DeodrwPG.js";var M=e(t(),1);function N(e,t){let n=o(t);return F({filters:{...e,status:`pending`}},n).length}function P(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function F(e={},t){let i=o(t).getMutationCache(),a=M.useRef(e),s=M.useRef(null);return s.current===null&&(s.current=P(i,e)),M.useEffect(()=>{a.current=e}),M.useSyncExternalStore(M.useCallback(e=>i.subscribe(()=>{let t=n(s.current,P(i,a.current));s.current!==t&&(s.current=t,r.schedule(e))}),[i]),()=>s.current,()=>s.current)}var I=()=>{let e=f(),t=N({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},L=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch pull requests, inspect the diff, and leave a concise review with risks and suggested follow-ups.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: github.pull_request.opened and github.pull_request.synchronize
2
2
  Required MCP: GitHub
3
3
 
4
4
  1. Read repository, pull_request, and sender from the event payload.
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-tfdzTXWU.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-B-C8JaTb.js","assets/active-backend-context-CNF2lPkA.js","assets/declaration-D9ucT0fq.js","assets/react-CM_dJw1Z.js","assets/query-client-config-Ca3tW1AH.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/createLucideIcon-CkGTf9Qj.js","assets/utils-eXk6yerZ.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/common-Dh7OqABE.js","assets/useQuery-DGRSm7IT.js","assets/suspense-Bqb0V0q1.js","assets/QueryClientProvider-XcSjsfpb.js","assets/pencil-DPEtl5QD.js","assets/plus-DKUID4kd.js","assets/trash-2-C-RvV8WA.js","assets/useTranslation-CL6FTf1b.js","assets/context-CI9FqkUp.js","assets/backend-form-modal-Dl29wkF5.js","assets/organization-service.api-BNc9Kn6n.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/proxy--Uy1iGsW.js","assets/brand-button-9SOzmqPP.js","assets/settings-input-BM8ANxDb.js","assets/modal-backdrop-_VbcKk5K.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-Cd-PtMHr.js","assets/modal-close-button-Dbo0NAMt.js","assets/navigation-context-BpAOh_t5.js","assets/modal-classes-CNm4ovfm.js","assets/confirmation-modal-Cq3eqvqH.js","assets/api-key-entry-screen-Dnr5TcV0.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as l}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{o as u,t as d}from"./declaration-D9ucT0fq.js";import{n as f}from"./QueryClientProvider-XcSjsfpb.js";import{t as p}from"./useTranslation-CL6FTf1b.js";import{r as m}from"./providers-BiWSYwRT.js";import{f as h}from"./query-client-config-Ca3tW1AH.js";import{C as g,s as _}from"./agent-server-client-options-B-C8JaTb.js";import{f as v,l as y,s as b,u as x}from"./active-backend-context-CNF2lPkA.js";import{a as S,i as C,n as w,o as T,r as E,t as D}from"./telemetry-DCFAqpIA.js";import{t as O}from"./modal-backdrop-_VbcKk5K.js";import{n as k}from"./modal-body-Cd-PtMHr.js";import{n as A,r as j}from"./base-modal-DvuGYyu1.js";import{t as M}from"./brand-button-9SOzmqPP.js";import{t as N}from"./loading-spinner-D7bOU6I7.js";import{t as P}from"./use-config-5zEjywCL.js";import{i as F,n as I}from"./color-themes-0biOprdo.js";var L=e(t(),1);function R(){let[e,t]=(0,L.useState)(()=>w()),n=(0,L.useRef)(!1);(0,L.useEffect)(()=>{n.current||(n.current=!0,S())},[]),(0,L.useEffect)(()=>{e===`granted`&&T()},[e]);let r=(0,L.useCallback)(async()=>{await E(`granted`),t(`granted`)},[]),i=(0,L.useCallback)(async()=>{await E(`denied`),t(`denied`)},[]),a=(0,L.useCallback)((t,n)=>{e===`granted`&&C(t,n)},[e]),o=(0,L.useCallback)(()=>{D(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var z=u();function B({onChoice:e}){let{t,ready:n}=p(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=R(),[o,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,z.jsx)(O,{"aria-label":t(d.TELEMETRY$CONSENT_TITLE),children:(0,z.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,z.jsxs)(k,{className:`border border-[var(--oh-border)]`,children:[(0,z.jsx)(j,{title:t(d.TELEMETRY$CONSENT_TITLE)}),(0,z.jsx)(A,{children:t(d.TELEMETRY$CONSENT_DESCRIPTION)}),(0,z.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,z.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(d.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,z.jsx)(M,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(d.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function V(){return L.useEffect(()=>{I(F())},[]),null}var H=L.lazy(()=>n(()=>import(`./manage-backends-modal-tfdzTXWU.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),U=L.lazy(()=>n(()=>import(`./api-key-entry-screen-Dnr5TcV0.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,22,14,15,23,24,13,25,26,27,28,29,30,31,32])));function W({children:e}){return(0,z.jsxs)(`html`,{lang:`en`,children:[(0,z.jsxs)(`head`,{children:[(0,z.jsx)(`meta`,{charSet:`utf-8`}),(0,z.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,z.jsx)(i,{}),(0,z.jsx)(c,{})]}),(0,z.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,z.jsxs)(m,{contentClassName:`min-h-screen`,children:[(0,z.jsx)(V,{}),e,(0,z.jsx)(l,{toastOptions:h}),(0,z.jsx)(B,{}),(0,z.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,z.jsx)(s,{}),(0,z.jsx)(o,{})]})]})}function G(){return(0,z.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,z.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,z.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,z.jsx)(N,{size:`large`})})})})}function K(){let e=f(),t=L.useCallback(()=>{_()&&(y(),e.invalidateQueries({queryKey:b.WEB_CLIENT_CONFIG}))},[e]);return(0,z.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,z.jsx)(L.Suspense,{fallback:null,children:(0,z.jsx)(H,{onClose:t,recoveryMode:!0})})})}var q=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],J=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],Y=r(function(){let e=g(),t=!!_()?.apiKey,n=e&&!t,r=P({enabled:!n});return n||x(r.error)?(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(G,{}),children:(0,z.jsx)(U,{})}):r.isPending||r.isLoading?(0,z.jsx)(G,{}):v(r.error)?(0,z.jsx)(K,{}):(0,z.jsx)(a,{})});export{W as Layout,Y as default,q as links,J as meta};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-v5POMal5.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-wXLeJYeM.js","assets/active-backend-context-B2OSC-qe.js","assets/declaration-D9ucT0fq.js","assets/react-CM_dJw1Z.js","assets/query-client-config-Ca3tW1AH.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/createLucideIcon-CkGTf9Qj.js","assets/utils-eXk6yerZ.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/common-Dh7OqABE.js","assets/useQuery-DGRSm7IT.js","assets/suspense-Bqb0V0q1.js","assets/QueryClientProvider-XcSjsfpb.js","assets/pencil-DPEtl5QD.js","assets/plus-DKUID4kd.js","assets/trash-2-C-RvV8WA.js","assets/useTranslation-CL6FTf1b.js","assets/context-CI9FqkUp.js","assets/backend-form-modal-B3BCZDPq.js","assets/organization-service.api-CzMvXIQT.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/proxy-Bx3NeKeo.js","assets/brand-button-9SOzmqPP.js","assets/settings-input-BM8ANxDb.js","assets/modal-backdrop-_VbcKk5K.js","assets/react-dom-hVBnwgwZ.js","assets/modal-body-Cd-PtMHr.js","assets/modal-close-button-Dbo0NAMt.js","assets/navigation-context-BpAOh_t5.js","assets/modal-classes-CNm4ovfm.js","assets/confirmation-modal-Cq3eqvqH.js","assets/api-key-entry-screen-BarZU9nr.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{L as r,a as i,c as a,d as o,f as s,i as c}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as l}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{o as u,t as d}from"./declaration-D9ucT0fq.js";import{n as f}from"./QueryClientProvider-XcSjsfpb.js";import{t as p}from"./useTranslation-CL6FTf1b.js";import{r as m}from"./providers-CbpQft-X.js";import{f as h}from"./query-client-config-Ca3tW1AH.js";import{C as g,s as _}from"./agent-server-client-options-wXLeJYeM.js";import{f as v,l as y,s as b,u as x}from"./active-backend-context-B2OSC-qe.js";import{a as S,i as C,n as w,o as T,r as E,t as D}from"./telemetry-CAWBJ_rB.js";import{t as O}from"./modal-backdrop-_VbcKk5K.js";import{n as k}from"./modal-body-Cd-PtMHr.js";import{n as A,r as j}from"./base-modal-DvuGYyu1.js";import{t as M}from"./brand-button-9SOzmqPP.js";import{t as N}from"./loading-spinner-D7bOU6I7.js";import{t as P}from"./use-config-DVU9HaPf.js";import{i as F,n as I}from"./color-themes-0biOprdo.js";var L=e(t(),1);function R(){let[e,t]=(0,L.useState)(()=>w()),n=(0,L.useRef)(!1);(0,L.useEffect)(()=>{n.current||(n.current=!0,S())},[]),(0,L.useEffect)(()=>{e===`granted`&&T()},[e]);let r=(0,L.useCallback)(async()=>{await E(`granted`),t(`granted`)},[]),i=(0,L.useCallback)(async()=>{await E(`denied`),t(`denied`)},[]),a=(0,L.useCallback)((t,n)=>{e===`granted`&&C(t,n)},[e]),o=(0,L.useCallback)(()=>{D(),t(`pending`)},[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:r,denyConsent:i,track:a,clearData:o}}var z=u();function B({onChoice:e}){let{t,ready:n}=p(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=R(),[o,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,z.jsx)(O,{"aria-label":t(d.TELEMETRY$CONSENT_TITLE),children:(0,z.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,z.jsxs)(k,{className:`border border-[var(--oh-border)]`,children:[(0,z.jsx)(j,{title:t(d.TELEMETRY$CONSENT_TITLE)}),(0,z.jsx)(A,{children:t(d.TELEMETRY$CONSENT_DESCRIPTION)}),(0,z.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,z.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(d.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,z.jsx)(M,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(d.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function V(){return L.useEffect(()=>{I(F())},[]),null}var H=L.lazy(()=>n(()=>import(`./manage-backends-modal-v5POMal5.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),U=L.lazy(()=>n(()=>import(`./api-key-entry-screen-BarZU9nr.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,22,14,15,23,24,13,25,26,27,28,29,30,31,32])));function W({children:e}){return(0,z.jsxs)(`html`,{lang:`en`,children:[(0,z.jsxs)(`head`,{children:[(0,z.jsx)(`meta`,{charSet:`utf-8`}),(0,z.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,z.jsx)(i,{}),(0,z.jsx)(c,{})]}),(0,z.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,z.jsxs)(m,{contentClassName:`min-h-screen`,children:[(0,z.jsx)(V,{}),e,(0,z.jsx)(l,{toastOptions:h}),(0,z.jsx)(B,{}),(0,z.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,z.jsx)(s,{}),(0,z.jsx)(o,{})]})]})}function G(){return(0,z.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,z.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,z.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,z.jsx)(N,{size:`large`})})})})}function K(){let e=f(),t=L.useCallback(()=>{_()&&(y(),e.invalidateQueries({queryKey:b.WEB_CLIENT_CONFIG}))},[e]);return(0,z.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,z.jsx)(L.Suspense,{fallback:null,children:(0,z.jsx)(H,{onClose:t,recoveryMode:!0})})})}var q=()=>[{rel:`icon`,type:`image/svg+xml`,href:`/favicon.svg`}],J=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],Y=r(function(){let e=g(),t=!!_()?.apiKey,n=e&&!t,r=P({enabled:!n});return n||x(r.error)?(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(G,{}),children:(0,z.jsx)(U,{})}):r.isPending||r.isLoading?(0,z.jsx)(G,{}):v(r.error)?(0,z.jsx)(K,{}):(0,z.jsx)(a,{})});export{W as Layout,Y as default,q as links,J as meta};