@openhands/agent-canvas 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{active-backend-context-B8rMv0X9.js → active-backend-context-DHhm10VS.js} +1 -1
  4. package/build/assets/{add-backend-modal-CxC7BNEc.js → add-backend-modal-BoMkMyLB.js} +1 -1
  5. package/build/assets/{agent-profiles-settings-BJb8YXR1.js → agent-profiles-settings-CYPloKYK.js} +1 -1
  6. package/build/assets/{agent-server-compatibility-BWN-EIQn.js → agent-server-compatibility-C0MtTTwb.js} +1 -1
  7. package/build/assets/{agent-server-conversation-service.api-DSPIkMwJ.js → agent-server-conversation-service.api-lzc8dabY.js} +3 -3
  8. package/build/assets/{agent-settings-CgCnqaAA.js → agent-settings-GwiXe_6k.js} +1 -1
  9. package/build/assets/agent-settings-OdsyI2gX.js +1 -0
  10. package/build/assets/{api-key-entry-screen-iZc7n8AI.js → api-key-entry-screen-2gsoZAOK.js} +1 -1
  11. package/build/assets/{app-settings-B5zyipxJ.js → app-settings-CD9euh81.js} +1 -1
  12. package/build/assets/{automation-detail-CZsu2CoM.js → automation-detail-Bn8q0AG3.js} +1 -1
  13. package/build/assets/{automation-export-BwRX6H32.js → automation-export-Djc8Tf0M.js} +1 -1
  14. package/build/assets/{automations-list-lHAVzMoA.js → automations-list-Dtiolk1h.js} +1 -1
  15. package/build/assets/{backend-form-modal-RGcu909r.js → backend-form-modal-B8GtBA-J.js} +1 -1
  16. package/build/assets/{backend-synced-settings-badge-BSfN0AZA.js → backend-synced-settings-badge-yVh6Kf4E.js} +1 -1
  17. package/build/assets/{client-source-BZK8vRs2.js → client-source-CtQjJEy6.js} +1 -1
  18. package/build/assets/{cloud-funnel-analytics-Zcv57hfT.js → cloud-funnel-analytics-uzzLlLuj.js} +1 -1
  19. package/build/assets/{condenser-settings-BGlWn93P.js → condenser-settings-Q1rHh4Qe.js} +1 -1
  20. package/build/assets/conversation-B8d8_Upd.js +1 -0
  21. package/build/assets/{conversation-BoCYx8n2.js → conversation-Lmqm6VJC.js} +20 -20
  22. package/build/assets/conversation-panel-B8n40Swu.js +1 -0
  23. package/build/assets/{conversation-service.api-_f9GlIEi.js → conversation-service.api-D8QU-BiL.js} +1 -1
  24. package/build/assets/{entry.client-DNlPGxsu.js → entry.client-Dnnak-Hq.js} +1 -1
  25. package/build/assets/{extensions-hub-CCbLA7IM.js → extensions-hub-DqvwvpCi.js} +1 -1
  26. package/build/assets/{extensions-navigation-CPNjMNvR.js → extensions-navigation-BMc9Nluv.js} +1 -1
  27. package/build/assets/{files-tab-y4K7EXBO.js → files-tab-BAkaV4aO.js} +1 -1
  28. package/build/assets/{git-provider-icon-ITvsH4Ko.js → git-provider-icon-xvbukHaT.js} +1 -1
  29. package/build/assets/{home-BwbeOWwU.js → home-D01kSnmo.js} +1 -1
  30. package/build/assets/home-NZO2bF4N.js +1 -0
  31. package/build/assets/index-home-BsI6i0TC.js +1 -0
  32. package/build/assets/{install-server-modal-Qk1gwyI8.js → install-server-modal-BYjqoRyX.js} +1 -1
  33. package/build/assets/{launch-CAGavYl-.js → launch-DlXspDku.js} +1 -1
  34. package/build/assets/{lesson-plan-DMCPdtrf.js → lesson-plan-cNUjpdFx.js} +1 -1
  35. package/build/assets/{llm-not-configured-banner-C1ktyb3C.js → llm-not-configured-banner-DUPyoFIZ.js} +7 -7
  36. package/build/assets/{llm-settings-DFkJQr_w.js → llm-settings-Cs_iieFY.js} +1 -1
  37. package/build/assets/llm-settings-J2ke2foG.js +1 -0
  38. package/build/assets/{llm-subscription-service-Casyzgn1.js → llm-subscription-service-C0zN0-rH.js} +1 -1
  39. package/build/assets/{manage-backends-modal-CKQ46rvw.js → manage-backends-modal-nMoCZ2a0.js} +1 -1
  40. package/build/assets/{manifest-03478bbf.js → manifest-f1b46f62.js} +1 -1
  41. package/build/assets/{mcp-BapoJsDc.js → mcp-kZM-cAZw.js} +1 -1
  42. package/build/assets/{messages-CUBFMY5o.js → messages-CJAv5n4j.js} +1 -1
  43. package/build/assets/{model-selector-DJrMrFAr.js → model-selector-D51W2Q9b.js} +1 -1
  44. package/build/assets/{onboarding-6NMkdNxV.js → onboarding-Dx8n8HFr.js} +1 -1
  45. package/build/assets/{onboarding-modal-Q4AnpIdg.js → onboarding-modal-Bxuxpfdz.js} +1 -1
  46. package/build/assets/{organization-service.api-vrRNwOma.js → organization-service.api-Da2jiuBS.js} +1 -1
  47. package/build/assets/{path-utils-PNfCKQDV.js → path-utils-D53ZHUQU.js} +1 -1
  48. package/build/assets/{planner-tab-ByOw1he8.js → planner-tab-BM-pKx0z.js} +1 -1
  49. package/build/assets/{plugins-management-service-B75jyC56.js → plugins-management-service-DISfOL13.js} +1 -1
  50. package/build/assets/{profiles-service.api-BQTklD5D.js → profiles-service.api-DWetW2TL.js} +1 -1
  51. package/build/assets/{providers-DfTB2gPd.js → providers-C7lMslCi.js} +1 -1
  52. package/build/assets/{proxy-B3tCGf0X.js → proxy-G4ce0fnQ.js} +1 -1
  53. package/build/assets/{recommended-automations-launcher-Bj7PuHY1.js → recommended-automations-launcher-BWRRvMPE.js} +1 -1
  54. package/build/assets/{root-layout-DfYVlcRG.js → root-layout-ClEl-JlJ.js} +2 -2
  55. package/build/assets/{root-CDnuTToz.js → root-oT83qVlk.js} +2 -2
  56. package/build/assets/{schema-field-CUwk4wrQ.js → schema-field-CwdqUOnE.js} +1 -1
  57. package/build/assets/{sdk-section-page-DLLNrYjI.js → sdk-section-page-Cwj0T4gF.js} +1 -1
  58. package/build/assets/{secrets-service-CvyPWJhg.js → secrets-service-Ch7RH8eH.js} +1 -1
  59. package/build/assets/{secrets-settings-CHy72A5C.js → secrets-settings-Bc_pBX6F.js} +1 -1
  60. package/build/assets/{settings-index-BKDl2CQ-.js → settings-index-BzSIM1-N.js} +1 -1
  61. package/build/assets/{settings-modal-DeK11CyT.js → settings-modal-BnZ7mMu7.js} +1 -1
  62. package/build/assets/{settings-B9S8UVQr.js → settings-n9a395O0.js} +1 -1
  63. package/build/assets/{settings-service.api-DXk5TdeJ.js → settings-service.api-DPTFyRXL.js} +1 -1
  64. package/build/assets/{shared-conversation-9atDzTR4.js → shared-conversation-CIDDti9I.js} +1 -1
  65. package/build/assets/{sidebar-mobile-menu-toggle-giMMZctn.js → sidebar-mobile-menu-toggle-CTX7J4wM.js} +1 -1
  66. package/build/assets/{skills-plugins-Tropusio.js → skills-plugins-HZEbNDmX.js} +1 -1
  67. package/build/assets/{skills-settings-BvzBBCWk.js → skills-settings-BdqijFlC.js} +1 -1
  68. package/build/assets/{telemetry-C5JMEfqB.js → telemetry-SHxpVxk8.js} +1 -1
  69. package/build/assets/{terminal-DRXt2Lr4.js → terminal-BDTa1HEr.js} +1 -1
  70. package/build/assets/{use-acp-credential-form-Bm8qXdlc.js → use-acp-credential-form-DHd_Id-q.js} +1 -1
  71. package/build/assets/{use-activate-agent-profile-DlykqEfN.js → use-activate-agent-profile-BRDdSwQ0.js} +1 -1
  72. package/build/assets/{use-active-agent-profile-hI-x-UBa.js → use-active-agent-profile-BMDTXsay.js} +1 -1
  73. package/build/assets/{use-active-conversation-2qeez40F.js → use-active-conversation-BbeVgedA.js} +1 -1
  74. package/build/assets/{use-agent-profiles-0pr5bLS7.js → use-agent-profiles-Dn_S_Tkz.js} +1 -1
  75. package/build/assets/{use-agent-state-C6peDXUm.js → use-agent-state-5qM3X30V.js} +1 -1
  76. package/build/assets/{use-backends-health-CLHPitJM.js → use-backends-health-BagmAE_W.js} +1 -1
  77. package/build/assets/{use-can-manage-org-profiles-Ck_bsNbH.js → use-can-manage-org-profiles-CyYqfzeo.js} +1 -1
  78. package/build/assets/{use-cloud-current-user-id-DUCSxNjY.js → use-cloud-current-user-id-BwMX7jHW.js} +1 -1
  79. package/build/assets/{use-config-B5r8erYt.js → use-config-B39iHYFi.js} +1 -1
  80. package/build/assets/{use-create-conversation-r1JHfKO5.js → use-create-conversation-CkKUQVbP.js} +1 -1
  81. package/build/assets/{use-create-secret-Cf2N11d2.js → use-create-secret-DEgM0MXZ.js} +1 -1
  82. package/build/assets/{use-handle-plan-click-CsAW3FlH.js → use-handle-plan-click-BFcE0Xms.js} +1 -1
  83. package/build/assets/{use-llm-profiles-Dr5__SlZ.js → use-llm-profiles-CgRtnj74.js} +1 -1
  84. package/build/assets/{use-plugins-marketplace-BplU65ae.js → use-plugins-marketplace-DOJp9rlE.js} +1 -1
  85. package/build/assets/use-runtime-is-ready-ziHQvXZQ.js +1 -0
  86. package/build/assets/{use-save-agent-profile-RqUGqTv6.js → use-save-agent-profile-i4FcEP98.js} +1 -1
  87. package/build/assets/{use-save-settings-Chvzeu2s.js → use-save-settings-DiDEbIJw.js} +1 -1
  88. package/build/assets/{use-settings-CyxSlyTQ.js → use-settings-BeJap6YL.js} +1 -1
  89. package/build/assets/{use-settings-nav-items-zEkSO_Bf.js → use-settings-nav-items-D5JJjFHJ.js} +1 -1
  90. package/build/assets/{use-skills-xrVoKYrF.js → use-skills-Blpg2BqE.js} +1 -1
  91. package/build/assets/{use-tracking-D2Qg5Lpd.js → use-tracking-DFoPQUSU.js} +1 -1
  92. package/build/assets/{use-user-conversation-CnE4zhOA.js → use-user-conversation-BrN2xeQU.js} +1 -1
  93. package/build/assets/{verification-settings-CfkrXoSa.js → verification-settings-C8KzAdAX.js} +1 -1
  94. package/build/index.html +4 -4
  95. package/config/defaults.json +1 -1
  96. package/dist/config/defaults.cjs +1 -1
  97. package/dist/config/defaults.cjs.map +1 -1
  98. package/dist/config/defaults.js +1 -1
  99. package/dist/config/defaults.js.map +1 -1
  100. package/dist/hooks/query/use-task-polling.cjs +1 -1
  101. package/dist/hooks/query/use-task-polling.cjs.map +1 -1
  102. package/dist/hooks/query/use-task-polling.d.ts +19 -3
  103. package/dist/hooks/query/use-task-polling.js +36 -35
  104. package/dist/hooks/query/use-task-polling.js.map +1 -1
  105. package/dist/package.cjs +1 -1
  106. package/dist/package.cjs.map +1 -1
  107. package/dist/package.js +1 -1
  108. package/dist/package.js.map +1 -1
  109. package/dist/routes/conversation.cjs +1 -1
  110. package/dist/routes/conversation.cjs.map +1 -1
  111. package/dist/routes/conversation.js +1 -1
  112. package/dist/routes/conversation.js.map +1 -1
  113. package/package.json +1 -1
  114. package/build/assets/agent-settings-DDkSavD7.js +0 -1
  115. package/build/assets/conversation-DgHqMjnY.js +0 -1
  116. package/build/assets/conversation-panel-78Rxh_-I.js +0 -1
  117. package/build/assets/home-DKPGQ5P3.js +0 -1
  118. package/build/assets/index-home-Bko2Itv5.js +0 -1
  119. package/build/assets/llm-settings-BBsZFi9l.js +0 -1
  120. package/build/assets/use-runtime-is-ready-vCFOcLFa.js +0 -1
package/README.md CHANGED
@@ -96,7 +96,7 @@ docker run -it --rm \
96
96
  -p 8000:8000 \
97
97
  -v "$HOME/.openhands:/home/openhands/.openhands" \
98
98
  -v "${PROJECTS_PATH}:/projects" \
99
- ghcr.io/openhands/agent-canvas:1.5.1 # x-release-please-version
99
+ ghcr.io/openhands/agent-canvas:1.5.2 # x-release-please-version
100
100
  ```
101
101
 
102
102
  **Windows (PowerShell / Windows Terminal):** See [README.windows.md](./README.windows.md) for the equivalent commands.
package/README.windows.md CHANGED
@@ -12,7 +12,7 @@ For the main install options and overall context, see [README.md](./README.md).
12
12
  - A host directory for `PROJECTS_PATH` containing the project folders you want the agent to access (create it before starting the container)
13
13
 
14
14
  ```powershell
15
- docker pull ghcr.io/openhands/agent-canvas:1.5.1 # x-release-please-version
15
+ docker pull ghcr.io/openhands/agent-canvas:1.5.2 # x-release-please-version
16
16
 
17
17
  $env:PROJECTS_PATH = Join-Path $HOME "projects" # directory containing your project folders
18
18
  New-Item -ItemType Directory -Force -Path $env:PROJECTS_PATH, (Join-Path $env:USERPROFILE ".openhands") | Out-Null
@@ -21,7 +21,7 @@ docker run -it --rm `
21
21
  -p 8000:8000 `
22
22
  -v "$($env:USERPROFILE)\.openhands:/home/openhands/.openhands" `
23
23
  -v "$($env:PROJECTS_PATH):/projects" `
