@openhands/agent-canvas 1.12.0 → 1.13.0

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 (732) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BkL3HWa3.js → acp-providers-D1PORKc0.js} +1 -1
  4. package/build/assets/active-backend-context-IqOjobNK.js +2 -0
  5. package/build/assets/{agent-context-settings-CzWS1DgR.js → agent-context-settings-DMrObcIS.js} +1 -1
  6. package/build/assets/agent-profiles-settings-DororXN5.js +1 -0
  7. package/build/assets/agent-server-conversation-service.api-DWBe0rbX.js +86 -0
  8. package/build/assets/{agent-settings-D2J1dKVd.js → agent-settings-BJVk92PU.js} +1 -1
  9. package/build/assets/agent-settings-COfJsQ1d.js +1 -0
  10. package/build/assets/{alert-banner-lrK-2_0Y.js → alert-banner-CzZsm7ms.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-D70oJj2c.js → api-key-entry-screen-D8Fade_-.js} +1 -1
  12. package/build/assets/{app-settings-D0OKHB3M.js → app-settings-CpyGB3AT.js} +1 -1
  13. package/build/assets/{automation-detail-C0SxWTnQ.js → automation-detail-B-jQ39Mm.js} +1 -1
  14. package/build/assets/{automation-export-BjQa_fT6.js → automation-export-B1dywoqk.js} +1 -1
  15. package/build/assets/{automation-setup-route-BzCNpljP.js → automation-setup-route-C-bWUZBi.js} +1 -1
  16. package/build/assets/{automation-templates-D9gs6ihu.js → automation-templates-DgpCGOJV.js} +1 -1
  17. package/build/assets/{automations-list-dZg8zOCl.js → automations-list-DnMxlxsL.js} +1 -1
  18. package/build/assets/{back-nav-button-B3pYwmUJ.js → back-nav-button-HHEneWMw.js} +1 -1
  19. package/build/assets/{backend-form-modal-HwclKrUS.js → backend-form-modal-DiVrD4Cm.js} +1 -1
  20. package/build/assets/{backend-synced-settings-badge-YI3k09Wr.js → backend-synced-settings-badge-7MIjpr8M.js} +1 -1
  21. package/build/assets/{badge-Dpn3-LTV.js → badge-CpYmcVZV.js} +1 -1
  22. package/build/assets/{base-modal-3NmIOKDm.js → base-modal-Fnh6Uln9.js} +1 -1
  23. package/build/assets/bot-BQZx8e2i.js +1 -0
  24. package/build/assets/{brand-button-CJcwjnfb.js → brand-button-swT1RyO0.js} +1 -1
  25. package/build/assets/browser-B9AbV6kG.js +7 -0
  26. package/build/assets/{browser-tab-4CPdj3J3.js → browser-tab-zAY12m_i.js} +1 -1
  27. package/build/assets/{chat-send-button-B8n6-DQA.js → chat-send-button-DsJtivmL.js} +1 -1
  28. package/build/assets/check-WAFXrrs_.js +1 -0
  29. package/build/assets/chevron-down-CifNWzme.js +1 -0
  30. package/build/assets/circle-check-CtnimJa8.js +1 -0
  31. package/build/assets/{circle-plus-check-toggle-BVzv5EkZ.js → circle-plus-check-toggle-Cuzx55bo.js} +1 -1
  32. package/build/assets/{cloud-funnel-analytics-CcSez21r.js → cloud-funnel-analytics-86CwNdSh.js} +1 -1
  33. package/build/assets/{combobox-caret-BlmRwiM8.js → combobox-caret-D0fRotFi.js} +1 -1
  34. package/build/assets/{command-menu-BKOLj-TC.js → command-menu-BXy03FBl.js} +1 -1
  35. package/build/assets/{condenser-settings-DLQogFnB.js → condenser-settings-BmZa0ui_.js} +1 -1
  36. package/build/assets/{confirmation-modal-DAH0XtOp.js → confirmation-modal-BgoN6lbN.js} +1 -1
  37. package/build/assets/{context-menu-list-item-BQhmFVEK.js → context-menu-list-item-Bq02tc-P.js} +1 -1
  38. package/build/assets/conversation-BPo8SvLN.js +1 -0
  39. package/build/assets/conversation-CPCVsCUY.js +90 -0
  40. package/build/assets/conversation-panel-BPo8SvLN.js +1 -0
  41. package/build/assets/{conversation-state-store-CtgILxWF.js → conversation-state-store-C5YpjMNy.js} +1 -1
  42. package/build/assets/conversation-store-Blc5xysY.js +6 -0
  43. package/build/assets/{conversation-tab-empty-state-C9sfDOlt.js → conversation-tab-empty-state-CMqo_0Bd.js} +1 -1
  44. package/build/assets/{copy-to-clipboard-button-DatoElj8.js → copy-to-clipboard-button-Cg1pF0xn.js} +1 -1
  45. package/build/assets/{device-verify-BIjXeW9N.js → device-verify-BfQLgNyq.js} +1 -1
  46. package/build/assets/{dropdown-classes-zFW7qPSK.js → dropdown-classes-BIqQr5mx.js} +1 -1
  47. package/build/assets/{entry.client-EBn3ZtNP.js → entry.client-CxFjRYqH.js} +2 -2
  48. package/build/assets/{enum-filter-dropdown-CctILg5t.js → enum-filter-dropdown-C_yV4_bo.js} +1 -1
  49. package/build/assets/{environment-switch-overlay-Cvmo6clk.js → environment-switch-overlay-Bi4qbh2g.js} +1 -1
  50. package/build/assets/{extensions-hub-BZ3HYztk.js → extensions-hub-BqUINAhp.js} +1 -1
  51. package/build/assets/{extensions-navigation-Bnx32WAb.js → extensions-navigation-lraj88Wk.js} +1 -1
  52. package/build/assets/external-link-CgtpA_a1.js +1 -0
  53. package/build/assets/{file-text-RecuaId_.js → file-text-DEK4LSVw.js} +1 -1
  54. package/build/assets/files-tab-DV0L-lFE.js +1 -0
  55. package/build/assets/{form-control-classes-DLN3Qgub.js → form-control-classes-7yFSQJq_.js} +1 -1
  56. package/build/assets/{format-relative-time-BerVamGl.js → format-relative-time-DSErAuVr.js} +1 -1
  57. package/build/assets/git-provider-icon-BvlLAche.js +1 -0
  58. package/build/assets/{git-repo-dropdown-B5VnMftu.js → git-repo-dropdown-ByMzpNko.js} +1 -1
  59. package/build/assets/git-repo-dropdown-C6R7hgM8.js +1 -0
  60. package/build/assets/{highlighted-source-view-CgJfD5VT.js → highlighted-source-view-C_sfncLZ.js} +1 -1
  61. package/build/assets/{home-Y0aDou-a.js → home-BOrlwLqG.js} +1 -1
  62. package/build/assets/home-BvMNC6E-.js +1 -0
  63. package/build/assets/{home-store-Cubdq0uP.js → home-store-CxqsY9Fi.js} +1 -1
  64. package/build/assets/index-home-BvMNC6E-.js +1 -0
  65. package/build/assets/info-BRVcJAUg.js +1 -0
  66. package/build/assets/{install-server-modal-DW6dSyGr.js → install-server-modal-Bl4G1zF4.js} +1 -1
  67. package/build/assets/{kebab-menu-item-content-CKydZrbH.js → kebab-menu-item-content-BGoGFEAg.js} +1 -1
  68. package/build/assets/{launch-c4GEP8oo.js → launch-CkqiSCqi.js} +1 -1
  69. package/build/assets/{list-todo-CheUtB7F.js → list-todo-DNWlzfaM.js} +1 -1
  70. package/build/assets/llm-not-configured-banner-DLw_tu-G.js +27 -0
  71. package/build/assets/llm-settings-B-pkVCrt.js +1 -0
  72. package/build/assets/llm-settings-DSC0-IQ7.js +1 -0
  73. package/build/assets/llm-subscription-service-BAdOl5Xx.js +1 -0
  74. package/build/assets/loader-circle-B47W9XqT.js +1 -0
  75. package/build/assets/{loading-spinner-CN3riY7k.js → loading-spinner-xhnrGP4Y.js} +1 -1
  76. package/build/assets/{manage-backends-modal-DTCME_Pu.js → manage-backends-modal-DhGk5mJt.js} +1 -1
  77. package/build/assets/manifest-653b89aa.js +1 -0
  78. package/build/assets/{manifest-subpage-layout-Ds7G5GZ8.js → manifest-subpage-layout-CKWvL2ig.js} +1 -1
  79. package/build/assets/{map-provider-7Bp2aih5.js → map-provider-Mx8mZuE-.js} +1 -1
  80. package/build/assets/markdown-renderer-DUmk7pFc.js +8 -0
  81. package/build/assets/{mcp-Da7wFU7A.js → mcp-DCkvl6K0.js} +2 -2
  82. package/build/assets/mcp-marketplace-utils-DEbMXlQr.js +1 -0
  83. package/build/assets/messages-DSXvyc21.js +40 -0
  84. package/build/assets/{modal-body-duRaxj_K.js → modal-body-gIe21fDv.js} +1 -1
  85. package/build/assets/{modal-classes-CLEXO6dj.js → modal-classes-D66dlgZ7.js} +1 -1
  86. package/build/assets/{modal-close-button-D0aT02hs.js → modal-close-button-B6iOGYpI.js} +1 -1
  87. package/build/assets/{mouse-pointer-click-Px-dXWcS.js → mouse-pointer-click-BYX1Pw5W.js} +1 -1
  88. package/build/assets/{npm-Cswluf6-.js → npm-DLckoeJc.js} +1 -1
  89. package/build/assets/{onboarding-BKbTYlW1.js → onboarding-D7WDG66N.js} +1 -1
  90. package/build/assets/{onboarding-modal-DrrGlEQq.js → onboarding-modal-C_xVrFNv.js} +1 -1
  91. package/build/assets/{organization-service.api-DK8csGvK.js → organization-service.api-D-s9z18a.js} +1 -1
  92. package/build/assets/pencil-BGOCPRyu.js +1 -0
  93. package/build/assets/{planner-tab-D-mZ1I7n.js → planner-tab-AKaXIIfg.js} +1 -1
  94. package/build/assets/{plugins-management-service-CywqyfLK.js → plugins-management-service-wtmY4QQw.js} +1 -1
  95. package/build/assets/plus-zNEL8rcX.js +1 -0
  96. package/build/assets/{profiles-service.api-vcE_jJCe.js → profiles-service.api-DCMYxHMi.js} +1 -1
  97. package/build/assets/{providers-CdrPPm0z.js → providers-BjrtjX4L.js} +1 -1
  98. package/build/assets/{proxy-b4aqL4SX.js → proxy-9Z_WZggZ.js} +1 -1
  99. package/build/assets/{puzzle-B3v361yY.js → puzzle-BWLmN8z4.js} +1 -1
  100. package/build/assets/recommended-automations-launcher-CFlzhu1o.js +1 -0
  101. package/build/assets/refresh-cw-CXtFWpwv.js +1 -0
  102. package/build/assets/root-CanxKlNV.css +1 -0
  103. package/build/assets/{root-CBBi6IAe.js → root-DkfG_UWR.js} +2 -2
  104. package/build/assets/root-layout-D75LHYhh.js +2 -0
  105. package/build/assets/{schema-field-Z-rMg9ti.js → schema-field-OnM5Uob_.js} +1 -1
  106. package/build/assets/{sdk-section-page-m_cjygxR.js → sdk-section-page-m5WQm2sy.js} +1 -1
  107. package/build/assets/search-CycosyjN.js +1 -0
  108. package/build/assets/{secrets-service-BHF4fxML.js → secrets-service-B26R61C1.js} +1 -1
  109. package/build/assets/{secrets-settings-aBGXtQhX.js → secrets-settings-CbLYCKOX.js} +1 -1
  110. package/build/assets/{segmented-toggle-SmvsR3jW.js → segmented-toggle-DCspm2U5.js} +1 -1
  111. package/build/assets/{settings-CZPGNens.js → settings-BJQI_iBM.js} +1 -1
  112. package/build/assets/{settings-dropdown-input-TWIeiG02.js → settings-dropdown-input-BI8V_Nov.js} +1 -1
  113. package/build/assets/{settings-index-Dtlegd6s.js → settings-index-BiTqJoH7.js} +1 -1
  114. package/build/assets/{settings-input-D61Vzp9e.js → settings-input-Cz62hWVW.js} +1 -1
  115. package/build/assets/{settings-list-classes-sE0ASr1s.js → settings-list-classes-z_3FW5H3.js} +1 -1
  116. package/build/assets/{settings-modal-CalzJP2l.js → settings-modal-BIrIVn97.js} +1 -1
  117. package/build/assets/{settings-service.api-DfPYaxZJ.js → settings-service.api--rJmnuLa.js} +1 -1
  118. package/build/assets/{settings-switch-Drt-rF5s.js → settings-switch-BRsSI8Vs.js} +1 -1
  119. package/build/assets/{settings-utils-gw2ppAvw.js → settings-utils-Ba7vel6T.js} +1 -1
  120. package/build/assets/shared-conversation-CQK_PqHx.js +1 -0
  121. package/build/assets/shield-check-T3JsDJiM.js +1 -0
  122. package/build/assets/{sidebar-layout-Dxg6zc2K.js → sidebar-layout-Bhi3hVcu.js} +1 -1
  123. package/build/assets/{sidebar-mobile-menu-toggle-C6HpQ55l.js → sidebar-mobile-menu-toggle-YWJNRN4p.js} +1 -1
  124. package/build/assets/{sidebar-nav-link-CxLoG-dG.js → sidebar-nav-link-BSUlY5Ml.js} +1 -1
  125. package/build/assets/{sidebar-store-BJeYY-E9.js → sidebar-store-Cl1cUv_F.js} +1 -1
  126. package/build/assets/{skill-card-pill-row-B_BYBONu.js → skill-card-pill-row-BXz8L8Rn.js} +1 -1
  127. package/build/assets/{skill-icon-badge-CN41Hy9l.js → skill-icon-badge-QgfKv31M.js} +1 -1
  128. package/build/assets/{skill-scope-Dt1V5X2p.js → skill-scope-Dc3JPW-8.js} +1 -1
  129. package/build/assets/{skills-plugins-B-H0cCOP.js → skills-plugins-CpTV27n3.js} +1 -1
  130. package/build/assets/{skills-settings-DthdIDUb.js → skills-settings-CSW__IW4.js} +1 -1
  131. package/build/assets/{sparkles-g7y3r-Ut.js → sparkles-TJ0mdECe.js} +1 -1
  132. package/build/assets/{styled-tooltip-C5C07RQC.js → styled-tooltip-BUMSbgrF.js} +1 -1
  133. package/build/assets/{task-list-tab-BTde81Iu.js → task-list-tab-mAHMOkUz.js} +1 -1
  134. package/build/assets/{terminal-DRrJo-cR.js → terminal-BzxBaHx2.js} +1 -1
  135. package/build/assets/{toggle-switch-CIioisto.js → toggle-switch-O5v1FgxW.js} +1 -1
  136. package/build/assets/trash-2-C0xNVp9c.js +1 -0
  137. package/build/assets/{typography-D9tiHct7.js → typography-NOKSk9_R.js} +1 -1
  138. package/build/assets/usage-tab-tEmVN0KD.js +1 -0
  139. package/build/assets/{use-acp-credential-form-DGyo0QvL.js → use-acp-credential-form-BPNi0Zbm.js} +1 -1
  140. package/build/assets/{use-activate-agent-profile-DrPzIKJF.js → use-activate-agent-profile-D9YRQPTF.js} +1 -1
  141. package/build/assets/{use-agent-profiles-B37XWDLq.js → use-agent-profiles-Cb2zUW3l.js} +1 -1
  142. package/build/assets/{use-can-manage-org-profiles-BzE28H3x.js → use-can-manage-org-profiles-Dxzq2AEd.js} +1 -1
  143. package/build/assets/{use-cloud-current-user-id-U6HPjy50.js → use-cloud-current-user-id-Co2eJk2A.js} +1 -1
  144. package/build/assets/{use-config-DapX3pjC.js → use-config-DKAMiI5R.js} +1 -1
  145. package/build/assets/use-create-conversation-CoHTiCbI.js +1 -0
  146. package/build/assets/{use-create-secret-DcpT3RPw.js → use-create-secret-2zBlCDsF.js} +1 -1
  147. package/build/assets/use-is-authed-C52-ivnB.js +1 -0
  148. package/build/assets/{use-is-creating-conversation-CVefC9Ns.js → use-is-creating-conversation-DdaAE6jV.js} +1 -1
  149. package/build/assets/{use-launch-skill-in-chat-BcKNjxxd.js → use-launch-skill-in-chat-COnDpxCQ.js} +1 -1
  150. package/build/assets/use-llm-profiles-C_BHue65.js +1 -0
  151. package/build/assets/{use-manifest-capabilities-zihHDbMW.js → use-manifest-capabilities-DPrQsaPP.js} +1 -1
  152. package/build/assets/{use-onboarding-completion-6kWOW3ul.js → use-onboarding-completion-CCE8OQgV.js} +1 -1
  153. package/build/assets/{use-plugins-marketplace-CqkR8kLE.js → use-plugins-marketplace-CEiak69h.js} +1 -1
  154. package/build/assets/use-save-agent-profile-DK9idD6a.js +1 -0
  155. package/build/assets/{use-save-settings-DIEurJ3D.js → use-save-settings-DNmnbG6f.js} +1 -1
  156. package/build/assets/{use-settings-nav-items-DV9qgeu7.js → use-settings-nav-items-BlFL7YhM.js} +1 -1
  157. package/build/assets/{use-settings-BmLzQjnC.js → use-settings-wCwPaSIv.js} +1 -1
  158. package/build/assets/{use-tracking-salbPJxT.js → use-tracking-CVwPmhlX.js} +1 -1
  159. package/build/assets/{use-user-conversation-Dt-W6uNw.js → use-user-conversation-DVtfg0B_.js} +1 -1
  160. package/build/assets/{useInfiniteQuery-DbCv0Jzd.js → useInfiniteQuery-p1xq35r2.js} +1 -1
  161. package/build/assets/{useMutation-ChpkYxI5.js → useMutation-BFDQmgk9.js} +1 -1
  162. package/build/assets/{useQueries-Cjv3E8_1.js → useQueries-DF1NAAeC.js} +1 -1
  163. package/build/assets/{useQuery-BCnzy4LX.js → useQuery-DRv--6bK.js} +1 -1
  164. package/build/assets/utils-zxEjKE70.js +1 -0
  165. package/build/assets/{vendor~browser-DJ1pl_wn.js → vendor~browser-B-fae1JU.js} +14 -14
  166. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js} +3 -3
  167. package/build/assets/{vendor~files-tab-C87pjSpi.js → vendor~files-tab-D9wR9yM2.js} +1 -1
  168. package/build/assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js +13 -0
  169. package/build/assets/vendor~root-layout-C-IgVx6e.js +1 -0
  170. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js → vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js} +1 -1
  171. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js} +1 -1
  172. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js} +1 -1
  173. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js} +1 -1
  174. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js} +2 -2
  175. package/build/assets/{verification-settings-oi54wEc1.js → verification-settings-B8UMQ7MG.js} +1 -1
  176. package/build/assets/{wrench-B1_H-tL1.js → wrench-DIka3hCq.js} +1 -1
  177. package/build/assets/x-BWKA2Ver.js +1 -0
  178. package/build/assets/zap-DHddTPc0.js +1 -0
  179. package/build/index.html +4 -4
  180. package/build/locales/ar/openhands.json +28 -1
  181. package/build/locales/ca/openhands.json +28 -1
  182. package/build/locales/de/openhands.json +28 -1
  183. package/build/locales/en/openhands.json +28 -1
  184. package/build/locales/es/openhands.json +28 -1
  185. package/build/locales/fr/openhands.json +28 -1
  186. package/build/locales/it/openhands.json +28 -1
  187. package/build/locales/ja/openhands.json +28 -1
  188. package/build/locales/ko-KR/openhands.json +28 -1
  189. package/build/locales/no/openhands.json +28 -1
  190. package/build/locales/pt/openhands.json +28 -1
  191. package/build/locales/tr/openhands.json +28 -1
  192. package/build/locales/uk/openhands.json +28 -1
  193. package/build/locales/zh-CN/openhands.json +28 -1
  194. package/build/locales/zh-TW/openhands.json +28 -1
  195. package/config/defaults.json +3 -3
  196. package/dist/api/agent-server-compatibility.cjs +1 -1
  197. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  198. package/dist/api/agent-server-compatibility.js +1 -1
  199. package/dist/api/agent-server-compatibility.js.map +1 -1
  200. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  201. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  202. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +24 -1
  203. package/dist/api/conversation-service/agent-server-conversation-service.api.js +116 -97
  204. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  205. package/dist/api/llm-balance-service.cjs +2 -0
  206. package/dist/api/llm-balance-service.cjs.map +1 -0
  207. package/dist/api/llm-balance-service.d.ts +33 -0
  208. package/dist/api/llm-balance-service.js +53 -0
  209. package/dist/api/llm-balance-service.js.map +1 -0
  210. package/dist/api/llm-subscription-service.cjs +1 -1
  211. package/dist/api/llm-subscription-service.cjs.map +1 -1
  212. package/dist/api/llm-subscription-service.js +42 -34
  213. package/dist/api/llm-subscription-service.js.map +1 -1
  214. package/dist/components/conversation/index.cjs +1 -1
  215. package/dist/components/conversation/index.d.ts +0 -1
  216. package/dist/components/conversation/index.js +0 -1
  217. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  218. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  219. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +1 -1
  220. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  221. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
  222. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
  223. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +24 -23
  224. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
  225. package/dist/components/conversation-events/chat/group-events.cjs +1 -1
  226. package/dist/components/conversation-events/chat/group-events.cjs.map +1 -1
  227. package/dist/components/conversation-events/chat/group-events.d.ts +3 -3
  228. package/dist/components/conversation-events/chat/group-events.js +27 -26
  229. package/dist/components/conversation-events/chat/group-events.js.map +1 -1
  230. package/dist/components/features/automations/recommended-automations-section.d.ts +7 -0
  231. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  232. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  233. package/dist/components/features/chat/components/chat-input-actions.js +123 -118
  234. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  235. package/dist/components/features/chat/components/chat-input-grip.cjs +1 -1
  236. package/dist/components/features/chat/components/chat-input-grip.cjs.map +1 -1
  237. package/dist/components/features/chat/components/chat-input-grip.d.ts +2 -1
  238. package/dist/components/features/chat/components/chat-input-grip.js +7 -7
  239. package/dist/components/features/chat/components/chat-input-grip.js.map +1 -1
  240. package/dist/components/features/chat/components/context-window-meter.cjs +2 -0
  241. package/dist/components/features/chat/components/context-window-meter.cjs.map +1 -0
  242. package/dist/components/features/chat/components/context-window-meter.d.ts +2 -0
  243. package/dist/components/features/chat/components/context-window-meter.js +131 -0
  244. package/dist/components/features/chat/components/context-window-meter.js.map +1 -0
  245. package/dist/components/features/chat/components/context-window-ring.cjs +2 -0
  246. package/dist/components/features/chat/components/context-window-ring.cjs.map +1 -0
  247. package/dist/components/features/chat/components/context-window-ring.d.ts +26 -0
  248. package/dist/components/features/chat/components/context-window-ring.js +45 -0
  249. package/dist/components/features/chat/components/context-window-ring.js.map +1 -0
  250. package/dist/components/features/chat/custom-chat-input.cjs +1 -1
  251. package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
  252. package/dist/components/features/chat/custom-chat-input.js +68 -67
  253. package/dist/components/features/chat/custom-chat-input.js.map +1 -1
  254. package/dist/components/features/chat/path-component.cjs +1 -1
  255. package/dist/components/features/chat/path-component.cjs.map +1 -1
  256. package/dist/components/features/chat/path-component.js +9 -6
  257. package/dist/components/features/chat/path-component.js.map +1 -1
  258. package/dist/components/features/chat/plan-preview.cjs +1 -1
  259. package/dist/components/features/chat/plan-preview.js +4 -4
  260. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
  261. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
  262. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.d.ts +0 -8
  263. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +92 -50
  264. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
  265. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
  266. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
  267. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +7 -2
  268. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +15 -9
  269. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
  270. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs +2 -0
  271. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.cjs.map +1 -0
  272. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.d.ts +20 -0
  273. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js +76 -0
  274. package/dist/components/features/chat/tool-visualizers/primitives/markdown-file-preview.js.map +1 -0
  275. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  276. package/dist/components/features/controls/server-status-context-menu.cjs.map +1 -1
  277. package/dist/components/features/controls/server-status-context-menu.d.ts +5 -3
  278. package/dist/components/features/controls/server-status-context-menu.js +8 -8
  279. package/dist/components/features/controls/server-status-context-menu.js.map +1 -1
  280. package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
  281. package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
  282. package/dist/components/features/conversation/conversation-name-context-menu.js +58 -61
  283. package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
  284. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  285. package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
  286. package/dist/components/features/conversation/conversation-name-with-status.js +74 -46
  287. package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
  288. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  289. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  290. package/dist/components/features/conversation/conversation-name.js +69 -71
  291. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  292. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs +1 -1
  293. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.cjs.map +1 -1
  294. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js +7 -6
  295. package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.js.map +1 -1
  296. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  297. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  298. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +92 -86
  299. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  300. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  301. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  302. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +81 -71
  303. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  304. package/dist/components/features/conversation/metrics-modal/cost-section.cjs +1 -1
  305. package/dist/components/features/conversation/metrics-modal/cost-section.cjs.map +1 -1
  306. package/dist/components/features/conversation/metrics-modal/cost-section.js +6 -6
  307. package/dist/components/features/conversation/metrics-modal/cost-section.js.map +1 -1
  308. package/dist/components/features/conversation/metrics-modal/metric-row.cjs +1 -1
  309. package/dist/components/features/conversation/metrics-modal/metric-row.cjs.map +1 -1
  310. package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +2 -1
  311. package/dist/components/features/conversation/metrics-modal/metric-row.js +10 -9
  312. package/dist/components/features/conversation/metrics-modal/metric-row.js.map +1 -1
  313. package/dist/components/features/conversation/metrics-modal/usage-section.cjs +1 -1
  314. package/dist/components/features/conversation/metrics-modal/usage-section.cjs.map +1 -1
  315. package/dist/components/features/conversation/metrics-modal/usage-section.js +2 -1
  316. package/dist/components/features/conversation/metrics-modal/usage-section.js.map +1 -1
  317. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs +2 -0
  318. package/dist/components/features/conversation/usage-panel/compact-context-button.cjs.map +1 -0
  319. package/dist/components/features/conversation/usage-panel/compact-context-button.d.ts +16 -0
  320. package/dist/components/features/conversation/usage-panel/compact-context-button.js +59 -0
  321. package/dist/components/features/conversation/usage-panel/compact-context-button.js.map +1 -0
  322. package/dist/components/features/conversation/usage-panel/context-meter.cjs +2 -0
  323. package/dist/components/features/conversation/usage-panel/context-meter.cjs.map +1 -0
  324. package/dist/components/features/conversation/usage-panel/context-meter.d.ts +19 -0
  325. package/dist/components/features/conversation/usage-panel/context-meter.js +46 -0
  326. package/dist/components/features/conversation/usage-panel/context-meter.js.map +1 -0
  327. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs +2 -0
  328. package/dist/components/features/conversation/usage-panel/provider-balance-card.cjs.map +1 -0
  329. package/dist/components/features/conversation/usage-panel/provider-balance-card.d.ts +7 -0
  330. package/dist/components/features/conversation/usage-panel/provider-balance-card.js +57 -0
  331. package/dist/components/features/conversation/usage-panel/provider-balance-card.js.map +1 -0
  332. package/dist/components/features/conversation/usage-panel/usage-panel.cjs +2 -0
  333. package/dist/components/features/conversation/usage-panel/usage-panel.cjs.map +1 -0
  334. package/dist/components/features/conversation/usage-panel/usage-panel.d.ts +9 -0
  335. package/dist/components/features/conversation/usage-panel/usage-panel.js +68 -0
  336. package/dist/components/features/conversation/usage-panel/usage-panel.js.map +1 -0
  337. package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
  338. package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
  339. package/dist/components/features/conversation-panel/budget-display.js +10 -13
  340. package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
  341. package/dist/components/features/conversation-panel/budget-progress-bar.cjs +1 -1
  342. package/dist/components/features/conversation-panel/budget-progress-bar.cjs.map +1 -1
  343. package/dist/components/features/conversation-panel/budget-progress-bar.js +2 -2
  344. package/dist/components/features/conversation-panel/budget-progress-bar.js.map +1 -1
  345. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs +2 -0
  346. package/dist/components/features/conversation-panel/confirm-archive-modal.cjs.map +1 -0
  347. package/dist/components/features/conversation-panel/confirm-archive-modal.d.ts +8 -0
  348. package/dist/components/features/conversation-panel/confirm-archive-modal.js +48 -0
  349. package/dist/components/features/conversation-panel/confirm-archive-modal.js.map +1 -0
  350. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  351. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
  352. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +3 -1
  353. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +39 -34
  354. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
  355. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  356. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  357. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +3 -1
  358. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +104 -80
  359. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  360. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  361. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
  362. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +7 -1
  363. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +25 -17
  364. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
  365. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
  366. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
  367. package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +9 -1
  368. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +94 -84
  369. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
  370. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs +1 -1
  371. package/dist/components/features/conversation-panel/conversation-group-folder-list.cjs.map +1 -1
  372. package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +2 -1
  373. package/dist/components/features/conversation-panel/conversation-group-folder-list.js +32 -31
  374. package/dist/components/features/conversation-panel/conversation-group-folder-list.js.map +1 -1
  375. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs +1 -1
  376. package/dist/components/features/conversation-panel/conversation-group-folder-row.cjs.map +1 -1
  377. package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +2 -1
  378. package/dist/components/features/conversation-panel/conversation-group-folder-row.js +27 -26
  379. package/dist/components/features/conversation-panel/conversation-group-folder-row.js.map +1 -1
  380. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  381. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  382. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +3 -1
  383. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +116 -106
  384. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  385. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  386. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  387. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +27 -0
  388. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +69 -46
  389. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  390. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  391. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  392. package/dist/components/features/conversation-panel/conversation-panel.js +230 -165
  393. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  394. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  395. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  396. package/dist/components/features/files-tab/file-content-viewer.js +22 -25
  397. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  398. package/dist/components/features/markdown/markdown-table-scroll.cjs +1 -1
  399. package/dist/components/features/markdown/markdown-table-scroll.cjs.map +1 -1
  400. package/dist/components/features/markdown/markdown-table-scroll.js +2 -2
  401. package/dist/components/features/markdown/markdown-table-scroll.js.map +1 -1
  402. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  403. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
  404. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +2 -2
  405. package/dist/components/shared/buttons/conversation-confirmation-buttons.js.map +1 -1
  406. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  407. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  408. package/dist/components/shared/modals/confirmation-modals/base-modal.js +1 -1
  409. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  410. package/dist/config/defaults.cjs +1 -1
  411. package/dist/config/defaults.cjs.map +1 -1
  412. package/dist/config/defaults.js +3 -3
  413. package/dist/config/defaults.js.map +1 -1
  414. package/dist/constants/llm-balance.cjs +2 -0
  415. package/dist/constants/llm-balance.cjs.map +1 -0
  416. package/dist/constants/llm-balance.d.ts +13 -0
  417. package/dist/constants/llm-balance.js +6 -0
  418. package/dist/constants/llm-balance.js.map +1 -0
  419. package/dist/contexts/conversation-websocket-context.cjs +2 -2
  420. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  421. package/dist/contexts/conversation-websocket-context.js +217 -209
  422. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  423. package/dist/hooks/chat/use-grip-resize.cjs +1 -1
  424. package/dist/hooks/chat/use-grip-resize.cjs.map +1 -1
  425. package/dist/hooks/chat/use-grip-resize.d.ts +1 -0
  426. package/dist/hooks/chat/use-grip-resize.js +39 -30
  427. package/dist/hooks/chat/use-grip-resize.js.map +1 -1
  428. package/dist/hooks/mutation/use-condense-conversation.cjs +2 -0
  429. package/dist/hooks/mutation/use-condense-conversation.cjs.map +1 -0
  430. package/dist/hooks/mutation/use-condense-conversation.d.ts +12 -0
  431. package/dist/hooks/mutation/use-condense-conversation.js +17 -0
  432. package/dist/hooks/mutation/use-condense-conversation.js.map +1 -0
  433. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  434. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  435. package/dist/hooks/mutation/use-create-conversation.js +30 -21
  436. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  437. package/dist/hooks/mutation/use-new-conversation-command.cjs +1 -1
  438. package/dist/hooks/mutation/use-new-conversation-command.cjs.map +1 -1
  439. package/dist/hooks/mutation/use-new-conversation-command.js +1 -1
  440. package/dist/hooks/mutation/use-new-conversation-command.js.map +1 -1
  441. package/dist/hooks/query/use-conversation-metrics.cjs +1 -1
  442. package/dist/hooks/query/use-conversation-metrics.cjs.map +1 -1
  443. package/dist/hooks/query/use-conversation-metrics.js +1 -1
  444. package/dist/hooks/query/use-conversation-metrics.js.map +1 -1
  445. package/dist/hooks/query/use-llm-balance.cjs +2 -0
  446. package/dist/hooks/query/use-llm-balance.cjs.map +1 -0
  447. package/dist/hooks/query/use-llm-balance.d.ts +10 -0
  448. package/dist/hooks/query/use-llm-balance.js +24 -0
  449. package/dist/hooks/query/use-llm-balance.js.map +1 -0
  450. package/dist/hooks/query/use-search-providers.cjs +1 -1
  451. package/dist/hooks/query/use-search-providers.cjs.map +1 -1
  452. package/dist/hooks/query/use-search-providers.js +1 -1
  453. package/dist/hooks/query/use-search-providers.js.map +1 -1
  454. package/dist/hooks/use-await-context-compaction.cjs +2 -0
  455. package/dist/hooks/use-await-context-compaction.cjs.map +1 -0
  456. package/dist/hooks/use-await-context-compaction.d.ts +38 -0
  457. package/dist/hooks/use-await-context-compaction.js +61 -0
  458. package/dist/hooks/use-await-context-compaction.js.map +1 -0
  459. package/dist/hooks/use-compact-context-action.cjs +2 -0
  460. package/dist/hooks/use-compact-context-action.cjs.map +1 -0
  461. package/dist/hooks/use-compact-context-action.d.ts +10 -0
  462. package/dist/hooks/use-compact-context-action.js +61 -0
  463. package/dist/hooks/use-compact-context-action.js.map +1 -0
  464. package/dist/hooks/use-context-window-usage.cjs +2 -0
  465. package/dist/hooks/use-context-window-usage.cjs.map +1 -0
  466. package/dist/hooks/use-context-window-usage.d.ts +5 -0
  467. package/dist/hooks/use-context-window-usage.js +20 -0
  468. package/dist/hooks/use-context-window-usage.js.map +1 -0
  469. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  470. package/dist/hooks/use-conversation-name-context-menu.cjs.map +1 -1
  471. package/dist/hooks/use-conversation-name-context-menu.d.ts +0 -3
  472. package/dist/hooks/use-conversation-name-context-menu.js +54 -57
  473. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  474. package/dist/hooks/use-drag-resize.cjs +1 -1
  475. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  476. package/dist/hooks/use-drag-resize.d.ts +8 -0
  477. package/dist/hooks/use-drag-resize.js +21 -18
  478. package/dist/hooks/use-drag-resize.js.map +1 -1
  479. package/dist/hooks/use-live-conversation-metrics.cjs +2 -0
  480. package/dist/hooks/use-live-conversation-metrics.cjs.map +1 -0
  481. package/dist/hooks/use-live-conversation-metrics.d.ts +18 -0
  482. package/dist/hooks/use-live-conversation-metrics.js +37 -0
  483. package/dist/hooks/use-live-conversation-metrics.js.map +1 -0
  484. package/dist/hooks/use-select-conversation-tab.cjs +1 -1
  485. package/dist/hooks/use-select-conversation-tab.cjs.map +1 -1
  486. package/dist/hooks/use-select-conversation-tab.js +2 -2
  487. package/dist/hooks/use-select-conversation-tab.js.map +1 -1
  488. package/dist/i18n/declaration.cjs +1 -1
  489. package/dist/i18n/declaration.cjs.map +1 -1
  490. package/dist/i18n/declaration.d.ts +27 -0
  491. package/dist/i18n/declaration.js +1 -1
  492. package/dist/i18n/declaration.js.map +1 -1
  493. package/dist/i18n/translation.cjs +2 -2
  494. package/dist/i18n/translation.cjs.map +1 -1
  495. package/dist/i18n/translation.js +474 -15
  496. package/dist/i18n/translation.js.map +1 -1
  497. package/dist/index.cjs +1 -1
  498. package/dist/index.js +28 -29
  499. package/dist/lib/index.cjs +1 -1
  500. package/dist/lib/index.js +0 -1
  501. package/dist/locales/ar/openhands.json +28 -1
  502. package/dist/locales/ca/openhands.json +28 -1
  503. package/dist/locales/de/openhands.json +28 -1
  504. package/dist/locales/en/openhands.json +28 -1
  505. package/dist/locales/es/openhands.json +28 -1
  506. package/dist/locales/fr/openhands.json +28 -1
  507. package/dist/locales/it/openhands.json +28 -1
  508. package/dist/locales/ja/openhands.json +28 -1
  509. package/dist/locales/ko-KR/openhands.json +28 -1
  510. package/dist/locales/no/openhands.json +28 -1
  511. package/dist/locales/pt/openhands.json +28 -1
  512. package/dist/locales/tr/openhands.json +28 -1
  513. package/dist/locales/uk/openhands.json +28 -1
  514. package/dist/locales/zh-CN/openhands.json +28 -1
  515. package/dist/locales/zh-TW/openhands.json +28 -1
  516. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs +5 -5
  517. package/dist/node_modules/@microlink/react-json-view/dist/main.cjs.map +1 -1
  518. package/dist/node_modules/@microlink/react-json-view/dist/main.js +5194 -5187
  519. package/dist/node_modules/@microlink/react-json-view/dist/main.js.map +1 -1
  520. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +2 -1
  521. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -0
  522. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +21 -1
  523. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -0
  524. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs +2 -1
  525. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.cjs.map +1 -0
  526. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js +22 -1
  527. package/dist/node_modules/@openhands/typescript-client/dist/client/hooks-client.js.map +1 -0
  528. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs +2 -1
  529. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.cjs.map +1 -0
  530. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js +33 -1
  531. package/dist/node_modules/@openhands/typescript-client/dist/client/meta-profiles-client.js.map +1 -0
  532. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  533. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  534. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +56 -22
  535. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  536. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs +1 -1
  537. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs.map +1 -1
  538. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js +3 -0
  539. package/dist/node_modules/@openhands/typescript-client/dist/client/profiles-client.js.map +1 -1
  540. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs +2 -1
  541. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.cjs.map +1 -0
  542. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js +31 -1
  543. package/dist/node_modules/@openhands/typescript-client/dist/client/shared-client.js.map +1 -0
  544. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs +2 -1
  545. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.cjs.map +1 -0
  546. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js +21 -1
  547. package/dist/node_modules/@openhands/typescript-client/dist/client/sub-agents-client.js.map +1 -0
  548. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs +2 -1
  549. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.cjs.map +1 -0
  550. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js +21 -1
  551. package/dist/node_modules/@openhands/typescript-client/dist/client/tool-client.js.map +1 -0
  552. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.cjs.map +1 -1
  553. package/dist/node_modules/@openhands/typescript-client/dist/conversation/local-conversation.js.map +1 -1
  554. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  555. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  556. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +9 -5
  557. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  558. package/dist/node_modules/i18next-http-backend/esm/index.cjs +1 -1
  559. package/dist/node_modules/i18next-http-backend/esm/index.cjs.map +1 -1
  560. package/dist/node_modules/i18next-http-backend/esm/index.js +2 -2
  561. package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
  562. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs +2 -0
  563. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.cjs.map +1 -0
  564. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js +31 -0
  565. package/dist/node_modules/lucide-react/dist/esm/icons/archive-restore.js.map +1 -0
  566. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs +2 -0
  567. package/dist/node_modules/lucide-react/dist/esm/icons/archive.cjs.map +1 -0
  568. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js +23 -0
  569. package/dist/node_modules/lucide-react/dist/esm/icons/archive.js.map +1 -0
  570. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs +2 -0
  571. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.cjs.map +1 -0
  572. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js +12 -0
  573. package/dist/node_modules/lucide-react/dist/esm/icons/gauge.js.map +1 -0
  574. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs +2 -0
  575. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.cjs.map +1 -0
  576. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js +23 -0
  577. package/dist/node_modules/lucide-react/dist/esm/icons/minimize.js.map +1 -0
  578. package/dist/node_modules/zustand/esm/middleware.cjs +3 -3
  579. package/dist/node_modules/zustand/esm/middleware.cjs.map +1 -1
  580. package/dist/node_modules/zustand/esm/middleware.js +33 -31
  581. package/dist/node_modules/zustand/esm/middleware.js.map +1 -1
  582. package/dist/package.cjs +1 -1
  583. package/dist/package.cjs.map +1 -1
  584. package/dist/package.js +17 -16
  585. package/dist/package.js.map +1 -1
  586. package/dist/routes/usage-tab.cjs +2 -0
  587. package/dist/routes/usage-tab.cjs.map +1 -0
  588. package/dist/routes/usage-tab.d.ts +2 -0
  589. package/dist/routes/usage-tab.js +10 -0
  590. package/dist/routes/usage-tab.js.map +1 -0
  591. package/dist/services/child-conversation-launch.cjs +1 -1
  592. package/dist/services/child-conversation-launch.cjs.map +1 -1
  593. package/dist/services/child-conversation-launch.js +11 -5
  594. package/dist/services/child-conversation-launch.js.map +1 -1
  595. package/dist/stores/archived-conversations-store.cjs +2 -0
  596. package/dist/stores/archived-conversations-store.cjs.map +1 -0
  597. package/dist/stores/archived-conversations-store.d.ts +24 -0
  598. package/dist/stores/archived-conversations-store.js +33 -0
  599. package/dist/stores/archived-conversations-store.js.map +1 -0
  600. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  601. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  602. package/dist/stores/conversation-panel-preferences-store.d.ts +3 -0
  603. package/dist/stores/conversation-panel-preferences-store.js +4 -0
  604. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  605. package/dist/stores/conversation-store.cjs.map +1 -1
  606. package/dist/stores/conversation-store.d.ts +1 -1
  607. package/dist/stores/conversation-store.js.map +1 -1
  608. package/dist/stores/metrics-store.cjs +1 -1
  609. package/dist/stores/metrics-store.cjs.map +1 -1
  610. package/dist/stores/metrics-store.d.ts +1 -0
  611. package/dist/stores/metrics-store.js +7 -4
  612. package/dist/stores/metrics-store.js.map +1 -1
  613. package/dist/types/agent-server/core/events/condensation-event.d.ts +3 -0
  614. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +4 -6
  615. package/dist/types/agent-server/type-guards.cjs +1 -1
  616. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  617. package/dist/types/agent-server/type-guards.d.ts +5 -0
  618. package/dist/types/agent-server/type-guards.js +3 -3
  619. package/dist/types/agent-server/type-guards.js.map +1 -1
  620. package/dist/utils/conversation-local-storage.cjs +1 -1
  621. package/dist/utils/conversation-local-storage.cjs.map +1 -1
  622. package/dist/utils/conversation-local-storage.js +2 -1
  623. package/dist/utils/conversation-local-storage.js.map +1 -1
  624. package/dist/utils/format-token-count.cjs +2 -0
  625. package/dist/utils/format-token-count.cjs.map +1 -0
  626. package/dist/utils/format-token-count.d.ts +3 -0
  627. package/dist/utils/format-token-count.js +19 -0
  628. package/dist/utils/format-token-count.js.map +1 -0
  629. package/dist/utils/hover-reveal-classes.cjs +2 -0
  630. package/dist/utils/hover-reveal-classes.cjs.map +1 -0
  631. package/dist/utils/hover-reveal-classes.d.ts +34 -0
  632. package/dist/utils/hover-reveal-classes.js +41 -0
  633. package/dist/utils/hover-reveal-classes.js.map +1 -0
  634. package/dist/utils/is-markdown-file-path.cjs +2 -0
  635. package/dist/utils/is-markdown-file-path.cjs.map +1 -0
  636. package/dist/utils/is-markdown-file-path.d.ts +4 -0
  637. package/dist/utils/is-markdown-file-path.js +14 -0
  638. package/dist/utils/is-markdown-file-path.js.map +1 -0
  639. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  640. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  641. package/dist/utils/mcp-marketplace-utils.d.ts +7 -0
  642. package/dist/utils/mcp-marketplace-utils.js +19 -16
  643. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  644. package/dist/utils/transcript-export/index.cjs +3 -3
  645. package/dist/utils/transcript-export/index.cjs.map +1 -1
  646. package/dist/utils/transcript-export/index.js +12 -12
  647. package/dist/utils/transcript-export/index.js.map +1 -1
  648. package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
  649. package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
  650. package/dist/utils/transcript-export/load-complete-events.js +4 -4
  651. package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
  652. package/dist/utils/workspace-relative-path.cjs +2 -0
  653. package/dist/utils/workspace-relative-path.cjs.map +1 -0
  654. package/dist/utils/workspace-relative-path.d.ts +10 -0
  655. package/dist/utils/workspace-relative-path.js +22 -0
  656. package/dist/utils/workspace-relative-path.js.map +1 -0
  657. package/package.json +17 -16
  658. package/scripts/check-sdk-version-sync.mjs +6 -6
  659. package/scripts/dev-process-utils.mjs +6 -1
  660. package/scripts/dev-safe.mjs +57 -2
  661. package/build/assets/active-backend-context-B_bg5h9O.js +0 -2
  662. package/build/assets/agent-profiles-settings-hd2cAIZM.js +0 -1
  663. package/build/assets/agent-server-conversation-service.api-BheU4HX3.js +0 -86
  664. package/build/assets/agent-settings-D_SVrWhI.js +0 -1
  665. package/build/assets/bot-DuN83i3p.js +0 -1
  666. package/build/assets/browser--eoQOo4M.js +0 -6
  667. package/build/assets/check-DLOKoFU9.js +0 -1
  668. package/build/assets/chevron-down-CnIbtM6i.js +0 -1
  669. package/build/assets/circle-check-CxCYJrpZ.js +0 -1
  670. package/build/assets/conversation-Cmyw9bFh.js +0 -90
  671. package/build/assets/conversation-CvoGZ5vC.js +0 -1
  672. package/build/assets/conversation-panel-CvoGZ5vC.js +0 -1
  673. package/build/assets/conversation-store-B8Eahyeg.js +0 -6
  674. package/build/assets/external-link-zWbg5KXS.js +0 -1
  675. package/build/assets/files-tab-D5zuU5TY.js +0 -1
  676. package/build/assets/git-provider-icon-zuKz2cwo.js +0 -1
  677. package/build/assets/git-repo-dropdown-Bo7ciSNX.js +0 -1
  678. package/build/assets/home-DqyeeFA_.js +0 -1
  679. package/build/assets/index-home-DqyeeFA_.js +0 -1
  680. package/build/assets/info-C9lpK5pw.js +0 -1
  681. package/build/assets/llm-not-configured-banner-DCE_0B4I.js +0 -27
  682. package/build/assets/llm-settings-8eWBF3Ij.js +0 -1
  683. package/build/assets/llm-settings-D9ko42Pi.js +0 -1
  684. package/build/assets/llm-subscription-service-B3K-97lP.js +0 -1
  685. package/build/assets/loader-circle-C5AnEN8r.js +0 -1
  686. package/build/assets/manifest-e1c3bc3b.js +0 -1
  687. package/build/assets/markdown-renderer-DzvgdZey.js +0 -8
  688. package/build/assets/mcp-marketplace-utils-DSLou4n7.js +0 -1
  689. package/build/assets/messages-B2l0qLVk.js +0 -40
  690. package/build/assets/pencil-Bl3GWhgq.js +0 -1
  691. package/build/assets/plus-CtzlyAoF.js +0 -1
  692. package/build/assets/recommended-automations-launcher-DIYgUdMm.js +0 -1
  693. package/build/assets/refresh-cw-B9GhC3QC.js +0 -1
  694. package/build/assets/root-CRK9fOFd.css +0 -1
  695. package/build/assets/root-layout-BFN2rCOy.js +0 -2
  696. package/build/assets/search-CYaiKHRp.js +0 -1
  697. package/build/assets/shared-conversation-BIAcuORk.js +0 -1
  698. package/build/assets/shield-check-D2cpEpv3.js +0 -1
  699. package/build/assets/trash-2-CzDVN-Iw.js +0 -1
  700. package/build/assets/use-create-conversation-CRf1dCm5.js +0 -1
  701. package/build/assets/use-is-authed-Bka89Xmm.js +0 -1
  702. package/build/assets/use-llm-profiles-CHxqoHiN.js +0 -1
  703. package/build/assets/use-save-agent-profile-CH9_EXQG.js +0 -1
  704. package/build/assets/utils-DPQfkd-7.js +0 -1
  705. package/build/assets/vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js +0 -13
  706. package/build/assets/x-RYDBg-e2.js +0 -1
  707. package/build/assets/zap-tbKDzCe3.js +0 -1
  708. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs +0 -2
  709. package/dist/components/features/conversation/metrics-modal/context-window-section.cjs.map +0 -1
  710. package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +0 -6
  711. package/dist/components/features/conversation/metrics-modal/context-window-section.js +0 -46
  712. package/dist/components/features/conversation/metrics-modal/context-window-section.js.map +0 -1
  713. package/dist/components/features/conversation/metrics-modal/empty-state.cjs +0 -2
  714. package/dist/components/features/conversation/metrics-modal/empty-state.cjs.map +0 -1
  715. package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +0 -1
  716. package/dist/components/features/conversation/metrics-modal/empty-state.js +0 -18
  717. package/dist/components/features/conversation/metrics-modal/empty-state.js.map +0 -1
  718. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs +0 -2
  719. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.cjs.map +0 -1
  720. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +0 -5
  721. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js +0 -20
  722. package/dist/components/features/conversation/metrics-modal/metrics-modal-header.js.map +0 -1
  723. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs +0 -2
  724. package/dist/components/features/conversation/metrics-modal/metrics-modal.cjs.map +0 -1
  725. package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +0 -6
  726. package/dist/components/features/conversation/metrics-modal/metrics-modal.js +0 -57
  727. package/dist/components/features/conversation/metrics-modal/metrics-modal.js.map +0 -1
  728. package/dist/icons/u-credit-card.cjs +0 -2
  729. package/dist/icons/u-credit-card.cjs.map +0 -1
  730. package/dist/icons/u-credit-card.js +0 -21
  731. package/dist/icons/u-credit-card.js.map +0 -1
  732. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js} +0 -0
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{t as i,z as a}from"./utils-DPQfkd-7.js";import{f as o}from"./form-control-classes-DLN3Qgub.js";var s=e(t(),1),c=n();function l(){let{t:e}=r(`openhands`);return(0,c.jsx)(`span`,{className:`text-xs text-tertiary-alt`,children:e(a.COMMON$OPTIONAL)})}var u=(0,s.forwardRef)(function({testId:e,name:t,label:n,type:r,defaultValue:a,value:s,placeholder:u,showOptionalTag:d,isDisabled:f,startContent:p,className:m,onChange:h,onKeyDown:g,required:_,min:v,max:y,step:b,pattern:x,title:S,labelClassName:C,ariaDescribedBy:w,ariaInvalid:T,error:E,showRequiredTag:D,hint:O,onBlur:k,inputClassName:A},j){let M=E&&e?`${e}-error`:void 0;return(0,c.jsxs)(`label`,{className:i(`flex flex-col gap-2.5 w-full min-w-0`,m),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,c.jsx)(`span`,{className:i(`text-sm`,C),children:n}),D&&(0,c.jsx)(`span`,{className:`text-red-400 text-sm leading-none`,"aria-hidden":!0,children:`*`}),d&&(0,c.jsx)(l,{}),O&&(0,c.jsx)(`span`,{"data-testid":e?`${e}-hint`:void 0,className:`min-w-0 text-xs text-[var(--oh-muted)]`,children:O})]}),(0,c.jsx)(`input`,{ref:j,"data-testid":e,onChange:e=>h?.(e.target.value),onKeyDown:g,onBlur:k,name:t,disabled:f,type:r,defaultValue:a,value:s,placeholder:u,min:v,max:y,step:b,required:_,pattern:x,title:S,"aria-describedby":M??w,"aria-invalid":!!E||T,className:i(o,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`,E&&`border-red-500`,A)}),E&&(0,c.jsx)(`p`,{id:M,role:`alert`,"data-testid":e?`${e}-error`:void 0,className:`text-xs text-red-400 -mt-1`,children:E})]})});export{l as n,u as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as i,z as a}from"./utils-zxEjKE70.js";import{f as o}from"./form-control-classes-7yFSQJq_.js";var s=e(t(),1),c=n();function l(){let{t:e}=r(`openhands`);return(0,c.jsx)(`span`,{className:`text-xs text-tertiary-alt`,children:e(a.COMMON$OPTIONAL)})}var u=(0,s.forwardRef)(function({testId:e,name:t,label:n,type:r,defaultValue:a,value:s,placeholder:u,showOptionalTag:d,isDisabled:f,startContent:p,className:m,onChange:h,onKeyDown:g,required:_,min:v,max:y,step:b,pattern:x,title:S,labelClassName:C,ariaDescribedBy:w,ariaInvalid:T,error:E,showRequiredTag:D,hint:O,onBlur:k,inputClassName:A},j){let M=E&&e?`${e}-error`:void 0;return(0,c.jsxs)(`label`,{className:i(`flex flex-col gap-2.5 w-full min-w-0`,m),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,c.jsx)(`span`,{className:i(`text-sm`,C),children:n}),D&&(0,c.jsx)(`span`,{className:`text-red-400 text-sm leading-none`,"aria-hidden":!0,children:`*`}),d&&(0,c.jsx)(l,{}),O&&(0,c.jsx)(`span`,{"data-testid":e?`${e}-hint`:void 0,className:`min-w-0 text-xs text-[var(--oh-muted)]`,children:O})]}),(0,c.jsx)(`input`,{ref:j,"data-testid":e,onChange:e=>h?.(e.target.value),onKeyDown:g,onBlur:k,name:t,disabled:f,type:r,defaultValue:a,value:s,placeholder:u,min:v,max:y,step:b,required:_,pattern:x,title:S,"aria-describedby":M??w,"aria-invalid":!!E||T,className:i(o,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`,E&&`border-red-500`,A)}),E&&(0,c.jsx)(`p`,{id:M,role:`alert`,"data-testid":e?`${e}-error`:void 0,className:`text-xs text-red-400 -mt-1`,children:E})]})});export{l as n,u as t};
@@ -1 +1 @@
1
- import{t as e}from"./utils-DPQfkd-7.js";import{_ as t,d as n,i as r,m as i}from"./form-control-classes-DLN3Qgub.js";var a=`h-12 min-h-12`,o=e(r,n,i,`overflow-hidden`),s=e(o,`overflow-auto max-h-[min(70vh,39rem)]`),c=`divide-y divide-[var(--oh-border)]`,l=`hover:bg-[var(--oh-interactive-hover-low)]`,u=e(a,`flex items-center px-3`,t,l),d=e(l,t,`border-t border-[var(--oh-border)] first:border-t-0`),f=e(i,`sticky top-0 z-10 border-b border-[var(--oh-border)]`),p=e(a,`px-3 text-left text-sm font-medium align-middle`),m=e(a,`px-3 text-sm align-middle min-w-0`),h=e(`inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted`,t,`hover:bg-[var(--oh-interactive-hover-low)] hover:text-white`);export{s as a,p as c,u as i,d as l,c as n,m as o,h as r,f as s,o as t};
1
+ import{t as e}from"./utils-zxEjKE70.js";import{_ as t,d as n,i as r,m as i}from"./form-control-classes-7yFSQJq_.js";var a=`h-12 min-h-12`,o=e(r,n,i,`overflow-hidden`),s=e(o,`overflow-auto max-h-[min(70vh,39rem)]`),c=`divide-y divide-[var(--oh-border)]`,l=`hover:bg-[var(--oh-interactive-hover-low)]`,u=e(a,`flex items-center px-3`,t,l),d=e(l,t,`border-t border-[var(--oh-border)] first:border-t-0`),f=e(i,`sticky top-0 z-10 border-b border-[var(--oh-border)]`),p=e(a,`px-3 text-left text-sm font-medium align-middle`),m=e(a,`px-3 text-sm align-middle min-w-0`),h=e(`inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted`,t,`hover:bg-[var(--oh-interactive-hover-low)] hover:text-white`);export{s as a,p as c,u as i,d as l,c as n,m as o,h as r,f as s,o as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{Kt as i}from"./active-backend-context-B_bg5h9O.js";import{L as a,t as o,z as s}from"./utils-DPQfkd-7.js";import{i as c}from"./llm-settings-D9ko42Pi.js";import{t as l}from"./use-tracking-salbPJxT.js";import{t as u}from"./settings-CWFxymAf.js";import{t as d}from"./use-save-settings-DIEurJ3D.js";import{t as f}from"./modal-backdrop-BSzNhM4r.js";import{r as p,t as m}from"./modal-body-duRaxj_K.js";import{t as h}from"./base-modal-3NmIOKDm.js";import{t as g}from"./modal-classes-CLEXO6dj.js";import{t as _}from"./brand-button-CJcwjnfb.js";import{n as v}from"./navigation-context-CQZwH_tC.js";import{t as y}from"./settings-input-D61Vzp9e.js";import{s as b,y as x}from"./schema-field-Z-rMg9ti.js";import{t as S}from"./settings-utils-gw2ppAvw.js";var C=e(t(),1),w=n();function T({testId:e,title:t,description:n,buttons:r}){return(0,w.jsx)(h,{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 E({settings:e,onClose:t}){let{trackSettingsSaved:n}=l(),{mutate:i}=d(),{currentPath:o}=v(),{t:u}=r(`openhands`),p=C.useRef(null),[m,h]=C.useState(!1),g=async e=>{let r=S(e);await i(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=()=>{g(new FormData(p.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);o.startsWith(`/conversations/`)?h(!0):g(t)},O=e.llm_api_key_set,k=b(e,`llm.model`);return(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`form`,{ref:p,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,w.jsx)(c,{currentModel:typeof k==`string`?k:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,w.jsx)(y,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(s.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,w.jsx)(x,{testId:`llm-api-key-help-anchor`,text:u(s.SETTINGS$DONT_KNOW_API_KEY),linkText:u(s.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,w.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,w.jsx)(_,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:u(s.BUTTON$SAVE)})})]}),m&&(0,w.jsx)(f,{children:(0,w.jsx)(T,{title:u(s.MODAL$END_SESSION_TITLE),description:u(s.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(s.BUTTON$END_SESSION),onClick:E},cancel:{text:u(s.BUTTON$CANCEL),onClick:()=>h(!1)}}})})]})}function D({onClose:e,settings:t}){let{t:n}=r(`openhands`);return(0,w.jsx)(f,{children:(0,w.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`,p(`md`),m),children:[(0,w.jsx)(`span`,{className:g,children:n(s.AI_SETTINGS$TITLE)}),(0,w.jsx)(x,{testId:`advanced-settings-link`,text:`${n(s.SETTINGS$DESCRIPTION)}. ${n(s.SETTINGS$FOR_OTHER_OPTIONS)} ${n(s.COMMON$SEE)}`,linkText:n(s.COMMON$ADVANCED_SETTINGS),href:i(`/settings`),suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,w.jsx)(E,{settings:t||u,onClose:e})]})})}export{D as SettingsModal};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{Kt as i}from"./active-backend-context-IqOjobNK.js";import{L as a,t as o,z as s}from"./utils-zxEjKE70.js";import{i as c}from"./llm-settings-DSC0-IQ7.js";import{t as l}from"./use-tracking-CVwPmhlX.js";import{t as u}from"./settings-CWFxymAf.js";import{t as d}from"./use-save-settings-DNmnbG6f.js";import{t as f}from"./modal-backdrop-BSzNhM4r.js";import{r as p,t as m}from"./modal-body-gIe21fDv.js";import{t as h}from"./base-modal-Fnh6Uln9.js";import{t as g}from"./modal-classes-D66dlgZ7.js";import{t as _}from"./brand-button-swT1RyO0.js";import{n as v}from"./navigation-context-CQZwH_tC.js";import{t as y}from"./settings-input-Cz62hWVW.js";import{s as b,y as x}from"./schema-field-OnM5Uob_.js";import{t as S}from"./settings-utils-Ba7vel6T.js";var C=e(t(),1),w=n();function T({testId:e,title:t,description:n,buttons:r}){return(0,w.jsx)(h,{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 E({settings:e,onClose:t}){let{trackSettingsSaved:n}=l(),{mutate:i}=d(),{currentPath:o}=v(),{t:u}=r(`openhands`),p=C.useRef(null),[m,h]=C.useState(!1),g=async e=>{let r=S(e);await i(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=()=>{g(new FormData(p.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);o.startsWith(`/conversations/`)?h(!0):g(t)},O=e.llm_api_key_set,k=b(e,`llm.model`);return(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`form`,{ref:p,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,w.jsx)(c,{currentModel:typeof k==`string`?k:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,w.jsx)(y,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(s.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,w.jsx)(x,{testId:`llm-api-key-help-anchor`,text:u(s.SETTINGS$DONT_KNOW_API_KEY),linkText:u(s.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,w.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,w.jsx)(_,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:u(s.BUTTON$SAVE)})})]}),m&&(0,w.jsx)(f,{children:(0,w.jsx)(T,{title:u(s.MODAL$END_SESSION_TITLE),description:u(s.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(s.BUTTON$END_SESSION),onClick:E},cancel:{text:u(s.BUTTON$CANCEL),onClick:()=>h(!1)}}})})]})}function D({onClose:e,settings:t}){let{t:n}=r(`openhands`);return(0,w.jsx)(f,{children:(0,w.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`,p(`md`),m),children:[(0,w.jsx)(`span`,{className:g,children:n(s.AI_SETTINGS$TITLE)}),(0,w.jsx)(x,{testId:`advanced-settings-link`,text:`${n(s.SETTINGS$DESCRIPTION)}. ${n(s.SETTINGS$FOR_OTHER_OPTIONS)} ${n(s.COMMON$SEE)}`,linkText:n(s.COMMON$ADVANCED_SETTINGS),href:i(`/settings`),suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,w.jsx)(E,{settings:t||u,onClose:e})]})})}export{D as SettingsModal};
@@ -1 +1 @@
1
- import{d as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{$ as t,ct as n}from"./active-backend-context-B_bg5h9O.js";import{t as r}from"./proxy-b4aqL4SX.js";import{t as i}from"./settings-CWFxymAf.js";var a=[`none`,`api_key`,`bearer`,`basic`,`header`,`oauth2`],o=e=>!!e&&typeof e==`object`&&!Array.isArray(e),s=e=>o(e)&&typeof e.strategy==`string`&&a.includes(e.strategy),c=/^[a-zA-Z0-9_-]+$/;function l(e){return c.test(e)}function u(e,t=`mcp`){return e.trim().replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}var d=`**********`,f=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function p(e){if(!f(e))return null;let t=e.mcpServers;return f(t)&&!(`url`in t)&&!(`command`in t)?t:e}function m(e){if(!f(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0}function h(e){return e===`**********`?!0:Array.isArray(e)?e.some(h):f(e)?Object.values(e).some(h):!1}var g=e=>e.enabled===!1?!1:void 0,_=e=>{if(e===`stdio`||e===`sse`||e===`streamable-http`)return e;if(e===`http`||e===`shttp`||e===void 0)return`http`};function v(e){let t=p(e);if(!t)return{};let n={};for(let[e,r]of Object.entries(t)){if(!f(r))continue;if(typeof r.command==`string`){n[e]={transport:`stdio`,command:r.command,...Array.isArray(r.args)&&r.args.every(e=>typeof e==`string`)&&{args:r.args},...m(r.env)&&{env:m(r.env)},...typeof r.cwd==`string`&&{cwd:r.cwd},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...r.enabled===!1&&{enabled:!1}};continue}if(typeof r.url!=`string`)continue;let t=_(r.transport);!t||t===`stdio`||(n[e]={transport:t,url:r.url,...m(r.headers)&&{headers:m(r.headers)},...s(r.auth)&&{auth:r.auth},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...typeof r.sse_read_timeout==`number`&&{sse_read_timeout:r.sse_read_timeout},...typeof r.keep_alive==`boolean`&&{keep_alive:r.keep_alive},...r.enabled===!1&&{enabled:!1}})}return n}function ee(e){return e.type===`stdio`?{transport:`stdio`,command:e.command,...e.args?.length?{args:e.args}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.enabled===!1&&{enabled:!1}}:{transport:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0?{headers:e.headers}:{},...e.auth?{auth:e.auth}:{},...e.type===`shttp`&&e.timeout!==void 0?{timeout:e.timeout}:{},...e.enabled===!1&&{enabled:!1}}}var y=(e,t)=>t.enabled===!1?{enabled:!1}:g(e)===!1?{enabled:!0}:{},b=(e,t)=>{if(!t)return e?null:void 0;let n={};for(let[e,r]of Object.entries(t))r!==`**********`&&(n[e]=r);for(let r of Object.keys(e??{}))r in t||(n[r]=null);return Object.keys(n).length>0?n:void 0},x=[`client_auth_method`,`scopes`,`client_id`,`client_secret`],S=(e,t)=>{if(t===`**********`||t===void 0)return;if(t===null)return null;if(Array.isArray(t))return h(t)||JSON.stringify(e)===JSON.stringify(t)?void 0:t;if(!f(t))return Object.is(e,t)?void 0:t;let n=f(e)?e:{},r={};for(let[e,i]of Object.entries(t)){let t=S(n[e],i);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:void 0},C=(e,t)=>{if(t===void 0)return;if(t===null)return null;let n=S(e,t),r=f(n)?{...n}:{},i=f(e)?e:{};for(let e of x)e in i&&!(e in t)&&(r[e]=null);if(Object.keys(r).length!==0)return{type:`oauth`,...r}},w=(e,t)=>{if(!e||e.strategy===t.strategy)return t;let n={...t};for(let t of Object.keys(e))t!==`strategy`&&!(t in n)&&(n[t]=null);return n},T=`Removing an individual header from header authentication is not supported yet. Replace the credential or clear authentication, then re-enter the headers you want to keep.`,E=(e,t)=>{let n=b(e?.strategy===`header`?e.headers:void 0,t.headers);if(n){if(Object.values(n).some(e=>e===null))throw Error(T);return{strategy:`header`,headers:n}}},D=(e,t)=>{let n=e?.strategy===`oauth2`?e:void 0,r=C(n?.authentication,t.authentication),i=S(n?.state,t.state);if(!(n&&r===void 0&&i===void 0))return w(e,{strategy:`oauth2`,...r!==void 0&&{authentication:r},...i!==void 0&&{state:i}})};function O(e,t){let n=y(e,t);if(t.type===`stdio`){let r=b(e.transport===`stdio`?e.env:void 0,t.env);return{transport:`stdio`,command:t.command,...t.args?.length?{args:t.args}:e.transport===`stdio`&&e.args?{args:null}:{},...r===void 0?{}:{env:r},...n}}let r=e.transport===`stdio`?void 0:e,i={transport:t.type===`sse`?`sse`:`http`,url:t.url,...n};if(t.type===`shttp`&&(t.timeout===void 0?r?.timeout!==void 0&&(i.timeout=null):i.timeout=t.timeout),t.auth)if(t.auth.strategy===`oauth2`){let e=D(r?.auth,t.auth);e!==void 0&&(i.auth=e)}else if(t.auth.strategy===`header`&&r?.auth?.strategy===`header`){let e=E(r.auth,t.auth);e!==void 0&&(i.auth=e)}else h(t.auth)||(i.auth=w(r?.auth,t.auth));else r?.auth&&(i.auth=null);return i}var k=(e,t)=>{let n=(e,t)=>{let r=f(e)?{...e}:{};if(!f(t))return r;for(let[e,i]of Object.entries(t))i===null?delete r[e]:f(i)?r[e]=n(r[e],i):r[e]=i;return r};return n(e,t)},A=`Replace or clear the stored credential before renaming this MCP server.`;function te(e,t,n,r){if(h(n.transport===`stdio`?n.env:{auth:n.auth,headers:n.headers}))throw Error(A);let i=k(n,O(n,r));return{[e]:null,[t]:i}}function ne(e,t,n){let r=u(t||n);if(!(r in e))return r;let i=1;for(;`${r}_${i}`in e;)i+=1;return`${r}_${i}`}function j(){let e=n().backend;if(e.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return e}function M(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),e.mcp_config&&Object.keys(e.mcp_config).length>0&&(t.mcp_config=e.mcp_config),t}function N(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function P(){let e=await r({backend:j(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:M(e),conversation_settings:N(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function F(e){let t=j(),n={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(n.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(n.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,r]of Object.entries(e.app_preferences))r!==void 0&&(n[t]=r);await r({backend:t,method:`POST`,path:`/api/v1/settings`,body:n})}async function I(){return r({backend:j(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function L(){return r({backend:j(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var R=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`],z=new Set(R),B=e=>z.has(e),V=e=>{let t={},n={};for(let[r,i]of Object.entries(e))B(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},H=e=>JSON.parse(JSON.stringify(e)),U=(e,t)=>({...e??{},...t??{}});async function W(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var G={redacted:null,encrypted:null,timestamp:0},K=300*1e3,q=()=>Date.now()-G.timestamp<K,J=()=>{G={redacted:null,encrypted:null,timestamp:0}},Y=e=>!!e&&typeof e==`object`&&!Array.isArray(e),X=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,re=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:X(e.username,e.password)};case`header`:return m(e.headers)??{};case`oauth2`:{let t=Y(e.state)?e.state.tokens:void 0;return!Y(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},Z=async e=>{if(!Y(e))return e;let t=Y(e.mcpServers),r=t?e.mcpServers:e,i=Object.values(r).some(e=>Y(e)&&Y(e.auth)&&e.auth!==null)&&n().backend.kind===`cloud`,a=new Map;if(i)try{let e=await P(),t=Y(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(Y(n)){let t=m(n.headers);t&&a.set(e,t)}}catch{}let o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!Y(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!Y(t.auth))return[e,t];let n=re(t.auth);if(n===null)return[e,t];let r={...t},i={...m(t.headers)??{},...n},o=a.get(e);if(o)for(let e of Object.keys(o))e in i||(i[e]=null);return delete r.auth,Object.keys(i).length>0?r.headers=i:delete r.headers,[e,r]}));return t?{...e,mcpServers:o}:o},Q=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of R){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=U(i.agent_settings??{},e.agent_settings??{}),n=U(i.conversation_settings??{},e.conversation_settings??{}),r={...H(i),...e,provider_tokens_set:{...i.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(r.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(r.llm_model=a.model),typeof a?.base_url==`string`&&(r.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(r.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(r.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(r.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(r.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(r.max_iterations=n.max_iterations),r.search_api_key_set=!!r.search_api_key,r},ie=class r{static async fetchSettingsFromApi(n){return W(()=>new e(t()).getSettings({exposeSecrets:n}))}static async getSettings(){if(n().backend.kind===`cloud`)try{return $(await W(()=>P()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(q()&&G.redacted)return $(Q(G.redacted));try{let e=await this.fetchSettingsFromApi();return G.redacted=e,G.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(q()&&G.encrypted)return{agentSettings:G.encrypted.agent_settings,conversationSettings:G.encrypted.conversation_settings,secretsEncrypted:!0};let e=await this.fetchSettingsFromApi(`encrypted`);return G.encrypted=e,G.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0}}static async getSettingsSchema(){return n().backend.kind===`cloud`?await I():await new e(t()).getAgentSchema()}static async getConversationSettingsSchema(){return n().backend.kind===`cloud`?await L():await new e(t()).getConversationSchema()}static async patchMcpConfig(r){if(n().backend.kind===`cloud`){let e=await Z(r);await W(()=>F({agent_settings_diff:{mcp_config:e}}))}else await W(()=>new e(t()).updateSettings({agent_settings_diff:{mcp_config:r}}));return J(),!0}static async patchMcpServer(i,a){return n().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await W(()=>new e(t()).patchMcpServer(i,a)),J(),!0)}static async createMcpServer(i,a){return n().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await W(()=>new e(t()).createMcpServer(i,a)),J(),!0)}static async deleteMcpServer(i){return n().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await W(()=>new e(t()).deleteMcpServer(i)),J(),!0)}static async saveSettings(r){let{extracted:i,rest:a}=V(r),o=Object.keys(i).length>0,s={},c=a.agent_settings_diff;c&&Object.keys(c).length>0&&(s.agent_settings_diff=c);let l=a.conversation_settings_diff;if(l&&Object.keys(l).length>0&&(s.conversation_settings_diff=l),o&&(s.misc_settings_diff={app_preferences:i}),n().backend.kind===`cloud`){if(!(s.agent_settings_diff||s.conversation_settings_diff||o))return!0;let e={};s.agent_settings_diff&&(e.agent_settings_diff={...s.agent_settings_diff},`mcp_config`in e.agent_settings_diff&&(e.agent_settings_diff.mcp_config=await Z(e.agent_settings_diff.mcp_config))),s.conversation_settings_diff&&(e.conversation_settings_diff=s.conversation_settings_diff),o&&(e.app_preferences=i),await W(()=>F(e))}else{if(!(s.agent_settings_diff||s.conversation_settings_diff||s.misc_settings_diff))return!0;await W(()=>new e(t()).updateSettings(s))}return J(),!0}static invalidateCache(){J()}};export{O as a,h as c,c as d,l as f,ne as i,v as l,s as m,A as n,te as o,u as p,d as r,g as s,ie as t,ee as u};
1
+ import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{$ as t,ct as n}from"./active-backend-context-IqOjobNK.js";import{t as r}from"./proxy-9Z_WZggZ.js";import{t as i}from"./settings-CWFxymAf.js";var a=[`none`,`api_key`,`bearer`,`basic`,`header`,`oauth2`],o=e=>!!e&&typeof e==`object`&&!Array.isArray(e),s=e=>o(e)&&typeof e.strategy==`string`&&a.includes(e.strategy),c=/^[a-zA-Z0-9_-]+$/;function l(e){return c.test(e)}function u(e,t=`mcp`){return e.trim().replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}var d=`**********`,f=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function p(e){if(!f(e))return null;let t=e.mcpServers;return f(t)&&!(`url`in t)&&!(`command`in t)?t:e}function m(e){if(!f(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0}function h(e){return e===`**********`?!0:Array.isArray(e)?e.some(h):f(e)?Object.values(e).some(h):!1}var g=e=>e.enabled===!1?!1:void 0,_=e=>{if(e===`stdio`||e===`sse`||e===`streamable-http`)return e;if(e===`http`||e===`shttp`||e===void 0)return`http`};function v(e){let t=p(e);if(!t)return{};let n={};for(let[e,r]of Object.entries(t)){if(!f(r))continue;if(typeof r.command==`string`){n[e]={transport:`stdio`,command:r.command,...Array.isArray(r.args)&&r.args.every(e=>typeof e==`string`)&&{args:r.args},...m(r.env)&&{env:m(r.env)},...typeof r.cwd==`string`&&{cwd:r.cwd},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...r.enabled===!1&&{enabled:!1}};continue}if(typeof r.url!=`string`)continue;let t=_(r.transport);!t||t===`stdio`||(n[e]={transport:t,url:r.url,...m(r.headers)&&{headers:m(r.headers)},...s(r.auth)&&{auth:r.auth},...typeof r.description==`string`&&{description:r.description},...typeof r.icon==`string`&&{icon:r.icon},...typeof r.timeout==`number`&&{timeout:r.timeout},...typeof r.sse_read_timeout==`number`&&{sse_read_timeout:r.sse_read_timeout},...typeof r.keep_alive==`boolean`&&{keep_alive:r.keep_alive},...r.enabled===!1&&{enabled:!1}})}return n}function ee(e){return e.type===`stdio`?{transport:`stdio`,command:e.command,...e.args?.length?{args:e.args}:{},...e.env&&Object.keys(e.env).length>0?{env:e.env}:{},...e.enabled===!1&&{enabled:!1}}:{transport:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0?{headers:e.headers}:{},...e.auth?{auth:e.auth}:{},...e.type===`shttp`&&e.timeout!==void 0?{timeout:e.timeout}:{},...e.enabled===!1&&{enabled:!1}}}var y=(e,t)=>t.enabled===!1?{enabled:!1}:g(e)===!1?{enabled:!0}:{},b=(e,t)=>{if(!t)return e?null:void 0;let n={};for(let[e,r]of Object.entries(t))r!==`**********`&&(n[e]=r);for(let r of Object.keys(e??{}))r in t||(n[r]=null);return Object.keys(n).length>0?n:void 0},x=[`client_auth_method`,`scopes`,`client_id`,`client_secret`],S=(e,t)=>{if(t===`**********`||t===void 0)return;if(t===null)return null;if(Array.isArray(t))return h(t)||JSON.stringify(e)===JSON.stringify(t)?void 0:t;if(!f(t))return Object.is(e,t)?void 0:t;let n=f(e)?e:{},r={};for(let[e,i]of Object.entries(t)){let t=S(n[e],i);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:void 0},C=(e,t)=>{if(t===void 0)return;if(t===null)return null;let n=S(e,t),r=f(n)?{...n}:{},i=f(e)?e:{};for(let e of x)e in i&&!(e in t)&&(r[e]=null);if(Object.keys(r).length!==0)return{type:`oauth`,...r}},w=(e,t)=>{if(!e||e.strategy===t.strategy)return t;let n={...t};for(let t of Object.keys(e))t!==`strategy`&&!(t in n)&&(n[t]=null);return n},T=`Removing an individual header from header authentication is not supported yet. Replace the credential or clear authentication, then re-enter the headers you want to keep.`,E=(e,t)=>{let n=b(e?.strategy===`header`?e.headers:void 0,t.headers);if(n){if(Object.values(n).some(e=>e===null))throw Error(T);return{strategy:`header`,headers:n}}},D=(e,t)=>{let n=e?.strategy===`oauth2`?e:void 0,r=C(n?.authentication,t.authentication),i=S(n?.state,t.state);if(!(n&&r===void 0&&i===void 0))return w(e,{strategy:`oauth2`,...r!==void 0&&{authentication:r},...i!==void 0&&{state:i}})};function O(e,t){let n=y(e,t);if(t.type===`stdio`){let r=b(e.transport===`stdio`?e.env:void 0,t.env);return{transport:`stdio`,command:t.command,...t.args?.length?{args:t.args}:e.transport===`stdio`&&e.args?{args:null}:{},...r===void 0?{}:{env:r},...n}}let r=e.transport===`stdio`?void 0:e,i={transport:t.type===`sse`?`sse`:`http`,url:t.url,...n};if(t.type===`shttp`&&(t.timeout===void 0?r?.timeout!==void 0&&(i.timeout=null):i.timeout=t.timeout),t.auth)if(t.auth.strategy===`oauth2`){let e=D(r?.auth,t.auth);e!==void 0&&(i.auth=e)}else if(t.auth.strategy===`header`&&r?.auth?.strategy===`header`){let e=E(r.auth,t.auth);e!==void 0&&(i.auth=e)}else h(t.auth)||(i.auth=w(r?.auth,t.auth));else r?.auth&&(i.auth=null);return i}var k=(e,t)=>{let n=(e,t)=>{let r=f(e)?{...e}:{};if(!f(t))return r;for(let[e,i]of Object.entries(t))i===null?delete r[e]:f(i)?r[e]=n(r[e],i):r[e]=i;return r};return n(e,t)},A=`Replace or clear the stored credential before renaming this MCP server.`;function te(e,t,n,r){if(h(n.transport===`stdio`?n.env:{auth:n.auth,headers:n.headers}))throw Error(A);let i=k(n,O(n,r));return{[e]:null,[t]:i}}function ne(e,t,n){let r=u(t||n);if(!(r in e))return r;let i=1;for(;`${r}_${i}`in e;)i+=1;return`${r}_${i}`}function j(){let e=n().backend;if(e.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return e}function M(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),e.mcp_config&&Object.keys(e.mcp_config).length>0&&(t.mcp_config=e.mcp_config),t}function N(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function P(){let e=await r({backend:j(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:M(e),conversation_settings:N(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function F(e){let t=j(),n={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(n.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(n.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,r]of Object.entries(e.app_preferences))r!==void 0&&(n[t]=r);await r({backend:t,method:`POST`,path:`/api/v1/settings`,body:n})}async function I(){return r({backend:j(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function L(){return r({backend:j(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var R=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`],z=new Set(R),B=e=>z.has(e),V=e=>{let t={},n={};for(let[r,i]of Object.entries(e))B(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},H=e=>JSON.parse(JSON.stringify(e)),U=(e,t)=>({...e??{},...t??{}});async function W(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var G={redacted:null,encrypted:null,timestamp:0},K=300*1e3,q=()=>Date.now()-G.timestamp<K,J=()=>{G={redacted:null,encrypted:null,timestamp:0}},Y=e=>!!e&&typeof e==`object`&&!Array.isArray(e),X=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,re=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:X(e.username,e.password)};case`header`:return m(e.headers)??{};case`oauth2`:{let t=Y(e.state)?e.state.tokens:void 0;return!Y(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},Z=async e=>{if(!Y(e))return e;let t=Y(e.mcpServers),r=t?e.mcpServers:e,i=Object.values(r).some(e=>Y(e)&&Y(e.auth)&&e.auth!==null)&&n().backend.kind===`cloud`,a=new Map;if(i)try{let e=await P(),t=Y(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(Y(n)){let t=m(n.headers);t&&a.set(e,t)}}catch{}let o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!Y(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!Y(t.auth))return[e,t];let n=re(t.auth);if(n===null)return[e,t];let r={...t},i={...m(t.headers)??{},...n},o=a.get(e);if(o)for(let e of Object.keys(o))e in i||(i[e]=null);return delete r.auth,Object.keys(i).length>0?r.headers=i:delete r.headers,[e,r]}));return t?{...e,mcpServers:o}:o},Q=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of R){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=U(i.agent_settings??{},e.agent_settings??{}),n=U(i.conversation_settings??{},e.conversation_settings??{}),r={...H(i),...e,provider_tokens_set:{...i.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(r.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(r.llm_model=a.model),typeof a?.base_url==`string`&&(r.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(r.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(r.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(r.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(r.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(r.max_iterations=n.max_iterations),r.search_api_key_set=!!r.search_api_key,r},ie=class r{static async fetchSettingsFromApi(n){return W(()=>new e(t()).getSettings({exposeSecrets:n}))}static async getSettings(){if(n().backend.kind===`cloud`)try{return $(await W(()=>P()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(q()&&G.redacted)return $(Q(G.redacted));try{let e=await this.fetchSettingsFromApi();return G.redacted=e,G.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(q()&&G.encrypted)return{agentSettings:G.encrypted.agent_settings,conversationSettings:G.encrypted.conversation_settings,secretsEncrypted:!0};let e=await this.fetchSettingsFromApi(`encrypted`);return G.encrypted=e,G.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0}}static async getSettingsSchema(){return n().backend.kind===`cloud`?await I():await new e(t()).getAgentSchema()}static async getConversationSettingsSchema(){return n().backend.kind===`cloud`?await L():await new e(t()).getConversationSchema()}static async patchMcpConfig(r){if(n().backend.kind===`cloud`){let e=await Z(r);await W(()=>F({agent_settings_diff:{mcp_config:e}}))}else await W(()=>new e(t()).updateSettings({agent_settings_diff:{mcp_config:r}}));return J(),!0}static async patchMcpServer(i,a){return n().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await W(()=>new e(t()).patchMcpServer(i,a)),J(),!0)}static async createMcpServer(i,a){return n().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await W(()=>new e(t()).createMcpServer(i,a)),J(),!0)}static async deleteMcpServer(i){return n().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await W(()=>new e(t()).deleteMcpServer(i)),J(),!0)}static async saveSettings(r){let{extracted:i,rest:a}=V(r),o=Object.keys(i).length>0,s={},c=a.agent_settings_diff;c&&Object.keys(c).length>0&&(s.agent_settings_diff=c);let l=a.conversation_settings_diff;if(l&&Object.keys(l).length>0&&(s.conversation_settings_diff=l),o&&(s.misc_settings_diff={app_preferences:i}),n().backend.kind===`cloud`){if(!(s.agent_settings_diff||s.conversation_settings_diff||o))return!0;let e={};s.agent_settings_diff&&(e.agent_settings_diff={...s.agent_settings_diff},`mcp_config`in e.agent_settings_diff&&(e.agent_settings_diff.mcp_config=await Z(e.agent_settings_diff.mcp_config))),s.conversation_settings_diff&&(e.conversation_settings_diff=s.conversation_settings_diff),o&&(e.app_preferences=i),await W(()=>F(e))}else{if(!(s.agent_settings_diff||s.conversation_settings_diff||s.misc_settings_diff))return!0;await W(()=>new e(t()).updateSettings(s))}return J(),!0}static invalidateCache(){J()}};export{O as a,h as c,c as d,l as f,ne as i,v as l,s as m,A as n,te as o,u as p,d as r,g as s,ie as t,ee as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{t as i,z as a}from"./utils-DPQfkd-7.js";import{n as o}from"./toggle-switch-CIioisto.js";var s=e(t(),1),c=n();function l({children:e,testId:t,name:n,onToggle:l,defaultIsToggled:u,isToggled:d,isBeta:f,isDisabled:p,togglePosition:m=`left`}){let{t:h}=r(`openhands`),[g,_]=s.useState(u??!1),v=e=>{p||(_(e),l?.(e))},y=(0,c.jsx)(`input`,{hidden:!0,"data-testid":t,name:n,type:`checkbox`,onChange:e=>v(e.target.checked),checked:d??g,disabled:p}),b=(0,c.jsx)(o,{enabled:d??g}),x=e||f?(0,c.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(`span`,{className:`text-sm`,children:e}),f&&(0,c.jsx)(`span`,{className:`text-[11px] leading-4 text-base font-[500] tracking-tighter bg-primary px-1 rounded-full`,children:h(a.BADGE$BETA)})]}):null;return(0,c.jsxs)(`label`,{className:i(`flex items-center gap-2`,m===`right`?`w-full justify-between`:`w-fit`,p?`cursor-not-allowed opacity-50`:`cursor-pointer`),children:[y,m===`right`?(0,c.jsxs)(c.Fragment,{children:[x,b]}):(0,c.jsxs)(c.Fragment,{children:[b,x]})]})}export{l as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as i,z as a}from"./utils-zxEjKE70.js";import{n as o}from"./toggle-switch-O5v1FgxW.js";var s=e(t(),1),c=n();function l({children:e,testId:t,name:n,onToggle:l,defaultIsToggled:u,isToggled:d,isBeta:f,isDisabled:p,togglePosition:m=`left`}){let{t:h}=r(`openhands`),[g,_]=s.useState(u??!1),v=e=>{p||(_(e),l?.(e))},y=(0,c.jsx)(`input`,{hidden:!0,"data-testid":t,name:n,type:`checkbox`,onChange:e=>v(e.target.checked),checked:d??g,disabled:p}),b=(0,c.jsx)(o,{enabled:d??g}),x=e||f?(0,c.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(`span`,{className:`text-sm`,children:e}),f&&(0,c.jsx)(`span`,{className:`text-[11px] leading-4 text-base font-[500] tracking-tighter bg-primary px-1 rounded-full`,children:h(a.BADGE$BETA)})]}):null;return(0,c.jsxs)(`label`,{className:i(`flex items-center gap-2`,m===`right`?`w-full justify-between`:`w-fit`,p?`cursor-not-allowed opacity-50`:`cursor-pointer`),children:[y,m===`right`?(0,c.jsxs)(c.Fragment,{children:[x,b]}):(0,c.jsxs)(c.Fragment,{children:[b,x]})]})}export{l as t};
@@ -1 +1 @@
1
- import{t as e}from"./map-provider-7Bp2aih5.js";var t=t=>{let n=t.get(`llm-provider-input`)?.toString(),r=n?e(n):void 0,i=t.get(`llm-model-input`)?.toString();return{llmModel:r&&i?`${r}/${i}`:void 0,llmApiKey:t.get(`llm-api-key-input`)?.toString(),agent:t.get(`agent`)?.toString(),language:t.get(`language`)?.toString()}},n=e=>{let{llmModel:n,llmApiKey:r,agent:i,language:a}=t(e),o={};n&&(o.model=n),r!==void 0&&(o.api_key=r);let s={};return Object.keys(o).length>0&&(s.llm=o),i&&(s.agent=i),{...Object.keys(s).length>0?{agent_settings_diff:s}:{},...a?{language:a}:{}}};function r(e,t){return!!(t?.hide_llm_settings&&e===`/settings/llm`)}function i(e){return[{path:`/settings/agents`,hidden:!1},{path:`/settings/llm`,hidden:!!e?.hide_llm_settings},{path:`/settings`,hidden:!!e?.hide_llm_settings},{path:`/settings/app`,hidden:!1},{path:`/settings/secrets`,hidden:!1}].find(e=>!e.hidden)?.path??null}export{i as n,r,n as t};
1
+ import{t as e}from"./map-provider-Mx8mZuE-.js";var t=t=>{let n=t.get(`llm-provider-input`)?.toString(),r=n?e(n):void 0,i=t.get(`llm-model-input`)?.toString();return{llmModel:r&&i?`${r}/${i}`:void 0,llmApiKey:t.get(`llm-api-key-input`)?.toString(),agent:t.get(`agent`)?.toString(),language:t.get(`language`)?.toString()}},n=e=>{let{llmModel:n,llmApiKey:r,agent:i,language:a}=t(e),o={};n&&(o.model=n),r!==void 0&&(o.api_key=r);let s={};return Object.keys(o).length>0&&(s.llm=o),i&&(s.agent=i),{...Object.keys(s).length>0?{agent_settings_diff:s}:{},...a?{language:a}:{}}};function r(e,t){return!!(t?.hide_llm_settings&&e===`/settings/llm`)}function i(e){return[{path:`/settings/agents`,hidden:!1},{path:`/settings/llm`,hidden:!!e?.hide_llm_settings},{path:`/settings`,hidden:!!e?.hide_llm_settings},{path:`/settings/app`,hidden:!1},{path:`/settings/secrets`,hidden:!1}].find(e=>!e.hidden)?.path??null}export{i as n,r,n as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{B as r,U as i,c as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as s}from"./useInfiniteQuery-p1xq35r2.js";import{c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as l}from"./useQuery-DRv--6bK.js";import{$ as u}from"./active-backend-context-IqOjobNK.js";import{z as d}from"./utils-zxEjKE70.js";import{t as f}from"./messages-DSXvyc21.js";import{t as p}from"./loading-spinner-xhnrGP4Y.js";import{t as m}from"./openhands-logo-BS-Epajy.js";import{C as h,d as g}from"./markdown-renderer-DUmk7pFc.js";var _=e(t(),1),v=e=>l({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new c(u()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>s({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new c(u()).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=i(function(){let{t:e}=o(`openhands`),{conversationId:t}=r(),{data:n,isLoading:i,error:s}=v(t),{data:c,isLoading:l,error:u,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=i||l,E=s||u,D=_.useMemo(()=>c?.pages?c.pages.flatMap(e=>e.items):[],[c?.pages]),O=_.useMemo(()=>D.reduce((e,t)=>h(t,e),[]).filter(g),[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(d.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(d.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(d.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(d.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(d.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(d.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)(f,{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(d.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};
@@ -0,0 +1 @@
1
+ import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";var t=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
@@ -1 +1 @@
1
- import{t as e}from"./utils-DPQfkd-7.js";var t=`transition-none motion-reduce:transition-none`,n=`flex h-9 w-[18px] shrink-0 items-center justify-center`,r=`relative h-9 min-h-9 max-h-9 w-full shrink-0`;function i(t){return e(`flex h-10 min-h-10 shrink-0 items-center w-full`,t?`px-0`:`gap-2 pl-2.5 pr-2.5`)}var a={active:`bg-tertiary text-white font-normal`,idle:`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`};function o(t){return e(`flex flex-col gap-0.5 w-full shrink-0 items-stretch`,!t&&`pr-2.5`)}function s(n){let{indent:r=!1,collapsed:i=!1}=n??{};return e(`flex h-9 min-h-9 min-w-0 items-center rounded-md`,t,`text-sm leading-5 w-full`,i?`group gap-0 px-0 overflow-visible bg-transparent hover:bg-transparent`:`gap-2 px-2.5 overflow-hidden`,r&&!i&&`pl-7`)}function c(n){return e(`pointer-events-none absolute inset-0 z-0 rounded-md`,t,n?`bg-tertiary`:`bg-transparent group-hover:bg-[var(--oh-surface-raised)]`)}function l(t){return e(`relative z-[1] flex h-full w-full items-center justify-start pl-2.5 [&_svg]:shrink-0`,t?`text-white font-normal`:`text-[var(--oh-muted)] group-hover:text-white`)}function u(e){return e?`sr-only`:`min-w-0 truncate`}var d=e(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,t,`cursor-pointer`),f=e(`relative hidden md:block shrink-0 overflow-visible`,r),p=e(`absolute left-1/2 top-1/2 hidden h-7 w-7 -translate-x-1/2 -translate-y-1/2 md:inline-flex`,`items-center justify-center rounded-md`,t,`cursor-pointer`,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`);export{n as a,l as c,o as d,s as f,d as i,i as l,f as n,a as o,p as r,c as s,r as t,u};
1
+ import{t as e}from"./utils-zxEjKE70.js";var t=`transition-none motion-reduce:transition-none`,n=`flex h-9 w-[18px] shrink-0 items-center justify-center`,r=`relative h-9 min-h-9 max-h-9 w-full shrink-0`;function i(t){return e(`flex h-10 min-h-10 shrink-0 items-center w-full`,t?`px-0`:`gap-2 pl-2.5 pr-2.5`)}var a={active:`bg-tertiary text-white font-normal`,idle:`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`};function o(t){return e(`flex flex-col gap-0.5 w-full shrink-0 items-stretch`,!t&&`pr-2.5`)}function s(n){let{indent:r=!1,collapsed:i=!1}=n??{};return e(`flex h-9 min-h-9 min-w-0 items-center rounded-md`,t,`text-sm leading-5 w-full`,i?`group gap-0 px-0 overflow-visible bg-transparent hover:bg-transparent`:`gap-2 px-2.5 overflow-hidden`,r&&!i&&`pl-7`)}function c(n){return e(`pointer-events-none absolute inset-0 z-0 rounded-md`,t,n?`bg-tertiary`:`bg-transparent group-hover:bg-[var(--oh-surface-raised)]`)}function l(t){return e(`relative z-[1] flex h-full w-full items-center justify-start pl-2.5 [&_svg]:shrink-0`,t?`text-white font-normal`:`text-[var(--oh-muted)] group-hover:text-white`)}function u(e){return e?`sr-only`:`min-w-0 truncate`}var d=e(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,t,`cursor-pointer`),f=e(`relative hidden md:block shrink-0 overflow-visible`,r),p=e(`absolute left-1/2 top-1/2 hidden h-7 w-7 -translate-x-1/2 -translate-y-1/2 md:inline-flex`,`items-center justify-center rounded-md`,t,`cursor-pointer`,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`);export{n as a,l as c,o as d,s as f,d as i,i as l,f as n,a as o,p as r,c as s,r as t,u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{t as a}from"./useMutation-ChpkYxI5.js";import{t as o}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js";import{t as s,z as c}from"./utils-DPQfkd-7.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{n as u}from"./modal-body-duRaxj_K.js";import{n as d,r as f}from"./base-modal-3NmIOKDm.js";import{_ as p,u as m}from"./form-control-classes-DLN3Qgub.js";import{t as h}from"./brand-button-CJcwjnfb.js";import{t as g}from"./agent-server-conversation-service.api-BheU4HX3.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:a}){let{t:s}=i(`openhands`),p;return p=a??(n?(0,v.jsx)(o,{ns:`openhands`,i18nKey:c.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):s(c.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??s(c.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:s(c.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:s(c.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=i(`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(c.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(c.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(c.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(c.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return a({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=s(`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}=i(`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?c.SIDEBAR$CLOSE_MENU:c.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-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as a}from"./useMutation-BFDQmgk9.js";import{t as o}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js";import{t as s,z as c}from"./utils-zxEjKE70.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{n as u}from"./modal-body-gIe21fDv.js";import{n as d,r as f}from"./base-modal-Fnh6Uln9.js";import{_ as p,u as m}from"./form-control-classes-7yFSQJq_.js";import{t as h}from"./brand-button-swT1RyO0.js";import{t as g}from"./agent-server-conversation-service.api-DWBe0rbX.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:a}){let{t:s}=i(`openhands`),p;return p=a??(n?(0,v.jsx)(o,{ns:`openhands`,i18nKey:c.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):s(c.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??s(c.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:s(c.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:s(c.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=i(`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(c.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(c.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(c.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(c.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return a({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=_.createContext(null);function T({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)(w.Provider,{value:o,children:e})}function E(){let e=_.useContext(w);if(!e)throw Error(`useSidebarMobileNav must be used within SidebarMobileNavProvider`);return e}var D=s(`inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)]`,p,m),O=`size-5 shrink-0`,k=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 A(){let{t:e}=i(`openhands`),{isOpen:t,toggle:n}=E();return(0,v.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-menu-toggle`,onClick:n,"aria-expanded":t,"aria-label":e(t?c.SIDEBAR$CLOSE_MENU:c.SIDEBAR$OPEN_MENU),className:D,children:(0,v.jsx)(k,{className:O,"aria-hidden":!0})})}export{T as a,S as c,y as d,O as i,x as l,k as n,E as o,D as r,C as s,A as t,b as u};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-DPQfkd-7.js";import{n as r}from"./navigation-context-CQZwH_tC.js";import{t as i}from"./navigation-link-Bxo3-4vo.js";import{a,c as o,f as s,o as c,s as l,t as u,u as d}from"./sidebar-layout-Dxg6zc2K.js";import{t as f}from"./styled-tooltip-C5C07RQC.js";e();var p=t();function m({active:e,className:t,children:r}){return(0,p.jsxs)(`span`,{className:n(u,t),children:[(0,p.jsx)(`span`,{"aria-hidden":!0,className:l(e)}),(0,p.jsx)(`span`,{className:o(e),children:r})]})}function h(e,t,n){return t===`/`||n?e===t:e===t||e.startsWith(`${t}/`)}function g({to:e,label:t,end:o=!1,indent:l=!1,testId:u,disabled:g=!1,icon:_,collapsed:v=!1,hoverContent:y,forceActive:b=!1}){let{currentPath:x}=r(),S=b||h(x,e,o),C=(0,p.jsxs)(i,{to:e,end:o,"data-testid":u,tabIndex:g?-1:0,"aria-label":v?t:void 0,"aria-disabled":g||void 0,onClick:e=>{g&&e.preventDefault()},className:n(s({indent:l,collapsed:v}),!v&&(S?c.active:c.idle),g&&`opacity-50`,g&&`pointer-events-none`),children:[_?v?(0,p.jsx)(m,{active:S,children:_}):(0,p.jsx)(`span`,{className:a,children:_}):null,(0,p.jsx)(`span`,{className:d(v),children:t})]});return v?(0,p.jsx)(f,{content:y??t,placement:`right`,tooltipClassName:y?`p-0 bg-tertiary text-white`:void 0,children:C}):C}export{m as n,g as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-zxEjKE70.js";import{n as r}from"./navigation-context-CQZwH_tC.js";import{t as i}from"./navigation-link-Bxo3-4vo.js";import{a,c as o,f as s,o as c,s as l,t as u,u as d}from"./sidebar-layout-Bhi3hVcu.js";import{t as f}from"./styled-tooltip-BUMSbgrF.js";e();var p=t();function m({active:e,className:t,children:r}){return(0,p.jsxs)(`span`,{className:n(u,t),children:[(0,p.jsx)(`span`,{"aria-hidden":!0,className:l(e)}),(0,p.jsx)(`span`,{className:o(e),children:r})]})}function h(e,t,n){return t===`/`||n?e===t:e===t||e.startsWith(`${t}/`)}function g({to:e,label:t,end:o=!1,indent:l=!1,testId:u,disabled:g=!1,icon:_,collapsed:v=!1,hoverContent:y,forceActive:b=!1}){let{currentPath:x}=r(),S=b||h(x,e,o),C=(0,p.jsxs)(i,{to:e,end:o,"data-testid":u,tabIndex:g?-1:0,"aria-label":v?t:void 0,"aria-disabled":g||void 0,onClick:e=>{g&&e.preventDefault()},className:n(s({indent:l,collapsed:v}),!v&&(S?c.active:c.idle),g&&`opacity-50`,g&&`pointer-events-none`),children:[_?v?(0,p.jsx)(m,{active:S,children:_}):(0,p.jsx)(`span`,{className:a,children:_}):null,(0,p.jsx)(`span`,{className:d(v),children:t})]});return v?(0,p.jsx)(f,{content:y??t,placement:`right`,tooltipClassName:y?`p-0 bg-tertiary text-white`:void 0,children:C}):C}export{m as n,g as t};
@@ -1 +1 @@
1
- import{E as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{d as t,f as n,l as r}from"./conversation-store-B8Eahyeg.js";var i=e(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),a=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),o=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),s=n(e=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e(e=>({isOpen:!e.isOpen}))})),c=`openhands-sidebar`,l=`openhands-sidebar-collapsed`,u=n()(t(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:c,storage:r(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(l);window.localStorage.getItem(c)===null&&(e===`true`||e===`false`)&&u.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(l)}catch{}export{i as a,a as i,s as n,o as r,u as t};
1
+ import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{d as t,f as n,l as r}from"./conversation-store-Blc5xysY.js";var i=e(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),a=e(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),o=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),s=n(e=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e(e=>({isOpen:!e.isOpen}))})),c=`openhands-sidebar`,l=`openhands-sidebar-collapsed`,u=n()(t(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:c,storage:r(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(l);window.localStorage.getItem(c)===null&&(e===`true`||e===`false`)&&u.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(l)}catch{}export{i as a,a as i,s as n,o as r,u as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{t as i,z as a}from"./utils-DPQfkd-7.js";import{i as o}from"./extension-module-card-classes-Bo43vY5V.js";var s=e(t(),1),c=n(),l=o,u=6;function d(e,t){if(e.length===0||t<=0)return 0;let n=0;for(let r=0;r<e.length;r+=1){let i=e[r],a=r>0?u:0,o=e.length-r-1>0?46:0;if(n+a+i+o>t)return Math.max(1,r);n+=a+i}return e.length}function f({pills:e,testId:t}){let{t:n}=r(`openhands`),l=s.useRef(null),u=s.useRef(null),[f,p]=s.useState(e.length),m=s.useCallback(()=>{let e=l.current,t=u.current;!e||!t||p(d(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]);if(s.useLayoutEffect(()=>{m()},[e,m]),s.useEffect(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>m());return t.observe(e),()=>t.disconnect()},[m]),e.length===0)return null;let h=Math.max(0,e.length-f);return(0,c.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,c.jsx)(`div`,{ref:u,"aria-hidden":!0,className:`pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex flex-nowrap items-center gap-1.5 opacity-0`,children:e.map(e=>(0,c.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id))}),(0,c.jsxs)(`div`,{ref:l,"data-testid":t,className:`flex w-full min-w-0 max-w-full flex-nowrap items-center gap-1.5 overflow-hidden`,children:[e.slice(0,f).map(e=>(0,c.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id)),h>0?(0,c.jsx)(`span`,{"data-testid":`${t}-overflow`,className:i(o,`font-medium text-tertiary-alt`),title:e.slice(f).map(e=>e.id).join(`, `),children:n(a.SETTINGS$SKILLS_PILLS_MORE,{count:h})}):null]})]})}export{f as n,l as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as i,z as a}from"./utils-zxEjKE70.js";import{i as o}from"./extension-module-card-classes-Bo43vY5V.js";var s=e(t(),1),c=n(),l=o,u=6;function d(e,t){if(e.length===0||t<=0)return 0;let n=0;for(let r=0;r<e.length;r+=1){let i=e[r],a=r>0?u:0,o=e.length-r-1>0?46:0;if(n+a+i+o>t)return Math.max(1,r);n+=a+i}return e.length}function f({pills:e,testId:t}){let{t:n}=r(`openhands`),l=s.useRef(null),u=s.useRef(null),[f,p]=s.useState(e.length),m=s.useCallback(()=>{let e=l.current,t=u.current;!e||!t||p(d(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]);if(s.useLayoutEffect(()=>{m()},[e,m]),s.useEffect(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>m());return t.observe(e),()=>t.disconnect()},[m]),e.length===0)return null;let h=Math.max(0,e.length-f);return(0,c.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,c.jsx)(`div`,{ref:u,"aria-hidden":!0,className:`pointer-events-none fixed top-0 -left-[10000px] z-[-1] flex flex-nowrap items-center gap-1.5 opacity-0`,children:e.map(e=>(0,c.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id))}),(0,c.jsxs)(`div`,{ref:l,"data-testid":t,className:`flex w-full min-w-0 max-w-full flex-nowrap items-center gap-1.5 overflow-hidden`,children:[e.slice(0,f).map(e=>(0,c.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id)),h>0?(0,c.jsx)(`span`,{"data-testid":`${t}-overflow`,className:i(o,`font-medium text-tertiary-alt`),title:e.slice(f).map(e=>e.id).join(`, `),children:n(a.SETTINGS$SKILLS_PILLS_MORE,{count:h})}):null]})]})}export{f as n,l as t};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-DPQfkd-7.js";import{t as n}from"./skills-B0IliMxw.js";var r=e();function i({skillName:e,className:i}){return(0,r.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:t(`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`,i),children:(0,r.jsx)(n,{})})}export{i as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-zxEjKE70.js";import{t as n}from"./skills-B0IliMxw.js";var r=e();function i({skillName:e,className:i}){return(0,r.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:t(`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`,i),children:(0,r.jsx)(n,{})})}export{i as t};
@@ -1 +1 @@
1
- import{u as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t}from"./useQuery-BCnzy4LX.js";import{$ as n,ct as r,yt as i}from"./active-backend-context-B_bg5h9O.js";import{t as a}from"./proxy-b4aqL4SX.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js";var s=100;function c(){let e=r().backend;if(e.kind!==`cloud`)throw Error(`Cloud skills call requires a cloud backend.`);return e}async function l(){let e=c(),t=[],n=null;do{let r=new URLSearchParams({limit:String(s)});n&&r.set(`page_id`,n);let i=await a({backend:e,method:`GET`,path:`/api/v1/skills/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}function u(e){return{name:e.name,type:`knowledge`,source:`public`,description:e.description,triggers:e.triggers,category:e.category,content:e.content,license:e.license??null,compatibility:e.compatibility??null}}var d=o.map(u),f=class{static async getSkills(t){if(r().backend.kind===`cloud`)return l();let a=[];try{a=(await new e(n()).getSkills({load_public:!1,load_user:!0,load_project:!0,load_org:!1,project_dir:t??i()})).skills??[]}catch{}return[...a,...d]}},p=e=>t({queryKey:[`skills`,e??null],queryFn:()=>f.getSkills(e),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),m=[`project`,`personal`,`public`],h=[`/.agents/skills/`,`/.openhands/skills/`,`/.openhands/microagents/`];function g(e){return e.replace(/\\/g,`/`)}function _(e){let t=g(e).toLowerCase();return t===`public`?!0:t.includes(`public-skills`)||t.includes(`/.openhands/cache/skills/`)}function v(e){let t=g(e);return/^\/Users\/[^/]+\/\.(agents|openhands)\//.test(t)||/^\/home\/[^/]+\/\.(agents|openhands)\//.test(t)?!0:h.some(e=>{let n=t.indexOf(e);if(n===-1)return!1;let r=t.slice(0,n);return/^\/Users\/[^/]+$/.test(r)||/^\/home\/[^/]+$/.test(r)})}function y(e,t){let n=g(e);if(!h.some(e=>n.includes(e))||v(e))return!1;if(t){let e=g(t).replace(/\/$/,``);if(n.startsWith(e))return!0}return!0}function b(e,t){let n=e.source?.trim();if(!n)return e.type===`repo`?`project`:`public`;let r=n.toLowerCase();return _(n)?`public`:r===`user`||r===`global`?`personal`:r===`project`||r===`repo`||r===`sandbox`?`project`:v(n)?`personal`:y(n,t)?`project`:`public`}function x(e,t){let n={project:[],personal:[],public:[]};for(let r of e)n[b(r,t)].push(r);for(let e of m)n[e].sort((e,t)=>e.name.localeCompare(t.name));return n}export{p as i,b as n,x as r,m as t};
1
+ import{d as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t}from"./useQuery-DRv--6bK.js";import{$ as n,ct as r,yt as i}from"./active-backend-context-IqOjobNK.js";import{t as a}from"./proxy-9Z_WZggZ.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js";var s=100;function c(){let e=r().backend;if(e.kind!==`cloud`)throw Error(`Cloud skills call requires a cloud backend.`);return e}async function l(){let e=c(),t=[],n=null;do{let r=new URLSearchParams({limit:String(s)});n&&r.set(`page_id`,n);let i=await a({backend:e,method:`GET`,path:`/api/v1/skills/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}function u(e){return{name:e.name,type:`knowledge`,source:`public`,description:e.description,triggers:e.triggers,category:e.category,content:e.content,license:e.license??null,compatibility:e.compatibility??null}}var d=o.map(u),f=class{static async getSkills(t){if(r().backend.kind===`cloud`)return l();let a=[];try{a=(await new e(n()).getSkills({load_public:!1,load_user:!0,load_project:!0,load_org:!1,project_dir:t??i()})).skills??[]}catch{}return[...a,...d]}},p=e=>t({queryKey:[`skills`,e??null],queryFn:()=>f.getSkills(e),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),m=[`project`,`personal`,`public`],h=[`/.agents/skills/`,`/.openhands/skills/`,`/.openhands/microagents/`];function g(e){return e.replace(/\\/g,`/`)}function _(e){let t=g(e).toLowerCase();return t===`public`?!0:t.includes(`public-skills`)||t.includes(`/.openhands/cache/skills/`)}function v(e){let t=g(e);return/^\/Users\/[^/]+\/\.(agents|openhands)\//.test(t)||/^\/home\/[^/]+\/\.(agents|openhands)\//.test(t)?!0:h.some(e=>{let n=t.indexOf(e);if(n===-1)return!1;let r=t.slice(0,n);return/^\/Users\/[^/]+$/.test(r)||/^\/home\/[^/]+$/.test(r)})}function y(e,t){let n=g(e);if(!h.some(e=>n.includes(e))||v(e))return!1;if(t){let e=g(t).replace(/\/$/,``);if(n.startsWith(e))return!0}return!0}function b(e,t){let n=e.source?.trim();if(!n)return e.type===`repo`?`project`:`public`;let r=n.toLowerCase();return _(n)?`public`:r===`user`||r===`global`?`personal`:r===`project`||r===`repo`||r===`sandbox`?`project`:v(n)?`personal`:y(n,t)?`project`:`public`}function x(e,t){let n={project:[],personal:[],public:[]};for(let r of e)n[b(r,t)].push(r);for(let e of m)n[e].sort((e,t)=>e.name.localeCompare(t.name));return n}export{p as i,b as n,x as r,m as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{t as o}from"./useMutation-ChpkYxI5.js";import{t as s}from"./useQuery-BCnzy4LX.js";import{At as c,I as l,Pt as u,jt as d,n as f}from"./active-backend-context-B_bg5h9O.js";import{t as p,z as m}from"./utils-DPQfkd-7.js";import{t as h}from"./search-CYaiKHRp.js";import{t as g}from"./x-RYDBg-e2.js";import{t as _}from"./loading-spinner-CN3riY7k.js";import{t as v}from"./modal-backdrop-BSzNhM4r.js";import{n as y}from"./modal-classes-CLEXO6dj.js";import{t as b}from"./brand-button-CJcwjnfb.js";import{n as x}from"./navigation-context-CQZwH_tC.js";import{t as S}from"./modal-close-button-D0aT02hs.js";import{t as C}from"./settings-input-D61Vzp9e.js";import{t as w}from"./plugins-management-service-CywqyfLK.js";import{a as T,i as E,r as D}from"./extension-module-card-classes-Bo43vY5V.js";import{t as O}from"./settings-switch-Drt-rF5s.js";import{n as k}from"./circle-plus-check-toggle-BVzv5EkZ.js";import{n as A,t as ee}from"./use-plugins-marketplace-CqkR8kLE.js";import{n as j}from"./extensions-navigation-Bnx32WAb.js";import{t as M}from"./skill-icon-badge-CN41Hy9l.js";import{n as N}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";import{n as P,t as F}from"./highlighted-source-view-CgJfD5VT.js";var I=e(t(),1),L=n();function R({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:o}){let{t:s}=a(`openhands`);return(0,L.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:p(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,T,D),children:[(0,L.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,L.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,L.jsx)(k,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:o,disableTooltipKey:m.COMMON$DISABLE}):e.isLocal?(0,L.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:p(E,`flex-shrink-0`),children:s(m.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:s(t?m.SETTINGS$PLUGINS_INSTALLING:m.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,L.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,L.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:p(E,`self-start`),children:s(m.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var z=[{value:`all`,labelKey:m.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:m.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:m.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:m.SETTINGS$PLUGINS_FILTER_LOCAL}];function B({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=a(`openhands`);return(0,L.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,L.jsxs)(`div`,{className:p(`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,L.jsx)(h,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,L.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(m.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(m.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:p(`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,L.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(m.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,L.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,L.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:z.map(e=>(0,L.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:p(`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))})]})}var V=(e,t)=>s({queryKey:[`plugin-file-content`,e,t],queryFn:()=>{if(!e||!t)throw Error(`No file selected`);return A.getPluginFileContent(e,t)},enabled:!!(e&&t),retry:!1,staleTime:1e3*60*10,refetchOnWindowFocus:!1});function H({basePath:e,files:t}){let{t:n}=a(`openhands`),[r,i]=I.useState(null),o=r&&t.includes(r)?r:null,{data:s,isLoading:c,isError:l}=V(o?e:null,o);return(0,L.jsxs)(`section`,{"data-testid":`plugin-files-section`,className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:n(m.COMMON$FILES)}),(0,L.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)]`,children:[(0,L.jsx)(`div`,{className:`max-h-48 overflow-y-auto custom-scrollbar`,children:(0,L.jsx)(P,{paths:t,selectedPath:o,onSelectFile:e=>i(t=>t===e?null:e)})}),o?(0,L.jsxs)(`div`,{"data-testid":`plugin-file-content`,className:`flex h-60 min-w-0 flex-col border-t border-[var(--oh-border)]`,children:[(0,L.jsx)(`p`,{className:`truncate px-3 py-2 text-xs text-tertiary-alt`,title:o,children:o}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:c?(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,L.jsx)(_,{size:`small`})}):l?(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(m.FILES$LOAD_ERROR)}):s?.kind===`binary`?(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(m.FILES$BINARY_FALLBACK)}):(0,L.jsx)(F,{path:o,text:s?.text??``})})]}):null]})]})}function U({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:o,onRefresh:s,onClose:c,onStartConversation:l}){let{t:u}=a(`openhands`),d=n||t;return(0,L.jsx)(v,{onClose:c,"aria-label":e.name,children:(0,L.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[640px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,L.jsx)(S,{onClose:c,testId:`plugin-detail-modal-close`}),(0,L.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,L.jsx)(`h2`,{className:p(`pr-6`,y),children:e.name}),e.source?(0,L.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,L.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,L.jsx)(`span`,{className:E,children:u(m.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,L.jsx)(`span`,{className:E,children:u(m.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,L.jsxs)(`span`,{className:E,children:[u(m.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,L.jsxs)(`span`,{className:E,children:[u(m.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,L.jsx)(O,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?m.SETTINGS$SKILLS_ENABLED:m.SETTINGS$SKILLS_DISABLED)}):null,e.skills?.length?(0,L.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:u(m.SETTINGS$PLUGINS_SKILLS_IN_BUNDLE)}),(0,L.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:e.skills.map(e=>(0,L.jsxs)(`li`,{"data-testid":`plugin-bundled-skill-${e.name}`,className:`flex items-start gap-3 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:[(0,L.jsx)(M,{skillName:e.name}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),e.description?(0,L.jsx)(`p`,{className:`mt-0.5 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null]})]},e.name))})]}):null,e.path&&e.files?.length?(0,L.jsx)(H,{basePath:e.path,files:e.files}):null]}),(0,L.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:s,children:u(m.SETTINGS$PLUGINS_REFRESH)}),(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:o,children:u(m.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?m.SETTINGS$PLUGINS_INSTALLING:m.SETTINGS$PLUGINS_INSTALL)}),e.source&&l?(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-start-conversation-${e.name}`,onClick:l,children:u(m.COMMON$START_CONVERSATION)}):null,(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:c,children:u(m.BUTTON$CLOSE)})]})]})})}function W(){let e=i(),{t}=a(`openhands`);return o({mutationFn:e=>w.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed}),e.invalidateQueries({queryKey:l.marketplace}),d(t(m.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function G({onClose:e,onInstalled:t}){let{t:n}=a(`openhands`),r=W(),[i,o]=I.useState(``),[s,c]=I.useState(``),[l,u]=I.useState(``),d=i.trim(),f=d.length>0&&!r.isPending;return(0,L.jsx)(v,{onClose:e,"aria-label":n(m.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,L.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),f&&r.mutate({source:d,ref:s.trim()||null,repo_path:l.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,L.jsx)(S,{onClose:e,testId:`add-plugin-modal-close`}),(0,L.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,L.jsx)(`h2`,{className:p(`pr-6`,y),children:n(m.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,L.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(m.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,L.jsx)(C,{testId:`add-plugin-source-input`,label:n(m.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:o,placeholder:n(m.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,L.jsx)(C,{testId:`add-plugin-ref-input`,label:n(m.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:s,onChange:c,showOptionalTag:!0}),(0,L.jsx)(C,{testId:`add-plugin-repo-path-input`,label:n(m.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:l,onChange:u,showOptionalTag:!0})]}),(0,L.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,L.jsx)(b,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(m.BUTTON$CLOSE)}),(0,L.jsx)(b,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!f,children:n(r.isPending?m.SETTINGS$PLUGINS_INSTALLING:m.SETTINGS$PLUGINS_INSTALL)})]})]})})}function K(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,path:t.path??null,skills:t.skills??null,files:t.files??null});for(let e of t??[]){let t=r.get(e.name),n=e.skills!=null||e.files!=null;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,path:n?e.install_path:t?.path??null,skills:n?e.skills??null:t?.skills??null,files:n?e.files??null:t?.files??null})}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,path:e.path??null,skills:e.skills??null,files:e.files??null});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 q(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 J(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var Y=()=>s({queryKey:l.installed,queryFn:()=>w.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),X=()=>s({queryKey:l.local,queryFn:()=>A.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1});function Z(){let e=i(),{t}=a(`openhands`);return o({mutationFn:({name:e,enabled:t})=>w.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed})},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function Q(){let e=i(),{t}=a(`openhands`);return o({mutationFn:e=>w.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed}),e.invalidateQueries({queryKey:l.marketplace}),d(t(m.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function te(){let e=i(),{t}=a(`openhands`);return o({mutationFn:e=>w.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed}),d(t(m.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function ne(e){let t=btoa(JSON.stringify(e));return`/launch?${new URLSearchParams({plugins:t}).toString()}`}var $=r(function(){let{t:e}=a(`openhands`),{backend:t}=f(),{navigate:n}=x(),r=t.kind===`local`,{data:i,isLoading:o}=ee(),{data:s,isLoading:c}=Y(),{data:l,isLoading:u}=X(),d=W(),h=Z(),g=Q(),_=te(),[v,y]=I.useState(``),[S,C]=I.useState(`all`),[w,T]=I.useState(null),[E,D]=I.useState(!1),O=I.useMemo(()=>K(i,s,l),[i,s,l]),k=I.useMemo(()=>O.filter(e=>J(e,S)&&q(e,v)),[O,S,v]),A=w?O.find(e=>e.name===w)??null:null,M=o||c||u,P=(h.isPending?h.variables?.name:void 0)??(g.isPending?g.variables:void 0)??(_.isPending?_.variables:void 0)??null,F=e=>P===e.name||d.isPending&&d.variables?.source===e.source,z=e=>{e.source&&d.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},V=(e,t)=>{h.mutate({name:e.name,enabled:t})},H=e=>{g.mutate(e.name,{onSuccess:()=>T(null)})},$=e=>{_.mutate(e.name)},re=e=>{e.source&&n(ne([{source:e.source,ref:e.ref,repo_path:e.repoPath}]))};return(0,L.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,L.jsx)(j,{}),(0,L.jsx)(`main`,{className:p(N,`h-full`),children:(0,L.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(m.SETTINGS$PLUGINS_TITLE)}),(0,L.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(m.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!r,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>D(!0),children:e(m.SETTINGS$PLUGINS_ADD_BUTTON)})]}),M&&(0,L.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!M&&O.length===0&&(0,L.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,L.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(m.SETTINGS$PLUGINS_NO_PLUGINS)})}),!M&&O.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{search:v,onSearchChange:y,statusFilter:S,onStatusFilterChange:C}),k.length===0?(0,L.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,L.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(m.SETTINGS$PLUGINS_NO_MATCH)})}):(0,L.jsx)(`section`,{className:p(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,L.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:k.map(e=>(0,L.jsx)(R,{plugin:e,isBusy:F(e),isDisabled:!r,onOpen:()=>T(e.name),onInstall:()=>z(e),onToggle:t=>V(e,t)},e.name))})})]}),A&&(0,L.jsx)(U,{plugin:A,isBusy:F(A),isDisabled:!r,onToggle:e=>V(A,e),onInstall:()=>z(A),onUninstall:()=>H(A),onRefresh:()=>$(A),onStartConversation:()=>re(A),onClose:()=>T(null)}),E&&(0,L.jsx)(G,{onClose:()=>D(!1)})]})})]})});export{$ as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as o}from"./useMutation-BFDQmgk9.js";import{t as s}from"./useQuery-DRv--6bK.js";import{At as c,I as l,Pt as u,jt as d,n as f}from"./active-backend-context-IqOjobNK.js";import{t as p,z as m}from"./utils-zxEjKE70.js";import{t as h}from"./search-CycosyjN.js";import{t as g}from"./x-BWKA2Ver.js";import{t as _}from"./loading-spinner-xhnrGP4Y.js";import{t as v}from"./modal-backdrop-BSzNhM4r.js";import{n as y}from"./modal-classes-D66dlgZ7.js";import{t as b}from"./brand-button-swT1RyO0.js";import{n as x}from"./navigation-context-CQZwH_tC.js";import{t as S}from"./modal-close-button-B6iOGYpI.js";import{t as C}from"./settings-input-Cz62hWVW.js";import{t as w}from"./plugins-management-service-wtmY4QQw.js";import{a as T,i as E,r as D}from"./extension-module-card-classes-Bo43vY5V.js";import{t as O}from"./settings-switch-BRsSI8Vs.js";import{n as k}from"./circle-plus-check-toggle-Cuzx55bo.js";import{n as A,t as ee}from"./use-plugins-marketplace-CEiak69h.js";import{n as j}from"./extensions-navigation-lraj88Wk.js";import{t as M}from"./skill-icon-badge-QgfKv31M.js";import{n as N}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";import{n as P,t as F}from"./highlighted-source-view-C_sfncLZ.js";var I=e(t(),1),L=n();function R({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:o}){let{t:s}=a(`openhands`);return(0,L.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:p(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,T,D),children:[(0,L.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,L.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,L.jsx)(k,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:o,disableTooltipKey:m.COMMON$DISABLE}):e.isLocal?(0,L.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:p(E,`flex-shrink-0`),children:s(m.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:s(t?m.SETTINGS$PLUGINS_INSTALLING:m.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,L.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,L.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:p(E,`self-start`),children:s(m.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var z=[{value:`all`,labelKey:m.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:m.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:m.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:m.SETTINGS$PLUGINS_FILTER_LOCAL}];function B({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=a(`openhands`);return(0,L.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,L.jsxs)(`div`,{className:p(`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,L.jsx)(h,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,L.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(m.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(m.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:p(`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,L.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(m.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,L.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,L.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:z.map(e=>(0,L.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:p(`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))})]})}var V=(e,t)=>s({queryKey:[`plugin-file-content`,e,t],queryFn:()=>{if(!e||!t)throw Error(`No file selected`);return A.getPluginFileContent(e,t)},enabled:!!(e&&t),retry:!1,staleTime:1e3*60*10,refetchOnWindowFocus:!1});function H({basePath:e,files:t}){let{t:n}=a(`openhands`),[r,i]=I.useState(null),o=r&&t.includes(r)?r:null,{data:s,isLoading:c,isError:l}=V(o?e:null,o);return(0,L.jsxs)(`section`,{"data-testid":`plugin-files-section`,className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:n(m.COMMON$FILES)}),(0,L.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)]`,children:[(0,L.jsx)(`div`,{className:`max-h-48 overflow-y-auto custom-scrollbar`,children:(0,L.jsx)(P,{paths:t,selectedPath:o,onSelectFile:e=>i(t=>t===e?null:e)})}),o?(0,L.jsxs)(`div`,{"data-testid":`plugin-file-content`,className:`flex h-60 min-w-0 flex-col border-t border-[var(--oh-border)]`,children:[(0,L.jsx)(`p`,{className:`truncate px-3 py-2 text-xs text-tertiary-alt`,title:o,children:o}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:c?(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,L.jsx)(_,{size:`small`})}):l?(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(m.FILES$LOAD_ERROR)}):s?.kind===`binary`?(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(m.FILES$BINARY_FALLBACK)}):(0,L.jsx)(F,{path:o,text:s?.text??``})})]}):null]})]})}function U({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:o,onRefresh:s,onClose:c,onStartConversation:l}){let{t:u}=a(`openhands`),d=n||t;return(0,L.jsx)(v,{onClose:c,"aria-label":e.name,children:(0,L.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[640px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,L.jsx)(S,{onClose:c,testId:`plugin-detail-modal-close`}),(0,L.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,L.jsx)(`h2`,{className:p(`pr-6`,y),children:e.name}),e.source?(0,L.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,L.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,L.jsx)(`span`,{className:E,children:u(m.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,L.jsx)(`span`,{className:E,children:u(m.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,L.jsxs)(`span`,{className:E,children:[u(m.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,L.jsxs)(`span`,{className:E,children:[u(m.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,L.jsx)(O,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?m.SETTINGS$SKILLS_ENABLED:m.SETTINGS$SKILLS_DISABLED)}):null,e.skills?.length?(0,L.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:u(m.SETTINGS$PLUGINS_SKILLS_IN_BUNDLE)}),(0,L.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:e.skills.map(e=>(0,L.jsxs)(`li`,{"data-testid":`plugin-bundled-skill-${e.name}`,className:`flex items-start gap-3 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:[(0,L.jsx)(M,{skillName:e.name}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`p`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),e.description?(0,L.jsx)(`p`,{className:`mt-0.5 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null]})]},e.name))})]}):null,e.path&&e.files?.length?(0,L.jsx)(H,{basePath:e.path,files:e.files}):null]}),(0,L.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:s,children:u(m.SETTINGS$PLUGINS_REFRESH)}),(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:o,children:u(m.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?m.SETTINGS$PLUGINS_INSTALLING:m.SETTINGS$PLUGINS_INSTALL)}),e.source&&l?(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-start-conversation-${e.name}`,onClick:l,children:u(m.COMMON$START_CONVERSATION)}):null,(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:c,children:u(m.BUTTON$CLOSE)})]})]})})}function W(){let e=i(),{t}=a(`openhands`);return o({mutationFn:e=>w.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed}),e.invalidateQueries({queryKey:l.marketplace}),d(t(m.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function G({onClose:e,onInstalled:t}){let{t:n}=a(`openhands`),r=W(),[i,o]=I.useState(``),[s,c]=I.useState(``),[l,u]=I.useState(``),d=i.trim(),f=d.length>0&&!r.isPending;return(0,L.jsx)(v,{onClose:e,"aria-label":n(m.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,L.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),f&&r.mutate({source:d,ref:s.trim()||null,repo_path:l.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,L.jsx)(S,{onClose:e,testId:`add-plugin-modal-close`}),(0,L.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,L.jsx)(`h2`,{className:p(`pr-6`,y),children:n(m.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,L.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(m.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,L.jsx)(C,{testId:`add-plugin-source-input`,label:n(m.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:o,placeholder:n(m.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,L.jsx)(C,{testId:`add-plugin-ref-input`,label:n(m.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:s,onChange:c,showOptionalTag:!0}),(0,L.jsx)(C,{testId:`add-plugin-repo-path-input`,label:n(m.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:l,onChange:u,showOptionalTag:!0})]}),(0,L.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,L.jsx)(b,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(m.BUTTON$CLOSE)}),(0,L.jsx)(b,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!f,children:n(r.isPending?m.SETTINGS$PLUGINS_INSTALLING:m.SETTINGS$PLUGINS_INSTALL)})]})]})})}function K(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,path:t.path??null,skills:t.skills??null,files:t.files??null});for(let e of t??[]){let t=r.get(e.name),n=e.skills!=null||e.files!=null;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,path:n?e.install_path:t?.path??null,skills:n?e.skills??null:t?.skills??null,files:n?e.files??null:t?.files??null})}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,path:e.path??null,skills:e.skills??null,files:e.files??null});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 q(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 J(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var Y=()=>s({queryKey:l.installed,queryFn:()=>w.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),X=()=>s({queryKey:l.local,queryFn:()=>A.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1});function Z(){let e=i(),{t}=a(`openhands`);return o({mutationFn:({name:e,enabled:t})=>w.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed})},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function Q(){let e=i(),{t}=a(`openhands`);return o({mutationFn:e=>w.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed}),e.invalidateQueries({queryKey:l.marketplace}),d(t(m.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function te(){let e=i(),{t}=a(`openhands`);return o({mutationFn:e=>w.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:l.installed}),d(t(m.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{c(u(e)||t(m.ERROR$GENERIC))}})}function ne(e){let t=btoa(JSON.stringify(e));return`/launch?${new URLSearchParams({plugins:t}).toString()}`}var $=r(function(){let{t:e}=a(`openhands`),{backend:t}=f(),{navigate:n}=x(),r=t.kind===`local`,{data:i,isLoading:o}=ee(),{data:s,isLoading:c}=Y(),{data:l,isLoading:u}=X(),d=W(),h=Z(),g=Q(),_=te(),[v,y]=I.useState(``),[S,C]=I.useState(`all`),[w,T]=I.useState(null),[E,D]=I.useState(!1),O=I.useMemo(()=>K(i,s,l),[i,s,l]),k=I.useMemo(()=>O.filter(e=>J(e,S)&&q(e,v)),[O,S,v]),A=w?O.find(e=>e.name===w)??null:null,M=o||c||u,P=(h.isPending?h.variables?.name:void 0)??(g.isPending?g.variables:void 0)??(_.isPending?_.variables:void 0)??null,F=e=>P===e.name||d.isPending&&d.variables?.source===e.source,z=e=>{e.source&&d.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},V=(e,t)=>{h.mutate({name:e.name,enabled:t})},H=e=>{g.mutate(e.name,{onSuccess:()=>T(null)})},$=e=>{_.mutate(e.name)},re=e=>{e.source&&n(ne([{source:e.source,ref:e.ref,repo_path:e.repoPath}]))};return(0,L.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,L.jsx)(j,{}),(0,L.jsx)(`main`,{className:p(N,`h-full`),children:(0,L.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(m.SETTINGS$PLUGINS_TITLE)}),(0,L.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(m.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,L.jsx)(b,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!r,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>D(!0),children:e(m.SETTINGS$PLUGINS_ADD_BUTTON)})]}),M&&(0,L.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!M&&O.length===0&&(0,L.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,L.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(m.SETTINGS$PLUGINS_NO_PLUGINS)})}),!M&&O.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B,{search:v,onSearchChange:y,statusFilter:S,onStatusFilterChange:C}),k.length===0?(0,L.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,L.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(m.SETTINGS$PLUGINS_NO_MATCH)})}):(0,L.jsx)(`section`,{className:p(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,L.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:k.map(e=>(0,L.jsx)(R,{plugin:e,isBusy:F(e),isDisabled:!r,onOpen:()=>T(e.name),onInstall:()=>z(e),onToggle:t=>V(e,t)},e.name))})})]}),A&&(0,L.jsx)(U,{plugin:A,isBusy:F(A),isDisabled:!r,onToggle:e=>V(A,e),onInstall:()=>z(A),onUninstall:()=>H(A),onRefresh:()=>$(A),onStartConversation:()=>re(A),onClose:()=>T(null)}),E&&(0,L.jsx)(G,{onClose:()=>D(!1)})]})})]})});export{$ as default};
@@ -1,2 +1,2 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{E as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as s}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js";import{At as c,Pt as l}from"./active-backend-context-B_bg5h9O.js";import{t as u,z as d}from"./utils-DPQfkd-7.js";import{t as f}from"./bot-DuN83i3p.js";import{t as p}from"./check-DLOKoFU9.js";import{a as m,i as h,n as g,r as _,t as v}from"./wrench-B1_H-tL1.js";import{t as y}from"./search-CYaiKHRp.js";import{t as b}from"./shield-check-D2cpEpv3.js";import{t as x}from"./x-RYDBg-e2.js";import{n as S}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js";import{n as ee}from"./use-settings-BmLzQjnC.js";import{t as te}from"./use-save-settings-DIEurJ3D.js";import{t as C}from"./modal-backdrop-BSzNhM4r.js";import{n as w,t as T}from"./modal-body-duRaxj_K.js";import{n as E}from"./modal-classes-CLEXO6dj.js";import{t as D}from"./brand-button-CJcwjnfb.js";import{t as O}from"./modal-close-button-D0aT02hs.js";import{t as k}from"./checkmark-XZyokq_Y.js";import{t as A}from"./copy-Drmhc2jD.js";import{a as j,n as ne,o as re,r as M,t as ie}from"./extension-module-card-classes-Bo43vY5V.js";import{t as N}from"./settings-switch-Drt-rF5s.js";import{n as P,t as F}from"./skill-card-pill-row-B_BYBONu.js";import{n as I}from"./circle-plus-check-toggle-BVzv5EkZ.js";import{i as ae,n as L,t as oe}from"./skill-scope-Dt1V5X2p.js";import{n as se}from"./extensions-navigation-Bnx32WAb.js";import{t as ce}from"./skill-icon-badge-CN41Hy9l.js";import{n as le,t as ue}from"./use-launch-skill-in-chat-BcKNjxxd.js";import{n as de}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var fe=o(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),pe=o(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),me=o(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),R=e(t(),1),he=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,z=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`,B=n(),ge=[d.SETTINGS$SKILLS_ADD_MODAL_STEP_1,d.SETTINGS$SKILLS_ADD_MODAL_STEP_2,d.SETTINGS$SKILLS_ADD_MODAL_STEP_3,d.SETTINGS$SKILLS_ADD_MODAL_STEP_4,d.SETTINGS$SKILLS_ADD_MODAL_STEP_5],V={cmd:(0,B.jsx)(H,{}),path:(0,B.jsx)(H,{}),env:(0,B.jsx)(H,{})};function H({children:e}){return(0,B.jsx)(`code`,{className:u(`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 _e(){let{t:e}=a(`openhands`),[t,n]=R.useState(!1);return R.useEffect(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(`pre`,{"data-testid":`add-skill-modal-example`,className:u(`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:z}),(0,B.jsx)(`button`,{type:`button`,"data-testid":`add-skill-modal-example-copy`,"aria-label":e(t?d.BUTTON$COPIED:d.BUTTON$COPY),disabled:t,onClick:async()=>{await navigator.clipboard.writeText(z),n(!0)},className:u(`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,B.jsx)(k,{width:14,height:14}):(0,B.jsx)(A,{width:14,height:14})})]})}function U({i18nKey:e}){return(0,B.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:(0,B.jsx)(s,{ns:`openhands`,i18nKey:e,components:V})})}function ve({onClose:e}){let{t}=a(`openhands`);return(0,B.jsx)(C,{onClose:e,"aria-label":t(d.SETTINGS$SKILLS_ADD_MODAL_TITLE),children:(0,B.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,B.jsx)(O,{onClose:e,testId:`add-skill-modal-close`}),(0,B.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,B.jsx)(`h2`,{className:u(`pr-6`,E),children:t(d.SETTINGS$SKILLS_ADD_MODAL_TITLE)}),(0,B.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_INTRO)})]}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,B.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}),(0,B.jsx)(U,{i18nKey:d.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}),(0,B.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}),(0,B.jsx)(_e,{}),(0,B.jsx)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light`,children:ge.map(e=>(0,B.jsx)(`li`,{children:e===d.SETTINGS$SKILLS_ADD_MODAL_STEP_3?(0,B.jsx)(s,{ns:`openhands`,i18nKey:e,components:V}):t(e)},e))})]}),(0,B.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}),(0,B.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)})]}),(0,B.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}),(0,B.jsx)(U,{i18nKey:d.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY})]}),(0,B.jsx)(U,{i18nKey:d.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}),(0,B.jsx)(`a`,{href:he,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(d.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)})]}),(0,B.jsx)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:(0,B.jsx)(D,{type:`button`,variant:`secondary`,onClick:e,testId:`add-skill-modal-dismiss`,children:t(d.BUTTON$CLOSE)})})]})})}var W=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function ye(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 be(e){let t=e.match(W);return t?e.slice(t[0].length).trim():e.trim()}function xe(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 G(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(W);if(r){let e=ye(r[1]);if(e)return e}return xe(be(n))}var Se=`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`,Ce={agentskills:{labelKey:d.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:d.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:d.SETTINGS$SKILLS_TYPE_REPO}};function we({type:e}){let{t}=a(`openhands`),n=Ce[e];return(0,B.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:Se,children:t(n.labelKey)})}var K=[`automations`,`environment`,`code-hosting`,`agent-authoring`,`code-quality`,`integrations`,`writing`,`design`,`other`],q={automations:d.SETTINGS$SKILLS_CATEGORY_AUTOMATIONS,environment:d.SETTINGS$SKILLS_CATEGORY_ENVIRONMENT,"code-hosting":d.SETTINGS$SKILLS_CATEGORY_CODE_HOSTING,"agent-authoring":d.SETTINGS$SKILLS_CATEGORY_AGENT_AUTHORING,"code-quality":d.SETTINGS$SKILLS_CATEGORY_CODE_QUALITY,integrations:d.SETTINGS$SKILLS_CATEGORY_INTEGRATIONS,writing:d.SETTINGS$SKILLS_CATEGORY_WRITING,design:d.SETTINGS$SKILLS_CATEGORY_DESIGN,other:d.SETTINGS$SKILLS_CATEGORY_OTHER},Te={automations:g,environment:v,"code-hosting":m,"agent-authoring":f,"code-quality":b,integrations:_,writing:me,design:pe,other:fe},Ee=`other`,De=new Set(S);function Oe(e){let t=e.category;return t&&De.has(t)?t:Ee}function J(e,t,n){if(e)return`${e}-${t}-${n}`}function ke(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=Oe(e),o=[{id:`type-${e.type}`,node:(0,B.jsx)(we,{type:e.type})}];if(a!==`other`&&o.push({id:`category-${a}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`category`)??`skill-category-${e.name}`,className:F,children:t(q[a])})}),e.version&&o.push({id:`version-${e.version}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`version`)??`skill-version-${e.name}`,className:F,children:t(d.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&o.push({id:`license-${e.license}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`license`),className:F,children:e.license})}),r===`detail`&&e.compatibility&&o.push({id:`compatibility-${e.compatibility}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`compatibility`),className:F,children:e.compatibility})}),e.disable_model_invocation&&o.push({id:`disable-model-invocation`,node:(0,B.jsxs)(`span`,{"data-testid":J(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,B.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(d.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)o.push({id:`allowed-tool-${t}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`tool-${t}`),className:u(F,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))o.push({id:`metadata-${t}`,node:(0,B.jsxs)(`span`,{"data-testid":J(i,e.name,`metadata-${t}`),className:F,children:[(0,B.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])o.push({id:`trigger-${t}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`trigger-${t}`),className:F,children:t})});return o}function Ae(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 je({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[o,s]=R.useState(!1),c=G(e),l=R.useMemo(()=>ke(e,i),[e,i]),f=Ae(e.source);return R.useEffect(()=>{if(!o)return;let e=setTimeout(()=>s(!1),2e3);return()=>clearTimeout(e)},[o]),(0,B.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:u(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,j,M),children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(ce,{skillName:e.name}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,B.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,B.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,B.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,B.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(o?d.BUTTON$COPIED:d.SETTINGS$SKILLS_COPY_PATH),disabled:o,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),s(!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:o?(0,B.jsx)(k,{width:12,height:12}):(0,B.jsx)(A,{width:12,height:12})}):null]}):null]}),(0,B.jsx)(I,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:d.COMMON$DISABLE})]}),c?(0,B.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,B.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:c})}):null,l.length>0?(0,B.jsx)(P,{pills:l,testId:`skill-triggers-${e.name}`}):null]})]})})}function Me(e){return e.name===`add-skill`?z:`/${e.name} `}function Ne({testId:e,label:t,value:n}){return(0,B.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,B.jsx)(`span`,{className:`text-sm`,children:t}),(0,B.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-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{D as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as s}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js";import{At as c,Pt as l}from"./active-backend-context-IqOjobNK.js";import{t as u,z as d}from"./utils-zxEjKE70.js";import{t as f}from"./bot-BQZx8e2i.js";import{t as p}from"./check-WAFXrrs_.js";import{a as m,i as h,n as g,r as _,t as v}from"./wrench-DIka3hCq.js";import{t as y}from"./search-CycosyjN.js";import{t as b}from"./shield-check-T3JsDJiM.js";import{t as x}from"./x-BWKA2Ver.js";import{n as S}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js";import{n as ee}from"./use-settings-wCwPaSIv.js";import{t as te}from"./use-save-settings-DNmnbG6f.js";import{t as C}from"./modal-backdrop-BSzNhM4r.js";import{n as w,t as T}from"./modal-body-gIe21fDv.js";import{n as E}from"./modal-classes-D66dlgZ7.js";import{t as D}from"./brand-button-swT1RyO0.js";import{t as O}from"./modal-close-button-B6iOGYpI.js";import{t as k}from"./checkmark-XZyokq_Y.js";import{t as A}from"./copy-Drmhc2jD.js";import{a as j,n as ne,o as re,r as M,t as ie}from"./extension-module-card-classes-Bo43vY5V.js";import{t as N}from"./settings-switch-BRsSI8Vs.js";import{n as P,t as F}from"./skill-card-pill-row-BXz8L8Rn.js";import{n as I}from"./circle-plus-check-toggle-Cuzx55bo.js";import{i as ae,n as L,t as oe}from"./skill-scope-Dc3JPW-8.js";import{n as se}from"./extensions-navigation-lraj88Wk.js";import{t as ce}from"./skill-icon-badge-QgfKv31M.js";import{n as le,t as ue}from"./use-launch-skill-in-chat-COnDpxCQ.js";import{n as de}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var fe=o(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),pe=o(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),me=o(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),R=e(t(),1),he=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,z=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`,B=n(),ge=[d.SETTINGS$SKILLS_ADD_MODAL_STEP_1,d.SETTINGS$SKILLS_ADD_MODAL_STEP_2,d.SETTINGS$SKILLS_ADD_MODAL_STEP_3,d.SETTINGS$SKILLS_ADD_MODAL_STEP_4,d.SETTINGS$SKILLS_ADD_MODAL_STEP_5],V={cmd:(0,B.jsx)(H,{}),path:(0,B.jsx)(H,{}),env:(0,B.jsx)(H,{})};function H({children:e}){return(0,B.jsx)(`code`,{className:u(`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 _e(){let{t:e}=a(`openhands`),[t,n]=R.useState(!1);return R.useEffect(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(`pre`,{"data-testid":`add-skill-modal-example`,className:u(`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:z}),(0,B.jsx)(`button`,{type:`button`,"data-testid":`add-skill-modal-example-copy`,"aria-label":e(t?d.BUTTON$COPIED:d.BUTTON$COPY),disabled:t,onClick:async()=>{await navigator.clipboard.writeText(z),n(!0)},className:u(`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,B.jsx)(k,{width:14,height:14}):(0,B.jsx)(A,{width:14,height:14})})]})}function U({i18nKey:e}){return(0,B.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:(0,B.jsx)(s,{ns:`openhands`,i18nKey:e,components:V})})}function ve({onClose:e}){let{t}=a(`openhands`);return(0,B.jsx)(C,{onClose:e,"aria-label":t(d.SETTINGS$SKILLS_ADD_MODAL_TITLE),children:(0,B.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,B.jsx)(O,{onClose:e,testId:`add-skill-modal-close`}),(0,B.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,B.jsx)(`h2`,{className:u(`pr-6`,E),children:t(d.SETTINGS$SKILLS_ADD_MODAL_TITLE)}),(0,B.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_INTRO)})]}),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,B.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}),(0,B.jsx)(U,{i18nKey:d.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}),(0,B.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}),(0,B.jsx)(_e,{}),(0,B.jsx)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light`,children:ge.map(e=>(0,B.jsx)(`li`,{children:e===d.SETTINGS$SKILLS_ADD_MODAL_STEP_3?(0,B.jsx)(s,{ns:`openhands`,i18nKey:e,components:V}):t(e)},e))})]}),(0,B.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}),(0,B.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)})]}),(0,B.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(d.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}),(0,B.jsx)(U,{i18nKey:d.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY})]}),(0,B.jsx)(U,{i18nKey:d.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}),(0,B.jsx)(`a`,{href:he,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(d.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)})]}),(0,B.jsx)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:(0,B.jsx)(D,{type:`button`,variant:`secondary`,onClick:e,testId:`add-skill-modal-dismiss`,children:t(d.BUTTON$CLOSE)})})]})})}var W=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function ye(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 be(e){let t=e.match(W);return t?e.slice(t[0].length).trim():e.trim()}function xe(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 G(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(W);if(r){let e=ye(r[1]);if(e)return e}return xe(be(n))}var Se=`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`,Ce={agentskills:{labelKey:d.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:d.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:d.SETTINGS$SKILLS_TYPE_REPO}};function we({type:e}){let{t}=a(`openhands`),n=Ce[e];return(0,B.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:Se,children:t(n.labelKey)})}var K=[`automations`,`environment`,`code-hosting`,`agent-authoring`,`code-quality`,`integrations`,`writing`,`design`,`other`],q={automations:d.SETTINGS$SKILLS_CATEGORY_AUTOMATIONS,environment:d.SETTINGS$SKILLS_CATEGORY_ENVIRONMENT,"code-hosting":d.SETTINGS$SKILLS_CATEGORY_CODE_HOSTING,"agent-authoring":d.SETTINGS$SKILLS_CATEGORY_AGENT_AUTHORING,"code-quality":d.SETTINGS$SKILLS_CATEGORY_CODE_QUALITY,integrations:d.SETTINGS$SKILLS_CATEGORY_INTEGRATIONS,writing:d.SETTINGS$SKILLS_CATEGORY_WRITING,design:d.SETTINGS$SKILLS_CATEGORY_DESIGN,other:d.SETTINGS$SKILLS_CATEGORY_OTHER},Te={automations:g,environment:v,"code-hosting":m,"agent-authoring":f,"code-quality":b,integrations:_,writing:me,design:pe,other:fe},Ee=`other`,De=new Set(S);function Oe(e){let t=e.category;return t&&De.has(t)?t:Ee}function J(e,t,n){if(e)return`${e}-${t}-${n}`}function ke(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=Oe(e),o=[{id:`type-${e.type}`,node:(0,B.jsx)(we,{type:e.type})}];if(a!==`other`&&o.push({id:`category-${a}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`category`)??`skill-category-${e.name}`,className:F,children:t(q[a])})}),e.version&&o.push({id:`version-${e.version}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`version`)??`skill-version-${e.name}`,className:F,children:t(d.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&o.push({id:`license-${e.license}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`license`),className:F,children:e.license})}),r===`detail`&&e.compatibility&&o.push({id:`compatibility-${e.compatibility}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`compatibility`),className:F,children:e.compatibility})}),e.disable_model_invocation&&o.push({id:`disable-model-invocation`,node:(0,B.jsxs)(`span`,{"data-testid":J(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,B.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(d.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)o.push({id:`allowed-tool-${t}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`tool-${t}`),className:u(F,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))o.push({id:`metadata-${t}`,node:(0,B.jsxs)(`span`,{"data-testid":J(i,e.name,`metadata-${t}`),className:F,children:[(0,B.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])o.push({id:`trigger-${t}`,node:(0,B.jsx)(`span`,{"data-testid":J(i,e.name,`trigger-${t}`),className:F,children:t})});return o}function Ae(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 je({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[o,s]=R.useState(!1),c=G(e),l=R.useMemo(()=>ke(e,i),[e,i]),f=Ae(e.source);return R.useEffect(()=>{if(!o)return;let e=setTimeout(()=>s(!1),2e3);return()=>clearTimeout(e)},[o]),(0,B.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:u(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,j,M),children:(0,B.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,B.jsx)(ce,{skillName:e.name}),(0,B.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,B.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,B.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,B.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,B.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(o?d.BUTTON$COPIED:d.SETTINGS$SKILLS_COPY_PATH),disabled:o,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),s(!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:o?(0,B.jsx)(k,{width:12,height:12}):(0,B.jsx)(A,{width:12,height:12})}):null]}):null]}),(0,B.jsx)(I,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:d.COMMON$DISABLE})]}),c?(0,B.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,B.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:c})}):null,l.length>0?(0,B.jsx)(P,{pills:l,testId:`skill-triggers-${e.name}`}):null]})]})})}function Me(e){return e.name===`add-skill`?z:`/${e.name} `}function Ne({testId:e,label:t,value:n}){return(0,B.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,B.jsx)(`span`,{className:`text-sm`,children:t}),(0,B.jsx)(`textarea`,{"data-testid":e,readOnly:!0,value:n,rows:Math.min(12,Math.max(4,n.split(`
2
2
  `).length)),className:u(`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 Pe({skill:e,enabled:t,onToggle:n,onClose:r}){let{t:i}=a(`openhands`),o=ue(),[s,c]=R.useState(!1),l=R.useMemo(()=>Me(e),[e]),u=G(e),f=R.useMemo(()=>ke(e,i,{variant:`detail`,testIdPrefix:`skill-modal-pill`}),[e,i]),p=Ae(e.source);return R.useEffect(()=>{if(!s)return;let e=setTimeout(()=>c(!1),2e3);return()=>clearTimeout(e)},[s]),(0,B.jsx)(C,{onClose:r,"aria-label":e.name,children:(0,B.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,B.jsx)(O,{onClose:r,testId:`skill-detail-modal-close`}),(0,B.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,B.jsx)(ce,{skillName:e.name}),(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`h2`,{"data-testid":`skill-modal-name-${e.name}`,className:E,children:e.name}),e.source?(0,B.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,B.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}),p?(0,B.jsx)(`button`,{type:`button`,"data-testid":`skill-modal-copy-source-${e.name}`,"aria-label":i(s?d.BUTTON$COPIED:d.SETTINGS$SKILLS_COPY_PATH),disabled:s,onClick:async()=>{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,B.jsx)(k,{width:12,height:12}):(0,B.jsx)(A,{width:12,height:12})}):null]}):null]})]}),(0,B.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,B.jsx)(N,{testId:`skill-modal-toggle-${e.name}`,isToggled:t,onToggle:n,togglePosition:`right`,children:i(t?d.SETTINGS$SKILLS_ENABLED:d.SETTINGS$SKILLS_DISABLED)})}),u?(0,B.jsx)(`p`,{"data-testid":`skill-modal-description-${e.name}`,className:`text-xs text-tertiary-light`,children:u}):null,f.length>0?(0,B.jsx)(P,{pills:f,testId:`skill-modal-pills-${e.name}`}):null,e.content?(0,B.jsx)(Ne,{testId:`skill-modal-field-content-${e.name}`,label:i(d.SETTINGS$SKILLS_CONTENT),value:e.content}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,B.jsx)(D,{type:`button`,variant:`secondary`,onClick:r,testId:`skill-detail-close`,children:i(d.BUTTON$CLOSE)}),(0,B.jsx)(D,{type:`button`,variant:`primary`,isDisabled:!t,onClick:()=>o(l,r),testId:`skill-detail-use-skill-${e.name}`,startContent:(0,B.jsx)(le,{className:`size-4`,"aria-hidden":!0}),children:i(d.SETTINGS$SKILLS_USE_SKILL_BUTTON)})]})]})})}function Fe({labelKey:e,count:t,checked:n,disabled:r,icon:i,testId:o,onToggle:s}){let{t:c}=a(`openhands`),l=c(e);return(0,B.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":n,"data-testid":o,disabled:r,onClick:s,className:u(`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm`,r?`cursor-default text-tertiary-alt/40`:`cursor-pointer hover:bg-[var(--oh-surface-raised)] hover:text-white`,n?`text-white`:`text-tertiary-light`),children:[(0,B.jsx)(`span`,{"aria-hidden":!0,className:u(`flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border`,n?`border-white bg-white text-black`:`border-[var(--oh-border)]`),children:n?(0,B.jsx)(p,{className:`size-2.5`,strokeWidth:3}):null}),i?(0,B.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,(0,B.jsx)(`span`,{title:l,className:`min-w-0 flex-1 truncate`,children:l}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-tertiary-alt`,children:t})]})}function Ie(e,t){if(e===`category`)return Te[t]}function Le({groups:e,onToggle:t,className:n}){let{t:r}=a(`openhands`);return e.length===0?null:(0,B.jsx)(`div`,{"data-testid":`skill-facet-rail`,className:u(`flex min-w-0 flex-col gap-5`,n),children:e.map(e=>{let n=`skill-facet-group-${e.id}-title`;return(0,B.jsxs)(`div`,{"data-testid":`skill-facet-group-${e.id}`,role:`group`,"aria-labelledby":n,className:`flex flex-col gap-1.5`,children:[(0,B.jsx)(`span`,{id:n,className:`px-1 text-[11px] font-semibold uppercase tracking-wider text-tertiary-alt`,children:r(e.labelKey)}),e.rows.map(n=>(0,B.jsx)(Fe,{testId:`skill-facet-${e.id}-${n.value}`,labelKey:n.labelKey,count:n.count,checked:n.checked,disabled:n.disabled,icon:Ie(e.id,n.value),onToggle:()=>t(e.id,n.value)},n.value))]},e.id)})})}function Re({groups:e,activeCount:t,onToggle:n,onClearAll:r,onClose:i}){let{t:o}=a(`openhands`);return(0,B.jsx)(C,{onClose:i,"aria-label":o(d.SETTINGS$SKILLS_FILTERS_MODAL_TITLE),children:(0,B.jsxs)(w,{testID:`skill-filters-modal`,className:u(`items-stretch`,T),children:[(0,B.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:o(d.SETTINGS$SKILLS_FILTERS_MODAL_TITLE)}),(0,B.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto custom-scrollbar-always`,children:(0,B.jsx)(Le,{groups:e,onToggle:n})}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[t>0?(0,B.jsx)(D,{type:`button`,variant:`secondary`,testId:`skill-filters-modal-clear`,onClick:r,children:o(d.SETTINGS$SKILLS_CLEAR_FILTERS)}):null,(0,B.jsx)(D,{type:`button`,variant:`primary`,testId:`skill-filters-modal-done`,onClick:i,children:o(d.BUTTON$CLOSE)})]})]})})}var ze=`source`,Be=`category`,Ve=`type`,He=`state`,Ue=[`enabled`,`disabled`],We=[`agentskills`,`knowledge`,`repo`],Ge={query:``,sources:new Set,categories:new Set,types:new Set,states:new Set};function Y(e,t){return e.map(e=>({value:e,labelKey:t[e]}))}function X(e,t){return new Set(e.filter(e=>t.has(e)))}var Ke={project:d.SETTINGS$SKILLS_SOURCE_PROJECT,personal:d.SETTINGS$SKILLS_SOURCE_PERSONAL,public:d.SETTINGS$SKILLS_SOURCE_PUBLIC},qe={agentskills:d.SETTINGS$SKILLS_TYPE_AGENTSKILLS,knowledge:d.SETTINGS$SKILLS_TYPE_KNOWLEDGE,repo:d.SETTINGS$SKILLS_TYPE_REPO},Je={enabled:d.SETTINGS$SKILLS_ENABLED,disabled:d.SETTINGS$SKILLS_DISABLED},Z=[{id:`state`,labelKey:d.SETTINGS$SKILLS_FACET_STATE,param:He,values:Y(Ue,Je),valueOf:(e,t)=>t.has(e.name)?`disabled`:`enabled`,selected:e=>e.states,withSelected:(e,t)=>({...e,states:X(Ue,t)})},{id:`source`,labelKey:d.SETTINGS$SKILLS_FACET_SOURCE,param:ze,values:Y(oe,Ke),valueOf:e=>L(e),selected:e=>e.sources,withSelected:(e,t)=>({...e,sources:X(oe,t)})},{id:`category`,labelKey:d.SETTINGS$SKILLS_FACET_CATEGORY,param:Be,values:Y(K,q),valueOf:e=>Oe(e),selected:e=>e.categories,withSelected:(e,t)=>({...e,categories:X(K,t)})},{id:`type`,labelKey:d.SETTINGS$SKILLS_FACET_TYPE,param:Ve,values:Y(We,qe),valueOf:e=>e.type,selected:e=>e.types,withSelected:(e,t)=>({...e,types:X(We,t)})}];function Ye(e){let t=Z.find(t=>t.id===e);if(!t)throw Error(`Unknown skill facet group: ${e}`);return t}function Xe(e,t){let n=new Set(t.values.map(({value:e})=>e));return new Set(e.map(e=>e.trim()).filter(e=>n.has(e)))}function Ze(e){return Z.reduce((t,n)=>n.withSelected(t,Xe(e.getAll(n.param),n)),{...Ge,query:e.get(`q`)??``})}function Q(e){let t=new URLSearchParams;e.query&&t.set(`q`,e.query);for(let n of Z){let r=n.selected(e);for(let{value:e}of n.values)r.has(e)&&t.append(n.param,e)}return t}function Qe(e,t){let n=t.trim();if(!n)return!0;let r=[e.name,G(e),e.description??``,e.content??``,e.license??``,e.compatibility??``,...e.triggers??[],...e.allowed_tools??[]],i=n.toLowerCase();return r.some(e=>e.toLowerCase().includes(i))}function $e(e,t,n,r){return Z.every(i=>{if(i.id===r)return!0;let a=i.selected(n);return a.size===0?!0:a.has(i.valueOf(e,t))})}function et(e,t,n){return e.filter(e=>Qe(e,n.query)&&$e(e,t,n))}function $(e,t,n){let r={};for(let i of e){let e=t.valueOf(i,n);r[e]=(r[e]??0)+1}return r}function tt(e,t,n,r,i){let a=$(t,e,r),o=e.values.filter(({value:e})=>(a[e]??0)>0),s=e.selected(i);if(o.length<2&&s.size===0)return null;let c=e.values.filter(({value:e})=>(a[e]??0)>0||s.has(e)),l=$(n.filter(t=>$e(t,r,i,e.id)),e,r);return{id:e.id,labelKey:e.labelKey,rows:c.map(({value:e,labelKey:t})=>{let n=l[e]??0,r=s.has(e);return{value:e,labelKey:t,count:n,checked:r,disabled:n===0&&!r}})}}function nt(e,t,n){let r=e.filter(e=>Qe(e,n.query));return Z.map(i=>tt(i,e,r,t,n)).filter(e=>e!==null)}function rt(e,t,n){let r=Ye(t);if(!r.values.some(e=>e.value===n))return e;let i=new Set(r.selected(e));return i.has(n)?i.delete(n):i.add(n),r.withSelected(e,i)}function it(e){return{...Ge,query:e.query}}function at(e){return Z.reduce((t,n)=>t+n.selected(e).size,0)}function ot({search:e,onSearchChange:t,activeFilterCount:n,onOpenFilters:r}){let{t:i}=a(`openhands`);return(0,B.jsxs)(`div`,{"data-testid":`skills-toolbar`,className:`flex items-stretch gap-2`,children:[(0,B.jsxs)(`div`,{className:u(`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,B.jsx)(y,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,B.jsx)(`input`,{"data-testid":`skills-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(d.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),"aria-label":i(d.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),className:u(`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,B.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(d.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,B.jsx)(x,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,B.jsxs)(`button`,{type:`button`,"data-testid":`skills-filters-button`,onClick:r,className:u(`flex shrink-0 items-center gap-2 rounded-lg px-3 py-2 text-sm md:hidden`,`border border-[var(--oh-border)] bg-base-secondary text-white`,`cursor-pointer hover:bg-[var(--oh-interactive-hover)]`),children:[(0,B.jsx)(h,{className:`size-4 shrink-0`,"aria-hidden":!0}),i(d.SETTINGS$SKILLS_FILTERS_BUTTON),n>0?(0,B.jsx)(`span`,{className:`rounded-full bg-white px-1.5 text-[11px] font-medium text-black`,children:n}):null]})]})}var st=300;function ct(){let{t:e}=a(`openhands`),{mutate:t}=te(),{data:n,isLoading:i}=ee(),{data:o,isLoading:s}=ae(),[f,p]=r(),[m,h]=R.useState(()=>f.get(`q`)??``),g=R.useRef(m),[_,v]=R.useState(new Set),[y,b]=R.useState(!1),[x,S]=R.useState(null),[C,w]=R.useState(!1),[T,E]=R.useState(!1),O=i||s||!n,k=o??[],A=R.useMemo(()=>({...Ze(f),query:m}),[f,m]),j=R.useMemo(()=>nt(k,_,A),[k,_,A]),M=R.useMemo(()=>et(k,_,A),[k,_,A]),N=at(A);R.useEffect(()=>{i||!n||(v(new Set(n.disabled_skills??[])),b(!0))},[i,n?.disabled_skills]),R.useEffect(()=>{y&&t({disabled_skills:Array.from(_)},{onError:t=>{c(l(t)||e(d.ERROR$GENERIC))}})},[_,y,t,e]),R.useEffect(()=>{let e=f.get(`q`)??``;e!==g.current&&(g.current=e,h(e))},[f]),R.useEffect(()=>{if((f.get(`q`)??``)===m)return;let e=setTimeout(()=>{g.current=m,p(e=>{let t=new URLSearchParams(e);return m?t.set(`q`,m):t.delete(`q`),t},{replace:!0})},st);return()=>clearTimeout(e)},[m,f,p]);let P=e=>{e.query!==A.query&&h(e.query),Q({...e,query:``}).toString()!==Q({...A,query:``}).toString()&&p(Q(e))},F=(e,t)=>P(rt(A,e,t)),I=()=>P(it(A)),L=(e,t)=>{v(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r})};return(0,B.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,B.jsx)(se,{}),(0,B.jsxs)(`main`,{className:u(de,`h-full`),children:[(0,B.jsxs)(`div`,{"data-testid":`skills-page`,className:`mx-auto flex w-full min-w-0 max-w-[1100px] flex-col gap-6`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,B.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(d.SETTINGS$SKILLS_TITLE)}),(0,B.jsx)(`div`,{"data-testid":`skills-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(d.SETTINGS$SKILLS_PAGE_DESCRIPTION)})]}),(0,B.jsx)(D,{type:`button`,variant:`secondary`,testId:`skills-add-skill-button`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>w(!0),children:e(d.SETTINGS$SKILLS_ADD_BUTTON)})]}),O?(0,B.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,B.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}):null,!O&&k.length===0?(0,B.jsx)(`div`,{"data-testid":`skills-empty`,className:re,children:(0,B.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(d.SETTINGS$SKILLS_NO_SKILLS)})}):null,!O&&k.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ot,{search:A.query,onSearchChange:e=>P({...A,query:e}),activeFilterCount:N,onOpenFilters:()=>E(!0)}),(0,B.jsxs)(`div`,{className:`flex min-w-0 gap-6`,children:[(0,B.jsx)(Le,{groups:j,onToggle:F,className:`hidden w-[240px] shrink-0 self-start md:flex`}),(0,B.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-tertiary-light`,children:[(0,B.jsx)(`span`,{"data-testid":`skills-result-summary`,children:e(d.SETTINGS$SKILLS_RESULT_COUNT,{count:M.length})}),N>0?(0,B.jsx)(`button`,{type:`button`,"data-testid":`skills-clear-filters`,onClick:I,className:`cursor-pointer underline hover:text-white`,children:e(d.SETTINGS$SKILLS_CLEAR_FILTERS)}):null]}),M.length===0?(0,B.jsx)(`div`,{"data-testid":`skills-no-match`,className:re,children:(0,B.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(d.SETTINGS$SKILLS_NO_MATCH)})}):(0,B.jsx)(`div`,{className:u(ne),children:(0,B.jsx)(`div`,{className:ie,children:M.map(e=>(0,B.jsx)(je,{skill:e,enabled:!_.has(e.name),onOpen:()=>S(e),onToggle:t=>L(e.name,t)},e.name))})})]})]}),T?(0,B.jsx)(Re,{groups:j,activeCount:N,onToggle:F,onClearAll:I,onClose:()=>E(!1)}):null]}):null]}),x&&(0,B.jsx)(Pe,{skill:x,enabled:!_.has(x.name),onToggle:e=>L(x.name,e),onClose:()=>S(null)}),C&&(0,B.jsx)(ve,{onClose:()=>w(!1)})]})]})}var lt=i(ct);export{lt as default};
@@ -1 +1 @@
1
- import{E as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t};
1
+ import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";var t=e(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]);export{t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./utils-DPQfkd-7.js";var a=e(t(),1),o=r();function s(e){return a.Children.count(e)===1&&a.isValidElement(e)?e:(0,o.jsx)(`span`,{className:`inline-flex`,children:e})}function c({children:e,content:t,tooltipClassName:r,placement:a=`right`,showArrow:c=!1,closeDelay:l=100,shouldFlip:u,offset:d=7}){return(0,o.jsx)(n,{content:t,closeDelay:l,placement:a,offset:d,shouldFlip:u,className:i(`bg-white text-black`,r),showArrow:c,disableAnimation:!1,classNames:{content:i(`z-[9999] rounded-md px-2 py-1 text-xs font-medium shadow-md`,`!bg-white !text-black`,r)},children:s(e)})}export{c as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./utils-zxEjKE70.js";var a=e(t(),1),o=r();function s(e){return a.Children.count(e)===1&&a.isValidElement(e)?e:(0,o.jsx)(`span`,{className:`inline-flex`,children:e})}function c({children:e,content:t,tooltipClassName:r,placement:a=`right`,showArrow:c=!1,closeDelay:l=100,shouldFlip:u,offset:d=7}){return(0,o.jsx)(n,{content:t,closeDelay:l,placement:a,offset:d,shouldFlip:u,className:i(`bg-white text-black`,r),showArrow:c,disableAnimation:!1,classNames:{content:i(`z-[9999] rounded-md px-2 py-1 text-xs font-medium shadow-md`,`!bg-white !text-black`,r)},children:s(e)})}export{c as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{t as i,z as a}from"./utils-DPQfkd-7.js";import{a as o,i as s}from"./messages-B2l0qLVk.js";import{n as c}from"./conversation-Cmyw9bFh.js";import{r as l}from"./typography-D9tiHct7.js";import{t as u}from"./u-check-circle-BKn1spCL.js";import{t as d}from"./conversation-tab-empty-state-C9sfDOlt.js";var f=e(t(),1),p=n();function m({task:e}){let{t}=r(`openhands`),n=(0,f.useMemo)(()=>{switch(e.status){case`todo`:return(0,p.jsx)(o,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,p.jsx)(u,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,p.jsx)(o,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),c=e.status===`done`;return(0,p.jsxs)(`div`,{className:`flex gap-2 items-center w-full`,"data-name":`item`,children:[(0,p.jsx)(`div`,{className:`shrink-0`,children:n}),(0,p.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[16px] text-nowrap whitespace-pre font-normal`,children:[(0,p.jsx)(l.Text,{className:i(`text-[12px]`,c?`text-[var(--oh-muted)]`:`text-white`),children:e.title}),e.notes&&(0,p.jsxs)(l.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(a.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function h(){let{t:e}=r(`openhands`),{taskList:t}=c();return t.length===0?(0,p.jsx)(d,{icon:(0,p.jsx)(u,{}),children:e(a.COMMON$NO_TASKS)}):(0,p.jsx)(`main`,{className:`h-full overflow-y-auto flex flex-col custom-scrollbar-always`,children:t.map(e=>(0,p.jsx)(`div`,{"data-active":e.status===`in_progress`?`true`:`false`,className:i(`px-4 py-2`,e.status===`in_progress`&&`bg-[var(--oh-surface-raised)]`),children:(0,p.jsx)(m,{task:e})},e.id))})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as i,z as a}from"./utils-zxEjKE70.js";import{a as o,o as s}from"./messages-DSXvyc21.js";import{n as c}from"./conversation-CPCVsCUY.js";import{r as l}from"./typography-NOKSk9_R.js";import{t as u}from"./u-check-circle-BKn1spCL.js";import{t as d}from"./conversation-tab-empty-state-CMqo_0Bd.js";var f=e(t(),1),p=n();function m({task:e}){let{t}=r(`openhands`),n=(0,f.useMemo)(()=>{switch(e.status){case`todo`:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,p.jsx)(o,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,p.jsx)(u,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),c=e.status===`done`;return(0,p.jsxs)(`div`,{className:`flex gap-2 items-center w-full`,"data-name":`item`,children:[(0,p.jsx)(`div`,{className:`shrink-0`,children:n}),(0,p.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[16px] text-nowrap whitespace-pre font-normal`,children:[(0,p.jsx)(l.Text,{className:i(`text-[12px]`,c?`text-[var(--oh-muted)]`:`text-white`),children:e.title}),e.notes&&(0,p.jsxs)(l.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(a.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function h(){let{t:e}=r(`openhands`),{taskList:t}=c();return t.length===0?(0,p.jsx)(d,{icon:(0,p.jsx)(u,{}),children:e(a.COMMON$NO_TASKS)}):(0,p.jsx)(`main`,{className:`h-full overflow-y-auto flex flex-col custom-scrollbar-always`,children:t.map(e=>(0,p.jsx)(`div`,{"data-active":e.status===`in_progress`?`true`:`false`,className:i(`px-4 py-2`,e.status===`in_progress`&&`bg-[var(--oh-surface-raised)]`),children:(0,p.jsx)(m,{task:e})},e.id))})}export{h as default};
@@ -1,3 +1,3 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{E as i,t as a,z as o}from"./utils-DPQfkd-7.js";import{i as s}from"./conversation-Cmyw9bFh.js";import{d as c}from"./llm-not-configured-banner-DCE_0B4I.js";import{G as l,v as u}from"./markdown-renderer-DzvgdZey.js";import{n as d,t as f}from"./vendor~terminal-BVSbSr6V.js";import{t as p}from"./conversation-tab-empty-state-C9sfDOlt.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-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{E as i,t as a,z as o}from"./utils-zxEjKE70.js";import{i as s}from"./conversation-CPCVsCUY.js";import{h as c}from"./llm-not-configured-banner-DLw_tu-G.js";import{q as l,y as u}from"./markdown-renderer-DUmk7pFc.js";import{n as d,t as f}from"./vendor~terminal-BVSbSr6V.js";import{t as p}from"./conversation-tab-empty-state-CMqo_0Bd.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=u(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)(c,{testId:t,className:e})}function w(){let{t:e}=r(`openhands`);return(0,S.jsx)(p,{className:`h-full`,icon:(0,S.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(o.TERMINAL$NO_OUTPUT)})}function T(){let{curAgentState:e}=l(),t=u(e=>e.commands),n=i.includes(e),r=t.length>0,o=n||!r,s=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:a(`flex-1 min-h-0 p-4`,o&&`pointer-events-none absolute inset-0 h-0 w-0 overflow-hidden p-0 opacity-0`),children:(0,S.jsx)(`div`,{ref:s,className:`h-full w-full`})})]})}export{T as default};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-DPQfkd-7.js";var n=e();function r({enabled:e,className:r}){return(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t(`relative inline-flex h-[22px] w-[40px] shrink-0 items-center rounded-full border`,`transition-colors duration-200 ease-in-out motion-reduce:transition-none`,e?`border-white bg-white`:`border-[var(--oh-border)] bg-surface-raised`,r),children:(0,n.jsx)(`span`,{className:t(`inline-block size-4 rounded-full`,`transition-transform duration-200 ease-in-out motion-reduce:transition-none`,e?`translate-x-[21px] bg-base-secondary`:`translate-x-[2px] bg-[var(--oh-muted)]`)})})}function i({enabled:e,label:i,onToggle:a,className:o}){return(0,n.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":i,onClick:e=>{e.stopPropagation(),a()},className:t(`cursor-pointer`,o),children:(0,n.jsx)(r,{enabled:e})})}export{r as n,i as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-zxEjKE70.js";var n=e();function r({enabled:e,className:r}){return(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t(`relative inline-flex h-[22px] w-[40px] shrink-0 items-center rounded-full border`,`transition-colors duration-200 ease-in-out motion-reduce:transition-none`,e?`border-white bg-white`:`border-[var(--oh-border)] bg-surface-raised`,r),children:(0,n.jsx)(`span`,{className:t(`inline-block size-4 rounded-full`,`transition-transform duration-200 ease-in-out motion-reduce:transition-none`,e?`translate-x-[21px] bg-base-secondary`:`translate-x-[2px] bg-[var(--oh-muted)]`)})})}function i({enabled:e,label:i,onToggle:a,className:o}){return(0,n.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":i,onClick:e=>{e.stopPropagation(),a()},className:t(`cursor-pointer`,o),children:(0,n.jsx)(r,{enabled:e})})}export{r as n,i as t};
@@ -0,0 +1 @@
1
+ import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";var t=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-DPQfkd-7.js";import{t as n}from"./dist-Bl64nBZL.js";var r=e(),i=n(``,{variants:{variant:{h1:`text-[32px] text-white font-medium leading-5`,h2:`text-xl font-medium leading-6 -tracking-[0.02em] text-white`,h3:`text-sm font-medium text-[var(--oh-text-tertiary)]`,span:`text-sm font-normal text-white leading-5.5`,p:`text-sm font-normal text-white leading-5.5`,codeBlock:`font-mono text-sm leading-relaxed text-[var(--oh-text-tertiary)] whitespace-pre-wrap`}},defaultVariants:{variant:`h1`}});function a({variant:e,className:n,testId:a,children:o}){return(0,r.jsx)(e,{"data-testid":a,className:t(i({variant:e}),n),children:o})}function o({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h1`,className:e,testId:t,children:n})}function s({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h2`,className:e,testId:t,children:n})}function c({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h3`,className:e,testId:t,children:n})}function l({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`span`,className:e,testId:t,children:n})}function u({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`codeBlock`,className:e,testId:t,children:n})}function d({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`p`,className:e,testId:t,children:n})}a.H1=o,a.H2=s,a.H3=c,a.Text=l,a.CodeBlock=u,a.Paragraph=d;export{l as n,a as r,o as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-zxEjKE70.js";import{t as n}from"./dist-Bl64nBZL.js";var r=e(),i=n(``,{variants:{variant:{h1:`text-[32px] text-white font-medium leading-5`,h2:`text-xl font-medium leading-6 -tracking-[0.02em] text-white`,h3:`text-sm font-medium text-[var(--oh-text-tertiary)]`,span:`text-sm font-normal text-white leading-5.5`,p:`text-sm font-normal text-white leading-5.5`,codeBlock:`font-mono text-sm leading-relaxed text-[var(--oh-text-tertiary)] whitespace-pre-wrap`}},defaultVariants:{variant:`h1`}});function a({variant:e,className:n,testId:a,children:o}){return(0,r.jsx)(e,{"data-testid":a,className:t(i({variant:e}),n),children:o})}function o({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h1`,className:e,testId:t,children:n})}function s({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h2`,className:e,testId:t,children:n})}function c({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h3`,className:e,testId:t,children:n})}function l({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`span`,className:e,testId:t,children:n})}function u({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`codeBlock`,className:e,testId:t,children:n})}function d({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`p`,className:e,testId:t,children:n})}a.H1=o,a.H2=s,a.H3=c,a.Text=l,a.CodeBlock=u,a.Paragraph=d;export{l as n,a as r,o as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{o as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as a}from"./useQuery-DRv--6bK.js";import{$ as o,n as s}from"./active-backend-context-IqOjobNK.js";import{t as c,z as l}from"./utils-zxEjKE70.js";import{r as u}from"./vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js";import{d}from"./git-provider-icon-BvlLAche.js";import{t as f}from"./info-BRVcJAUg.js";import{t as p}from"./loader-circle-B47W9XqT.js";import{t as m}from"./refresh-cw-CXtFWpwv.js";import{t as h}from"./brand-button-swT1RyO0.js";import{t as g}from"./styled-tooltip-BUMSbgrF.js";import{d as _,f as v,p as y,u as b}from"./llm-not-configured-banner-DLw_tu-G.js";import{J as x,p as S}from"./markdown-renderer-DUmk7pFc.js";import{t as C}from"./conversation-tab-empty-state-CMqo_0Bd.js";var w=e(t(),1);function T(e=!0){let t=S(e=>e.cost),n=S(e=>e.max_budget_per_task),r=S(e=>e.usage),{data:i}=x(),{data:a}=y(i?.id,i?.conversation_url,i?.session_api_key,e);return(0,w.useMemo)(()=>t!==null||r!==null?{cost:t,max_budget_per_task:n,usage:r}:a?{cost:a.accumulated_cost,max_budget_per_task:a.max_budget_per_task,usage:a.accumulated_token_usage?{prompt_tokens:a.accumulated_token_usage.prompt_tokens??0,completion_tokens:a.accumulated_token_usage.completion_tokens??0,cache_read_tokens:a.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:a.accumulated_token_usage.cache_write_tokens??0,context_window:a.accumulated_token_usage.context_window??0,per_turn_token:a.accumulated_token_usage.per_turn_token??0}:null}:{cost:null,max_budget_per_task:null,usage:null},[a,t,n,r])}var E=n();function D({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,E.jsx)(`div`,{className:`relative mt-1 h-1.5 w-full rounded-full bg-tertiary`,children:(0,E.jsx)(`div`,{className:c(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function O({currentCost:e,maxBudget:t}){let{t:n}=r(`openhands`),i=e/t*100;return(0,E.jsx)(`div`,{className:`flex justify-end`,children:(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(l.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:i.toFixed(2),used:n(l.CONVERSATION$USED)})})})}function k({cost:e,maxBudgetPerTask:t}){let{t:n}=r(`openhands`);return e===null?null:(0,E.jsx)(`div`,{children:t!==null&&t>0?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(D,{currentCost:e,maxBudget:t}),(0,E.jsx)(O,{currentCost:e,maxBudget:t})]}):(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(l.CONVERSATION$NO_BUDGET_LIMIT)})})}function A({cost:e,maxBudgetPerTask:t}){let{t:n}=r(`openhands`);return e===null?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(k,{cost:e,maxBudgetPerTask:t}),(0,E.jsxs)(`div`,{className:`flex justify-between items-center border-t border-[var(--oh-border-subtle)] pt-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:n(l.CONVERSATION$TOTAL_COST)}),(0,E.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]})]})}function j({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`,showBorder:i=!0}){return(0,E.jsxs)(`div`,{className:c(`flex justify-between items-center pb-2`,i&&`border-b border-[var(--oh-border-subtle)]`),children:[(0,E.jsx)(`span`,{className:n,children:e}),(0,E.jsx)(`span`,{className:r,children:t})]})}function M({usage:e}){let{t}=r(`openhands`);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(j,{label:t(l.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(l.CONVERSATION$CACHE_HIT)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(l.CONVERSATION$CACHE_WRITE)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,E.jsx)(j,{label:t(l.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,E.jsx)(j,{label:t(l.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`,showBorder:!1})]})}function N({fillPercent:e,perTurnToken:t=0}){let{t:n}=r(`openhands`),{handleCompact:i,isCompacting:a,isDisabled:o,description:s}=_(t),c=e>70;return(0,E.jsxs)(`div`,{"data-testid":`compact-context-section`,className:`flex flex-col gap-2 border-t border-[var(--oh-border-subtle)] pt-3`,children:[c&&(0,E.jsx)(`span`,{className:`text-xs text-amber-500`,children:n(l.CONVERSATION$CONTEXT_FILLING_UP)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(h,{testId:`compact-context-button`,type:`button`,variant:c?`primary`:`secondary`,isDisabled:o,"aria-busy":a,onClick:i,startContent:a?(0,E.jsx)(p,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):(0,E.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),className:`w-fit`,children:n(l.CONVERSATION$COMPACT_CONTEXT)}),(0,E.jsx)(g,{content:s,placement:`top`,tooltipClassName:`max-w-[220px] text-xs font-normal leading-relaxed whitespace-normal`,children:(0,E.jsx)(`button`,{type:`button`,"data-testid":`compact-context-info`,"aria-label":s,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] transition-colors cursor-help`,children:(0,E.jsx)(f,{className:`size-3.5`,"aria-hidden":!0})})})]})]})}var P=`/api/llm/balance`,F=1e4;function I(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function L(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function R(e){return I(e)&&(e.name===`TimeoutError`||e.name===`AbortError`)}function z(e){return!I(e)||typeof e.provider!=`string`?null:{provider:e.provider,limit:L(e.limit),limitRemaining:L(e.limit_remaining),usage:L(e.usage)??0,usageDaily:L(e.usage_daily),usageWeekly:L(e.usage_weekly),usageMonthly:L(e.usage_monthly),isFreeTier:e.is_free_tier===!0}}var B=class{static async getBalance(){let{host:e,apiKey:t}=o(),n=new i({host:e,apiKey:t,timeout:F});try{return z(await n.get(P,{acceptableStatusCodes:new Set([200]),responseType:`json`,timeoutSeconds:Math.floor(F/1e3)}))}catch(e){if(e instanceof Error&&`status`in e&&e.status===404)return null;if(R(e))throw Error(`Balance request timed out after ${F}ms`);let t=e instanceof Error&&`status`in e&&e.status;throw Error(t?`Balance request failed with ${t}`:`Balance request failed: ${e instanceof Error?e.message:String(e)}`)}finally{n.close()}}},V=e=>{let{backend:t}=s();return a({queryKey:[`llm-balance`,t.id,e],queryFn:()=>B.getBalance(),enabled:t.kind!==`cloud`&&!!e,staleTime:1/0,gcTime:1e3*60*5,retry:!1,refetchOnWindowFocus:!1})};function H(e){return`$${e.toFixed(2)}`}function U(){let{t:e}=r(`openhands`),{data:t}=x(),{data:n,isError:i,isFetching:a,refetch:o}=V(t?.id);if(!n||i)return null;let s=n.limit!==null&&n.limitRemaining!==null;return(0,E.jsxs)(`div`,{"data-testid":`provider-balance-card`,className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between pb-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:e(l.CONVERSATION$PROVIDER_BALANCE)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[n.provider,n.isFreeTier?` · ${e(l.CONVERSATION$FREE_TIER)}`:null]}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`provider-balance-refresh`,"aria-label":e(l.BUTTON$REFRESH),disabled:a,onClick:()=>o(),className:`cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default`,children:(0,E.jsx)(m,{className:c(`h-3.5 w-3.5`,a&&`animate-spin`)})})]})]}),(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[s?(0,E.jsx)(j,{label:e(l.CONVERSATION$CREDITS_REMAINING),value:H(n.limitRemaining??0)}):null,(0,E.jsx)(j,{label:e(l.CONVERSATION$CREDITS_USED),value:H(n.usage),valueClassName:s?``:`font-semibold`,labelClassName:s?`text-[var(--oh-muted)]`:``})]})]})}function W(){let{t:e}=r(`openhands`),t=T(),{data:n}=x(),i=n?.agent_kind===`acp`,{usage:a}=t;return t.cost!==null||a!==null?(0,E.jsxs)(`main`,{"data-testid":`usage-panel`,className:`h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3`,children:[a!==null&&(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(b,{perTurnToken:a.per_turn_token,contextWindow:a.context_window}),(0,E.jsx)(N,{fillPercent:v(a.per_turn_token,a.context_window),perTurnToken:a.per_turn_token})]})}),(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(`div`,{className:`flex justify-between items-center pb-2`,children:(0,E.jsx)(`span`,{className:`text-lg font-semibold`,children:e(l.CONVERSATION$TOKEN_USAGE)})}),i&&(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:e(l.CONVERSATION$PLAN_USAGE_NOTE)}),a!==null&&(0,E.jsx)(M,{usage:a}),(0,E.jsx)(A,{cost:t.cost,maxBudgetPerTask:t.max_budget_per_task})]})}),(0,E.jsx)(U,{})]}):(0,E.jsx)(C,{icon:(0,E.jsx)(d,{}),children:e(l.CONVERSATION$NO_METRICS)})}function G(){return(0,E.jsx)(W,{})}export{G as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{v as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as o}from"./useQuery-BCnzy4LX.js";import{$ as s,At as c,Nt as l,Pt as u,jt as d,n as f}from"./active-backend-context-B_bg5h9O.js";import{t as p,z as m}from"./utils-DPQfkd-7.js";import{t as h}from"./check-DLOKoFU9.js";import{t as g}from"./loader-circle-C5AnEN8r.js";import{l as _}from"./form-control-classes-DLN3Qgub.js";import{n as v,t as y}from"./settings-input-D61Vzp9e.js";import{a as b,l as x}from"./acp-providers-BkL3HWa3.js";import{n as S,t as C}from"./use-create-secret-DcpT3RPw.js";var w=e(t(),1),T=n();function E({conflicts:e}){let{t}=i(`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(m.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function D({status:e,isChecking:t,providerName:n,testIdPrefix:r}){let{t:a}=i(`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)(h,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:a(m.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)(g,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:a(m.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):null}function O({field:e,value:t,onChange:n,alreadySet:r,testId:a,showOptionalTag:o}){let{t:s}=i(`openhands`),c=r?s(m.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}),o&&(0,T.jsx)(v,{})]}),(0,T.jsx)(`textarea`,{"data-testid":a,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:c,onChange:e=>n(e.target.value),className:p(_,`font-mono text-xs`)})]}):(0,T.jsx)(y,{testId:a,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:o,placeholder:c}),(0,T.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:s(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 a(s()).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(),i=r.backend.kind===`local`,a=n&&i&&!!e,s=o({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>I(e),enabled:a,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:a&&s.isFetching&&s.data===void 0,isSupported:i}}function R(e,t){let{t:n}=i(`openhands`),a=r(),{mutateAsync:o}=C(),[s,f]=w.useState(!1);return{saveFilled:async(r,{silent:i=!1}={})=>{let s=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(s.length===0)return!0;f(!0);try{for(let{field:e,value:t}of s)await o({name:e.name,value:t});return await a.invalidateQueries({queryKey:[`secrets-search`]}),await a.invalidateQueries({queryKey:[`secrets`]}),!t&&s.some(({field:e})=>e.multiline)?l(n(m.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):i||d(n(m.SETTINGS$SAVED)),!0}catch(e){return c(u(e)||n(m.ERROR$GENERIC)),!1}finally{f(!1)}},isSaving:s}}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-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{y as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as o}from"./useQuery-DRv--6bK.js";import{$ as s,At as c,Nt as l,Pt as u,jt as d,n as f}from"./active-backend-context-IqOjobNK.js";import{t as p,z as m}from"./utils-zxEjKE70.js";import{t as h}from"./check-WAFXrrs_.js";import{t as g}from"./loader-circle-B47W9XqT.js";import{l as _}from"./form-control-classes-7yFSQJq_.js";import{n as v,t as y}from"./settings-input-Cz62hWVW.js";import{a as b,l as x}from"./acp-providers-D1PORKc0.js";import{n as S,t as C}from"./use-create-secret-2zBlCDsF.js";var w=e(t(),1),T=n();function E({conflicts:e}){let{t}=i(`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(m.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function D({status:e,isChecking:t,providerName:n,testIdPrefix:r}){let{t:a}=i(`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)(h,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:a(m.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)(g,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,T.jsx)(`span`,{children:a(m.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):null}function O({field:e,value:t,onChange:n,alreadySet:r,testId:a,showOptionalTag:o}){let{t:s}=i(`openhands`),c=r?s(m.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}),o&&(0,T.jsx)(v,{})]}),(0,T.jsx)(`textarea`,{"data-testid":a,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:c,onChange:e=>n(e.target.value),className:p(_,`font-mono text-xs`)})]}):(0,T.jsx)(y,{testId:a,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:o,placeholder:c}),(0,T.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:s(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 a(s()).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(),i=r.backend.kind===`local`,a=n&&i&&!!e,s=o({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>I(e),enabled:a,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:a&&s.isFetching&&s.data===void 0,isSupported:i}}function R(e,t){let{t:n}=i(`openhands`),a=r(),{mutateAsync:o}=C(),[s,f]=w.useState(!1);return{saveFilled:async(r,{silent:i=!1}={})=>{let s=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(s.length===0)return!0;f(!0);try{for(let{field:e,value:t}of s)await o({name:e.name,value:t});return await a.invalidateQueries({queryKey:[`secrets-search`]}),await a.invalidateQueries({queryKey:[`secrets`]}),!t&&s.some(({field:e})=>e.multiline)?l(n(m.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):i||d(n(m.SETTINGS$SAVED)),!0}catch(e){return c(u(e)||n(m.ERROR$GENERIC)),!1}finally{f(!1)}},isSaving:s}}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};