@openhands/agent-canvas 1.18.0 → 1.20.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 (420) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-DOKcGeaV.js +1 -0
  4. package/build/assets/active-backend-context-BETEdaJl.js +2 -0
  5. package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
  9. package/build/assets/agent-settings-BnzyTgCb.js +2 -0
  10. package/build/assets/agent-settings-CeXj3xK-.js +1 -0
  11. package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
  13. package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
  14. package/build/assets/automation-detail-CF2SweVs.js +3 -0
  15. package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
  16. package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
  17. package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
  18. package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
  19. package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
  20. package/build/assets/automations-list-yK7ETmYP.js +1 -0
  21. package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
  22. package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
  24. package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
  25. package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
  26. package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
  27. package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
  28. package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
  29. package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
  30. package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
  32. package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
  35. package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
  36. package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
  37. package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
  38. package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
  39. package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
  40. package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
  41. package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
  42. package/build/assets/conversation-XRsI28ZM.js +1 -0
  43. package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
  44. package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
  47. package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
  48. package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
  49. package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
  50. package/build/assets/empty-state-B5advKVW.js +1 -0
  51. package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
  54. package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
  55. package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
  56. package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
  57. package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
  58. package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
  59. package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
  60. package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
  61. package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
  62. package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
  63. package/build/assets/home-4lyLzYjG.js +1 -0
  64. package/build/assets/home-BGaB0EeK.js +1 -0
  65. package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
  66. package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
  67. package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
  68. package/build/assets/index-home-6Y_Y7kOo.js +1 -0
  69. package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
  70. package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
  71. package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
  72. package/build/assets/link-external-B4gx3EeM.js +1 -0
  73. package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
  74. package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
  75. package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
  76. package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
  77. package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
  78. package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
  79. package/build/assets/manifest-23d79467.js +1 -0
  80. package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
  81. package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
  82. package/build/assets/mcp-CoUOIGBF.js +1 -0
  83. package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
  84. package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
  85. package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
  86. package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
  87. package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
  88. package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
  89. package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
  90. package/build/assets/onboarding-Cc4Av7bi.js +1 -0
  91. package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
  92. package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.js} +1 -1
  93. package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
  94. package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-yISBVUKu.js} +1 -1
  95. package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
  96. package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
  97. package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
  98. package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
  99. package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
  100. package/build/assets/root-D1y82Lhg.js +2 -0
  101. package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
  102. package/build/assets/root-sEWn3ha1.css +1 -0
  103. package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
  104. package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
  105. package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
  106. package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
  107. package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
  108. package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
  109. package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
  110. package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
  111. package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
  112. package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
  113. package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
  114. package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
  115. package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
  116. package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
  117. package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
  118. package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
  119. package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
  120. package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
  121. package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
  122. package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
  123. package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
  124. package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
  125. package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
  126. package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
  127. package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
  128. package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
  129. package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
  130. package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
  131. package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
  132. package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
  133. package/build/assets/trash-D1QMHInX.js +1 -0
  134. package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
  135. package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
  136. package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
  137. package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
  138. package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
  139. package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
  140. package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
  141. package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
  142. package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
  143. package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
  145. package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
  146. package/build/assets/use-create-conversation-D15Px574.js +1 -0
  147. package/build/assets/use-create-secret-D_qPU88t.js +1 -0
  148. package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
  149. package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
  150. package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
  151. package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
  152. package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
  153. package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
  154. package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
  155. package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
  156. package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
  157. package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
  158. package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
  159. package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
  160. package/build/assets/use-tracking-BAFpgpgq.js +3 -0
  161. package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
  162. package/build/assets/utils-CbjwNcR-.js +1 -0
  163. package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
  164. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
  165. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
  166. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
  167. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
  168. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
  169. package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
  170. package/build/index.html +4 -4
  171. package/build/locales/ar/openhands.json +18 -1
  172. package/build/locales/ca/openhands.json +18 -1
  173. package/build/locales/de/openhands.json +18 -1
  174. package/build/locales/en/openhands.json +18 -1
  175. package/build/locales/es/openhands.json +18 -1
  176. package/build/locales/fr/openhands.json +18 -1
  177. package/build/locales/it/openhands.json +18 -1
  178. package/build/locales/ja/openhands.json +18 -1
  179. package/build/locales/ko-KR/openhands.json +18 -1
  180. package/build/locales/no/openhands.json +18 -1
  181. package/build/locales/pt/openhands.json +18 -1
  182. package/build/locales/tr/openhands.json +18 -1
  183. package/build/locales/uk/openhands.json +18 -1
  184. package/build/locales/zh-CN/openhands.json +18 -1
  185. package/build/locales/zh-TW/openhands.json +18 -1
  186. package/config/defaults.json +3 -3
  187. package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
  188. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
  189. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
  190. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
  191. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
  192. package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
  193. package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
  194. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  195. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  196. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
  197. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  198. package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
  199. package/dist/config/defaults.cjs +1 -1
  200. package/dist/config/defaults.cjs.map +1 -1
  201. package/dist/config/defaults.js +3 -3
  202. package/dist/config/defaults.js.map +1 -1
  203. package/dist/constants/acp-providers.cjs +1 -1
  204. package/dist/constants/acp-providers.cjs.map +1 -1
  205. package/dist/constants/acp-providers.d.ts +0 -5
  206. package/dist/constants/acp-providers.js +20 -16
  207. package/dist/constants/acp-providers.js.map +1 -1
  208. package/dist/constants/profile-scope.d.ts +21 -0
  209. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  210. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  211. package/dist/hooks/mutation/use-create-conversation.js +30 -19
  212. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  213. package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
  214. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
  215. package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
  216. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
  217. package/dist/hooks/query/query-keys.cjs +1 -1
  218. package/dist/hooks/query/query-keys.cjs.map +1 -1
  219. package/dist/hooks/query/query-keys.d.ts +1 -0
  220. package/dist/hooks/query/query-keys.js +10 -1
  221. package/dist/hooks/query/query-keys.js.map +1 -1
  222. package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
  223. package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
  224. package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
  225. package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
  226. package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
  227. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  228. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  229. package/dist/hooks/query/use-automation-sdk-version.js +3 -1
  230. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  231. package/dist/hooks/use-drag-resize.cjs +1 -1
  232. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  233. package/dist/hooks/use-drag-resize.js +8 -9
  234. package/dist/hooks/use-drag-resize.js.map +1 -1
  235. package/dist/i18n/declaration.cjs +1 -1
  236. package/dist/i18n/declaration.cjs.map +1 -1
  237. package/dist/i18n/declaration.d.ts +18 -1
  238. package/dist/i18n/declaration.js +1 -1
  239. package/dist/i18n/declaration.js.map +1 -1
  240. package/dist/i18n/translation.cjs +3 -3
  241. package/dist/i18n/translation.cjs.map +1 -1
  242. package/dist/i18n/translation.js +289 -0
  243. package/dist/i18n/translation.js.map +1 -1
  244. package/dist/locales/ar/openhands.json +18 -1
  245. package/dist/locales/ca/openhands.json +18 -1
  246. package/dist/locales/de/openhands.json +18 -1
  247. package/dist/locales/en/openhands.json +18 -1
  248. package/dist/locales/es/openhands.json +18 -1
  249. package/dist/locales/fr/openhands.json +18 -1
  250. package/dist/locales/it/openhands.json +18 -1
  251. package/dist/locales/ja/openhands.json +18 -1
  252. package/dist/locales/ko-KR/openhands.json +18 -1
  253. package/dist/locales/no/openhands.json +18 -1
  254. package/dist/locales/pt/openhands.json +18 -1
  255. package/dist/locales/tr/openhands.json +18 -1
  256. package/dist/locales/uk/openhands.json +18 -1
  257. package/dist/locales/zh-CN/openhands.json +18 -1
  258. package/dist/locales/zh-TW/openhands.json +18 -1
  259. package/dist/manifests/automation-setup.cjs.map +1 -1
  260. package/dist/manifests/automation-setup.js.map +1 -1
  261. package/dist/manifests/manifest-local-validation.cjs.map +1 -1
  262. package/dist/manifests/manifest-local-validation.js.map +1 -1
  263. package/dist/manifests/manifest-validation.cjs +1 -1
  264. package/dist/manifests/manifest-validation.cjs.map +1 -1
  265. package/dist/manifests/manifest-validation.js +2 -2
  266. package/dist/manifests/manifest-validation.js.map +1 -1
  267. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
  268. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  269. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
  270. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  271. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  272. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  273. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
  274. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  275. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
  276. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
  277. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
  278. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
  279. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
  280. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  281. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
  282. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  283. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
  284. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
  285. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
  286. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
  287. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
  288. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  289. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
  290. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  291. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
  292. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
  293. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
  294. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
  295. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  296. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  297. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
  298. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  299. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
  300. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
  301. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
  302. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
  303. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  304. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  305. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
  306. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  307. package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
  308. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  309. package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
  310. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  311. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
  312. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
  313. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
  314. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
  315. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
  316. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
  317. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
  318. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
  319. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  320. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  321. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
  322. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  323. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
  324. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
  325. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
  326. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
  327. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  328. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  329. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
  330. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  331. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
  332. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
  333. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
  334. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
  335. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  336. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  337. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
  338. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  339. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
  340. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
  341. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
  342. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
  343. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  344. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
  345. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
  346. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
  347. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  348. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  349. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
  350. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  351. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
  352. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
  353. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
  354. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
  355. package/dist/package.cjs +1 -1
  356. package/dist/package.cjs.map +1 -1
  357. package/dist/package.js +3 -3
  358. package/dist/package.js.map +1 -1
  359. package/dist/routes/agent-settings.d.ts +11 -0
  360. package/dist/types/automation.cjs.map +1 -1
  361. package/dist/types/automation.d.ts +26 -2
  362. package/dist/types/automation.js.map +1 -1
  363. package/dist/utils/automation-disabled-reason.cjs +2 -0
  364. package/dist/utils/automation-disabled-reason.cjs.map +1 -0
  365. package/dist/utils/automation-disabled-reason.d.ts +32 -0
  366. package/dist/utils/automation-disabled-reason.js +19 -0
  367. package/dist/utils/automation-disabled-reason.js.map +1 -0
  368. package/dist/utils/parse-git-remote-url.cjs +1 -1
  369. package/dist/utils/parse-git-remote-url.cjs.map +1 -1
  370. package/dist/utils/parse-git-remote-url.d.ts +5 -1
  371. package/dist/utils/parse-git-remote-url.js +20 -13
  372. package/dist/utils/parse-git-remote-url.js.map +1 -1
  373. package/package.json +3 -3
  374. package/scripts/check-sdk-version-sync.mjs +79 -8
  375. package/scripts/dev-safe.mjs +14 -1
  376. package/scripts/docker-build.mjs +3 -0
  377. package/scripts/static-server.mjs +24 -7
  378. package/build/assets/acp-providers-DcY_mKYa.js +0 -1
  379. package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
  380. package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
  381. package/build/assets/agent-settings-BF8hM6wb.js +0 -2
  382. package/build/assets/agent-settings-YPutBAeR.js +0 -1
  383. package/build/assets/automation-detail-BxXhb_m2.js +0 -3
  384. package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
  385. package/build/assets/automations-list-DEPVNud3.js +0 -1
  386. package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
  387. package/build/assets/conversation-edjzrv5w.js +0 -1
  388. package/build/assets/conversation-panel-edjzrv5w.js +0 -1
  389. package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
  390. package/build/assets/empty-state-FK_s1B60.js +0 -1
  391. package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
  392. package/build/assets/home-BM5_Wz_R.js +0 -1
  393. package/build/assets/home-Ivfm7KC4.js +0 -1
  394. package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
  395. package/build/assets/index-home-td9BN2T3.js +0 -1
  396. package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
  397. package/build/assets/link-external-BNZzCM1I.js +0 -1
  398. package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
  399. package/build/assets/llm-settings-CZaXYgtw.js +0 -1
  400. package/build/assets/manifest-bfeccb98.js +0 -1
  401. package/build/assets/mcp-CraxoXQv.js +0 -1
  402. package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
  403. package/build/assets/mcp-page-CteH_K0N.js +0 -9
  404. package/build/assets/onboarding-DXFBRqEy.js +0 -1
  405. package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
  406. package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
  407. package/build/assets/root-CM6IZHlg.css +0 -1
  408. package/build/assets/root-DdFkodKW.js +0 -2
  409. package/build/assets/trash-Ckh7yCaB.js +0 -1
  410. package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
  411. package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
  412. package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
  413. package/build/assets/use-tracking-j4uo9VEW.js +0 -3
  414. package/build/assets/utils-BgLSZdyy.js +0 -1
  415. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
  416. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
  417. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
  418. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
  419. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
  420. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
