@openhands/agent-canvas 1.18.0 → 1.19.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 (331) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-BQ4o4vqy.js +1 -0
  4. package/build/assets/{active-backend-context-BnH4-L8h.js → active-backend-context-BsLfwrXB.js} +1 -1
  5. package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-D9i6ezoJ.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-U-9YzDFU.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-D-bUV2PX.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-BaVQ6NpE.js +88 -0
  9. package/build/assets/agent-settings-BZJHtaIK.js +2 -0
  10. package/build/assets/agent-settings-D4snDd6u.js +1 -0
  11. package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-BkVt_8Or.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-fAIld-n7.js} +1 -1
  13. package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DITbrM2u.js} +1 -1
  14. package/build/assets/automation-detail-DawHmaOl.js +3 -0
  15. package/build/assets/automation-disabled-reason-DtgC8Ppt.js +1 -0
  16. package/build/assets/{automation-export-BJsfi7n2.js → automation-export-Kv6e0bHx.js} +1 -1
  17. package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-Dd98G_Oz.js} +1 -1
  18. package/build/assets/{automation-setup-route-qaJ6lLCf.js → automation-setup-route-Cdc109ZD.js} +1 -1
  19. package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-Xhr-FDAB.js} +1 -1
  20. package/build/assets/automations-list-BeP1LuzQ.js +1 -0
  21. package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-DWNiN277.js} +1 -1
  22. package/build/assets/backend-form-modal-DeaUJIik.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-Br85iWIY.js} +1 -1
  24. package/build/assets/{badge-ehL-kgeO.js → badge-Cdnei7Ly.js} +1 -1
  25. package/build/assets/{base-modal-C1a0TsSx.js → base-modal-Ds7grR67.js} +1 -1
  26. package/build/assets/{brand-button-CUMfjb99.js → brand-button-mQq2Ld1I.js} +1 -1
  27. package/build/assets/{browser-SE24Tk8g.js → browser-Bfum8fkE.js} +2 -2
  28. package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-CmYT4j_r.js} +1 -1
  29. package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-CokKSVRG.js} +1 -1
  30. package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-BoQEYG-2.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-Du2M5iEX.js} +1 -1
  32. package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-DM3JgMc2.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-BbYBiUwv.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-D02kgq1s.js} +1 -1
  35. package/build/assets/{cog-CAEugqtV.js → cog-Dy1eWbSZ.js} +1 -1
  36. package/build/assets/{command-menu-CQxs4mtX.js → command-menu-mehU3Evb.js} +1 -1
  37. package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-DhQW8CXi.js} +1 -1
  38. package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-eRk6Fkx6.js} +1 -1
  39. package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-BmVt_c0I.js} +1 -1
  40. package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-lx2zk9G7.js} +1 -1
  41. package/build/assets/{conversation-B_nweu5p.js → conversation-BOj0ENI6.js} +4 -4
  42. package/build/assets/conversation-SouWlGvs.js +1 -0
  43. package/build/assets/conversation-panel-SouWlGvs.js +1 -0
  44. package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-C6YncQNo.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-DIhwCC2J.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-DVNXLylP.js} +1 -1
  47. package/build/assets/{device-verify-D5QRIS_x.js → device-verify-LP-x7nra.js} +1 -1
  48. package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-goDldkiu.js} +1 -1
  49. package/build/assets/edit-automation-modal-BJJR9wSW.js +1 -0
  50. package/build/assets/empty-state-Cd-TFe7i.js +1 -0
  51. package/build/assets/{entry.client-BMafTpjO.js → entry.client-CJdjIvMZ.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-pocrz9AL.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-Dwe78wRl.js} +1 -1
  54. package/build/assets/{error-state-Cf8LRuuY.js → error-state-SuWwztxV.js} +1 -1
  55. package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-O0esK3Er.js} +1 -1
  56. package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-CgCVSXje.js} +1 -1
  57. package/build/assets/{files-tab-D5PPIWI1.js → files-tab-B_6t8ljw.js} +1 -1
  58. package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-lQfLxzH4.js} +1 -1
  59. package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-Bp5rsUkl.js} +1 -1
  60. package/build/assets/git-repo-dropdown-CbD0_LPN.js +1 -0
  61. package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DPQVumZg.js} +1 -1
  62. package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-Bp0sgK-f.js} +1 -1
  63. package/build/assets/home-BghzJd-D.js +1 -0
  64. package/build/assets/home-CXZ8zawS.js +1 -0
  65. package/build/assets/home-automation-run-tooltip-BdpCckKO.js +1 -0
  66. package/build/assets/{home-store-DCbei3DX.js → home-store-DNQpfIEO.js} +1 -1
  67. package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-DkxnQa4N.js} +1 -1
  68. package/build/assets/index-home-Ca6Q5CtT.js +1 -0
  69. package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DvxxYKia.js} +1 -1
  70. package/build/assets/{key-O84CMFHb.js → key-CwTE6XJj.js} +1 -1
  71. package/build/assets/{launch-ZLxI4opd.js → launch-jsRGPRBx.js} +1 -1
  72. package/build/assets/link-external-B4gx3EeM.js +1 -0
  73. package/build/assets/{llm-not-configured-banner-Dh_ajcM8.js → llm-not-configured-banner-DMdL1vaX.js} +4 -4
  74. package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-dkQ5Oq7W.js} +1 -1
  75. package/build/assets/llm-settings-lNDerSlu.js +1 -0
  76. package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-BiQaZbvv.js} +1 -1
  77. package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-DK1sAwVg.js} +1 -1
  78. package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-DqCJohsX.js} +1 -1
  79. package/build/assets/manifest-ff93dc8c.js +1 -0
  80. package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-sxuPqfUr.js} +1 -1
  81. package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-BH5pqDuJ.js} +1 -1
  82. package/build/assets/mcp-BtaJDXnP.js +1 -0
  83. package/build/assets/mcp-installed-servers-Br4ZLsjr.js +1 -0
  84. package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
  85. package/build/assets/mcp-page-DwbnQpVs.js +9 -0
  86. package/build/assets/{messages-Bk1xhbU2.js → messages-DmFJlW6c.js} +4 -4
  87. package/build/assets/{modal-body-C24WsdFb.js → modal-body-DBweM2EN.js} +1 -1
  88. package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-jvG85nkU.js} +1 -1
  89. package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-BrM5fNnn.js} +1 -1
  90. package/build/assets/onboarding-CQ8T6T0U.js +1 -0
  91. package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-CnliiaSN.js} +1 -1
  92. package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-DmFUEmu5.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-CXph_C9F.js} +1 -1
  95. package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-CcEpfNKz.js} +1 -1
  96. package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-DdF_4Zhe.js} +1 -1
  97. package/build/assets/{providers-XmZ9HM4Q.js → providers-BWRnl31s.js} +1 -1
  98. package/build/assets/{proxy-XP6U1Dhv.js → proxy-DbEf3Nqr.js} +1 -1
  99. package/build/assets/recommended-automations-launcher-r0oI91HN.js +1 -0
  100. package/build/assets/root-j2fFRlWS.js +2 -0
  101. package/build/assets/{root-layout-DUquNZTU.js → root-layout-CfGgm2lo.js} +2 -2
  102. package/build/assets/root-sEWn3ha1.css +1 -0
  103. package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-c3Ncgm4x.js} +1 -1
  104. package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DFEiuiFQ.js} +1 -1
  105. package/build/assets/{secret-form-9-BoGA40.js → secret-form-WXXNFqTM.js} +1 -1
  106. package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-DU6wh3wX.js} +1 -1
  107. package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BEqbPvjy.js} +1 -1
  108. package/build/assets/{settings-D4hdToD4.js → settings-DjaSQwFh.js} +1 -1
  109. package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-BRR2OZwi.js} +1 -1
  110. package/build/assets/{settings-index-DeQphyBK.js → settings-index-DHv4XFcM.js} +1 -1
  111. package/build/assets/{settings-input-dVuzapBA.js → settings-input-Cm4VxUon.js} +1 -1
  112. package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-CaUfKZ33.js} +1 -1
  113. package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-djXuAnBO.js} +1 -1
  114. package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-DFb3hBMr.js} +1 -1
  115. package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-Q9lKW1TX.js} +1 -1
  116. package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-seaSJc7t.js} +1 -1
  117. package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-x3rxVCon.js} +1 -1
  118. package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-B6mcvvdV.js} +1 -1
  119. package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-CEqS8KnA.js} +1 -1
  120. package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-BTHX11LG.js} +1 -1
  121. package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-BP1kzn6p.js} +1 -1
  122. package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-TD39nfP3.js} +1 -1
  123. package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-CdBbbwjm.js} +1 -1
  124. package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-vUEp7gsC.js} +1 -1
  125. package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-BTRBQt0-.js} +1 -1
  126. package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-k1tUNAw4.js} +1 -1
  127. package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-CENviPT7.js} +1 -1
  128. package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-DVAlWYnL.js} +1 -1
  129. package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-BLKF_x9f.js} +1 -1
  130. package/build/assets/{terminal-Dph60VFZ.js → terminal-Ckbnqb23.js} +1 -1
  131. package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-DeiG9Mf6.js} +1 -1
  132. package/build/assets/trash-CXN2R54L.js +1 -0
  133. package/build/assets/{typography-DgcLGdHk.js → typography-NarNyelM.js} +1 -1
  134. package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-Drd3O006.js} +1 -1
  135. package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-CJ5wPsQm.js} +1 -1
  136. package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-iQZ0U3qV.js} +1 -1
  137. package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-LCvb5OXT.js} +1 -1
  138. package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-DdgSa8sA.js} +1 -1
  139. package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-D3kEeieu.js} +1 -1
  140. package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-CEubcYTD.js} +1 -1
  141. package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-CB8ybxFK.js} +1 -1
  142. package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BMacwi2v.js} +1 -1
  143. package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-BEKRd6XZ.js} +1 -1
  144. package/build/assets/{use-config-l5tkDHyD.js → use-config-3WYcJsgC.js} +1 -1
  145. package/build/assets/{use-create-conversation-i_PdFdIs.js → use-create-conversation-Be-eVpFp.js} +1 -1
  146. package/build/assets/use-create-secret-Bk9ZxTjl.js +1 -0
  147. package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-Ci3FkKEm.js} +1 -1
  148. package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-fqS0kxt6.js} +1 -1
  149. package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-B71ZEVg2.js} +1 -1
  150. package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-xtCBMbef.js} +1 -1
  151. package/build/assets/{use-manifest-capabilities-CdqYfUAC.js → use-manifest-capabilities-Bso6A_-A.js} +1 -1
  152. package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-CEgjL02y.js} +1 -1
  153. package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-pK4IlJ-p.js} +1 -1
  154. package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-B8-ZEB34.js} +1 -1
  155. package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-D7hJuW_u.js} +1 -1
  156. package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CikTu5xV.js} +1 -1
  157. package/build/assets/{use-settings-C2KKQKVC.js → use-settings-BWIH5EuN.js} +1 -1
  158. package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-DSKwLDnd.js} +1 -1
  159. package/build/assets/use-tracking-ChnSFChv.js +3 -0
  160. package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-C_l65DqW.js} +1 -1
  161. package/build/assets/utils-D-gOfhmN.js +1 -0
  162. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +2 -0
  163. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js +48 -0
  164. package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-PKtoIUUY.js} +1 -1
  165. package/build/index.html +4 -4
  166. package/build/locales/ar/openhands.json +10 -0
  167. package/build/locales/ca/openhands.json +10 -0
  168. package/build/locales/de/openhands.json +10 -0
  169. package/build/locales/en/openhands.json +10 -0
  170. package/build/locales/es/openhands.json +10 -0
  171. package/build/locales/fr/openhands.json +10 -0
  172. package/build/locales/it/openhands.json +10 -0
  173. package/build/locales/ja/openhands.json +10 -0
  174. package/build/locales/ko-KR/openhands.json +10 -0
  175. package/build/locales/no/openhands.json +10 -0
  176. package/build/locales/pt/openhands.json +10 -0
  177. package/build/locales/tr/openhands.json +10 -0
  178. package/build/locales/uk/openhands.json +10 -0
  179. package/build/locales/zh-CN/openhands.json +10 -0
  180. package/build/locales/zh-TW/openhands.json +10 -0
  181. package/config/defaults.json +3 -3
  182. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
  183. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
  184. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
  185. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
  186. package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
  187. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  188. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  189. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
  190. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  191. package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
  192. package/dist/config/defaults.cjs +1 -1
  193. package/dist/config/defaults.cjs.map +1 -1
  194. package/dist/config/defaults.js +3 -3
  195. package/dist/config/defaults.js.map +1 -1
  196. package/dist/constants/acp-providers.cjs +1 -1
  197. package/dist/constants/acp-providers.cjs.map +1 -1
  198. package/dist/constants/acp-providers.d.ts +0 -5
  199. package/dist/constants/acp-providers.js +20 -16
  200. package/dist/constants/acp-providers.js.map +1 -1
  201. package/dist/constants/profile-scope.d.ts +21 -0
  202. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  203. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  204. package/dist/hooks/query/use-automation-sdk-version.js +3 -1
  205. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  206. package/dist/hooks/use-drag-resize.cjs +1 -1
  207. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  208. package/dist/hooks/use-drag-resize.js +8 -9
  209. package/dist/hooks/use-drag-resize.js.map +1 -1
  210. package/dist/i18n/declaration.cjs +1 -1
  211. package/dist/i18n/declaration.cjs.map +1 -1
  212. package/dist/i18n/declaration.d.ts +10 -0
  213. package/dist/i18n/declaration.js +1 -1
  214. package/dist/i18n/declaration.js.map +1 -1
  215. package/dist/i18n/translation.cjs +2 -2
  216. package/dist/i18n/translation.cjs.map +1 -1
  217. package/dist/i18n/translation.js +170 -0
  218. package/dist/i18n/translation.js.map +1 -1
  219. package/dist/locales/ar/openhands.json +10 -0
  220. package/dist/locales/ca/openhands.json +10 -0
  221. package/dist/locales/de/openhands.json +10 -0
  222. package/dist/locales/en/openhands.json +10 -0
  223. package/dist/locales/es/openhands.json +10 -0
  224. package/dist/locales/fr/openhands.json +10 -0
  225. package/dist/locales/it/openhands.json +10 -0
  226. package/dist/locales/ja/openhands.json +10 -0
  227. package/dist/locales/ko-KR/openhands.json +10 -0
  228. package/dist/locales/no/openhands.json +10 -0
  229. package/dist/locales/pt/openhands.json +10 -0
  230. package/dist/locales/tr/openhands.json +10 -0
  231. package/dist/locales/uk/openhands.json +10 -0
  232. package/dist/locales/zh-CN/openhands.json +10 -0
  233. package/dist/locales/zh-TW/openhands.json +10 -0
  234. package/dist/manifests/manifest-validation.cjs +1 -1
  235. package/dist/manifests/manifest-validation.cjs.map +1 -1
  236. package/dist/manifests/manifest-validation.js +2 -2
  237. package/dist/manifests/manifest-validation.js.map +1 -1
  238. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
  239. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
  240. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
  241. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
  242. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
  243. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
  244. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
  245. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
  246. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  247. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  248. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
  249. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  250. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +1 -1
  251. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -1
  252. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +3 -6
  253. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -1
  254. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
  255. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
  256. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
  257. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
  258. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
  259. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
  260. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
  261. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
  262. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
  263. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
  264. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
  265. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
  266. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  267. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -1
  268. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  269. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  270. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
  271. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  272. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
  273. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
  274. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
  275. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
  276. package/dist/package.cjs +1 -1
  277. package/dist/package.cjs.map +1 -1
  278. package/dist/package.js +2 -2
  279. package/dist/package.js.map +1 -1
  280. package/dist/routes/agent-settings.d.ts +5 -0
  281. package/dist/types/automation.cjs.map +1 -1
  282. package/dist/types/automation.d.ts +23 -1
  283. package/dist/types/automation.js.map +1 -1
  284. package/dist/utils/automation-disabled-reason.cjs +2 -0
  285. package/dist/utils/automation-disabled-reason.cjs.map +1 -0
  286. package/dist/utils/automation-disabled-reason.d.ts +32 -0
  287. package/dist/utils/automation-disabled-reason.js +19 -0
  288. package/dist/utils/automation-disabled-reason.js.map +1 -0
  289. package/dist/utils/parse-git-remote-url.cjs +1 -1
  290. package/dist/utils/parse-git-remote-url.cjs.map +1 -1
  291. package/dist/utils/parse-git-remote-url.d.ts +5 -1
  292. package/dist/utils/parse-git-remote-url.js +20 -13
  293. package/dist/utils/parse-git-remote-url.js.map +1 -1
  294. package/package.json +2 -2
  295. package/scripts/check-sdk-version-sync.mjs +79 -8
  296. package/scripts/dev-safe.mjs +1 -1
  297. package/scripts/static-server.mjs +24 -7
  298. package/build/assets/acp-providers-DcY_mKYa.js +0 -1
  299. package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
  300. package/build/assets/agent-settings-BF8hM6wb.js +0 -2
  301. package/build/assets/agent-settings-YPutBAeR.js +0 -1
  302. package/build/assets/automation-detail-BxXhb_m2.js +0 -3
  303. package/build/assets/automations-list-DEPVNud3.js +0 -1
  304. package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
  305. package/build/assets/conversation-edjzrv5w.js +0 -1
  306. package/build/assets/conversation-panel-edjzrv5w.js +0 -1
  307. package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
  308. package/build/assets/empty-state-FK_s1B60.js +0 -1
  309. package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
  310. package/build/assets/home-BM5_Wz_R.js +0 -1
  311. package/build/assets/home-Ivfm7KC4.js +0 -1
  312. package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
  313. package/build/assets/index-home-td9BN2T3.js +0 -1
  314. package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
  315. package/build/assets/link-external-BNZzCM1I.js +0 -1
  316. package/build/assets/llm-settings-CZaXYgtw.js +0 -1
  317. package/build/assets/manifest-bfeccb98.js +0 -1
  318. package/build/assets/mcp-CraxoXQv.js +0 -1
  319. package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
  320. package/build/assets/mcp-page-CteH_K0N.js +0 -9
  321. package/build/assets/onboarding-DXFBRqEy.js +0 -1
  322. package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
  323. package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
  324. package/build/assets/root-CM6IZHlg.css +0 -1
  325. package/build/assets/root-DdFkodKW.js +0 -2
  326. package/build/assets/trash-Ckh7yCaB.js +0 -1
  327. package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
  328. package/build/assets/use-tracking-j4uo9VEW.js +0 -3
  329. package/build/assets/utils-BgLSZdyy.js +0 -1
  330. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
  331. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
