@openhands/agent-canvas 1.0.0-beta.6 → 1.0.0-beta.7

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 (802) hide show
  1. package/README.md +24 -7
  2. package/README.windows.md +27 -0
  3. package/bin/agent-canvas.mjs +26 -3
  4. package/build/assets/{QueryClientProvider-CkGuhXg-.js → QueryClientProvider-Cnr-Yl3j.js} +1 -1
  5. package/build/assets/{Trans-Cvm_-SMi.js → Trans-4jmk54WC.js} +1 -1
  6. package/build/assets/acp-providers-CPdgcp13.js +1 -0
  7. package/build/assets/{acp-route-guard-B2yoBZ_4.js → acp-route-guard-BoVmCn0e.js} +1 -1
  8. package/build/assets/active-backend-context-Beu-LZL-.js +1 -0
  9. package/build/assets/add-backend-modal-BheqYXHK.js +1 -0
  10. package/build/assets/agent-server-client-options-HEOwGVIU.js +1 -0
  11. package/build/assets/agent-server-compatibility-CdI3N7dr.js +1 -0
  12. package/build/assets/agent-server-conversation-service.api-CORdqJZg.js +5 -0
  13. package/build/assets/{agent-settings-CnGSCmK8.js → agent-settings-UFvcGjoI.js} +1 -1
  14. package/build/assets/{alert-banner-DtzAX654.js → alert-banner-DFnn_lC6.js} +1 -1
  15. package/build/assets/{analytics-consent-form-modal-CHZ3I37v.js → analytics-consent-form-modal-CVNugqzu.js} +1 -1
  16. package/build/assets/api-key-entry-screen-M6su2VSf.js +1 -0
  17. package/build/assets/{app-settings-Db9ITeJH.js → app-settings-BlvBhBdc.js} +1 -1
  18. package/build/assets/automation-detail-BWrQk4Oa.js +1 -0
  19. package/build/assets/automations-list-ux9KvYsU.js +1 -0
  20. package/build/assets/back-nav-button-7dQJ2k3O.js +1 -0
  21. package/build/assets/backend-form-modal-CDnEYjaU.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-Dc6c7GT4.js → backend-synced-settings-badge-BTIj-Ffq.js} +1 -1
  23. package/build/assets/base-modal-C2oy2EBG.js +1 -0
  24. package/build/assets/brand-button-DJ_S16rO.js +1 -0
  25. package/build/assets/{browser-D810xUYt.js → browser-CGM-k-sH.js} +2 -2
  26. package/build/assets/browser-store-DAsixKdU.js +1 -0
  27. package/build/assets/{browser-tab-B-aIqXRl.js → browser-tab-dvSPdvkm.js} +1 -1
  28. package/build/assets/{checkmark-DL7acQA7.js → checkmark-Dus0b6jt.js} +1 -1
  29. package/build/assets/{chevron-left-small-CVWf8TI6.js → chevron-left-small-_uvG7RVM.js} +1 -1
  30. package/build/assets/{circle-plus-check-toggle-P7ZZToV4.js → circle-plus-check-toggle-DKS8MAVV.js} +1 -1
  31. package/build/assets/{close-B5LROHR3.js → close-BU5iTc66.js} +1 -1
  32. package/build/assets/code-tag-BzyqOtPD.js +1 -0
  33. package/build/assets/combobox-caret-BJC7XJsz.js +1 -0
  34. package/build/assets/{command-store-DFN_17p1.js → command-store-CE1weJy8.js} +1 -1
  35. package/build/assets/{condenser-settings-wnEKhBof.js → condenser-settings-BolbDvm5.js} +1 -1
  36. package/build/assets/{confirmation-modal-Dau3w_sa.js → confirmation-modal-B5Ca6qFE.js} +1 -1
  37. package/build/assets/context-menu-list-item-7tAcm2c3.js +1 -0
  38. package/build/assets/conversation-D0N4dw_p.js +19 -0
  39. package/build/assets/conversation-DhRJuZLG.js +1 -0
  40. package/build/assets/conversation-panel-CNqHbS_Z.js +1 -0
  41. package/build/assets/conversation-service.api-BsJy6uuL.js +1 -0
  42. package/build/assets/conversation-state-store-D-w0uurj.js +1 -0
  43. package/build/assets/conversation-store-CC-isCnP.js +1 -0
  44. package/build/assets/{conversation-tab-empty-state-DyssnnWa.js → conversation-tab-empty-state-CStQLPVW.js} +1 -1
  45. package/build/assets/conversation-websocket-context-DvHgx_FE.js +3 -0
  46. package/build/assets/{copy-DYgmUdIw.js → copy-Chg-sFu3.js} +1 -1
  47. package/build/assets/{custom-toast-handlers-C-SZFmto.js → custom-toast-handlers-ufGJ6_Rc.js} +1 -1
  48. package/build/assets/declaration-CR6HMp29.js +1 -0
  49. package/build/assets/{device-verify-DqDlphsG.js → device-verify-C6mj28zv.js} +1 -1
  50. package/build/assets/dist-DNeWJ2bh.js +1 -0
  51. package/build/assets/dropdown-classes-BsVmxlNG.js +1 -0
  52. package/build/assets/edit-automation-modal-BpX-t-HD.js +1 -0
  53. package/build/assets/ellipsis-button-Vh5MvRZa.js +1 -0
  54. package/build/assets/entry.client-Ck9rQCg-.js +2 -0
  55. package/build/assets/enum-filter-dropdown-5JeF2RLb.js +1 -0
  56. package/build/assets/{environment-switch-overlay-XL8yCGP6.js → environment-switch-overlay-Tf_BIfeR.js} +1 -1
  57. package/build/assets/extensions-hub-CE9QOb5n.js +1 -0
  58. package/build/assets/{extensions-navigation-BYR8Giqq.js → extensions-navigation-DSLGNGbS.js} +1 -1
  59. package/build/assets/file-BTY6Gyy9.js +1 -0
  60. package/build/assets/files-tab-cL668j1I.js +1 -0
  61. package/build/assets/files-tab-store-m0ARqX_E.js +1 -0
  62. package/build/assets/{folder-ZZJVGgd7.js → folder-D1T2W1cj.js} +1 -1
  63. package/build/assets/git-control-bar-branch-button-DtIrOrie.js +27 -0
  64. package/build/assets/git-provider-icon-CHdGBdU2.js +1 -0
  65. package/build/assets/globe-Bzj_0oXT.js +1 -0
  66. package/build/assets/home-Cz2Veg56.js +1 -0
  67. package/build/assets/{i18n-CTohRuoO.js → i18n-DET2iOyh.js} +1 -1
  68. package/build/assets/install-server-modal-B9nXCS3u.js +1 -0
  69. package/build/assets/launch-CWz0dm4o.js +1 -0
  70. package/build/assets/{lesson-plan-dH5Bj0pN.js → lesson-plan-duSsqWVs.js} +1 -1
  71. package/build/assets/link-external-DGxVm4Ps.js +1 -0
  72. package/build/assets/{llm-client-DaH1TuyR.js → llm-client-CYEaUjGx.js} +1 -1
  73. package/build/assets/llm-settings-DFkXHuvT.js +1 -0
  74. package/build/assets/llm-settings-DhrdCXqX.js +1 -0
  75. package/build/assets/{loading-spinner-BPtYORNK.js → loading-spinner-5GT9q1xy.js} +1 -1
  76. package/build/assets/manage-backends-modal-DpBD_vR9.js +1 -0
  77. package/build/assets/manage-workspaces-modal-CtRbxREx.js +1 -0
  78. package/build/assets/manifest-eed90ff5.js +1 -0
  79. package/build/assets/{markdown-renderer-DMzf2i4x.js → markdown-renderer-B3IAVfv4.js} +1 -1
  80. package/build/assets/mcp-BUe7kiYM.js +9 -0
  81. package/build/assets/messages-dqp_KYyl.js +36 -0
  82. package/build/assets/{modal-backdrop-BAbgYsqB.js → modal-backdrop-RfNCrSpK.js} +1 -1
  83. package/build/assets/{modal-body-BI6Ru2Qr.js → modal-body-aoa2fx5W.js} +1 -1
  84. package/build/assets/modal-classes-6YqcqA6y.js +1 -0
  85. package/build/assets/{modal-close-button-t1Gh3qmL.js → modal-close-button-CtWOUMmw.js} +1 -1
  86. package/build/assets/{model-selector-SM9IUz-q.js → model-selector-BvSTrkhT.js} +1 -1
  87. package/build/assets/{navigation-context-D0YWpT8d.js → navigation-context-BdKYH32C.js} +1 -1
  88. package/build/assets/{navigation-link-Cn7KP3c5.js → navigation-link-U4vY9i_C.js} +1 -1
  89. package/build/assets/{openhands-logo-CnrF6LKb.js → openhands-logo-CCo0wJZX.js} +1 -1
  90. package/build/assets/{option-service.api-KvY_mZMY.js → option-service.api-DmNVxAvS.js} +1 -1
  91. package/build/assets/{organization-service.api-DzYTHTYC.js → organization-service.api-DbnougaQ.js} +1 -1
  92. package/build/assets/{path-utils-C3bQf6lJ.js → path-utils-onx24uF5.js} +1 -1
  93. package/build/assets/{plan-components-atxXCF0R.js → plan-components-CRDMQzsS.js} +1 -1
  94. package/build/assets/{planner-tab-BlrCpv-7.js → planner-tab-CmIjLz7q.js} +1 -1
  95. package/build/assets/{profiles-client-D6IkTJof.js → profiles-client-fEmgWkCW.js} +1 -1
  96. package/build/assets/{providers-Bx6EfrzZ.js → providers-CbD7fiic.js} +1 -1
  97. package/build/assets/proxy-BAdHH8QB.js +1 -0
  98. package/build/assets/{query-client-config-B7u9asM0.js → query-client-config-CRnGSujB.js} +1 -1
  99. package/build/assets/{recommended-automations-launcher-CgV8FyPK.js → recommended-automations-launcher-uTyODuzB.js} +3 -3
  100. package/build/assets/{root-dNntxffj.js → root-DmjpFpTu.js} +2 -2
  101. package/build/assets/root-Z2VHU4R3.css +1 -0
  102. package/build/assets/root-layout-DejMsKhy.js +2 -0
  103. package/build/assets/{sdk-section-page-DOIKvwSL.js → sdk-section-page-BgDlMhcq.js} +1 -1
  104. package/build/assets/{sdk-settings-schema-DsUf9wu1.js → sdk-settings-schema-CLmJ9sho.js} +1 -1
  105. package/build/assets/{search-27Owlc3A.js → search-SuJctqNJ.js} +1 -1
  106. package/build/assets/secrets-service-B7CxNinp.js +1 -0
  107. package/build/assets/secrets-settings-yK7CqIpm.js +1 -0
  108. package/build/assets/{server-client-DyAQ3NZ_.js → server-client-Kh4QSwDJ.js} +1 -1
  109. package/build/assets/{settings-BYkVX7vW.js → settings-DN5PpgRD.js} +1 -1
  110. package/build/assets/{settings-dropdown-input-BJYvGdg-.js → settings-dropdown-input-BtoovFre.js} +1 -1
  111. package/build/assets/{settings-gear-C77PgE_O.js → settings-gear-Dd8K2_8B.js} +1 -1
  112. package/build/assets/settings-index-DKC8IY1P.js +1 -0
  113. package/build/assets/{settings-input-Bn7F5C75.js → settings-input-CehsXnb3.js} +1 -1
  114. package/build/assets/settings-list-classes-E3v_f6QG.js +1 -0
  115. package/build/assets/settings-modal-DJ4kGzUx.js +1 -0
  116. package/build/assets/{settings-section-header-context-BgZe5YkE.js → settings-section-header-context-DewwJ0-F.js} +1 -1
  117. package/build/assets/settings-service.api-C3rxTtPj.js +1 -0
  118. package/build/assets/{settings-switch-BeIKrWms.js → settings-switch-BiBuS3xa.js} +1 -1
  119. package/build/assets/{settings-utils-B6Nl07io.js → settings-utils-DY04tWG1.js} +1 -1
  120. package/build/assets/{shared-conversation-AMyqXvpk.js → shared-conversation-h9YnBtCU.js} +1 -1
  121. package/build/assets/sidebar-mobile-menu-toggle-D0-AvsnT.js +1 -0
  122. package/build/assets/{sidebar-nav-link-BGjiJq-4.js → sidebar-nav-link-OhIeFyna.js} +1 -1
  123. package/build/assets/{sidebar-store-Uy3v0AOV.js → sidebar-store-DnQAJAE5.js} +1 -1
  124. package/build/assets/{skill-card-pill-row-DF1axQCG.js → skill-card-pill-row-BW9qvhoK.js} +1 -1
  125. package/build/assets/{skills-ChIKZPK4.js → skills-0GRKX5Xj.js} +1 -1
  126. package/build/assets/{skills-plugins-CcI_19lM.js → skills-plugins-DNcsNF88.js} +1 -1
  127. package/build/assets/skills-settings-7liFiSY6.js +2 -0
  128. package/build/assets/{styled-tooltip-CBzrri6o.js → styled-tooltip-hdfMXPQC.js} +1 -1
  129. package/build/assets/{switch-skeleton-DnC9wLp7.js → switch-skeleton-DSKqSx2A.js} +1 -1
  130. package/build/assets/{task-list-tab-DUJn1sgz.js → task-list-tab-DT6_zfUs.js} +1 -1
  131. package/build/assets/{terminal-DgQk1Ay6.js → terminal-CDhQGDua.js} +2 -2
  132. package/build/assets/{terminal-RmuaSdhJ.js → terminal-CPYWdo4j.js} +1 -1
  133. package/build/assets/{toggle-switch-Pvyp2RAN.js → toggle-switch-T2v6sJ6l.js} +1 -1
  134. package/build/assets/{typography-gpuWmrQO.js → typography-BDgnT7Yp.js} +1 -1
  135. package/build/assets/{u-check-circle-IUIfACQQ.js → u-check-circle-DOauqQKb.js} +1 -1
  136. package/build/assets/{u-check-circle-half-C1YxB6py.js → u-check-circle-half-steSK_JB.js} +1 -1
  137. package/build/assets/{u-circuit-BmVikJHu.js → u-circuit-x3ExjBbU.js} +1 -1
  138. package/build/assets/{u-edit-CFvXHqZk.js → u-edit-BbrptMCa.js} +1 -1
  139. package/build/assets/{use-active-conversation-BEFNwnFk.js → use-active-conversation-DHGcmjCK.js} +1 -1
  140. package/build/assets/use-agent-settings-schema-CLoTOSJI.js +1 -0
  141. package/build/assets/{use-agent-state-Bkrd1FZq.js → use-agent-state-PKrUPMJ3.js} +1 -1
  142. package/build/assets/{use-cloud-current-user-id-CvkXFnTT.js → use-cloud-current-user-id-Ddr75hEz.js} +1 -1
  143. package/build/assets/{use-config-Co1O8-Ey.js → use-config-OIMQLQ2s.js} +1 -1
  144. package/build/assets/{use-create-conversation-CEgXpkfH.js → use-create-conversation-Bszyp13O.js} +1 -1
  145. package/build/assets/{use-event-store-BT_gV3ut.js → use-event-store-BomO7ywK.js} +1 -1
  146. package/build/assets/{use-get-secrets-DuhdIA59.js → use-get-secrets-8Jby8ele.js} +1 -1
  147. package/build/assets/{use-handle-plan-click-Ckkm5eIY.js → use-handle-plan-click-CohJPvvW.js} +1 -1
  148. package/build/assets/use-is-authed-dw2026rR.js +1 -0
  149. package/build/assets/{use-is-creating-conversation-BZ5hB_Bg.js → use-is-creating-conversation-DX2qSlfL.js} +1 -1
  150. package/build/assets/{use-launch-skill-in-chat-fNN_xGZG.js → use-launch-skill-in-chat-sQNEOLGD.js} +1 -1
  151. package/build/assets/use-llm-profiles-C861aFAq.js +1 -0
  152. package/build/assets/use-runtime-is-ready-Do2h_hRl.js +1 -0
  153. package/build/assets/{use-save-settings-VUrj_QNG.js → use-save-settings-DkAOEfD9.js} +1 -1
  154. package/build/assets/use-settings-D5hbTS9t.js +1 -0
  155. package/build/assets/{use-settings-nav-items-1ZvovKSr.js → use-settings-nav-items-BcSbo02d.js} +1 -1
  156. package/build/assets/{use-skills-DAMLFjKU.js → use-skills-D7PS0fH0.js} +1 -1
  157. package/build/assets/{use-task-list-CLJbuJgM.js → use-task-list-CsT10CBb.js} +1 -1
  158. package/build/assets/{use-unified-vscode-url-DdSRw-6P.js → use-unified-vscode-url-DEoe-NRI.js} +1 -1
  159. package/build/assets/use-user-conversation-Cs5H1pUF.js +1 -0
  160. package/build/assets/{useMutation-DqrumCWD.js → useMutation-GSSKKebK.js} +1 -1
  161. package/build/assets/{useTranslation-DCOdSSMl.js → useTranslation-B6voJV4y.js} +1 -1
  162. package/build/assets/utils-DCVfKFRt.js +1 -0
  163. package/build/assets/{vendor~browser-BNjNhjFU.js → vendor~browser-BrOJLj3y.js} +1 -1
  164. package/build/assets/vendor~conversation-panel~conversation-C9o-K1hW.js +1 -0
  165. package/build/assets/vendor~conversation-panel~conversation~index-RXYdJYxU.js +1 -0
  166. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js} +1 -1
  167. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DpAdkv8m.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-6ByzelMS.js} +1 -1
  168. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B92czPCF.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BED5W_c4.js} +1 -1
  169. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-By5W2oHN.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CCbqAFiI.js} +1 -1
  170. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BbFOrAjI.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CG96FCly.js} +1 -1
  171. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-smY2r837.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-E4d6IEfI.js} +1 -1
  172. package/build/assets/{vendor~home~mcp~automations-list-Cs-TO3fK.js → vendor~home~mcp~automations-list-CZSK-lT2.js} +1 -1
  173. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-Z3nsiNNq.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js} +1 -1
  174. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-DbfELDJu.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js} +2 -2
  175. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js → vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js} +1 -1
  176. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js +1 -0
  177. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js +9 -0
  178. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BkQGKpye.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js} +1 -1
  179. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-Bbs7UJ5U.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js} +2 -2
  180. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-hTzSytKK.js} +1 -1
  181. package/build/assets/{vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js → vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js} +1 -1
  182. package/build/assets/{verification-settings-CsbvQcYS.js → verification-settings-Dlt8pINd.js} +1 -1
  183. package/build/assets/{vscode-tab-DjNArCgY.js → vscode-tab-DgepcYtF.js} +1 -1
  184. package/build/assets/{waiting-for-runtime-message-CntjExbU.js → waiting-for-runtime-message-CdK3btDZ.js} +1 -1
  185. package/build/assets/{x-mark-CrpjscNc.js → x-mark-BrkSPIiT.js} +1 -1
  186. package/build/index.html +4 -4
  187. package/build/locales/ar/openhands.json +20 -2
  188. package/build/locales/ca/openhands.json +20 -2
  189. package/build/locales/de/openhands.json +20 -2
  190. package/build/locales/en/openhands.json +20 -2
  191. package/build/locales/es/openhands.json +20 -2
  192. package/build/locales/fr/openhands.json +20 -2
  193. package/build/locales/it/openhands.json +20 -2
  194. package/build/locales/ja/openhands.json +20 -2
  195. package/build/locales/ko-KR/openhands.json +20 -2
  196. package/build/locales/no/openhands.json +20 -2
  197. package/build/locales/pt/openhands.json +20 -2
  198. package/build/locales/tr/openhands.json +20 -2
  199. package/build/locales/uk/openhands.json +20 -2
  200. package/build/locales/zh-CN/openhands.json +20 -2
  201. package/build/locales/zh-TW/openhands.json +20 -2
  202. package/dist/api/acp-service/acp-service.api.d.ts +18 -0
  203. package/dist/api/agent-server-adapter.cjs +3 -3
  204. package/dist/api/agent-server-adapter.cjs.map +1 -1
  205. package/dist/api/agent-server-adapter.js +54 -55
  206. package/dist/api/agent-server-adapter.js.map +1 -1
  207. package/dist/api/agent-server-client-options.cjs +1 -1
  208. package/dist/api/agent-server-client-options.cjs.map +1 -1
  209. package/dist/api/agent-server-client-options.d.ts +4 -0
  210. package/dist/api/agent-server-client-options.js +18 -12
  211. package/dist/api/agent-server-client-options.js.map +1 -1
  212. package/dist/api/agent-server-compatibility.cjs +1 -1
  213. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  214. package/dist/api/agent-server-compatibility.d.ts +1 -1
  215. package/dist/api/agent-server-compatibility.js +30 -25
  216. package/dist/api/agent-server-compatibility.js.map +1 -1
  217. package/dist/api/agent-server-config.cjs +1 -1
  218. package/dist/api/agent-server-config.cjs.map +1 -1
  219. package/dist/api/agent-server-config.d.ts +1 -51
  220. package/dist/api/agent-server-config.js +20 -70
  221. package/dist/api/agent-server-config.js.map +1 -1
  222. package/dist/api/backend-registry/active-store.cjs +1 -1
  223. package/dist/api/backend-registry/active-store.cjs.map +1 -1
  224. package/dist/api/backend-registry/active-store.d.ts +11 -5
  225. package/dist/api/backend-registry/active-store.js +36 -27
  226. package/dist/api/backend-registry/active-store.js.map +1 -1
  227. package/dist/api/backend-registry/auth.cjs +1 -1
  228. package/dist/api/backend-registry/auth.cjs.map +1 -1
  229. package/dist/api/backend-registry/auth.js +3 -9
  230. package/dist/api/backend-registry/auth.js.map +1 -1
  231. package/dist/api/backend-registry/default-backend.cjs +1 -1
  232. package/dist/api/backend-registry/default-backend.cjs.map +1 -1
  233. package/dist/api/backend-registry/default-backend.d.ts +9 -16
  234. package/dist/api/backend-registry/default-backend.js +5 -4
  235. package/dist/api/backend-registry/default-backend.js.map +1 -1
  236. package/dist/api/backend-registry/storage.cjs +1 -1
  237. package/dist/api/backend-registry/storage.cjs.map +1 -1
  238. package/dist/api/backend-registry/storage.js +67 -34
  239. package/dist/api/backend-registry/storage.js.map +1 -1
  240. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  241. package/dist/api/cloud/conversation-service.api.d.ts +8 -13
  242. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  243. package/dist/api/cloud/organization-service.api.cjs.map +1 -1
  244. package/dist/api/cloud/organization-service.api.d.ts +1 -2
  245. package/dist/api/cloud/organization-service.api.js.map +1 -1
  246. package/dist/api/cloud/proxy.cjs +1 -1
  247. package/dist/api/cloud/proxy.cjs.map +1 -1
  248. package/dist/api/cloud/proxy.d.ts +6 -6
  249. package/dist/api/cloud/proxy.js +33 -24
  250. package/dist/api/cloud/proxy.js.map +1 -1
  251. package/dist/api/cloud/sandbox-service.api.cjs.map +1 -1
  252. package/dist/api/cloud/sandbox-service.api.d.ts +3 -3
  253. package/dist/api/cloud/sandbox-service.api.js.map +1 -1
  254. package/dist/api/cloud/secrets-service.api.cjs.map +1 -1
  255. package/dist/api/cloud/secrets-service.api.d.ts +3 -4
  256. package/dist/api/cloud/secrets-service.api.js.map +1 -1
  257. package/dist/api/cloud/settings-service.api.cjs +1 -1
  258. package/dist/api/cloud/settings-service.api.cjs.map +1 -1
  259. package/dist/api/cloud/settings-service.api.js +5 -1
  260. package/dist/api/cloud/settings-service.api.js.map +1 -1
  261. package/dist/api/cloud/skills-service.api.cjs.map +1 -1
  262. package/dist/api/cloud/skills-service.api.d.ts +5 -5
  263. package/dist/api/cloud/skills-service.api.js.map +1 -1
  264. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  265. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  266. package/dist/api/conversation-service/agent-server-conversation-service.api.js +115 -108
  267. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  268. package/dist/api/device-flow-client.cjs +1 -1
  269. package/dist/api/device-flow-client.cjs.map +1 -1
  270. package/dist/api/device-flow-client.d.ts +3 -5
  271. package/dist/api/device-flow-client.js +55 -66
  272. package/dist/api/device-flow-client.js.map +1 -1
  273. package/dist/api/event-service/event-service.api.cjs +1 -1
  274. package/dist/api/event-service/event-service.api.cjs.map +1 -1
  275. package/dist/api/event-service/event-service.api.d.ts +3 -3
  276. package/dist/api/event-service/event-service.api.js +17 -17
  277. package/dist/api/event-service/event-service.api.js.map +1 -1
  278. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  279. package/dist/api/git-service/agent-server-git-service.api.js +11 -11
  280. package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
  281. package/dist/api/runtime-service/agent-server-runtime-service.js +6 -6
  282. package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.cjs +2 -2
  283. package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.js +10 -10
  284. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.cjs.map +1 -1
  285. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.d.ts +5 -5
  286. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.js.map +1 -1
  287. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
  288. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  289. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +1 -1
  290. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  291. package/dist/components/features/automations/automation-action-button-classes.d.ts +2 -2
  292. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  293. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  294. package/dist/components/features/backends/backend-form-modal.d.ts +1 -0
  295. package/dist/components/features/backends/backend-form-modal.js +203 -140
  296. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  297. package/dist/components/features/backends/backend-selector.cjs +1 -1
  298. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  299. package/dist/components/features/backends/backend-selector.js +117 -105
  300. package/dist/components/features/backends/backend-selector.js.map +1 -1
  301. package/dist/components/features/backends/backend-status-dot.cjs +1 -1
  302. package/dist/components/features/backends/backend-status-dot.cjs.map +1 -1
  303. package/dist/components/features/backends/backend-status-dot.d.ts +1 -1
  304. package/dist/components/features/backends/backend-status-dot.js +1 -1
  305. package/dist/components/features/backends/backend-status-dot.js.map +1 -1
  306. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  307. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  308. package/dist/components/features/backends/manage-backends-modal.js +81 -70
  309. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  310. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  311. package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
  312. package/dist/components/features/chat/change-agent-button.js +59 -57
  313. package/dist/components/features/chat/change-agent-button.js.map +1 -1
  314. package/dist/components/features/chat/change-agent-context-menu.cjs +1 -1
  315. package/dist/components/features/chat/change-agent-context-menu.cjs.map +1 -1
  316. package/dist/components/features/chat/change-agent-context-menu.d.ts +3 -1
  317. package/dist/components/features/chat/change-agent-context-menu.js +30 -25
  318. package/dist/components/features/chat/change-agent-context-menu.js.map +1 -1
  319. package/dist/components/features/chat/chat-add-file-button.cjs +1 -1
  320. package/dist/components/features/chat/chat-add-file-button.cjs.map +1 -1
  321. package/dist/components/features/chat/chat-add-file-button.js +39 -38
  322. package/dist/components/features/chat/chat-add-file-button.js.map +1 -1
  323. package/dist/components/features/chat/chat-message.cjs +1 -1
  324. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  325. package/dist/components/features/chat/chat-message.d.ts +2 -1
  326. package/dist/components/features/chat/chat-message.js +185 -57
  327. package/dist/components/features/chat/chat-message.js.map +1 -1
  328. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  329. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  330. package/dist/components/features/chat/components/chat-input-actions.js +113 -113
  331. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  332. package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
  333. package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
  334. package/dist/components/features/chat/components/chat-input-model.js +52 -51
  335. package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
  336. package/dist/components/features/chat/components/slash-command-menu.cjs +2 -2
  337. package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
  338. package/dist/components/features/chat/components/slash-command-menu.js +38 -34
  339. package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
  340. package/dist/components/features/chat/git-control-bar-pr-button.cjs +1 -1
  341. package/dist/components/features/chat/git-control-bar-pr-button.cjs.map +1 -1
  342. package/dist/components/features/chat/git-control-bar-pr-button.js +16 -15
  343. package/dist/components/features/chat/git-control-bar-pr-button.js.map +1 -1
  344. package/dist/components/features/chat/git-control-bar-pull-button.cjs +1 -1
  345. package/dist/components/features/chat/git-control-bar-pull-button.cjs.map +1 -1
  346. package/dist/components/features/chat/git-control-bar-pull-button.js +16 -15
  347. package/dist/components/features/chat/git-control-bar-pull-button.js.map +1 -1
  348. package/dist/components/features/chat/git-control-bar-push-button.cjs +1 -1
  349. package/dist/components/features/chat/git-control-bar-push-button.cjs.map +1 -1
  350. package/dist/components/features/chat/git-control-bar-push-button.js +16 -15
  351. package/dist/components/features/chat/git-control-bar-push-button.js.map +1 -1
  352. package/dist/components/features/chat/git-control-bar.cjs +1 -1
  353. package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
  354. package/dist/components/features/chat/git-control-bar.js +63 -62
  355. package/dist/components/features/chat/git-control-bar.js.map +1 -1
  356. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  357. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  358. package/dist/components/features/chat/pending-user-messages.js +27 -23
  359. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  360. package/dist/components/features/chat/switch-profile-button.cjs +1 -1
  361. package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
  362. package/dist/components/features/chat/switch-profile-button.js +26 -25
  363. package/dist/components/features/chat/switch-profile-button.js.map +1 -1
  364. package/dist/components/features/chat/switch-profile-context-menu.cjs +1 -1
  365. package/dist/components/features/chat/switch-profile-context-menu.cjs.map +1 -1
  366. package/dist/components/features/chat/switch-profile-context-menu.js +77 -67
  367. package/dist/components/features/chat/switch-profile-context-menu.js.map +1 -1
  368. package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs +1 -1
  369. package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs.map +1 -1
  370. package/dist/components/features/context-menu/context-menu-icon-text-with-description.d.ts +2 -1
  371. package/dist/components/features/context-menu/context-menu-icon-text-with-description.js +3 -2
  372. package/dist/components/features/context-menu/context-menu-icon-text-with-description.js.map +1 -1
  373. package/dist/components/features/context-menu/context-menu-icon-text.cjs +1 -1
  374. package/dist/components/features/context-menu/context-menu-icon-text.cjs.map +1 -1
  375. package/dist/components/features/context-menu/context-menu-icon-text.d.ts +2 -1
  376. package/dist/components/features/context-menu/context-menu-icon-text.js +20 -10
  377. package/dist/components/features/context-menu/context-menu-icon-text.js.map +1 -1
  378. package/dist/components/features/context-menu/context-menu-list-item.cjs +1 -1
  379. package/dist/components/features/context-menu/context-menu-list-item.cjs.map +1 -1
  380. package/dist/components/features/context-menu/context-menu-list-item.js +10 -9
  381. package/dist/components/features/context-menu/context-menu-list-item.js.map +1 -1
  382. package/dist/components/features/controls/agent-status.cjs +1 -1
  383. package/dist/components/features/controls/agent-status.js +12 -12
  384. package/dist/components/features/controls/git-tools-submenu.cjs +1 -1
  385. package/dist/components/features/controls/git-tools-submenu.cjs.map +1 -1
  386. package/dist/components/features/controls/git-tools-submenu.js +1 -1
  387. package/dist/components/features/controls/git-tools-submenu.js.map +1 -1
  388. package/dist/components/features/controls/macros-submenu.cjs +1 -1
  389. package/dist/components/features/controls/macros-submenu.cjs.map +1 -1
  390. package/dist/components/features/controls/macros-submenu.js +1 -1
  391. package/dist/components/features/controls/macros-submenu.js.map +1 -1
  392. package/dist/components/features/controls/server-status-context-menu-icon-text.cjs +1 -1
  393. package/dist/components/features/controls/server-status-context-menu-icon-text.cjs.map +1 -1
  394. package/dist/components/features/controls/server-status-context-menu-icon-text.js +14 -15
  395. package/dist/components/features/controls/server-status-context-menu-icon-text.js.map +1 -1
  396. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  397. package/dist/components/features/controls/server-status-context-menu.js +4 -4
  398. package/dist/components/features/controls/server-status.cjs +1 -1
  399. package/dist/components/features/controls/server-status.js +7 -7
  400. package/dist/components/features/controls/tools-context-menu-icon-text.cjs +1 -1
  401. package/dist/components/features/controls/tools-context-menu-icon-text.cjs.map +1 -1
  402. package/dist/components/features/controls/tools-context-menu-icon-text.js +16 -16
  403. package/dist/components/features/controls/tools-context-menu-icon-text.js.map +1 -1
  404. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs +1 -1
  405. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs.map +1 -1
  406. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js +11 -11
  407. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js.map +1 -1
  408. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  409. package/dist/components/features/conversation/conversation-name-with-status.js +11 -11
  410. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  411. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  412. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +60 -47
  413. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  414. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs +1 -1
  415. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs.map +1 -1
  416. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js +86 -82
  417. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js.map +1 -1
  418. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  419. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +4 -4
  420. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  421. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +9 -9
  422. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  423. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  424. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +93 -93
  425. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  426. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  427. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  428. package/dist/components/features/conversation-panel/conversation-panel.js +177 -177
  429. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  430. package/dist/components/features/conversation-panel/ellipsis-button.cjs +1 -1
  431. package/dist/components/features/conversation-panel/ellipsis-button.cjs.map +1 -1
  432. package/dist/components/features/conversation-panel/ellipsis-button.js +13 -13
  433. package/dist/components/features/conversation-panel/ellipsis-button.js.map +1 -1
  434. package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs +1 -1
  435. package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs.map +1 -1
  436. package/dist/components/features/conversation-panel/local-new-conversation-menu.js +57 -53
  437. package/dist/components/features/conversation-panel/local-new-conversation-menu.js.map +1 -1
  438. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs +1 -1
  439. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs.map +1 -1
  440. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js +3 -2
  441. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js.map +1 -1
  442. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs +1 -1
  443. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs.map +1 -1
  444. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js +11 -8
  445. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js.map +1 -1
  446. package/dist/components/features/conversation-panel/system-message-modal/tab-content.cjs.map +1 -1
  447. package/dist/components/features/conversation-panel/system-message-modal/tab-content.d.ts +2 -5
  448. package/dist/components/features/conversation-panel/system-message-modal/tab-content.js.map +1 -1
  449. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  450. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  451. package/dist/components/features/files-tab/file-content-viewer.js +45 -42
  452. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  453. package/dist/components/features/home/llm-not-configured-banner.d.ts +11 -0
  454. package/dist/components/features/home/shared/dropdown-item.cjs +1 -1
  455. package/dist/components/features/home/shared/dropdown-item.cjs.map +1 -1
  456. package/dist/components/features/home/shared/dropdown-item.js +20 -16
  457. package/dist/components/features/home/shared/dropdown-item.js.map +1 -1
  458. package/dist/components/features/home/shared/generic-dropdown-menu.cjs +1 -1
  459. package/dist/components/features/home/shared/generic-dropdown-menu.cjs.map +1 -1
  460. package/dist/components/features/home/shared/generic-dropdown-menu.js +23 -22
  461. package/dist/components/features/home/shared/generic-dropdown-menu.js.map +1 -1
  462. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs +1 -1
  463. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs.map +1 -1
  464. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js +103 -102
  465. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js.map +1 -1
  466. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs +1 -1
  467. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs.map +1 -1
  468. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js +68 -67
  469. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js.map +1 -1
  470. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  471. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  472. package/dist/components/features/mcp-page/custom-server-editor.js +62 -60
  473. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  474. package/dist/components/features/mcp-page/index.cjs +1 -1
  475. package/dist/components/features/mcp-page/index.d.ts +1 -0
  476. package/dist/components/features/mcp-page/index.js +1 -0
  477. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  478. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  479. package/dist/components/features/mcp-page/install-server-modal.js +141 -121
  480. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  481. package/dist/components/features/mcp-page/save-as-secret-toggle.cjs +2 -0
  482. package/dist/components/features/mcp-page/save-as-secret-toggle.cjs.map +1 -0
  483. package/dist/components/features/mcp-page/save-as-secret-toggle.d.ts +7 -0
  484. package/dist/components/features/mcp-page/save-as-secret-toggle.js +50 -0
  485. package/dist/components/features/mcp-page/save-as-secret-toggle.js.map +1 -0
  486. package/dist/components/features/onboarding/onboarding-modal.d.ts +2 -2
  487. package/dist/components/features/onboarding/steps/check-backend-step.d.ts +1 -1
  488. package/dist/components/features/onboarding/steps/choose-agent-step.d.ts +2 -1
  489. package/dist/components/features/onboarding/steps/setup-acp-secrets-step.d.ts +19 -10
  490. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  491. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.d.ts +5 -0
  492. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -0
  493. package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
  494. package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
  495. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  496. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  497. package/dist/components/features/skills/extensions-navigation.js +1 -1
  498. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  499. package/dist/components/shared/buttons/back-nav-button.cjs +2 -0
  500. package/dist/components/shared/buttons/back-nav-button.cjs.map +1 -0
  501. package/dist/components/shared/buttons/back-nav-button.d.ts +17 -0
  502. package/dist/components/shared/buttons/back-nav-button.js +33 -0
  503. package/dist/components/shared/buttons/back-nav-button.js.map +1 -0
  504. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  505. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +5 -5
  506. package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
  507. package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
  508. package/dist/components/shared/filters/enum-filter-dropdown.js +32 -31
  509. package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
  510. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  511. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  512. package/dist/components/shared/modals/confirmation-modals/base-modal.js +14 -13
  513. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  514. package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
  515. package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
  516. package/dist/components/shared/modals/settings/settings-modal.js +17 -16
  517. package/dist/components/shared/modals/settings/settings-modal.js.map +1 -1
  518. package/dist/components/shared/text-shimmer.cjs +2 -0
  519. package/dist/components/shared/text-shimmer.cjs.map +1 -0
  520. package/dist/components/shared/text-shimmer.d.ts +11 -0
  521. package/dist/components/shared/text-shimmer.js +43 -0
  522. package/dist/components/shared/text-shimmer.js.map +1 -0
  523. package/dist/constants/acp-providers.cjs +1 -1
  524. package/dist/constants/acp-providers.cjs.map +1 -1
  525. package/dist/constants/acp-providers.d.ts +16 -3
  526. package/dist/constants/acp-providers.js +0 -1
  527. package/dist/constants/acp-providers.js.map +1 -1
  528. package/dist/contexts/active-backend-context.cjs +1 -1
  529. package/dist/contexts/active-backend-context.cjs.map +1 -1
  530. package/dist/contexts/active-backend-context.js +32 -32
  531. package/dist/contexts/active-backend-context.js.map +1 -1
  532. package/dist/hooks/chat/use-chat-input-logic.cjs +1 -1
  533. package/dist/hooks/chat/use-chat-input-logic.cjs.map +1 -1
  534. package/dist/hooks/chat/use-chat-input-logic.js +13 -6
  535. package/dist/hooks/chat/use-chat-input-logic.js.map +1 -1
  536. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs +2 -0
  537. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs.map +1 -0
  538. package/dist/hooks/mutation/use-save-fields-as-secrets.d.ts +9 -0
  539. package/dist/hooks/mutation/use-save-fields-as-secrets.js +24 -0
  540. package/dist/hooks/mutation/use-save-fields-as-secrets.js.map +1 -0
  541. package/dist/hooks/mutation/use-unified-start-conversation.cjs +1 -1
  542. package/dist/hooks/mutation/use-unified-start-conversation.js +8 -8
  543. package/dist/hooks/mutation/use-unified-stop-conversation.cjs +1 -1
  544. package/dist/hooks/mutation/use-unified-stop-conversation.js +15 -15
  545. package/dist/hooks/query/use-acp-auth-status.d.ts +36 -0
  546. package/dist/hooks/query/use-agent-settings-schema.cjs +1 -1
  547. package/dist/hooks/query/use-agent-settings-schema.cjs.map +1 -1
  548. package/dist/hooks/query/use-agent-settings-schema.js +26 -16
  549. package/dist/hooks/query/use-agent-settings-schema.js.map +1 -1
  550. package/dist/hooks/query/use-backends-health.cjs +1 -1
  551. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  552. package/dist/hooks/query/use-backends-health.d.ts +2 -0
  553. package/dist/hooks/query/use-backends-health.js +31 -21
  554. package/dist/hooks/query/use-backends-health.js.map +1 -1
  555. package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
  556. package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
  557. package/dist/hooks/query/use-paginated-conversations.js +15 -14
  558. package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
  559. package/dist/hooks/query/use-settings.cjs +1 -1
  560. package/dist/hooks/query/use-settings.cjs.map +1 -1
  561. package/dist/hooks/query/use-settings.js +65 -52
  562. package/dist/hooks/query/use-settings.js.map +1 -1
  563. package/dist/hooks/query/use-user-conversation.cjs +1 -1
  564. package/dist/hooks/query/use-user-conversation.cjs.map +1 -1
  565. package/dist/hooks/query/use-user-conversation.js +20 -11
  566. package/dist/hooks/query/use-user-conversation.js.map +1 -1
  567. package/dist/hooks/use-agent-state.cjs +1 -1
  568. package/dist/hooks/use-agent-state.js +13 -13
  569. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  570. package/dist/hooks/use-conversation-name-context-menu.js +10 -10
  571. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  572. package/dist/hooks/use-llm-configured.d.ts +25 -0
  573. package/dist/hooks/use-runtime-is-ready.cjs +1 -1
  574. package/dist/hooks/use-runtime-is-ready.js +5 -5
  575. package/dist/i18n/declaration.cjs +1 -1
  576. package/dist/i18n/declaration.cjs.map +1 -1
  577. package/dist/i18n/declaration.d.ts +19 -1
  578. package/dist/i18n/declaration.js +1 -1
  579. package/dist/i18n/declaration.js.map +1 -1
  580. package/dist/i18n/translation.cjs +3 -3
  581. package/dist/i18n/translation.cjs.map +1 -1
  582. package/dist/i18n/translation.js +321 -15
  583. package/dist/i18n/translation.js.map +1 -1
  584. package/dist/icons/stop-circle.cjs +1 -1
  585. package/dist/icons/stop-circle.cjs.map +1 -1
  586. package/dist/icons/stop-circle.js +7 -10
  587. package/dist/icons/stop-circle.js.map +1 -1
  588. package/dist/locales/ar/openhands.json +20 -2
  589. package/dist/locales/ca/openhands.json +20 -2
  590. package/dist/locales/de/openhands.json +20 -2
  591. package/dist/locales/en/openhands.json +20 -2
  592. package/dist/locales/es/openhands.json +20 -2
  593. package/dist/locales/fr/openhands.json +20 -2
  594. package/dist/locales/it/openhands.json +20 -2
  595. package/dist/locales/ja/openhands.json +20 -2
  596. package/dist/locales/ko-KR/openhands.json +20 -2
  597. package/dist/locales/no/openhands.json +20 -2
  598. package/dist/locales/pt/openhands.json +20 -2
  599. package/dist/locales/tr/openhands.json +20 -2
  600. package/dist/locales/uk/openhands.json +20 -2
  601. package/dist/locales/zh-CN/openhands.json +20 -2
  602. package/dist/locales/zh-TW/openhands.json +20 -2
  603. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs +2 -0
  604. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs.map +1 -0
  605. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +15 -0
  606. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js.map +1 -0
  607. package/dist/package.cjs +1 -1
  608. package/dist/package.cjs.map +1 -1
  609. package/dist/package.js +1 -1
  610. package/dist/package.js.map +1 -1
  611. package/dist/routes/conversation.cjs +1 -1
  612. package/dist/routes/conversation.cjs.map +1 -1
  613. package/dist/routes/conversation.js +1 -1
  614. package/dist/routes/conversation.js.map +1 -1
  615. package/dist/routes/llm-settings.cjs +1 -1
  616. package/dist/routes/llm-settings.cjs.map +1 -1
  617. package/dist/routes/llm-settings.js +55 -54
  618. package/dist/routes/llm-settings.js.map +1 -1
  619. package/dist/routes/secrets-settings.cjs +1 -1
  620. package/dist/routes/secrets-settings.cjs.map +1 -1
  621. package/dist/routes/secrets-settings.js +19 -27
  622. package/dist/routes/secrets-settings.js.map +1 -1
  623. package/dist/stores/conversation-store.cjs +1 -1
  624. package/dist/stores/conversation-store.cjs.map +1 -1
  625. package/dist/stores/conversation-store.d.ts +4 -0
  626. package/dist/stores/conversation-store.js +6 -0
  627. package/dist/stores/conversation-store.js.map +1 -1
  628. package/dist/types/agent-server/core/events/acp-tool-call-event.d.ts +6 -4
  629. package/dist/types/agent-server/core/events/system-event.d.ts +5 -0
  630. package/dist/types/automation.d.ts +15 -0
  631. package/dist/types/settings.d.ts +3 -1
  632. package/dist/ui/combobox-caret.cjs +1 -1
  633. package/dist/ui/combobox-caret.cjs.map +1 -1
  634. package/dist/ui/combobox-caret.d.ts +1 -1
  635. package/dist/ui/combobox-caret.js +9 -8
  636. package/dist/ui/combobox-caret.js.map +1 -1
  637. package/dist/ui/context-menu.cjs +1 -1
  638. package/dist/ui/context-menu.cjs.map +1 -1
  639. package/dist/ui/context-menu.js +9 -8
  640. package/dist/ui/context-menu.js.map +1 -1
  641. package/dist/ui/dropdown/dropdown-menu.cjs +1 -1
  642. package/dist/ui/dropdown/dropdown-menu.cjs.map +1 -1
  643. package/dist/ui/dropdown/dropdown-menu.js +21 -17
  644. package/dist/ui/dropdown/dropdown-menu.js.map +1 -1
  645. package/dist/ui/dropdown/dropdown.cjs +1 -1
  646. package/dist/ui/dropdown/dropdown.cjs.map +1 -1
  647. package/dist/ui/dropdown/dropdown.js +2 -2
  648. package/dist/ui/dropdown/dropdown.js.map +1 -1
  649. package/dist/utils/automation-schedule.d.ts +1 -0
  650. package/dist/utils/dropdown-classes.cjs +2 -0
  651. package/dist/utils/dropdown-classes.cjs.map +1 -0
  652. package/dist/utils/dropdown-classes.d.ts +32 -0
  653. package/dist/utils/dropdown-classes.js +8 -0
  654. package/dist/utils/dropdown-classes.js.map +1 -0
  655. package/dist/utils/form-control-classes.cjs +1 -1
  656. package/dist/utils/form-control-classes.cjs.map +1 -1
  657. package/dist/utils/form-control-classes.d.ts +18 -2
  658. package/dist/utils/form-control-classes.js +4 -3
  659. package/dist/utils/form-control-classes.js.map +1 -1
  660. package/dist/utils/git-control-bar-classes.cjs +2 -0
  661. package/dist/utils/git-control-bar-classes.cjs.map +1 -0
  662. package/dist/utils/git-control-bar-classes.d.ts +4 -0
  663. package/dist/utils/git-control-bar-classes.js +14 -0
  664. package/dist/utils/git-control-bar-classes.js.map +1 -0
  665. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  666. package/dist/utils/handle-event-for-ui.d.ts +6 -3
  667. package/dist/utils/handle-event-for-ui.js.map +1 -1
  668. package/dist/utils/mobile-top-bar-icon-button-classes.cjs +1 -1
  669. package/dist/utils/mobile-top-bar-icon-button-classes.cjs.map +1 -1
  670. package/dist/utils/mobile-top-bar-icon-button-classes.js +3 -3
  671. package/dist/utils/mobile-top-bar-icon-button-classes.js.map +1 -1
  672. package/dist/utils/modal-classes.cjs +2 -0
  673. package/dist/utils/modal-classes.cjs.map +1 -0
  674. package/dist/utils/modal-classes.d.ts +8 -0
  675. package/dist/utils/modal-classes.js +7 -0
  676. package/dist/utils/modal-classes.js.map +1 -0
  677. package/dist/utils/openhands-llm.cjs +2 -0
  678. package/dist/utils/openhands-llm.cjs.map +1 -0
  679. package/dist/utils/openhands-llm.d.ts +2 -0
  680. package/dist/utils/openhands-llm.js +9 -0
  681. package/dist/utils/openhands-llm.js.map +1 -0
  682. package/dist/utils/redact-custom-secrets.cjs +2 -0
  683. package/dist/utils/redact-custom-secrets.cjs.map +1 -0
  684. package/dist/utils/redact-custom-secrets.d.ts +6 -0
  685. package/dist/utils/redact-custom-secrets.js +10 -0
  686. package/dist/utils/redact-custom-secrets.js.map +1 -0
  687. package/dist/utils/status.cjs +1 -1
  688. package/dist/utils/status.cjs.map +1 -1
  689. package/dist/utils/status.d.ts +2 -1
  690. package/dist/utils/status.js +9 -8
  691. package/dist/utils/status.js.map +1 -1
  692. package/dist/utils/system-message-adapter.cjs +1 -1
  693. package/dist/utils/system-message-adapter.cjs.map +1 -1
  694. package/dist/utils/system-message-adapter.js +10 -7
  695. package/dist/utils/system-message-adapter.js.map +1 -1
  696. package/dist/utils/utils.cjs +1 -1
  697. package/dist/utils/utils.cjs.map +1 -1
  698. package/dist/utils/utils.d.ts +2 -1
  699. package/dist/utils/utils.js +21 -20
  700. package/dist/utils/utils.js.map +1 -1
  701. package/package.json +1 -1
  702. package/scripts/dev-safe.mjs +3 -1
  703. package/scripts/dev-static.mjs +2 -2
  704. package/scripts/dev-with-automation.mjs +283 -108
  705. package/scripts/static-build.mjs +20 -19
  706. package/scripts/static-server.mjs +50 -3
  707. package/build/assets/acp-providers-CbiRekh9.js +0 -1
  708. package/build/assets/active-backend-context-cCM1vYYZ.js +0 -1
  709. package/build/assets/add-backend-modal-DIUQzMPa.js +0 -1
  710. package/build/assets/agent-server-client-options-Bc5ZorQZ.js +0 -1
  711. package/build/assets/agent-server-compatibility-BlkUsrX2.js +0 -1
  712. package/build/assets/agent-server-conversation-service.api-C2V5SlHu.js +0 -5
  713. package/build/assets/api-key-entry-screen-B2gynaCp.js +0 -1
  714. package/build/assets/automation-detail-DJvbVSYK.js +0 -1
  715. package/build/assets/automations-list-6FDbI5dc.js +0 -1
  716. package/build/assets/backend-form-modal-Dnk33xA_.js +0 -1
  717. package/build/assets/base-modal-_dYTw1ri.js +0 -1
  718. package/build/assets/brand-button-Br7f0kZJ.js +0 -1
  719. package/build/assets/browser-store-Couc4S5D.js +0 -1
  720. package/build/assets/clock-BRjCgHTc.js +0 -1
  721. package/build/assets/combobox-caret-to1O8irE.js +0 -1
  722. package/build/assets/context-menu-list-item-CWNFpuiC.js +0 -1
  723. package/build/assets/conversation-DVrKU0oz.js +0 -19
  724. package/build/assets/conversation-Dlys-D5A.js +0 -1
  725. package/build/assets/conversation-panel-iF09WjZ4.js +0 -1
  726. package/build/assets/conversation-service.api-CCfztilW.js +0 -1
  727. package/build/assets/conversation-state-store-u5jepov0.js +0 -1
  728. package/build/assets/conversation-store-Z5iMCRpc.js +0 -1
  729. package/build/assets/conversation-websocket-context-DhJhqUna.js +0 -3
  730. package/build/assets/declaration-BNMqORFE.js +0 -1
  731. package/build/assets/dist-BxBP7tFD.js +0 -1
  732. package/build/assets/edit-automation-modal-BGzR3nfZ.js +0 -1
  733. package/build/assets/ellipsis-button-ZyLMPURn.js +0 -1
  734. package/build/assets/entry.client-1VMHpktY.js +0 -2
  735. package/build/assets/enum-filter-dropdown-CEgCdu4A.js +0 -1
  736. package/build/assets/extensions-hub-C651jsVh.js +0 -1
  737. package/build/assets/files-tab-R5z0lLdY.js +0 -1
  738. package/build/assets/files-tab-store-CDyVTXNT.js +0 -1
  739. package/build/assets/git-control-bar-branch-button-COdRAYHb.js +0 -27
  740. package/build/assets/git-provider-icon-BzLbc0yC.js +0 -1
  741. package/build/assets/home-e-egNUXZ.js +0 -1
  742. package/build/assets/install-server-modal-DHlbgqVH.js +0 -1
  743. package/build/assets/launch-CshDse3e.js +0 -1
  744. package/build/assets/link-external-D2POYx4c.js +0 -1
  745. package/build/assets/llm-settings-Bql-vydt.js +0 -1
  746. package/build/assets/llm-settings-C_tal6Ds.js +0 -1
  747. package/build/assets/manage-backends-modal-l7RkKfwX.js +0 -1
  748. package/build/assets/manage-workspaces-modal-DhKF_8z3.js +0 -1
  749. package/build/assets/manifest-3bf30d69.js +0 -1
  750. package/build/assets/mcp-ByeBfdfU.js +0 -9
  751. package/build/assets/messages-D0rWot7s.js +0 -36
  752. package/build/assets/proxy-CxydCnis.js +0 -1
  753. package/build/assets/root-DHeCXo9N.css +0 -1
  754. package/build/assets/root-layout-Czo9Ma6Q.js +0 -2
  755. package/build/assets/secrets-service-BsnKFc2x.js +0 -1
  756. package/build/assets/secrets-settings-Bz_UohPJ.js +0 -1
  757. package/build/assets/settings-client-C73C7IgV.js +0 -1
  758. package/build/assets/settings-index-Dz0BmdJD.js +0 -1
  759. package/build/assets/settings-list-classes-Bf80tWtc.js +0 -1
  760. package/build/assets/settings-modal-Brzgh5Yw.js +0 -1
  761. package/build/assets/settings-service.api-CZ3uWx4v.js +0 -1
  762. package/build/assets/sidebar-mobile-menu-toggle-Do_aA9Zm.js +0 -1
  763. package/build/assets/skills-settings-DlA5hlXw.js +0 -2
  764. package/build/assets/status-hp6M6E7E.js +0 -1
  765. package/build/assets/use-agent-settings-schema-33Un7UF2.js +0 -1
  766. package/build/assets/use-is-authed-BggE5wPj.js +0 -1
  767. package/build/assets/use-llm-profiles-DDOol3gK.js +0 -1
  768. package/build/assets/use-runtime-is-ready-B7EF4BKU.js +0 -1
  769. package/build/assets/use-settings-DQIZmIov.js +0 -1
  770. package/build/assets/use-user-conversation-C6hrMMtn.js +0 -1
  771. package/build/assets/utils-i18rdUj2.js +0 -1
  772. package/build/assets/vendor~conversation-panel~conversation-a9SyrrhV.js +0 -1
  773. package/build/assets/vendor~conversation-panel~conversation~index-C23ZXO4R.js +0 -1
  774. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-BebWhFNT.js +0 -1
  775. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DzIXV3Ui.js +0 -9
  776. /package/build/assets/{automation-IdgZq6ZK.js → automation-XDPAjiZi.js} +0 -0
  777. /package/build/assets/{color-themes-DSaoIL6A.js → color-themes-B9pm9c-R.js} +0 -0
  778. /package/build/assets/{common-DR1t-EeP.js → common-DqjLSBOt.js} +0 -0
  779. /package/build/assets/{conversation-local-storage-UYl-SX-r.js → conversation-local-storage-YmOVXxxW.js} +0 -0
  780. /package/build/assets/{dist-C6t0EXL7.js → dist-C3NfioQC.js} +0 -0
  781. /package/build/assets/{environment-switch-store-C4ulFJKp.js → environment-switch-store-CiurvTtK.js} +0 -0
  782. /package/build/assets/{health-store-BDC2rM-X.js → health-store-B5f0S2FY.js} +0 -0
  783. /package/build/assets/{map-provider-COBVzZYo.js → map-provider-BJ_8KZKU.js} +0 -0
  784. /package/build/assets/{middleware-BC9EwbB9.js → middleware-CfatjPYZ.js} +0 -0
  785. /package/build/assets/{objectWithoutPropertiesLoose-Du6eBn-V.js → objectWithoutPropertiesLoose-DSQKyRhw.js} +0 -0
  786. /package/build/assets/{react-Do0CT17Y.js → react-Dy05vyj5.js} +0 -0
  787. /package/build/assets/{sdk-settings-field-metadata-CBPmeqYa.js → sdk-settings-field-metadata-DQiaIBie.js} +0 -0
  788. /package/build/assets/{settings-D_H-qsRm.js → settings-DGY6n4J2.js} +0 -0
  789. /package/build/assets/{settings-like-page-layout-classes-I0BDBEoq.js → settings-like-page-layout-classes-D7YjdTd0.js} +0 -0
  790. /package/build/assets/{use-breakpoint-DbJ6FkQ-.js → use-breakpoint-DF_RiQ6s.js} +0 -0
  791. /package/build/assets/{use-click-outside-element-DffgWWoZ.js → use-click-outside-element-DhxCUyWl.js} +0 -0
  792. /package/build/assets/{v4-CNn21NXa.js → v4-khGvL7i2.js} +0 -0
  793. /package/build/assets/{vendor~browser-DDiZgqD3.js → vendor~browser-DisFGEp9.js} +0 -0
  794. /package/build/assets/{vendor~browser-tab-BgwV1mxF.js → vendor~browser-tab-BxhTtM9_.js} +0 -0
  795. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DbvX3OcM.js → vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js} +0 -0
  796. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js} +0 -0
  797. /package/build/assets/{vendor~files-tab-BGKayPiK.js → vendor~files-tab-BtkpAiMX.js} +0 -0
  798. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BW6261Sb.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CyZ-3lDQ.js} +0 -0
  799. /package/build/assets/{vendor~home~mcp~automations-list-DoPfwaXj.js → vendor~home~mcp~automations-list-BgV86Sti.js} +0 -0
  800. /package/build/assets/{vendor~launch-vdeRTWFu.js → vendor~launch-BXgl67Re.js} +0 -0
  801. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js} +0 -0
  802. /package/build/assets/{vendor~terminal-DUrOWGFE.js → vendor~terminal-DZaJIY8A.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"use-backends-health.cjs","names":[],"sources":["../../../src/hooks/query/use-backends-health.ts"],"sourcesContent":["import React from \"react\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { ServerClient } from \"@openhands/typescript-client/clients\";\nimport { getCurrentCloudApiKey } from \"#/api/cloud/organization-service.api\";\nimport type { Backend } from \"#/api/backend-registry/types\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport {\n getHealthSnapshot,\n recordBackendFailure,\n recordBackendSuccess,\n subscribeBackendHealth,\n} from \"#/api/backend-registry/health-store\";\nimport { MAX_CONSECUTIVE_FAILURES } from \"#/api/backend-registry/health-storage\";\n\nconst REFRESH_INTERVAL_MS = 10000;\nconst PROBE_TIMEOUT_MS = 4000;\n\n/**\n * Probe a single backend for connectivity. The probe path differs by\n * backend kind:\n *\n * - Local agent-server: GET `/server_info` via the typescript-client.\n * That's the same endpoint the root compatibility check uses, so a\n * healthy backend always answers it.\n * - Cloud: GET `/api/keys/current` via the bundled local\n * agent-server's `/api/cloud-proxy`. That endpoint is lightweight,\n * requires auth, and `getCurrentCloudApiKey` already absorbs the\n * legacy-key 400 fallback so we treat that as \"connected\" too.\n * Any other failure (network, 401, 5xx, …) means the backend is\n * not reachable / not usable from the GUI.\n *\n * Throws on failure so React Query marks the query as errored — the\n * dropdown reads `isSuccess` to flip the indicator green.\n */\nasync function probeBackend(backend: Backend): Promise<true> {\n if (backend.kind === \"cloud\") {\n await getCurrentCloudApiKey(backend);\n return true;\n }\n\n await new ServerClient(\n getAgentServerClientOptions({\n host: backend.host,\n sessionApiKey: backend.apiKey || null,\n timeout: PROBE_TIMEOUT_MS,\n }),\n ).getServerInfo();\n return true;\n}\n\nexport interface BackendHealth {\n /** `null` while the first probe is in flight; then `true` / `false`. */\n isConnected: boolean | null;\n /** Number of consecutive failed probes since the last success. */\n consecutiveFailures: number;\n /** Last error message captured from a failed probe, if any. */\n lastError: string | null;\n /**\n * `true` once `consecutiveFailures` reaches the cap. While disabled,\n * ordinary background polling stops and survives a page refresh in\n * that state.\n */\n disabled: boolean;\n}\n\nexport interface UseBackendsHealthOptions {\n /**\n * Re-probe disabled backends once when the hook mounts. Used by the\n * Manage Backends modal so a recovered backend can clear its stale\n * persisted error state without forcing the user to edit the config.\n */\n probeDisabledOnce?: boolean;\n}\n\n/**\n * Poll every backend in `backends` once every 10s and report a simple\n * connected / disconnected verdict per backend id.\n *\n * The query key includes `host` and `apiKey` so editing a backend's\n * connection details re-keys the query and triggers an immediate\n * refetch instead of waiting for the next tick.\n *\n * After `MAX_CONSECUTIVE_FAILURES` failures in a row, ordinary polling\n * stops for that backend until the user updates its host / apiKey.\n * Callers can still opt into a one-shot recheck for disabled backends\n * (for example when the user explicitly opens Manage Backends). The\n * failure count and last error live in localStorage so a page refresh\n * does not silently re-arm polling against a backend that's known to\n * be unreachable.\n */\nexport function useBackendsHealth(\n backends: Backend[],\n options: UseBackendsHealthOptions = {},\n): Record<string, BackendHealth> {\n const { probeDisabledOnce = false } = options;\n const healthMap = React.useSyncExternalStore(\n subscribeBackendHealth,\n getHealthSnapshot,\n getHealthSnapshot,\n );\n\n const results = useQueries({\n queries: backends.map((b) => {\n const isDisabled = healthMap[b.id]?.disabled === true;\n const shouldProbe = !isDisabled || probeDisabledOnce;\n return {\n queryKey: [\n \"backend-health\",\n b.id,\n b.kind,\n b.host,\n b.apiKey ?? \"\",\n ] as const,\n queryFn: async () => {\n try {\n const result = await probeBackend(b);\n recordBackendSuccess(b.id);\n return result;\n } catch (err) {\n recordBackendFailure(b.id, err);\n throw err;\n }\n },\n enabled: shouldProbe,\n refetchInterval: isDisabled ? (false as const) : REFRESH_INTERVAL_MS,\n refetchIntervalInBackground: false,\n refetchOnMount: isDisabled && probeDisabledOnce ? \"always\" : true,\n refetchOnReconnect: !isDisabled,\n refetchOnWindowFocus: !isDisabled,\n retry: false,\n // Keep the previous verdict visible while the next probe is in\n // flight so the indicator doesn't flicker on routine polling.\n staleTime: isDisabled ? 0 : REFRESH_INTERVAL_MS,\n meta: { disableToast: true },\n };\n }),\n });\n\n const out: Record<string, BackendHealth> = {};\n backends.forEach((b, i) => {\n const r = results[i];\n const entry = healthMap[b.id];\n const disabled = entry?.disabled === true;\n const consecutiveFailures = entry?.consecutiveFailures ?? 0;\n const lastError = entry?.lastError ?? null;\n\n let isConnected: boolean | null;\n if (disabled) {\n // Polling stopped after hitting the cap — treat as disconnected\n // so existing consumers (dot, badge) render red without needing\n // to know about the new fields.\n isConnected = false;\n } else if (r.isSuccess) isConnected = true;\n else if (r.isError) isConnected = false;\n else isConnected = null;\n\n out[b.id] = { isConnected, consecutiveFailures, lastError, disabled };\n });\n return out;\n}\n\nexport { MAX_CONSECUTIVE_FAILURES };\n"],"mappings":"ubAcA,IAAM,EAAsB,IACtB,EAAmB,IAmBzB,eAAe,EAAa,EAAiC,CAa3D,OAZI,EAAQ,OAAS,SACnB,MAAM,EAAA,sBAAsB,EAAQ,CAC7B,KAGT,MAAM,IAAI,EAAA,aACR,EAAA,4BAA4B,CAC1B,KAAM,EAAQ,KACd,cAAe,EAAQ,QAAU,KACjC,QAAS,EACV,CAAC,CACH,CAAC,eAAe,CACV,IA2CT,SAAgB,EACd,EACA,EAAoC,EAAE,CACP,CAC/B,GAAM,CAAE,oBAAoB,IAAU,EAChC,EAAY,EAAA,QAAM,qBACtB,EAAA,uBACA,EAAA,kBACA,EAAA,kBACD,CAEK,EAAU,EAAA,WAAW,CACzB,QAAS,EAAS,IAAK,GAAM,CAC3B,IAAM,EAAa,EAAU,EAAE,KAAK,WAAa,GAC3C,EAAc,CAAC,GAAc,EACnC,MAAO,CACL,SAAU,CACR,iBACA,EAAE,GACF,EAAE,KACF,EAAE,KACF,EAAE,QAAU,GACb,CACD,QAAS,SAAY,CACnB,GAAI,CACF,IAAM,EAAS,MAAM,EAAa,EAAE,CAEpC,OADA,EAAA,qBAAqB,EAAE,GAAG,CACnB,QACA,EAAK,CAEZ,MADA,EAAA,qBAAqB,EAAE,GAAI,EAAI,CACzB,IAGV,QAAS,EACT,gBAAiB,EAAc,GAAkB,EACjD,4BAA6B,GAC7B,eAAgB,GAAc,EAAoB,SAAW,GAC7D,mBAAoB,CAAC,EACrB,qBAAsB,CAAC,EACvB,MAAO,GAGP,UAAW,EAAa,EAAI,EAC5B,KAAM,CAAE,aAAc,GAAM,CAC7B,EACD,CACH,CAAC,CAEI,EAAqC,EAAE,CAoB7C,OAnBA,EAAS,SAAS,EAAG,IAAM,CACzB,IAAM,EAAI,EAAQ,GACZ,EAAQ,EAAU,EAAE,IACpB,EAAW,GAAO,WAAa,GAC/B,EAAsB,GAAO,qBAAuB,EACpD,EAAY,GAAO,WAAa,KAElC,EACJ,AAOK,EAPD,EAIY,GACL,EAAE,UAAyB,GAC7B,EAAE,QAAuB,GACf,KAEnB,EAAI,EAAE,IAAM,CAAE,cAAa,sBAAqB,YAAW,WAAU,EACrE,CACK"}
