@openhands/agent-canvas 1.2.0 → 1.2.1

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 (125) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{active-backend-context-DRFevVIj.js → active-backend-context-u2tdYRgH.js} +1 -1
  4. package/build/assets/{add-backend-modal-DzuB9zlG.js → add-backend-modal-DIEyAkA4.js} +1 -1
  5. package/build/assets/{agent-profiles-settings-BfAwTshW.js → agent-profiles-settings-BovdV4N8.js} +1 -1
  6. package/build/assets/{agent-server-conversation-service.api-DfH2k6Sx.js → agent-server-conversation-service.api-BP73yONA.js} +1 -1
  7. package/build/assets/agent-settings-FGL3Yvkp.js +1 -0
  8. package/build/assets/{agent-settings-DjVlKgaP.js → agent-settings-Ofbh6UTD.js} +1 -1
  9. package/build/assets/{api-key-entry-screen-O8gS-fnF.js → api-key-entry-screen-CZIdRmUJ.js} +1 -1
  10. package/build/assets/{app-settings-SlZvaXlk.js → app-settings-BHJ9nKti.js} +1 -1
  11. package/build/assets/{automation-detail-CwsNJ9AM.js → automation-detail-DwYGzLkp.js} +1 -1
  12. package/build/assets/{automations-list-B9cPtugh.js → automations-list-CuAfJmMW.js} +1 -1
  13. package/build/assets/{backend-form-modal-D2EDGVAc.js → backend-form-modal-BiaOB2C4.js} +1 -1
  14. package/build/assets/{backend-synced-settings-badge-6OCwIuLY.js → backend-synced-settings-badge-Bs3FSXsS.js} +1 -1
  15. package/build/assets/{color-themes-Dd1sO5U6.js → color-themes-DPBzNtVg.js} +3 -3
  16. package/build/assets/{condenser-settings-BhxvlfoY.js → condenser-settings-D_5vY4m3.js} +1 -1
  17. package/build/assets/conversation-DnVC6vRV.js +1 -0
  18. package/build/assets/conversation-panel-ZEz-z3az.js +1 -0
  19. package/build/assets/{conversation-service.api-Ch9kR9aE.js → conversation-service.api-CqZcHr1c.js} +1 -1
  20. package/build/assets/{conversation-B8prFAZF.js → conversation-xkBS3AHC.js} +3 -3
  21. package/build/assets/{edit-automation-modal-BoibW8cd.js → edit-automation-modal-B6U96gVV.js} +1 -1
  22. package/build/assets/{entry.client-BgWj9jL_.js → entry.client-Dy--3GeA.js} +1 -1
  23. package/build/assets/{extensions-hub-MtC8lK3A.js → extensions-hub-CksKNpP9.js} +1 -1
  24. package/build/assets/{extensions-navigation-BtV14oQL.js → extensions-navigation-Di9rJ-b5.js} +1 -1
  25. package/build/assets/{files-tab-DHqtsKLy.js → files-tab-61Vaihc6.js} +1 -1
  26. package/build/assets/{git-provider-icon-CGU7_KiU.js → git-provider-icon-aQRcUVI-.js} +1 -1
  27. package/build/assets/{home-BgjWP_UN.js → home-5gOtUe-n.js} +1 -1
  28. package/build/assets/{install-server-modal-J_eQ6lhG.js → install-server-modal-BRab9inF.js} +1 -1
  29. package/build/assets/{launch-DamfAY5L.js → launch-1TJRKkkX.js} +1 -1
  30. package/build/assets/{lesson-plan-HD886V64.js → lesson-plan-BtrZUCuj.js} +1 -1
  31. package/build/assets/{llm-not-configured-banner-DTrLsVr_.js → llm-not-configured-banner-BrU5uHto.js} +1 -1
  32. package/build/assets/{llm-settings-BgSFkbHC.js → llm-settings-BpdU51Jo.js} +1 -1
  33. package/build/assets/llm-settings-DsInf6yD.js +1 -0
  34. package/build/assets/{manage-backends-modal-BUzj5_Lq.js → manage-backends-modal-BREySP-J.js} +1 -1
  35. package/build/assets/{manifest-4d6a1552.js → manifest-a5bb7568.js} +1 -1
  36. package/build/assets/{mcp-DvqJYDbz.js → mcp-XXf8k6mb.js} +1 -1
  37. package/build/assets/{messages-C4KEFkPk.js → messages-D2oZb47Z.js} +1 -1
  38. package/build/assets/{onboarding-gGIqoxvA.js → onboarding-D32kiGME.js} +1 -1
  39. package/build/assets/{onboarding-modal-CGHPoMp7.js → onboarding-modal-C084vkv7.js} +1 -1
  40. package/build/assets/{option-service.api-Dz7Eomnx.js → option-service.api-Cl5VLGyw.js} +1 -1
  41. package/build/assets/{path-utils-CBaRYg35.js → path-utils-BeOmjIcE.js} +1 -1
  42. package/build/assets/{planner-tab-G4j36bJk.js → planner-tab-AZMjJx31.js} +1 -1
  43. package/build/assets/{providers-CPoq0VXm.js → providers-vX9jk9Vy.js} +1 -1
  44. package/build/assets/recommended-automations-launcher-Bk8tQ-Cn.js +58 -0
  45. package/build/assets/{root-layout-CvxdHJ6j.js → root-layout-CoWw4kpz.js} +2 -2
  46. package/build/assets/{root-S6CfVoNm.js → root-tuEPDx-i.js} +2 -2
  47. package/build/assets/{schema-field-DwUzlw6b.js → schema-field-nvq_Juo2.js} +1 -1
  48. package/build/assets/{sdk-section-page-BUXONTx6.js → sdk-section-page-CgT70FaZ.js} +1 -1
  49. package/build/assets/{secrets-settings-ZxyfRBgx.js → secrets-settings-BCxk9p9s.js} +1 -1
  50. package/build/assets/{settings-Bx6vn-g8.js → settings-CedTdtb5.js} +1 -1
  51. package/build/assets/{settings-index-D4SM26d5.js → settings-index-Cct3PJSP.js} +1 -1
  52. package/build/assets/{settings-modal-BoC8oMlg.js → settings-modal-DwLybV_O.js} +1 -1
  53. package/build/assets/{shared-conversation-DMiaQFsj.js → shared-conversation-DnDwfLgg.js} +1 -1
  54. package/build/assets/{sidebar-mobile-menu-toggle-CaV3tQFF.js → sidebar-mobile-menu-toggle-B8k3qu84.js} +1 -1
  55. package/build/assets/{skills-plugins-D2WkrXkr.js → skills-plugins-B68ay6Pu.js} +1 -1
  56. package/build/assets/{skills-settings-CZGVOp_t.js → skills-settings-A6sUy0T7.js} +1 -1
  57. package/build/assets/{terminal-B0aL_iDZ.js → terminal-BmT0_gIH.js} +1 -1
  58. package/build/assets/{use-acp-credential-form-rzaqkJ1n.js → use-acp-credential-form-Bs6s0DTU.js} +1 -1
  59. package/build/assets/{use-activate-agent-profile-DY0txItX.js → use-activate-agent-profile-CKtTToSx.js} +1 -1
  60. package/build/assets/{use-active-agent-profile-Cp5AFONR.js → use-active-agent-profile-CWLPpOtK.js} +1 -1
  61. package/build/assets/{use-active-conversation-DvcFBqFe.js → use-active-conversation-DI5S5M1w.js} +1 -1
  62. package/build/assets/{use-agent-profiles-DnH16_Vm.js → use-agent-profiles-DPcaYLpm.js} +1 -1
  63. package/build/assets/{use-agent-state-BvRcEzY4.js → use-agent-state-Buh3bQDh.js} +1 -1
  64. package/build/assets/{use-backends-health-e-Ull4wz.js → use-backends-health-CxkvJy2N.js} +1 -1
  65. package/build/assets/{use-can-manage-org-profiles-OIhplvQ0.js → use-can-manage-org-profiles-DeX2Mfje.js} +1 -1
  66. package/build/assets/{use-cloud-current-user-id-ekU7UXDT.js → use-cloud-current-user-id-D_PQGfmT.js} +1 -1
  67. package/build/assets/{use-config-Dwf5gla-.js → use-config-ur0RbjCP.js} +1 -1
  68. package/build/assets/{use-create-conversation-CvAXfA3T.js → use-create-conversation-D9OWYcte.js} +1 -1
  69. package/build/assets/{use-create-secret-BKeXCo__.js → use-create-secret-CVFSlhlR.js} +1 -1
  70. package/build/assets/{use-handle-plan-click-cAXS-Hft.js → use-handle-plan-click-Dug8egQl.js} +1 -1
  71. package/build/assets/{use-llm-profiles-BcLibtGb.js → use-llm-profiles-DjackuP1.js} +1 -1
  72. package/build/assets/use-runtime-is-ready-Diiq65Q-.js +1 -0
  73. package/build/assets/{use-save-agent-profile-DFjxHhNx.js → use-save-agent-profile-aKKLqDJM.js} +1 -1
  74. package/build/assets/{use-save-settings-5xPYpSQM.js → use-save-settings-CChDyjOB.js} +1 -1
  75. package/build/assets/{use-settings-B07msZ2Z.js → use-settings-dX4fKUPF.js} +1 -1
  76. package/build/assets/{use-settings-nav-items-CswsOEyw.js → use-settings-nav-items-D6pHnvxg.js} +1 -1
  77. package/build/assets/{use-skills-Aoaoq_ei.js → use-skills-Dqo-pDDx.js} +1 -1
  78. package/build/assets/{use-tracking-CqODdfO4.js → use-tracking-GtXCHmTv.js} +1 -1
  79. package/build/assets/{use-user-conversation-BPHQ-dm-.js → use-user-conversation-6uOXFP95.js} +1 -1
  80. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-DJHl5b-B.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js} +267 -27
  81. package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js +1 -0
  82. package/build/assets/{verification-settings-DZQ-JvKH.js → verification-settings-D_zsNB_c.js} +1 -1
  83. package/build/index.html +4 -4
  84. package/config/defaults.json +1 -1
  85. package/dist/config/defaults.cjs +1 -1
  86. package/dist/config/defaults.cjs.map +1 -1
  87. package/dist/config/defaults.js +1 -1
  88. package/dist/config/defaults.js.map +1 -1
  89. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs +1 -1
  90. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -1
  91. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js +70 -3
  92. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -1
  93. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  94. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  95. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +27 -2
  96. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  97. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs +2 -0
  98. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs.map +1 -0
  99. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js +33 -0
  100. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js.map +1 -0
  101. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  102. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  103. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +48 -46
  104. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  105. package/dist/node_modules/@openhands/extensions/skills/index.cjs +267 -27
  106. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  107. package/dist/node_modules/@openhands/extensions/skills/index.js +36 -30
  108. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  109. package/dist/package.cjs +1 -1
  110. package/dist/package.cjs.map +1 -1
  111. package/dist/package.js +2 -2
  112. package/dist/package.js.map +1 -1
  113. package/dist/themes/color-themes.cjs +3 -3
  114. package/dist/themes/color-themes.cjs.map +1 -1
  115. package/dist/themes/color-themes.d.ts +13 -2
  116. package/dist/themes/color-themes.js +2 -2
  117. package/dist/themes/color-themes.js.map +1 -1
  118. package/package.json +2 -2
  119. package/build/assets/agent-settings-CMMms-0q.js +0 -1
  120. package/build/assets/conversation-DGVDwGn8.js +0 -1
  121. package/build/assets/conversation-panel-C7DC4Cxx.js +0 -1
  122. package/build/assets/llm-settings-Bkc8C5Bi.js +0 -1
  123. package/build/assets/recommended-automations-launcher-CXaEK1rW.js +0 -50
  124. package/build/assets/use-runtime-is-ready-CBFe69Ew.js +0 -1
  125. package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-L2sdihTY.js +0 -1
