@openhands/agent-canvas 1.4.0 → 1.5.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 (674) hide show
  1. package/README.md +11 -12
  2. package/README.windows.md +4 -2
  3. package/build/assets/{Trans-Ch-OVWEA.js → Trans-DqF_OEZB.js} +1 -1
  4. package/build/assets/{acp-providers-Sy2LKyMa.js → acp-providers-BQwoUBpe.js} +1 -1
  5. package/build/assets/active-backend-context-BCXRv5pm.js +1 -0
  6. package/build/assets/{add-backend-modal-Bgy8anoR.js → add-backend-modal-BKHzq5no.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-3mmXljZX.js → agent-profiles-settings-CEp5CIz8.js} +1 -1
  8. package/build/assets/agent-server-compatibility-D6DSanlx.js +1 -0
  9. package/build/assets/agent-server-conversation-service.api-cylugfDz.js +41 -0
  10. package/build/assets/{agent-settings-B-W10B4E.js → agent-settings-C-tann3x.js} +2 -2
  11. package/build/assets/agent-settings-DGUKNSnU.js +1 -0
  12. package/build/assets/{alert-banner-Bpf2NQJq.js → alert-banner-Dd4woGbm.js} +1 -1
  13. package/build/assets/api-key-entry-screen-Bll_CkuQ.js +1 -0
  14. package/build/assets/app-settings-BpViWwpC.js +1 -0
  15. package/build/assets/automation-detail-Z9dN2f5l.js +2 -0
  16. package/build/assets/automation-export-D5uL0Tf8.js +2 -0
  17. package/build/assets/automations-list-BMOWcqzZ.js +1 -0
  18. package/build/assets/{back-nav-button-CUS2mi-U.js → back-nav-button-ZUDTMOTB.js} +1 -1
  19. package/build/assets/backend-form-modal-DhBT8P4g.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-D9hZx05w.js → backend-synced-settings-badge-Db_REKVw.js} +1 -1
  21. package/build/assets/{base-modal-BuF2f0YL.js → base-modal-Cb0C6m0Q.js} +1 -1
  22. package/build/assets/{bot-D7eUAuSB.js → bot-C-EA6685.js} +1 -1
  23. package/build/assets/{brand-button-vMVuyDXu.js → brand-button-2Tp3aXk1.js} +1 -1
  24. package/build/assets/{browser-BifzWIBd.js → browser-QYLVr1kS.js} +2 -2
  25. package/build/assets/browser-store-BGXOGo-R.js +1 -0
  26. package/build/assets/{browser-tab-CkkqJnqw.js → browser-tab-BTTP1OE2.js} +1 -1
  27. package/build/assets/canvas-ui-BhxjoA1f.js +1 -0
  28. package/build/assets/{chat-send-button-B_jc5z5C.js → chat-send-button-BZHG2hAW.js} +1 -1
  29. package/build/assets/check-TbOEtHKj.js +1 -0
  30. package/build/assets/{chevron-down-CI8A6tet.js → chevron-down-D7IvFMBM.js} +1 -1
  31. package/build/assets/{circle-plus-check-toggle-C5YxjxvI.js → circle-plus-check-toggle-QQJKUnF6.js} +1 -1
  32. package/build/assets/client-source-Biqarhgr.js +1 -0
  33. package/build/assets/cloud-funnel-analytics-D-27T5Ao.js +1 -0
  34. package/build/assets/{combobox-caret-DoObzqf4.js → combobox-caret-A5jMVHgE.js} +1 -1
  35. package/build/assets/{command-menu-D-JV3Wqm.js → command-menu-BMVEme4H.js} +1 -1
  36. package/build/assets/{command-store-D8J5LMW1.js → command-store-jrWX_CcW.js} +1 -1
  37. package/build/assets/condenser-settings-CIa6eyB4.js +1 -0
  38. package/build/assets/{confirmation-modal-BGLu6XJN.js → confirmation-modal-4n_944zq.js} +1 -1
  39. package/build/assets/{context-menu-list-item-BD5_EaKN.js → context-menu-list-item-DvfFic5I.js} +1 -1
  40. package/build/assets/conversation-CHnEXGRM.js +1 -0
  41. package/build/assets/conversation-D4o4dG2t.js +89 -0
  42. package/build/assets/conversation-panel-11FjLCId.js +1 -0
  43. package/build/assets/conversation-service.api-0JG_fF9d.js +1 -0
  44. package/build/assets/conversation-state-store-JiUQp02U.js +1 -0
  45. package/build/assets/{conversation-store-LptbOvKa.js → conversation-store-BCSpLuEf.js} +1 -1
  46. package/build/assets/{conversation-tab-empty-state-B2dDYEwf.js → conversation-tab-empty-state-BUhKVwoi.js} +1 -1
  47. package/build/assets/{copy-3JCw_XFB.js → copy-D1YGjP-C.js} +1 -1
  48. package/build/assets/{copy-to-clipboard-button-CaR52OnA.js → copy-to-clipboard-button-Dp4Q_hXi.js} +1 -1
  49. package/build/assets/declaration-BGsHjPEW.js +1 -0
  50. package/build/assets/{device-verify-Dj6I4Iqe.js → device-verify-CM086oKs.js} +1 -1
  51. package/build/assets/{dropdown-classes-DJSXeLqc.js → dropdown-classes-DZq0BQjb.js} +1 -1
  52. package/build/assets/{ellipsis-button-C5Z-tPFp.js → ellipsis-button-TPJdyxnK.js} +1 -1
  53. package/build/assets/{entry.client-2_3ePAm0.js → entry.client-DypYHsYm.js} +2 -2
  54. package/build/assets/{enum-filter-dropdown-DXbVwiNZ.js → enum-filter-dropdown-CW_mBg0e.js} +1 -1
  55. package/build/assets/{environment-switch-overlay-DZQfRGTx.js → environment-switch-overlay-6laJch-9.js} +1 -1
  56. package/build/assets/{extensions-hub-CLjmOGqS.js → extensions-hub-BJFbFfKS.js} +1 -1
  57. package/build/assets/{extensions-navigation-B5MeUiMq.js → extensions-navigation-DqSl7CJw.js} +1 -1
  58. package/build/assets/{external-link-D2zJjE9G.js → external-link-lhdITPqq.js} +1 -1
  59. package/build/assets/files-tab-c316dKAq.js +1 -0
  60. package/build/assets/{files-tab-store-DJsPxYdg.js → files-tab-store-tfCav6bB.js} +1 -1
  61. package/build/assets/{form-control-classes-ChpNBe9n.js → form-control-classes-CvUaw8_L.js} +1 -1
  62. package/build/assets/format-time-delta-DhDbkD7V.js +1 -0
  63. package/build/assets/git-provider-icon-DUb2pEos.js +1 -0
  64. package/build/assets/home-BQ-DC06B.js +1 -0
  65. package/build/assets/home-D7ds4Jyw.js +1 -0
  66. package/build/assets/index-home-BRFDWs_4.js +1 -0
  67. package/build/assets/install-server-modal-CvHvzZj3.js +1 -0
  68. package/build/assets/{launch-V_3Rp7WS.js → launch-A47TK2Me.js} +1 -1
  69. package/build/assets/lesson-plan-DSf95kQ2.js +4 -0
  70. package/build/assets/{list-todo-BfH6yYUK.js → list-todo-CAtvkzcy.js} +1 -1
  71. package/build/assets/llm-not-configured-banner-B7DR8SPs.js +27 -0
  72. package/build/assets/llm-settings-Ch4ZbW3c.js +1 -0
  73. package/build/assets/llm-settings-Cvi7q4ox.js +1 -0
  74. package/build/assets/llm-subscription-service-Cz1yBBvE.js +1 -0
  75. package/build/assets/loader-circle-CsAsfLIs.js +1 -0
  76. package/build/assets/{loading-spinner-BLdswi6q.js → loading-spinner-Txxx1I1p.js} +1 -1
  77. package/build/assets/manage-backends-modal-DAVhNUCe.js +1 -0
  78. package/build/assets/manifest-958c741a.js +1 -0
  79. package/build/assets/{markdown-renderer-DMT7Zkpd.js → markdown-renderer-B6cJJ_MN.js} +1 -1
  80. package/build/assets/{mcp-BQufNPZ6.js → mcp-BwssgMpg.js} +2 -2
  81. package/build/assets/{messages-BnJCqnFf.js → messages-D8MeG2ZQ.js} +26 -26
  82. package/build/assets/{modal-body-DouOE5KH.js → modal-body-CDZdZ-eT.js} +1 -1
  83. package/build/assets/{modal-classes-Cf-4tbHz.js → modal-classes-B4oit_4c.js} +1 -1
  84. package/build/assets/{modal-close-button-B6CfxxJj.js → modal-close-button-DQElFMPo.js} +1 -1
  85. package/build/assets/model-selector-BxTbbKub.js +1 -0
  86. package/build/assets/{navigation-link-D8hfwvxI.js → navigation-link-imH6S7h2.js} +1 -1
  87. package/build/assets/onboarding-CyicadGt.js +1 -0
  88. package/build/assets/onboarding-modal-DQwihcTz.js +1 -0
  89. package/build/assets/option-service.api-DAkg_F7p.js +1 -0
  90. package/build/assets/organization-service.api-QknzKDh3.js +1 -0
  91. package/build/assets/package-Dk_VtWJ4.js +1 -0
  92. package/build/assets/path-utils-BECGet7G.js +1 -0
  93. package/build/assets/{pencil-Dj2XjKmI.js → pencil-CWhApFIT.js} +1 -1
  94. package/build/assets/{plan-components-CcCBmCzW.js → plan-components-CgPHWz3E.js} +1 -1
  95. package/build/assets/{planner-tab-Dhyqcqmb.js → planner-tab-DPKHmMAX.js} +1 -1
  96. package/build/assets/plugins-management-service-DuTTxquo.js +1 -0
  97. package/build/assets/profiles-service.api-D6jvZOWu.js +1 -0
  98. package/build/assets/providers-B8pxQK8x.js +1 -0
  99. package/build/assets/proxy-CuhhyjdX.js +1 -0
  100. package/build/assets/{recommended-automations-launcher-CTcGTl4d.js → recommended-automations-launcher-DA6DWS7V.js} +1 -1
  101. package/build/assets/{refresh-cw-DM82EIyx.js → refresh-cw-B9B7-vsy.js} +1 -1
  102. package/build/assets/root-BhP6bTBB.js +2 -0
  103. package/build/assets/root-CYWeTrWE.css +1 -0
  104. package/build/assets/root-layout-oBaHHW4s.js +2 -0
  105. package/build/assets/{runtime-waiting-state-BsXLElvN.js → runtime-waiting-state-DeD9G7yJ.js} +1 -1
  106. package/build/assets/schema-field-BOLdL_U7.js +1 -0
  107. package/build/assets/sdk-section-page-ZIltERxf.js +1 -0
  108. package/build/assets/{sdk-settings-schema-Cv7M9eSe.js → sdk-settings-schema-Ba_Pa9uf.js} +1 -1
  109. package/build/assets/search-dIQ09UY2.js +1 -0
  110. package/build/assets/secrets-service-50DElFny.js +1 -0
  111. package/build/assets/{secrets-settings-Cx6yJlyb.js → secrets-settings-Digl7JLe.js} +1 -1
  112. package/build/assets/{segmented-toggle-DyQqPhoD.js → segmented-toggle-C1-ZVyr5.js} +1 -1
  113. package/build/assets/settings-BfgLHsgd.js +1 -0
  114. package/build/assets/{settings-dropdown-input-BjunGXJb.js → settings-dropdown-input-BD5C9fBn.js} +1 -1
  115. package/build/assets/{settings-index-D6sxWSRk.js → settings-index-CODBijya.js} +1 -1
  116. package/build/assets/{settings-input-bD6npsDm.js → settings-input-CzNOq-Pj.js} +1 -1
  117. package/build/assets/{settings-list-classes-Dp_OgzN0.js → settings-list-classes-CuxH9ZoR.js} +1 -1
  118. package/build/assets/settings-modal-BcSWpKI0.js +1 -0
  119. package/build/assets/settings-service.api-Bsu1PvYO.js +1 -0
  120. package/build/assets/{settings-switch-5cuxl8Dc.js → settings-switch-DqmHAfWJ.js} +1 -1
  121. package/build/assets/{settings-utils-BMdG65By.js → settings-utils-B1lBErvV.js} +1 -1
  122. package/build/assets/shared-conversation-CDskdmrb.js +1 -0
  123. package/build/assets/{sidebar-layout-DuzJMMw-.js → sidebar-layout-Cn6eQaEI.js} +1 -1
  124. package/build/assets/{sidebar-mobile-menu-toggle-VvvX32iF.js → sidebar-mobile-menu-toggle-DmCmZgq1.js} +1 -1
  125. package/build/assets/{sidebar-nav-link-5AlTT5-j.js → sidebar-nav-link-DMc8AIe7.js} +1 -1
  126. package/build/assets/{sidebar-store-CZuE8AH5.js → sidebar-store-DXWSCFpa.js} +1 -1
  127. package/build/assets/{skill-card-pill-row-eTIkE4nz.js → skill-card-pill-row-DOIWjiMF.js} +1 -1
  128. package/build/assets/skills-plugins-DLgINYuY.js +1 -0
  129. package/build/assets/{skills-settings-BUv04tSc.js → skills-settings-DPiCWalR.js} +2 -2
  130. package/build/assets/{square-chevron-right-Czw3FFWc.js → square-chevron-right-DE-JN-2Z.js} +1 -1
  131. package/build/assets/{styled-tooltip-CgX2oRaK.js → styled-tooltip-CvsjHuIf.js} +1 -1
  132. package/build/assets/{suspense-BO1Tl_Vf.js → suspense-DmZ3MSSh.js} +1 -1
  133. package/build/assets/{task-list-tab-0k9PhuqO.js → task-list-tab-CuhcDycu.js} +1 -1
  134. package/build/assets/telemetry-DHiTRl5_.js +2 -0
  135. package/build/assets/{terminal-B61WrJdS.js → terminal-CVqF-tCD.js} +1 -1
  136. package/build/assets/{toggle-switch-2j5wwR85.js → toggle-switch-CS0ClOy2.js} +1 -1
  137. package/build/assets/{trash-2-Be_7y3Mn.js → trash-2-BU6BlW4i.js} +1 -1
  138. package/build/assets/{typography-D8mHDeNG.js → typography-CQn9wyEX.js} +1 -1
  139. package/build/assets/use-acp-credential-form-LlfZO_DD.js +1 -0
  140. package/build/assets/{use-activate-agent-profile-20v1xU0H.js → use-activate-agent-profile-DpQjsXM0.js} +1 -1
  141. package/build/assets/{use-active-agent-profile-BkJN7Xsy.js → use-active-agent-profile-Gw_uJujV.js} +1 -1
  142. package/build/assets/{use-active-conversation-DOZVSVtU.js → use-active-conversation-B0sttISF.js} +1 -1
  143. package/build/assets/use-agent-profiles-LHZEK0Gg.js +1 -0
  144. package/build/assets/{use-agent-state-DHZO1obC.js → use-agent-state-C5uA0bRj.js} +1 -1
  145. package/build/assets/use-backends-health-DKt1SmiU.js +1 -0
  146. package/build/assets/{use-can-manage-org-profiles-C-OhWVBS.js → use-can-manage-org-profiles-BAtqsbCi.js} +1 -1
  147. package/build/assets/use-cloud-current-user-id-C8m1oBy4.js +1 -0
  148. package/build/assets/use-config-CXy4vD0H.js +1 -0
  149. package/build/assets/use-create-conversation-CWQGNQ9J.js +1 -0
  150. package/build/assets/{use-create-secret-D0HCOZFu.js → use-create-secret-BIrsX3OB.js} +1 -1
  151. package/build/assets/{use-event-store-DjgU4wfO.js → use-event-store-CsD17BKu.js} +1 -1
  152. package/build/assets/{use-handle-plan-click-DyRASKMC.js → use-handle-plan-click-DEuO7Byo.js} +1 -1
  153. package/build/assets/use-is-authed-Dvbpiu3B.js +1 -0
  154. package/build/assets/{use-launch-skill-in-chat-BnoDgvAy.js → use-launch-skill-in-chat-CdHOoQGM.js} +1 -1
  155. package/build/assets/use-llm-profiles-DQpQxVOD.js +1 -0
  156. package/build/assets/use-plugins-marketplace-Bkk07W_M.js +1 -0
  157. package/build/assets/use-runtime-is-ready-D4pkGT6E.js +1 -0
  158. package/build/assets/use-save-agent-profile-BxEsjnW0.js +1 -0
  159. package/build/assets/{use-save-settings-BGlSfuYn.js → use-save-settings-ioSUMqbE.js} +1 -1
  160. package/build/assets/use-settings-DNJC4gqu.js +1 -0
  161. package/build/assets/use-settings-nav-items-BUsrDbVR.js +16 -0
  162. package/build/assets/use-skills-BsmKm23M.js +1 -0
  163. package/build/assets/{use-task-list-AVBLbbcR.js → use-task-list-rs7Xbzl8.js} +1 -1
  164. package/build/assets/{use-tracking-BIXzagSI.js → use-tracking-poxQHMwR.js} +1 -1
  165. package/build/assets/{use-user-conversation-zpx7I18x.js → use-user-conversation-B337kUKB.js} +1 -1
  166. package/build/assets/{useMutation-DrCAVg5w.js → useMutation-u8UgRgDK.js} +1 -1
  167. package/build/assets/{useMutationState-D8QN0ZCy.js → useMutationState-OnAsCLA_.js} +1 -1
  168. package/build/assets/{useQueries-DClgUTc7.js → useQueries-BpIlT8Mt.js} +1 -1
  169. package/build/assets/{useQuery-CRBP8vIS.js → useQuery-D5pEZbY0.js} +1 -1
  170. package/build/assets/{useTranslation-CDRCKC9-.js → useTranslation-Cbf5AGg_.js} +1 -1
  171. package/build/assets/{utils-D3U3rlqr.js → utils-DB9LsAzA.js} +1 -1
  172. package/build/assets/{vendor~browser-Cvg7jXCP.js → vendor~browser-5Njjw1Cl.js} +1 -1
  173. package/build/assets/{vendor~browser-tab-Di0kh5Zw.js → vendor~browser-tab-Xn94EtUo.js} +1 -1
  174. package/build/assets/{vendor~entry.client-9tWQ_Ugw.js → vendor~entry.client-DDuH4--y.js} +1 -1
  175. package/build/assets/{vendor~entry.client-D6BtSOtn.js → vendor~entry.client-DQGrNspu.js} +1 -1
  176. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-BIieS_OD.js +2 -0
  177. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js +185 -0
  178. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jewnulst-C57fm7C-.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ljq5gbus-B2XD4bi2.js} +1 -1
  179. package/build/assets/{vendor~files-tab-B02k3xvx.js → vendor~files-tab-CiC3-lGh.js} +1 -1
  180. package/build/assets/{vendor~home~conversation-panel~conversation-CYMF9JYB.js → vendor~index-home~home~conversation-panel~conversation-ChmYLVgz.js} +1 -1
  181. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9UMeuPV6.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B8XNNEQZ.js} +1 -1
  182. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CnJRLn5s.js} +1 -1
  183. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DWteoTyr.js +2 -0
  184. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D7EUmQ8Y.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dc5nKwLO.js} +1 -1
  185. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD0GaRGa.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-tlf6AnDe.js} +1 -1
  186. package/build/assets/{vendor~launch-CHXA9cJu.js → vendor~launch-28DK5Rsl.js} +1 -1
  187. package/build/assets/{vendor~root-layout~conversation-panel~conversation-CpiTHpHl.js → vendor~root-layout~conversation-panel~conversation-8tIsyrPj.js} +1 -1
  188. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-lYNG9C1U.js} +1 -1
  189. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-Cn2jwSga.js → vendor~root-layout~index-home~home~conversation-panel~conversation-Zhq6xAxR.js} +1 -1
  190. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CZM4hwUT.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-B81b08bw.js} +1 -1
  191. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~enjl5xdm-B0EIDu4M.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-jpyLM1Nn.js} +2 -2
  192. package/build/assets/{verification-settings-D576N2xa.js → verification-settings-HRgEM-_3.js} +1 -1
  193. package/build/assets/x-ZE4iplpF.js +1 -0
  194. package/build/index.html +4 -4
  195. package/build/locales/ar/openhands.json +9 -0
  196. package/build/locales/ca/openhands.json +9 -0
  197. package/build/locales/de/openhands.json +9 -0
  198. package/build/locales/en/openhands.json +9 -0
  199. package/build/locales/es/openhands.json +9 -0
  200. package/build/locales/fr/openhands.json +9 -0
  201. package/build/locales/it/openhands.json +9 -0
  202. package/build/locales/ja/openhands.json +9 -0
  203. package/build/locales/ko-KR/openhands.json +9 -0
  204. package/build/locales/no/openhands.json +9 -0
  205. package/build/locales/pt/openhands.json +9 -0
  206. package/build/locales/tr/openhands.json +9 -0
  207. package/build/locales/uk/openhands.json +9 -0
  208. package/build/locales/zh-CN/openhands.json +9 -0
  209. package/build/locales/zh-TW/openhands.json +9 -0
  210. package/config/defaults.json +5 -4
  211. package/dist/api/agent-server-adapter.cjs +3 -3
  212. package/dist/api/agent-server-adapter.cjs.map +1 -1
  213. package/dist/api/agent-server-adapter.d.ts +9 -1
  214. package/dist/api/agent-server-adapter.js +105 -102
  215. package/dist/api/agent-server-adapter.js.map +1 -1
  216. package/dist/api/agent-server-config.cjs +1 -1
  217. package/dist/api/agent-server-config.cjs.map +1 -1
  218. package/dist/api/agent-server-config.d.ts +3 -0
  219. package/dist/api/agent-server-config.js +45 -23
  220. package/dist/api/agent-server-config.js.map +1 -1
  221. package/dist/api/backend-registry/auth.cjs +1 -1
  222. package/dist/api/backend-registry/auth.cjs.map +1 -1
  223. package/dist/api/backend-registry/auth.js +1 -1
  224. package/dist/api/backend-registry/auth.js.map +1 -1
  225. package/dist/api/backend-registry/default-backend.cjs +1 -1
  226. package/dist/api/backend-registry/default-backend.cjs.map +1 -1
  227. package/dist/api/backend-registry/default-backend.d.ts +3 -0
  228. package/dist/api/backend-registry/default-backend.js +22 -10
  229. package/dist/api/backend-registry/default-backend.js.map +1 -1
  230. package/dist/api/backend-registry/storage.cjs +1 -1
  231. package/dist/api/backend-registry/storage.cjs.map +1 -1
  232. package/dist/api/backend-registry/storage.js +38 -33
  233. package/dist/api/backend-registry/storage.js.map +1 -1
  234. package/dist/api/backend-registry/types.d.ts +2 -0
  235. package/dist/api/canvas-ui-client-tool.cjs +38 -0
  236. package/dist/api/canvas-ui-client-tool.cjs.map +1 -0
  237. package/dist/api/canvas-ui-client-tool.d.ts +14 -0
  238. package/dist/api/canvas-ui-client-tool.js +47 -0
  239. package/dist/api/canvas-ui-client-tool.js.map +1 -0
  240. package/dist/api/client-source.cjs +2 -0
  241. package/dist/api/client-source.cjs.map +1 -0
  242. package/dist/api/client-source.d.ts +9 -0
  243. package/dist/api/client-source.js +10 -0
  244. package/dist/api/client-source.js.map +1 -0
  245. package/dist/api/cloud/client.cjs +2 -0
  246. package/dist/api/cloud/client.cjs.map +1 -0
  247. package/dist/api/cloud/client.d.ts +4 -0
  248. package/dist/api/cloud/client.js +38 -0
  249. package/dist/api/cloud/client.js.map +1 -0
  250. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  251. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  252. package/dist/api/cloud/conversation-service.api.js +33 -31
  253. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  254. package/dist/api/cloud/organization-service.api.cjs +1 -1
  255. package/dist/api/cloud/organization-service.api.cjs.map +1 -1
  256. package/dist/api/cloud/organization-service.api.js +11 -10
  257. package/dist/api/cloud/organization-service.api.js.map +1 -1
  258. package/dist/api/cloud/proxy.cjs +1 -1
  259. package/dist/api/cloud/proxy.cjs.map +1 -1
  260. package/dist/api/cloud/proxy.d.ts +2 -40
  261. package/dist/api/cloud/proxy.js +14 -39
  262. package/dist/api/cloud/proxy.js.map +1 -1
  263. package/dist/api/conversation-metadata-store.cjs +1 -1
  264. package/dist/api/conversation-metadata-store.cjs.map +1 -1
  265. package/dist/api/conversation-metadata-store.d.ts +2 -9
  266. package/dist/api/conversation-metadata-store.js +13 -9
  267. package/dist/api/conversation-metadata-store.js.map +1 -1
  268. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  269. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  270. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +2 -1
  271. package/dist/api/conversation-service/agent-server-conversation-service.api.js +98 -88
  272. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  273. package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +5 -0
  274. package/dist/api/device-flow-client.cjs +1 -1
  275. package/dist/api/device-flow-client.cjs.map +1 -1
  276. package/dist/api/device-flow-client.d.ts +4 -58
  277. package/dist/api/device-flow-client.js +8 -98
  278. package/dist/api/device-flow-client.js.map +1 -1
  279. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  280. package/dist/api/git-service/agent-server-git-service.api.cjs.map +1 -1
  281. package/dist/api/git-service/agent-server-git-service.api.d.ts +10 -2
  282. package/dist/api/git-service/agent-server-git-service.api.js +107 -40
  283. package/dist/api/git-service/agent-server-git-service.api.js.map +1 -1
  284. package/dist/api/open-hands.types.d.ts +11 -0
  285. package/dist/api/secrets-service.cjs +1 -1
  286. package/dist/api/secrets-service.cjs.map +1 -1
  287. package/dist/api/secrets-service.js +15 -14
  288. package/dist/api/secrets-service.js.map +1 -1
  289. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  290. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  291. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +73 -64
  292. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  293. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.cjs +2 -2
  294. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.cjs.map +1 -1
  295. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.js +2 -0
  296. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-content.js.map +1 -1
  297. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  298. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  299. package/dist/components/features/backends/backend-form-modal.d.ts +4 -2
  300. package/dist/components/features/backends/backend-form-modal.js +202 -188
  301. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  302. package/dist/components/features/backends/backend-row.cjs +1 -1
  303. package/dist/components/features/backends/backend-row.cjs.map +1 -1
  304. package/dist/components/features/backends/backend-row.js +2 -1
  305. package/dist/components/features/backends/backend-row.js.map +1 -1
  306. package/dist/components/features/backends/backend-selector.cjs +1 -1
  307. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  308. package/dist/components/features/backends/backend-selector.js +51 -51
  309. package/dist/components/features/backends/backend-selector.js.map +1 -1
  310. package/dist/components/features/backends/device-flow-auth.cjs +1 -1
  311. package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
  312. package/dist/components/features/backends/device-flow-auth.d.ts +4 -1
  313. package/dist/components/features/backends/device-flow-auth.js +38 -38
  314. package/dist/components/features/backends/device-flow-auth.js.map +1 -1
  315. package/dist/components/features/chat/chat-interface.cjs +2 -2
  316. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  317. package/dist/components/features/chat/chat-interface.js +173 -165
  318. package/dist/components/features/chat/chat-interface.js.map +1 -1
  319. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  320. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  321. package/dist/components/features/chat/components/chat-input-actions.d.ts +2 -1
  322. package/dist/components/features/chat/components/chat-input-actions.js +44 -43
  323. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  324. package/dist/components/features/chat/components/chat-input-container.cjs +1 -1
  325. package/dist/components/features/chat/components/chat-input-container.cjs.map +1 -1
  326. package/dist/components/features/chat/components/chat-input-container.d.ts +2 -1
  327. package/dist/components/features/chat/components/chat-input-container.js +20 -19
  328. package/dist/components/features/chat/components/chat-input-container.js.map +1 -1
  329. package/dist/components/features/chat/components/chat-input-profile-picker.cjs +1 -1
  330. package/dist/components/features/chat/components/chat-input-profile-picker.cjs.map +1 -1
  331. package/dist/components/features/chat/components/chat-input-profile-picker.js +44 -32
  332. package/dist/components/features/chat/components/chat-input-profile-picker.js.map +1 -1
  333. package/dist/components/features/chat/components/resolve-picker-kind.cjs +1 -1
  334. package/dist/components/features/chat/components/resolve-picker-kind.cjs.map +1 -1
  335. package/dist/components/features/chat/components/resolve-picker-kind.d.ts +10 -22
  336. package/dist/components/features/chat/components/resolve-picker-kind.js +6 -3
  337. package/dist/components/features/chat/components/resolve-picker-kind.js.map +1 -1
  338. package/dist/components/features/chat/custom-chat-input.cjs +1 -1
  339. package/dist/components/features/chat/custom-chat-input.cjs.map +1 -1
  340. package/dist/components/features/chat/custom-chat-input.d.ts +2 -1
  341. package/dist/components/features/chat/custom-chat-input.js +52 -51
  342. package/dist/components/features/chat/custom-chat-input.js.map +1 -1
  343. package/dist/components/features/chat/interactive-chat-box.cjs +1 -1
  344. package/dist/components/features/chat/interactive-chat-box.cjs.map +1 -1
  345. package/dist/components/features/chat/interactive-chat-box.d.ts +2 -1
  346. package/dist/components/features/chat/interactive-chat-box.js +9 -8
  347. package/dist/components/features/chat/interactive-chat-box.js.map +1 -1
  348. package/dist/components/features/diff-viewer/commit-list.cjs +2 -0
  349. package/dist/components/features/diff-viewer/commit-list.cjs.map +1 -0
  350. package/dist/components/features/diff-viewer/commit-list.d.ts +13 -0
  351. package/dist/components/features/diff-viewer/commit-list.js +27 -0
  352. package/dist/components/features/diff-viewer/commit-list.js.map +1 -0
  353. package/dist/components/features/diff-viewer/commit-row.cjs +2 -0
  354. package/dist/components/features/diff-viewer/commit-row.cjs.map +1 -0
  355. package/dist/components/features/diff-viewer/commit-row.d.ts +14 -0
  356. package/dist/components/features/diff-viewer/commit-row.js +59 -0
  357. package/dist/components/features/diff-viewer/commit-row.js.map +1 -0
  358. package/dist/components/features/diff-viewer/file-diff-viewer.cjs +1 -1
  359. package/dist/components/features/diff-viewer/file-diff-viewer.cjs.map +1 -1
  360. package/dist/components/features/diff-viewer/file-diff-viewer.d.ts +7 -1
  361. package/dist/components/features/diff-viewer/file-diff-viewer.js +40 -39
  362. package/dist/components/features/diff-viewer/file-diff-viewer.js.map +1 -1
  363. package/dist/components/features/plugins/plugin-detail-modal.d.ts +2 -1
  364. package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
  365. package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
  366. package/dist/components/shared/modals/settings/settings-modal.js +23 -22
  367. package/dist/components/shared/modals/settings/settings-modal.js.map +1 -1
  368. package/dist/config/defaults.cjs +1 -1
  369. package/dist/config/defaults.cjs.map +1 -1
  370. package/dist/config/defaults.js +5 -4
  371. package/dist/config/defaults.js.map +1 -1
  372. package/dist/constants/acp-providers.cjs.map +1 -1
  373. package/dist/constants/acp-providers.d.ts +1 -1
  374. package/dist/constants/acp-providers.js.map +1 -1
  375. package/dist/constants/canvas-ui.cjs +2 -0
  376. package/dist/constants/canvas-ui.cjs.map +1 -0
  377. package/dist/constants/canvas-ui.d.ts +8 -0
  378. package/dist/constants/canvas-ui.js +6 -0
  379. package/dist/constants/canvas-ui.js.map +1 -0
  380. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  381. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  382. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  383. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  384. package/dist/hooks/mutation/use-create-conversation.d.ts +2 -1
  385. package/dist/hooks/mutation/use-create-conversation.js +52 -52
  386. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  387. package/dist/hooks/query/query-keys.cjs +1 -1
  388. package/dist/hooks/query/query-keys.cjs.map +1 -1
  389. package/dist/hooks/query/query-keys.d.ts +2 -0
  390. package/dist/hooks/query/query-keys.js +4 -1
  391. package/dist/hooks/query/query-keys.js.map +1 -1
  392. package/dist/hooks/query/use-backends-health.cjs +1 -1
  393. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  394. package/dist/hooks/query/use-backends-health.js +50 -48
  395. package/dist/hooks/query/use-backends-health.js.map +1 -1
  396. package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
  397. package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
  398. package/dist/hooks/query/use-cloud-organizations.d.ts +1 -0
  399. package/dist/hooks/query/use-cloud-organizations.js +5 -2
  400. package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
  401. package/dist/hooks/query/use-commit-changes.cjs +2 -0
  402. package/dist/hooks/query/use-commit-changes.cjs.map +1 -0
  403. package/dist/hooks/query/use-commit-changes.d.ts +5 -0
  404. package/dist/hooks/query/use-commit-changes.js +34 -0
  405. package/dist/hooks/query/use-commit-changes.js.map +1 -0
  406. package/dist/hooks/query/use-task-polling.cjs +1 -1
  407. package/dist/hooks/query/use-task-polling.cjs.map +1 -1
  408. package/dist/hooks/query/use-task-polling.d.ts +3 -2
  409. package/dist/hooks/query/use-task-polling.js +53 -40
  410. package/dist/hooks/query/use-task-polling.js.map +1 -1
  411. package/dist/hooks/query/use-unified-git-commits.cjs +2 -0
  412. package/dist/hooks/query/use-unified-git-commits.cjs.map +1 -0
  413. package/dist/hooks/query/use-unified-git-commits.d.ts +10 -0
  414. package/dist/hooks/query/use-unified-git-commits.js +41 -0
  415. package/dist/hooks/query/use-unified-git-commits.js.map +1 -0
  416. package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
  417. package/dist/hooks/query/use-unified-git-diff.cjs.map +1 -1
  418. package/dist/hooks/query/use-unified-git-diff.d.ts +5 -0
  419. package/dist/hooks/query/use-unified-git-diff.js +11 -4
  420. package/dist/hooks/query/use-unified-git-diff.js.map +1 -1
  421. package/dist/hooks/use-acp-model-context.cjs +1 -1
  422. package/dist/hooks/use-acp-model-context.cjs.map +1 -1
  423. package/dist/hooks/use-acp-model-context.d.ts +4 -1
  424. package/dist/hooks/use-acp-model-context.js +9 -8
  425. package/dist/hooks/use-acp-model-context.js.map +1 -1
  426. package/dist/hooks/use-auto-refresh-files-on-edit.cjs +1 -1
  427. package/dist/hooks/use-auto-refresh-files-on-edit.cjs.map +1 -1
  428. package/dist/hooks/use-auto-refresh-files-on-edit.js +1 -1
  429. package/dist/hooks/use-auto-refresh-files-on-edit.js.map +1 -1
  430. package/dist/hooks/use-chat-input-model-state.cjs.map +1 -1
  431. package/dist/hooks/use-chat-input-model-state.d.ts +2 -1
  432. package/dist/hooks/use-chat-input-model-state.js.map +1 -1
  433. package/dist/hooks/use-chat-input-profile-state.cjs +1 -1
  434. package/dist/hooks/use-chat-input-profile-state.cjs.map +1 -1
  435. package/dist/hooks/use-chat-input-profile-state.d.ts +1 -10
  436. package/dist/hooks/use-chat-input-profile-state.js +42 -15
  437. package/dist/hooks/use-chat-input-profile-state.js.map +1 -1
  438. package/dist/hooks/use-device-flow.cjs +1 -1
  439. package/dist/hooks/use-device-flow.cjs.map +1 -1
  440. package/dist/hooks/use-device-flow.d.ts +4 -1
  441. package/dist/hooks/use-device-flow.js +42 -40
  442. package/dist/hooks/use-device-flow.js.map +1 -1
  443. package/dist/hooks/use-tracking.cjs.map +1 -1
  444. package/dist/hooks/use-tracking.d.ts +2 -1
  445. package/dist/hooks/use-tracking.js.map +1 -1
  446. package/dist/i18n/declaration.cjs +1 -1
  447. package/dist/i18n/declaration.cjs.map +1 -1
  448. package/dist/i18n/declaration.d.ts +9 -0
  449. package/dist/i18n/declaration.js +1 -1
  450. package/dist/i18n/declaration.js.map +1 -1
  451. package/dist/i18n/index.cjs +1 -1
  452. package/dist/i18n/index.cjs.map +1 -1
  453. package/dist/i18n/index.js +19 -18
  454. package/dist/i18n/index.js.map +1 -1
  455. package/dist/i18n/translation.cjs +2 -2
  456. package/dist/i18n/translation.cjs.map +1 -1
  457. package/dist/i18n/translation.js +153 -0
  458. package/dist/i18n/translation.js.map +1 -1
  459. package/dist/index.cjs +1 -1
  460. package/dist/index.js +32 -32
  461. package/dist/lib/index.cjs +1 -1
  462. package/dist/lib/index.js +1 -1
  463. package/dist/locales/ar/openhands.json +9 -0
  464. package/dist/locales/ca/openhands.json +9 -0
  465. package/dist/locales/de/openhands.json +9 -0
  466. package/dist/locales/en/openhands.json +9 -0
  467. package/dist/locales/es/openhands.json +9 -0
  468. package/dist/locales/fr/openhands.json +9 -0
  469. package/dist/locales/it/openhands.json +9 -0
  470. package/dist/locales/ja/openhands.json +9 -0
  471. package/dist/locales/ko-KR/openhands.json +9 -0
  472. package/dist/locales/no/openhands.json +9 -0
  473. package/dist/locales/pt/openhands.json +9 -0
  474. package/dist/locales/tr/openhands.json +9 -0
  475. package/dist/locales/uk/openhands.json +9 -0
  476. package/dist/locales/zh-CN/openhands.json +9 -0
  477. package/dist/locales/zh-TW/openhands.json +9 -0
  478. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.cjs +2 -0
  479. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.cjs.map +1 -0
  480. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.js +351 -0
  481. package/dist/node_modules/@openhands/typescript-client/dist/client/cloud-client.js.map +1 -0
  482. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.cjs +2 -0
  483. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.cjs.map +1 -0
  484. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.js +106 -0
  485. package/dist/node_modules/@openhands/typescript-client/dist/client/device-flow-client.js.map +1 -0
  486. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +2 -0
  487. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -0
  488. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +69 -0
  489. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -0
  490. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  491. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +3 -0
  492. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  493. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  494. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +18 -2
  495. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  496. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
  497. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js.map +1 -1
  498. package/dist/node_modules/axios/index.cjs +1 -1
  499. package/dist/node_modules/axios/index.js +1 -1
  500. package/dist/package.cjs +1 -1
  501. package/dist/package.cjs.map +1 -1
  502. package/dist/package.js +2 -2
  503. package/dist/package.js.map +1 -1
  504. package/dist/routes/app-settings.cjs +1 -1
  505. package/dist/routes/app-settings.cjs.map +1 -1
  506. package/dist/routes/app-settings.js +67 -66
  507. package/dist/routes/app-settings.js.map +1 -1
  508. package/dist/routes/commits-tab.cjs +2 -0
  509. package/dist/routes/commits-tab.cjs.map +1 -0
  510. package/dist/routes/commits-tab.d.ts +8 -0
  511. package/dist/routes/commits-tab.js +45 -0
  512. package/dist/routes/commits-tab.js.map +1 -0
  513. package/dist/routes/files-tab.cjs +1 -1
  514. package/dist/routes/files-tab.cjs.map +1 -1
  515. package/dist/routes/files-tab.js +148 -127
  516. package/dist/routes/files-tab.js.map +1 -1
  517. package/dist/services/cloud-funnel-analytics.cjs +2 -0
  518. package/dist/services/cloud-funnel-analytics.cjs.map +1 -0
  519. package/dist/services/cloud-funnel-analytics.d.ts +12 -0
  520. package/dist/services/cloud-funnel-analytics.js +53 -0
  521. package/dist/services/cloud-funnel-analytics.js.map +1 -0
  522. package/dist/services/telemetry.cjs +1 -1
  523. package/dist/services/telemetry.cjs.map +1 -1
  524. package/dist/services/telemetry.js +49 -47
  525. package/dist/services/telemetry.js.map +1 -1
  526. package/dist/types/agent-server/core/base/action.d.ts +5 -4
  527. package/dist/types/agent-server/core/base/base.d.ts +3 -2
  528. package/dist/types/agent-server/core/base/observation.d.ts +1 -1
  529. package/dist/types/agent-server/type-guards.cjs +1 -1
  530. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  531. package/dist/types/agent-server/type-guards.d.ts +3 -5
  532. package/dist/types/agent-server/type-guards.js +2 -1
  533. package/dist/types/agent-server/type-guards.js.map +1 -1
  534. package/dist/types/automation.d.ts +5 -0
  535. package/dist/utils/api-error-message.d.ts +11 -0
  536. package/dist/utils/automation-timeout.d.ts +19 -0
  537. package/dist/utils/base-path.cjs +2 -0
  538. package/dist/utils/base-path.cjs.map +1 -0
  539. package/dist/utils/base-path.d.ts +2 -0
  540. package/dist/utils/base-path.js +23 -0
  541. package/dist/utils/base-path.js.map +1 -0
  542. package/package.json +2 -2
  543. package/scripts/check-sdk-version-sync.mjs +6 -6
  544. package/scripts/dev-safe.mjs +7 -8
  545. package/scripts/dev-static.mjs +3 -0
  546. package/scripts/dev-with-automation.mjs +3 -0
  547. package/scripts/docker-build.mjs +4 -0
  548. package/scripts/static-server.mjs +93 -7
  549. package/tools/canvas_ui_tool.py +14 -8
  550. package/build/assets/active-backend-context-hxq31W25.js +0 -1
  551. package/build/assets/agent-server-client-options-DVLRd9sw.js +0 -1
  552. package/build/assets/agent-server-conversation-service.api-CuSdr4Qb.js +0 -5
  553. package/build/assets/agent-settings-D_yOy8XB.js +0 -1
  554. package/build/assets/api-key-entry-screen-Dl0qVYi4.js +0 -1
  555. package/build/assets/app-settings-yVizGXox.js +0 -1
  556. package/build/assets/automation-detail-dvJfLs5u.js +0 -2
  557. package/build/assets/automation-export-BPcgLqPD.js +0 -2
  558. package/build/assets/automations-list-CUXogTe0.js +0 -1
  559. package/build/assets/backend-form-modal-CQJGmItq.js +0 -1
  560. package/build/assets/browser-store-BI6uklCG.js +0 -1
  561. package/build/assets/check-Bvi71siz.js +0 -1
  562. package/build/assets/condenser-settings-Ca8fYZ_Z.js +0 -1
  563. package/build/assets/conversation-9NBSRoR9.js +0 -1
  564. package/build/assets/conversation-BXg6Oti2.js +0 -89
  565. package/build/assets/conversation-panel-CZri9Rup.js +0 -1
  566. package/build/assets/conversation-service.api-DPBQvTKD.js +0 -1
  567. package/build/assets/conversation-state-store-B2Bp32XI.js +0 -1
  568. package/build/assets/declaration-gq8V5eTU.js +0 -1
  569. package/build/assets/files-tab-UVoray88.js +0 -1
  570. package/build/assets/git-provider-icon-o6hdnJUB.js +0 -1
  571. package/build/assets/home-D1IHvGTN.js +0 -1
  572. package/build/assets/index-redirect-CUUJiNki.js +0 -1
  573. package/build/assets/install-server-modal-BbuQaA2w.js +0 -1
  574. package/build/assets/lesson-plan-jC0HBoe6.js +0 -4
  575. package/build/assets/llm-not-configured-banner-DoARbcdL.js +0 -27
  576. package/build/assets/llm-settings-4JMLV8mq.js +0 -1
  577. package/build/assets/llm-settings-D91gMw3U.js +0 -1
  578. package/build/assets/llm-subscription-service-CKyaV24y.js +0 -1
  579. package/build/assets/loader-circle-BEykUKYG.js +0 -1
  580. package/build/assets/manage-backends-modal-DkWAMSle.js +0 -1
  581. package/build/assets/manifest-aa5c29f6.js +0 -1
  582. package/build/assets/model-selector-BfqpMkSJ.js +0 -1
  583. package/build/assets/mouse-pointer-click-PdEQPL6v.js +0 -1
  584. package/build/assets/onboarding-Bu-HN1ze.js +0 -1
  585. package/build/assets/onboarding-modal-CZgjs5Bx.js +0 -1
  586. package/build/assets/option-service.api-BrZ5q87N.js +0 -1
  587. package/build/assets/organization-service.api-Bk4pCGU1.js +0 -1
  588. package/build/assets/path-utils-CSmuZoix.js +0 -1
  589. package/build/assets/plugins-management-service-BRBLxvUl.js +0 -1
  590. package/build/assets/profiles-service.api-BMXQ9pZC.js +0 -1
  591. package/build/assets/providers-BpO967xS.js +0 -1
  592. package/build/assets/proxy-BgJLtxu7.js +0 -1
  593. package/build/assets/root-BM5WgQ4_.js +0 -2
  594. package/build/assets/root-V8fkplMy.css +0 -1
  595. package/build/assets/root-layout-BdoyoobY.js +0 -2
  596. package/build/assets/schema-field-BSHrUMme.js +0 -1
  597. package/build/assets/sdk-section-page-t82gsOqa.js +0 -1
  598. package/build/assets/search-4DHskuhE.js +0 -1
  599. package/build/assets/secrets-service-B2GqPV0N.js +0 -1
  600. package/build/assets/settings-DmPLkgq0.js +0 -1
  601. package/build/assets/settings-modal-CwrZKrTq.js +0 -1
  602. package/build/assets/settings-service.api-Ce-ub11I.js +0 -1
  603. package/build/assets/shared-conversation-BDREQPnE.js +0 -1
  604. package/build/assets/skills-plugins-2Y44YHbO.js +0 -1
  605. package/build/assets/use-acp-credential-form-MzZM6D7D.js +0 -1
  606. package/build/assets/use-agent-profiles-DwZxnwO5.js +0 -1
  607. package/build/assets/use-backends-health-CRHzuvxO.js +0 -1
  608. package/build/assets/use-cloud-current-user-id-utFreJ0i.js +0 -1
  609. package/build/assets/use-config-mJrtZHP1.js +0 -1
  610. package/build/assets/use-create-conversation-DdqsP78F.js +0 -1
  611. package/build/assets/use-is-authed-B6M0mcGL.js +0 -1
  612. package/build/assets/use-llm-profiles-RC-PkpBl.js +0 -1
  613. package/build/assets/use-plugins-marketplace-FHlbeQ4c.js +0 -1
  614. package/build/assets/use-runtime-is-ready-RKj2WmEh.js +0 -1
  615. package/build/assets/use-save-agent-profile-tvDP15mh.js +0 -1
  616. package/build/assets/use-settings-CH5LzXD8.js +0 -1
  617. package/build/assets/use-settings-nav-items-Dwktv8wo.js +0 -16
  618. package/build/assets/use-skills-CSzSL6HG.js +0 -1
  619. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~lf310vj7-CSVPGId3.js +0 -10
  620. package/build/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nfpll1wp-BCpa95De.js +0 -177
  621. package/build/assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CqXiHwjU.js +0 -2
  622. package/build/assets/x-Cb0WAtak.js +0 -1
  623. /package/build/assets/{__vite-browser-external-4xJsU2-u.js → __vite-browser-external-DU-Cb_sT.js} +0 -0
  624. /package/build/assets/{automation-BU8zu-FP.js → automation-BVEmGghX.js} +0 -0
  625. /package/build/assets/{checkmark-h7udgXMM.js → checkmark-DhcMGwtO.js} +0 -0
  626. /package/build/assets/{close-p3Op5lxI.js → close-DO5Rq_CS.js} +0 -0
  627. /package/build/assets/{code-tag-DYlAhEQY.js → code-tag-BvjtzUsr.js} +0 -0
  628. /package/build/assets/{color-themes-DPBzNtVg.js → color-themes-bVMmJJG6.js} +0 -0
  629. /package/build/assets/{common-Dh7OqABE.js → common-CxbUL3nR.js} +0 -0
  630. /package/build/assets/{conversation-local-storage-F6zVMM--.js → conversation-local-storage-B31voBg7.js} +0 -0
  631. /package/build/assets/{copy-BLmGeJcd.js → copy-DLUw2us-.js} +0 -0
  632. /package/build/assets/{createLucideIcon-CVAsW2Yo.js → createLucideIcon-D4Tak8A1.js} +0 -0
  633. /package/build/assets/{dist-CodhvuAP.js → dist-Dj01FXbZ.js} +0 -0
  634. /package/build/assets/{environment-switch-store-DkjlKWzN.js → environment-switch-store-D9hB9PvY.js} +0 -0
  635. /package/build/assets/{extension-module-card-classes-9V3J9J_b.js → extension-module-card-classes-BlO4w702.js} +0 -0
  636. /package/build/assets/{folder-mMWFvaw0.js → folder-ynxP2EIL.js} +0 -0
  637. /package/build/assets/{get-language-from-path-CPNnuVhI.js → get-language-from-path-rWEQrOGU.js} +0 -0
  638. /package/build/assets/{git-status-mapper-BI8FyUVp.js → git-status-mapper-C3rfzUex.js} +0 -0
  639. /package/build/assets/{handle-capture-consent-CPMXU29K.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
  640. /package/build/assets/{iconBase-DaTRRUjy.js → iconBase-CuvxAQZ5.js} +0 -0
  641. /package/build/assets/{link-external-DfKQroKX.js → link-external-BVDiJfZt.js} +0 -0
  642. /package/build/assets/{llm-subscription-DtsX5Lhg.js → llm-subscription-BkdHwtQe.js} +0 -0
  643. /package/build/assets/{map-provider-BM2SJarp.js → map-provider-XSFHmdDs.js} +0 -0
  644. /package/build/assets/{middleware-DYHYNAnP.js → middleware-CWYDMVuG.js} +0 -0
  645. /package/build/assets/{modal-backdrop-zVwfOJZr.js → modal-backdrop-Dsmzgr5s.js} +0 -0
  646. /package/build/assets/{navigation-context-DPs2G0X8.js → navigation-context-SjzfpygH.js} +0 -0
  647. /package/build/assets/{objectWithoutPropertiesLoose-BgYIAs2y.js → objectWithoutPropertiesLoose-CQwg6tC0.js} +0 -0
  648. /package/build/assets/{openhands-logo-bcNw5bkY.js → openhands-logo-C-gDp1wr.js} +0 -0
  649. /package/build/assets/{react-DPDgL6du.js → react-ao3tWj6K.js} +0 -0
  650. /package/build/assets/{search-BsjCEFNf.js → search-pb4UKTfK.js} +0 -0
  651. /package/build/assets/{settings-mQUckT0g.js → settings-DksoDv5z.js} +0 -0
  652. /package/build/assets/{settings-gear-MXCyZW0x.js → settings-gear-D_HVvE5L.js} +0 -0
  653. /package/build/assets/{settings-like-page-layout-classes-DENKlZpD.js → settings-like-page-layout-classes-DLrsPCaI.js} +0 -0
  654. /package/build/assets/{settings-section-header-context-COMOIaxV.js → settings-section-header-context-C2MUIG88.js} +0 -0
  655. /package/build/assets/{skills-9cDZONKh.js → skills-CH4xgIh-.js} +0 -0
  656. /package/build/assets/{switch-skeleton-DqQwalyu.js → switch-skeleton-BpSOvZ-n.js} +0 -0
  657. /package/build/assets/{terminal-BuLtIrb9.js → terminal-Dokfkxn0.js} +0 -0
  658. /package/build/assets/{u-check-circle-BqoIxNz_.js → u-check-circle-DPWVO-9N.js} +0 -0
  659. /package/build/assets/{u-check-circle-half-LiwZkuFe.js → u-check-circle-half-BGNAAjOW.js} +0 -0
  660. /package/build/assets/{u-edit-DJ90xc8Z.js → u-edit-BIskOoEG.js} +0 -0
  661. /package/build/assets/{use-breakpoint-B-O0lQ84.js → use-breakpoint-OjLm94cF.js} +0 -0
  662. /package/build/assets/{use-click-outside-element-Bf4Omzot.js → use-click-outside-element-Jpt2WWd7.js} +0 -0
  663. /package/build/assets/{use-onboarding-completion-C_Swglzp.js → use-onboarding-completion-DkRpDTsD.js} +0 -0
  664. /package/build/assets/{v4-DbCkTSoU.js → v4-DPgam_jW.js} +0 -0
  665. /package/build/assets/{vendor~browser-Dqd33JyP.js → vendor~browser-BvEKaLBz.js} +0 -0
  666. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DHDkknt5.js → vendor~conversation-panel~conversation~alert-banner-CznX01nZ.js} +0 -0
  667. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~epa72zsm-B4rXs7Zd.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js} +0 -0
  668. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~ivvrgjsa-BlIZPCXX.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g9hift2g-DmmpG9SI.js} +0 -0
  669. /package/build/assets/{vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js} +0 -0
  670. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DTzw2x50.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BuL5kjfS.js} +0 -0
  671. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js → vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-DUYl8gbZ.js} +0 -0
  672. /package/build/assets/{vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js → vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-pIgQDxTc.js} +0 -0
  673. /package/build/assets/{vendor~terminal-aeP3PnKf.js → vendor~terminal-jAaNQWS9.js} +0 -0
  674. /package/build/assets/{x-mark-Batp6gXa.js → x-mark-C5przfXl.js} +0 -0