@@ -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"./useQuery-DAAacS7O.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{n as a}from"./active-backend-context-BnH4-L8h.js";import{t as o}from"./utils-BgLSZdyy.js";import{p as s}from"./agent-server-client-options-EHB23gyx.js";import{t as c}from"./settings-service.api-C1vZH9Vh.js";import{h as l,l as u}from"./form-control-classes-Dbq-7YP_.js";import{t as d}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as f}from"./dist-Bl64nBZL.js";import{n as p,t as m}from"./settings-input-dVuzapBA.js";import{a as h,i as ee,n as g}from"./llm-subscription-DTqtBCWz.js";import{t as _}from"./use-is-authed-A2Yinlt0.js";import{r as v}from"./typography-DgcLGdHk.js";import{t as y}from"./settings-switch-DDd1cQ8t.js";var b=e(t(),1),x=n(),S=f(``,{variants:{size:{default:`text-xs`,settings:`text-sm text-[var(--oh-muted)] font-normal leading-5.5`},linkColor:{default:``,white:`text-white`}},defaultVariants:{size:`default`,linkColor:`default`}});function C({testId:e,text:t,linkText:n,href:r,suffix:i,suffixLinkText:a,suffixLinkHref:s,trailing:c,size:l,linkColor:u,className:d,linkTextClassName:f,suffixClassName:p}){return(0,x.jsxs)(`p`,{"data-testid":e,className:o(S({size:l}),d),children:[t,` `,(0,x.jsx)(`a`,{href:r,rel:`noreferrer noopener`,target:`_blank`,className:o(`underline underline-offset-2`,S({size:l,linkColor:u}),f),children:n}),i&&(0,x.jsx)(`span`,{className:p,children:i}),a&&s?(0,x.jsxs)(x.Fragment,{children:[` `,(0,x.jsx)(`a`,{href:s,rel:`noreferrer noopener`,target:`_blank`,className:o(`underline underline-offset-2`,S({size:l,linkColor:u}),f),children:a}),c]}):null]})}var te=`llm`;function w(e){if(!e?.sections)return e;let t=!1,n=e.sections.map(e=>{if(e.key!==te)return e;let n=new Set(e.fields.map(e=>e.key)),r=ee.filter(e=>!n.has(e.key));return r.length===0?e:(t=!0,{...e,fields:[...e.fields,...r]})});return t?{...e,sections:n}:e}var T=(e,t)=>{let{data:n}=_(),{backend:i,orgId:o}=a(),l=!s(i),{data:u,error:d,isLoading:f,isFetching:p}=r({queryKey:[`settings-schema`,e,i.id,o,i.kind,i.host,i.apiKey],queryFn:e===`conversation`?c.getConversationSettingsSchema:c.getSettingsSchema,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,enabled:!t&&!!n&&l,meta:{disableToast:!0}}),m=(0,b.useMemo)(()=>e===`agent`?w(t):t,[t,e]),h=(0,b.useMemo)(()=>e===`agent`?w(u):u,[u,e]);return t?{data:m,error:null,isLoading:!1,isFetching:!1}:{data:h,error:d,isLoading:f,isFetching:p}},E=e=>T(`agent`,e),ne=e=>T(`conversation`,e);function re(e,t){return`SCHEMA$${e.replace(/\./g,`$`).toUpperCase()}$${t}`}var D=e=>!!e?.includes(`$`),O={tool_concurrency_limit:{constraints:{min:1,step:1}},"llm.top_p":{constraints:{min:0,max:1,step:.01}},"llm.temperature":{constraints:{min:0,max:2,step:.1}}};function k(e){return O[e]?.constraints}function A(e,t,n,r){if(D(r))return e(r);let i=re(t,n);return e(i,{defaultValue:``})||(r&&console.warn(`[i18n] Missing translation for key "${i}", falling back to: "${r}"`),r??null)}function j(e,t,n){return A(e,t,`LABEL`,n)??``}function M(e,t,n){return A(e,t,`DESCRIPTION`,n)}function ie(e,t,n,r){if(D(r))return e(r);let i=`SCHEMA$${t.replace(/\./g,`$`).toUpperCase()}$CHOICE$${String(n).toUpperCase()}`;return e(i,{defaultValue:``})||(console.warn(`[i18n] Missing translation for key "${i}", falling back to: "${r}"`),r)}var ae=new Set([`llm.model`,`llm.api_key`,`llm.base_url`,g,h]),oe={basic:new Set([`critical`]),advanced:new Set([`critical`,`major`]),all:new Set([`critical`,`major`,`minor`])};function N(e){return!!e&&Array.isArray(e.sections)}function P(e){return N(e)?e.sections.flatMap(e=>e.fields):[]}function F(e,t){if(!e)return;let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r}function I(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(i[t]==null||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}function L(e,t,n=`agent_settings`){return F(e[n],t)??null}function R(e,t){return L(e,t,`agent_settings`)}function z(e){return e.choices.length>0}function B(e){return e.prominence===`critical`}function V(e){return e.prominence===`minor`}function H(e,t){let n=t??e.default;return z(e)?n==null?``:String(n):e.value_type===`boolean`?!!(n??!1):n==null?``:e.value_type===`array`||e.value_type===`object`?JSON.stringify(n,null,2):String(n)}function U(e){return typeof e!=`object`||!e?JSON.stringify(e):Array.isArray(e)?`[${e.map(U).join(`,`)}]`:`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${U(t)}`).join(`,`)}}`}function W(e,t){if(t===void 0)return null;if(e.value_type===`boolean`){if(typeof t==`string`){if(t===`true`)return!0;if(t===`false`)return!1}return t===null?null:!!t}if(e.value_type===`integer`||e.value_type===`number`){if(t===``||t===null)return null;let e=typeof t==`number`?t:Number(String(t));return Number.isNaN(e)?null:e}if(e.value_type===`array`||e.value_type===`object`){if(t===null||e.value_type===`object`&&typeof t==`object`&&!Array.isArray(t)&&Object.keys(t).length===0)return null;if(typeof t==`string`){let n=t.trim();if(!n)return null;try{let t=JSON.parse(n);return e.value_type===`object`&&typeof t==`object`&&t&&!Array.isArray(t)&&Object.keys(t).length===0?null:U(t)}catch{return n}}return U(t)}return t===null?null:String(t)}function G(e,t,n=`agent_settings`){let r=t??(n===`conversation_settings`?e.conversation_settings_schema:e.agent_settings_schema);return r?Object.fromEntries(P(r).map(t=>[t.key,H(t,L(e,t.key,n))])):{}}function K(e,t,n=`agent_settings`){let r=t??(n===`conversation_settings`?e.conversation_settings_schema:e.agent_settings_schema);if(!r)return`basic`;let i=!1,a=!1;for(let t of P(r))B(t)||W(t,L(e,t.key,n)??t.default??null)!==W(t,t.default??null)&&(V(t)?i=!0:a=!0);return i?`all`:a?`advanced`:`basic`}function q(e,t){return e.depends_on.every(e=>t[e]===!0)}function J(e){if(typeof e==`boolean`)return e;let t=e.trim().toLowerCase();if(!t)return null;if(t===`true`)return!0;if(t===`false`)return!1;throw Error(`Expected a boolean value, received: ${e}`)}function Y(e,t){if(e.value_type===`boolean`)return J(t);if(e.value_type===`integer`||e.value_type===`number`){let n=String(t).trim();if(!n)return null;let r=Number(n);if(Number.isNaN(r))throw Error(`Expected a numeric value, received: ${n}`);if(e.value_type===`integer`&&!Number.isInteger(r))throw Error(`Expected an integer value, received: ${n}`);let i=k(e.key);if(i?.min!=null&&r<i.min)throw Error(`${e.label} must be at least ${i.min}`);if(i?.max!=null&&r>i.max)throw Error(`${e.label} must be at most ${i.max}`);return r}if(e.value_type===`array`||e.value_type===`object`){let n=String(t).trim();if(!n)return null;let r;try{r=JSON.parse(n)}catch{throw Error(`Invalid JSON for ${e.label}`)}if(e.value_type===`array`){if(!Array.isArray(r))throw Error(`${e.label} must be a JSON array`);return r}if(r===null||Array.isArray(r)||typeof r!=`object`)throw Error(`${e.label} must be a JSON object`);return r}let n=String(t);return n===``&&!e.secret?null:n}function X(e,t,n){let r={};for(let i of P(e))n[i.key]&&I(r,i.key,Y(i,t[i.key]));return r}function Z(e,t){return oe[t].has(e.prominence)}function se(e,t,n,r){let i=X(e,t,n);for(let t of P(e))Z(t,r)||I(i,t.key,t.default??null);return i}function ce(e,t,n,r=ae){return N(e)?e.sections.map(e=>({...e,fields:e.fields.filter(e=>!r.has(e.key)&&Z(e,n)&&q(e,t))})).filter(e=>e.fields.length>0):[]}function le(e){return e?P(e).some(e=>e.prominence===`critical`):!1}function ue(e){return e?P(e).some(e=>e.prominence===`major`):!1}function de(e){return e?P(e).some(e=>e.prominence===`minor`):!1}var fe={"llm.api_key":{textKey:`SCHEMA$LLM$API_KEY$HELP_TEXT`,linkTextKey:`SCHEMA$LLM$API_KEY$HELP_LINK_TEXT`,href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`},"verification.critic_api_key":{textKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_TEXT`,linkTextKey:`SETTINGS$OPENHANDS_API_KEY_HELP_LINK`,suffixKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_SUFFIX`,href:`https://app.all-hands.dev/settings/api-keys`,hideDescription:!0}};function Q({field:e}){let{t}=i(`openhands`),n=fe[e.key],r=M(t,e.key,e.description);return(0,x.jsxs)(x.Fragment,{children:[r&&!n?.hideDescription?(0,x.jsx)(v.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,x.jsx)(C,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,suffix:n.suffixKey?` ${t(n.suffixKey)}`:void 0,size:`settings`,linkColor:`white`}):null]})}var pe=new Set([`verification.critic_api_key`]);function $(e){return e.choices.length>0}function me(e){return e.value_type===`boolean`&&!$(e)}function he(e){return e.value_type===`array`||e.value_type===`object`}function ge(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function _e(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&ge(e)?`url`:`text`}function ve({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),s=j(a,e.key,e.label),c=k(e.key);return me(e)?(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(y,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:s}),(0,x.jsx)(`div`,{className:l,children:(0,x.jsx)(Q,{field:e})})]}):$(e)?(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(d,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,items:e.choices.map(t=>({key:String(t.value),label:ie(a,e.key,t.value,t.label)})),selectedKey:t===``?void 0:String(t),isClearable:!e.required,required:e.required,showOptionalTag:!e.required,isDisabled:n,onSelectionChange:e=>r(String(e??``))}),(0,x.jsx)(Q,{field:e})]}):he(e)?(0,x.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-sm`,children:s}),e.required?null:(0,x.jsx)(p,{})]}),(0,x.jsx)(`textarea`,{"data-testid":`sdk-settings-${e.key}`,name:e.key,value:String(t??``),required:e.required,disabled:n,onChange:e=>r(e.target.value),className:o(u,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,x.jsx)(Q,{field:e})]}):(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(m,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,type:_e(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:c?.min,max:c?.max,step:c?.step}),(0,x.jsx)(Q,{field:e})]})}export{j as _,se as a,C as b,ce as c,de as d,K as f,M as g,H as h,X as i,ue as l,W as m,ve as n,Y as o,N as p,G as r,R as s,pe as t,le as u,E as v,ne as y};
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"./useQuery-DAAacS7O.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{n as a}from"./active-backend-context-BETEdaJl.js";import{t as o}from"./utils-CbjwNcR-.js";import{p as s}from"./agent-server-client-options-EHB23gyx.js";import{t as c}from"./settings-service.api-CYBTLGOd.js";import{h as l,l as u}from"./form-control-classes-BVI_szaj.js";import{t as d}from"./settings-dropdown-input-Df_HXRk4.js";import{t as f}from"./dist-Bl64nBZL.js";import{n as p,t as m}from"./settings-input-B3i5U9GL.js";import{a as h,i as ee,n as g}from"./llm-subscription-DTqtBCWz.js";import{t as _}from"./use-is-authed-A2Yinlt0.js";import{r as v}from"./typography-BdAApXGl.js";import{t as y}from"./settings-switch-CI93Iozg.js";var b=e(t(),1),x=n(),S=f(``,{variants:{size:{default:`text-xs`,settings:`text-sm text-[var(--oh-muted)] font-normal leading-5.5`},linkColor:{default:``,white:`text-white`}},defaultVariants:{size:`default`,linkColor:`default`}});function C({testId:e,text:t,linkText:n,href:r,suffix:i,suffixLinkText:a,suffixLinkHref:s,trailing:c,size:l,linkColor:u,className:d,linkTextClassName:f,suffixClassName:p}){return(0,x.jsxs)(`p`,{"data-testid":e,className:o(S({size:l}),d),children:[t,` `,(0,x.jsx)(`a`,{href:r,rel:`noreferrer noopener`,target:`_blank`,className:o(`underline underline-offset-2`,S({size:l,linkColor:u}),f),children:n}),i&&(0,x.jsx)(`span`,{className:p,children:i}),a&&s?(0,x.jsxs)(x.Fragment,{children:[` `,(0,x.jsx)(`a`,{href:s,rel:`noreferrer noopener`,target:`_blank`,className:o(`underline underline-offset-2`,S({size:l,linkColor:u}),f),children:a}),c]}):null]})}var te=`llm`;function w(e){if(!e?.sections)return e;let t=!1,n=e.sections.map(e=>{if(e.key!==te)return e;let n=new Set(e.fields.map(e=>e.key)),r=ee.filter(e=>!n.has(e.key));return r.length===0?e:(t=!0,{...e,fields:[...e.fields,...r]})});return t?{...e,sections:n}:e}var T=(e,t)=>{let{data:n}=_(),{backend:i,orgId:o}=a(),l=!s(i),{data:u,error:d,isLoading:f,isFetching:p}=r({queryKey:[`settings-schema`,e,i.id,o,i.kind,i.host,i.apiKey],queryFn:e===`conversation`?c.getConversationSettingsSchema:c.getSettingsSchema,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,enabled:!t&&!!n&&l,meta:{disableToast:!0}}),m=(0,b.useMemo)(()=>e===`agent`?w(t):t,[t,e]),h=(0,b.useMemo)(()=>e===`agent`?w(u):u,[u,e]);return t?{data:m,error:null,isLoading:!1,isFetching:!1}:{data:h,error:d,isLoading:f,isFetching:p}},E=e=>T(`agent`,e),ne=e=>T(`conversation`,e);function re(e,t){return`SCHEMA$${e.replace(/\./g,`$`).toUpperCase()}$${t}`}var D=e=>!!e?.includes(`$`),O={tool_concurrency_limit:{constraints:{min:1,step:1}},"llm.top_p":{constraints:{min:0,max:1,step:.01}},"llm.temperature":{constraints:{min:0,max:2,step:.1}}};function k(e){return O[e]?.constraints}function A(e,t,n,r){if(D(r))return e(r);let i=re(t,n);return e(i,{defaultValue:``})||(r&&console.warn(`[i18n] Missing translation for key "${i}", falling back to: "${r}"`),r??null)}function j(e,t,n){return A(e,t,`LABEL`,n)??``}function M(e,t,n){return A(e,t,`DESCRIPTION`,n)}function ie(e,t,n,r){if(D(r))return e(r);let i=`SCHEMA$${t.replace(/\./g,`$`).toUpperCase()}$CHOICE$${String(n).toUpperCase()}`;return e(i,{defaultValue:``})||(console.warn(`[i18n] Missing translation for key "${i}", falling back to: "${r}"`),r)}var ae=new Set([`llm.model`,`llm.api_key`,`llm.base_url`,g,h]),oe={basic:new Set([`critical`]),advanced:new Set([`critical`,`major`]),all:new Set([`critical`,`major`,`minor`])};function N(e){return!!e&&Array.isArray(e.sections)}function P(e){return N(e)?e.sections.flatMap(e=>e.fields):[]}function F(e,t){if(!e)return;let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r}function I(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(i[t]==null||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}function L(e,t,n=`agent_settings`){return F(e[n],t)??null}function R(e,t){return L(e,t,`agent_settings`)}function z(e){return e.choices.length>0}function B(e){return e.prominence===`critical`}function V(e){return e.prominence===`minor`}function H(e,t){let n=t??e.default;return z(e)?n==null?``:String(n):e.value_type===`boolean`?!!(n??!1):n==null?``:e.value_type===`array`||e.value_type===`object`?JSON.stringify(n,null,2):String(n)}function U(e){return typeof e!=`object`||!e?JSON.stringify(e):Array.isArray(e)?`[${e.map(U).join(`,`)}]`:`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${U(t)}`).join(`,`)}}`}function W(e,t){if(t===void 0)return null;if(e.value_type===`boolean`){if(typeof t==`string`){if(t===`true`)return!0;if(t===`false`)return!1}return t===null?null:!!t}if(e.value_type===`integer`||e.value_type===`number`){if(t===``||t===null)return null;let e=typeof t==`number`?t:Number(String(t));return Number.isNaN(e)?null:e}if(e.value_type===`array`||e.value_type===`object`){if(t===null||e.value_type===`object`&&typeof t==`object`&&!Array.isArray(t)&&Object.keys(t).length===0)return null;if(typeof t==`string`){let n=t.trim();if(!n)return null;try{let t=JSON.parse(n);return e.value_type===`object`&&typeof t==`object`&&t&&!Array.isArray(t)&&Object.keys(t).length===0?null:U(t)}catch{return n}}return U(t)}return t===null?null:String(t)}function G(e,t,n=`agent_settings`){let r=t??(n===`conversation_settings`?e.conversation_settings_schema:e.agent_settings_schema);return r?Object.fromEntries(P(r).map(t=>[t.key,H(t,L(e,t.key,n))])):{}}function K(e,t,n=`agent_settings`){let r=t??(n===`conversation_settings`?e.conversation_settings_schema:e.agent_settings_schema);if(!r)return`basic`;let i=!1,a=!1;for(let t of P(r))B(t)||W(t,L(e,t.key,n)??t.default??null)!==W(t,t.default??null)&&(V(t)?i=!0:a=!0);return i?`all`:a?`advanced`:`basic`}function q(e,t){return e.depends_on.every(e=>t[e]===!0)}function J(e){if(typeof e==`boolean`)return e;let t=e.trim().toLowerCase();if(!t)return null;if(t===`true`)return!0;if(t===`false`)return!1;throw Error(`Expected a boolean value, received: ${e}`)}function Y(e,t){if(e.value_type===`boolean`)return J(t);if(e.value_type===`integer`||e.value_type===`number`){let n=String(t).trim();if(!n)return null;let r=Number(n);if(Number.isNaN(r))throw Error(`Expected a numeric value, received: ${n}`);if(e.value_type===`integer`&&!Number.isInteger(r))throw Error(`Expected an integer value, received: ${n}`);let i=k(e.key);if(i?.min!=null&&r<i.min)throw Error(`${e.label} must be at least ${i.min}`);if(i?.max!=null&&r>i.max)throw Error(`${e.label} must be at most ${i.max}`);return r}if(e.value_type===`array`||e.value_type===`object`){let n=String(t).trim();if(!n)return null;let r;try{r=JSON.parse(n)}catch{throw Error(`Invalid JSON for ${e.label}`)}if(e.value_type===`array`){if(!Array.isArray(r))throw Error(`${e.label} must be a JSON array`);return r}if(r===null||Array.isArray(r)||typeof r!=`object`)throw Error(`${e.label} must be a JSON object`);return r}let n=String(t);return n===``&&!e.secret?null:n}function X(e,t,n){let r={};for(let i of P(e))n[i.key]&&I(r,i.key,Y(i,t[i.key]));return r}function Z(e,t){return oe[t].has(e.prominence)}function se(e,t,n,r){let i=X(e,t,n);for(let t of P(e))Z(t,r)||I(i,t.key,t.default??null);return i}function ce(e,t,n,r=ae){return N(e)?e.sections.map(e=>({...e,fields:e.fields.filter(e=>!r.has(e.key)&&Z(e,n)&&q(e,t))})).filter(e=>e.fields.length>0):[]}function le(e){return e?P(e).some(e=>e.prominence===`critical`):!1}function ue(e){return e?P(e).some(e=>e.prominence===`major`):!1}function de(e){return e?P(e).some(e=>e.prominence===`minor`):!1}var fe={"llm.api_key":{textKey:`SCHEMA$LLM$API_KEY$HELP_TEXT`,linkTextKey:`SCHEMA$LLM$API_KEY$HELP_LINK_TEXT`,href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`},"verification.critic_api_key":{textKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_TEXT`,linkTextKey:`SETTINGS$OPENHANDS_API_KEY_HELP_LINK`,suffixKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_SUFFIX`,href:`https://app.all-hands.dev/settings/api-keys`,hideDescription:!0}};function Q({field:e}){let{t}=i(`openhands`),n=fe[e.key],r=M(t,e.key,e.description);return(0,x.jsxs)(x.Fragment,{children:[r&&!n?.hideDescription?(0,x.jsx)(v.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,x.jsx)(C,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,suffix:n.suffixKey?` ${t(n.suffixKey)}`:void 0,size:`settings`,linkColor:`white`}):null]})}var pe=new Set([`verification.critic_api_key`]);function $(e){return e.choices.length>0}function me(e){return e.value_type===`boolean`&&!$(e)}function he(e){return e.value_type===`array`||e.value_type===`object`}function ge(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function _e(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&ge(e)?`url`:`text`}function ve({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),s=j(a,e.key,e.label),c=k(e.key);return me(e)?(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(y,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:s}),(0,x.jsx)(`div`,{className:l,children:(0,x.jsx)(Q,{field:e})})]}):$(e)?(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(d,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,items:e.choices.map(t=>({key:String(t.value),label:ie(a,e.key,t.value,t.label)})),selectedKey:t===``?void 0:String(t),isClearable:!e.required,required:e.required,showOptionalTag:!e.required,isDisabled:n,onSelectionChange:e=>r(String(e??``))}),(0,x.jsx)(Q,{field:e})]}):he(e)?(0,x.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-sm`,children:s}),e.required?null:(0,x.jsx)(p,{})]}),(0,x.jsx)(`textarea`,{"data-testid":`sdk-settings-${e.key}`,name:e.key,value:String(t??``),required:e.required,disabled:n,onChange:e=>r(e.target.value),className:o(u,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,x.jsx)(Q,{field:e})]}):(0,x.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,x.jsx)(m,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,type:_e(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:c?.min,max:c?.max,step:c?.step}),(0,x.jsx)(Q,{field:e})]})}export{j as _,se as a,C as b,ce as c,de as d,K as f,M as g,H as h,X as i,ue as l,W as m,ve as n,Y as o,N as p,G as r,R as s,pe as t,le as u,E as v,ne as y};
@@ -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{s as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{ct as a,dt as o,st as s}from"./active-backend-context-BnH4-L8h.js";import{K as c,t as l}from"./utils-BgLSZdyy.js";import{n as ee}from"./use-settings-C2KKQKVC.js";import{t as te}from"./use-save-settings-Dapkf4cC.js";import{_ as u}from"./form-control-classes-Dbq-7YP_.js";import{t as ne}from"./brand-button-CUMfjb99.js";import{a as re,c as ie,d as ae,f as oe,i as se,l as ce,m as d,n as le,p as ue,r as de,t as fe,u as pe,v as me,y as he}from"./schema-field-Y3F8JvXd.js";import{n as f,t as p}from"./switch-skeleton-DwOoCqaL.js";import{o as ge}from"./extension-module-card-classes-DpeaYhYo.js";var m=e(t(),1),h=n();function g(){return(0,h.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function _(){return(0,h.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,h.jsx)(p,{}),(0,h.jsx)(f,{}),(0,h.jsx)(f,{}),(0,h.jsx)(f,{}),(0,h.jsx)(g,{}),(0,h.jsx)(p,{}),(0,h.jsx)(p,{}),(0,h.jsx)(f,{})]})}var v=(e,t)=>l(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,u,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function _e({view:e,setView:t,showBasic:n=!0,showAdvanced:r,showAll:a,isDisabled:o=!1}){let{t:s}=i(`openhands`);return[n,r,a].filter(Boolean).length<=1?null:(0,h.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[n?(0,h.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:v(e===`basic`,o),onClick:()=>t(`basic`),children:s(c.SETTINGS$BASIC)}):null,r?(0,h.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:v(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(c.SETTINGS$ADVANCED)}):null,a?(0,h.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:v(e===`all`,o),onClick:()=>t(`all`),children:s(c.SETTINGS$ALL)}):null]})}var ve=new Set,y={basic:0,advanced:1,all:2},ye=(e,t)=>y[t]<y[e]?t:e,be=(e,t)=>y[t]>y[e]?t:e,xe=(e,{showBasic:t,showAdvanced:n,showAll:r})=>{if(e===`all`)return r?`all`:n?`advanced`:`basic`;if(e===`advanced`)return n?`advanced`:r?`all`:`basic`;if(!t){if(n)return`advanced`;if(r)return`all`}return`basic`},Se={agent_settings:`agent_settings_diff`,conversation_settings:`conversation_settings_diff`},Ce=(e,t)=>e instanceof r?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function b({settingsSources:e,scope:t=`personal`,header:n,extraDirty:r=!1,buildPayload:l,onSaveSuccess:u,getInitialView:f,forceShowAdvancedView:p=!1,allowAllView:g=!0,initialValueOverrides:v,markInitialOverridesDirty:y=!0,embedded:b=!1,hideSaveButton:x=!1,suppressSuccessToast:we=!1,onSaveControlChange:S,testId:Te=`sdk-section-settings-screen`}){let{t:C}=i(`openhands`),{mutate:Ee,isPending:w}=te(t),{data:T,isLoading:De,isFetching:Oe}=ee(t),E=me(T?.agent_settings_schema),D=he(T?.conversation_settings_schema),O=m.useMemo(()=>JSON.stringify(e.map(e=>({source:e.settingsSource,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?Array.from(e.excludeKeys).sort():null}))),[e]),k=m.useMemo(()=>JSON.parse(O).map(e=>({settingsSource:e.source,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?new Set(e.excludeKeys):void 0})),[O]),A=m.useCallback(e=>e===`conversation_settings`?D.data:E.data,[E.data,D.data]),ke=k.some(e=>e.settingsSource===`conversation_settings`?D.isLoading:E.isLoading),j=m.useMemo(()=>k.map(e=>{let t=A(e.settingsSource);if(!ue(t))return{...e,filteredSchema:null};let n=new Set(e.sectionKeys),r=new Set,i={...t,sections:t.sections.filter(e=>!n.has(e.key)||r.has(e.key)?!1:(r.add(e.key),!0))};return{...e,filteredSchema:i}}),[k,A]),M=j.some(e=>pe(e.filteredSchema)),N=p||j.some(e=>ce(e.filteredSchema)),P=g&&j.some(e=>ae(e.filteredSchema)),Ae=m.useMemo(()=>Ce(k.reduce((e,t)=>e??(t.settingsSource===`conversation_settings`?D.error:E.error),null),C(c.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[k,E.error,D.error,C]),F=m.useMemo(()=>v?JSON.stringify(v):``,[v]),I=j[0]?.settingsSource,[L,R]=m.useState(`basic`),[z,B]=m.useState({}),[V,H]=m.useState({}),U=m.useRef(!1),W=m.useMemo(()=>{if(!T)return null;let e={};for(let t of j){if(!t.filteredSchema)return null;e[t.settingsSource]={...e[t.settingsSource]??{},...de(T,t.filteredSchema,t.settingsSource)}}if(v){let t=j[0]?.settingsSource;t&&e[t]&&(e[t]={...e[t],...v})}return e},[T,j,F]),G=m.useMemo(()=>{if(!T)return null;let e=null;for(let t of j){if(!t.filteredSchema)return null;let n=f?f(T,t.filteredSchema):oe(T,t.filteredSchema,t.settingsSource);e=e?be(e,n):n}return e?xe(e,{showBasic:M,showAdvanced:N,showAll:P}):null},[T,j,f,M,N,P]);m.useEffect(()=>{U.current=!1,R(`basic`),B({}),H({})},[t,O]),m.useEffect(()=>{if(!(!W||!G)&&!(x&&U.current)){if(B(W),v&&y){let e=I;if(e){let t=Object.fromEntries(Object.keys(v).map(e=>[e,!0]));H({[e]:t})}else H({})}else H({});U.current?R(e=>ye(e,G)):(U.current=!0,R(G))}},[W,G,F,y,I,x]);let K=m.useMemo(()=>{let e=new Map;for(let t of j)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let r of n.fields)e.has(r.key)||e.set(r.key,t.settingsSource);return e},[j]),q=m.useMemo(()=>{let e={};for(let t of j)Object.assign(e,z[t.settingsSource]??{});return e},[j,z]),J=m.useMemo(()=>{let e={};for(let t of j)Object.assign(e,V[t.settingsSource]??{});return e},[j,V]),Y=m.useMemo(()=>{let e=new Map;for(let t of j)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let t of n.fields)e.has(t.key)||e.set(t.key,t);return e},[j]),X=m.useRef(W);X.current=W;let Z=m.useRef(v);Z.current=v;let Q=m.useRef(y);Q.current=y;let je=m.useRef(Y);je.current=Y;let Me=m.useCallback((e,t)=>{let n=K.get(e)??j[0]?.settingsSource;n&&(B(r=>({...r,[n]:{...r[n]??{},[e]:t}})),H(r=>{let i=X.current?.[n]?.[e],a=Q.current&&!!Z.current&&e in Z.current,o=je.current.get(e);if((o?d(o,t)===d(o,i):t===i)&&!a){if(!r[n]?.[e])return r;let t={...r[n]??{}};return delete t[e],{...r,[n]:t}}return r[n]?.[e]?r:{...r,[n]:{...r[n]??{},[e]:!0}}}))},[K,j]),Ne=m.useCallback(e=>{s(o(e)||C(c.ERROR$GENERIC))},[C]),Pe=m.useRef(()=>{}),Fe=m.useCallback(()=>{Pe.current()},[]),Ie=m.useRef(()=>({})),Le=m.useCallback(()=>Ie.current(),[]),Re=()=>{if(j.some(e=>!e.filteredSchema))return;let e;try{let t={};for(let e of j){let n=e.filteredSchema,r=re(n,z[e.settingsSource]??{},V[e.settingsSource]??{},L);if(Object.keys(r).length>0){let n=Se[e.settingsSource];t[n]={...t[n]??{},...r}}}e=l?l(t,{values:q,dirty:J,view:L}):t}catch(e){s(e instanceof Error?e.message:C(c.ERROR$GENERIC));return}Object.keys(e).length!==0&&Ee(e,{onError:Ne,onSuccess:()=>{we||a(C(c.SETTINGS$SAVED_WARNING)),H({}),u?.()}})};Pe.current=Re,Ie.current=()=>{let e={};for(let t of j){if(!t.filteredSchema)continue;let n=z[t.settingsSource]??{},r=V[t.settingsSource]??{};Object.assign(e,se(t.filteredSchema,n,r))}return e};let ze=Object.keys(J).length>0,$=ze||r;return m.useEffect(()=>{S&&S({save:Fe,isSaving:w,isDirty:$,values:q,view:L,getDirtyPayload:Le})},[w,$,q,L]),(De||Oe)&&!T||ke?(0,h.jsx)(_,{}):j.some(e=>e.filteredSchema&&e.filteredSchema.sections.length>0)?Object.keys(q).length===0?(0,h.jsx)(_,{}):(0,h.jsxs)(`div`,{"data-testid":Te,className:b?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,h.jsx)(_e,{view:L,setView:R,showBasic:M,showAdvanced:N,showAll:P,isDisabled:!1}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[n?.({values:q,isDisabled:!1,view:L,onChange:Me}),j.map(e=>{if(!e.filteredSchema)return null;let t=z[e.settingsSource]??{};return ie(e.filteredSchema,{...q,...t},L,e.excludeKeys??ve).map(n=>(0,h.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,h.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:n.fields.map(e=>(0,h.jsx)(`div`,{className:fe.has(e.key)?`xl:col-span-2`:void 0,children:(0,h.jsx)(le,{field:e,value:t[e.key],isDisabled:!1,onChange:t=>Me(e.key,t)})},e.key))})},`${e.settingsSource}:${n.key}`))}),x?null:(0,h.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,h.jsx)(ne,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:w||!ze&&!r,onClick:Re,children:C(w?c.SETTINGS$SAVING:c.SETTINGS$SAVE_CHANGES)})})]})]}):(0,h.jsx)(`div`,{"data-testid":`sdk-schema-unavailable`,className:ge,children:(0,h.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:Ae})})}export{_ as n,b 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{s as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{ct as a,dt as o,st as s}from"./active-backend-context-BETEdaJl.js";import{K as c,t as l}from"./utils-CbjwNcR-.js";import{n as ee}from"./use-settings-D69cw06D.js";import{t as te}from"./use-save-settings-CmX41wlf.js";import{_ as u}from"./form-control-classes-BVI_szaj.js";import{t as ne}from"./brand-button-CGUwj6zK.js";import{a as re,c as ie,d as ae,f as oe,i as se,l as ce,m as d,n as le,p as ue,r as de,t as fe,u as pe,v as me,y as he}from"./schema-field-DSi0d7a8.js";import{n as f,t as p}from"./switch-skeleton-DwOoCqaL.js";import{o as ge}from"./extension-module-card-classes-DpeaYhYo.js";var m=e(t(),1),h=n();function g(){return(0,h.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function _(){return(0,h.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,h.jsx)(p,{}),(0,h.jsx)(f,{}),(0,h.jsx)(f,{}),(0,h.jsx)(f,{}),(0,h.jsx)(g,{}),(0,h.jsx)(p,{}),(0,h.jsx)(p,{}),(0,h.jsx)(f,{})]})}var v=(e,t)=>l(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,u,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function _e({view:e,setView:t,showBasic:n=!0,showAdvanced:r,showAll:a,isDisabled:o=!1}){let{t:s}=i(`openhands`);return[n,r,a].filter(Boolean).length<=1?null:(0,h.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[n?(0,h.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:v(e===`basic`,o),onClick:()=>t(`basic`),children:s(c.SETTINGS$BASIC)}):null,r?(0,h.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:v(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(c.SETTINGS$ADVANCED)}):null,a?(0,h.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:v(e===`all`,o),onClick:()=>t(`all`),children:s(c.SETTINGS$ALL)}):null]})}var ve=new Set,y={basic:0,advanced:1,all:2},ye=(e,t)=>y[t]<y[e]?t:e,be=(e,t)=>y[t]>y[e]?t:e,xe=(e,{showBasic:t,showAdvanced:n,showAll:r})=>{if(e===`all`)return r?`all`:n?`advanced`:`basic`;if(e===`advanced`)return n?`advanced`:r?`all`:`basic`;if(!t){if(n)return`advanced`;if(r)return`all`}return`basic`},Se={agent_settings:`agent_settings_diff`,conversation_settings:`conversation_settings_diff`},Ce=(e,t)=>e instanceof r?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function b({settingsSources:e,scope:t=`personal`,header:n,extraDirty:r=!1,buildPayload:l,onSaveSuccess:u,getInitialView:f,forceShowAdvancedView:p=!1,allowAllView:g=!0,initialValueOverrides:v,markInitialOverridesDirty:y=!0,embedded:b=!1,hideSaveButton:x=!1,suppressSuccessToast:we=!1,onSaveControlChange:S,testId:Te=`sdk-section-settings-screen`}){let{t:C}=i(`openhands`),{mutate:Ee,isPending:w}=te(t),{data:T,isLoading:De,isFetching:Oe}=ee(t),E=me(T?.agent_settings_schema),D=he(T?.conversation_settings_schema),O=m.useMemo(()=>JSON.stringify(e.map(e=>({source:e.settingsSource,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?Array.from(e.excludeKeys).sort():null}))),[e]),k=m.useMemo(()=>JSON.parse(O).map(e=>({settingsSource:e.source,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?new Set(e.excludeKeys):void 0})),[O]),A=m.useCallback(e=>e===`conversation_settings`?D.data:E.data,[E.data,D.data]),ke=k.some(e=>e.settingsSource===`conversation_settings`?D.isLoading:E.isLoading),j=m.useMemo(()=>k.map(e=>{let t=A(e.settingsSource);if(!ue(t))return{...e,filteredSchema:null};let n=new Set(e.sectionKeys),r=new Set,i={...t,sections:t.sections.filter(e=>!n.has(e.key)||r.has(e.key)?!1:(r.add(e.key),!0))};return{...e,filteredSchema:i}}),[k,A]),M=j.some(e=>pe(e.filteredSchema)),N=p||j.some(e=>ce(e.filteredSchema)),P=g&&j.some(e=>ae(e.filteredSchema)),Ae=m.useMemo(()=>Ce(k.reduce((e,t)=>e??(t.settingsSource===`conversation_settings`?D.error:E.error),null),C(c.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[k,E.error,D.error,C]),F=m.useMemo(()=>v?JSON.stringify(v):``,[v]),I=j[0]?.settingsSource,[L,R]=m.useState(`basic`),[z,B]=m.useState({}),[V,H]=m.useState({}),U=m.useRef(!1),W=m.useMemo(()=>{if(!T)return null;let e={};for(let t of j){if(!t.filteredSchema)return null;e[t.settingsSource]={...e[t.settingsSource]??{},...de(T,t.filteredSchema,t.settingsSource)}}if(v){let t=j[0]?.settingsSource;t&&e[t]&&(e[t]={...e[t],...v})}return e},[T,j,F]),G=m.useMemo(()=>{if(!T)return null;let e=null;for(let t of j){if(!t.filteredSchema)return null;let n=f?f(T,t.filteredSchema):oe(T,t.filteredSchema,t.settingsSource);e=e?be(e,n):n}return e?xe(e,{showBasic:M,showAdvanced:N,showAll:P}):null},[T,j,f,M,N,P]);m.useEffect(()=>{U.current=!1,R(`basic`),B({}),H({})},[t,O]),m.useEffect(()=>{if(!(!W||!G)&&!(x&&U.current)){if(B(W),v&&y){let e=I;if(e){let t=Object.fromEntries(Object.keys(v).map(e=>[e,!0]));H({[e]:t})}else H({})}else H({});U.current?R(e=>ye(e,G)):(U.current=!0,R(G))}},[W,G,F,y,I,x]);let K=m.useMemo(()=>{let e=new Map;for(let t of j)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let r of n.fields)e.has(r.key)||e.set(r.key,t.settingsSource);return e},[j]),q=m.useMemo(()=>{let e={};for(let t of j)Object.assign(e,z[t.settingsSource]??{});return e},[j,z]),J=m.useMemo(()=>{let e={};for(let t of j)Object.assign(e,V[t.settingsSource]??{});return e},[j,V]),Y=m.useMemo(()=>{let e=new Map;for(let t of j)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let t of n.fields)e.has(t.key)||e.set(t.key,t);return e},[j]),X=m.useRef(W);X.current=W;let Z=m.useRef(v);Z.current=v;let Q=m.useRef(y);Q.current=y;let je=m.useRef(Y);je.current=Y;let Me=m.useCallback((e,t)=>{let n=K.get(e)??j[0]?.settingsSource;n&&(B(r=>({...r,[n]:{...r[n]??{},[e]:t}})),H(r=>{let i=X.current?.[n]?.[e],a=Q.current&&!!Z.current&&e in Z.current,o=je.current.get(e);if((o?d(o,t)===d(o,i):t===i)&&!a){if(!r[n]?.[e])return r;let t={...r[n]??{}};return delete t[e],{...r,[n]:t}}return r[n]?.[e]?r:{...r,[n]:{...r[n]??{},[e]:!0}}}))},[K,j]),Ne=m.useCallback(e=>{s(o(e)||C(c.ERROR$GENERIC))},[C]),Pe=m.useRef(()=>{}),Fe=m.useCallback(()=>{Pe.current()},[]),Ie=m.useRef(()=>({})),Le=m.useCallback(()=>Ie.current(),[]),Re=()=>{if(j.some(e=>!e.filteredSchema))return;let e;try{let t={};for(let e of j){let n=e.filteredSchema,r=re(n,z[e.settingsSource]??{},V[e.settingsSource]??{},L);if(Object.keys(r).length>0){let n=Se[e.settingsSource];t[n]={...t[n]??{},...r}}}e=l?l(t,{values:q,dirty:J,view:L}):t}catch(e){s(e instanceof Error?e.message:C(c.ERROR$GENERIC));return}Object.keys(e).length!==0&&Ee(e,{onError:Ne,onSuccess:()=>{we||a(C(c.SETTINGS$SAVED_WARNING)),H({}),u?.()}})};Pe.current=Re,Ie.current=()=>{let e={};for(let t of j){if(!t.filteredSchema)continue;let n=z[t.settingsSource]??{},r=V[t.settingsSource]??{};Object.assign(e,se(t.filteredSchema,n,r))}return e};let ze=Object.keys(J).length>0,$=ze||r;return m.useEffect(()=>{S&&S({save:Fe,isSaving:w,isDirty:$,values:q,view:L,getDirtyPayload:Le})},[w,$,q,L]),(De||Oe)&&!T||ke?(0,h.jsx)(_,{}):j.some(e=>e.filteredSchema&&e.filteredSchema.sections.length>0)?Object.keys(q).length===0?(0,h.jsx)(_,{}):(0,h.jsxs)(`div`,{"data-testid":Te,className:b?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,h.jsx)(_e,{view:L,setView:R,showBasic:M,showAdvanced:N,showAll:P,isDisabled:!1}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[n?.({values:q,isDisabled:!1,view:L,onChange:Me}),j.map(e=>{if(!e.filteredSchema)return null;let t=z[e.settingsSource]??{};return ie(e.filteredSchema,{...q,...t},L,e.excludeKeys??ve).map(n=>(0,h.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,h.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:n.fields.map(e=>(0,h.jsx)(`div`,{className:fe.has(e.key)?`xl:col-span-2`:void 0,children:(0,h.jsx)(le,{field:e,value:t[e.key],isDisabled:!1,onChange:t=>Me(e.key,t)})},e.key))})},`${e.settingsSource}:${n.key}`))}),x?null:(0,h.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,h.jsx)(ne,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:w||!ze&&!r,onClick:Re,children:C(w?c.SETTINGS$SAVING:c.SETTINGS$SAVE_CHANGES)})})]})]}):(0,h.jsx)(`div`,{"data-testid":`sdk-schema-unavailable`,className:ge,children:(0,h.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:Ae})})}export{_ as n,b 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{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{f as c,l}from"./form-control-classes-Dbq-7YP_.js";import{t as u}from"./brand-button-CUMfjb99.js";import{n as d,t as f}from"./settings-input-dVuzapBA.js";import{t as p}from"./secrets-service-BOIsfD9j.js";import{t as m}from"./use-get-secrets-CMTuWEp_.js";import{t as h}from"./use-create-secret-CjWq0J4O.js";var g=()=>i({mutationFn:e=>p.deleteSecret(e)}),_=e(t(),1),v=()=>i({mutationFn:({secretToEdit:e,name:t,description:n,value:r})=>p.updateSecret(e,t,n,r)}),y=n();function b({mode:e,selectedSecret:t,onCancel:n}){let i=r(),{t:p}=a(`openhands`),{data:g}=m(),{mutate:b}=h(),{mutate:x}=v(),[S,C]=_.useState(null),[w,T]=_.useState(e===`edit`&&t?t:``),[E,D]=_.useState(``),[O,k]=_.useState(``),A=e===`edit`&&t&&g?.find(e=>e.name===t)?.description?.trim()||``,j=e===`edit`&&t?t:``;_.useEffect(()=>{T(e===`edit`&&t?t:``),D(``),k(A),C(null)},[e,t,A]);let M=()=>{i.invalidateQueries({queryKey:[`secrets-search`]}),i.invalidateQueries({queryKey:[`secrets`]})},N=(e,t,r)=>{b({name:e,value:t,description:r},{onSettled:n,onSuccess:M})},P=(e,t,r,i)=>{x({secretToEdit:e,name:t,description:r,value:i},{onSettled:n,onSuccess:M})},F=n=>{n.preventDefault();let r=w.trim(),i=E.trim(),a=O||void 0;if(r){if(C(null),g?.some(e=>e.name===r&&e.name!==t)){C(p(o.SECRETS$SECRET_ALREADY_EXISTS));return}if(e===`add`){if(!i){C(p(o.SECRETS$SECRET_VALUE_REQUIRED));return}N(r,i,a)}else e===`edit`&&t&&P(t,r,a,i||void 0)}},I=e===`add`?`add-secret-form`:`edit-secret-form`,L=e===`edit`&&(w.trim()!==j.trim()||O!==A||E.trim()!==``),R=e===`add`?!w.trim()||!E.trim():e===`edit`?!L:!1;return(0,y.jsxs)(`form`,{"data-testid":I,onSubmit:F,className:`flex flex-col items-start gap-6`,children:[(0,y.jsx)(f,{testId:`name-input`,name:`secret-name`,type:`text`,label:p(o.SETTINGS$NAME),className:`w-full min-w-0`,required:!0,value:w,onChange:T,placeholder:p(o.SECRETS$API_KEY_EXAMPLE),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:p(o.SETTINGS$SECRET_NAME_PATTERN_TITLE)}),S&&(0,y.jsx)(`p`,{className:`text-red-500 text-sm`,children:S}),(0,y.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,y.jsx)(`span`,{className:`text-sm`,children:p(e===`add`?o.FORM$VALUE:o.SECRETS$SECRET_VALUE_LEAVE_BLANK)}),(0,y.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:e===`add`,value:E,onChange:e=>D(e.currentTarget.value),className:s(`resize-none`,l,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,y.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-sm`,children:p(o.FORM$DESCRIPTION)}),(0,y.jsx)(d,{})]}),(0,y.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,value:O,onChange:e=>k(e.currentTarget.value),className:s(c,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,y.jsx)(u,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:p(o.BUTTON$CANCEL)}),(0,y.jsxs)(u,{testId:`submit-button`,type:`submit`,variant:`primary`,isDisabled:R,children:[e===`add`&&p(o.SECRETS$ADD_SECRET),e===`edit`&&p(o.SECRETS$EDIT_SECRET)]})]})]})}export{g as n,b 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{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-CbjwNcR-.js";import{f as c,l}from"./form-control-classes-BVI_szaj.js";import{t as u}from"./brand-button-CGUwj6zK.js";import{n as d,t as f}from"./settings-input-B3i5U9GL.js";import{t as p}from"./secrets-service-C3CNNEpY.js";import{t as m}from"./use-get-secrets-Pbo9jh2A.js";import{t as h}from"./use-create-secret-D_qPU88t.js";var g=()=>i({mutationFn:e=>p.deleteSecret(e)}),_=e(t(),1),v=()=>i({mutationFn:({secretToEdit:e,name:t,description:n,value:r})=>p.updateSecret(e,t,n,r)}),y=n();function b({mode:e,selectedSecret:t,onCancel:n}){let i=r(),{t:p}=a(`openhands`),{data:g}=m(),{mutate:b}=h(),{mutate:x}=v(),[S,C]=_.useState(null),[w,T]=_.useState(e===`edit`&&t?t:``),[E,D]=_.useState(``),[O,k]=_.useState(``),A=e===`edit`&&t&&g?.find(e=>e.name===t)?.description?.trim()||``,j=e===`edit`&&t?t:``;_.useEffect(()=>{T(e===`edit`&&t?t:``),D(``),k(A),C(null)},[e,t,A]);let M=()=>{i.invalidateQueries({queryKey:[`secrets-search`]}),i.invalidateQueries({queryKey:[`secrets`]})},N=(e,t,r)=>{b({name:e,value:t,description:r},{onSettled:n,onSuccess:M})},P=(e,t,r,i)=>{x({secretToEdit:e,name:t,description:r,value:i},{onSettled:n,onSuccess:M})},F=n=>{n.preventDefault();let r=w.trim(),i=E.trim(),a=O||void 0;if(r){if(C(null),g?.some(e=>e.name===r&&e.name!==t)){C(p(o.SECRETS$SECRET_ALREADY_EXISTS));return}if(e===`add`){if(!i){C(p(o.SECRETS$SECRET_VALUE_REQUIRED));return}N(r,i,a)}else e===`edit`&&t&&P(t,r,a,i||void 0)}},I=e===`add`?`add-secret-form`:`edit-secret-form`,L=e===`edit`&&(w.trim()!==j.trim()||O!==A||E.trim()!==``),R=e===`add`?!w.trim()||!E.trim():e===`edit`?!L:!1;return(0,y.jsxs)(`form`,{"data-testid":I,onSubmit:F,className:`flex flex-col items-start gap-6`,children:[(0,y.jsx)(f,{testId:`name-input`,name:`secret-name`,type:`text`,label:p(o.SETTINGS$NAME),className:`w-full min-w-0`,required:!0,value:w,onChange:T,placeholder:p(o.SECRETS$API_KEY_EXAMPLE),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:p(o.SETTINGS$SECRET_NAME_PATTERN_TITLE)}),S&&(0,y.jsx)(`p`,{className:`text-red-500 text-sm`,children:S}),(0,y.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,y.jsx)(`span`,{className:`text-sm`,children:p(e===`add`?o.FORM$VALUE:o.SECRETS$SECRET_VALUE_LEAVE_BLANK)}),(0,y.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:e===`add`,value:E,onChange:e=>D(e.currentTarget.value),className:s(`resize-none`,l,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,y.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-sm`,children:p(o.FORM$DESCRIPTION)}),(0,y.jsx)(d,{})]}),(0,y.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,value:O,onChange:e=>k(e.currentTarget.value),className:s(c,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,y.jsx)(u,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:p(o.BUTTON$CANCEL)}),(0,y.jsxs)(u,{testId:`submit-button`,type:`submit`,variant:`primary`,isDisabled:R,children:[e===`add`&&p(o.SECRETS$ADD_SECRET),e===`edit`&&p(o.SECRETS$EDIT_SECRET)]})]})]})}export{g as n,b as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{$ as t}from"./active-backend-context-BnH4-L8h.js";import{c as n,n as r}from"./agent-server-client-options-EHB23gyx.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as a}from"./proxy-XP6U1Dhv.js";async function o(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 s=100;function c(){let e=n().backend;if(e.kind!==`cloud`)throw Error(`Cloud secrets 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/secrets/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}async function u({name:e,value:t,description:n,previousName:r}){let i=c();r!==void 0&&await o(()=>a({backend:i,method:`PUT`,path:`/api/v1/secrets/${encodeURIComponent(r)}`,body:{name:e,description:n}})),t!==void 0&&await o(()=>a({backend:i,method:`POST`,path:`/api/v1/secrets`,body:{name:e,value:t,description:n}}))}async function d(e){await a({backend:c(),method:`DELETE`,path:`/api/v1/secrets/${encodeURIComponent(e)}`})}var f=e({SecretsService:()=>m});async function p(){return n().backend.kind===`cloud`?o(()=>l()):(await o(()=>new i(r()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}var m=class{static async getSecrets(){try{return await p()}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async getSecretsOrThrow(){return p()}static async createSecret(e,t,a){if(n().backend.kind===`cloud`){await u({name:e,value:t,description:a});return}await o(()=>new i(r()).upsertSecret({name:e,value:t,description:a}))}static async updateSecret(e,t,a,s){if(n().backend.kind===`cloud`){await u({name:t,value:s,description:a,previousName:e});return}let c=new i(r()),l=s??await o(()=>c.getSecret(e));await o(()=>c.upsertSecret({name:t,value:l,description:a})),t!==e&&await this.deleteSecret(e)}static async deleteSecret(e){try{if(n().backend.kind===`cloud`){await o(()=>d(e));return}await o(()=>new i(r()).deleteSecret(e))}catch(e){if(t(e,404)||e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};export{f as n,m as t};
1
+ import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{$ as t}from"./active-backend-context-BETEdaJl.js";import{c as n,n as r}from"./agent-server-client-options-EHB23gyx.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as a}from"./proxy-BCCQUna8.js";async function o(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 s=100;function c(){let e=n().backend;if(e.kind!==`cloud`)throw Error(`Cloud secrets 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/secrets/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}async function u({name:e,value:t,description:n,previousName:r}){let i=c();r!==void 0&&await o(()=>a({backend:i,method:`PUT`,path:`/api/v1/secrets/${encodeURIComponent(r)}`,body:{name:e,description:n}})),t!==void 0&&await o(()=>a({backend:i,method:`POST`,path:`/api/v1/secrets`,body:{name:e,value:t,description:n}}))}async function d(e){await a({backend:c(),method:`DELETE`,path:`/api/v1/secrets/${encodeURIComponent(e)}`})}var f=e({SecretsService:()=>m});async function p(){return n().backend.kind===`cloud`?o(()=>l()):(await o(()=>new i(r()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}var m=class{static async getSecrets(){try{return await p()}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async getSecretsOrThrow(){return p()}static async createSecret(e,t,a){if(n().backend.kind===`cloud`){await u({name:e,value:t,description:a});return}await o(()=>new i(r()).upsertSecret({name:e,value:t,description:a}))}static async updateSecret(e,t,a,s){if(n().backend.kind===`cloud`){await u({name:t,value:s,description:a,previousName:e});return}let c=new i(r()),l=s??await o(()=>c.getSecret(e));await o(()=>c.upsertSecret({name:t,value:l,description:a})),t!==e&&await this.deleteSecret(e)}static async deleteSecret(e){try{if(n().backend.kind===`cloud`){await o(()=>d(e));return}await o(()=>new i(r()).deleteSecret(e))}catch(e){if(t(e,404)||e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};export{f as n,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~i58xkef6-cHFhpUBq.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{t as c}from"./back-nav-button-B2yBiVMB.js";import{t as l}from"./pencil-q-ihqDYv.js";import{t as u}from"./trash-2-Bb40zQzs.js";import{t as d}from"./loading-spinner-BeLV0IXf.js";import{t as f}from"./brand-button-CUMfjb99.js";import{t as p}from"./confirmation-modal-78sd9Vny.js";import{r as m}from"./typography-DgcLGdHk.js";import"./extension-module-card-classes-DpeaYhYo.js";import{a as h,c as g,i as _,l as v,o as y,r as b,s as x}from"./settings-list-classes-DhAPuXm6.js";import{t as S}from"./use-get-secrets-CMTuWEp_.js";import{n as C,t as w}from"./secret-form-9-BoGA40.js";var T=e(t(),1),E=n();function D(){return(0,E.jsxs)(`div`,{className:s(_,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,E.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,E.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,E.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,E.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function O({title:e,description:t,onEdit:n,onDelete:r}){return(0,E.jsxs)(`tr`,{"data-testid":`secret-item`,className:v,children:[(0,E.jsx)(`td`,{className:s(y,`text-content-2 truncate`),title:e,children:e}),(0,E.jsx)(`td`,{className:s(y,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,E.jsx)(`td`,{className:y,children:(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,E.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:b,children:(0,E.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,E.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:b,children:(0,E.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var k={hideTitle:!0};function A(){let e=i(),{t}=a(`openhands`),n=(0,T.useRef)(null),{data:r,isLoading:l,hasNextPage:u,isFetchingNextPage:_,onLoadMore:v}=S(),{mutate:y}=C(),[b,k]=T.useState(`list`),[A,j]=T.useState(null),[M,N]=T.useState(!1),P=(0,T.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&u&&!_&&v()},[u,_,v]),F=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},I=e=>{y(e,{onSettled:()=>{N(!1)},onSuccess:F,onError:F})},L=()=>{A&&I(A)},R=()=>{N(!1)},z=()=>{k(`list`),j(null)},B=b===`add-secret-form`||b===`edit-secret-form`,V=t(b===`add-secret-form`?o.SECRETS$ADD_A_SECRET:o.SECRETS$EDIT_A_SECRET);return(0,E.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[b===`list`?(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,E.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,E.jsx)(m.H2,{children:t(o.SETTINGS$NAV_SECRETS)}),(0,E.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(o.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,E.jsx)(f,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>k(`add-secret-form`),isDisabled:l,children:t(o.SECRETS$ADD_NEW_SECRET)})]}):null,B?(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(c,{testId:`back-to-secrets`,onClick:z,children:t(o.BUTTON$BACK)}),(0,E.jsx)(m.H2,{testId:`secret-editor-title`,children:V})]}):null,l&&b===`list`&&(0,E.jsxs)(`ul`,{children:[(0,E.jsx)(D,{}),(0,E.jsx)(D,{}),(0,E.jsx)(D,{})]}),b===`list`&&!l&&r?.length===0&&(0,E.jsx)(`div`,{"data-testid":`secrets-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,E.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:t(o.SECRETS$EMPTY)})}),b===`list`&&!l&&(r?.length??0)>0&&(0,E.jsxs)(`div`,{ref:n,className:h,onScroll:P,children:[(0,E.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,E.jsx)(`thead`,{className:x,children:(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`th`,{className:s(g,`w-1/4`),children:t(o.SETTINGS$NAME)}),(0,E.jsx)(`th`,{className:s(g,`w-1/2`),children:t(o.SECRETS$DESCRIPTION)}),(0,E.jsx)(`th`,{className:s(g,`w-1/4 text-right`),children:t(o.SETTINGS$ACTIONS)})]})}),(0,E.jsx)(`tbody`,{children:r?.map(e=>(0,E.jsx)(O,{title:e.name,description:e.description,onEdit:()=>{k(`edit-secret-form`),j(e.name)},onDelete:()=>{N(!0),j(e.name)}},e.name))})]}),_&&(0,E.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,E.jsx)(d,{size:`small`})})]}),(b===`add-secret-form`||b===`edit-secret-form`)&&(0,E.jsx)(w,{mode:b===`add-secret-form`?`add`:`edit`,selectedSecret:A,onCancel:z}),M&&(0,E.jsx)(p,{text:t(o.SECRETS$CONFIRM_DELETE_KEY),onConfirm:L,onCancel:R})]})}var j=r(A);export{j as default,k as handle};
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~i58xkef6-cHFhpUBq.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{K as o,t as s}from"./utils-CbjwNcR-.js";import{t as c}from"./back-nav-button-oDvIxpQ5.js";import{t as l}from"./pencil-q-ihqDYv.js";import{t as u}from"./trash-2-Bb40zQzs.js";import{t as d}from"./loading-spinner-BJc2J0Dw.js";import{t as f}from"./brand-button-CGUwj6zK.js";import{t as p}from"./confirmation-modal-oN1EId79.js";import{r as m}from"./typography-BdAApXGl.js";import"./extension-module-card-classes-DpeaYhYo.js";import{a as h,c as g,i as _,l as v,o as y,r as b,s as x}from"./settings-list-classes-DbqcSiVW.js";import{t as S}from"./use-get-secrets-Pbo9jh2A.js";import{n as C,t as w}from"./secret-form-BDvzojzN.js";var T=e(t(),1),E=n();function D(){return(0,E.jsxs)(`div`,{className:s(_,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,E.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,E.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,E.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,E.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function O({title:e,description:t,onEdit:n,onDelete:r}){return(0,E.jsxs)(`tr`,{"data-testid":`secret-item`,className:v,children:[(0,E.jsx)(`td`,{className:s(y,`text-content-2 truncate`),title:e,children:e}),(0,E.jsx)(`td`,{className:s(y,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,E.jsx)(`td`,{className:y,children:(0,E.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,E.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:b,children:(0,E.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,E.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:b,children:(0,E.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var k={hideTitle:!0};function A(){let e=i(),{t}=a(`openhands`),n=(0,T.useRef)(null),{data:r,isLoading:l,hasNextPage:u,isFetchingNextPage:_,onLoadMore:v}=S(),{mutate:y}=C(),[b,k]=T.useState(`list`),[A,j]=T.useState(null),[M,N]=T.useState(!1),P=(0,T.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&u&&!_&&v()},[u,_,v]),F=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},I=e=>{y(e,{onSettled:()=>{N(!1)},onSuccess:F,onError:F})},L=()=>{A&&I(A)},R=()=>{N(!1)},z=()=>{k(`list`),j(null)},B=b===`add-secret-form`||b===`edit-secret-form`,V=t(b===`add-secret-form`?o.SECRETS$ADD_A_SECRET:o.SECRETS$EDIT_A_SECRET);return(0,E.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[b===`list`?(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,E.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,E.jsx)(m.H2,{children:t(o.SETTINGS$NAV_SECRETS)}),(0,E.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(o.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,E.jsx)(f,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>k(`add-secret-form`),isDisabled:l,children:t(o.SECRETS$ADD_NEW_SECRET)})]}):null,B?(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(c,{testId:`back-to-secrets`,onClick:z,children:t(o.BUTTON$BACK)}),(0,E.jsx)(m.H2,{testId:`secret-editor-title`,children:V})]}):null,l&&b===`list`&&(0,E.jsxs)(`ul`,{children:[(0,E.jsx)(D,{}),(0,E.jsx)(D,{}),(0,E.jsx)(D,{})]}),b===`list`&&!l&&r?.length===0&&(0,E.jsx)(`div`,{"data-testid":`secrets-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,E.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:t(o.SECRETS$EMPTY)})}),b===`list`&&!l&&(r?.length??0)>0&&(0,E.jsxs)(`div`,{ref:n,className:h,onScroll:P,children:[(0,E.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,E.jsx)(`thead`,{className:x,children:(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`th`,{className:s(g,`w-1/4`),children:t(o.SETTINGS$NAME)}),(0,E.jsx)(`th`,{className:s(g,`w-1/2`),children:t(o.SECRETS$DESCRIPTION)}),(0,E.jsx)(`th`,{className:s(g,`w-1/4 text-right`),children:t(o.SETTINGS$ACTIONS)})]})}),(0,E.jsx)(`tbody`,{children:r?.map(e=>(0,E.jsx)(O,{title:e.name,description:e.description,onEdit:()=>{k(`edit-secret-form`),j(e.name)},onDelete:()=>{N(!0),j(e.name)}},e.name))})]}),_&&(0,E.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,E.jsx)(d,{size:`small`})})]}),(b===`add-secret-form`||b===`edit-secret-form`)&&(0,E.jsx)(w,{mode:b===`add-secret-form`?`add`:`edit`,selectedSecret:A,onCancel:z}),M&&(0,E.jsx)(p,{text:t(o.SECRETS$CONFIRM_DELETE_KEY),onConfirm:L,onCancel:R})]})}var j=r(A);export{j as default,k as handle};
@@ -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{F as r,L as i,U as a,j as o,p as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{B as l,M as u,it as d}from"./active-backend-context-BnH4-L8h.js";import{K as f,t as p}from"./utils-BgLSZdyy.js";import{n as m}from"./settings-nav-GAQjW1a-.js";import{i as h,n as g,r as _,t as v}from"./use-settings-nav-items-TOc0Rsfd.js";import{n as y}from"./use-config-l5tkDHyD.js";import"./navigation-link-Bxo3-4vo.js";import"./sidebar-layout-DH0E-5KW.js";import{t as b}from"./sidebar-nav-link-oLQiKUBu.js";import"./close-ScPlnwyq.js";import{n as x,r as S}from"./settings-utils-BTaaRhLZ.js";import{r as C}from"./typography-DgcLGdHk.js";import{t as w}from"./settings-section-header-context-BOJ_Fbak.js";import"./settings-gear-DaJj6Pde.js";import{t as T}from"./use-breakpoint-DWtihr9g.js";import{t as E}from"./backend-synced-settings-badge-DLEp6cq7.js";import{t as D}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var O=e(t(),1),k=n();function A({navigationItems:e}){let{t}=c(`openhands`),n=e.filter(e=>e.type===`item`);return(0,k.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:p(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,k.jsx)(C.Text,{className:`px-2 text-sm font-normal text-white`,children:t(f.SETTINGS$TITLE)}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:[n.map(e=>(0,k.jsx)(b,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,k.jsx)(g,{}),(0,k.jsx)(_,{})]}),(0,k.jsx)(`div`,{className:`flex flex-col gap-2 px-2 pt-3`,children:(0,k.jsx)(h,{})}),(0,k.jsx)(`div`,{className:`px-2 pt-3`,children:(0,k.jsx)(E,{})})]})}function j({children:e,navigationItems:t}){return(0,k.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,k.jsx)(A,{navigationItems:t}),(0,k.jsx)(`main`,{className:D,children:(0,k.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}var M=async({request:e})=>{let{pathname:t}=new URL(e.url),n=(await d.fetchQuery({queryKey:l.WEB_CLIENT_CONFIG,queryFn:y.getConfig,...u}))?.feature_flags;if(S(t,n)){let e=x(n);if(e&&e!==t)return o(e)}return null};function N(){let{t:e}=c(`openhands`),t=r(),n=i(),a=v(),o=T(768),[l,u]=(0,O.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:f}=(0,O.useMemo)(()=>{let e=m.find(e=>e.to===t.pathname);if(e)return{currentSectionTitle:e.text,currentSectionSubtitle:e.subtitle};let n=a.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[a,t.pathname]),p=n.find(e=>e.pathname===t.pathname)?.handle,h=o&&t.pathname===`/settings`;return(0,k.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,k.jsx)(w,{setHideSectionHeader:u,children:(0,k.jsx)(j,{navigationItems:a,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(p?.hideTitle===!0||h||l)&&(0,k.jsxs)(`header`,{className:`space-y-1`,children:[(0,k.jsx)(C.H2,{children:e(d)}),f?(0,k.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(f)}):null]}),(0,k.jsx)(s,{})]})})})})}var P=a(N);export{M as clientLoader,P 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{F as r,L as i,U as a,j as o,p as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{B as l,M as u,it as d}from"./active-backend-context-BETEdaJl.js";import{K as f,t as p}from"./utils-CbjwNcR-.js";import{n as m}from"./settings-nav-BThjwLWD.js";import{i as h,n as g,r as _,t as v}from"./use-settings-nav-items-CVz0SnDr.js";import{n as y}from"./use-config-BJ_FJCjV.js";import"./navigation-link-Bxo3-4vo.js";import"./sidebar-layout-Csb6Geq0.js";import{t as b}from"./sidebar-nav-link-Xv7QEMVS.js";import"./close-ScPlnwyq.js";import{n as x,r as S}from"./settings-utils-BTaaRhLZ.js";import{r as C}from"./typography-BdAApXGl.js";import{t as w}from"./settings-section-header-context-BOJ_Fbak.js";import"./settings-gear-DaJj6Pde.js";import{t as T}from"./use-breakpoint-DWtihr9g.js";import{t as E}from"./backend-synced-settings-badge-DXDDHWX4.js";import{t as D}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var O=e(t(),1),k=n();function A({navigationItems:e}){let{t}=c(`openhands`),n=e.filter(e=>e.type===`item`);return(0,k.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:p(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,k.jsx)(C.Text,{className:`px-2 text-sm font-normal text-white`,children:t(f.SETTINGS$TITLE)}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:[n.map(e=>(0,k.jsx)(b,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,k.jsx)(g,{}),(0,k.jsx)(_,{})]}),(0,k.jsx)(`div`,{className:`flex flex-col gap-2 px-2 pt-3`,children:(0,k.jsx)(h,{})}),(0,k.jsx)(`div`,{className:`px-2 pt-3`,children:(0,k.jsx)(E,{})})]})}function j({children:e,navigationItems:t}){return(0,k.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,k.jsx)(A,{navigationItems:t}),(0,k.jsx)(`main`,{className:D,children:(0,k.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}var M=async({request:e})=>{let{pathname:t}=new URL(e.url),n=(await d.fetchQuery({queryKey:l.WEB_CLIENT_CONFIG,queryFn:y.getConfig,...u}))?.feature_flags;if(S(t,n)){let e=x(n);if(e&&e!==t)return o(e)}return null};function N(){let{t:e}=c(`openhands`),t=r(),n=i(),a=v(),o=T(768),[l,u]=(0,O.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:f}=(0,O.useMemo)(()=>{let e=m.find(e=>e.to===t.pathname);if(e)return{currentSectionTitle:e.text,currentSectionSubtitle:e.subtitle};let n=a.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[a,t.pathname]),p=n.find(e=>e.pathname===t.pathname)?.handle,h=o&&t.pathname===`/settings`;return(0,k.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,k.jsx)(w,{setHideSectionHeader:u,children:(0,k.jsx)(j,{navigationItems:a,children:(0,k.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(p?.hideTitle===!0||h||l)&&(0,k.jsxs)(`header`,{className:`space-y-1`,children:[(0,k.jsx)(C.H2,{children:e(d)}),f?(0,k.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(f)}):null]}),(0,k.jsx)(s,{})]})})})})}var P=a(N);export{M as clientLoader,P as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,r as t,t as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-BgLSZdyy.js";import{f as s,g as c}from"./form-control-classes-Dbq-7YP_.js";import{n as l}from"./settings-input-dVuzapBA.js";e();var u=r();function d({className:e}){return(0,u.jsx)(`svg`,{"aria-hidden":!0,fill:`none`,focusable:`false`,height:`1em`,role:`presentation`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,viewBox:`0 0 24 24`,width:`1em`,className:e,children:(0,u.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}var f=o(`inline-flex items-center justify-center shrink-0 rounded-none bg-transparent px-1 min-w-0 w-auto h-auto text-medium cursor-pointer outline-none`,c),p=o(f,`!rounded-none !bg-transparent data-[hover=true]:!bg-transparent`);function m({isOpen:e,className:t}){return(0,u.jsx)(d,{className:o(`shrink-0`,c,e&&`rotate-180`,t)})}function h({testId:e,label:r,wrapperClassName:c,name:d,items:f,placeholder:m,showOptionalTag:h,isDisabled:g,isLoading:_,defaultSelectedKey:v,selectedKey:y,isClearable:b,allowsCustomValue:x,required:S,onSelectionChange:C,onInputChange:w,defaultFilter:T,startContent:E,inputWrapperClassName:D,inputClassName:O}){let{t:k}=i(`openhands`);return(0,u.jsxs)(`label`,{className:o(`flex flex-col gap-2.5 w-full min-w-0`,c),children:[r&&(0,u.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm`,children:r}),h&&(0,u.jsx)(l,{})]}),(0,u.jsx)(n,{"aria-label":typeof r==`string`?r:d,"data-testid":e,name:d,defaultItems:f,defaultSelectedKey:v,selectedKey:y,onSelectionChange:C,onInputChange:w,isClearable:b,isDisabled:g||_,isLoading:_,placeholder:_?k(a.HOME$LOADING):m,allowsCustomValue:x,isRequired:S,className:`w-full`,classNames:{popoverContent:`bg-content1 rounded-xl`,selectorButton:p},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:o(s,D),input:O}},defaultFilter:T,startContent:E||null,children:e=>(0,u.jsx)(t,{children:e.label},e.key)})]})}export{p as a,f as i,d as n,m as r,h as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,r as t,t as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-CbjwNcR-.js";import{f as s,g as c}from"./form-control-classes-BVI_szaj.js";import{n as l}from"./settings-input-B3i5U9GL.js";e();var u=r();function d({className:e}){return(0,u.jsx)(`svg`,{"aria-hidden":!0,fill:`none`,focusable:`false`,height:`1em`,role:`presentation`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,viewBox:`0 0 24 24`,width:`1em`,className:e,children:(0,u.jsx)(`path`,{d:`m6 9 6 6 6-6`})})}var f=o(`inline-flex items-center justify-center shrink-0 rounded-none bg-transparent px-1 min-w-0 w-auto h-auto text-medium cursor-pointer outline-none`,c),p=o(f,`!rounded-none !bg-transparent data-[hover=true]:!bg-transparent`);function m({isOpen:e,className:t}){return(0,u.jsx)(d,{className:o(`shrink-0`,c,e&&`rotate-180`,t)})}function h({testId:e,label:r,wrapperClassName:c,name:d,items:f,placeholder:m,showOptionalTag:h,isDisabled:g,isLoading:_,defaultSelectedKey:v,selectedKey:y,isClearable:b,allowsCustomValue:x,required:S,onSelectionChange:C,onInputChange:w,defaultFilter:T,startContent:E,inputWrapperClassName:D,inputClassName:O}){let{t:k}=i(`openhands`);return(0,u.jsxs)(`label`,{className:o(`flex flex-col gap-2.5 w-full min-w-0`,c),children:[r&&(0,u.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm`,children:r}),h&&(0,u.jsx)(l,{})]}),(0,u.jsx)(n,{"aria-label":typeof r==`string`?r:d,"data-testid":e,name:d,defaultItems:f,defaultSelectedKey:v,selectedKey:y,onSelectionChange:C,onInputChange:w,isClearable:b,isDisabled:g||_,isLoading:_,placeholder:_?k(a.HOME$LOADING):m,allowsCustomValue:x,isRequired:S,className:`w-full`,classNames:{popoverContent:`bg-content1 rounded-xl`,selectorButton:p},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:o(s,D),input:O}},defaultFilter:T,startContent:E||null,children:e=>(0,u.jsx)(t,{children:e.label},e.key)})]})}export{p as a,f as i,d as n,m as r,h as t};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t,f as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i}from"./utils-BgLSZdyy.js";import{t as a}from"./settings-nav-GAQjW1a-.js";import{i as o,n as s,r as c,t as l}from"./use-settings-nav-items-TOc0Rsfd.js";import{u}from"./agent-server-config-C_x8Otd9.js";import{t as d}from"./use-config-l5tkDHyD.js";import{t as f}from"./sidebar-nav-link-oLQiKUBu.js";import{n as p}from"./settings-utils-BTaaRhLZ.js";import{r as m}from"./typography-DgcLGdHk.js";import{t as h}from"./use-breakpoint-DWtihr9g.js";import{t as g}from"./backend-synced-settings-badge-DLEp6cq7.js";var _=e();function v({navigationItems:e}){let{t}=r(`openhands`),n=e.filter(e=>e.type===`item`);return(0,_.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,_.jsx)(m.H2,{children:t(i.SETTINGS$TITLE)}),(0,_.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[n.map(e=>(0,_.jsx)(f,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,_.jsx)(s,{}),(0,_.jsx)(c,{})]}),(0,_.jsx)(o,{}),(0,_.jsx)(`div`,{className:`pt-1`,children:(0,_.jsx)(g,{})})]})}var y=t(function(){let e=h(768),t=l(),{data:r}=d();return e?(0,_.jsx)(v,{navigationItems:t}):(0,_.jsx)(n,{to:u()===null?p(r?.feature_flags)??`/settings/app`:a,replace:!0})});export{y as default};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t,f as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i}from"./utils-CbjwNcR-.js";import{t as a}from"./settings-nav-BThjwLWD.js";import{i as o,n as s,r as c,t as l}from"./use-settings-nav-items-CVz0SnDr.js";import{u}from"./agent-server-config-C_x8Otd9.js";import{t as d}from"./use-config-BJ_FJCjV.js";import{t as f}from"./sidebar-nav-link-Xv7QEMVS.js";import{n as p}from"./settings-utils-BTaaRhLZ.js";import{r as m}from"./typography-BdAApXGl.js";import{t as h}from"./use-breakpoint-DWtihr9g.js";import{t as g}from"./backend-synced-settings-badge-DXDDHWX4.js";var _=e();function v({navigationItems:e}){let{t}=r(`openhands`),n=e.filter(e=>e.type===`item`);return(0,_.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,_.jsx)(m.H2,{children:t(i.SETTINGS$TITLE)}),(0,_.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[n.map(e=>(0,_.jsx)(f,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,_.jsx)(s,{}),(0,_.jsx)(c,{})]}),(0,_.jsx)(o,{}),(0,_.jsx)(`div`,{className:`pt-1`,children:(0,_.jsx)(g,{})})]})}var y=t(function(){let e=h(768),t=l(),{data:r}=d();return e?(0,_.jsx)(v,{navigationItems:t}):(0,_.jsx)(n,{to:u()===null?p(r?.feature_flags)??`/settings/app`:a,replace:!0})});export{y 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{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{f as o}from"./form-control-classes-Dbq-7YP_.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(i.COMMON$OPTIONAL)})}var u=(0,s.forwardRef)(function({testId:e,name:t,label:n,type:r,defaultValue:i,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,ariaLabel:w,ariaDescribedBy:T,ariaInvalid:E,error:D,showRequiredTag:O,hint:k,onBlur:A,inputClassName:j},M){let N=D&&e?`${e}-error`:void 0;return(0,c.jsxs)(`label`,{className:a(`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:a(`text-sm`,C),children:n}),O&&(0,c.jsx)(`span`,{className:`text-red-400 text-sm leading-none`,"aria-hidden":!0,children:`*`}),d&&(0,c.jsx)(l,{}),k&&(0,c.jsx)(`span`,{"data-testid":e?`${e}-hint`:void 0,className:`min-w-0 text-xs text-[var(--oh-muted)]`,children:k})]}),(0,c.jsx)(`input`,{ref:M,"data-testid":e,onChange:e=>h?.(e.target.value),onKeyDown:g,onBlur:A,name:t,disabled:f,type:r,defaultValue:i,value:s,placeholder:u,min:v,max:y,step:b,required:_,pattern:x,title:S,"aria-label":w,"aria-describedby":N??T,"aria-invalid":!!D||E,className:a(o,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`,D&&`border-red-500`,j)}),D&&(0,c.jsx)(`p`,{id:N,role:`alert`,"data-testid":e?`${e}-error`:void 0,className:`text-xs text-red-400 -mt-1`,children:D})]})});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"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-CbjwNcR-.js";import{f as o}from"./form-control-classes-BVI_szaj.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(i.COMMON$OPTIONAL)})}var u=(0,s.forwardRef)(function({testId:e,name:t,label:n,type:r,defaultValue:i,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,ariaLabel:w,ariaDescribedBy:T,ariaInvalid:E,error:D,showRequiredTag:O,hint:k,onBlur:A,inputClassName:j},M){let N=D&&e?`${e}-error`:void 0;return(0,c.jsxs)(`label`,{className:a(`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:a(`text-sm`,C),children:n}),O&&(0,c.jsx)(`span`,{className:`text-red-400 text-sm leading-none`,"aria-hidden":!0,children:`*`}),d&&(0,c.jsx)(l,{}),k&&(0,c.jsx)(`span`,{"data-testid":e?`${e}-hint`:void 0,className:`min-w-0 text-xs text-[var(--oh-muted)]`,children:k})]}),(0,c.jsx)(`input`,{ref:M,"data-testid":e,onChange:e=>h?.(e.target.value),onKeyDown:g,onBlur:A,name:t,disabled:f,type:r,defaultValue:i,value:s,placeholder:u,min:v,max:y,step:b,required:_,pattern:x,title:S,"aria-label":w,"aria-describedby":N??T,"aria-invalid":!!D||E,className:a(o,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`,D&&`border-red-500`,j)}),D&&(0,c.jsx)(`p`,{id:N,role:`alert`,"data-testid":e?`${e}-error`:void 0,className:`text-xs text-red-400 -mt-1`,children:D})]})});export{l as n,u as t};
@@ -1 +1 @@
1
- import{t as e}from"./utils-BgLSZdyy.js";import{_ as t,d as n,i as r,m as i}from"./form-control-classes-Dbq-7YP_.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-CbjwNcR-.js";import{_ as t,d as n,i as r,m as i}from"./form-control-classes-BVI_szaj.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"./useTranslation-CCgUjPJF.js";import{yt as i}from"./active-backend-context-BnH4-L8h.js";import{K as a,U as o,t as s}from"./utils-BgLSZdyy.js";import{i as c}from"./llm-settings-CODhjQzy.js";import{t as l}from"./use-tracking-j4uo9VEW.js";import{t as u}from"./settings-CKqk8ZnH.js";import{t as d}from"./use-save-settings-Dapkf4cC.js";import{t as f}from"./modal-backdrop-BSzNhM4r.js";import{r as p,t as m}from"./modal-body-C24WsdFb.js";import{t as h}from"./base-modal-C1a0TsSx.js";import{t as g}from"./modal-classes-B0b9eiL8.js";import{t as _}from"./brand-button-CUMfjb99.js";import{n as v}from"./navigation-context-CQZwH_tC.js";import{t as y}from"./settings-input-dVuzapBA.js";import{t as b}from"./settings-utils-BTaaRhLZ.js";import{b as x,s as S}from"./schema-field-Y3F8JvXd.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:s}=v(),{t:u}=r(`openhands`),p=C.useRef(null),[m,h]=C.useState(!1),g=async e=>{let r=b(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);s.startsWith(`/conversations/`)?h(!0):g(t)},O=e.llm_api_key_set,k=S(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:o.LABEL_CLASSNAME}),(0,w.jsx)(y,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(a.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:o.LABEL_CLASSNAME}),(0,w.jsx)(x,{testId:`llm-api-key-help-anchor`,text:u(a.SETTINGS$DONT_KNOW_API_KEY),linkText:u(a.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(a.BUTTON$SAVE)})})]}),m&&(0,w.jsx)(f,{children:(0,w.jsx)(T,{title:u(a.MODAL$END_SESSION_TITLE),description:u(a.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(a.BUTTON$END_SESSION),onClick:E},cancel:{text:u(a.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:s(`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(a.AI_SETTINGS$TITLE)}),(0,w.jsx)(x,{testId:`advanced-settings-link`,text:`${n(a.SETTINGS$DESCRIPTION)}. ${n(a.SETTINGS$FOR_OTHER_OPTIONS)} ${n(a.COMMON$SEE)}`,linkText:n(a.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"./useTranslation-CCgUjPJF.js";import{yt as i}from"./active-backend-context-BETEdaJl.js";import{K as a,U as o,t as s}from"./utils-CbjwNcR-.js";import{i as c}from"./llm-settings-CUgt39uu.js";import{t as l}from"./use-tracking-BAFpgpgq.js";import{t as u}from"./settings-CKqk8ZnH.js";import{t as d}from"./use-save-settings-CmX41wlf.js";import{t as f}from"./modal-backdrop-BSzNhM4r.js";import{r as p,t as m}from"./modal-body-B_95ci1c.js";import{t as h}from"./base-modal-CZq4kB_H.js";import{t as g}from"./modal-classes-BPcBCWVj.js";import{t as _}from"./brand-button-CGUwj6zK.js";import{n as v}from"./navigation-context-CQZwH_tC.js";import{t as y}from"./settings-input-B3i5U9GL.js";import{t as b}from"./settings-utils-BTaaRhLZ.js";import{b as x,s as S}from"./schema-field-DSi0d7a8.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:s}=v(),{t:u}=r(`openhands`),p=C.useRef(null),[m,h]=C.useState(!1),g=async e=>{let r=b(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);s.startsWith(`/conversations/`)?h(!0):g(t)},O=e.llm_api_key_set,k=S(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:o.LABEL_CLASSNAME}),(0,w.jsx)(y,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(a.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:o.LABEL_CLASSNAME}),(0,w.jsx)(x,{testId:`llm-api-key-help-anchor`,text:u(a.SETTINGS$DONT_KNOW_API_KEY),linkText:u(a.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(a.BUTTON$SAVE)})})]}),m&&(0,w.jsx)(f,{children:(0,w.jsx)(T,{title:u(a.MODAL$END_SESSION_TITLE),description:u(a.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(a.BUTTON$END_SESSION),onClick:E},cancel:{text:u(a.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:s(`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(a.AI_SETTINGS$TITLE)}),(0,w.jsx)(x,{testId:`advanced-settings-link`,text:`${n(a.SETTINGS$DESCRIPTION)}. ${n(a.SETTINGS$FOR_OTHER_OPTIONS)} ${n(a.COMMON$SEE)}`,linkText:n(a.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,4 +1,4 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./key-O84CMFHb.js";import{t as i}from"./u-robot-BvAOA2ZD.js";var a=n(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),o=n(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),s=n(`shield`,[[`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`}]]);e();var c=t(),l=[{icon:(0,c.jsx)(i,{width:16,height:16}),to:`/settings/agents`,text:`SETTINGS$NAV_AGENT`,subtitle:`SETTINGS$PAGE_AGENT_PROFILES_SUBLINE`},{icon:(0,c.jsx)(e=>(0,c.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,c.jsx)(`path`,{d:`M10 13C9.80222 13 9.60888 13.0586 9.44443 13.1685C9.27998 13.2784 9.15181 13.4346 9.07612 13.6173C9.00043 13.8 8.98063 14.0011 9.01921 14.1951C9.0578 14.3891 9.15304 14.5673 9.29289 14.7071C9.43275 14.847 9.61093 14.9422 9.80491 14.9808C9.99889 15.0194 10.2 14.9996 10.3827 14.9239C10.5654 14.8482 10.7216 14.72 10.8315 14.5556C10.9414 14.3911 11 14.1978 11 14C11 13.7348 10.8946 13.4804 10.7071 13.2929C10.5196 13.1054 10.2652 13 10 13ZM10 9C9.80222 9 9.60888 9.05865 9.44443 9.16853C9.27998 9.27841 9.15181 9.43459 9.07612 9.61732C9.00043 9.80004 8.98063 10.0011 9.01921 10.1951C9.0578 10.3891 9.15304 10.5673 9.29289 10.7071C9.43275 10.847 9.61093 10.9422 9.80491 10.9808C9.99889 11.0194 10.2 10.9996 10.3827 10.9239C10.5654 10.8482 10.7216 10.72 10.8315 10.5556C10.9414 10.3911 11 10.1978 11 10C11 9.73478 10.8946 9.48043 10.7071 9.29289C10.5196 9.10536 10.2652 9 10 9ZM14 9C13.8022 9 13.6089 9.05865 13.4444 9.16853C13.28 9.27841 13.1518 9.43459 13.0761 9.61732C13.0004 9.80004 12.9806 10.0011 13.0192 10.1951C13.0578 10.3891 13.153 10.5673 13.2929 10.7071C13.4327 10.847 13.6109 10.9422 13.8049 10.9808C13.9989 11.0194 14.2 10.9996 14.3827 10.9239C14.5654 10.8482 14.7216 10.72 14.8315 10.5556C14.9414 10.3911 15 10.1978 15 10C15 9.73478 14.8946 9.48043 14.7071 9.29289C14.5196 9.10536 14.2652 9 14 9ZM21 13C21.2652 13 21.5196 12.8946 21.7071 12.7071C21.8946 12.5196 22 12.2652 22 12C22 11.7348 21.8946 11.4804 21.7071 11.2929C21.5196 11.1054 21.2652 11 21 11H19V9H21C21.2652 9 21.5196 8.89464 21.7071 8.70711C21.8946 8.51957 22 8.26522 22 8C22 7.73478 21.8946 7.48043 21.7071 7.29289C21.5196 7.10536 21.2652 7 21 7H18.82C18.6707 6.5806 18.4299 6.19969 18.1151 5.8849C17.8003 5.57011 17.4194 5.32932 17 5.18V3C17 2.73478 16.8946 2.48043 16.7071 2.29289C16.5196 2.10536 16.2652 2 16 2C15.7348 2 15.4804 2.10536 15.2929 2.29289C15.1054 2.48043 15 2.73478 15 3V5H13V3C13 2.73478 12.8946 2.48043 12.7071 2.29289C12.5196 2.10536 12.2652 2 12 2C11.7348 2 11.4804 2.10536 11.2929 2.29289C11.1054 2.48043 11 2.73478 11 3V5H9V3C9 2.73478 8.89464 2.48043 8.70711 2.29289C8.51957 2.10536 8.26522 2 8 2C7.73478 2 7.48043 2.10536 7.29289 2.29289C7.10536 2.48043 7 2.73478 7 3V5.18C6.5806 5.32932 6.19969 5.57011 5.8849 5.8849C5.57011 6.19969 5.32932 6.5806 5.18 7H3C2.73478 7 2.48043 7.10536 2.29289 7.29289C2.10536 7.48043 2 7.73478 2 8C2 8.26522 2.10536 8.51957 2.29289 8.70711C2.48043 8.89464 2.73478 9 3 9H5V11H3C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H5V15H3C2.73478 15 2.48043 15.1054 2.29289 15.2929C2.10536 15.4804 2 15.7348 2 16C2 16.2652 2.10536 16.5196 2.29289 16.7071C2.48043 16.8946 2.73478 17 3 17H5.18C5.32932 17.4194 5.57011 17.8003 5.8849 18.1151C6.19969 18.4299 6.5806 18.6707 7 18.82V21C7 21.2652 7.10536 21.5196 7.29289 21.7071C7.48043 21.8946 7.73478 22 8 22C8.26522 22 8.51957 21.8946 8.70711 21.7071C8.89464 21.5196 9 21.2652 9 21V19H11V21C11 21.2652 11.1054 21.5196 11.2929 21.7071C11.4804 21.8946 11.7348 22 12 22C12.2652 22 12.5196 21.8946 12.7071 21.7071C12.8946 21.5196 13 21.2652 13 21V19H15V21C15 21.2652 15.1054 21.5196 15.2929 21.7071C15.4804 21.8946 15.7348 22 16 22C16.2652 22 16.5196 21.8946 16.7071 21.7071C16.8946 21.5196 17 21.2652 17 21V18.82C17.4194 18.6707 17.8003 18.4299 18.1151 18.1151C18.4299 17.8003 18.6707 17.4194 18.82 17H21C21.2652 17 21.5196 16.8946 21.7071 16.7071C21.8946 16.5196 22 16.2652 22 16C22 15.7348 21.8946 15.4804 21.7071 15.2929C21.5196 15.1054 21.2652 15 21 15H19V13H21ZM17 16C17 16.2652 16.8946 16.5196 16.7071 16.7071C16.5196 16.8946 16.2652 17 16 17H8C7.73478 17 7.48043 16.8946 7.29289 16.7071C7.10536 16.5196 7 16.2652 7 16V8C7 7.73478 7.10536 7.48043 7.29289 7.29289C7.48043 7.10536 7.73478 7 8 7H16C16.2652 7 16.5196 7.10536 16.7071 7.29289C16.8946 7.48043 17 7.73478 17 8V16ZM14 13C13.8022 13 13.6089 13.0586 13.4444 13.1685C13.28 13.2784 13.1518 13.4346 13.0761 13.6173C13.0004 13.8 12.9806 14.0011 13.0192 14.1951C13.0578 14.3891 13.153 14.5673 13.2929 14.7071C13.4327 14.847 13.6109 14.9422 13.8049 14.9808C13.9989 15.0194 14.2 14.9996 14.3827 14.9239C14.5654 14.8482 14.7216 14.72 14.8315 14.5556C14.9414 14.3911 15 14.1978 15 14C15 13.7348 14.8946 13.4804 14.7071 13.2929C14.5196 13.1054 14.2652 13 14 13Z`,fill:`currentColor`})}),{width:16,height:16}),to:`/settings/llm`,text:`SETTINGS$NAV_LLM`,subtitle:`SETTINGS$PAGE_LLM_SUBLINE`},{icon:(0,c.jsx)(e=>(0,c.jsxs)(`svg`,{id:`Layer_1`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 22.3 18.66`,...e,children:[(0,c.jsx)(`defs`,{children:(0,c.jsx)(`style`,{children:`
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./key-DpfBWQbk.js";import{t as i}from"./u-robot-BvAOA2ZD.js";var a=n(`app-window`,[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]),o=n(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),s=n(`shield`,[[`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`}]]);e();var c=t(),l=[{icon:(0,c.jsx)(i,{width:16,height:16}),to:`/settings/agents`,text:`SETTINGS$NAV_AGENT`,subtitle:`SETTINGS$PAGE_AGENT_PROFILES_SUBLINE`},{icon:(0,c.jsx)(e=>(0,c.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,c.jsx)(`path`,{d:`M10 13C9.80222 13 9.60888 13.0586 9.44443 13.1685C9.27998 13.2784 9.15181 13.4346 9.07612 13.6173C9.00043 13.8 8.98063 14.0011 9.01921 14.1951C9.0578 14.3891 9.15304 14.5673 9.29289 14.7071C9.43275 14.847 9.61093 14.9422 9.80491 14.9808C9.99889 15.0194 10.2 14.9996 10.3827 14.9239C10.5654 14.8482 10.7216 14.72 10.8315 14.5556C10.9414 14.3911 11 14.1978 11 14C11 13.7348 10.8946 13.4804 10.7071 13.2929C10.5196 13.1054 10.2652 13 10 13ZM10 9C9.80222 9 9.60888 9.05865 9.44443 9.16853C9.27998 9.27841 9.15181 9.43459 9.07612 9.61732C9.00043 9.80004 8.98063 10.0011 9.01921 10.1951C9.0578 10.3891 9.15304 10.5673 9.29289 10.7071C9.43275 10.847 9.61093 10.9422 9.80491 10.9808C9.99889 11.0194 10.2 10.9996 10.3827 10.9239C10.5654 10.8482 10.7216 10.72 10.8315 10.5556C10.9414 10.3911 11 10.1978 11 10C11 9.73478 10.8946 9.48043 10.7071 9.29289C10.5196 9.10536 10.2652 9 10 9ZM14 9C13.8022 9 13.6089 9.05865 13.4444 9.16853C13.28 9.27841 13.1518 9.43459 13.0761 9.61732C13.0004 9.80004 12.9806 10.0011 13.0192 10.1951C13.0578 10.3891 13.153 10.5673 13.2929 10.7071C13.4327 10.847 13.6109 10.9422 13.8049 10.9808C13.9989 11.0194 14.2 10.9996 14.3827 10.9239C14.5654 10.8482 14.7216 10.72 14.8315 10.5556C14.9414 10.3911 15 10.1978 15 10C15 9.73478 14.8946 9.48043 14.7071 9.29289C14.5196 9.10536 14.2652 9 14 9ZM21 13C21.2652 13 21.5196 12.8946 21.7071 12.7071C21.8946 12.5196 22 12.2652 22 12C22 11.7348 21.8946 11.4804 21.7071 11.2929C21.5196 11.1054 21.2652 11 21 11H19V9H21C21.2652 9 21.5196 8.89464 21.7071 8.70711C21.8946 8.51957 22 8.26522 22 8C22 7.73478 21.8946 7.48043 21.7071 7.29289C21.5196 7.10536 21.2652 7 21 7H18.82C18.6707 6.5806 18.4299 6.19969 18.1151 5.8849C17.8003 5.57011 17.4194 5.32932 17 5.18V3C17 2.73478 16.8946 2.48043 16.7071 2.29289C16.5196 2.10536 16.2652 2 16 2C15.7348 2 15.4804 2.10536 15.2929 2.29289C15.1054 2.48043 15 2.73478 15 3V5H13V3C13 2.73478 12.8946 2.48043 12.7071 2.29289C12.5196 2.10536 12.2652 2 12 2C11.7348 2 11.4804 2.10536 11.2929 2.29289C11.1054 2.48043 11 2.73478 11 3V5H9V3C9 2.73478 8.89464 2.48043 8.70711 2.29289C8.51957 2.10536 8.26522 2 8 2C7.73478 2 7.48043 2.10536 7.29289 2.29289C7.10536 2.48043 7 2.73478 7 3V5.18C6.5806 5.32932 6.19969 5.57011 5.8849 5.8849C5.57011 6.19969 5.32932 6.5806 5.18 7H3C2.73478 7 2.48043 7.10536 2.29289 7.29289C2.10536 7.48043 2 7.73478 2 8C2 8.26522 2.10536 8.51957 2.29289 8.70711C2.48043 8.89464 2.73478 9 3 9H5V11H3C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H5V15H3C2.73478 15 2.48043 15.1054 2.29289 15.2929C2.10536 15.4804 2 15.7348 2 16C2 16.2652 2.10536 16.5196 2.29289 16.7071C2.48043 16.8946 2.73478 17 3 17H5.18C5.32932 17.4194 5.57011 17.8003 5.8849 18.1151C6.19969 18.4299 6.5806 18.6707 7 18.82V21C7 21.2652 7.10536 21.5196 7.29289 21.7071C7.48043 21.8946 7.73478 22 8 22C8.26522 22 8.51957 21.8946 8.70711 21.7071C8.89464 21.5196 9 21.2652 9 21V19H11V21C11 21.2652 11.1054 21.5196 11.2929 21.7071C11.4804 21.8946 11.7348 22 12 22C12.2652 22 12.5196 21.8946 12.7071 21.7071C12.8946 21.5196 13 21.2652 13 21V19H15V21C15 21.2652 15.1054 21.5196 15.2929 21.7071C15.4804 21.8946 15.7348 22 16 22C16.2652 22 16.5196 21.8946 16.7071 21.7071C16.8946 21.5196 17 21.2652 17 21V18.82C17.4194 18.6707 17.8003 18.4299 18.1151 18.1151C18.4299 17.8003 18.6707 17.4194 18.82 17H21C21.2652 17 21.5196 16.8946 21.7071 16.7071C21.8946 16.5196 22 16.2652 22 16C22 15.7348 21.8946 15.4804 21.7071 15.2929C21.5196 15.1054 21.2652 15 21 15H19V13H21ZM17 16C17 16.2652 16.8946 16.5196 16.7071 16.7071C16.5196 16.8946 16.2652 17 16 17H8C7.73478 17 7.48043 16.8946 7.29289 16.7071C7.10536 16.5196 7 16.2652 7 16V8C7 7.73478 7.10536 7.48043 7.29289 7.29289C7.48043 7.10536 7.73478 7 8 7H16C16.2652 7 16.5196 7.10536 16.7071 7.29289C16.8946 7.48043 17 7.73478 17 8V16ZM14 13C13.8022 13 13.6089 13.0586 13.4444 13.1685C13.28 13.2784 13.1518 13.4346 13.0761 13.6173C13.0004 13.8 12.9806 14.0011 13.0192 14.1951C13.0578 14.3891 13.153 14.5673 13.2929 14.7071C13.4327 14.847 13.6109 14.9422 13.8049 14.9808C13.9989 15.0194 14.2 14.9996 14.3827 14.9239C14.5654 14.8482 14.7216 14.72 14.8315 14.5556C14.9414 14.3911 15 14.1978 15 14C15 13.7348 14.8946 13.4804 14.7071 13.2929C14.5196 13.1054 14.2652 13 14 13Z`,fill:`currentColor`})}),{width:16,height:16}),to:`/settings/llm`,text:`SETTINGS$NAV_LLM`,subtitle:`SETTINGS$PAGE_LLM_SUBLINE`},{icon:(0,c.jsx)(e=>(0,c.jsxs)(`svg`,{id:`Layer_1`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 22.3 18.66`,...e,children:[(0,c.jsx)(`defs`,{children:(0,c.jsx)(`style`,{children:`
2
2
  .st0 {
3
3
  stroke-miterlimit: 10;
4
4
  }
@@ -1 +1 @@
1
- import{c as e,n as t}from"./agent-server-client-options-EHB23gyx.js";import{f as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as r}from"./proxy-XP6U1Dhv.js";import{t as i}from"./settings-CKqk8ZnH.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 te=(e,t)=>t.enabled===!1?{enabled:!1}:g(e)===!1?{enabled:!0}:{},y=(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},b=[`client_auth_method`,`scopes`,`client_id`,`client_secret`],x=(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=x(n[e],i);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:void 0},S=(e,t)=>{if(t===void 0)return;if(t===null)return null;let n=x(e,t),r=f(n)?{...n}:{},i=f(e)?e:{};for(let e of b)e in i&&!(e in t)&&(r[e]=null);if(Object.keys(r).length!==0)return{type:`oauth`,...r}},C=(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},w=`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.`,T=(e,t)=>{let n=y(e?.strategy===`header`?e.headers:void 0,t.headers);if(n){if(Object.values(n).some(e=>e===null))throw Error(w);return{strategy:`header`,headers:n}}},E=(e,t)=>{let n=e?.strategy===`oauth2`?e:void 0,r=S(n?.authentication,t.authentication),i=x(n?.state,t.state);if(!(n&&r===void 0&&i===void 0))return C(e,{strategy:`oauth2`,...r!==void 0&&{authentication:r},...i!==void 0&&{state:i}})};function D(e,t){let n=te(e,t);if(t.type===`stdio`){let r=y(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=E(r?.auth,t.auth);e!==void 0&&(i.auth=e)}else if(t.auth.strategy===`header`&&r?.auth?.strategy===`header`){let e=T(r.auth,t.auth);e!==void 0&&(i.auth=e)}else h(t.auth)||(i.auth=C(r?.auth,t.auth));else r?.auth&&(i.auth=null);return i}var O=(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)},k=`Replace or clear the stored credential before renaming this MCP server.`;function ne(e,t,n,r){if(h(n.transport===`stdio`?n.env:{auth:n.auth,headers:n.headers}))throw Error(k);let i=O(n,D(n,r));return{[e]:null,[t]:i}}function re(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 A(){let t=e().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function j(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 M(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 N(){let e=await r({backend:A(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:j(e),conversation_settings:M(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 P(e){let t=A(),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 F(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function I(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var L=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`,`enabled_skills`],R=new Set(L),z=e=>R.has(e),B=e=>{let t={},n={};for(let[r,i]of Object.entries(e))z(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},V=e=>JSON.parse(JSON.stringify(e)),H=(e,t)=>({...e??{},...t??{}});async function U(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 W={redacted:null,encrypted:null,timestamp:0},G=300*1e3,K=()=>Date.now()-W.timestamp<G,q=()=>{W={redacted:null,encrypted:null,timestamp:0}},J=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Y=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,ie=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:Y(e.username,e.password)};case`header`:return m(e.headers)??{};case`oauth2`:{let t=J(e.state)?e.state.tokens:void 0;return!J(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},X=async t=>{if(!J(t))return t;let n=J(t.mcpServers),r=n?t.mcpServers:t,i=Object.values(r).some(e=>J(e)&&J(e.auth)&&e.auth!==null)&&e().backend.kind===`cloud`,a=new Map;if(i)try{let e=await N(),t=J(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(J(n)){let t=m(n.headers);t&&a.set(e,t)}}catch{}let o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!J(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!J(t.auth))return[e,t];let n=ie(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 n?{...t,mcpServers:o}:o},Z=e=>{let t=e.misc_settings?.app_preferences,n=t?.disabled_skills,r=t?.enabled_skills;return{disabledSkills:Array.isArray(n)?n:[],enabledSkills:Array.isArray(r)?r:void 0}},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 L){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=H(i.agent_settings??{},e.agent_settings??{}),n=H(i.conversation_settings??{},e.conversation_settings??{}),r={...V(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},ae=class r{static async fetchSettingsFromApi(e){return U(()=>new n(t()).getSettings({exposeSecrets:e}))}static async getSettings(){if(e().backend.kind===`cloud`)try{return $(await U(()=>N()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(K()&&W.redacted)return $(Q(W.redacted));try{let e=await this.fetchSettingsFromApi();return W.redacted=e,W.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(K()&&W.encrypted)return{agentSettings:W.encrypted.agent_settings,conversationSettings:W.encrypted.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(W.encrypted)};let e=await this.fetchSettingsFromApi(`encrypted`);return W.encrypted=e,W.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(e)}}static async getSettingsSchema(){return e().backend.kind===`cloud`?await F():await new n(t()).getAgentSchema()}static async getConversationSettingsSchema(){return e().backend.kind===`cloud`?await I():await new n(t()).getConversationSchema()}static async patchMcpConfig(r){if(e().backend.kind===`cloud`){let e=await X(r);await U(()=>P({agent_settings_diff:{mcp_config:e}}))}else await U(()=>new n(t()).updateSettings({agent_settings_diff:{mcp_config:r}}));return q(),!0}static async patchMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).patchMcpServer(i,a)),q(),!0)}static async createMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).createMcpServer(i,a)),q(),!0)}static async deleteMcpServer(i){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await U(()=>new n(t()).deleteMcpServer(i)),q(),!0)}static async saveSettings(r){let{extracted:i,rest:a}=B(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}),e().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 X(e.agent_settings_diff.mcp_config))),s.conversation_settings_diff&&(e.conversation_settings_diff=s.conversation_settings_diff),o&&(e.app_preferences=i),await U(()=>P(e))}else{if(!(s.agent_settings_diff||s.conversation_settings_diff||s.misc_settings_diff))return!0;await U(()=>new n(t()).updateSettings(s))}return q(),!0}static invalidateCache(){q()}};export{D as a,h as c,c as d,l as f,re as i,v as l,s as m,k as n,ne as o,u as p,d as r,g as s,ae as t,ee as u};
1
+ import{c as e,n as t}from"./agent-server-client-options-EHB23gyx.js";import{f as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as r}from"./proxy-BCCQUna8.js";import{t as i}from"./settings-CKqk8ZnH.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 te=(e,t)=>t.enabled===!1?{enabled:!1}:g(e)===!1?{enabled:!0}:{},y=(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},b=[`client_auth_method`,`scopes`,`client_id`,`client_secret`],x=(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=x(n[e],i);t!==void 0&&(r[e]=t)}return Object.keys(r).length>0?r:void 0},S=(e,t)=>{if(t===void 0)return;if(t===null)return null;let n=x(e,t),r=f(n)?{...n}:{},i=f(e)?e:{};for(let e of b)e in i&&!(e in t)&&(r[e]=null);if(Object.keys(r).length!==0)return{type:`oauth`,...r}},C=(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},w=`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.`,T=(e,t)=>{let n=y(e?.strategy===`header`?e.headers:void 0,t.headers);if(n){if(Object.values(n).some(e=>e===null))throw Error(w);return{strategy:`header`,headers:n}}},E=(e,t)=>{let n=e?.strategy===`oauth2`?e:void 0,r=S(n?.authentication,t.authentication),i=x(n?.state,t.state);if(!(n&&r===void 0&&i===void 0))return C(e,{strategy:`oauth2`,...r!==void 0&&{authentication:r},...i!==void 0&&{state:i}})};function D(e,t){let n=te(e,t);if(t.type===`stdio`){let r=y(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=E(r?.auth,t.auth);e!==void 0&&(i.auth=e)}else if(t.auth.strategy===`header`&&r?.auth?.strategy===`header`){let e=T(r.auth,t.auth);e!==void 0&&(i.auth=e)}else h(t.auth)||(i.auth=C(r?.auth,t.auth));else r?.auth&&(i.auth=null);return i}var O=(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)},k=`Replace or clear the stored credential before renaming this MCP server.`;function ne(e,t,n,r){if(h(n.transport===`stdio`?n.env:{auth:n.auth,headers:n.headers}))throw Error(k);let i=O(n,D(n,r));return{[e]:null,[t]:i}}function re(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 A(){let t=e().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function j(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 M(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 N(){let e=await r({backend:A(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:j(e),conversation_settings:M(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 P(e){let t=A(),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 F(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function I(){return r({backend:A(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var L=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`,`enabled_skills`],R=new Set(L),z=e=>R.has(e),B=e=>{let t={},n={};for(let[r,i]of Object.entries(e))z(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},V=e=>JSON.parse(JSON.stringify(e)),H=(e,t)=>({...e??{},...t??{}});async function U(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 W={redacted:null,encrypted:null,timestamp:0},G=300*1e3,K=()=>Date.now()-W.timestamp<G,q=()=>{W={redacted:null,encrypted:null,timestamp:0}},J=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Y=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,ie=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:Y(e.username,e.password)};case`header`:return m(e.headers)??{};case`oauth2`:{let t=J(e.state)?e.state.tokens:void 0;return!J(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},X=async t=>{if(!J(t))return t;let n=J(t.mcpServers),r=n?t.mcpServers:t,i=Object.values(r).some(e=>J(e)&&J(e.auth)&&e.auth!==null)&&e().backend.kind===`cloud`,a=new Map;if(i)try{let e=await N(),t=J(e.mcp_config)?e.mcp_config:{};for(let[e,n]of Object.entries(t))if(J(n)){let t=m(n.headers);t&&a.set(e,t)}}catch{}let o=Object.fromEntries(Object.entries(r).map(([e,t])=>{if(!J(t))return[e,t];if(t.auth===null){let n={...t,headers:null};return delete n.auth,[e,n]}if(!J(t.auth))return[e,t];let n=ie(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 n?{...t,mcpServers:o}:o},Z=e=>{let t=e.misc_settings?.app_preferences,n=t?.disabled_skills,r=t?.enabled_skills;return{disabledSkills:Array.isArray(n)?n:[],enabledSkills:Array.isArray(r)?r:void 0}},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 L){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=H(i.agent_settings??{},e.agent_settings??{}),n=H(i.conversation_settings??{},e.conversation_settings??{}),r={...V(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},ae=class r{static async fetchSettingsFromApi(e){return U(()=>new n(t()).getSettings({exposeSecrets:e}))}static async getSettings(){if(e().backend.kind===`cloud`)try{return $(await U(()=>N()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(K()&&W.redacted)return $(Q(W.redacted));try{let e=await this.fetchSettingsFromApi();return W.redacted=e,W.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(K()&&W.encrypted)return{agentSettings:W.encrypted.agent_settings,conversationSettings:W.encrypted.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(W.encrypted)};let e=await this.fetchSettingsFromApi(`encrypted`);return W.encrypted=e,W.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0,skillEnablement:Z(e)}}static async getSettingsSchema(){return e().backend.kind===`cloud`?await F():await new n(t()).getAgentSchema()}static async getConversationSettingsSchema(){return e().backend.kind===`cloud`?await I():await new n(t()).getConversationSchema()}static async patchMcpConfig(r){if(e().backend.kind===`cloud`){let e=await X(r);await U(()=>P({agent_settings_diff:{mcp_config:e}}))}else await U(()=>new n(t()).updateSettings({agent_settings_diff:{mcp_config:r}}));return q(),!0}static async patchMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).patchMcpServer(i,a)),q(),!0)}static async createMcpServer(i,a){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:a}):(await U(()=>new n(t()).createMcpServer(i,a)),q(),!0)}static async deleteMcpServer(i){return e().backend.kind===`cloud`?r.patchMcpConfig({[i]:null}):(await U(()=>new n(t()).deleteMcpServer(i)),q(),!0)}static async saveSettings(r){let{extracted:i,rest:a}=B(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}),e().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 X(e.agent_settings_diff.mcp_config))),s.conversation_settings_diff&&(e.conversation_settings_diff=s.conversation_settings_diff),o&&(e.app_preferences=i),await U(()=>P(e))}else{if(!(s.agent_settings_diff||s.conversation_settings_diff||s.misc_settings_diff))return!0;await U(()=>new n(t()).updateSettings(s))}return q(),!0}static invalidateCache(){q()}};export{D as a,h as c,c as d,l as f,re as i,v as l,s as m,k as n,ne as o,u as p,d as r,g as s,ae 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"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{n as o}from"./toggle-switch-B2uXaAUS.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(i.BADGE$BETA)})]}):null;return(0,c.jsxs)(`label`,{className:a(`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"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-CbjwNcR-.js";import{n as o}from"./toggle-switch-D3TBxlsc.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(i.BADGE$BETA)})]}):null;return(0,c.jsxs)(`label`,{className:a(`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{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~i58xkef6-cHFhpUBq.js";import{t as o}from"./useInfiniteQuery-CtSRG7uW.js";import{t as s}from"./useQuery-DAAacS7O.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{K as l}from"./utils-BgLSZdyy.js";import{n as u}from"./agent-server-client-options-EHB23gyx.js";import{t as d}from"./messages-Bk1xhbU2.js";import{c as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as p}from"./loading-spinner-BeLV0IXf.js";import{t as m}from"./openhands-logo-BS-Epajy.js";import{O as h,m as g}from"./markdown-renderer-DyFl9-mL.js";var _=e(t(),1),v=e=>s({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new f(u()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>o({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new f(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}=c(`openhands`),{conversationId:t}=r(),{data:n,isLoading:i,error:o}=v(t),{data:s,isLoading:u,error:f,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=i||u,E=o||f,D=_.useMemo(()=>s?.pages?s.pages.flatMap(e=>e.items):[],[s?.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(l.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(a,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(l.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(m,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(l.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(d,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(l.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(p,{size:`small`})})]})})]})});export{S as default};
1
+ import{a as e}from"./rolldown-runtime-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~i58xkef6-cHFhpUBq.js";import{t as o}from"./useInfiniteQuery-CtSRG7uW.js";import{t as s}from"./useQuery-DAAacS7O.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{K as l}from"./utils-CbjwNcR-.js";import{n as u}from"./agent-server-client-options-EHB23gyx.js";import{t as d}from"./messages-WUb9Yh-p.js";import{c as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as p}from"./loading-spinner-BJc2J0Dw.js";import{t as m}from"./openhands-logo-BS-Epajy.js";import{O as h,m as g}from"./markdown-renderer-DRpwRlNm.js";var _=e(t(),1),v=e=>s({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new f(u()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>o({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new f(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}=c(`openhands`),{conversationId:t}=r(),{data:n,isLoading:i,error:o}=v(t),{data:s,isLoading:u,error:f,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=i||u,E=o||f,D=_.useMemo(()=>s?.pages?s.pages.flatMap(e=>e.items):[],[s?.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(l.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(a,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(l.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(m,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(l.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(l.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(d,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(l.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(p,{size:`small`})})]})})]})});export{S as default};
@@ -1 +1 @@
1
- import{t as e}from"./utils-BgLSZdyy.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-CbjwNcR-.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{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-BgLSZdyy.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{n as u}from"./modal-body-C24WsdFb.js";import{n as d,r as f}from"./base-modal-C1a0TsSx.js";import{_ as p,u as m}from"./form-control-classes-Dbq-7YP_.js";import{t as h}from"./brand-button-CUMfjb99.js";import{t as g}from"./agent-server-conversation-service.api-jiCopc2E.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:i}){let{t:c}=o(`openhands`),p;return p=i??(n?(0,v.jsx)(a,{ns:`openhands`,i18nKey:s.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):c(s.CONVERSATION$DELETE_WARNING)),(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:r??c(s.CONVERSATION$CONFIRM_DELETE)}),(0,v.jsx)(d,{children:p})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:c(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:c(s.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=o(`openhands`);return(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:n(s.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(s.CONVERSATION$CLOSE_CONVERSATION_WARNING)})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:n(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(s.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return i({mutationFn:e=>g.updateConversationTitle(e.conversationId,e.newTitle),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,title:t.newTitle}:e)),e.setQueryData([`user`,`conversation`,t.conversationId],e=>e&&{...e,title:t.newTitle}),{previousConversations:n}},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})};function S(e){if(!e)return null;try{let t=new URL(e);return t.hostname===`localhost`&&window.location.hostname!==`localhost`?(t.hostname=window.location.hostname,t.toString()):e}catch{return e}}var C=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{d:`M12 2C12.5523 2 13 2.44772 13 3V13.5858L15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929C7.68342 10.9024 8.31658 10.9024 8.70711 11.2929L11 13.5858V3C11 2.44772 11.4477 2 12 2ZM5 17C5.55228 17 6 17.4477 6 18V20H18V18C18 17.4477 18.4477 17 19 17C19.5523 17 20 17.4477 20 18V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V18C4 17.4477 4.44772 17 5 17Z`,fill:`currentColor`})}),w=_.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=c(`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}=o(`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?s.SIDEBAR$CLOSE_MENU:s.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
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-CbjwNcR-.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{n as u}from"./modal-body-B_95ci1c.js";import{n as d,r as f}from"./base-modal-CZq4kB_H.js";import{_ as p,u as m}from"./form-control-classes-BVI_szaj.js";import{t as h}from"./brand-button-CGUwj6zK.js";import{t as g}from"./agent-server-conversation-service.api-BtOlitCD.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:i}){let{t:c}=o(`openhands`),p;return p=i??(n?(0,v.jsx)(a,{ns:`openhands`,i18nKey:s.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):c(s.CONVERSATION$DELETE_WARNING)),(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:r??c(s.CONVERSATION$CONFIRM_DELETE)}),(0,v.jsx)(d,{children:p})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:c(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:c(s.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=o(`openhands`);return(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:n(s.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(s.CONVERSATION$CLOSE_CONVERSATION_WARNING)})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:n(s.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(s.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return i({mutationFn:e=>g.updateConversationTitle(e.conversationId,e.newTitle),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,title:t.newTitle}:e)),e.setQueryData([`user`,`conversation`,t.conversationId],e=>e&&{...e,title:t.newTitle}),{previousConversations:n}},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})};function S(e){if(!e)return null;try{let t=new URL(e);return t.hostname===`localhost`&&window.location.hostname!==`localhost`?(t.hostname=window.location.hostname,t.toString()):e}catch{return e}}var C=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{d:`M12 2C12.5523 2 13 2.44772 13 3V13.5858L15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929C7.68342 10.9024 8.31658 10.9024 8.70711 11.2929L11 13.5858V3C11 2.44772 11.4477 2 12 2ZM5 17C5.55228 17 6 17.4477 6 18V20H18V18C18 17.4477 18.4477 17 19 17C19.5523 17 20 17.4477 20 18V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V18C4 17.4477 4.44772 17 5 17Z`,fill:`currentColor`})}),w=_.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=c(`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}=o(`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?s.SIDEBAR$CLOSE_MENU:s.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-BgLSZdyy.js";import{t as r}from"./pin-BdroVQdN.js";import{n as i}from"./navigation-context-CQZwH_tC.js";import{t as a}from"./navigation-link-Bxo3-4vo.js";import{a as o,c as s,f as c,o as l,s as u,t as d,u as f}from"./sidebar-layout-DH0E-5KW.js";import{t as p}from"./styled-tooltip-CejG0rqv.js";e();var m=t();function h({active:e,className:t,children:r}){return(0,m.jsxs)(`span`,{className:n(d,t),children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:u(e)}),(0,m.jsx)(`span`,{className:s(e),children:r})]})}var g=[`[@media(hover:hover)_and_(pointer:fine)]:pointer-events-none`,`[@media(hover:hover)_and_(pointer:fine)]:invisible`,`[@media(hover:hover)_and_(pointer:fine)]:opacity-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:pointer-events-auto`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:visible`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:opacity-100`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:pointer-events-auto`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:visible`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:opacity-100`],_=[`[@media(hover:hover)_and_(pointer:fine)]:opacity-100`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:opacity-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:opacity-0`],v=[`[@media(hover:hover)_and_(pointer:fine)]:min-w-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:min-w-[3.75rem]`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:min-w-[3.75rem]`],y=[`[@media(hover:hover)_and_(pointer:fine)]:flex`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:hidden`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:hidden`];function b(e=!1){return e?`pointer-events-auto visible opacity-100`:n(`pointer-events-auto visible opacity-100`,...g)}function x(e=!1){return e?`opacity-0`:n(`opacity-0`,..._)}function S(e=!1){return e?`min-w-[3.75rem]`:n(`min-w-[3.75rem]`,...v)}function C(e=!1){return e?`hidden`:n(`hidden`,...y)}function w(e,t,n){return t===`/`||n?e===t:e===t||e.startsWith(`${t}/`)}function T({to:e,label:t,end:s=!1,indent:u=!1,testId:d,disabled:g=!1,icon:_,collapsed:v=!1,hoverContent:y,forceActive:x=!1,pinAction:S}){let{currentPath:C}=i(),T=x||w(C,e,s),E=!v&&S!=null,D=(0,m.jsxs)(a,{to:e,end:s,"data-testid":d,tabIndex:g?-1:0,"aria-label":v?t:void 0,"aria-disabled":g||void 0,onClick:e=>{g&&e.preventDefault()},className:n(c({indent:u,collapsed:v}),!v&&(T?l.active:l.idle),g&&`opacity-50`,g&&`pointer-events-none`,E&&`pr-9`),children:[_?v?(0,m.jsx)(h,{active:T,children:_}):(0,m.jsx)(`span`,{className:o,children:_}):null,(0,m.jsx)(`span`,{className:f(v),children:t})]});return v?(0,m.jsx)(p,{content:y??t,placement:`right`,tooltipClassName:y?`p-0 bg-tertiary text-white`:void 0,children:D}):S?(0,m.jsxs)(`div`,{className:`group relative`,children:[D,(0,m.jsx)(`button`,{type:`button`,"data-testid":S.testId,"aria-pressed":S.pinned,"aria-label":S.label,onClick:e=>{e.preventDefault(),e.stopPropagation(),S.onToggle()},className:n(`absolute right-1.5 top-1/2 -translate-y-1/2`,`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`,b(S.pinned)),children:(0,m.jsx)(r,{className:n(`h-3.5 w-3.5`,S.pinned&&`fill-current`),"aria-hidden":!0})})]}):D}export{x as a,S as i,b as n,h as o,C as r,T 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-CbjwNcR-.js";import{t as r}from"./pin-BdroVQdN.js";import{n as i}from"./navigation-context-CQZwH_tC.js";import{t as a}from"./navigation-link-Bxo3-4vo.js";import{a as o,c as s,f as c,o as l,s as u,t as d,u as f}from"./sidebar-layout-Csb6Geq0.js";import{t as p}from"./styled-tooltip-CknPQH4Y.js";e();var m=t();function h({active:e,className:t,children:r}){return(0,m.jsxs)(`span`,{className:n(d,t),children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:u(e)}),(0,m.jsx)(`span`,{className:s(e),children:r})]})}var g=[`[@media(hover:hover)_and_(pointer:fine)]:pointer-events-none`,`[@media(hover:hover)_and_(pointer:fine)]:invisible`,`[@media(hover:hover)_and_(pointer:fine)]:opacity-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:pointer-events-auto`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:visible`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:opacity-100`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:pointer-events-auto`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:visible`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:opacity-100`],_=[`[@media(hover:hover)_and_(pointer:fine)]:opacity-100`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:opacity-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:opacity-0`],v=[`[@media(hover:hover)_and_(pointer:fine)]:min-w-0`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:min-w-[3.75rem]`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:min-w-[3.75rem]`],y=[`[@media(hover:hover)_and_(pointer:fine)]:flex`,`[@media(hover:hover)_and_(pointer:fine)]:group-hover:hidden`,`[@media(hover:hover)_and_(pointer:fine)]:group-focus-within:hidden`];function b(e=!1){return e?`pointer-events-auto visible opacity-100`:n(`pointer-events-auto visible opacity-100`,...g)}function x(e=!1){return e?`opacity-0`:n(`opacity-0`,..._)}function S(e=!1){return e?`min-w-[3.75rem]`:n(`min-w-[3.75rem]`,...v)}function C(e=!1){return e?`hidden`:n(`hidden`,...y)}function w(e,t,n){return t===`/`||n?e===t:e===t||e.startsWith(`${t}/`)}function T({to:e,label:t,end:s=!1,indent:u=!1,testId:d,disabled:g=!1,icon:_,collapsed:v=!1,hoverContent:y,forceActive:x=!1,pinAction:S}){let{currentPath:C}=i(),T=x||w(C,e,s),E=!v&&S!=null,D=(0,m.jsxs)(a,{to:e,end:s,"data-testid":d,tabIndex:g?-1:0,"aria-label":v?t:void 0,"aria-disabled":g||void 0,onClick:e=>{g&&e.preventDefault()},className:n(c({indent:u,collapsed:v}),!v&&(T?l.active:l.idle),g&&`opacity-50`,g&&`pointer-events-none`,E&&`pr-9`),children:[_?v?(0,m.jsx)(h,{active:T,children:_}):(0,m.jsx)(`span`,{className:o,children:_}):null,(0,m.jsx)(`span`,{className:f(v),children:t})]});return v?(0,m.jsx)(p,{content:y??t,placement:`right`,tooltipClassName:y?`p-0 bg-tertiary text-white`:void 0,children:D}):S?(0,m.jsxs)(`div`,{className:`group relative`,children:[D,(0,m.jsx)(`button`,{type:`button`,"data-testid":S.testId,"aria-pressed":S.pinned,"aria-label":S.label,onClick:e=>{e.preventDefault(),e.stopPropagation(),S.onToggle()},className:n(`absolute right-1.5 top-1/2 -translate-y-1/2`,`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`,b(S.pinned)),children:(0,m.jsx)(r,{className:n(`h-3.5 w-3.5`,S.pinned&&`fill-current`),"aria-hidden":!0})})]}):D}export{x as a,S as i,b as n,h as o,C as r,T as t};
@@ -1 +1 @@
1
- import{K as e}from"./utils-BgLSZdyy.js";var t=`https://docs.openhands.dev/openhands/usage/agent-canvas/prebuilt-automations`,n=`https://openhands.dev/joinslack`,r=`openhands-sidebar-onboarding-checklist-dismissed`,i=`openhands-sidebar-onboarding-checklist-dismissed-change`,a=`openhands-sidebar-onboarding-checklist-minimized`,o=`openhands-sidebar-onboarding-checklist-customize-explored`,s=`openhands-sidebar-onboarding-checklist-slack-joined`,c=[`configure-llm`,`start-conversation`,`schedule-task`,`customize-agent`,`connect-mcp`,`join-slack`],l={"configure-llm":`/settings/llm`,"connect-mcp":`/mcp`,"start-conversation":`/conversations`,"schedule-task":`/automations`,"customize-agent":`/settings/agents`},u={"configure-llm":`configure_llm`,"start-conversation":`start_conversation`,"schedule-task":`schedule_task`,"customize-agent":`customize_agent`,"connect-mcp":`connect_mcp`,"join-slack":`join_slack`},d={"configure-llm":`settings`,"start-conversation":`conversation`,"schedule-task":`automation`,"customize-agent":`settings`,"connect-mcp":`integration`,"join-slack":`community`};function f(e){return e===`join-slack`}function p(e){return f(e)?{kind:`external`,href:n}:{kind:`internal`,href:l[e]}}var m={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_CONFIGURE_LLM,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_CONNECT_MCP,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_START_CHAT,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_SCHEDULE_TASK,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_CUSTOMIZE,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_JOIN_SLACK},h={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_CONFIGURE_LLM_DESC,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_CONNECT_MCP_DESC,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_START_CHAT_DESC,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_SCHEDULE_TASK_DESC,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_CUSTOMIZE_DESC,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_JOIN_SLACK_DESC},g={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CONFIGURE_LLM,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CONNECT_MCP,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_START_CHAT,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_SCHEDULE_TASK,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CUSTOMIZE,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_JOIN_SLACK},_={"configure-llm":`https://docs.openhands.dev/openhands/usage/settings/llm-settings#llm-profiles`,"start-conversation":`https://docs.openhands.dev/openhands/usage/agent-canvas/backends`,"schedule-task":t,"customize-agent":`https://docs.openhands.dev/openhands/usage/agent-canvas/customize-and-settings`,"connect-mcp":`https://docs.openhands.dev/overview/model-context-protocol`,"join-slack":`https://docs.openhands.dev/overview/community`};function v(e){return e===`/settings/agents`||e.startsWith(`/settings/agents/`)}function y(){return typeof window>`u`?!1:window.localStorage.getItem(r)===`true`}function b(){return y()}function x(e){let t=()=>e();return window.addEventListener(`storage`,t),window.addEventListener(i,t),()=>{window.removeEventListener(`storage`,t),window.removeEventListener(i,t)}}function S(e){window.localStorage.setItem(r,e?`true`:`false`),window.dispatchEvent(new Event(i))}function C(){return typeof window>`u`?!1:window.localStorage.getItem(a)===`true`}function w(e){window.localStorage.setItem(a,e?`true`:`false`)}function T(){return typeof window>`u`?!1:window.localStorage.getItem(o)===`true`}function E(e){window.localStorage.setItem(o,e?`true`:`false`)}function D(){return typeof window>`u`?!1:window.localStorage.getItem(s)===`true`}function O(e){window.localStorage.setItem(s,e?`true`:`false`)}export{u as _,D as a,f as b,S as c,g as d,h as f,c as g,m as h,C as i,w as l,_ as m,T as n,x as o,d as p,y as r,E as s,b as t,O as u,p as v,v as y};
1
+ import{K as e}from"./utils-CbjwNcR-.js";var t=`https://docs.openhands.dev/openhands/usage/agent-canvas/prebuilt-automations`,n=`https://openhands.dev/joinslack`,r=`openhands-sidebar-onboarding-checklist-dismissed`,i=`openhands-sidebar-onboarding-checklist-dismissed-change`,a=`openhands-sidebar-onboarding-checklist-minimized`,o=`openhands-sidebar-onboarding-checklist-customize-explored`,s=`openhands-sidebar-onboarding-checklist-slack-joined`,c=[`configure-llm`,`start-conversation`,`schedule-task`,`customize-agent`,`connect-mcp`,`join-slack`],l={"configure-llm":`/settings/llm`,"connect-mcp":`/mcp`,"start-conversation":`/conversations`,"schedule-task":`/automations`,"customize-agent":`/settings/agents`},u={"configure-llm":`configure_llm`,"start-conversation":`start_conversation`,"schedule-task":`schedule_task`,"customize-agent":`customize_agent`,"connect-mcp":`connect_mcp`,"join-slack":`join_slack`},d={"configure-llm":`settings`,"start-conversation":`conversation`,"schedule-task":`automation`,"customize-agent":`settings`,"connect-mcp":`integration`,"join-slack":`community`};function f(e){return e===`join-slack`}function p(e){return f(e)?{kind:`external`,href:n}:{kind:`internal`,href:l[e]}}var m={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_CONFIGURE_LLM,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_CONNECT_MCP,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_START_CHAT,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_SCHEDULE_TASK,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_CUSTOMIZE,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_JOIN_SLACK},h={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_CONFIGURE_LLM_DESC,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_CONNECT_MCP_DESC,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_START_CHAT_DESC,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_SCHEDULE_TASK_DESC,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_CUSTOMIZE_DESC,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_JOIN_SLACK_DESC},g={"configure-llm":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CONFIGURE_LLM,"connect-mcp":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CONNECT_MCP,"start-conversation":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_START_CHAT,"schedule-task":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_SCHEDULE_TASK,"customize-agent":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_CUSTOMIZE,"join-slack":e.SIDEBAR$ONBOARDING_CHECKLIST_ACTION_JOIN_SLACK},_={"configure-llm":`https://docs.openhands.dev/openhands/usage/settings/llm-settings#llm-profiles`,"start-conversation":`https://docs.openhands.dev/openhands/usage/agent-canvas/backends`,"schedule-task":t,"customize-agent":`https://docs.openhands.dev/openhands/usage/agent-canvas/customize-and-settings`,"connect-mcp":`https://docs.openhands.dev/overview/model-context-protocol`,"join-slack":`https://docs.openhands.dev/overview/community`};function v(e){return e===`/settings/agents`||e.startsWith(`/settings/agents/`)}function y(){return typeof window>`u`?!1:window.localStorage.getItem(r)===`true`}function b(){return y()}function x(e){let t=()=>e();return window.addEventListener(`storage`,t),window.addEventListener(i,t),()=>{window.removeEventListener(`storage`,t),window.removeEventListener(i,t)}}function S(e){window.localStorage.setItem(r,e?`true`:`false`),window.dispatchEvent(new Event(i))}function C(){return typeof window>`u`?!1:window.localStorage.getItem(a)===`true`}function w(e){window.localStorage.setItem(a,e?`true`:`false`)}function T(){return typeof window>`u`?!1:window.localStorage.getItem(o)===`true`}function E(e){window.localStorage.setItem(o,e?`true`:`false`)}function D(){return typeof window>`u`?!1:window.localStorage.getItem(s)===`true`}function O(e){window.localStorage.setItem(s,e?`true`:`false`)}export{u as _,D as a,f as b,S as c,g as d,h as f,c as g,m as h,C as i,w as l,_ as m,T as n,x as o,d as p,y as r,E as s,b as t,O as u,p as v,v as y};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-BgLSZdyy.js";import{i as s}from"./extension-module-card-classes-DpeaYhYo.js";var c=e(t(),1),l=e(n(),1),u=r(),d=s,f=6,p=8,m=4;function h(e,t){let n=window.innerWidth-p-t,r=e.left;return r>n&&(r=e.right-t),r=Math.min(Math.max(p,r),Math.max(p,n)),{top:e.bottom+m,left:r}}function g(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?f: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 _({pills:e,testId:t}){let{t:n}=i(`openhands`),r=c.useRef(null),d=c.useRef(null),f=c.useRef(null),p=c.useRef(null),[m,_]=c.useState(e.length),[v,y]=c.useState(!1),[b,x]=c.useState(null),S=c.useCallback(()=>{let e=r.current,t=d.current;!e||!t||_(g(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]),C=e.map(e=>e.id).join(``),w=c.useRef(null);c.useLayoutEffect(()=>{w.current!==C&&(w.current=C,y(!1),S())},[C,S]),c.useEffect(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>S());return t.observe(e),()=>t.disconnect()},[S]);let T=c.useCallback(()=>{let e=f.current;if(!e)return;let t=h(e.getBoundingClientRect(),p.current?.offsetWidth??e.offsetWidth);x(e=>e?.top===t.top&&e?.left===t.left?e:t)},[]);if(c.useLayoutEffect(()=>{if(!v){x(null);return}return T(),window.addEventListener(`resize`,T),window.addEventListener(`scroll`,T,!0),()=>{window.removeEventListener(`resize`,T),window.removeEventListener(`scroll`,T,!0)}},[v,T]),c.useLayoutEffect(()=>{v&&b&&p.current&&T()},[v,T,b]),c.useEffect(()=>{if(!v)return;let e=e=>{let t=e.target;f.current?.contains(t)||p.current?.contains(t)||y(!1)},t=e=>{e.key===`Escape`&&y(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]),e.length===0)return null;let E=Math.max(0,e.length-m),D=e.slice(m),O=e=>{e.stopPropagation()};return(0,u.jsxs)(`div`,{"data-testid":`${t}-wrap`,className:`min-w-0 overflow-hidden`,children:[(0,u.jsx)(`div`,{ref:d,"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,u.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id))}),(0,u.jsxs)(`div`,{ref:r,"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,m).map(e=>(0,u.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id)),E>0?(0,u.jsx)(`button`,{ref:f,type:`button`,"data-testid":`${t}-overflow`,"aria-expanded":v,"aria-haspopup":`dialog`,"aria-label":n(a.SETTINGS$SKILLS_PILLS_OVERFLOW_ARIA,{count:E}),onMouseDown:O,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(e=>!e)},onKeyDown:O,className:o(s,`cursor-pointer font-medium text-tertiary-alt hover:text-white`),children:n(a.SETTINGS$SKILLS_PILLS_MORE,{count:E})}):null]}),v&&b&&typeof document<`u`&&(0,l.createPortal)((0,u.jsx)(`div`,{ref:p,role:`dialog`,"data-testid":`${t}-overflow-popover`,className:o(`z-[9999] flex w-max max-w-[20rem] flex-col gap-1.5`,`rounded-md border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface)] p-2 shadow-lg`),style:{position:`fixed`,top:b.top,left:b.left},onMouseDown:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:D.map(e=>(0,u.jsx)(`div`,{"data-testid":`${t}-overflow-item`,className:`min-w-0`,children:e.node},e.id))}),document.body)]})}export{_ as n,d as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-CbjwNcR-.js";import{i as s}from"./extension-module-card-classes-DpeaYhYo.js";var c=e(t(),1),l=e(n(),1),u=r(),d=s,f=6,p=8,m=4;function h(e,t){let n=window.innerWidth-p-t,r=e.left;return r>n&&(r=e.right-t),r=Math.min(Math.max(p,r),Math.max(p,n)),{top:e.bottom+m,left:r}}function g(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?f: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 _({pills:e,testId:t}){let{t:n}=i(`openhands`),r=c.useRef(null),d=c.useRef(null),f=c.useRef(null),p=c.useRef(null),[m,_]=c.useState(e.length),[v,y]=c.useState(!1),[b,x]=c.useState(null),S=c.useCallback(()=>{let e=r.current,t=d.current;!e||!t||_(g(Array.from(t.children).map(e=>e.offsetWidth),e.clientWidth))},[]),C=e.map(e=>e.id).join(``),w=c.useRef(null);c.useLayoutEffect(()=>{w.current!==C&&(w.current=C,y(!1),S())},[C,S]),c.useEffect(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>S());return t.observe(e),()=>t.disconnect()},[S]);let T=c.useCallback(()=>{let e=f.current;if(!e)return;let t=h(e.getBoundingClientRect(),p.current?.offsetWidth??e.offsetWidth);x(e=>e?.top===t.top&&e?.left===t.left?e:t)},[]);if(c.useLayoutEffect(()=>{if(!v){x(null);return}return T(),window.addEventListener(`resize`,T),window.addEventListener(`scroll`,T,!0),()=>{window.removeEventListener(`resize`,T),window.removeEventListener(`scroll`,T,!0)}},[v,T]),c.useLayoutEffect(()=>{v&&b&&p.current&&T()},[v,T,b]),c.useEffect(()=>{if(!v)return;let e=e=>{let t=e.target;f.current?.contains(t)||p.current?.contains(t)||y(!1)},t=e=>{e.key===`Escape`&&y(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]),e.length===0)return null;let E=Math.max(0,e.length-m),D=e.slice(m),O=e=>{e.stopPropagation()};return(0,u.jsxs)(`div`,{"data-testid":`${t}-wrap`,className:`min-w-0 overflow-hidden`,children:[(0,u.jsx)(`div`,{ref:d,"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,u.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id))}),(0,u.jsxs)(`div`,{ref:r,"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,m).map(e=>(0,u.jsx)(`span`,{className:`inline-flex shrink-0`,children:e.node},e.id)),E>0?(0,u.jsx)(`button`,{ref:f,type:`button`,"data-testid":`${t}-overflow`,"aria-expanded":v,"aria-haspopup":`dialog`,"aria-label":n(a.SETTINGS$SKILLS_PILLS_OVERFLOW_ARIA,{count:E}),onMouseDown:O,onClick:e=>{e.preventDefault(),e.stopPropagation(),y(e=>!e)},onKeyDown:O,className:o(s,`cursor-pointer font-medium text-tertiary-alt hover:text-white`),children:n(a.SETTINGS$SKILLS_PILLS_MORE,{count:E})}):null]}),v&&b&&typeof document<`u`&&(0,l.createPortal)((0,u.jsx)(`div`,{ref:p,role:`dialog`,"data-testid":`${t}-overflow-popover`,className:o(`z-[9999] flex w-max max-w-[20rem] flex-col gap-1.5`,`rounded-md border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface)] p-2 shadow-lg`),style:{position:`fixed`,top:b.top,left:b.left},onMouseDown:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:D.map(e=>(0,u.jsx)(`div`,{"data-testid":`${t}-overflow-item`,className:`min-w-0`,children:e.node},e.id))}),document.body)]})}export{_ as n,d as t};
@@ -1 +1 @@
1
- import{n as e,t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";var n=e.map(e=>e.name),r=new Set(n),i=new Set(t);function a(e){return r.has(e)}function o(e){return i.has(e)}function s(e){return e.enabledSkills??[...t]}function c(e){let t=new Set(s(e)),n=new Set(e.disabledSkills??[]);return e=>n.has(e)?!1:!a(e)||t.has(e)}function l(e){if(e.enabledSkills!==void 0)return;let r=new Set(e.disabledSkills??[]);return{enabled_skills:[...r].some(a)?n.filter(e=>!r.has(e)):[...t],disabled_skills:[...r].filter(e=>!a(e))}}function u(e){return{enabledSkills:e.enabled_skills,disabledSkills:e.disabled_skills}}var d=new Map(e.flatMap(e=>[`/${e.name}`,...(e.triggers??[]).filter(e=>e.startsWith(`/`))].map(t=>[t.toLowerCase(),e.name])));function f(e){let t=e?.trim().split(/\s+/,1)[0];if(t?.startsWith(`/`))return d.get(t.toLowerCase())}export{o as a,u as c,a as i,c as n,l as o,f as r,s,n as t};
1
+ import{n as e,t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js";var n=e.map(e=>e.name),r=new Set(n),i=new Set(t);function a(e){return r.has(e)}function o(e){return i.has(e)}function s(e){return e.enabledSkills??[...t]}function c(e){let t=new Set(s(e)),n=new Set(e.disabledSkills??[]);return e=>n.has(e)?!1:!a(e)||t.has(e)}function l(e){if(e.enabledSkills!==void 0)return;let r=new Set(e.disabledSkills??[]);return{enabled_skills:[...r].some(a)?n.filter(e=>!r.has(e)):[...t],disabled_skills:[...r].filter(e=>!a(e))}}function u(e){return{enabledSkills:e.enabled_skills,disabledSkills:e.disabled_skills}}var d=new Map(e.flatMap(e=>[`/${e.name}`,...(e.triggers??[]).filter(e=>e.startsWith(`/`))].map(t=>[t.toLowerCase(),e.name])));function f(e){let t=e?.trim().split(/\s+/,1)[0];if(t?.startsWith(`/`))return d.get(t.toLowerCase())}export{o as a,u as c,a as i,c as n,l as o,f as r,s,n as t};