@@ -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"./useQuery-CpjHYtZc.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{n as a}from"./active-backend-context-DRFevVIj.js";import{t as o}from"./utils-CE0lDWtb.js";import{p as s}from"./agent-server-client-options-DVLRd9sw.js";import{h as c,l}from"./form-control-classes-9rkU4usZ.js";import{n as u,t as d}from"./settings-input-DYs7t3oK.js";import{t as f}from"./settings-service.api-DldkFI1x.js";import{i as p}from"./llm-subscription-DtsX5Lhg.js";import{t as m}from"./use-is-authed-_dhQ2Xuj.js";import{f as h,g,h as _,m as v,p as y}from"./sdk-settings-schema-BjBkMHzZ.js";import{t as b}from"./settings-dropdown-input-xzoZwgUe.js";import{r as x}from"./typography-YGPBGzOG.js";import{t as S}from"./settings-switch-C2N2xqEb.js";var C=e(t(),1),w=`llm`;function T(e){if(!e?.sections)return e;let t=!1,n=e.sections.map(e=>{if(e.key!==w)return e;let n=new Set(e.fields.map(e=>e.key)),r=p.filter(e=>!n.has(e.key));return r.length===0?e:(t=!0,{...e,fields:[...e.fields,...r]})});return t?{...e,sections:n}:e}var E=(e,t)=>{let{data:n}=m(),{backend:i,orgId:o}=a(),c=!s(i),{data:l,error:u,isLoading:d,isFetching:p}=r({queryKey:[`settings-schema`,e,i.id,o,i.kind,i.host,i.apiKey],queryFn:e===`conversation`?f.getConversationSettingsSchema:f.getSettingsSchema,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,enabled:!t&&!!n&&c,meta:{disableToast:!0}}),h=(0,C.useMemo)(()=>e===`agent`?T(t):t,[t,e]),g=(0,C.useMemo)(()=>e===`agent`?T(l):l,[l,e]);return t?{data:h,error:null,isLoading:!1,isFetching:!1}:{data:g,error:u,isLoading:d,isFetching:p}},D=e=>E(`agent`,e),O=e=>E(`conversation`,e),k=n(),A={"llm.api_key":{textKey:`SCHEMA$LLM$API_KEY$HELP_TEXT`,linkTextKey:`SCHEMA$LLM$API_KEY$HELP_LINK_TEXT`,href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`},"verification.critic_api_key":{textKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_TEXT`,linkTextKey:`SETTINGS$NAV_API_KEYS`,suffixKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_SUFFIX`,href:`https://app.all-hands.dev/settings/api-keys`,hideDescription:!0}};function j({field:e}){let{t}=i(`openhands`),n=A[e.key],r=v(t,e.key,e.description);return(0,k.jsxs)(k.Fragment,{children:[r&&!n?.hideDescription?(0,k.jsx)(x.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,k.jsx)(g,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,suffix:n.suffixKey?` ${t(n.suffixKey)}`:void 0,size:`settings`,linkColor:`white`}):null]})}var M=new Set([`verification.critic_api_key`]);function N(e){return e.choices.length>0}function P(e){return e.value_type===`boolean`&&!N(e)}function F(e){return e.value_type===`array`||e.value_type===`object`}function I(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function L(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&I(e)?`url`:`text`}function R({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),s=_(a,e.key,e.label),f=h(e.key);return P(e)?(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(S,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:s}),(0,k.jsx)(`div`,{className:c,children:(0,k.jsx)(j,{field:e})})]}):N(e)?(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(b,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,items:e.choices.map(t=>({key:String(t.value),label:y(a,e.key,t.value,t.label)})),selectedKey:t===``?void 0:String(t),isClearable:!e.required,required:e.required,showOptionalTag:!e.required,isDisabled:n,onSelectionChange:e=>r(String(e??``))}),(0,k.jsx)(j,{field:e})]}):F(e)?(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:s}),e.required?null:(0,k.jsx)(u,{})]}),(0,k.jsx)(`textarea`,{"data-testid":`sdk-settings-${e.key}`,name:e.key,value:String(t??``),required:e.required,disabled:n,onChange:e=>r(e.target.value),className:o(l,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,k.jsx)(j,{field:e})]}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(d,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,type:L(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:f?.min,max:f?.max,step:f?.step}),(0,k.jsx)(j,{field:e})]})}export{O as i,R as n,D as r,M as t};
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"./useQuery-CpjHYtZc.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{n as a}from"./active-backend-context-u2tdYRgH.js";import{t as o}from"./utils-CE0lDWtb.js";import{p as s}from"./agent-server-client-options-DVLRd9sw.js";import{h as c,l}from"./form-control-classes-9rkU4usZ.js";import{n as u,t as d}from"./settings-input-DYs7t3oK.js";import{t as f}from"./settings-service.api-DldkFI1x.js";import{i as p}from"./llm-subscription-DtsX5Lhg.js";import{t as m}from"./use-is-authed-_dhQ2Xuj.js";import{f as h,g,h as _,m as v,p as y}from"./sdk-settings-schema-BjBkMHzZ.js";import{t as b}from"./settings-dropdown-input-xzoZwgUe.js";import{r as x}from"./typography-YGPBGzOG.js";import{t as S}from"./settings-switch-C2N2xqEb.js";var C=e(t(),1),w=`llm`;function T(e){if(!e?.sections)return e;let t=!1,n=e.sections.map(e=>{if(e.key!==w)return e;let n=new Set(e.fields.map(e=>e.key)),r=p.filter(e=>!n.has(e.key));return r.length===0?e:(t=!0,{...e,fields:[...e.fields,...r]})});return t?{...e,sections:n}:e}var E=(e,t)=>{let{data:n}=m(),{backend:i,orgId:o}=a(),c=!s(i),{data:l,error:u,isLoading:d,isFetching:p}=r({queryKey:[`settings-schema`,e,i.id,o,i.kind,i.host,i.apiKey],queryFn:e===`conversation`?f.getConversationSettingsSchema:f.getSettingsSchema,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,enabled:!t&&!!n&&c,meta:{disableToast:!0}}),h=(0,C.useMemo)(()=>e===`agent`?T(t):t,[t,e]),g=(0,C.useMemo)(()=>e===`agent`?T(l):l,[l,e]);return t?{data:h,error:null,isLoading:!1,isFetching:!1}:{data:g,error:u,isLoading:d,isFetching:p}},D=e=>E(`agent`,e),O=e=>E(`conversation`,e),k=n(),A={"llm.api_key":{textKey:`SCHEMA$LLM$API_KEY$HELP_TEXT`,linkTextKey:`SCHEMA$LLM$API_KEY$HELP_LINK_TEXT`,href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`},"verification.critic_api_key":{textKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_TEXT`,linkTextKey:`SETTINGS$NAV_API_KEYS`,suffixKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_SUFFIX`,href:`https://app.all-hands.dev/settings/api-keys`,hideDescription:!0}};function j({field:e}){let{t}=i(`openhands`),n=A[e.key],r=v(t,e.key,e.description);return(0,k.jsxs)(k.Fragment,{children:[r&&!n?.hideDescription?(0,k.jsx)(x.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,k.jsx)(g,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,suffix:n.suffixKey?` ${t(n.suffixKey)}`:void 0,size:`settings`,linkColor:`white`}):null]})}var M=new Set([`verification.critic_api_key`]);function N(e){return e.choices.length>0}function P(e){return e.value_type===`boolean`&&!N(e)}function F(e){return e.value_type===`array`||e.value_type===`object`}function I(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function L(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&I(e)?`url`:`text`}function R({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),s=_(a,e.key,e.label),f=h(e.key);return P(e)?(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(S,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:s}),(0,k.jsx)(`div`,{className:c,children:(0,k.jsx)(j,{field:e})})]}):N(e)?(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(b,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,items:e.choices.map(t=>({key:String(t.value),label:y(a,e.key,t.value,t.label)})),selectedKey:t===``?void 0:String(t),isClearable:!e.required,required:e.required,showOptionalTag:!e.required,isDisabled:n,onSelectionChange:e=>r(String(e??``))}),(0,k.jsx)(j,{field:e})]}):F(e)?(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:s}),e.required?null:(0,k.jsx)(u,{})]}),(0,k.jsx)(`textarea`,{"data-testid":`sdk-settings-${e.key}`,name:e.key,value:String(t??``),required:e.required,disabled:n,onChange:e=>r(e.target.value),className:o(l,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,k.jsx)(j,{field:e})]}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(d,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,type:L(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:f?.min,max:f?.max,step:f?.step}),(0,k.jsx)(j,{field:e})]})}export{O as i,R as n,D as r,M as t};
@@ -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-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{v as a}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{A as o,N as s,j as ee}from"./active-backend-context-DRFevVIj.js";import{t as c}from"./utils-CE0lDWtb.js";import{_ as l}from"./form-control-classes-9rkU4usZ.js";import{t as te}from"./brand-button-DKPMEKcW.js";import{r as ne}from"./use-settings-B07msZ2Z.js";import{t as re}from"./use-save-settings-5xPYpSQM.js";import{c as ie,l as ae,n as oe,o as se,r as u,s as d,t as f,u as ce}from"./sdk-settings-schema-BjBkMHzZ.js";import{i as le,n as ue,r as p,t as de}from"./schema-field-DwUzlw6b.js";import{n as m,t as h}from"./switch-skeleton-DqQwalyu.js";import{o as fe}from"./extension-module-card-classes-9V3J9J_b.js";var g=e(t(),1),_=n();function v(){return(0,_.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function y(){return(0,_.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,_.jsx)(h,{}),(0,_.jsx)(m,{}),(0,_.jsx)(m,{}),(0,_.jsx)(m,{}),(0,_.jsx)(v,{}),(0,_.jsx)(h,{}),(0,_.jsx)(h,{}),(0,_.jsx)(m,{})]})}var b=(e,t)=>c(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,l,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function pe({view:e,setView:t,showAdvanced:n,showAll:a,isDisabled:o=!1}){let{t:s}=r(`openhands`);return!n&&!a?null:(0,_.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[(0,_.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:b(e===`basic`,o),onClick:()=>t(`basic`),children:s(i.SETTINGS$BASIC)}),n?(0,_.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:b(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(i.SETTINGS$ADVANCED)}):null,a?(0,_.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:b(e===`all`,o),onClick:()=>t(`all`),children:s(i.SETTINGS$ALL)}):null]})}var me=new Set,x={basic:0,advanced:1,all:2},he=(e,t)=>x[t]<x[e]?t:e,ge=(e,t)=>x[t]>x[e]?t:e,_e=(e,{showAdvanced:t,showAll:n})=>e===`all`?n?`all`:t?`advanced`:`basic`:e===`advanced`?t?`advanced`:n?`all`:`basic`:`basic`,ve={agent_settings:`agent_settings_diff`,conversation_settings:`conversation_settings_diff`},ye=(e,t)=>e instanceof a?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function S({settingsSources:e,scope:t=`personal`,header:n,extraDirty:a=!1,buildPayload:c,onSaveSuccess:l,getInitialView:m,forceShowAdvancedView:h=!1,allowAllView:v=!0,initialValueOverrides:b,embedded:x=!1,hideSaveButton:S=!1,suppressSuccessToast:be=!1,onSaveControlChange:C,testId:xe=`sdk-section-settings-screen`}){let{t:w}=r(`openhands`),{mutate:Se,isPending:T}=re(t),{data:E,isLoading:Ce,isFetching:D}=ne(t),O=p(E?.agent_settings_schema),k=le(E?.conversation_settings_schema),A=g.useMemo(()=>JSON.stringify(e.map(e=>({source:e.settingsSource,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?Array.from(e.excludeKeys).sort():null}))),[e]),j=g.useMemo(()=>JSON.parse(A).map(e=>({settingsSource:e.source,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?new Set(e.excludeKeys):void 0})),[A]),M=g.useCallback(e=>e===`conversation_settings`?k.data:O.data,[O.data,k.data]),we=j.some(e=>e.settingsSource===`conversation_settings`?k.isLoading:O.isLoading),N=g.useMemo(()=>j.map(e=>{let t=M(e.settingsSource);if(!ce(t))return{...e,filteredSchema:null};let n=new Set(e.sectionKeys),r={...t,sections:t.sections.filter(e=>n.has(e.key))};return{...e,filteredSchema:r}}),[j,M]),P=h||N.some(e=>d(e.filteredSchema)),F=v&&N.some(e=>ie(e.filteredSchema)),Te=g.useMemo(()=>ye(j.reduce((e,t)=>e??(t.settingsSource===`conversation_settings`?k.error:O.error),null),w(i.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[j,O.error,k.error,w]),Ee=g.useMemo(()=>b?JSON.stringify(b):``,[b]),[I,L]=g.useState(`basic`),[R,z]=g.useState({}),[B,V]=g.useState({}),H=g.useRef(!1),U=g.useMemo(()=>{if(!E)return null;let e={};for(let t of N){if(!t.filteredSchema)return null;e[t.settingsSource]={...e[t.settingsSource]??{},...f(E,t.filteredSchema,t.settingsSource)}}if(b){let t=N[0]?.settingsSource;t&&e[t]&&(e[t]={...e[t],...b})}return e},[E,N,Ee]),W=g.useMemo(()=>{if(!E)return null;let e=null;for(let t of N){if(!t.filteredSchema)return null;let n=m?m(E,t.filteredSchema):ae(E,t.filteredSchema,t.settingsSource);e=e?ge(e,n):n}return e?_e(e,{showAdvanced:P,showAll:F}):null},[E,N,m,P,F]);g.useEffect(()=>{H.current=!1,L(`basic`),z({}),V({})},[t,A]),g.useEffect(()=>{if(!(!U||!W)){if(z(U),b){let e=N[0]?.settingsSource;if(e){let t=Object.fromEntries(Object.keys(b).map(e=>[e,!0]));V({[e]:t})}else V({})}else V({});L(e=>H.current?he(e,W):(H.current=!0,W))}},[U,W]);let G=g.useMemo(()=>{let e=new Map;for(let t of N)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let r of n.fields)e.has(r.key)||e.set(r.key,t.settingsSource);return e},[N]),K=g.useMemo(()=>{let e={};for(let t of N)Object.assign(e,R[t.settingsSource]??{});return e},[N,R]),q=g.useMemo(()=>{let e={};for(let t of N)Object.assign(e,B[t.settingsSource]??{});return e},[N,B]),J=g.useCallback((e,t)=>{let n=G.get(e);n&&(z(r=>({...r,[n]:{...r[n]??{},[e]:t}})),V(t=>({...t,[n]:{...t[n]??{},[e]:!0}})))},[G]),De=g.useCallback(e=>{o(s(e)||w(i.ERROR$GENERIC))},[w]),Y=g.useRef(()=>{}),Oe=g.useCallback(()=>{Y.current()},[]),X=g.useRef(()=>({})),ke=g.useCallback(()=>X.current(),[]),Z=()=>{if(N.some(e=>!e.filteredSchema))return;let e;try{let t={};for(let e of N){let n=e.filteredSchema,r=u(n,R[e.settingsSource]??{},B[e.settingsSource]??{},I);if(Object.keys(r).length>0){let n=ve[e.settingsSource];t[n]={...t[n]??{},...r}}}e=c?c(t,{values:K,dirty:q,view:I}):t}catch(e){o(e instanceof Error?e.message:w(i.ERROR$GENERIC));return}Object.keys(e).length!==0&&Se(e,{onError:De,onSuccess:()=>{be||ee(w(i.SETTINGS$SAVED_WARNING)),V({}),l?.()}})};Y.current=Z,X.current=()=>{let e={};for(let t of N){if(!t.filteredSchema)continue;let n=R[t.settingsSource]??{},r=B[t.settingsSource]??{};Object.assign(e,oe(t.filteredSchema,n,r))}return e};let Q=Object.keys(q).length>0,$=Q||a;return g.useEffect(()=>{C&&C({save:Oe,isSaving:T,isDirty:$,values:K,view:I,getDirtyPayload:ke})},[T,$,K,I]),(Ce||D)&&!E||we?(0,_.jsx)(y,{}):N.some(e=>e.filteredSchema&&e.filteredSchema.sections.length>0)?Object.keys(K).length===0?(0,_.jsx)(y,{}):(0,_.jsxs)(`div`,{"data-testid":xe,className:x?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,_.jsx)(pe,{view:I,setView:L,showAdvanced:P,showAll:F,isDisabled:!1}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[n?.({values:K,isDisabled:!1,view:I,onChange:J}),N.map(e=>{if(!e.filteredSchema)return null;let t=R[e.settingsSource]??{};return se(e.filteredSchema,{...K,...t},I,e.excludeKeys??me).map(n=>(0,_.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,_.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:n.fields.map(e=>(0,_.jsx)(`div`,{className:de.has(e.key)?`xl:col-span-2`:void 0,children:(0,_.jsx)(ue,{field:e,value:t[e.key],isDisabled:!1,onChange:t=>J(e.key,t)})},e.key))})},`${e.settingsSource}:${n.key}`))}),S?null:(0,_.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,_.jsx)(te,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:T||!Q&&!a,onClick:Z,children:w(T?i.SETTINGS$SAVING:i.SETTINGS$SAVE_CHANGES)})})]})]}):(0,_.jsx)(`div`,{"data-testid":`sdk-schema-unavailable`,className:fe,children:(0,_.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:Te})})}export{S as t};
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-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{v as a}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{A as o,N as s,j as ee}from"./active-backend-context-u2tdYRgH.js";import{t as c}from"./utils-CE0lDWtb.js";import{_ as l}from"./form-control-classes-9rkU4usZ.js";import{t as te}from"./brand-button-DKPMEKcW.js";import{r as ne}from"./use-settings-dX4fKUPF.js";import{t as re}from"./use-save-settings-CChDyjOB.js";import{c as ie,l as ae,n as oe,o as se,r as u,s as d,t as f,u as ce}from"./sdk-settings-schema-BjBkMHzZ.js";import{i as le,n as ue,r as p,t as de}from"./schema-field-nvq_Juo2.js";import{n as m,t as h}from"./switch-skeleton-DqQwalyu.js";import{o as fe}from"./extension-module-card-classes-9V3J9J_b.js";var g=e(t(),1),_=n();function v(){return(0,_.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function y(){return(0,_.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,_.jsx)(h,{}),(0,_.jsx)(m,{}),(0,_.jsx)(m,{}),(0,_.jsx)(m,{}),(0,_.jsx)(v,{}),(0,_.jsx)(h,{}),(0,_.jsx)(h,{}),(0,_.jsx)(m,{})]})}var b=(e,t)=>c(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,l,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function pe({view:e,setView:t,showAdvanced:n,showAll:a,isDisabled:o=!1}){let{t:s}=r(`openhands`);return!n&&!a?null:(0,_.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[(0,_.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:b(e===`basic`,o),onClick:()=>t(`basic`),children:s(i.SETTINGS$BASIC)}),n?(0,_.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:b(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(i.SETTINGS$ADVANCED)}):null,a?(0,_.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:b(e===`all`,o),onClick:()=>t(`all`),children:s(i.SETTINGS$ALL)}):null]})}var me=new Set,x={basic:0,advanced:1,all:2},he=(e,t)=>x[t]<x[e]?t:e,ge=(e,t)=>x[t]>x[e]?t:e,_e=(e,{showAdvanced:t,showAll:n})=>e===`all`?n?`all`:t?`advanced`:`basic`:e===`advanced`?t?`advanced`:n?`all`:`basic`:`basic`,ve={agent_settings:`agent_settings_diff`,conversation_settings:`conversation_settings_diff`},ye=(e,t)=>e instanceof a?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function S({settingsSources:e,scope:t=`personal`,header:n,extraDirty:a=!1,buildPayload:c,onSaveSuccess:l,getInitialView:m,forceShowAdvancedView:h=!1,allowAllView:v=!0,initialValueOverrides:b,embedded:x=!1,hideSaveButton:S=!1,suppressSuccessToast:be=!1,onSaveControlChange:C,testId:xe=`sdk-section-settings-screen`}){let{t:w}=r(`openhands`),{mutate:Se,isPending:T}=re(t),{data:E,isLoading:Ce,isFetching:D}=ne(t),O=p(E?.agent_settings_schema),k=le(E?.conversation_settings_schema),A=g.useMemo(()=>JSON.stringify(e.map(e=>({source:e.settingsSource,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?Array.from(e.excludeKeys).sort():null}))),[e]),j=g.useMemo(()=>JSON.parse(A).map(e=>({settingsSource:e.source,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?new Set(e.excludeKeys):void 0})),[A]),M=g.useCallback(e=>e===`conversation_settings`?k.data:O.data,[O.data,k.data]),we=j.some(e=>e.settingsSource===`conversation_settings`?k.isLoading:O.isLoading),N=g.useMemo(()=>j.map(e=>{let t=M(e.settingsSource);if(!ce(t))return{...e,filteredSchema:null};let n=new Set(e.sectionKeys),r={...t,sections:t.sections.filter(e=>n.has(e.key))};return{...e,filteredSchema:r}}),[j,M]),P=h||N.some(e=>d(e.filteredSchema)),F=v&&N.some(e=>ie(e.filteredSchema)),Te=g.useMemo(()=>ye(j.reduce((e,t)=>e??(t.settingsSource===`conversation_settings`?k.error:O.error),null),w(i.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[j,O.error,k.error,w]),Ee=g.useMemo(()=>b?JSON.stringify(b):``,[b]),[I,L]=g.useState(`basic`),[R,z]=g.useState({}),[B,V]=g.useState({}),H=g.useRef(!1),U=g.useMemo(()=>{if(!E)return null;let e={};for(let t of N){if(!t.filteredSchema)return null;e[t.settingsSource]={...e[t.settingsSource]??{},...f(E,t.filteredSchema,t.settingsSource)}}if(b){let t=N[0]?.settingsSource;t&&e[t]&&(e[t]={...e[t],...b})}return e},[E,N,Ee]),W=g.useMemo(()=>{if(!E)return null;let e=null;for(let t of N){if(!t.filteredSchema)return null;let n=m?m(E,t.filteredSchema):ae(E,t.filteredSchema,t.settingsSource);e=e?ge(e,n):n}return e?_e(e,{showAdvanced:P,showAll:F}):null},[E,N,m,P,F]);g.useEffect(()=>{H.current=!1,L(`basic`),z({}),V({})},[t,A]),g.useEffect(()=>{if(!(!U||!W)){if(z(U),b){let e=N[0]?.settingsSource;if(e){let t=Object.fromEntries(Object.keys(b).map(e=>[e,!0]));V({[e]:t})}else V({})}else V({});L(e=>H.current?he(e,W):(H.current=!0,W))}},[U,W]);let G=g.useMemo(()=>{let e=new Map;for(let t of N)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let r of n.fields)e.has(r.key)||e.set(r.key,t.settingsSource);return e},[N]),K=g.useMemo(()=>{let e={};for(let t of N)Object.assign(e,R[t.settingsSource]??{});return e},[N,R]),q=g.useMemo(()=>{let e={};for(let t of N)Object.assign(e,B[t.settingsSource]??{});return e},[N,B]),J=g.useCallback((e,t)=>{let n=G.get(e);n&&(z(r=>({...r,[n]:{...r[n]??{},[e]:t}})),V(t=>({...t,[n]:{...t[n]??{},[e]:!0}})))},[G]),De=g.useCallback(e=>{o(s(e)||w(i.ERROR$GENERIC))},[w]),Y=g.useRef(()=>{}),Oe=g.useCallback(()=>{Y.current()},[]),X=g.useRef(()=>({})),ke=g.useCallback(()=>X.current(),[]),Z=()=>{if(N.some(e=>!e.filteredSchema))return;let e;try{let t={};for(let e of N){let n=e.filteredSchema,r=u(n,R[e.settingsSource]??{},B[e.settingsSource]??{},I);if(Object.keys(r).length>0){let n=ve[e.settingsSource];t[n]={...t[n]??{},...r}}}e=c?c(t,{values:K,dirty:q,view:I}):t}catch(e){o(e instanceof Error?e.message:w(i.ERROR$GENERIC));return}Object.keys(e).length!==0&&Se(e,{onError:De,onSuccess:()=>{be||ee(w(i.SETTINGS$SAVED_WARNING)),V({}),l?.()}})};Y.current=Z,X.current=()=>{let e={};for(let t of N){if(!t.filteredSchema)continue;let n=R[t.settingsSource]??{},r=B[t.settingsSource]??{};Object.assign(e,oe(t.filteredSchema,n,r))}return e};let Q=Object.keys(q).length>0,$=Q||a;return g.useEffect(()=>{C&&C({save:Oe,isSaving:T,isDirty:$,values:K,view:I,getDirtyPayload:ke})},[T,$,K,I]),(Ce||D)&&!E||we?(0,_.jsx)(y,{}):N.some(e=>e.filteredSchema&&e.filteredSchema.sections.length>0)?Object.keys(K).length===0?(0,_.jsx)(y,{}):(0,_.jsxs)(`div`,{"data-testid":xe,className:x?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,_.jsx)(pe,{view:I,setView:L,showAdvanced:P,showAll:F,isDisabled:!1}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[n?.({values:K,isDisabled:!1,view:I,onChange:J}),N.map(e=>{if(!e.filteredSchema)return null;let t=R[e.settingsSource]??{};return se(e.filteredSchema,{...K,...t},I,e.excludeKeys??me).map(n=>(0,_.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,_.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:n.fields.map(e=>(0,_.jsx)(`div`,{className:de.has(e.key)?`xl:col-span-2`:void 0,children:(0,_.jsx)(ue,{field:e,value:t[e.key],isDisabled:!1,onChange:t=>J(e.key,t)})},e.key))})},`${e.settingsSource}:${n.key}`))}),S?null:(0,_.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,_.jsx)(te,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:T||!Q&&!a,onClick:Z,children:w(T?i.SETTINGS$SAVING:i.SETTINGS$SAVE_CHANGES)})})]})]}):(0,_.jsx)(`div`,{"data-testid":`sdk-schema-unavailable`,className:fe,children:(0,_.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:Te})})}export{S as t};
@@ -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-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useTranslation-Cgy4JA_g.js";import{t as s}from"./declaration-B9kpCaYl.js";import{t as c}from"./back-nav-button-BYmxFxGt.js";import{t as l}from"./pencil-Dj2XjKmI.js";import{t as u}from"./trash-2-Be_7y3Mn.js";import{t as d}from"./utils-CE0lDWtb.js";import{f,l as p}from"./form-control-classes-9rkU4usZ.js";import{t as m}from"./brand-button-DKPMEKcW.js";import{t as h}from"./loading-spinner-DHAIPZkP.js";import{n as g,t as _}from"./settings-input-DYs7t3oK.js";import{t as v}from"./confirmation-modal-BK1F0A68.js";import{r as y}from"./typography-YGPBGzOG.js";import"./extension-module-card-classes-9V3J9J_b.js";import{a as b,c as x,i as S,l as C,o as w,r as T,s as E}from"./settings-list-classes-DvQr5jVS.js";import{t as D}from"./secrets-service-CZYjNxFw.js";import{n as O,t as k}from"./use-create-secret-BKeXCo__.js";var A=e(t(),1),j=()=>a({mutationFn:e=>D.deleteSecret(e)}),M=()=>a({mutationFn:({secretToEdit:e,name:t,description:n})=>D.updateSecret(e,t,n)}),N=n();function P({mode:e,selectedSecret:t,onCancel:n}){let r=i(),{t:a}=o(`openhands`),{data:c}=O(),{mutate:l}=k(),{mutate:u}=M(),[h,v]=A.useState(null),y=e===`edit`&&t&&c?.find(e=>e.name===t)?.description?.trim()||``,b=()=>{r.invalidateQueries({queryKey:[`secrets-search`]}),r.invalidateQueries({queryKey:[`secrets`]})},x=(e,t,r)=>{l({name:e,value:t,description:r},{onSettled:n,onSuccess:b})},S=(e,t,r)=>{u({secretToEdit:e,name:t,description:r},{onSettled:n,onSuccess:b})};return(0,N.jsxs)(`form`,{"data-testid":e===`add`?`add-secret-form`:`edit-secret-form`,onSubmit:n=>{n.preventDefault();let r=new FormData(n.currentTarget),i=r.get(`secret-name`)?.toString(),o=r.get(`secret-value`)?.toString().trim(),l=r.get(`secret-description`)?.toString();if(i){if(v(null),c?.some(e=>e.name===i&&e.name!==t)){v(a(s.SECRETS$SECRET_ALREADY_EXISTS));return}if(e===`add`){if(!o){v(a(s.SECRETS$SECRET_VALUE_REQUIRED));return}x(i,o,l||void 0)}else e===`edit`&&t&&S(t,i,l||void 0)}},className:`flex flex-col items-start gap-6`,children:[(0,N.jsx)(_,{testId:`name-input`,name:`secret-name`,type:`text`,label:a(s.SETTINGS$NAME),className:`w-full min-w-0`,required:!0,defaultValue:e===`edit`&&t?t:``,placeholder:a(s.SECRETS$API_KEY_EXAMPLE),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:a(s.SETTINGS$SECRET_NAME_PATTERN_TITLE)}),h&&(0,N.jsx)(`p`,{className:`text-red-500 text-sm`,children:h}),e===`add`&&(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:a(s.FORM$VALUE)}),(0,N.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:!0,className:d(`resize-none`,p,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:a(s.FORM$DESCRIPTION)}),(0,N.jsx)(g,{})]}),(0,N.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,defaultValue:y,className:d(f,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(m,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:a(s.BUTTON$CANCEL)}),(0,N.jsxs)(m,{testId:`submit-button`,type:`submit`,variant:`primary`,children:[e===`add`&&a(s.SECRETS$ADD_SECRET),e===`edit`&&a(s.SECRETS$EDIT_SECRET)]})]})]})}function F(){return(0,N.jsxs)(`div`,{className:d(S,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function I({title:e,description:t,onEdit:n,onDelete:r}){return(0,N.jsxs)(`tr`,{"data-testid":`secret-item`,className:C,children:[(0,N.jsx)(`td`,{className:d(w,`text-content-2 truncate`),title:e,children:e}),(0,N.jsx)(`td`,{className:d(w,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,N.jsx)(`td`,{className:w,children:(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,N.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:T,children:(0,N.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,N.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:T,children:(0,N.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var L={hideTitle:!0};function R(){let e=i(),{t}=o(`openhands`),n=(0,A.useRef)(null),{data:r,isLoading:a,hasNextPage:l,isFetchingNextPage:u,onLoadMore:f}=O(),{mutate:p}=j(),[g,_]=A.useState(`list`),[S,C]=A.useState(null),[w,T]=A.useState(!1),D=(0,A.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&l&&!u&&f()},[l,u,f]),k=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},M=e=>{p(e,{onSettled:()=>{T(!1)},onSuccess:k,onError:k})},L=()=>{S&&M(S)},R=()=>{T(!1)},z=()=>{_(`list`),C(null)},B=g===`add-secret-form`||g===`edit-secret-form`,V=t(g===`add-secret-form`?s.SECRETS$ADD_A_SECRET:s.SECRETS$EDIT_A_SECRET);return(0,N.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[g===`list`?(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(y.H2,{children:t(s.SETTINGS$NAV_SECRETS)}),(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(s.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,N.jsx)(m,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>_(`add-secret-form`),isDisabled:a,children:t(s.SECRETS$ADD_NEW_SECRET)})]}):null,B?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(c,{testId:`back-to-secrets`,onClick:z,children:t(s.BUTTON$BACK)}),(0,N.jsx)(y.H2,{testId:`secret-editor-title`,children:V})]}):null,a&&g===`list`&&(0,N.jsxs)(`ul`,{children:[(0,N.jsx)(F,{}),(0,N.jsx)(F,{}),(0,N.jsx)(F,{})]}),g===`list`&&!a&&r?.length===0&&(0,N.jsx)(`div`,{"data-testid":`secrets-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:t(s.SECRETS$EMPTY)})}),g===`list`&&!a&&(r?.length??0)>0&&(0,N.jsxs)(`div`,{ref:n,className:b,onScroll:D,children:[(0,N.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,N.jsx)(`thead`,{className:E,children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{className:d(x,`w-1/4`),children:t(s.SETTINGS$NAME)}),(0,N.jsx)(`th`,{className:d(x,`w-1/2`),children:t(s.SECRETS$DESCRIPTION)}),(0,N.jsx)(`th`,{className:d(x,`w-1/4 text-right`),children:t(s.SETTINGS$ACTIONS)})]})}),(0,N.jsx)(`tbody`,{children:r?.map(e=>(0,N.jsx)(I,{title:e.name,description:e.description,onEdit:()=>{_(`edit-secret-form`),C(e.name)},onDelete:()=>{T(!0),C(e.name)}},e.name))})]}),u&&(0,N.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,N.jsx)(h,{size:`small`})})]}),(g===`add-secret-form`||g===`edit-secret-form`)&&(0,N.jsx)(P,{mode:g===`add-secret-form`?`add`:`edit`,selectedSecret:S,onCancel:z}),w&&(0,N.jsx)(v,{text:t(s.SECRETS$CONFIRM_DELETE_KEY),onConfirm:L,onCancel:R})]})}var z=r(R);export{z as default,L as handle};
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-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useTranslation-Cgy4JA_g.js";import{t as s}from"./declaration-B9kpCaYl.js";import{t as c}from"./back-nav-button-BYmxFxGt.js";import{t as l}from"./pencil-Dj2XjKmI.js";import{t as u}from"./trash-2-Be_7y3Mn.js";import{t as d}from"./utils-CE0lDWtb.js";import{f,l as p}from"./form-control-classes-9rkU4usZ.js";import{t as m}from"./brand-button-DKPMEKcW.js";import{t as h}from"./loading-spinner-DHAIPZkP.js";import{n as g,t as _}from"./settings-input-DYs7t3oK.js";import{t as v}from"./confirmation-modal-BK1F0A68.js";import{r as y}from"./typography-YGPBGzOG.js";import"./extension-module-card-classes-9V3J9J_b.js";import{a as b,c as x,i as S,l as C,o as w,r as T,s as E}from"./settings-list-classes-DvQr5jVS.js";import{t as D}from"./secrets-service-CZYjNxFw.js";import{n as O,t as k}from"./use-create-secret-CVFSlhlR.js";var A=e(t(),1),j=()=>a({mutationFn:e=>D.deleteSecret(e)}),M=()=>a({mutationFn:({secretToEdit:e,name:t,description:n})=>D.updateSecret(e,t,n)}),N=n();function P({mode:e,selectedSecret:t,onCancel:n}){let r=i(),{t:a}=o(`openhands`),{data:c}=O(),{mutate:l}=k(),{mutate:u}=M(),[h,v]=A.useState(null),y=e===`edit`&&t&&c?.find(e=>e.name===t)?.description?.trim()||``,b=()=>{r.invalidateQueries({queryKey:[`secrets-search`]}),r.invalidateQueries({queryKey:[`secrets`]})},x=(e,t,r)=>{l({name:e,value:t,description:r},{onSettled:n,onSuccess:b})},S=(e,t,r)=>{u({secretToEdit:e,name:t,description:r},{onSettled:n,onSuccess:b})};return(0,N.jsxs)(`form`,{"data-testid":e===`add`?`add-secret-form`:`edit-secret-form`,onSubmit:n=>{n.preventDefault();let r=new FormData(n.currentTarget),i=r.get(`secret-name`)?.toString(),o=r.get(`secret-value`)?.toString().trim(),l=r.get(`secret-description`)?.toString();if(i){if(v(null),c?.some(e=>e.name===i&&e.name!==t)){v(a(s.SECRETS$SECRET_ALREADY_EXISTS));return}if(e===`add`){if(!o){v(a(s.SECRETS$SECRET_VALUE_REQUIRED));return}x(i,o,l||void 0)}else e===`edit`&&t&&S(t,i,l||void 0)}},className:`flex flex-col items-start gap-6`,children:[(0,N.jsx)(_,{testId:`name-input`,name:`secret-name`,type:`text`,label:a(s.SETTINGS$NAME),className:`w-full min-w-0`,required:!0,defaultValue:e===`edit`&&t?t:``,placeholder:a(s.SECRETS$API_KEY_EXAMPLE),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:a(s.SETTINGS$SECRET_NAME_PATTERN_TITLE)}),h&&(0,N.jsx)(`p`,{className:`text-red-500 text-sm`,children:h}),e===`add`&&(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:a(s.FORM$VALUE)}),(0,N.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:!0,className:d(`resize-none`,p,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:a(s.FORM$DESCRIPTION)}),(0,N.jsx)(g,{})]}),(0,N.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,defaultValue:y,className:d(f,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(m,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:a(s.BUTTON$CANCEL)}),(0,N.jsxs)(m,{testId:`submit-button`,type:`submit`,variant:`primary`,children:[e===`add`&&a(s.SECRETS$ADD_SECRET),e===`edit`&&a(s.SECRETS$EDIT_SECRET)]})]})]})}function F(){return(0,N.jsxs)(`div`,{className:d(S,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function I({title:e,description:t,onEdit:n,onDelete:r}){return(0,N.jsxs)(`tr`,{"data-testid":`secret-item`,className:C,children:[(0,N.jsx)(`td`,{className:d(w,`text-content-2 truncate`),title:e,children:e}),(0,N.jsx)(`td`,{className:d(w,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,N.jsx)(`td`,{className:w,children:(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,N.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:T,children:(0,N.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,N.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:T,children:(0,N.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var L={hideTitle:!0};function R(){let e=i(),{t}=o(`openhands`),n=(0,A.useRef)(null),{data:r,isLoading:a,hasNextPage:l,isFetchingNextPage:u,onLoadMore:f}=O(),{mutate:p}=j(),[g,_]=A.useState(`list`),[S,C]=A.useState(null),[w,T]=A.useState(!1),D=(0,A.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&l&&!u&&f()},[l,u,f]),k=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},M=e=>{p(e,{onSettled:()=>{T(!1)},onSuccess:k,onError:k})},L=()=>{S&&M(S)},R=()=>{T(!1)},z=()=>{_(`list`),C(null)},B=g===`add-secret-form`||g===`edit-secret-form`,V=t(g===`add-secret-form`?s.SECRETS$ADD_A_SECRET:s.SECRETS$EDIT_A_SECRET);return(0,N.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[g===`list`?(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(y.H2,{children:t(s.SETTINGS$NAV_SECRETS)}),(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(s.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,N.jsx)(m,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>_(`add-secret-form`),isDisabled:a,children:t(s.SECRETS$ADD_NEW_SECRET)})]}):null,B?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(c,{testId:`back-to-secrets`,onClick:z,children:t(s.BUTTON$BACK)}),(0,N.jsx)(y.H2,{testId:`secret-editor-title`,children:V})]}):null,a&&g===`list`&&(0,N.jsxs)(`ul`,{children:[(0,N.jsx)(F,{}),(0,N.jsx)(F,{}),(0,N.jsx)(F,{})]}),g===`list`&&!a&&r?.length===0&&(0,N.jsx)(`div`,{"data-testid":`secrets-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:t(s.SECRETS$EMPTY)})}),g===`list`&&!a&&(r?.length??0)>0&&(0,N.jsxs)(`div`,{ref:n,className:b,onScroll:D,children:[(0,N.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,N.jsx)(`thead`,{className:E,children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{className:d(x,`w-1/4`),children:t(s.SETTINGS$NAME)}),(0,N.jsx)(`th`,{className:d(x,`w-1/2`),children:t(s.SECRETS$DESCRIPTION)}),(0,N.jsx)(`th`,{className:d(x,`w-1/4 text-right`),children:t(s.SETTINGS$ACTIONS)})]})}),(0,N.jsx)(`tbody`,{children:r?.map(e=>(0,N.jsx)(I,{title:e.name,description:e.description,onEdit:()=>{_(`edit-secret-form`),C(e.name)},onDelete:()=>{T(!0),C(e.name)}},e.name))})]}),u&&(0,N.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,N.jsx)(h,{size:`small`})})]}),(g===`add-secret-form`||g===`edit-secret-form`)&&(0,N.jsx)(P,{mode:g===`add-secret-form`?`add`:`edit`,selectedSecret:S,onCancel:z}),w&&(0,N.jsx)(v,{text:t(s.SECRETS$CONFIRM_DELETE_KEY),onConfirm:L,onCancel:R})]})}var z=r(R);export{z as default,L 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{E as r,L as i,c as a,j as o,k as s}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{t as c}from"./useTranslation-Cgy4JA_g.js";import{t as l}from"./declaration-B9kpCaYl.js";import{C as u,a as d,d as f,f as p,i as m,o as h}from"./active-backend-context-DRFevVIj.js";import{n as g,r as _,t as v}from"./use-settings-nav-items-CswsOEyw.js";import{t as y}from"./utils-CE0lDWtb.js";import{c as b}from"./agent-server-client-options-DVLRd9sw.js";import{t as x}from"./option-service.api-Dz7Eomnx.js";import"./navigation-link-D8hfwvxI.js";import"./sidebar-layout-BtpUSN3j.js";import{t as S}from"./sidebar-nav-link-CIB3NBRW.js";import{n as C}from"./use-settings-B07msZ2Z.js";import{n as w}from"./use-agent-profiles-DnH16_Vm.js";import"./close-p3Op5lxI.js";import{r as T}from"./typography-YGPBGzOG.js";import{t as E}from"./settings-section-header-context-COMOIaxV.js";import"./settings-gear-MXCyZW0x.js";import{n as D,r as O}from"./settings-utils-BMdG65By.js";import{t as k}from"./use-breakpoint-B-O0lQ84.js";import{t as A}from"./backend-synced-settings-badge-6OCwIuLY.js";import{t as j}from"./settings-like-page-layout-classes-DENKlZpD.js";var M=e(t(),1),N=n();function P({navigationItems:e}){let{t}=c(`openhands`),n=e.filter(e=>e.type===`item`);return(0,N.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:y(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,N.jsx)(T.Text,{className:`px-2 text-sm font-normal text-white`,children:t(l.SETTINGS$TITLE)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:[n.map(e=>(0,N.jsx)(S,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon,disabled:e.disabled,disabledReason:e.disabled&&e.disabledAgentName?t(l.SETTINGS$AGENT_DISABLED_TOOLTIP,{agentName:e.disabledAgentName}):void 0},e.item.to)),(0,N.jsx)(_,{})]}),(0,N.jsx)(`div`,{className:`px-2 pt-3`,children:(0,N.jsx)(A,{})})]})}function F({children:e,navigationItems:t}){return(0,N.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,N.jsx)(P,{navigationItems:t}),(0,N.jsx)(`main`,{className:j,children:(0,N.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}async function I(){try{let e=b(),t;try{let n=await u.fetchQuery({queryKey:[...m.all,e.backend.id,e.orgId],queryFn:w.listProfiles,staleTime:0,...d}),r=n?.active_agent_profile_id??null,i=n?.profiles.find(e=>e.id!=null&&e.id===r);i&&(t=i.agent_kind===`acp`)}catch{}if(t===void 0&&(t=(await u.fetchQuery({queryKey:[...p.byScope(`personal`),e.backend.id,e.orgId],queryFn:()=>C(`personal`),staleTime:0}))?.agent_settings?.agent_kind===`acp`),t)return r(`/settings/agents`)}catch{}return null}var L=async({request:e})=>{let{pathname:t}=new URL(e.url),n=(await u.fetchQuery({queryKey:f.WEB_CLIENT_CONFIG,queryFn:x.getConfig,...h}))?.feature_flags;if(O(t,n)){let e=D(n);if(e&&e!==t)return r(e)}if(g.find(e=>e.to===t)?.disabledByAcp){let e=await I();if(e)return e}return null};function R(){let{t:e}=c(`openhands`),t=s(),n=o(),r=v(),i=k(768),[l,u]=(0,M.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:f}=(0,M.useMemo)(()=>{let e=r.find(e=>e.type===`item`&&e.item.to===t.pathname);if(e?.type===`item`)return{currentSectionTitle:e.item.text,currentSectionSubtitle:e.item.subtitle};let n=r.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[r,t.pathname]),p=n.find(e=>e.pathname===t.pathname)?.handle,m=i&&t.pathname===`/settings`;return(0,N.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,N.jsx)(E,{setHideSectionHeader:u,children:(0,N.jsx)(F,{navigationItems:r,children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(p?.hideTitle===!0||m||l)&&(0,N.jsxs)(`header`,{className:`space-y-1`,children:[(0,N.jsx)(T.H2,{children:e(d)}),f?(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(f)}):null]}),(0,N.jsx)(a,{})]})})})})}var z=i(R);export{L as clientLoader,z 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{E as r,L as i,c as a,j as o,k as s}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{t as c}from"./useTranslation-Cgy4JA_g.js";import{t as l}from"./declaration-B9kpCaYl.js";import{C as u,a as d,d as f,f as p,i as m,o as h}from"./active-backend-context-u2tdYRgH.js";import{n as g,r as _,t as v}from"./use-settings-nav-items-D6pHnvxg.js";import{t as y}from"./utils-CE0lDWtb.js";import{c as b}from"./agent-server-client-options-DVLRd9sw.js";import{t as x}from"./option-service.api-Cl5VLGyw.js";import"./navigation-link-D8hfwvxI.js";import"./sidebar-layout-BtpUSN3j.js";import{t as S}from"./sidebar-nav-link-CIB3NBRW.js";import{n as C}from"./use-settings-dX4fKUPF.js";import{n as w}from"./use-agent-profiles-DPcaYLpm.js";import"./close-p3Op5lxI.js";import{r as T}from"./typography-YGPBGzOG.js";import{t as E}from"./settings-section-header-context-COMOIaxV.js";import"./settings-gear-MXCyZW0x.js";import{n as D,r as O}from"./settings-utils-BMdG65By.js";import{t as k}from"./use-breakpoint-B-O0lQ84.js";import{t as A}from"./backend-synced-settings-badge-Bs3FSXsS.js";import{t as j}from"./settings-like-page-layout-classes-DENKlZpD.js";var M=e(t(),1),N=n();function P({navigationItems:e}){let{t}=c(`openhands`),n=e.filter(e=>e.type===`item`);return(0,N.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:y(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,N.jsx)(T.Text,{className:`px-2 text-sm font-normal text-white`,children:t(l.SETTINGS$TITLE)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:[n.map(e=>(0,N.jsx)(S,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon,disabled:e.disabled,disabledReason:e.disabled&&e.disabledAgentName?t(l.SETTINGS$AGENT_DISABLED_TOOLTIP,{agentName:e.disabledAgentName}):void 0},e.item.to)),(0,N.jsx)(_,{})]}),(0,N.jsx)(`div`,{className:`px-2 pt-3`,children:(0,N.jsx)(A,{})})]})}function F({children:e,navigationItems:t}){return(0,N.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,N.jsx)(P,{navigationItems:t}),(0,N.jsx)(`main`,{className:j,children:(0,N.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}async function I(){try{let e=b(),t;try{let n=await u.fetchQuery({queryKey:[...m.all,e.backend.id,e.orgId],queryFn:w.listProfiles,staleTime:0,...d}),r=n?.active_agent_profile_id??null,i=n?.profiles.find(e=>e.id!=null&&e.id===r);i&&(t=i.agent_kind===`acp`)}catch{}if(t===void 0&&(t=(await u.fetchQuery({queryKey:[...p.byScope(`personal`),e.backend.id,e.orgId],queryFn:()=>C(`personal`),staleTime:0}))?.agent_settings?.agent_kind===`acp`),t)return r(`/settings/agents`)}catch{}return null}var L=async({request:e})=>{let{pathname:t}=new URL(e.url),n=(await u.fetchQuery({queryKey:f.WEB_CLIENT_CONFIG,queryFn:x.getConfig,...h}))?.feature_flags;if(O(t,n)){let e=D(n);if(e&&e!==t)return r(e)}if(g.find(e=>e.to===t)?.disabledByAcp){let e=await I();if(e)return e}return null};function R(){let{t:e}=c(`openhands`),t=s(),n=o(),r=v(),i=k(768),[l,u]=(0,M.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:f}=(0,M.useMemo)(()=>{let e=r.find(e=>e.type===`item`&&e.item.to===t.pathname);if(e?.type===`item`)return{currentSectionTitle:e.item.text,currentSectionSubtitle:e.item.subtitle};let n=r.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[r,t.pathname]),p=n.find(e=>e.pathname===t.pathname)?.handle,m=i&&t.pathname===`/settings`;return(0,N.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,N.jsx)(E,{setHideSectionHeader:u,children:(0,N.jsx)(F,{navigationItems:r,children:(0,N.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(p?.hideTitle===!0||m||l)&&(0,N.jsxs)(`header`,{className:`space-y-1`,children:[(0,N.jsx)(T.H2,{children:e(d)}),f?(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(f)}):null]}),(0,N.jsx)(a,{})]})})})})}var z=i(R);export{L as clientLoader,z as default};
@@ -1 +1 @@
1
- import{bt as e}from"./vendor-styling-CI0PQ3ab.js";import{L as t,s as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{t as r}from"./useTranslation-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{r as a,t as o}from"./use-settings-nav-items-CswsOEyw.js";import{t as s}from"./use-config-Dwf5gla-.js";import{t as c}from"./sidebar-nav-link-CIB3NBRW.js";import{r as l}from"./typography-YGPBGzOG.js";import{n as u}from"./settings-utils-BMdG65By.js";import{t as d}from"./use-breakpoint-B-O0lQ84.js";import{t as f}from"./backend-synced-settings-badge-6OCwIuLY.js";var p=e();function m({navigationItems:e}){let{t}=r(`openhands`),n=e.filter(e=>e.type===`item`);return(0,p.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,p.jsx)(l.H2,{children:t(i.SETTINGS$TITLE)}),(0,p.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[n.map(e=>(0,p.jsx)(c,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,p.jsx)(a,{})]}),(0,p.jsx)(`div`,{className:`pt-1`,children:(0,p.jsx)(f,{})})]})}var h=t(function(){let e=d(768),t=o(),{data:r}=s();return e?(0,p.jsx)(m,{navigationItems:t}):(0,p.jsx)(n,{to:u(r?.feature_flags)??`/settings/app`,replace:!0})});export{h as default};
1
+ import{bt as e}from"./vendor-styling-CI0PQ3ab.js";import{L as t,s as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{t as r}from"./useTranslation-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{r as a,t as o}from"./use-settings-nav-items-D6pHnvxg.js";import{t as s}from"./use-config-ur0RbjCP.js";import{t as c}from"./sidebar-nav-link-CIB3NBRW.js";import{r as l}from"./typography-YGPBGzOG.js";import{n as u}from"./settings-utils-BMdG65By.js";import{t as d}from"./use-breakpoint-B-O0lQ84.js";import{t as f}from"./backend-synced-settings-badge-Bs3FSXsS.js";var p=e();function m({navigationItems:e}){let{t}=r(`openhands`),n=e.filter(e=>e.type===`item`);return(0,p.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,p.jsx)(l.H2,{children:t(i.SETTINGS$TITLE)}),(0,p.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[n.map(e=>(0,p.jsx)(c,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,p.jsx)(a,{})]}),(0,p.jsx)(`div`,{className:`pt-1`,children:(0,p.jsx)(f,{})})]})}var h=t(function(){let e=d(768),t=o(),{data:r}=s();return e?(0,p.jsx)(m,{navigationItems:t}):(0,p.jsx)(n,{to:u(r?.feature_flags)??`/settings/app`,replace:!0})});export{h 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{t as r}from"./useTranslation-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{F as a,t as o}from"./utils-CE0lDWtb.js";import{t as s}from"./modal-backdrop-zVwfOJZr.js";import{r as c,t as l}from"./modal-body-Dcu5McCa.js";import{t as u}from"./base-modal-CC5Pp8CF.js";import{t as d}from"./modal-classes-DPqxSyuP.js";import{t as f}from"./brand-button-DKPMEKcW.js";import{n as p}from"./navigation-context-DPs2G0X8.js";import{t as m}from"./settings-input-DYs7t3oK.js";import{t as h}from"./settings-mQUckT0g.js";import{t as g}from"./use-tracking-CqODdfO4.js";import{t as _}from"./use-save-settings-5xPYpSQM.js";import{t as v}from"./model-selector-VDHBytb6.js";import{a as y,g as b}from"./sdk-settings-schema-BjBkMHzZ.js";import{t as x}from"./settings-utils-BMdG65By.js";var S=e(t(),1),C=n();function w({testId:e,title:t,description:n,buttons:r}){return(0,C.jsx)(u,{testId:e,title:t,description:n,buttons:[{text:r.danger.text,onClick:r.danger.onClick,className:`bg-danger`},{text:r.cancel.text,onClick:r.cancel.onClick,className:`bg-[var(--oh-interactive-selected)]`}]})}function T({settings:e,onClose:t}){let{trackSettingsSaved:n}=g(),{mutate:o}=_(),{currentPath:c}=p(),{t:l}=r(`openhands`),u=S.useRef(null),[d,h]=S.useState(!1),T=async e=>{let r=x(e);await o(r,{onSuccess:()=>{t();let e=r.agent_settings_diff?.llm??{};n({llmModel:e.model,llmApiKeySet:e.api_key?`SET`:`UNSET`,searchApiKeySet:r.search_api_key?`SET`:`UNSET`,remoteRuntimeResourceFactor:r.remote_runtime_resource_factor})}})},E=()=>{T(new FormData(u.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);c.startsWith(`/conversations/`)?h(!0):T(t)},O=e.llm_api_key_set,k=y(e,`llm.model`);return(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`form`,{ref:u,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,C.jsx)(v,{currentModel:typeof k==`string`?k:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(m,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:l(i.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(b,{testId:`llm-api-key-help-anchor`,text:l(i.SETTINGS$DONT_KNOW_API_KEY),linkText:l(i.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,C.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,C.jsx)(f,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:l(i.BUTTON$SAVE)})})]}),d&&(0,C.jsx)(s,{children:(0,C.jsx)(w,{title:l(i.MODAL$END_SESSION_TITLE),description:l(i.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:l(i.BUTTON$END_SESSION),onClick:E},cancel:{text:l(i.BUTTON$CANCEL),onClick:()=>h(!1)}}})})]})}function E({onClose:e,settings:t}){let{t:n}=r(`openhands`);return(0,C.jsx)(s,{children:(0,C.jsxs)(`div`,{"data-testid":`ai-config-modal`,className:o(`bg-[var(--oh-surface)] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal`,c(`md`),l),children:[(0,C.jsx)(`span`,{className:d,children:n(i.AI_SETTINGS$TITLE)}),(0,C.jsx)(b,{testId:`advanced-settings-link`,text:`${n(i.SETTINGS$DESCRIPTION)}. ${n(i.SETTINGS$FOR_OTHER_OPTIONS)} ${n(i.COMMON$SEE)}`,linkText:n(i.COMMON$ADVANCED_SETTINGS),href:`/settings`,suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,C.jsx)(T,{settings:t||h,onClose:e})]})})}export{E as SettingsModal};
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-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{F as a,t as o}from"./utils-CE0lDWtb.js";import{t as s}from"./modal-backdrop-zVwfOJZr.js";import{r as c,t as l}from"./modal-body-Dcu5McCa.js";import{t as u}from"./base-modal-CC5Pp8CF.js";import{t as d}from"./modal-classes-DPqxSyuP.js";import{t as f}from"./brand-button-DKPMEKcW.js";import{n as p}from"./navigation-context-DPs2G0X8.js";import{t as m}from"./settings-input-DYs7t3oK.js";import{t as h}from"./settings-mQUckT0g.js";import{t as g}from"./use-tracking-GtXCHmTv.js";import{t as _}from"./use-save-settings-CChDyjOB.js";import{t as v}from"./model-selector-VDHBytb6.js";import{a as y,g as b}from"./sdk-settings-schema-BjBkMHzZ.js";import{t as x}from"./settings-utils-BMdG65By.js";var S=e(t(),1),C=n();function w({testId:e,title:t,description:n,buttons:r}){return(0,C.jsx)(u,{testId:e,title:t,description:n,buttons:[{text:r.danger.text,onClick:r.danger.onClick,className:`bg-danger`},{text:r.cancel.text,onClick:r.cancel.onClick,className:`bg-[var(--oh-interactive-selected)]`}]})}function T({settings:e,onClose:t}){let{trackSettingsSaved:n}=g(),{mutate:o}=_(),{currentPath:c}=p(),{t:l}=r(`openhands`),u=S.useRef(null),[d,h]=S.useState(!1),T=async e=>{let r=x(e);await o(r,{onSuccess:()=>{t();let e=r.agent_settings_diff?.llm??{};n({llmModel:e.model,llmApiKeySet:e.api_key?`SET`:`UNSET`,searchApiKeySet:r.search_api_key?`SET`:`UNSET`,remoteRuntimeResourceFactor:r.remote_runtime_resource_factor})}})},E=()=>{T(new FormData(u.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);c.startsWith(`/conversations/`)?h(!0):T(t)},O=e.llm_api_key_set,k=y(e,`llm.model`);return(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`form`,{ref:u,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,C.jsx)(v,{currentModel:typeof k==`string`?k:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(m,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:l(i.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(b,{testId:`llm-api-key-help-anchor`,text:l(i.SETTINGS$DONT_KNOW_API_KEY),linkText:l(i.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,C.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,C.jsx)(f,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:l(i.BUTTON$SAVE)})})]}),d&&(0,C.jsx)(s,{children:(0,C.jsx)(w,{title:l(i.MODAL$END_SESSION_TITLE),description:l(i.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:l(i.BUTTON$END_SESSION),onClick:E},cancel:{text:l(i.BUTTON$CANCEL),onClick:()=>h(!1)}}})})]})}function E({onClose:e,settings:t}){let{t:n}=r(`openhands`);return(0,C.jsx)(s,{children:(0,C.jsxs)(`div`,{"data-testid":`ai-config-modal`,className:o(`bg-[var(--oh-surface)] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal`,c(`md`),l),children:[(0,C.jsx)(`span`,{className:d,children:n(i.AI_SETTINGS$TITLE)}),(0,C.jsx)(b,{testId:`advanced-settings-link`,text:`${n(i.SETTINGS$DESCRIPTION)}. ${n(i.SETTINGS$FOR_OTHER_OPTIONS)} ${n(i.COMMON$SEE)}`,linkText:n(i.COMMON$ADVANCED_SETTINGS),href:`/settings`,suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,C.jsx)(T,{settings:t||h,onClose:e})]})})}export{E as SettingsModal};
@@ -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,P as i,r as a}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{h as o}from"./path-utils-CBaRYg35.js";import{t as s}from"./useQuery-CpjHYtZc.js";import{t as c}from"./useTranslation-Cgy4JA_g.js";import{t as l}from"./declaration-B9kpCaYl.js";import{n as u}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{t as d}from"./messages-C4KEFkPk.js";import{n as f}from"./agent-server-client-options-DVLRd9sw.js";import{t as p}from"./loading-spinner-DHAIPZkP.js";import{t as m}from"./openhands-logo-bcNw5bkY.js";import{c as h}from"./lesson-plan-HD886V64.js";import{n as g}from"./use-event-store-YSOxy9FC.js";var _=e(t(),1),v=e=>s({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new u(f()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>o({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new u(f()).searchSharedEvents({conversationId:e,limit:100,pageId:t})},initialPageParam:void 0,getNextPageParam:e=>e.next_page_id??void 0,enabled:!!e,retry:!1}),b=({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:n,threshold:r=100})=>{let i=(0,_.useRef)(null),a=(0,_.useCallback)(()=>{if(!i.current||t||!e)return;let{scrollTop:a,scrollHeight:o,clientHeight:s}=i.current;a+s>=o-r&&n()},[e,t,n,r]);return(0,_.useEffect)(()=>{let e=i.current;if(e)return e.addEventListener(`scroll`,a),()=>{e.removeEventListener(`scroll`,a)}},[a]),i},x=n(),S=r(function(){let{t:e}=c(`openhands`),{conversationId:t}=i(),{data:n,isLoading:r,error:o}=v(t),{data:s,isLoading:u,error:f,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=r||u,E=o||f,D=_.useMemo(()=>s?.pages?s.pages.flatMap(e=>e.items):[],[s?.pages]),O=_.useMemo(()=>D.reduce((e,t)=>g(t,e),[]).filter(h),[D]),k=b({hasNextPage:!!S,isFetchingNextPage:w,fetchNextPage:C});return T?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(p,{size:`large`})}):E||!n?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(`div`,{className:`text-white`,children:e(l.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(a,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(l.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(m,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(l.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(d,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(l.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(p,{size:`small`})})]})})]})});export{S 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,P as i,r as a}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{h as o}from"./path-utils-BeOmjIcE.js";import{t as s}from"./useQuery-CpjHYtZc.js";import{t as c}from"./useTranslation-Cgy4JA_g.js";import{t as l}from"./declaration-B9kpCaYl.js";import{n as u}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{t as d}from"./messages-D2oZb47Z.js";import{n as f}from"./agent-server-client-options-DVLRd9sw.js";import{t as p}from"./loading-spinner-DHAIPZkP.js";import{t as m}from"./openhands-logo-bcNw5bkY.js";import{c as h}from"./lesson-plan-BtrZUCuj.js";import{n as g}from"./use-event-store-YSOxy9FC.js";var _=e(t(),1),v=e=>s({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new u(f()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>o({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new u(f()).searchSharedEvents({conversationId:e,limit:100,pageId:t})},initialPageParam:void 0,getNextPageParam:e=>e.next_page_id??void 0,enabled:!!e,retry:!1}),b=({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:n,threshold:r=100})=>{let i=(0,_.useRef)(null),a=(0,_.useCallback)(()=>{if(!i.current||t||!e)return;let{scrollTop:a,scrollHeight:o,clientHeight:s}=i.current;a+s>=o-r&&n()},[e,t,n,r]);return(0,_.useEffect)(()=>{let e=i.current;if(e)return e.addEventListener(`scroll`,a),()=>{e.removeEventListener(`scroll`,a)}},[a]),i},x=n(),S=r(function(){let{t:e}=c(`openhands`),{conversationId:t}=i(),{data:n,isLoading:r,error:o}=v(t),{data:s,isLoading:u,error:f,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=r||u,E=o||f,D=_.useMemo(()=>s?.pages?s.pages.flatMap(e=>e.items):[],[s?.pages]),O=_.useMemo(()=>D.reduce((e,t)=>g(t,e),[]).filter(h),[D]),k=b({hasNextPage:!!S,isFetchingNextPage:w,fetchNextPage:C});return T?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(p,{size:`large`})}):E||!n?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(`div`,{className:`text-white`,children:e(l.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(a,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(l.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(m,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(l.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(d,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(l.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(p,{size:`small`})})]})})]})});export{S 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{n as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as i}from"./useMutation-DCE9RcgK.js";import{t as a}from"./Trans-De9RwQhA.js";import{t as o}from"./useTranslation-Cgy4JA_g.js";import{t as s}from"./declaration-B9kpCaYl.js";import{t as c}from"./utils-CE0lDWtb.js";import{t as l}from"./modal-backdrop-zVwfOJZr.js";import{n as u}from"./modal-body-Dcu5McCa.js";import{n as d,r as f}from"./base-modal-CC5Pp8CF.js";import{_ as p,u as m}from"./form-control-classes-9rkU4usZ.js";import{t as h}from"./brand-button-DKPMEKcW.js";import{t as g}from"./agent-server-conversation-service.api-DfH2k6Sx.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:i}){let{t:c}=o(`openhands`),p;return p=i??(n?(0,v.jsx)(a,{ns:`openhands`,i18nKey:s.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):c(s.CONVERSATION$DELETE_WARNING)),(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:r??c(s.CONVERSATION$CONFIRM_DELETE)}),(0,v.jsx)(d,{children:p})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:c(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:c(s.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=o(`openhands`);return(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:n(s.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(s.CONVERSATION$CLOSE_CONVERSATION_WARNING)})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:n(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(s.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return i({mutationFn:e=>g.updateConversationTitle(e.conversationId,e.newTitle),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,title:t.newTitle}:e)),e.setQueryData([`user`,`conversation`,t.conversationId],e=>e&&{...e,title:t.newTitle}),{previousConversations:n}},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})};function S(e){if(!e)return null;try{let t=new URL(e);return t.hostname===`localhost`&&window.location.hostname!==`localhost`?(t.hostname=window.location.hostname,t.toString()):e}catch{return e}}var C=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{d:`M12 2C12.5523 2 13 2.44772 13 3V13.5858L15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929C7.68342 10.9024 8.31658 10.9024 8.70711 11.2929L11 13.5858V3C11 2.44772 11.4477 2 12 2ZM5 17C5.55228 17 6 17.4477 6 18V20H18V18C18 17.4477 18.4477 17 19 17C19.5523 17 20 17.4477 20 18V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V18C4 17.4477 4.44772 17 5 17Z`,fill:`currentColor`})}),w=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 7.5V9H3V7.5H21ZM3 10.5H21V18H3V10.5ZM21 6H3C2.60218 6 2.22064 6.15804 1.93934 6.43934C1.65804 6.72064 1.5 7.10218 1.5 7.5V18C1.5 18.3978 1.65804 18.7794 1.93934 19.0607C2.22064 19.342 2.60218 19.5 3 19.5H21C21.3978 19.5 21.7794 19.342 22.0607 19.0607C22.342 18.7794 22.5 18.3978 22.5 18V7.5C22.5 7.10218 22.342 6.72064 22.0607 6.43934C21.7794 6.15804 21.3978 6 21 6ZM16.5 15H19.5V16.5H16.5V15Z`,fill:`currentColor`})}),T=_.createContext(null);function E({children:e}){let[t,n]=_.useState(!1),r=_.useCallback(()=>n(!0),[]),i=_.useCallback(()=>n(!1),[]),a=_.useCallback(()=>n(e=>!e),[]),o=_.useMemo(()=>({isOpen:t,open:r,close:i,toggle:a}),[t,r,i,a]);return(0,v.jsx)(T.Provider,{value:o,children:e})}function D(){let e=_.useContext(T);if(!e)throw Error(`useSidebarMobileNav must be used within SidebarMobileNavProvider`);return e}var O=c(`inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)]`,p,m),k=`size-5 shrink-0`,A=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 5.5H18C18.2761 5.5 18.5 5.72386 18.5 6V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 5.5ZM8.5 5.5H6C5.72386 5.5 5.5 5.72386 5.5 6V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 5.5ZM18 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4Z`,fill:`currentColor`})});function j(){let{t:e}=o(`openhands`),{isOpen:t,toggle:n}=D();return(0,v.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-menu-toggle`,onClick:n,"aria-expanded":t,"aria-label":e(t?s.SIDEBAR$CLOSE_MENU:s.SIDEBAR$OPEN_MENU),className:O,children:(0,v.jsx)(A,{className:k,"aria-hidden":!0})})}export{E as a,C as c,b as d,y as f,k as i,S as l,A as n,D as o,O as r,w as s,j as t,x as u};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as i}from"./useMutation-DCE9RcgK.js";import{t as a}from"./Trans-De9RwQhA.js";import{t as o}from"./useTranslation-Cgy4JA_g.js";import{t as s}from"./declaration-B9kpCaYl.js";import{t as c}from"./utils-CE0lDWtb.js";import{t as l}from"./modal-backdrop-zVwfOJZr.js";import{n as u}from"./modal-body-Dcu5McCa.js";import{n as d,r as f}from"./base-modal-CC5Pp8CF.js";import{_ as p,u as m}from"./form-control-classes-9rkU4usZ.js";import{t as h}from"./brand-button-DKPMEKcW.js";import{t as g}from"./agent-server-conversation-service.api-BP73yONA.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:i}){let{t:c}=o(`openhands`),p;return p=i??(n?(0,v.jsx)(a,{ns:`openhands`,i18nKey:s.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):c(s.CONVERSATION$DELETE_WARNING)),(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:r??c(s.CONVERSATION$CONFIRM_DELETE)}),(0,v.jsx)(d,{children:p})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:c(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:c(s.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=o(`openhands`);return(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:n(s.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(s.CONVERSATION$CLOSE_CONVERSATION_WARNING)})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:n(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(s.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return i({mutationFn:e=>g.updateConversationTitle(e.conversationId,e.newTitle),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,title:t.newTitle}:e)),e.setQueryData([`user`,`conversation`,t.conversationId],e=>e&&{...e,title:t.newTitle}),{previousConversations:n}},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})};function S(e){if(!e)return null;try{let t=new URL(e);return t.hostname===`localhost`&&window.location.hostname!==`localhost`?(t.hostname=window.location.hostname,t.toString()):e}catch{return e}}var C=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{d:`M12 2C12.5523 2 13 2.44772 13 3V13.5858L15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929C7.68342 10.9024 8.31658 10.9024 8.70711 11.2929L11 13.5858V3C11 2.44772 11.4477 2 12 2ZM5 17C5.55228 17 6 17.4477 6 18V20H18V18C18 17.4477 18.4477 17 19 17C19.5523 17 20 17.4477 20 18V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V18C4 17.4477 4.44772 17 5 17Z`,fill:`currentColor`})}),w=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 7.5V9H3V7.5H21ZM3 10.5H21V18H3V10.5ZM21 6H3C2.60218 6 2.22064 6.15804 1.93934 6.43934C1.65804 6.72064 1.5 7.10218 1.5 7.5V18C1.5 18.3978 1.65804 18.7794 1.93934 19.0607C2.22064 19.342 2.60218 19.5 3 19.5H21C21.3978 19.5 21.7794 19.342 22.0607 19.0607C22.342 18.7794 22.5 18.3978 22.5 18V7.5C22.5 7.10218 22.342 6.72064 22.0607 6.43934C21.7794 6.15804 21.3978 6 21 6ZM16.5 15H19.5V16.5H16.5V15Z`,fill:`currentColor`})}),T=_.createContext(null);function E({children:e}){let[t,n]=_.useState(!1),r=_.useCallback(()=>n(!0),[]),i=_.useCallback(()=>n(!1),[]),a=_.useCallback(()=>n(e=>!e),[]),o=_.useMemo(()=>({isOpen:t,open:r,close:i,toggle:a}),[t,r,i,a]);return(0,v.jsx)(T.Provider,{value:o,children:e})}function D(){let e=_.useContext(T);if(!e)throw Error(`useSidebarMobileNav must be used within SidebarMobileNavProvider`);return e}var O=c(`inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)]`,p,m),k=`size-5 shrink-0`,A=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 5.5H18C18.2761 5.5 18.5 5.72386 18.5 6V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 5.5ZM8.5 5.5H6C5.72386 5.5 5.5 5.72386 5.5 6V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 5.5ZM18 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4Z`,fill:`currentColor`})});function j(){let{t:e}=o(`openhands`),{isOpen:t,toggle:n}=D();return(0,v.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-menu-toggle`,onClick:n,"aria-expanded":t,"aria-label":e(t?s.SIDEBAR$CLOSE_MENU:s.SIDEBAR$OPEN_MENU),className:O,children:(0,v.jsx)(A,{className:k,"aria-hidden":!0})})}export{E as a,C as c,b as d,y as f,k as i,S as l,A as n,D as o,O as r,w as s,j as t,x as u};
@@ -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-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useQuery-CpjHYtZc.js";import{t as s}from"./useTranslation-Cgy4JA_g.js";import{t as c}from"./declaration-B9kpCaYl.js";import{A as l,N as u,j as d,n as f,u as p}from"./active-backend-context-DRFevVIj.js";import{t as m}from"./search-4DHskuhE.js";import{t as h}from"./x-Cb0WAtak.js";import{t as g}from"./utils-CE0lDWtb.js";import{t as _}from"./modal-backdrop-zVwfOJZr.js";import{n as v}from"./modal-classes-DPqxSyuP.js";import{t as y}from"./brand-button-DKPMEKcW.js";import{t as b}from"./modal-close-button-CTCX4nCH.js";import{t as x}from"./settings-input-DYs7t3oK.js";import{t as S}from"./plugins-management-service-BAp70KN7.js";import{a as C,i as w,r as T}from"./extension-module-card-classes-9V3J9J_b.js";import{t as E}from"./settings-switch-C2N2xqEb.js";import{n as D}from"./circle-plus-check-toggle-T3eAIuPQ.js";import{n as O,t as k}from"./use-plugins-marketplace-BGb-KgfD.js";import{n as A}from"./extensions-navigation-BtV14oQL.js";import{n as j}from"./settings-like-page-layout-classes-DENKlZpD.js";var M=e(t(),1),N=n();function P({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:a}){let{t:o}=s(`openhands`);return(0,N.jsxs)(`div`,{"data-testid":`plugin-card-${e.name}`,role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:g(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,C,T),children:[(0,N.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,N.jsx)(`p`,{"data-testid":`plugin-source-${e.name}`,className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}):null]}),e.installed?(0,N.jsx)(D,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:a,disableTooltipKey:c.COMMON$DISABLE}):e.isLocal?(0,N.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:g(w,`flex-shrink-0`),children:o(c.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:o(t?c.SETTINGS$PLUGINS_INSTALLING:c.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,N.jsx)(`p`,{"data-testid":`plugin-description-${e.name}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null,(e.installed||e.isLocal)&&e.version?(0,N.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:g(w,`self-start`),children:o(c.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var F=[{value:`all`,labelKey:c.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:c.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:c.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:c.SETTINGS$PLUGINS_FILTER_LOCAL}];function I({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=s(`openhands`);return(0,N.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,N.jsxs)(`div`,{className:g(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,N.jsx)(m,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,N.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(c.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(c.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:g(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(c.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,N.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,N.jsx)(`div`,{"data-testid":`plugins-status-filter`,className:`flex shrink-0 items-center gap-1 rounded-lg border border-[var(--oh-border)] bg-base-secondary p-1`,children:F.map(e=>(0,N.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:g(`cursor-pointer rounded-md px-3 py-1 text-xs transition-colors`,n===e.value?`bg-surface-raised text-white`:`text-tertiary-alt hover:text-white`),children:i(e.labelKey)},e.value))})]})}function L({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:a,onRefresh:o,onClose:l}){let{t:u}=s(`openhands`),d=n||t;return(0,N.jsx)(_,{onClose:l,"aria-label":e.name,children:(0,N.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,N.jsx)(b,{onClose:l,testId:`plugin-detail-modal-close`}),(0,N.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,N.jsx)(`h2`,{className:g(`pr-6`,v),children:e.name}),e.source?(0,N.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,N.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,N.jsx)(`span`,{className:w,children:u(c.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,N.jsx)(`span`,{className:w,children:u(c.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,N.jsxs)(`span`,{className:w,children:[u(c.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,N.jsxs)(`span`,{className:w,children:[u(c.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,N.jsx)(E,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?c.SETTINGS$SKILLS_ENABLED:c.SETTINGS$SKILLS_DISABLED)}):null]}),(0,N.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:o,children:u(c.SETTINGS$PLUGINS_REFRESH)}),(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:a,children:u(c.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,N.jsx)(y,{type:`button`,variant:`primary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?c.SETTINGS$PLUGINS_INSTALLING:c.SETTINGS$PLUGINS_INSTALL)}),(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:l,children:u(c.BUTTON$CLOSE)})]})]})})}function R(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>S.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed}),e.invalidateQueries({queryKey:p.marketplace}),d(t(c.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}function z({onClose:e,onInstalled:t}){let{t:n}=s(`openhands`),r=R(),[i,a]=M.useState(``),[o,l]=M.useState(``),[u,d]=M.useState(``),f=i.trim(),p=f.length>0&&!r.isPending;return(0,N.jsx)(_,{onClose:e,"aria-label":n(c.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,N.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),p&&r.mutate({source:f,ref:o.trim()||null,repo_path:u.trim()||null},{onSuccess:()=>{t?.(),e()}})},"data-testid":`add-plugin-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,N.jsx)(b,{onClose:e,testId:`add-plugin-modal-close`}),(0,N.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,N.jsx)(`h2`,{className:g(`pr-6`,v),children:n(c.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,N.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(c.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,N.jsx)(x,{testId:`add-plugin-source-input`,label:n(c.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:a,placeholder:n(c.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,N.jsx)(x,{testId:`add-plugin-ref-input`,label:n(c.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:o,onChange:l,showOptionalTag:!0}),(0,N.jsx)(x,{testId:`add-plugin-repo-path-input`,label:n(c.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:u,onChange:d,showOptionalTag:!0})]}),(0,N.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,N.jsx)(y,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(c.BUTTON$CLOSE)}),(0,N.jsx)(y,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!p,children:n(r.isPending?c.SETTINGS$PLUGINS_INSTALLING:c.SETTINGS$PLUGINS_INSTALL)})]})]})})}function B(e,t,n=void 0){let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,description:t.description,source:t.source,ref:t.ref??null,repoPath:t.repo_path??null,installed:t.installed,enabled:!1,version:null,inCatalog:!0,isLocal:!1});for(let e of t??[]){let t=r.get(e.name);r.set(e.name,{name:e.name,description:t?.description??e.description??null,source:e.source??t?.source??null,ref:e.resolved_ref??t?.ref??null,repoPath:e.repo_path??t?.repoPath??null,installed:!0,enabled:e.enabled,version:e.version??null,inCatalog:t?.inCatalog??!1,isLocal:!1})}for(let e of n??[])r.has(e.name)||r.set(e.name,{name:e.name,description:e.description||null,source:null,ref:null,repoPath:null,installed:!1,enabled:!1,version:e.version||null,inCatalog:!1,isLocal:!0});let i=e=>e.installed?0:e.isLocal?1:2;return Array.from(r.values()).sort((e,t)=>{let n=i(e)-i(t);return n===0?e.name.localeCompare(t.name):n})}function V(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description??``,e.source??``,e.repoPath??``,e.ref??``].some(e=>e.toLowerCase().includes(n)):!0}function H(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var U=()=>o({queryKey:p.installed,queryFn:()=>S.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),W=()=>o({queryKey:p.local,queryFn:()=>O.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1});function G(){let e=i(),{t}=s(`openhands`);return a({mutationFn:({name:e,enabled:t})=>S.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed})},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}function K(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>S.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed}),e.invalidateQueries({queryKey:p.marketplace}),d(t(c.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}function q(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>S.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed}),d(t(c.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}var J=r(function(){let{t:e}=s(`openhands`),{backend:t}=f(),n=t.kind===`local`,{data:r,isLoading:i}=k(),{data:a,isLoading:o}=U(),{data:l,isLoading:u}=W(),d=R(),p=G(),m=K(),h=q(),[_,v]=M.useState(``),[b,x]=M.useState(`all`),[S,C]=M.useState(null),[w,T]=M.useState(!1),E=M.useMemo(()=>B(r,a,l),[r,a,l]),D=M.useMemo(()=>E.filter(e=>H(e,b)&&V(e,_)),[E,b,_]),O=S?E.find(e=>e.name===S)??null:null,F=i||o||u,J=(p.isPending?p.variables?.name:void 0)??(m.isPending?m.variables:void 0)??(h.isPending?h.variables:void 0)??null,Y=e=>J===e.name||d.isPending&&d.variables?.source===e.source,X=e=>{e.source&&d.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},Z=(e,t)=>{p.mutate({name:e.name,enabled:t})},Q=e=>{m.mutate(e.name,{onSuccess:()=>C(null)})},$=e=>{h.mutate(e.name)};return(0,N.jsxs)(`div`,{"data-testid":`skills-plugins-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,N.jsx)(A,{}),(0,N.jsx)(`main`,{className:g(j,`h-full`),children:(0,N.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(c.SETTINGS$PLUGINS_TITLE)}),(0,N.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(c.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!n,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>T(!0),children:e(c.SETTINGS$PLUGINS_ADD_BUTTON)})]}),F&&(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!F&&E.length===0&&(0,N.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(c.SETTINGS$PLUGINS_NO_PLUGINS)})}),!F&&E.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(I,{search:_,onSearchChange:v,statusFilter:b,onStatusFilterChange:x}),D.length===0?(0,N.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(c.SETTINGS$PLUGINS_NO_MATCH)})}):(0,N.jsx)(`section`,{className:g(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,N.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:D.map(e=>(0,N.jsx)(P,{plugin:e,isBusy:Y(e),isDisabled:!n,onOpen:()=>C(e.name),onInstall:()=>X(e),onToggle:t=>Z(e,t)},e.name))})})]}),O&&(0,N.jsx)(L,{plugin:O,isBusy:Y(O),isDisabled:!n,onToggle:e=>Z(O,e),onInstall:()=>X(O),onUninstall:()=>Q(O),onRefresh:()=>$(O),onClose:()=>C(null)}),w&&(0,N.jsx)(z,{onClose:()=>T(!1)})]})})]})});export{J 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-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useQuery-CpjHYtZc.js";import{t as s}from"./useTranslation-Cgy4JA_g.js";import{t as c}from"./declaration-B9kpCaYl.js";import{A as l,N as u,j as d,n as f,u as p}from"./active-backend-context-u2tdYRgH.js";import{t as m}from"./search-4DHskuhE.js";import{t as h}from"./x-Cb0WAtak.js";import{t as g}from"./utils-CE0lDWtb.js";import{t as _}from"./modal-backdrop-zVwfOJZr.js";import{n as v}from"./modal-classes-DPqxSyuP.js";import{t as y}from"./brand-button-DKPMEKcW.js";import{t as b}from"./modal-close-button-CTCX4nCH.js";import{t as x}from"./settings-input-DYs7t3oK.js";import{t as S}from"./plugins-management-service-BAp70KN7.js";import{a as C,i as w,r as T}from"./extension-module-card-classes-9V3J9J_b.js";import{t as E}from"./settings-switch-C2N2xqEb.js";import{n as D}from"./circle-plus-check-toggle-T3eAIuPQ.js";import{n as O,t as k}from"./use-plugins-marketplace-BGb-KgfD.js";import{n as A}from"./extensions-navigation-Di9rJ-b5.js";import{n as j}from"./settings-like-page-layout-classes-DENKlZpD.js";var M=e(t(),1),N=n();function P({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:a}){let{t:o}=s(`openhands`);return(0,N.jsxs)(`div`,{"data-testid":`plugin-card-${e.name}`,role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:g(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,C,T),children:[(0,N.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,N.jsx)(`p`,{"data-testid":`plugin-source-${e.name}`,className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}):null]}),e.installed?(0,N.jsx)(D,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:a,disableTooltipKey:c.COMMON$DISABLE}):e.isLocal?(0,N.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:g(w,`flex-shrink-0`),children:o(c.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:o(t?c.SETTINGS$PLUGINS_INSTALLING:c.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,N.jsx)(`p`,{"data-testid":`plugin-description-${e.name}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null,(e.installed||e.isLocal)&&e.version?(0,N.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:g(w,`self-start`),children:o(c.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var F=[{value:`all`,labelKey:c.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:c.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:c.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:c.SETTINGS$PLUGINS_FILTER_LOCAL}];function I({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=s(`openhands`);return(0,N.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,N.jsxs)(`div`,{className:g(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,N.jsx)(m,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,N.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(c.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(c.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:g(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(c.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,N.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,N.jsx)(`div`,{"data-testid":`plugins-status-filter`,className:`flex shrink-0 items-center gap-1 rounded-lg border border-[var(--oh-border)] bg-base-secondary p-1`,children:F.map(e=>(0,N.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:g(`cursor-pointer rounded-md px-3 py-1 text-xs transition-colors`,n===e.value?`bg-surface-raised text-white`:`text-tertiary-alt hover:text-white`),children:i(e.labelKey)},e.value))})]})}function L({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:a,onRefresh:o,onClose:l}){let{t:u}=s(`openhands`),d=n||t;return(0,N.jsx)(_,{onClose:l,"aria-label":e.name,children:(0,N.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,N.jsx)(b,{onClose:l,testId:`plugin-detail-modal-close`}),(0,N.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,N.jsx)(`h2`,{className:g(`pr-6`,v),children:e.name}),e.source?(0,N.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,N.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,N.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,N.jsx)(`span`,{className:w,children:u(c.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,N.jsx)(`span`,{className:w,children:u(c.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,N.jsxs)(`span`,{className:w,children:[u(c.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,N.jsxs)(`span`,{className:w,children:[u(c.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,N.jsx)(E,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?c.SETTINGS$SKILLS_ENABLED:c.SETTINGS$SKILLS_DISABLED)}):null]}),(0,N.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:o,children:u(c.SETTINGS$PLUGINS_REFRESH)}),(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:a,children:u(c.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,N.jsx)(y,{type:`button`,variant:`primary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?c.SETTINGS$PLUGINS_INSTALLING:c.SETTINGS$PLUGINS_INSTALL)}),(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:l,children:u(c.BUTTON$CLOSE)})]})]})})}function R(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>S.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed}),e.invalidateQueries({queryKey:p.marketplace}),d(t(c.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}function z({onClose:e,onInstalled:t}){let{t:n}=s(`openhands`),r=R(),[i,a]=M.useState(``),[o,l]=M.useState(``),[u,d]=M.useState(``),f=i.trim(),p=f.length>0&&!r.isPending;return(0,N.jsx)(_,{onClose:e,"aria-label":n(c.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,N.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),p&&r.mutate({source:f,ref:o.trim()||null,repo_path:u.trim()||null},{onSuccess:()=>{t?.(),e()}})},"data-testid":`add-plugin-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,N.jsx)(b,{onClose:e,testId:`add-plugin-modal-close`}),(0,N.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,N.jsx)(`h2`,{className:g(`pr-6`,v),children:n(c.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,N.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(c.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,N.jsx)(x,{testId:`add-plugin-source-input`,label:n(c.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:a,placeholder:n(c.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,N.jsx)(x,{testId:`add-plugin-ref-input`,label:n(c.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:o,onChange:l,showOptionalTag:!0}),(0,N.jsx)(x,{testId:`add-plugin-repo-path-input`,label:n(c.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:u,onChange:d,showOptionalTag:!0})]}),(0,N.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,N.jsx)(y,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(c.BUTTON$CLOSE)}),(0,N.jsx)(y,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!p,children:n(r.isPending?c.SETTINGS$PLUGINS_INSTALLING:c.SETTINGS$PLUGINS_INSTALL)})]})]})})}function B(e,t,n=void 0){let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,description:t.description,source:t.source,ref:t.ref??null,repoPath:t.repo_path??null,installed:t.installed,enabled:!1,version:null,inCatalog:!0,isLocal:!1});for(let e of t??[]){let t=r.get(e.name);r.set(e.name,{name:e.name,description:t?.description??e.description??null,source:e.source??t?.source??null,ref:e.resolved_ref??t?.ref??null,repoPath:e.repo_path??t?.repoPath??null,installed:!0,enabled:e.enabled,version:e.version??null,inCatalog:t?.inCatalog??!1,isLocal:!1})}for(let e of n??[])r.has(e.name)||r.set(e.name,{name:e.name,description:e.description||null,source:null,ref:null,repoPath:null,installed:!1,enabled:!1,version:e.version||null,inCatalog:!1,isLocal:!0});let i=e=>e.installed?0:e.isLocal?1:2;return Array.from(r.values()).sort((e,t)=>{let n=i(e)-i(t);return n===0?e.name.localeCompare(t.name):n})}function V(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description??``,e.source??``,e.repoPath??``,e.ref??``].some(e=>e.toLowerCase().includes(n)):!0}function H(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var U=()=>o({queryKey:p.installed,queryFn:()=>S.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),W=()=>o({queryKey:p.local,queryFn:()=>O.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1});function G(){let e=i(),{t}=s(`openhands`);return a({mutationFn:({name:e,enabled:t})=>S.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed})},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}function K(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>S.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed}),e.invalidateQueries({queryKey:p.marketplace}),d(t(c.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}function q(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>S.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:p.installed}),d(t(c.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{l(u(e)||t(c.ERROR$GENERIC))}})}var J=r(function(){let{t:e}=s(`openhands`),{backend:t}=f(),n=t.kind===`local`,{data:r,isLoading:i}=k(),{data:a,isLoading:o}=U(),{data:l,isLoading:u}=W(),d=R(),p=G(),m=K(),h=q(),[_,v]=M.useState(``),[b,x]=M.useState(`all`),[S,C]=M.useState(null),[w,T]=M.useState(!1),E=M.useMemo(()=>B(r,a,l),[r,a,l]),D=M.useMemo(()=>E.filter(e=>H(e,b)&&V(e,_)),[E,b,_]),O=S?E.find(e=>e.name===S)??null:null,F=i||o||u,J=(p.isPending?p.variables?.name:void 0)??(m.isPending?m.variables:void 0)??(h.isPending?h.variables:void 0)??null,Y=e=>J===e.name||d.isPending&&d.variables?.source===e.source,X=e=>{e.source&&d.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},Z=(e,t)=>{p.mutate({name:e.name,enabled:t})},Q=e=>{m.mutate(e.name,{onSuccess:()=>C(null)})},$=e=>{h.mutate(e.name)};return(0,N.jsxs)(`div`,{"data-testid":`skills-plugins-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,N.jsx)(A,{}),(0,N.jsx)(`main`,{className:g(j,`h-full`),children:(0,N.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(c.SETTINGS$PLUGINS_TITLE)}),(0,N.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(c.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,N.jsx)(y,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!n,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>T(!0),children:e(c.SETTINGS$PLUGINS_ADD_BUTTON)})]}),F&&(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!F&&E.length===0&&(0,N.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(c.SETTINGS$PLUGINS_NO_PLUGINS)})}),!F&&E.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(I,{search:_,onSearchChange:v,statusFilter:b,onStatusFilterChange:x}),D.length===0?(0,N.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(c.SETTINGS$PLUGINS_NO_MATCH)})}):(0,N.jsx)(`section`,{className:g(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,N.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:D.map(e=>(0,N.jsx)(P,{plugin:e,isBusy:Y(e),isDisabled:!n,onOpen:()=>C(e.name),onInstall:()=>X(e),onToggle:t=>Z(e,t)},e.name))})})]}),O&&(0,N.jsx)(L,{plugin:O,isBusy:Y(O),isDisabled:!n,onToggle:e=>Z(O,e),onInstall:()=>X(O),onUninstall:()=>Q(O),onRefresh:()=>$(O),onClose:()=>C(null)}),w&&(0,N.jsx)(z,{onClose:()=>T(!1)})]})})]})});export{J 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}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{t as i}from"./Trans-De9RwQhA.js";import{t as a}from"./useTranslation-Cgy4JA_g.js";import{t as o}from"./declaration-B9kpCaYl.js";import{A as s,N as c}from"./active-backend-context-DRFevVIj.js";import{t as l}from"./search-4DHskuhE.js";import{t as u}from"./x-Cb0WAtak.js";import{t as d}from"./utils-CE0lDWtb.js";import{t as f}from"./modal-backdrop-zVwfOJZr.js";import{n as p}from"./modal-classes-DPqxSyuP.js";import{t as m}from"./brand-button-DKPMEKcW.js";import{t as h}from"./modal-close-button-CTCX4nCH.js";import{r as g}from"./use-settings-B07msZ2Z.js";import{t as _}from"./skills-9cDZONKh.js";import{t as v}from"./use-save-settings-5xPYpSQM.js";import{t as y}from"./checkmark-h7udgXMM.js";import{t as b}from"./copy-BLmGeJcd.js";import{a as x,r as S}from"./extension-module-card-classes-9V3J9J_b.js";import{t as C}from"./settings-switch-C2N2xqEb.js";import{n as w,t as T}from"./skill-card-pill-row-D2bUe2kB.js";import{n as E}from"./circle-plus-check-toggle-T3eAIuPQ.js";import{t as D}from"./use-skills-Aoaoq_ei.js";import{n as O}from"./extensions-navigation-BtV14oQL.js";import{n as k,t as A}from"./use-launch-skill-in-chat-BnoDgvAy.js";import{t as j}from"./enum-filter-dropdown-DCITiYVi.js";import{n as ee}from"./settings-like-page-layout-classes-DENKlZpD.js";var M=e(t(),1),N=n();function P({skillName:e,className:t}){return(0,N.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:d(`inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden`,`rounded-lg border border-white/10 bg-surface-raised text-white`,`shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,`[&>svg]:h-5 [&>svg]:w-5`,t),children:(0,N.jsx)(_,{})})}var F=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function te(e){let t=e.match(/^description:\s*\|\s*\r?\n((?:[ \t].*(?:\r?\n|$))+)/m);if(t)return t[1].replace(/^[ \t]+/gm,``).trim();let n=e.match(/^description:\s*['"](.+?)['"]\s*$/m);if(n)return n[1].trim();let r=e.match(/^description:\s*(.+)\s*$/m);return r?r[1].trim():null}function ne(e){let t=e.match(F);return t?e.slice(t[0].length).trim():e.trim()}function re(e){let t=e.replace(/^#+\s+[^\n]+\n+/,``).trim();return t.split(/\n\s*\n/).map(e=>e.replace(/\s+/g,` `).trim()).find(e=>e.length>0)??t.replace(/\s+/g,` `).trim()}function I(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(F);if(r){let e=te(r[1]);if(e)return e}return re(ne(n))}var L=`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-text-secondary/35 bg-text-secondary/12 px-2 py-0.5 text-[11px] font-medium leading-4 text-tertiary-light`,R={agentskills:{labelKey:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:o.SETTINGS$SKILLS_TYPE_REPO}};function z({type:e}){let{t}=a(`openhands`),n=R[e];return(0,N.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:L,children:t(n.labelKey)})}function B(e,t,n){if(e)return`${e}-${t}-${n}`}function V(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=[{id:`type-${e.type}`,node:(0,N.jsx)(z,{type:e.type})}];if(e.version&&a.push({id:`version-${e.version}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`version`)??`skill-version-${e.name}`,className:T,children:t(o.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&a.push({id:`license-${e.license}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`license`),className:T,children:e.license})}),r===`detail`&&e.compatibility&&a.push({id:`compatibility-${e.compatibility}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`compatibility`),className:T,children:e.compatibility})}),e.disable_model_invocation&&a.push({id:`disable-model-invocation`,node:(0,N.jsxs)(`span`,{"data-testid":B(i,e.name,`disable-model-invocation`)??`skill-disable-model-invocation-${e.name}`,className:`inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium leading-4 text-[#fca5a5]`,children:[(0,N.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(o.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)a.push({id:`allowed-tool-${t}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`tool-${t}`),className:d(T,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))a.push({id:`metadata-${t}`,node:(0,N.jsxs)(`span`,{"data-testid":B(i,e.name,`metadata-${t}`),className:T,children:[(0,N.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])a.push({id:`trigger-${t}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`trigger-${t}`),className:T,children:t})});return a}function H(e){let t=e?.trim();return t?!!(/^https?:\/\//i.test(t)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`~`)||/^[A-Za-z]:[\\/]/.test(t)||t.includes(`/`)||t.includes(`\\`)):!1}function U({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[s,c]=M.useState(!1),l=I(e),u=M.useMemo(()=>V(e,i),[e,i]),f=H(e.source);return M.useEffect(()=>{if(!s)return;let e=setTimeout(()=>c(!1),2e3);return()=>clearTimeout(e)},[s]),(0,N.jsx)(`div`,{"data-testid":`skill-card-${e.name}`,role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:d(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,x,S),children:(0,N.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,N.jsx)(P,{skillName:e.name}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,N.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,N.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,N.jsx)(`p`,{"data-testid":`skill-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),f?(0,N.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(s?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:s,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),c(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:s?(0,N.jsx)(y,{width:12,height:12}):(0,N.jsx)(b,{width:12,height:12})}):null]}):null]}),(0,N.jsx)(E,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:o.COMMON$DISABLE})]}),l?(0,N.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,N.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:l})}):null,u.length>0?(0,N.jsx)(w,{pills:u,testId:`skill-triggers-${e.name}`}):null]})]})})}var W=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,G=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`;function K(e){return e.name===`add-skill`?G:`/${e.name} `}function q({testId:e,label:t,value:n}){return(0,N.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:t}),(0,N.jsx)(`textarea`,{"data-testid":e,readOnly:!0,value:n,rows:Math.min(12,Math.max(4,n.split(`
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-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{t as i}from"./Trans-De9RwQhA.js";import{t as a}from"./useTranslation-Cgy4JA_g.js";import{t as o}from"./declaration-B9kpCaYl.js";import{A as s,N as c}from"./active-backend-context-u2tdYRgH.js";import{t as l}from"./search-4DHskuhE.js";import{t as u}from"./x-Cb0WAtak.js";import{t as d}from"./utils-CE0lDWtb.js";import{t as f}from"./modal-backdrop-zVwfOJZr.js";import{n as p}from"./modal-classes-DPqxSyuP.js";import{t as m}from"./brand-button-DKPMEKcW.js";import{t as h}from"./modal-close-button-CTCX4nCH.js";import{r as g}from"./use-settings-dX4fKUPF.js";import{t as _}from"./skills-9cDZONKh.js";import{t as v}from"./use-save-settings-CChDyjOB.js";import{t as y}from"./checkmark-h7udgXMM.js";import{t as b}from"./copy-BLmGeJcd.js";import{a as x,r as S}from"./extension-module-card-classes-9V3J9J_b.js";import{t as C}from"./settings-switch-C2N2xqEb.js";import{n as w,t as T}from"./skill-card-pill-row-D2bUe2kB.js";import{n as E}from"./circle-plus-check-toggle-T3eAIuPQ.js";import{t as D}from"./use-skills-Dqo-pDDx.js";import{n as O}from"./extensions-navigation-Di9rJ-b5.js";import{n as k,t as A}from"./use-launch-skill-in-chat-BnoDgvAy.js";import{t as j}from"./enum-filter-dropdown-DCITiYVi.js";import{n as ee}from"./settings-like-page-layout-classes-DENKlZpD.js";var M=e(t(),1),N=n();function P({skillName:e,className:t}){return(0,N.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:d(`inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden`,`rounded-lg border border-white/10 bg-surface-raised text-white`,`shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,`[&>svg]:h-5 [&>svg]:w-5`,t),children:(0,N.jsx)(_,{})})}var F=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function te(e){let t=e.match(/^description:\s*\|\s*\r?\n((?:[ \t].*(?:\r?\n|$))+)/m);if(t)return t[1].replace(/^[ \t]+/gm,``).trim();let n=e.match(/^description:\s*['"](.+?)['"]\s*$/m);if(n)return n[1].trim();let r=e.match(/^description:\s*(.+)\s*$/m);return r?r[1].trim():null}function ne(e){let t=e.match(F);return t?e.slice(t[0].length).trim():e.trim()}function re(e){let t=e.replace(/^#+\s+[^\n]+\n+/,``).trim();return t.split(/\n\s*\n/).map(e=>e.replace(/\s+/g,` `).trim()).find(e=>e.length>0)??t.replace(/\s+/g,` `).trim()}function I(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(F);if(r){let e=te(r[1]);if(e)return e}return re(ne(n))}var L=`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-text-secondary/35 bg-text-secondary/12 px-2 py-0.5 text-[11px] font-medium leading-4 text-tertiary-light`,R={agentskills:{labelKey:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:o.SETTINGS$SKILLS_TYPE_REPO}};function z({type:e}){let{t}=a(`openhands`),n=R[e];return(0,N.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:L,children:t(n.labelKey)})}function B(e,t,n){if(e)return`${e}-${t}-${n}`}function V(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=[{id:`type-${e.type}`,node:(0,N.jsx)(z,{type:e.type})}];if(e.version&&a.push({id:`version-${e.version}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`version`)??`skill-version-${e.name}`,className:T,children:t(o.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&a.push({id:`license-${e.license}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`license`),className:T,children:e.license})}),r===`detail`&&e.compatibility&&a.push({id:`compatibility-${e.compatibility}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`compatibility`),className:T,children:e.compatibility})}),e.disable_model_invocation&&a.push({id:`disable-model-invocation`,node:(0,N.jsxs)(`span`,{"data-testid":B(i,e.name,`disable-model-invocation`)??`skill-disable-model-invocation-${e.name}`,className:`inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium leading-4 text-[#fca5a5]`,children:[(0,N.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(o.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)a.push({id:`allowed-tool-${t}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`tool-${t}`),className:d(T,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))a.push({id:`metadata-${t}`,node:(0,N.jsxs)(`span`,{"data-testid":B(i,e.name,`metadata-${t}`),className:T,children:[(0,N.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])a.push({id:`trigger-${t}`,node:(0,N.jsx)(`span`,{"data-testid":B(i,e.name,`trigger-${t}`),className:T,children:t})});return a}function H(e){let t=e?.trim();return t?!!(/^https?:\/\//i.test(t)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`~`)||/^[A-Za-z]:[\\/]/.test(t)||t.includes(`/`)||t.includes(`\\`)):!1}function U({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[s,c]=M.useState(!1),l=I(e),u=M.useMemo(()=>V(e,i),[e,i]),f=H(e.source);return M.useEffect(()=>{if(!s)return;let e=setTimeout(()=>c(!1),2e3);return()=>clearTimeout(e)},[s]),(0,N.jsx)(`div`,{"data-testid":`skill-card-${e.name}`,role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:d(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,x,S),children:(0,N.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,N.jsx)(P,{skillName:e.name}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,N.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,N.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,N.jsx)(`p`,{"data-testid":`skill-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),f?(0,N.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(s?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:s,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),c(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:s?(0,N.jsx)(y,{width:12,height:12}):(0,N.jsx)(b,{width:12,height:12})}):null]}):null]}),(0,N.jsx)(E,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:o.COMMON$DISABLE})]}),l?(0,N.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,N.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:l})}):null,u.length>0?(0,N.jsx)(w,{pills:u,testId:`skill-triggers-${e.name}`}):null]})]})})}var W=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,G=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`;function K(e){return e.name===`add-skill`?G:`/${e.name} `}function q({testId:e,label:t,value:n}){return(0,N.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:t}),(0,N.jsx)(`textarea`,{"data-testid":e,readOnly:!0,value:n,rows:Math.min(12,Math.max(4,n.split(`
2
2
  `).length)),className:d(`bg-[var(--oh-surface-raised)] border border-[var(--oh-border-subtle)] w-full min-w-0 rounded-sm p-2 text-sm`,`cursor-not-allowed resize-none custom-scrollbar`)})]})}function J({skill:e,enabled:t,onToggle:n,onClose:r}){let{t:i}=a(`openhands`),s=A(),[c,l]=M.useState(!1),u=M.useMemo(()=>K(e),[e]),d=I(e),g=M.useMemo(()=>V(e,i,{variant:`detail`,testIdPrefix:`skill-modal-pill`}),[e,i]),_=H(e.source);return M.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,N.jsx)(f,{onClose:r,"aria-label":e.name,children:(0,N.jsxs)(`div`,{"data-testid":`skill-detail-modal`,"data-skill-name":e.name,className:`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar`,children:[(0,N.jsx)(h,{onClose:r,testId:`skill-detail-modal-close`}),(0,N.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,N.jsx)(P,{skillName:e.name}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h2`,{"data-testid":`skill-modal-name-${e.name}`,className:p,children:e.name}),e.source?(0,N.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,N.jsx)(`p`,{"data-testid":`skill-modal-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),_?(0,N.jsx)(`button`,{type:`button`,"data-testid":`skill-modal-copy-source-${e.name}`,"aria-label":i(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async()=>{e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,N.jsx)(y,{width:12,height:12}):(0,N.jsx)(b,{width:12,height:12})}):null]}):null]})]}),(0,N.jsx)(`div`,{"data-testid":`skill-modal-enable-row-${e.name}`,className:`flex w-full items-center rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:(0,N.jsx)(C,{testId:`skill-modal-toggle-${e.name}`,isToggled:t,onToggle:n,togglePosition:`right`,children:i(t?o.SETTINGS$SKILLS_ENABLED:o.SETTINGS$SKILLS_DISABLED)})}),d?(0,N.jsx)(`p`,{"data-testid":`skill-modal-description-${e.name}`,className:`text-xs text-tertiary-light`,children:d}):null,g.length>0?(0,N.jsx)(w,{pills:g,testId:`skill-modal-pills-${e.name}`}):null,e.content?(0,N.jsx)(q,{testId:`skill-modal-field-content-${e.name}`,label:i(o.SETTINGS$SKILLS_CONTENT),value:e.content}):null,(0,N.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,N.jsx)(m,{type:`button`,variant:`secondary`,onClick:r,testId:`skill-detail-close`,children:i(o.BUTTON$CLOSE)}),(0,N.jsx)(m,{type:`button`,variant:`primary`,isDisabled:!t,onClick:()=>s(u,r),testId:`skill-detail-use-skill-${e.name}`,startContent:(0,N.jsx)(k,{className:`size-4`,"aria-hidden":!0}),children:i(o.SETTINGS$SKILLS_USE_SKILL_BUTTON)})]})]})})}var Y=[o.SETTINGS$SKILLS_ADD_MODAL_STEP_1,o.SETTINGS$SKILLS_ADD_MODAL_STEP_2,o.SETTINGS$SKILLS_ADD_MODAL_STEP_3,o.SETTINGS$SKILLS_ADD_MODAL_STEP_4,o.SETTINGS$SKILLS_ADD_MODAL_STEP_5],X={cmd:(0,N.jsx)(Z,{}),path:(0,N.jsx)(Z,{}),env:(0,N.jsx)(Z,{})};function Z({children:e}){return(0,N.jsx)(`code`,{className:d(`mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white`),children:e})}function ie(){let{t:e}=a(`openhands`),[t,n]=M.useState(!1);return M.useEffect(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(`pre`,{"data-testid":`add-skill-modal-example`,className:d(`overflow-x-auto rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] p-2 pr-10 text-xs text-white`),children:G}),(0,N.jsx)(`button`,{type:`button`,"data-testid":`add-skill-modal-example-copy`,"aria-label":e(t?o.BUTTON$COPIED:o.BUTTON$COPY),disabled:t,onClick:async()=>{await navigator.clipboard.writeText(G),n(!0)},className:d(`absolute right-2 top-2 cursor-pointer rounded-sm border border-[var(--oh-border-subtle)]`,`bg-base-secondary p-1 text-tertiary-alt transition-colors`,`hover:bg-[var(--oh-surface)] hover:text-white disabled:cursor-default [&_path]:fill-current`),children:t?(0,N.jsx)(y,{width:14,height:14}):(0,N.jsx)(b,{width:14,height:14})})]})}function Q({i18nKey:e}){return(0,N.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:(0,N.jsx)(i,{ns:`openhands`,i18nKey:e,components:X})})}function ae({onClose:e}){let{t}=a(`openhands`);return(0,N.jsx)(f,{onClose:e,"aria-label":t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE),children:(0,N.jsxs)(`div`,{"data-testid":`add-skill-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,N.jsx)(h,{onClose:e,testId:`add-skill-modal-close`}),(0,N.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,N.jsx)(`h2`,{className:d(`pr-6`,p),children:t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE)}),(0,N.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_INTRO)})]}),(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,N.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}),(0,N.jsx)(Q,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}),(0,N.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}),(0,N.jsx)(ie,{}),(0,N.jsx)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light`,children:Y.map(e=>(0,N.jsx)(`li`,{children:e===o.SETTINGS$SKILLS_ADD_MODAL_STEP_3?(0,N.jsx)(i,{ns:`openhands`,i18nKey:e,components:X}):t(e)},e))})]}),(0,N.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}),(0,N.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)})]}),(0,N.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}),(0,N.jsx)(Q,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY})]}),(0,N.jsx)(Q,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}),(0,N.jsx)(`a`,{href:W,target:`_blank`,rel:`noreferrer`,"data-testid":`add-skill-modal-docs-link`,className:`self-start text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)})]}),(0,N.jsx)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:(0,N.jsx)(m,{type:`button`,variant:`secondary`,onClick:e,testId:`add-skill-modal-dismiss`,children:t(o.BUTTON$CLOSE)})})]})})}var oe=[`all`,`agentskills`,`knowledge`,`repo`],$={all:o.SETTINGS$SKILLS_TYPE_ALL,agentskills:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS,knowledge:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE,repo:o.SETTINGS$SKILLS_TYPE_REPO};function se({value:e,onChange:t}){return(0,N.jsx)(j,{testId:`skills-type-filter`,value:e,onChange:t,options:oe,labelKeyByValue:$})}function ce({search:e,onSearchChange:t,typeFilter:n,onTypeFilterChange:r}){let{t:i}=a(`openhands`);return(0,N.jsxs)(`div`,{"data-testid":`skills-toolbar`,className:`flex items-stretch gap-2`,children:[(0,N.jsxs)(`div`,{className:d(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,N.jsx)(l,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,N.jsx)(`input`,{"data-testid":`skills-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),"aria-label":i(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),className:d(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,N.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(o.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,N.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,N.jsx)(se,{value:n,onChange:r})]})}function le(e,t){if(!t)return!0;let n=[e.name,I(e),e.description??``,e.content??``,e.license??``,e.compatibility??``,...e.triggers??[],...e.allowed_tools??[]],r=t.toLowerCase();return n.some(e=>e.toLowerCase().includes(r))}function ue(){let{t:e}=a(`openhands`),{mutate:t}=v(),{data:n,isLoading:r}=g(),{data:i,isLoading:l}=D(),[u,f]=M.useState(new Set),[p,h]=M.useState(!1),[_,y]=M.useState(``),[b,x]=M.useState(`all`),[S,C]=M.useState(null),[w,T]=M.useState(!1);M.useEffect(()=>{r||!n||(f(new Set(n.disabled_skills??[])),h(!0))},[r,n?.disabled_skills]);let E=(e,t)=>{f(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r})};M.useEffect(()=>{p&&t({disabled_skills:Array.from(u)},{onError:t=>{s(c(t)||e(o.ERROR$GENERIC))}})},[u,p,t,e]);let k=r||l||!n,A=M.useMemo(()=>i?i.filter(e=>(b===`all`||e.type===b)&&le(e,_)):[],[i,b,_]);return(0,N.jsxs)(`div`,{"data-testid":`skills-settings-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,N.jsx)(O,{}),(0,N.jsx)(`main`,{className:d(ee,`h-full`),children:(0,N.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(o.SETTINGS$SKILLS_TITLE)}),(0,N.jsx)(`div`,{"data-testid":`skills-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(o.SETTINGS$SKILLS_PAGE_DESCRIPTION)})]}),(0,N.jsx)(m,{type:`button`,variant:`secondary`,testId:`skills-add-skill-button`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>T(!0),children:e(o.SETTINGS$SKILLS_ADD_BUTTON)})]}),k&&(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!k&&(!i||i.length===0)&&(0,N.jsx)(`div`,{"data-testid":`skills-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(o.SETTINGS$SKILLS_NO_SKILLS)})}),!k&&i&&i.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ce,{search:_,onSearchChange:y,typeFilter:b,onTypeFilterChange:x}),A.length===0?(0,N.jsx)(`div`,{"data-testid":`skills-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(o.SETTINGS$SKILLS_NO_MATCH)})}):(0,N.jsx)(`section`,{className:d(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,N.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:A.map(e=>(0,N.jsx)(U,{skill:e,enabled:!u.has(e.name),onOpen:()=>C(e),onToggle:t=>E(e.name,t)},e.name))})})]}),S&&(0,N.jsx)(J,{skill:S,enabled:!u.has(S.name),onToggle:e=>E(S.name,e),onClose:()=>C(null)}),w&&(0,N.jsx)(ae,{onClose:()=>T(!1)})]})})]})}var de=r(ue);export{de as default};