@@ -1,59 +1,5 @@
1
- /**
2
- * OAuth 2.0 Device Flow client implementation (RFC 8628).
3
- *
4
- * Used for one-click authentication with cloud backends.
5
- * The flow allows users to authenticate in their browser while the
6
- * application polls for the resulting API key.
7
- *
8
- * Device flow requests go directly to the configured OpenHands Cloud host.
9
- */
10
- export declare class DeviceFlowError extends Error {
11
- readonly code?: string | undefined;
12
- constructor(message: string, code?: string | undefined);
13
- }
14
- export interface DeviceAuthorizationResponse {
15
- device_code: string;
16
- user_code: string;
17
- verification_uri: string;
18
- verification_uri_complete: string;
19
- expires_in: number;
20
- interval: number;
21
- }
22
- export interface DeviceTokenResponse {
23
- access_token: string;
24
- token_type: string;
25
- expires_in?: number;
26
- }
27
- /**
28
- * Check if a host is a known OpenHands Cloud domain.
29
- * Uses hostname extraction to prevent substring matching attacks.
30
- */
31
- export declare function isOpenHandsCloudHost(host: string): boolean;
32
- /**
33
- * Start the OAuth 2.0 Device Flow by requesting a device code.
34
- * Requests are sent directly to the cloud host.
35
- *
36
- * @param host - The cloud backend host URL (e.g., "https://app.all-hands.dev")
37
- * @returns DeviceAuthorizationResponse with device_code, user_code, verification URLs, etc.
38
- * @throws DeviceFlowError if the request fails
39
- */
1
+ import type { DeviceAuthorizationResponse, DeviceTokenResponse, PollDeviceTokenOptions } from "@openhands/typescript-client/client/device-flow-client";
2
+ export { DeviceFlowError, isOpenHandsCloudHost, } from "@openhands/typescript-client/client/device-flow-client";
40
3
  export declare function startDeviceFlow(host: string): Promise<DeviceAuthorizationResponse>;
