@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,2 +1,2 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{i as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.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"./bot-ByolqPEr.js";import{t as l}from"./check-Bo8s5Ylg.js";import{n as u,r as d,t as f}from"./wrench-B8Wg_nbp.js";import{t as p}from"./list-filter-B8PQk3RA.js";import{t as ee}from"./plug-7ACOEbMs.js";import{n as te,t as ne}from"./x-CX8lVGwm.js";import{t as re}from"./shield-check-C3Rl0NF8.js";import{r as ie}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";import{t as m}from"./modal-backdrop-BSzNhM4r.js";import{n as ae,t as h}from"./modal-body-C24WsdFb.js";import{n as g}from"./modal-classes-B0b9eiL8.js";import{t as _}from"./brand-button-CUMfjb99.js";import{t as v}from"./modal-close-button-DfqfB2Nj.js";import{a as y}from"./skill-enablement-DXeaImBz.js";import{t as b}from"./checkmark-XZyokq_Y.js";import{t as x}from"./copy-Drmhc2jD.js";import{a as oe,r as se}from"./extension-module-card-classes-DpeaYhYo.js";import{t as ce}from"./settings-switch-DDd1cQ8t.js";import{n as S,t as C}from"./skill-card-pill-row-DfjIfj0K.js";import{n as le}from"./circle-plus-check-toggle-BDX_ctNs.js";import{n as ue,t as w}from"./skill-scope-BE-H9TSZ.js";import{n as T,t as de}from"./use-launch-skill-in-chat-QbXDhiHr.js";import{t as E}from"./skill-icon-badge-0MK_68Nc.js";var fe=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),pe=r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),me=r(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),D=e(t(),1),O=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function he(e){let t=e.match(/^description:\s*\|\s*\r?\n((?:[ \t].*(?:\r?\n|$))+)/m);if(t)return t[1].replace(/^[ \t]+/gm,``).trim();let n=e.match(/^description:\s*['"](.+?)['"]\s*$/m);if(n)return n[1].trim();let r=e.match(/^description:\s*(.+)\s*$/m);return r?r[1].trim():null}function ge(e){let t=e.match(O);return t?e.slice(t[0].length).trim():e.trim()}function _e(e){let t=e.replace(/^#+\s+[^\n]+\n+/,``).trim();return t.split(/\n\s*\n/).map(e=>e.replace(/\s+/g,` `).trim()).find(e=>e.length>0)??t.replace(/\s+/g,` `).trim()}function k(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(O);if(r){let e=he(r[1]);if(e)return e}return _e(ge(n))}var A=n(),ve=`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-text-secondary/35 bg-text-secondary/12 px-2 py-0.5 text-[11px] font-medium leading-4 text-tertiary-light`,ye={agentskills:{labelKey:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:o.SETTINGS$SKILLS_TYPE_REPO}};function be({type:e}){let{t}=a(`openhands`),n=ye[e];return(0,A.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:ve,children:t(n.labelKey)})}var j=[`automations`,`environment`,`code-hosting`,`agent-authoring`,`code-quality`,`integrations`,`writing`,`design`,`other`],M={automations:o.SETTINGS$SKILLS_CATEGORY_AUTOMATIONS,environment:o.SETTINGS$SKILLS_CATEGORY_ENVIRONMENT,"code-hosting":o.SETTINGS$SKILLS_CATEGORY_CODE_HOSTING,"agent-authoring":o.SETTINGS$SKILLS_CATEGORY_AGENT_AUTHORING,"code-quality":o.SETTINGS$SKILLS_CATEGORY_CODE_QUALITY,integrations:o.SETTINGS$SKILLS_CATEGORY_INTEGRATIONS,writing:o.SETTINGS$SKILLS_CATEGORY_WRITING,design:o.SETTINGS$SKILLS_CATEGORY_DESIGN,other:o.SETTINGS$SKILLS_CATEGORY_OTHER},N={automations:u,environment:f,"code-hosting":d,"agent-authoring":c,"code-quality":re,integrations:ee,writing:me,design:pe,other:fe},xe=`other`,Se=new Set(ie);function P(e){let t=e.category;return t&&Se.has(t)?t:xe}function F(e,t,n){if(e)return`${e}-${t}-${n}`}function I(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=P(e),c=[{id:`type-${e.type}`,node:(0,A.jsx)(be,{type:e.type})}];if(y(e.name)&&c.push({id:`recommended`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`recommended`)??`skill-recommended-${e.name}`,className:C,children:t(o.SETTINGS$SKILLS_RECOMMENDED)})}),a!==`other`&&c.push({id:`category-${a}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`category`)??`skill-category-${e.name}`,className:C,children:t(M[a])})}),e.version&&c.push({id:`version-${e.version}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`version`)??`skill-version-${e.name}`,className:C,children:t(o.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&c.push({id:`license-${e.license}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`license`),className:C,children:e.license})}),r===`detail`&&e.compatibility&&c.push({id:`compatibility-${e.compatibility}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`compatibility`),className:C,children:e.compatibility})}),e.disable_model_invocation&&c.push({id:`disable-model-invocation`,node:(0,A.jsxs)(`span`,{"data-testid":F(i,e.name,`disable-model-invocation`)??`skill-disable-model-invocation-${e.name}`,className:`inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium leading-4 text-[#fca5a5]`,children:[(0,A.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(o.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)c.push({id:`allowed-tool-${t}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`tool-${t}`),className:s(C,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))c.push({id:`metadata-${t}`,node:(0,A.jsxs)(`span`,{"data-testid":F(i,e.name,`metadata-${t}`),className:C,children:[(0,A.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])c.push({id:`trigger-${t}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`trigger-${t}`),className:C,children:t})});return c}function L(e){let t=e?.trim();return t?!!(/^https?:\/\//i.test(t)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`~`)||/^[A-Za-z]:[\\/]/.test(t)||t.includes(`/`)||t.includes(`\\`)):!1}function Ce({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[c,l]=D.useState(!1),u=k(e),d=D.useMemo(()=>I(e,i),[e,i]),f=L(e.source);return D.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,A.jsx)(`div`,{"data-testid":`skill-card-${e.name}`,role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:s(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,oe,se),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(E,{skillName:e.name}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,A.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,A.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,A.jsx)(`p`,{"data-testid":`skill-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),f?(0,A.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,A.jsx)(b,{width:12,height:12}):(0,A.jsx)(x,{width:12,height:12})}):null]}):null]}),(0,A.jsx)(le,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:o.COMMON$DISABLE})]}),u?(0,A.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,A.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:u})}):null,d.length>0?(0,A.jsx)(S,{pills:d,testId:`skill-triggers-${e.name}`}):null]})]})})}var we=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,R=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`;function Te(e){return e.name===`add-skill`?R:`/${e.name} `}function Ee({testId:e,label:t,value:n}){return(0,A.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,A.jsx)(`span`,{className:`text-sm`,children:t}),(0,A.jsx)(`textarea`,{"data-testid":e,readOnly:!0,value:n,rows:Math.min(12,Math.max(4,n.split(`
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{i as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.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"./bot-ByolqPEr.js";import{t as l}from"./check-Bo8s5Ylg.js";import{n as u,r as d,t as f}from"./wrench-B8Wg_nbp.js";import{t as p}from"./list-filter-B8PQk3RA.js";import{t as ee}from"./plug-7ACOEbMs.js";import{n as te,t as ne}from"./x-CX8lVGwm.js";import{t as re}from"./shield-check-C3Rl0NF8.js";import{r as ie}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js";import{t as m}from"./modal-backdrop-BSzNhM4r.js";import{n as ae,t as h}from"./modal-body-B_95ci1c.js";import{n as g}from"./modal-classes-BPcBCWVj.js";import{t as _}from"./brand-button-CGUwj6zK.js";import{t as v}from"./modal-close-button-Cq3dma5u.js";import{a as y}from"./skill-enablement-BBKya60C.js";import{t as b}from"./checkmark-XZyokq_Y.js";import{t as x}from"./copy-Drmhc2jD.js";import{a as oe,r as se}from"./extension-module-card-classes-DpeaYhYo.js";import{t as ce}from"./settings-switch-CI93Iozg.js";import{n as S,t as C}from"./skill-card-pill-row-CxOFySng.js";import{n as le}from"./circle-plus-check-toggle-ZOXpJ3I2.js";import{n as ue,t as w}from"./skill-scope-C0NxJnpT.js";import{n as T,t as de}from"./use-launch-skill-in-chat-QbXDhiHr.js";import{t as E}from"./skill-icon-badge-CVxE42yg.js";var fe=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),pe=r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),me=r(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),D=e(t(),1),O=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function he(e){let t=e.match(/^description:\s*\|\s*\r?\n((?:[ \t].*(?:\r?\n|$))+)/m);if(t)return t[1].replace(/^[ \t]+/gm,``).trim();let n=e.match(/^description:\s*['"](.+?)['"]\s*$/m);if(n)return n[1].trim();let r=e.match(/^description:\s*(.+)\s*$/m);return r?r[1].trim():null}function ge(e){let t=e.match(O);return t?e.slice(t[0].length).trim():e.trim()}function _e(e){let t=e.replace(/^#+\s+[^\n]+\n+/,``).trim();return t.split(/\n\s*\n/).map(e=>e.replace(/\s+/g,` `).trim()).find(e=>e.length>0)??t.replace(/\s+/g,` `).trim()}function k(e){let t=e.description?.trim();if(t)return t;let n=e.content?.trim();if(!n)return``;let r=n.match(O);if(r){let e=he(r[1]);if(e)return e}return _e(ge(n))}var A=n(),ve=`inline-flex shrink-0 items-center whitespace-nowrap rounded-full border border-text-secondary/35 bg-text-secondary/12 px-2 py-0.5 text-[11px] font-medium leading-4 text-tertiary-light`,ye={agentskills:{labelKey:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS},knowledge:{labelKey:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE},repo:{labelKey:o.SETTINGS$SKILLS_TYPE_REPO}};function be({type:e}){let{t}=a(`openhands`),n=ye[e];return(0,A.jsx)(`span`,{"data-testid":`skill-type-badge-${e}`,className:ve,children:t(n.labelKey)})}var j=[`automations`,`environment`,`code-hosting`,`agent-authoring`,`code-quality`,`integrations`,`writing`,`design`,`other`],M={automations:o.SETTINGS$SKILLS_CATEGORY_AUTOMATIONS,environment:o.SETTINGS$SKILLS_CATEGORY_ENVIRONMENT,"code-hosting":o.SETTINGS$SKILLS_CATEGORY_CODE_HOSTING,"agent-authoring":o.SETTINGS$SKILLS_CATEGORY_AGENT_AUTHORING,"code-quality":o.SETTINGS$SKILLS_CATEGORY_CODE_QUALITY,integrations:o.SETTINGS$SKILLS_CATEGORY_INTEGRATIONS,writing:o.SETTINGS$SKILLS_CATEGORY_WRITING,design:o.SETTINGS$SKILLS_CATEGORY_DESIGN,other:o.SETTINGS$SKILLS_CATEGORY_OTHER},N={automations:u,environment:f,"code-hosting":d,"agent-authoring":c,"code-quality":re,integrations:ee,writing:me,design:pe,other:fe},xe=`other`,Se=new Set(ie);function P(e){let t=e.category;return t&&Se.has(t)?t:xe}function F(e,t,n){if(e)return`${e}-${t}-${n}`}function I(e,t,n={}){let{variant:r=`card`,testIdPrefix:i}=n,a=P(e),c=[{id:`type-${e.type}`,node:(0,A.jsx)(be,{type:e.type})}];if(y(e.name)&&c.push({id:`recommended`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`recommended`)??`skill-recommended-${e.name}`,className:C,children:t(o.SETTINGS$SKILLS_RECOMMENDED)})}),a!==`other`&&c.push({id:`category-${a}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`category`)??`skill-category-${e.name}`,className:C,children:t(M[a])})}),e.version&&c.push({id:`version-${e.version}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`version`)??`skill-version-${e.name}`,className:C,children:t(o.SETTINGS$SKILLS_VERSION,{version:e.version})})}),r===`detail`&&e.license&&c.push({id:`license-${e.license}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`license`),className:C,children:e.license})}),r===`detail`&&e.compatibility&&c.push({id:`compatibility-${e.compatibility}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`compatibility`),className:C,children:e.compatibility})}),e.disable_model_invocation&&c.push({id:`disable-model-invocation`,node:(0,A.jsxs)(`span`,{"data-testid":F(i,e.name,`disable-model-invocation`)??`skill-disable-model-invocation-${e.name}`,className:`inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-[rgba(248,113,113,0.35)] bg-[rgba(248,113,113,0.12)] px-2 py-0.5 text-[11px] font-medium leading-4 text-[#fca5a5]`,children:[(0,A.jsx)(`span`,{className:`size-1.5 rounded-full bg-[#fca5a5]`}),t(o.SETTINGS$SKILLS_DISABLE_MODEL_INVOCATION)]})}),r===`detail`&&e.allowed_tools)for(let t of e.allowed_tools)c.push({id:`allowed-tool-${t}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`tool-${t}`),className:s(C,`font-mono`),children:t})});if(r===`detail`&&e.metadata)for(let[t,n]of Object.entries(e.metadata))c.push({id:`metadata-${t}`,node:(0,A.jsxs)(`span`,{"data-testid":F(i,e.name,`metadata-${t}`),className:C,children:[(0,A.jsxs)(`span`,{className:`font-mono text-[10px] text-tertiary-light`,children:[t,`:`]}),` `,n]})});for(let t of e.triggers??[])c.push({id:`trigger-${t}`,node:(0,A.jsx)(`span`,{"data-testid":F(i,e.name,`trigger-${t}`),className:C,children:t})});return c}function L(e){let t=e?.trim();return t?!!(/^https?:\/\//i.test(t)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`~`)||/^[A-Za-z]:[\\/]/.test(t)||t.includes(`/`)||t.includes(`\\`)):!1}function Ce({skill:e,enabled:t,onOpen:n,onToggle:r}){let{t:i}=a(`openhands`),[c,l]=D.useState(!1),u=k(e),d=D.useMemo(()=>I(e,i),[e,i]),f=L(e.source);return D.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,A.jsx)(`div`,{"data-testid":`skill-card-${e.name}`,role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:s(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,oe,se),children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(E,{skillName:e.name}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,A.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h3`,{"data-testid":`skill-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,A.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,A.jsx)(`p`,{"data-testid":`skill-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),f?(0,A.jsx)(`button`,{type:`button`,"data-testid":`skill-copy-source-${e.name}`,"aria-label":i(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async t=>{t.stopPropagation(),e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,A.jsx)(b,{width:12,height:12}):(0,A.jsx)(x,{width:12,height:12})}):null]}):null]}),(0,A.jsx)(le,{testId:`skill-toggle-${e.name}`,isSelected:t,onToggle:r,disableTooltipKey:o.COMMON$DISABLE})]}),u?(0,A.jsx)(`div`,{"data-testid":`skill-description-${e.name}`,className:`min-w-0`,children:(0,A.jsx)(`p`,{className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:u})}):null,d.length>0?(0,A.jsx)(S,{pills:d,testId:`skill-triggers-${e.name}`}):null]})]})})}var we=`https://docs.openhands.dev/overview/skills/adding#adding-new-skills`,R=`/add-skill https://github.com/OpenHands/extensions/tree/main/skills/codereview`;function Te(e){return e.name===`add-skill`?R:`/${e.name} `}function Ee({testId:e,label:t,value:n}){return(0,A.jsxs)(`label`,{className:`flex min-w-0 w-full flex-col gap-2.5`,children:[(0,A.jsx)(`span`,{className:`text-sm`,children:t}),(0,A.jsx)(`textarea`,{"data-testid":e,readOnly:!0,value:n,rows:Math.min(12,Math.max(4,n.split(`
2
2
  `).length)),className:s(`bg-[var(--oh-surface-raised)] border border-[var(--oh-border-subtle)] w-full min-w-0 rounded-sm p-2 text-sm`,`cursor-not-allowed resize-none custom-scrollbar`)})]})}function De({skill:e,enabled:t,onToggle:n,onClose:r}){let{t:i}=a(`openhands`),s=de(),[c,l]=D.useState(!1),u=D.useMemo(()=>Te(e),[e]),d=k(e),f=D.useMemo(()=>I(e,i,{variant:`detail`,testIdPrefix:`skill-modal-pill`}),[e,i]),p=L(e.source);return D.useEffect(()=>{if(!c)return;let e=setTimeout(()=>l(!1),2e3);return()=>clearTimeout(e)},[c]),(0,A.jsx)(m,{onClose:r,"aria-label":e.name,children:(0,A.jsxs)(`div`,{"data-testid":`skill-detail-modal`,"data-skill-name":e.name,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col overflow-hidden rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,A.jsx)(v,{onClose:r,testId:`skill-detail-modal-close`}),(0,A.jsxs)(`header`,{className:`flex flex-shrink-0 items-start gap-3 pb-4 pl-6 pr-12 pt-6`,children:[(0,A.jsx)(E,{skillName:e.name}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h2`,{"data-testid":`skill-modal-name-${e.name}`,className:g,children:e.name}),e.source?(0,A.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[(0,A.jsx)(`p`,{"data-testid":`skill-modal-source-${e.name}`,className:`min-w-0 flex-1 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),p?(0,A.jsx)(`button`,{type:`button`,"data-testid":`skill-modal-copy-source-${e.name}`,"aria-label":i(c?o.BUTTON$COPIED:o.SETTINGS$SKILLS_COPY_PATH),disabled:c,onClick:async()=>{e.source&&(await navigator.clipboard.writeText(e.source),l(!0))},className:`shrink-0 cursor-pointer border-0 bg-transparent p-0.5 text-tertiary-alt hover:text-white disabled:cursor-default [&_path]:fill-current`,children:c?(0,A.jsx)(b,{width:12,height:12}):(0,A.jsx)(x,{width:12,height:12})}):null]}):null]})]}),(0,A.jsxs)(`div`,{"data-testid":`skill-detail-modal-content`,className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain px-6 custom-scrollbar-always`,children:[(0,A.jsx)(`div`,{"data-testid":`skill-modal-enable-row-${e.name}`,className:`flex w-full items-center rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:(0,A.jsx)(ce,{testId:`skill-modal-toggle-${e.name}`,isToggled:t,onToggle:n,togglePosition:`right`,children:i(t?o.SETTINGS$SKILLS_ENABLED:o.SETTINGS$SKILLS_DISABLED)})}),d?(0,A.jsx)(`p`,{"data-testid":`skill-modal-description-${e.name}`,className:`break-words whitespace-pre-line text-xs text-tertiary-light`,children:d}):null,f.length>0?(0,A.jsx)(S,{pills:f,testId:`skill-modal-pills-${e.name}`}):null,e.content?(0,A.jsx)(Ee,{testId:`skill-modal-field-content-${e.name}`,label:i(o.SETTINGS$SKILLS_CONTENT),value:e.content}):null]}),(0,A.jsxs)(`footer`,{"data-testid":`skill-detail-modal-actions`,className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,A.jsx)(_,{type:`button`,variant:`secondary`,onClick:r,testId:`skill-detail-close`,children:i(o.BUTTON$CLOSE)}),(0,A.jsx)(_,{type:`button`,variant:`primary`,isDisabled:!t,onClick:()=>s(u,r),testId:`skill-detail-use-skill-${e.name}`,startContent:(0,A.jsx)(T,{className:`size-4`,"aria-hidden":!0}),children:i(o.SETTINGS$SKILLS_USE_SKILL_BUTTON)})]})]})})}var Oe=[o.SETTINGS$SKILLS_ADD_MODAL_STEP_1,o.SETTINGS$SKILLS_ADD_MODAL_STEP_2,o.SETTINGS$SKILLS_ADD_MODAL_STEP_3,o.SETTINGS$SKILLS_ADD_MODAL_STEP_4,o.SETTINGS$SKILLS_ADD_MODAL_STEP_5],z={cmd:(0,A.jsx)(B,{}),path:(0,A.jsx)(B,{}),env:(0,A.jsx)(B,{})};function B({children:e}){return(0,A.jsx)(`code`,{className:s(`mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white`),children:e})}function V(){let{t:e}=a(`openhands`),[t,n]=D.useState(!1);return D.useEffect(()=>{if(!t)return;let e=setTimeout(()=>n(!1),2e3);return()=>clearTimeout(e)},[t]),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`pre`,{"data-testid":`add-skill-modal-example`,className:s(`overflow-x-auto rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] p-2 pr-10 text-xs text-white`),children:R}),(0,A.jsx)(`button`,{type:`button`,"data-testid":`add-skill-modal-example-copy`,"aria-label":e(t?o.BUTTON$COPIED:o.BUTTON$COPY),disabled:t,onClick:async()=>{await navigator.clipboard.writeText(R),n(!0)},className:s(`absolute right-2 top-2 cursor-pointer rounded-sm border border-[var(--oh-border-subtle)]`,`bg-base-secondary p-1 text-tertiary-alt transition-colors`,`hover:bg-[var(--oh-surface)] hover:text-white disabled:cursor-default [&_path]:fill-current`),children:t?(0,A.jsx)(b,{width:14,height:14}):(0,A.jsx)(x,{width:14,height:14})})]})}function H({i18nKey:e}){return(0,A.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:(0,A.jsx)(i,{ns:`openhands`,i18nKey:e,components:z})})}function ke({onClose:e}){let{t}=a(`openhands`);return(0,A.jsx)(m,{onClose:e,"aria-label":t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE),children:(0,A.jsxs)(`div`,{"data-testid":`add-skill-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,A.jsx)(v,{onClose:e,testId:`add-skill-modal-close`}),(0,A.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,A.jsx)(`h2`,{className:s(`pr-6`,g),children:t(o.SETTINGS$SKILLS_ADD_MODAL_TITLE)}),(0,A.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_INTRO)})]}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,A.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_CHAT_TITLE)}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_CHAT_BODY}),(0,A.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_EXAMPLE_LABEL)}),(0,A.jsx)(V,{}),(0,A.jsx)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs leading-relaxed text-tertiary-light`,children:Oe.map(e=>(0,A.jsx)(`li`,{children:e===o.SETTINGS$SKILLS_ADD_MODAL_STEP_3?(0,A.jsx)(i,{ns:`openhands`,i18nKey:e,components:z}):t(e)},e))})]}),(0,A.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS_TITLE)}),(0,A.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_URL_FORMATS)})]}),(0,A.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_TITLE)}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_STORAGE_BODY})]}),(0,A.jsx)(H,{i18nKey:o.SETTINGS$SKILLS_ADD_MODAL_PRIVATE_REPOS}),(0,A.jsx)(`a`,{href:we,target:`_blank`,rel:`noreferrer`,"data-testid":`add-skill-modal-docs-link`,className:`self-start text-xs text-[var(--oh-muted)] transition-colors hover:text-white hover:underline`,children:t(o.SETTINGS$SKILLS_ADD_MODAL_VIEW_DOCS)})]}),(0,A.jsx)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:(0,A.jsx)(_,{type:`button`,variant:`secondary`,onClick:e,testId:`add-skill-modal-dismiss`,children:t(o.BUTTON$CLOSE)})})]})})}function Ae({search:e,onSearchChange:t,activeFilterCount:n,onOpenFilters:r}){let{t:i}=a(`openhands`);return(0,A.jsxs)(`div`,{"data-testid":`skills-toolbar`,className:`flex items-stretch gap-2`,children:[(0,A.jsxs)(`div`,{className:s(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,A.jsx)(te,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,A.jsx)(`input`,{"data-testid":`skills-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),"aria-label":i(o.SETTINGS$SKILLS_SEARCH_PLACEHOLDER),className:s(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,A.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(o.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,A.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,A.jsxs)(`button`,{type:`button`,"data-testid":`skills-filters-button`,onClick:r,className:s(`flex shrink-0 items-center gap-2 rounded-lg px-3 py-2 text-sm md:hidden`,`border border-[var(--oh-border)] bg-base-secondary text-white`,`cursor-pointer hover:bg-[var(--oh-interactive-hover)]`),children:[(0,A.jsx)(p,{className:`size-4 shrink-0`,"aria-hidden":!0}),i(o.SETTINGS$SKILLS_FILTERS_BUTTON),n>0?(0,A.jsx)(`span`,{className:`rounded-full bg-white px-1.5 text-[11px] font-medium text-black`,children:n}):null]})]})}function je({labelKey:e,count:t,checked:n,disabled:r,icon:i,testId:o,onToggle:c}){let{t:u}=a(`openhands`),d=u(e);return(0,A.jsxs)(`button`,{type:`button`,role:`checkbox`,"aria-checked":n,"data-testid":o,disabled:r,onClick:c,className:s(`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm`,r?`cursor-default text-tertiary-alt/40`:`cursor-pointer hover:bg-[var(--oh-surface-raised)] hover:text-white`,n?`text-white`:`text-tertiary-light`),children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:s(`flex size-3.5 shrink-0 items-center justify-center rounded-[3px] border`,n?`border-white bg-white text-black`:`border-[var(--oh-border)]`),children:n?(0,A.jsx)(l,{className:`size-2.5`,strokeWidth:3}):null}),i?(0,A.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,(0,A.jsx)(`span`,{title:d,className:`min-w-0 flex-1 truncate`,children:d}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-tertiary-alt`,children:t})]})}function Me(e,t){if(e===`category`)return N[t]}function U({groups:e,onToggle:t,className:n}){let{t:r}=a(`openhands`);return e.length===0?null:(0,A.jsx)(`div`,{"data-testid":`skill-facet-rail`,className:s(`flex min-w-0 flex-col gap-5`,n),children:e.map(e=>{let n=`skill-facet-group-${e.id}-title`;return(0,A.jsxs)(`div`,{"data-testid":`skill-facet-group-${e.id}`,role:`group`,"aria-labelledby":n,className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{id:n,className:`px-1 text-[11px] font-semibold uppercase tracking-wider text-tertiary-alt`,children:r(e.labelKey)}),e.rows.map(n=>(0,A.jsx)(je,{testId:`skill-facet-${e.id}-${n.value}`,labelKey:n.labelKey,count:n.count,checked:n.checked,disabled:n.disabled,icon:Me(e.id,n.value),onToggle:()=>t(e.id,n.value)},n.value))]},e.id)})})}function Ne({groups:e,activeCount:t,onToggle:n,onClearAll:r,onClose:i}){let{t:c}=a(`openhands`);return(0,A.jsx)(m,{onClose:i,"aria-label":c(o.SETTINGS$SKILLS_FILTERS_MODAL_TITLE),children:(0,A.jsxs)(ae,{testID:`skill-filters-modal`,className:s(`items-stretch`,h),children:[(0,A.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:c(o.SETTINGS$SKILLS_FILTERS_MODAL_TITLE)}),(0,A.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto custom-scrollbar-always`,children:(0,A.jsx)(U,{groups:e,onToggle:n})}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[t>0?(0,A.jsx)(_,{type:`button`,variant:`secondary`,testId:`skill-filters-modal-clear`,onClick:r,children:c(o.SETTINGS$SKILLS_CLEAR_FILTERS)}):null,(0,A.jsx)(_,{type:`button`,variant:`primary`,testId:`skill-filters-modal-done`,onClick:i,children:c(o.BUTTON$CLOSE)})]})]})})}var Pe=`source`,Fe=`category`,Ie=`type`,Le=`state`,Re=`recommendation`,W=[`enabled`,`disabled`],G=[`recommended`,`other`],K=[`agentskills`,`knowledge`,`repo`],q={query:``,sources:new Set,categories:new Set,types:new Set,states:new Set,recommendations:new Set};function J(e,t){return e.map(e=>({value:e,labelKey:t[e]}))}function Y(e,t){return new Set(e.filter(e=>t.has(e)))}var ze={project:o.SETTINGS$SKILLS_SOURCE_PROJECT,personal:o.SETTINGS$SKILLS_SOURCE_PERSONAL,public:o.SETTINGS$SKILLS_SOURCE_PUBLIC},Be={agentskills:o.SETTINGS$SKILLS_TYPE_AGENTSKILLS,knowledge:o.SETTINGS$SKILLS_TYPE_KNOWLEDGE,repo:o.SETTINGS$SKILLS_TYPE_REPO},Ve={enabled:o.SETTINGS$SKILLS_ENABLED,disabled:o.SETTINGS$SKILLS_DISABLED},He={recommended:o.SETTINGS$SKILLS_RECOMMENDED,other:o.SETTINGS$SKILLS_RECOMMENDATION_OTHER},X=[{id:`state`,labelKey:o.SETTINGS$SKILLS_FACET_STATE,param:Le,values:J(W,Ve),valueOf:(e,t)=>t(e)?`enabled`:`disabled`,selected:e=>e.states,withSelected:(e,t)=>({...e,states:Y(W,t)})},{id:`recommendation`,labelKey:o.SETTINGS$SKILLS_FACET_RECOMMENDATION,param:Re,values:J(G,He),valueOf:e=>y(e.name)?`recommended`:`other`,selected:e=>e.recommendations,withSelected:(e,t)=>({...e,recommendations:Y(G,t)})},{id:`source`,labelKey:o.SETTINGS$SKILLS_FACET_SOURCE,param:Pe,values:J(w,ze),valueOf:e=>ue(e),selected:e=>e.sources,withSelected:(e,t)=>({...e,sources:Y(w,t)})},{id:`category`,labelKey:o.SETTINGS$SKILLS_FACET_CATEGORY,param:Fe,values:J(j,M),valueOf:e=>P(e),selected:e=>e.categories,withSelected:(e,t)=>({...e,categories:Y(j,t)})},{id:`type`,labelKey:o.SETTINGS$SKILLS_FACET_TYPE,param:Ie,values:J(K,Be),valueOf:e=>e.type,selected:e=>e.types,withSelected:(e,t)=>({...e,types:Y(K,t)})}];function Ue(e){let t=X.find(t=>t.id===e);if(!t)throw Error(`Unknown skill facet group: ${e}`);return t}function We(e,t){let n=new Set(t.values.map(({value:e})=>e));return new Set(e.map(e=>e.trim()).filter(e=>n.has(e)))}function Ge(e){return X.reduce((t,n)=>n.withSelected(t,We(e.getAll(n.param),n)),{...q,query:e.get(`q`)??``})}function Ke(e){let t=new URLSearchParams;e.query&&t.set(`q`,e.query);for(let n of X){let r=n.selected(e);for(let{value:e}of n.values)r.has(e)&&t.append(n.param,e)}return t}function Z(e,t){let n=t.trim();if(!n)return!0;let r=[e.name,k(e),e.description??``,e.content??``,e.license??``,e.compatibility??``,...e.triggers??[],...e.allowed_tools??[]],i=n.toLowerCase();return r.some(e=>e.toLowerCase().includes(i))}function Q(e,t,n,r){return X.every(i=>{if(i.id===r)return!0;let a=i.selected(n);return a.size===0?!0:a.has(i.valueOf(e,t))})}function qe(e,t,n){return e.filter(e=>Z(e,n.query)&&Q(e,t,n))}function $(e,t,n){let r={};for(let i of e){let e=t.valueOf(i,n);r[e]=(r[e]??0)+1}return r}function Je(e,t,n,r,i){let a=$(t,e,r),o=e.values.filter(({value:e})=>(a[e]??0)>0),s=e.selected(i);if(o.length<2&&s.size===0)return null;let c=e.values.filter(({value:e})=>(a[e]??0)>0||s.has(e)),l=$(n.filter(t=>Q(t,r,i,e.id)),e,r);return{id:e.id,labelKey:e.labelKey,rows:c.map(({value:e,labelKey:t})=>{let n=l[e]??0,r=s.has(e);return{value:e,labelKey:t,count:n,checked:r,disabled:n===0&&!r}})}}function Ye(e,t,n){let r=e.filter(e=>Z(e,n.query));return X.map(i=>Je(i,e,r,t,n)).filter(e=>e!==null)}function Xe(e,t,n){let r=Ue(t);if(!r.values.some(e=>e.value===n))return e;let i=new Set(r.selected(e));return i.has(n)?i.delete(n):i.add(n),r.withSelected(e,i)}function Ze(e){return{...q,query:e.query}}function Qe(e){return X.reduce((t,n)=>t+n.selected(e).size,0)}export{Qe as a,Xe as c,Ae as d,ke as f,Ze as i,Ne as l,Ce as m,qe as n,Ge as o,De as p,Ye as r,Ke as s,q as t,U as u};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-BgLSZdyy.js";import{t as n}from"./skills-B0IliMxw.js";var r=e();function i({skillName:e,className:i}){return(0,r.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:t(`inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden`,`rounded-lg border border-white/10 bg-surface-raised text-white`,`shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,`[&>svg]:h-5 [&>svg]:w-5`,i),children:(0,r.jsx)(n,{})})}export{i as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-CbjwNcR-.js";import{t as n}from"./skills-B0IliMxw.js";var r=e();function i({skillName:e,className:i}){return(0,r.jsx)(`span`,{"aria-hidden":`true`,title:e,"data-testid":`skill-icon-${e}`,className:t(`inline-flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden`,`rounded-lg border border-white/10 bg-surface-raised text-white`,`shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,`[&>svg]:h-5 [&>svg]:w-5`,i),children:(0,r.jsx)(n,{})})}export{i as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useTranslation-CCgUjPJF.js";import{dt as r,n as i,st as a}from"./active-backend-context-BnH4-L8h.js";import{K as o}from"./utils-BgLSZdyy.js";import{c as s,n as c}from"./agent-server-client-options-EHB23gyx.js";import{s as l}from"./agent-server-config-C_x8Otd9.js";import{d as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as d}from"./proxy-XP6U1Dhv.js";import{n as f}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";import{n as p}from"./use-settings-C2KKQKVC.js";import{t as m}from"./use-save-settings-Dapkf4cC.js";import{i as h,n as g,s as _,t as v}from"./skill-enablement-DXeaImBz.js";var y=100;function b(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud skills call requires a cloud backend.`);return e}async function x(){let e=b(),t=[],n=null;do{let r=new URLSearchParams({limit:String(y)});n&&r.set(`page_id`,n);let i=await d({backend:e,method:`GET`,path:`/api/v1/skills/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}async function S(e){return((await d({backend:b(),method:`GET`,path:`/api/v1/app-conversations/${e}/skills`}))?.skills??[]).map(e=>({...e,source:null}))}function C(e){return{name:e.name,type:`knowledge`,source:`public`,description:e.description,triggers:e.triggers,category:e.category,content:e.content,license:e.license??null,compatibility:e.compatibility??null}}var w=f.map(C),T=class{static async getSkills(e){if(s().backend.kind===`cloud`)return x();let t=[];try{t=(await new u(c()).getSkills({load_public:!1,load_user:!0,load_project:!0,load_org:!1,project_dir:e??l()})).skills??[]}catch{}return[...t,...w]}static getConversationSkills(e){return S(e)}},E=e(t(),1);function D(e,t){return{enabledSkills:t?e?.enabled_skills:[...v],disabledSkills:e?.disabled_skills??[]}}function O(){let{backend:e}=i(),{data:t}=p(),n=e.kind!==`cloud`;return E.useMemo(()=>{let e=g(D(t,n));return t=>e(t.name)},[t?.enabled_skills,t?.disabled_skills,n])}function k(e){return JSON.stringify([[..._(e)].sort(),[...e.disabledSkills??[]].sort()])}function A(e,t,n){return e.includes(t)===n?e:n?[...e,t]:e.filter(e=>e!==t)}function j(){let{t:e}=n(`openhands`),{backend:t}=i(),s=t.kind!==`cloud`,{data:c,isLoading:l}=p(),{mutate:u}=m(),[d,f]=E.useState({}),v=E.useRef(null);return E.useEffect(()=>{if(l||!c)return;let e=D(c,s);v.current=k(e),f(e)},[l,c?.enabled_skills,c?.disabled_skills,s]),E.useEffect(()=>{let t=k(d);if(v.current===null||v.current===t)return;v.current=t;let n=d.disabledSkills??[];u(s?{enabled_skills:_(d),disabled_skills:n}:{disabled_skills:n},{onError:t=>{a(r(t)||e(o.ERROR$GENERIC))}})},[d,s,u,e]),{isEnabled:E.useMemo(()=>{let e=g(d);return t=>e(t.name)},[d]),setEnabled:E.useCallback((e,t)=>{f(n=>{let r=s&&h(e);return{enabledSkills:r?A(_(n),e,t):n.enabledSkills,disabledSkills:A(n.disabledSkills??[],e,!t&&!r)}})},[s])}}var M=[`project`,`personal`,`public`],N=[`/.agents/skills/`,`/.openhands/skills/`,`/.openhands/microagents/`];function P(e){return e.replace(/\\/g,`/`)}function F(e){let t=P(e).toLowerCase();return t===`public`?!0:t.includes(`public-skills`)||t.includes(`/.openhands/cache/skills/`)}function I(e){let t=P(e);return/^\/Users\/[^/]+\/\.(agents|openhands)\//.test(t)||/^\/home\/[^/]+\/\.(agents|openhands)\//.test(t)?!0:N.some(e=>{let n=t.indexOf(e);if(n===-1)return!1;let r=t.slice(0,n);return/^\/Users\/[^/]+$/.test(r)||/^\/home\/[^/]+$/.test(r)})}function L(e,t){let n=P(e);if(!N.some(e=>n.includes(e))||I(e))return!1;if(t){let e=P(t).replace(/\/$/,``);if(n.startsWith(e))return!0}return!0}function R(e,t){let n=e.source?.trim();if(!n)return e.type===`repo`?`project`:`public`;let r=n.toLowerCase();return F(n)?`public`:r===`user`||r===`global`?`personal`:r===`project`||r===`repo`||r===`sandbox`?`project`:I(n)?`personal`:L(n,t)?`project`:`public`}function z(e,t){let n={project:[],personal:[],public:[]};for(let r of e)n[R(r,t)].push(r);for(let e of M)n[e].sort((e,t)=>e.name.localeCompare(t.name));return n}export{j as a,O as i,R as n,T as o,z as r,M as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useTranslation-CCgUjPJF.js";import{dt as r,n as i,st as a}from"./active-backend-context-BETEdaJl.js";import{K as o}from"./utils-CbjwNcR-.js";import{c as s,n as c}from"./agent-server-client-options-EHB23gyx.js";import{s as l}from"./agent-server-config-C_x8Otd9.js";import{d as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as d}from"./proxy-BCCQUna8.js";import{n as f}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js";import{n as p}from"./use-settings-D69cw06D.js";import{t as m}from"./use-save-settings-CmX41wlf.js";import{i as h,n as g,s as _,t as v}from"./skill-enablement-BBKya60C.js";var y=100;function b(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud skills call requires a cloud backend.`);return e}async function x(){let e=b(),t=[],n=null;do{let r=new URLSearchParams({limit:String(y)});n&&r.set(`page_id`,n);let i=await d({backend:e,method:`GET`,path:`/api/v1/skills/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}async function S(e){return((await d({backend:b(),method:`GET`,path:`/api/v1/app-conversations/${e}/skills`}))?.skills??[]).map(e=>({...e,source:null}))}function C(e){return{name:e.name,type:`knowledge`,source:`public`,description:e.description,triggers:e.triggers,category:e.category,content:e.content,license:e.license??null,compatibility:e.compatibility??null}}var w=f.map(C),T=class{static async getSkills(e){if(s().backend.kind===`cloud`)return x();let t=[];try{t=(await new u(c()).getSkills({load_public:!1,load_user:!0,load_project:!0,load_org:!1,project_dir:e??l()})).skills??[]}catch{}return[...t,...w]}static getConversationSkills(e){return S(e)}},E=e(t(),1);function D(e,t){return{enabledSkills:t?e?.enabled_skills:[...v],disabledSkills:e?.disabled_skills??[]}}function O(){let{backend:e}=i(),{data:t}=p(),n=e.kind!==`cloud`;return E.useMemo(()=>{let e=g(D(t,n));return t=>e(t.name)},[t?.enabled_skills,t?.disabled_skills,n])}function k(e){return JSON.stringify([[..._(e)].sort(),[...e.disabledSkills??[]].sort()])}function A(e,t,n){return e.includes(t)===n?e:n?[...e,t]:e.filter(e=>e!==t)}function j(){let{t:e}=n(`openhands`),{backend:t}=i(),s=t.kind!==`cloud`,{data:c,isLoading:l}=p(),{mutate:u}=m(),[d,f]=E.useState({}),v=E.useRef(null);return E.useEffect(()=>{if(l||!c)return;let e=D(c,s);v.current=k(e),f(e)},[l,c?.enabled_skills,c?.disabled_skills,s]),E.useEffect(()=>{let t=k(d);if(v.current===null||v.current===t)return;v.current=t;let n=d.disabledSkills??[];u(s?{enabled_skills:_(d),disabled_skills:n}:{disabled_skills:n},{onError:t=>{a(r(t)||e(o.ERROR$GENERIC))}})},[d,s,u,e]),{isEnabled:E.useMemo(()=>{let e=g(d);return t=>e(t.name)},[d]),setEnabled:E.useCallback((e,t)=>{f(n=>{let r=s&&h(e);return{enabledSkills:r?A(_(n),e,t):n.enabledSkills,disabledSkills:A(n.disabledSkills??[],e,!t&&!r)}})},[s])}}var M=[`project`,`personal`,`public`],N=[`/.agents/skills/`,`/.openhands/skills/`,`/.openhands/microagents/`];function P(e){return e.replace(/\\/g,`/`)}function F(e){let t=P(e).toLowerCase();return t===`public`?!0:t.includes(`public-skills`)||t.includes(`/.openhands/cache/skills/`)}function I(e){let t=P(e);return/^\/Users\/[^/]+\/\.(agents|openhands)\//.test(t)||/^\/home\/[^/]+\/\.(agents|openhands)\//.test(t)?!0:N.some(e=>{let n=t.indexOf(e);if(n===-1)return!1;let r=t.slice(0,n);return/^\/Users\/[^/]+$/.test(r)||/^\/home\/[^/]+$/.test(r)})}function L(e,t){let n=P(e);if(!N.some(e=>n.includes(e))||I(e))return!1;if(t){let e=P(t).replace(/\/$/,``);if(n.startsWith(e))return!0}return!0}function R(e,t){let n=e.source?.trim();if(!n)return e.type===`repo`?`project`:`public`;let r=n.toLowerCase();return F(n)?`public`:r===`user`||r===`global`?`personal`:r===`project`||r===`repo`||r===`sandbox`?`project`:I(n)?`personal`:L(n,t)?`project`:`public`}function z(e,t){let n={project:[],personal:[],public:[]};for(let r of e)n[R(r,t)].push(r);for(let e of M)n[e].sort((e,t)=>e.name.localeCompare(t.name));return n}export{j as a,O as i,R as n,T as o,z as r,M as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~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"./useMutation-Cszf8mKy.js";import{t as o}from"./useQuery-DAAacS7O.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{R as c,ct as l,dt as u,n as d,st as f}from"./active-backend-context-BnH4-L8h.js";import{K as p,t as m}from"./utils-BgLSZdyy.js";import{n as h}from"./extensions-navigation-C5GfpzFe.js";import{n as g,t as _}from"./x-CX8lVGwm.js";import{t as v}from"./loading-spinner-BeLV0IXf.js";import{t as y}from"./modal-backdrop-BSzNhM4r.js";import{n as b}from"./modal-classes-B0b9eiL8.js";import{t as x}from"./brand-button-CUMfjb99.js";import{n as S}from"./navigation-context-CQZwH_tC.js";import{t as C}from"./modal-close-button-DfqfB2Nj.js";import{t as w}from"./settings-input-dVuzapBA.js";import{t as T}from"./plugins-management-service-5rqVPEGN.js";import{a as E,i as D,r as O}from"./extension-module-card-classes-DpeaYhYo.js";import{t as k}from"./settings-switch-DDd1cQ8t.js";import{n as A}from"./circle-plus-check-toggle-BDX_ctNs.js";import{n as j,t as M}from"./use-plugins-marketplace-BIIaPiaB.js";import{t as N}from"./skill-icon-badge-0MK_68Nc.js";import{n as P}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";import{n as F,t as I}from"./highlighted-source-view-C7pAXrT0.js";var L=e(t(),1),R=n();function z({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:a}){let{t:o}=s(`openhands`);return(0,R.jsxs)(`div`,{"data-testid":`plugin-card-${e.name}`,role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:m(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,E,O),children:[(0,R.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,R.jsx)(`p`,{"data-testid":`plugin-source-${e.name}`,className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}):null]}),e.installed?(0,R.jsx)(A,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:a,disableTooltipKey:p.COMMON$DISABLE}):e.isLocal?(0,R.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:m(D,`flex-shrink-0`),children:o(p.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:o(t?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,R.jsx)(`p`,{"data-testid":`plugin-description-${e.name}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null,(e.installed||e.isLocal)&&e.version?(0,R.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:m(D,`self-start`),children:o(p.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var B=[{value:`all`,labelKey:p.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:p.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:p.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:p.SETTINGS$PLUGINS_FILTER_LOCAL}];function V({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=s(`openhands`);return(0,R.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,R.jsxs)(`div`,{className:m(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,R.jsx)(g,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,R.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(p.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(p.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:m(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(p.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,R.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,R.jsx)(`div`,{"data-testid":`plugins-status-filter`,className:`flex shrink-0 items-center gap-1 rounded-lg border border-[var(--oh-border)] bg-base-secondary p-1`,children:B.map(e=>(0,R.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:m(`cursor-pointer rounded-md px-3 py-1 text-xs transition-colors`,n===e.value?`bg-surface-raised text-white`:`text-tertiary-alt hover:text-white`),children:i(e.labelKey)},e.value))})]})}var H=(e,t)=>{let{backend:n,orgId:r}=d();return o({queryKey:[`plugin-file-content`,e,t,n.id,r],queryFn:()=>{if(!e||!t)throw Error(`No file selected`);return j.getPluginFileContent(e,t)},enabled:!!(e&&t),retry:!1,staleTime:1e3*60*10,refetchOnWindowFocus:!1})};function U({basePath:e,files:t}){let{t:n}=s(`openhands`),[r,i]=L.useState(null),a=r&&t.includes(r)?r:null,{data:o,isLoading:c,isError:l}=H(a?e:null,a);return(0,R.jsxs)(`section`,{"data-testid":`plugin-files-section`,className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:n(p.COMMON$FILES)}),(0,R.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)]`,children:[(0,R.jsx)(`div`,{className:`max-h-48 overflow-y-auto custom-scrollbar`,children:(0,R.jsx)(F,{paths:t,selectedPath:a,onSelectFile:e=>i(t=>t===e?null:e)})}),a?(0,R.jsxs)(`div`,{"data-testid":`plugin-file-content`,className:`flex h-60 min-w-0 flex-col border-t border-[var(--oh-border)]`,children:[(0,R.jsx)(`p`,{className:`truncate px-3 py-2 text-xs text-tertiary-alt`,title:a,children:a}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1`,children:c?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(v,{size:`small`})}):l?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(p.FILES$LOAD_ERROR)}):o?.kind===`binary`?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(p.FILES$BINARY_FALLBACK)}):(0,R.jsx)(I,{path:a,text:o?.text??``})})]}):null]})]})}function W({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:a,onRefresh:o,onClose:c,onStartConversation:l}){let{t:u}=s(`openhands`),d=n||t;return(0,R.jsx)(y,{onClose:c,"aria-label":e.name,children:(0,R.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[640px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,R.jsx)(C,{onClose:c,testId:`plugin-detail-modal-close`}),(0,R.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,R.jsx)(`h2`,{className:m(`pr-6`,b),children:e.name}),e.source?(0,R.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,R.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,R.jsx)(`span`,{className:D,children:u(p.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,R.jsx)(`span`,{className:D,children:u(p.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,R.jsxs)(`span`,{className:D,children:[u(p.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,R.jsxs)(`span`,{className:D,children:[u(p.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,R.jsx)(k,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?p.SETTINGS$SKILLS_ENABLED:p.SETTINGS$SKILLS_DISABLED)}):null,e.skills?.length?(0,R.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:u(p.SETTINGS$PLUGINS_SKILLS_IN_BUNDLE)}),(0,R.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:e.skills.map(e=>(0,R.jsxs)(`li`,{"data-testid":`plugin-bundled-skill-${e.name}`,className:`flex items-start gap-3 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:[(0,R.jsx)(N,{skillName:e.name}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),e.description?(0,R.jsx)(`p`,{className:`mt-0.5 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null]})]},e.name))})]}):null,e.path&&e.files?.length?(0,R.jsx)(U,{basePath:e.path,files:e.files}):null]}),(0,R.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:o,children:u(p.SETTINGS$PLUGINS_REFRESH)}),(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:a,children:u(p.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)}),e.source&&l?(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-start-conversation-${e.name}`,onClick:l,children:u(p.COMMON$START_CONVERSATION)}):null,(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:c,children:u(p.BUTTON$CLOSE)})]})]})})}function G(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),e.invalidateQueries({queryKey:c.marketplace}),l(t(p.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function K({onClose:e,onInstalled:t}){let{t:n}=s(`openhands`),r=G(),[i,a]=L.useState(``),[o,c]=L.useState(``),[l,u]=L.useState(``),d=i.trim(),f=d.length>0&&!r.isPending;return(0,R.jsx)(y,{onClose:e,"aria-label":n(p.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,R.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),f&&r.mutate({source:d,ref:o.trim()||null,repo_path:l.trim()||null},{onSuccess:()=>{t?.(),e()}})},"data-testid":`add-plugin-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,R.jsx)(C,{onClose:e,testId:`add-plugin-modal-close`}),(0,R.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,R.jsx)(`h2`,{className:m(`pr-6`,b),children:n(p.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,R.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(p.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,R.jsx)(w,{testId:`add-plugin-source-input`,label:n(p.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:a,placeholder:n(p.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,R.jsx)(w,{testId:`add-plugin-ref-input`,label:n(p.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:o,onChange:c,showOptionalTag:!0}),(0,R.jsx)(w,{testId:`add-plugin-repo-path-input`,label:n(p.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:l,onChange:u,showOptionalTag:!0})]}),(0,R.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,R.jsx)(x,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(p.BUTTON$CLOSE)}),(0,R.jsx)(x,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!f,children:n(r.isPending?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)})]})]})})}function q(e,t,n=void 0){let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,description:t.description,source:t.source,ref:t.ref??null,repoPath:t.repo_path??null,installed:t.installed,enabled:!1,version:null,inCatalog:!0,isLocal:!1,path:t.path??null,skills:t.skills??null,files:t.files??null});for(let e of t??[]){let t=r.get(e.name),n=e.skills!=null||e.files!=null;r.set(e.name,{name:e.name,description:t?.description??e.description??null,source:e.source??t?.source??null,ref:e.resolved_ref??t?.ref??null,repoPath:e.repo_path??t?.repoPath??null,installed:!0,enabled:e.enabled,version:e.version??null,inCatalog:t?.inCatalog??!1,isLocal:!1,path:n?e.install_path:t?.path??null,skills:n?e.skills??null:t?.skills??null,files:n?e.files??null:t?.files??null})}for(let e of n??[])r.has(e.name)||r.set(e.name,{name:e.name,description:e.description||null,source:null,ref:null,repoPath:null,installed:!1,enabled:!1,version:e.version||null,inCatalog:!1,isLocal:!0,path:e.path??null,skills:e.skills??null,files:e.files??null});let i=e=>e.installed?0:e.isLocal?1:2;return Array.from(r.values()).sort((e,t)=>{let n=i(e)-i(t);return n===0?e.name.localeCompare(t.name):n})}function J(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description??``,e.source??``,e.repoPath??``,e.ref??``].some(e=>e.toLowerCase().includes(n)):!0}function Y(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var X=()=>{let{backend:e,orgId:t}=d();return o({queryKey:[...c.installed,e.id,t],queryFn:()=>T.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1})},Z=()=>{let{backend:e,orgId:t}=d();return o({queryKey:[...c.local,e.id,t],queryFn:()=>j.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1})};function Q(){let e=i(),{t}=s(`openhands`);return a({mutationFn:({name:e,enabled:t})=>T.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed})},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function ee(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),e.invalidateQueries({queryKey:c.marketplace}),l(t(p.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function te(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),l(t(p.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function ne(e){let t=btoa(JSON.stringify(e));return`/launch?${new URLSearchParams({plugins:t}).toString()}`}var $=r(function(){let{t:e}=s(`openhands`),{backend:t}=d(),{navigate:n}=S(),r=t.kind===`local`,{data:i,isLoading:a}=M(),{data:o,isLoading:c}=X(),{data:l,isLoading:u}=Z(),f=G(),g=Q(),_=ee(),v=te(),[y,b]=L.useState(``),[C,w]=L.useState(`all`),[T,E]=L.useState(null),[D,O]=L.useState(!1),k=L.useMemo(()=>q(i,o,l),[i,o,l]),A=L.useMemo(()=>k.filter(e=>Y(e,C)&&J(e,y)),[k,C,y]),j=T?k.find(e=>e.name===T)??null:null,N=a||c||u,F=(g.isPending?g.variables?.name:void 0)??(_.isPending?_.variables:void 0)??(v.isPending?v.variables:void 0)??null,I=e=>F===e.name||f.isPending&&f.variables?.source===e.source,B=e=>{e.source&&f.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},H=(e,t)=>{g.mutate({name:e.name,enabled:t})},U=e=>{_.mutate(e.name,{onSuccess:()=>E(null)})},$=e=>{v.mutate(e.name)},re=e=>{e.source&&n(ne([{source:e.source,ref:e.ref,repo_path:e.repoPath}]))};return(0,R.jsxs)(`div`,{"data-testid":`skills-plugins-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,R.jsx)(h,{}),(0,R.jsx)(`main`,{className:m(P,`h-full`),children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(p.SETTINGS$PLUGINS_TITLE)}),(0,R.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!r,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>O(!0),children:e(p.SETTINGS$PLUGINS_ADD_BUTTON)})]}),N&&(0,R.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!N&&k.length===0&&(0,R.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_NO_PLUGINS)})}),!N&&k.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(V,{search:y,onSearchChange:b,statusFilter:C,onStatusFilterChange:w}),A.length===0?(0,R.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_NO_MATCH)})}):(0,R.jsx)(`section`,{className:m(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,R.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:A.map(e=>(0,R.jsx)(z,{plugin:e,isBusy:I(e),isDisabled:!r,onOpen:()=>E(e.name),onInstall:()=>B(e),onToggle:t=>H(e,t)},e.name))})})]}),j&&(0,R.jsx)(W,{plugin:j,isBusy:I(j),isDisabled:!r,onToggle:e=>H(j,e),onInstall:()=>B(j),onUninstall:()=>U(j),onRefresh:()=>$(j),onStartConversation:()=>re(j),onClose:()=>E(null)}),D&&(0,R.jsx)(K,{onClose:()=>O(!1)})]})})]})});export{$ as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~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"./useMutation-Cszf8mKy.js";import{t as o}from"./useQuery-DAAacS7O.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{R as c,ct as l,dt as u,n as d,st as f}from"./active-backend-context-BETEdaJl.js";import{K as p,t as m}from"./utils-CbjwNcR-.js";import{n as h}from"./extensions-navigation-Di-J2KUR.js";import{n as g,t as _}from"./x-CX8lVGwm.js";import{t as v}from"./loading-spinner-BJc2J0Dw.js";import{t as y}from"./modal-backdrop-BSzNhM4r.js";import{n as b}from"./modal-classes-BPcBCWVj.js";import{t as x}from"./brand-button-CGUwj6zK.js";import{n as S}from"./navigation-context-CQZwH_tC.js";import{t as C}from"./modal-close-button-Cq3dma5u.js";import{t as w}from"./settings-input-B3i5U9GL.js";import{t as T}from"./plugins-management-service-2oP6_tWr.js";import{a as E,i as D,r as O}from"./extension-module-card-classes-DpeaYhYo.js";import{t as k}from"./settings-switch-CI93Iozg.js";import{n as A}from"./circle-plus-check-toggle-ZOXpJ3I2.js";import{n as j,t as M}from"./use-plugins-marketplace-CTRoukH0.js";import{t as N}from"./skill-icon-badge-CVxE42yg.js";import{n as P}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";import{n as F,t as I}from"./highlighted-source-view-DPerL6tF.js";var L=e(t(),1),R=n();function z({plugin:e,isBusy:t=!1,isDisabled:n=!1,onOpen:r,onInstall:i,onToggle:a}){let{t:o}=s(`openhands`);return(0,R.jsxs)(`div`,{"data-testid":`plugin-card-${e.name}`,role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:m(`flex min-w-0 flex-col gap-3 overflow-hidden p-4`,E,O),children:[(0,R.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h3`,{"data-testid":`plugin-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),e.source?(0,R.jsx)(`p`,{"data-testid":`plugin-source-${e.name}`,className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}):null]}),e.installed?(0,R.jsx)(A,{testId:`plugin-toggle-${e.name}`,isSelected:e.enabled,isDisabled:n||t,onToggle:a,disableTooltipKey:p.COMMON$DISABLE}):e.isLocal?(0,R.jsx)(`span`,{"data-testid":`plugin-local-badge-${e.name}`,className:m(D,`flex-shrink-0`),children:o(p.SETTINGS$PLUGINS_FILTER_LOCAL)}):(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-install-${e.name}`,isDisabled:n||t,className:`flex-shrink-0 whitespace-nowrap`,onClick:e=>{e?.stopPropagation(),i()},children:o(t?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)})]}),e.description?(0,R.jsx)(`p`,{"data-testid":`plugin-description-${e.name}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null,(e.installed||e.isLocal)&&e.version?(0,R.jsx)(`span`,{"data-testid":`plugin-version-${e.name}`,className:m(D,`self-start`),children:o(p.SETTINGS$SKILLS_VERSION,{version:e.version})}):null]})}var B=[{value:`all`,labelKey:p.SETTINGS$PLUGINS_FILTER_ALL},{value:`installed`,labelKey:p.SETTINGS$PLUGINS_FILTER_INSTALLED},{value:`available`,labelKey:p.SETTINGS$PLUGINS_FILTER_AVAILABLE},{value:`local`,labelKey:p.SETTINGS$PLUGINS_FILTER_LOCAL}];function V({search:e,onSearchChange:t,statusFilter:n,onStatusFilterChange:r}){let{t:i}=s(`openhands`);return(0,R.jsxs)(`div`,{"data-testid":`plugins-toolbar`,className:`flex items-stretch gap-2`,children:[(0,R.jsxs)(`div`,{className:m(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,R.jsx)(g,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,R.jsx)(`input`,{"data-testid":`plugins-search-input`,type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:i(p.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),"aria-label":i(p.SETTINGS$PLUGINS_SEARCH_PLACEHOLDER),className:m(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,R.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":i(p.MCP$SEARCH_CLEAR),className:`mr-2 p-1 rounded text-tertiary-alt hover:text-white cursor-pointer`,children:(0,R.jsx)(_,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,R.jsx)(`div`,{"data-testid":`plugins-status-filter`,className:`flex shrink-0 items-center gap-1 rounded-lg border border-[var(--oh-border)] bg-base-secondary p-1`,children:B.map(e=>(0,R.jsx)(`button`,{type:`button`,"data-testid":`plugins-filter-${e.value}`,"aria-pressed":n===e.value,onClick:()=>r(e.value),className:m(`cursor-pointer rounded-md px-3 py-1 text-xs transition-colors`,n===e.value?`bg-surface-raised text-white`:`text-tertiary-alt hover:text-white`),children:i(e.labelKey)},e.value))})]})}var H=(e,t)=>{let{backend:n,orgId:r}=d();return o({queryKey:[`plugin-file-content`,e,t,n.id,r],queryFn:()=>{if(!e||!t)throw Error(`No file selected`);return j.getPluginFileContent(e,t)},enabled:!!(e&&t),retry:!1,staleTime:1e3*60*10,refetchOnWindowFocus:!1})};function U({basePath:e,files:t}){let{t:n}=s(`openhands`),[r,i]=L.useState(null),a=r&&t.includes(r)?r:null,{data:o,isLoading:c,isError:l}=H(a?e:null,a);return(0,R.jsxs)(`section`,{"data-testid":`plugin-files-section`,className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:n(p.COMMON$FILES)}),(0,R.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)]`,children:[(0,R.jsx)(`div`,{className:`max-h-48 overflow-y-auto custom-scrollbar`,children:(0,R.jsx)(F,{paths:t,selectedPath:a,onSelectFile:e=>i(t=>t===e?null:e)})}),a?(0,R.jsxs)(`div`,{"data-testid":`plugin-file-content`,className:`flex h-60 min-w-0 flex-col border-t border-[var(--oh-border)]`,children:[(0,R.jsx)(`p`,{className:`truncate px-3 py-2 text-xs text-tertiary-alt`,title:a,children:a}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1`,children:c?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,R.jsx)(v,{size:`small`})}):l?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(p.FILES$LOAD_ERROR)}):o?.kind===`binary`?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-tertiary-light`,children:n(p.FILES$BINARY_FALLBACK)}):(0,R.jsx)(I,{path:a,text:o?.text??``})})]}):null]})]})}function W({plugin:e,isBusy:t=!1,isDisabled:n=!1,onToggle:r,onInstall:i,onUninstall:a,onRefresh:o,onClose:c,onStartConversation:l}){let{t:u}=s(`openhands`),d=n||t;return(0,R.jsx)(y,{onClose:c,"aria-label":e.name,children:(0,R.jsxs)(`div`,{"data-testid":`plugin-detail-modal`,"data-plugin-name":e.name,className:`relative flex w-[640px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,R.jsx)(C,{onClose:c,testId:`plugin-detail-modal-close`}),(0,R.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,R.jsx)(`h2`,{className:m(`pr-6`,b),children:e.name}),e.source?(0,R.jsx)(`p`,{className:`mt-1 break-all text-xs text-tertiary-alt`,children:e.source}):null]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[e.description?(0,R.jsx)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:e.description}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.isLocal?(0,R.jsx)(`span`,{className:D,children:u(p.SETTINGS$PLUGINS_FILTER_LOCAL)}):null,e.version?(0,R.jsx)(`span`,{className:D,children:u(p.SETTINGS$SKILLS_VERSION,{version:e.version})}):null,e.ref?(0,R.jsxs)(`span`,{className:D,children:[u(p.SETTINGS$PLUGINS_REF_LABEL),` `,e.ref]}):null,e.repoPath?(0,R.jsxs)(`span`,{className:D,children:[u(p.SETTINGS$PLUGINS_REPO_PATH_LABEL),` `,e.repoPath]}):null]}),e.installed?(0,R.jsx)(k,{testId:`plugin-modal-toggle-${e.name}`,isToggled:e.enabled,onToggle:r,isDisabled:d,togglePosition:`right`,children:u(e.enabled?p.SETTINGS$SKILLS_ENABLED:p.SETTINGS$SKILLS_DISABLED)}):null,e.skills?.length?(0,R.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-white`,children:u(p.SETTINGS$PLUGINS_SKILLS_IN_BUNDLE)}),(0,R.jsx)(`ul`,{className:`flex min-w-0 flex-col gap-2`,children:e.skills.map(e=>(0,R.jsxs)(`li`,{"data-testid":`plugin-bundled-skill-${e.name}`,className:`flex items-start gap-3 rounded-lg border border-[var(--oh-border)] bg-[rgba(255,255,255,0.04)] px-3 py-2.5`,children:[(0,R.jsx)(N,{skillName:e.name}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),e.description?(0,R.jsx)(`p`,{className:`mt-0.5 break-words text-xs leading-relaxed text-tertiary-light`,children:e.description}):null]})]},e.name))})]}):null,e.path&&e.files?.length?(0,R.jsx)(U,{basePath:e.path,files:e.files}):null]}),(0,R.jsxs)(`footer`,{className:`flex flex-shrink-0 flex-wrap justify-end gap-2 px-6 pb-6 pt-4`,children:[e.installed?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-refresh-${e.name}`,isDisabled:d,onClick:o,children:u(p.SETTINGS$PLUGINS_REFRESH)}),(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-uninstall-${e.name}`,isDisabled:d,onClick:a,children:u(p.SETTINGS$PLUGINS_UNINSTALL)})]}):e.isLocal?null:(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-install-${e.name}`,isDisabled:d,onClick:i,children:u(t?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)}),e.source&&l?(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-start-conversation-${e.name}`,onClick:l,children:u(p.COMMON$START_CONVERSATION)}):null,(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugin-detail-modal-dismiss`,onClick:c,children:u(p.BUTTON$CLOSE)})]})]})})}function G(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.installPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),e.invalidateQueries({queryKey:c.marketplace}),l(t(p.SETTINGS$PLUGINS_INSTALL_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function K({onClose:e,onInstalled:t}){let{t:n}=s(`openhands`),r=G(),[i,a]=L.useState(``),[o,c]=L.useState(``),[l,u]=L.useState(``),d=i.trim(),f=d.length>0&&!r.isPending;return(0,R.jsx)(y,{onClose:e,"aria-label":n(p.SETTINGS$PLUGINS_ADD_MODAL_TITLE),children:(0,R.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),f&&r.mutate({source:d,ref:o.trim()||null,repo_path:l.trim()||null},{onSuccess:()=>{t?.(),e()}})},"data-testid":`add-plugin-modal`,className:`relative flex w-[520px] max-w-[90vw] max-h-[85vh] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,R.jsx)(C,{onClose:e,testId:`add-plugin-modal-close`}),(0,R.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,R.jsx)(`h2`,{className:m(`pr-6`,b),children:n(p.SETTINGS$PLUGINS_ADD_MODAL_TITLE)}),(0,R.jsx)(`p`,{className:`mt-4 text-sm text-tertiary-light`,children:n(p.SETTINGS$PLUGINS_ADD_MODAL_INTRO)})]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 custom-scrollbar`,children:[(0,R.jsx)(w,{testId:`add-plugin-source-input`,label:n(p.SETTINGS$PLUGINS_SOURCE_LABEL),type:`text`,value:i,onChange:a,placeholder:n(p.SETTINGS$PLUGINS_SOURCE_PLACEHOLDER),showRequiredTag:!0}),(0,R.jsx)(w,{testId:`add-plugin-ref-input`,label:n(p.SETTINGS$PLUGINS_REF_LABEL),type:`text`,value:o,onChange:c,showOptionalTag:!0}),(0,R.jsx)(w,{testId:`add-plugin-repo-path-input`,label:n(p.SETTINGS$PLUGINS_REPO_PATH_LABEL),type:`text`,value:l,onChange:u,showOptionalTag:!0})]}),(0,R.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[(0,R.jsx)(x,{type:`button`,variant:`secondary`,onClick:e,testId:`add-plugin-modal-dismiss`,children:n(p.BUTTON$CLOSE)}),(0,R.jsx)(x,{type:`submit`,variant:`primary`,testId:`add-plugin-submit`,isDisabled:!f,children:n(r.isPending?p.SETTINGS$PLUGINS_INSTALLING:p.SETTINGS$PLUGINS_INSTALL)})]})]})})}function q(e,t,n=void 0){let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,description:t.description,source:t.source,ref:t.ref??null,repoPath:t.repo_path??null,installed:t.installed,enabled:!1,version:null,inCatalog:!0,isLocal:!1,path:t.path??null,skills:t.skills??null,files:t.files??null});for(let e of t??[]){let t=r.get(e.name),n=e.skills!=null||e.files!=null;r.set(e.name,{name:e.name,description:t?.description??e.description??null,source:e.source??t?.source??null,ref:e.resolved_ref??t?.ref??null,repoPath:e.repo_path??t?.repoPath??null,installed:!0,enabled:e.enabled,version:e.version??null,inCatalog:t?.inCatalog??!1,isLocal:!1,path:n?e.install_path:t?.path??null,skills:n?e.skills??null:t?.skills??null,files:n?e.files??null:t?.files??null})}for(let e of n??[])r.has(e.name)||r.set(e.name,{name:e.name,description:e.description||null,source:null,ref:null,repoPath:null,installed:!1,enabled:!1,version:e.version||null,inCatalog:!1,isLocal:!0,path:e.path??null,skills:e.skills??null,files:e.files??null});let i=e=>e.installed?0:e.isLocal?1:2;return Array.from(r.values()).sort((e,t)=>{let n=i(e)-i(t);return n===0?e.name.localeCompare(t.name):n})}function J(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description??``,e.source??``,e.repoPath??``,e.ref??``].some(e=>e.toLowerCase().includes(n)):!0}function Y(e,t){return t===`installed`?e.installed:t===`available`?!e.installed&&!e.isLocal:t===`local`?e.isLocal:!0}var X=()=>{let{backend:e,orgId:t}=d();return o({queryKey:[...c.installed,e.id,t],queryFn:()=>T.listInstalledPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1})},Z=()=>{let{backend:e,orgId:t}=d();return o({queryKey:[...c.local,e.id,t],queryFn:()=>j.getLocalPlugins(),staleTime:1e3*60*10,refetchOnWindowFocus:!1})};function Q(){let e=i(),{t}=s(`openhands`);return a({mutationFn:({name:e,enabled:t})=>T.setPluginEnabled(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed})},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function ee(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.uninstallPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),e.invalidateQueries({queryKey:c.marketplace}),l(t(p.SETTINGS$PLUGINS_UNINSTALL_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function te(){let e=i(),{t}=s(`openhands`);return a({mutationFn:e=>T.refreshPlugin(e),onSuccess:()=>{e.invalidateQueries({queryKey:c.installed}),l(t(p.SETTINGS$PLUGINS_REFRESH_SUCCESS))},onError:e=>{f(u(e)||t(p.ERROR$GENERIC))}})}function ne(e){let t=btoa(JSON.stringify(e));return`/launch?${new URLSearchParams({plugins:t}).toString()}`}var $=r(function(){let{t:e}=s(`openhands`),{backend:t}=d(),{navigate:n}=S(),r=t.kind===`local`,{data:i,isLoading:a}=M(),{data:o,isLoading:c}=X(),{data:l,isLoading:u}=Z(),f=G(),g=Q(),_=ee(),v=te(),[y,b]=L.useState(``),[C,w]=L.useState(`all`),[T,E]=L.useState(null),[D,O]=L.useState(!1),k=L.useMemo(()=>q(i,o,l),[i,o,l]),A=L.useMemo(()=>k.filter(e=>Y(e,C)&&J(e,y)),[k,C,y]),j=T?k.find(e=>e.name===T)??null:null,N=a||c||u,F=(g.isPending?g.variables?.name:void 0)??(_.isPending?_.variables:void 0)??(v.isPending?v.variables:void 0)??null,I=e=>F===e.name||f.isPending&&f.variables?.source===e.source,B=e=>{e.source&&f.mutate({source:e.source,ref:e.ref,repo_path:e.repoPath})},H=(e,t)=>{g.mutate({name:e.name,enabled:t})},U=e=>{_.mutate(e.name,{onSuccess:()=>E(null)})},$=e=>{v.mutate(e.name)},re=e=>{e.source&&n(ne([{source:e.source,ref:e.ref,repo_path:e.repoPath}]))};return(0,R.jsxs)(`div`,{"data-testid":`skills-plugins-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,R.jsx)(h,{}),(0,R.jsx)(`main`,{className:m(P,`h-full`),children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(p.SETTINGS$PLUGINS_TITLE)}),(0,R.jsx)(`div`,{"data-testid":`plugins-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_PAGE_DESCRIPTION)})]}),(0,R.jsx)(x,{type:`button`,variant:`secondary`,testId:`plugins-add-plugin-button`,isDisabled:!r,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>O(!0),children:e(p.SETTINGS$PLUGINS_ADD_BUTTON)})]}),N&&(0,R.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}),!N&&k.length===0&&(0,R.jsx)(`div`,{"data-testid":`plugins-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_NO_PLUGINS)})}),!N&&k.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(V,{search:y,onSearchChange:b,statusFilter:C,onStatusFilterChange:w}),A.length===0?(0,R.jsx)(`div`,{"data-testid":`plugins-no-match`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,R.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(p.SETTINGS$PLUGINS_NO_MATCH)})}):(0,R.jsx)(`section`,{className:m(`flex min-w-0 flex-col gap-3`,`@container min-w-0 w-full`),children:(0,R.jsx)(`div`,{className:`grid min-w-0 grid-cols-1 gap-3 @min-[600px]:grid-cols-2`,children:A.map(e=>(0,R.jsx)(z,{plugin:e,isBusy:I(e),isDisabled:!r,onOpen:()=>E(e.name),onInstall:()=>B(e),onToggle:t=>H(e,t)},e.name))})})]}),j&&(0,R.jsx)(W,{plugin:j,isBusy:I(j),isDisabled:!r,onToggle:e=>H(j,e),onInstall:()=>B(j),onUninstall:()=>U(j),onRefresh:()=>$(j),onStartConversation:()=>re(j),onClose:()=>E(null)}),D&&(0,R.jsx)(K,{onClose:()=>O(!1)})]})})]})});export{$ 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{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-BgLSZdyy.js";import{n as l}from"./extensions-navigation-C5GfpzFe.js";import{a as u,c as ee,d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,u as x}from"./skill-filter-DsNLmn76.js";import{n as S}from"./use-settings-C2KKQKVC.js";import{t as C}from"./brand-button-CUMfjb99.js";import{n as w,o as T,t as E}from"./extension-module-card-classes-DpeaYhYo.js";import{a as D,o as O}from"./skill-scope-BE-H9TSZ.js";import{n as te}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var k=e(t(),1),A=e=>a({queryKey:[`skills`,e??null],queryFn:()=>O.getSkills(e),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),j=n(),M=300;function N(){let{t:e}=o(`openhands`),{data:t,isLoading:n}=S(),{data:i,isLoading:a}=A(),{isEnabled:O,setEnabled:N}=D(),[P,F]=r(),[I,L]=k.useState(()=>P.get(`q`)??``),R=k.useRef(I),[z,B]=k.useState(null),[V,H]=k.useState(!1),[U,W]=k.useState(!1),G=n||a||!t,K=i??[],q=k.useMemo(()=>({..._(P),query:I}),[P,I]),J=k.useMemo(()=>y(K,O,q),[K,O,q]),Y=k.useMemo(()=>g(K,O,q),[K,O,q]),X=u(q);k.useEffect(()=>{let e=P.get(`q`)??``;e!==R.current&&(R.current=e,L(e))},[P]),k.useEffect(()=>{if((P.get(`q`)??``)===I)return;let e=setTimeout(()=>{R.current=I,F(e=>{let t=new URLSearchParams(e);return I?t.set(`q`,I):t.delete(`q`),t},{replace:!0})},M);return()=>clearTimeout(e)},[I,P,F]);let Z=e=>{e.query!==q.query&&L(e.query),b({...e,query:``}).toString()!==b({...q,query:``}).toString()&&F(b(e))},Q=(e,t)=>Z(ee(q,e,t)),$=()=>Z(p(q));return(0,j.jsxs)(`div`,{"data-testid":`skills-settings-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,j.jsx)(l,{}),(0,j.jsxs)(`main`,{className:c(te,`h-full`),children:[(0,j.jsxs)(`div`,{"data-testid":`skills-page`,className:`mx-auto flex w-full min-w-0 max-w-[1100px] flex-col gap-6`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,j.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(s.SETTINGS$SKILLS_TITLE)}),(0,j.jsx)(`div`,{"data-testid":`skills-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_PAGE_DESCRIPTION)}),(0,j.jsx)(`div`,{"data-testid":`skills-new-conversation-notice`,className:`max-w-2xl text-xs text-tertiary-alt`,children:e(s.SETTINGS$SKILLS_NEW_CONVERSATION_NOTICE)})]}),(0,j.jsx)(C,{type:`button`,variant:`secondary`,testId:`skills-add-skill-button`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>H(!0),children:e(s.SETTINGS$SKILLS_ADD_BUTTON)})]}),G?(0,j.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,j.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}):null,!G&&K.length===0?(0,j.jsx)(`div`,{"data-testid":`skills-empty`,className:T,children:(0,j.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_NO_SKILLS)})}):null,!G&&K.length>0?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d,{search:q.query,onSearchChange:e=>Z({...q,query:e}),activeFilterCount:X,onOpenFilters:()=>W(!0)}),(0,j.jsxs)(`div`,{className:`flex min-w-0 gap-6`,children:[(0,j.jsx)(x,{groups:J,onToggle:Q,className:`hidden w-[240px] shrink-0 self-start md:flex`}),(0,j.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-tertiary-light`,children:[(0,j.jsx)(`span`,{"data-testid":`skills-result-summary`,children:e(s.SETTINGS$SKILLS_RESULT_COUNT,{count:Y.length})}),X>0?(0,j.jsx)(`button`,{type:`button`,"data-testid":`skills-clear-filters`,onClick:$,className:`cursor-pointer underline hover:text-white`,children:e(s.SETTINGS$SKILLS_CLEAR_FILTERS)}):null]}),Y.length===0?(0,j.jsx)(`div`,{"data-testid":`skills-no-match`,className:T,children:(0,j.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_NO_MATCH)})}):(0,j.jsx)(`div`,{className:c(w),children:(0,j.jsx)(`div`,{className:E,children:Y.map(e=>(0,j.jsx)(h,{skill:e,enabled:O(e),onOpen:()=>B(e),onToggle:t=>N(e.name,t)},e.name))})})]})]}),U?(0,j.jsx)(m,{groups:J,activeCount:X,onToggle:Q,onClearAll:$,onClose:()=>W(!1)}):null]}):null]}),z&&(0,j.jsx)(v,{skill:z,enabled:O(z),onToggle:e=>N(z.name,e),onClose:()=>B(null)}),V&&(0,j.jsx)(f,{onClose:()=>H(!1)})]})]})}var P=i(N);export{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{H as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-CbjwNcR-.js";import{n as l}from"./extensions-navigation-Di-J2KUR.js";import{a as u,c as ee,d,f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,u as x}from"./skill-filter-BvtbD--b.js";import{n as S}from"./use-settings-D69cw06D.js";import{t as C}from"./brand-button-CGUwj6zK.js";import{n as w,o as T,t as E}from"./extension-module-card-classes-DpeaYhYo.js";import{a as D,o as O}from"./skill-scope-C0NxJnpT.js";import{n as te}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var k=e(t(),1),A=e=>a({queryKey:[`skills`,e??null],queryFn:()=>O.getSkills(e),staleTime:1e3*60*10,refetchOnWindowFocus:!1}),j=n(),M=300;function N(){let{t:e}=o(`openhands`),{data:t,isLoading:n}=S(),{data:i,isLoading:a}=A(),{isEnabled:O,setEnabled:N}=D(),[P,F]=r(),[I,L]=k.useState(()=>P.get(`q`)??``),R=k.useRef(I),[z,B]=k.useState(null),[V,H]=k.useState(!1),[U,W]=k.useState(!1),G=n||a||!t,K=i??[],q=k.useMemo(()=>({..._(P),query:I}),[P,I]),J=k.useMemo(()=>y(K,O,q),[K,O,q]),Y=k.useMemo(()=>g(K,O,q),[K,O,q]),X=u(q);k.useEffect(()=>{let e=P.get(`q`)??``;e!==R.current&&(R.current=e,L(e))},[P]),k.useEffect(()=>{if((P.get(`q`)??``)===I)return;let e=setTimeout(()=>{R.current=I,F(e=>{let t=new URLSearchParams(e);return I?t.set(`q`,I):t.delete(`q`),t},{replace:!0})},M);return()=>clearTimeout(e)},[I,P,F]);let Z=e=>{e.query!==q.query&&L(e.query),b({...e,query:``}).toString()!==b({...q,query:``}).toString()&&F(b(e))},Q=(e,t)=>Z(ee(q,e,t)),$=()=>Z(p(q));return(0,j.jsxs)(`div`,{"data-testid":`skills-settings-screen`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,j.jsx)(l,{}),(0,j.jsxs)(`main`,{className:c(te,`h-full`),children:[(0,j.jsxs)(`div`,{"data-testid":`skills-page`,className:`mx-auto flex w-full min-w-0 max-w-[1100px] flex-col gap-6`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,j.jsx)(`h2`,{className:`text-xl font-semibold leading-6 text-foreground`,children:e(s.SETTINGS$SKILLS_TITLE)}),(0,j.jsx)(`div`,{"data-testid":`skills-settings-description`,className:`max-w-2xl text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_PAGE_DESCRIPTION)}),(0,j.jsx)(`div`,{"data-testid":`skills-new-conversation-notice`,className:`max-w-2xl text-xs text-tertiary-alt`,children:e(s.SETTINGS$SKILLS_NEW_CONVERSATION_NOTICE)})]}),(0,j.jsx)(C,{type:`button`,variant:`secondary`,testId:`skills-add-skill-button`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>H(!0),children:e(s.SETTINGS$SKILLS_ADD_BUTTON)})]}),G?(0,j.jsx)(`div`,{className:`flex flex-col gap-4`,children:[1,2,3].map(e=>(0,j.jsx)(`div`,{className:`h-24 rounded-2xl bg-tertiary animate-pulse`},e))}):null,!G&&K.length===0?(0,j.jsx)(`div`,{"data-testid":`skills-empty`,className:T,children:(0,j.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_NO_SKILLS)})}):null,!G&&K.length>0?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d,{search:q.query,onSearchChange:e=>Z({...q,query:e}),activeFilterCount:X,onOpenFilters:()=>W(!0)}),(0,j.jsxs)(`div`,{className:`flex min-w-0 gap-6`,children:[(0,j.jsx)(x,{groups:J,onToggle:Q,className:`hidden w-[240px] shrink-0 self-start md:flex`}),(0,j.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-tertiary-light`,children:[(0,j.jsx)(`span`,{"data-testid":`skills-result-summary`,children:e(s.SETTINGS$SKILLS_RESULT_COUNT,{count:Y.length})}),X>0?(0,j.jsx)(`button`,{type:`button`,"data-testid":`skills-clear-filters`,onClick:$,className:`cursor-pointer underline hover:text-white`,children:e(s.SETTINGS$SKILLS_CLEAR_FILTERS)}):null]}),Y.length===0?(0,j.jsx)(`div`,{"data-testid":`skills-no-match`,className:T,children:(0,j.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:e(s.SETTINGS$SKILLS_NO_MATCH)})}):(0,j.jsx)(`div`,{className:c(w),children:(0,j.jsx)(`div`,{className:E,children:Y.map(e=>(0,j.jsx)(h,{skill:e,enabled:O(e),onOpen:()=>B(e),onToggle:t=>N(e.name,t)},e.name))})})]})]}),U?(0,j.jsx)(m,{groups:J,activeCount:X,onToggle:Q,onClearAll:$,onClose:()=>W(!1)}):null]}):null]}),z&&(0,j.jsx)(v,{skill:z,enabled:O(z),onToggle:e=>N(z.name,e),onClose:()=>B(null)}),V&&(0,j.jsx)(f,{onClose:()=>H(!1)})]})]})}var P=i(N);export{P as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./utils-BgLSZdyy.js";var a=e(t(),1),o=r();function s(e){return a.Children.count(e)===1&&a.isValidElement(e)?e:(0,o.jsx)(`span`,{className:`inline-flex`,children:e})}function c({children:e,content:t,tooltipClassName:r,placement:a=`right`,showArrow:c=!1,closeDelay:l=100,shouldFlip:u,offset:d=7,isOpen:f}){return(0,o.jsx)(n,{content:t,closeDelay:l,placement:a,offset:d,shouldFlip:u,isOpen:f,className:i(`bg-white text-black`,r),showArrow:c,disableAnimation:!1,classNames:{content:i(`z-[9999] rounded-md px-2 py-1 text-xs font-medium shadow-md`,`!bg-white !text-black`,r)},children:s(e)})}export{c as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./utils-CbjwNcR-.js";var a=e(t(),1),o=r();function s(e){return a.Children.count(e)===1&&a.isValidElement(e)?e:(0,o.jsx)(`span`,{className:`inline-flex`,children:e})}function c({children:e,content:t,tooltipClassName:r,placement:a=`right`,showArrow:c=!1,closeDelay:l=100,shouldFlip:u,offset:d=7,isOpen:f}){return(0,o.jsx)(n,{content:t,closeDelay:l,placement:a,offset:d,shouldFlip:u,isOpen:f,className:i(`bg-white text-black`,r),showArrow:c,disableAnimation:!1,classNames:{content:i(`z-[9999] rounded-md px-2 py-1 text-xs font-medium shadow-md`,`!bg-white !text-black`,r)},children:s(e)})}export{c as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{a as o,o as s}from"./messages-Bk1xhbU2.js";import{r as c}from"./typography-DgcLGdHk.js";import{t as l}from"./u-check-circle-BKn1spCL.js";import{i as u}from"./conversation-B_nweu5p.js";import{t as d}from"./conversation-tab-empty-state-B3dpJXX0.js";var f=e(t(),1),p=n();function m({task:e}){let{t}=r(`openhands`),n=(0,f.useMemo)(()=>{switch(e.status){case`todo`:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,p.jsx)(o,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,p.jsx)(l,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),u=e.status===`done`;return(0,p.jsxs)(`div`,{className:`flex gap-2 items-center w-full`,"data-name":`item`,children:[(0,p.jsx)(`div`,{className:`shrink-0`,children:n}),(0,p.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[16px] text-nowrap whitespace-pre font-normal`,children:[(0,p.jsx)(c.Text,{className:a(`text-[12px]`,u?`text-[var(--oh-muted)]`:`text-white`),children:e.title}),e.notes&&(0,p.jsxs)(c.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(i.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function h(){let{t:e}=r(`openhands`),{taskList:t}=u();return t.length===0?(0,p.jsx)(d,{icon:(0,p.jsx)(l,{}),children:e(i.COMMON$NO_TASKS)}):(0,p.jsx)(`main`,{className:`h-full overflow-y-auto flex flex-col custom-scrollbar-always`,children:t.map(e=>(0,p.jsx)(`div`,{"data-active":e.status===`in_progress`?`true`:`false`,className:a(`px-4 py-2`,e.status===`in_progress`&&`bg-[var(--oh-surface-raised)]`),children:(0,p.jsx)(m,{task:e})},e.id))})}export{h as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-CbjwNcR-.js";import{a as o,o as s}from"./messages-WUb9Yh-p.js";import{r as c}from"./typography-BdAApXGl.js";import{t as l}from"./u-check-circle-BKn1spCL.js";import{i as u}from"./conversation-9a53tdbO.js";import{t as d}from"./conversation-tab-empty-state-BT1GrnKP.js";var f=e(t(),1),p=n();function m({task:e}){let{t}=r(`openhands`),n=(0,f.useMemo)(()=>{switch(e.status){case`todo`:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,p.jsx)(o,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,p.jsx)(l,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,p.jsx)(s,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),u=e.status===`done`;return(0,p.jsxs)(`div`,{className:`flex gap-2 items-center w-full`,"data-name":`item`,children:[(0,p.jsx)(`div`,{className:`shrink-0`,children:n}),(0,p.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[16px] text-nowrap whitespace-pre font-normal`,children:[(0,p.jsx)(c.Text,{className:a(`text-[12px]`,u?`text-[var(--oh-muted)]`:`text-white`),children:e.title}),e.notes&&(0,p.jsxs)(c.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(i.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function h(){let{t:e}=r(`openhands`),{taskList:t}=u();return t.length===0?(0,p.jsx)(d,{icon:(0,p.jsx)(l,{}),children:e(i.COMMON$NO_TASKS)}):(0,p.jsx)(`main`,{className:`h-full overflow-y-auto flex flex-col custom-scrollbar-always`,children:t.map(e=>(0,p.jsx)(`div`,{"data-active":e.status===`in_progress`?`true`:`false`,className:a(`px-4 py-2`,e.status===`in_progress`&&`bg-[var(--oh-surface-raised)]`),children:(0,p.jsx)(m,{task:e})},e.id))})}export{h as default};
@@ -1,3 +1,3 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{A as i,K as a,t as o}from"./utils-BgLSZdyy.js";import{c as s}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{m as c}from"./llm-not-configured-banner-Dh_ajcM8.js";import{$ as l,w as u}from"./markdown-renderer-DyFl9-mL.js";import{n as d,t as f}from"./vendor~terminal-BVSbSr6V.js";import{t as p}from"./conversation-tab-empty-state-B3dpJXX0.js";var m=e(t(),1),h=`[Python Interpreter: `,g=e=>{let t=e.indexOf(h);if(t<0)return e;let n=t+21;return e.indexOf(`]`,n)<=n?e:e.substring(0,t).trim()},_=(e,t,n=!1)=>{let{content:r,type:i}=e;if(i===`input`&&n)return;let a=(r||``).replaceAll(`
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{A as i,K as a,t as o}from"./utils-CbjwNcR-.js";import{c as s}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{m as c}from"./llm-not-configured-banner-BdjItKQR.js";import{$ as l,w as u}from"./markdown-renderer-DRpwRlNm.js";import{n as d,t as f}from"./vendor~terminal-BVSbSr6V.js";import{t as p}from"./conversation-tab-empty-state-BT1GrnKP.js";var m=e(t(),1),h=`[Python Interpreter: `,g=e=>{let t=e.indexOf(h);if(t<0)return e;let n=t+21;return e.indexOf(`]`,n)<=n?e:e.substring(0,t).trim()},_=(e,t,n=!1)=>{let{content:r,type:i}=e;if(i===`input`&&n)return;let a=(r||``).replaceAll(`
2
2
  `,`\r
3
3
  `).trim();a&&t.writeln(g(a))},v=(e,t,n)=>{if(!e||!t||!n||window.getComputedStyle(n).display===`none`)return!1;let{clientWidth:r,clientHeight:i}=n;return!(r===0||i===0||!e.element)};function y(e){let t=e.ownerDocument.createElement(`span`);t.style.color=`var(--oh-surface-foreground)`,t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.pointerEvents=`none`,e.appendChild(t);let n=getComputedStyle(t).color;return t.remove(),n&&n!==`rgba(0, 0, 0, 0)`?n:getComputedStyle(e).color}var b={current:0},x=()=>{let e=u(e=>e.commands),t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),i=b,a=m.useRef(!1),o=e=>new f({fontFamily:`Menlo, Monaco, 'Courier New', monospace`,fontSize:14,scrollback:1e4,scrollSensitivity:1,fastScrollSensitivity:5,disableStdin:!0,allowTransparency:!0,theme:{background:`rgba(0, 0, 0, 0)`,foreground:y(e)}}),s=m.useCallback(()=>{a.current||v(t.current,n.current,r.current)&&n.current.fit()},[]),c=()=>{t.current&&(n.current&&t.current.loadAddon(n.current),r.current&&(t.current.open(r.current),t.current.write(`\x1B[?25l`),s()))};return m.useEffect(()=>{a.current=!1;let s=r.current;if(s){if(t.current=o(s),n.current=new d,r.current&&(c(),e.length>0)){for(let n=0;n<e.length;n+=1)e[n].type===`input`&&t.current.write(`$ `),_(e[n],t.current,!1);i.current=e.length}return()=>{a.current=!0,t.current?.dispose(),i.current=0}}},[]),m.useEffect(()=>{if(t.current&&e.length>0&&i.current<e.length){for(let n=i.current;n<e.length;n+=1)e[n].type===`input`&&t.current.write(`$ `),_(e[n],t.current,!1);i.current=e.length}},[e]),m.useEffect(()=>{let e=null;return e=new ResizeObserver(()=>{requestAnimationFrame(()=>{s()})}),r.current&&e.observe(r.current),()=>{e?.disconnect()}},[s]),r},S=n();function C({className:e,testId:t}){return(0,S.jsx)(c,{testId:t,className:e})}function w(){let{t:e}=r(`openhands`);return(0,S.jsx)(p,{className:`h-full`,icon:(0,S.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(a.TERMINAL$NO_OUTPUT)})}function T(){let{curAgentState:e}=l(),t=u(e=>e.commands),n=i.includes(e),r=t.length>0,a=n||!r,s=x();return(0,S.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[n&&(0,S.jsx)(C,{className:`pt-16`}),!n&&!r&&(0,S.jsx)(w,{}),(0,S.jsx)(`div`,{className:o(`flex-1 min-h-0 p-4`,a&&`pointer-events-none absolute inset-0 h-0 w-0 overflow-hidden p-0 opacity-0`),children:(0,S.jsx)(`div`,{ref:s,className:`h-full w-full`})})]})}export{T as default};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-BgLSZdyy.js";var n=e();function r({enabled:e,size:r=`md`,className:i}){let a=r===`sm`;return(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t(`relative inline-flex shrink-0 items-center rounded-full`,`transition-colors duration-200 ease-in-out motion-reduce:transition-none`,a?`h-3.5 w-6 p-[3px]`:`h-[22px] w-[40px] border`,e?a?`bg-white`:`border-white bg-white`:a?`bg-[var(--oh-border)]`:`border-[var(--oh-border)] bg-surface-raised`,i),children:(0,n.jsx)(`span`,{className:t(`inline-block rounded-full`,`transition-transform duration-200 ease-in-out motion-reduce:transition-none`,a?`size-2`:`size-4`,e?a?`translate-x-[10px] bg-base-secondary`:`translate-x-[21px] bg-base-secondary`:a?`translate-x-0 bg-[var(--oh-muted)]`:`translate-x-[2px] bg-[var(--oh-muted)]`)})})}function i({enabled:e,label:i,onToggle:a,className:o}){return(0,n.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":i,onClick:e=>{e.stopPropagation(),a()},className:t(`cursor-pointer`,o),children:(0,n.jsx)(r,{enabled:e})})}export{r as n,i as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-CbjwNcR-.js";var n=e();function r({enabled:e,size:r=`md`,className:i}){let a=r===`sm`;return(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t(`relative inline-flex shrink-0 items-center rounded-full`,`transition-colors duration-200 ease-in-out motion-reduce:transition-none`,a?`h-3.5 w-6 p-[3px]`:`h-[22px] w-[40px] border`,e?a?`bg-white`:`border-white bg-white`:a?`bg-[var(--oh-border)]`:`border-[var(--oh-border)] bg-surface-raised`,i),children:(0,n.jsx)(`span`,{className:t(`inline-block rounded-full`,`transition-transform duration-200 ease-in-out motion-reduce:transition-none`,a?`size-2`:`size-4`,e?a?`translate-x-[10px] bg-base-secondary`:`translate-x-[21px] bg-base-secondary`:a?`translate-x-0 bg-[var(--oh-muted)]`:`translate-x-[2px] bg-[var(--oh-muted)]`)})})}function i({enabled:e,label:i,onToggle:a,className:o}){return(0,n.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":i,onClick:e=>{e.stopPropagation(),a()},className:t(`cursor-pointer`,o),children:(0,n.jsx)(r,{enabled:e})})}export{r as n,i as t};
@@ -0,0 +1 @@
1
+ import{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{r as s}from"./automation-disabled-reason-QFtMrdOr.js";import{n as c,t as l}from"./context-menu-list-item-DIm5xQg6.js";import{r as u}from"./dropdown-classes-DyyMaaXl.js";var d=e(n(),1),f=e(t()),p=r(),m=e=>(0,p.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 20 20`,...e,children:(0,p.jsx)(`path`,{d:`M10 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z`})}),h=o(`inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,u);function g({items:e,triggerClassName:t}){let{t:n}=i(`openhands`),[r,u]=(0,f.useState)(!1),[g,_]=(0,f.useState)(),v=(0,f.useRef)(null),y=(0,f.useRef)(null);(0,f.useLayoutEffect)(()=>{if(!r||!v.current)return;let t=()=>{let t=v.current?.getBoundingClientRect();if(!t)return;let n=(y.current?.getBoundingClientRect().height??0)||e.length*36;_({position:`fixed`,zIndex:9999,...t.bottom+4+n>window.innerHeight?{bottom:window.innerHeight-t.top+4}:{top:t.bottom+4},right:window.innerWidth-t.right})};t();let n=window.requestAnimationFrame(t);return window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.cancelAnimationFrame(n),window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[r,e.length]),(0,f.useEffect)(()=>{if(!r)return;let e=e=>{let t=e.target;v.current?.contains(t)||y.current?.contains(t)||u(!1)},t=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let b=r&&g?(0,p.jsx)(c,{ref:y,theme:`popover`,className:`min-w-[10rem]`,children:e.map(e=>(0,p.jsx)(`li`,{children:(0,p.jsx)(l,{onClick:t=>{t.stopPropagation(),e.onClick(),u(!1)},isDisabled:e.disabled,className:`group`,children:(0,p.jsx)(s,{icon:e.icon,label:e.label})})},e.label))}):null;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`button`,{ref:v,type:`button`,onClick:e=>{e.stopPropagation(),u(e=>!e)},className:o(h,t),"aria-label":n(a.AUTOMATIONS$ACTIONS_MENU),"aria-expanded":r,"aria-haspopup":`menu`,children:(0,p.jsx)(m,{className:`size-4`})}),r&&g&&typeof document<`u`?d.createPortal((0,p.jsx)(`div`,{style:g,children:b}),document.body):null]})}var _=e=>(0,p.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,p.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})});export{g as n,h as r,_ as t};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-BgLSZdyy.js";import{t as n}from"./dist-Bl64nBZL.js";var r=e(),i=n(``,{variants:{variant:{h1:`text-[32px] text-white font-medium leading-5`,h2:`text-xl font-medium leading-6 -tracking-[0.02em] text-white`,h3:`text-sm font-medium text-[var(--oh-text-tertiary)]`,span:`text-sm font-normal text-white leading-5.5`,p:`text-sm font-normal text-white leading-5.5`,codeBlock:`font-mono text-sm leading-relaxed text-[var(--oh-text-tertiary)] whitespace-pre-wrap`}},defaultVariants:{variant:`h1`}});function a({variant:e,className:n,testId:a,children:o}){return(0,r.jsx)(e,{"data-testid":a,className:t(i({variant:e}),n),children:o})}function o({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h1`,className:e,testId:t,children:n})}function s({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h2`,className:e,testId:t,children:n})}function c({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h3`,className:e,testId:t,children:n})}function l({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`span`,className:e,testId:t,children:n})}function u({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`codeBlock`,className:e,testId:t,children:n})}function d({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`p`,className:e,testId:t,children:n})}a.H1=o,a.H2=s,a.H3=c,a.Text=l,a.CodeBlock=u,a.Paragraph=d;export{l as n,a as r,o as t};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{t}from"./utils-CbjwNcR-.js";import{t as n}from"./dist-Bl64nBZL.js";var r=e(),i=n(``,{variants:{variant:{h1:`text-[32px] text-white font-medium leading-5`,h2:`text-xl font-medium leading-6 -tracking-[0.02em] text-white`,h3:`text-sm font-medium text-[var(--oh-text-tertiary)]`,span:`text-sm font-normal text-white leading-5.5`,p:`text-sm font-normal text-white leading-5.5`,codeBlock:`font-mono text-sm leading-relaxed text-[var(--oh-text-tertiary)] whitespace-pre-wrap`}},defaultVariants:{variant:`h1`}});function a({variant:e,className:n,testId:a,children:o}){return(0,r.jsx)(e,{"data-testid":a,className:t(i({variant:e}),n),children:o})}function o({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h1`,className:e,testId:t,children:n})}function s({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h2`,className:e,testId:t,children:n})}function c({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`h3`,className:e,testId:t,children:n})}function l({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`span`,className:e,testId:t,children:n})}function u({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`codeBlock`,className:e,testId:t,children:n})}function d({className:e,testId:t,children:n}){return(0,r.jsx)(a,{variant:`p`,className:e,testId:t,children:n})}a.H1=o,a.H2=s,a.H3=c,a.Text=l,a.CodeBlock=u,a.Paragraph=d;export{l as n,a as r,o as t};
@@ -1 +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{K as o,t as s}from"./utils-BgLSZdyy.js";import{n as c}from"./agent-server-client-options-EHB23gyx.js";import{r as l}from"./vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js";import{r as u}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{t as d}from"./info-BcajzHn1.js";import{t as f}from"./loader-circle-BxJgk73D.js";import{t as p}from"./refresh-cw-BtdC3T8P.js";import{o as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as h}from"./brand-button-CUMfjb99.js";import{t as g}from"./styled-tooltip-CejG0rqv.js";import{d as _,f as v,l as y,u as b}from"./llm-not-configured-banner-Dh_ajcM8.js";import{g as x,tt as S}from"./markdown-renderer-DyFl9-mL.js";import{t as C}from"./conversation-tab-empty-state-B3dpJXX0.js";var w=e(t(),1);function T(e=!0){let t=x(e=>e.cost),n=x(e=>e.max_budget_per_task),r=x(e=>e.usage),{data:i}=S(),{data:a}=v(i?.id,i?.conversation_url,i?.session_api_key,e);return(0,w.useMemo)(()=>t!==null||r!==null?{cost:t,max_budget_per_task:n,usage:r}:a?{cost:a.accumulated_cost,max_budget_per_task:a.max_budget_per_task,usage:a.accumulated_token_usage?{prompt_tokens:a.accumulated_token_usage.prompt_tokens??0,completion_tokens:a.accumulated_token_usage.completion_tokens??0,cache_read_tokens:a.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:a.accumulated_token_usage.cache_write_tokens??0,context_window:a.accumulated_token_usage.context_window??0,per_turn_token:a.accumulated_token_usage.per_turn_token??0}:null}:{cost:null,max_budget_per_task:null,usage:null},[a,t,n,r])}var E=n();function D({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,E.jsx)(`div`,{className:`relative mt-1 h-1.5 w-full rounded-full bg-tertiary`,children:(0,E.jsx)(`div`,{className:s(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function O({currentCost:e,maxBudget:t}){let{t:n}=i(`openhands`),r=e/t*100;return(0,E.jsx)(`div`,{className:`flex justify-end`,children:(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(o.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:r.toFixed(2),used:n(o.CONVERSATION$USED)})})})}function k({cost:e,maxBudgetPerTask:t}){return e===null||t===null||t<=0?null:(0,E.jsxs)(`div`,{children:[(0,E.jsx)(D,{currentCost:e,maxBudget:t}),(0,E.jsx)(O,{currentCost:e,maxBudget:t})]})}function A({cost:e,maxBudgetPerTask:t}){let{t:n}=i(`openhands`);return e===null?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(k,{cost:e,maxBudgetPerTask:t}),(0,E.jsxs)(`div`,{className:`flex justify-between items-center border-t border-[var(--oh-border-subtle)] pt-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:n(o.CONVERSATION$TOTAL_COST)}),(0,E.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]})]})}function j({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`,showBorder:i=!0}){return(0,E.jsxs)(`div`,{className:s(`flex justify-between items-center pb-2`,i&&`border-b border-[var(--oh-border-subtle)]`),children:[(0,E.jsx)(`span`,{className:n,children:e}),(0,E.jsx)(`span`,{className:r,children:t})]})}function M({usage:e}){let{t}=i(`openhands`);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(j,{label:t(o.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(o.CONVERSATION$CACHE_HIT)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(o.CONVERSATION$CACHE_WRITE)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,E.jsx)(j,{label:t(o.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,E.jsx)(j,{label:t(o.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`,showBorder:!1})]})}function N({fillPercent:e,perTurnToken:t=0}){let{t:n}=i(`openhands`),{handleCompact:r,isCompacting:a,isDisabled:s,description:c}=b(t),u=e>70;return(0,E.jsxs)(`div`,{"data-testid":`compact-context-section`,className:`flex flex-col gap-2 border-t border-[var(--oh-border-subtle)] pt-3`,children:[u&&(0,E.jsx)(`span`,{className:`text-xs text-amber-500`,children:n(o.CONVERSATION$CONTEXT_FILLING_UP)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(h,{testId:`compact-context-button`,type:`button`,variant:u?`primary`:`secondary`,isDisabled:s,"aria-busy":a,onClick:r,startContent:a?(0,E.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):(0,E.jsx)(l,{className:`h-4 w-4`,"aria-hidden":!0}),className:`w-fit`,children:n(o.CONVERSATION$COMPACT_CONTEXT)}),(0,E.jsx)(g,{content:c,placement:`top`,tooltipClassName:`max-w-[220px] text-xs font-normal leading-relaxed whitespace-normal`,children:(0,E.jsx)(`button`,{type:`button`,"data-testid":`compact-context-info`,"aria-label":c,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] transition-colors cursor-help`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":!0})})})]})]})}var P=`/api/llm/balance`,F=1e4;function I(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function L(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function R(e){return I(e)&&(e.name===`TimeoutError`||e.name===`AbortError`)}function z(e){return!I(e)||typeof e.provider!=`string`?null:{provider:e.provider,limit:L(e.limit),limitRemaining:L(e.limit_remaining),usage:L(e.usage)??0,usageDaily:L(e.usage_daily),usageWeekly:L(e.usage_weekly),usageMonthly:L(e.usage_monthly),isFreeTier:e.is_free_tier===!0}}var B=class{static async getBalance(){let{host:e,apiKey:t}=c(),n=new m({host:e,apiKey:t,timeout:F});try{return z(await n.get(P,{acceptableStatusCodes:new Set([200]),responseType:`json`,timeoutSeconds:Math.floor(F/1e3)}))}catch(e){if(e instanceof Error&&`status`in e&&e.status===404)return null;if(R(e))throw Error(`Balance request timed out after ${F}ms`);let t=e instanceof Error&&`status`in e&&e.status;throw Error(t?`Balance request failed with ${t}`:`Balance request failed: ${e instanceof Error?e.message:String(e)}`)}finally{n.close()}}},V=e=>{let{backend:t}=a();return r({queryKey:[`llm-balance`,t.id,e],queryFn:()=>B.getBalance(),enabled:t.kind!==`cloud`&&!!e,staleTime:1/0,gcTime:1e3*60*5,retry:!1,refetchOnWindowFocus:!1})};function H(e){return`$${e.toFixed(2)}`}function U(){let{t:e}=i(`openhands`),{data:t}=S(),{data:n,isError:r,isFetching:a,refetch:c}=V(t?.id);if(!n||r)return null;let l=n.limit!==null&&n.limitRemaining!==null;return(0,E.jsxs)(`div`,{"data-testid":`provider-balance-card`,className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between pb-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:e(o.CONVERSATION$PROVIDER_BALANCE)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[n.provider,n.isFreeTier?` · ${e(o.CONVERSATION$FREE_TIER)}`:null]}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`provider-balance-refresh`,"aria-label":e(o.BUTTON$REFRESH),disabled:a,onClick:()=>c(),className:`cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default`,children:(0,E.jsx)(p,{className:s(`h-3.5 w-3.5`,a&&`animate-spin`)})})]})]}),(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[l?(0,E.jsx)(j,{label:e(o.CONVERSATION$CREDITS_REMAINING),value:H(n.limitRemaining??0)}):null,(0,E.jsx)(j,{label:e(o.CONVERSATION$CREDITS_USED),value:H(n.usage),valueClassName:l?``:`font-semibold`,labelClassName:l?`text-[var(--oh-muted)]`:``})]})]})}function W(){let{t:e}=i(`openhands`),t=T(),{data:n}=S(),r=n?.agent_kind===`acp`,{usage:a}=t;return t.cost!==null||a!==null?(0,E.jsxs)(`main`,{"data-testid":`usage-panel`,className:`h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3`,children:[a!==null&&(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(y,{perTurnToken:a.per_turn_token,contextWindow:a.context_window}),(0,E.jsx)(N,{fillPercent:_(a.per_turn_token,a.context_window),perTurnToken:a.per_turn_token})]})}),(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(`div`,{className:`flex justify-between items-center pb-2`,children:(0,E.jsx)(`span`,{className:`text-lg font-semibold`,children:e(o.CONVERSATION$TOKEN_USAGE)})}),r&&(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:e(o.CONVERSATION$PLAN_USAGE_NOTE)}),a!==null&&(0,E.jsx)(M,{usage:a}),(0,E.jsx)(A,{cost:t.cost,maxBudgetPerTask:t.max_budget_per_task})]})}),(0,E.jsx)(U,{})]}):(0,E.jsx)(C,{icon:(0,E.jsx)(u,{}),children:e(o.CONVERSATION$NO_METRICS)})}function G(){return(0,E.jsx)(W,{})}export{G as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useQuery-DAAacS7O.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{n as a}from"./active-backend-context-BETEdaJl.js";import{K as o,t as s}from"./utils-CbjwNcR-.js";import{n as c}from"./agent-server-client-options-EHB23gyx.js";import{r as l}from"./vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js";import{r as u}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{t as d}from"./info-BcajzHn1.js";import{t as f}from"./loader-circle-BxJgk73D.js";import{t as p}from"./refresh-cw-BtdC3T8P.js";import{o as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as h}from"./brand-button-CGUwj6zK.js";import{t as g}from"./styled-tooltip-CknPQH4Y.js";import{d as _,f as v,l as y,u as b}from"./llm-not-configured-banner-BdjItKQR.js";import{g as x,tt as S}from"./markdown-renderer-DRpwRlNm.js";import{t as C}from"./conversation-tab-empty-state-BT1GrnKP.js";var w=e(t(),1);function T(e=!0){let t=x(e=>e.cost),n=x(e=>e.max_budget_per_task),r=x(e=>e.usage),{data:i}=S(),{data:a}=v(i?.id,i?.conversation_url,i?.session_api_key,e);return(0,w.useMemo)(()=>t!==null||r!==null?{cost:t,max_budget_per_task:n,usage:r}:a?{cost:a.accumulated_cost,max_budget_per_task:a.max_budget_per_task,usage:a.accumulated_token_usage?{prompt_tokens:a.accumulated_token_usage.prompt_tokens??0,completion_tokens:a.accumulated_token_usage.completion_tokens??0,cache_read_tokens:a.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:a.accumulated_token_usage.cache_write_tokens??0,context_window:a.accumulated_token_usage.context_window??0,per_turn_token:a.accumulated_token_usage.per_turn_token??0}:null}:{cost:null,max_budget_per_task:null,usage:null},[a,t,n,r])}var E=n();function D({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,E.jsx)(`div`,{className:`relative mt-1 h-1.5 w-full rounded-full bg-tertiary`,children:(0,E.jsx)(`div`,{className:s(`absolute inset-y-0 left-0 rounded-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function O({currentCost:e,maxBudget:t}){let{t:n}=i(`openhands`),r=e/t*100;return(0,E.jsx)(`div`,{className:`flex justify-end`,children:(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(o.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:r.toFixed(2),used:n(o.CONVERSATION$USED)})})})}function k({cost:e,maxBudgetPerTask:t}){return e===null||t===null||t<=0?null:(0,E.jsxs)(`div`,{children:[(0,E.jsx)(D,{currentCost:e,maxBudget:t}),(0,E.jsx)(O,{currentCost:e,maxBudget:t})]})}function A({cost:e,maxBudgetPerTask:t}){let{t:n}=i(`openhands`);return e===null?null:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(k,{cost:e,maxBudgetPerTask:t}),(0,E.jsxs)(`div`,{className:`flex justify-between items-center border-t border-[var(--oh-border-subtle)] pt-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:n(o.CONVERSATION$TOTAL_COST)}),(0,E.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]})]})}function j({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`,showBorder:i=!0}){return(0,E.jsxs)(`div`,{className:s(`flex justify-between items-center pb-2`,i&&`border-b border-[var(--oh-border-subtle)]`),children:[(0,E.jsx)(`span`,{className:n,children:e}),(0,E.jsx)(`span`,{className:r,children:t})]})}function M({usage:e}){let{t}=i(`openhands`);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(j,{label:t(o.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(o.CONVERSATION$CACHE_HIT)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,E.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(o.CONVERSATION$CACHE_WRITE)}),(0,E.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,E.jsx)(j,{label:t(o.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,E.jsx)(j,{label:t(o.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`,showBorder:!1})]})}function N({fillPercent:e,perTurnToken:t=0}){let{t:n}=i(`openhands`),{handleCompact:r,isCompacting:a,isDisabled:s,description:c}=b(t),u=e>70;return(0,E.jsxs)(`div`,{"data-testid":`compact-context-section`,className:`flex flex-col gap-2 border-t border-[var(--oh-border-subtle)] pt-3`,children:[u&&(0,E.jsx)(`span`,{className:`text-xs text-amber-500`,children:n(o.CONVERSATION$CONTEXT_FILLING_UP)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(h,{testId:`compact-context-button`,type:`button`,variant:u?`primary`:`secondary`,isDisabled:s,"aria-busy":a,onClick:r,startContent:a?(0,E.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):(0,E.jsx)(l,{className:`h-4 w-4`,"aria-hidden":!0}),className:`w-fit`,children:n(o.CONVERSATION$COMPACT_CONTEXT)}),(0,E.jsx)(g,{content:c,placement:`top`,tooltipClassName:`max-w-[220px] text-xs font-normal leading-relaxed whitespace-normal`,children:(0,E.jsx)(`button`,{type:`button`,"data-testid":`compact-context-info`,"aria-label":c,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] transition-colors cursor-help`,children:(0,E.jsx)(d,{className:`size-3.5`,"aria-hidden":!0})})})]})]})}var P=`/api/llm/balance`,F=1e4;function I(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function L(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function R(e){return I(e)&&(e.name===`TimeoutError`||e.name===`AbortError`)}function z(e){return!I(e)||typeof e.provider!=`string`?null:{provider:e.provider,limit:L(e.limit),limitRemaining:L(e.limit_remaining),usage:L(e.usage)??0,usageDaily:L(e.usage_daily),usageWeekly:L(e.usage_weekly),usageMonthly:L(e.usage_monthly),isFreeTier:e.is_free_tier===!0}}var B=class{static async getBalance(){let{host:e,apiKey:t}=c(),n=new m({host:e,apiKey:t,timeout:F});try{return z(await n.get(P,{acceptableStatusCodes:new Set([200]),responseType:`json`,timeoutSeconds:Math.floor(F/1e3)}))}catch(e){if(e instanceof Error&&`status`in e&&e.status===404)return null;if(R(e))throw Error(`Balance request timed out after ${F}ms`);let t=e instanceof Error&&`status`in e&&e.status;throw Error(t?`Balance request failed with ${t}`:`Balance request failed: ${e instanceof Error?e.message:String(e)}`)}finally{n.close()}}},V=e=>{let{backend:t}=a();return r({queryKey:[`llm-balance`,t.id,e],queryFn:()=>B.getBalance(),enabled:t.kind!==`cloud`&&!!e,staleTime:1/0,gcTime:1e3*60*5,retry:!1,refetchOnWindowFocus:!1})};function H(e){return`$${e.toFixed(2)}`}function U(){let{t:e}=i(`openhands`),{data:t}=S(),{data:n,isError:r,isFetching:a,refetch:c}=V(t?.id);if(!n||r)return null;let l=n.limit!==null&&n.limitRemaining!==null;return(0,E.jsxs)(`div`,{"data-testid":`provider-balance-card`,className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between pb-2`,children:[(0,E.jsx)(`span`,{className:`font-semibold`,children:e(o.CONVERSATION$PROVIDER_BALANCE)}),(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[n.provider,n.isFreeTier?` · ${e(o.CONVERSATION$FREE_TIER)}`:null]}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`provider-balance-refresh`,"aria-label":e(o.BUTTON$REFRESH),disabled:a,onClick:()=>c(),className:`cursor-pointer text-[var(--oh-muted)] hover:text-[var(--oh-foreground)] disabled:cursor-default`,children:(0,E.jsx)(p,{className:s(`h-3.5 w-3.5`,a&&`animate-spin`)})})]})]}),(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[l?(0,E.jsx)(j,{label:e(o.CONVERSATION$CREDITS_REMAINING),value:H(n.limitRemaining??0)}):null,(0,E.jsx)(j,{label:e(o.CONVERSATION$CREDITS_USED),value:H(n.usage),valueClassName:l?``:`font-semibold`,labelClassName:l?`text-[var(--oh-muted)]`:``})]})]})}function W(){let{t:e}=i(`openhands`),t=T(),{data:n}=S(),r=n?.agent_kind===`acp`,{usage:a}=t;return t.cost!==null||a!==null?(0,E.jsxs)(`main`,{"data-testid":`usage-panel`,className:`h-full overflow-y-auto custom-scrollbar-always flex flex-col gap-3 p-3`,children:[a!==null&&(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(y,{perTurnToken:a.per_turn_token,contextWindow:a.context_window}),(0,E.jsx)(N,{fillPercent:_(a.per_turn_token,a.context_window),perTurnToken:a.per_turn_token})]})}),(0,E.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,E.jsxs)(`div`,{className:`grid gap-3`,children:[(0,E.jsx)(`div`,{className:`flex justify-between items-center pb-2`,children:(0,E.jsx)(`span`,{className:`text-lg font-semibold`,children:e(o.CONVERSATION$TOKEN_USAGE)})}),r&&(0,E.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:e(o.CONVERSATION$PLAN_USAGE_NOTE)}),a!==null&&(0,E.jsx)(M,{usage:a}),(0,E.jsx)(A,{cost:t.cost,maxBudgetPerTask:t.max_budget_per_task})]})}),(0,E.jsx)(U,{})]}):(0,E.jsx)(C,{icon:(0,E.jsx)(u,{}),children:e(o.CONVERSATION$NO_METRICS)})}function G(){return(0,E.jsx)(W,{})}export{G as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,dt as c,n as l,st as u,ut 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"./agent-server-client-options-EHB23gyx.js";import{t as h}from"./check-Bo8s5Ylg.js";import{t as g}from"./loader-circle-BxJgk73D.js";import{b as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{l as v}from"./form-control-classes-Dbq-7YP_.js";import{n as y,t as b}from"./settings-input-dVuzapBA.js";import{a as x,l as S}from"./acp-providers-DcY_mKYa.js";import{t as C}from"./use-get-secrets-CMTuWEp_.js";import{t as w}from"./use-create-secret-CjWq0J4O.js";var T=i(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),E=e(t(),1),D=n();function O({conflicts:e}){let{t}=o(`openhands`);return(0,D.jsx)(D.Fragment,{children:e.map(([e,n])=>(0,D.jsx)(`p`,{"data-testid":`acp-credential-conflict-warning`,className:`text-sm text-amber-300`,children:t(f.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function k({status:e,isChecking:t,credentialsConfigured:n}){return e===`authenticated`?`signed-in`:t?`checking`:n?`configured`:`none`}function A({status:e,isChecking:t,providerName:n,credentialsConfigured:r=!1,testIdPrefix:i}){let{t:a}=o(`openhands`),s=k({status:e,isChecking:t,credentialsConfigured:r});return s===`signed-in`?(0,D.jsxs)(`div`,{"data-testid":`${i}-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,D.jsx)(h,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_AUTH_DETECTED,{provider:n})})]}):s===`checking`?(0,D.jsxs)(`div`,{"data-testid":`${i}-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,D.jsx)(g,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):s===`configured`?(0,D.jsxs)(`div`,{"data-testid":`${i}-configured`,className:`flex items-start gap-2 rounded-xl border border-blue-500/40 bg-blue-500/10 px-4 py-3 text-sm text-blue-200`,children:[(0,D.jsx)(T,{className:`mt-0.5 size-4 shrink-0 text-blue-400`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_CREDENTIALS_CONFIGURED,{provider:n})})]}):null}function j({field:e,value:t,onChange:n,alreadySet:r,testId:i,showOptionalTag:a}){let{t:s}=o(`openhands`),c=r?s(f.ONBOARDING$ACP_SECRET_ALREADY_SET):``;return(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.multiline?(0,D.jsxs)(`label`,{className:`flex flex-col gap-2.5`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`text-sm font-mono text-white`,children:e.name}),a&&(0,D.jsx)(y,{})]}),(0,D.jsx)(`textarea`,{"data-testid":i,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:c,onChange:e=>n(e.target.value),className:p(v,`font-mono text-xs`)})]}):(0,D.jsx)(b,{testId:i,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:a,placeholder:c}),(0,D.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:s(e.hint_key,e.hint_values)})]})}var M=10;function N(e){return`${e.stdout??``}\n${e.stderr??``}`}function P(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function F(e){let t=N(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function I(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var L={"claude-code":{command:`claude auth status --json`,classify:P},codex:{command:`codex login status`,classify:F},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:I}},R=class{static async getAuthStatus(e){let t=L[e];if(!t)return`unknown`;let n=await new _(m()).executeCommand(t.command,void 0,M);return t.classify(n)}};async function z(e){try{return await R.getAuthStatus(e)}catch{return`unknown`}}function B(e,t={}){let{enabled:n=!0}=t,r=l(),i=r.backend.kind===`local`,o=n&&i&&!!e,s=a({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>z(e),enabled:o,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:o&&s.isFetching&&s.data===void 0,isSupported:i}}function V(e,t){let{t:n}=o(`openhands`),i=r(),{mutateAsync:a}=w(),[l,p]=E.useState(!1);return{saveFilled:async(r,{silent:o=!1}={})=>{let l=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(l.length===0)return!0;p(!0);try{for(let{field:e,value:t}of l)await a({name:e.name,value:t});return await i.invalidateQueries({queryKey:[`secrets-search`]}),await i.invalidateQueries({queryKey:[`secrets`]}),!t&&l.some(({field:e})=>e.multiline)?d(n(f.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):o||s(n(f.SETTINGS$SAVED)),!0}catch(e){return u(c(e)||n(f.ERROR$GENERIC)),!1}finally{p(!1)}},isSaving:l}}function H(e){let{data:t}=C(),n=E.useMemo(()=>S(e),[e]),[r,i]=E.useState({}),{saveFilled:a,isSaving:o}=V(n,!0);E.useEffect(()=>{i({})},[e]);let s=E.useCallback(e=>(t??[]).some(t=>t.name===e),[t]),c=E.useCallback(e=>!!r[e]?.trim()||s(e),[r,s]),l=E.useCallback((e,t)=>i(n=>({...n,[e]:t})),[]),u=E.useCallback(()=>i({}),[]);return{fields:n,values:r,setValue:l,secretExists:s,hasValueFor:c,conflicts:x(e,c),credentialsConfigured:n.some(e=>e.secret===!0&&s(e.name)),consumesFileCredentials:!0,isDirty:n.some(e=>!!r[e.name]?.trim()),save:e=>a(r,e),reset:u,isSaving:o}}export{O as a,A as i,B as n,T as o,j as r,H 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{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,dt as c,n as l,st as u,ut as d}from"./active-backend-context-BETEdaJl.js";import{K as f,t as p}from"./utils-CbjwNcR-.js";import{n as m}from"./agent-server-client-options-EHB23gyx.js";import{t as h}from"./check-Bo8s5Ylg.js";import{t as g}from"./loader-circle-BxJgk73D.js";import{y as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{l as v}from"./form-control-classes-BVI_szaj.js";import{n as y,t as b}from"./settings-input-B3i5U9GL.js";import{a as x,l as S}from"./acp-providers-DOKcGeaV.js";import{t as C}from"./use-get-secrets-Pbo9jh2A.js";import{t as w}from"./use-create-secret-D_qPU88t.js";var T=i(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),E=e(t(),1),D=n();function O({conflicts:e}){let{t}=o(`openhands`);return(0,D.jsx)(D.Fragment,{children:e.map(([e,n])=>(0,D.jsx)(`p`,{"data-testid":`acp-credential-conflict-warning`,className:`text-sm text-amber-300`,children:t(f.SETTINGS$ACP_CREDENTIAL_CONFLICT_WARNING,{credential:e,conflicting:n})},`${e}:${n}`))})}function k({status:e,isChecking:t,credentialsConfigured:n}){return e===`authenticated`?`signed-in`:t?`checking`:n?`configured`:`none`}function A({status:e,isChecking:t,providerName:n,credentialsConfigured:r=!1,testIdPrefix:i}){let{t:a}=o(`openhands`),s=k({status:e,isChecking:t,credentialsConfigured:r});return s===`signed-in`?(0,D.jsxs)(`div`,{"data-testid":`${i}-detected`,className:`flex items-start gap-2 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3 text-sm text-green-200`,children:[(0,D.jsx)(h,{className:`mt-0.5 size-4 shrink-0 text-green-400`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_AUTH_DETECTED,{provider:n})})]}):s===`checking`?(0,D.jsxs)(`div`,{"data-testid":`${i}-checking`,className:`flex items-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,D.jsx)(g,{className:`size-4 shrink-0 animate-spin`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_AUTH_CHECKING,{provider:n})})]}):s===`configured`?(0,D.jsxs)(`div`,{"data-testid":`${i}-configured`,className:`flex items-start gap-2 rounded-xl border border-blue-500/40 bg-blue-500/10 px-4 py-3 text-sm text-blue-200`,children:[(0,D.jsx)(T,{className:`mt-0.5 size-4 shrink-0 text-blue-400`,"aria-hidden":!0}),(0,D.jsx)(`span`,{children:a(f.ONBOARDING$ACP_CREDENTIALS_CONFIGURED,{provider:n})})]}):null}function j({field:e,value:t,onChange:n,alreadySet:r,testId:i,showOptionalTag:a}){let{t:s}=o(`openhands`),c=r?s(f.ONBOARDING$ACP_SECRET_ALREADY_SET):``;return(0,D.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.multiline?(0,D.jsxs)(`label`,{className:`flex flex-col gap-2.5`,children:[(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`text-sm font-mono text-white`,children:e.name}),a&&(0,D.jsx)(y,{})]}),(0,D.jsx)(`textarea`,{"data-testid":i,name:e.name,rows:4,spellCheck:!1,autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,value:t,placeholder:c,onChange:e=>n(e.target.value),className:p(v,`font-mono text-xs`)})]}):(0,D.jsx)(b,{testId:i,name:e.name,label:e.name,labelClassName:`font-mono`,type:e.secret?`password`:`text`,value:t,onChange:n,showOptionalTag:a,placeholder:c}),(0,D.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:s(e.hint_key,e.hint_values)})]})}var M=10;function N(e){return`${e.stdout??``}\n${e.stderr??``}`}function P(e){let t;try{t=JSON.parse((e.stdout??``).trim())}catch{return`unknown`}let n=t?.loggedIn;return typeof n==`boolean`?n?`authenticated`:`unauthenticated`:`unknown`}function F(e){let t=N(e).toLowerCase();return t.includes(`not logged in`)?`unauthenticated`:t.includes(`logged in`)?`authenticated`:`unknown`}function I(e){let t=(e.stdout??``).trim();return t===`present`?`authenticated`:t===`absent`?`unauthenticated`:`unknown`}var L={"claude-code":{command:`claude auth status --json`,classify:P},codex:{command:`codex login status`,classify:F},"gemini-cli":{command:`test -f "$HOME/.gemini/oauth_creds.json" && echo present || echo absent`,classify:I}},R=class{static async getAuthStatus(e){let t=L[e];if(!t)return`unknown`;let n=await new _(m()).executeCommand(t.command,void 0,M);return t.classify(n)}};async function z(e){try{return await R.getAuthStatus(e)}catch{return`unknown`}}function B(e,t={}){let{enabled:n=!0}=t,r=l(),i=r.backend.kind===`local`,o=n&&i&&!!e,s=a({queryKey:[`acp-auth-status`,r.backend.id,e],queryFn:()=>z(e),enabled:o,staleTime:1/0,gcTime:1e3*60*15,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1});return{status:s.data??`unknown`,isChecking:o&&s.isFetching&&s.data===void 0,isSupported:i}}function V(e,t){let{t:n}=o(`openhands`),i=r(),{mutateAsync:a}=w(),[l,p]=E.useState(!1);return{saveFilled:async(r,{silent:o=!1}={})=>{let l=e.map(e=>({field:e,value:r[e.name]?.trim()})).filter(e=>!!e.value);if(l.length===0)return!0;p(!0);try{for(let{field:e,value:t}of l)await a({name:e.name,value:t});return await i.invalidateQueries({queryKey:[`secrets-search`]}),await i.invalidateQueries({queryKey:[`secrets`]}),!t&&l.some(({field:e})=>e.multiline)?d(n(f.ONBOARDING$ACP_SECRETS_ORPHANED_WARNING)):o||s(n(f.SETTINGS$SAVED)),!0}catch(e){return u(c(e)||n(f.ERROR$GENERIC)),!1}finally{p(!1)}},isSaving:l}}function H(e){let{data:t}=C(),n=E.useMemo(()=>S(e),[e]),[r,i]=E.useState({}),{saveFilled:a,isSaving:o}=V(n,!0);E.useEffect(()=>{i({})},[e]);let s=E.useCallback(e=>(t??[]).some(t=>t.name===e),[t]),c=E.useCallback(e=>!!r[e]?.trim()||s(e),[r,s]),l=E.useCallback((e,t)=>i(n=>({...n,[e]:t})),[]),u=E.useCallback(()=>i({}),[]);return{fields:n,values:r,setValue:l,secretExists:s,hasValueFor:c,conflicts:x(e,c),credentialsConfigured:n.some(e=>e.secret===!0&&s(e.name)),consumesFileCredentials:!0,isDirty:n.some(e=>!!r[e.name]?.trim()),save:e=>a(r,e),reset:u,isSaving:o}}export{O as a,A as i,B as n,T as o,j as r,H as t};
@@ -1 +1 @@
1
- import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{O as n,V as r}from"./active-backend-context-BnH4-L8h.js";import{t as i}from"./settings-service.api-C1vZH9Vh.js";import{t as a}from"./agent-profiles-service.api-DkeZaqIl.js";var o=[`activate-agent-profile`];function s(){let s=e();return t({mutationKey:o,mutationFn:e=>a.activateProfile(e),onMutate:async e=>{await s.cancelQueries({queryKey:n.all});let t=s.getQueriesData({queryKey:n.all});return s.setQueriesData({queryKey:n.all},t=>t&&{...t,active_agent_profile_id:e}),{snapshots:t}},onError:(e,t,n)=>{n?.snapshots?.forEach(([e,t])=>{s.setQueryData(e,t)})},onSuccess:async()=>{i.invalidateCache(),await s.invalidateQueries({queryKey:n.all}),await s.invalidateQueries({queryKey:r.personal()})}})}export{s as n,o as t};
1
+ import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{O as n,V as r}from"./active-backend-context-BETEdaJl.js";import{t as i}from"./settings-service.api-CYBTLGOd.js";import{t as a}from"./agent-profiles-service.api-CiMVQAIT.js";var o=[`activate-agent-profile`];function s(){let s=e();return t({mutationKey:o,mutationFn:e=>a.activateProfile(e),onMutate:async e=>{await s.cancelQueries({queryKey:n.all});let t=s.getQueriesData({queryKey:n.all});return s.setQueriesData({queryKey:n.all},t=>t&&{...t,active_agent_profile_id:e}),{snapshots:t}},onError:(e,t,n)=>{n?.snapshots?.forEach(([e,t])=>{s.setQueryData(e,t)})},onSuccess:async()=>{i.invalidateCache(),await s.invalidateQueries({queryKey:n.all}),await s.invalidateQueries({queryKey:r.personal()})}})}export{s as n,o as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-DAAacS7O.js";import{M as t,O as n,k as r,n as i}from"./active-backend-context-BnH4-L8h.js";import{t as a}from"./agent-profiles-service.api-DkeZaqIl.js";function o(o={}){let{backend:s,orgId:c}=i();return e({queryKey:[...n.all,s.id,c],queryFn:a.listProfiles,...t,...r,enabled:o.enabled??!0,meta:{disableToast:!0}})}export{o as t};
1
+ import{t as e}from"./useQuery-DAAacS7O.js";import{M as t,O as n,k as r,n as i}from"./active-backend-context-BETEdaJl.js";import{t as a}from"./agent-profiles-service.api-CiMVQAIT.js";function o(o={}){let{backend:s,orgId:c}=i();return e({queryKey:[...n.all,s.id,c],queryFn:a.listProfiles,...t,...r,enabled:o.enabled??!0,meta:{disableToast:!0}})}export{o as t};
@@ -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"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BnH4-L8h.js";import{n as i}from"./use-tracking-j4uo9VEW.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),s=[`automation-health`];function c(){let e=r();return n({queryKey:[...s,e.backend.id,e.orgId],queryFn:()=>i.checkHealth(),staleTime:30*1e3,retry:!1})}export{o as n,c 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"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BETEdaJl.js";import{n as i}from"./use-tracking-BAFpgpgq.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),s=[`automation-health`];function c(){let e=r();return n({queryKey:[...s,e.backend.id,e.orgId],queryFn:()=>i.checkHealth(),staleTime:30*1e3,retry:!1})}export{o as n,c as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-DAAacS7O.js";import{n as t}from"./active-backend-context-BnH4-L8h.js";import{t as n}from"./organization-service.api-B5CvmnYQ.js";import{t as r}from"./use-cloud-current-user-id-B4ZLUZSa.js";var i=`view_automations`,a=`manage_automations`;function o(){let{backend:r,orgId:o}=t(),s=r.kind===`cloud`,{data:c,isLoading:l}=e({queryKey:[`cloud-current-user`,r.id,o,r.connectionRevision??0],queryFn:()=>n(o,r),enabled:s&&!!o,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});if(!s)return{canView:!0,canManage:!0,isLoading:!1};if(l||!c)return{canView:!1,canManage:!1,isLoading:l};if(c.permissions)return{canView:c.permissions.includes(i),canManage:c.permissions.includes(a),isLoading:!1};let u=c.role===`owner`||c.role===`admin`;return{canView:u||c.role===`member`,canManage:u,isLoading:!1}}function s(e){let{backend:n}=t(),i=r();if(n.kind!==`cloud`)return!0;let a=i[n.id];return!a||a.isLoading||!a.userId?!1:e.user_id===a.userId}export{s as n,o as t};
1
+ import{t as e}from"./useQuery-DAAacS7O.js";import{n as t}from"./active-backend-context-BETEdaJl.js";import{t as n}from"./organization-service.api-zhHpQU0t.js";import{t as r}from"./use-cloud-current-user-id-Dqw6qQUg.js";var i=`view_automations`,a=`manage_automations`;function o(){let{backend:r,orgId:o}=t(),s=r.kind===`cloud`,{data:c,isLoading:l}=e({queryKey:[`cloud-current-user`,r.id,o,r.connectionRevision??0],queryFn:()=>n(o,r),enabled:s&&!!o,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});if(!s)return{canView:!0,canManage:!0,isLoading:!1};if(l||!c)return{canView:!1,canManage:!1,isLoading:l};if(c.permissions)return{canView:c.permissions.includes(i),canManage:c.permissions.includes(a),isLoading:!1};let u=c.role===`owner`||c.role===`admin`;return{canView:u||c.role===`member`,canManage:u,isLoading:!1}}function s(e){let{backend:n}=t(),i=r();if(n.kind!==`cloud`)return!0;let a=i[n.id];return!a||a.isLoading||!a.userId?!1:e.user_id===a.userId}export{s as n,o as t};
@@ -1 +1 @@
1
- import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BnH4-L8h.js";import{n as i,t as a}from"./use-tracking-j4uo9VEW.js";import{t as o}from"./automation-C_eCrGyP.js";var s=[`automation-detail`],c=[`automation-runs`];function l(e){let{id:t,enabled:a=!0}=e,o=r();return n({queryKey:[...s,t,o.backend.id,o.orgId],queryFn:()=>i.getAutomation(t),staleTime:300*1e3,enabled:!!t&&a})}function u(e){let{id:t,limit:a=20,offset:s=0,enabled:l=!0}=e,u=r();return n({queryKey:[...c,t,{limit:a,offset:s},u.backend.id,u.orgId],queryFn:()=>i.getAutomationRuns(t,a,s),staleTime:60*1e3,enabled:!!t&&l,refetchInterval:e=>{let t=e.state.data;return t&&t.runs.some(e=>e.status===o.PENDING||e.status===o.RUNNING)?3e3:!1}})}var d=[`automations`];function f(e={}){let{limit:t=50,offset:a=0,enabled:o=!0}=e,s=r();return n({queryKey:[...d,{limit:t,offset:a},s.backend.id,s.orgId],queryFn:()=>i.getAutomations(t,a),staleTime:0,enabled:o})}function p(){let n=e(),o=r(),{trackAutomationDisableButton:c}=a();return t({mutationFn:({id:e,enabled:t})=>i.toggleAutomation(e,t),onSuccess:(e,t)=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),t.enabled||c({backendKind:o.backend.kind})}})}function m(){let n=e(),o=r(),{trackAutomationImported:s}=a();return t({mutationFn:e=>i.createAutomation({...e,enabled:!1}),onSuccess:()=>{n.invalidateQueries({queryKey:d}),s({backendKind:o.backend.kind})}})}function h(){let n=e(),o=r(),{trackAutomationEdited:c}=a();return t({mutationFn:({id:e,body:t})=>i.updateAutomation(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),c({backendKind:o.backend.kind})}})}function g(){let n=e(),o=r(),{trackAutomationDeleted:s}=a();return t({mutationFn:e=>i.deleteAutomation(e),onSuccess:()=>{n.invalidateQueries({queryKey:d}),s({backendKind:o.backend.kind})}})}function _(){let n=e(),o=r(),{trackAutomationExecuted:l}=a();return t({mutationFn:e=>i.dispatchAutomation(e),onSuccess:(e,t)=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),n.invalidateQueries({queryKey:[...c,t]}),n.invalidateQueries({queryKey:[`user`,`conversations`]}),l({backendKind:o.backend.kind})}})}function v(){let n=e();return t({mutationFn:({runId:e})=>i.cancelAutomationRun(e),onSuccess:(e,{automationId:t})=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),n.invalidateQueries({queryKey:[...c,t]}),n.invalidateQueries({queryKey:[`user`,`conversations`]})}})}export{m as a,c,_ as i,l,v as n,p as o,g as r,h as s,f as t,u};
1
+ import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BETEdaJl.js";import{n as i,t as a}from"./use-tracking-BAFpgpgq.js";import{t as o}from"./automation-C_eCrGyP.js";var s=[`automation-detail`],c=[`automation-runs`];function l(e){let{id:t,enabled:a=!0}=e,o=r();return n({queryKey:[...s,t,o.backend.id,o.orgId],queryFn:()=>i.getAutomation(t),staleTime:300*1e3,enabled:!!t&&a})}function u(e){let{id:t,limit:a=20,offset:s=0,enabled:l=!0}=e,u=r();return n({queryKey:[...c,t,{limit:a,offset:s},u.backend.id,u.orgId],queryFn:()=>i.getAutomationRuns(t,a,s),staleTime:60*1e3,enabled:!!t&&l,refetchInterval:e=>{let t=e.state.data;return t&&t.runs.some(e=>e.status===o.PENDING||e.status===o.RUNNING)?3e3:!1}})}var d=[`automations`];function f(e={}){let{limit:t=50,offset:a=0,enabled:o=!0}=e,s=r();return n({queryKey:[...d,{limit:t,offset:a},s.backend.id,s.orgId],queryFn:()=>i.getAutomations(t,a),staleTime:0,enabled:o})}function p(){let n=e(),o=r(),{trackAutomationDisableButton:c}=a();return t({mutationFn:({id:e,enabled:t})=>i.toggleAutomation(e,t),onSuccess:(e,t)=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),t.enabled||c({backendKind:o.backend.kind})}})}function m(){let n=e(),o=r(),{trackAutomationImported:s}=a();return t({mutationFn:e=>i.createAutomation({...e,enabled:!1}),onSuccess:()=>{n.invalidateQueries({queryKey:d}),s({backendKind:o.backend.kind})}})}function h(){let n=e(),o=r(),{trackAutomationEdited:c}=a();return t({mutationFn:({id:e,body:t})=>i.updateAutomation(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),c({backendKind:o.backend.kind})}})}function g(){let n=e(),o=r(),{trackAutomationDeleted:s}=a();return t({mutationFn:e=>i.deleteAutomation(e),onSuccess:()=>{n.invalidateQueries({queryKey:d}),s({backendKind:o.backend.kind})}})}function _(){let n=e(),o=r(),{trackAutomationExecuted:l}=a();return t({mutationFn:e=>i.dispatchAutomation(e),onSuccess:(e,t)=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),n.invalidateQueries({queryKey:[...c,t]}),n.invalidateQueries({queryKey:[`user`,`conversations`]}),l({backendKind:o.backend.kind})}})}function v(){let n=e();return t({mutationFn:({runId:e})=>i.cancelAutomationRun(e),onSuccess:(e,{automationId:t})=>{n.invalidateQueries({queryKey:d}),n.invalidateQueries({queryKey:s}),n.invalidateQueries({queryKey:[...c,t]}),n.invalidateQueries({queryKey:[`user`,`conversations`]})}})}export{m as a,c,_ as i,l,v as n,p as o,g as r,h as s,f 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{t as r}from"./useQuery-DAAacS7O.js";import{n as i}from"./active-backend-context-BnH4-L8h.js";import{t as a}from"./utils-BgLSZdyy.js";import{t as o}from"./organization-service.api-B5CvmnYQ.js";import{_ as s,u as c}from"./form-control-classes-Dbq-7YP_.js";import{c as l,u}from"./dropdown-classes-BGvOvW2_.js";var d=n();function f({icon:e,text:t,className:n}){return(0,d.jsxs)(`div`,{className:a(`flex min-w-0 w-full items-center`,l,n),children:[(0,d.jsx)(`span`,{className:u,"aria-hidden":!0,children:e}),(0,d.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}var p=e(t()),m=e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,d.jsx)(`path`,{d:`M7 4C7 2.89543 7.89543 2 9 2H15C16.1046 2 17 2.89543 17 4V6H18.9897C18.9959 5.99994 19.0021 5.99994 19.0083 6H21C21.5523 6 22 6.44772 22 7C22 7.55228 21.5523 8 21 8H19.9311L19.0638 20.1425C18.989 21.1891 18.1182 22 17.0689 22H6.93112C5.88184 22 5.01096 21.1891 4.9362 20.1425L4.06888 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H4.99174C4.99795 5.99994 5.00414 5.99994 5.01032 6H7V4ZM9 6H15V4H9V6ZM6.07398 8L6.93112 20H17.0689L17.926 8H6.07398ZM10 10C10.5523 10 11 10.4477 11 11V17C11 17.5523 10.5523 18 10 18C9.44772 18 9 17.5523 9 17V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V17C15 17.5523 14.5523 18 14 18C13.4477 18 13 17.5523 13 17V11C13 10.4477 13.4477 10 14 10Z`,fill:`currentColor`})}),h=e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,d.jsx)(`path`,{d:`M14.25 19.5C14.25 20.7426 13.2426 21.75 12 21.75C10.7574 21.75 9.75 20.7426 9.75 19.5C9.75 18.2574 10.7574 17.25 12 17.25C13.2426 17.25 14.25 18.2574 14.25 19.5ZM14.25 12C14.25 13.2426 13.2426 14.25 12 14.25C10.7574 14.25 9.75 13.2426 9.75 12C9.75 10.7574 10.7574 9.75 12 9.75C13.2426 9.75 14.25 10.7574 14.25 12ZM14.25 4.5C14.25 5.74264 13.2426 6.75 12 6.75C10.7574 6.75 9.75 5.74264 9.75 4.5C9.75 3.25736 10.7574 2.25 12 2.25C13.2426 2.25 14.25 3.25736 14.25 4.5Z`,fill:`currentColor`})}),g=p.forwardRef(function({onClick:e,className:t,iconClassName:n,ariaLabel:r,testId:i=`ellipsis-button`},o){return(0,d.jsx)(`button`,{ref:o,"data-testid":i,type:`button`,onClick:e,"aria-label":r,className:a(`p-1 rounded-md cursor-pointer`,s,`text-[var(--oh-muted)]`,c,`flex items-center justify-center`,t),children:(0,d.jsx)(h,{className:n??`w-4 h-4`})})}),_=`edit_org_settings`;function v(){let{backend:e,orgId:t}=i(),n=e.kind===`cloud`,{data:a}=r({queryKey:[`cloud-current-user`,e.id,t,e.connectionRevision??0],queryFn:()=>o(t,e),enabled:n&&!!t,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});return n?a?.permissions?a.permissions.includes(_):a?.role===`owner`||a?.role===`admin`:!0}export{f as a,m as i,g as n,h as r,v 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"./useQuery-DAAacS7O.js";import{n as i}from"./active-backend-context-BETEdaJl.js";import{t as a}from"./utils-CbjwNcR-.js";import{t as o}from"./organization-service.api-zhHpQU0t.js";import{_ as s,u as c}from"./form-control-classes-BVI_szaj.js";import{c as l,u}from"./dropdown-classes-DyyMaaXl.js";var d=n();function f({icon:e,text:t,className:n}){return(0,d.jsxs)(`div`,{className:a(`flex min-w-0 w-full items-center`,l,n),children:[(0,d.jsx)(`span`,{className:u,"aria-hidden":!0,children:e}),(0,d.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}var p=e(t()),m=e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,d.jsx)(`path`,{d:`M7 4C7 2.89543 7.89543 2 9 2H15C16.1046 2 17 2.89543 17 4V6H18.9897C18.9959 5.99994 19.0021 5.99994 19.0083 6H21C21.5523 6 22 6.44772 22 7C22 7.55228 21.5523 8 21 8H19.9311L19.0638 20.1425C18.989 21.1891 18.1182 22 17.0689 22H6.93112C5.88184 22 5.01096 21.1891 4.9362 20.1425L4.06888 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H4.99174C4.99795 5.99994 5.00414 5.99994 5.01032 6H7V4ZM9 6H15V4H9V6ZM6.07398 8L6.93112 20H17.0689L17.926 8H6.07398ZM10 10C10.5523 10 11 10.4477 11 11V17C11 17.5523 10.5523 18 10 18C9.44772 18 9 17.5523 9 17V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V17C15 17.5523 14.5523 18 14 18C13.4477 18 13 17.5523 13 17V11C13 10.4477 13.4477 10 14 10Z`,fill:`currentColor`})}),h=e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,d.jsx)(`path`,{d:`M14.25 19.5C14.25 20.7426 13.2426 21.75 12 21.75C10.7574 21.75 9.75 20.7426 9.75 19.5C9.75 18.2574 10.7574 17.25 12 17.25C13.2426 17.25 14.25 18.2574 14.25 19.5ZM14.25 12C14.25 13.2426 13.2426 14.25 12 14.25C10.7574 14.25 9.75 13.2426 9.75 12C9.75 10.7574 10.7574 9.75 12 9.75C13.2426 9.75 14.25 10.7574 14.25 12ZM14.25 4.5C14.25 5.74264 13.2426 6.75 12 6.75C10.7574 6.75 9.75 5.74264 9.75 4.5C9.75 3.25736 10.7574 2.25 12 2.25C13.2426 2.25 14.25 3.25736 14.25 4.5Z`,fill:`currentColor`})}),g=p.forwardRef(function({onClick:e,className:t,iconClassName:n,ariaLabel:r,testId:i=`ellipsis-button`},o){return(0,d.jsx)(`button`,{ref:o,"data-testid":i,type:`button`,onClick:e,"aria-label":r,className:a(`p-1 rounded-md cursor-pointer`,s,`text-[var(--oh-muted)]`,c,`flex items-center justify-center`,t),children:(0,d.jsx)(h,{className:n??`w-4 h-4`})})}),_=`edit_org_settings`;function v(){let{backend:e,orgId:t}=i(),n=e.kind===`cloud`,{data:a}=r({queryKey:[`cloud-current-user`,e.id,t,e.connectionRevision??0],queryFn:()=>o(t,e),enabled:n&&!!t,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}});return n?a?.permissions?a.permissions.includes(_):a?.role===`owner`||a?.role===`admin`:!0}export{f as a,m as i,g as n,h as r,v as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-DAAacS7O.js";import{$ as t,j as n,n as r}from"./active-backend-context-BnH4-L8h.js";import{c as i,n as a,p as o}from"./agent-server-client-options-EHB23gyx.js";import{o as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";var c=`/api/canvas-extensions`,l=/^(?:github:|https?:\/\/|git:\/\/|file:\/\/|[\w.-]+@[\w.-]+:)/i,u=class extends Error{reason;constructor(e){super(e===`no-backend`?`Add an Agent Server backend to use Apps.`:e===`cloud-backend`?`Apps are not available on Cloud backends yet.`:`This Agent Server does not support Apps yet. Upgrade the backend and try again.`),this.name=`CanvasExtensionsUnsupportedError`,this.reason=e}};function d(e){return e instanceof u||typeof e==`object`&&!!e&&`name`in e&&e.name===`CanvasExtensionsUnsupportedError`}function f(){let{backend:e}=i();if(o(e))throw new u(`no-backend`);if(e.kind===`cloud`)throw new u(`cloud-backend`)}function p(){return f(),new s(a())}function m(e){if(o(e))throw new u(`no-backend`);if(e.kind===`cloud`)throw new u(`cloud-backend`);return new s({host:e.host,...e.apiKey?{apiKey:e.apiKey}:{},timeout:6e4})}async function h(e){try{return await e()}catch(e){throw t(e,404)?new u(`missing-api`):e}}function g(e){return`${c}/installed/${encodeURIComponent(e)}`}function _(e,t){let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`,r=e.replace(/[\\/]+$/,``),i=t.replace(/^[\\/]+/,``);return i?r?`${r}${n}${i}`:`${n}${i}`:e}function v(e){let t=e.repo_path?.trim();return!t||l.test(e.source)?e:{...e,source:_(e.source,t),repo_path:null}}var y=class{static async listInstalled(){let e=p();return(await h(()=>e.get(`${c}/installed`))).canvas_extensions??[]}static async install(e){let t=p();return h(()=>t.post(`${c}/install`,v(e)))}static async setEnabled(e,t){let n=p();return h(()=>n.patch(g(e),{enabled:t}))}static async uninstall(e){let t=p();return h(()=>t.delete(g(e)))}static async fetchBundle(e,t){let n=t?m(t):p();return h(()=>n.get(`${g(e)}/bundle`,{responseType:`text`}))}static async requestAgentServer(e,t){if(!e.path.startsWith(`/`)||e.path.startsWith(`//`))throw Error(`Canvas Extension Agent Server requests must use a root-relative path.`);return(t?m(t):p()).request({method:e.method??`GET`,path:e.path,body:e.body,headers:e.headers})}};function b(t={}){let i=r(),a=i.backend.connectionRevision??0,s=!o(i.backend)&&i.backend.kind===`local`;return e({queryKey:n.installed(i.backend.id,i.orgId,a),queryFn:()=>y.listInstalled(),enabled:(t.enabled??!0)&&s,retry:!1,staleTime:0,refetchOnWindowFocus:!0,meta:{backendId:i.backend.id,disableToast:!0}})}export{d as i,y as n,u as r,b as t};
1
+ import{t as e}from"./useQuery-DAAacS7O.js";import{$ as t,j as n,n as r}from"./active-backend-context-BETEdaJl.js";import{c as i,n as a,p as o}from"./agent-server-client-options-EHB23gyx.js";import{o as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";var c=`/api/canvas-extensions`,l=/^(?:github:|https?:\/\/|git:\/\/|file:\/\/|[\w.-]+@[\w.-]+:)/i,u=class extends Error{reason;constructor(e){super(e===`no-backend`?`Add an Agent Server backend to use Apps.`:e===`cloud-backend`?`Apps are not available on Cloud backends yet.`:`This Agent Server does not support Apps yet. Upgrade the backend and try again.`),this.name=`CanvasExtensionsUnsupportedError`,this.reason=e}};function d(e){return e instanceof u||typeof e==`object`&&!!e&&`name`in e&&e.name===`CanvasExtensionsUnsupportedError`}function f(){let{backend:e}=i();if(o(e))throw new u(`no-backend`);if(e.kind===`cloud`)throw new u(`cloud-backend`)}function p(){return f(),new s(a())}function m(e){if(o(e))throw new u(`no-backend`);if(e.kind===`cloud`)throw new u(`cloud-backend`);return new s({host:e.host,...e.apiKey?{apiKey:e.apiKey}:{},timeout:6e4})}async function h(e){try{return await e()}catch(e){throw t(e,404)?new u(`missing-api`):e}}function g(e){return`${c}/installed/${encodeURIComponent(e)}`}function _(e,t){let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`,r=e.replace(/[\\/]+$/,``),i=t.replace(/^[\\/]+/,``);return i?r?`${r}${n}${i}`:`${n}${i}`:e}function v(e){let t=e.repo_path?.trim();return!t||l.test(e.source)?e:{...e,source:_(e.source,t),repo_path:null}}var y=class{static async listInstalled(){let e=p();return(await h(()=>e.get(`${c}/installed`))).canvas_extensions??[]}static async install(e){let t=p();return h(()=>t.post(`${c}/install`,v(e)))}static async setEnabled(e,t){let n=p();return h(()=>n.patch(g(e),{enabled:t}))}static async uninstall(e){let t=p();return h(()=>t.delete(g(e)))}static async fetchBundle(e,t){let n=t?m(t):p();return h(()=>n.get(`${g(e)}/bundle`,{responseType:`text`}))}static async requestAgentServer(e,t){if(!e.path.startsWith(`/`)||e.path.startsWith(`//`))throw Error(`Canvas Extension Agent Server requests must use a root-relative path.`);return(t?m(t):p()).request({method:e.method??`GET`,path:e.path,body:e.body,headers:e.headers})}};function b(t={}){let i=r(),a=i.backend.connectionRevision??0,s=!o(i.backend)&&i.backend.kind===`local`;return e({queryKey:n.installed(i.backend.id,i.orgId,a),queryFn:()=>y.listInstalled(),enabled:(t.enabled??!0)&&s,retry:!1,staleTime:0,refetchOnWindowFocus:!0,meta:{backendId:i.backend.id,disableToast:!0}})}export{d as i,y as n,u as r,b as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQueries-pUohFMSP.js";import{n as t,r as n}from"./active-backend-context-BnH4-L8h.js";import{i as r,r as i,t as a}from"./organization-service.api-B5CvmnYQ.js";function o(){let{backends:t}=n(),a=t.filter(e=>e.kind===`cloud`),o=e({queries:a.map(e=>({queryKey:[`cloud-organizations`,e.id,e.connectionRevision??0],queryFn:async()=>{let t=await i(e);if(e.authMode===`cookie`)return t;let n=await r(e);return n.isLegacyKey||n.orgId===null?t:{...t,items:t.items.filter(e=>e.id===n.orgId)}},staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}))}),s={};return a.forEach((e,t)=>{let n=o[t];s[e.id]={backend:e,isLoading:n.isLoading,orgs:n.data?.items??[],currentOrgId:n.data?.currentOrgId??null}}),s}function s(){let{backends:r}=n(),i=t(),s=o(),c=[];for(let e of r)if(e.kind===`cloud`){let t=s[e.id],n=e.id===i.backend.id&&i.orgId?i.orgId:t?.orgs[0]?.id??null;n&&c.push({backendId:e.id,connectionRevision:e.connectionRevision??0,orgIdForMe:n})}let l=e({queries:c.map(({backendId:e,connectionRevision:t,orgIdForMe:n})=>{let i=r.find(t=>t.id===e);return{queryKey:[`cloud-current-user`,e,n,t],queryFn:async()=>i?a(n,i):{orgId:n,userId:``},enabled:!!i,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}})}),u={};return c.forEach((e,t)=>{let n=l[t];u[e.backendId]={isLoading:n.isLoading,userId:n.data?.userId??null}}),u}export{o as n,s as t};
1
+ import{t as e}from"./useQueries-pUohFMSP.js";import{n as t,r as n}from"./active-backend-context-BETEdaJl.js";import{i as r,r as i,t as a}from"./organization-service.api-zhHpQU0t.js";function o(){let{backends:t}=n(),a=t.filter(e=>e.kind===`cloud`),o=e({queries:a.map(e=>({queryKey:[`cloud-organizations`,e.id,e.connectionRevision??0],queryFn:async()=>{let t=await i(e);if(e.authMode===`cookie`)return t;let n=await r(e);return n.isLegacyKey||n.orgId===null?t:{...t,items:t.items.filter(e=>e.id===n.orgId)}},staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}))}),s={};return a.forEach((e,t)=>{let n=o[t];s[e.id]={backend:e,isLoading:n.isLoading,orgs:n.data?.items??[],currentOrgId:n.data?.currentOrgId??null}}),s}function s(){let{backends:r}=n(),i=t(),s=o(),c=[];for(let e of r)if(e.kind===`cloud`){let t=s[e.id],n=e.id===i.backend.id&&i.orgId?i.orgId:t?.orgs[0]?.id??null;n&&c.push({backendId:e.id,connectionRevision:e.connectionRevision??0,orgIdForMe:n})}let l=e({queries:c.map(({backendId:e,connectionRevision:t,orgIdForMe:n})=>{let i=r.find(t=>t.id===e);return{queryKey:[`cloud-current-user`,e,n,t],queryFn:async()=>i?a(n,i):{orgId:n,userId:``},enabled:!!i,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}}})}),u={};return c.forEach((e,t)=>{let n=l[t];u[e.backendId]={isLoading:n.isLoading,userId:n.data?.userId??null}}),u}export{o as n,s as t};
@@ -1 +1 @@
1
- import{t as e}from"./useQuery-DAAacS7O.js";import{B as t,M as n,Y as r,Z as i,et as a}from"./active-backend-context-BnH4-L8h.js";import{n as o}from"./agent-server-client-options-EHB23gyx.js";import{h as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";var c=class{static async getModels(){let e=new s(o()),[t,n,r]=await Promise.all([e.getModels(),e.getVerifiedModels(),e.getProviders()]),i=Object.keys(n??{}).sort(),a=i.flatMap(e=>n[e]??[]);return{models:t??[],verified_models:a,verified_providers:r?.filter(e=>i.includes(e))??i,default_model:a[0]??t?.[0]??``}}static async getConfig(){return await a(),{feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}},l=a=>e({queryKey:t.WEB_CLIENT_CONFIG,queryFn:c.getConfig,retry:(e,t)=>!i(t)&&!r(t)&&e<3,meta:{disableToast:!0},...n,enabled:a?.enabled});export{c as n,l as t};
1
+ import{t as e}from"./useQuery-DAAacS7O.js";import{B as t,M as n,Y as r,Z as i,et as a}from"./active-backend-context-BETEdaJl.js";import{n as o}from"./agent-server-client-options-EHB23gyx.js";import{h as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";var c=class{static async getModels(){let e=new s(o()),[t,n,r]=await Promise.all([e.getModels(),e.getVerifiedModels(),e.getProviders()]),i=Object.keys(n??{}).sort(),a=i.flatMap(e=>n[e]??[]);return{models:t??[],verified_models:a,verified_providers:r?.filter(e=>i.includes(e))??i,default_model:a[0]??t?.[0]??``}}static async getConfig(){return await a(),{feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}},l=a=>e({queryKey:t.WEB_CLIENT_CONFIG,queryFn:c.getConfig,retry:(e,t)=>!i(t)&&!r(t)&&e<3,meta:{disableToast:!0},...n,enabled:a?.enabled});export{c as n,l as t};
@@ -0,0 +1 @@
1
+ import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t}from"./useMutation-Cszf8mKy.js";import{O as n,P as r,R as i,k as a,n as o}from"./active-backend-context-BETEdaJl.js";import{t as s}from"./use-tracking-BAFpgpgq.js";import{E as c,O as l,k as u,t as d}from"./agent-server-conversation-service.api-BtOlitCD.js";import{t as f}from"./profiles-service.api-B5thiTI3.js";import{t as p}from"./use-llm-profiles-U4u1gzuk.js";import{t as m}from"./agent-profiles-service.api-CiMVQAIT.js";import{t as h}from"./use-agent-profiles-YsBlt3tT.js";import{t as g}from"./plugins-management-service-2oP6_tWr.js";function _(e){if(e.name)return e.name;if(e.repo_path){let t=e.repo_path.split(`/`).filter(Boolean);if(t.length>0)return t[t.length-1]}let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`/`)&&t.split(`/`).pop()?.replace(/\.git$/,``)||t}function v(e){let{source:t}=e;return!(t.startsWith(`github:`)||/^[a-z][a-z0-9+.-]*:\/\//i.test(t))}function y(e){let t=e.source.startsWith(`github:`)?e.source.replace(`github:`,``):e.source;return e.ref?`${t} @ ${e.ref}`:t}function b(e){return[e.source,e.ref??``,e.repo_path??``].join(` `)}var x=[`create-conversation`],S=()=>{let _=e(),{trackConversationCreated:v}=s(),{data:y}=p(),{backend:S,orgId:C}=o();return h(),t({mutationKey:x,mutationFn:async e=>{let{query:t,conversationInstructions:o,plugins:s,repository:p,workingDir:h,workspaceMode:v,parentConversationId:x,agentType:w,agentProfileId:T}=e,E=await _.ensureQueryData({queryKey:[...n.all,S.id,C],queryFn:m.listProfiles,...a}),D=T??E.active_agent_profile_id??void 0,O=D?E?.profiles?.find(e=>e.id===D):void 0,k=S.kind===`cloud`,A=!1,j=null;if(!k&&O?.name==="default"&&O?.agent_kind===`openhands`)A=!0;else if(O?.agent_kind===`openhands`&&O.llm_profile_ref){let e=!1;try{let t=await _.ensureQueryData({queryKey:[...r.all,S.id,C],queryFn:f.listProfiles,retry:!1});e=t.profiles.some(e=>e.name===O.llm_profile_ref),j=t.active_profile??null}catch{}e?!k&&!T&&j&&j!==O.llm_profile_ref&&(A=!0):(console.warn(`Agent profile "${O.name}" references missing LLM profile "${O.llm_profile_ref}"; launching from agent_settings instead.`),A=!0)}let M=!0;if(A&&O)try{let e=(await _.fetchQuery({queryKey:n.detail(S.id,C,O.name),queryFn:()=>m.getProfile(O.name),...a})).profile.secret_refs;M=!Array.isArray(e)}catch{M=!1}let N=A&&M?void 0:D,P=await d.createConversation({initialUserMsg:t,conversationInstructions:o,plugins:s,metadata:p?{selected_repository:p.name,selected_branch:p.branch??null,git_provider:p.gitProvider}:null,workingDirOverride:h,workspaceMode:v,parentConversationId:x,agentType:w,...N?{agentProfileId:N,agentProfileKind:O?.agent_kind}:{}}),F=P.app_conversation_id,I=s?.map(u)??[],L=I;if(F){let e=[];try{e=await _.ensureQueryData({queryKey:[...i.installed,S.id,C],queryFn:()=>g.listInstalledPlugins()})}catch{}let t=new Set(I.map(b)),n=e.filter(e=>e.enabled).map(e=>({source:e.source,ref:e.resolved_ref??null,repo_path:e.repo_path??null,name:e.name})).filter(e=>!t.has(b(e)));L=[...I,...n]}let R=N&&O?.agent_kind===`openhands`?O.llm_profile_ref:j??y?.active_profile??null;if(F&&(R||L.length)){let e=c(F);l(F,{selected_repository:e?.selected_repository??null,selected_branch:e?.selected_branch??null,git_provider:e?.git_provider??null,selected_workspace:e?.selected_workspace??null,workspace_mode:e?.workspace_mode??null,active_profile:R??e?.active_profile??null,plugins:L.length?L:e?.plugins??null})}return{conversation_id:P.app_conversation_id?P.app_conversation_id:`task-${P.id}`,session_api_key:null,url:P.agent_server_url,task_id:P.id}},onSuccess:async(e,t)=>{v({conversationId:e.conversation_id,taskId:e.task_id,hasRepository:!!t.repository,gitProvider:t.repository?.gitProvider,hasWorkspace:!!t.workingDir,workspaceMode:t.workspaceMode,hasInitialQuery:!!t.query,agentType:t.agentType,hasParentConversation:!!t.parentConversationId,entryPoint:t.entryPoint}),_.invalidateQueries({queryKey:[`user`,`conversations`]}),_.invalidateQueries({queryKey:[`start-tasks`]})}})};export{v as a,y as i,S as n,b as o,_ as r,x as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./useMutation-Cszf8mKy.js";import{t}from"./secrets-service-C3CNNEpY.js";var n=()=>e({mutationFn:({name:e,value:n,description:r})=>t.createSecret(e,n,r)});export{n as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BnH4-L8h.js";import{c as i,n as a}from"./agent-server-client-options-EHB23gyx.js";import{h as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as s}from"./proxy-XP6U1Dhv.js";import{t as c}from"./react-BX7IV650.js";var l=e(t(),1);function u(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function d(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function f(e,t){return!t||t<=0?e:e.slice(0,t)}function p(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var m=class{static async searchModels(e={},t){let n=i();if(n.backend.kind===`cloud`){let t=p({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return s({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new o(a()),c=t===void 0?r.getVerifiedModels():Promise.resolve(t),[l,m]=await Promise.all([r.getModels(),c]),h=e.provider__eq??null,g=new Set(h?m?.[h]??[]:[]),_=[...g].map(e=>({provider:h,name:e,verified:!0,free:!1,default:!1})),v=h?(l??[]).filter(e=>e.startsWith(`${h}/`)).map(e=>e.slice(h.length+1)).filter(e=>e.length>0&&!g.has(e)).map(e=>({provider:h,name:e,verified:!1,free:!1,default:!1})):[];return{items:f(d(u([..._,...v],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=i();if(n.backend.kind===`cloud`){let t=p({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return s({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new o(a()),c=t===void 0?r.getVerifiedModels():Promise.resolve(t),[l,m]=await Promise.all([r.getProviders(),c]),h=new Set(Object.keys(m??{}));return{items:f(d(u([...new Set([...h,...l??[]])].map(e=>({name:e,verified:h.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},h=new Set,g=c()(e=>({freeModels:h,defaultModel:null,defaultModelReady:!1,setFlags:t=>e({freeModels:t.freeModels,defaultModel:t.defaultModel,defaultModelReady:!0}),markDefaultModelReady:()=>e({defaultModelReady:!0}),resetFlags:()=>e({freeModels:h,defaultModel:null,defaultModelReady:!1})})),_=[`config`,`verified-models`],v=1e3*60*5,y=1e3*60*15;async function b(){return i().backend.kind===`cloud`?{}:await new o(a()).getVerifiedModels()??{}}var x=`openhands`,S=100,C=10;async function w(e,t,n,r){if(r>=C)throw Error(`Too many pagination requests while fetching OpenHands models (depth=${r})`);let i=await m.searchModels({provider__eq:x,limit:S,...t?{page_id:t}:{}},e);if(!i.next_page_id)return i.items;if(n.has(i.next_page_id))throw Error(`Repeated page id while fetching OpenHands models: ${i.next_page_id}`);n.add(i.next_page_id);let a=await w(e,i.next_page_id,n,r+1);return[...i.items,...a]}var T=()=>{let{backend:e,orgId:t}=r(),i=[e.id,e.connectionRevision??0,t];return n({queryKey:[`config`,`models`,x,`flags`,...i],queryFn:async({client:e})=>w(await e.fetchQuery({queryKey:[..._,...i],queryFn:b,staleTime:v}),null,new Set,0),staleTime:v,gcTime:y})},E=()=>{let{backend:e,orgId:t}=r(),{data:n,isError:i}=T(),a=g(e=>e.setFlags),o=g(e=>e.markDefaultModelReady),s=g(e=>e.resetFlags);l.useEffect(()=>{s()},[e.id,e.connectionRevision,t,s]),l.useEffect(()=>{if(!n)return;let e=new Set(n.filter(e=>e.free).map(e=>`${x}/${e.name}`)),t=n.find(e=>e.default);a({freeModels:e,defaultModel:t?`${x}/${t.name}`:null})},[n,a]),l.useEffect(()=>{i&&o()},[i,o])},D=()=>g(e=>e.freeModels),O=()=>g(e=>e.defaultModel),k=()=>g(e=>e.defaultModelReady);export{y as a,b as c,E as i,m as l,k as n,_ as o,D as r,v as s,O as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BETEdaJl.js";import{c as i,n as a}from"./agent-server-client-options-EHB23gyx.js";import{h as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as s}from"./proxy-BCCQUna8.js";import{t as c}from"./react-BX7IV650.js";var l=e(t(),1);function u(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function d(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function f(e,t){return!t||t<=0?e:e.slice(0,t)}function p(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var m=class{static async searchModels(e={},t){let n=i();if(n.backend.kind===`cloud`){let t=p({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return s({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new o(a()),c=t===void 0?r.getVerifiedModels():Promise.resolve(t),[l,m]=await Promise.all([r.getModels(),c]),h=e.provider__eq??null,g=new Set(h?m?.[h]??[]:[]),_=[...g].map(e=>({provider:h,name:e,verified:!0,free:!1,default:!1})),v=h?(l??[]).filter(e=>e.startsWith(`${h}/`)).map(e=>e.slice(h.length+1)).filter(e=>e.length>0&&!g.has(e)).map(e=>({provider:h,name:e,verified:!1,free:!1,default:!1})):[];return{items:f(d(u([..._,...v],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=i();if(n.backend.kind===`cloud`){let t=p({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return s({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new o(a()),c=t===void 0?r.getVerifiedModels():Promise.resolve(t),[l,m]=await Promise.all([r.getProviders(),c]),h=new Set(Object.keys(m??{}));return{items:f(d(u([...new Set([...h,...l??[]])].map(e=>({name:e,verified:h.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},h=new Set,g=c()(e=>({freeModels:h,defaultModel:null,defaultModelReady:!1,setFlags:t=>e({freeModels:t.freeModels,defaultModel:t.defaultModel,defaultModelReady:!0}),markDefaultModelReady:()=>e({defaultModelReady:!0}),resetFlags:()=>e({freeModels:h,defaultModel:null,defaultModelReady:!1})})),_=[`config`,`verified-models`],v=1e3*60*5,y=1e3*60*15;async function b(){return i().backend.kind===`cloud`?{}:await new o(a()).getVerifiedModels()??{}}var x=`openhands`,S=100,C=10;async function w(e,t,n,r){if(r>=C)throw Error(`Too many pagination requests while fetching OpenHands models (depth=${r})`);let i=await m.searchModels({provider__eq:x,limit:S,...t?{page_id:t}:{}},e);if(!i.next_page_id)return i.items;if(n.has(i.next_page_id))throw Error(`Repeated page id while fetching OpenHands models: ${i.next_page_id}`);n.add(i.next_page_id);let a=await w(e,i.next_page_id,n,r+1);return[...i.items,...a]}var T=()=>{let{backend:e,orgId:t}=r(),i=[e.id,e.connectionRevision??0,t];return n({queryKey:[`config`,`models`,x,`flags`,...i],queryFn:async({client:e})=>w(await e.fetchQuery({queryKey:[..._,...i],queryFn:b,staleTime:v}),null,new Set,0),staleTime:v,gcTime:y})},E=()=>{let{backend:e,orgId:t}=r(),{data:n,isError:i}=T(),a=g(e=>e.setFlags),o=g(e=>e.markDefaultModelReady),s=g(e=>e.resetFlags);l.useEffect(()=>{s()},[e.id,e.connectionRevision,t,s]),l.useEffect(()=>{if(!n)return;let e=new Set(n.filter(e=>e.free).map(e=>`${x}/${e.name}`)),t=n.find(e=>e.default);a({freeModels:e,defaultModel:t?`${x}/${t.name}`:null})},[n,a]),l.useEffect(()=>{i&&o()},[i,o])},D=()=>g(e=>e.freeModels),O=()=>g(e=>e.defaultModel),k=()=>g(e=>e.defaultModelReady);export{y as a,b as c,E as i,m as l,k as n,_ as o,D as r,v as s,O as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BnH4-L8h.js";import{t as i}from"./secrets-service-BOIsfD9j.js";var a=e(t(),1),o=(e={})=>{let{nameContains:t,enabled:o=!0}=e,s=r(),c=n({queryKey:[`secrets`,s.backend.id,s.orgId],queryFn:i.getSecrets,enabled:o,staleTime:1e3*60*5,gcTime:1e3*60*15});return{data:(0,a.useMemo)(()=>{if(!c.data)return[];if(!t)return c.data;let e=t.toLowerCase();return c.data.filter(t=>t.name.toLowerCase().includes(e))},[c.data,t]),isLoading:c.isLoading,isError:c.isError,hasNextPage:!1,isFetchingNextPage:!1,fetchNextPage:()=>{},onLoadMore:()=>{},refetch:c.refetch}};export{o as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useQuery-DAAacS7O.js";import{n as r}from"./active-backend-context-BETEdaJl.js";import{t as i}from"./secrets-service-C3CNNEpY.js";var a=e(t(),1),o=(e={})=>{let{nameContains:t,enabled:o=!0}=e,s=r(),c=n({queryKey:[`secrets`,s.backend.id,s.orgId],queryFn:i.getSecrets,enabled:o,staleTime:1e3*60*5,gcTime:1e3*60*15});return{data:(0,a.useMemo)(()=>{if(!c.data)return[];if(!t)return c.data;let e=t.toLowerCase();return c.data.filter(t=>t.name.toLowerCase().includes(e))},[c.data,t]),isLoading:c.isLoading,isError:c.isError,hasNextPage:!1,isFetchingNextPage:!1,fetchNextPage:()=>{},onLoadMore:()=>{},refetch:c.refetch}};export{o as t};