1
+ {"version":3,"file":"use-backends-health.cjs","names":[],"sources":["../../../src/hooks/query/use-backends-health.ts"],"sourcesContent":["import React from \"react\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { SettingsClient } from \"@openhands/typescript-client/clients\";\nimport { getCurrentCloudApiKey } from \"#/api/cloud/organization-service.api\";\nimport { isSdkHttpStatusError } from \"#/api/agent-server-compatibility\";\nimport type { Backend } from \"#/api/backend-registry/types\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport {\n getHealthSnapshot,\n recordBackendFailure,\n recordBackendSuccess,\n subscribeBackendHealth,\n} from \"#/api/backend-registry/health-store\";\nimport { MAX_CONSECUTIVE_FAILURES } from \"#/api/backend-registry/health-storage\";\n\nconst REFRESH_INTERVAL_MS = 10000;\nconst PROBE_TIMEOUT_MS = 4000;\nexport const INVALID_BACKEND_API_KEY_ERROR = \"Invalid API key\";\n\nexport function isInvalidBackendApiKeyHealthError(\n error: string | null | undefined,\n): boolean {\n return error === INVALID_BACKEND_API_KEY_ERROR;\n}\n\n/**\n * Probe a single backend for connectivity. The probe path differs by\n * backend kind:\n *\n * - Local agent-server: GET `/api/settings` via the typescript-client.\n * Unlike `/server_info`, this validates the configured session API key.\n * - Cloud: GET `/api/keys/current` via the bundled local\n * agent-server's `/api/cloud-proxy`. That endpoint is lightweight,\n * requires auth, and `getCurrentCloudApiKey` already absorbs the\n * legacy-key 400 fallback so we treat that as \"connected\" too.\n * Any other failure (network, 401, 5xx, …) means the backend is\n * not reachable / not usable from the GUI.\n *\n * Throws on failure so React Query marks the query as errored — the\n * dropdown reads `isSuccess` to flip the indicator green.\n */\nasync function probeBackend(backend: Backend): Promise<true> {\n if (backend.kind === \"cloud\") {\n await getCurrentCloudApiKey(backend);\n return true;\n }\n\n try {\n await new SettingsClient(\n getAgentServerClientOptions({\n host: backend.host,\n sessionApiKey: backend.apiKey || null,\n timeout: PROBE_TIMEOUT_MS,\n }),\n ).getSettings();\n } catch (error) {\n if (isSdkHttpStatusError(error, 401)) {\n throw new Error(INVALID_BACKEND_API_KEY_ERROR);\n }\n throw error;\n }\n return true;\n}\n\nexport interface BackendHealth {\n /** `null` while the first probe is in flight; then `true` / `false`. */\n isConnected: boolean | null;\n /** Number of consecutive failed probes since the last success. */\n consecutiveFailures: number;\n /** Last error message captured from a failed probe, if any. */\n lastError: string | null;\n /**\n * `true` once `consecutiveFailures` reaches the cap. While disabled,\n * ordinary background polling stops and survives a page refresh in\n * that state.\n */\n disabled: boolean;\n}\n\nexport interface UseBackendsHealthOptions {\n /**\n * Re-probe disabled backends once when the hook mounts. Used by the\n * Manage Backends modal so a recovered backend can clear its stale\n * persisted error state without forcing the user to edit the config.\n */\n probeDisabledOnce?: boolean;\n}\n\n/**\n * Poll every backend in `backends` once every 10s and report a simple\n * connected / disconnected verdict per backend id.\n *\n * The query key includes `host` and `apiKey` so editing a backend's\n * connection details re-keys the query and triggers an immediate\n * refetch instead of waiting for the next tick.\n *\n * After `MAX_CONSECUTIVE_FAILURES` failures in a row, ordinary polling\n * stops for that backend until the user updates its host / apiKey.\n * Callers can still opt into a one-shot recheck for disabled backends\n * (for example when the user explicitly opens Manage Backends). The\n * failure count and last error live in localStorage so a page refresh\n * does not silently re-arm polling against a backend that's known to\n * be unreachable.\n */\nexport function useBackendsHealth(\n backends: Backend[],\n options: UseBackendsHealthOptions = {},\n): Record<string, BackendHealth> {\n const { probeDisabledOnce = false } = options;\n const healthMap = React.useSyncExternalStore(\n subscribeBackendHealth,\n getHealthSnapshot,\n getHealthSnapshot,\n );\n\n const results = useQueries({\n queries: backends.map((b) => {\n const isDisabled = healthMap[b.id]?.disabled === true;\n const shouldProbe = !isDisabled || probeDisabledOnce;\n return {\n queryKey: [\n \"backend-health\",\n b.id,\n b.kind,\n b.host,\n b.apiKey ?? \"\",\n ] as const,\n queryFn: async () => {\n try {\n const result = await probeBackend(b);\n recordBackendSuccess(b.id);\n return result;\n } catch (err) {\n recordBackendFailure(b.id, err);\n throw err;\n }\n },\n enabled: shouldProbe,\n refetchInterval: isDisabled ? (false as const) : REFRESH_INTERVAL_MS,\n refetchIntervalInBackground: false,\n refetchOnMount: isDisabled && probeDisabledOnce ? \"always\" : true,\n refetchOnReconnect: !isDisabled,\n refetchOnWindowFocus: !isDisabled,\n retry: false,\n // Keep the previous verdict visible while the next probe is in\n // flight so the indicator doesn't flicker on routine polling.\n staleTime: isDisabled ? 0 : REFRESH_INTERVAL_MS,\n meta: { disableToast: true },\n };\n }),\n });\n\n const out: Record<string, BackendHealth> = {};\n backends.forEach((b, i) => {\n const r = results[i];\n const entry = healthMap[b.id];\n const disabled = entry?.disabled === true;\n const consecutiveFailures = entry?.consecutiveFailures ?? 0;\n const lastError = entry?.lastError ?? null;\n\n let isConnected: boolean | null;\n if (disabled) {\n // Polling stopped after hitting the cap — treat as disconnected\n // so existing consumers (dot, badge) render red without needing\n // to know about the new fields.\n isConnected = false;\n } else if (r.isSuccess) isConnected = true;\n else if (r.isError) isConnected = false;\n else isConnected = null;\n\n out[b.id] = { isConnected, consecutiveFailures, lastError, disabled };\n });\n return out;\n}\n\nexport { MAX_CONSECUTIVE_FAILURES };\n"],"mappings":"+eAeA,IAAM,EAAsB,IACtB,EAAmB,IACZ,EAAgC,kBAE7C,SAAgB,EACd,EACS,CACT,OAAO,IAAU,EAmBnB,eAAe,EAAa,EAAiC,CAC3D,GAAI,EAAQ,OAAS,QAEnB,OADA,MAAM,EAAA,sBAAsB,EAAQ,CAC7B,GAGT,GAAI,CACF,MAAM,IAAI,EAAA,eACR,EAAA,4BAA4B,CAC1B,KAAM,EAAQ,KACd,cAAe,EAAQ,QAAU,KACjC,QAAS,EACV,CAAC,CACH,CAAC,aAAa,OACR,EAAO,CAId,MAHI,EAAA,qBAAqB,EAAO,IAAI,CACxB,MAAM,EAA8B,CAE1C,EAER,MAAO,GA2CT,SAAgB,EACd,EACA,EAAoC,EAAE,CACP,CAC/B,GAAM,CAAE,oBAAoB,IAAU,EAChC,EAAY,EAAA,QAAM,qBACtB,EAAA,uBACA,EAAA,kBACA,EAAA,kBACD,CAEK,EAAU,EAAA,WAAW,CACzB,QAAS,EAAS,IAAK,GAAM,CAC3B,IAAM,EAAa,EAAU,EAAE,KAAK,WAAa,GAC3C,EAAc,CAAC,GAAc,EACnC,MAAO,CACL,SAAU,CACR,iBACA,EAAE,GACF,EAAE,KACF,EAAE,KACF,EAAE,QAAU,GACb,CACD,QAAS,SAAY,CACnB,GAAI,CACF,IAAM,EAAS,MAAM,EAAa,EAAE,CAEpC,OADA,EAAA,qBAAqB,EAAE,GAAG,CACnB,QACA,EAAK,CAEZ,MADA,EAAA,qBAAqB,EAAE,GAAI,EAAI,CACzB,IAGV,QAAS,EACT,gBAAiB,EAAc,GAAkB,EACjD,4BAA6B,GAC7B,eAAgB,GAAc,EAAoB,SAAW,GAC7D,mBAAoB,CAAC,EACrB,qBAAsB,CAAC,EACvB,MAAO,GAGP,UAAW,EAAa,EAAI,EAC5B,KAAM,CAAE,aAAc,GAAM,CAC7B,EACD,CACH,CAAC,CAEI,EAAqC,EAAE,CAoB7C,OAnBA,EAAS,SAAS,EAAG,IAAM,CACzB,IAAM,EAAI,EAAQ,GACZ,EAAQ,EAAU,EAAE,IACpB,EAAW,GAAO,WAAa,GAC/B,EAAsB,GAAO,qBAAuB,EACpD,EAAY,GAAO,WAAa,KAElC,EACJ,AAOK,EAPD,EAIY,GACL,EAAE,UAAyB,GAC7B,EAAE,QAAuB,GACf,KAEnB,EAAI,EAAE,IAAM,CAAE,cAAa,sBAAqB,YAAW,WAAU,EACrE,CACK"}
@@ -1,5 +1,7 @@
1
1
  import type { Backend } from "#/api/backend-registry/types";