@@ -0,0 +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{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQueries-pUohFMSP.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,n as c,st as l}from"./active-backend-context-BsLfwrXB.js";import{K as u,t as d}from"./utils-D-gOfhmN.js";import{C as f,S as p,f as m,g as h,l as g,n as _,t as v,u as ee,x as y}from"./automation-disabled-reason-DtgC8Ppt.js";import{t as te}from"./plug-7ACOEbMs.js";import{r as b}from"./context-menu-list-item-lx2zk9G7.js";import{n as ne}from"./use-tracking-ChnSFChv.js";import{n as re}from"./navigation-context-CQZwH_tC.js";import{t as ie}from"./navigation-link-Bxo3-4vo.js";import{p as ae}from"./install-server-modal-DvxxYKia.js";import{t as oe}from"./folder-C1ou4_DT.js";import{n as x}from"./use-automation-health-DdgSa8sA.js";import{t as S}from"./automation-C_eCrGyP.js";import{c as se,i as ce,n as le,o as ue}from"./use-automations-CEubcYTD.js";import{i as C}from"./extension-module-card-classes-DpeaYhYo.js";import{n as w}from"./api-error-message-BXo0lCI5.js";import{t as de}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{o as fe}from"./mcp-marketplace-utils-BwEnDYqm.js";import{n as pe,t as me}from"./use-automation-permissions-D3kEeieu.js";var he=i(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),T=e(t(),1),E=r(),D=new class{limit;active=0;queue=[];constructor(e){this.limit=e}async run(e,t){await this.acquire();try{if(t?.aborted)throw t.reason??new DOMException(`Aborted`,`AbortError`);return await e()}finally{this.release()}}acquire(){return this.active<this.limit?(this.active+=1,Promise.resolve()):new Promise(e=>{this.queue.push(e)})}release(){let e=this.queue.shift();e?e():--this.active}}(3),ge=15e3;function _e(e){let t=c(),n=a({queries:e.map(e=>({queryKey:[...se,e.id,{limit:12,offset:0},t.backend.id,t.orgId],queryFn:({signal:t})=>D.run(()=>ne.getAutomationRuns(e.id,12,0),t),staleTime:60*1e3,retry:!1,refetchOnWindowFocus:!1,refetchInterval:e=>{let t=e.state.data?.runs[0];return t?.status===S.PENDING||t?.status===S.RUNNING?ge:!1}}))}),r=new Map;return e.forEach((e,t)=>{let i=n[t],a=i?.data?.runs??[];r.set(e.id,{latestRun:a[0]??null,recentRuns:a,total:i?.data?.total,isLoading:i?.isPending??!0,isError:i?.isError??!1})}),r}var O=20,ve=[S.COMPLETED,S.COMPLETED,S.FAILED,S.COMPLETED,S.CANCELLED,S.COMPLETED,S.COMPLETED,S.FAILED,S.COMPLETED,S.SKIPPED,S.COMPLETED];function ye(){return!1}var be={"demo-conv-titled":`Fix flaky CI on main`,"demo-conv-untitled":`Summarize open pull requests`};function xe(e){if(e in be)return be[e]}function k(e){return new Date(Date.now()-e*36e5).toISOString()}function A(e,t,n){return{id:e,name:t,trigger:n,enabled:!0,created_at:k(720),updated_at:k(24),prompt:`demo`}}function j(e,t,n={}){let r=n.startedHoursAgo??2,i=n.completedHoursAgo===void 0?1:n.completedHoursAgo;return{id:e,status:t,conversation_id:n.conversationId===void 0?null:n.conversationId,bash_command_id:null,error_detail:n.errorDetail===void 0?null:n.errorDetail,started_at:k(r),completed_at:i===null?null:k(i)}}function Se(e){if(!e)return[];let t=[2,8,45,3,15,1,25,90,5,12,6];return[e,...ve.slice(0,11).map((n,r)=>{let i=24+r*6,a=(t[r]??5)/60;return j(`${e.id}-hist-${r}`,n,{startedHoursAgo:i,completedHoursAgo:i-a,conversationId:null,errorDetail:n===S.FAILED?`Prior failure`:null})})]}function Ce(e){return{...e,recentRuns:e.recentRuns??Se(e.latestRun)}}var M=[{pin:!0,automation:A(`demo-pin-loading`,`Card: loading skeleton`,{type:`cron`,schedule:`0 * * * *`,schedule_human:`Every hour`}),runState:{latestRun:null,isLoading:!0,isError:!1}},{pin:!0,automation:A(`demo-pin-error`,`Card: status unavailable`,{type:`cron`,schedule:`0 9 * * *`,schedule_human:`Daily at 9am`}),runState:{latestRun:null,isLoading:!1,isError:!0}},{pin:!0,automation:A(`demo-pin-no-runs`,`Card: no runs yet`,{type:`event`,source:`github`,on:`pull_request.opened`}),runState:{latestRun:null,isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-failed-detail`,`Card: failed with error detail`,{type:`cron`,schedule:`*/15 * * * *`,schedule_human:`Every 15 min`}),runState:{latestRun:j(`run-failed-detail`,S.FAILED,{errorDetail:`Sandbox provisioning timed out after 120s while waiting for the runtime to become ready.`,startedHoursAgo:3,completedHoursAgo:2.5}),isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-completed-title`,`Card: completed + conversation title`,{type:`event`,source:`github`,on:`push`}),runState:{latestRun:j(`run-completed-title`,S.COMPLETED,{conversationId:`demo-conv-titled`,startedHoursAgo:5,completedHoursAgo:4}),isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-completed-untitled`,`Card: completed + conversation title`,{type:`cron`,schedule:`0 0 * * 1`,schedule_human:`Mondays at midnight`}),runState:{latestRun:j(`run-completed-untitled`,S.COMPLETED,{conversationId:`demo-conv-untitled`,startedHoursAgo:8,completedHoursAgo:7}),isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-completed-no-conv`,`Card: completed, no conversation`,{type:`cron`,schedule:`0 12 * * *`,schedule_human:`Daily at noon`}),runState:{latestRun:j(`run-completed-no-conv`,S.COMPLETED,{conversationId:null,startedHoursAgo:10,completedHoursAgo:9}),isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-failed-no-conv`,`Card: failed, no conversation`,{type:`event`,source:`slack`,on:`message`}),runState:{latestRun:j(`run-failed-no-conv`,S.FAILED,{conversationId:null,errorDetail:null,startedHoursAgo:12,completedHoursAgo:11}),isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-pending`,`Card: pending (empty result panel)`,{type:`cron`,schedule:`0 */6 * * *`,schedule_human:`Every 6 hours`}),runState:{latestRun:j(`run-pending`,S.PENDING,{conversationId:null,startedHoursAgo:.1,completedHoursAgo:null}),isLoading:!1,isError:!1}},{pin:!0,automation:A(`demo-pin-running`,`Card: running (empty result panel)`,{type:`event`,source:`github`,on:`issues.opened`}),runState:{latestRun:j(`run-running`,S.RUNNING,{conversationId:null,startedHoursAgo:.25,completedHoursAgo:null}),isLoading:!1,isError:!1}},{automation:A(`demo-list-cancelled`,`List: cancelled run`,{type:`cron`,schedule:`30 2 * * *`,schedule_human:`Daily at 2:30am`}),runState:{latestRun:j(`run-cancelled`,S.CANCELLED,{startedHoursAgo:14,completedHoursAgo:13}),isLoading:!1,isError:!1}},{automation:A(`demo-list-skipped`,`List: skipped run`,{type:`event`,source:`github`,on:`pull_request.synchronize`}),runState:{latestRun:j(`run-skipped`,S.SKIPPED,{startedHoursAgo:16,completedHoursAgo:16}),isLoading:!1,isError:!1}},{automation:A(`demo-list-running-2`,`List: second in-flight run`,{type:`cron`,schedule:`*/5 * * * *`,schedule_human:`Every 5 min`}),runState:{latestRun:j(`run-running-2`,S.RUNNING,{conversationId:null,startedHoursAgo:.5,completedHoursAgo:null}),isLoading:!1,isError:!1}},{automation:A(`demo-list-success-old`,`List: older success`,{type:`cron`,schedule:`0 8 * * 1-5`,schedule_human:`Weekdays at 8am`}),runState:{latestRun:j(`run-success-old`,S.COMPLETED,{conversationId:`demo-conv-titled`,startedHoursAgo:48,completedHoursAgo:47}),isLoading:!1,isError:!1}},{automation:A(`demo-list-failed-old`,`List: older failure`,{type:`event`,source:`github`,on:`release.published`}),runState:{latestRun:j(`run-failed-old`,S.FAILED,{errorDetail:`Model returned an empty completion.`,startedHoursAgo:72,completedHoursAgo:71}),isLoading:!1,isError:!1}},{automation:A(`demo-list-no-runs-2`,`List: never ran`,{type:`cron`,schedule:`0 0 1 * *`,schedule_human:`Monthly on the 1st`}),runState:{latestRun:null,isLoading:!1,isError:!1}},{automation:A(`demo-list-loading-2`,`List: loading status`,{type:`event`,source:`linear`,on:`Issue.create`}),runState:{latestRun:null,isLoading:!0,isError:!1}},{automation:A(`demo-list-error-2`,`List: fetch error`,{type:`cron`,schedule:`15 * * * *`,schedule_human:`Hourly at :15`}),runState:{latestRun:null,isLoading:!1,isError:!0}},{automation:A(`demo-list-pending-2`,`List: pending, long name that should truncate in the activity row when the viewport is narrow`,{type:`cron`,schedule:`0 3 * * 0`,schedule_human:`Sundays at 3am`}),runState:{latestRun:j(`run-pending-2`,S.PENDING,{startedHoursAgo:.05,completedHoursAgo:null}),isLoading:!1,isError:!1}},{automation:A(`demo-list-completed-fallback`,`List: completed with conversation`,{type:`event`,source:`github`,on:`workflow_run.completed`}),runState:{latestRun:j(`run-completed-fallback`,S.COMPLETED,{conversationId:`demo-conv-untitled`,startedHoursAgo:20,completedHoursAgo:19}),isLoading:!1,isError:!1}}];if(M.length!==O)throw Error(`home-automations-demo: expected ${O} specs, got ${M.length}`);var we=M.filter(e=>e.pin).map(e=>e.automation.id),Te=M.map(e=>e.automation),Ee=new Map(M.map(e=>[e.automation.id,Ce(e.runState)]));function N(e){if(e.isLoading||e.isError)return`unknown`;if(!e.latestRun)return`none`;switch(p(e.latestRun).badgeStatus){case S.COMPLETED:case`success`:return`success`;case S.FAILED:case`failed`:return`failed`;case`blocked`:case`partial_success`:case`unknown`:return`warning`;case S.PENDING:case S.RUNNING:return`in_progress`;default:return`unknown`}}function De(e){switch(e){case`success`:return u.FEATURED_AUTOMATIONS$LAST_RUN_SUCCEEDED;case`failed`:return u.FEATURED_AUTOMATIONS$LAST_RUN_FAILED;case`warning`:return u.AUTOMATIONS$DETAIL$NEEDS_REVIEW;case`in_progress`:return u.FEATURED_AUTOMATIONS$RUN_IN_PROGRESS;case`none`:return u.AUTOMATIONS$DETAIL$NO_RUNS;default:return u.FEATURED_AUTOMATIONS$STATUS_UNKNOWN}}var Oe={github:`GitHub`,gitlab:`GitLab`,slack:`Slack`,linear:`Linear`,jira:`Jira`};function P(e){let t=e.trim().toLowerCase();return t?Oe[t]??t.replace(/\b\w/g,e=>e.toUpperCase()):e}function F(e){let{trigger:t}=e;return t.type===`event`&&t.on?h(t.on):null}function I(e){let{trigger:t}=e;return t.type===`event`&&t.source?.trim()||null}function L(e){let{trigger:t}=e;return t.type===`event`?null:t.schedule_human||t.schedule||t.type||null}function R(e){let{trigger:t}=e;if(t.type===`event`){let t=I(e);return[F(e)??``,t?`(${P(t)})`:``].filter(Boolean).join(` `)}return L(e)??t.type}var z=48;function B(e){let t=e.trim().replace(/\s+/g,` `);if(!t)return t;let n=t.match(/^.*?[.!?](?=\s|$)/)?.[0]??t;return n.length<=z?n:`${n.slice(0,z-1).trimEnd()}…`}function ke(e,t=B(e)){return e.trim().replace(/\s+/g,` `)!==t}function V(e){let t=e.completed_at??e.started_at;if(!t)return null;let n=new Date(t).getTime();return Number.isNaN(n)||n===0?null:t}function Ae(e,t){let n=[];if(e.repository&&n.push({id:`repository`,node:(0,E.jsxs)(`span`,{className:d(C,`gap-1`),children:[(0,E.jsx)(oe,{className:`size-3 shrink-0`}),e.repository]})}),e.trigger.type===`event`){let t=F(e);t&&n.push({id:`event-trigger`,node:(0,E.jsxs)(`span`,{className:d(C,`gap-1`),children:[(0,E.jsx)(b,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t]})});let r=I(e);if(r){let e=fe(r.toLowerCase(),de);n.push({id:`event-source`,node:(0,E.jsxs)(`span`,{className:d(C,`gap-1`),children:[e?(0,E.jsx)(ae,{entry:e,size:`xs`,testId:`automation-source-logo`}):(0,E.jsx)(te,{className:`size-3 shrink-0`,"aria-hidden":`true`,"data-testid":`automation-source-logo`}),P(r)]})})}}else n.push({id:`schedule`,node:(0,E.jsxs)(`span`,{className:d(C,`gap-1`),children:[(0,E.jsx)(x,{className:`size-3 shrink-0`}),t]})});return e.model&&n.push({id:`model`,node:(0,E.jsxs)(`span`,{className:d(C,`gap-1`),children:[(0,E.jsx)(f,{className:`size-3 shrink-0`}),e.model]})}),n}var je=new Set([S.COMPLETED,S.FAILED]);function H(e){let{badgeStatus:t}=p(e);return t===S.COMPLETED||t===`success`}function Me(e){let{badgeStatus:t}=p(e);return t===S.FAILED||t===`failed`||t===`blocked`}function U(e){let t=e.runs.filter(e=>je.has(e.status)),n=t.filter(H).length,r;r=e.status_counts?e.status_counts[S.COMPLETED]??0:e.total<=e.runs.length?n:null;let i=t.flatMap(e=>{if(!e.completed_at)return[];let t=new Date(e.completed_at).getTime()-new Date(e.started_at).getTime();return Number.isFinite(t)&&t>=0?[t]:[]});return{total:e.total,completedTotal:r,latestRun:e.runs[0]??null,recentRuns:e.runs,recentSuccessRate:t.length===0?null:n/t.length,averageDurationMs:i.length===0?null:i.reduce((e,t)=>e+t,0)/i.length}}function W(e,t){if(!e.enabled)return`disabled`;if(!t||t.isError||t.isLoading||!t.summary)return`unknown`;let n=t.summary.latestRun;return n?Me(n)?`failing`:n.status===S.PENDING||n.status===S.RUNNING?`running`:H(n)?`healthy`:`unknown`:`never-run`}function G(e){return e===null||!Number.isFinite(e)?`—`:e<6e4?`${Math.max(1,Math.round(e/1e3))}s`:e<36e5?`${Math.max(1,Math.round(e/6e4))}m`:`${(e/36e5).toFixed(1)}h`}function K(e,t){let n=t.toLowerCase();return n?e.name.toLowerCase().includes(n)||(e.prompt??``).toLowerCase().includes(n)||e.repository?.toLowerCase().includes(n)===!0||e.model?.toLowerCase().includes(n)===!0:!0}var Ne={active:e=>e.enabled,failing:(e,t)=>t===`failing`,disabled:e=>!e.enabled},Pe={event:e=>e.trigger.type===`event`,schedule:e=>e.trigger.type!==`event`};function q(e,t){return t.get(e.id)?.summary?.total??0}function J(e,t){let n=t.get(e.id)?.summary?.latestRun?.started_at??e.last_triggered_at;if(!n)return 0;let r=new Date(n).getTime();return Number.isFinite(r)?r:0}var Fe={"last-run":(e,t,n)=>J(t,n)-J(e,n),runs:(e,t,n)=>q(t,n)-q(e,n),name:(e,t)=>e.name.localeCompare(t.name)};function Ie(e,t,n){return e.filter(e=>!(!K(e,t.search)||t.status!==`all`&&!Ne[t.status](e,W(e,n.get(e.id)))||t.trigger!==`all`&&!Pe[t.trigger](e))).sort((e,r)=>Fe[t.sort](e,r,n))}function Y(e,t){return e.flatMap(e=>{let n=t.get(e.id);return n?.summary&&!n.isLoading&&!n.isError?[n.summary]:[]})}var Le={automations:e=>({display:e.length.toLocaleString(),isZero:e.length===0,placeholderValues:{active:e.filter(e=>e.enabled).length}}),"needs-attention":(e,t)=>{let n=e.filter(e=>W(e,t.get(e.id))===`failing`).length;return{display:n.toLocaleString(),isZero:n===0,placeholderValues:{}}},"total-runs":(e,t)=>{let n=Y(e,t);if(n.length===0&&e.length>0)return{display:`—`,isZero:!1,placeholderValues:{}};let r=n.reduce((e,t)=>e+t.total,0);return{display:r.toLocaleString(),isZero:r===0,placeholderValues:{}}},"average-duration":(e,t)=>{let n=Y(e,t).flatMap(e=>e.averageDurationMs===null?[]:[e.averageDurationMs]);return{display:G(n.length===0?null:n.reduce((e,t)=>e+t,0)/n.length),isZero:!1,placeholderValues:{}}}};function Re(e,t,n){return Le[e](t,n)}function ze(e){return e?.summary?e.summary.total.toLocaleString():!e||e.isLoading?`…`:`—`}function Be(e){let t=e?.summary?.recentSuccessRate;return t==null?`—`:`${Math.round(t*100)}%`}function Ve(e){return G(e?.summary?.averageDurationMs??null)}function He({state:e,copy:t}){return(0,E.jsx)(`dl`,{"data-testid":`automation-run-stats`,className:`grid grid-cols-3 gap-2 text-xs`,children:[{label:t.runs,value:ze(e)},{label:t.recentSuccess,value:Be(e)},{label:t.averageDuration,value:Ve(e)}].map(e=>(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`dt`,{className:`truncate text-muted`,children:e.label}),(0,E.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-content`,children:e.value})]},e.label))})}var Ue={latestRun:null,recentRuns:[],isLoading:!1,isError:!1};function We(e){return e?{latestRun:e.summary?.latestRun??null,recentRuns:e.summary?.recentRuns??[],total:e.summary?.total,isLoading:e.isLoading,isError:e.isError}:Ue}function Ge(e){return e.recentRuns.length===0&&(e.isLoading||e.isError)?{summary:null,isLoading:e.isLoading,isError:e.isError}:{summary:U({runs:e.recentRuns,total:e.total??e.recentRuns.length}),isLoading:e.isLoading,isError:e.isError}}function X(e){return e?.status===S.PENDING||e?.status===S.RUNNING}function Ke(e,t){let{t:n}=o(`openhands`),{navigate:r}=re(),{canManage:i}=me(),a=pe(e),c=i||a,d=ye(),f=ce(),p=ue(),m=le(),[h,g]=(0,T.useState)(!1),[_,v]=(0,T.useState)(!1);return{canManage:c,isRunPending:f.isPending&&f.variables===e.id,isCancelPending:m.isPending&&m.variables?.runId===t?.id,canCancel:c&&X(t),editOpen:h,setEditOpen:g,turnOffConfirmOpen:_,runNow:(0,T.useCallback)(()=>{if(d){s(n(u.AUTOMATIONS$RUN_NOW_SUCCESS));return}f.mutate(e.id,{onSuccess:()=>{s(n(u.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:e=>{l(w(e,n(u.AUTOMATIONS$RUN_NOW_ERROR)))}})},[e.id,f,d,n]),viewDetails:(0,T.useCallback)(()=>{r?.(`/automations/${e.id}`)},[e.id,r]),openEdit:(0,T.useCallback)(()=>{g(!0)},[]),requestTurnOff:(0,T.useCallback)(()=>{v(!0)},[]),confirmTurnOff:(0,T.useCallback)(()=>{v(!1),!d&&p.mutate({id:e.id,enabled:!1},{onError:e=>{l(w(e,n(u.AUTOMATIONS$TURN_OFF_ERROR)))}})},[e.id,d,n,p]),cancelTurnOff:(0,T.useCallback)(()=>{v(!1)},[]),cancelRun:(0,T.useCallback)(()=>{if(!(!t||!X(t))){if(d){s(n(u.AUTOMATIONS$CANCEL_RUN_SUCCESS));return}m.mutate({automationId:e.id,runId:t.id},{onSuccess:()=>{s(n(u.AUTOMATIONS$CANCEL_RUN_SUCCESS))},onError:e=>{l(w(e,n(u.AUTOMATIONS$CANCEL_RUN_ERROR)))}})}},[e.id,m,d,t,n])}}var qe=`openhands-automations-view`;function Je(){return typeof window>`u`?`grid`:window.localStorage.getItem(`openhands-automations-view`)===`list`?`list`:`grid`}function Ye(e){window.localStorage.setItem(qe,e)}var Xe=`divide-y divide-[var(--oh-border-subtle)] overflow-hidden rounded-xl border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]`,Ze=`group relative flex items-stretch transition-colors hover:bg-surface-raised has-[:focus-visible]:bg-surface-raised`,Qe=`mt-3 flex min-h-9 items-center justify-between gap-2 overflow-hidden rounded-md border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)] px-3 py-2 text-xs`,Z=1e3,$e=30*6e4;function et(e,t=Date.now()){let n=e.started_at?new Date(e.started_at).getTime():NaN;if(Number.isNaN(n)||n<=0)return null;if(e.completed_at){let t=new Date(e.completed_at).getTime();return Number.isNaN(t)||t<n?null:t-n}return e.status===S.PENDING||e.status===S.RUNNING?Math.max(0,t-n):null}function tt(e){if(e==null||e<=0)return 11;let t=Math.log(Math.min($e,Math.max(Z,e))/Z)/Math.log($e/Z);return Math.round(6+t*9)}function nt(e){switch(e){case S.COMPLETED:case`success`:return`bg-[var(--oh-status-success)]`;case S.FAILED:case`failed`:return`bg-[var(--oh-status-error)]`;case`blocked`:case`partial_success`:case`unknown`:return`bg-[var(--oh-warning)]`;case S.RUNNING:return`bg-[var(--oh-status-success)] animate-pulse motion-reduce:animate-none`;case S.PENDING:return`bg-[repeating-linear-gradient(-45deg,var(--oh-muted)_0_1.5px,var(--oh-border)_1.5px_3px)]`;case S.CANCELLED:return`bg-[var(--oh-muted)]`;default:return`bg-[var(--oh-border)]`}}function rt(e){return y(e)}function it(e){return e==null||e<=0?null:e<6e4?`${Math.max(1,Math.round(e/1e3))}s`:e<36e5?`${Math.round(e/6e4)}m`:`${(e/36e5).toFixed(1)}h`}function at({label:e,children:t}){return(0,E.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,E.jsx)(`span`,{className:`w-16 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-white`,children:t})]})}function ot({run:e,nowMs:t}){let{t:n,i18n:r}=o(`openhands`),i=V(e),a=i?m(i,r.language,n):null,s=it(et(e,t)),c=p(e),l=n(rt(c.badgeStatus));return(0,E.jsxs)(`div`,{className:`flex w-[220px] flex-col gap-2 p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:d(`h-3 w-1.5 shrink-0 rounded-[1px]`,nt(c.badgeStatus))}),(0,E.jsx)(`span`,{className:`text-sm font-medium text-white`,children:l})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[a?(0,E.jsx)(at,{label:n(u.AUTOMATIONS$DETAIL$LAST_RUN),children:a}):null,s?(0,E.jsx)(at,{label:n(u.FEATURED_AUTOMATIONS$RUN_DURATION),children:s}):null]}),c.summary?(0,E.jsx)(`p`,{className:`line-clamp-3 text-xs text-[var(--oh-text-secondary)]`,children:c.summary}):null]})}function st({automationId:e,run:t,nowMs:r}){let{t:i}=o(`openhands`),a=et(t,r),s=p(t),c=i(rt(s.badgeStatus)),l=`/automations/${encodeURIComponent(e)}?run=${encodeURIComponent(t.id)}`;return(0,E.jsx)(n,{content:(0,E.jsx)(ot,{run:t,nowMs:r}),placement:`top`,closeDelay:80,delay:200,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,children:(0,E.jsx)(ie,{to:l,"aria-label":c,className:`group/spark-bar inline-flex h-full cursor-pointer items-end px-[2px] focus:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-focus)]`,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,E.jsx)(`span`,{className:d(`w-1 shrink-0 origin-bottom rounded-[1px]`,`transition-transform duration-100 ease-out motion-reduce:transition-none`,`group-hover/spark-bar:scale-x-[1.4] group-hover/spark-bar:scale-y-[1.15]`,`group-focus-visible/spark-bar:scale-x-[1.4] group-focus-visible/spark-bar:scale-y-[1.15]`,nt(s.badgeStatus)),style:{height:tt(a)}})})})}function ct({automationId:e,runs:t,testId:n}){let{t:r}=o(`openhands`),i=t.some(e=>X(e)),[a,s]=(0,T.useState)(()=>Date.now());if((0,T.useEffect)(()=>{if(!i)return;let e=window.setInterval(()=>s(Date.now()),1e3);return()=>window.clearInterval(e)},[i]),t.length===0)return null;let c=[...t].reverse().slice(-12);return(0,E.jsx)(`span`,{"data-testid":n,"aria-label":r(u.FEATURED_AUTOMATIONS$RUN_ACTIVITY_LABEL,{count:c.length}),className:`inline-flex shrink-0 items-end`,style:{height:18},onMouseDown:e=>e.preventDefault(),children:c.map((t,n)=>(0,E.jsx)(st,{automationId:e,run:t,nowMs:a},`${t.id}-${n}`))})}function lt({health:e}){return e===`success`?(0,E.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`h-2.5 w-2.5 shrink-0 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})}):(0,E.jsx)(`span`,{"aria-hidden":`true`,className:d(`h-1.5 w-1.5 shrink-0 rounded-full`,e===`failed`&&`bg-[var(--oh-status-error)]`,e===`warning`&&`bg-[var(--oh-warning)]`,e===`in_progress`&&`animate-pulse bg-[var(--oh-status-success)] motion-reduce:animate-none`,(e===`none`||e===`unknown`)&&`bg-[var(--oh-border)]`)})}function Q(e){return e.isError?u.FEATURED_AUTOMATIONS$STATUS_UNAVAILABLE:e.latestRun?y(p(e.latestRun).badgeStatus):De(N(e))}function $({label:e,children:t}){return(0,E.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,E.jsx)(`span`,{className:`w-20 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-[var(--oh-foreground)]`,children:t})]})}function ut({run:e}){let{t}=o(`openhands`),n=ee({status:e?.status,code:e?.phase_code,label:e?.phase_label,updatedAt:e?.phase_updated_at});if(!e||!g(e.status)||!n)return null;let{text:r,age:i}=n;return(0,E.jsx)($,{label:t(u.AUTOMATIONS$DETAIL$PHASE),children:(0,E.jsxs)(`span`,{"data-testid":`run-phase-row`,children:[r,i?(0,E.jsxs)(`span`,{className:`text-muted`,children:[` · `,i]}):null]})})}function dt({automation:e,runState:t}){let{t:n,i18n:r}=o(`openhands`),{latestRun:i}=t,a=i?V(i):null,s=e.trigger.type===`event`?b:x,c=N(t),l=i?p(i):null,d=_(e)?v(e,n):null;return(0,E.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-3 p-3`,children:[(0,E.jsx)(`span`,{className:`break-words text-sm font-medium text-white`,children:e.name}),(0,E.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$TRIGGER),children:(0,E.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,E.jsx)(s,{className:`mt-0.5 size-3 shrink-0`,"aria-hidden":`true`}),(0,E.jsx)(`span`,{className:`break-all`,children:R(e)})]})}),(0,E.jsx)($,{label:n(u.COMMON$STATUS),children:(0,E.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,E.jsx)(lt,{health:c}),(0,E.jsx)(`span`,{children:n(Q(t))})]})}),d?(0,E.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$DISABLED_REASON_HEADING),children:(0,E.jsx)(`span`,{"data-testid":`automation-tooltip-disabled-reason`,className:`line-clamp-3 text-[var(--oh-text-secondary)]`,children:d.text})}):null,(0,E.jsx)(ut,{run:i}),a?(0,E.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$LAST_RUN),children:m(a,r.language,n)}):null,l?.summary?(0,E.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$TASK_LABEL),children:(0,E.jsx)(`span`,{className:`line-clamp-3 text-[var(--oh-text-secondary)]`,children:l.summary})}):null]})]})}export{Ee as A,L as C,ke as D,B as E,he as F,ye as M,_e as N,Te as O,D as P,F as S,R as T,U as _,Xe as a,P as b,Je as c,We as d,Ge as f,K as g,Re as h,ct as i,xe as j,we as k,Ye as l,Ie as m,Q as n,Ze as o,He as p,lt as r,Qe as s,dt as t,Ke as u,Ae as v,I as w,V as x,N as y};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useInfiniteQuery-CtSRG7uW.js";import{t as i}from"./useQuery-DAAacS7O.js";import{n as a}from"./active-backend-context-BnH4-L8h.js";import{x as o}from"./utils-BgLSZdyy.js";import{c as s,n as c}from"./agent-server-client-options-EHB23gyx.js";import{t as l}from"./proxy-XP6U1Dhv.js";import{t as u}from"./react-BX7IV650.js";import{i as d}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";import{n as f}from"./use-settings-C2KKQKVC.js";import{g as p,m}from"./conversation-store-DC-JlJuq.js";import{t as h}from"./agent-server-conversation-service.api-jiCopc2E.js";import{t as g}from"./use-is-authed-A2Yinlt0.js";var _=e(t()),v=n(),y=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),b=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},x=()=>{let{data:e,isLoading:t}=f();return{providers:_.useMemo(()=>b(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function S(e){switch(e){case`ADDED`:case`added`:return`A`;case`DELETED`:case`deleted`:return`D`;case`UPDATED`:case`modified`:return`M`;case`MOVED`:case`renamed`:return`R`;default:return`M`}}function C(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function w(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await l({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function T(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await l({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function E(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await l({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var D=e=>e,O=()=>s().backend.kind===`cloud`,k=e=>!e||e===`undefined`||e===`null`,A={items:[],next_page_id:null},j={items:[],next_page_id:null},M={items:[],next_page_id:null},N=class{static async searchGitRepositories(e,t,n=100,r,i){return k(t)||!O()?A:w({provider:D(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return k(e)||!O()?A:w({provider:D(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(k(e)||!O())return A;let a=n[t];return a?w({provider:D(e),installationId:a,limit:i,pageId:r}):A}static async getRepositoryBranches(e,t,n=``,r,i=30){return k(t)||!O()?j:E({provider:D(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return k(t)||!O()?j:E({provider:D(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return k(e)||!O()?M:T({provider:D(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await h.resolveConversationWorkingDir(e);return(await new d(c({workingDir:t})).gitChanges(t)).map(e=>({path:e.path,status:S(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new d(c()).gitDiff(t);return{modified:n.modified??``,original:n.original??``}}},P=e=>{let{data:t}=g(),{providers:n}=x(),r=a();return i({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>N.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&o(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function F(e){let{provider:t,pageSize:n=30,enabled:i=!0}=e,{providers:s}=x(),{data:c}=P(t),l=c?.items,u=a(),d=t?o(t,u.backend.kind):!1,f=r({queryKey:[`repositories`,t,d,n,u.backend.id,u.orgId,...d?[l||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(d){if(!l)throw Error(`Missing installation list`);let r=e;return await N.retrieveInstallationRepositories(t,r.installationIndex,l,r.pageId??void 0,n)}let r=e;return await N.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(d&&l){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<l.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:d?{installationIndex:0,pageId:null}:null,enabled:i&&(s||[]).length>0&&!!t&&(!d||Array.isArray(l)&&l.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:f.data,isLoading:f.isLoading,isError:f.isError,hasNextPage:f.hasNextPage,isFetchingNextPage:f.isFetchingNextPage,fetchNextPage:f.fetchNextPage,onLoadMore:()=>{f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()}}}function I(e,t,n,r=100){return i({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await N.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,staleTime:1e3*60*5,gcTime:1e3*60*15})}function L(e,t){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var R={recentRepositories:[],lastSelectedProvider:null},z=u()(p((e,t)=>({...R,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:m(()=>localStorage)}));export{N as a,y as c,F as i,L as n,S as o,I as r,x as s,z as t};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useInfiniteQuery-CtSRG7uW.js";import{t as i}from"./useQuery-DAAacS7O.js";import{n as a}from"./active-backend-context-BsLfwrXB.js";import{x as o}from"./utils-D-gOfhmN.js";import{c as s,n as c}from"./agent-server-client-options-EHB23gyx.js";import{t as l}from"./proxy-DbEf3Nqr.js";import{t as u}from"./react-BX7IV650.js";import{i as d}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js";import{n as f}from"./use-settings-BWIH5EuN.js";import{g as p,m}from"./conversation-store-DC-JlJuq.js";import{t as h}from"./agent-server-conversation-service.api-BaVQ6NpE.js";import{t as g}from"./use-is-authed-A2Yinlt0.js";var _=e(t()),v=n(),y=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),b=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},x=()=>{let{data:e,isLoading:t}=f();return{providers:_.useMemo(()=>b(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function S(e){switch(e){case`ADDED`:case`added`:return`A`;case`DELETED`:case`deleted`:return`D`;case`UPDATED`:case`modified`:return`M`;case`MOVED`:case`renamed`:return`R`;default:return`M`}}function C(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function w(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await l({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function T(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await l({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function E(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await l({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var D=e=>e,O=()=>s().backend.kind===`cloud`,k=e=>!e||e===`undefined`||e===`null`,A={items:[],next_page_id:null},j={items:[],next_page_id:null},M={items:[],next_page_id:null},N=class{static async searchGitRepositories(e,t,n=100,r,i){return k(t)||!O()?A:w({provider:D(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return k(e)||!O()?A:w({provider:D(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(k(e)||!O())return A;let a=n[t];return a?w({provider:D(e),installationId:a,limit:i,pageId:r}):A}static async getRepositoryBranches(e,t,n=``,r,i=30){return k(t)||!O()?j:E({provider:D(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return k(t)||!O()?j:E({provider:D(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return k(e)||!O()?M:T({provider:D(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await h.resolveConversationWorkingDir(e);return(await new d(c({workingDir:t})).gitChanges(t)).map(e=>({path:e.path,status:S(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new d(c()).gitDiff(t);return{modified:n.modified??``,original:n.original??``}}},P=e=>{let{data:t}=g(),{providers:n}=x(),r=a();return i({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>N.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&o(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function F(e){let{provider:t,pageSize:n=30,enabled:i=!0}=e,{providers:s}=x(),{data:c}=P(t),l=c?.items,u=a(),d=t?o(t,u.backend.kind):!1,f=r({queryKey:[`repositories`,t,d,n,u.backend.id,u.orgId,...d?[l||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(d){if(!l)throw Error(`Missing installation list`);let r=e;return await N.retrieveInstallationRepositories(t,r.installationIndex,l,r.pageId??void 0,n)}let r=e;return await N.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(d&&l){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<l.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:d?{installationIndex:0,pageId:null}:null,enabled:i&&(s||[]).length>0&&!!t&&(!d||Array.isArray(l)&&l.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:f.data,isLoading:f.isLoading,isError:f.isError,hasNextPage:f.hasNextPage,isFetchingNextPage:f.isFetchingNextPage,fetchNextPage:f.fetchNextPage,onLoadMore:()=>{f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()}}}function I(e,t,n,r=100){return i({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await N.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,staleTime:1e3*60*5,gcTime:1e3*60*15})}function L(e,t){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var R={recentRepositories:[],lastSelectedProvider:null},z=u()(p((e,t)=>({...R,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:m(()=>localStorage)}));export{N as a,y as c,F as i,L as n,S as o,I as r,x as s,z as t};
@@ -1 +1 @@
1
- import{n as e,u as t}from"./agent-server-client-options-EHB23gyx.js";import{s as n}from"./agent-server-config-C_x8Otd9.js";import{g as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";var i=5e3,a=class{static async loadWorkspaceHooks(a){if(!t())return null;try{return(await new r(e({timeout:i})).loadHooks({project_dir:a??n()}))?.hook_config??null}catch(e){return console.warn(`Failed to load workspace hooks, continuing without:`,e),null}}};export{a as default};
1
+ import{n as e,u as t}from"./agent-server-client-options-EHB23gyx.js";import{s as n}from"./agent-server-config-C_x8Otd9.js";import{g as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";var i=5e3,a=class{static async loadWorkspaceHooks(a){if(!t())return null;try{return(await new r(e({timeout:i})).loadHooks({project_dir:a??n()}))?.hook_config??null}catch(e){return console.warn(`Failed to load workspace hooks, continuing without:`,e),null}}};export{a as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t}from"./home-BghzJd-D.js";import{n}from"./use-pinned-home-route-pK4IlJ-p.js";var r=()=>{let t=n();return t?e(t):null};export{r as clientLoader,t 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{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{V as o,ct as s,dt as c,n as l,st as u}from"./active-backend-context-BnH4-L8h.js";import{K as d,t as f}from"./utils-BgLSZdyy.js";import{c as p,d as m,n as h}from"./agent-server-client-options-EHB23gyx.js";import{t as ee}from"./bot-ByolqPEr.js";import{m as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{c as _,i as v,l as y,m as b,p as te,r as x,t as S,u as C}from"./settings-service.api-C1vZH9Vh.js";import{n as w}from"./use-settings-C2KKQKVC.js";import{t as ne}from"./modal-backdrop-BSzNhM4r.js";import{n as re}from"./modal-classes-B0b9eiL8.js";import{t as ie}from"./brand-button-CUMfjb99.js";import{t as T}from"./styled-tooltip-CejG0rqv.js";import{t as ae}from"./modal-close-button-DfqfB2Nj.js";import{t as E}from"./settings-input-dVuzapBA.js";import{t as D}from"./secrets-service-BOIsfD9j.js";import{c as oe,i as se,s as O,t as k}from"./mcp-marketplace-utils-C7PYr293.js";import{t as A}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";var j=e(t()),M=n(),N=e=>(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,M.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,fill:`currentColor`})});function P({fieldKey:e,checked:t,onToggle:n}){let{t:r}=a(`openhands`);return(0,M.jsxs)(`label`,{"data-testid":`mcp-install-save-secret-${e}`,className:f(`flex items-center gap-2 px-3 py-2 mt-0.5 rounded-lg border cursor-pointer transition-colors`,t?`border-green-500/35 bg-green-500/10`:`border-[var(--oh-border)] bg-transparent hover:bg-white/[0.03]`),children:[(0,M.jsx)(`input`,{className:`sr-only`,id:`mcp-save-secret-checkbox-${e}`,type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),(0,M.jsx)(`span`,{"aria-hidden":`true`,className:f(`relative inline-flex h-[22px] w-[40px] shrink-0 items-center rounded-full border transition-colors duration-200`,t?`border-green-500 bg-green-500`:`border-[var(--oh-border)] bg-surface-raised`),children:(0,M.jsx)(`span`,{className:f(`inline-block size-4 rounded-full transition-transform duration-200`,t?`translate-x-[21px] bg-white`:`translate-x-[2px] bg-[var(--oh-muted)]`)})}),(0,M.jsx)(`span`,{className:`text-sm`,children:r(d.MCP$ALSO_SAVE_AS_SECRET)}),(0,M.jsx)(`code`,{className:f(`ml-auto text-[11px] font-mono tracking-tight border rounded px-1.5 py-0.5`,t?`text-green-500 border-green-500/35 bg-white/[0.04]`:`text-tertiary-alt border-[var(--oh-border)]`),children:e}),(0,M.jsx)(T,{content:r(d.MCP$SAVE_AS_SECRET_TOOLTIP),placement:`top`,children:(0,M.jsx)(`button`,{type:`button`,"aria-label":r(d.MCP$SAVE_AS_SECRET_TOOLTIP),className:`flex items-center justify-center size-[15px] shrink-0 rounded-full border border-[var(--oh-muted)] text-tertiary-alt text-[9px] font-bold cursor-help`,onClick:e=>e.preventDefault(),children:`?`})})]})}var F={xs:`h-4 w-4 rounded [&>svg]:h-2.5 [&>svg]:w-2.5`,sm:`h-5 w-5 rounded-md [&>svg]:h-3 [&>svg]:w-3`,base:`h-7 w-7 rounded-lg [&>svg]:h-3.5 [&>svg]:w-3.5`,md:`h-10 w-10 rounded-lg [&>svg]:h-5 [&>svg]:w-5`},I={slack:N};function ce({entry:e,size:t=`md`,className:n,fallback:r,testId:i}){let a=e?I[e.id]:void 0;return(0,M.jsx)(`span`,{"aria-hidden":`true`,title:e?.name,"data-testid":i,className:f(`inline-flex shrink-0 items-center justify-center overflow-hidden`,`border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,F[t],n),style:{backgroundColor:e?.iconBg??`var(--oh-color-tertiary)`,color:e?.iconColor??`#FFFFFF`},children:a?(0,M.jsx)(a,{}):e?.logoUrl?(0,M.jsx)(`img`,{src:e.logoUrl,alt:`${e.name} logo`,className:`h-full w-full object-contain p-[22%]`,onError:e=>{let t=e.currentTarget;t.style.display=`none`}}):r??(0,M.jsx)(ee,{className:`h-5 w-5`,strokeWidth:2.25})})}var le=new Set([`invalid_auth`,`not_authed`,`account_inactive`,`token_revoked`,`token_expired`]),L=e=>e.is_error?e.text||`tool call failed`:null,ue={github:{toolCall:{name:`get_me`,arguments:{}},interpret:L},linear:{toolCall:{name:`list_teams`,arguments:{}},interpret:L},slack:{toolCall:{name:`slack_list_channels`,arguments:{limit:1}},interpret:e=>{if(e.is_error)return e.text||`tool call failed`;try{let t=JSON.parse(e.text);if(t?.ok===!1&&le.has(t.error))return String(t.error)}catch{}return null}}};function R(e){let t=k(e,O(A));return t?ue[t.id]:void 0}var de=4,fe=/token|key|secret|auth/i,pe=[/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,/\bxox[a-z](?:-[A-Za-z0-9]+)+/g,/\blin_api_[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g],me=/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi;function z(e,t){typeof t==`string`&&(t.length<de||t!==`**********`&&e.add(t))}function B(e,t){for(let n of Object.values(t??{}))z(e,n)}function he(e,t){if(t)try{let n=new URL(t);z(e,n.username),z(e,n.password),z(e,decodeURIComponent(n.username)),z(e,decodeURIComponent(n.password)),n.searchParams.forEach((t,n)=>{fe.test(n)&&z(e,t)})}catch{}}function ge(e,t){if(t)switch(t.strategy){case`api_key`:case`bearer`:z(e,t.value);break;case`basic`:z(e,t.username),z(e,t.password);break;case`header`:B(e,t.headers);break;case`oauth2`:z(e,t.authentication?.client_secret),B(e,t.state?.tokens);break;default:break}}function _e(e){let t=new Set;return B(t,e.env),B(t,e.headers),ge(t,e.auth),he(t,e.url),[...t].sort((e,t)=>t.length-e.length)}function V(e,...t){if(!e)return e;let n=e;for(let e of t)if(e)for(let t of _e(e))n=n.split(t).join(x);n=n.replace(me,`Bearer ${x}`);for(let e of pe)n=n.replace(e,x);return n}var H=e=>!!e&&typeof e==`object`&&!Array.isArray(e),ve=e=>{if(!H(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0},ye=e=>!!e&&Object.values(e).some(e=>e===`**********`);function be(e,t){if(!H(e))return e;let n=H(t)?t:{},r={...e};for(let[t,i]of Object.entries(e))if(i===`**********`){let e=n[t];typeof e==`string`&&e!==`**********`&&(r[t]=e)}else H(i)&&(r[t]=be(i,n[t]));return r}var xe=(e,t)=>t[e.id];async function Se(e){let t=(await S.fetchSettingsFromApi(`encrypted`)).agent_settings?.mcp_config;if(H(t))return xe(e,t)}async function Ce(e){let t=e.type===`stdio`&&ye(e.env),n=(e.type===`sse`||e.type===`shttp`)&&_(e.auth),r=(e.type===`sse`||e.type===`shttp`)&&ye(e.headers);if(!t&&!n&&!r)return e;try{let i=await Se(e);if(!i)return e;if(t){let t=ve(i.env)??{},n=Object.fromEntries(Object.entries(e.env??{}).map(([e,n])=>[e,n===`**********`&&typeof t[e]==`string`?t[e]:n]));return{...e,env:n}}let a={...e};if(n&&b(i.auth)&&(a.auth=be(e.auth,i.auth)),r){let t=ve(i.headers)??{};a.headers=Object.fromEntries(Object.entries(e.headers??{}).map(([e,n])=>[e,n===`**********`&&typeof t[e]==`string`?t[e]:n]))}return a}catch{return e}}var we=120;function Te(e){return e.type===`stdio`?{type:`stdio`,command:e.command,...e.args?.length&&{args:e.args},...e.env&&Object.keys(e.env).length>0&&{env:e.env}}:{type:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0&&{headers:e.headers},...e.auth?{auth:e.auth}:{}}}function Ee(e){return e.auth?.strategy===`oauth2`?we:e.timeout}async function De(e){let t=R(e),n=await Ce(e),r=Te(n),i=Ee(e);return{request:{server:r,...e.name?{name:e.name}:{},...i===void 0?{}:{timeout:i},...t?{tool_call:t.toolCall}:{}},substituted:n}}function Oe(e,t){return e.ok?e.tool_result?{...e,tool_result:{...e.tool_result,text:V(e.tool_result.text,...t)}}:e:{...e,error:V(e.error,...t)}}function ke(e,t,n){let r=Oe(e,n);if(r.ok&&t&&r.tool_result&&r.tools.includes(t.toolCall.name)){let e=t.interpret(r.tool_result);if(e)return{ok:!1,error:e,error_kind:`credentials`}}return r}function Ae(){if(p().backend.kind===`local`){let{host:e,apiKey:t}=h();return{host:e,...t?{apiKey:t}:{}}}let e=m().find(e=>e.kind===`local`&&e.host);if(e)return{host:e.host.replace(/\/+$/,``),...e.apiKey?{apiKey:e.apiKey}:{}};throw Error(`OAuth authorization requires a reachable local backend.`)}function U(){let{host:e,apiKey:t}=Ae();return new g({host:e,...t?{apiKey:t}:{},timeout:125e3})}function je(e){return e.status===`succeeded`?{ok:!0,tools:e.tools??[],...e.tool_result!==void 0&&{tool_result:e.tool_result},...e.oauth_state!==void 0&&{oauth_state:e.oauth_state}}:{ok:!1,error:e.error||`OAuth authorization did not complete`,error_kind:e.error_kind||`unknown`}}var Me=e=>new Promise(t=>{window.setTimeout(t,e)}),W=class e{static async testServer(e){if(p().backend.kind===`cloud`)return{ok:!0,tools:[]};let t=R(e),{host:n,apiKey:r}=h(),i=new g({host:n,...r?{apiKey:r}:{}});try{let{request:n,substituted:r}=await De(e);return ke(await i.testServer(n),t,[r,e])}finally{i.close()}}static async startOAuth(t){let n=U();try{return await e.startOAuthWithClient(n,t)}finally{n.close()}}static async getOAuthStatus(t){let n=U();try{return await e.getOAuthStatusWithClient(n,t)}finally{n.close()}}static async submitOAuthCallback(t,n){let r=U();try{return await e.submitOAuthCallbackWithClient(r,t,n)}finally{r.close()}}static async authorizeOAuth(t){let n=R(t),r=e=>ke(e,n,[t]),i=window.open(`about:blank`,`_blank`),a=U();try{let n=await e.startOAuthWithClient(a,t);if(!n.ok||!n.job_id||!n.authorization_url)return i?.close(),r({ok:!1,error:n.error||`Could not start OAuth authorization`,error_kind:n.error_kind||`unknown`});let o=await e.getOAuthStatusWithClient(a,n.job_id);for(let t=0;t<20;t+=1){if(o.status===`succeeded`||o.status===`failed`)return i?.close(),r(je(o));if(o.callback_ready)break;await Me(250),o=await e.getOAuthStatusWithClient(a,n.job_id)}i&&(i.location.href=n.authorization_url);for(let t=0;t<we;t+=1)if(await Me(1e3),o=await e.getOAuthStatusWithClient(a,n.job_id),o.status===`succeeded`||o.status===`failed`)return i?.close(),r(je(o));return{ok:!1,error:`OAuth authorization timed out`,error_kind:`timeout`}}finally{a.close()}}static async startOAuthWithClient(e,t){let{request:n}=await De(t);return e.startOAuth(n)}static async getOAuthStatusWithClient(e,t){return await e.getOAuthStatus(t)}static async submitOAuthCallbackWithClient(e,t,n){return await e.submitOAuthCallback(t,{callback_url:n})}},G=e=>Object.keys(e??{}).sort();function K(e){return e.type===`stdio`?JSON.stringify({type:e.type,name:e.name??``,command:e.command??``,args:e.args??[],envKeys:G(e.env)}):JSON.stringify({type:e.type,name:e.name??``,url:e.url??``,headerKeys:G(e.headers),authStrategy:e.auth?.strategy??``,authHeaderName:e.auth?.strategy===`api_key`?e.auth.header_name??``:``,authHeaderKeys:e.auth?.strategy===`header`?G(e.auth.headers):[]})}var q={},J=new Set,Ne=1;function Y(e){q=e,J.forEach(e=>e())}function Pe(){return q}function Fe(e){return J.add(e),()=>{J.delete(e)}}function Ie(e){let t=Ne;return Ne+=1,Y({...q,[e]:{status:`checking`,checkId:t}}),t}function X(e,t,n){let r=q[e];r?.status!==`checking`||r.checkId!==t||Y({...q,[e]:n})}function Le(e,t){Y({...q,[e]:t})}function Re(e){if(!(e in q))return;let{[e]:t,...n}=q;Y(n)}var ze=/\b(401|403)\b|unauthorized|forbidden|invalid[ _-]?(token|credentials?|api[ _-]?key)/i;function Be(e,t){return{status:`failed`,kind:`unknown`,error:V(t instanceof Error?t.message:String(t),e),checkedAt:Date.now()}}function Z(e,t){let n=Date.now();if(!t.ok)return{status:`failed`,kind:(t.error_kind===`connection`||t.error_kind===`unknown`)&&ze.test(t.error)?`credentials`:t.error_kind,error:t.error,checkedAt:n};let r=R(e);return{status:`healthy`,verification:r&&t.tools.includes(r.toolCall.name)&&t.tool_result&&!t.tool_result.is_error?`verified`:`connectivity-only`,toolCount:t.tools.length,checkedAt:n}}async function Ve(e){let t=K(e),n=Ie(t),r;try{r=Z(e,await W.testServer(e))}catch(t){r=Be(e,t)}X(t,n,r)}async function He(e){let t=K(e),n=Ie(t);try{let r=await W.authorizeOAuth(e);return X(t,n,Z(e,r)),r}catch(r){return X(t,n,Be(e,r)),null}}function Ue(e,t,n){let r=K(e);n.some(e=>K(e)===r)||Le(r,Z(e,t))}function We(){let e=r(),{data:t}=w();return i({mutationFn:async e=>{if(!t)throw Error(`MCP settings are still loading. Please try again.`);let n=v(t.mcp_config??y(t.agent_settings?.mcp_config),e.name,e.type);await S.createMcpServer(n,C(e))},onSuccess:()=>{e.invalidateQueries({queryKey:o.personal()})}})}function Ge(){return i({mutationFn:e=>W.testServer(e)})}function Ke(e){return e.length<=3?e.join(`, `):`${e.slice(0,3).join(`, `)} … (+${e.length-3})`}function qe(){let{t:e}=a(`openhands`),t=r();return(0,j.useCallback)((n,r,i)=>{let a=n.filter(e=>i[e.key]&&(r[e.key]??``).trim());return a.length===0?Promise.resolve():Promise.allSettled(a.map(e=>D.createSecret(e.key,r[e.key].trim(),e.label))).then(n=>{let r=a.filter((e,t)=>n[t].status===`fulfilled`).map(e=>e.key),i=a.filter((e,t)=>n[t].status===`rejected`).map(e=>e.key);r.length>0&&(t.invalidateQueries({queryKey:[`secrets-search`]}),t.invalidateQueries({queryKey:[`secrets`]}),s(e(d.MCP$SECRETS_SAVED,{keys:Ke(r)}))),i.length>0&&u(e(d.MCP$SECRETS_SAVE_FAILED,{keys:Ke(i)}))})},[e,t])}function Je(e,t,n){switch(t){case`timeout`:return e(d.MCP$TEST_ERROR_TIMEOUT);case`connection`:return e(d.MCP$TEST_ERROR_CONNECTION);case`credentials`:return e(d.MCP$TEST_ERROR_CREDENTIALS,{error:n});default:return e(d.MCP$TEST_ERROR_UNKNOWN,{error:n})}}function Q(e){let t=/\[([^\]]+)\]\(([^)]+)\)/g,n=[],r=0;for(let i of e.matchAll(t))i.index>r&&n.push(e.slice(r,i.index)),n.push((0,M.jsx)(`a`,{href:/^https?:\/\//i.test(i[2])?i[2]:`#`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-white transition-colors`,children:i[1]},i.index)),r=i.index+i[0].length;return r<e.length&&n.push(e.slice(r)),n}function Ye(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?!1:[`api_key`,`bearer`].includes(e.auth.strategy)}function Xe(e){return!!e&&e.auth.strategy===`oauth2`}function Ze(e){return e.transport.kind===`stdio`?e.auth.apiKeyOptional??!1:e.auth.apiKeyOptional??e.transport.apiKeyOptional??!1}function $(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?[]:e.transport.headerFields??[]}function Qe(e){let t={},n={},r=se(e),i=r?.transport;if(i?.kind===`stdio`){for(let e of i.envFields??[])t[e.key]=``,n[e.key]=e.type===`password`;for(let e of i.argFields??[])t[e.key]=``}else if(i?.kind===`shttp`||i?.kind===`sse`){t.url=i.url;for(let e of $(r))t[e.key]=``,n[e.key]=e.type===`password`;Ye(r)&&(t.api_key=``,r?.auth.credentialSecretName&&(n.api_key=r.auth.saveCredentialAsSecretByDefault??!1))}return{values:t,errors:{},savedAsSecret:n}}function $e({entry:e,existingServers:t,onClose:n,onSuccess:r}){let{t:i}=a(`openhands`),{mutate:o,isPending:u}=We(),{mutate:f,isPending:p}=Ge(),m=qe(),{backend:h}=l(),ee=h.kind===`cloud`,[g,_]=j.useState(()=>Qe(e)),v=j.useRef(g);v.current=g;let[y,b]=j.useState(null),[x,S]=j.useState(!1),[C,w]=j.useState(!1),T=se(e),D=T?.transport,O=p||C||u||x,k=(e,t)=>{_(n=>({...n,values:{...n.values,[e]:t},errors:{...n.errors,[e]:null}})),b(null)},A=(e,t)=>{_(n=>({...n,savedAsSecret:{...n.savedAsSecret,[e]:t}}))},N=()=>{let e=T?.auth.credentialSecretName,t=v.current.values.api_key?.trim();return!e||!t||!v.current.savedAsSecret.api_key?Promise.resolve():m([{key:e,label:T.auth.credentialLabel??e,type:`password`,required:!0}],{[e]:t},{[e]:!0})},F=()=>D?.kind===`stdio`?m(D.envFields??[],v.current.values,v.current.savedAsSecret):D?.kind===`shttp`||D?.kind===`sse`?Promise.all([N(),m($(T),v.current.values,v.current.savedAsSecret)]).then(()=>void 0):Promise.resolve(),I=a=>{if(a.auth?.strategy===`oauth2`){w(!0),W.authorizeOAuth(a).then(l=>{if(!l.ok){b(Je(i,l.error_kind,l.error));return}let u=l.oauth_state?{...a,auth:{...a.auth,state:l.oauth_state}}:a;o(u,{onSuccess:()=>{ee||Ue(u,l,t),s(i(d.MCP$INSTALL_SUCCESS)),S(!0),(async()=>{try{await F()}finally{r?.(e),n()}})()},onError:e=>{b(c(e)||i(d.ERROR$GENERIC))}})}).catch(e=>{b(c(e)||i(d.ERROR$GENERIC))}).finally(()=>w(!1));return}f(a,{onSuccess:l=>{if(!l.ok){b(Je(i,l.error_kind,l.error));return}let u=l.oauth_state&&a.auth?.strategy===`oauth2`?{...a,auth:{...a.auth,state:l.oauth_state}}:a;o(u,{onSuccess:()=>{ee||Ue(u,l,t),s(i(d.MCP$INSTALL_SUCCESS)),S(!0),(async()=>{try{await F()}finally{r?.(e),n()}})()},onError:e=>{b(c(e)||i(d.ERROR$GENERIC))}})},onError:e=>{b(c(e)||i(d.ERROR$GENERIC))}})},le=()=>{if(D?.kind!==`shttp`&&D?.kind!==`sse`||!T)return;let t=g.values.api_key?.trim()??``,n=D.urlEditable?g.values.url?.trim()??``:D.url,r=Xe(T),a=Ye(T),o=$(T),s={};if(!n)s.url=i(d.SETTINGS$MCP_ERROR_URL_REQUIRED);else try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s.url=i(d.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL))}catch{s.url=i(d.SETTINGS$MCP_ERROR_URL_INVALID)}for(let e of o)e.required&&!(g.values[e.key]??``).trim()&&(s[e.key]=i(d.MCP$ERROR_FIELD_REQUIRED));if(!r&&a&&!Ze(T)&&!t&&(s.api_key=i(d.MCP$ERROR_FIELD_REQUIRED)),Object.values(s).some(Boolean)){_(e=>({...e,errors:s}));return}let c=r?oe(T):void 0,l=Object.fromEntries(o.map(e=>[e.key,g.values[e.key]?.trim()??``]).filter(([,e])=>e)),u=Object.keys(l).length>0,f;r?f={strategy:`oauth2`,...c&&{authentication:c}}:a&&t?f=T.auth.strategy===`api_key`?{strategy:`api_key`,value:t,...T.auth.apiKeyHeaderName&&{header_name:T.auth.apiKeyHeaderName}}:{strategy:`bearer`,value:t}:u&&(f={strategy:`header`,headers:l}),I({id:``,type:D.kind,name:te(e.id),url:n,...f&&{auth:f},...u&&f?.strategy!==`header`&&{headers:l}})},L=()=>{if(D?.kind!==`stdio`)return;let e=D,t={};for(let n of e.envFields??[])n.required&&!(g.values[n.key]??``).trim()&&(t[n.key]=i(d.MCP$ERROR_FIELD_REQUIRED));for(let n of e.argFields??[])n.required&&!(g.values[n.key]??``).trim()&&(t[n.key]=i(d.MCP$ERROR_FIELD_REQUIRED));if(Object.values(t).some(Boolean)){_(e=>({...e,errors:t}));return}let n={};for(let t of e.envFields??[]){let e=g.values[t.key]?.trim();e&&(n[t.key]=e)}let r=[];for(let t of e.argFields??[]){let e=g.values[t.key]?.trim();if(e)for(let t of e.split(/\s+/))t&&r.push(t)}I({id:``,type:`stdio`,name:e.serverName,command:e.command,args:[...e.args,...r],...Object.keys(n).length>0&&{env:n}})};return(0,M.jsx)(ne,{onClose:n,"aria-label":e.name,children:(0,M.jsxs)(`form`,{"data-testid":`mcp-install-modal`,"data-marketplace-id":e.id,onSubmit:e=>(e.preventDefault(),b(null),D?.kind===`shttp`||D?.kind===`sse`?le():L()),className:`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar`,children:[(0,M.jsx)(ae,{onClose:n,testId:`mcp-install-modal-close`,disabled:O}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,M.jsx)(ce,{entry:e}),(0,M.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,M.jsx)(`h2`,{className:re,children:e.name}),(0,M.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.description})]})]}),e.installHint&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.installHint}),e.docsUrl&&(0,M.jsx)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-xs text-[var(--oh-muted)] hover:text-white hover:underline self-start transition-colors`,children:i(d.MCP$VIEW_DOCS)}),(0,M.jsx)(`div`,{className:`flex flex-col gap-3`,children:(()=>{if(D?.kind===`shttp`||D?.kind===`sse`){let e=Xe(T),t=Ye(T),n=T?Ze(T):!1,r=T?.auth.credentialSecretName,a=$(T);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{testId:`mcp-install-field-url`,name:`url`,type:`url`,label:i(d.SETTINGS$MCP_URL),value:g.values.url??D.url,onChange:e=>k(`url`,e),isDisabled:!D.urlEditable,className:`w-full`}),g.errors.url&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors.url}),a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]}),e.key in g.savedAsSecret&&(0,M.jsx)(P,{fieldKey:e.key,checked:g.savedAsSecret[e.key]??!1,onToggle:t=>A(e.key,t)})]},e.key)),e?(0,M.jsxs)(`div`,{"data-testid":`mcp-install-oauth-info`,className:`flex flex-col gap-2 p-3 rounded-lg border border-[var(--oh-border)] bg-base-tertiary`,children:[(0,M.jsx)(`p`,{className:`text-sm text-secondary-light`,children:i(d.MCP$OAUTH_CONNECT_INFO)}),(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:i(d.MCP$OAUTH_CONNECT_HINT)})]}):t?(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-api_key`,name:`api_key`,type:`password`,label:T?.auth.credentialLabel??i(d.SETTINGS$MCP_API_KEY),value:g.values.api_key??``,onChange:e=>k(`api_key`,e),placeholder:T?.auth.credentialPlaceholder??i(d.SETTINGS$MCP_API_KEY_PLACEHOLDER),showOptionalTag:n,required:!n,className:`w-full`}),T?.auth.credentialHelp&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(T.auth.credentialHelp)}),g.errors.api_key&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors.api_key}),r&&(0,M.jsx)(P,{fieldKey:r,checked:g.savedAsSecret.api_key??!1,onToggle:e=>A(`api_key`,e)})]}):null]})}if(D?.kind!==`stdio`)return null;let e=D;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{testId:`mcp-install-field-command-readonly`,name:`command-readonly`,type:`text`,label:i(d.MCP$COMMAND_LABEL),value:`${e.command} ${e.args.join(` `)}`.trim(),onChange:()=>{},isDisabled:!0,className:`w-full`}),(e.envFields??[]).map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]}),e.key in g.savedAsSecret&&(0,M.jsx)(P,{fieldKey:e.key,checked:g.savedAsSecret[e.key],onToggle:t=>A(e.key,t)})]},e.key)),(e.argFields??[]).map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]})]},e.key))]})})()}),y&&(0,M.jsx)(`p`,{"data-testid":`mcp-install-modal-error`,className:`text-sm text-red-500 whitespace-pre-wrap`,children:y}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,M.jsx)(ie,{type:`button`,variant:`secondary`,onClick:n,testId:`mcp-install-cancel`,isDisabled:O,children:i(d.BUTTON$CANCEL)}),(0,M.jsx)(ie,{type:`submit`,variant:`primary`,isDisabled:O,testId:`mcp-install-submit`,children:i(p||C?d.MCP$VERIFYING:u||x?d.SETTINGS$SAVING:d.MCP$INSTALL_BUTTON)})]})]})})}export{Ve as a,Re as c,K as d,W as f,We as i,Pe as l,N as m,Je as n,He as o,ce as p,Ge as r,Ue as s,$e as t,Fe as u};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{f as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as i}from"./useMutation-Cszf8mKy.js";import{t as a}from"./useTranslation-CCgUjPJF.js";import{V as o,ct as s,dt as c,n as l,st as u}from"./active-backend-context-BsLfwrXB.js";import{K as d,t as f}from"./utils-D-gOfhmN.js";import{c as p,d as m,n as h}from"./agent-server-client-options-EHB23gyx.js";import{t as ee}from"./bot-ByolqPEr.js";import{m as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{c as _,i as v,l as y,m as b,p as te,r as x,t as S,u as C}from"./settings-service.api-Q9lKW1TX.js";import{n as w}from"./use-settings-BWIH5EuN.js";import{t as ne}from"./modal-backdrop-BSzNhM4r.js";import{n as re}from"./modal-classes-jvG85nkU.js";import{t as ie}from"./brand-button-mQq2Ld1I.js";import{t as T}from"./styled-tooltip-DVAlWYnL.js";import{t as ae}from"./modal-close-button-BrM5fNnn.js";import{t as E}from"./settings-input-Cm4VxUon.js";import{t as D}from"./secrets-service-DU6wh3wX.js";import{t as O}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{c as oe,i as se,s as k,t as A}from"./mcp-marketplace-utils-BwEnDYqm.js";var j=e(t()),M=n(),N=e=>(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,M.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,fill:`currentColor`})});function P({fieldKey:e,checked:t,onToggle:n}){let{t:r}=a(`openhands`);return(0,M.jsxs)(`label`,{"data-testid":`mcp-install-save-secret-${e}`,className:f(`flex items-center gap-2 px-3 py-2 mt-0.5 rounded-lg border cursor-pointer transition-colors`,t?`border-green-500/35 bg-green-500/10`:`border-[var(--oh-border)] bg-transparent hover:bg-white/[0.03]`),children:[(0,M.jsx)(`input`,{className:`sr-only`,id:`mcp-save-secret-checkbox-${e}`,type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),(0,M.jsx)(`span`,{"aria-hidden":`true`,className:f(`relative inline-flex h-[22px] w-[40px] shrink-0 items-center rounded-full border transition-colors duration-200`,t?`border-green-500 bg-green-500`:`border-[var(--oh-border)] bg-surface-raised`),children:(0,M.jsx)(`span`,{className:f(`inline-block size-4 rounded-full transition-transform duration-200`,t?`translate-x-[21px] bg-white`:`translate-x-[2px] bg-[var(--oh-muted)]`)})}),(0,M.jsx)(`span`,{className:`text-sm`,children:r(d.MCP$ALSO_SAVE_AS_SECRET)}),(0,M.jsx)(`code`,{className:f(`ml-auto text-[11px] font-mono tracking-tight border rounded px-1.5 py-0.5`,t?`text-green-500 border-green-500/35 bg-white/[0.04]`:`text-tertiary-alt border-[var(--oh-border)]`),children:e}),(0,M.jsx)(T,{content:r(d.MCP$SAVE_AS_SECRET_TOOLTIP),placement:`top`,children:(0,M.jsx)(`button`,{type:`button`,"aria-label":r(d.MCP$SAVE_AS_SECRET_TOOLTIP),className:`flex items-center justify-center size-[15px] shrink-0 rounded-full border border-[var(--oh-muted)] text-tertiary-alt text-[9px] font-bold cursor-help`,onClick:e=>e.preventDefault(),children:`?`})})]})}var F={xs:`h-4 w-4 rounded [&>svg]:h-2.5 [&>svg]:w-2.5`,sm:`h-5 w-5 rounded-md [&>svg]:h-3 [&>svg]:w-3`,base:`h-7 w-7 rounded-lg [&>svg]:h-3.5 [&>svg]:w-3.5`,md:`h-10 w-10 rounded-lg [&>svg]:h-5 [&>svg]:w-5`},I={slack:N};function ce({entry:e,size:t=`md`,className:n,fallback:r,testId:i}){let a=e?I[e.id]:void 0;return(0,M.jsx)(`span`,{"aria-hidden":`true`,title:e?.name,"data-testid":i,className:f(`inline-flex shrink-0 items-center justify-center overflow-hidden`,`border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,F[t],n),style:{backgroundColor:e?.iconBg??`var(--oh-color-tertiary)`,color:e?.iconColor??`#FFFFFF`},children:a?(0,M.jsx)(a,{}):e?.logoUrl?(0,M.jsx)(`img`,{src:e.logoUrl,alt:`${e.name} logo`,className:`h-full w-full object-contain p-[22%]`,onError:e=>{let t=e.currentTarget;t.style.display=`none`}}):r??(0,M.jsx)(ee,{className:`h-5 w-5`,strokeWidth:2.25})})}var le=new Set([`invalid_auth`,`not_authed`,`account_inactive`,`token_revoked`,`token_expired`]),L=e=>e.is_error?e.text||`tool call failed`:null,ue={github:{toolCall:{name:`get_me`,arguments:{}},interpret:L},linear:{toolCall:{name:`list_teams`,arguments:{}},interpret:L},slack:{toolCall:{name:`slack_list_channels`,arguments:{limit:1}},interpret:e=>{if(e.is_error)return e.text||`tool call failed`;try{let t=JSON.parse(e.text);if(t?.ok===!1&&le.has(t.error))return String(t.error)}catch{}return null}}};function R(e){let t=A(e,k(O));return t?ue[t.id]:void 0}var de=4,fe=/token|key|secret|auth/i,pe=[/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,/\bxox[a-z](?:-[A-Za-z0-9]+)+/g,/\blin_api_[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g],me=/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi;function z(e,t){typeof t==`string`&&(t.length<de||t!==`**********`&&e.add(t))}function B(e,t){for(let n of Object.values(t??{}))z(e,n)}function he(e,t){if(t)try{let n=new URL(t);z(e,n.username),z(e,n.password),z(e,decodeURIComponent(n.username)),z(e,decodeURIComponent(n.password)),n.searchParams.forEach((t,n)=>{fe.test(n)&&z(e,t)})}catch{}}function ge(e,t){if(t)switch(t.strategy){case`api_key`:case`bearer`:z(e,t.value);break;case`basic`:z(e,t.username),z(e,t.password);break;case`header`:B(e,t.headers);break;case`oauth2`:z(e,t.authentication?.client_secret),B(e,t.state?.tokens);break;default:break}}function _e(e){let t=new Set;return B(t,e.env),B(t,e.headers),ge(t,e.auth),he(t,e.url),[...t].sort((e,t)=>t.length-e.length)}function V(e,...t){if(!e)return e;let n=e;for(let e of t)if(e)for(let t of _e(e))n=n.split(t).join(x);n=n.replace(me,`Bearer ${x}`);for(let e of pe)n=n.replace(e,x);return n}var H=e=>!!e&&typeof e==`object`&&!Array.isArray(e),ve=e=>{if(!H(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0},ye=e=>!!e&&Object.values(e).some(e=>e===`**********`);function be(e,t){if(!H(e))return e;let n=H(t)?t:{},r={...e};for(let[t,i]of Object.entries(e))if(i===`**********`){let e=n[t];typeof e==`string`&&e!==`**********`&&(r[t]=e)}else H(i)&&(r[t]=be(i,n[t]));return r}var xe=(e,t)=>t[e.id];async function Se(e){let t=(await S.fetchSettingsFromApi(`encrypted`)).agent_settings?.mcp_config;if(H(t))return xe(e,t)}async function Ce(e){let t=e.type===`stdio`&&ye(e.env),n=(e.type===`sse`||e.type===`shttp`)&&_(e.auth),r=(e.type===`sse`||e.type===`shttp`)&&ye(e.headers);if(!t&&!n&&!r)return e;try{let i=await Se(e);if(!i)return e;if(t){let t=ve(i.env)??{},n=Object.fromEntries(Object.entries(e.env??{}).map(([e,n])=>[e,n===`**********`&&typeof t[e]==`string`?t[e]:n]));return{...e,env:n}}let a={...e};if(n&&b(i.auth)&&(a.auth=be(e.auth,i.auth)),r){let t=ve(i.headers)??{};a.headers=Object.fromEntries(Object.entries(e.headers??{}).map(([e,n])=>[e,n===`**********`&&typeof t[e]==`string`?t[e]:n]))}return a}catch{return e}}var we=120;function Te(e){return e.type===`stdio`?{type:`stdio`,command:e.command,...e.args?.length&&{args:e.args},...e.env&&Object.keys(e.env).length>0&&{env:e.env}}:{type:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0&&{headers:e.headers},...e.auth?{auth:e.auth}:{}}}function Ee(e){return e.auth?.strategy===`oauth2`?we:e.timeout}async function De(e){let t=R(e),n=await Ce(e),r=Te(n),i=Ee(e);return{request:{server:r,...e.name?{name:e.name}:{},...i===void 0?{}:{timeout:i},...t?{tool_call:t.toolCall}:{}},substituted:n}}function Oe(e,t){return e.ok?e.tool_result?{...e,tool_result:{...e.tool_result,text:V(e.tool_result.text,...t)}}:e:{...e,error:V(e.error,...t)}}function ke(e,t,n){let r=Oe(e,n);if(r.ok&&t&&r.tool_result&&r.tools.includes(t.toolCall.name)){let e=t.interpret(r.tool_result);if(e)return{ok:!1,error:e,error_kind:`credentials`}}return r}function Ae(){if(p().backend.kind===`local`){let{host:e,apiKey:t}=h();return{host:e,...t?{apiKey:t}:{}}}let e=m().find(e=>e.kind===`local`&&e.host);if(e)return{host:e.host.replace(/\/+$/,``),...e.apiKey?{apiKey:e.apiKey}:{}};throw Error(`OAuth authorization requires a reachable local backend.`)}function U(){let{host:e,apiKey:t}=Ae();return new g({host:e,...t?{apiKey:t}:{},timeout:125e3})}function je(e){return e.status===`succeeded`?{ok:!0,tools:e.tools??[],...e.tool_result!==void 0&&{tool_result:e.tool_result},...e.oauth_state!==void 0&&{oauth_state:e.oauth_state}}:{ok:!1,error:e.error||`OAuth authorization did not complete`,error_kind:e.error_kind||`unknown`}}var Me=e=>new Promise(t=>{window.setTimeout(t,e)}),W=class e{static async testServer(e){if(p().backend.kind===`cloud`)return{ok:!0,tools:[]};let t=R(e),{host:n,apiKey:r}=h(),i=new g({host:n,...r?{apiKey:r}:{}});try{let{request:n,substituted:r}=await De(e);return ke(await i.testServer(n),t,[r,e])}finally{i.close()}}static async startOAuth(t){let n=U();try{return await e.startOAuthWithClient(n,t)}finally{n.close()}}static async getOAuthStatus(t){let n=U();try{return await e.getOAuthStatusWithClient(n,t)}finally{n.close()}}static async submitOAuthCallback(t,n){let r=U();try{return await e.submitOAuthCallbackWithClient(r,t,n)}finally{r.close()}}static async authorizeOAuth(t){let n=R(t),r=e=>ke(e,n,[t]),i=window.open(`about:blank`,`_blank`),a=U();try{let n=await e.startOAuthWithClient(a,t);if(!n.ok||!n.job_id||!n.authorization_url)return i?.close(),r({ok:!1,error:n.error||`Could not start OAuth authorization`,error_kind:n.error_kind||`unknown`});let o=await e.getOAuthStatusWithClient(a,n.job_id);for(let t=0;t<20;t+=1){if(o.status===`succeeded`||o.status===`failed`)return i?.close(),r(je(o));if(o.callback_ready)break;await Me(250),o=await e.getOAuthStatusWithClient(a,n.job_id)}i&&(i.location.href=n.authorization_url);for(let t=0;t<we;t+=1)if(await Me(1e3),o=await e.getOAuthStatusWithClient(a,n.job_id),o.status===`succeeded`||o.status===`failed`)return i?.close(),r(je(o));return{ok:!1,error:`OAuth authorization timed out`,error_kind:`timeout`}}finally{a.close()}}static async startOAuthWithClient(e,t){let{request:n}=await De(t);return e.startOAuth(n)}static async getOAuthStatusWithClient(e,t){return await e.getOAuthStatus(t)}static async submitOAuthCallbackWithClient(e,t,n){return await e.submitOAuthCallback(t,{callback_url:n})}},G=e=>Object.keys(e??{}).sort();function K(e){return e.type===`stdio`?JSON.stringify({type:e.type,name:e.name??``,command:e.command??``,args:e.args??[],envKeys:G(e.env)}):JSON.stringify({type:e.type,name:e.name??``,url:e.url??``,headerKeys:G(e.headers),authStrategy:e.auth?.strategy??``,authHeaderName:e.auth?.strategy===`api_key`?e.auth.header_name??``:``,authHeaderKeys:e.auth?.strategy===`header`?G(e.auth.headers):[]})}var q={},J=new Set,Ne=1;function Y(e){q=e,J.forEach(e=>e())}function Pe(){return q}function Fe(e){return J.add(e),()=>{J.delete(e)}}function Ie(e){let t=Ne;return Ne+=1,Y({...q,[e]:{status:`checking`,checkId:t}}),t}function X(e,t,n){let r=q[e];r?.status!==`checking`||r.checkId!==t||Y({...q,[e]:n})}function Le(e,t){Y({...q,[e]:t})}function Re(e){if(!(e in q))return;let{[e]:t,...n}=q;Y(n)}var ze=/\b(401|403)\b|unauthorized|forbidden|invalid[ _-]?(token|credentials?|api[ _-]?key)/i;function Be(e,t){return{status:`failed`,kind:`unknown`,error:V(t instanceof Error?t.message:String(t),e),checkedAt:Date.now()}}function Z(e,t){let n=Date.now();if(!t.ok)return{status:`failed`,kind:(t.error_kind===`connection`||t.error_kind===`unknown`)&&ze.test(t.error)?`credentials`:t.error_kind,error:t.error,checkedAt:n};let r=R(e);return{status:`healthy`,verification:r&&t.tools.includes(r.toolCall.name)&&t.tool_result&&!t.tool_result.is_error?`verified`:`connectivity-only`,toolCount:t.tools.length,checkedAt:n}}async function Ve(e){let t=K(e),n=Ie(t),r;try{r=Z(e,await W.testServer(e))}catch(t){r=Be(e,t)}X(t,n,r)}async function He(e){let t=K(e),n=Ie(t);try{let r=await W.authorizeOAuth(e);return X(t,n,Z(e,r)),r}catch(r){return X(t,n,Be(e,r)),null}}function Ue(e,t,n){let r=K(e);n.some(e=>K(e)===r)||Le(r,Z(e,t))}function We(){let e=r(),{data:t}=w();return i({mutationFn:async e=>{if(!t)throw Error(`MCP settings are still loading. Please try again.`);let n=v(t.mcp_config??y(t.agent_settings?.mcp_config),e.name,e.type);await S.createMcpServer(n,C(e))},onSuccess:()=>{e.invalidateQueries({queryKey:o.personal()})}})}function Ge(){return i({mutationFn:e=>W.testServer(e)})}function Ke(e){return e.length<=3?e.join(`, `):`${e.slice(0,3).join(`, `)} … (+${e.length-3})`}function qe(){let{t:e}=a(`openhands`),t=r();return(0,j.useCallback)((n,r,i)=>{let a=n.filter(e=>i[e.key]&&(r[e.key]??``).trim());return a.length===0?Promise.resolve():Promise.allSettled(a.map(e=>D.createSecret(e.key,r[e.key].trim(),e.label))).then(n=>{let r=a.filter((e,t)=>n[t].status===`fulfilled`).map(e=>e.key),i=a.filter((e,t)=>n[t].status===`rejected`).map(e=>e.key);r.length>0&&(t.invalidateQueries({queryKey:[`secrets-search`]}),t.invalidateQueries({queryKey:[`secrets`]}),s(e(d.MCP$SECRETS_SAVED,{keys:Ke(r)}))),i.length>0&&u(e(d.MCP$SECRETS_SAVE_FAILED,{keys:Ke(i)}))})},[e,t])}function Je(e,t,n){switch(t){case`timeout`:return e(d.MCP$TEST_ERROR_TIMEOUT);case`connection`:return e(d.MCP$TEST_ERROR_CONNECTION);case`credentials`:return e(d.MCP$TEST_ERROR_CREDENTIALS,{error:n});default:return e(d.MCP$TEST_ERROR_UNKNOWN,{error:n})}}function Q(e){let t=/\[([^\]]+)\]\(([^)]+)\)/g,n=[],r=0;for(let i of e.matchAll(t))i.index>r&&n.push(e.slice(r,i.index)),n.push((0,M.jsx)(`a`,{href:/^https?:\/\//i.test(i[2])?i[2]:`#`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-white transition-colors`,children:i[1]},i.index)),r=i.index+i[0].length;return r<e.length&&n.push(e.slice(r)),n}function Ye(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?!1:[`api_key`,`bearer`].includes(e.auth.strategy)}function Xe(e){return!!e&&e.auth.strategy===`oauth2`}function Ze(e){return e.transport.kind===`stdio`?e.auth.apiKeyOptional??!1:e.auth.apiKeyOptional??e.transport.apiKeyOptional??!1}function $(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?[]:e.transport.headerFields??[]}function Qe(e){let t={},n={},r=se(e),i=r?.transport;if(i?.kind===`stdio`){for(let e of i.envFields??[])t[e.key]=``,n[e.key]=e.type===`password`;for(let e of i.argFields??[])t[e.key]=``}else if(i?.kind===`shttp`||i?.kind===`sse`){t.url=i.url;for(let e of $(r))t[e.key]=``,n[e.key]=e.type===`password`;Ye(r)&&(t.api_key=``,r?.auth.credentialSecretName&&(n.api_key=r.auth.saveCredentialAsSecretByDefault??!1))}return{values:t,errors:{},savedAsSecret:n}}function $e({entry:e,existingServers:t,onClose:n,onSuccess:r}){let{t:i}=a(`openhands`),{mutate:o,isPending:u}=We(),{mutate:f,isPending:p}=Ge(),m=qe(),{backend:h}=l(),ee=h.kind===`cloud`,[g,_]=j.useState(()=>Qe(e)),v=j.useRef(g);v.current=g;let[y,b]=j.useState(null),[x,S]=j.useState(!1),[C,w]=j.useState(!1),T=se(e),D=T?.transport,O=p||C||u||x,k=(e,t)=>{_(n=>({...n,values:{...n.values,[e]:t},errors:{...n.errors,[e]:null}})),b(null)},A=(e,t)=>{_(n=>({...n,savedAsSecret:{...n.savedAsSecret,[e]:t}}))},N=()=>{let e=T?.auth.credentialSecretName,t=v.current.values.api_key?.trim();return!e||!t||!v.current.savedAsSecret.api_key?Promise.resolve():m([{key:e,label:T.auth.credentialLabel??e,type:`password`,required:!0}],{[e]:t},{[e]:!0})},F=()=>D?.kind===`stdio`?m(D.envFields??[],v.current.values,v.current.savedAsSecret):D?.kind===`shttp`||D?.kind===`sse`?Promise.all([N(),m($(T),v.current.values,v.current.savedAsSecret)]).then(()=>void 0):Promise.resolve(),I=a=>{if(a.auth?.strategy===`oauth2`){w(!0),W.authorizeOAuth(a).then(l=>{if(!l.ok){b(Je(i,l.error_kind,l.error));return}let u=l.oauth_state?{...a,auth:{...a.auth,state:l.oauth_state}}:a;o(u,{onSuccess:()=>{ee||Ue(u,l,t),s(i(d.MCP$INSTALL_SUCCESS)),S(!0),(async()=>{try{await F()}finally{r?.(e),n()}})()},onError:e=>{b(c(e)||i(d.ERROR$GENERIC))}})}).catch(e=>{b(c(e)||i(d.ERROR$GENERIC))}).finally(()=>w(!1));return}f(a,{onSuccess:l=>{if(!l.ok){b(Je(i,l.error_kind,l.error));return}let u=l.oauth_state&&a.auth?.strategy===`oauth2`?{...a,auth:{...a.auth,state:l.oauth_state}}:a;o(u,{onSuccess:()=>{ee||Ue(u,l,t),s(i(d.MCP$INSTALL_SUCCESS)),S(!0),(async()=>{try{await F()}finally{r?.(e),n()}})()},onError:e=>{b(c(e)||i(d.ERROR$GENERIC))}})},onError:e=>{b(c(e)||i(d.ERROR$GENERIC))}})},le=()=>{if(D?.kind!==`shttp`&&D?.kind!==`sse`||!T)return;let t=g.values.api_key?.trim()??``,n=D.urlEditable?g.values.url?.trim()??``:D.url,r=Xe(T),a=Ye(T),o=$(T),s={};if(!n)s.url=i(d.SETTINGS$MCP_ERROR_URL_REQUIRED);else try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s.url=i(d.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL))}catch{s.url=i(d.SETTINGS$MCP_ERROR_URL_INVALID)}for(let e of o)e.required&&!(g.values[e.key]??``).trim()&&(s[e.key]=i(d.MCP$ERROR_FIELD_REQUIRED));if(!r&&a&&!Ze(T)&&!t&&(s.api_key=i(d.MCP$ERROR_FIELD_REQUIRED)),Object.values(s).some(Boolean)){_(e=>({...e,errors:s}));return}let c=r?oe(T):void 0,l=Object.fromEntries(o.map(e=>[e.key,g.values[e.key]?.trim()??``]).filter(([,e])=>e)),u=Object.keys(l).length>0,f;r?f={strategy:`oauth2`,...c&&{authentication:c}}:a&&t?f=T.auth.strategy===`api_key`?{strategy:`api_key`,value:t,...T.auth.apiKeyHeaderName&&{header_name:T.auth.apiKeyHeaderName}}:{strategy:`bearer`,value:t}:u&&(f={strategy:`header`,headers:l}),I({id:``,type:D.kind,name:te(e.id),url:n,...f&&{auth:f},...u&&f?.strategy!==`header`&&{headers:l}})},L=()=>{if(D?.kind!==`stdio`)return;let e=D,t={};for(let n of e.envFields??[])n.required&&!(g.values[n.key]??``).trim()&&(t[n.key]=i(d.MCP$ERROR_FIELD_REQUIRED));for(let n of e.argFields??[])n.required&&!(g.values[n.key]??``).trim()&&(t[n.key]=i(d.MCP$ERROR_FIELD_REQUIRED));if(Object.values(t).some(Boolean)){_(e=>({...e,errors:t}));return}let n={};for(let t of e.envFields??[]){let e=g.values[t.key]?.trim();e&&(n[t.key]=e)}let r=[];for(let t of e.argFields??[]){let e=g.values[t.key]?.trim();if(e)for(let t of e.split(/\s+/))t&&r.push(t)}I({id:``,type:`stdio`,name:e.serverName,command:e.command,args:[...e.args,...r],...Object.keys(n).length>0&&{env:n}})};return(0,M.jsx)(ne,{onClose:n,"aria-label":e.name,children:(0,M.jsxs)(`form`,{"data-testid":`mcp-install-modal`,"data-marketplace-id":e.id,onSubmit:e=>(e.preventDefault(),b(null),D?.kind===`shttp`||D?.kind===`sse`?le():L()),className:`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar`,children:[(0,M.jsx)(ae,{onClose:n,testId:`mcp-install-modal-close`,disabled:O}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,M.jsx)(ce,{entry:e}),(0,M.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,M.jsx)(`h2`,{className:re,children:e.name}),(0,M.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.description})]})]}),e.installHint&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.installHint}),e.docsUrl&&(0,M.jsx)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-xs text-[var(--oh-muted)] hover:text-white hover:underline self-start transition-colors`,children:i(d.MCP$VIEW_DOCS)}),(0,M.jsx)(`div`,{className:`flex flex-col gap-3`,children:(()=>{if(D?.kind===`shttp`||D?.kind===`sse`){let e=Xe(T),t=Ye(T),n=T?Ze(T):!1,r=T?.auth.credentialSecretName,a=$(T);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{testId:`mcp-install-field-url`,name:`url`,type:`url`,label:i(d.SETTINGS$MCP_URL),value:g.values.url??D.url,onChange:e=>k(`url`,e),isDisabled:!D.urlEditable,className:`w-full`}),g.errors.url&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors.url}),a.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]}),e.key in g.savedAsSecret&&(0,M.jsx)(P,{fieldKey:e.key,checked:g.savedAsSecret[e.key]??!1,onToggle:t=>A(e.key,t)})]},e.key)),e?(0,M.jsxs)(`div`,{"data-testid":`mcp-install-oauth-info`,className:`flex flex-col gap-2 p-3 rounded-lg border border-[var(--oh-border)] bg-base-tertiary`,children:[(0,M.jsx)(`p`,{className:`text-sm text-secondary-light`,children:i(d.MCP$OAUTH_CONNECT_INFO)}),(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:i(d.MCP$OAUTH_CONNECT_HINT)})]}):t?(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-api_key`,name:`api_key`,type:`password`,label:T?.auth.credentialLabel??i(d.SETTINGS$MCP_API_KEY),value:g.values.api_key??``,onChange:e=>k(`api_key`,e),placeholder:T?.auth.credentialPlaceholder??i(d.SETTINGS$MCP_API_KEY_PLACEHOLDER),showOptionalTag:n,required:!n,className:`w-full`}),T?.auth.credentialHelp&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(T.auth.credentialHelp)}),g.errors.api_key&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors.api_key}),r&&(0,M.jsx)(P,{fieldKey:r,checked:g.savedAsSecret.api_key??!1,onToggle:e=>A(`api_key`,e)})]}):null]})}if(D?.kind!==`stdio`)return null;let e=D;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(E,{testId:`mcp-install-field-command-readonly`,name:`command-readonly`,type:`text`,label:i(d.MCP$COMMAND_LABEL),value:`${e.command} ${e.args.join(` `)}`.trim(),onChange:()=>{},isDisabled:!0,className:`w-full`}),(e.envFields??[]).map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]}),e.key in g.savedAsSecret&&(0,M.jsx)(P,{fieldKey:e.key,checked:g.savedAsSecret[e.key],onToggle:t=>A(e.key,t)})]},e.key)),(e.argFields??[]).map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(E,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]})]},e.key))]})})()}),y&&(0,M.jsx)(`p`,{"data-testid":`mcp-install-modal-error`,className:`text-sm text-red-500 whitespace-pre-wrap`,children:y}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,M.jsx)(ie,{type:`button`,variant:`secondary`,onClick:n,testId:`mcp-install-cancel`,isDisabled:O,children:i(d.BUTTON$CANCEL)}),(0,M.jsx)(ie,{type:`submit`,variant:`primary`,isDisabled:O,testId:`mcp-install-submit`,children:i(p||C?d.MCP$VERIFYING:u||x?d.SETTINGS$SAVING:d.MCP$INSTALL_BUTTON)})]})]})})}export{Ve as a,Re as c,K as d,W as f,We as i,Pe as l,N as m,Je as n,He as o,ce as p,Ge as r,Ue as s,$e as t,Fe as u};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./useQuery-DAAacS7O.js";import{A as i}from"./active-backend-context-BnH4-L8h.js";var a=n(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),o=`https://registry.npmjs.org/@openhands/agent-canvas/latest`,s=`https://github.com/OpenHands/OpenHands/releases`,c={npm:`npm install -g @openhands/agent-canvas@latest`,docker:`docker pull ghcr.io/openhands/agent-canvas:latest`};async function l(e){let t=await fetch(o,{signal:e,headers:{Accept:`application/json`}});if(!t.ok)throw Error(`npm registry responded ${t.status}`);let n=(await t.json())?.version;if(typeof n!=`string`||!n.trim())throw Error(`npm registry response missing version`);return n.trim()}function u({enabled:e=!0}={}){return r({queryKey:i.latestVersion,queryFn:({signal:e})=>l(e),enabled:e,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*60,meta:{disableToast:!0}})}e();var d=t(),f=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`,{fill:`currentColor`,d:`M21.81 10.25c-.06-.04-.56-.43-1.64-.43c-.28 0-.56.03-.84.08c-.21-1.4-1.38-2.11-1.43-2.14l-.29-.17l-.18.27c-.24.36-.43.77-.51 1.19c-.2.8-.08 1.56.33 2.21c-.49.28-1.29.35-1.46.35H2.62c-.34 0-.62.28-.62.63c0 1.15.18 2.3.58 3.38c.45 1.19 1.13 2.07 2 2.61c.98.6 2.59.94 4.42.94c.79 0 1.61-.07 2.42-.22c1.12-.2 2.2-.59 3.19-1.16A8.3 8.3 0 0 0 16.78 16c1.05-1.17 1.67-2.5 2.12-3.65h.19c1.14 0 1.85-.46 2.24-.85c.26-.24.45-.53.59-.87l.08-.24zm-17.96.99h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H3.85c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.43 0h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H6.28c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.47 0h1.75c.1 0 .17-.07.17-.16V9.5c0-.08-.06-.16-.17-.16H8.75c-.08 0-.15.07-.15.16v1.58c0 .09.06.16.15.16m2.44 0h1.77c.08 0 .15-.07.15-.16V9.5c0-.08-.06-.16-.15-.16h-1.77c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16M6.28 9h1.76c.08 0 .16-.09.16-.18V7.25c0-.09-.07-.16-.16-.16H6.28c-.09 0-.16.06-.16.16v1.57c.01.09.07.18.16.18m2.47 0h1.75c.1 0 .17-.09.17-.18V7.25c0-.09-.06-.16-.17-.16H8.75c-.08 0-.15.06-.15.16v1.57c0 .09.06.18.15.18m2.44 0h1.77c.08 0 .15-.09.15-.18V7.25c0-.09-.07-.16-.15-.16h-1.77c-.08 0-.15.06-.15.16v1.57c0 .09.07.18.15.18m0-2.28h1.77c.08 0 .15-.07.15-.16V5c0-.1-.07-.17-.15-.17h-1.77c-.08 0-.15.06-.15.17v1.56c0 .08.07.16.15.16m2.46 4.52h1.76c.09 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16h-1.76c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16`})}),p=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`,{fill:`currentColor`,d:`M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z`})}),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`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.0265 1.63647C18.2362 1.88301 19.3557 2.45458 20.2649 3.28974C21.1741 4.12489 21.8384 5.19205 22.1865 6.37647C22.509 7.46247 22.557 8.61147 22.326 9.72147C21.9921 11.2422 21.1518 12.6046 19.9428 13.5856C18.7337 14.5666 17.2274 15.1081 15.6705 15.1215C15.0135 15.1215 14.3595 15.027 13.731 14.8365L12.531 16.2435L11.9625 16.506H10.5V18.756L9.75 19.506H7.5V21.756L6.75 22.506H2.25L1.5 21.756V18.2955L1.719 17.766L9.18 10.305C8.96826 9.62297 8.86698 8.91148 8.88 8.19747C8.89367 7.19853 9.12754 6.2149 9.56495 5.3167C10.0024 4.4185 10.6325 3.62786 11.4105 3.00113C12.1885 2.3744 13.0952 1.92702 14.0659 1.69088C15.0367 1.45473 16.0475 1.43565 17.0265 1.63497V1.63647ZM19.0035 12.4365C19.9458 11.6734 20.6011 10.6131 20.862 9.42897L20.868 9.43647C21.0538 8.57068 21.0204 7.67216 20.7707 6.82258C20.521 5.97299 20.063 5.19926 19.4383 4.57169C18.8135 3.94412 18.0419 3.4826 17.1934 3.22908C16.345 2.97555 15.4466 2.93804 14.58 3.11997C13.4112 3.3794 12.3627 4.0224 11.6016 4.94661C10.8405 5.87082 10.4105 7.02309 10.38 8.21997C10.365 8.90397 10.485 9.58197 10.7385 10.215L10.5735 11.0295L3 18.606V21.006H6V18.756L6.75 18.006H9V15.756L9.75 15.006H11.6175L12.9315 13.482L13.773 13.272C14.3796 13.509 15.0253 13.6301 15.6765 13.629C16.8885 13.6197 18.0615 13.1992 19.0035 12.4365ZM17.7465 8.33847C17.8648 8.17505 17.9489 7.98945 17.9937 7.79277C18.0386 7.59609 18.0434 7.39239 18.0077 7.19384C17.972 6.99528 17.8967 6.80597 17.7861 6.63721C17.6756 6.46845 17.5322 6.32373 17.3644 6.21169C17.1967 6.09965 17.008 6.0226 16.8098 5.98514C16.6116 5.94769 16.4078 5.95061 16.2108 5.99372C16.0137 6.03683 15.8273 6.11925 15.6629 6.23605C15.4984 6.35285 15.3592 6.50162 15.2535 6.67347C15.0503 7.00406 14.983 7.40054 15.066 7.77963C15.1489 8.15872 15.3755 8.49093 15.6982 8.70645C16.0209 8.92198 16.4146 9.00405 16.7966 8.93543C17.1785 8.86682 17.519 8.65285 17.7465 8.33847Z`,fill:`currentColor`})});export{s as a,u as i,p as n,c as o,f as r,a as s,m as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{i as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as r}from"./useQuery-DAAacS7O.js";import{A as i}from"./active-backend-context-BsLfwrXB.js";var a=n(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),o=`https://registry.npmjs.org/@openhands/agent-canvas/latest`,s=`https://github.com/OpenHands/OpenHands/releases`,c={npm:`npm install -g @openhands/agent-canvas@latest`,docker:`docker pull ghcr.io/openhands/agent-canvas:latest`};async function l(e){let t=await fetch(o,{signal:e,headers:{Accept:`application/json`}});if(!t.ok)throw Error(`npm registry responded ${t.status}`);let n=(await t.json())?.version;if(typeof n!=`string`||!n.trim())throw Error(`npm registry response missing version`);return n.trim()}function u({enabled:e=!0}={}){return r({queryKey:i.latestVersion,queryFn:({signal:e})=>l(e),enabled:e,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*60,meta:{disableToast:!0}})}e();var d=t(),f=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`,{fill:`currentColor`,d:`M21.81 10.25c-.06-.04-.56-.43-1.64-.43c-.28 0-.56.03-.84.08c-.21-1.4-1.38-2.11-1.43-2.14l-.29-.17l-.18.27c-.24.36-.43.77-.51 1.19c-.2.8-.08 1.56.33 2.21c-.49.28-1.29.35-1.46.35H2.62c-.34 0-.62.28-.62.63c0 1.15.18 2.3.58 3.38c.45 1.19 1.13 2.07 2 2.61c.98.6 2.59.94 4.42.94c.79 0 1.61-.07 2.42-.22c1.12-.2 2.2-.59 3.19-1.16A8.3 8.3 0 0 0 16.78 16c1.05-1.17 1.67-2.5 2.12-3.65h.19c1.14 0 1.85-.46 2.24-.85c.26-.24.45-.53.59-.87l.08-.24zm-17.96.99h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H3.85c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.43 0h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H6.28c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.47 0h1.75c.1 0 .17-.07.17-.16V9.5c0-.08-.06-.16-.17-.16H8.75c-.08 0-.15.07-.15.16v1.58c0 .09.06.16.15.16m2.44 0h1.77c.08 0 .15-.07.15-.16V9.5c0-.08-.06-.16-.15-.16h-1.77c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16M6.28 9h1.76c.08 0 .16-.09.16-.18V7.25c0-.09-.07-.16-.16-.16H6.28c-.09 0-.16.06-.16.16v1.57c.01.09.07.18.16.18m2.47 0h1.75c.1 0 .17-.09.17-.18V7.25c0-.09-.06-.16-.17-.16H8.75c-.08 0-.15.06-.15.16v1.57c0 .09.06.18.15.18m2.44 0h1.77c.08 0 .15-.09.15-.18V7.25c0-.09-.07-.16-.15-.16h-1.77c-.08 0-.15.06-.15.16v1.57c0 .09.07.18.15.18m0-2.28h1.77c.08 0 .15-.07.15-.16V5c0-.1-.07-.17-.15-.17h-1.77c-.08 0-.15.06-.15.17v1.56c0 .08.07.16.15.16m2.46 4.52h1.76c.09 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16h-1.76c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16`})}),p=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`,{fill:`currentColor`,d:`M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z`})}),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`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.0265 1.63647C18.2362 1.88301 19.3557 2.45458 20.2649 3.28974C21.1741 4.12489 21.8384 5.19205 22.1865 6.37647C22.509 7.46247 22.557 8.61147 22.326 9.72147C21.9921 11.2422 21.1518 12.6046 19.9428 13.5856C18.7337 14.5666 17.2274 15.1081 15.6705 15.1215C15.0135 15.1215 14.3595 15.027 13.731 14.8365L12.531 16.2435L11.9625 16.506H10.5V18.756L9.75 19.506H7.5V21.756L6.75 22.506H2.25L1.5 21.756V18.2955L1.719 17.766L9.18 10.305C8.96826 9.62297 8.86698 8.91148 8.88 8.19747C8.89367 7.19853 9.12754 6.2149 9.56495 5.3167C10.0024 4.4185 10.6325 3.62786 11.4105 3.00113C12.1885 2.3744 13.0952 1.92702 14.0659 1.69088C15.0367 1.45473 16.0475 1.43565 17.0265 1.63497V1.63647ZM19.0035 12.4365C19.9458 11.6734 20.6011 10.6131 20.862 9.42897L20.868 9.43647C21.0538 8.57068 21.0204 7.67216 20.7707 6.82258C20.521 5.97299 20.063 5.19926 19.4383 4.57169C18.8135 3.94412 18.0419 3.4826 17.1934 3.22908C16.345 2.97555 15.4466 2.93804 14.58 3.11997C13.4112 3.3794 12.3627 4.0224 11.6016 4.94661C10.8405 5.87082 10.4105 7.02309 10.38 8.21997C10.365 8.90397 10.485 9.58197 10.7385 10.215L10.5735 11.0295L3 18.606V21.006H6V18.756L6.75 18.006H9V15.756L9.75 15.006H11.6175L12.9315 13.482L13.773 13.272C14.3796 13.509 15.0253 13.6301 15.6765 13.629C16.8885 13.6197 18.0615 13.1992 19.0035 12.4365ZM17.7465 8.33847C17.8648 8.17505 17.9489 7.98945 17.9937 7.79277C18.0386 7.59609 18.0434 7.39239 18.0077 7.19384C17.972 6.99528 17.8967 6.80597 17.7861 6.63721C17.6756 6.46845 17.5322 6.32373 17.3644 6.21169C17.1967 6.09965 17.008 6.0226 16.8098 5.98514C16.6116 5.94769 16.4078 5.95061 16.2108 5.99372C16.0137 6.03683 15.8273 6.11925 15.6629 6.23605C15.4984 6.35285 15.3592 6.50162 15.2535 6.67347C15.0503 7.00406 14.983 7.40054 15.066 7.77963C15.1489 8.15872 15.3755 8.49093 15.6982 8.70645C16.0209 8.92198 16.4146 9.00405 16.7966 8.93543C17.1785 8.86682 17.519 8.65285 17.7465 8.33847Z`,fill:`currentColor`})});export{s as a,u as i,p as n,c as o,f as r,a as s,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{H as r,R as i,U as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-BgLSZdyy.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{r as u,t as d}from"./modal-body-C24WsdFb.js";import{t as f}from"./brand-button-CUMfjb99.js";import{t as p}from"./modal-close-button-DfqfB2Nj.js";import{t as m}from"./settings-input-dVuzapBA.js";import{n as h}from"./use-create-conversation-i_PdFdIs.js";import{r as g}from"./typography-DgcLGdHk.js";import{n as _,t as v}from"./vendor~launch-CHwEQG6e.js";var y=e(t(),1),b=n();function x({pluginIndex:e,paramKey:t,paramValue:n,onParameterChange:r}){let i=`plugin-${e}-param-${t}`;return typeof n==`boolean`?(0,b.jsxs)(`label`,{htmlFor:i,className:`flex w-full cursor-pointer items-center gap-2.5`,children:[(0,b.jsx)(`input`,{id:i,"data-testid":i,type:`checkbox`,checked:n,onChange:n=>r(e,t,n.target.checked),className:`h-4 w-4 shrink-0 rounded`}),(0,b.jsx)(`span`,{className:`text-sm`,children:t})]}):typeof n==`number`?(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`number`,label:t,value:String(n),className:`w-full`,onChange:n=>r(e,t,n===``?0:parseFloat(n)||0)}):(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`text`,label:t,value:String(n??``),className:`w-full`,onChange:n=>r(e,t,n)})}function S({plugin:e,originalIndex:t,isExpanded:n,onToggle:r,getPluginDisplayName:i,onParameterChange:a}){let{t:c}=o(`openhands`);return e.parameters&&Object.keys(e.parameters).length>0?(0,b.jsxs)(`div`,{className:`rounded-lg border border-[var(--oh-border)] bg-tertiary`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer`,"data-testid":`plugin-section-${t}`,children:[(0,b.jsx)(g.Text,{className:`text-base font-normal`,children:i(e)}),n?(0,b.jsx)(v,{className:`h-5 w-5 text-white`}):(0,b.jsx)(_,{className:`h-5 w-5 text-white`})]}),n&&(0,b.jsxs)(`div`,{className:`border-t border-[var(--oh-border-subtle)] px-4 pb-3`,children:[e.ref&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(s.LAUNCH$PLUGIN_REF),` `,e.ref]}),e.repo_path&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(s.LAUNCH$PLUGIN_PATH),` `,e.repo_path]}),(0,b.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(e.parameters||{}).map(([e,n])=>(0,b.jsx)(x,{pluginIndex:t,paramKey:e,paramValue:n,onParameterChange:a},e))})]})]}):null}function C({plugins:e,message:t,isLoading:n=!1,onStartConversation:r,onClose:i}){let{t:a}=o(`openhands`),[m,h]=y.useState(e),[_,v]=y.useState(()=>{let t={};return e.forEach((e,n)=>{e.parameters&&Object.keys(e.parameters).length>0&&(t[n]=!0)}),t}),[x,C]=y.useState(!1),w=m.filter(e=>e.parameters&&Object.keys(e.parameters).length>0),T=m.filter(e=>!e.parameters||Object.keys(e.parameters).length===0),E=e=>{v(t=>({...t,[e]:!t[e]}))},D=(e,t,n)=>{h(r=>{let i=[...r],a={...i[e]};return a.parameters={...a.parameters,[t]:n},i[e]=a,i})},O=e=>{let{source:t,repo_path:n}=e;if(n){let e=n.split(`/`);return e[e.length-1]}if(t.startsWith(`github:`))return t.replace(`github:`,``);if(t.includes(`/`)){let e=t.split(`/`);return e[e.length-1].replace(`.git`,``)}return t},k=e=>{let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`github.com/`)&&t.split(`github.com/`)[1]?.replace(`.git`,``)||t},A=()=>{let e=m.map(e=>k(e));return[...new Set(e)]},j=()=>{r(m,t)},M=m.length===1?O(m[0]):a(s.LAUNCH$MODAL_TITLE_GENERIC);return(0,b.jsx)(l,{onClose:i,children:(0,b.jsxs)(`div`,{"data-testid":`plugin-launch-modal`,className:c(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]`,u(`md`),d),children:[(0,b.jsx)(p,{onClose:i,testId:`close-button`}),(0,b.jsxs)(g.H2,{className:`pr-6`,children:[a(s.LAUNCH$MODAL_TITLE),` `,M]}),t&&(0,b.jsx)(`p`,{className:`text-sm text-white`,children:t}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:[w.length>0&&(0,b.jsx)(`div`,{className:`space-y-3`,children:m.map((e,t)=>(0,b.jsx)(S,{plugin:e,originalIndex:t,isExpanded:!!_[t],onToggle:()=>E(t),getPluginDisplayName:O,onParameterChange:D},`plugin-${t}`))}),T.length>0&&(0,b.jsxs)(`div`,{className:c(w.length>0&&`mt-4`),children:[(0,b.jsx)(g.H3,{className:`mb-2 text-white`,children:w.length>0?a(s.LAUNCH$ADDITIONAL_PLUGINS):a(s.LAUNCH$PLUGINS)}),(0,b.jsx)(`div`,{className:`space-y-2`,children:T.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-md bg-tertiary px-3 py-2 text-sm`,children:[(0,b.jsx)(`div`,{className:`font-medium`,children:O(e)}),(0,b.jsxs)(`div`,{className:`text-xs text-white mt-1`,children:[k(e),e.repo_path&&(0,b.jsxs)(`span`,{className:`ml-1`,children:[`/ `,e.repo_path]}),e.ref&&(0,b.jsxs)(`span`,{className:`ml-2`,children:[`@ `,e.ref]})]})]},`simple-plugin-${t}`))})]})]}),(0,b.jsxs)(`div`,{className:`pt-4 border-t border-[var(--oh-border-subtle)]`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,b.jsx)(`input`,{id:`trust-checkbox`,"data-testid":`trust-checkbox`,type:`checkbox`,checked:x,onChange:e=>C(e.target.checked),className:`mt-1 h-4 w-4 flex-shrink-0`}),(0,b.jsx)(`label`,{htmlFor:`trust-checkbox`,className:`text-sm text-white`,children:a(s.LAUNCH$TRUST_SKILL_CHECKBOX,{sources:A().join(`, `),interpolation:{escapeValue:!1}})})]}),(0,b.jsx)(`div`,{className:`flex w-full justify-end mt-8`,children:(0,b.jsx)(f,{testId:`start-conversation-button`,type:`button`,variant:`primary`,onClick:j,isDisabled:n||!x,className:`px-4`,children:a(n?s.LAUNCH$STARTING:s.LAUNCH$START_CONVERSATION)})})]})]})})}function w(e){if(e)return e.replace(/<[^>]*>/g,``).slice(0,500)||void 0}function T(e){let t=e.get(`plugins`);if(t)try{let n=atob(t),r=JSON.parse(n);if(!Array.isArray(r))return{plugins:[],error:`invalid_format`};let i=[];for(let e of r){if(typeof e!=`object`||!e||typeof e.source!=`string`)return{plugins:[],error:`invalid_format`};i.push({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null,parameters:e.parameters??null})}return i.length===0?{plugins:[],error:`no_plugins`}:{plugins:i,message:w(e.get(`message`))}}catch{return{plugins:[],error:`invalid_format`}}let n=e.get(`plugin_source`);return n?{plugins:[{source:n,ref:e.get(`plugin_ref`)??null,repo_path:e.get(`plugin_repo_path`)??null,parameters:null}],message:w(e.get(`message`))}:{plugins:[],error:`no_plugins`}}function E({errorType:e,onGoHome:t,onTryAgain:n}){let{t:r}=o(`openhands`),i={no_plugins:r(s.LAUNCH$ERROR_NO_PLUGINS),invalid_format:r(s.LAUNCH$ERROR_INVALID_FORMAT),creation_failed:r(s.LAUNCH$ERROR_CREATION_FAILED)};return(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,"data-testid":`launch-error`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-lg bg-[var(--oh-surface)] p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`mb-4 text-xl font-medium text-red-400`,children:r(s.LAUNCH$ERROR_TITLE)}),(0,b.jsx)(`p`,{className:`mb-6 text-[var(--oh-text-tertiary)]`,children:i[e]}),(0,b.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md bg-tertiary px-4 py-2 text-sm text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`go-home-button`,children:r(s.LAUNCH$GO_HOME)}),n&&(0,b.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md bg-blue-600 px-4 py-2 text-sm text-white hover:bg-blue-700`,"data-testid":`try-again-button`,children:r(s.LAUNCH$TRY_AGAIN)})]})]})})}var D=a(function(){let[e]=r(),t=i(),{t:n}=o(`openhands`),a=h(),[c,l]=y.useState(null),u=y.useMemo(()=>T(e),[e]),d=async(e,r)=>{l(null);try{t(`/conversations/${(await a.mutateAsync({plugins:e,query:r,entryPoint:`launch_deeplink`})).conversation_id}`)}catch{l(n(s.LAUNCH$ERROR_CREATION_UNKNOWN))}},f=()=>{t(`/conversations`)};return u.error?(0,b.jsx)(E,{errorType:u.error,onGoHome:f}):c?(0,b.jsx)(E,{errorType:`creation_failed`,onGoHome:f,onTryAgain:()=>{l(null),window.location.reload()}}):(0,b.jsx)(`div`,{className:`h-full`,"data-testid":`launch-route`,children:(0,b.jsx)(C,{plugins:u.plugins,message:u.message,isLoading:a.isPending,onStartConversation:d,onClose:f})})});export{D 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,R as i,U as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{K as s,t as c}from"./utils-D-gOfhmN.js";import{t as l}from"./modal-backdrop-BSzNhM4r.js";import{r as u,t as d}from"./modal-body-DBweM2EN.js";import{t as f}from"./brand-button-mQq2Ld1I.js";import{t as p}from"./modal-close-button-BrM5fNnn.js";import{t as m}from"./settings-input-Cm4VxUon.js";import{n as h}from"./use-create-conversation-Be-eVpFp.js";import{r as g}from"./typography-NarNyelM.js";import{n as _,t as v}from"./vendor~launch-CHwEQG6e.js";var y=e(t(),1),b=n();function x({pluginIndex:e,paramKey:t,paramValue:n,onParameterChange:r}){let i=`plugin-${e}-param-${t}`;return typeof n==`boolean`?(0,b.jsxs)(`label`,{htmlFor:i,className:`flex w-full cursor-pointer items-center gap-2.5`,children:[(0,b.jsx)(`input`,{id:i,"data-testid":i,type:`checkbox`,checked:n,onChange:n=>r(e,t,n.target.checked),className:`h-4 w-4 shrink-0 rounded`}),(0,b.jsx)(`span`,{className:`text-sm`,children:t})]}):typeof n==`number`?(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`number`,label:t,value:String(n),className:`w-full`,onChange:n=>r(e,t,n===``?0:parseFloat(n)||0)}):(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`text`,label:t,value:String(n??``),className:`w-full`,onChange:n=>r(e,t,n)})}function S({plugin:e,originalIndex:t,isExpanded:n,onToggle:r,getPluginDisplayName:i,onParameterChange:a}){let{t:c}=o(`openhands`);return e.parameters&&Object.keys(e.parameters).length>0?(0,b.jsxs)(`div`,{className:`rounded-lg border border-[var(--oh-border)] bg-tertiary`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer`,"data-testid":`plugin-section-${t}`,children:[(0,b.jsx)(g.Text,{className:`text-base font-normal`,children:i(e)}),n?(0,b.jsx)(v,{className:`h-5 w-5 text-white`}):(0,b.jsx)(_,{className:`h-5 w-5 text-white`})]}),n&&(0,b.jsxs)(`div`,{className:`border-t border-[var(--oh-border-subtle)] px-4 pb-3`,children:[e.ref&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(s.LAUNCH$PLUGIN_REF),` `,e.ref]}),e.repo_path&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(s.LAUNCH$PLUGIN_PATH),` `,e.repo_path]}),(0,b.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(e.parameters||{}).map(([e,n])=>(0,b.jsx)(x,{pluginIndex:t,paramKey:e,paramValue:n,onParameterChange:a},e))})]})]}):null}function C({plugins:e,message:t,isLoading:n=!1,onStartConversation:r,onClose:i}){let{t:a}=o(`openhands`),[m,h]=y.useState(e),[_,v]=y.useState(()=>{let t={};return e.forEach((e,n)=>{e.parameters&&Object.keys(e.parameters).length>0&&(t[n]=!0)}),t}),[x,C]=y.useState(!1),w=m.filter(e=>e.parameters&&Object.keys(e.parameters).length>0),T=m.filter(e=>!e.parameters||Object.keys(e.parameters).length===0),E=e=>{v(t=>({...t,[e]:!t[e]}))},D=(e,t,n)=>{h(r=>{let i=[...r],a={...i[e]};return a.parameters={...a.parameters,[t]:n},i[e]=a,i})},O=e=>{let{source:t,repo_path:n}=e;if(n){let e=n.split(`/`);return e[e.length-1]}if(t.startsWith(`github:`))return t.replace(`github:`,``);if(t.includes(`/`)){let e=t.split(`/`);return e[e.length-1].replace(`.git`,``)}return t},k=e=>{let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`github.com/`)&&t.split(`github.com/`)[1]?.replace(`.git`,``)||t},A=()=>{let e=m.map(e=>k(e));return[...new Set(e)]},j=()=>{r(m,t)},M=m.length===1?O(m[0]):a(s.LAUNCH$MODAL_TITLE_GENERIC);return(0,b.jsx)(l,{onClose:i,children:(0,b.jsxs)(`div`,{"data-testid":`plugin-launch-modal`,className:c(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]`,u(`md`),d),children:[(0,b.jsx)(p,{onClose:i,testId:`close-button`}),(0,b.jsxs)(g.H2,{className:`pr-6`,children:[a(s.LAUNCH$MODAL_TITLE),` `,M]}),t&&(0,b.jsx)(`p`,{className:`text-sm text-white`,children:t}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:[w.length>0&&(0,b.jsx)(`div`,{className:`space-y-3`,children:m.map((e,t)=>(0,b.jsx)(S,{plugin:e,originalIndex:t,isExpanded:!!_[t],onToggle:()=>E(t),getPluginDisplayName:O,onParameterChange:D},`plugin-${t}`))}),T.length>0&&(0,b.jsxs)(`div`,{className:c(w.length>0&&`mt-4`),children:[(0,b.jsx)(g.H3,{className:`mb-2 text-white`,children:w.length>0?a(s.LAUNCH$ADDITIONAL_PLUGINS):a(s.LAUNCH$PLUGINS)}),(0,b.jsx)(`div`,{className:`space-y-2`,children:T.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-md bg-tertiary px-3 py-2 text-sm`,children:[(0,b.jsx)(`div`,{className:`font-medium`,children:O(e)}),(0,b.jsxs)(`div`,{className:`text-xs text-white mt-1`,children:[k(e),e.repo_path&&(0,b.jsxs)(`span`,{className:`ml-1`,children:[`/ `,e.repo_path]}),e.ref&&(0,b.jsxs)(`span`,{className:`ml-2`,children:[`@ `,e.ref]})]})]},`simple-plugin-${t}`))})]})]}),(0,b.jsxs)(`div`,{className:`pt-4 border-t border-[var(--oh-border-subtle)]`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,b.jsx)(`input`,{id:`trust-checkbox`,"data-testid":`trust-checkbox`,type:`checkbox`,checked:x,onChange:e=>C(e.target.checked),className:`mt-1 h-4 w-4 flex-shrink-0`}),(0,b.jsx)(`label`,{htmlFor:`trust-checkbox`,className:`text-sm text-white`,children:a(s.LAUNCH$TRUST_SKILL_CHECKBOX,{sources:A().join(`, `),interpolation:{escapeValue:!1}})})]}),(0,b.jsx)(`div`,{className:`flex w-full justify-end mt-8`,children:(0,b.jsx)(f,{testId:`start-conversation-button`,type:`button`,variant:`primary`,onClick:j,isDisabled:n||!x,className:`px-4`,children:a(n?s.LAUNCH$STARTING:s.LAUNCH$START_CONVERSATION)})})]})]})})}function w(e){if(e)return e.replace(/<[^>]*>/g,``).slice(0,500)||void 0}function T(e){let t=e.get(`plugins`);if(t)try{let n=atob(t),r=JSON.parse(n);if(!Array.isArray(r))return{plugins:[],error:`invalid_format`};let i=[];for(let e of r){if(typeof e!=`object`||!e||typeof e.source!=`string`)return{plugins:[],error:`invalid_format`};i.push({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null,parameters:e.parameters??null})}return i.length===0?{plugins:[],error:`no_plugins`}:{plugins:i,message:w(e.get(`message`))}}catch{return{plugins:[],error:`invalid_format`}}let n=e.get(`plugin_source`);return n?{plugins:[{source:n,ref:e.get(`plugin_ref`)??null,repo_path:e.get(`plugin_repo_path`)??null,parameters:null}],message:w(e.get(`message`))}:{plugins:[],error:`no_plugins`}}function E({errorType:e,onGoHome:t,onTryAgain:n}){let{t:r}=o(`openhands`),i={no_plugins:r(s.LAUNCH$ERROR_NO_PLUGINS),invalid_format:r(s.LAUNCH$ERROR_INVALID_FORMAT),creation_failed:r(s.LAUNCH$ERROR_CREATION_FAILED)};return(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,"data-testid":`launch-error`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-lg bg-[var(--oh-surface)] p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`mb-4 text-xl font-medium text-red-400`,children:r(s.LAUNCH$ERROR_TITLE)}),(0,b.jsx)(`p`,{className:`mb-6 text-[var(--oh-text-tertiary)]`,children:i[e]}),(0,b.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md bg-tertiary px-4 py-2 text-sm text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`go-home-button`,children:r(s.LAUNCH$GO_HOME)}),n&&(0,b.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md bg-blue-600 px-4 py-2 text-sm text-white hover:bg-blue-700`,"data-testid":`try-again-button`,children:r(s.LAUNCH$TRY_AGAIN)})]})]})})}var D=a(function(){let[e]=r(),t=i(),{t:n}=o(`openhands`),a=h(),[c,l]=y.useState(null),u=y.useMemo(()=>T(e),[e]),d=async(e,r)=>{l(null);try{t(`/conversations/${(await a.mutateAsync({plugins:e,query:r,entryPoint:`launch_deeplink`})).conversation_id}`)}catch{l(n(s.LAUNCH$ERROR_CREATION_UNKNOWN))}},f=()=>{t(`/conversations`)};return u.error?(0,b.jsx)(E,{errorType:u.error,onGoHome:f}):c?(0,b.jsx)(E,{errorType:`creation_failed`,onGoHome:f,onTryAgain:()=>{l(null),window.location.reload()}}):(0,b.jsx)(`div`,{className:`h-full`,"data-testid":`launch-route`,children:(0,b.jsx)(C,{plugins:u.plugins,message:u.message,isLoading:a.isPending,onStartConversation:d,onClose:f})})});export{D as default};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{d:`M9 6C9.55228 6 10 6.44772 10 7V17C10 17.5523 9.55228 18 9 18C8.44772 18 8 17.5523 8 17V7C8 6.44772 8.44772 6 9 6ZM15 6C15.5523 6 16 6.44772 16 7V17C16 17.5523 15.5523 18 15 18C14.4477 18 14 17.5523 14 17V7C14 6.44772 14.4477 6 15 6Z`,fill:`currentColor`})}),i=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{d:`M7.062 8.367L3.0915 12.336L7.062 16.305L6 17.367L1.5 12.867V11.805L6 7.305L7.062 8.367ZM17.562 7.305L16.5 8.367L20.4705 12.336L16.5 16.305L17.562 17.367L22.062 12.867V11.805L17.562 7.305ZM7.362 19.5L8.703 20.172L16.203 5.172L14.862 4.5L7.362 19.5Z`,fill:`currentColor`})}),a=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M2.25 1.5H9V3H3V21H21V15H22.5V21.75L21.75 22.5H2.25L1.5 21.75V2.25L2.25 1.5Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M22.5 2.25V12H21V4.0605L10.8645 14.1975L9.80402 13.1355L19.9395 3H12V1.5H21.75L22.5 2.25Z`,fill:`currentColor`})]});export{i as n,r,a as t};