24
- ghcr.io/openhands/agent-canvas:1.5.1 # x-release-please-version
24
+ ghcr.io/openhands/agent-canvas:1.5.2 # x-release-please-version
25
25
  ```
26
26
 
27
27
  Open [http://localhost:8000/canvas](http://localhost:8000/canvas) in your browser.
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{a as r,d as i,f as a,i as o,l as s,n as c,o as ee,p as te,r as ne}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{i as re,t as l}from"./declaration-BGsHjPEW.js";import{I as ie,t as ae}from"./utils-DB9LsAzA.js";import{C as u,D as oe,T as se,_ as ce,b as d,g as le,n as ue,v as f,w as p,x as m}from"./agent-server-compatibility-BWN-EIQn.js";var h=e(t(),1),de=`__AGENT_CANVAS_BASE_PATH__`;function g(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function fe(){let e=g(void 0);if(e)return e;if(typeof window<`u`){let e=window[de];if(typeof e==`string`)return g(e)}return``}function _(e){let t=fe();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var v=`openhands`,y=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],b=new WeakMap,pe=e=>{if(!b.has(e)){let t=e.use(r).use(o).use(re).init({fallbackLng:`en`,debug:!1,supportedLngs:y.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[v],defaultNS:v,fallbackNS:v,backend:{loadPath:_(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});b.set(e,t)}return e},me=()=>pe(s()),x=null,S=null,C=()=>(x||=me(),x),w=()=>S??C(),he=e=>(S=e??C(),S),ge=async(e=C())=>(await b.get(e),e),T=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:v,...e}:e:{ns:v},E=new Proxy({},{get:(e,t)=>{let n=w();if(t===`t`)return(e,t)=>n.t(e,T(t));if(t===`exists`)return(e,t)=>n.exists(e,T(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=w();return Reflect.set(r,t,n,r)}}),_e=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,ve=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,ye=`Disconnected (check URL or network). Check that the backend URL is correct and the backend server is reachable. If the backend is on another origin, check that it allows this frontend origin.`,be=`Disconnected (request timed out). Check that the backend URL is correct and reachable.`,xe=4;function Se(e){return typeof e==`object`&&!!e}function D(e){let t=[],n=new Set,r=e,i=0;for(;r!=null&&i<xe&&!n.has(r);){if(n.add(r),r instanceof Error)r.message&&t.push(r.message),r=r.cause;else if(typeof r==`string`){r&&t.push(r);break}else if(Se(r)){let e=r.message;typeof e==`string`&&e&&t.push(e),r=r.cause}else break;i+=1}return t}function O(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`disconnected (check cors or network)`)||t.includes(`disconnected (check url or network)`)||t.includes(`blocked by cors`)||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`load failed`)||t.includes(`networkerror when attempting to fetch resource`)||t.includes(`cors`)&&t.includes(`blocked`)}function Ce(e){return D(e).some(O)}function k(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`request timeout`)||t.includes(`timeout after`)||t.includes(`backend request timed out`)}function A(e){let t=D(e);return t.some(O)?ye:t.some(k)?be:t[0]??null}function we(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var j=e=>{let t=null,n=!1;return we(e)?(n=!0,t=_e(e)&&e.response?.data.error?e.response?.data.error:ve(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,A(n?t??e:e)??t??``},M=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},N=n(),P={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},F={position:`top-right`,style:P},Te={...P,color:`var(--oh-muted)`};function Ee({message:e}){let t=h.useRef(null),[n,r]=h.useState(!1);return h.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,N.jsxs)(`div`,{className:ae(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,N.jsx)(ne,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:ie}}),(0,N.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var De={...F,icon:null,style:Te},I=e=>{let t=e||E.t(l.STATUS$ERROR);O(t)?t=E.t(l.ERROR$CORS_OR_NETWORK):k(t)&&(t=E.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=M(t,4e3);c((0,N.jsx)(Ee,{message:t}),{...De,duration:n})},Oe=e=>{let t=M(e,5e3);c.success((0,N.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...F,duration:t})},ke=(e,t,n)=>{let r=M(`${e} ${t}`,5e3);c.success((0,N.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,N.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{...F,duration:r})},Ae=e=>{let t=M(e,6e3);c((0,N.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...F,icon:`⚠️`,duration:t})},L=`openhands-backend-health`,R=500;function je(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function Me(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(L);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&je(r)&&(n[e]=r);return n}catch{return{}}}function Ne(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(L);return}window.localStorage.setItem(L,JSON.stringify(e))}catch{}}function Pe(e){let t=A(e)??`Unknown error`;return t.length>R?`${t.slice(0,R)}…`:t}var z=Me(),B=new Set;function V(){B.forEach(e=>e())}function H(e){z=e,Ne(e),V()}function Fe(){return z}function Ie(e){return B.add(e),()=>{B.delete(e)}}function Le(e,t){let n=z[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:Pe(t),lastFailureAt:Date.now(),disabled:i};H({...z,[e]:a})}function U(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function Re(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function ze(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}var W=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},G=e=>{if(!(e instanceof ee)||e.response?.status!==401&&e.status!==401)return!1;let t=ce().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},K=new Set,Be=()=>{let e=new i({queryCache:new a({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&U(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||W(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!G(t)){let e=j(t);K.has(e||``)||(I(e||E.t(l.ERROR$GENERIC)),K.add(e||``),setTimeout(()=>{K.delete(e||``)},3e3))}}}),mutationCache:new te({onError:(t,n,r,i)=>{W(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!G(t)&&I(j(t)||E.t(l.ERROR$GENERIC))}})});return e},q=null,J=null,Y=()=>(q||=Be(),q),X=()=>J??Y(),Ve=e=>(J=e??Y(),J),Z=new Proxy({},{get:(e,t)=>{let n=X(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=X();return Reflect.set(r,t,n,r)}}),Q={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},He={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},Ue={all:[`llm-profiles`]},We={all:[`agent-profiles`]},Ge={retry:!1},Ke={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},qe={all:[`local-workspaces`]},Je={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},Ye={staleTime:1e3*60*5,gcTime:1e3*60*15},$=h.createContext(null);function Xe(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Ze({children:e}){let t=h.useSyncExternalStore(se,m,m),n=h.useCallback(()=>{ue(),Z.invalidateQueries({queryKey:Q.WEB_CLIENT_CONFIG})},[]),r=h.useCallback((e,t)=>{let r=f()?.backendId??null,i=f()?.orgId??null,a=t??null;e===r&&a===i||(u({backendId:e,orgId:a}),n())},[n]),i=h.useCallback(e=>{let t={...e,id:Xe()};return p([...d(),t]),u({backendId:t.id}),n(),t},[n]),a=h.useCallback((e,t)=>{let r=d().find(t=>t.id===e),i=f()?.backendId??null;p(d().map(n=>n.id===e?{...n,...t}:n));let a=t.host!==void 0&&r!==void 0&&t.host!==r.host,o=t.apiKey!==void 0&&r!==void 0&&t.apiKey!==r.apiKey;(a||o)&&(Re(e),i===e&&n())},[n]),o=h.useCallback(e=>{p(d().filter(t=>t.id!==e)),ze(e),n()},[n]),s=h.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,N.jsx)($.Provider,{value:s,children:e})}function Qe(){let e=h.useContext($);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function $e(){let e=h.useContext($);return e?e.active:{backend:oe()??le,orgId:null}}export{O as A,Oe as C,A as D,j as E,E as F,he as I,ge as L,v as M,C as N,k as O,w as P,_ as R,I as S,Ae as T,Fe as _,Ge as a,Ie as b,Ke as c,Q as d,He as f,Ve as g,Z as h,We as i,y as j,Ce as k,qe as l,X as m,$e as n,Ye as o,Y as p,Qe as r,Ue as s,Ze as t,Je as u,Le as v,ke as w,F as x,U as y};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{a as r,d as i,f as a,i as o,l as s,n as c,o as ee,p as te,r as ne}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{i as re,t as l}from"./declaration-BGsHjPEW.js";import{I as ie,t as ae}from"./utils-DB9LsAzA.js";import{C as u,D as oe,T as se,_ as ce,b as d,g as le,n as ue,v as f,w as p,x as m}from"./agent-server-compatibility-C0MtTTwb.js";var h=e(t(),1),de=`__AGENT_CANVAS_BASE_PATH__`;function g(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function fe(){let e=g(void 0);if(e)return e;if(typeof window<`u`){let e=window[de];if(typeof e==`string`)return g(e)}return``}function _(e){let t=fe();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var v=`openhands`,y=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],b=new WeakMap,pe=e=>{if(!b.has(e)){let t=e.use(r).use(o).use(re).init({fallbackLng:`en`,debug:!1,supportedLngs:y.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[v],defaultNS:v,fallbackNS:v,backend:{loadPath:_(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});b.set(e,t)}return e},me=()=>pe(s()),x=null,S=null,C=()=>(x||=me(),x),w=()=>S??C(),he=e=>(S=e??C(),S),ge=async(e=C())=>(await b.get(e),e),T=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:v,...e}:e:{ns:v},E=new Proxy({},{get:(e,t)=>{let n=w();if(t===`t`)return(e,t)=>n.t(e,T(t));if(t===`exists`)return(e,t)=>n.exists(e,T(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=w();return Reflect.set(r,t,n,r)}}),_e=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,ve=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,ye=`Disconnected (check URL or network). Check that the backend URL is correct and the backend server is reachable. If the backend is on another origin, check that it allows this frontend origin.`,be=`Disconnected (request timed out). Check that the backend URL is correct and reachable.`,xe=4;function Se(e){return typeof e==`object`&&!!e}function D(e){let t=[],n=new Set,r=e,i=0;for(;r!=null&&i<xe&&!n.has(r);){if(n.add(r),r instanceof Error)r.message&&t.push(r.message),r=r.cause;else if(typeof r==`string`){r&&t.push(r);break}else if(Se(r)){let e=r.message;typeof e==`string`&&e&&t.push(e),r=r.cause}else break;i+=1}return t}function O(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`disconnected (check cors or network)`)||t.includes(`disconnected (check url or network)`)||t.includes(`blocked by cors`)||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`load failed`)||t.includes(`networkerror when attempting to fetch resource`)||t.includes(`cors`)&&t.includes(`blocked`)}function Ce(e){return D(e).some(O)}function k(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`request timeout`)||t.includes(`timeout after`)||t.includes(`backend request timed out`)}function A(e){let t=D(e);return t.some(O)?ye:t.some(k)?be:t[0]??null}function we(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var j=e=>{let t=null,n=!1;return we(e)?(n=!0,t=_e(e)&&e.response?.data.error?e.response?.data.error:ve(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,A(n?t??e:e)??t??``},M=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},N=n(),P={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},F={position:`top-right`,style:P},Te={...P,color:`var(--oh-muted)`};function Ee({message:e}){let t=h.useRef(null),[n,r]=h.useState(!1);return h.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,N.jsxs)(`div`,{className:ae(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,N.jsx)(ne,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:ie}}),(0,N.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var De={...F,icon:null,style:Te},I=e=>{let t=e||E.t(l.STATUS$ERROR);O(t)?t=E.t(l.ERROR$CORS_OR_NETWORK):k(t)&&(t=E.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=M(t,4e3);c((0,N.jsx)(Ee,{message:t}),{...De,duration:n})},Oe=e=>{let t=M(e,5e3);c.success((0,N.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...F,duration:t})},ke=(e,t,n)=>{let r=M(`${e} ${t}`,5e3);c.success((0,N.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,N.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{...F,duration:r})},Ae=e=>{let t=M(e,6e3);c((0,N.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...F,icon:`⚠️`,duration:t})},L=`openhands-backend-health`,R=500;function je(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function Me(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(L);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&je(r)&&(n[e]=r);return n}catch{return{}}}function Ne(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(L);return}window.localStorage.setItem(L,JSON.stringify(e))}catch{}}function Pe(e){let t=A(e)??`Unknown error`;return t.length>R?`${t.slice(0,R)}…`:t}var z=Me(),B=new Set;function V(){B.forEach(e=>e())}function H(e){z=e,Ne(e),V()}function Fe(){return z}function Ie(e){return B.add(e),()=>{B.delete(e)}}function Le(e,t){let n=z[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:Pe(t),lastFailureAt:Date.now(),disabled:i};H({...z,[e]:a})}function U(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function Re(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}function ze(e){if(!(e in z))return;let{[e]:t,...n}=z;H(n)}var W=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},G=e=>{if(!(e instanceof ee)||e.response?.status!==401&&e.status!==401)return!1;let t=ce().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},K=new Set,Be=()=>{let e=new i({queryCache:new a({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&U(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||W(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!G(t)){let e=j(t);K.has(e||``)||(I(e||E.t(l.ERROR$GENERIC)),K.add(e||``),setTimeout(()=>{K.delete(e||``)},3e3))}}}),mutationCache:new te({onError:(t,n,r,i)=>{W(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!G(t)&&I(j(t)||E.t(l.ERROR$GENERIC))}})});return e},q=null,J=null,Y=()=>(q||=Be(),q),X=()=>J??Y(),Ve=e=>(J=e??Y(),J),Z=new Proxy({},{get:(e,t)=>{let n=X(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=X();return Reflect.set(r,t,n,r)}}),Q={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},He={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},Ue={all:[`llm-profiles`]},We={all:[`agent-profiles`]},Ge={retry:!1},Ke={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},qe={all:[`local-workspaces`]},Je={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},Ye={staleTime:1e3*60*5,gcTime:1e3*60*15},$=h.createContext(null);function Xe(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Ze({children:e}){let t=h.useSyncExternalStore(se,m,m),n=h.useCallback(()=>{ue(),Z.invalidateQueries({queryKey:Q.WEB_CLIENT_CONFIG})},[]),r=h.useCallback((e,t)=>{let r=f()?.backendId??null,i=f()?.orgId??null,a=t??null;e===r&&a===i||(u({backendId:e,orgId:a}),n())},[n]),i=h.useCallback(e=>{let t={...e,id:Xe()};return p([...d(),t]),u({backendId:t.id}),n(),t},[n]),a=h.useCallback((e,t)=>{let r=d().find(t=>t.id===e),i=f()?.backendId??null;p(d().map(n=>n.id===e?{...n,...t}:n));let a=t.host!==void 0&&r!==void 0&&t.host!==r.host,o=t.apiKey!==void 0&&r!==void 0&&t.apiKey!==r.apiKey;(a||o)&&(Re(e),i===e&&n())},[n]),o=h.useCallback(e=>{p(d().filter(t=>t.id!==e)),ze(e),n()},[n]),s=h.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,N.jsx)($.Provider,{value:s,children:e})}function Qe(){let e=h.useContext($);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function $e(){let e=h.useContext($);return e?e.active:{backend:oe()??le,orgId:null}}export{O as A,Oe as C,A as D,j as E,E as F,he as I,ge as L,v as M,C as N,k as O,w as P,_ as R,I as S,Ae as T,Fe as _,Ge as a,Ie as b,Ke as c,Q as d,He as f,Ve as g,Z as h,We as i,y as j,Ce as k,qe as l,X as m,$e as n,Ye as o,Y as p,Qe as r,Ue as s,Ze as t,Je as u,Le as v,ke as w,F as x,U as y};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-BFRubm34.js";import{bt as t}from"./vendor-styling-CI0PQ3ab.js";import{r as n}from"./backend-form-modal-RGcu909r.js";var r=e({AddBackendModal:()=>a}),i=t();function a({onClose:e}){return(0,i.jsx)(n,{mode:`add`,onClose:e})}export{r as n,a as t};
1
+ import{r as e}from"./rolldown-runtime-BFRubm34.js";import{bt as t}from"./vendor-styling-CI0PQ3ab.js";import{r as n}from"./backend-form-modal-B8GtBA-J.js";var r=e({AddBackendModal:()=>a}),i=t();function a({onClose:e}){return(0,i.jsx)(n,{mode:`add`,onClose:e})}export{r as n,a as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n,xt as r}from"./vendor-styling-CI0PQ3ab.js";import{L as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{n as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{t as o}from"./useMutation-u8UgRgDK.js";import{t as s}from"./useTranslation-Cbf5AGg_.js";import{t as c}from"./declaration-BGsHjPEW.js";import{C as l,E as u,S as d,i as f}from"./active-backend-context-B8rMv0X9.js";import{t as p}from"./back-nav-button-DVknCcSP.js";import{t as m}from"./utils-DB9LsAzA.js";import{t as h}from"./brand-button-B1izLAdR.js";import{t as g}from"./loading-spinner-BcdnT0mN.js";import{i as _}from"./dropdown-classes-D3wMJlXT.js";import{t as v}from"./use-llm-profiles-Dr5__SlZ.js";import{n as y,t as b}from"./use-agent-profiles-0pr5bLS7.js";import{r as x,t as S}from"./ellipsis-button-CbNnHlIq.js";import{t as C}from"./u-edit-DL5LgKon.js";import{t as w}from"./settings-dropdown-input-Dhx9ErGd.js";import{r as T}from"./typography-CzfoD9DY.js";import{o as E}from"./extension-module-card-classes-9V3J9J_b.js";import{a as D,i as O,n as k,r as A,s as j,t as M}from"./use-can-manage-org-profiles-Ck_bsNbH.js";import{t as N}from"./u-check-circle-BqoIxNz_.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-DSJJX99U.js";import{n as R}from"./settings-section-header-context-COMOIaxV.js";import{t as z}from"./use-save-agent-profile-RqUGqTv6.js";import{n as B}from"./use-activate-agent-profile-DlykqEfN.js";import{i as V,t as H}from"./agent-settings-CgCnqaAA.js";var U=e(t(),1),W=e(r(),1),G=n();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:l}=s(`openhands`),u=(0,U.useRef)(null),d=(0,U.useRef)([]),f=o?.current??null,[p,h]=(0,U.useState)();(0,U.useLayoutEffect)(()=>{if(!f)return;let e=()=>{let e=f.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[f]),(0,U.useEffect)(()=>{d.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;u.current&&!u.current.contains(t)&&a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let g=e=>{e(),a()},v=(0,U.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=d.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;d.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;d.current[r]?.focus()}},[a]),y=r||i,b=!!f,S=(0,G.jsxs)(`div`,{ref:u,className:m(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,G.jsx)(A,{index:0,icon:(0,G.jsx)(C,{width:16,height:16}),label:l(c.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:d,testId:`agent-profile-edit`}),(0,G.jsx)(A,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:l(c.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:d,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(A,{index:2,icon:(0,G.jsx)(x,{width:16,height:16}),label:l(c.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:d,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!p?null:W.createPortal((0,G.jsx)(`div`,{style:p,children:S}),document.body):S}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:l}=s(`openhands`),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(null),p=e.agent_kind===`openhands`?e.llm_profile_ref:l(c.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:m(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),p?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:p,children:p}):null,t&&(0,G.jsx)(k,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:l(c.SETTINGS$PROFILE_ACTIVE)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(S,{ref:f,onClick:()=>d(e=>!e),ariaLabel:l(c.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),u&&(0,G.jsx)(K,{anchorRef:f,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>d(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:l,isActivating:u}){let{t:d}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(g,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:E,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:d(c.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:E,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:d(c.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:m(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:l,isActivating:u},e.name))})}function Y(){let e=a();return o({mutationFn:e=>y.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:f.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(c.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(c.ERROR$GENERIC))}},o=()=>{r.isPending||t()},u=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(c.BUTTON$CANCEL)}),(0,G.jsx)(h,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(c.BUTTON$DELETE)})]}):n(c.BUTTON$DELETE)})]});return(0,G.jsx)(O,{isOpen:!0,title:n(c.SETTINGS$PROFILE_DELETE_TITLE),footer:u,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(c.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function Z({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=b(),o=B(),u=M(),[d,f]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(c.SETTINGS$AVAILABLE_PROFILES)}),e&&u?(0,G.jsx)(h,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(c.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:u,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(c.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:f,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:d,onClose:()=>f(null)})]})}function Q(e,t){if(!e||e.agent_kind!==t.agent_kind)return t;let{id:n,name:r,revision:i,...a}=e;return{...a,...t}}function $(){let e=a();return o({mutationFn:({name:e,newName:t})=>y.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:f.all})},meta:{disableToast:!0}})}function ee(e){return e.agent_kind===`acp`?{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``}:{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,tool_concurrency_limit:e.tool_concurrency_limit}}function te(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=R(),n=z(),r=$(),{data:i}=b(),{data:a,isLoading:o}=v(),[f,m]=(0,U.useState)(`list`),[g,_]=(0,U.useState)(``),[x,S]=(0,U.useState)(null),[C,E]=(0,U.useState)(null),[O,k]=(0,U.useState)(``),[A,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(f!==`list`),()=>t(!1)),[f,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),B=(0,U.useMemo)(()=>!(!j(g,{isRequired:!0})||f===`create`&&L.has(g)||f===`edit`&&g!==x?.name&&L.has(g)),[g,f,L,x?.name]),V=(0,U.useCallback)(()=>{_(``),S(null),E({agent_kind:`openhands`}),k(I),M(null),m(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await y.getProfile(t.name,`encrypted`)).profile;S(e),E(ee(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),m(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(c.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{m(`list`),S(null),_(``),E(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!A||!B)return;let t;try{let n=A.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!O){d(e(c.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:O}}else t=n}catch(t){d(t instanceof Error?t.message:e(c.ERROR$GENERIC));return}let i=g.trim(),a=x?.name,o=f===`edit`&&a&&a!==i;P(!0);try{if(A.credentials.isDirty){if(!await A.credentials.save({silent:!0}))return;A.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=Q(f===`edit`?x:null,t);await n.mutateAsync({name:i,profile:s}),l(e(f===`create`?c.SETTINGS$PROFILE_CREATED:c.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(c.ERROR$GENERIC))}finally{P(!1)}},[A,B,O,g,f,x,n,r,e,K]);if(f===`list`)return(0,G.jsx)(Z,{onAddProfile:V,onEditProfile:W});let J=e(f===`edit`?c.SETTINGS$EDIT_AGENT_PROFILE:c.SETTINGS$ADD_AGENT_PROFILE),Y=f===`edit`&&x?e(c.SETTINGS$PROFILE_LOADED,{name:x.name}):e(c.SETTINGS$PROFILE_SAVE_HINT),X=A?.agentType!==`acp`;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(p,{testId:`back-to-agent-profiles`,onClick:K,children:e(c.BUTTON$BACK)}),(0,G.jsx)(T.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(D,{testId:`agent-profile-name-input`,value:g,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:C,onSaveControlChange:M},f===`edit`?`edit-${x?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(w,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(c.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:O,onSelectionChange:e=>e&&k(String(e))}):(0,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(c.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(h,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(c.BUTTON$CANCEL)}),(0,G.jsx)(h,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!B||N||!A?.isValid,"aria-busy":N,children:e(N?c.SETTINGS$SAVING:c.BUTTON$SAVE)})]})]})}var ne={hideTitle:!1},re=i(function(){return(0,G.jsx)(te,{})});export{re as default,ne as handle};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n,xt as r}from"./vendor-styling-CI0PQ3ab.js";import{L as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{n as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{t as o}from"./useMutation-u8UgRgDK.js";import{t as s}from"./useTranslation-Cbf5AGg_.js";import{t as c}from"./declaration-BGsHjPEW.js";import{C as l,E as u,S as d,i as f}from"./active-backend-context-DHhm10VS.js";import{t as p}from"./back-nav-button-DVknCcSP.js";import{t as m}from"./utils-DB9LsAzA.js";import{t as h}from"./brand-button-B1izLAdR.js";import{t as g}from"./loading-spinner-BcdnT0mN.js";import{i as _}from"./dropdown-classes-D3wMJlXT.js";import{t as v}from"./use-llm-profiles-CgRtnj74.js";import{n as y,t as b}from"./use-agent-profiles-Dn_S_Tkz.js";import{r as x,t as S}from"./ellipsis-button-CbNnHlIq.js";import{t as C}from"./u-edit-DL5LgKon.js";import{t as w}from"./settings-dropdown-input-Dhx9ErGd.js";import{r as T}from"./typography-CzfoD9DY.js";import{o as E}from"./extension-module-card-classes-9V3J9J_b.js";import{a as D,i as O,n as k,r as A,s as j,t as M}from"./use-can-manage-org-profiles-CyYqfzeo.js";import{t as N}from"./u-check-circle-BqoIxNz_.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-DSJJX99U.js";import{n as R}from"./settings-section-header-context-COMOIaxV.js";import{t as z}from"./use-save-agent-profile-i4FcEP98.js";import{n as B}from"./use-activate-agent-profile-BRDdSwQ0.js";import{i as V,t as H}from"./agent-settings-GwiXe_6k.js";var U=e(t(),1),W=e(r(),1),G=n();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:l}=s(`openhands`),u=(0,U.useRef)(null),d=(0,U.useRef)([]),f=o?.current??null,[p,h]=(0,U.useState)();(0,U.useLayoutEffect)(()=>{if(!f)return;let e=()=>{let e=f.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[f]),(0,U.useEffect)(()=>{d.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;u.current&&!u.current.contains(t)&&a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let g=e=>{e(),a()},v=(0,U.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=d.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;d.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;d.current[r]?.focus()}},[a]),y=r||i,b=!!f,S=(0,G.jsxs)(`div`,{ref:u,className:m(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,G.jsx)(A,{index:0,icon:(0,G.jsx)(C,{width:16,height:16}),label:l(c.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:d,testId:`agent-profile-edit`}),(0,G.jsx)(A,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:l(c.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:d,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(A,{index:2,icon:(0,G.jsx)(x,{width:16,height:16}),label:l(c.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:d,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!p?null:W.createPortal((0,G.jsx)(`div`,{style:p,children:S}),document.body):S}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:l}=s(`openhands`),[u,d]=(0,U.useState)(!1),f=(0,U.useRef)(null),p=e.agent_kind===`openhands`?e.llm_profile_ref:l(c.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:m(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),p?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:p,children:p}):null,t&&(0,G.jsx)(k,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:l(c.SETTINGS$PROFILE_ACTIVE)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(S,{ref:f,onClick:()=>d(e=>!e),ariaLabel:l(c.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),u&&(0,G.jsx)(K,{anchorRef:f,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>d(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:l,isActivating:u}){let{t:d}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(g,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:E,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:d(c.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:E,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:d(c.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:m(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:l,isActivating:u},e.name))})}function Y(){let e=a();return o({mutationFn:e=>y.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:f.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(c.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(c.ERROR$GENERIC))}},o=()=>{r.isPending||t()},u=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(c.BUTTON$CANCEL)}),(0,G.jsx)(h,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(c.BUTTON$DELETE)})]}):n(c.BUTTON$DELETE)})]});return(0,G.jsx)(O,{isOpen:!0,title:n(c.SETTINGS$PROFILE_DELETE_TITLE),footer:u,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(c.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function Z({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=b(),o=B(),u=M(),[d,f]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(c.SETTINGS$AVAILABLE_PROFILES)}),e&&u?(0,G.jsx)(h,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(c.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:u,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(c.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:f,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:d,onClose:()=>f(null)})]})}function Q(e,t){if(!e||e.agent_kind!==t.agent_kind)return t;let{id:n,name:r,revision:i,...a}=e;return{...a,...t}}function $(){let e=a();return o({mutationFn:({name:e,newName:t})=>y.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:f.all})},meta:{disableToast:!0}})}function ee(e){return e.agent_kind===`acp`?{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``}:{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,tool_concurrency_limit:e.tool_concurrency_limit}}function te(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=R(),n=z(),r=$(),{data:i}=b(),{data:a,isLoading:o}=v(),[f,m]=(0,U.useState)(`list`),[g,_]=(0,U.useState)(``),[x,S]=(0,U.useState)(null),[C,E]=(0,U.useState)(null),[O,k]=(0,U.useState)(``),[A,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(f!==`list`),()=>t(!1)),[f,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),B=(0,U.useMemo)(()=>!(!j(g,{isRequired:!0})||f===`create`&&L.has(g)||f===`edit`&&g!==x?.name&&L.has(g)),[g,f,L,x?.name]),V=(0,U.useCallback)(()=>{_(``),S(null),E({agent_kind:`openhands`}),k(I),M(null),m(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await y.getProfile(t.name,`encrypted`)).profile;S(e),E(ee(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),m(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(c.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{m(`list`),S(null),_(``),E(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!A||!B)return;let t;try{let n=A.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!O){d(e(c.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:O}}else t=n}catch(t){d(t instanceof Error?t.message:e(c.ERROR$GENERIC));return}let i=g.trim(),a=x?.name,o=f===`edit`&&a&&a!==i;P(!0);try{if(A.credentials.isDirty){if(!await A.credentials.save({silent:!0}))return;A.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=Q(f===`edit`?x:null,t);await n.mutateAsync({name:i,profile:s}),l(e(f===`create`?c.SETTINGS$PROFILE_CREATED:c.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(c.ERROR$GENERIC))}finally{P(!1)}},[A,B,O,g,f,x,n,r,e,K]);if(f===`list`)return(0,G.jsx)(Z,{onAddProfile:V,onEditProfile:W});let J=e(f===`edit`?c.SETTINGS$EDIT_AGENT_PROFILE:c.SETTINGS$ADD_AGENT_PROFILE),Y=f===`edit`&&x?e(c.SETTINGS$PROFILE_LOADED,{name:x.name}):e(c.SETTINGS$PROFILE_SAVE_HINT),X=A?.agentType!==`acp`;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(p,{testId:`back-to-agent-profiles`,onClick:K,children:e(c.BUTTON$BACK)}),(0,G.jsx)(T.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(D,{testId:`agent-profile-name-input`,value:g,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:C,onSaveControlChange:M},f===`edit`?`edit-${x?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(w,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(c.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:O,onSelectionChange:e=>e&&k(String(e))}):(0,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(c.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(h,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(c.BUTTON$CANCEL)}),(0,G.jsx)(h,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!B||N||!A?.isValid,"aria-busy":N,children:e(N?c.SETTINGS$SAVING:c.BUTTON$SAVE)})]})]})}var ne={hideTitle:!1},re=i(function(){return(0,G.jsx)(te,{})});export{re as default,ne as handle};
@@ -1 +1 @@
1
- import{d as e,y as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";var n=`workspace/project`,r=`__AGENT_CANVAS_LOCK_TO_CLOUD__`,i=`all-hands.dev`,a=`openhands.dev`,o=`app.${i}`,s=a,ee=`app.${a}`;function c(e){return e?.trim()||null}function te(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function l(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function ne(e){let t=e.toLowerCase();return t===o||t===ee?s:t===i?a:t.endsWith(`.${i}`)?`${t.slice(0,-13)}${a}`:t}function u(e){let t=l(e);if(!t)return null;try{let e=new URL(t),n=e.port?`:${e.port}`:``;return`${e.protocol}//${ne(e.hostname)}${n}`}catch{return t.toLowerCase()}}function d(){let e=f();return!e||typeof window>`u`||!p(window.location.origin,e)?null:window.location.origin}function re(){return te(void 0)}function ie(){let e=c(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return c(e)}return null}function ae(){return{baseUrl:m()??``,sessionApiKey:h()??``}}function f(){let e=l(void 0);if(e)return e;if(typeof window<`u`){let e=window[r];if(typeof e==`string`)return l(e)}return null}function p(e,t){let n=u(e),r=u(t);return!n||!r?!1:n===r}function oe(){return d()?`cookie`:`api-key`}function m(){return re()||(typeof window<`u`?window.location.origin:null)}function h(){return ie()}function g(){return(void 0)?.trim()||n}function se(e){return`${g().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function ce(){let e=h();return e?{"X-Session-API-Key":e}:{}}function _(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function le(){return _()?!h():!1}var ue=`default-local`,v=`Local`,de=`locked-cloud`,fe=`OpenHands Cloud`;function pe(){if(!f())return null;let e=d();return e?{id:de,name:fe,host:e,apiKey:``,kind:`cloud`,authMode:`cookie`}:null}function y(){if(f())return null;let e=m(),t=h();return!e||!t?null:{id:ue,name:v,host:e,apiKey:t,kind:`local`}}var me=`openhands-backends`,b=`openhands-active-backend`;function he(e){return e===`local`||e===`cloud`}function ge(e){return e===void 0||e===`api-key`||e===`cookie`}function _e(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&he(t.kind)&&ge(t.authMode)}function x(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function ve(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||x(e.host)&&x(t.host)}function ye(e){let t=y();if(!t)return e;let n=!1,r=e.map(e=>!ve(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(S(r),r):e}function S(e){if(!(typeof window>`u`))try{window.localStorage.setItem(me,JSON.stringify(e))}catch{}}function be(){if(typeof window>`u`)return[];try{let e=pe();if(e)return S([e]),D()?.backendId!==e.id&&O({backendId:e.id}),[e];let t=window.localStorage.getItem(me);if(t===null){let e=y();return e?(S([e]),[e]):[]}let n=JSON.parse(t);if(!Array.isArray(n))return[];let r=n.filter(_e);if(r.length===0){let e=y();return e?(S([e]),[e]):[]}return ye(r)}catch{return[]}}function C(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function w(e,t){try{return e?.getItem(t)??null}catch{return null}}function T(e,t,n){try{e?.setItem(t,n)}catch{}}function E(e,t){try{e?.removeItem(t)}catch{}}function D(){return typeof window>`u`?null:C(w(window.sessionStorage,b))||C(w(window.localStorage,b))}function O(e){if(typeof window>`u`)return;if(!e){E(window.sessionStorage,b),E(window.localStorage,b);return}let t=JSON.stringify({backendId:e.backendId,orgId:e.orgId??null});T(window.sessionStorage,b,t),T(window.localStorage,b,t)}var k=`no-backend`,A={id:k,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function j(e){return e.id===k}function xe(e){return e[0]??A}function M(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=xe(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var N=M(be(),D()),P=new Set;function F(){P.forEach(e=>e())}function I(){return N.active}function L(){let e=N.active.backend;return e.kind===`local`&&!j(e)?e:null}function Se(){return N.backends}function Ce(){return N.selection}function we(){return N}function Te(e){O(e),N=M(N.backends,e),F()}function Ee(e){S(e);let t=N.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,O(null)),N=M(e,t),F()}function De(e){return P.add(e),()=>{P.delete(e)}}function R(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function z(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function B(e){let t=R(e),n=z(e),r=window.location.protocol===`https:`,i=V(e)===`https:`;return`${r||i?`https:`:`http:`}//${t}${n}`}function V(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function Oe(e,t){let n=R(e),r=z(e),i=window.location.protocol===`https:`,a=V(e)===`https:`,o=`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/bash-events`;return t?`${o}?session_api_key=${encodeURIComponent(t)}`:o}function ke(e,t){if(!e)return null;let n=R(t),r=z(t),i=window.location.protocol===`https:`,a=V(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var H=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function U(e){return e.replace(/\/+$/,``)}function Ae(e,t){return e.host?U(e.host):e.conversationUrl?U(B(e.conversationUrl)):U(t?.host??``)}function W(e={}){let t=L();if(!t&&!e.host&&!e.conversationUrl)throw new H;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:Ae(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??g(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function je(e){let{host:t,apiKey:n,timeout:r}=W(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}var Me={_comment:`Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.`,versions:{agentServer:`1.36.1`,agentCanvas:`1.5.1`,automation:`1.1.7`},compatibility:{minimumAgentServer:`1.28.0`},constraints:{_comment:`Temporary upper bound on the agent-client-protocol (acp) transitive dependency. openhands-sdk 1.35.0 requires agent-client-protocol>=0.10.1 with no upper bound, but acp 0.11.0 reordered the ACP prompt() arguments and breaks the SDK's ACP client (a PromptRequest validation error surfaces as 'ACP error: 2 validation errors for PromptRequest'). Pin acp <0.11 until a fixed openhands-sdk ships. Consumed by scripts/dev-safe.mjs (agent-server uvx install) and .github/workflows/mock-llm-e2e.yml (mock ACP server venv).`,agentClientProtocol:`agent-client-protocol<0.11`},images:{agentServer:`ghcr.io/openhands/agent-server`,agentCanvas:`ghcr.io/openhands/agent-canvas`},ports:{agentServer:18e3,automation:18001,proxy:8e3},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`}},Ne=5e3,Pe=`unknown`,G=Me.compatibility.minimumAgentServer,Fe=`AGENT_SERVER_UNSUPPORTED_VERSION`,Ie=`AGENT_SERVER_UNKNOWN_VERSION`,K=null,Le=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,q=class extends Error{details;noBackendConfigured;constructor(e,t){let n=t?.noBackendConfigured??!1;super(n?`No agent server backend is configured yet. Add a backend to get started.`:`Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null,this.noBackendConfigured=n}},Re=e=>e instanceof q||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,ze=class extends q{code=Fe;actualVersion;requiredVersion=G;constructor(e){let t=`Agent Canvas requires agent-server ${G} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},J=class extends q{code=Ie;actualVersion;requiredVersion=G;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${G} or newer, but this backend did not return a valid version from /server_info. Restart or rebuild the agent-server backend, then try again.`;super(t),this.name=`AgentServerUnknownVersionError`,this.message=t,this.actualVersion=e}},Be=e=>_()&&Z(e,401);function Y(){K=null}function Ve(e){let t=Le(K);return Array.isArray(t)?t.includes(e):!0}function X(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function Z(e,t){return X(e)&&e.status===t}function He(e){return typeof e.version==`string`&&e.version.trim()||null}function Ue(e){let t=He(e);return!t||t.toLowerCase()===Pe?null:t}function We(e){let t=Ue(e);return!t||!Q(t)?null:t}function Ge(e,t){let n=Q(e),r=Q(t);if(!n||!r)return null;for(let e of[`major`,`minor`,`patch`]){if(n[e]>r[e])return 1;if(n[e]<r[e])return-1}return n.prerelease&&!r.prerelease?-1:!n.prerelease&&r.prerelease?1:n.prerelease&&r.prerelease?n.prerelease.localeCompare(r.prerelease):0}function Q(e){let[t]=e.trim().replace(/^v/,``).split(`+`),[n,r]=t.split(`-`,2),i=n.split(`.`);if(i.length!==3)return null;let[a,o,s]=i.map(e=>Number(e));return[a,o,s].every(e=>Number.isInteger(e)&&e>=0)?{major:a,minor:o,patch:s,prerelease:r}:null}function $(e){let t=Ue(e);if(!t)throw Y(),new J(He(e));let n=Ge(t,G);if(n===null)throw Y(),new J(t);if(n<0)throw Y(),new ze(t)}async function Ke(){let n=L();if(!n){if(Y(),j(I().backend))throw new q(`No backend configured`,{noBackendConfigured:!0});return null}let r=W({host:n.host,sessionApiKey:n.apiKey||null,timeout:Ne}),i;try{i=await new t(r).getServerInfo()}catch(e){throw Y(),Z(e,401)?e:new q(e instanceof Error?e.message:null)}if($(i),_())try{await new e(r).getSettings()}catch(e){if(Z(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return K=i,i}export{m as A,Te as C,y as D,v as E,f as F,_ as I,le as L,ce as M,g as N,n as O,oe as P,p as R,j as S,De as T,I as _,Ve as a,Se as b,Z as c,W as d,je as f,A as g,ke as h,Be as i,ae as j,se as k,Ke as l,B as m,Y as n,Re as o,Oe as p,We as r,X as s,$ as t,H as u,Ce as v,Ee as w,we as x,L as y};
1
+ import{d as e,y as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";var n=`workspace/project`,r=`__AGENT_CANVAS_LOCK_TO_CLOUD__`,i=`all-hands.dev`,a=`openhands.dev`,o=`app.${i}`,s=a,ee=`app.${a}`;function c(e){return e?.trim()||null}function te(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function l(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function ne(e){let t=e.toLowerCase();return t===o||t===ee?s:t===i?a:t.endsWith(`.${i}`)?`${t.slice(0,-13)}${a}`:t}function u(e){let t=l(e);if(!t)return null;try{let e=new URL(t),n=e.port?`:${e.port}`:``;return`${e.protocol}//${ne(e.hostname)}${n}`}catch{return t.toLowerCase()}}function d(){let e=f();return!e||typeof window>`u`||!p(window.location.origin,e)?null:window.location.origin}function re(){return te(void 0)}function ie(){let e=c(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return c(e)}return null}function ae(){return{baseUrl:m()??``,sessionApiKey:h()??``}}function f(){let e=l(void 0);if(e)return e;if(typeof window<`u`){let e=window[r];if(typeof e==`string`)return l(e)}return null}function p(e,t){let n=u(e),r=u(t);return!n||!r?!1:n===r}function oe(){return d()?`cookie`:`api-key`}function m(){return re()||(typeof window<`u`?window.location.origin:null)}function h(){return ie()}function g(){return(void 0)?.trim()||n}function se(e){return`${g().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function ce(){let e=h();return e?{"X-Session-API-Key":e}:{}}function _(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function le(){return _()?!h():!1}var ue=`default-local`,v=`Local`,de=`locked-cloud`,fe=`OpenHands Cloud`;function pe(){if(!f())return null;let e=d();return e?{id:de,name:fe,host:e,apiKey:``,kind:`cloud`,authMode:`cookie`}:null}function y(){if(f())return null;let e=m(),t=h();return!e||!t?null:{id:ue,name:v,host:e,apiKey:t,kind:`local`}}var me=`openhands-backends`,b=`openhands-active-backend`;function he(e){return e===`local`||e===`cloud`}function ge(e){return e===void 0||e===`api-key`||e===`cookie`}function _e(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&he(t.kind)&&ge(t.authMode)}function x(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function ve(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||x(e.host)&&x(t.host)}function ye(e){let t=y();if(!t)return e;let n=!1,r=e.map(e=>!ve(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(S(r),r):e}function S(e){if(!(typeof window>`u`))try{window.localStorage.setItem(me,JSON.stringify(e))}catch{}}function be(){if(typeof window>`u`)return[];try{let e=pe();if(e)return S([e]),D()?.backendId!==e.id&&O({backendId:e.id}),[e];let t=window.localStorage.getItem(me);if(t===null){let e=y();return e?(S([e]),[e]):[]}let n=JSON.parse(t);if(!Array.isArray(n))return[];let r=n.filter(_e);if(r.length===0){let e=y();return e?(S([e]),[e]):[]}return ye(r)}catch{return[]}}function C(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function w(e,t){try{return e?.getItem(t)??null}catch{return null}}function T(e,t,n){try{e?.setItem(t,n)}catch{}}function E(e,t){try{e?.removeItem(t)}catch{}}function D(){return typeof window>`u`?null:C(w(window.sessionStorage,b))||C(w(window.localStorage,b))}function O(e){if(typeof window>`u`)return;if(!e){E(window.sessionStorage,b),E(window.localStorage,b);return}let t=JSON.stringify({backendId:e.backendId,orgId:e.orgId??null});T(window.sessionStorage,b,t),T(window.localStorage,b,t)}var k=`no-backend`,A={id:k,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function j(e){return e.id===k}function xe(e){return e[0]??A}function M(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=xe(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var N=M(be(),D()),P=new Set;function F(){P.forEach(e=>e())}function I(){return N.active}function L(){let e=N.active.backend;return e.kind===`local`&&!j(e)?e:null}function Se(){return N.backends}function Ce(){return N.selection}function we(){return N}function Te(e){O(e),N=M(N.backends,e),F()}function Ee(e){S(e);let t=N.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,O(null)),N=M(e,t),F()}function De(e){return P.add(e),()=>{P.delete(e)}}function R(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function z(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function B(e){let t=R(e),n=z(e),r=window.location.protocol===`https:`,i=V(e)===`https:`;return`${r||i?`https:`:`http:`}//${t}${n}`}function V(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function Oe(e,t){let n=R(e),r=z(e),i=window.location.protocol===`https:`,a=V(e)===`https:`,o=`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/bash-events`;return t?`${o}?session_api_key=${encodeURIComponent(t)}`:o}function ke(e,t){if(!e)return null;let n=R(t),r=z(t),i=window.location.protocol===`https:`,a=V(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var H=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function U(e){return e.replace(/\/+$/,``)}function Ae(e,t){return e.host?U(e.host):e.conversationUrl?U(B(e.conversationUrl)):U(t?.host??``)}function W(e={}){let t=L();if(!t&&!e.host&&!e.conversationUrl)throw new H;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:Ae(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??g(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function je(e){let{host:t,apiKey:n,timeout:r}=W(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}var Me={_comment:`Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.`,versions:{agentServer:`1.36.1`,agentCanvas:`1.5.2`,automation:`1.1.7`},compatibility:{minimumAgentServer:`1.28.0`},constraints:{_comment:`Temporary upper bound on the agent-client-protocol (acp) transitive dependency. openhands-sdk 1.35.0 requires agent-client-protocol>=0.10.1 with no upper bound, but acp 0.11.0 reordered the ACP prompt() arguments and breaks the SDK's ACP client (a PromptRequest validation error surfaces as 'ACP error: 2 validation errors for PromptRequest'). Pin acp <0.11 until a fixed openhands-sdk ships. Consumed by scripts/dev-safe.mjs (agent-server uvx install) and .github/workflows/mock-llm-e2e.yml (mock ACP server venv).`,agentClientProtocol:`agent-client-protocol<0.11`},images:{agentServer:`ghcr.io/openhands/agent-server`,agentCanvas:`ghcr.io/openhands/agent-canvas`},ports:{agentServer:18e3,automation:18001,proxy:8e3},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`}},Ne=5e3,Pe=`unknown`,G=Me.compatibility.minimumAgentServer,Fe=`AGENT_SERVER_UNSUPPORTED_VERSION`,Ie=`AGENT_SERVER_UNKNOWN_VERSION`,K=null,Le=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,q=class extends Error{details;noBackendConfigured;constructor(e,t){let n=t?.noBackendConfigured??!1;super(n?`No agent server backend is configured yet. Add a backend to get started.`:`Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null,this.noBackendConfigured=n}},Re=e=>e instanceof q||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,ze=class extends q{code=Fe;actualVersion;requiredVersion=G;constructor(e){let t=`Agent Canvas requires agent-server ${G} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},J=class extends q{code=Ie;actualVersion;requiredVersion=G;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${G} or newer, but this backend did not return a valid version from /server_info. Restart or rebuild the agent-server backend, then try again.`;super(t),this.name=`AgentServerUnknownVersionError`,this.message=t,this.actualVersion=e}},Be=e=>_()&&Z(e,401);function Y(){K=null}function Ve(e){let t=Le(K);return Array.isArray(t)?t.includes(e):!0}function X(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function Z(e,t){return X(e)&&e.status===t}function He(e){return typeof e.version==`string`&&e.version.trim()||null}function Ue(e){let t=He(e);return!t||t.toLowerCase()===Pe?null:t}function We(e){let t=Ue(e);return!t||!Q(t)?null:t}function Ge(e,t){let n=Q(e),r=Q(t);if(!n||!r)return null;for(let e of[`major`,`minor`,`patch`]){if(n[e]>r[e])return 1;if(n[e]<r[e])return-1}return n.prerelease&&!r.prerelease?-1:!n.prerelease&&r.prerelease?1:n.prerelease&&r.prerelease?n.prerelease.localeCompare(r.prerelease):0}function Q(e){let[t]=e.trim().replace(/^v/,``).split(`+`),[n,r]=t.split(`-`,2),i=n.split(`.`);if(i.length!==3)return null;let[a,o,s]=i.map(e=>Number(e));return[a,o,s].every(e=>Number.isInteger(e)&&e>=0)?{major:a,minor:o,patch:s,prerelease:r}:null}function $(e){let t=Ue(e);if(!t)throw Y(),new J(He(e));let n=Ge(t,G);if(n===null)throw Y(),new J(t);if(n<0)throw Y(),new ze(t)}async function Ke(){let n=L();if(!n){if(Y(),j(I().backend))throw new q(`No backend configured`,{noBackendConfigured:!0});return null}let r=W({host:n.host,sessionApiKey:n.apiKey||null,timeout:Ne}),i;try{i=await new t(r).getServerInfo()}catch(e){throw Y(),Z(e,401)?e:new q(e instanceof Error?e.message:null)}if($(i),_())try{await new e(r).getSettings()}catch(e){if(Z(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return K=i,i}export{m as A,Te as C,y as D,v as E,f as F,_ as I,le as L,ce as M,g as N,n as O,oe as P,p as R,j as S,De as T,I as _,Ve as a,Se as b,Z as c,W as d,je as f,A as g,ke as h,Be as i,ae as j,se as k,Ke as l,B as m,Y as n,Re as o,Oe as p,We as r,X as s,$ as t,H as u,Ce as v,Ee as w,we as x,L as y};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-CvyPWJhg.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-compatibility-BWN-EIQn.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js","assets/vendor-styling-CI0PQ3ab.js","assets/proxy-B3tCGf0X.js"])))=>i.map(i=>d[i]);
2
- import{St as e}from"./vendor-styling-CI0PQ3ab.js";import{t}from"./common-CxbUL3nR.js";import{N as n,_ as r,a as i,d as a,k as o,m as s,u as c,y as l}from"./agent-server-compatibility-BWN-EIQn.js";import{_ as u,c as d,f,g as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{t as m}from"./client-source-BZK8vRs2.js";import{r as h,t as g}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js";import{t as _}from"./proxy-B3tCGf0X.js";import{t as v}from"./settings-mQUckT0g.js";import{t as ee}from"./settings-service.api-DXk5TdeJ.js";import{t as y}from"./v4-DbCkTSoU.js";import{t as te}from"./profiles-service.api-BQTklD5D.js";import{t as b}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js";import{f as x,o as S,s as C}from"./acp-providers-DerAmTyY.js";import{d as ne,f as w,r as re}from"./llm-subscription-DtsX5Lhg.js";import{t as ie}from"./llm-subscription-service-Casyzgn1.js";import{n as T,r as ae}from"./canvas-ui-COgjltGz.js";var E=new Map;function oe(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function se(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function ce(e={}){let t=a(e),n=t.host,r=E.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new p(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();E.set(n,i);try{return await i}catch(e){throw E.delete(n),e}}async function le(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?oe(n)?n:se(await ce(t),n):ce(t)}var D=`openhands-agent-server-conversation-metadata`,ue=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),O=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(D);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},k=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(D);return}window.localStorage.setItem(D,JSON.stringify(e))}},A=e=>O()[e]??null,j=(e,t)=>{let n=O();n[e]=t,k(n)},M=e=>{let t=O();e in t&&(delete t[e],k(t))};function N(e){if(!e?.id)return e;let t=A(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function P(){let e=r().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function de(e=20,t){let n=P(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>N(e)),next_page_id:i?.next_page_id??null}}async function F(e){if(e.length===0)return[];let t=P(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(N)}async function fe(e){return await _({backend:P(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:m})}async function pe(e){return _({backend:P(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function me(e){await _({backend:P(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function he(e,t){return await _({backend:P(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function ge(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function _e(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function I(e,t){let n=P(),r=new URLSearchParams;return r.append(`file_path`,t),await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function ve(e){let t=P(),n=new URLSearchParams;return n.set(`ids`,e),(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}function ye(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}var be={name:T,description:`The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-Ch7RH8eH.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-compatibility-C0MtTTwb.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js","assets/vendor-styling-CI0PQ3ab.js","assets/proxy-G4ce0fnQ.js"])))=>i.map(i=>d[i]);
2
+ import{St as e}from"./vendor-styling-CI0PQ3ab.js";import{t}from"./common-CxbUL3nR.js";import{N as n,_ as r,a as i,d as a,k as o,m as s,u as c,y as l}from"./agent-server-compatibility-C0MtTTwb.js";import{_ as u,c as d,f,g as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{t as m}from"./client-source-CtQjJEy6.js";import{r as h,t as g}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js";import{t as _}from"./proxy-G4ce0fnQ.js";import{t as v}from"./settings-mQUckT0g.js";import{t as ee}from"./settings-service.api-DPTFyRXL.js";import{t as y}from"./v4-DbCkTSoU.js";import{t as te}from"./profiles-service.api-DWetW2TL.js";import{t as b}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js";import{f as x,o as S,s as C}from"./acp-providers-DerAmTyY.js";import{d as ne,f as w,r as re}from"./llm-subscription-DtsX5Lhg.js";import{t as ie}from"./llm-subscription-service-C0zN0-rH.js";import{n as T,r as ae}from"./canvas-ui-COgjltGz.js";var E=new Map;function oe(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function se(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function ce(e={}){let t=a(e),n=t.host,r=E.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new p(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();E.set(n,i);try{return await i}catch(e){throw E.delete(n),e}}async function le(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?oe(n)?n:se(await ce(t),n):ce(t)}var D=`openhands-agent-server-conversation-metadata`,ue=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),O=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(D);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},k=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(D);return}window.localStorage.setItem(D,JSON.stringify(e))}},A=e=>O()[e]??null,j=(e,t)=>{let n=O();n[e]=t,k(n)},M=e=>{let t=O();e in t&&(delete t[e],k(t))};function N(e){if(!e?.id)return e;let t=A(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function P(){let e=r().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function de(e=20,t){let n=P(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>N(e)),next_page_id:i?.next_page_id??null}}async function F(e){if(e.length===0)return[];let t=P(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(N)}async function fe(e){return await _({backend:P(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:m})}async function pe(e){return _({backend:P(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function me(e){await _({backend:P(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function he(e,t){return await _({backend:P(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function ge(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function _e(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function I(e,t){let n=P(),r=new URLSearchParams;return r.append(`file_path`,t),await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function ve(e){let t=P(),n=new URLSearchParams;return n.set(`ids`,e),(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}function ye(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}var be={name:T,description:`The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
3
3
 
4
4
  They will NOT see the files you wrote, the terminal output, or the browser
5
5
  unless you call this tool to switch the right-side panel to the relevant
@@ -38,4 +38,4 @@ call per logical step is enough — don't repeat it for the same file or tab in
38
38
  the same turn.`,parameters:{type:`object`,additionalProperties:!1,properties:{command:{type:`string`,enum:[`navigate_to_file`,`open_tab`,`show_preview`],description:`UI command to dispatch.`},path:{type:`string`,description:`Workspace-relative file path. Required for navigate_to_file and show_preview; ignored otherwise.`},tab:{type:`string`,enum:[`files`,`browser`,`vscode`,`terminal`,`planner`,`tasklist`],description:`Tab to open. Required for open_tab; ignored otherwise.`}},required:[`command`]},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},xe=[`terminal`,`file_editor`,`task_tracker`],L=`browser_tool_set`,R=`task_tool_set`;function Se(){return!0}function Ce(){let e=(void 0)?.trim();if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;if(typeof e==`string`)return e.trim()||null}return null}function we(){let e=Ce();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function Te(){let e=we();if(!e?.services)return;let t=[];t.push(`<RUNTIME_SERVICES>`),e.mode?t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`):t.push(`You are running inside an agent-canvas dev stack.`),t.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:n,ingress:r,automation:i}=e.services,{frontend:a}=e.services;n?.url_from_agent&&t.push(`* Agent Server (you): ${n.url_from_agent}`,` ${n.description??`The agent-server hosting your tool calls.`}`),r?.url_from_agent&&t.push(`* Ingress: ${r.url_from_agent}`,` ${r.description??`Unified entry point for browser-facing traffic.`}`),a?.url_from_agent&&t.push(`* Frontend: ${a.url_from_agent}`,` ${a.description??`Frontend dev server.`}`),i?.url_from_agent?(t.push(`* Automation backend: ${i.url_from_agent}`,` ${i.description??`OpenHands Automations service.`}`),i.docs_url&&t.push(` Docs: ${i.docs_url}`),i.openapi_url&&t.push(` OpenAPI: ${i.openapi_url}`),i.auth_env_var&&t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)):t.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let o=n?.url_from_agent;return t.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),o&&t.push(`In particular, ${o} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),t.push(`</RUNTIME_SERVICES>`),t.join(`
39
39
  `)}function Ee(e){let{host:t}=a();return`${t}/api/conversations/${e}`}function z(e){return`Conversation ${e.slice(0,5)}`}function B(e){let r=A(e.id),i=e.agent?.kind===`ACPAgent`,o=i?e.tags?.acpserver??e.agent?.acp_server??null:null;return{id:e.id,created_by_user_id:null,selected_repository:r?.selected_repository??null,selected_branch:r?.selected_branch??null,git_provider:r?.git_provider??null,selected_workspace:r?.selected_workspace??null,active_profile:r?.active_profile??null,title:e.title?.trim()?e.title:z(e.id),trigger:null,pr_number:[],agent_kind:i?`acp`:`openhands`,acp_server:o,launched_agent_profile:e.launched_agent_profile??null,llm_model:i?x({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??v.llm_model,metrics:e.metrics?{accumulated_cost:e.metrics.accumulated_cost??null,max_budget_per_task:e.metrics.max_budget_per_task??null,accumulated_token_usage:e.metrics.accumulated_token_usage?{prompt_tokens:e.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:e.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:e.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:e.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:e.metrics.accumulated_token_usage.context_window??0,per_turn_token:e.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??t.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:Ee(e.id),session_api_key:a().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??n()},public:!1,sub_conversation_ids:[]}}function De(e){return{items:e.items.map(B),next_page_id:e.next_page_id??null}}var Oe=`acpserver`,ke=`gAAAAA`,Ae=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function V(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function H(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function U(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function W(e){return typeof e==`string`?e.startsWith(ke):Array.isArray(e)?e.some(W):U(e)?Object.values(e).some(W):!1}function je(e){return U(e)?Object.values(e).some(W):!1}function Me(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Ne(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function Pe(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function G(e,t){return e===L?Se()&&i(e):e===R?t.enable_sub_agents===!0&&i(e):!0}function Fe(e){let t=new Map;for(let n of xe)G(n,e)&&t.set(n,{name:n,params:{}});for(let n of[L,R])G(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>Pe(e)))for(let r of n)G(r.name,e)&&t.set(r.name,{name:r.name,params:V(r.params)});return Array.from(t.values())}function Ie(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
40
40
 
41
- `)}],run:!0}}function Le(){return b.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null,n=`/home/runner/work/agent-canvas/agent-canvas/node_modules/@openhands/extensions/skills/${e.name}/SKILL.md`;return{name:e.name,content:e.content,trigger:t,source:n,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function K(e){let t=Te(),n=V(e.agent_context),r=[...Array.isArray(n.skills)?n.skills:[],...Le()];return{...n,skills:r,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function q(e){return V(e.agent_settings).agent_kind===`acp`}function Re(e){let t=V(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function ze(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=C(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Be(e){let t=V(e.agent_settings),n={agent_kind:`acp`,agent_context:K(t)};for(let e of g){if(e===`acp_model`||e===`acp_env`)continue;let r=e===`acp_command`?ze(t):t[e];r!=null&&(n[e]=r)}let r=V(t.mcp_config);Object.keys(r).length>0&&(n.mcp_config=r);let i=typeof t.acp_server==`string`?t.acp_server:void 0,a=x({configured:t.acp_model,providerDefault:S(i)});return a&&(n.acp_model=a),n}function Ve(e){let t=V(e.agent_settings),n=V(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:v.llm_model,n.stream=!0;let r=H(n.api_key);r?n.api_key=r:delete n.api_key;let i=H(n.base_url);i?n.base_url=i:delete n.base_url,w(n)?(n.auth_type=re,n.subscription_vendor=ne,delete n.api_key,delete n.base_url):(delete n.auth_type,delete n.subscription_vendor);let a=V(t.mcp_config);Object.keys(a).length===0&&delete t.mcp_config,delete t.acp_server;for(let e of g)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:K(t),tools:Fe(t)}}function He(e){return q(e)?Be(e):Ve(e)}function Ue(e){let{settings:t,query:r,conversationInstructions:i,plugins:a,workingDir:o}=e,s=V(t.conversation_settings),c=Ie(r,i);return Ae.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??n()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function We(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=q(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=He(t),a=n?Re(t):void 0,o=Ue(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[be]:[],confirmation_policy:Me(o),max_iterations:typeof o.max_iterations==`number`?o.max_iterations:500,stuck_detection:!0,autotitle:!0,worktree:e.worktree??!0};!e.agentProfileId&&a&&(s.tags={[Oe]:a}),!e.agentProfileId&&e.secretsEncrypted&&(!n||je(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId);let c=Ne(o);c&&(s.security_analyzer=c),o.initial_message&&(s.initial_message=o.initial_message),o.plugins&&(s.plugins=o.plugins),o.hook_config&&(s.hook_config=o.hook_config);let u={...o.tool_module_qualnames??{}};if(delete u[ae],delete u[T],Object.keys(u).length>0&&(s.tool_module_qualnames=u),o.agent_definitions&&(s.agent_definitions=o.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=l(),n=t?ye(t):{},r={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),r[t.name]=e}s.secrets=r}return s}var Ge=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Ke(e){if(w(V(e.llm))&&!(await ie.getOpenAIStatus()).connected)throw Error(Ge)}async function qe(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-CvyPWJhg.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4,5])),[r,i]=await Promise.all([ee.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return t.agentProfileId||await Ke(a),We({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Je(){return{hooks:[]}}var Ye=`1970-01-01T00:00:00.000Z`,Xe=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function J(){return Error(Xe)}function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ze(e){return typeof e==`number`?e:null}function X(e){return typeof e==`number`?e:0}function Z(e){return typeof e==`string`?e:null}function Qe(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Ye}function $e(e){return Y(e)?{prompt_tokens:X(e.prompt_tokens),completion_tokens:X(e.completion_tokens),cache_read_tokens:X(e.cache_read_tokens),cache_write_tokens:X(e.cache_write_tokens),context_window:X(e.context_window),per_turn_token:X(e.per_turn_token)}:null}function et(e){return Y(e)?{accumulated_cost:Ze(e.accumulated_cost),max_budget_per_task:Ze(e.max_budget_per_task),accumulated_token_usage:$e(e.accumulated_token_usage)}:null}function tt(e){if(!Y(e))return null;let t=Y(e.llm)?{model:Z(e.llm.model)}:null;return{kind:Z(e.kind),acp_server:Z(e.acp_server),acp_model:Z(e.acp_model),llm:t}}function nt(e){return Y(e)?{working_dir:Z(e.working_dir)}:null}function rt(e){if(!Y(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function it(e){if(!Y(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function at(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function ot(e,t){let n=at(e),r=at(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function st(e){if(!Y(e)||typeof e.id!=`string`||!e.id.trim())throw J();return{id:e.id.trim(),title:Z(e.title),created_at:Qe(e,`created_at`,`createdAt`),updated_at:Qe(e,`updated_at`,`updatedAt`),execution_status:Z(e.execution_status),sandbox_status:Z(e.sandbox_status),metrics:et(e.metrics),agent:tt(e.agent),workspace:nt(e.workspace),tags:rt(e.tags),launched_agent_profile:it(e.launched_agent_profile),current_model_id:Z(e.current_model_id),current_model_name:Z(e.current_model_name)}}function Q(e){if(!Array.isArray(e))throw J();return e.map(st)}function ct(e){if(Array.isArray(e))return{items:Q(e),next_page_id:null};if(!Y(e))throw J();return{items:Q(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var lt=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function ut(e){let t=e??`idle`;return lt.has(t)?t:`idle`}function $(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var dt=class{static async sendMessage(e,t,n){let i=r().backend,o=n?.conversationUrl??null,c=n?.sessionApiKey??null;if(i.kind===`cloud`){if(!o||!c){let[t]=await F([e]);o=t?.conversation_url?.trim()??null,c=t?.session_api_key?.trim()??null}if(!o||!c)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await _({backend:i,method:`POST`,hostOverride:s(o),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:c}),t}return await new u(a({conversationUrl:o,sessionApiKey:c})).sendEvent(e,t,{run:!0}),t}static async createConversation(e,t,n,i,s,d,f,p,m,h,g){if(r().backend.kind===`cloud`)return fe({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:t??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:n??null,parent_conversation_id:f??null,agent_type:p,sandbox_id:m??null,agent_profile_id:h??null});let _=await ee.getSettings(),v=y(),te=await le(s??o(v)),b=d??(s?`local_repo`:`new_worktree`),x=await qe({settings:_,query:e,conversationInstructions:t,plugins:n,conversationId:v,workingDir:te,worktree:b===`new_worktree`,agentProfileId:h,agentProfileKind:g}),S=await new u(a()).createConversation(x),C=l();if(!C)throw new c;return(i?.selected_repository||s)&&j(S.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:s??null,workspace_mode:b}),{id:S.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:S.id,agent_server_url:C.host,request:{initial_message:x.initial_message,plugins:n??null},created_at:S.created_at,updated_at:S.updated_at}}static async getStartTask(e){return r().backend.kind===`cloud`?ve(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new d(a({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??n()}static async batchGetAppConversations(e){return e.length===0?[]:r().backend.kind===`cloud`?F(e):Q(await new u(a()).getConversations(e)).map(e=>B(e))}static async updateConversationPublicFlag(e,t){if(r().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return he(e,t)}static async updateConversationRepository(e,t,n,r){t?j(e,{...A(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):M(e);let[i]=await this.batchGetAppConversations([e]);return $(i,e)}static async readConversationFile(e,t){if(r().backend.kind===`cloud`)return I(e,ot(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),i=ot(t??`${n}/.agents_tmp/PLAN.md`,n);return new p(a()).downloadTextFile(i)}static async downloadConversation(e){return r().backend.kind===`cloud`?pe(e):new p(a()).downloadTrajectory(e)}static async getHooks(e){return Je()}static async getRuntimeConversation(e,t,n){let i=r().backend,o=i.kind===`cloud`&&t?await _({backend:i,method:`GET`,hostOverride:s(t),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:n}):await new u(a({conversationUrl:t,sessionApiKey:n})).getConversation(e),c=st(o),l=Y(o)?o.stats:null;return{id:c.id,title:c.title?.trim()?c.title:z(c.id),metrics:et(c.metrics),created_at:c.created_at,updated_at:c.updated_at,status:ut(c.execution_status),stats:Y(l)?l:{usage_to_metrics:{}}}}static async searchConversations(e=20,t){return r().backend.kind===`cloud`?de(e,t):De(ct(await new u(a()).searchConversations({limit:e,page_id:t,sort_order:h.UPDATED_AT_DESC})))}static async deleteConversation(e){r().backend.kind===`cloud`?await me(e):await new u(a()).deleteConversation(e),M(e)}static async updateConversationTitle(e,t){await new u(a()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return $(n,e)}static async forkConversation(e,t,n){if(r().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new u(a()).forkConversation(e,{from_event_id:t,...n?{title:n}:{}}),o=A(e);return o&&j(i.id,o),i}static async getEventParentId(e,t){return(await new u(a()).getEvent(e,t)).parent_id??void 0}static async switchProfile(e,t){let{backend:n}=r();if(n.kind===`cloud`){if(!e){await te.activateProfile(t);return}await _({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:t}});return}if(!e){await new f(a()).activateProfile(t);return}let i=a(),o=new u(i),s=await new f(i).getProfile(t,{exposeSecrets:`encrypted`}),c=typeof s.config.model==`string`?s.config.model:``;if(!c)throw Error(`Profile '${t}' has no model.`);await Ke({llm:s.config}),await o.switchLLM(e,{...s.config,model:c,stream:!0,usage_id:`profile:${t}:${y()}`})}static async switchAcpModel(e,t){let{backend:n}=r();if(n.kind===`cloud`){await _({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:t}});return}await new u(a()).switchAcpModel(e,t)}};export{_e as a,ue as c,I as i,le as l,F as n,A as o,ge as r,j as s,dt as t};
41
+ `)}],run:!0}}function Le(){return b.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null,n=`/home/runner/work/agent-canvas/agent-canvas/node_modules/@openhands/extensions/skills/${e.name}/SKILL.md`;return{name:e.name,content:e.content,trigger:t,source:n,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function K(e){let t=Te(),n=V(e.agent_context),r=[...Array.isArray(n.skills)?n.skills:[],...Le()];return{...n,skills:r,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function q(e){return V(e.agent_settings).agent_kind===`acp`}function Re(e){let t=V(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function ze(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=C(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Be(e){let t=V(e.agent_settings),n={agent_kind:`acp`,agent_context:K(t)};for(let e of g){if(e===`acp_model`||e===`acp_env`)continue;let r=e===`acp_command`?ze(t):t[e];r!=null&&(n[e]=r)}let r=V(t.mcp_config);Object.keys(r).length>0&&(n.mcp_config=r);let i=typeof t.acp_server==`string`?t.acp_server:void 0,a=x({configured:t.acp_model,providerDefault:S(i)});return a&&(n.acp_model=a),n}function Ve(e){let t=V(e.agent_settings),n=V(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:v.llm_model,n.stream=!0;let r=H(n.api_key);r?n.api_key=r:delete n.api_key;let i=H(n.base_url);i?n.base_url=i:delete n.base_url,w(n)?(n.auth_type=re,n.subscription_vendor=ne,delete n.api_key,delete n.base_url):(delete n.auth_type,delete n.subscription_vendor);let a=V(t.mcp_config);Object.keys(a).length===0&&delete t.mcp_config,delete t.acp_server;for(let e of g)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:K(t),tools:Fe(t)}}function He(e){return q(e)?Be(e):Ve(e)}function Ue(e){let{settings:t,query:r,conversationInstructions:i,plugins:a,workingDir:o}=e,s=V(t.conversation_settings),c=Ie(r,i);return Ae.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??n()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function We(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=q(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=He(t),a=n?Re(t):void 0,o=Ue(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[be]:[],confirmation_policy:Me(o),max_iterations:typeof o.max_iterations==`number`?o.max_iterations:500,stuck_detection:!0,autotitle:!0,worktree:e.worktree??!0};!e.agentProfileId&&a&&(s.tags={[Oe]:a}),!e.agentProfileId&&e.secretsEncrypted&&(!n||je(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId);let c=Ne(o);c&&(s.security_analyzer=c),o.initial_message&&(s.initial_message=o.initial_message),o.plugins&&(s.plugins=o.plugins),o.hook_config&&(s.hook_config=o.hook_config);let u={...o.tool_module_qualnames??{}};if(delete u[ae],delete u[T],Object.keys(u).length>0&&(s.tool_module_qualnames=u),o.agent_definitions&&(s.agent_definitions=o.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=l(),n=t?ye(t):{},r={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),r[t.name]=e}s.secrets=r}return s}var Ge=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Ke(e){if(w(V(e.llm))&&!(await ie.getOpenAIStatus()).connected)throw Error(Ge)}async function qe(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-Ch7RH8eH.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4,5])),[r,i]=await Promise.all([ee.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return t.agentProfileId||await Ke(a),We({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Je(){return{hooks:[]}}var Ye=`1970-01-01T00:00:00.000Z`,Xe=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function J(){return Error(Xe)}function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ze(e){return typeof e==`number`?e:null}function X(e){return typeof e==`number`?e:0}function Z(e){return typeof e==`string`?e:null}function Qe(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Ye}function $e(e){return Y(e)?{prompt_tokens:X(e.prompt_tokens),completion_tokens:X(e.completion_tokens),cache_read_tokens:X(e.cache_read_tokens),cache_write_tokens:X(e.cache_write_tokens),context_window:X(e.context_window),per_turn_token:X(e.per_turn_token)}:null}function et(e){return Y(e)?{accumulated_cost:Ze(e.accumulated_cost),max_budget_per_task:Ze(e.max_budget_per_task),accumulated_token_usage:$e(e.accumulated_token_usage)}:null}function tt(e){if(!Y(e))return null;let t=Y(e.llm)?{model:Z(e.llm.model)}:null;return{kind:Z(e.kind),acp_server:Z(e.acp_server),acp_model:Z(e.acp_model),llm:t}}function nt(e){return Y(e)?{working_dir:Z(e.working_dir)}:null}function rt(e){if(!Y(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function it(e){if(!Y(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function at(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function ot(e,t){let n=at(e),r=at(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function st(e){if(!Y(e)||typeof e.id!=`string`||!e.id.trim())throw J();return{id:e.id.trim(),title:Z(e.title),created_at:Qe(e,`created_at`,`createdAt`),updated_at:Qe(e,`updated_at`,`updatedAt`),execution_status:Z(e.execution_status),sandbox_status:Z(e.sandbox_status),metrics:et(e.metrics),agent:tt(e.agent),workspace:nt(e.workspace),tags:rt(e.tags),launched_agent_profile:it(e.launched_agent_profile),current_model_id:Z(e.current_model_id),current_model_name:Z(e.current_model_name)}}function Q(e){if(!Array.isArray(e))throw J();return e.map(st)}function ct(e){if(Array.isArray(e))return{items:Q(e),next_page_id:null};if(!Y(e))throw J();return{items:Q(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var lt=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function ut(e){let t=e??`idle`;return lt.has(t)?t:`idle`}function $(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var dt=class{static async sendMessage(e,t,n){let i=r().backend,o=n?.conversationUrl??null,c=n?.sessionApiKey??null;if(i.kind===`cloud`){if(!o||!c){let[t]=await F([e]);o=t?.conversation_url?.trim()??null,c=t?.session_api_key?.trim()??null}if(!o||!c)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await _({backend:i,method:`POST`,hostOverride:s(o),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:c}),t}return await new u(a({conversationUrl:o,sessionApiKey:c})).sendEvent(e,t,{run:!0}),t}static async createConversation(e,t,n,i,s,d,f,p,m,h,g){if(r().backend.kind===`cloud`)return fe({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:t??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:n??null,parent_conversation_id:f??null,agent_type:p,sandbox_id:m??null,agent_profile_id:h??null});let _=await ee.getSettings(),v=y(),te=await le(s??o(v)),b=d??(s?`local_repo`:`new_worktree`),x=await qe({settings:_,query:e,conversationInstructions:t,plugins:n,conversationId:v,workingDir:te,worktree:b===`new_worktree`,agentProfileId:h,agentProfileKind:g}),S=await new u(a()).createConversation(x),C=l();if(!C)throw new c;return(i?.selected_repository||s)&&j(S.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:s??null,workspace_mode:b}),{id:S.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:S.id,agent_server_url:C.host,request:{initial_message:x.initial_message,plugins:n??null},created_at:S.created_at,updated_at:S.updated_at}}static async getStartTask(e){return r().backend.kind===`cloud`?ve(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new d(a({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??n()}static async batchGetAppConversations(e){return e.length===0?[]:r().backend.kind===`cloud`?F(e):Q(await new u(a()).getConversations(e)).map(e=>B(e))}static async updateConversationPublicFlag(e,t){if(r().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return he(e,t)}static async updateConversationRepository(e,t,n,r){t?j(e,{...A(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):M(e);let[i]=await this.batchGetAppConversations([e]);return $(i,e)}static async readConversationFile(e,t){if(r().backend.kind===`cloud`)return I(e,ot(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),i=ot(t??`${n}/.agents_tmp/PLAN.md`,n);return new p(a()).downloadTextFile(i)}static async downloadConversation(e){return r().backend.kind===`cloud`?pe(e):new p(a()).downloadTrajectory(e)}static async getHooks(e){return Je()}static async getRuntimeConversation(e,t,n){let i=r().backend,o=i.kind===`cloud`&&t?await _({backend:i,method:`GET`,hostOverride:s(t),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:n}):await new u(a({conversationUrl:t,sessionApiKey:n})).getConversation(e),c=st(o),l=Y(o)?o.stats:null;return{id:c.id,title:c.title?.trim()?c.title:z(c.id),metrics:et(c.metrics),created_at:c.created_at,updated_at:c.updated_at,status:ut(c.execution_status),stats:Y(l)?l:{usage_to_metrics:{}}}}static async searchConversations(e=20,t){return r().backend.kind===`cloud`?de(e,t):De(ct(await new u(a()).searchConversations({limit:e,page_id:t,sort_order:h.UPDATED_AT_DESC})))}static async deleteConversation(e){r().backend.kind===`cloud`?await me(e):await new u(a()).deleteConversation(e),M(e)}static async updateConversationTitle(e,t){await new u(a()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return $(n,e)}static async forkConversation(e,t,n){if(r().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new u(a()).forkConversation(e,{from_event_id:t,...n?{title:n}:{}}),o=A(e);return o&&j(i.id,o),i}static async getEventParentId(e,t){return(await new u(a()).getEvent(e,t)).parent_id??void 0}static async switchProfile(e,t){let{backend:n}=r();if(n.kind===`cloud`){if(!e){await te.activateProfile(t);return}await _({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:t}});return}if(!e){await new f(a()).activateProfile(t);return}let i=a(),o=new u(i),s=await new f(i).getProfile(t,{exposeSecrets:`encrypted`}),c=typeof s.config.model==`string`?s.config.model:``;if(!c)throw Error(`Profile '${t}' has no model.`);await Ke({llm:s.config}),await o.switchLLM(e,{...s.config,model:c,stream:!0,usage_id:`profile:${t}:${y()}`})}static async switchAcpModel(e,t){let{backend:n}=r();if(n.kind===`cloud`){await _({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:t}});return}await new u(a()).switchAcpModel(e,t)}};export{_e as a,ue as c,I as i,le as l,F as n,A as o,ge as r,j as s,dt as t};
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./rolldown-runtime-BFRubm34.js";import{Ct as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{L as i,s as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as o}from"./useTranslation-Cbf5AGg_.js";import{t as s}from"./declaration-BGsHjPEW.js";import{C as c,E as l,S as u}from"./active-backend-context-B8rMv0X9.js";import{t as d}from"./utils-DB9LsAzA.js";import"./form-control-classes-CbdN5aO3.js";import{t as f}from"./brand-button-B1izLAdR.js";import{t as p}from"./settings-input-BsgQWS5R.js";import{r as m}from"./use-settings-CyxSlyTQ.js";import{c as h,i as ee,n as g,o as _,s as v,t as te}from"./acp-providers-DerAmTyY.js";import{t as ne}from"./use-save-settings-Chvzeu2s.js";import{d as re,h as ie,i as ae,m as oe}from"./sdk-settings-schema-CLR01YIK.js";import{n as se,r as ce}from"./schema-field-CUwk4wrQ.js";import{t as y}from"./settings-dropdown-input-Dhx9ErGd.js";import{r as b}from"./typography-CzfoD9DY.js";import{t as le}from"./settings-switch-Bes8dIlV.js";import{a as x,i as ue,n as S,r as de,t as fe}from"./use-acp-credential-form-Bm8qXdlc.js";var C=e(n(),1),w=r();function pe({form:e,providerKey:t}){let{t:n}=o(`openhands`),{fields:r,values:i,setValue:a,secretExists:c,conflicts:l}=e,{status:u,isChecking:d}=S(t),f=h(t)??t;return r.length===0?null:(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(b.Text,{className:`text-sm font-medium text-white`,children:n(s.SETTINGS$ACP_CREDENTIALS_TITLE)}),(0,w.jsx)(b.Text,{className:`text-xs text-[#717888]`,children:n(s.SETTINGS$ACP_CREDENTIALS_DESCRIPTION)})]}),(0,w.jsx)(ue,{status:u,isChecking:d,providerName:f,testIdPrefix:`settings-acp-auth`}),(0,w.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map(e=>(0,w.jsx)(de,{field:e,value:i[e.name]??``,onChange:t=>a(e.name,t),alreadySet:c(e.name),testId:`settings-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,w.jsx)(x,{conflicts:l})]})}var T=t(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,`$1\\$2`)}).join(` `)}})),E=t(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r.push(i),t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function ee(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function g(e,t,d){d||={};var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||={};var g=!1;return m.map(function(n){var i=n[0];if(!i||g)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return ee(t,``,n)}for(m=0;m<i.length;m++){var _=i.charAt(m);if(p||=!a&&(_===`*`||_===`?`),o)d+=_,o=!1;else if(a)_===a?a=!1:a==c?d+=_:_===f?(m+=1,_=i.charAt(m),_===l||_===f||_===u?d+=_:d+=f+_):_===u?d+=h():d+=_;else if(_===l||_===c)a=_;else if(r.test(_))return{op:i};else if(s.test(_)){g=!0;var v={comment:e.slice(n.index+m+1)};return d.length?[d,v]:[v]}else _===f?o=!0:_===u?d+=h():d+=_}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0?e:e.concat(t)},[])}t.exports=function(e,t,n){var r=g(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e.concat(t);var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?e.concat(n[0]):e.concat(n.filter(Boolean).map(function(e){return m.test(e)?JSON.parse(e.split(d)[1]):e}))},[]):r}})),{quote:D}=e(t((e=>{e.quote=T(),e.parse=E()}))(),1);function O(e){let t=[],n=0,r=``,i=!1;for(;n<e.length;){let a=e[n];if(a===` `||a===` `||a===`
1
+ import{a as e,t}from"./rolldown-runtime-BFRubm34.js";import{Ct as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{L as i,s as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as o}from"./useTranslation-Cbf5AGg_.js";import{t as s}from"./declaration-BGsHjPEW.js";import{C as c,E as l,S as u}from"./active-backend-context-DHhm10VS.js";import{t as d}from"./utils-DB9LsAzA.js";import"./form-control-classes-CbdN5aO3.js";import{t as f}from"./brand-button-B1izLAdR.js";import{t as p}from"./settings-input-BsgQWS5R.js";import{r as m}from"./use-settings-BeJap6YL.js";import{c as h,i as ee,n as g,o as _,s as v,t as te}from"./acp-providers-DerAmTyY.js";import{t as ne}from"./use-save-settings-DiDEbIJw.js";import{d as re,h as ie,i as ae,m as oe}from"./sdk-settings-schema-CLR01YIK.js";import{n as se,r as ce}from"./schema-field-CwdqUOnE.js";import{t as y}from"./settings-dropdown-input-Dhx9ErGd.js";import{r as b}from"./typography-CzfoD9DY.js";import{t as le}from"./settings-switch-Bes8dIlV.js";import{a as x,i as ue,n as S,r as de,t as fe}from"./use-acp-credential-form-DHd_Id-q.js";var C=e(n(),1),w=r();function pe({form:e,providerKey:t}){let{t:n}=o(`openhands`),{fields:r,values:i,setValue:a,secretExists:c,conflicts:l}=e,{status:u,isChecking:d}=S(t),f=h(t)??t;return r.length===0?null:(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(b.Text,{className:`text-sm font-medium text-white`,children:n(s.SETTINGS$ACP_CREDENTIALS_TITLE)}),(0,w.jsx)(b.Text,{className:`text-xs text-[#717888]`,children:n(s.SETTINGS$ACP_CREDENTIALS_DESCRIPTION)})]}),(0,w.jsx)(ue,{status:u,isChecking:d,providerName:f,testIdPrefix:`settings-acp-auth`}),(0,w.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map(e=>(0,w.jsx)(de,{field:e,value:i[e.name]??``,onChange:t=>a(e.name,t),alreadySet:c(e.name),testId:`settings-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,w.jsx)(x,{conflicts:l})]})}var T=t(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,`$1\\$2`)}).join(` `)}})),E=t(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r.push(i),t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function ee(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function g(e,t,d){d||={};var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||={};var g=!1;return m.map(function(n){var i=n[0];if(!i||g)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return ee(t,``,n)}for(m=0;m<i.length;m++){var _=i.charAt(m);if(p||=!a&&(_===`*`||_===`?`),o)d+=_,o=!1;else if(a)_===a?a=!1:a==c?d+=_:_===f?(m+=1,_=i.charAt(m),_===l||_===f||_===u?d+=_:d+=f+_):_===u?d+=h():d+=_;else if(_===l||_===c)a=_;else if(r.test(_))return{op:i};else if(s.test(_)){g=!0;var v={comment:e.slice(n.index+m+1)};return d.length?[d,v]:[v]}else _===f?o=!0:_===u?d+=h():d+=_}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0?e:e.concat(t)},[])}t.exports=function(e,t,n){var r=g(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e.concat(t);var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?e.concat(n[0]):e.concat(n.filter(Boolean).map(function(e){return m.test(e)?JSON.parse(e.split(d)[1]):e}))},[]):r}})),{quote:D}=e(t((e=>{e.quote=T(),e.parse=E()}))(),1);function O(e){let t=[],n=0,r=``,i=!1;for(;n<e.length;){let a=e[n];if(a===` `||a===` `||a===`
2
2
  `||a===`\r`){i&&=(t.push(r),r=``,!1),n+=1;continue}if(a===`'`){for(i=!0,n+=1;n<e.length&&e[n]!==`'`;)r+=e[n],n+=1;n<e.length&&(n+=1);continue}if(a===`"`){for(i=!0,n+=1;n<e.length&&e[n]!==`"`;){if(e[n]===`\\`&&n+1<e.length){let t=e[n+1];if(t===`"`||t===`\\`){r+=t,n+=2;continue}}r+=e[n],n+=1}n<e.length&&(n+=1);continue}if(a===`\\`&&n+1<e.length){i=!0,r+=e[n+1],n+=2;continue}i=!0,r+=a,n+=1}return i&&t.push(r),t}var k=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function A(e){return e.map(e=>k.test(e)||e===``?D([e]):e).join(` `)}var j={hideTitle:!0},me=`enable_sub_agents`,he=`tool_concurrency_limit`,ge=`npx -y <package-name>`,M=`__custom_model__`;function _e(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function N(e,t){let n=O(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return te}function ve(e){return e?.find(e=>e.key===me)}function ye(e,t){return typeof e==`boolean`?e:t?.default===!0}function be(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function xe(e){let{isAcp:t,selectedPreset:n,isDefaultProviderCommand:r,commandTokens:i,acpModel:a,subAgentsEnabled:o,toolConcurrencyField:s,toolConcurrency:c}=e;if(t){let e=r&&n!==`custom`;return{agent_kind:`acp`,acp_server:n,acp_model:a.trim()||null,acp_command:e?null:A(i)||null,acp_args:null}}let l={agent_kind:`openhands`,enable_sub_agents:o};if(s){let e=ae(s,c),t=typeof s.default==`number`?s.default:1;l.tool_concurrency_limit=e==null?t:Number(e)}return l}function P({embedded:e=!1,agentSettingsOverride:t=null,onSaveControlChange:n}={}){let{t:r}=o(`openhands`),{data:i,isLoading:a}=m(),h=t??i?.agent_settings??null,{mutate:x,isPending:ue}=ne(),{data:S}=ce(i?.agent_settings_schema),de=C.useMemo(()=>S?.sections.flatMap(e=>e.fields),[S]),T=ve(de),E=C.useMemo(()=>ye(h?.[me],T),[T,h]),[D,k]=(0,C.useState)(E),j=de?.find(e=>e.key===he),P=C.useMemo(()=>{if(!j)return``;let e=h?.[he];return re(j,e)},[j,h]),[F,Se]=(0,C.useState)(P),[I,L]=(0,C.useState)(`openhands`),[R,z]=(0,C.useState)(``),[B,V]=(0,C.useState)(``),[Ce,H]=(0,C.useState)(!1),[we,U]=(0,C.useState)(!1),W=I===`acp`?N(R,g):null,G=fe(W&&W!==`custom`?W:null),Te=(0,C.useRef)(null),K=(0,C.useRef)(null),q=(0,C.useRef)(``);(0,C.useEffect)(()=>{let e=t??i?.agent_settings??null;if(!e&&!i)return;let n=t??i;if(Te.current!==n){if(Te.current=n,e?.agent_kind===`acp`){L(`acp`);let t=e?.acp_server,n=typeof t==`string`?t:void 0,r=v(n),i=_e(e?.acp_command),a=[...i.length>0?i:r?.default_command??[],..._e(e?.acp_args)],o=a.length>0?A(a):``;z(o),K.current=n??null,q.current=o;let s=e?.acp_model,c=typeof s==`string`?s.trim():``;V(c||_(n)||``),H(!!c&&(!r||!be(r,c)))}else L(`openhands`),z(``),V(``),K.current=null,q.current=``,H(!1);U(!1)}},[i,t]),(0,C.useEffect)(()=>{k(E)},[E]),(0,C.useEffect)(()=>{Se(P)},[P]);let Ee=(0,C.useRef)(()=>({agent_kind:`openhands`,enable_sub_agents:!1})),De=(0,C.useCallback)(()=>Ee.current(),[]),J=(0,C.useRef)(G);J.current=G;let Oe=(0,C.useCallback)(e=>J.current.save(e),[]),ke=(0,C.useCallback)(()=>J.current.reset(),[]),Ae=I===`acp`&&O(R).length===0,je=G.isDirty;if((0,C.useEffect)(()=>{!e||!n||n({agentType:I,isValid:!Ae,buildAgentProfileFields:De,credentials:{isDirty:je,save:Oe,reset:ke}})},[e,n,I,Ae,je,De,Oe,ke]),a)return null;let Y=I===`acp`,X=O(R),Me=Y&&X.length===0,Z=N(R,g),Q=v(Z),Ne=Q?.available_models??[],Pe=Ne.length>0,Fe=be(Q,B),Ie=Ce||!Fe?M:B,Le=!!Q&&X.join(` `)===Q.default_command.join(` `),Re=A(g[0]?.default_command??[])||ge;Ee.current=()=>xe({isAcp:Y,selectedPreset:Z,isDefaultProviderCommand:Le,commandTokens:X,acpModel:B,subAgentsEnabled:D,toolConcurrencyField:j,toolConcurrency:F});let ze=we||!Y&&(D!==E||F!==P),Be=G.isDirty,Ve=ze||Be,$=ue||G.isSaving,He=async()=>{if(G.isDirty){if(!await G.save({silent:ze}))return;G.reset()}if(ze)if(Y){let e=!!(Q&&Le),t=K.current,n=R===q.current,i=!!t&&t!==`custom`&&!g.some(e=>e.key===t),a=Y&&n&&i,o=ee(a?t:Q&&Le?Q.key:te,{command:e?[]:X,model:B.trim()||void 0,allowUnknownServer:a});if(!o)return;x({agent_settings_diff:o},{onError:e=>{u(l(e)||r(s.ERROR$GENERIC))},onSuccess:()=>{c(r(s.SETTINGS$SAVED)),U(!1)}})}else{let e={agent_kind:`openhands`,enable_sub_agents:D};if(j){let t;try{t=ae(j,F)}catch(e){u(e instanceof Error?e.message:r(s.ERROR$GENERIC));return}t!=null&&(e[he]=t)}x({agent_settings_diff:e},{onError:e=>{u(l(e)||r(s.ERROR$GENERIC))},onSuccess:()=>{c(r(s.SETTINGS$SAVED)),U(!1)}})}},Ue=T?ie(r,T.key,T.label):r(s.SCHEMA$ENABLE_SUB_AGENTS$LABEL),We=T?oe(r,T.key,T.description):r(s.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION);return(0,w.jsxs)(`div`,{"data-testid":`agent-settings-screen`,className:`flex flex-col gap-6 pb-8 max-w-2xl`,children:[!e&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(b.H2,{className:`mb-2`,children:r(s.SETTINGS$NAV_AGENT)}),(0,w.jsx)(b.Paragraph,{className:`text-sm text-[#A3A3A3]`,children:r(s.SETTINGS$AGENT_PAGE_DESCRIPTION)})]}),(0,w.jsx)(y,{testId:`agent-type-selector`,name:`agent-type`,label:r(s.SETTINGS$NAV_AGENT),items:[{key:`openhands`,label:r(s.SETTINGS$AGENT_TYPE_OPENHANDS)},{key:`acp`,label:r(s.SETTINGS$AGENT_TYPE_ACP)}],selectedKey:I,onSelectionChange:e=>{if(!e)return;let t=e;if(L(t),t===`acp`&&!R){let e=g[0];e&&(z(A(e.default_command)),V(_(e.key)??``),H(!1))}else t===`openhands`&&H(!1);U(!0)}}),!Y&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(le,{testId:`agent-settings-enable-sub-agents`,isToggled:D,onToggle:e=>{k(e)},children:Ue}),We?(0,w.jsx)(b.Paragraph,{className:d(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:We}):null]}),!Y&&j?(0,w.jsx)(se,{field:j,value:F,isDisabled:$,onChange:Se}):null,Y&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(y,{testId:`agent-preset-selector`,name:`agent-preset`,label:r(s.SETTINGS$AGENT_PRESET),items:[...g.map(e=>({key:e.key,label:e.display_name})),{key:`custom`,label:r(s.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Z,onSelectionChange:e=>{if(!e)return;let t=String(e),n=v(t);n?(z(A(n.default_command)),V(_(t)??``),H(!1)):t===`custom`&&(z(``),V(``),H(!0)),U(!0)}}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,w.jsx)(b.Text,{className:`text-sm`,children:r(s.SETTINGS$AGENT_COMMAND)}),(0,w.jsx)(`textarea`,{"data-testid":`agent-command-input`,className:`bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:text-[#717888] min-h-[60px] resize-y focus:outline-none focus:border-white`,value:R,placeholder:Re,onChange:e=>{let t=e.target.value,n=N(R,g),r=N(t,g);r!==n&&(V(_(r)??``),H(!1)),z(t),U(!0)}}),(0,w.jsx)(b.Text,{className:`text-xs text-[#717888]`,children:r(s.SETTINGS$AGENT_COMMAND_HINT)})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Pe&&(0,w.jsx)(y,{testId:`agent-model-selector`,name:`agent-model`,label:r(s.SETTINGS$AGENT_MODEL),items:[...Ne.map(e=>({key:e.id,label:e.label})),{key:M,label:r(s.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Ie,onSelectionChange:e=>{if(!e)return;let t=String(e);t===M?(H(!0),V(``)):(H(!1),V(t)),U(!0)}}),Ie===M&&(0,w.jsx)(p,{testId:`agent-model-input`,label:r(Pe?s.SETTINGS$AGENT_CUSTOM_MODEL:s.SETTINGS$AGENT_MODEL),type:`text`,className:`w-full`,value:B,showOptionalTag:!0,onChange:e=>{V(e),U(!0)}}),(0,w.jsx)(b.Text,{className:`text-xs text-[#717888]`,children:r(s.SETTINGS$AGENT_MODEL_HINT)})]})]}),Y&&Z!==`custom`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`hr`,{className:`border-[#3D4046]`}),(0,w.jsx)(pe,{form:G,providerKey:Z})]}),!e&&(0,w.jsx)(`div`,{children:(0,w.jsx)(f,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:$||!Ve||Me,onClick:He,children:r($?s.SETTINGS$SAVING:s.SETTINGS$SAVE_CHANGES)})})]})}var F=i(function(){return(0,w.jsx)(a,{to:`/settings/agents`,replace:!0})});export{O as i,F as n,j as r,P as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./agent-settings-GwiXe_6k.js";export{e as default,t as handle};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useTranslation-Cbf5AGg_.js";import{t as i}from"./declaration-BGsHjPEW.js";import{r as a}from"./active-backend-context-B8rMv0X9.js";import{t as o}from"./utils-DB9LsAzA.js";import{S as s,c,d as l}from"./agent-server-compatibility-BWN-EIQn.js";import{d as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{r as d,t as f}from"./modal-body-Cc2zp0xb.js";import{t as p}from"./brand-button-B1izLAdR.js";import{n as m,o as h}from"./backend-form-modal-RGcu909r.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new u(l({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),s(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),c(t,401))T(e(i.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(i.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:o(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,d(`md`),f),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(i.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(m,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(h,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(i.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(p,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?i.ONBOARDING$BACKEND_STATUS_CHECKING:i.BACKEND$CONNECT)})]})})})]})})}export{v as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useTranslation-Cbf5AGg_.js";import{t as i}from"./declaration-BGsHjPEW.js";import{r as a}from"./active-backend-context-DHhm10VS.js";import{t as o}from"./utils-DB9LsAzA.js";import{S as s,c,d as l}from"./agent-server-compatibility-C0MtTTwb.js";import{d as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{r as d,t as f}from"./modal-body-Cc2zp0xb.js";import{t as p}from"./brand-button-B1izLAdR.js";import{n as m,o as h}from"./backend-form-modal-B8GtBA-J.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new u(l({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),s(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),c(t,401))T(e(i.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(i.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:o(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,d(`md`),f),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(i.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(m,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(h,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(i.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(p,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?i.ONBOARDING$BACKEND_STATUS_CHECKING:i.BACKEND$CONNECT)})]})})})]})})}export{v as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{L as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{t as a}from"./declaration-BGsHjPEW.js";import{C as o,E as s,S as c,j as l}from"./active-backend-context-B8rMv0X9.js";import{c as u}from"./telemetry-C5JMEfqB.js";import{t as d}from"./brand-button-B1izLAdR.js";import{i as f,n as p,r as m,t as h}from"./color-themes-CHizm1xF.js";import{t as g}from"./settings-input-BsgQWS5R.js";import{t as _}from"./settings-mQUckT0g.js";import{r as v}from"./use-settings-CyxSlyTQ.js";import{t as y}from"./use-save-settings-Chvzeu2s.js";import{t as b}from"./settings-dropdown-input-Dhx9ErGd.js";import{n as x,t as S}from"./switch-skeleton-DqQwalyu.js";import{t as C}from"./settings-switch-Bes8dIlV.js";var w=e(t(),1),T=n();function E({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,T.jsx)(b,{testId:n,name:n,onInputChange:t,label:r(a.SETTINGS$LANGUAGE),items:l.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function D(){let{t:e}=i(`openhands`),t=w.useCallback(e=>{if(!e)return;let t=e;p(t),m(t)},[]);return(0,T.jsx)(b,{testId:`color-theme-input`,name:`color-theme-input`,label:e(a.SETTINGS$COLOR_THEME),items:h.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:f(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function O(){return(0,T.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,T.jsx)(x,{}),(0,T.jsx)(S,{}),(0,T.jsx)(S,{})]})}function k(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=y(),{data:r,isLoading:f}=v(),[p,m]=w.useState(!1),[h,b]=w.useState(!1),[x,S]=w.useState(!1),[k,A]=w.useState(!1),[j,M]=w.useState(!1),N=n=>{let r=n.get(`language-input`)?.toString(),i=l.find(({label:e})=>e===r)?.value||_.language,d=n.get(`enable-analytics-switch`)?.toString()===`on`;t({language:i,user_consents_to_analytics:d,enable_sound_notifications:n.get(`enable-sound-notifications-switch`)?.toString()===`on`,git_user_name:n.get(`git-user-name-input`)?.toString()||_.git_user_name,git_user_email:n.get(`git-user-email-input`)?.toString()||_.git_user_email},{onSuccess:()=>{u(d?`granted`:`denied`),o(e(a.SETTINGS$SAVED))},onError:t=>{c(s(t)||e(a.ERROR$GENERIC))},onSettled:()=>{m(!1),b(!1),S(!1),A(!1),M(!1)}})},P=e=>{let t=l.find(({label:t})=>t===e)?.label,n=l.find(({value:e})=>e===r?.language)?.label;m(t!==n)},F=e=>{b(e!==(r?.user_consents_to_analytics??!0))},I=e=>{S(e!==!!r?.enable_sound_notifications)},L=e=>{let t=r?.git_user_name;A(e!==t)},R=e=>{let t=r?.git_user_email;M(e!==t)},z=!p&&!h&&!x&&!k&&!j,B=!r||f||n;return(0,T.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:N,className:`flex flex-col gap-6`,children:[B&&(0,T.jsx)(O,{}),!B&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,T.jsx)(E,{name:`language-input`,defaultKey:r.language,onChange:P}),(0,T.jsx)(D,{}),(0,T.jsx)(C,{testId:`enable-analytics-switch`,name:`enable-analytics-switch`,defaultIsToggled:r.user_consents_to_analytics??!0,onToggle:F,children:e(a.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,T.jsx)(C,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:I,children:e(a.SETTINGS$SOUND_NOTIFICATIONS)}),(0,T.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,T.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(a.SETTINGS$GIT_SETTINGS)}),(0,T.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(a.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,T.jsx)(g,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(a.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:L,placeholder:e(a.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,T.jsx)(g,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(a.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:R,placeholder:e(a.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,T.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,T.jsxs)(d,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||z,children:[!n&&e(a.SETTINGS$SAVE_CHANGES),n&&e(a.SETTINGS$SAVING)]})})]})]})]})}var A=r(k);export{A as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{L as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{t as a}from"./declaration-BGsHjPEW.js";import{C as o,E as s,S as c,j as l}from"./active-backend-context-DHhm10VS.js";import{c as u}from"./telemetry-SHxpVxk8.js";import{t as d}from"./brand-button-B1izLAdR.js";import{i as f,n as p,r as m,t as h}from"./color-themes-CHizm1xF.js";import{t as g}from"./settings-input-BsgQWS5R.js";import{t as _}from"./settings-mQUckT0g.js";import{r as v}from"./use-settings-BeJap6YL.js";import{t as y}from"./use-save-settings-DiDEbIJw.js";import{t as b}from"./settings-dropdown-input-Dhx9ErGd.js";import{n as x,t as S}from"./switch-skeleton-DqQwalyu.js";import{t as C}from"./settings-switch-Bes8dIlV.js";var w=e(t(),1),T=n();function E({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,T.jsx)(b,{testId:n,name:n,onInputChange:t,label:r(a.SETTINGS$LANGUAGE),items:l.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function D(){let{t:e}=i(`openhands`),t=w.useCallback(e=>{if(!e)return;let t=e;p(t),m(t)},[]);return(0,T.jsx)(b,{testId:`color-theme-input`,name:`color-theme-input`,label:e(a.SETTINGS$COLOR_THEME),items:h.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:f(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function O(){return(0,T.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,T.jsx)(x,{}),(0,T.jsx)(S,{}),(0,T.jsx)(S,{})]})}function k(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=y(),{data:r,isLoading:f}=v(),[p,m]=w.useState(!1),[h,b]=w.useState(!1),[x,S]=w.useState(!1),[k,A]=w.useState(!1),[j,M]=w.useState(!1),N=n=>{let r=n.get(`language-input`)?.toString(),i=l.find(({label:e})=>e===r)?.value||_.language,d=n.get(`enable-analytics-switch`)?.toString()===`on`;t({language:i,user_consents_to_analytics:d,enable_sound_notifications:n.get(`enable-sound-notifications-switch`)?.toString()===`on`,git_user_name:n.get(`git-user-name-input`)?.toString()||_.git_user_name,git_user_email:n.get(`git-user-email-input`)?.toString()||_.git_user_email},{onSuccess:()=>{u(d?`granted`:`denied`),o(e(a.SETTINGS$SAVED))},onError:t=>{c(s(t)||e(a.ERROR$GENERIC))},onSettled:()=>{m(!1),b(!1),S(!1),A(!1),M(!1)}})},P=e=>{let t=l.find(({label:t})=>t===e)?.label,n=l.find(({value:e})=>e===r?.language)?.label;m(t!==n)},F=e=>{b(e!==(r?.user_consents_to_analytics??!0))},I=e=>{S(e!==!!r?.enable_sound_notifications)},L=e=>{let t=r?.git_user_name;A(e!==t)},R=e=>{let t=r?.git_user_email;M(e!==t)},z=!p&&!h&&!x&&!k&&!j,B=!r||f||n;return(0,T.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:N,className:`flex flex-col gap-6`,children:[B&&(0,T.jsx)(O,{}),!B&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,T.jsx)(E,{name:`language-input`,defaultKey:r.language,onChange:P}),(0,T.jsx)(D,{}),(0,T.jsx)(C,{testId:`enable-analytics-switch`,name:`enable-analytics-switch`,defaultIsToggled:r.user_consents_to_analytics??!0,onToggle:F,children:e(a.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,T.jsx)(C,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:I,children:e(a.SETTINGS$SOUND_NOTIFICATIONS)}),(0,T.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,T.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(a.SETTINGS$GIT_SETTINGS)}),(0,T.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(a.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,T.jsx)(g,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(a.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:L,placeholder:e(a.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,T.jsx)(g,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(a.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:R,placeholder:e(a.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,T.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,T.jsxs)(d,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||z,children:[!n&&e(a.SETTINGS$SAVE_CHANGES),n&&e(a.SETTINGS$SAVING)]})})]})]})]})}var A=r(k);export{A as default};
@@ -1,2 +1,2 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{L as r,P as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{c as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as o}from"./useQuery-D5pEZbY0.js";import{t as s}from"./useTranslation-Cbf5AGg_.js";import{t as c}from"./declaration-BGsHjPEW.js";import{C as l,S as u,n as d}from"./active-backend-context-B8rMv0X9.js";import{t as f}from"./back-nav-button-DVknCcSP.js";import{i as p,t as m}from"./utils-DB9LsAzA.js";import{_ as h,d as g,m as _,s as v}from"./agent-server-compatibility-BWN-EIQn.js";import{v as y}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{t as b}from"./proxy-B3tCGf0X.js";import{r as x}from"./modal-classes-3qT9Ap7Q.js";import{t as S}from"./brand-button-B1izLAdR.js";import{n as C}from"./navigation-context-DPs2G0X8.js";import{t as w}from"./use-settings-CyxSlyTQ.js";import{t as T}from"./use-tracking-D2Qg5Lpd.js";import{n as E}from"./use-create-conversation-r1JHfKO5.js";import{t as D}from"./u-edit-DL5LgKon.js";import{t as O}from"./terminal-Cgf___rK.js";import{t as k}from"./use-user-conversation-CnE4zhOA.js";import{t as A}from"./toggle-switch-DX_k418f.js";import{t as j}from"./x-mark-Batp6gXa.js";import{t as M}from"./code-tag-DYlAhEQY.js";import{t as N}from"./link-external-CaBmUEs_.js";import{C as ee,D as P,E as te,O as ne,S as re,T as ie,_ as F,a as ae,b as oe,c as se,d as I,f as L,g as ce,h as le,i as ue,k as de,l as fe,m as R,o as pe,p as me,r as he,s as ge,t as _e,u as ve}from"./automation-export-BwRX6H32.js";import{t as z}from"./automation-LZB0MjdV.js";var B=e(t()),V=n();function H(){let{t:e}=s(`openhands`);return(0,V.jsx)(f,{to:`/automations`,children:e(c.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var U=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function ye({active:e}){let{t}=s(`openhands`);return(0,V.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:m(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?c.AUTOMATIONS$DETAIL$ACTIVE:c.AUTOMATIONS$DETAIL$INACTIVE)})}function be({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:a,onRunNow:o,isRunningNow:l=!1}){let{t:u}=s(`openhands`),d=ce(`manage_automations`),f=[...n?[{label:u(c.AUTOMATIONS$EDIT),icon:(0,V.jsx)(D,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?u(c.AUTOMATIONS$TURN_OFF):u(c.AUTOMATIONS$TURN_ON),icon:(0,V.jsx)(ve,{className:`size-4`}),onClick:t},{label:u(c.AUTOMATIONS$EXPORT),icon:(0,V.jsx)(U,{className:`size-4`}),onClick:i},{label:u(c.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,V.jsx)(U,{className:`size-4`}),onClick:a},{label:u(c.AUTOMATIONS$DELETE),icon:(0,V.jsx)(fe,{className:`size-4`}),onClick:r}];return(0,V.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,V.jsx)(ye,{active:e.enabled})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d&&o&&(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:l||!e.enabled,onClick:o,children:[(0,V.jsx)(le,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),u(l?c.AUTOMATIONS$STARTING:c.AUTOMATIONS$RUN_NOW)]}),d&&(0,V.jsx)(A,{enabled:e.enabled,label:e.enabled?u(c.AUTOMATIONS$TURN_OFF):u(c.AUTOMATIONS$TURN_ON),onToggle:t}),d&&(0,V.jsx)(F,{items:f})]})]})})}function W({icon:e,title:t,children:n}){return(0,V.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,V.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,V.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,V.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var xe=240,Se=`max-h-60`;function Ce({prompt:e}){let{t}=s(`openhands`),[n,r]=B.useState(!1),[i,a]=B.useState(!1),o=B.useRef(null),l=i&&!n;return B.useLayoutEffect(()=>{let e=o.current;if(!e)return;let t=()=>{a(e.scrollHeight>xe)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,V.jsx)(W,{icon:(0,V.jsx)(O,{className:`size-4`}),title:t(c.AUTOMATIONS$DETAIL$PROMPT),children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`p`,{ref:o,className:m(`whitespace-pre-wrap text-sm leading-6 text-content`,l&&m(Se,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),l?(0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,V.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?c.COMMON$VIEW_LESS:c.COMMON$VIEW_MORE)}):null]})})}var we=e=>(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),Te=e=>(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,V.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,V.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,V.jsx)(`circle`,{cx:9,cy:18,r:2})]}),G=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),K=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),Ee=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function q({icon:e,label:t,children:n}){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,V.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,V.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function De({branch:e}){return(0,V.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}var J=60;function Oe({filter:e}){let{t}=s(`openhands`),[n,r]=(0,B.useState)(!1),i=e.length>J;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,J)}…`:e}),i&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?c.SETTINGS$SKILLS_SHOW_LESS:c.SETTINGS$SKILLS_SHOW_MORE)})]})}function ke({automation:e}){let{t}=s(`openhands`),n=e.trigger.type===`event`,r=e.trigger.schedule??``;e.trigger.schedule_human&&(r=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let i=t(n?c.AUTOMATIONS$DETAIL$TRIGGER_EVENT:c.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,V.jsx)(W,{icon:(0,V.jsx)(we,{className:`size-4`}),title:t(c.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,V.jsx)(q,{icon:(0,V.jsx)(Te,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,V.jsx)(De,{branch:e.branch})]})}),(0,V.jsx)(q,{icon:(0,V.jsx)(G,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,V.jsx)(q,{icon:(0,V.jsx)(K,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,V.jsx)(q,{icon:(0,V.jsx)(me,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,V.jsx)(q,{icon:(0,V.jsx)(N,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$EVENT_TYPE),children:I(e.trigger.on)}),n&&e.trigger.filter&&(0,V.jsx)(q,{icon:(0,V.jsx)(M,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,V.jsx)(Oe,{filter:e.trigger.filter})}),(0,V.jsx)(q,{icon:(0,V.jsx)(L,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$MODEL),children:e.model??t(c.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,V.jsx)(q,{icon:(0,V.jsx)(Ee,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var Ae=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function je({name:e}){return(0,V.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function Me({plugins:e}){let{t}=s(`openhands`);return(0,V.jsx)(W,{icon:(0,V.jsx)(Ae,{className:`size-4`}),title:t(c.AUTOMATIONS$DETAIL$PLUGINS),children:(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,V.jsx)(je,{name:e},e))})})}var Y=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function X(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function Ne(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?n(c.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(c.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(c.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):o===1?n(c.AUTOMATIONS$DETAIL$TIME_YESTERDAY):o<7?n(c.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:o}):X(e,t)}function Pe({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=s(`openhands`),i=r.language;return(0,V.jsx)(W,{icon:(0,V.jsx)(Y,{className:`size-4`}),title:n(c.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,V.jsx)(q,{icon:(0,V.jsx)(K,{className:`size-3.5`}),label:n(c.AUTOMATIONS$DETAIL$CREATED),children:X(e,i)}),(0,V.jsx)(q,{icon:(0,V.jsx)(R,{className:`size-3.5`}),label:n(c.AUTOMATIONS$DETAIL$LAST_RUN),children:t?Ne(t,i,n):n(c.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Fe=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),Ie={[z.COMPLETED]:{label:c.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[z.FAILED]:{label:c.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[z.PENDING]:{label:c.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[z.RUNNING]:{label:c.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function Le({status:e}){switch(e){case z.COMPLETED:return(0,V.jsx)(G,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case z.FAILED:return(0,V.jsx)(Fe,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,V.jsx)(R,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Re({status:e}){let{t}=s(`openhands`),n=Ie[e];return(0,V.jsxs)(`span`,{className:m(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,V.jsx)(Le,{status:e}),t(n.label)]})}var ze=20;function Be(e){return e.kind===`BashOutput`}var Ve=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<ze;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{Be(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=h().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),b({backend:r,method:`GET`,hostOverride:_(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new y(g({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},He=[`bash-command-logs`];function Ue(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function We(e){let t=a.isAxiosError(e)?e.response?.status:v(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(a.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function Ge(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=d(),a=k(r?t??null:null),s=a.data,c=s?.conversation_url??null,l=s?.session_api_key??null,u=i.backend.kind===`cloud`,f=a.isFetched,p=null,m=!1;u&&f&&(s?p=Ue(s.sandbox_status)??(s.conversation_url?null:`missing`):m=!0);let h=r&&!!n&&(u?!!c:!0)&&!p&&!m,g=o({queryKey:[...He,n,c,l,i.backend.id,i.orgId],queryFn:()=>Ve.listOutputs(c,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?We(g.error):null,v=p??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:m,sandboxIssue:v}}var Ke=4e3;function qe(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function Je({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?qe(a,Ke):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{L as r,P as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{c as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as o}from"./useQuery-D5pEZbY0.js";import{t as s}from"./useTranslation-Cbf5AGg_.js";import{t as c}from"./declaration-BGsHjPEW.js";import{C as l,S as u,n as d}from"./active-backend-context-DHhm10VS.js";import{t as f}from"./back-nav-button-DVknCcSP.js";import{i as p,t as m}from"./utils-DB9LsAzA.js";import{_ as h,d as g,m as _,s as v}from"./agent-server-compatibility-C0MtTTwb.js";import{v as y}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{t as b}from"./proxy-G4ce0fnQ.js";import{r as x}from"./modal-classes-3qT9Ap7Q.js";import{t as S}from"./brand-button-B1izLAdR.js";import{n as C}from"./navigation-context-DPs2G0X8.js";import{t as w}from"./use-settings-BeJap6YL.js";import{t as T}from"./use-tracking-DFoPQUSU.js";import{n as E}from"./use-create-conversation-CkKUQVbP.js";import{t as D}from"./u-edit-DL5LgKon.js";import{t as O}from"./terminal-Cgf___rK.js";import{t as k}from"./use-user-conversation-BrN2xeQU.js";import{t as A}from"./toggle-switch-DX_k418f.js";import{t as j}from"./x-mark-Batp6gXa.js";import{t as M}from"./code-tag-DYlAhEQY.js";import{t as N}from"./link-external-CaBmUEs_.js";import{C as ee,D as P,E as te,O as ne,S as re,T as ie,_ as F,a as ae,b as oe,c as se,d as I,f as L,g as ce,h as le,i as ue,k as de,l as fe,m as R,o as pe,p as me,r as he,s as ge,t as _e,u as ve}from"./automation-export-Djc8Tf0M.js";import{t as z}from"./automation-LZB0MjdV.js";var B=e(t()),V=n();function H(){let{t:e}=s(`openhands`);return(0,V.jsx)(f,{to:`/automations`,children:e(c.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var U=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function ye({active:e}){let{t}=s(`openhands`);return(0,V.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:m(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?c.AUTOMATIONS$DETAIL$ACTIVE:c.AUTOMATIONS$DETAIL$INACTIVE)})}function be({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:a,onRunNow:o,isRunningNow:l=!1}){let{t:u}=s(`openhands`),d=ce(`manage_automations`),f=[...n?[{label:u(c.AUTOMATIONS$EDIT),icon:(0,V.jsx)(D,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?u(c.AUTOMATIONS$TURN_OFF):u(c.AUTOMATIONS$TURN_ON),icon:(0,V.jsx)(ve,{className:`size-4`}),onClick:t},{label:u(c.AUTOMATIONS$EXPORT),icon:(0,V.jsx)(U,{className:`size-4`}),onClick:i},{label:u(c.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,V.jsx)(U,{className:`size-4`}),onClick:a},{label:u(c.AUTOMATIONS$DELETE),icon:(0,V.jsx)(fe,{className:`size-4`}),onClick:r}];return(0,V.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,V.jsx)(ye,{active:e.enabled})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d&&o&&(0,V.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:l||!e.enabled,onClick:o,children:[(0,V.jsx)(le,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),u(l?c.AUTOMATIONS$STARTING:c.AUTOMATIONS$RUN_NOW)]}),d&&(0,V.jsx)(A,{enabled:e.enabled,label:e.enabled?u(c.AUTOMATIONS$TURN_OFF):u(c.AUTOMATIONS$TURN_ON),onToggle:t}),d&&(0,V.jsx)(F,{items:f})]})]})})}function W({icon:e,title:t,children:n}){return(0,V.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,V.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,V.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,V.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var xe=240,Se=`max-h-60`;function Ce({prompt:e}){let{t}=s(`openhands`),[n,r]=B.useState(!1),[i,a]=B.useState(!1),o=B.useRef(null),l=i&&!n;return B.useLayoutEffect(()=>{let e=o.current;if(!e)return;let t=()=>{a(e.scrollHeight>xe)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,V.jsx)(W,{icon:(0,V.jsx)(O,{className:`size-4`}),title:t(c.AUTOMATIONS$DETAIL$PROMPT),children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(`p`,{ref:o,className:m(`whitespace-pre-wrap text-sm leading-6 text-content`,l&&m(Se,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),l?(0,V.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,V.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?c.COMMON$VIEW_LESS:c.COMMON$VIEW_MORE)}):null]})})}var we=e=>(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),Te=e=>(0,V.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,V.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,V.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,V.jsx)(`circle`,{cx:9,cy:18,r:2})]}),G=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),K=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),Ee=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function q({icon:e,label:t,children:n}){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,V.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,V.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function De({branch:e}){return(0,V.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}var J=60;function Oe({filter:e}){let{t}=s(`openhands`),[n,r]=(0,B.useState)(!1),i=e.length>J;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,J)}…`:e}),i&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?c.SETTINGS$SKILLS_SHOW_LESS:c.SETTINGS$SKILLS_SHOW_MORE)})]})}function ke({automation:e}){let{t}=s(`openhands`),n=e.trigger.type===`event`,r=e.trigger.schedule??``;e.trigger.schedule_human&&(r=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let i=t(n?c.AUTOMATIONS$DETAIL$TRIGGER_EVENT:c.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,V.jsx)(W,{icon:(0,V.jsx)(we,{className:`size-4`}),title:t(c.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,V.jsx)(q,{icon:(0,V.jsx)(Te,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,V.jsx)(De,{branch:e.branch})]})}),(0,V.jsx)(q,{icon:(0,V.jsx)(G,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,V.jsx)(q,{icon:(0,V.jsx)(K,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,V.jsx)(q,{icon:(0,V.jsx)(me,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,V.jsx)(q,{icon:(0,V.jsx)(N,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$EVENT_TYPE),children:I(e.trigger.on)}),n&&e.trigger.filter&&(0,V.jsx)(q,{icon:(0,V.jsx)(M,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,V.jsx)(Oe,{filter:e.trigger.filter})}),(0,V.jsx)(q,{icon:(0,V.jsx)(L,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$MODEL),children:e.model??t(c.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,V.jsx)(q,{icon:(0,V.jsx)(Ee,{className:`size-3.5`}),label:t(c.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var Ae=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function je({name:e}){return(0,V.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function Me({plugins:e}){let{t}=s(`openhands`);return(0,V.jsx)(W,{icon:(0,V.jsx)(Ae,{className:`size-4`}),title:t(c.AUTOMATIONS$DETAIL$PLUGINS),children:(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,V.jsx)(je,{name:e},e))})})}var Y=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function X(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function Ne(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?n(c.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(c.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(c.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):o===1?n(c.AUTOMATIONS$DETAIL$TIME_YESTERDAY):o<7?n(c.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:o}):X(e,t)}function Pe({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=s(`openhands`),i=r.language;return(0,V.jsx)(W,{icon:(0,V.jsx)(Y,{className:`size-4`}),title:n(c.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,V.jsx)(q,{icon:(0,V.jsx)(K,{className:`size-3.5`}),label:n(c.AUTOMATIONS$DETAIL$CREATED),children:X(e,i)}),(0,V.jsx)(q,{icon:(0,V.jsx)(R,{className:`size-3.5`}),label:n(c.AUTOMATIONS$DETAIL$LAST_RUN),children:t?Ne(t,i,n):n(c.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Fe=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),Ie={[z.COMPLETED]:{label:c.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[z.FAILED]:{label:c.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[z.PENDING]:{label:c.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[z.RUNNING]:{label:c.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function Le({status:e}){switch(e){case z.COMPLETED:return(0,V.jsx)(G,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case z.FAILED:return(0,V.jsx)(Fe,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,V.jsx)(R,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Re({status:e}){let{t}=s(`openhands`),n=Ie[e];return(0,V.jsxs)(`span`,{className:m(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,V.jsx)(Le,{status:e}),t(n.label)]})}var ze=20;function Be(e){return e.kind===`BashOutput`}var Ve=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<ze;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{Be(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=h().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),b({backend:r,method:`GET`,hostOverride:_(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new y(g({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},He=[`bash-command-logs`];function Ue(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function We(e){let t=a.isAxiosError(e)?e.response?.status:v(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(a.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function Ge(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=d(),a=k(r?t??null:null),s=a.data,c=s?.conversation_url??null,l=s?.session_api_key??null,u=i.backend.kind===`cloud`,f=a.isFetched,p=null,m=!1;u&&f&&(s?p=Ue(s.sandbox_status)??(s.conversation_url?null:`missing`):m=!0);let h=r&&!!n&&(u?!!c:!0)&&!p&&!m,g=o({queryKey:[...He,n,c,l,i.backend.id,i.orgId],queryFn:()=>Ve.listOutputs(c,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?We(g.error):null,v=p??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:m,sandboxIssue:v}}var Ke=4e3;function qe(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function Je({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?qe(a,Ke):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
2
2
  `)}function Ye({run:e,automation:t,stderr:n}){let{t:r}=s(`openhands`),{navigate:i}=C(),a=E();return(0,V.jsx)(S,{testId:`debug-automation-button`,type:`button`,variant:`primary`,onClick:()=>{if(a.isPending)return;let r=Je({automationName:t?.name,automationPrompt:t?.prompt,errorDetail:e.error_detail,stderr:n,runId:e.id});a.mutate({query:r},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},isDisabled:a.isPending,"aria-busy":a.isPending,children:r(c.AUTOMATIONS$DETAIL$DEBUG_WITH_OPENHANDS)})}var Xe={missing:c.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:c.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:c.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:c.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:c.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function Z(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function Ze({conversationId:e,bashCommandId:t,isOpen:n,onClose:r,run:i,automation:a}){let{t:o}=s(`openhands`),[l,u]=(0,B.useState)(`stdout`),{data:d,isFetching:f,isResolvingConversation:p,sandboxIssue:h,conversationMissing:g,error:_}=Ge({conversationId:e,bashCommandId:t,enabled:n});(0,B.useEffect)(()=>{n&&u(`stdout`)},[n,t]),(0,B.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:v,stderr:y}=(0,B.useMemo)(()=>d?{stdout:Z(d,`stdout`),stderr:Z(d,`stderr`)}:{stdout:``,stderr:``},[d]);if(!n)return null;let b=p||f&&!d,S=!t,C=l===`stdout`?v:y,w=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,T=`border-[var(--oh-primary)] text-white`,E=`border-transparent text-muted hover:text-content`;return(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":o(c.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,V.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,V.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":o(c.AUTOMATIONS$CANCEL),children:(0,V.jsx)(j,{className:`size-5`})}),(0,V.jsx)(`h2`,{className:m(`pr-8`,x),children:o(c.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,V.jsxs)(`div`,{role:`tablist`,"aria-label":o(c.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,V.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:l===`stdout`?0:-1,onClick:()=>u(`stdout`),className:`${w} ${l===`stdout`?T:E}`,children:o(c.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,V.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":l===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:l===`stderr`?0:-1,onClick:()=>u(`stderr`),className:`${w} ${l===`stderr`?T:E}`,children:o(c.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,V.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${l}`,"aria-labelledby":`run-logs-tab-${l}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[S&&(0,V.jsx)(`p`,{className:`text-muted italic`,children:o(c.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!S&&g&&(0,V.jsx)(`p`,{className:`text-muted italic`,children:o(c.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!S&&!g&&h&&(0,V.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${h}`,className:`text-muted italic`,children:o(Xe[h])}),!S&&!g&&!h&&b&&(0,V.jsx)(`p`,{className:`text-muted italic`,children:o(c.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!S&&!g&&!h&&!b&&_&&!d&&(0,V.jsxs)(`p`,{className:`text-danger`,children:[o(c.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(_)]}),!b&&!h&&d&&(0,V.jsx)(`pre`,{"data-testid":`run-logs-output-${l}`,className:`whitespace-pre-wrap break-words ${l===`stderr`?`text-danger`:`text-content`}`,children:C.length>0?C:(0,V.jsx)(`span`,{className:`text-muted italic`,children:o(c.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]}),i?.status===z.FAILED&&(0,V.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,V.jsx)(Ye,{run:i,automation:a,stderr:y})})]})]})}function Qe(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function $e(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function et(e){return`/conversations/${e}`}function tt({run:e,automation:t}){let{t:n,i18n:r}=s(`openhands`),i=!!e.conversation_id,a=!!e.bash_command_id,o=e.status===z.COMPLETED||e.status===z.FAILED,l=!i&&o,[u,d]=(0,B.useState)(!1),[f]=(0,B.useState)(()=>new Date().toISOString()),p=Qe($e(e.started_at)?f:e.started_at,r.language),m=a?(0,V.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),d(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":n(c.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:p}),title:n(c.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,V.jsx)(O,{className:`size-4`})}):null,h=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-content`,children:p}),l&&(0,V.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,n(c.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,(0,V.jsx)(Re,{status:e.status})]})]});return(0,V.jsxs)(V.Fragment,{children:[i&&e.conversation_id?(0,V.jsx)(`a`,{href:et(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":`View conversation for run at ${p}`,children:h}):(0,V.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:h}),a&&(0,V.jsx)(Ze,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:u,onClose:()=>d(!1),run:e,automation:t})]})}var Q=20;function nt({automation:e}){let{t}=s(`openhands`),[n,r]=(0,B.useState)(Q),{data:i,isLoading:a}=P({id:e.id,limit:n,offset:0}),o=i?i.total>i.runs.length:!1;return(0,V.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,V.jsx)(`span`,{className:`size-4 text-muted`,children:(0,V.jsx)(Y,{className:`size-4`})}),(0,V.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(c.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),a&&(0,V.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,V.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!a&&i?.runs.length===0&&(0,V.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(c.AUTOMATIONS$DETAIL$NO_RUNS)}),!a&&i&&i.runs.length>0&&(0,V.jsxs)(`div`,{children:[i.runs.map((t,n)=>(0,V.jsx)(`div`,{className:n>0?`border-t border-[var(--oh-border)]`:``,children:(0,V.jsx)(tt,{run:t,automation:e})},t.id)),o&&(0,V.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,V.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+Q),className:`text-sm text-muted hover:text-foreground`,children:t(c.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function $({className:e}){return(0,V.jsx)(`div`,{className:m(`animate-pulse rounded bg-surface-raised`,e)})}function rt(){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,V.jsx)($,{className:`h-5 w-40`}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)($,{className:`h-6 w-48`}),(0,V.jsx)($,{className:`h-6 w-16 rounded-full`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)($,{className:`h-6 w-11 rounded-full`}),(0,V.jsx)($,{className:`h-8 w-8`})]})]}),(0,V.jsx)($,{className:`h-5 w-96`}),(0,V.jsx)($,{className:`h-36 w-full rounded-2xl`}),(0,V.jsx)($,{className:`h-72 w-full rounded-2xl`}),(0,V.jsx)($,{className:`h-32 w-full rounded-2xl`}),(0,V.jsx)($,{className:`h-40 w-full rounded-2xl`})]})}function it(){let{t:e}=s(`openhands`);return(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,V.jsx)(se,{className:`size-12 text-muted`}),(0,V.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(c.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(c.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,V.jsx)(`div`,{className:`mt-6`,children:(0,V.jsx)(H,{})})]})}var at=r(function(){let{t:e}=s(`openhands`),{automationId:t}=i(),{navigate:n}=C(),[r,a]=(0,B.useState)(!1),[o,f]=(0,B.useState)(!1),{data:m,isLoading:h,refetch:g}=oe(),_=m?.status===`ok`,v=d(),y=(0,B.useRef)(v.backend.id).current!==v.backend.id,{data:b,isLoading:x,isError:S,error:E,refetch:D}=te({id:t??``,enabled:_&&!y}),{trackPrebuiltAutomationEnabled:O,trackAutomationExported:k}=T(),A=ie(),j=re(),M=ee(),N=S&&w(E)===404;if(h)return(0,V.jsx)(`div`,{className:`min-h-full`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,V.jsx)(rt,{})})});if(!_)return(0,V.jsx)(`div`,{className:`min-h-full`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,V.jsx)(pe,{onRetry:g})})});if(x)return(0,V.jsx)(`div`,{className:`min-h-full`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,V.jsx)(rt,{})})});if(N)return(0,V.jsx)(`div`,{className:`min-h-full`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,V.jsx)(it,{})})});if(S||!b)return(0,V.jsx)(`div`,{className:`min-h-full`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,V.jsx)(ge,{onRetry:()=>D()})})});let P=()=>{let e=!b.enabled;A.mutate({id:b.id,enabled:e}),e&&O({automationId:b.id,automationName:b.name})},F=()=>{j.mutate(b.id,{onSuccess:()=>{n?.(`/automations`)}})},se=()=>{M.mutate(b.id,{onSuccess:()=>{l(e(c.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{u(de(t,e(c.AUTOMATIONS$RUN_NOW_ERROR)))}})},I=()=>{let e=`${JSON.stringify(he(b),null,2)}\n`;p(new Blob([e],{type:`application/json`}),_e(b)),k({backendKind:v.backend.kind})},L=v.backend.kind===`local`;return(0,V.jsx)(`div`,{className:`min-h-full`,children:(0,V.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsx)(H,{}),(0,V.jsx)(be,{automation:b,onToggle:P,onEdit:L?()=>f(!0):void 0,onDelete:()=>a(!0),onExport:I,onDownloadTarball:()=>ne.downloadTarball(b.id,b.name),onRunNow:se,isRunningNow:M.isPending}),b.prompt&&(0,V.jsx)(Ce,{prompt:b.prompt}),(0,V.jsx)(ke,{automation:b}),b.plugins&&b.plugins.length>0&&(0,V.jsx)(Me,{plugins:b.plugins}),(0,V.jsx)(Pe,{createdAt:b.created_at,lastRunAt:b.last_triggered_at}),(0,V.jsx)(nt,{automation:b}),(0,V.jsx)(ae,{automationName:b.name,isOpen:r,onConfirm:F,onCancel:()=>a(!1)}),L&&(0,V.jsx)(ue,{automation:b,isOpen:o,onClose:()=>f(!1)})]})})})});export{at as default};