2
2
  import { MAX_CONSECUTIVE_FAILURES } from "#/api/backend-registry/health-storage";
3
+ export declare const INVALID_BACKEND_API_KEY_ERROR = "Invalid API key";
4
+ export declare function isInvalidBackendApiKeyHealthError(error: string | null | undefined): boolean;
3
5
  export interface BackendHealth {
4
6
  /** `null` while the first probe is in flight; then `true` / `false`. */
5
7
  isConnected: boolean | null;
@@ -1,21 +1,31 @@
1
1
  import { getHealthSnapshot as e, recordBackendFailure as t, recordBackendSuccess as n, subscribeBackendHealth as r } from "../../api/backend-registry/health-store.js";
2
- import { ServerClient as i } from "../../node_modules/@openhands/typescript-client/dist/client/server-client.js";
2
+ import { SettingsClient as i } from "../../node_modules/@openhands/typescript-client/dist/client/settings-client.js";
3
3
  import { useQueries as a } from "../../node_modules/@tanstack/react-query/build/modern/useQueries.js";
4
4
  import { getAgentServerClientOptions as o } from "../../api/agent-server-client-options.js";
5
- import { getCurrentCloudApiKey as s } from "../../api/cloud/organization-service.api.js";
6
- import c from "react";
5
+ import { isSdkHttpStatusError as s } from "../../api/agent-server-compatibility.js";
6
+ import { getCurrentCloudApiKey as c } from "../../api/cloud/organization-service.api.js";
7
+ import l from "react";
7
8
  //#region src/hooks/query/use-backends-health.ts
8
- var l = 1e4, u = 4e3;
9
- async function d(e) {
10
- return e.kind === "cloud" ? (await s(e), !0) : (await new i(o({
11
- host: e.host,
12
- sessionApiKey: e.apiKey || null,
13
- timeout: u
14
- })).getServerInfo(), !0);
9
+ var u = 1e4, d = 4e3, f = "Invalid API key";
10
+ function p(e) {
11
+ return e === f;
15
12
  }
16
- function f(i, o = {}) {
17
- let { probeDisabledOnce: s = !1 } = o, u = c.useSyncExternalStore(r, e, e), f = a({ queries: i.map((e) => {
18
- let r = u[e.id]?.disabled === !0, i = !r || s;
13
+ async function m(e) {
14
+ if (e.kind === "cloud") return await c(e), !0;
15
+ try {
16
+ await new i(o({
17
+ host: e.host,
18
+ sessionApiKey: e.apiKey || null,
19
+ timeout: d
20
+ })).getSettings();
21
+ } catch (e) {
22
+ throw s(e, 401) ? Error(f) : e;
23
+ }
24
+ return !0;
25
+ }
26
+ function h(i, o = {}) {
27
+ let { probeDisabledOnce: s = !1 } = o, c = l.useSyncExternalStore(r, e, e), d = a({ queries: i.map((e) => {
28
+ let r = c[e.id]?.disabled === !0, i = !r || s;
19
29
  return {
20
30
  queryKey: [
21
31
  "backend-health",
@@ -26,34 +36,34 @@ function f(i, o = {}) {
26
36
  ],
27
37
  queryFn: async () => {
28
38
  try {
29
- let t = await d(e);
39
+ let t = await m(e);
30
40
  return n(e.id), t;
31
41
  } catch (n) {
32
42
  throw t(e.id, n), n;
33
43
  }
34
44
  },
35
45
  enabled: i,
36
- refetchInterval: r ? !1 : l,
46
+ refetchInterval: r ? !1 : u,
37
47
  refetchIntervalInBackground: !1,
38
48
  refetchOnMount: r && s ? "always" : !0,
39
49
  refetchOnReconnect: !r,
40
50
  refetchOnWindowFocus: !r,
41
51
  retry: !1,
42
- staleTime: r ? 0 : l,
52
+ staleTime: r ? 0 : u,
43
53
  meta: { disableToast: !0 }
44
54
  };
45
- }) }), p = {};
55
+ }) }), f = {};
46
56
  return i.forEach((e, t) => {
47
- let n = f[t], r = u[e.id], i = r?.disabled === !0, a = r?.consecutiveFailures ?? 0, o = r?.lastError ?? null, s;
48
- s = i ? !1 : n.isSuccess ? !0 : n.isError ? !1 : null, p[e.id] = {
57
+ let n = d[t], r = c[e.id], i = r?.disabled === !0, a = r?.consecutiveFailures ?? 0, o = r?.lastError ?? null, s;
58
+ s = i ? !1 : n.isSuccess ? !0 : n.isError ? !1 : null, f[e.id] = {
49
59
  isConnected: s,
50
60
  consecutiveFailures: a,
51
61
  lastError: o,
52
62
  disabled: i
53
63
  };
54
- }), p;
64
+ }), f;
55
65
  }
56
66
  //#endregion
57
- export { f as useBackendsHealth };
67
+ export { p as isInvalidBackendApiKeyHealthError, h as useBackendsHealth };
58
68
 
59
69
  //# sourceMappingURL=use-backends-health.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-backends-health.js","names":[],"sources":["../../../src/hooks/query/use-backends-health.ts"],"sourcesContent":["import React from \"react\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { ServerClient } from \"@openhands/typescript-client/clients\";\nimport { getCurrentCloudApiKey } from \"#/api/cloud/organization-service.api\";\nimport type { Backend } from \"#/api/backend-registry/types\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport {\n getHealthSnapshot,\n recordBackendFailure,\n recordBackendSuccess,\n subscribeBackendHealth,\n} from \"#/api/backend-registry/health-store\";\nimport { MAX_CONSECUTIVE_FAILURES } from \"#/api/backend-registry/health-storage\";\n\nconst REFRESH_INTERVAL_MS = 10000;\nconst PROBE_TIMEOUT_MS = 4000;\n\n/**\n * Probe a single backend for connectivity. The probe path differs by\n * backend kind:\n *\n * - Local agent-server: GET `/server_info` via the typescript-client.\n * That's the same endpoint the root compatibility check uses, so a\n * healthy backend always answers it.\n * - Cloud: GET `/api/keys/current` via the bundled local\n * agent-server's `/api/cloud-proxy`. That endpoint is lightweight,\n * requires auth, and `getCurrentCloudApiKey` already absorbs the\n * legacy-key 400 fallback so we treat that as \"connected\" too.\n * Any other failure (network, 401, 5xx, …) means the backend is\n * not reachable / not usable from the GUI.\n *\n * Throws on failure so React Query marks the query as errored — the\n * dropdown reads `isSuccess` to flip the indicator green.\n */\nasync function probeBackend(backend: Backend): Promise<true> {\n if (backend.kind === \"cloud\") {\n await getCurrentCloudApiKey(backend);\n return true;\n }\n\n await new ServerClient(\n getAgentServerClientOptions({\n host: backend.host,\n sessionApiKey: backend.apiKey || null,\n timeout: PROBE_TIMEOUT_MS,\n }),\n ).getServerInfo();\n return true;\n}\n\nexport interface BackendHealth {\n /** `null` while the first probe is in flight; then `true` / `false`. */\n isConnected: boolean | null;\n /** Number of consecutive failed probes since the last success. */\n consecutiveFailures: number;\n /** Last error message captured from a failed probe, if any. */\n lastError: string | null;\n /**\n * `true` once `consecutiveFailures` reaches the cap. While disabled,\n * ordinary background polling stops and survives a page refresh in\n * that state.\n */\n disabled: boolean;\n}\n\nexport interface UseBackendsHealthOptions {\n /**\n * Re-probe disabled backends once when the hook mounts. Used by the\n * Manage Backends modal so a recovered backend can clear its stale\n * persisted error state without forcing the user to edit the config.\n */\n probeDisabledOnce?: boolean;\n}\n\n/**\n * Poll every backend in `backends` once every 10s and report a simple\n * connected / disconnected verdict per backend id.\n *\n * The query key includes `host` and `apiKey` so editing a backend's\n * connection details re-keys the query and triggers an immediate\n * refetch instead of waiting for the next tick.\n *\n * After `MAX_CONSECUTIVE_FAILURES` failures in a row, ordinary polling\n * stops for that backend until the user updates its host / apiKey.\n * Callers can still opt into a one-shot recheck for disabled backends\n * (for example when the user explicitly opens Manage Backends). The\n * failure count and last error live in localStorage so a page refresh\n * does not silently re-arm polling against a backend that's known to\n * be unreachable.\n */\nexport function useBackendsHealth(\n backends: Backend[],\n options: UseBackendsHealthOptions = {},\n): Record<string, BackendHealth> {\n const { probeDisabledOnce = false } = options;\n const healthMap = React.useSyncExternalStore(\n subscribeBackendHealth,\n getHealthSnapshot,\n getHealthSnapshot,\n );\n\n const results = useQueries({\n queries: backends.map((b) => {\n const isDisabled = healthMap[b.id]?.disabled === true;\n const shouldProbe = !isDisabled || probeDisabledOnce;\n return {\n queryKey: [\n \"backend-health\",\n b.id,\n b.kind,\n b.host,\n b.apiKey ?? \"\",\n ] as const,\n queryFn: async () => {\n try {\n const result = await probeBackend(b);\n recordBackendSuccess(b.id);\n return result;\n } catch (err) {\n recordBackendFailure(b.id, err);\n throw err;\n }\n },\n enabled: shouldProbe,\n refetchInterval: isDisabled ? (false as const) : REFRESH_INTERVAL_MS,\n refetchIntervalInBackground: false,\n refetchOnMount: isDisabled && probeDisabledOnce ? \"always\" : true,\n refetchOnReconnect: !isDisabled,\n refetchOnWindowFocus: !isDisabled,\n retry: false,\n // Keep the previous verdict visible while the next probe is in\n // flight so the indicator doesn't flicker on routine polling.\n staleTime: isDisabled ? 0 : REFRESH_INTERVAL_MS,\n meta: { disableToast: true },\n };\n }),\n });\n\n const out: Record<string, BackendHealth> = {};\n backends.forEach((b, i) => {\n const r = results[i];\n const entry = healthMap[b.id];\n const disabled = entry?.disabled === true;\n const consecutiveFailures = entry?.consecutiveFailures ?? 0;\n const lastError = entry?.lastError ?? null;\n\n let isConnected: boolean | null;\n if (disabled) {\n // Polling stopped after hitting the cap — treat as disconnected\n // so existing consumers (dot, badge) render red without needing\n // to know about the new fields.\n isConnected = false;\n } else if (r.isSuccess) isConnected = true;\n else if (r.isError) isConnected = false;\n else isConnected = null;\n\n out[b.id] = { isConnected, consecutiveFailures, lastError, disabled };\n });\n return out;\n}\n\nexport { MAX_CONSECUTIVE_FAILURES };\n"],"mappings":";;;;;;;AAcA,IAAM,IAAsB,KACtB,IAAmB;AAmBzB,eAAe,EAAa,GAAiC;AAa3D,QAZI,EAAQ,SAAS,WACnB,MAAM,EAAsB,EAAQ,EAC7B,OAGT,MAAM,IAAI,EACR,EAA4B;EAC1B,MAAM,EAAQ;EACd,eAAe,EAAQ,UAAU;EACjC,SAAS;EACV,CAAC,CACH,CAAC,eAAe,EACV;;AA2CT,SAAgB,EACd,GACA,IAAoC,EAAE,EACP;CAC/B,IAAM,EAAE,uBAAoB,OAAU,GAChC,IAAY,EAAM,qBACtB,GACA,GACA,EACD,EAEK,IAAU,EAAW,EACzB,SAAS,EAAS,KAAK,MAAM;EAC3B,IAAM,IAAa,EAAU,EAAE,KAAK,aAAa,IAC3C,IAAc,CAAC,KAAc;AACnC,SAAO;GACL,UAAU;IACR;IACA,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE,UAAU;IACb;GACD,SAAS,YAAY;AACnB,QAAI;KACF,IAAM,IAAS,MAAM,EAAa,EAAE;AAEpC,YADA,EAAqB,EAAE,GAAG,EACnB;aACA,GAAK;AAEZ,WADA,EAAqB,EAAE,IAAI,EAAI,EACzB;;;GAGV,SAAS;GACT,iBAAiB,IAAc,KAAkB;GACjD,6BAA6B;GAC7B,gBAAgB,KAAc,IAAoB,WAAW;GAC7D,oBAAoB,CAAC;GACrB,sBAAsB,CAAC;GACvB,OAAO;GAGP,WAAW,IAAa,IAAI;GAC5B,MAAM,EAAE,cAAc,IAAM;GAC7B;GACD,EACH,CAAC,EAEI,IAAqC,EAAE;AAoB7C,QAnBA,EAAS,SAAS,GAAG,MAAM;EACzB,IAAM,IAAI,EAAQ,IACZ,IAAQ,EAAU,EAAE,KACpB,IAAW,GAAO,aAAa,IAC/B,IAAsB,GAAO,uBAAuB,GACpD,IAAY,GAAO,aAAa,MAElC;AAUJ,EATA,AAOK,IAPD,IAIY,KACL,EAAE,YAAyB,KAC7B,EAAE,UAAuB,KACf,MAEnB,EAAI,EAAE,MAAM;GAAE;GAAa;GAAqB;GAAW;GAAU;GACrE,EACK"}
1
+ {"version":3,"file":"use-backends-health.js","names":[],"sources":["../../../src/hooks/query/use-backends-health.ts"],"sourcesContent":["import React from \"react\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport { SettingsClient } from \"@openhands/typescript-client/clients\";\nimport { getCurrentCloudApiKey } from \"#/api/cloud/organization-service.api\";\nimport { isSdkHttpStatusError } from \"#/api/agent-server-compatibility\";\nimport type { Backend } from \"#/api/backend-registry/types\";\nimport { getAgentServerClientOptions } from \"#/api/agent-server-client-options\";\nimport {\n getHealthSnapshot,\n recordBackendFailure,\n recordBackendSuccess,\n subscribeBackendHealth,\n} from \"#/api/backend-registry/health-store\";\nimport { MAX_CONSECUTIVE_FAILURES } from \"#/api/backend-registry/health-storage\";\n\nconst REFRESH_INTERVAL_MS = 10000;\nconst PROBE_TIMEOUT_MS = 4000;\nexport const INVALID_BACKEND_API_KEY_ERROR = \"Invalid API key\";\n\nexport function isInvalidBackendApiKeyHealthError(\n error: string | null | undefined,\n): boolean {\n return error === INVALID_BACKEND_API_KEY_ERROR;\n}\n\n/**\n * Probe a single backend for connectivity. The probe path differs by\n * backend kind:\n *\n * - Local agent-server: GET `/api/settings` via the typescript-client.\n * Unlike `/server_info`, this validates the configured session API key.\n * - Cloud: GET `/api/keys/current` via the bundled local\n * agent-server's `/api/cloud-proxy`. That endpoint is lightweight,\n * requires auth, and `getCurrentCloudApiKey` already absorbs the\n * legacy-key 400 fallback so we treat that as \"connected\" too.\n * Any other failure (network, 401, 5xx, …) means the backend is\n * not reachable / not usable from the GUI.\n *\n * Throws on failure so React Query marks the query as errored — the\n * dropdown reads `isSuccess` to flip the indicator green.\n */\nasync function probeBackend(backend: Backend): Promise<true> {\n if (backend.kind === \"cloud\") {\n await getCurrentCloudApiKey(backend);\n return true;\n }\n\n try {\n await new SettingsClient(\n getAgentServerClientOptions({\n host: backend.host,\n sessionApiKey: backend.apiKey || null,\n timeout: PROBE_TIMEOUT_MS,\n }),\n ).getSettings();\n } catch (error) {\n if (isSdkHttpStatusError(error, 401)) {\n throw new Error(INVALID_BACKEND_API_KEY_ERROR);\n }\n throw error;\n }\n return true;\n}\n\nexport interface BackendHealth {\n /** `null` while the first probe is in flight; then `true` / `false`. */\n isConnected: boolean | null;\n /** Number of consecutive failed probes since the last success. */\n consecutiveFailures: number;\n /** Last error message captured from a failed probe, if any. */\n lastError: string | null;\n /**\n * `true` once `consecutiveFailures` reaches the cap. While disabled,\n * ordinary background polling stops and survives a page refresh in\n * that state.\n */\n disabled: boolean;\n}\n\nexport interface UseBackendsHealthOptions {\n /**\n * Re-probe disabled backends once when the hook mounts. Used by the\n * Manage Backends modal so a recovered backend can clear its stale\n * persisted error state without forcing the user to edit the config.\n */\n probeDisabledOnce?: boolean;\n}\n\n/**\n * Poll every backend in `backends` once every 10s and report a simple\n * connected / disconnected verdict per backend id.\n *\n * The query key includes `host` and `apiKey` so editing a backend's\n * connection details re-keys the query and triggers an immediate\n * refetch instead of waiting for the next tick.\n *\n * After `MAX_CONSECUTIVE_FAILURES` failures in a row, ordinary polling\n * stops for that backend until the user updates its host / apiKey.\n * Callers can still opt into a one-shot recheck for disabled backends\n * (for example when the user explicitly opens Manage Backends). The\n * failure count and last error live in localStorage so a page refresh\n * does not silently re-arm polling against a backend that's known to\n * be unreachable.\n */\nexport function useBackendsHealth(\n backends: Backend[],\n options: UseBackendsHealthOptions = {},\n): Record<string, BackendHealth> {\n const { probeDisabledOnce = false } = options;\n const healthMap = React.useSyncExternalStore(\n subscribeBackendHealth,\n getHealthSnapshot,\n getHealthSnapshot,\n );\n\n const results = useQueries({\n queries: backends.map((b) => {\n const isDisabled = healthMap[b.id]?.disabled === true;\n const shouldProbe = !isDisabled || probeDisabledOnce;\n return {\n queryKey: [\n \"backend-health\",\n b.id,\n b.kind,\n b.host,\n b.apiKey ?? \"\",\n ] as const,\n queryFn: async () => {\n try {\n const result = await probeBackend(b);\n recordBackendSuccess(b.id);\n return result;\n } catch (err) {\n recordBackendFailure(b.id, err);\n throw err;\n }\n },\n enabled: shouldProbe,\n refetchInterval: isDisabled ? (false as const) : REFRESH_INTERVAL_MS,\n refetchIntervalInBackground: false,\n refetchOnMount: isDisabled && probeDisabledOnce ? \"always\" : true,\n refetchOnReconnect: !isDisabled,\n refetchOnWindowFocus: !isDisabled,\n retry: false,\n // Keep the previous verdict visible while the next probe is in\n // flight so the indicator doesn't flicker on routine polling.\n staleTime: isDisabled ? 0 : REFRESH_INTERVAL_MS,\n meta: { disableToast: true },\n };\n }),\n });\n\n const out: Record<string, BackendHealth> = {};\n backends.forEach((b, i) => {\n const r = results[i];\n const entry = healthMap[b.id];\n const disabled = entry?.disabled === true;\n const consecutiveFailures = entry?.consecutiveFailures ?? 0;\n const lastError = entry?.lastError ?? null;\n\n let isConnected: boolean | null;\n if (disabled) {\n // Polling stopped after hitting the cap — treat as disconnected\n // so existing consumers (dot, badge) render red without needing\n // to know about the new fields.\n isConnected = false;\n } else if (r.isSuccess) isConnected = true;\n else if (r.isError) isConnected = false;\n else isConnected = null;\n\n out[b.id] = { isConnected, consecutiveFailures, lastError, disabled };\n });\n return out;\n}\n\nexport { MAX_CONSECUTIVE_FAILURES };\n"],"mappings":";;;;;;;;AAeA,IAAM,IAAsB,KACtB,IAAmB,KACZ,IAAgC;AAE7C,SAAgB,EACd,GACS;AACT,QAAO,MAAU;;AAmBnB,eAAe,EAAa,GAAiC;AAC3D,KAAI,EAAQ,SAAS,QAEnB,QADA,MAAM,EAAsB,EAAQ,EAC7B;AAGT,KAAI;AACF,QAAM,IAAI,EACR,EAA4B;GAC1B,MAAM,EAAQ;GACd,eAAe,EAAQ,UAAU;GACjC,SAAS;GACV,CAAC,CACH,CAAC,aAAa;UACR,GAAO;AAId,QAHI,EAAqB,GAAO,IAAI,GACxB,MAAM,EAA8B,GAE1C;;AAER,QAAO;;AA2CT,SAAgB,EACd,GACA,IAAoC,EAAE,EACP;CAC/B,IAAM,EAAE,uBAAoB,OAAU,GAChC,IAAY,EAAM,qBACtB,GACA,GACA,EACD,EAEK,IAAU,EAAW,EACzB,SAAS,EAAS,KAAK,MAAM;EAC3B,IAAM,IAAa,EAAU,EAAE,KAAK,aAAa,IAC3C,IAAc,CAAC,KAAc;AACnC,SAAO;GACL,UAAU;IACR;IACA,EAAE;IACF,EAAE;IACF,EAAE;IACF,EAAE,UAAU;IACb;GACD,SAAS,YAAY;AACnB,QAAI;KACF,IAAM,IAAS,MAAM,EAAa,EAAE;AAEpC,YADA,EAAqB,EAAE,GAAG,EACnB;aACA,GAAK;AAEZ,WADA,EAAqB,EAAE,IAAI,EAAI,EACzB;;;GAGV,SAAS;GACT,iBAAiB,IAAc,KAAkB;GACjD,6BAA6B;GAC7B,gBAAgB,KAAc,IAAoB,WAAW;GAC7D,oBAAoB,CAAC;GACrB,sBAAsB,CAAC;GACvB,OAAO;GAGP,WAAW,IAAa,IAAI;GAC5B,MAAM,EAAE,cAAc,IAAM;GAC7B;GACD,EACH,CAAC,EAEI,IAAqC,EAAE;AAoB7C,QAnBA,EAAS,SAAS,GAAG,MAAM;EACzB,IAAM,IAAI,EAAQ,IACZ,IAAQ,EAAU,EAAE,KACpB,IAAW,GAAO,aAAa,IAC/B,IAAsB,GAAO,uBAAuB,GACpD,IAAY,GAAO,aAAa,MAElC;AAUJ,EATA,AAOK,IAPD,IAIY,KACL,EAAE,YAAyB,KAC7B,EAAE,UAAuB,KACf,MAEnB,EAAI,EAAE,MAAM;GAAE;GAAa;GAAqB;GAAW;GAAU;GACrE,EACK"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../contexts/active-backend-context.cjs`),t=require(`../../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs`),n=require(`../../api/conversation-service/agent-server-conversation-service.api.cjs`),r=require(`./use-is-authed.cjs`);var i=(i=20)=>{let{data:a}=r.useIsAuthed(),o=e.useActiveBackend();return t.useInfiniteQuery({queryKey:[`user`,`conversations`,`paginated`,i,o.backend.id,o.orgId],queryFn:async({pageParam:e})=>await n.default.searchConversations(i,e),enabled:!!a,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:o.backend.id}})};exports.usePaginatedConversations=i;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../api/backend-registry/active-store.cjs`),t=require(`../../contexts/active-backend-context.cjs`),n=require(`../../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.cjs`),r=require(`../../api/conversation-service/agent-server-conversation-service.api.cjs`),i=require(`./use-is-authed.cjs`);var a=(a=20)=>{let{data:o}=i.useIsAuthed(),s=t.useActiveBackend(),c=!e.isNoBackend(s.backend);return n.useInfiniteQuery({queryKey:[`user`,`conversations`,`paginated`,a,s.backend.id,s.orgId],queryFn:async({pageParam:e})=>await r.default.searchConversations(a,e),enabled:!!o&&c,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:s.backend.id}})};exports.usePaginatedConversations=a;
2
2
  //# sourceMappingURL=use-paginated-conversations.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-paginated-conversations.cjs","names":[],"sources":["../../../src/hooks/query/use-paginated-conversations.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { useIsAuthed } from \"./use-is-authed\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { AppConversationPage } from \"#/api/conversation-service/agent-server-conversation-service.types\";\n\nexport const usePaginatedConversations = (limit: number = 20) => {\n const { data: userIsAuthenticated } = useIsAuthed();\n const active = useActiveBackend();\n\n return useInfiniteQuery({\n // Include the active backend identity so each (backend, org) pair\n // maintains its own paginated cache. Switching backends naturally\n // produces a new query and a fresh fetch — without it the previous\n // backend's conversations stay visible for staleTime.\n queryKey: [\n \"user\",\n \"conversations\",\n \"paginated\",\n limit,\n active.backend.id,\n active.orgId,\n ],\n queryFn: async ({ pageParam }) => {\n const result = await AgentServerConversationService.searchConversations(\n limit,\n pageParam,\n );\n\n return result;\n },\n enabled: !!userIsAuthenticated,\n getNextPageParam: (lastPage: AppConversationPage) => lastPage.next_page_id,\n initialPageParam: undefined as string | undefined,\n // Poll every 10s so titles, execution status, and timestamps stay fresh\n // without requiring the user to refresh. Consumers must gate initial-load\n // UI (e.g. skeletons) on `isLoading`, not `isFetching` — `isFetching`\n // flips back to true on every background refetch, which would cause the\n // skeleton to flicker every 10s when the list is empty.\n refetchInterval: 10_000,\n // A successful fetch proves the backend is reachable. The global\n // QueryCache onSuccess handler reads this to clear any persisted\n // failure state, re-arming the status dot without user intervention.\n meta: { backendId: active.backend.id },\n });\n};\n"],"mappings":"4TAMA,IAAa,GAA6B,EAAgB,KAAO,CAC/D,GAAM,CAAE,KAAM,GAAwB,EAAA,aAAa,CAC7C,EAAS,EAAA,kBAAkB,CAEjC,OAAO,EAAA,iBAAiB,CAKtB,SAAU,CACR,OACA,gBACA,YACA,EACA,EAAO,QAAQ,GACf,EAAO,MACR,CACD,QAAS,MAAO,CAAE,eAMT,MALc,EAAA,QAA+B,oBAClD,EACA,EACD,CAIH,QAAS,CAAC,CAAC,EACX,iBAAmB,GAAkC,EAAS,aAC9D,iBAAkB,IAAA,GAMlB,gBAAiB,IAIjB,KAAM,CAAE,UAAW,EAAO,QAAQ,GAAI,CACvC,CAAC"}
1
+ {"version":3,"file":"use-paginated-conversations.cjs","names":[],"sources":["../../../src/hooks/query/use-paginated-conversations.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { useIsAuthed } from \"./use-is-authed\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { AppConversationPage } from \"#/api/conversation-service/agent-server-conversation-service.types\";\n\nexport const usePaginatedConversations = (limit: number = 20) => {\n const { data: userIsAuthenticated } = useIsAuthed();\n const active = useActiveBackend();\n const hasBackend = !isNoBackend(active.backend);\n\n return useInfiniteQuery({\n // Include the active backend identity so each (backend, org) pair\n // maintains its own paginated cache. Switching backends naturally\n // produces a new query and a fresh fetch — without it the previous\n // backend's conversations stay visible for staleTime.\n queryKey: [\n \"user\",\n \"conversations\",\n \"paginated\",\n limit,\n active.backend.id,\n active.orgId,\n ],\n queryFn: async ({ pageParam }) => {\n const result = await AgentServerConversationService.searchConversations(\n limit,\n pageParam,\n );\n\n return result;\n },\n enabled: !!userIsAuthenticated && hasBackend,\n getNextPageParam: (lastPage: AppConversationPage) => lastPage.next_page_id,\n initialPageParam: undefined as string | undefined,\n // Poll every 10s so titles, execution status, and timestamps stay fresh\n // without requiring the user to refresh. Consumers must gate initial-load\n // UI (e.g. skeletons) on `isLoading`, not `isFetching` — `isFetching`\n // flips back to true on every background refetch, which would cause the\n // skeleton to flicker every 10s when the list is empty.\n refetchInterval: 10_000,\n // A successful fetch proves the backend is reachable. The global\n // QueryCache onSuccess handler reads this to clear any persisted\n // failure state, re-arming the status dot without user intervention.\n meta: { backendId: active.backend.id },\n });\n};\n"],"mappings":"qXAOA,IAAa,GAA6B,EAAgB,KAAO,CAC/D,GAAM,CAAE,KAAM,GAAwB,EAAA,aAAa,CAC7C,EAAS,EAAA,kBAAkB,CAC3B,EAAa,CAAC,EAAA,YAAY,EAAO,QAAQ,CAE/C,OAAO,EAAA,iBAAiB,CAKtB,SAAU,CACR,OACA,gBACA,YACA,EACA,EAAO,QAAQ,GACf,EAAO,MACR,CACD,QAAS,MAAO,CAAE,eAMT,MALc,EAAA,QAA+B,oBAClD,EACA,EACD,CAIH,QAAS,CAAC,CAAC,GAAuB,EAClC,iBAAmB,GAAkC,EAAS,aAC9D,iBAAkB,IAAA,GAMlB,gBAAiB,IAIjB,KAAM,CAAE,UAAW,EAAO,QAAQ,GAAI,CACvC,CAAC"}
@@ -1,28 +1,29 @@
1
- import { useActiveBackend as e } from "../../contexts/active-backend-context.js";
2
- import { useInfiniteQuery as t } from "../../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js";
3
- import n from "../../api/conversation-service/agent-server-conversation-service.api.js";
4
- import { useIsAuthed as r } from "./use-is-authed.js";
1
+ import { isNoBackend as e } from "../../api/backend-registry/active-store.js";
2
+ import { useActiveBackend as t } from "../../contexts/active-backend-context.js";
3
+ import { useInfiniteQuery as n } from "../../node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js";
4
+ import r from "../../api/conversation-service/agent-server-conversation-service.api.js";
5
+ import { useIsAuthed as i } from "./use-is-authed.js";
5
6
  //#region src/hooks/query/use-paginated-conversations.ts
6
- var i = (i = 20) => {
7
- let { data: a } = r(), o = e();
8
- return t({
7
+ var a = (a = 20) => {
8
+ let { data: o } = i(), s = t(), c = !e(s.backend);
9
+ return n({
9
10
  queryKey: [
10
11
  "user",
11
12
  "conversations",
12
13
  "paginated",
13
- i,
14
- o.backend.id,
15
- o.orgId
14
+ a,
15
+ s.backend.id,
16
+ s.orgId
16
17
  ],
17
- queryFn: async ({ pageParam: e }) => await n.searchConversations(i, e),
18
- enabled: !!a,
18
+ queryFn: async ({ pageParam: e }) => await r.searchConversations(a, e),
19
+ enabled: !!o && c,
19
20
  getNextPageParam: (e) => e.next_page_id,
20
21
  initialPageParam: void 0,
21
22
  refetchInterval: 1e4,
22
- meta: { backendId: o.backend.id }
23
+ meta: { backendId: s.backend.id }
23
24
  });
24
25
  };
25
26
  //#endregion
26
- export { i as usePaginatedConversations };
27
+ export { a as usePaginatedConversations };
27
28
 
28
29
  //# sourceMappingURL=use-paginated-conversations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-paginated-conversations.js","names":[],"sources":["../../../src/hooks/query/use-paginated-conversations.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { useIsAuthed } from \"./use-is-authed\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { AppConversationPage } from \"#/api/conversation-service/agent-server-conversation-service.types\";\n\nexport const usePaginatedConversations = (limit: number = 20) => {\n const { data: userIsAuthenticated } = useIsAuthed();\n const active = useActiveBackend();\n\n return useInfiniteQuery({\n // Include the active backend identity so each (backend, org) pair\n // maintains its own paginated cache. Switching backends naturally\n // produces a new query and a fresh fetch — without it the previous\n // backend's conversations stay visible for staleTime.\n queryKey: [\n \"user\",\n \"conversations\",\n \"paginated\",\n limit,\n active.backend.id,\n active.orgId,\n ],\n queryFn: async ({ pageParam }) => {\n const result = await AgentServerConversationService.searchConversations(\n limit,\n pageParam,\n );\n\n return result;\n },\n enabled: !!userIsAuthenticated,\n getNextPageParam: (lastPage: AppConversationPage) => lastPage.next_page_id,\n initialPageParam: undefined as string | undefined,\n // Poll every 10s so titles, execution status, and timestamps stay fresh\n // without requiring the user to refresh. Consumers must gate initial-load\n // UI (e.g. skeletons) on `isLoading`, not `isFetching` — `isFetching`\n // flips back to true on every background refetch, which would cause the\n // skeleton to flicker every 10s when the list is empty.\n refetchInterval: 10_000,\n // A successful fetch proves the backend is reachable. The global\n // QueryCache onSuccess handler reads this to clear any persisted\n // failure state, re-arming the status dot without user intervention.\n meta: { backendId: active.backend.id },\n });\n};\n"],"mappings":";;;;;AAMA,IAAa,KAA6B,IAAgB,OAAO;CAC/D,IAAM,EAAE,MAAM,MAAwB,GAAa,EAC7C,IAAS,GAAkB;AAEjC,QAAO,EAAiB;EAKtB,UAAU;GACR;GACA;GACA;GACA;GACA,EAAO,QAAQ;GACf,EAAO;GACR;EACD,SAAS,OAAO,EAAE,mBAMT,MALc,EAA+B,oBAClD,GACA,EACD;EAIH,SAAS,CAAC,CAAC;EACX,mBAAmB,MAAkC,EAAS;EAC9D,kBAAkB,KAAA;EAMlB,iBAAiB;EAIjB,MAAM,EAAE,WAAW,EAAO,QAAQ,IAAI;EACvC,CAAC"}
1
+ {"version":3,"file":"use-paginated-conversations.js","names":[],"sources":["../../../src/hooks/query/use-paginated-conversations.ts"],"sourcesContent":["import { useInfiniteQuery } from \"@tanstack/react-query\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { useIsAuthed } from \"./use-is-authed\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { AppConversationPage } from \"#/api/conversation-service/agent-server-conversation-service.types\";\n\nexport const usePaginatedConversations = (limit: number = 20) => {\n const { data: userIsAuthenticated } = useIsAuthed();\n const active = useActiveBackend();\n const hasBackend = !isNoBackend(active.backend);\n\n return useInfiniteQuery({\n // Include the active backend identity so each (backend, org) pair\n // maintains its own paginated cache. Switching backends naturally\n // produces a new query and a fresh fetch — without it the previous\n // backend's conversations stay visible for staleTime.\n queryKey: [\n \"user\",\n \"conversations\",\n \"paginated\",\n limit,\n active.backend.id,\n active.orgId,\n ],\n queryFn: async ({ pageParam }) => {\n const result = await AgentServerConversationService.searchConversations(\n limit,\n pageParam,\n );\n\n return result;\n },\n enabled: !!userIsAuthenticated && hasBackend,\n getNextPageParam: (lastPage: AppConversationPage) => lastPage.next_page_id,\n initialPageParam: undefined as string | undefined,\n // Poll every 10s so titles, execution status, and timestamps stay fresh\n // without requiring the user to refresh. Consumers must gate initial-load\n // UI (e.g. skeletons) on `isLoading`, not `isFetching` — `isFetching`\n // flips back to true on every background refetch, which would cause the\n // skeleton to flicker every 10s when the list is empty.\n refetchInterval: 10_000,\n // A successful fetch proves the backend is reachable. The global\n // QueryCache onSuccess handler reads this to clear any persisted\n // failure state, re-arming the status dot without user intervention.\n meta: { backendId: active.backend.id },\n });\n};\n"],"mappings":";;;;;;AAOA,IAAa,KAA6B,IAAgB,OAAO;CAC/D,IAAM,EAAE,MAAM,MAAwB,GAAa,EAC7C,IAAS,GAAkB,EAC3B,IAAa,CAAC,EAAY,EAAO,QAAQ;AAE/C,QAAO,EAAiB;EAKtB,UAAU;GACR;GACA;GACA;GACA;GACA,EAAO,QAAQ;GACf,EAAO;GACR;EACD,SAAS,OAAO,EAAE,mBAMT,MALc,EAA+B,oBAClD,GACA,EACD;EAIH,SAAS,CAAC,CAAC,KAAuB;EAClC,mBAAmB,MAAkC,EAAS;EAC9D,kBAAkB,KAAA;EAMlB,iBAAiB;EAIjB,MAAM,EAAE,WAAW,EAAO,QAAQ,IAAI;EACvC,CAAC"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../contexts/active-backend-context.cjs`),t=require(`../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs`),n=require(`../../node_modules/axios/lib/axios.cjs`),r=require(`../../services/settings.cjs`),i=require(`../../api/settings-service/settings-service.api.cjs`),a=require(`./query-keys.cjs`),o=require(`../../utils/settings-value-pickers.cjs`),s=require(`../../utils/mcp-config.cjs`);var c=e=>{if(typeof e==`object`&&e&&`status`in e){let{status:t}=e;if(typeof t==`number`)return t}if(n.default.isAxiosError(e))return e.response?.status},l=(e,t)=>{let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r},u=(e,t,n,r=!1)=>{let i=l(e,t);return typeof i==`string`&&(i.length>0||r)?i:n},d=e=>{let t=e.agent_settings??{},n={...r.DEFAULT_SETTINGS.conversation_settings??{},...e.conversation_settings??{}};return{...r.DEFAULT_SETTINGS,...e,llm_model:u(t,`llm.model`,r.DEFAULT_SETTINGS.llm_model),llm_base_url:u(t,`llm.base_url`,r.DEFAULT_SETTINGS.llm_base_url,!0),agent:u(t,`agent`,r.DEFAULT_SETTINGS.agent),llm_api_key:e.llm_api_key??null,llm_api_key_set:e.llm_api_key_set??!1,confirmation_mode:o.pickFirstBoolean(n.confirmation_mode)??r.DEFAULT_SETTINGS.confirmation_mode,security_analyzer:o.pickNullableString(n.security_analyzer)??r.DEFAULT_SETTINGS.security_analyzer,max_iterations:o.pickFirstNumber(n.max_iterations)??r.DEFAULT_SETTINGS.max_iterations,enable_default_condenser:o.pickFirstBoolean(l(t,`condenser.enabled`))??r.DEFAULT_SETTINGS.enable_default_condenser,condenser_max_size:o.pickFirstNumber(l(t,`condenser.max_size`))??r.DEFAULT_SETTINGS.condenser_max_size,mcp_config:s.parseMcpConfig(e.mcp_config??t.mcp_config),search_api_key:e.search_api_key||``,email:e.email||``,git_user_name:e.git_user_name||r.DEFAULT_SETTINGS.git_user_name,git_user_email:e.git_user_email||r.DEFAULT_SETTINGS.git_user_email,is_new_user:!1,disabled_skills:e.disabled_skills??r.DEFAULT_SETTINGS.disabled_skills,agent_settings_schema:e.agent_settings_schema??null,agent_settings:e.agent_settings??r.DEFAULT_SETTINGS.agent_settings,conversation_settings_schema:e.conversation_settings_schema??r.DEFAULT_SETTINGS.conversation_settings_schema,conversation_settings:n}},f=async(e=`personal`)=>{if(e!==`personal`)throw Error(`Unsupported settings scope: ${e}`);return d(await i.default.getSettings())},p=(n=`personal`)=>{let i=e.useActiveBackend(),o=t.useQuery({queryKey:[...a.SETTINGS_QUERY_KEYS.byScope(n),i.backend.id,i.orgId],queryFn:()=>f(n),retry:(e,t)=>c(t)!==404,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,meta:{disableToast:!0}});return c(o.error)===404?{data:r.DEFAULT_SETTINGS,error:o.error,isError:o.isError,isLoading:o.isLoading,isFetching:o.isFetching,isFetched:o.isFetched,isSuccess:o.isSuccess,status:o.status,fetchStatus:o.fetchStatus,refetch:o.refetch}:o};exports.getErrorStatus=c,exports.useSettings=p;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../api/backend-registry/active-store.cjs`),t=require(`../../contexts/active-backend-context.cjs`),n=require(`../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs`),r=require(`../../node_modules/axios/lib/axios.cjs`),i=require(`../../services/settings.cjs`),a=require(`../../api/settings-service/settings-service.api.cjs`),o=require(`./query-keys.cjs`),s=require(`../../utils/settings-value-pickers.cjs`),c=require(`../../utils/mcp-config.cjs`);var l=e=>{if(typeof e==`object`&&e&&`status`in e){let{status:t}=e;if(typeof t==`number`)return t}if(r.default.isAxiosError(e))return e.response?.status},u=(e,t)=>{let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r},d=(e,t,n,r=!1)=>{let i=u(e,t);return typeof i==`string`&&(i.length>0||r)?i:n},f=e=>{let t=e.agent_settings??{},n={...i.DEFAULT_SETTINGS.conversation_settings??{},...e.conversation_settings??{}};return{...i.DEFAULT_SETTINGS,...e,llm_model:d(t,`llm.model`,i.DEFAULT_SETTINGS.llm_model),llm_base_url:d(t,`llm.base_url`,i.DEFAULT_SETTINGS.llm_base_url,!0),agent:d(t,`agent`,i.DEFAULT_SETTINGS.agent),llm_api_key:e.llm_api_key??null,llm_api_key_set:e.llm_api_key_set??!1,confirmation_mode:s.pickFirstBoolean(n.confirmation_mode)??i.DEFAULT_SETTINGS.confirmation_mode,security_analyzer:s.pickNullableString(n.security_analyzer)??i.DEFAULT_SETTINGS.security_analyzer,max_iterations:s.pickFirstNumber(n.max_iterations)??i.DEFAULT_SETTINGS.max_iterations,enable_default_condenser:s.pickFirstBoolean(u(t,`condenser.enabled`))??i.DEFAULT_SETTINGS.enable_default_condenser,condenser_max_size:s.pickFirstNumber(u(t,`condenser.max_size`))??i.DEFAULT_SETTINGS.condenser_max_size,mcp_config:c.parseMcpConfig(e.mcp_config??t.mcp_config),search_api_key:e.search_api_key||``,email:e.email||``,git_user_name:e.git_user_name||i.DEFAULT_SETTINGS.git_user_name,git_user_email:e.git_user_email||i.DEFAULT_SETTINGS.git_user_email,is_new_user:!1,disabled_skills:e.disabled_skills??i.DEFAULT_SETTINGS.disabled_skills,agent_settings_schema:e.agent_settings_schema??null,agent_settings:e.agent_settings??i.DEFAULT_SETTINGS.agent_settings,conversation_settings_schema:e.conversation_settings_schema??i.DEFAULT_SETTINGS.conversation_settings_schema,conversation_settings:n}},p=async(e=`personal`)=>{if(e!==`personal`)throw Error(`Unsupported settings scope: ${e}`);return f(await a.default.getSettings())},m=(r=`personal`)=>{let a=t.useActiveBackend(),s=!e.isNoBackend(a.backend),c=n.useQuery({queryKey:[...o.SETTINGS_QUERY_KEYS.byScope(r),a.backend.id,a.orgId],queryFn:()=>p(r),retry:(e,t)=>l(t)!==404,enabled:s,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,meta:{disableToast:!0}});return s?l(c.error)===404?{data:i.DEFAULT_SETTINGS,error:c.error,isError:c.isError,isLoading:c.isLoading,isFetching:c.isFetching,isFetched:c.isFetched,isSuccess:c.isSuccess,status:c.status,fetchStatus:c.fetchStatus,refetch:c.refetch}:c:{data:i.DEFAULT_SETTINGS,error:null,isError:!1,isLoading:!1,isFetching:!1,isFetched:!1,isSuccess:!0,status:`success`,fetchStatus:`idle`,refetch:c.refetch}};exports.getErrorStatus=l,exports.useSettings=m;
2
2
  //# sourceMappingURL=use-settings.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-settings.cjs","names":[],"sources":["../../../src/hooks/query/use-settings.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { Settings, SettingsScope, SettingsValue } from \"#/types/settings\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { SETTINGS_QUERY_KEYS } from \"#/hooks/query/query-keys\";\nimport {\n pickFirstBoolean,\n pickFirstNumber,\n pickNullableString,\n} from \"#/utils/settings-value-pickers\";\nimport { parseMcpConfig } from \"#/utils/mcp-config\";\n\nexport const getErrorStatus = (error: unknown): number | undefined => {\n if (typeof error === \"object\" && error !== null && \"status\" in error) {\n const { status } = error as { status?: unknown };\n if (typeof status === \"number\") {\n return status;\n }\n }\n\n if (axios.isAxiosError(error)) {\n return error.response?.status;\n }\n\n return undefined;\n};\n\nconst lookupNested = (obj: Record<string, unknown>, key: string): unknown => {\n const parts = key.split(\".\");\n let current: unknown = obj;\n for (const part of parts) {\n if (current == null || typeof current !== \"object\") return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n};\n\nconst resolveSdkString = (\n agentSettings: Record<string, unknown>,\n key: string,\n defaultValue: string,\n allowEmpty = false,\n): string => {\n const value = lookupNested(agentSettings, key);\n if (typeof value === \"string\" && (value.length > 0 || allowEmpty)) {\n return value;\n }\n return defaultValue;\n};\n\nconst normalizeSettingsResponse = (settings: Partial<Settings>): Settings => {\n const agentSettings = (settings.agent_settings ?? {}) as Record<\n string,\n unknown\n >;\n const conversationSettings = {\n ...(DEFAULT_SETTINGS.conversation_settings ?? {}),\n ...((settings.conversation_settings ?? {}) as Record<\n string,\n SettingsValue\n >),\n };\n\n return {\n ...DEFAULT_SETTINGS,\n ...settings,\n llm_model: resolveSdkString(\n agentSettings,\n \"llm.model\",\n DEFAULT_SETTINGS.llm_model,\n ),\n llm_base_url: resolveSdkString(\n agentSettings,\n \"llm.base_url\",\n DEFAULT_SETTINGS.llm_base_url,\n true,\n ),\n agent: resolveSdkString(agentSettings, \"agent\", DEFAULT_SETTINGS.agent),\n llm_api_key: settings.llm_api_key ?? null,\n llm_api_key_set: settings.llm_api_key_set ?? false,\n confirmation_mode:\n pickFirstBoolean(conversationSettings.confirmation_mode) ??\n DEFAULT_SETTINGS.confirmation_mode,\n security_analyzer:\n pickNullableString(conversationSettings.security_analyzer) ??\n DEFAULT_SETTINGS.security_analyzer,\n max_iterations:\n pickFirstNumber(conversationSettings.max_iterations) ??\n DEFAULT_SETTINGS.max_iterations,\n enable_default_condenser:\n pickFirstBoolean(lookupNested(agentSettings, \"condenser.enabled\")) ??\n DEFAULT_SETTINGS.enable_default_condenser,\n condenser_max_size:\n pickFirstNumber(lookupNested(agentSettings, \"condenser.max_size\")) ??\n DEFAULT_SETTINGS.condenser_max_size,\n mcp_config: parseMcpConfig(\n settings.mcp_config ??\n (agentSettings.mcp_config as typeof settings.mcp_config),\n ),\n search_api_key: settings.search_api_key || \"\",\n email: settings.email || \"\",\n git_user_name: settings.git_user_name || DEFAULT_SETTINGS.git_user_name,\n git_user_email: settings.git_user_email || DEFAULT_SETTINGS.git_user_email,\n is_new_user: false,\n disabled_skills:\n settings.disabled_skills ?? DEFAULT_SETTINGS.disabled_skills,\n agent_settings_schema: settings.agent_settings_schema ?? null,\n agent_settings: settings.agent_settings ?? DEFAULT_SETTINGS.agent_settings,\n conversation_settings_schema:\n settings.conversation_settings_schema ??\n DEFAULT_SETTINGS.conversation_settings_schema,\n conversation_settings: conversationSettings,\n };\n};\n\nexport const getSettingsQueryFn = async (\n scope: SettingsScope = \"personal\",\n): Promise<Settings> => {\n if (scope !== \"personal\") {\n throw new Error(`Unsupported settings scope: ${scope}`);\n }\n\n const settings = await SettingsService.getSettings();\n return normalizeSettingsResponse(settings);\n};\n\nexport const useSettings = (scope: SettingsScope = \"personal\") => {\n const active = useActiveBackend();\n const query = useQuery({\n // Include the active backend identity so switching backends or orgs\n // produces a fresh query — the `staleTime` cache for one backend\n // never serves another's data.\n queryKey: [\n ...SETTINGS_QUERY_KEYS.byScope(scope),\n active.backend.id,\n active.orgId,\n ],\n queryFn: () => getSettingsQueryFn(scope),\n retry: (_, error) => getErrorStatus(error) !== 404,\n refetchOnWindowFocus: false,\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 15,\n meta: {\n disableToast: true,\n },\n });\n\n if (getErrorStatus(query.error) === 404) {\n return {\n data: DEFAULT_SETTINGS,\n error: query.error,\n isError: query.isError,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n isFetched: query.isFetched,\n isSuccess: query.isSuccess,\n status: query.status,\n fetchStatus: query.fetchStatus,\n refetch: query.refetch,\n };\n }\n\n return query;\n};\n"],"mappings":"qdAcA,IAAa,EAAkB,GAAuC,CACpE,GAAI,OAAO,GAAU,UAAY,GAAkB,WAAY,EAAO,CACpE,GAAM,CAAE,UAAW,EACnB,GAAI,OAAO,GAAW,SACpB,OAAO,EAIX,GAAI,EAAA,QAAM,aAAa,EAAM,CAC3B,OAAO,EAAM,UAAU,QAMrB,GAAgB,EAA8B,IAAyB,CAC3E,IAAM,EAAQ,EAAI,MAAM,IAAI,CACxB,EAAmB,EACvB,IAAK,IAAM,KAAQ,EAAO,CACxB,GAAuB,OAAO,GAAY,WAAtC,EAAgD,OACpD,EAAW,EAAoC,GAEjD,OAAO,GAGH,GACJ,EACA,EACA,EACA,EAAa,KACF,CACX,IAAM,EAAQ,EAAa,EAAe,EAAI,CAI9C,OAHI,OAAO,GAAU,WAAa,EAAM,OAAS,GAAK,GAC7C,EAEF,GAGH,EAA6B,GAA0C,CAC3E,IAAM,EAAiB,EAAS,gBAAkB,EAAE,CAI9C,EAAuB,CAC3B,GAAI,EAAA,iBAAiB,uBAAyB,EAAE,CAChD,GAAK,EAAS,uBAAyB,EAAE,CAI1C,CAED,MAAO,CACL,GAAG,EAAA,iBACH,GAAG,EACH,UAAW,EACT,EACA,YACA,EAAA,iBAAiB,UAClB,CACD,aAAc,EACZ,EACA,eACA,EAAA,iBAAiB,aACjB,GACD,CACD,MAAO,EAAiB,EAAe,QAAS,EAAA,iBAAiB,MAAM,CACvE,YAAa,EAAS,aAAe,KACrC,gBAAiB,EAAS,iBAAmB,GAC7C,kBACE,EAAA,iBAAiB,EAAqB,kBAAkB,EACxD,EAAA,iBAAiB,kBACnB,kBACE,EAAA,mBAAmB,EAAqB,kBAAkB,EAC1D,EAAA,iBAAiB,kBACnB,eACE,EAAA,gBAAgB,EAAqB,eAAe,EACpD,EAAA,iBAAiB,eACnB,yBACE,EAAA,iBAAiB,EAAa,EAAe,oBAAoB,CAAC,EAClE,EAAA,iBAAiB,yBACnB,mBACE,EAAA,gBAAgB,EAAa,EAAe,qBAAqB,CAAC,EAClE,EAAA,iBAAiB,mBACnB,WAAY,EAAA,eACV,EAAS,YACN,EAAc,WAClB,CACD,eAAgB,EAAS,gBAAkB,GAC3C,MAAO,EAAS,OAAS,GACzB,cAAe,EAAS,eAAiB,EAAA,iBAAiB,cAC1D,eAAgB,EAAS,gBAAkB,EAAA,iBAAiB,eAC5D,YAAa,GACb,gBACE,EAAS,iBAAmB,EAAA,iBAAiB,gBAC/C,sBAAuB,EAAS,uBAAyB,KACzD,eAAgB,EAAS,gBAAkB,EAAA,iBAAiB,eAC5D,6BACE,EAAS,8BACT,EAAA,iBAAiB,6BACnB,sBAAuB,EACxB,EAGU,EAAqB,MAChC,EAAuB,aACD,CACtB,GAAI,IAAU,WACZ,MAAU,MAAM,+BAA+B,IAAQ,CAIzD,OAAO,EAA0B,MADV,EAAA,QAAgB,aAAa,CACV,EAG/B,GAAe,EAAuB,aAAe,CAChE,IAAM,EAAS,EAAA,kBAAkB,CAC3B,EAAQ,EAAA,SAAS,CAIrB,SAAU,CACR,GAAG,EAAA,oBAAoB,QAAQ,EAAM,CACrC,EAAO,QAAQ,GACf,EAAO,MACR,CACD,YAAe,EAAmB,EAAM,CACxC,OAAQ,EAAG,IAAU,EAAe,EAAM,GAAK,IAC/C,qBAAsB,GACtB,UAAW,IAAO,GAAK,EACvB,OAAQ,IAAO,GAAK,GACpB,KAAM,CACJ,aAAc,GACf,CACF,CAAC,CAiBF,OAfI,EAAe,EAAM,MAAM,GAAK,IAC3B,CACL,KAAM,EAAA,iBACN,MAAO,EAAM,MACb,QAAS,EAAM,QACf,UAAW,EAAM,UACjB,WAAY,EAAM,WAClB,UAAW,EAAM,UACjB,UAAW,EAAM,UACjB,OAAQ,EAAM,OACd,YAAa,EAAM,YACnB,QAAS,EAAM,QAChB,CAGI"}
1
+ {"version":3,"file":"use-settings.cjs","names":[],"sources":["../../../src/hooks/query/use-settings.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { Settings, SettingsScope, SettingsValue } from \"#/types/settings\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { SETTINGS_QUERY_KEYS } from \"#/hooks/query/query-keys\";\nimport {\n pickFirstBoolean,\n pickFirstNumber,\n pickNullableString,\n} from \"#/utils/settings-value-pickers\";\nimport { parseMcpConfig } from \"#/utils/mcp-config\";\n\nexport const getErrorStatus = (error: unknown): number | undefined => {\n if (typeof error === \"object\" && error !== null && \"status\" in error) {\n const { status } = error as { status?: unknown };\n if (typeof status === \"number\") {\n return status;\n }\n }\n\n if (axios.isAxiosError(error)) {\n return error.response?.status;\n }\n\n return undefined;\n};\n\nconst lookupNested = (obj: Record<string, unknown>, key: string): unknown => {\n const parts = key.split(\".\");\n let current: unknown = obj;\n for (const part of parts) {\n if (current == null || typeof current !== \"object\") return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n};\n\nconst resolveSdkString = (\n agentSettings: Record<string, unknown>,\n key: string,\n defaultValue: string,\n allowEmpty = false,\n): string => {\n const value = lookupNested(agentSettings, key);\n if (typeof value === \"string\" && (value.length > 0 || allowEmpty)) {\n return value;\n }\n return defaultValue;\n};\n\nconst normalizeSettingsResponse = (settings: Partial<Settings>): Settings => {\n const agentSettings = (settings.agent_settings ?? {}) as Record<\n string,\n unknown\n >;\n const conversationSettings = {\n ...(DEFAULT_SETTINGS.conversation_settings ?? {}),\n ...((settings.conversation_settings ?? {}) as Record<\n string,\n SettingsValue\n >),\n };\n\n return {\n ...DEFAULT_SETTINGS,\n ...settings,\n llm_model: resolveSdkString(\n agentSettings,\n \"llm.model\",\n DEFAULT_SETTINGS.llm_model,\n ),\n llm_base_url: resolveSdkString(\n agentSettings,\n \"llm.base_url\",\n DEFAULT_SETTINGS.llm_base_url,\n true,\n ),\n agent: resolveSdkString(agentSettings, \"agent\", DEFAULT_SETTINGS.agent),\n llm_api_key: settings.llm_api_key ?? null,\n llm_api_key_set: settings.llm_api_key_set ?? false,\n confirmation_mode:\n pickFirstBoolean(conversationSettings.confirmation_mode) ??\n DEFAULT_SETTINGS.confirmation_mode,\n security_analyzer:\n pickNullableString(conversationSettings.security_analyzer) ??\n DEFAULT_SETTINGS.security_analyzer,\n max_iterations:\n pickFirstNumber(conversationSettings.max_iterations) ??\n DEFAULT_SETTINGS.max_iterations,\n enable_default_condenser:\n pickFirstBoolean(lookupNested(agentSettings, \"condenser.enabled\")) ??\n DEFAULT_SETTINGS.enable_default_condenser,\n condenser_max_size:\n pickFirstNumber(lookupNested(agentSettings, \"condenser.max_size\")) ??\n DEFAULT_SETTINGS.condenser_max_size,\n mcp_config: parseMcpConfig(\n settings.mcp_config ??\n (agentSettings.mcp_config as typeof settings.mcp_config),\n ),\n search_api_key: settings.search_api_key || \"\",\n email: settings.email || \"\",\n git_user_name: settings.git_user_name || DEFAULT_SETTINGS.git_user_name,\n git_user_email: settings.git_user_email || DEFAULT_SETTINGS.git_user_email,\n is_new_user: false,\n disabled_skills:\n settings.disabled_skills ?? DEFAULT_SETTINGS.disabled_skills,\n agent_settings_schema: settings.agent_settings_schema ?? null,\n agent_settings: settings.agent_settings ?? DEFAULT_SETTINGS.agent_settings,\n conversation_settings_schema:\n settings.conversation_settings_schema ??\n DEFAULT_SETTINGS.conversation_settings_schema,\n conversation_settings: conversationSettings,\n };\n};\n\nexport const getSettingsQueryFn = async (\n scope: SettingsScope = \"personal\",\n): Promise<Settings> => {\n if (scope !== \"personal\") {\n throw new Error(`Unsupported settings scope: ${scope}`);\n }\n\n const settings = await SettingsService.getSettings();\n return normalizeSettingsResponse(settings);\n};\n\nexport const useSettings = (scope: SettingsScope = \"personal\") => {\n const active = useActiveBackend();\n const hasBackend = !isNoBackend(active.backend);\n const query = useQuery({\n // Include the active backend identity so switching backends or orgs\n // produces a fresh query — the `staleTime` cache for one backend\n // never serves another's data.\n queryKey: [\n ...SETTINGS_QUERY_KEYS.byScope(scope),\n active.backend.id,\n active.orgId,\n ],\n queryFn: () => getSettingsQueryFn(scope),\n retry: (_, error) => getErrorStatus(error) !== 404,\n enabled: hasBackend,\n refetchOnWindowFocus: false,\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 15,\n meta: {\n disableToast: true,\n },\n });\n\n if (!hasBackend) {\n return {\n data: DEFAULT_SETTINGS,\n error: null,\n isError: false,\n isLoading: false,\n isFetching: false,\n isFetched: false,\n isSuccess: true,\n status: \"success\" as const,\n fetchStatus: \"idle\" as const,\n refetch: query.refetch,\n };\n }\n\n if (getErrorStatus(query.error) === 404) {\n return {\n data: DEFAULT_SETTINGS,\n error: query.error,\n isError: query.isError,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n isFetched: query.isFetched,\n isSuccess: query.isSuccess,\n status: query.status,\n fetchStatus: query.fetchStatus,\n refetch: query.refetch,\n };\n }\n\n return query;\n};\n"],"mappings":"8gBAeA,IAAa,EAAkB,GAAuC,CACpE,GAAI,OAAO,GAAU,UAAY,GAAkB,WAAY,EAAO,CACpE,GAAM,CAAE,UAAW,EACnB,GAAI,OAAO,GAAW,SACpB,OAAO,EAIX,GAAI,EAAA,QAAM,aAAa,EAAM,CAC3B,OAAO,EAAM,UAAU,QAMrB,GAAgB,EAA8B,IAAyB,CAC3E,IAAM,EAAQ,EAAI,MAAM,IAAI,CACxB,EAAmB,EACvB,IAAK,IAAM,KAAQ,EAAO,CACxB,GAAuB,OAAO,GAAY,WAAtC,EAAgD,OACpD,EAAW,EAAoC,GAEjD,OAAO,GAGH,GACJ,EACA,EACA,EACA,EAAa,KACF,CACX,IAAM,EAAQ,EAAa,EAAe,EAAI,CAI9C,OAHI,OAAO,GAAU,WAAa,EAAM,OAAS,GAAK,GAC7C,EAEF,GAGH,EAA6B,GAA0C,CAC3E,IAAM,EAAiB,EAAS,gBAAkB,EAAE,CAI9C,EAAuB,CAC3B,GAAI,EAAA,iBAAiB,uBAAyB,EAAE,CAChD,GAAK,EAAS,uBAAyB,EAAE,CAI1C,CAED,MAAO,CACL,GAAG,EAAA,iBACH,GAAG,EACH,UAAW,EACT,EACA,YACA,EAAA,iBAAiB,UAClB,CACD,aAAc,EACZ,EACA,eACA,EAAA,iBAAiB,aACjB,GACD,CACD,MAAO,EAAiB,EAAe,QAAS,EAAA,iBAAiB,MAAM,CACvE,YAAa,EAAS,aAAe,KACrC,gBAAiB,EAAS,iBAAmB,GAC7C,kBACE,EAAA,iBAAiB,EAAqB,kBAAkB,EACxD,EAAA,iBAAiB,kBACnB,kBACE,EAAA,mBAAmB,EAAqB,kBAAkB,EAC1D,EAAA,iBAAiB,kBACnB,eACE,EAAA,gBAAgB,EAAqB,eAAe,EACpD,EAAA,iBAAiB,eACnB,yBACE,EAAA,iBAAiB,EAAa,EAAe,oBAAoB,CAAC,EAClE,EAAA,iBAAiB,yBACnB,mBACE,EAAA,gBAAgB,EAAa,EAAe,qBAAqB,CAAC,EAClE,EAAA,iBAAiB,mBACnB,WAAY,EAAA,eACV,EAAS,YACN,EAAc,WAClB,CACD,eAAgB,EAAS,gBAAkB,GAC3C,MAAO,EAAS,OAAS,GACzB,cAAe,EAAS,eAAiB,EAAA,iBAAiB,cAC1D,eAAgB,EAAS,gBAAkB,EAAA,iBAAiB,eAC5D,YAAa,GACb,gBACE,EAAS,iBAAmB,EAAA,iBAAiB,gBAC/C,sBAAuB,EAAS,uBAAyB,KACzD,eAAgB,EAAS,gBAAkB,EAAA,iBAAiB,eAC5D,6BACE,EAAS,8BACT,EAAA,iBAAiB,6BACnB,sBAAuB,EACxB,EAGU,EAAqB,MAChC,EAAuB,aACD,CACtB,GAAI,IAAU,WACZ,MAAU,MAAM,+BAA+B,IAAQ,CAIzD,OAAO,EAA0B,MADV,EAAA,QAAgB,aAAa,CACV,EAG/B,GAAe,EAAuB,aAAe,CAChE,IAAM,EAAS,EAAA,kBAAkB,CAC3B,EAAa,CAAC,EAAA,YAAY,EAAO,QAAQ,CACzC,EAAQ,EAAA,SAAS,CAIrB,SAAU,CACR,GAAG,EAAA,oBAAoB,QAAQ,EAAM,CACrC,EAAO,QAAQ,GACf,EAAO,MACR,CACD,YAAe,EAAmB,EAAM,CACxC,OAAQ,EAAG,IAAU,EAAe,EAAM,GAAK,IAC/C,QAAS,EACT,qBAAsB,GACtB,UAAW,IAAO,GAAK,EACvB,OAAQ,IAAO,GAAK,GACpB,KAAM,CACJ,aAAc,GACf,CACF,CAAC,CAgCF,OA9BK,EAeD,EAAe,EAAM,MAAM,GAAK,IAC3B,CACL,KAAM,EAAA,iBACN,MAAO,EAAM,MACb,QAAS,EAAM,QACf,UAAW,EAAM,UACjB,WAAY,EAAM,WAClB,UAAW,EAAM,UACjB,UAAW,EAAM,UACjB,OAAQ,EAAM,OACd,YAAa,EAAM,YACnB,QAAS,EAAM,QAChB,CAGI,EA7BE,CACL,KAAM,EAAA,iBACN,MAAO,KACP,QAAS,GACT,UAAW,GACX,WAAY,GACZ,UAAW,GACX,UAAW,GACX,OAAQ,UACR,YAAa,OACb,QAAS,EAAM,QAChB"}
@@ -1,89 +1,102 @@
1
- import { useActiveBackend as e } from "../../contexts/active-backend-context.js";
2
- import { useQuery as t } from "../../node_modules/@tanstack/react-query/build/modern/useQuery.js";
3
- import n from "../../node_modules/axios/lib/axios.js";
4
- import { DEFAULT_SETTINGS as r } from "../../services/settings.js";
5
- import i from "../../api/settings-service/settings-service.api.js";
6
- import { SETTINGS_QUERY_KEYS as a } from "./query-keys.js";
7
- import { pickFirstBoolean as o, pickFirstNumber as s, pickNullableString as c } from "../../utils/settings-value-pickers.js";
8
- import { parseMcpConfig as l } from "../../utils/mcp-config.js";
1
+ import { isNoBackend as e } from "../../api/backend-registry/active-store.js";
2
+ import { useActiveBackend as t } from "../../contexts/active-backend-context.js";
3
+ import { useQuery as n } from "../../node_modules/@tanstack/react-query/build/modern/useQuery.js";
4
+ import r from "../../node_modules/axios/lib/axios.js";
5
+ import { DEFAULT_SETTINGS as i } from "../../services/settings.js";
6
+ import a from "../../api/settings-service/settings-service.api.js";
7
+ import { SETTINGS_QUERY_KEYS as o } from "./query-keys.js";
8
+ import { pickFirstBoolean as s, pickFirstNumber as c, pickNullableString as l } from "../../utils/settings-value-pickers.js";
9
+ import { parseMcpConfig as u } from "../../utils/mcp-config.js";
9
10
  //#region src/hooks/query/use-settings.ts
10
- var u = (e) => {
11
+ var d = (e) => {
11
12
  if (typeof e == "object" && e && "status" in e) {
12
13
  let { status: t } = e;
13
14
  if (typeof t == "number") return t;
14
15
  }
15
- if (n.isAxiosError(e)) return e.response?.status;
16
- }, d = (e, t) => {
16
+ if (r.isAxiosError(e)) return e.response?.status;
17
+ }, f = (e, t) => {
17
18
  let n = t.split("."), r = e;
18
19
  for (let e of n) {
19
20
  if (typeof r != "object" || !r) return;
20
21
  r = r[e];
21
22
  }
22
23
  return r;
23
- }, f = (e, t, n, r = !1) => {
24
- let i = d(e, t);
24
+ }, p = (e, t, n, r = !1) => {
25
+ let i = f(e, t);
25
26
  return typeof i == "string" && (i.length > 0 || r) ? i : n;
26
- }, p = (e) => {
27
+ }, m = (e) => {
27
28
  let t = e.agent_settings ?? {}, n = {
28
- ...r.conversation_settings ?? {},
29
+ ...i.conversation_settings ?? {},
29
30
  ...e.conversation_settings ?? {}
30
31
  };
31
32
  return {
32
- ...r,
33
+ ...i,
33
34
  ...e,
34
- llm_model: f(t, "llm.model", r.llm_model),
35
- llm_base_url: f(t, "llm.base_url", r.llm_base_url, !0),
36
- agent: f(t, "agent", r.agent),
35
+ llm_model: p(t, "llm.model", i.llm_model),
36
+ llm_base_url: p(t, "llm.base_url", i.llm_base_url, !0),
37
+ agent: p(t, "agent", i.agent),
37
38
  llm_api_key: e.llm_api_key ?? null,
38
39
  llm_api_key_set: e.llm_api_key_set ?? !1,
39
- confirmation_mode: o(n.confirmation_mode) ?? r.confirmation_mode,
40
- security_analyzer: c(n.security_analyzer) ?? r.security_analyzer,
41
- max_iterations: s(n.max_iterations) ?? r.max_iterations,
42
- enable_default_condenser: o(d(t, "condenser.enabled")) ?? r.enable_default_condenser,
43
- condenser_max_size: s(d(t, "condenser.max_size")) ?? r.condenser_max_size,
44
- mcp_config: l(e.mcp_config ?? t.mcp_config),
40
+ confirmation_mode: s(n.confirmation_mode) ?? i.confirmation_mode,
41
+ security_analyzer: l(n.security_analyzer) ?? i.security_analyzer,
42
+ max_iterations: c(n.max_iterations) ?? i.max_iterations,
43
+ enable_default_condenser: s(f(t, "condenser.enabled")) ?? i.enable_default_condenser,
44
+ condenser_max_size: c(f(t, "condenser.max_size")) ?? i.condenser_max_size,
45
+ mcp_config: u(e.mcp_config ?? t.mcp_config),
45
46
  search_api_key: e.search_api_key || "",
46
47
  email: e.email || "",
47
- git_user_name: e.git_user_name || r.git_user_name,
48
- git_user_email: e.git_user_email || r.git_user_email,
48
+ git_user_name: e.git_user_name || i.git_user_name,
49
+ git_user_email: e.git_user_email || i.git_user_email,
49
50
  is_new_user: !1,
50
- disabled_skills: e.disabled_skills ?? r.disabled_skills,
51
+ disabled_skills: e.disabled_skills ?? i.disabled_skills,
51
52
  agent_settings_schema: e.agent_settings_schema ?? null,
52
- agent_settings: e.agent_settings ?? r.agent_settings,
53
- conversation_settings_schema: e.conversation_settings_schema ?? r.conversation_settings_schema,
53
+ agent_settings: e.agent_settings ?? i.agent_settings,
54
+ conversation_settings_schema: e.conversation_settings_schema ?? i.conversation_settings_schema,
54
55
  conversation_settings: n
55
56
  };
56
- }, m = async (e = "personal") => {
57
+ }, h = async (e = "personal") => {
57
58
  if (e !== "personal") throw Error(`Unsupported settings scope: ${e}`);
58
- return p(await i.getSettings());
59
- }, h = (n = "personal") => {
60
- let i = e(), o = t({
59
+ return m(await a.getSettings());
60
+ }, g = (r = "personal") => {
61
+ let a = t(), s = !e(a.backend), c = n({
61
62
  queryKey: [
62
- ...a.byScope(n),
63
- i.backend.id,
64
- i.orgId
63
+ ...o.byScope(r),
64
+ a.backend.id,
65
+ a.orgId
65
66
  ],
66
- queryFn: () => m(n),
67
- retry: (e, t) => u(t) !== 404,
67
+ queryFn: () => h(r),
68
+ retry: (e, t) => d(t) !== 404,
69
+ enabled: s,
68
70
  refetchOnWindowFocus: !1,
69
71
  staleTime: 1e3 * 60 * 5,
70
72
  gcTime: 1e3 * 60 * 15,
71
73
  meta: { disableToast: !0 }
72
74
  });
73
- return u(o.error) === 404 ? {
74
- data: r,
75
- error: o.error,
76
- isError: o.isError,
77
- isLoading: o.isLoading,
78
- isFetching: o.isFetching,
79
- isFetched: o.isFetched,
80
- isSuccess: o.isSuccess,
81
- status: o.status,
82
- fetchStatus: o.fetchStatus,
83
- refetch: o.refetch
84
- } : o;
75
+ return s ? d(c.error) === 404 ? {
76
+ data: i,
77
+ error: c.error,
78
+ isError: c.isError,
79
+ isLoading: c.isLoading,
80
+ isFetching: c.isFetching,
81
+ isFetched: c.isFetched,
82
+ isSuccess: c.isSuccess,
83
+ status: c.status,
84
+ fetchStatus: c.fetchStatus,
85
+ refetch: c.refetch
86
+ } : c : {
87
+ data: i,
88
+ error: null,
89
+ isError: !1,
90
+ isLoading: !1,
91
+ isFetching: !1,
92
+ isFetched: !1,
93
+ isSuccess: !0,
94
+ status: "success",
95
+ fetchStatus: "idle",
96
+ refetch: c.refetch
97
+ };
85
98
  };
86
99
  //#endregion
87
- export { u as getErrorStatus, h as useSettings };
100
+ export { d as getErrorStatus, g as useSettings };
88
101
 
89
102
  //# sourceMappingURL=use-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-settings.js","names":[],"sources":["../../../src/hooks/query/use-settings.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { Settings, SettingsScope, SettingsValue } from \"#/types/settings\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { SETTINGS_QUERY_KEYS } from \"#/hooks/query/query-keys\";\nimport {\n pickFirstBoolean,\n pickFirstNumber,\n pickNullableString,\n} from \"#/utils/settings-value-pickers\";\nimport { parseMcpConfig } from \"#/utils/mcp-config\";\n\nexport const getErrorStatus = (error: unknown): number | undefined => {\n if (typeof error === \"object\" && error !== null && \"status\" in error) {\n const { status } = error as { status?: unknown };\n if (typeof status === \"number\") {\n return status;\n }\n }\n\n if (axios.isAxiosError(error)) {\n return error.response?.status;\n }\n\n return undefined;\n};\n\nconst lookupNested = (obj: Record<string, unknown>, key: string): unknown => {\n const parts = key.split(\".\");\n let current: unknown = obj;\n for (const part of parts) {\n if (current == null || typeof current !== \"object\") return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n};\n\nconst resolveSdkString = (\n agentSettings: Record<string, unknown>,\n key: string,\n defaultValue: string,\n allowEmpty = false,\n): string => {\n const value = lookupNested(agentSettings, key);\n if (typeof value === \"string\" && (value.length > 0 || allowEmpty)) {\n return value;\n }\n return defaultValue;\n};\n\nconst normalizeSettingsResponse = (settings: Partial<Settings>): Settings => {\n const agentSettings = (settings.agent_settings ?? {}) as Record<\n string,\n unknown\n >;\n const conversationSettings = {\n ...(DEFAULT_SETTINGS.conversation_settings ?? {}),\n ...((settings.conversation_settings ?? {}) as Record<\n string,\n SettingsValue\n >),\n };\n\n return {\n ...DEFAULT_SETTINGS,\n ...settings,\n llm_model: resolveSdkString(\n agentSettings,\n \"llm.model\",\n DEFAULT_SETTINGS.llm_model,\n ),\n llm_base_url: resolveSdkString(\n agentSettings,\n \"llm.base_url\",\n DEFAULT_SETTINGS.llm_base_url,\n true,\n ),\n agent: resolveSdkString(agentSettings, \"agent\", DEFAULT_SETTINGS.agent),\n llm_api_key: settings.llm_api_key ?? null,\n llm_api_key_set: settings.llm_api_key_set ?? false,\n confirmation_mode:\n pickFirstBoolean(conversationSettings.confirmation_mode) ??\n DEFAULT_SETTINGS.confirmation_mode,\n security_analyzer:\n pickNullableString(conversationSettings.security_analyzer) ??\n DEFAULT_SETTINGS.security_analyzer,\n max_iterations:\n pickFirstNumber(conversationSettings.max_iterations) ??\n DEFAULT_SETTINGS.max_iterations,\n enable_default_condenser:\n pickFirstBoolean(lookupNested(agentSettings, \"condenser.enabled\")) ??\n DEFAULT_SETTINGS.enable_default_condenser,\n condenser_max_size:\n pickFirstNumber(lookupNested(agentSettings, \"condenser.max_size\")) ??\n DEFAULT_SETTINGS.condenser_max_size,\n mcp_config: parseMcpConfig(\n settings.mcp_config ??\n (agentSettings.mcp_config as typeof settings.mcp_config),\n ),\n search_api_key: settings.search_api_key || \"\",\n email: settings.email || \"\",\n git_user_name: settings.git_user_name || DEFAULT_SETTINGS.git_user_name,\n git_user_email: settings.git_user_email || DEFAULT_SETTINGS.git_user_email,\n is_new_user: false,\n disabled_skills:\n settings.disabled_skills ?? DEFAULT_SETTINGS.disabled_skills,\n agent_settings_schema: settings.agent_settings_schema ?? null,\n agent_settings: settings.agent_settings ?? DEFAULT_SETTINGS.agent_settings,\n conversation_settings_schema:\n settings.conversation_settings_schema ??\n DEFAULT_SETTINGS.conversation_settings_schema,\n conversation_settings: conversationSettings,\n };\n};\n\nexport const getSettingsQueryFn = async (\n scope: SettingsScope = \"personal\",\n): Promise<Settings> => {\n if (scope !== \"personal\") {\n throw new Error(`Unsupported settings scope: ${scope}`);\n }\n\n const settings = await SettingsService.getSettings();\n return normalizeSettingsResponse(settings);\n};\n\nexport const useSettings = (scope: SettingsScope = \"personal\") => {\n const active = useActiveBackend();\n const query = useQuery({\n // Include the active backend identity so switching backends or orgs\n // produces a fresh query — the `staleTime` cache for one backend\n // never serves another's data.\n queryKey: [\n ...SETTINGS_QUERY_KEYS.byScope(scope),\n active.backend.id,\n active.orgId,\n ],\n queryFn: () => getSettingsQueryFn(scope),\n retry: (_, error) => getErrorStatus(error) !== 404,\n refetchOnWindowFocus: false,\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 15,\n meta: {\n disableToast: true,\n },\n });\n\n if (getErrorStatus(query.error) === 404) {\n return {\n data: DEFAULT_SETTINGS,\n error: query.error,\n isError: query.isError,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n isFetched: query.isFetched,\n isSuccess: query.isSuccess,\n status: query.status,\n fetchStatus: query.fetchStatus,\n refetch: query.refetch,\n };\n }\n\n return query;\n};\n"],"mappings":";;;;;;;;;AAcA,IAAa,KAAkB,MAAuC;AACpE,KAAI,OAAO,KAAU,YAAY,KAAkB,YAAY,GAAO;EACpE,IAAM,EAAE,cAAW;AACnB,MAAI,OAAO,KAAW,SACpB,QAAO;;AAIX,KAAI,EAAM,aAAa,EAAM,CAC3B,QAAO,EAAM,UAAU;GAMrB,KAAgB,GAA8B,MAAyB;CAC3E,IAAM,IAAQ,EAAI,MAAM,IAAI,EACxB,IAAmB;AACvB,MAAK,IAAM,KAAQ,GAAO;AACxB,MAAuB,OAAO,KAAY,aAAtC,EAAgD;AACpD,MAAW,EAAoC;;AAEjD,QAAO;GAGH,KACJ,GACA,GACA,GACA,IAAa,OACF;CACX,IAAM,IAAQ,EAAa,GAAe,EAAI;AAI9C,QAHI,OAAO,KAAU,aAAa,EAAM,SAAS,KAAK,KAC7C,IAEF;GAGH,KAA6B,MAA0C;CAC3E,IAAM,IAAiB,EAAS,kBAAkB,EAAE,EAI9C,IAAuB;EAC3B,GAAI,EAAiB,yBAAyB,EAAE;EAChD,GAAK,EAAS,yBAAyB,EAAE;EAI1C;AAED,QAAO;EACL,GAAG;EACH,GAAG;EACH,WAAW,EACT,GACA,aACA,EAAiB,UAClB;EACD,cAAc,EACZ,GACA,gBACA,EAAiB,cACjB,GACD;EACD,OAAO,EAAiB,GAAe,SAAS,EAAiB,MAAM;EACvE,aAAa,EAAS,eAAe;EACrC,iBAAiB,EAAS,mBAAmB;EAC7C,mBACE,EAAiB,EAAqB,kBAAkB,IACxD,EAAiB;EACnB,mBACE,EAAmB,EAAqB,kBAAkB,IAC1D,EAAiB;EACnB,gBACE,EAAgB,EAAqB,eAAe,IACpD,EAAiB;EACnB,0BACE,EAAiB,EAAa,GAAe,oBAAoB,CAAC,IAClE,EAAiB;EACnB,oBACE,EAAgB,EAAa,GAAe,qBAAqB,CAAC,IAClE,EAAiB;EACnB,YAAY,EACV,EAAS,cACN,EAAc,WAClB;EACD,gBAAgB,EAAS,kBAAkB;EAC3C,OAAO,EAAS,SAAS;EACzB,eAAe,EAAS,iBAAiB,EAAiB;EAC1D,gBAAgB,EAAS,kBAAkB,EAAiB;EAC5D,aAAa;EACb,iBACE,EAAS,mBAAmB,EAAiB;EAC/C,uBAAuB,EAAS,yBAAyB;EACzD,gBAAgB,EAAS,kBAAkB,EAAiB;EAC5D,8BACE,EAAS,gCACT,EAAiB;EACnB,uBAAuB;EACxB;GAGU,IAAqB,OAChC,IAAuB,eACD;AACtB,KAAI,MAAU,WACZ,OAAU,MAAM,+BAA+B,IAAQ;AAIzD,QAAO,EAA0B,MADV,EAAgB,aAAa,CACV;GAG/B,KAAe,IAAuB,eAAe;CAChE,IAAM,IAAS,GAAkB,EAC3B,IAAQ,EAAS;EAIrB,UAAU;GACR,GAAG,EAAoB,QAAQ,EAAM;GACrC,EAAO,QAAQ;GACf,EAAO;GACR;EACD,eAAe,EAAmB,EAAM;EACxC,QAAQ,GAAG,MAAU,EAAe,EAAM,KAAK;EAC/C,sBAAsB;EACtB,WAAW,MAAO,KAAK;EACvB,QAAQ,MAAO,KAAK;EACpB,MAAM,EACJ,cAAc,IACf;EACF,CAAC;AAiBF,QAfI,EAAe,EAAM,MAAM,KAAK,MAC3B;EACL,MAAM;EACN,OAAO,EAAM;EACb,SAAS,EAAM;EACf,WAAW,EAAM;EACjB,YAAY,EAAM;EAClB,WAAW,EAAM;EACjB,WAAW,EAAM;EACjB,QAAQ,EAAM;EACd,aAAa,EAAM;EACnB,SAAS,EAAM;EAChB,GAGI"}
1
+ {"version":3,"file":"use-settings.js","names":[],"sources":["../../../src/hooks/query/use-settings.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { Settings, SettingsScope, SettingsValue } from \"#/types/settings\";\nimport SettingsService from \"#/api/settings-service/settings-service.api\";\nimport { isNoBackend } from \"#/api/backend-registry/active-store\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\nimport { SETTINGS_QUERY_KEYS } from \"#/hooks/query/query-keys\";\nimport {\n pickFirstBoolean,\n pickFirstNumber,\n pickNullableString,\n} from \"#/utils/settings-value-pickers\";\nimport { parseMcpConfig } from \"#/utils/mcp-config\";\n\nexport const getErrorStatus = (error: unknown): number | undefined => {\n if (typeof error === \"object\" && error !== null && \"status\" in error) {\n const { status } = error as { status?: unknown };\n if (typeof status === \"number\") {\n return status;\n }\n }\n\n if (axios.isAxiosError(error)) {\n return error.response?.status;\n }\n\n return undefined;\n};\n\nconst lookupNested = (obj: Record<string, unknown>, key: string): unknown => {\n const parts = key.split(\".\");\n let current: unknown = obj;\n for (const part of parts) {\n if (current == null || typeof current !== \"object\") return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n};\n\nconst resolveSdkString = (\n agentSettings: Record<string, unknown>,\n key: string,\n defaultValue: string,\n allowEmpty = false,\n): string => {\n const value = lookupNested(agentSettings, key);\n if (typeof value === \"string\" && (value.length > 0 || allowEmpty)) {\n return value;\n }\n return defaultValue;\n};\n\nconst normalizeSettingsResponse = (settings: Partial<Settings>): Settings => {\n const agentSettings = (settings.agent_settings ?? {}) as Record<\n string,\n unknown\n >;\n const conversationSettings = {\n ...(DEFAULT_SETTINGS.conversation_settings ?? {}),\n ...((settings.conversation_settings ?? {}) as Record<\n string,\n SettingsValue\n >),\n };\n\n return {\n ...DEFAULT_SETTINGS,\n ...settings,\n llm_model: resolveSdkString(\n agentSettings,\n \"llm.model\",\n DEFAULT_SETTINGS.llm_model,\n ),\n llm_base_url: resolveSdkString(\n agentSettings,\n \"llm.base_url\",\n DEFAULT_SETTINGS.llm_base_url,\n true,\n ),\n agent: resolveSdkString(agentSettings, \"agent\", DEFAULT_SETTINGS.agent),\n llm_api_key: settings.llm_api_key ?? null,\n llm_api_key_set: settings.llm_api_key_set ?? false,\n confirmation_mode:\n pickFirstBoolean(conversationSettings.confirmation_mode) ??\n DEFAULT_SETTINGS.confirmation_mode,\n security_analyzer:\n pickNullableString(conversationSettings.security_analyzer) ??\n DEFAULT_SETTINGS.security_analyzer,\n max_iterations:\n pickFirstNumber(conversationSettings.max_iterations) ??\n DEFAULT_SETTINGS.max_iterations,\n enable_default_condenser:\n pickFirstBoolean(lookupNested(agentSettings, \"condenser.enabled\")) ??\n DEFAULT_SETTINGS.enable_default_condenser,\n condenser_max_size:\n pickFirstNumber(lookupNested(agentSettings, \"condenser.max_size\")) ??\n DEFAULT_SETTINGS.condenser_max_size,\n mcp_config: parseMcpConfig(\n settings.mcp_config ??\n (agentSettings.mcp_config as typeof settings.mcp_config),\n ),\n search_api_key: settings.search_api_key || \"\",\n email: settings.email || \"\",\n git_user_name: settings.git_user_name || DEFAULT_SETTINGS.git_user_name,\n git_user_email: settings.git_user_email || DEFAULT_SETTINGS.git_user_email,\n is_new_user: false,\n disabled_skills:\n settings.disabled_skills ?? DEFAULT_SETTINGS.disabled_skills,\n agent_settings_schema: settings.agent_settings_schema ?? null,\n agent_settings: settings.agent_settings ?? DEFAULT_SETTINGS.agent_settings,\n conversation_settings_schema:\n settings.conversation_settings_schema ??\n DEFAULT_SETTINGS.conversation_settings_schema,\n conversation_settings: conversationSettings,\n };\n};\n\nexport const getSettingsQueryFn = async (\n scope: SettingsScope = \"personal\",\n): Promise<Settings> => {\n if (scope !== \"personal\") {\n throw new Error(`Unsupported settings scope: ${scope}`);\n }\n\n const settings = await SettingsService.getSettings();\n return normalizeSettingsResponse(settings);\n};\n\nexport const useSettings = (scope: SettingsScope = \"personal\") => {\n const active = useActiveBackend();\n const hasBackend = !isNoBackend(active.backend);\n const query = useQuery({\n // Include the active backend identity so switching backends or orgs\n // produces a fresh query — the `staleTime` cache for one backend\n // never serves another's data.\n queryKey: [\n ...SETTINGS_QUERY_KEYS.byScope(scope),\n active.backend.id,\n active.orgId,\n ],\n queryFn: () => getSettingsQueryFn(scope),\n retry: (_, error) => getErrorStatus(error) !== 404,\n enabled: hasBackend,\n refetchOnWindowFocus: false,\n staleTime: 1000 * 60 * 5,\n gcTime: 1000 * 60 * 15,\n meta: {\n disableToast: true,\n },\n });\n\n if (!hasBackend) {\n return {\n data: DEFAULT_SETTINGS,\n error: null,\n isError: false,\n isLoading: false,\n isFetching: false,\n isFetched: false,\n isSuccess: true,\n status: \"success\" as const,\n fetchStatus: \"idle\" as const,\n refetch: query.refetch,\n };\n }\n\n if (getErrorStatus(query.error) === 404) {\n return {\n data: DEFAULT_SETTINGS,\n error: query.error,\n isError: query.isError,\n isLoading: query.isLoading,\n isFetching: query.isFetching,\n isFetched: query.isFetched,\n isSuccess: query.isSuccess,\n status: query.status,\n fetchStatus: query.fetchStatus,\n refetch: query.refetch,\n };\n }\n\n return query;\n};\n"],"mappings":";;;;;;;;;;AAeA,IAAa,KAAkB,MAAuC;AACpE,KAAI,OAAO,KAAU,YAAY,KAAkB,YAAY,GAAO;EACpE,IAAM,EAAE,cAAW;AACnB,MAAI,OAAO,KAAW,SACpB,QAAO;;AAIX,KAAI,EAAM,aAAa,EAAM,CAC3B,QAAO,EAAM,UAAU;GAMrB,KAAgB,GAA8B,MAAyB;CAC3E,IAAM,IAAQ,EAAI,MAAM,IAAI,EACxB,IAAmB;AACvB,MAAK,IAAM,KAAQ,GAAO;AACxB,MAAuB,OAAO,KAAY,aAAtC,EAAgD;AACpD,MAAW,EAAoC;;AAEjD,QAAO;GAGH,KACJ,GACA,GACA,GACA,IAAa,OACF;CACX,IAAM,IAAQ,EAAa,GAAe,EAAI;AAI9C,QAHI,OAAO,KAAU,aAAa,EAAM,SAAS,KAAK,KAC7C,IAEF;GAGH,KAA6B,MAA0C;CAC3E,IAAM,IAAiB,EAAS,kBAAkB,EAAE,EAI9C,IAAuB;EAC3B,GAAI,EAAiB,yBAAyB,EAAE;EAChD,GAAK,EAAS,yBAAyB,EAAE;EAI1C;AAED,QAAO;EACL,GAAG;EACH,GAAG;EACH,WAAW,EACT,GACA,aACA,EAAiB,UAClB;EACD,cAAc,EACZ,GACA,gBACA,EAAiB,cACjB,GACD;EACD,OAAO,EAAiB,GAAe,SAAS,EAAiB,MAAM;EACvE,aAAa,EAAS,eAAe;EACrC,iBAAiB,EAAS,mBAAmB;EAC7C,mBACE,EAAiB,EAAqB,kBAAkB,IACxD,EAAiB;EACnB,mBACE,EAAmB,EAAqB,kBAAkB,IAC1D,EAAiB;EACnB,gBACE,EAAgB,EAAqB,eAAe,IACpD,EAAiB;EACnB,0BACE,EAAiB,EAAa,GAAe,oBAAoB,CAAC,IAClE,EAAiB;EACnB,oBACE,EAAgB,EAAa,GAAe,qBAAqB,CAAC,IAClE,EAAiB;EACnB,YAAY,EACV,EAAS,cACN,EAAc,WAClB;EACD,gBAAgB,EAAS,kBAAkB;EAC3C,OAAO,EAAS,SAAS;EACzB,eAAe,EAAS,iBAAiB,EAAiB;EAC1D,gBAAgB,EAAS,kBAAkB,EAAiB;EAC5D,aAAa;EACb,iBACE,EAAS,mBAAmB,EAAiB;EAC/C,uBAAuB,EAAS,yBAAyB;EACzD,gBAAgB,EAAS,kBAAkB,EAAiB;EAC5D,8BACE,EAAS,gCACT,EAAiB;EACnB,uBAAuB;EACxB;GAGU,IAAqB,OAChC,IAAuB,eACD;AACtB,KAAI,MAAU,WACZ,OAAU,MAAM,+BAA+B,IAAQ;AAIzD,QAAO,EAA0B,MADV,EAAgB,aAAa,CACV;GAG/B,KAAe,IAAuB,eAAe;CAChE,IAAM,IAAS,GAAkB,EAC3B,IAAa,CAAC,EAAY,EAAO,QAAQ,EACzC,IAAQ,EAAS;EAIrB,UAAU;GACR,GAAG,EAAoB,QAAQ,EAAM;GACrC,EAAO,QAAQ;GACf,EAAO;GACR;EACD,eAAe,EAAmB,EAAM;EACxC,QAAQ,GAAG,MAAU,EAAe,EAAM,KAAK;EAC/C,SAAS;EACT,sBAAsB;EACtB,WAAW,MAAO,KAAK;EACvB,QAAQ,MAAO,KAAK;EACpB,MAAM,EACJ,cAAc,IACf;EACF,CAAC;AAgCF,QA9BK,IAeD,EAAe,EAAM,MAAM,KAAK,MAC3B;EACL,MAAM;EACN,OAAO,EAAM;EACb,SAAS,EAAM;EACf,WAAW,EAAM;EACjB,YAAY,EAAM;EAClB,WAAW,EAAM;EACjB,WAAW,EAAM;EACjB,QAAQ,EAAM;EACd,aAAa,EAAM;EACnB,SAAS,EAAM;EAChB,GAGI,IA7BE;EACL,MAAM;EACN,OAAO;EACP,SAAS;EACT,WAAW;EACX,YAAY;EACZ,WAAW;EACX,WAAW;EACX,QAAQ;EACR,aAAa;EACb,SAAS,EAAM;EAChB"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../contexts/active-backend-context.cjs`),t=require(`../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs`),n=require(`../../api/conversation-service/agent-server-conversation-service.api.cjs`);var r=1e3*60*5,i=1e3*60*15,a=(a,o)=>{let s=e.useActiveBackend();return t.useQuery({queryKey:[`user`,`conversation`,a,s.backend.id,s.orgId],queryFn:async()=>a?(await n.default.batchGetAppConversations([a]))[0]??null:null,enabled:!!a&&!a.startsWith(`task-`),retry:!1,refetchInterval:o,staleTime:r,gcTime:i})};exports.useUserConversation=a;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../contexts/active-backend-context.cjs`),t=require(`../../node_modules/@tanstack/react-query/build/modern/useQuery.cjs`),n=require(`../../api/conversation-service/agent-server-conversation-service.api.cjs`);let r=require(`react`);var i=1e3*60*5,a=1e3*60*15,o=(o,s)=>{let c=e.useActiveBackend(),l=(0,r.useRef)({cid:o,backendId:c.backend.id});l.current.cid!==o&&(l.current={cid:o,backendId:c.backend.id});let u=l.current.backendId!==c.backend.id;return t.useQuery({queryKey:[`user`,`conversation`,o,c.backend.id,c.orgId],queryFn:async()=>o?(await n.default.batchGetAppConversations([o]))[0]??null:null,enabled:!!o&&!o.startsWith(`task-`)&&!u,retry:!1,refetchInterval:s,staleTime:i,gcTime:a})};exports.useUserConversation=o;
2
2
  //# sourceMappingURL=use-user-conversation.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-user-conversation.cjs","names":[],"sources":["../../../src/hooks/query/use-user-conversation.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Query, useQuery } from \"@tanstack/react-query\";\nimport { AxiosError } from \"axios\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { AppConversation } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\nconst FIVE_MINUTES = 1000 * 60 * 5;\nconst FIFTEEN_MINUTES = 1000 * 60 * 15;\n\ntype RefetchInterval = (\n query: Query<\n AppConversation | null,\n AxiosError<unknown, any>,\n AppConversation | null,\n (string | null)[]\n >,\n) => number;\n\nexport const useUserConversation = (\n cid: string | null,\n refetchInterval?: RefetchInterval,\n) => {\n const active = useActiveBackend();\n\n return useQuery({\n // Include the active backend identity so each (backend, org) pair\n // maintains its own per-conversation cache entry. Without this, a\n // local→cloud→local switch can leave a `null` cached value (from a\n // refetch that ran while the cloud backend was active) under the\n // shared cid key, which then makes the conversation route toast\n // \"conversation not available or no permission\" until the user\n // hard-refreshes the page. Mirrors `usePaginatedConversations`.\n queryKey: [\"user\", \"conversation\", cid, active.backend.id, active.orgId],\n queryFn: async () => {\n if (!cid) return null;\n\n // Use the V1 batch API endpoint to get a single conversation\n const results =\n await AgentServerConversationService.batchGetAppConversations([cid]);\n return results[0] ?? null;\n },\n enabled: !!cid && !cid.startsWith(\"task-\"),\n retry: false,\n refetchInterval,\n staleTime: FIVE_MINUTES,\n gcTime: FIFTEEN_MINUTES,\n });\n};\n"],"mappings":"mRAOA,IAAM,EAAe,IAAO,GAAK,EAC3B,EAAkB,IAAO,GAAK,GAWvB,GACX,EACA,IACG,CACH,IAAM,EAAS,EAAA,kBAAkB,CAEjC,OAAO,EAAA,SAAS,CAQd,SAAU,CAAC,OAAQ,eAAgB,EAAK,EAAO,QAAQ,GAAI,EAAO,MAAM,CACxE,QAAS,SACF,GAKE,MADC,EAAA,QAA+B,yBAAyB,CAAC,EAAI,CAAC,EACvD,IAAM,KALJ,KAOnB,QAAS,CAAC,CAAC,GAAO,CAAC,EAAI,WAAW,QAAQ,CAC1C,MAAO,GACP,kBACA,UAAW,EACX,OAAQ,EACT,CAAC"}
1
+ {"version":3,"file":"use-user-conversation.cjs","names":[],"sources":["../../../src/hooks/query/use-user-conversation.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useRef } from \"react\";\nimport { Query, useQuery } from \"@tanstack/react-query\";\nimport { AxiosError } from \"axios\";\nimport AgentServerConversationService from \"#/api/conversation-service/agent-server-conversation-service.api\";\nimport { AppConversation } from \"#/api/conversation-service/agent-server-conversation-service.types\";\nimport { useActiveBackend } from \"#/contexts/active-backend-context\";\n\nconst FIVE_MINUTES = 1000 * 60 * 5;\nconst FIFTEEN_MINUTES = 1000 * 60 * 15;\n\ntype RefetchInterval = (\n query: Query<\n AppConversation | null,\n AxiosError<unknown, any>,\n AppConversation | null,\n (string | null)[]\n >,\n) => number;\n\nexport const useUserConversation = (\n cid: string | null,\n refetchInterval?: RefetchInterval,\n) => {\n const active = useActiveBackend();\n\n // The cid belongs to whichever backend was active when the user opened this\n // conversation. If they switch to a *different* backend (e.g. cloud → local)\n // without leaving the conversation view, the cid is foreign to the new\n // backend; fetching it makes that backend parse a response for an id it\n // doesn't own and surfaces a confusing \"agent server returned data this UI\n // does not understand\" toast. Pin the cid to its origin backend and disable\n // the query until the route navigates to a valid id. Compare backend id\n // ONLY — org changes within the same backend (e.g. the cloud\n // personal-workspace self-heal in BackendSelector) keep the same\n // agent-server schema and must still refetch.\n const origin = useRef({ cid, backendId: active.backend.id });\n if (origin.current.cid !== cid) {\n origin.current = { cid, backendId: active.backend.id };\n }\n const backendChanged = origin.current.backendId !== active.backend.id;\n\n return useQuery({\n // Include the active backend identity so each (backend, org) pair\n // maintains its own per-conversation cache entry. Without this, a\n // local→cloud→local switch can leave a `null` cached value (from a\n // refetch that ran while the cloud backend was active) under the\n // shared cid key, which then makes the conversation route toast\n // \"conversation not available or no permission\" until the user\n // hard-refreshes the page. Mirrors `usePaginatedConversations`.\n queryKey: [\"user\", \"conversation\", cid, active.backend.id, active.orgId],\n queryFn: async () => {\n if (!cid) return null;\n\n // Use the V1 batch API endpoint to get a single conversation\n const results =\n await AgentServerConversationService.batchGetAppConversations([cid]);\n return results[0] ?? null;\n },\n enabled: !!cid && !cid.startsWith(\"task-\") && !backendChanged,\n retry: false,\n refetchInterval,\n staleTime: FIVE_MINUTES,\n gcTime: FIFTEEN_MINUTES,\n });\n};\n"],"mappings":"0SAQA,IAAM,EAAe,IAAO,GAAK,EAC3B,EAAkB,IAAO,GAAK,GAWvB,GACX,EACA,IACG,CACH,IAAM,EAAS,EAAA,kBAAkB,CAY3B,GAAA,EAAA,EAAA,QAAgB,CAAE,MAAK,UAAW,EAAO,QAAQ,GAAI,CAAC,CACxD,EAAO,QAAQ,MAAQ,IACzB,EAAO,QAAU,CAAE,MAAK,UAAW,EAAO,QAAQ,GAAI,EAExD,IAAM,EAAiB,EAAO,QAAQ,YAAc,EAAO,QAAQ,GAEnE,OAAO,EAAA,SAAS,CAQd,SAAU,CAAC,OAAQ,eAAgB,EAAK,EAAO,QAAQ,GAAI,EAAO,MAAM,CACxE,QAAS,SACF,GAKE,MADC,EAAA,QAA+B,yBAAyB,CAAC,EAAI,CAAC,EACvD,IAAM,KALJ,KAOnB,QAAS,CAAC,CAAC,GAAO,CAAC,EAAI,WAAW,QAAQ,EAAI,CAAC,EAC/C,MAAO,GACP,kBACA,UAAW,EACX,OAAQ,EACT,CAAC"}
@@ -1,26 +1,35 @@
1
1
  import { useActiveBackend as e } from "../../contexts/active-backend-context.js";
2
2
  import { useQuery as t } from "../../node_modules/@tanstack/react-query/build/modern/useQuery.js";
3
3
  import n from "../../api/conversation-service/agent-server-conversation-service.api.js";
4
+ import { useRef as r } from "react";
4
5
  //#region src/hooks/query/use-user-conversation.ts
5
- var r = 1e3 * 60 * 5, i = 1e3 * 60 * 15, a = (a, o) => {
6
- let s = e();
6
+ var i = 1e3 * 60 * 5, a = 1e3 * 60 * 15, o = (o, s) => {
7
+ let c = e(), l = r({
8
+ cid: o,
9
+ backendId: c.backend.id
10
+ });
11
+ l.current.cid !== o && (l.current = {
12
+ cid: o,
13
+ backendId: c.backend.id
14
+ });
15
+ let u = l.current.backendId !== c.backend.id;
7
16
  return t({
8
17
  queryKey: [
9
18
  "user",
10
19
  "conversation",
11
- a,
12
- s.backend.id,
13
- s.orgId
20
+ o,
21
+ c.backend.id,
22
+ c.orgId
14
23
  ],
15
- queryFn: async () => a ? (await n.batchGetAppConversations([a]))[0] ?? null : null,
16
- enabled: !!a && !a.startsWith("task-"),
24
+ queryFn: async () => o ? (await n.batchGetAppConversations([o]))[0] ?? null : null,
25
+ enabled: !!o && !o.startsWith("task-") && !u,
17
26
  retry: !1,
18
- refetchInterval: o,
19
- staleTime: r,
20
- gcTime: i
27
+ refetchInterval: s,
28
+ staleTime: i,
29
+ gcTime: a
21
30
  });
22
31
  };
23
32
  //#endregion
24
- export { a as useUserConversation };
33
+ export { o as useUserConversation };
25
34
 
26
35
  //# sourceMappingURL=use-user-conversation.js.map