41
- export interface PollOptions {
42
- /** Polling interval in seconds (from device authorization response) */
43
- interval: number;
44
- /** Maximum time to wait for authorization in milliseconds */
45
- timeout?: number;
46
- /** Abort signal to cancel polling */
47
- signal?: AbortSignal;
48
- }
49
- /**
50
- * Poll for the API key after user authorization.
51
- * Requests are sent directly to the cloud host.
52
- *
53
- * @param host - The cloud backend host URL
54
- * @param deviceCode - The device code from startDeviceFlow
55
- * @param options - Polling options including interval, timeout, and abort signal
56
- * @returns DeviceTokenResponse containing the access_token (API key)
57
- * @throws DeviceFlowError if polling fails, user denies access, or timeout expires
58
- */
59
- export declare function pollForToken(host: string, deviceCode: string, options: PollOptions): Promise<DeviceTokenResponse>;
4
+ export declare function pollForToken(host: string, deviceCode: string, options: PollDeviceTokenOptions): Promise<DeviceTokenResponse>;
5
+ export type { DeviceAuthorizationResponse, DeviceTokenResponse, PollDeviceTokenOptions as PollOptions, } from "@openhands/typescript-client/client/device-flow-client";
@@ -1,106 +1,16 @@
1
+ import { pollForToken as e, startDeviceFlow as t } from "../node_modules/@openhands/typescript-client/dist/client/device-flow-client.js";
2
+ import { AGENT_CANVAS_CLIENT_HEADERS as n } from "./client-source.js";
1
3
  //#region src/api/device-flow-client.ts