@@ -1,3 +1,3 @@
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-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{t as a}from"./square-chevron-right-Czw3FFWc.js";import{t as o,w as s}from"./utils-CE0lDWtb.js";import{t as c}from"./use-agent-state-BvRcEzY4.js";import{t as l}from"./command-store-D8J5LMW1.js";import{t as u}from"./runtime-waiting-state-DkzLgvMn.js";import{n as d,t as f}from"./vendor~terminal-aeP3PnKf.js";import{t as p}from"./conversation-tab-empty-state-m8IUkfMj.js";var m=e(t(),1),h=`[Python Interpreter: `,g=e=>{let t=e.indexOf(h);if(t<0)return e;let n=t+21;return e.indexOf(`]`,n)<=n?e:e.substring(0,t).trim()},_=(e,t,n=!1)=>{let{content:r,type:i}=e;if(i===`input`&&n)return;let a=(r||``).replaceAll(`
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-Cgy4JA_g.js";import{t as i}from"./declaration-B9kpCaYl.js";import{t as a}from"./square-chevron-right-Czw3FFWc.js";import{t as o,w as s}from"./utils-CE0lDWtb.js";import{t as c}from"./use-agent-state-Buh3bQDh.js";import{t as l}from"./command-store-D8J5LMW1.js";import{t as u}from"./runtime-waiting-state-DkzLgvMn.js";import{n as d,t as f}from"./vendor~terminal-aeP3PnKf.js";import{t as p}from"./conversation-tab-empty-state-m8IUkfMj.js";var m=e(t(),1),h=`[Python Interpreter: `,g=e=>{let t=e.indexOf(h);if(t<0)return e;let n=t+21;return e.indexOf(`]`,n)<=n?e:e.substring(0,t).trim()},_=(e,t,n=!1)=>{let{content:r,type:i}=e;if(i===`input`&&n)return;let a=(r||``).replaceAll(`
2
2
  `,`\r
3
3
  `).trim();a&&t.writeln(g(a))},v=(e,t,n)=>{if(!e||!t||!n||window.getComputedStyle(n).display===`none`)return!1;let{clientWidth:r,clientHeight:i}=n;return!(r===0||i===0||!e.element)};function y(e){let t=e.ownerDocument.createElement(`span`);t.style.color=`var(--oh-surface-foreground)`,t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.pointerEvents=`none`,e.appendChild(t);let n=getComputedStyle(t).color;return t.remove(),n&&n!==`rgba(0, 0, 0, 0)`?n:getComputedStyle(e).color}var b={current:0},x=()=>{let e=l(e=>e.commands),t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),i=b,a=m.useRef(!1),o=e=>new f({fontFamily:`Menlo, Monaco, 'Courier New', monospace`,fontSize:14,scrollback:1e4,scrollSensitivity:1,fastScrollSensitivity:5,disableStdin:!0,allowTransparency:!0,theme:{background:`rgba(0, 0, 0, 0)`,foreground:y(e)}}),s=m.useCallback(()=>{a.current||v(t.current,n.current,r.current)&&n.current.fit()},[]),c=()=>{t.current&&(n.current&&t.current.loadAddon(n.current),r.current&&(t.current.open(r.current),t.current.write(`\x1B[?25l`),s()))};return m.useEffect(()=>{a.current=!1;let s=r.current;if(s){if(t.current=o(s),n.current=new d,r.current&&(c(),e.length>0)){for(let n=0;n<e.length;n+=1)e[n].type===`input`&&t.current.write(`$ `),_(e[n],t.current,!1);i.current=e.length}return()=>{a.current=!0,t.current?.dispose(),i.current=0}}},[]),m.useEffect(()=>{if(t.current&&e.length>0&&i.current<e.length){for(let n=i.current;n<e.length;n+=1)e[n].type===`input`&&t.current.write(`$ `),_(e[n],t.current,!1);i.current=e.length}},[e]),m.useEffect(()=>{let e=null;return e=new ResizeObserver(()=>{requestAnimationFrame(()=>{s()})}),r.current&&e.observe(r.current),()=>{e?.disconnect()}},[s]),r},S=n();function C({className:e,testId:t}){return(0,S.jsx)(u,{testId:t,className:e})}function w(){let{t:e}=r(`openhands`);return(0,S.jsx)(p,{className:`h-full`,icon:(0,S.jsx)(a,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(i.TERMINAL$NO_OUTPUT)})}function T(){let{curAgentState:e}=c(),t=l(e=>e.commands),n=s.includes(e),r=t.length>0,i=n||!r,a=x();return(0,S.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[n&&(0,S.jsx)(C,{className:`pt-16`}),!n&&!r&&(0,S.jsx)(w,{}),(0,S.jsx)(`div`,{className:o(`flex-1 min-h-0 p-4`,i&&`pointer-events-none absolute inset-0 h-0 w-0 overflow-hidden p-0 opacity-0`),children:(0,S.jsx)(`div`,{ref:a,className:`h-full w-full`})})]})}export{T 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{n as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as i}from"./useQuery-CpjHYtZc.js";import{t as a}from"./useTranslation-Cgy4JA_g.js";import{t as o}from"./declaration-B9kpCaYl.js";import{p as s}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{A as c,M as l,N as u,j as d,n as f}from"./active-backend-context-DRFevVIj.js";import{t as p}from"./check-Bvi71siz.js";import{t as m}from"./loader-circle-BEykUKYG.js";import{t as h}from"./utils-CE0lDWtb.js";import{n as g}from"./agent-server-client-options-DVLRd9sw.js";import{l as _}from"./form-control-classes-9rkU4usZ.js";import{n as v,t as y}from"./settings-input-DYs7t3oK.js";import{a as b,l as x}from"./acp-providers-D_D8VUpP.js";import{n as S,t as C}from"./use-create-secret-BKeXCo__.js";var w=e(t(),1),T=n();function E({conflicts:e}){let{t}=a(`openhands`);return(0,T.jsx)(T.Fragment,{children:e.map(([e,n])=>(0,T.jsx)(`p`,{"data-testid":`acp-credential-conflict-warning`,className:`text-sm text-amber-300`,children:t(o.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function D({status:e,isChecking:t,providerName:n,testIdPrefix:r}){let{t:i}=a(`openhands`);return e===`authenticated`?(0,T.jsxs)(`div`,{"data-testid":`${r}-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,T.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:i(o.ONBOARDING$ACP_AUTH_DETECTED,{provider:n})})]}):t?(0,T.jsxs)(`div`,{"data-testid":`${r}-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,T.jsx)(m,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:i(o.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):null}function O({field:e,value:t,onChange:n,alreadySet:r,testId:i,showOptionalTag:s}){let{t:c}=a(`openhands`),l=r?c(o.ONBOARDING$ACP_SECRET_ALREADY_SET):``;return(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.multiline?(0,T.jsxs)(`label`,{className:`flex flex-col gap-2.5`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-mono text-white`,children:e.name}),s&&(0,T.jsx)(v,{})]}),(0,T.jsx)(`textarea`,{"data-testid":i,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:l,onChange:e=>n(e.target.value),className:h(_,`font-mono text-xs`)})]}):(0,T.jsx)(y,{testId:i,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:s,placeholder:l}),(0,T.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:c(e.hint_key,e.hint_values)})]})}var k=10;function A(e){return`${e.stdout??``}\n${e.stderr??``}`}function j(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function M(e){let t=A(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function N(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var P={"claude-code":{command:`claude auth status --json`,classify:j},codex:{command:`codex login status`,classify:M},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:N}},F=class{static async getAuthStatus(e){let t=P[e];if(!t)return`unknown`;let n=await new s(g()).executeCommand(t.command,void 0,k);return t.classify(n)}};async function I(e){try{return await F.getAuthStatus(e)}catch{return`unknown`}}function L(e,t={}){let{enabled:n=!0}=t,r=f(),a=r.backend.kind===`local`,o=n&&a&&!!e,s=i({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>I(e),enabled:o,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:o&&s.isFetching&&s.data===void 0,isSupported:a}}function R(e,t){let{t:n}=a(`openhands`),i=r(),{mutateAsync:s}=C(),[f,p]=w.useState(!1);return{saveFilled:async(r,{silent:a=!1}={})=>{let f=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(f.length===0)return!0;p(!0);try{for(let{field:e,value:t}of f)await s({name:e.name,value:t});return await i.invalidateQueries({queryKey:[`secrets-search`]}),await i.invalidateQueries({queryKey:[`secrets`]}),!t&&f.some(({field:e})=>e.multiline)?l(n(o.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):a||d(n(o.SETTINGS$SAVED)),!0}catch(e){return c(u(e)||n(o.ERROR$GENERIC)),!1}finally{p(!1)}},isSaving:f}}function z(e){let{data:t}=S(),n=w.useMemo(()=>x(e),[e]),[r,i]=w.useState({}),{saveFilled:a,isSaving:o}=R(n,!0);w.useEffect(()=>{i({})},[e]);let s=w.useCallback(e=>(t??[]).some(t=>t.name===e),[t]),c=w.useCallback(e=>!!r[e]?.trim()||s(e),[r,s]),l=w.useCallback((e,t)=>i(n=>({...n,[e]:t})),[]),u=w.useCallback(()=>i({}),[]);return{fields:n,values:r,setValue:l,secretExists:s,hasValueFor:c,conflicts:b(e,c),consumesFileCredentials:!0,isDirty:n.some(e=>!!r[e.name]?.trim()),save:e=>a(r,e),reset:u,isSaving:o}}export{E as a,D as i,L as n,O as r,z as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as i}from"./useQuery-CpjHYtZc.js";import{t as a}from"./useTranslation-Cgy4JA_g.js";import{t as o}from"./declaration-B9kpCaYl.js";import{p as s}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{A as c,M as l,N as u,j as d,n as f}from"./active-backend-context-u2tdYRgH.js";import{t as p}from"./check-Bvi71siz.js";import{t as m}from"./loader-circle-BEykUKYG.js";import{t as h}from"./utils-CE0lDWtb.js";import{n as g}from"./agent-server-client-options-DVLRd9sw.js";import{l as _}from"./form-control-classes-9rkU4usZ.js";import{n as v,t as y}from"./settings-input-DYs7t3oK.js";import{a as b,l as x}from"./acp-providers-D_D8VUpP.js";import{n as S,t as C}from"./use-create-secret-CVFSlhlR.js";var w=e(t(),1),T=n();function E({conflicts:e}){let{t}=a(`openhands`);return(0,T.jsx)(T.Fragment,{children:e.map(([e,n])=>(0,T.jsx)(`p`,{"data-testid":`acp-credential-conflict-warning`,className:`text-sm text-amber-300`,children:t(o.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function D({status:e,isChecking:t,providerName:n,testIdPrefix:r}){let{t:i}=a(`openhands`);return e===`authenticated`?(0,T.jsxs)(`div`,{"data-testid":`${r}-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,T.jsx)(p,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:i(o.ONBOARDING$ACP_AUTH_DETECTED,{provider:n})})]}):t?(0,T.jsxs)(`div`,{"data-testid":`${r}-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,T.jsx)(m,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:i(o.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):null}function O({field:e,value:t,onChange:n,alreadySet:r,testId:i,showOptionalTag:s}){let{t:c}=a(`openhands`),l=r?c(o.ONBOARDING$ACP_SECRET_ALREADY_SET):``;return(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.multiline?(0,T.jsxs)(`label`,{className:`flex flex-col gap-2.5`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`text-sm font-mono text-white`,children:e.name}),s&&(0,T.jsx)(v,{})]}),(0,T.jsx)(`textarea`,{"data-testid":i,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:l,onChange:e=>n(e.target.value),className:h(_,`font-mono text-xs`)})]}):(0,T.jsx)(y,{testId:i,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:s,placeholder:l}),(0,T.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:c(e.hint_key,e.hint_values)})]})}var k=10;function A(e){return`${e.stdout??``}\n${e.stderr??``}`}function j(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function M(e){let t=A(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function N(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var P={"claude-code":{command:`claude auth status --json`,classify:j},codex:{command:`codex login status`,classify:M},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:N}},F=class{static async getAuthStatus(e){let t=P[e];if(!t)return`unknown`;let n=await new s(g()).executeCommand(t.command,void 0,k);return t.classify(n)}};async function I(e){try{return await F.getAuthStatus(e)}catch{return`unknown`}}function L(e,t={}){let{enabled:n=!0}=t,r=f(),a=r.backend.kind===`local`,o=n&&a&&!!e,s=i({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>I(e),enabled:o,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:o&&s.isFetching&&s.data===void 0,isSupported:a}}function R(e,t){let{t:n}=a(`openhands`),i=r(),{mutateAsync:s}=C(),[f,p]=w.useState(!1);return{saveFilled:async(r,{silent:a=!1}={})=>{let f=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(f.length===0)return!0;p(!0);try{for(let{field:e,value:t}of f)await s({name:e.name,value:t});return await i.invalidateQueries({queryKey:[`secrets-search`]}),await i.invalidateQueries({queryKey:[`secrets`]}),!t&&f.some(({field:e})=>e.multiline)?l(n(o.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):a||d(n(o.SETTINGS$SAVED)),!0}catch(e){return c(u(e)||n(o.ERROR$GENERIC)),!1}finally{p(!1)}},isSaving:f}}function z(e){let{data:t}=S(),n=w.useMemo(()=>x(e),[e]),[r,i]=w.useState({}),{saveFilled:a,isSaving:o}=R(n,!0);w.useEffect(()=>{i({})},[e]);let s=w.useCallback(e=>(t??[]).some(t=>t.name===e),[t]),c=w.useCallback(e=>!!r[e]?.trim()||s(e),[r,s]),l=w.useCallback((e,t)=>i(n=>({...n,[e]:t})),[]),u=w.useCallback(()=>i({}),[]);return{fields:n,values:r,setValue:l,secretExists:s,hasValueFor:c,conflicts:b(e,c),consumesFileCredentials:!0,isDirty:n.some(e=>!!r[e.name]?.trim()),save:e=>a(r,e),reset:u,isSaving:o}}export{E as a,D as i,L as n,O as r,z as t};
@@ -1 +1 @@
1
- import{n as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t}from"./useMutation-DCE9RcgK.js";import{f as n,i as r}from"./active-backend-context-DRFevVIj.js";import{t as i}from"./settings-service.api-DldkFI1x.js";import{n as a}from"./use-agent-profiles-DnH16_Vm.js";var o=[`activate-agent-profile`];function s(){let s=e();return t({mutationKey:o,mutationFn:e=>a.activateProfile(e),onMutate:async e=>{await s.cancelQueries({queryKey:r.all});let t=s.getQueriesData({queryKey:r.all});return s.setQueriesData({queryKey:r.all},t=>t&&{...t,active_agent_profile_id:e}),{snapshots:t}},onError:(e,t,n)=>{n?.snapshots?.forEach(([e,t])=>{s.setQueryData(e,t)})},onSuccess:async()=>{i.invalidateCache(),await s.invalidateQueries({queryKey:r.all}),await s.invalidateQueries({queryKey:n.personal()})}})}export{s as n,o as t};
1
+ import{n as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t}from"./useMutation-DCE9RcgK.js";import{f as n,i as r}from"./active-backend-context-u2tdYRgH.js";import{t as i}from"./settings-service.api-DldkFI1x.js";import{n as a}from"./use-agent-profiles-DPcaYLpm.js";var o=[`activate-agent-profile`];function s(){let s=e();return t({mutationKey:o,mutationFn:e=>a.activateProfile(e),onMutate:async e=>{await s.cancelQueries({queryKey:r.all});let t=s.getQueriesData({queryKey:r.all});return s.setQueriesData({queryKey:r.all},t=>t&&{...t,active_agent_profile_id:e}),{snapshots:t}},onError:(e,t,n)=>{n?.snapshots?.forEach(([e,t])=>{s.setQueryData(e,t)})},onSuccess:async()=>{i.invalidateCache(),await s.invalidateQueries({queryKey:r.all}),await s.invalidateQueries({queryKey:n.personal()})}})}export{s as n,o as t};
@@ -1 +1 @@
1
- import{t as e}from"./use-agent-profiles-DnH16_Vm.js";function t(){let{data:t,isLoading:n}=e(),r=t?.active_agent_profile_id??null;return{activeProfile:t?.profiles?.find(e=>e.id!=null&&e.id===r)??null,isLoading:n}}function n(){let{activeProfile:e}=t();return e?.agent_kind}export{t as n,n as t};
1
+ import{t as e}from"./use-agent-profiles-DPcaYLpm.js";function t(){let{data:t,isLoading:n}=e(),r=t?.active_agent_profile_id??null;return{activeProfile:t?.profiles?.find(e=>e.id!=null&&e.id===r)??null,isLoading:n}}function n(){let{activeProfile:e}=t();return e?.agent_kind}export{t as n,n as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{b as n}from"./utils-CE0lDWtb.js";import{n as r}from"./navigation-context-DPs2G0X8.js";import{t as i}from"./conversation-service.api-Ch9kR9aE.js";import{t as a}from"./use-user-conversation-BPHQ-dm-.js";var o=e(t(),1);function s(){let{conversationId:e}=r();return{conversationId:e}}function c(){let{conversationId:e}=s();if(!e)throw Error(`useConversationId must be used within a route that has a conversationId parameter`);return{conversationId:e}}var l=()=>{let{conversationId:e}=s(),t=!!e&&e.startsWith(`task-`),r=a(!e||t?null:e,e=>{let t=e.state.data;return t&&(!t.conversation_url||t.sandbox_status===`PAUSED`||!t.title&&n(t.execution_status))?3e3:3e4});return(0,o.useEffect)(()=>{let e=r.data;i.setCurrentConversation(e||null)},[e,r.isFetched,r?.data?.execution_status]),r};export{c as n,s as r,l as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{b as n}from"./utils-CE0lDWtb.js";import{n as r}from"./navigation-context-DPs2G0X8.js";import{t as i}from"./conversation-service.api-CqZcHr1c.js";import{t as a}from"./use-user-conversation-6uOXFP95.js";var o=e(t(),1);function s(){let{conversationId:e}=r();return{conversationId:e}}function c(){let{conversationId:e}=s();if(!e)throw Error(`useConversationId must be used within a route that has a conversationId parameter`);return{conversationId:e}}var l=()=>{let{conversationId:e}=s(),t=!!e&&e.startsWith(`task-`),r=a(!e||t?null:e,e=>{let t=e.state.data;return t&&(!t.conversation_url||t.sandbox_status===`PAUSED`||!t.title&&n(t.execution_status))?3e3:3e4});return(0,o.useEffect)(()=>{let e=r.data;i.setCurrentConversation(e||null)},[e,r.isFetched,r?.data?.execution_status]),r};export{c as n,s as r,l as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-CpjHYtZc.js";import{h as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{a as n,i as r,n as i,o as a}from"./active-backend-context-DRFevVIj.js";import{c as o,n as s}from"./agent-server-client-options-DVLRd9sw.js";import{t as c}from"./proxy-CHmFkV16.js";var l=`/api/agent-profiles`;function u(){let e=o().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function d(){return c({backend:u(),method:`GET`,path:l})}async function f(e){return c({backend:u(),method:`GET`,path:`${l}/${encodeURIComponent(e)}`})}async function p(e,t){return c({backend:u(),method:`POST`,path:`${l}/${encodeURIComponent(e)}`,body:t})}async function m(e){return c({backend:u(),method:`DELETE`,path:`${l}/${encodeURIComponent(e)}`})}async function h(e,t){return c({backend:u(),method:`POST`,path:`${l}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function g(e){return c({backend:u(),method:`POST`,path:`${l}/${encodeURIComponent(e)}/activate`,body:{}})}function _(){return o().backend.kind===`cloud`}var v=`default`,y=class{static async listProfiles(){return _()?d():new t(s()).listAgentProfiles()}static async getProfile(e,n){if(_())return f(e);let r=n?{exposeSecrets:n}:{};return new t(s()).getAgentProfile(e,r)}static async saveProfile(e,n){return _()?p(e,n):new t(s()).saveAgentProfile(e,n)}static async deleteProfile(e){return _()?m(e):new t(s()).deleteAgentProfile(e)}static async renameProfile(e,n){return _()?h(e,n):new t(s()).renameAgentProfile(e,n)}static async activateProfile(e){return _()?g(e):new t(s()).activateAgentProfile(e)}};function b(t={}){let{backend:o,orgId:s}=i();return e({queryKey:[...r.all,o.id,s],queryFn:y.listProfiles,...a,...n,enabled:t.enabled??!0,meta:{disableToast:!0}})}export{y as n,v as r,b as t};
1
+ import{t as e}from"./useQuery-CpjHYtZc.js";import{h as t}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{a as n,i as r,n as i,o as a}from"./active-backend-context-u2tdYRgH.js";import{c as o,n as s}from"./agent-server-client-options-DVLRd9sw.js";import{t as c}from"./proxy-CHmFkV16.js";var l=`/api/agent-profiles`;function u(){let e=o().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function d(){return c({backend:u(),method:`GET`,path:l})}async function f(e){return c({backend:u(),method:`GET`,path:`${l}/${encodeURIComponent(e)}`})}async function p(e,t){return c({backend:u(),method:`POST`,path:`${l}/${encodeURIComponent(e)}`,body:t})}async function m(e){return c({backend:u(),method:`DELETE`,path:`${l}/${encodeURIComponent(e)}`})}async function h(e,t){return c({backend:u(),method:`POST`,path:`${l}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function g(e){return c({backend:u(),method:`POST`,path:`${l}/${encodeURIComponent(e)}/activate`,body:{}})}function _(){return o().backend.kind===`cloud`}var v=`default`,y=class{static async listProfiles(){return _()?d():new t(s()).listAgentProfiles()}static async getProfile(e,n){if(_())return f(e);let r=n?{exposeSecrets:n}:{};return new t(s()).getAgentProfile(e,r)}static async saveProfile(e,n){return _()?p(e,n):new t(s()).saveAgentProfile(e,n)}static async deleteProfile(e){return _()?m(e):new t(s()).deleteAgentProfile(e)}static async renameProfile(e,n){return _()?h(e,n):new t(s()).renameAgentProfile(e,n)}static async activateProfile(e){return _()?g(e):new t(s()).activateAgentProfile(e)}};function b(t={}){let{backend:o,orgId:s}=i();return e({queryKey:[...r.all,o.id,s],queryFn:y.listProfiles,...a,...n,enabled:t.enabled??!0,meta:{disableToast:!0}})}export{y as n,v as r,b as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{C as n}from"./utils-CE0lDWtb.js";import{t as r}from"./common-Dh7OqABE.js";import{t as i}from"./conversation-state-store-B2Bp32XI.js";import{t as a}from"./use-active-conversation-DvcFBqFe.js";var o=e(t(),1);function s(e){if(!e)return n.LOADING;switch(e){case r.IDLE:return n.AWAITING_USER_INPUT;case r.RUNNING:return n.RUNNING;case r.PAUSED:return n.PAUSED;case r.WAITING_FOR_CONFIRMATION:return n.AWAITING_USER_CONFIRMATION;case r.FINISHED:return n.FINISHED;case r.ERROR:return n.ERROR;case r.STUCK:return n.ERROR;default:return n.LOADING}}function c(){let e=i(e=>e.execution_status),t=a().data?.execution_status??null,n=e??t;return{curAgentState:(0,o.useMemo)(()=>s(n),[n]),executionStatus:n}}export{c as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{C as n}from"./utils-CE0lDWtb.js";import{t as r}from"./common-Dh7OqABE.js";import{t as i}from"./conversation-state-store-B2Bp32XI.js";import{t as a}from"./use-active-conversation-DI5S5M1w.js";var o=e(t(),1);function s(e){if(!e)return n.LOADING;switch(e){case r.IDLE:return n.AWAITING_USER_INPUT;case r.RUNNING:return n.RUNNING;case r.PAUSED:return n.PAUSED;case r.WAITING_FOR_CONFIRMATION:return n.AWAITING_USER_CONFIRMATION;case r.FINISHED:return n.FINISHED;case r.ERROR:return n.ERROR;case r.STUCK:return n.ERROR;default:return n.LOADING}}function c(){let e=i(e=>e.execution_status),t=a().data?.execution_status??null,n=e??t;return{curAgentState:(0,o.useMemo)(()=>s(n),[n]),executionStatus:n}}export{c as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useQueries-CRzaAqzH.js";import{b as r,m as i,o as a}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{D as o,E as s,I as c,L as l,O as u,T as d,p as f,y as p}from"./active-backend-context-DRFevVIj.js";import{n as m}from"./agent-server-client-options-DVLRd9sw.js";import{r as h}from"./organization-service.api-CnynNoT-.js";var g=e(t(),1),_=1e4,v=4e3,y=`Invalid API key`,b=`API key required`,x=`Cloud API key or network issue`,S=`Logged out`;function C(e){return e===y}function w(e){return e===b}function T(e){return e===x}function E(e){return e.kind===`cloud`&&!e.apiKey.trim()}function D(e){return e===S}async function O(e){if(e.kind===`cloud`){if(!e.apiKey?.trim())throw Error(b);try{await h(e)}catch(e){throw r.isAxiosError(e)&&e.response?.status===401?Error(S):c(e)?Error(x):e}return!0}try{let t=m({host:e.host,sessionApiKey:e.apiKey||null,timeout:v});await new a(t).getSettings(),f(await new i(t).getServerInfo())}catch(e){throw p(e,401)?Error(y):e}return!0}var k=2,A=300;function j(e){return e instanceof Error?e.message!==`Invalid API key`&&e.message!==`API key required`&&e.message!==`Logged out`:!0}async function M(e){for(let t=0;;t+=1)try{return await O(e)}catch(e){if(t>=k||!j(e))throw e;await new Promise(e=>{setTimeout(e,A)})}}function N(e,t={}){let{probeDisabledOnce:r=!1}=t,i=g.useSyncExternalStore(u,d,d),a=n({queries:e.map(e=>{let t=i[e.id],n=E(e),a=t?.disabled===!0,c=a&&e.kind===`cloud`&&l(t?.lastError),u=!n&&(!a||r||c);return{queryKey:[`backend-health`,e.id,e.kind,e.host,e.apiKey??``],queryFn:async()=>{try{let t=await M(e);return o(e.id),t}catch(t){throw s(e.id,t),t}},enabled:u,refetchInterval:a||n?!1:_,refetchIntervalInBackground:!1,refetchOnMount:a&&r?`always`:!0,refetchOnReconnect:!a&&!n,refetchOnWindowFocus:!a&&!n,retry:!1,staleTime:a?0:_,meta:{disableToast:!0}}})}),c={};return e.forEach((e,t)=>{let n=a[t],r=i[e.id],o=E(e),s=o?!1:r?.disabled===!0,l=o?0:r?.consecutiveFailures??0,u=o?b:r?.lastError??null,d;d=o||s?!1:n.isSuccess?!0:n.isError?!1:null,c[e.id]={isConnected:d,consecutiveFailures:l,lastError:u,disabled:s}}),c}export{N as a,w as i,D as n,C as r,T as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useQueries-CRzaAqzH.js";import{b as r,m as i,o as a}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{D as o,E as s,I as c,L as l,O as u,T as d,p as f,y as p}from"./active-backend-context-u2tdYRgH.js";import{n as m}from"./agent-server-client-options-DVLRd9sw.js";import{r as h}from"./organization-service.api-CnynNoT-.js";var g=e(t(),1),_=1e4,v=4e3,y=`Invalid API key`,b=`API key required`,x=`Cloud API key or network issue`,S=`Logged out`;function C(e){return e===y}function w(e){return e===b}function T(e){return e===x}function E(e){return e.kind===`cloud`&&!e.apiKey.trim()}function D(e){return e===S}async function O(e){if(e.kind===`cloud`){if(!e.apiKey?.trim())throw Error(b);try{await h(e)}catch(e){throw r.isAxiosError(e)&&e.response?.status===401?Error(S):c(e)?Error(x):e}return!0}try{let t=m({host:e.host,sessionApiKey:e.apiKey||null,timeout:v});await new a(t).getSettings(),f(await new i(t).getServerInfo())}catch(e){throw p(e,401)?Error(y):e}return!0}var k=2,A=300;function j(e){return e instanceof Error?e.message!==`Invalid API key`&&e.message!==`API key required`&&e.message!==`Logged out`:!0}async function M(e){for(let t=0;;t+=1)try{return await O(e)}catch(e){if(t>=k||!j(e))throw e;await new Promise(e=>{setTimeout(e,A)})}}function N(e,t={}){let{probeDisabledOnce:r=!1}=t,i=g.useSyncExternalStore(u,d,d),a=n({queries:e.map(e=>{let t=i[e.id],n=E(e),a=t?.disabled===!0,c=a&&e.kind===`cloud`&&l(t?.lastError),u=!n&&(!a||r||c);return{queryKey:[`backend-health`,e.id,e.kind,e.host,e.apiKey??``],queryFn:async()=>{try{let t=await M(e);return o(e.id),t}catch(t){throw s(e.id,t),t}},enabled:u,refetchInterval:a||n?!1:_,refetchIntervalInBackground:!1,refetchOnMount:a&&r?`always`:!0,refetchOnReconnect:!a&&!n,refetchOnWindowFocus:!a&&!n,retry:!1,staleTime:a?0:_,meta:{disableToast:!0}}})}),c={};return e.forEach((e,t)=>{let n=a[t],r=i[e.id],o=E(e),s=o?!1:r?.disabled===!0,l=o?0:r?.consecutiveFailures??0,u=o?b:r?.lastError??null,d;d=o||s?!1:n.isSuccess?!0:n.isError?!1:null,c[e.id]={isConnected:d,consecutiveFailures:l,lastError:u,disabled:s}}),c}export{N as a,w as i,D as n,C as r,T as t};
@@ -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"./useQuery-CpjHYtZc.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{t as a}from"./declaration-B9kpCaYl.js";import{n as o}from"./active-backend-context-DRFevVIj.js";import{t as s}from"./utils-CE0lDWtb.js";import{t as c}from"./organization-service.api-CnynNoT-.js";import{t as l}from"./modal-backdrop-zVwfOJZr.js";import{r as u,t as d}from"./modal-body-Dcu5McCa.js";import{r as f}from"./base-modal-CC5Pp8CF.js";import{t as p}from"./settings-input-DYs7t3oK.js";import{i as m}from"./ellipsis-button-1BV9Sga8.js";var h=e(t(),1),g=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function _(e,{isRequired:t=!1}={}){return e===``?!t:g.test(e)}function v(e){let t=e.split(`/`),n=(t[t.length-1]||e).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&!/^[A-Za-z0-9]/.test(n)&&(n=`profile-${n}`),n.length>64&&(n=n.substring(0,64).replace(/-+$/,``)),n||`default-profile`}var y=n(),b=(0,h.forwardRef)(function({testId:e,ruleTestId:t,value:n,onChange:r,onKeyDown:o,placeholder:c,isDisabled:l,isOptional:u,isRequired:d=!1},f){let{t:m}=i(`openhands`),g=_(n,{isRequired:d}),v=u?`${m(a.SETTINGS$PROFILE_NAME_LABEL)} (${m(a.COMMON$OPTIONAL)})`:m(a.SETTINGS$PROFILE_NAME_LABEL),b=h.useId(),x=t??`${b}-rule`;return(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(p,{ref:f,testId:e,label:v,type:`text`,className:`w-full`,value:n,placeholder:c??m(a.SETTINGS$PROFILE_NAME_PLACEHOLDER),onChange:r,onKeyDown:o,isDisabled:l,ariaDescribedBy:x,ariaInvalid:!g}),(0,y.jsx)(`p`,{id:x,"data-testid":t,className:s(`text-xs`,g?`text-[var(--oh-muted)]`:`text-red-400`),children:m(a.SETTINGS$PROFILE_NAME_RULE)})]})});function x({isOpen:e,title:t,width:n=`md`,children:r,footer:i,onClose:a,initialFocusRef:o}){let c=(0,h.useRef)(null);return(0,h.useEffect)(()=>{if(!e)return;let t=o?.current??c.current;if(t){let e=setTimeout(()=>{t.focus()},0);return()=>clearTimeout(e)}},[e,o]),(0,h.useEffect)(()=>{if(!e||!c.current)return;let t=c.current,n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),e?(0,y.jsx)(l,{onClose:a,children:(0,y.jsxs)(`div`,{ref:c,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:s(`bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,u(n),d),children:[(0,y.jsx)(f,{id:`modal-title`,title:t}),r,(0,y.jsx)(`div`,{className:`w-full flex justify-end gap-2 mt-2`,children:i})]})}):null}function S({index:e,icon:t,label:n,onClick:r,onKeyDown:i,menuItemsRef:a,disabled:o,testId:c}){return(0,y.jsx)(`button`,{ref:t=>{a.current[e]=t},type:`button`,onClick:r,onKeyDown:t=>i(t,e),disabled:o,className:s(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`),role:`menuitem`,"data-testid":c,children:(0,y.jsx)(m,{icon:t,text:n})})}function C({children:e,className:t,...n}){return(0,y.jsx)(`span`,{className:s(`text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full`,t),...n,children:e})}var w=`edit_org_settings`;function T(){let{backend:e,orgId:t}=o(),n=e.kind===`cloud`,{data:i}=r({queryKey:[`cloud-current-user`,e.id,t],queryFn:()=>c(t,e),enabled:n&&!!t,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});return n?i?.permissions?i.permissions.includes(w):i?.role===`owner`||i?.role===`admin`:!0}export{b as a,x as i,C as n,v as o,S as r,_ as s,T as t};
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"./useQuery-CpjHYtZc.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{t as a}from"./declaration-B9kpCaYl.js";import{n as o}from"./active-backend-context-u2tdYRgH.js";import{t as s}from"./utils-CE0lDWtb.js";import{t as c}from"./organization-service.api-CnynNoT-.js";import{t as l}from"./modal-backdrop-zVwfOJZr.js";import{r as u,t as d}from"./modal-body-Dcu5McCa.js";import{r as f}from"./base-modal-CC5Pp8CF.js";import{t as p}from"./settings-input-DYs7t3oK.js";import{i as m}from"./ellipsis-button-1BV9Sga8.js";var h=e(t(),1),g=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function _(e,{isRequired:t=!1}={}){return e===``?!t:g.test(e)}function v(e){let t=e.split(`/`),n=(t[t.length-1]||e).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&!/^[A-Za-z0-9]/.test(n)&&(n=`profile-${n}`),n.length>64&&(n=n.substring(0,64).replace(/-+$/,``)),n||`default-profile`}var y=n(),b=(0,h.forwardRef)(function({testId:e,ruleTestId:t,value:n,onChange:r,onKeyDown:o,placeholder:c,isDisabled:l,isOptional:u,isRequired:d=!1},f){let{t:m}=i(`openhands`),g=_(n,{isRequired:d}),v=u?`${m(a.SETTINGS$PROFILE_NAME_LABEL)} (${m(a.COMMON$OPTIONAL)})`:m(a.SETTINGS$PROFILE_NAME_LABEL),b=h.useId(),x=t??`${b}-rule`;return(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(p,{ref:f,testId:e,label:v,type:`text`,className:`w-full`,value:n,placeholder:c??m(a.SETTINGS$PROFILE_NAME_PLACEHOLDER),onChange:r,onKeyDown:o,isDisabled:l,ariaDescribedBy:x,ariaInvalid:!g}),(0,y.jsx)(`p`,{id:x,"data-testid":t,className:s(`text-xs`,g?`text-[var(--oh-muted)]`:`text-red-400`),children:m(a.SETTINGS$PROFILE_NAME_RULE)})]})});function x({isOpen:e,title:t,width:n=`md`,children:r,footer:i,onClose:a,initialFocusRef:o}){let c=(0,h.useRef)(null);return(0,h.useEffect)(()=>{if(!e)return;let t=o?.current??c.current;if(t){let e=setTimeout(()=>{t.focus()},0);return()=>clearTimeout(e)}},[e,o]),(0,h.useEffect)(()=>{if(!e||!c.current)return;let t=c.current,n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),e?(0,y.jsx)(l,{onClose:a,children:(0,y.jsxs)(`div`,{ref:c,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:s(`bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,u(n),d),children:[(0,y.jsx)(f,{id:`modal-title`,title:t}),r,(0,y.jsx)(`div`,{className:`w-full flex justify-end gap-2 mt-2`,children:i})]})}):null}function S({index:e,icon:t,label:n,onClick:r,onKeyDown:i,menuItemsRef:a,disabled:o,testId:c}){return(0,y.jsx)(`button`,{ref:t=>{a.current[e]=t},type:`button`,onClick:r,onKeyDown:t=>i(t,e),disabled:o,className:s(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`),role:`menuitem`,"data-testid":c,children:(0,y.jsx)(m,{icon:t,text:n})})}function C({children:e,className:t,...n}){return(0,y.jsx)(`span`,{className:s(`text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full`,t),...n,children:e})}var w=`edit_org_settings`;function T(){let{backend:e,orgId:t}=o(),n=e.kind===`cloud`,{data:i}=r({queryKey:[`cloud-current-user`,e.id,t],queryFn:()=>c(t,e),enabled:n&&!!t,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});return n?i?.permissions?i.permissions.includes(w):i?.role===`owner`||i?.role===`admin`:!0}export{b as a,x as i,C as n,v as o,S as r,_ as s,T as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQueries-CRzaAqzH.js";import{n as t,r as n}from"./active-backend-context-DRFevVIj.js";import{n as r,r as i,t as a}from"./organization-service.api-CnynNoT-.js";function o(){let{backends:t}=n(),a=t.filter(e=>e.kind===`cloud`),o=e({queries:a.map(e=>({queryKey:[`cloud-organizations`,e.id],queryFn:async()=>{let[t,n]=await Promise.all([r(e),i(e)]);return n.isLegacyKey||n.orgId===null?t:{...t,items:t.items.filter(e=>e.id===n.orgId)}},staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}))}),s={};return a.forEach((e,t)=>{let n=o[t];s[e.id]={backend:e,isLoading:n.isLoading,orgs:n.data?.items??[]}}),s}function s(){let{backends:r}=n(),i=t(),s=o(),c=[];for(let e of r)if(e.kind===`cloud`){let t=s[e.id],n=e.id===i.backend.id&&i.orgId?i.orgId:t?.orgs[0]?.id??null;n&&c.push({backendId:e.id,orgIdForMe:n})}let l=e({queries:c.map(({backendId:e,orgIdForMe:t})=>{let n=r.find(t=>t.id===e);return{queryKey:[`cloud-current-user`,e,t],queryFn:async()=>n?a(t,n):{orgId:t,userId:``},enabled:!!n,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}})}),u={};return c.forEach((e,t)=>{let n=l[t];u[e.backendId]={isLoading:n.isLoading,userId:n.data?.userId??null}}),u}export{o as n,s as t};
1
+ import{t as e}from"./useQueries-CRzaAqzH.js";import{n as t,r as n}from"./active-backend-context-u2tdYRgH.js";import{n as r,r as i,t as a}from"./organization-service.api-CnynNoT-.js";function o(){let{backends:t}=n(),a=t.filter(e=>e.kind===`cloud`),o=e({queries:a.map(e=>({queryKey:[`cloud-organizations`,e.id],queryFn:async()=>{let[t,n]=await Promise.all([r(e),i(e)]);return n.isLegacyKey||n.orgId===null?t:{...t,items:t.items.filter(e=>e.id===n.orgId)}},staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}))}),s={};return a.forEach((e,t)=>{let n=o[t];s[e.id]={backend:e,isLoading:n.isLoading,orgs:n.data?.items??[]}}),s}function s(){let{backends:r}=n(),i=t(),s=o(),c=[];for(let e of r)if(e.kind===`cloud`){let t=s[e.id],n=e.id===i.backend.id&&i.orgId?i.orgId:t?.orgs[0]?.id??null;n&&c.push({backendId:e.id,orgIdForMe:n})}let l=e({queries:c.map(({backendId:e,orgIdForMe:t})=>{let n=r.find(t=>t.id===e);return{queryKey:[`cloud-current-user`,e,t],queryFn:async()=>n?a(t,n):{orgId:t,userId:``},enabled:!!n,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}})}),u={};return c.forEach((e,t)=>{let n=l[t];u[e.backendId]={isLoading:n.isLoading,userId:n.data?.userId??null}}),u}export{o as n,s as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-CpjHYtZc.js";import{d as t,g as n,o as r,v as i}from"./active-backend-context-DRFevVIj.js";import{t as a}from"./option-service.api-Dz7Eomnx.js";var o=o=>e({queryKey:t.WEB_CLIENT_CONFIG,queryFn:a.getConfig,retry:(e,t)=>!i(t)&&!n(t)&&e<3,meta:{disableToast:!0},...r,enabled:o?.enabled});export{o as t};
1
+ import{t as e}from"./useQuery-CpjHYtZc.js";import{d as t,g as n,o as r,v as i}from"./active-backend-context-u2tdYRgH.js";import{t as a}from"./option-service.api-Cl5VLGyw.js";var o=o=>e({queryKey:t.WEB_CLIENT_CONFIG,queryFn:a.getConfig,retry:(e,t)=>!i(t)&&!n(t)&&e<3,meta:{disableToast:!0},...r,enabled:o?.enabled});export{o as t};
@@ -1 +1 @@
1
- import{n as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t}from"./useMutation-DCE9RcgK.js";import{a as n,i as r,n as i,s as a,u as o}from"./active-backend-context-DRFevVIj.js";import{t as s}from"./use-tracking-CqODdfO4.js";import{a as c,o as l,t as u}from"./agent-server-conversation-service.api-DfH2k6Sx.js";import{t as d}from"./profiles-service.api-CeYEmSM3.js";import{t as f}from"./use-llm-profiles-BcLibtGb.js";import{n as p,t as m}from"./use-agent-profiles-DnH16_Vm.js";import{t as h}from"./plugins-management-service-BAp70KN7.js";function g(e){if(e.name)return e.name;if(e.repo_path){let t=e.repo_path.split(`/`).filter(Boolean);if(t.length>0)return t[t.length-1]}let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`/`)&&t.split(`/`).pop()?.replace(/\.git$/,``)||t}function _(e){let{source:t}=e;return!(t.startsWith(`github:`)||/^[a-z][a-z0-9+.-]*:\/\//i.test(t))}function v(e){let t=e.source.startsWith(`github:`)?e.source.replace(`github:`,``):e.source;return e.ref?`${t} @ ${e.ref}`:t}function y(e){return[e.source,e.ref??``,e.repo_path??``].join(` `)}var b=()=>{let g=e(),{trackConversationCreated:_}=s(),{data:v}=f(),{backend:b,orgId:x}=i();return m(),t({mutationKey:[`create-conversation`],mutationFn:async e=>{let{query:t,conversationInstructions:i,plugins:s,repository:f,workingDir:m,workspaceMode:_,parentConversationId:S,agentType:C,agentProfileId:w}=e,T;try{T=await g.ensureQueryData({queryKey:[...r.all,b.id,x],queryFn:p.listProfiles,...n})}catch{}let E=w??T?.active_agent_profile_id??void 0,D=E?T?.profiles?.find(e=>e.id===E):void 0,O=b.kind===`cloud`,k=E;if(!O&&D?.name===`default`&&D?.agent_kind===`openhands`)k=void 0;else if(D?.agent_kind===`openhands`&&D.llm_profile_ref){let e=!1;try{e=(await g.ensureQueryData({queryKey:[...a.all,b.id,x],queryFn:d.listProfiles,retry:!1})).profiles.some(e=>e.name===D.llm_profile_ref)}catch{}e||(console.warn(`Agent profile "${D.name}" references missing LLM profile "${D.llm_profile_ref}"; launching from agent_settings instead.`),k=void 0)}let A=k?[void 0,k]:[],j=await u.createConversation(t,i,s,f?{selected_repository:f.name,selected_branch:f.branch??null,git_provider:f.gitProvider}:null,m,_,S,C,...A),M=j.app_conversation_id,N=s?.map(e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}))??[],P=N;if(M){let e=[];try{e=await g.ensureQueryData({queryKey:o.installed,queryFn:()=>h.listInstalledPlugins()})}catch{}let t=new Set(N.map(y)),n=e.filter(e=>e.enabled).map(e=>({source:e.source,ref:e.resolved_ref??null,repo_path:e.repo_path??null,name:e.name})).filter(e=>!t.has(y(e)));P=[...N,...n]}let F=k&&D?.agent_kind===`openhands`?D.llm_profile_ref:v?.active_profile??null;if(M&&(F||P.length)){let e=c(M);l(M,{selected_repository:e?.selected_repository??null,selected_branch:e?.selected_branch??null,git_provider:e?.git_provider??null,selected_workspace:e?.selected_workspace??null,workspace_mode:e?.workspace_mode??null,active_profile:F??e?.active_profile??null,plugins:P.length?P:e?.plugins??null})}return{conversation_id:j.app_conversation_id?j.app_conversation_id:`task-${j.id}`,session_api_key:null,url:j.agent_server_url,task_id:j.id}},onSuccess:async(e,t)=>{_({conversationId:e.conversation_id,taskId:e.task_id,hasRepository:!!t.repository,gitProvider:t.repository?.gitProvider,hasWorkspace:!!t.workingDir,workspaceMode:t.workspaceMode,hasInitialQuery:!!t.query,agentType:t.agentType,hasParentConversation:!!t.parentConversationId,entryPoint:t.entryPoint}),g.invalidateQueries({queryKey:[`user`,`conversations`]}),g.invalidateQueries({queryKey:[`start-tasks`]})}})};export{y as a,_ as i,g as n,v as r,b as t};
1
+ import{n as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t}from"./useMutation-DCE9RcgK.js";import{a as n,i as r,n as i,s as a,u as o}from"./active-backend-context-u2tdYRgH.js";import{t as s}from"./use-tracking-GtXCHmTv.js";import{a as c,o as l,t as u}from"./agent-server-conversation-service.api-BP73yONA.js";import{t as d}from"./profiles-service.api-CeYEmSM3.js";import{t as f}from"./use-llm-profiles-DjackuP1.js";import{n as p,t as m}from"./use-agent-profiles-DPcaYLpm.js";import{t as h}from"./plugins-management-service-BAp70KN7.js";function g(e){if(e.name)return e.name;if(e.repo_path){let t=e.repo_path.split(`/`).filter(Boolean);if(t.length>0)return t[t.length-1]}let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`/`)&&t.split(`/`).pop()?.replace(/\.git$/,``)||t}function _(e){let{source:t}=e;return!(t.startsWith(`github:`)||/^[a-z][a-z0-9+.-]*:\/\//i.test(t))}function v(e){let t=e.source.startsWith(`github:`)?e.source.replace(`github:`,``):e.source;return e.ref?`${t} @ ${e.ref}`:t}function y(e){return[e.source,e.ref??``,e.repo_path??``].join(` `)}var b=()=>{let g=e(),{trackConversationCreated:_}=s(),{data:v}=f(),{backend:b,orgId:x}=i();return m(),t({mutationKey:[`create-conversation`],mutationFn:async e=>{let{query:t,conversationInstructions:i,plugins:s,repository:f,workingDir:m,workspaceMode:_,parentConversationId:S,agentType:C,agentProfileId:w}=e,T;try{T=await g.ensureQueryData({queryKey:[...r.all,b.id,x],queryFn:p.listProfiles,...n})}catch{}let E=w??T?.active_agent_profile_id??void 0,D=E?T?.profiles?.find(e=>e.id===E):void 0,O=b.kind===`cloud`,k=E;if(!O&&D?.name===`default`&&D?.agent_kind===`openhands`)k=void 0;else if(D?.agent_kind===`openhands`&&D.llm_profile_ref){let e=!1;try{e=(await g.ensureQueryData({queryKey:[...a.all,b.id,x],queryFn:d.listProfiles,retry:!1})).profiles.some(e=>e.name===D.llm_profile_ref)}catch{}e||(console.warn(`Agent profile "${D.name}" references missing LLM profile "${D.llm_profile_ref}"; launching from agent_settings instead.`),k=void 0)}let A=k?[void 0,k]:[],j=await u.createConversation(t,i,s,f?{selected_repository:f.name,selected_branch:f.branch??null,git_provider:f.gitProvider}:null,m,_,S,C,...A),M=j.app_conversation_id,N=s?.map(e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}))??[],P=N;if(M){let e=[];try{e=await g.ensureQueryData({queryKey:o.installed,queryFn:()=>h.listInstalledPlugins()})}catch{}let t=new Set(N.map(y)),n=e.filter(e=>e.enabled).map(e=>({source:e.source,ref:e.resolved_ref??null,repo_path:e.repo_path??null,name:e.name})).filter(e=>!t.has(y(e)));P=[...N,...n]}let F=k&&D?.agent_kind===`openhands`?D.llm_profile_ref:v?.active_profile??null;if(M&&(F||P.length)){let e=c(M);l(M,{selected_repository:e?.selected_repository??null,selected_branch:e?.selected_branch??null,git_provider:e?.git_provider??null,selected_workspace:e?.selected_workspace??null,workspace_mode:e?.workspace_mode??null,active_profile:F??e?.active_profile??null,plugins:P.length?P:e?.plugins??null})}return{conversation_id:j.app_conversation_id?j.app_conversation_id:`task-${j.id}`,session_api_key:null,url:j.agent_server_url,task_id:j.id}},onSuccess:async(e,t)=>{_({conversationId:e.conversation_id,taskId:e.task_id,hasRepository:!!t.repository,gitProvider:t.repository?.gitProvider,hasWorkspace:!!t.workingDir,workspaceMode:t.workspaceMode,hasInitialQuery:!!t.query,agentType:t.agentType,hasParentConversation:!!t.parentConversationId,entryPoint:t.entryPoint}),g.invalidateQueries({queryKey:[`user`,`conversations`]}),g.invalidateQueries({queryKey:[`start-tasks`]})}})};export{y as a,_ as i,g as n,v as r,b as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useMutation-DCE9RcgK.js";import{t as r}from"./useQuery-CpjHYtZc.js";import{n as i}from"./active-backend-context-DRFevVIj.js";import{t as a}from"./secrets-service-CZYjNxFw.js";var o=e(t(),1),s=(e={})=>{let{nameContains:t,enabled:n=!0}=e,s=i(),c=r({queryKey:[`secrets`,s.backend.id,s.orgId],queryFn:a.getSecrets,enabled:n,staleTime:1e3*60*5,gcTime:1e3*60*15});return{data:(0,o.useMemo)(()=>{if(!c.data)return[];if(!t)return c.data;let e=t.toLowerCase();return c.data.filter(t=>t.name.toLowerCase().includes(e))},[c.data,t]),isLoading:c.isLoading,isError:c.isError,hasNextPage:!1,isFetchingNextPage:!1,fetchNextPage:()=>{},onLoadMore:()=>{},refetch:c.refetch}},c=()=>n({mutationFn:({name:e,value:t,description:n})=>a.createSecret(e,t,n)});export{s as n,c as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useMutation-DCE9RcgK.js";import{t as r}from"./useQuery-CpjHYtZc.js";import{n as i}from"./active-backend-context-u2tdYRgH.js";import{t as a}from"./secrets-service-CZYjNxFw.js";var o=e(t(),1),s=(e={})=>{let{nameContains:t,enabled:n=!0}=e,s=i(),c=r({queryKey:[`secrets`,s.backend.id,s.orgId],queryFn:a.getSecrets,enabled:n,staleTime:1e3*60*5,gcTime:1e3*60*15});return{data:(0,o.useMemo)(()=>{if(!c.data)return[];if(!t)return c.data;let e=t.toLowerCase();return c.data.filter(t=>t.name.toLowerCase().includes(e))},[c.data,t]),isLoading:c.isLoading,isError:c.isError,hasNextPage:!1,isFetchingNextPage:!1,fetchNextPage:()=>{},onLoadMore:()=>{},refetch:c.refetch}},c=()=>n({mutationFn:({name:e,value:t,description:n})=>a.createSecret(e,t,n)});export{s as n,c as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useTranslation-Cgy4JA_g.js";import{t as r}from"./declaration-B9kpCaYl.js";import{j as i}from"./active-backend-context-DRFevVIj.js";import{a,r as o}from"./conversation-local-storage-F6zVMM--.js";import{t as s}from"./conversation-store-LptbOvKa.js";import{t as c}from"./use-create-conversation-CvAXfA3T.js";import{t as l}from"./use-active-conversation-DvcFBqFe.js";var u=e(t(),1),d=()=>{let{t:e}=n(`openhands`),{setConversationMode:t,setSubConversationTaskId:d,subConversationTaskId:f}=s(),{data:p}=l(),{mutate:m,isPending:h}=c();return(0,u.useEffect)(()=>{if(!p?.id)return;let e=o(p.id);e.subConversationTaskId&&!f&&d(e.subConversationTaskId)},[p?.id,f,d]),{handlePlanClick:(0,u.useCallback)(n=>{n?.preventDefault(),n?.stopPropagation(),t(`plan`),!(p?.sub_conversation_ids&&p.sub_conversation_ids.length>0||!p?.id||f)&&m({parentConversationId:p.id,agentType:`plan`,entryPoint:`plan_sub_conversation`},{onSuccess:t=>{i(e(r.PLANNING_AGENTT$PLANNING_AGENT_INITIALIZED)),t.task_id&&(d(t.task_id),a(p.id,{subConversationTaskId:t.task_id}))}})},[p,m,t,d,f,e]),isCreatingConversation:h}};export{d as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useTranslation-Cgy4JA_g.js";import{t as r}from"./declaration-B9kpCaYl.js";import{j as i}from"./active-backend-context-u2tdYRgH.js";import{a,r as o}from"./conversation-local-storage-F6zVMM--.js";import{t as s}from"./conversation-store-LptbOvKa.js";import{t as c}from"./use-create-conversation-D9OWYcte.js";import{t as l}from"./use-active-conversation-DI5S5M1w.js";var u=e(t(),1),d=()=>{let{t:e}=n(`openhands`),{setConversationMode:t,setSubConversationTaskId:d,subConversationTaskId:f}=s(),{data:p}=l(),{mutate:m,isPending:h}=c();return(0,u.useEffect)(()=>{if(!p?.id)return;let e=o(p.id);e.subConversationTaskId&&!f&&d(e.subConversationTaskId)},[p?.id,f,d]),{handlePlanClick:(0,u.useCallback)(n=>{n?.preventDefault(),n?.stopPropagation(),t(`plan`),!(p?.sub_conversation_ids&&p.sub_conversation_ids.length>0||!p?.id||f)&&m({parentConversationId:p.id,agentType:`plan`,entryPoint:`plan_sub_conversation`},{onSuccess:t=>{i(e(r.PLANNING_AGENTT$PLANNING_AGENT_INITIALIZED)),t.task_id&&(d(t.task_id),a(p.id,{subConversationTaskId:t.task_id}))}})},[p,m,t,d,f,e]),isCreatingConversation:h}};export{d as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-CpjHYtZc.js";import{n as t,o as n,s as r}from"./active-backend-context-DRFevVIj.js";import{t as i}from"./profiles-service.api-CeYEmSM3.js";function a(a={}){let{backend:o,orgId:s}=t();return e({queryKey:[...r.all,o.id,s],queryFn:i.listProfiles,...n,enabled:a.enabled??!0,meta:{disableToast:!0}})}export{a as t};
1
+ import{t as e}from"./useQuery-CpjHYtZc.js";import{n as t,o as n,s as r}from"./active-backend-context-u2tdYRgH.js";import{t as i}from"./profiles-service.api-CeYEmSM3.js";function a(a={}){let{backend:o,orgId:s}=t();return e({queryKey:[...r.all,o.id,s],queryFn:i.listProfiles,...n,enabled:a.enabled??!0,meta:{disableToast:!0}})}export{a as t};
@@ -0,0 +1 @@
1
+ import{T as e,b as t,w as n}from"./utils-CE0lDWtb.js";import{t as r}from"./use-active-conversation-DI5S5M1w.js";import{t as i}from"./use-agent-state-Buh3bQDh.js";var a=({allowAgentError:a=!1}={})=>{let{data:o}=r(),{curAgentState:s}=i(),c=a?e:n;return t(o?.execution_status)&&!c.includes(s)};export{a as t};
@@ -1 +1 @@
1
- import{n as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t}from"./useMutation-DCE9RcgK.js";import{i as n}from"./active-backend-context-DRFevVIj.js";import{n as r}from"./use-agent-profiles-DnH16_Vm.js";function i(){let i=e();return t({mutationFn:({name:e,profile:t})=>r.saveProfile(e,t),onSuccess:async()=>{await i.invalidateQueries({queryKey:n.all})},meta:{disableToast:!0}})}export{i as t};
1
+ import{n as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t}from"./useMutation-DCE9RcgK.js";import{i as n}from"./active-backend-context-u2tdYRgH.js";import{n as r}from"./use-agent-profiles-DPcaYLpm.js";function i(){let i=e();return t({mutationFn:({name:e,profile:t})=>r.saveProfile(e,t),onSuccess:async()=>{await i.invalidateQueries({queryKey:n.all})},meta:{disableToast:!0}})}export{i as t};