2
- var e = class extends Error {
3
- constructor(e, t) {
4
- super(e), this.code = t, this.name = "DeviceFlowError";
5
- }
6
- }, t = 6e5, n = 3e4;
7
4
  function r(e) {
8
- try {
9
- let t = e.trim().toLowerCase(), n = /^https?:\/\//i.test(t) ? t : `https://${t}`, r = new URL(n).hostname;
10
- return r.endsWith(".all-hands.dev") || r === "all-hands.dev" || r.endsWith(".openhands.dev") || r === "openhands.dev";
11
- } catch {
12
- return !1;
13
- }
5
+ return t(e, { headers: n });
14
6
  }
15
- async function i(e, t, n, r, i, a) {
16
- let o = r === void 0 ? void 0 : typeof r == "string" || r instanceof Blob || r instanceof FormData || r instanceof URLSearchParams ? r : JSON.stringify(r);
17
- return await fetch(`${e.replace(/\/+$/, "")}${n}`, {
18
- method: t,
19
- headers: { ...i ? { "Content-Type": i } : {} },
20
- body: o,
21
- signal: a
22
- });
23
- }
24
- async function a(t) {
25
- let n = t.replace(/\/+$/, "");
26
- try {
27
- let t = await i(n, "POST", "/oauth/device/authorize", {}, "application/json");
28
- if (!t.ok) throw new e(`Failed to start device flow: Server returned ${t.status}`);
29
- let r = await t.json();
30
- if (!r.device_code || !r.user_code || !r.verification_uri) throw new e("Invalid response from device authorization endpoint: missing required fields");
31
- let a = r.verification_uri_complete ?? `${r.verification_uri}?user_code=${encodeURIComponent(r.user_code)}`;
32
- return {
33
- device_code: r.device_code,
34
- user_code: r.user_code,
35
- verification_uri: r.verification_uri,
36
- verification_uri_complete: a,
37
- expires_in: r.expires_in ?? 600,
38
- interval: r.interval ?? 5
39
- };
40
- } catch (t) {
41
- throw t instanceof e ? t : new e(`Failed to start device flow: ${t instanceof Error ? t.message : String(t)}`);
42
- }
43
- }
44
- async function o(r, a, o) {
45
- let c = r.replace(/\/+$/, ""), l = o.timeout ?? t, u = Math.max(1, o.interval) * 1e3, d = Date.now();
46
- for (; Date.now() - d < l;) {
47
- if (o.signal?.aborted) throw new e("Authorization cancelled", "cancelled");
48
- try {
49
- let t = await i(c, "POST", "/oauth/device/token", new URLSearchParams({
50
- grant_type: "urn:ietf:params:oauth:grant-type:device_code",
51
- device_code: a
52
- }).toString(), "application/x-www-form-urlencoded", o.signal);
53
- if (t.ok) {
54
- let n = await t.json();
55
- if (!n.access_token) throw new e("Invalid token response: missing access_token");
56
- return {
57
- access_token: n.access_token,
58
- token_type: n.token_type ?? "Bearer",
59
- expires_in: n.expires_in
60
- };
61
- }
62
- let r;
63
- try {
64
- r = await t.json();
65
- } catch {
66
- throw new e(`Unexpected response from server: ${t.status}`);
67
- }
68
- let { error: s, error_description: l } = r;
69
- switch (s) {
70
- case "authorization_pending": break;
71
- case "slow_down":
72
- u = typeof r.interval == "number" && isFinite(r.interval) && r.interval > 0 ? Math.max(1, Math.min(r.interval, 30)) * 1e3 : Math.min(u + 5e3, n);
73
- break;
74
- case "expired_token": throw new e("Device code has expired. Please try again.", "expired_token");
75
- case "access_denied": throw new e("Authorization request was denied.", "access_denied");
76
- default: throw new e(`Authorization error: ${s}${l ? ` - ${l}` : ""}`, s);
77
- }
78
- } catch (t) {
79
- if (t instanceof e) throw t;
80
- if (t instanceof DOMException && t.name === "AbortError") throw new e("Authorization cancelled", "cancelled");
81
- console.warn("Network error during polling, retrying:", t);
82
- }
83
- try {
84
- await s(u, o.signal);
85
- } catch (t) {
86
- throw t instanceof DOMException && t.name === "AbortError" ? new e("Authorization cancelled", "cancelled") : t;
87
- }
88
- }
89
- throw new e("Timeout waiting for authorization. Please try again.", "timeout");
90
- }
91
- function s(e, t) {
92
- return new Promise((n, r) => {
93
- if (t?.aborted) {
94
- r(new DOMException("Aborted", "AbortError"));
95
- return;
96
- }
97
- let i = setTimeout(n, e);
98
- t?.addEventListener("abort", () => {
99
- clearTimeout(i), r(new DOMException("Aborted", "AbortError"));
100
- }, { once: !0 });
7
+ function i(t, r, i) {
8
+ return e(t, r, {
9
+ ...i,
10
+ headers: n
101
11
  });
102
12
  }
103
13
  //#endregion
104
- export { e as DeviceFlowError, r as isOpenHandsCloudHost, o as pollForToken, a as startDeviceFlow };
14
+ export { i as pollForToken, r as startDeviceFlow };
105
15
 
106
16
  //# sourceMappingURL=device-flow-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"device-flow-client.js","names":[],"sources":["../../src/api/device-flow-client.ts"],"sourcesContent":["/**\n * OAuth 2.0 Device Flow client implementation (RFC 8628).\n *\n * Used for one-click authentication with cloud backends.\n * The flow allows users to authenticate in their browser while the\n * application polls for the resulting API key.\n *\n * Device flow requests go directly to the configured OpenHands Cloud host.\n */\n\nexport class DeviceFlowError extends Error {\n constructor(\n message: string,\n public readonly code?: string,\n ) {\n super(message);\n this.name = \"DeviceFlowError\";\n }\n}\n\nexport interface DeviceAuthorizationResponse {\n device_code: string;\n user_code: string;\n verification_uri: string;\n verification_uri_complete: string;\n expires_in: number;\n interval: number;\n}\n\nexport interface DeviceTokenResponse {\n access_token: string;\n token_type: string;\n expires_in?: number;\n}\n\ninterface DeviceTokenErrorResponse {\n error: string;\n error_description?: string;\n interval?: number;\n}\n\nconst DEFAULT_TIMEOUT_MS = 600_000; // 10 minutes\nconst MAX_INTERVAL_MS = 30_000; // 30 seconds max polling interval\n\n/**\n * Check if a host is a known OpenHands Cloud domain.\n * Uses hostname extraction to prevent substring matching attacks.\n */\nexport function isOpenHandsCloudHost(host: string): boolean {\n try {\n // Extract hostname from URL or treat as hostname if no protocol\n const trimmed = host.trim().toLowerCase();\n const withProtocol = /^https?:\\/\\//i.test(trimmed)\n ? trimmed\n : `https://${trimmed}`;\n const url = new URL(withProtocol);\n const hostname = url.hostname;\n\n // Check if hostname ends with known domains (exact suffix match)\n return (\n hostname.endsWith(\".all-hands.dev\") ||\n hostname === \"all-hands.dev\" ||\n hostname.endsWith(\".openhands.dev\") ||\n hostname === \"openhands.dev\"\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Make a direct request to the OpenHands Cloud device-flow endpoint.\n */\nasync function makeCloudRequest(\n upstreamHost: string,\n method: \"GET\" | \"POST\",\n path: string,\n body?: unknown,\n contentType?: string,\n signal?: AbortSignal,\n): Promise<Response> {\n const requestBody =\n body === undefined\n ? undefined\n : typeof body === \"string\" ||\n body instanceof Blob ||\n body instanceof FormData ||\n body instanceof URLSearchParams\n ? body\n : JSON.stringify(body);\n\n const response = await fetch(`${upstreamHost.replace(/\\/+$/, \"\")}${path}`, {\n method,\n headers: {\n ...(contentType ? { \"Content-Type\": contentType } : {}),\n },\n body: requestBody,\n signal,\n });\n\n return response;\n}\n\n/**\n * Start the OAuth 2.0 Device Flow by requesting a device code.\n * Requests are sent directly to the cloud host.\n *\n * @param host - The cloud backend host URL (e.g., \"https://app.all-hands.dev\")\n * @returns DeviceAuthorizationResponse with device_code, user_code, verification URLs, etc.\n * @throws DeviceFlowError if the request fails\n */\nexport async function startDeviceFlow(\n host: string,\n): Promise<DeviceAuthorizationResponse> {\n const normalizedHost = host.replace(/\\/+$/, \"\");\n\n try {\n const response = await makeCloudRequest(\n normalizedHost,\n \"POST\",\n \"/oauth/device/authorize\",\n {},\n \"application/json\",\n );\n\n if (!response.ok) {\n // Avoid exposing sensitive server error details\n throw new DeviceFlowError(\n `Failed to start device flow: Server returned ${response.status}`,\n );\n }\n\n const data = await response.json();\n\n // Validate required fields per RFC 8628 Section 3.2\n // verification_uri_complete is OPTIONAL per RFC\n if (!data.device_code || !data.user_code || !data.verification_uri) {\n throw new DeviceFlowError(\n \"Invalid response from device authorization endpoint: missing required fields\",\n );\n }\n\n // Build verification_uri_complete if not provided (optional per RFC)\n const verificationUriComplete =\n data.verification_uri_complete ??\n `${data.verification_uri}?user_code=${encodeURIComponent(data.user_code)}`;\n\n return {\n device_code: data.device_code,\n user_code: data.user_code,\n verification_uri: data.verification_uri,\n verification_uri_complete: verificationUriComplete,\n expires_in: data.expires_in ?? 600,\n interval: data.interval ?? 5,\n };\n } catch (error) {\n if (error instanceof DeviceFlowError) {\n throw error;\n }\n throw new DeviceFlowError(\n `Failed to start device flow: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n}\n\nexport interface PollOptions {\n /** Polling interval in seconds (from device authorization response) */\n interval: number;\n /** Maximum time to wait for authorization in milliseconds */\n timeout?: number;\n /** Abort signal to cancel polling */\n signal?: AbortSignal;\n}\n\n/**\n * Poll for the API key after user authorization.\n * Requests are sent directly to the cloud host.\n *\n * @param host - The cloud backend host URL\n * @param deviceCode - The device code from startDeviceFlow\n * @param options - Polling options including interval, timeout, and abort signal\n * @returns DeviceTokenResponse containing the access_token (API key)\n * @throws DeviceFlowError if polling fails, user denies access, or timeout expires\n */\nexport async function pollForToken(\n host: string,\n deviceCode: string,\n options: PollOptions,\n): Promise<DeviceTokenResponse> {\n const normalizedHost = host.replace(/\\/+$/, \"\");\n const timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;\n let interval = Math.max(1, options.interval) * 1000; // At least 1 second\n const startTime = Date.now();\n\n while (Date.now() - startTime < timeout) {\n // Check if cancelled\n if (options.signal?.aborted) {\n throw new DeviceFlowError(\"Authorization cancelled\", \"cancelled\");\n }\n\n try {\n // RFC 8628 Section 3.4 requires grant_type parameter\n const tokenRequestBody = new URLSearchParams({\n grant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n device_code: deviceCode,\n }).toString();\n\n const response = await makeCloudRequest(\n normalizedHost,\n \"POST\",\n \"/oauth/device/token\",\n tokenRequestBody,\n \"application/x-www-form-urlencoded\",\n options.signal,\n );\n\n if (response.ok) {\n const data = await response.json();\n if (!data.access_token) {\n throw new DeviceFlowError(\n \"Invalid token response: missing access_token\",\n );\n }\n return {\n access_token: data.access_token,\n token_type: data.token_type ?? \"Bearer\",\n expires_in: data.expires_in,\n };\n }\n\n // Handle error responses\n let errorData: DeviceTokenErrorResponse;\n try {\n errorData = await response.json();\n } catch {\n throw new DeviceFlowError(\n `Unexpected response from server: ${response.status}`,\n );\n }\n\n const { error, error_description } = errorData;\n\n switch (error) {\n case \"authorization_pending\":\n // User hasn't finished yet; continue polling\n break;\n\n case \"slow_down\":\n // Server asks us to poll less frequently\n // RFC 8628 Section 3.5: \"the client MUST increase its polling interval by 5 seconds\"\n // Validate server-provided interval to prevent DoS (must be number, finite, positive)\n if (\n typeof errorData.interval === \"number\" &&\n isFinite(errorData.interval) &&\n errorData.interval > 0\n ) {\n interval = Math.max(1, Math.min(errorData.interval, 30)) * 1000;\n } else {\n // RFC 8628 mandates incrementing by 5 seconds\n interval = Math.min(interval + 5000, MAX_INTERVAL_MS);\n }\n break;\n\n case \"expired_token\":\n throw new DeviceFlowError(\n \"Device code has expired. Please try again.\",\n \"expired_token\",\n );\n\n case \"access_denied\":\n throw new DeviceFlowError(\n \"Authorization request was denied.\",\n \"access_denied\",\n );\n\n default:\n throw new DeviceFlowError(\n `Authorization error: ${error}${error_description ? ` - ${error_description}` : \"\"}`,\n error,\n );\n }\n } catch (error) {\n // DeviceFlowError means a definitive error (denied, expired, etc.) - rethrow\n if (error instanceof DeviceFlowError) {\n throw error;\n }\n // User cancelled - rethrow\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new DeviceFlowError(\"Authorization cancelled\", \"cancelled\");\n }\n // Network errors during polling should continue until timeout, not fail immediately\n // Brief network hiccups shouldn't abort 10-minute flows\n console.warn(\"Network error during polling, retrying:\", error);\n }\n\n // Wait before next poll (wrap in try-catch for consistent abort handling)\n try {\n await sleep(interval, options.signal);\n } catch (error) {\n if (error instanceof DOMException && error.name === \"AbortError\") {\n throw new DeviceFlowError(\"Authorization cancelled\", \"cancelled\");\n }\n throw error;\n }\n }\n\n throw new DeviceFlowError(\n \"Timeout waiting for authorization. Please try again.\",\n \"timeout\",\n );\n}\n\n/**\n * Sleep for a given duration, respecting an optional abort signal.\n */\nfunction sleep(ms: number, signal?: AbortSignal): Promise<void> {\n return new Promise((resolve, reject) => {\n if (signal?.aborted) {\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n return;\n }\n\n const timeoutId = setTimeout(resolve, ms);\n\n signal?.addEventListener(\n \"abort\",\n () => {\n clearTimeout(timeoutId);\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n },\n { once: true },\n );\n });\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"device-flow-client.js","names":[],"sources":["../../src/api/device-flow-client.ts"],"sourcesContent":["import {\n pollForToken as sdkPollForToken,\n startDeviceFlow as sdkStartDeviceFlow,\n} from \"@openhands/typescript-client/client/device-flow-client\";\nimport type {\n DeviceAuthorizationResponse,\n DeviceTokenResponse,\n PollDeviceTokenOptions,\n} from \"@openhands/typescript-client/client/device-flow-client\";\nimport { AGENT_CANVAS_CLIENT_HEADERS } from \"./client-source\";\n\nexport {\n DeviceFlowError,\n isOpenHandsCloudHost,\n} from \"@openhands/typescript-client/client/device-flow-client\";\n\nexport function startDeviceFlow(\n host: string,\n): Promise<DeviceAuthorizationResponse> {\n return sdkStartDeviceFlow(host, { headers: AGENT_CANVAS_CLIENT_HEADERS });\n}\n\nexport function pollForToken(\n host: string,\n deviceCode: string,\n options: PollDeviceTokenOptions,\n): Promise<DeviceTokenResponse> {\n return sdkPollForToken(host, deviceCode, {\n ...options,\n headers: AGENT_CANVAS_CLIENT_HEADERS,\n });\n}\n\nexport type {\n DeviceAuthorizationResponse,\n DeviceTokenResponse,\n PollDeviceTokenOptions as PollOptions,\n} from \"@openhands/typescript-client/client/device-flow-client\";\n"],"mappings":";;;AAgBA,SAAgB,EACd,GACsC;AACtC,QAAO,EAAmB,GAAM,EAAE,SAAS,GAA6B,CAAC;;AAG3E,SAAgB,EACd,GACA,GACA,GAC8B;AAC9B,QAAO,EAAgB,GAAM,GAAY;EACvC,GAAG;EACH,SAAS;EACV,CAAC"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`../agent-server-client-options.cjs`),n=require(`../cloud/proxy.cjs`),r=require(`../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs`),i=require(`../../utils/git-status-mapper.cjs`);function a(e){return e.startsWith(`/`)?e:`/${e}`}var o=class{static async getGitChanges(o,s,c,l){let u=e.getActiveBackend().backend;if(u.kind===`cloud`&&o){let e=new URLSearchParams;e.set(`path`,a(l));let t=await n.callCloudProxy({backend:u,method:`GET`,path:`/api/v1/app-conversations/${o}/git/changes?${e.toString()}`});if(!Array.isArray(t))throw Error(`Invalid response from runtime - runtime may be unavailable`);return t.map(e=>({status:i.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}let d=await new r.RemoteWorkspace(t.getAgentServerClientOptions({conversationUrl:s,sessionApiKey:c})).gitChanges(l);if(!Array.isArray(d))throw Error(`Invalid response from runtime - runtime may be unavailable`);return d.map(e=>({status:i.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}static async getGitChangeDiff(i,o,s,c){let l=e.getActiveBackend().backend;if(l.kind===`cloud`&&i){let e=new URLSearchParams;e.set(`path`,a(c));let t=await n.callCloudProxy({backend:l,method:`GET`,path:`/api/v1/app-conversations/${i}/git/diff?${e.toString()}`});return{modified:t?.modified??``,original:t?.original??``,...t?.diff?{diff:t.diff}:{}}}let u=await new r.RemoteWorkspace(t.getAgentServerClientOptions({conversationUrl:o,sessionApiKey:s})).gitDiff(c);return{modified:u.modified??``,original:u.original??``,...u.diff?{diff:u.diff}:{}}}};exports.default=o;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/websocket-url.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../agent-server-client-options.cjs`),r=require(`../agent-server-compatibility.cjs`),i=require(`../../node_modules/axios/index.cjs`),a=require(`../cloud/proxy.cjs`),o=require(`../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs`),s=require(`../../utils/git-status-mapper.cjs`);function c(e){return e.startsWith(`/`)?e:`/${e}`}async function l(r,i,s,l){let u=t.getActiveBackend().backend;if(u.kind===`cloud`&&r){let t=new URLSearchParams({...l,path:c(l.path)});return a.callCloudProxy({backend:u,method:`GET`,hostOverride:e.buildHttpBaseUrl(r),path:`${s}?${t.toString()}`,authMode:`session-api-key`,sessionApiKey:i??void 0})}return(await new o.RemoteWorkspace(n.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).client.get(s,{params:l})).data}function u(e){return r.isSdkHttpStatusError(e,404)||i.isAxiosError(e)&&e.response?.status===404}var d=class{static async getGitChanges(e,r,i,l){let u=t.getActiveBackend().backend;if(u.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,c(l));let n=await a.callCloudProxy({backend:u,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:s.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}let d=await new o.RemoteWorkspace(n.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).gitChanges(l);if(!Array.isArray(d))throw Error(`Invalid response from runtime - runtime may be unavailable`);return d.map(e=>({status:s.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await l(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(u(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await l(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:s.mapAnyGitStatusToClientStatus(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,r,i,s,u){if(u){let e=await l(r,i,`/api/git/diff`,{path:s,commit:u});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let d=t.getActiveBackend().backend;if(d.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,c(s));let n=await a.callCloudProxy({backend:d,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let f=await new o.RemoteWorkspace(n.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).gitDiff(s);return{modified:f.modified??``,original:f.original??``,...f.diff?{diff:f.diff}:{}}}};exports.default=d;
2
2
  //# sourceMappingURL=agent-server-git-service.api.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-server-git-service.api.cjs","names":[],"sources":["../../../src/api/git-service/agent-server-git-service.api.ts"],"sourcesContent":["import { RemoteWorkspace } from \"@openhands/typescript-client/workspace/remote-workspace\";\nimport { mapAnyGitStatusToClientStatus } from \"#/utils/git-status-mapper\";\nimport type { GitChange, GitChangeDiff } from \"../open-hands.types\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport { getAgentServerClientOptions } from \"../agent-server-client-options\";\n\ninterface AgentServerGitChange {\n status: string;\n path: string;\n}\n\n/**\n * Git operations for agent-server conversations.\n *\n * In **local** mode the runtime is reachable directly from the browser\n * (it's `127.0.0.1:18000`); the SDK's `RemoteWorkspace` calls land\n * fine. In **cloud** mode the runtime is at\n * `*.prod-runtime.all-hands.dev`, which doesn't allow CORS from\n * `localhost`. So cloud-mode calls hit the cloud API's\n * `GET /api/v1/app-conversations/{id}/git/{changes,diff}` proxy\n * endpoints instead — the server resolves the conversation's runtime\n * and makes the hop itself with the sandbox's session API key, and the\n * cloud API's CORS is permissive for bearer-token requests.\n */\n\n/**\n * The cloud runtime's `/api/git/{changes,diff}` endpoints prepend\n * `/workspace/` to relative paths (so a relative arg like\n * `workspace/project` becomes `/workspace/workspace/project` and 404s).\n * `getGitPath` returns the local agent-server's relative convention by\n * default; normalize to an absolute path before sending to the cloud\n * runtime.\n */\nfunction toAbsoluteRuntimePath(path: string): string {\n return path.startsWith(\"/\") ? path : `/${path}`;\n}\n\nclass AgentServerGitService {\n static async getGitChanges(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n ): Promise<GitChange[]> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const data = await callCloudProxy<AgentServerGitChange[]>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/changes?${params.toString()}`,\n });\n if (!Array.isArray(data)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n return data.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n // No `ref`: let the server auto-detect the base (origin branch /\n // merge-base), so changes the agent has already committed still show\n // up. `ref: \"HEAD\"` would go blank after every `git commit` — and the\n // cloud-proxy branch above already omits `ref`.\n const changes = await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitChanges(path);\n\n if (!Array.isArray(changes)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n\n return changes.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n static async getGitChangeDiff(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n ): Promise<GitChangeDiff> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const diff = await callCloudProxy<GitChangeDiff & { diff?: string }>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/diff?${params.toString()}`,\n });\n return {\n modified: diff?.modified ?? \"\",\n original: diff?.original ?? \"\",\n ...(diff?.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n\n // No `ref` for the same reason as getGitChanges: the base must match\n // the one the change list was computed against.\n const diff = (await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitDiff(path)) as GitChangeDiff & { diff?: string };\n\n return {\n modified: diff.modified ?? \"\",\n original: diff.original ?? \"\",\n ...(diff.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n}\n\nexport default AgentServerGitService;\n"],"mappings":"wUAkCA,SAAS,EAAsB,EAAsB,CACnD,OAAO,EAAK,WAAW,IAAI,CAAG,EAAO,IAAI,IAG3C,IAAM,EAAN,KAA4B,CAC1B,aAAa,cACX,EACA,EACA,EACA,EACsB,CACtB,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAElC,GAAI,EAAO,OAAS,SAAW,EAAgB,CAC7C,IAAM,EAAS,IAAI,gBACnB,EAAO,IAAI,OAAQ,EAAsB,EAAK,CAAC,CAC/C,IAAM,EAAO,MAAM,EAAA,eAAuC,CACxD,QAAS,EACT,OAAQ,MACR,KAAM,6BAA6B,EAAe,eAAe,EAAO,UAAU,GACnF,CAAC,CACF,GAAI,CAAC,MAAM,QAAQ,EAAK,CACtB,MAAU,MACR,6DACD,CAEH,OAAO,EAAK,IAAK,IAAY,CAC3B,OAAQ,EAAA,8BACN,OAAO,EAAO,OAAO,CAGtB,CACD,KAAM,EAAO,KACd,EAAE,CAOL,IAAM,EAAU,MAAM,IAAI,EAAA,gBACxB,EAAA,4BAA4B,CAAE,kBAAiB,gBAAe,CAAC,CAChE,CAAC,WAAW,EAAK,CAElB,GAAI,CAAC,MAAM,QAAQ,EAAQ,CACzB,MAAU,MACR,6DACD,CAGH,OAAO,EAAQ,IAAK,IAAY,CAC9B,OAAQ,EAAA,8BACN,OAAO,EAAO,OAAO,CAGtB,CACD,KAAM,EAAO,KACd,EAAE,CAGL,aAAa,iBACX,EACA,EACA,EACA,EACwB,CACxB,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAElC,GAAI,EAAO,OAAS,SAAW,EAAgB,CAC7C,IAAM,EAAS,IAAI,gBACnB,EAAO,IAAI,OAAQ,EAAsB,EAAK,CAAC,CAC/C,IAAM,EAAO,MAAM,EAAA,eAAkD,CACnE,QAAS,EACT,OAAQ,MACR,KAAM,6BAA6B,EAAe,YAAY,EAAO,UAAU,GAChF,CAAC,CACF,MAAO,CACL,SAAU,GAAM,UAAY,GAC5B,SAAU,GAAM,UAAY,GAC5B,GAAI,GAAM,KAAO,CAAE,KAAM,EAAK,KAAM,CAAG,EAAE,CAC1C,CAKH,IAAM,EAAQ,MAAM,IAAI,EAAA,gBACtB,EAAA,4BAA4B,CAAE,kBAAiB,gBAAe,CAAC,CAChE,CAAC,QAAQ,EAAK,CAEf,MAAO,CACL,SAAU,EAAK,UAAY,GAC3B,SAAU,EAAK,UAAY,GAC3B,GAAI,EAAK,KAAO,CAAE,KAAM,EAAK,KAAM,CAAG,EAAE,CACzC"}
1
+ {"version":3,"file":"agent-server-git-service.api.cjs","names":[],"sources":["../../../src/api/git-service/agent-server-git-service.api.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport { RemoteWorkspace } from \"@openhands/typescript-client/workspace/remote-workspace\";\nimport { mapAnyGitStatusToClientStatus } from \"#/utils/git-status-mapper\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport type {\n GitChange,\n GitChangeDiff,\n GitCommitsPage,\n} from \"../open-hands.types\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport { getAgentServerClientOptions } from \"../agent-server-client-options\";\nimport { isSdkHttpStatusError } from \"../agent-server-compatibility\";\n\ninterface AgentServerGitChange {\n status: string;\n path: string;\n}\n\ninterface AgentServerGitCommit {\n sha: string;\n short_sha: string;\n subject: string;\n author: string;\n timestamp: string;\n}\n\ninterface AgentServerGitCommitsPage {\n commits: AgentServerGitCommit[];\n has_more: boolean;\n}\n\n/**\n * Git operations for agent-server conversations.\n *\n * In **local** mode the runtime is reachable directly from the browser\n * (it's `127.0.0.1:18000`); the SDK's `RemoteWorkspace` calls land\n * fine. In **cloud** mode the runtime is at\n * `*.prod-runtime.all-hands.dev`, which doesn't allow CORS from\n * `localhost`. So cloud-mode calls hit the cloud API's\n * `GET /api/v1/app-conversations/{id}/git/{changes,diff}` proxy\n * endpoints instead — the server resolves the conversation's runtime\n * and makes the hop itself with the sandbox's session API key, and the\n * cloud API's CORS is permissive for bearer-token requests.\n */\n\n/**\n * The cloud runtime's `/api/git/{changes,diff}` endpoints prepend\n * `/workspace/` to relative paths (so a relative arg like\n * `workspace/project` becomes `/workspace/workspace/project` and 404s).\n * `getGitPath` returns the local agent-server's relative convention by\n * default; normalize to an absolute path before sending to the cloud\n * runtime.\n */\nfunction toAbsoluteRuntimePath(path: string): string {\n return path.startsWith(\"/\") ? path : `/${path}`;\n}\n\n/**\n * GET an arbitrary runtime git endpoint in both backend modes. Local mode\n * uses the SDK's public `HttpClient` (the typed `gitChanges`/`gitDiff`\n * wrappers don't know the newer endpoints/params, and they re-wrap errors,\n * dropping the `.status` needed for 404 feature-detection). Cloud mode goes\n * through the generic cloud-proxy envelope with the sandbox's session API\n * key — the same hop `executeCommand`/`downloadFile` use — so no dedicated\n * cloud API endpoints are required.\n */\nasync function getFromRuntime<T>(\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n apiPath: string,\n params: { path: string } & Record<string, string>,\n): Promise<T> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationUrl) {\n const search = new URLSearchParams({\n ...params,\n path: toAbsoluteRuntimePath(params.path),\n });\n return callCloudProxy<T>({\n backend: active,\n method: \"GET\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `${apiPath}?${search.toString()}`,\n authMode: \"session-api-key\",\n sessionApiKey: sessionApiKey ?? undefined,\n });\n }\n\n const response = await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).client.get<T>(apiPath, { params });\n return response.data;\n}\n\n/**\n * The commit endpoints are newer than some deployed agent servers. A 404\n * (route absent) means \"server too old\" — callers hide the commits section\n * instead of surfacing an error. Local calls and cloud-proxy calls (via the\n * shared TypeScript client) both throw the SDK's `HttpError`; the axios\n * check is kept as a safety net for axios-shaped errors.\n */\nfunction isEndpointMissingError(error: unknown): boolean {\n return (\n isSdkHttpStatusError(error, 404) ||\n (isAxiosError(error) && error.response?.status === 404)\n );\n}\n\nclass AgentServerGitService {\n static async getGitChanges(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n ): Promise<GitChange[]> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const data = await callCloudProxy<AgentServerGitChange[]>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/changes?${params.toString()}`,\n });\n if (!Array.isArray(data)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n return data.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n // No `ref`: let the server auto-detect the base (origin branch /\n // merge-base), so changes the agent has already committed still show\n // up. `ref: \"HEAD\"` would go blank after every `git commit` — and the\n // cloud-proxy branch above already omits `ref`.\n const changes = await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitChanges(path);\n\n if (!Array.isArray(changes)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n\n return changes.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n /**\n * List the conversation's commits (display-base..HEAD, newest first).\n * Resolves to `null` when the agent server predates the endpoint (404),\n * so callers can hide the commits section instead of erroring.\n */\n static async getGitCommits(\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n limit = 50,\n ): Promise<GitCommitsPage | null> {\n try {\n const page = await getFromRuntime<AgentServerGitCommitsPage>(\n conversationUrl,\n sessionApiKey,\n \"/api/git/commits\",\n { path, limit: String(limit) },\n );\n return {\n commits: (page?.commits ?? []).map((commit) => ({\n sha: commit.sha,\n shortSha: commit.short_sha,\n subject: commit.subject,\n author: commit.author,\n timestamp: commit.timestamp,\n })),\n hasMore: Boolean(page?.has_more),\n };\n } catch (error) {\n if (isEndpointMissingError(error)) return null;\n throw error;\n }\n }\n\n /** Files changed by a single commit (vs its first parent). */\n static async getCommitChanges(\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n sha: string,\n ): Promise<GitChange[]> {\n const changes = await getFromRuntime<AgentServerGitChange[]>(\n conversationUrl,\n sessionApiKey,\n `/api/git/commits/${encodeURIComponent(sha)}/changes`,\n { path },\n );\n\n if (!Array.isArray(changes)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n\n return changes.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n static async getGitChangeDiff(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n commit?: string,\n ): Promise<GitChangeDiff> {\n if (commit) {\n // Per-commit diff: both sides come from git objects on the server,\n // so files the commit deleted still render.\n const commitDiff = await getFromRuntime<\n GitChangeDiff & { diff?: string }\n >(conversationUrl, sessionApiKey, \"/api/git/diff\", { path, commit });\n return {\n modified: commitDiff?.modified ?? \"\",\n original: commitDiff?.original ?? \"\",\n ...(commitDiff?.diff ? { diff: commitDiff.diff } : {}),\n } as GitChangeDiff;\n }\n\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const diff = await callCloudProxy<GitChangeDiff & { diff?: string }>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/diff?${params.toString()}`,\n });\n return {\n modified: diff?.modified ?? \"\",\n original: diff?.original ?? \"\",\n ...(diff?.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n\n // No `ref` for the same reason as getGitChanges: the base must match\n // the one the change list was computed against.\n const diff = (await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitDiff(path)) as GitChangeDiff & { diff?: string };\n\n return {\n modified: diff.modified ?? \"\",\n original: diff.original ?? \"\",\n ...(diff.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n}\n\nexport default AgentServerGitService;\n"],"mappings":"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"}
@@ -1,6 +1,14 @@
1
- import type { GitChange, GitChangeDiff } from "../open-hands.types";
1
+ import type { GitChange, GitChangeDiff, GitCommitsPage } from "../open-hands.types";
2
2
  declare class AgentServerGitService {
3
3
  static getGitChanges(conversationId: string, conversationUrl: string | null | undefined, sessionApiKey: string | null | undefined, path: string): Promise<GitChange[]>;
4
- static getGitChangeDiff(conversationId: string, conversationUrl: string | null | undefined, sessionApiKey: string | null | undefined, path: string): Promise<GitChangeDiff>;
4
+ /**
5
+ * List the conversation's commits (display-base..HEAD, newest first).
6
+ * Resolves to `null` when the agent server predates the endpoint (404),
7
+ * so callers can hide the commits section instead of erroring.
8
+ */
9
+ static getGitCommits(conversationUrl: string | null | undefined, sessionApiKey: string | null | undefined, path: string, limit?: number): Promise<GitCommitsPage | null>;
10
+ /** Files changed by a single commit (vs its first parent). */
11
+ static getCommitChanges(conversationUrl: string | null | undefined, sessionApiKey: string | null | undefined, path: string, sha: string): Promise<GitChange[]>;
12
+ static getGitChangeDiff(conversationId: string, conversationUrl: string | null | undefined, sessionApiKey: string | null | undefined, path: string, commit?: string): Promise<GitChangeDiff>;
5
13
  }
6
14
  export default AgentServerGitService;
@@ -1,67 +1,134 @@
1
- import { getActiveBackend as e } from "../backend-registry/active-store.js";
2
- import { getAgentServerClientOptions as t } from "../agent-server-client-options.js";
3
- import { callCloudProxy as n } from "../cloud/proxy.js";
4
- import { RemoteWorkspace as r } from "../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js";
5
- import { mapAnyGitStatusToClientStatus as i } from "../../utils/git-status-mapper.js";
1
+ import { buildHttpBaseUrl as e } from "../../utils/websocket-url.js";
2
+ import { getActiveBackend as t } from "../backend-registry/active-store.js";
3
+ import { getAgentServerClientOptions as n } from "../agent-server-client-options.js";
4
+ import { isSdkHttpStatusError as r } from "../agent-server-compatibility.js";
5
+ import { isAxiosError as i } from "../../node_modules/axios/index.js";
6
+ import { callCloudProxy as a } from "../cloud/proxy.js";
7
+ import { RemoteWorkspace as o } from "../../node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js";
8
+ import { mapAnyGitStatusToClientStatus as s } from "../../utils/git-status-mapper.js";
6
9
  //#region src/api/git-service/agent-server-git-service.api.ts
7
- function a(e) {
10
+ function c(e) {
8
11
  return e.startsWith("/") ? e : `/${e}`;
9
12
  }
10
- var o = class {
11
- static async getGitChanges(o, s, c, l) {
12
- let u = e().backend;
13
- if (u.kind === "cloud" && o) {
14
- let e = new URLSearchParams();
15
- e.set("path", a(l));
16
- let t = await n({
13
+ async function l(r, i, s, l) {
14
+ let u = t().backend;
15
+ if (u.kind === "cloud" && r) {
16
+ let t = new URLSearchParams({
17
+ ...l,
18
+ path: c(l.path)
19
+ });
20
+ return a({
21
+ backend: u,
22
+ method: "GET",
23
+ hostOverride: e(r),
24
+ path: `${s}?${t.toString()}`,
25
+ authMode: "session-api-key",
26
+ sessionApiKey: i ?? void 0
27
+ });
28
+ }
29
+ return (await new o(n({
30
+ conversationUrl: r,
31
+ sessionApiKey: i
32
+ })).client.get(s, { params: l })).data;
33
+ }
34
+ function u(e) {
35
+ return r(e, 404) || i(e) && e.response?.status === 404;
36
+ }
37
+ var d = class {
38
+ static async getGitChanges(e, r, i, l) {
39
+ let u = t().backend;
40
+ if (u.kind === "cloud" && e) {
41
+ let t = new URLSearchParams();
42
+ t.set("path", c(l));
43
+ let n = await a({
17
44
  backend: u,
18
45
  method: "GET",
19
- path: `/api/v1/app-conversations/${o}/git/changes?${e.toString()}`
46
+ path: `/api/v1/app-conversations/${e}/git/changes?${t.toString()}`
20
47
  });
21
- if (!Array.isArray(t)) throw Error("Invalid response from runtime - runtime may be unavailable");
22
- return t.map((e) => ({
23
- status: i(String(e.status)),
48
+ if (!Array.isArray(n)) throw Error("Invalid response from runtime - runtime may be unavailable");
49
+ return n.map((e) => ({
50
+ status: s(String(e.status)),
24
51
  path: e.path
25
52
  }));
26
53
  }
27
- let d = await new r(t({
28
- conversationUrl: s,
29
- sessionApiKey: c
54
+ let d = await new o(n({
55
+ conversationUrl: r,
56
+ sessionApiKey: i
30
57
  })).gitChanges(l);
31
58
  if (!Array.isArray(d)) throw Error("Invalid response from runtime - runtime may be unavailable");
32
59
  return d.map((e) => ({
33
- status: i(String(e.status)),
60
+ status: s(String(e.status)),
34
61
  path: e.path
35
62
  }));
36
63
  }
37
- static async getGitChangeDiff(i, o, s, c) {
38
- let l = e().backend;
39
- if (l.kind === "cloud" && i) {
40
- let e = new URLSearchParams();
41
- e.set("path", a(c));
42
- let t = await n({
43
- backend: l,
64
+ static async getGitCommits(e, t, n, r = 50) {
65
+ try {
66
+ let i = await l(e, t, "/api/git/commits", {
67
+ path: n,
68
+ limit: String(r)
69
+ });
70
+ return {
71
+ commits: (i?.commits ?? []).map((e) => ({
72
+ sha: e.sha,
73
+ shortSha: e.short_sha,
74
+ subject: e.subject,
75
+ author: e.author,
76
+ timestamp: e.timestamp
77
+ })),
78
+ hasMore: !!i?.has_more
79
+ };
80
+ } catch (e) {
81
+ if (u(e)) return null;
82
+ throw e;
83
+ }
84
+ }
85
+ static async getCommitChanges(e, t, n, r) {
86
+ let i = await l(e, t, `/api/git/commits/${encodeURIComponent(r)}/changes`, { path: n });
87
+ if (!Array.isArray(i)) throw Error("Invalid response from runtime - runtime may be unavailable");
88
+ return i.map((e) => ({
89
+ status: s(String(e.status)),
90
+ path: e.path
91
+ }));
92
+ }
93
+ static async getGitChangeDiff(e, r, i, s, u) {
94
+ if (u) {
95
+ let e = await l(r, i, "/api/git/diff", {
96
+ path: s,
97
+ commit: u
98
+ });
99
+ return {
100
+ modified: e?.modified ?? "",
101
+ original: e?.original ?? "",
102
+ ...e?.diff ? { diff: e.diff } : {}
103
+ };
104
+ }
105
+ let d = t().backend;
106
+ if (d.kind === "cloud" && e) {
107
+ let t = new URLSearchParams();
108
+ t.set("path", c(s));
109
+ let n = await a({
110
+ backend: d,
44
111
  method: "GET",
45
- path: `/api/v1/app-conversations/${i}/git/diff?${e.toString()}`
112
+ path: `/api/v1/app-conversations/${e}/git/diff?${t.toString()}`
46
113
  });
47
114
  return {
48
- modified: t?.modified ?? "",
49
- original: t?.original ?? "",
50
- ...t?.diff ? { diff: t.diff } : {}
115
+ modified: n?.modified ?? "",
116
+ original: n?.original ?? "",
117
+ ...n?.diff ? { diff: n.diff } : {}
51
118
  };
52
119
  }
53
- let u = await new r(t({
54
- conversationUrl: o,
55
- sessionApiKey: s
56
- })).gitDiff(c);
120
+ let f = await new o(n({
121
+ conversationUrl: r,
122
+ sessionApiKey: i
123
+ })).gitDiff(s);
57
124
  return {
58
- modified: u.modified ?? "",
59
- original: u.original ?? "",
60
- ...u.diff ? { diff: u.diff } : {}
125
+ modified: f.modified ?? "",
126
+ original: f.original ?? "",
127
+ ...f.diff ? { diff: f.diff } : {}
61
128
  };
62
129
  }
63
130
  };
64
131
  //#endregion
65
- export { o as default };
132
+ export { d as default };
66
133
 
67
134
  //# sourceMappingURL=agent-server-git-service.api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-server-git-service.api.js","names":[],"sources":["../../../src/api/git-service/agent-server-git-service.api.ts"],"sourcesContent":["import { RemoteWorkspace } from \"@openhands/typescript-client/workspace/remote-workspace\";\nimport { mapAnyGitStatusToClientStatus } from \"#/utils/git-status-mapper\";\nimport type { GitChange, GitChangeDiff } from \"../open-hands.types\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport { getAgentServerClientOptions } from \"../agent-server-client-options\";\n\ninterface AgentServerGitChange {\n status: string;\n path: string;\n}\n\n/**\n * Git operations for agent-server conversations.\n *\n * In **local** mode the runtime is reachable directly from the browser\n * (it's `127.0.0.1:18000`); the SDK's `RemoteWorkspace` calls land\n * fine. In **cloud** mode the runtime is at\n * `*.prod-runtime.all-hands.dev`, which doesn't allow CORS from\n * `localhost`. So cloud-mode calls hit the cloud API's\n * `GET /api/v1/app-conversations/{id}/git/{changes,diff}` proxy\n * endpoints instead — the server resolves the conversation's runtime\n * and makes the hop itself with the sandbox's session API key, and the\n * cloud API's CORS is permissive for bearer-token requests.\n */\n\n/**\n * The cloud runtime's `/api/git/{changes,diff}` endpoints prepend\n * `/workspace/` to relative paths (so a relative arg like\n * `workspace/project` becomes `/workspace/workspace/project` and 404s).\n * `getGitPath` returns the local agent-server's relative convention by\n * default; normalize to an absolute path before sending to the cloud\n * runtime.\n */\nfunction toAbsoluteRuntimePath(path: string): string {\n return path.startsWith(\"/\") ? path : `/${path}`;\n}\n\nclass AgentServerGitService {\n static async getGitChanges(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n ): Promise<GitChange[]> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const data = await callCloudProxy<AgentServerGitChange[]>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/changes?${params.toString()}`,\n });\n if (!Array.isArray(data)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n return data.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n // No `ref`: let the server auto-detect the base (origin branch /\n // merge-base), so changes the agent has already committed still show\n // up. `ref: \"HEAD\"` would go blank after every `git commit` — and the\n // cloud-proxy branch above already omits `ref`.\n const changes = await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitChanges(path);\n\n if (!Array.isArray(changes)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n\n return changes.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n static async getGitChangeDiff(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n ): Promise<GitChangeDiff> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const diff = await callCloudProxy<GitChangeDiff & { diff?: string }>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/diff?${params.toString()}`,\n });\n return {\n modified: diff?.modified ?? \"\",\n original: diff?.original ?? \"\",\n ...(diff?.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n\n // No `ref` for the same reason as getGitChanges: the base must match\n // the one the change list was computed against.\n const diff = (await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitDiff(path)) as GitChangeDiff & { diff?: string };\n\n return {\n modified: diff.modified ?? \"\",\n original: diff.original ?? \"\",\n ...(diff.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n}\n\nexport default AgentServerGitService;\n"],"mappings":";;;;;;AAkCA,SAAS,EAAsB,GAAsB;AACnD,QAAO,EAAK,WAAW,IAAI,GAAG,IAAO,IAAI;;AAG3C,IAAM,IAAN,MAA4B;CAC1B,aAAa,cACX,GACA,GACA,GACA,GACsB;EACtB,IAAM,IAAS,GAAkB,CAAC;AAElC,MAAI,EAAO,SAAS,WAAW,GAAgB;GAC7C,IAAM,IAAS,IAAI,iBAAiB;AACpC,KAAO,IAAI,QAAQ,EAAsB,EAAK,CAAC;GAC/C,IAAM,IAAO,MAAM,EAAuC;IACxD,SAAS;IACT,QAAQ;IACR,MAAM,6BAA6B,EAAe,eAAe,EAAO,UAAU;IACnF,CAAC;AACF,OAAI,CAAC,MAAM,QAAQ,EAAK,CACtB,OAAU,MACR,6DACD;AAEH,UAAO,EAAK,KAAK,OAAY;IAC3B,QAAQ,EACN,OAAO,EAAO,OAAO,CAGtB;IACD,MAAM,EAAO;IACd,EAAE;;EAOL,IAAM,IAAU,MAAM,IAAI,EACxB,EAA4B;GAAE;GAAiB;GAAe,CAAC,CAChE,CAAC,WAAW,EAAK;AAElB,MAAI,CAAC,MAAM,QAAQ,EAAQ,CACzB,OAAU,MACR,6DACD;AAGH,SAAO,EAAQ,KAAK,OAAY;GAC9B,QAAQ,EACN,OAAO,EAAO,OAAO,CAGtB;GACD,MAAM,EAAO;GACd,EAAE;;CAGL,aAAa,iBACX,GACA,GACA,GACA,GACwB;EACxB,IAAM,IAAS,GAAkB,CAAC;AAElC,MAAI,EAAO,SAAS,WAAW,GAAgB;GAC7C,IAAM,IAAS,IAAI,iBAAiB;AACpC,KAAO,IAAI,QAAQ,EAAsB,EAAK,CAAC;GAC/C,IAAM,IAAO,MAAM,EAAkD;IACnE,SAAS;IACT,QAAQ;IACR,MAAM,6BAA6B,EAAe,YAAY,EAAO,UAAU;IAChF,CAAC;AACF,UAAO;IACL,UAAU,GAAM,YAAY;IAC5B,UAAU,GAAM,YAAY;IAC5B,GAAI,GAAM,OAAO,EAAE,MAAM,EAAK,MAAM,GAAG,EAAE;IAC1C;;EAKH,IAAM,IAAQ,MAAM,IAAI,EACtB,EAA4B;GAAE;GAAiB;GAAe,CAAC,CAChE,CAAC,QAAQ,EAAK;AAEf,SAAO;GACL,UAAU,EAAK,YAAY;GAC3B,UAAU,EAAK,YAAY;GAC3B,GAAI,EAAK,OAAO,EAAE,MAAM,EAAK,MAAM,GAAG,EAAE;GACzC"}
1
+ {"version":3,"file":"agent-server-git-service.api.js","names":[],"sources":["../../../src/api/git-service/agent-server-git-service.api.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport { RemoteWorkspace } from \"@openhands/typescript-client/workspace/remote-workspace\";\nimport { mapAnyGitStatusToClientStatus } from \"#/utils/git-status-mapper\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport type {\n GitChange,\n GitChangeDiff,\n GitCommitsPage,\n} from \"../open-hands.types\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport { getAgentServerClientOptions } from \"../agent-server-client-options\";\nimport { isSdkHttpStatusError } from \"../agent-server-compatibility\";\n\ninterface AgentServerGitChange {\n status: string;\n path: string;\n}\n\ninterface AgentServerGitCommit {\n sha: string;\n short_sha: string;\n subject: string;\n author: string;\n timestamp: string;\n}\n\ninterface AgentServerGitCommitsPage {\n commits: AgentServerGitCommit[];\n has_more: boolean;\n}\n\n/**\n * Git operations for agent-server conversations.\n *\n * In **local** mode the runtime is reachable directly from the browser\n * (it's `127.0.0.1:18000`); the SDK's `RemoteWorkspace` calls land\n * fine. In **cloud** mode the runtime is at\n * `*.prod-runtime.all-hands.dev`, which doesn't allow CORS from\n * `localhost`. So cloud-mode calls hit the cloud API's\n * `GET /api/v1/app-conversations/{id}/git/{changes,diff}` proxy\n * endpoints instead — the server resolves the conversation's runtime\n * and makes the hop itself with the sandbox's session API key, and the\n * cloud API's CORS is permissive for bearer-token requests.\n */\n\n/**\n * The cloud runtime's `/api/git/{changes,diff}` endpoints prepend\n * `/workspace/` to relative paths (so a relative arg like\n * `workspace/project` becomes `/workspace/workspace/project` and 404s).\n * `getGitPath` returns the local agent-server's relative convention by\n * default; normalize to an absolute path before sending to the cloud\n * runtime.\n */\nfunction toAbsoluteRuntimePath(path: string): string {\n return path.startsWith(\"/\") ? path : `/${path}`;\n}\n\n/**\n * GET an arbitrary runtime git endpoint in both backend modes. Local mode\n * uses the SDK's public `HttpClient` (the typed `gitChanges`/`gitDiff`\n * wrappers don't know the newer endpoints/params, and they re-wrap errors,\n * dropping the `.status` needed for 404 feature-detection). Cloud mode goes\n * through the generic cloud-proxy envelope with the sandbox's session API\n * key — the same hop `executeCommand`/`downloadFile` use — so no dedicated\n * cloud API endpoints are required.\n */\nasync function getFromRuntime<T>(\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n apiPath: string,\n params: { path: string } & Record<string, string>,\n): Promise<T> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationUrl) {\n const search = new URLSearchParams({\n ...params,\n path: toAbsoluteRuntimePath(params.path),\n });\n return callCloudProxy<T>({\n backend: active,\n method: \"GET\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `${apiPath}?${search.toString()}`,\n authMode: \"session-api-key\",\n sessionApiKey: sessionApiKey ?? undefined,\n });\n }\n\n const response = await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).client.get<T>(apiPath, { params });\n return response.data;\n}\n\n/**\n * The commit endpoints are newer than some deployed agent servers. A 404\n * (route absent) means \"server too old\" — callers hide the commits section\n * instead of surfacing an error. Local calls and cloud-proxy calls (via the\n * shared TypeScript client) both throw the SDK's `HttpError`; the axios\n * check is kept as a safety net for axios-shaped errors.\n */\nfunction isEndpointMissingError(error: unknown): boolean {\n return (\n isSdkHttpStatusError(error, 404) ||\n (isAxiosError(error) && error.response?.status === 404)\n );\n}\n\nclass AgentServerGitService {\n static async getGitChanges(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n ): Promise<GitChange[]> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const data = await callCloudProxy<AgentServerGitChange[]>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/changes?${params.toString()}`,\n });\n if (!Array.isArray(data)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n return data.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n // No `ref`: let the server auto-detect the base (origin branch /\n // merge-base), so changes the agent has already committed still show\n // up. `ref: \"HEAD\"` would go blank after every `git commit` — and the\n // cloud-proxy branch above already omits `ref`.\n const changes = await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitChanges(path);\n\n if (!Array.isArray(changes)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n\n return changes.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n /**\n * List the conversation's commits (display-base..HEAD, newest first).\n * Resolves to `null` when the agent server predates the endpoint (404),\n * so callers can hide the commits section instead of erroring.\n */\n static async getGitCommits(\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n limit = 50,\n ): Promise<GitCommitsPage | null> {\n try {\n const page = await getFromRuntime<AgentServerGitCommitsPage>(\n conversationUrl,\n sessionApiKey,\n \"/api/git/commits\",\n { path, limit: String(limit) },\n );\n return {\n commits: (page?.commits ?? []).map((commit) => ({\n sha: commit.sha,\n shortSha: commit.short_sha,\n subject: commit.subject,\n author: commit.author,\n timestamp: commit.timestamp,\n })),\n hasMore: Boolean(page?.has_more),\n };\n } catch (error) {\n if (isEndpointMissingError(error)) return null;\n throw error;\n }\n }\n\n /** Files changed by a single commit (vs its first parent). */\n static async getCommitChanges(\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n sha: string,\n ): Promise<GitChange[]> {\n const changes = await getFromRuntime<AgentServerGitChange[]>(\n conversationUrl,\n sessionApiKey,\n `/api/git/commits/${encodeURIComponent(sha)}/changes`,\n { path },\n );\n\n if (!Array.isArray(changes)) {\n throw new Error(\n \"Invalid response from runtime - runtime may be unavailable\",\n );\n }\n\n return changes.map((change) => ({\n status: mapAnyGitStatusToClientStatus(\n String(change.status) as Parameters<\n typeof mapAnyGitStatusToClientStatus\n >[0],\n ),\n path: change.path,\n }));\n }\n\n static async getGitChangeDiff(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey: string | null | undefined,\n path: string,\n commit?: string,\n ): Promise<GitChangeDiff> {\n if (commit) {\n // Per-commit diff: both sides come from git objects on the server,\n // so files the commit deleted still render.\n const commitDiff = await getFromRuntime<\n GitChangeDiff & { diff?: string }\n >(conversationUrl, sessionApiKey, \"/api/git/diff\", { path, commit });\n return {\n modified: commitDiff?.modified ?? \"\",\n original: commitDiff?.original ?? \"\",\n ...(commitDiff?.diff ? { diff: commitDiff.diff } : {}),\n } as GitChangeDiff;\n }\n\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationId) {\n const params = new URLSearchParams();\n params.set(\"path\", toAbsoluteRuntimePath(path));\n const diff = await callCloudProxy<GitChangeDiff & { diff?: string }>({\n backend: active,\n method: \"GET\",\n path: `/api/v1/app-conversations/${conversationId}/git/diff?${params.toString()}`,\n });\n return {\n modified: diff?.modified ?? \"\",\n original: diff?.original ?? \"\",\n ...(diff?.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n\n // No `ref` for the same reason as getGitChanges: the base must match\n // the one the change list was computed against.\n const diff = (await new RemoteWorkspace(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).gitDiff(path)) as GitChangeDiff & { diff?: string };\n\n return {\n modified: diff.modified ?? \"\",\n original: diff.original ?? \"\",\n ...(diff.diff ? { diff: diff.diff } : {}),\n } as GitChangeDiff;\n }\n}\n\nexport default AgentServerGitService;\n"],"mappings":"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"}
@@ -85,6 +85,17 @@ export interface GitChangeDiff {
85
85
  modified: string;
86
86
  original: string;
87
87
  }
88
+ export interface GitCommit {
89
+ sha: string;
90
+ shortSha: string;
91
+ subject: string;
92
+ author: string;
93
+ timestamp: string;
94
+ }
95
+ export interface GitCommitsPage {
96
+ commits: GitCommit[];
97
+ hasMore: boolean;
98
+ }
88
99
  export interface InputMetadata {
89
100
  name: string;
90
101
  description: string;
@@ -1,2 +1,2 @@
1
- require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/@openhands/typescript-client/dist/client/settings-client.cjs`);require(`../node_modules/@openhands/typescript-client/dist/clients.cjs`);const t=require(`./backend-registry/active-store.cjs`),n=require(`./agent-server-client-options.cjs`),r=require(`./cloud/secrets-service.api.cjs`);async function i(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var a=class{static async getSecrets(){try{return t.getActiveBackend().backend.kind===`cloud`?await i(()=>r.fetchCloudSecrets()):(await i(()=>new e.SettingsClient(n.getAgentServerClientOptions()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async createSecret(a,o,s){if(t.getActiveBackend().backend.kind===`cloud`){await i(()=>r.createCloudSecret(a,o,s));return}await i(()=>new e.SettingsClient(n.getAgentServerClientOptions()).upsertSecret({name:a,value:o,description:s}))}static async updateSecret(e,n,a){if(t.getActiveBackend().backend.kind===`cloud`){await i(()=>r.updateCloudSecret(e,n,a));return}await this.createSecret(e,n,a)}static async deleteSecret(a){try{if(t.getActiveBackend().backend.kind===`cloud`){await i(()=>r.deleteCloudSecret(a));return}await i(()=>new e.SettingsClient(n.getAgentServerClientOptions()).deleteSecret(a))}catch(e){if(e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};exports.SecretsService=a;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../node_modules/@openhands/typescript-client/dist/client/settings-client.cjs`);require(`../node_modules/@openhands/typescript-client/dist/clients.cjs`);const t=require(`./backend-registry/active-store.cjs`),n=require(`./agent-server-client-options.cjs`),r=require(`./agent-server-compatibility.cjs`),i=require(`./cloud/secrets-service.api.cjs`);async function a(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var o=class{static async getSecrets(){try{return t.getActiveBackend().backend.kind===`cloud`?await a(()=>i.fetchCloudSecrets()):(await a(()=>new e.SettingsClient(n.getAgentServerClientOptions()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async createSecret(r,o,s){if(t.getActiveBackend().backend.kind===`cloud`){await a(()=>i.createCloudSecret(r,o,s));return}await a(()=>new e.SettingsClient(n.getAgentServerClientOptions()).upsertSecret({name:r,value:o,description:s}))}static async updateSecret(e,n,r){if(t.getActiveBackend().backend.kind===`cloud`){await a(()=>i.updateCloudSecret(e,n,r));return}await this.createSecret(e,n,r)}static async deleteSecret(o){try{if(t.getActiveBackend().backend.kind===`cloud`){await a(()=>i.deleteCloudSecret(o));return}await a(()=>new e.SettingsClient(n.getAgentServerClientOptions()).deleteSecret(o))}catch(e){if(r.isSdkHttpStatusError(e,404)||e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};exports.SecretsService=o;
2
2
  //# sourceMappingURL=secrets-service.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"secrets-service.cjs","names":[],"sources":["../../src/api/secrets-service.ts"],"sourcesContent":["import { SettingsClient } from \"@openhands/typescript-client/clients\";\nimport { getActiveBackend } from \"./backend-registry/active-store\";\nimport {\n createCloudSecret,\n deleteCloudSecret,\n fetchCloudSecrets,\n updateCloudSecret,\n} from \"./cloud/secrets-service.api\";\nimport { getAgentServerClientOptions } from \"./agent-server-client-options\";\nimport { CustomSecretWithoutValue } from \"./secrets-service.types\";\n\n/**\n * Retry helper for API calls with exponential backoff.\n */\nasync function withRetry<T>(\n fn: () => Promise<T>,\n maxRetries: number = 3,\n baseDelayMs: number = 500,\n): Promise<T> {\n for (let attempt = 0; attempt < maxRetries; attempt += 1) {\n try {\n return await fn();\n } catch (error) {\n if (attempt >= maxRetries - 1) {\n throw error;\n }\n\n const delay = baseDelayMs * 2 ** attempt;\n\n await new Promise<void>((resolve) => {\n setTimeout(resolve, delay);\n });\n }\n }\n\n throw new Error(\"Retry attempts exhausted\");\n}\n\nexport class SecretsService {\n /**\n * List all custom secrets (names and descriptions only, no values).\n * Uses the agent-server API endpoint: GET /api/settings/secrets\n *\n * Note: The agent-server API doesn't support pagination or search filtering.\n * All secrets are returned in a single response.\n */\n static async getSecrets(): Promise<CustomSecretWithoutValue[]> {\n try {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return await withRetry(() => fetchCloudSecrets());\n }\n const response = await withRetry(() =>\n new SettingsClient(getAgentServerClientOptions()).listSecrets(),\n );\n return response.secrets.map((s) => ({\n name: s.name,\n description: s.description,\n }));\n } catch (error) {\n console.error(\"Failed to fetch secrets after retries:\", error);\n return [];\n }\n }\n\n /**\n * Create or update a custom secret (upsert by name).\n * Uses the agent-server API endpoint: PUT /api/settings/secrets\n *\n * @param name - Secret name (must start with letter, contain only letters/numbers/underscores, 1-64 chars)\n * @param value - Secret value\n * @param description - Optional description\n * @throws Error if the API call fails after retries\n */\n static async createSecret(\n name: string,\n value: string,\n description?: string,\n ): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await withRetry(() => createCloudSecret(name, value, description));\n return;\n }\n await withRetry(() =>\n new SettingsClient(getAgentServerClientOptions()).upsertSecret({\n name,\n value,\n description,\n }),\n );\n }\n\n /**\n * Update a secret's value and/or description.\n * Uses the same upsert endpoint as createSecret since agent-server\n * doesn't have a separate update endpoint.\n *\n * @param name - Secret name (used as identifier)\n * @param value - New secret value\n * @param description - Optional new description\n * @throws Error if the API call fails after retries\n */\n static async updateSecret(\n name: string,\n value: string,\n description?: string,\n ): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // The cloud PUT endpoint renames + redescribes only (no value field),\n // matching what `useUpdateSecret` actually sends:\n // (secretToEdit=name, newName=value, description).\n await withRetry(() => updateCloudSecret(name, value, description));\n return;\n }\n // Agent-server uses upsert, so update is the same as create\n await this.createSecret(name, value, description);\n }\n\n /**\n * Delete a custom secret by name.\n * Uses the agent-server API endpoint: DELETE /api/settings/secrets/{name}\n *\n * @param name - Secret name to delete\n * @throws Error if the API call fails (except 404, which is treated as success)\n */\n static async deleteSecret(name: string): Promise<void> {\n try {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await withRetry(() => deleteCloudSecret(name));\n return;\n }\n await withRetry(() =>\n new SettingsClient(getAgentServerClientOptions()).deleteSecret(name),\n );\n } catch (error) {\n // 404 means secret doesn't exist - treat as successful deletion\n if (\n error &&\n typeof error === \"object\" &&\n \"response\" in error &&\n (error as { response?: { status?: number } }).response?.status === 404\n ) {\n return;\n }\n throw error;\n }\n }\n}\n"],"mappings":"yWAcA,eAAe,EACb,EACA,EAAqB,EACrB,EAAsB,IACV,CACZ,IAAK,IAAI,EAAU,EAAG,EAAU,EAAY,GAAW,EACrD,GAAI,CACF,OAAO,MAAM,GAAI,OACV,EAAO,CACd,GAAI,GAAW,EAAa,EAC1B,MAAM,EAGR,IAAM,EAAQ,EAAc,GAAK,EAEjC,MAAM,IAAI,QAAe,GAAY,CACnC,WAAW,EAAS,EAAM,EAC1B,CAIN,MAAU,MAAM,2BAA2B,CAG7C,IAAa,EAAb,KAA4B,CAQ1B,aAAa,YAAkD,CAC7D,GAAI,CAOF,OANI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAC/B,MAAM,MAAgB,EAAA,mBAAmB,CAAC,EAK5C,MAHgB,MACrB,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,aAAa,CAChE,EACe,QAAQ,IAAK,IAAO,CAClC,KAAM,EAAE,KACR,YAAa,EAAE,YAChB,EAAE,OACI,EAAO,CAEd,OADA,QAAQ,MAAM,yCAA0C,EAAM,CACvD,EAAE,EAab,aAAa,aACX,EACA,EACA,EACe,CACf,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAAS,CAC/C,MAAM,MAAgB,EAAA,kBAAkB,EAAM,EAAO,EAAY,CAAC,CAClE,OAEF,MAAM,MACJ,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,aAAa,CAC7D,OACA,QACA,cACD,CAAC,CACH,CAaH,aAAa,aACX,EACA,EACA,EACe,CACf,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAAS,CAI/C,MAAM,MAAgB,EAAA,kBAAkB,EAAM,EAAO,EAAY,CAAC,CAClE,OAGF,MAAM,KAAK,aAAa,EAAM,EAAO,EAAY,CAUnD,aAAa,aAAa,EAA6B,CACrD,GAAI,CACF,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAAS,CAC/C,MAAM,MAAgB,EAAA,kBAAkB,EAAK,CAAC,CAC9C,OAEF,MAAM,MACJ,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,aAAa,EAAK,CACrE,OACM,EAAO,CAEd,GACE,GACA,OAAO,GAAU,UACjB,aAAc,GACb,EAA6C,UAAU,SAAW,IAEnE,OAEF,MAAM"}
1
+ {"version":3,"file":"secrets-service.cjs","names":[],"sources":["../../src/api/secrets-service.ts"],"sourcesContent":["import { SettingsClient } from \"@openhands/typescript-client/clients\";\nimport { isSdkHttpStatusError } from \"./agent-server-compatibility\";\nimport { getActiveBackend } from \"./backend-registry/active-store\";\nimport {\n createCloudSecret,\n deleteCloudSecret,\n fetchCloudSecrets,\n updateCloudSecret,\n} from \"./cloud/secrets-service.api\";\nimport { getAgentServerClientOptions } from \"./agent-server-client-options\";\nimport { CustomSecretWithoutValue } from \"./secrets-service.types\";\n\n/**\n * Retry helper for API calls with exponential backoff.\n */\nasync function withRetry<T>(\n fn: () => Promise<T>,\n maxRetries: number = 3,\n baseDelayMs: number = 500,\n): Promise<T> {\n for (let attempt = 0; attempt < maxRetries; attempt += 1) {\n try {\n return await fn();\n } catch (error) {\n if (attempt >= maxRetries - 1) {\n throw error;\n }\n\n const delay = baseDelayMs * 2 ** attempt;\n\n await new Promise<void>((resolve) => {\n setTimeout(resolve, delay);\n });\n }\n }\n\n throw new Error(\"Retry attempts exhausted\");\n}\n\nexport class SecretsService {\n /**\n * List all custom secrets (names and descriptions only, no values).\n * Uses the agent-server API endpoint: GET /api/settings/secrets\n *\n * Note: The agent-server API doesn't support pagination or search filtering.\n * All secrets are returned in a single response.\n */\n static async getSecrets(): Promise<CustomSecretWithoutValue[]> {\n try {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return await withRetry(() => fetchCloudSecrets());\n }\n const response = await withRetry(() =>\n new SettingsClient(getAgentServerClientOptions()).listSecrets(),\n );\n return response.secrets.map((s) => ({\n name: s.name,\n description: s.description,\n }));\n } catch (error) {\n console.error(\"Failed to fetch secrets after retries:\", error);\n return [];\n }\n }\n\n /**\n * Create or update a custom secret (upsert by name).\n * Uses the agent-server API endpoint: PUT /api/settings/secrets\n *\n * @param name - Secret name (must start with letter, contain only letters/numbers/underscores, 1-64 chars)\n * @param value - Secret value\n * @param description - Optional description\n * @throws Error if the API call fails after retries\n */\n static async createSecret(\n name: string,\n value: string,\n description?: string,\n ): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await withRetry(() => createCloudSecret(name, value, description));\n return;\n }\n await withRetry(() =>\n new SettingsClient(getAgentServerClientOptions()).upsertSecret({\n name,\n value,\n description,\n }),\n );\n }\n\n /**\n * Update a secret's value and/or description.\n * Uses the same upsert endpoint as createSecret since agent-server\n * doesn't have a separate update endpoint.\n *\n * @param name - Secret name (used as identifier)\n * @param value - New secret value\n * @param description - Optional new description\n * @throws Error if the API call fails after retries\n */\n static async updateSecret(\n name: string,\n value: string,\n description?: string,\n ): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // The cloud PUT endpoint renames + redescribes only (no value field),\n // matching what `useUpdateSecret` actually sends:\n // (secretToEdit=name, newName=value, description).\n await withRetry(() => updateCloudSecret(name, value, description));\n return;\n }\n // Agent-server uses upsert, so update is the same as create\n await this.createSecret(name, value, description);\n }\n\n /**\n * Delete a custom secret by name.\n * Uses the agent-server API endpoint: DELETE /api/settings/secrets/{name}\n *\n * @param name - Secret name to delete\n * @throws Error if the API call fails (except 404, which is treated as success)\n */\n static async deleteSecret(name: string): Promise<void> {\n try {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await withRetry(() => deleteCloudSecret(name));\n return;\n }\n await withRetry(() =>\n new SettingsClient(getAgentServerClientOptions()).deleteSecret(name),\n );\n } catch (error) {\n // 404 means secret doesn't exist - treat as successful deletion.\n // Both the SDK's HttpError (status on the error itself) and\n // axios-style errors (status under `response`) count.\n if (\n isSdkHttpStatusError(error, 404) ||\n (error &&\n typeof error === \"object\" &&\n \"response\" in error &&\n (error as { response?: { status?: number } }).response?.status ===\n 404)\n ) {\n return;\n }\n throw error;\n }\n }\n}\n"],"mappings":"uZAeA,eAAe,EACb,EACA,EAAqB,EACrB,EAAsB,IACV,CACZ,IAAK,IAAI,EAAU,EAAG,EAAU,EAAY,GAAW,EACrD,GAAI,CACF,OAAO,MAAM,GAAI,OACV,EAAO,CACd,GAAI,GAAW,EAAa,EAC1B,MAAM,EAGR,IAAM,EAAQ,EAAc,GAAK,EAEjC,MAAM,IAAI,QAAe,GAAY,CACnC,WAAW,EAAS,EAAM,EAC1B,CAIN,MAAU,MAAM,2BAA2B,CAG7C,IAAa,EAAb,KAA4B,CAQ1B,aAAa,YAAkD,CAC7D,GAAI,CAOF,OANI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAC/B,MAAM,MAAgB,EAAA,mBAAmB,CAAC,EAK5C,MAHgB,MACrB,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,aAAa,CAChE,EACe,QAAQ,IAAK,IAAO,CAClC,KAAM,EAAE,KACR,YAAa,EAAE,YAChB,EAAE,OACI,EAAO,CAEd,OADA,QAAQ,MAAM,yCAA0C,EAAM,CACvD,EAAE,EAab,aAAa,aACX,EACA,EACA,EACe,CACf,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAAS,CAC/C,MAAM,MAAgB,EAAA,kBAAkB,EAAM,EAAO,EAAY,CAAC,CAClE,OAEF,MAAM,MACJ,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,aAAa,CAC7D,OACA,QACA,cACD,CAAC,CACH,CAaH,aAAa,aACX,EACA,EACA,EACe,CACf,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAAS,CAI/C,MAAM,MAAgB,EAAA,kBAAkB,EAAM,EAAO,EAAY,CAAC,CAClE,OAGF,MAAM,KAAK,aAAa,EAAM,EAAO,EAAY,CAUnD,aAAa,aAAa,EAA6B,CACrD,GAAI,CACF,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QAAS,CAC/C,MAAM,MAAgB,EAAA,kBAAkB,EAAK,CAAC,CAC9C,OAEF,MAAM,MACJ,IAAI,EAAA,eAAe,EAAA,6BAA6B,CAAC,CAAC,aAAa,EAAK,CACrE,OACM,EAAO,CAId,GACE,EAAA,qBAAqB,EAAO,IAAI,EAC/B,GACC,OAAO,GAAU,UACjB,aAAc,GACb,EAA6C,UAAU,SACtD,IAEJ,OAEF,MAAM"}