@vellumai/web 0.10.10-dev.202607212031.507c9c7 → 0.10.10-staging.2

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 (348) hide show
  1. package/dist/assets/{BundleConfirmPage-DU7kUOob.js → BundleConfirmPage-DTwntn4X.js} +1 -1
  2. package/dist/assets/{a2a-invite-DkyOrzlM.js → a2a-invite-B-5DQeoe.js} +1 -1
  3. package/dist/assets/{about-page-XGv9RAQu.js → about-page-CTorC0We.js} +1 -1
  4. package/dist/assets/account-page-Cn_Ux2k8.js +1 -0
  5. package/dist/assets/{account-shell-z2p_MG9z.js → account-shell-CfWeuJs3.js} +1 -1
  6. package/dist/assets/acp-run-detail-panel-hdemc9Ns.js +5 -0
  7. package/dist/assets/{activity-steps-panel-XMrcrtav.js → activity-steps-panel-CJDoPVUC.js} +1 -1
  8. package/dist/assets/add-credits-modal-vjAb-rsd.js +1 -0
  9. package/dist/assets/ai-page-DX1CAGiX.js +1 -0
  10. package/dist/assets/animated-avatar-CyIeKE-s.js +1 -0
  11. package/dist/assets/{api-Ffg_vD9E.js → api-BBMl4mW3.js} +1 -1
  12. package/dist/assets/api-DjY6rho1.js +1 -0
  13. package/dist/assets/{api-errors-CoE1wFl2.js → api-errors-CDe82ZvY.js} +1 -1
  14. package/dist/assets/{api-key-screen-B0JDyMmi.js → api-key-screen-C0F9Kodk.js} +1 -1
  15. package/dist/assets/{app-info-Clwt3pCt.js → app-info-Dwct98Bb.js} +1 -1
  16. package/dist/assets/{archive-redirect-page-Dka89xFg.js → archive-redirect-page-E3vzn7Cc.js} +1 -1
  17. package/dist/assets/{assistant-feature-flag-store-aNAjw1qx.js → assistant-feature-flag-store-BpbbAIKZ.js} +1 -1
  18. package/dist/assets/assistant-identity-store-bwxIa6fM.js +1 -0
  19. package/dist/assets/{assistant-status-panel-D8GuCBBm.js → assistant-status-panel-DDvWvhN1.js} +1 -1
  20. package/dist/assets/auth-store-B6EXnaee.js +2 -0
  21. package/dist/assets/{background-task-detail-panel-CLVcDG_A.js → background-task-detail-panel-B3sQQ2WB.js} +1 -1
  22. package/dist/assets/billing-page-DbgQl5CS.js +3 -0
  23. package/dist/assets/bookmarks-page-Bg1kpqdy.js +1 -0
  24. package/dist/assets/browser-JyOUYdam.js +2 -0
  25. package/dist/assets/{build-state-C105yk9D.js → build-state-DR-w7k-Q.js} +1 -1
  26. package/dist/assets/calendar-D0labpMU.js +1 -0
  27. package/dist/assets/{capture-error-anSemq95.js → capture-error-BGD3-GQf.js} +1 -1
  28. package/dist/assets/{channels-page-route-D-ct9_bT.js → channels-page-route-Cm7KQpHs.js} +2 -2
  29. package/dist/assets/chat-CMHzEB4C.js +1 -0
  30. package/dist/assets/chat-markdown-message-D8WjuXJe.js +2 -0
  31. package/dist/assets/chevron-right-jRymmL7S.js +1 -0
  32. package/dist/assets/{client-feature-flag-store-D85jf9vW.js → client-feature-flag-store-DeUwlUsr.js} +1 -1
  33. package/dist/assets/{client-identity-B_r6IM_R.js → client-identity-jCzxcz5m.js} +1 -1
  34. package/dist/assets/{command-palette-B2m3a-Sy.js → command-palette-B23DDF8y.js} +1 -1
  35. package/dist/assets/{command-palette-window-page-Crl_XbSC.js → command-palette-window-page-2gnvF4NV.js} +1 -1
  36. package/dist/assets/community-page-De9KLKyn.js +1 -0
  37. package/dist/assets/{confirm-dialog-Zyfei9GV.js → confirm-dialog-CCrDkChx.js} +1 -1
  38. package/dist/assets/{connect-page-DZAWq2yF.js → connect-page-B_dNamaq.js} +1 -1
  39. package/dist/assets/consent-DAnl-k-J.js +1 -0
  40. package/dist/assets/{consent-controls-DS7GjOzc.js → consent-controls-CiU4EkLm.js} +1 -1
  41. package/dist/assets/{contacts-gateway-C1Oif2mf.js → contacts-gateway-EIOxMIFC.js} +1 -1
  42. package/dist/assets/contacts-page-route-CZwZ6baw.js +1 -0
  43. package/dist/assets/{conversation-list-fetchers-DKtnmlFF.js → conversation-list-fetchers-BOrVAREL.js} +1 -1
  44. package/dist/assets/{conversation-store-Ogn1aavZ.js → conversation-store-DBm_wIJg.js} +1 -1
  45. package/dist/assets/{credential-entry-page-Bo9MyWJX.js → credential-entry-page-_NrjRBZ2.js} +1 -1
  46. package/dist/assets/credentials-page-st-zOas5.js +1 -0
  47. package/dist/assets/credit-card-CpZ4FEYf.js +1 -0
  48. package/dist/assets/{danger-zone-redirect-page-DkKFJJZq.js → danger-zone-redirect-page-xzib25RG.js} +1 -1
  49. package/dist/assets/debug-page-BhcVrLKj.js +4 -0
  50. package/dist/assets/{deploy-dialogs-DZNZ-Fds.js → deploy-dialogs-BJRrRbSc.js} +1 -1
  51. package/dist/assets/{detail-card-CIh4dCKt.js → detail-card-CA8lPa5K.js} +1 -1
  52. package/dist/assets/{detail-panel-stop-button-CQiRg22Y.js → detail-panel-stop-button-c0oweWwM.js} +1 -1
  53. package/dist/assets/developer-page-DRakR84C.js +1 -0
  54. package/dist/assets/{devices-redirect-page-Blvhzm6X.js → devices-redirect-page-DpaYzLMA.js} +1 -1
  55. package/dist/assets/{diagnostics-gOI79YBb.js → diagnostics-CNSs2GQW.js} +1 -1
  56. package/dist/assets/{dictation-overlay-page-zBczDZ__.js → dictation-overlay-page-jXIAQQGI.js} +1 -1
  57. package/dist/assets/document-viewer-page-B6lpLvJw.js +1 -0
  58. package/dist/assets/{edge-swipe-arbiter-store-a9LiewmS.js → edge-swipe-arbiter-store-urfzS6HH.js} +1 -1
  59. package/dist/assets/emails-page-ChYRO5ST.js +1 -0
  60. package/dist/assets/{environment-store-R_3zZFKL.js → environment-store-D_Bc9wnl.js} +1 -1
  61. package/dist/assets/esm-B1YHbxjr.js +2 -0
  62. package/dist/assets/esm-BVtejx8-.js +2 -0
  63. package/dist/assets/esm-Cag4B91R.js +2 -0
  64. package/dist/assets/esm-DlbLA_5U.js +2 -0
  65. package/dist/assets/esm-Drxb0ny0.js +1 -0
  66. package/dist/assets/{esm-Da6ZHZYd.js → esm-DvjYgAFs.js} +2 -2
  67. package/dist/assets/esm-eTfO3z5C.js +2 -0
  68. package/dist/assets/feature-flag-catalog-C-DtLj8f.js +1 -0
  69. package/dist/assets/{file-editor-CmUOlTjl.js → file-editor-kHnQQ-I8.js} +1 -1
  70. package/dist/assets/{file-markdown-BXDlM5ry.js → file-markdown-DZhQRECx.js} +1 -1
  71. package/dist/assets/general-page-0F5njKZW.js +1 -0
  72. package/dist/assets/{haptics-izy3LPi2.js → haptics-D5SxnqtJ.js} +2 -2
  73. package/dist/assets/hatching-screen-CW3BRgRH.js +1 -0
  74. package/dist/assets/home-page-route-D_8JCZ_Q.js +1 -0
  75. package/dist/assets/{hosting-screen-BPGPT-Wc.js → hosting-screen-DHETBcAy.js} +1 -1
  76. package/dist/assets/identity-page-route-B1o8eOMl.js +7 -0
  77. package/dist/assets/index-CmaRQR9x.js +211 -0
  78. package/dist/assets/index-yF00bLYk.css +2 -0
  79. package/dist/assets/{ingest-EqEPbLa8.js → ingest-DbnjKjOF.js} +1 -1
  80. package/dist/assets/{inspect-page-BbvNLVkU.js → inspect-page-Cj0WVion.js} +6 -6
  81. package/dist/assets/integrations-page-CH-pFd_e.js +1 -0
  82. package/dist/assets/intelligence-layout-BHGZqgWE.js +1 -0
  83. package/dist/assets/{keyboard-shortcuts-redirect-page-DkS3PElo.js → keyboard-shortcuts-redirect-page-CSeKG-5e.js} +1 -1
  84. package/dist/assets/{latest-assistant-text-BKts4hYK.js → latest-assistant-text-DqYv-19M.js} +2 -2
  85. package/dist/assets/{library-detail-page-CXMARF0c.js → library-detail-page-D1SaX446.js} +1 -1
  86. package/dist/assets/{library-page-DKtFJjad.js → library-page-CY_UIQ7K.js} +1 -1
  87. package/dist/assets/list-row-9xgQystQ.js +1 -0
  88. package/dist/assets/local-mode-hyYI6_OH.js +39 -0
  89. package/dist/assets/{login-flow-Be8Yd2Np.js → login-flow-CsH-88pb.js} +1 -1
  90. package/dist/assets/{login-page-BLDZPYtj.js → login-page-DxxrePFg.js} +1 -1
  91. package/dist/assets/{logout-page-BGrm-u0K.js → logout-page-BsVCSXLH.js} +1 -1
  92. package/dist/assets/{logs-layout-DXfqBQv8.js → logs-layout-D_7jq15m.js} +1 -1
  93. package/dist/assets/memory-page-route-BGWq_aq8.js +1 -0
  94. package/dist/assets/{memory-router-playground-page-D4bdx3nG.js → memory-router-playground-page-DThWyhXE.js} +1 -1
  95. package/dist/assets/menu-DpEE6Pur.js +1 -0
  96. package/dist/assets/messages-obj2ULvb.js +13 -0
  97. package/dist/assets/{metric-card-Cywp_yEB.js → metric-card-BvFbnMl1.js} +1 -1
  98. package/dist/assets/middleware-DL-IveDQ.js +1 -0
  99. package/dist/assets/{mobile-sidebar-drawer-OMbJXqbY.js → mobile-sidebar-drawer-XsUj_ej1.js} +1 -1
  100. package/dist/assets/mutation-error-CbcKvssD.js +1 -0
  101. package/dist/assets/{native-biometric-Bp5eYpXj.js → native-biometric-gWkPFBiw.js} +1 -1
  102. package/dist/assets/{native-file-B7iGLcmU.js → native-file-CgfJr8IE.js} +2 -2
  103. package/dist/assets/{notice-DkAWz47A.js → notice-BylgS5W_.js} +1 -1
  104. package/dist/assets/notifications-page-4H3d3TVi.js +1 -0
  105. package/dist/assets/{oauth-complete-page-DGr3HAC-.js → oauth-complete-page-IYjT22S6.js} +1 -1
  106. package/dist/assets/{oauth-popup-complete-page-DYjInJjq.js → oauth-popup-complete-page-B2tgdOeo.js} +1 -1
  107. package/dist/assets/{onboarding-store-Bxw_JVDh.js → onboarding-store-DZ2FrhW-.js} +1 -1
  108. package/dist/assets/{page-empty-state-C7YVloua.js → page-empty-state-DbCk3v6f.js} +1 -1
  109. package/dist/assets/{page-shell-DA4GGC-p.js → page-shell-DeTaZ_s4.js} +1 -1
  110. package/dist/assets/{pairing-page-CWDkzHe0.js → pairing-page-BsGxP4RT.js} +1 -1
  111. package/dist/assets/panel-item-Bvqsr5n9.js +1 -0
  112. package/dist/assets/{password-reset-page-DLAZBfaV.js → password-reset-page-DNE8HK7m.js} +1 -1
  113. package/dist/assets/{personality-page-Dzc-7lci.js → personality-page-DWuNCYhT.js} +1 -1
  114. package/dist/assets/{platform-detection-BnBFKFxp.js → platform-detection-1awANa55.js} +1 -1
  115. package/dist/assets/{platform-loopback-page-5IJ6JUae.js → platform-loopback-page-Dpa25N6y.js} +1 -1
  116. package/dist/assets/plugin-detail-page-evKImXPP.js +1 -0
  117. package/dist/assets/plugins-page-O4J9g6Y8.js +1 -0
  118. package/dist/assets/plugins-surface-Db6GSyl4.js +1 -0
  119. package/dist/assets/prechat-P1y7ZM6C.js +1 -0
  120. package/dist/assets/prechat-names-clVy5Mee.js +1 -0
  121. package/dist/assets/prechat-route-CoHHHLoD.js +1 -0
  122. package/dist/assets/{prefs-Od3axSSC.js → prefs-wApndUEh.js} +1 -1
  123. package/dist/assets/privacy-page-DXHDyrXM.js +1 -0
  124. package/dist/assets/privacy-screen-N6-nGjeG.js +1 -0
  125. package/dist/assets/{provider-callback-page-CPIC6kPa.js → provider-callback-page-B6zqXdPZ.js} +1 -1
  126. package/dist/assets/{provider-key-ACM9xzKs.js → provider-key-BGsg7FL-.js} +1 -1
  127. package/dist/assets/{provider-signup-page-CkBp8n69.js → provider-signup-page-s0iG7WXI.js} +1 -1
  128. package/dist/assets/{quick-input-page-C4hGGA-G.js → quick-input-page-UeFQo32q.js} +1 -1
  129. package/dist/assets/react-query.gen-BQH0QRfT.js +1 -0
  130. package/dist/assets/react-query.gen-BXPoln4i.js +1 -0
  131. package/dist/assets/{remote-gateway-session-D-udmSfx.js → remote-gateway-session-CuTuWPx8.js} +1 -1
  132. package/dist/assets/{research-mock-page-DHo_s9B9.js → research-mock-page-DL9B4Lli.js} +1 -1
  133. package/dist/assets/{research-onboarding-persistence-C4LT0Ekr.js → research-onboarding-persistence-BLNrBZSe.js} +1 -1
  134. package/dist/assets/research-onboarding-route-CEPszqjJ.js +42 -0
  135. package/dist/assets/resize-errors-B4T7-3eS.js +1 -0
  136. package/dist/assets/{resolved-assistants-store-DdHm-7v4.js → resolved-assistants-store-DdnJoLGS.js} +1 -1
  137. package/dist/assets/{return-to-ugSGJ0dm.js → return-to-BVIOUdUp.js} +1 -1
  138. package/dist/assets/{review-terms-screen-DMPoD9JF.js → review-terms-screen-CchSUndG.js} +1 -1
  139. package/dist/assets/risk-BNYYQUrq.js +3 -0
  140. package/dist/assets/routes-XPLb07Av.js +1 -0
  141. package/dist/assets/{schedules-CqDlgP0M.js → schedules-Baaz8ToC.js} +1 -1
  142. package/dist/assets/schedules-page-Bj5HEJa-.js +1 -0
  143. package/dist/assets/{sdk.gen-B3ej_AZQ.js → sdk.gen-BJsTUGAk.js} +1 -1
  144. package/dist/assets/sdk.gen-D_Qurj4O.js +6 -0
  145. package/dist/assets/{security-redirect-page-VGVQozWv.js → security-redirect-page-lq2zT9X9.js} +1 -1
  146. package/dist/assets/select-assistant-screen-BQLQKCB5.js +1 -0
  147. package/dist/assets/{settings-divider-qjjA_SZa.js → settings-divider-Dk_uJxp_.js} +1 -1
  148. package/dist/assets/settings-layout-Dr3LiWJ0.js +1 -0
  149. package/dist/assets/share-feedback-modal-DvC-1HRQ.js +1 -0
  150. package/dist/assets/sidebar-tree-r9N8LP3u.js +1 -0
  151. package/dist/assets/{signup-page-m1EWLqjx.js → signup-page-B7lZHfHL.js} +1 -1
  152. package/dist/assets/site-favicon-B6zQaqfA.js +1 -0
  153. package/dist/assets/skill-detail-page-onU_WAHM.js +1 -0
  154. package/dist/assets/{skill-detail-panel-Cvxl5kZJ.js → skill-detail-panel-r5S_O0rZ.js} +1 -1
  155. package/dist/assets/{skills-DjpiZVhL.js → skills-DJft07cl.js} +1 -1
  156. package/dist/assets/skills-page-Cf86q643.js +1 -0
  157. package/dist/assets/{sounds-redirect-page-UZ0xMhrn.js → sounds-redirect-page-CBcnSoVu.js} +1 -1
  158. package/dist/assets/{src-CheJrlfT.js → src-CDdn26Yb.js} +2 -2
  159. package/dist/assets/{start-screen-B0RFE_x_.js → start-screen-kBX69v2m.js} +1 -1
  160. package/dist/assets/step-indicator-dots-D03TmFKG.js +1 -0
  161. package/dist/assets/subagent-detail-panel-D6oy2K_C.js +4 -0
  162. package/dist/assets/{subagent-store-B2CYmCAg.js → subagent-store-D0ALjG5_.js} +2 -2
  163. package/dist/assets/system-events-page-CXkh6imt.js +1 -0
  164. package/dist/assets/{system-events-redirect-page-I9g5qfGv.js → system-events-redirect-page-ZFijxK36.js} +1 -1
  165. package/dist/assets/{theme-stage-page-BQOitBUz.js → theme-stage-page-B1KCcRzM.js} +1 -1
  166. package/dist/assets/{tiptap-document-editor-DH-dfQtq.js → tiptap-document-editor-BVFwGbyO.js} +1 -1
  167. package/dist/assets/{toast-Be8FEQ-I.js → toast-ZoZVyeDI.js} +1 -1
  168. package/dist/assets/{tool-detail-panel-BkuoehPQ.js → tool-detail-panel-CI8Z5mU5.js} +1 -1
  169. package/dist/assets/typed-storage-CpCv7yDp.js +1 -0
  170. package/dist/assets/upgrade-cancel-page-78mnz39g.js +1 -0
  171. package/dist/assets/upgrade-success-page-Dnqc4oxD.js +1 -0
  172. package/dist/assets/{usage-redirect-page-D9S66xjY.js → usage-redirect-page-Bs2mzWyk.js} +1 -1
  173. package/dist/assets/{use-active-assistant-id-DwLFgABu.js → use-active-assistant-id-9rGx8kT9.js} +1 -1
  174. package/dist/assets/{use-assistant-identity-details-CP-JLE6a.js → use-assistant-identity-details-D0dDGwFZ.js} +1 -1
  175. package/dist/assets/{use-edge-swipe-back-CkuHZUtG.js → use-edge-swipe-back-CzIG6Agy.js} +1 -1
  176. package/dist/assets/{use-invite-link-dialog-BhtQXdeV.js → use-invite-link-dialog-BLqplXYp.js} +1 -1
  177. package/dist/assets/use-is-org-ready-ChwxZgjQ.js +1 -0
  178. package/dist/assets/{use-onboarding-login-C1KIbOZ7.js → use-onboarding-login-D6BGXpJ1.js} +1 -1
  179. package/dist/assets/use-skill-actions-B58D56j9.js +1 -0
  180. package/dist/assets/use-skill-categories-BewT8dcB.js +1 -0
  181. package/dist/assets/{use-skill-detail-files-DSICOfHG.js → use-skill-detail-files-S961Kf-o.js} +1 -1
  182. package/dist/assets/{utils-DvUW9GK8.js → utils-ilzygKkt.js} +1 -1
  183. package/dist/assets/{viewer-store-CA46JenB.js → viewer-store-ClQ_c5qv.js} +1 -1
  184. package/dist/assets/voice-page-IaJC48fm.js +1 -0
  185. package/dist/assets/{weather-forecast-display-DTHDpQIQ.js → weather-forecast-display-Cd2sZBmz.js} +1 -1
  186. package/dist/assets/{web-D_z4FjB0.js → web-BJvOJyLN.js} +1 -1
  187. package/dist/assets/{web-DT7Uml3n.js → web-CrrIg0Pn.js} +1 -1
  188. package/dist/assets/{web-D5EBYCt2.js → web-Cx4jtwLB.js} +1 -1
  189. package/dist/assets/{web-BgxqKmFT.js → web-CyWG_cm-.js} +1 -1
  190. package/dist/assets/{web-Cfu1-OYV.js → web-DoNLEdOt.js} +1 -1
  191. package/dist/assets/{web-TTULY5zV.js → web-DqOpt9dV.js} +1 -1
  192. package/dist/assets/{web-CpMgd0X0.js → web-DxGQp5dQ.js} +1 -1
  193. package/dist/assets/{web-F3CAps0-.js → web-qzBk16t5.js} +1 -1
  194. package/dist/assets/{welcome-screen-DwF95AMi.js → welcome-screen-CUTRt2OQ.js} +1 -1
  195. package/dist/assets/workflow-detail-panel-BRYRq60N.js +1 -0
  196. package/dist/assets/workspace-page-DgDej6f2.js +1 -0
  197. package/dist/index.html +114 -113
  198. package/package.json +1 -1
  199. package/dist/assets/account-page-CjDUoE8J.js +0 -1
  200. package/dist/assets/acp-run-detail-panel-C4czMS5N.js +0 -5
  201. package/dist/assets/add-credits-modal-XWWiBymX.js +0 -1
  202. package/dist/assets/ai-page-Dq8UmQrO.js +0 -1
  203. package/dist/assets/api-4X-X5R5M.js +0 -1
  204. package/dist/assets/assistant-identity-store-CgJwLRMd.js +0 -1
  205. package/dist/assets/auth-store-CbvnWDS-.js +0 -2
  206. package/dist/assets/billing-page-CJiWGKY6.js +0 -3
  207. package/dist/assets/billing-redirect-page-DDDmce7t.js +0 -1
  208. package/dist/assets/bookmarks-page-BOkjjLXt.js +0 -1
  209. package/dist/assets/browser-WF64N2wk.js +0 -2
  210. package/dist/assets/chart-column-L6Nldm8M.js +0 -1
  211. package/dist/assets/chat-BDhsGoUo.js +0 -1
  212. package/dist/assets/chat-markdown-message-CRwi1qsk.js +0 -2
  213. package/dist/assets/community-page-uTu1r1CU.js +0 -1
  214. package/dist/assets/consent-C8XzlZzW.js +0 -1
  215. package/dist/assets/contacts-page-route-CVHp4lq_.js +0 -1
  216. package/dist/assets/credentials-page-PAFOfej8.js +0 -1
  217. package/dist/assets/debug-page-DSsEDM7M.js +0 -4
  218. package/dist/assets/developer-page-ChB-02zQ.js +0 -1
  219. package/dist/assets/document-viewer-page-3IdqLUGN.js +0 -1
  220. package/dist/assets/emails-page-Fhjpz1NN.js +0 -1
  221. package/dist/assets/esm-BGZHdoYP.js +0 -2
  222. package/dist/assets/esm-BNfE-1QY.js +0 -1
  223. package/dist/assets/esm-CZhfXk6a.js +0 -2
  224. package/dist/assets/esm-DcTPJLRl.js +0 -2
  225. package/dist/assets/esm-LOX7qY3n.js +0 -2
  226. package/dist/assets/esm-hFTNI1fw.js +0 -2
  227. package/dist/assets/feature-flag-catalog-DpiUkDzU.js +0 -1
  228. package/dist/assets/general-page-5EV0etsj.js +0 -1
  229. package/dist/assets/get-memory-stats-DxsKb4lR.js +0 -1
  230. package/dist/assets/hatching-screen-7X3jYORD.js +0 -1
  231. package/dist/assets/home-page-route-DnTVbd65.js +0 -1
  232. package/dist/assets/identity-page-route-yRmR8R76.js +0 -7
  233. package/dist/assets/index-B92kvb9E.css +0 -2
  234. package/dist/assets/index-_0CSPD03.js +0 -217
  235. package/dist/assets/integrations-page-Da1u4lMO.js +0 -1
  236. package/dist/assets/intelligence-layout-DJCOjNrp.js +0 -1
  237. package/dist/assets/link-click-Cw5JZikw.js +0 -1
  238. package/dist/assets/list-row-CFyYr-FU.js +0 -1
  239. package/dist/assets/local-mode-Dydd46cS.js +0 -39
  240. package/dist/assets/machine-sizes-bagopaDl.js +0 -1
  241. package/dist/assets/memory-page-route-Bu6AgFF0.js +0 -2
  242. package/dist/assets/menu-C9SOvGlk.js +0 -1
  243. package/dist/assets/messages-4fYDxCnR.js +0 -13
  244. package/dist/assets/mutation-error-C9sr8Rue.js +0 -1
  245. package/dist/assets/notifications-page-BEAKFPRw.js +0 -1
  246. package/dist/assets/panel-item-An-BBeyL.js +0 -1
  247. package/dist/assets/plan-tier-meta-B3VW0CHM.js +0 -1
  248. package/dist/assets/plans-page-Bb70XhQe.js +0 -1
  249. package/dist/assets/plugin-attribution-6W3_ulYk.js +0 -1
  250. package/dist/assets/plugin-detail-page-D6Q_163j.js +0 -1
  251. package/dist/assets/plugins-page-DBVtY5EN.js +0 -1
  252. package/dist/assets/prechat-mDxOfWth.js +0 -1
  253. package/dist/assets/privacy-page-D1Dhps8d.js +0 -1
  254. package/dist/assets/privacy-screen-D0gupqwS.js +0 -1
  255. package/dist/assets/provider-catalogs-BKJqQ5tB.js +0 -1
  256. package/dist/assets/react-query.gen-DfzfX_Jv.js +0 -1
  257. package/dist/assets/research-onboarding-route-CqYRsZpN.js +0 -43
  258. package/dist/assets/resize-errors-NWH12qGQ.js +0 -1
  259. package/dist/assets/risk-CazgXmiu.js +0 -3
  260. package/dist/assets/routes-Cwb-U9H-.js +0 -1
  261. package/dist/assets/schedules-page-5cmeyClc.js +0 -1
  262. package/dist/assets/sdk.gen-BR-xXIZm.js +0 -6
  263. package/dist/assets/select-assistant-screen-Bp2lxhDH.js +0 -1
  264. package/dist/assets/settings-layout-BHa6BoJV.js +0 -1
  265. package/dist/assets/settings-wSv59mkN.js +0 -1
  266. package/dist/assets/share-feedback-modal-BXHzODAr.js +0 -1
  267. package/dist/assets/sidebar-tree--4fegN56.js +0 -1
  268. package/dist/assets/site-favicon-B_dwuYIn.js +0 -1
  269. package/dist/assets/skill-detail-page-E_O17Mce.js +0 -1
  270. package/dist/assets/skills-page-zxdj8FFy.js +0 -1
  271. package/dist/assets/sliders-horizontal-MqeLCMh3.js +0 -1
  272. package/dist/assets/subagent-detail-panel-BF2Q_SQY.js +0 -4
  273. package/dist/assets/superpowers-page-DXIv9iIP.js +0 -1
  274. package/dist/assets/system-events-page-CLeRj1th.js +0 -1
  275. package/dist/assets/typed-storage-Cphlhvyu.js +0 -1
  276. package/dist/assets/upgrade-cancel-page-BsqFc1Qr.js +0 -1
  277. package/dist/assets/upgrade-success-page-CYEp8B2T.js +0 -1
  278. package/dist/assets/use-bus-subscription-PbK6Fx9c.js +0 -1
  279. package/dist/assets/use-is-org-ready-BliPCA1A.js +0 -1
  280. package/dist/assets/use-skill-actions-CyzeSrSJ.js +0 -1
  281. package/dist/assets/users--1gWeHEq.js +0 -1
  282. package/dist/assets/voice-page-DnEwe-Mc.js +0 -1
  283. package/dist/assets/workflow-detail-panel-DwmOqRro.js +0 -1
  284. package/dist/assets/workspace-page-Dx1jE1x5.js +0 -1
  285. /package/dist/assets/{app-types-XM5qKBD0.js → app-types-CR9QB0-8.js} +0 -0
  286. /package/dist/assets/{avatar-bundled-components-ELDcio1Z.js → avatar-bundled-components--1Wyhs4r.js} +0 -0
  287. /package/dist/assets/{avatar-svg-compositor-D7Dy9s1k.js → avatar-svg-compositor-CnDf9Ibf.js} +0 -0
  288. /package/dist/assets/{ban-Bvfp1f1I.js → ban-Ih5bAOHZ.js} +0 -0
  289. /package/dist/assets/{bell-V9BYKY__.js → bell-BbESwsZk.js} +0 -0
  290. /package/dist/assets/{bookmark-CjHh36q4.js → bookmark-Dzconbsv.js} +0 -0
  291. /package/dist/assets/{brain-Ci5ws6Wl.js → brain-CMiHVWFK.js} +0 -0
  292. /package/dist/assets/{bug-BMI_6ziD.js → bug-YmXTm_XW.js} +0 -0
  293. /package/dist/assets/{build.umd-CW7LiBLq.js → build.umd-DE_kTHxO.js} +0 -0
  294. /package/dist/assets/{checkbox-1DytZ46G.js → checkbox-B2rdLpjz.js} +0 -0
  295. /package/dist/assets/{client.gen-DVfIRXUZ.js → client.gen-DZZugzSk.js} +0 -0
  296. /package/dist/assets/{cpu-DuPtXZt_.js → cpu-1TmG9m0R.js} +0 -0
  297. /package/dist/assets/{create-selectors-8NePGNlX.js → create-selectors-tFGOU7xo.js} +0 -0
  298. /package/dist/assets/{definitions-BUCExH-9.js → definitions-CZmL_0H7.js} +0 -0
  299. /package/dist/assets/{definitions-DpZNNWA7.js → definitions-DW2pQQOo.js} +0 -0
  300. /package/dist/assets/{dist-DyRKd0bN2.js → dist-CGPrc2vu2.js} +0 -0
  301. /package/dist/assets/{domains-CIIVdIa8.js → domains-CoWIwFeg.js} +0 -0
  302. /package/dist/assets/{download-B6XjnEzx.js → download-CXYjvgB3.js} +0 -0
  303. /package/dist/assets/{dropdown-BxYrCXBS.js → dropdown-BMNSccmo.js} +0 -0
  304. /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-Do3FUA8t.js} +0 -0
  305. /package/dist/assets/{event-bus-BNx4a0Ds.js → event-bus-BG8U4Mul.js} +0 -0
  306. /package/dist/assets/{external-link-Cczz6xJ4.js → external-link-5a-JuPGf.js} +0 -0
  307. /package/dist/assets/{eye-C2rSrbD-.js → eye-Cvo8rdU0.js} +0 -0
  308. /package/dist/assets/{eye-off-BQ9J3pF2.js → eye-off-BgOJcVXo.js} +0 -0
  309. /package/dist/assets/{file-C8pjlmtk.js → file-D1SmEL-K.js} +0 -0
  310. /package/dist/assets/{file-text-DA128T4K.js → file-text-E5adVLLN.js} +0 -0
  311. /package/dist/assets/{folder-open-7DKBH5WB.js → folder-open-9vQalGTM.js} +0 -0
  312. /package/dist/assets/{format-file-size-B9DWgk-8.js → format-file-size-Dy3zTYKi.js} +0 -0
  313. /package/dist/assets/{globe-DgKSh933.js → globe-Dx8dM0gj.js} +0 -0
  314. /package/dist/assets/{hard-drive-DVmyHlZR.js → hard-drive-BxDRcYId.js} +0 -0
  315. /package/dist/assets/{impersonate-version-flag-DRJTfKcP.js → impersonate-version-flag-CjFVQtQC.js} +0 -0
  316. /package/dist/assets/{info-CqgkBvyS.js → info-DPHR_AMJ.js} +0 -0
  317. /package/dist/assets/{is-electron-y5bNUVyG.js → is-electron-DBOtwp5h.js} +0 -0
  318. /package/dist/assets/{key-round-CN4UKztQ.js → key-round-DY4dz3U6.js} +0 -0
  319. /package/dist/assets/{link-2-B9c5ZsFq.js → link-2-BASJHEX6.js} +0 -0
  320. /package/dist/assets/{loader-circle-Ck8fq3yv.js → loader-circle-D57RZgLH.js} +0 -0
  321. /package/dist/assets/{log-in-khREn0DP.js → log-in-DWnaKiOt.js} +0 -0
  322. /package/dist/assets/{mic-DEmgi4rh.js → mic-DdZ0A0iw.js} +0 -0
  323. /package/dist/assets/{minimize-2-dsDfFPkN.js → minimize-2-DM7ejF4M.js} +0 -0
  324. /package/dist/assets/{misc-D0u5tzSd.js → misc-Dz1odwkI.js} +0 -0
  325. /package/dist/assets/{monitor-BFX2ySFb.js → monitor-DTDBOcSy.js} +0 -0
  326. /package/dist/assets/{moon-h3xmz34k.js → moon-Ci1LuSVx.js} +0 -0
  327. /package/dist/assets/{native-deep-link-CbHUZ2h_.js → native-deep-link-B9BuDLg1.js} +0 -0
  328. /package/dist/assets/{pdf-BFBTGjwO.js → pdf-0k9eWpTI.js} +0 -0
  329. /package/dist/assets/{pencil-CsnkG5VN.js → pencil-DEevs4oD.js} +0 -0
  330. /package/dist/assets/{plus-DZZypDUF.js → plus-CQiIB1qS.js} +0 -0
  331. /package/dist/assets/{pointer-DcD0Nt7Z.js → pointer-Cdz7NGHe.js} +0 -0
  332. /package/dist/assets/{profile-metadata-CMym5q9r.js → profile-metadata-DZwV-VFB.js} +0 -0
  333. /package/dist/assets/{puzzle-C894zd87.js → puzzle-CL8CuOcC.js} +0 -0
  334. /package/dist/assets/{refresh-cw-cau3ebz1.js → refresh-cw-CMEIZvPt.js} +0 -0
  335. /package/dist/assets/{repeat-BhXOPeQU.js → repeat-CS_kgMdk.js} +0 -0
  336. /package/dist/assets/{semver-DIkpaM51.js → semver-CRR7tMUr.js} +0 -0
  337. /package/dist/assets/{setting-row-BL-mNsNh.js → setting-row-BoJnQfzh.js} +0 -0
  338. /package/dist/assets/{shield-check-C3mmA0Pk.js → shield-check-BOKWBJve.js} +0 -0
  339. /package/dist/assets/{signup-shell-C--ZjbjA.js → signup-shell-B1qn4Jpy.js} +0 -0
  340. /package/dist/assets/{sparkles-BK3KXCjl.js → sparkles-DDIsk_nZ.js} +0 -0
  341. /package/dist/assets/{status-badge-pill-0N6rTEBg.js → status-badge-pill-j3ke1d9o.js} +0 -0
  342. /package/dist/assets/{theme-preferences-D58K1K0j.js → theme-preferences-DXNlsaIE.js} +0 -0
  343. /package/dist/assets/{three-dot-indicator-DNuHHwtA.js → three-dot-indicator-CwchtNVS.js} +0 -0
  344. /package/dist/assets/{triangle-alert-CnjNKhNx.js → triangle-alert-DXEpFOj_.js} +0 -0
  345. /package/dist/assets/{use-copy-to-clipboard-BCTXSMa-.js → use-copy-to-clipboard-D3nUm_6n.js} +0 -0
  346. /package/dist/assets/{user-plus-KuzSTM_D.js → user-plus-Jr3b-fDv.js} +0 -0
  347. /package/dist/assets/{xterm-BSc05cUt.js → xterm-BESsuCOb.js} +0 -0
  348. /package/dist/assets/{xterm-addon-fit-CW_qH798.js → xterm-addon-fit-CuoO7A0l.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./misc-D0u5tzSd.js";import{t as i}from"./format-file-size-B9DWgk-8.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./misc-Dz1odwkI.js";import{t as i}from"./format-file-size-Dy3zTYKi.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
@@ -1 +1 @@
1
- import{c as e}from"./routes-Cwb-U9H-.js";function t(t){let n=typeof window<`u`?window.location.origin:``,r=new URLSearchParams({senderAssistantId:t.senderAssistantId,token:t.token});return`${n}${e.connect}?${r.toString()}`}function n(e){let t=e.get(`senderAssistantId`)?.trim(),n=e.get(`token`)?.trim();return!t||!n?null:{senderAssistantId:t,token:n}}export{n,t};
1
+ import{c as e}from"./routes-XPLb07Av.js";function t(t){let n=typeof window<`u`?window.location.origin:``,r=new URLSearchParams({senderAssistantId:t.senderAssistantId,token:t.token});return`${n}${e.connect}?${r.toString()}`}function n(e){let t=e.get(`senderAssistantId`)?.trim(),n=e.get(`token`)?.trim();return!t||!n?null:{senderAssistantId:t,token:n}}export{n,t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{n as i,t as a}from"./app-info-Clwt3pCt.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-DBOtwp5h.js";import{n as i,t as a}from"./app-info-Dwct98Bb.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{a as i,n as a,o}from"./auth-store-B6EXnaee.js";import{f as s}from"./native-biometric-gWkPFBiw.js";import{c}from"./routes-XPLb07Av.js";import{n as l,t as u}from"./login-flow-CsH-88pb.js";import{Lr as d}from"./index-CmaRQR9x.js";import{r as f,t as p}from"./account-shell-CfWeuJs3.js";var m=e(t(),1),h=r();function g(){let e=i(),t=o(),r=a.use.user(),g=a.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(l,u)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(p,{children:(0,h.jsx)(f,{title:`Loading...`})}):e?(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),d(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:`Sign out`})]})]}):(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./notice-DkAWz47A.js";import"./src-CheJrlfT.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
1
+ import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./notice-BylgS5W_.js";import"./src-CDdn26Yb.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
@@ -0,0 +1,5 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BGD3-GQf.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-BQVYX8n_.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-Cqi8q9o7.js";import{t as o}from"./createLucideIcon-Bjb-Kuq7.js";import{t as s}from"./arrow-left-C2re-gYj.js";import{t as c}from"./brain-CMiHVWFK.js";import{t as l}from"./chevron-down-DpYf9Gwq.js";import{t as u}from"./chevron-right-jRymmL7S.js";import{t as d}from"./circle-check-DqvTjWle.js";import{w as f}from"./menu-DpEE6Pur.js";import{t as p}from"./code-B_ruRFrX.js";import{t as m}from"./file-text-E5adVLLN.js";import{t as h}from"./globe-Dx8dM0gj.js";import{t as g}from"./repeat-CS_kgMdk.js";import{t as _}from"./triangle-alert-DXEpFOj_.js";import{t as v}from"./x-CswtfvgS.js";import"./src-CDdn26Yb.js";import{t as y}from"./tag-B6WeUtBW.js";import{t as b}from"./chat-markdown-message-D8WjuXJe.js";import{t as x}from"./three-dot-indicator-CwchtNVS.js";import{$i as S,Bt as C,Rt as w,Ui as ee,Va as te,Vt as T,Wi as E,bt as ne,ea as re,qa as ie,qi as ae,va as oe,xt as se,yt as D,zt as O}from"./index-CmaRQR9x.js";import{t as ce}from"./status-badge-pill-j3ke1d9o.js";var le=o(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),ue=o(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),k=e(n(),1),A=``;function j(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function de(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function M(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(w.length):t}function N(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function P(e,t){if(t.updateType===`agent_message_chunk`&&de(t)){N(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:M(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??A,r=M(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(N(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??A,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==A&&r&&r.kind===`agent`&&r.messageId===A&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}N(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??A,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}N(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;N(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:j(t.toolStatus,`running`),content:t.content,locations:F(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=F(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:j(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=fe(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(N(e),e.push(i)):e[r]=i;return}}}function F(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function fe(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function pe(e){let t=[];for(let n of e)P(t,n);return t}function me(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function I(){let e=null,t=[];function n(n){return t=pe(n),e=n,t}function r(r){let i=me(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)P(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,k.useRef)(null);return t.current??=I(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
2
+ `)}function H(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function U(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var W=i();function _e({content:e,isComplete:t}){return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,W.jsx)(b,{content:e}),!t&&(0,W.jsx)(x,{className:`mt-1`,"data-testid":`acp-chat-agent-streaming`})]})}function ve({entries:e}){return e.length===0?null:(0,W.jsxs)(`div`,{"data-testid":`acp-chat-plan-block`,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-[var(--content-tertiary)]`,children:[(0,W.jsx)(oe,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`text-inherit`,children:`Plan`})]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,W.jsxs)(`li`,{"data-testid":`acp-chat-plan-entry`,"data-checked":e.checked,className:`flex items-start gap-2`,children:[e.checked?(0,W.jsx)(d,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,W.jsx)(f,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`}),(0,W.jsx)(`span`,{className:e.checked?`text-body-small-default text-[var(--content-tertiary)] line-through`:`text-body-small-default text-[var(--content-default)]`,children:e.label})]},t))})]})}function ye(e){switch(e){case`max_tokens`:case`max_turn_requests`:return`Stopped: limit reached`;case`refusal`:return`Refused`;case`cancelled`:return`Cancelled`;default:return`Completed`}}function be(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({completedAt:e}){return e===void 0?null:(0,W.jsxs)(`span`,{"data-testid":`acp-chat-terminal-time`,children:[`at `,be(e)]})}function xe({status:e,stopReason:t,error:n,completedAt:r}){if(T(e))return null;if(e===`failed`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-lg bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,W.jsx)(_,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{children:n??`Run failed`})]});if(e===`cancelled`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`cancelled`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(te,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{children:`Cancelled`}),(0,W.jsx)(G,{completedAt:r})]});let i=ye(t);return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`completed`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(d,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,W.jsx)(`span`,{children:i}),(0,W.jsx)(G,{completedAt:r})]})}function Se({showDot:e,isLast:t,children:n}){return(0,W.jsxs)(`div`,{className:`relative flex items-start gap-2${t?``:` pb-4`}`,children:[!t&&(0,W.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 left-[6.5px] w-px bg-[var(--border-element)] ${e?`top-[16px]`:`top-0`}`}),e?(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-timeline-dot`,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,W.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}):(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-[14px] w-[14px] shrink-0`}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:n})]})}function Ce({content:e,isComplete:t}){let[n,r]=(0,k.useState)(null),i=n??!t,a=e.trim().length>0,o=t?`Thought process`:`Thinking`,s=t?(0,W.jsx)(c,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(x,{dotSize:5,className:`shrink-0`,"data-testid":`acp-chat-thinking-streaming`});return a?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>r(!i),"data-testid":`acp-chat-thinking-toggle`,className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,children:[i?(0,W.jsx)(l,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(u,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),s,(0,W.jsx)(`span`,{children:o})]}),i&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-body`,className:`mt-1.5 border-l-2 border-[var(--border-base)] pl-3 text-body-small-default text-[var(--content-tertiary)]`,children:(0,W.jsx)(b,{content:e})})]}):(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:(0,W.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:[s,(0,W.jsx)(`span`,{children:o})]})})}var we={running:`neutral`,completed:`positive`,error:`negative`,ended:`neutral`},Te={running:`Running`,completed:`Completed`,error:`Failed`,ended:`Ended`},Ee={read:`Read file`,edit:`Edit file`,delete:`Delete file`,move:`Move file`,search:`Search`,execute:`Run command`,think:`Thinking`,fetch:`Fetch`,switch_mode:`Switch mode`},De=`Tool call`,Oe={read:m,edit:le,delete:ee,move:ue,search:re,execute:E,think:c,fetch:h,switch_mode:g},ke=new Set([`read`,`edit`,`delete`,`move`]);function Ae({toolKind:e}){return(0,W.jsx)(e&&Oe[e]||p,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`})}function K({label:e,value:t,testId:n}){return(0,W.jsxs)(`div`,{"data-testid":n,children:[(0,W.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(`pre`,{className:`max-h-60 overflow-auto rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] p-2.5 font-mono text-body-small-default text-[var(--content-secondary)]`,children:t})]})}function je({block:e,isTerminal:t=!1,onOpenDiff:n,onOpenOutput:r}){let[i,o]=(0,k.useState)(!1),s=(0,k.useMemo)(()=>R(e.content),[e.content]),c=(0,k.useMemo)(()=>V(e.content),[e.content]),d=(0,k.useMemo)(()=>c.split(`
3
+ `).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith("```"))||`View output`,[c]),f=(0,k.useMemo)(()=>U(s,e.locations),[s,e.locations]),p=t&&e.status===`running`?`ended`:e.status,h=p===`running`,g=e.toolKind&&Ee[e.toolKind]||De,_=B(e.rawInput)??e.title,v=_&&_!==g&&(!ke.has(e.toolKind??``)||f.length===0)?_:null,b=H(e.rawInput),S=H(e.rawOutput),C=b!==void 0||S!==void 0;return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-tool-card`,"data-status":e.status,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Ae,{toolKind:e.toolKind}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,title:e.title,children:g}),(0,W.jsx)(y,{tone:we[p],"data-testid":`acp-chat-tool-status`,children:Te[p]}),h&&(0,W.jsx)(x,{className:`shrink-0`,"data-testid":`acp-chat-tool-running`})]}),v&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-tool-detail`,className:`mt-1.5 font-mono text-body-small-default whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:v}),f.length>0&&(0,W.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:f.map(t=>{let r=t.oldText!==void 0||t.newText!==void 0,i=`flex max-w-full items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-1 text-body-small-default text-[var(--content-secondary)]`;return r?(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-file-chip`,onClick:()=>n(e.toolCallId,t),title:t.path,className:`${i} cursor-pointer transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path):(0,W.jsxs)(`span`,{"data-testid":`acp-chat-tool-file-ref`,title:t.path,className:i,children:[(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path)})}),c.length>0&&(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-output-open`,onClick:()=>r?.(e.toolCallId),className:`mt-2 flex w-full items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(E,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:d}),(0,W.jsx)(u,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`})]}),C&&(0,W.jsxs)(`div`,{className:`mt-2`,"data-testid":`acp-chat-tool-raw`,children:[(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-raw-toggle`,"aria-expanded":i,onClick:()=>o(e=>!e),className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-default)]`,children:[i?(0,W.jsx)(l,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(u,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:i?`Hide raw input/output`:`Show raw input/output`})]}),i&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-2`,children:[b!==void 0&&(0,W.jsx)(K,{label:`Raw input`,value:b,testId:`acp-chat-tool-raw-input`}),S!==void 0&&(0,W.jsx)(K,{label:`Raw output`,value:S,testId:`acp-chat-tool-raw-output`})]})]})]})}function Me({content:e}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-user-turn`,className:`flex w-full justify-end`,children:(0,W.jsx)(`div`,{className:`max-w-[80%] rounded-lg bg-[var(--surface-lift)] px-4 py-3 whitespace-pre-wrap text-chat text-[var(--content-default)]`,children:e})})}function Ne(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e);return e>0&&e<.01?`<${n(.01)}`:n(e)}var q=new Intl.NumberFormat(`en-US`);function J({label:e,value:t}){return(0,W.jsxs)(`div`,{className:`flex items-baseline gap-1`,"data-usage-stat":e.toLowerCase(),children:[(0,W.jsx)(a,{variant:`label-small-default`,className:`text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(a,{variant:`body-small-default`,className:`text-[var(--content-secondary)] tabular-nums`,children:t})]})}function Pe({entry:e}){let{inputTokens:t,outputTokens:n,costAmount:r,costCurrency:i}=e;if(t===void 0&&n===void 0)return null;let a=t??0,o=n??0,s=r!=null&&i!=null;return(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,"data-testid":`acp-usage-meter`,children:[(0,W.jsx)(J,{label:`Input`,value:q.format(a)}),(0,W.jsx)(J,{label:`Output`,value:q.format(o)}),s&&(0,W.jsx)(J,{label:`Cost`,value:Ne(r,i)})]})}function Fe({content:e}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-command-output`,className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 [&_pre]:!max-h-none`,children:(0,W.jsx)(b,{content:V(e),hardLineBreaks:!0})})}var Y=2e3;function X(e){if(e===``)return[];let t=e.split(`
4
+ `);return e.endsWith(`
5
+ `)&&t.pop(),t}function Ie(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push({type:`ctx`,text:e[o],oldNo:o+1,newNo:s+1}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,text:e[o],oldNo:o+1}),o++):(a.push({type:`add`,text:t[s],newNo:s+1}),s++);for(;o<n;)a.push({type:`del`,text:e[o],oldNo:o+1}),o++;for(;s<r;)a.push({type:`add`,text:t[s],newNo:s+1}),s++;return a}function Le(e,t){let n=X(e),r=X(t);return n.length>Y||r.length>Y?[{type:`too-large`,text:`Diff too large to render (over ${Y.toLocaleString()} lines)`}]:n.length===0?r.map((e,t)=>({type:`add`,text:e,newNo:t+1})):r.length===0?n.map((e,t)=>({type:`del`,text:e,oldNo:t+1})):Ie(n,r)}var Z=`—`;function Q(e){switch(e){case`add`:return`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`;case`del`:return`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`;case`too-large`:return`text-[var(--content-tertiary)] italic`;default:return`text-[var(--content-tertiary)]`}}function Re(e){switch(e){case`add`:return`+`;case`del`:return`-`;default:return` `}}function ze({path:e,oldText:t,newText:n}){let r=Le(t??``,n??``);return(0,W.jsx)(`div`,{"aria-label":`Diff for ${e}`,"data-testid":`acp-chat-file-diff`,className:`flex flex-col overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:(0,W.jsx)(`div`,{className:`overflow-x-auto font-mono text-xs`,children:r.map((e,t)=>(0,W.jsx)(Be,{row:e},t))})})}function Be({row:e}){return e.type===`too-large`?(0,W.jsx)(`div`,{"data-diff-type":`too-large`,className:`px-3 py-2 whitespace-pre-wrap ${Q(e.type)}`,children:e.text}):(0,W.jsxs)(`div`,{"data-diff-type":e.type,className:`flex items-start whitespace-pre ${Q(e.type)}`,children:[(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none px-2 text-right text-[var(--content-tertiary)] tabular-nums`,children:e.oldNo??Z}),(0,W.jsx)(`span`,{className:`w-10 shrink-0 select-none px-2 text-right text-[var(--content-tertiary)] tabular-nums`,children:e.newNo??Z}),(0,W.jsx)(`span`,{className:`w-4 shrink-0 select-none text-center`,children:Re(e.type)}),(0,W.jsx)(`span`,{className:`flex-1 pr-3`,children:e.text})]})}var Ve=80;function $(e){return e.scrollHeight-e.clientHeight-e.scrollTop<=Ve}function He(e){let t=(0,k.useRef)(null),n=(0,k.useRef)(!0),[r,i]=(0,k.useState)(!1),a=(0,k.useCallback)(()=>{let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]),o=(0,k.useCallback)(()=>{let e=t.current;if(!e)return;let r=$(e);n.current=r,i(e=>e===!r?e:!r)},[]),s=(0,k.useCallback)(()=>{n.current=!0,a(),i(!1)},[a]),c=(0,k.useCallback)(e=>{let r=t.current;r&&r.removeEventListener(`scroll`,o),t.current=e,e&&(e.addEventListener(`scroll`,o,{passive:!0}),n.current?e.scrollTop=e.scrollHeight:o())},[o]);return(0,k.useLayoutEffect)(()=>{n.current?a():o()},[e,a,o]),{scrollRef:c,showScrollToLatest:r,scrollToLatest:s}}function Ue(e,t){switch(e.kind){case`user`:return`user-${e.id||t}`;case`agent`:return`agent-${e.messageId||t}`;case`thinking`:return`thinking-${e.messageId||t}`;case`tool`:return`tool-${e.toolCallId}`;case`plan`:return`plan`}}var We=[];function Ge({entry:e,onClose:t}){let n=T(e.status),i=L(O(t=>t.byId[e.acpSessionId]?.events??We)),[o,s]=(0,k.useState)(null),[c,l]=(0,k.useState)(e.acpSessionId);c!==e.acpSessionId&&(l(e.acpSessionId),s(null));let d=(0,k.useCallback)((e,t)=>s({kind:`diff`,toolCallId:e,path:t.path}),[]),f=(0,k.useCallback)(e=>s({kind:`output`,toolCallId:e}),[]),p=(0,k.useCallback)(()=>s(null),[]),m=(0,k.useMemo)(()=>o?i.find(e=>e.kind===`tool`&&e.toolCallId===o.toolCallId)??null:null,[o,i]),h=(0,k.useMemo)(()=>o?.kind!==`diff`||!m?null:U(R(m.content),m.locations).find(e=>e.path===o.path)??null,[o,m]),g=o?.kind===`diff`?o.path:m?B(m.rawInput)??m.title??`Output`:`Output`,{scrollRef:_,showScrollToLatest:v,scrollToLatest:y}=He((0,k.useMemo)(()=>({blocks:i,status:e.status,completedAt:e.completedAt}),[i,e.status,e.completedAt])),b=!n;return(0,W.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[o&&(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:p,title:e.agent,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,W.jsx)(a,{variant:`body-small-default`,as:`span`,children:e.agent})}),(0,W.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,W.jsx)(a,{variant:`body-small-default`,as:`span`,title:g,className:`min-w-0 shrink truncate font-mono text-[var(--content-secondary)]`,children:g})]}),(0,W.jsx)(Ke,{entry:e,isRunning:n,onClose:t,showBack:!!o,onBack:p},`header-${e.acpSessionId}`),o?(0,W.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:o.kind===`diff`?(0,W.jsx)(ze,{path:o.path,oldText:h?.oldText,newText:h?.newText}):(0,W.jsx)(Fe,{content:m?.content})}):(0,W.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,W.jsxs)(`div`,{ref:_,"data-testid":`acp-chat-conversation`,className:`flex h-full flex-col gap-4 overflow-y-auto px-5 py-5`,children:[(0,W.jsx)(qe,{task:e.task}),(0,W.jsx)(`div`,{className:`flex flex-col`,"data-testid":`acp-chat-timeline`,children:i.map((e,t)=>(0,W.jsx)(Se,{showDot:t===0||t===i.length-1||e.kind===`tool`||e.kind===`plan`,isLast:t===i.length-1,children:(0,W.jsx)(Je,{block:e,isTerminal:b,onOpenDiff:d,onOpenOutput:f})},Ue(e,t)))}),!n&&(0,W.jsx)(xe,{status:e.status,stopReason:e.stopReason,error:e.error,completedAt:e.completedAt})]}),v&&(0,W.jsx)(r,{variant:`outlined`,size:`compact`,iconOnly:(0,W.jsx)(ie,{}),onClick:y,"aria-label":`Go to newest`,tooltip:`Go to newest`,"data-testid":`acp-chat-scroll-to-latest`,className:`absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full shadow-md`})]}),n&&!o&&(0,W.jsx)(Ye,{acpSessionId:e.acpSessionId},`steer-${e.acpSessionId}`)]})}function Ke({entry:e,isRunning:n,onClose:i,showBack:o=!1,onBack:c}){let[l,u]=(0,k.useState)(!1),d=C(e.status,e.stopReason),f=(0,k.useCallback)(()=>{u(!0),ne(e.acpSessionId).catch(e=>{u(!1),t(e,{context:`AcpRunChatView.stop`})})},[e.acpSessionId]);return(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[o&&(0,W.jsx)(r,{variant:`outlined`,iconOnly:(0,W.jsx)(s,{}),onClick:c,"aria-label":`Back to conversation`,tooltip:`Back`,"data-testid":`acp-chat-diff-back`,className:`shrink-0 rounded-lg`}),(0,W.jsx)(se,{agent:e.agent,className:`h-5 w-5 shrink-0`}),(0,W.jsx)(a,{variant:`title-medium`,title:e.agent,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:e.agent}),(0,W.jsx)(ce,{color:d.color,label:d.label}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(Pe,{entry:e}),n&&(0,W.jsxs)(`button`,{type:`button`,"aria-label":`Stop run`,onClick:f,disabled:l,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)] disabled:cursor-default disabled:opacity-50`,children:[(0,W.jsx)(ae,{className:`h-3 w-3`,fill:`currentColor`}),(0,W.jsx)(a,{variant:`label-small-default`,children:`Stop`})]}),(0,W.jsx)(r,{variant:`outlined`,iconOnly:(0,W.jsx)(v,{}),onClick:i,"aria-label":`Close run detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]})}function qe({task:e}){return e?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-objective`,children:[(0,W.jsx)(a,{variant:`body-medium-default`,as:`h3`,className:`mb-1 text-[var(--content-emphasised)]`,children:`Objective`}),(0,W.jsx)(a,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e}),(0,W.jsx)(`div`,{className:`mt-4 h-px w-full bg-[var(--border-hover)]`})]}):null}function Je({block:e,isTerminal:t,onOpenDiff:n,onOpenOutput:r}){switch(e.kind){case`user`:return(0,W.jsx)(Me,{content:e.content});case`agent`:return(0,W.jsx)(_e,{content:e.content,isComplete:e.isComplete||t});case`thinking`:return(0,W.jsx)(Ce,{content:e.content,isComplete:e.isComplete||t});case`tool`:return(0,W.jsx)(je,{block:e,isTerminal:t,onOpenDiff:n,onOpenOutput:r});case`plan`:return(0,W.jsx)(ve,{entries:e.entries})}}function Ye({acpSessionId:e}){let[n,i]=(0,k.useState)(``),[a,o]=(0,k.useState)(!1);return(0,W.jsx)(`form`,{onSubmit:(0,k.useCallback)(r=>{r.preventDefault();let s=n.trim();if(!s||a)return;o(!0);let c=O.getState().appendLocalMarker({acpSessionId:e,content:`${w}${s}`});D(e,s).then(()=>i(``)).catch(n=>{c&&O.getState().removeLocalMarker({acpSessionId:e,markerId:c}),t(n,{context:`AcpRunChatView.steer`})}).finally(()=>o(!1))},[n,a,e]),"data-testid":`acp-chat-steer-form`,className:`sticky bottom-0 z-10 shrink-0 border-t border-[var(--border-hover)] bg-[var(--surface-lift)] px-5 py-3`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md bg-[var(--surface-base)] px-3 py-2`,children:[(0,W.jsx)(`input`,{type:`text`,value:n,onChange:e=>i(e.target.value),placeholder:`Steer the run…`,disabled:a,"aria-label":`Steering instruction`,className:`text-body-medium-default min-w-0 flex-1 bg-transparent text-[color:var(--content-default)] placeholder:text-[color:var(--content-tertiary)] focus:outline-none disabled:opacity-50`}),(0,W.jsx)(r,{type:`submit`,variant:`primary`,size:`compact`,iconOnly:(0,W.jsx)(S,{}),disabled:a||n.trim()===``,"aria-label":`Send steering instruction`,className:`shrink-0`})]})})}function Xe({entry:e,onClose:t}){return(0,W.jsx)(Ge,{entry:e,onClose:t})}export{Xe as AcpRunDetailPanel};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-Cqi8q9o7.js";import{E as a,S as o,c as s,l as c,x as l}from"./risk-CazgXmiu.js";import{t as u}from"./chevron-left-B_RAz34t.js";import"./src-CheJrlfT.js";import{t as d}from"./chat-markdown-message-CRwi1qsk.js";import{C as f,a as p,i as m,n as h,r as g,s as _,y as v}from"./site-favicon-B_dwuYIn.js";import{Bt as y,E as b,G as x,J as S,K as C,Pa as w,U as T,W as E,X as D,Y as O,jt as k,q as A}from"./index-_0CSPD03.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-BkuoehPQ.js";var N=e(t(),1);function P(e,t,n){let r=E(t,n.workflow),i=e=>{let t=C(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=T(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=x(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=o(),r=w.use.byId(),i=w.use.byToolUseId(),l=w.use.notFoundRunIds(),u=w.use.hydrationFailedRunIds(),d=k.use.byId(),f=k.use.byToolUseId(),p=y.use.byId();return(0,N.useMemo)(()=>{if(!e||t==null)return null;let o=n.find(t=>a(t).includes(e));if(!o)return null;let m=c(o.contentBlocks??[],{splitInlineThinking:o.role!==`user`})[t];if(!m||m.type!==`activity`)return null;let{cardItems:h,toolCalls:g}=s(m.items);return P(h,g,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:l,hydrationFailedRunIds:u},acpById:d,acpByToolUseId:f,backgroundTaskById:p})},[n,e,t,r,i,l,u,d,f,p])}var I=r(),L=60;function R({payload:e,onClose:t}){let[r,a]=(0,N.useState)(null),o=F(e.messageId,e.groupIndex),s=o?.items??e.items,c=o?.toolCalls??e.toolCalls,l=D(s),d=S(l.steps),p=O(l.state,l.steps),m=p===`loading`,h=A(p,l.totalDurationLabel??``,d.failed),g=m&&l.currentStepTitle||h,v=new Map(c.map(e=>[e.id,e])),y=r?r.kind===`thinking`?`Thinking`:r.activity||r.title:``;return(0,I.jsx)(b,{titleNode:r?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(u,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>a(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:y})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:m?(0,I.jsx)(f,{children:g}):g}),l.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:l.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:r?(0,I.jsx)(B,{detail:r}):(0,I.jsx)(_,{steps:l.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:r,onOpenDetail:a,lookupToolCall:e=>v.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:a}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:a,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(m,{iconName:`brain`,label:l(e.text,L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(g,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(h,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(p,{step:e});let o=r(e.toolCallId);return(0,I.jsx)(m,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{o&&n(v(o))}})}function B({detail:e}){let t=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(d,{content:t??e.thinkingText??``,hardLineBreaks:!0}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-Cqi8q9o7.js";import{E as a,S as o,c as s,l as c,x as l}from"./risk-BNYYQUrq.js";import{t as u}from"./chevron-left-B_RAz34t.js";import"./src-CDdn26Yb.js";import{t as d}from"./chat-markdown-message-D8WjuXJe.js";import{C as f,a as p,i as m,n as h,r as g,s as _,y as v}from"./site-favicon-B6zQaqfA.js";import{E as y,G as b,J as x,K as S,Kr as C,W as w,X as T,Y as E,Z as D,q as O,qt as k,zt as A}from"./index-CmaRQR9x.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-CI8Z5mU5.js";var N=e(t(),1);function P(e,t,n){let r=b(t,n.workflow),i=e=>{let t=O(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=w(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=S(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=o(),r=C.use.byId(),i=C.use.byToolUseId(),l=C.use.notFoundRunIds(),u=C.use.hydrationFailedRunIds(),d=A.use.byId(),f=A.use.byToolUseId(),p=k.use.byId();return(0,N.useMemo)(()=>{if(!e||t==null)return null;let o=n.find(t=>a(t).includes(e));if(!o)return null;let m=c(o.contentBlocks??[],{splitInlineThinking:o.role!==`user`})[t];if(!m||m.type!==`activity`)return null;let{cardItems:h,toolCalls:g}=s(m.items);return P(h,g,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:l,hydrationFailedRunIds:u},acpById:d,acpByToolUseId:f,backgroundTaskById:p})},[n,e,t,r,i,l,u,d,f,p])}var I=r(),L=60;function R({payload:e,onClose:t}){let[r,a]=(0,N.useState)(null),o=F(e.messageId,e.groupIndex),s=o?.items??e.items,c=o?.toolCalls??e.toolCalls,l=D(s),d=E(l.steps),p=T(l.state,l.steps),m=p===`loading`,h=x(p,l.totalDurationLabel??``,d.failed),g=m&&l.currentStepTitle||h,v=new Map(c.map(e=>[e.id,e])),b=r?r.kind===`thinking`?`Thinking`:r.activity||r.title:``;return(0,I.jsx)(y,{titleNode:r?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(u,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>a(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:b})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:m?(0,I.jsx)(f,{children:g}):g}),l.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:l.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:r?(0,I.jsx)(B,{detail:r}):(0,I.jsx)(_,{steps:l.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:r,onOpenDetail:a,lookupToolCall:e=>v.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:a}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:a,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(m,{iconName:`brain`,label:l(e.text,L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(g,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(h,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(p,{step:e});let o=r(e.toolCallId);return(0,I.jsx)(m,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{o&&n(v(o))}})}function B({detail:e}){let t=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(d,{content:t??e.thinkingText??``,hardLineBreaks:!0}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
@@ -0,0 +1 @@
1
+ import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-BQVYX8n_.js";import{l as i,m as a,t as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./circle-alert-CTnM6GCb.js";import{t as f}from"./credit-card-CpZ4FEYf.js";import{t as p}from"./loader-circle-D57RZgLH.js";import{t as m}from"./modal-BtcwNEBj.js";import{t as h}from"./dropdown-BMNSccmo.js";import{n as g,t as _}from"./browser-JyOUYdam.js";import{lt as v,st as y}from"./react-query.gen-BXPoln4i.js";var b=t({AddCreditsModal:()=>E}),x=e(n(),1),S=u(),C=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function w(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function T(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function E({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[b]=a(),E=b.toString()?`${u}?${b.toString()}`:u,{data:D,isLoading:O}=c(y()),k=D?.allowed_top_up_amounts?.length?D.allowed_top_up_amounts:C,[A,j]=(0,x.useState)(null),M=A&&k.includes(A)?A:k[0]??C[0],N=l(v());return(0,x.useEffect)(()=>g(()=>{t(!1),n.invalidateQueries(y())}),[t,n]),(0,S.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,S.jsxs)(m.Content,{size:`sm`,children:[(0,S.jsxs)(m.Header,{children:[(0,S.jsx)(m.Title,{icon:f,children:`Add Credits`}),(0,S.jsx)(m.Description,{children:`Purchase credits to continue using the assistant. You'll be redirected to Stripe to complete the payment.`})]}),(0,S.jsx)(m.Body,{children:(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,S.jsx)(h,{id:`add-credits-amount`,value:M,onChange:e=>{j(e),N.isError&&N.reset()},disabled:O||!D,options:k.map(e=>({value:e,label:w(e)}))})]}),N.isError&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,S.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`}),T(N.error)]}),(0,S.jsx)(o,{to:`/assistant/settings/billing`,className:`text-body-small-default text-[var(--content-tertiary)] underline hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:`Configure Automatic Top-Ups →`})]})}),(0,S.jsxs)(m.Footer,{children:[(0,S.jsx)(m.Close,{asChild:!0,children:(0,S.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,S.jsx)(r,{variant:`primary`,leftIcon:N.isPending?(0,S.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{N.isPending||N.mutate({body:{amount:M,return_path:E}},{onSuccess:e=>{_(e.checkout_url)}})},disabled:N.isPending||O||!D,children:`Add credits`})]})]})})}export{b as n,E as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r}from"./local-settings-C-dW2vkq.js";import{r as i,t as a}from"./capture-error-BGD3-GQf.js";import{t as o}from"./react-DJZBPgpf.js";import{t as s}from"./button-BQVYX8n_.js";import{m as c,u as l}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as u}from"./QueryClientProvider-DKhXIxGb.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{t as f}from"./useMutation-Lj4VunQV.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./typography-Cqi8q9o7.js";import{t as h}from"./createLucideIcon-Bjb-Kuq7.js";import{t as g}from"./check-wF3S-AV4.js";import{t as _}from"./circle-alert-CTnM6GCb.js";import{t as v}from"./circle-check-DqvTjWle.js";import{t as y}from"./clock-LiCGqvyn.js";import{n as b,t as x}from"./domain-field-Bj9ReZlJ.js";import{t as S}from"./external-link-5a-JuPGf.js";import{t as C}from"./info-DPHR_AMJ.js";import{t as w}from"./loader-circle-D57RZgLH.js";import{t as T}from"./triangle-alert-DXEpFOj_.js";import{t as E}from"./notice-BylgS5W_.js";import{j as D}from"./src-CDdn26Yb.js";import{t as O}from"./tag-B6WeUtBW.js";import{t as k}from"./input-ZpyYt_a0.js";import{t as A}from"./toggle-QSEiPr3k.js";import{t as j}from"./modal-BtcwNEBj.js";import{n as M}from"./toast-ZoZVyeDI.js";import{t as N}from"./confirm-dialog-CCrDkChx.js";import{t as P}from"./dropdown-BMNSccmo.js";import{Ht as F,Ut as I,bn as L,ct as R,dt as z,j as B,tr as V}from"./sdk.gen-D_Qurj4O.js";import{H as ee,Pt as te,V as H,_t as U,c as W,d as G,f as K,l as q,m as ne,p as re,u as J,zt as Y}from"./react-query.gen-BQH0QRfT.js";import{t as ie}from"./assistant-identity-store-bwxIa6fM.js";import{r as ae}from"./utils-ilzygKkt.js";import{r as oe}from"./api-errors-CDe82ZvY.js";import{c as se}from"./routes-XPLb07Av.js";import{t as ce}from"./use-is-org-ready-ChwxZgjQ.js";import{c as le,d as ue,f as de,g as fe,h as pe,it as me,l as he,m as ge,o as _e,p as ve,s as ye,u as be,v as xe,y as Se}from"./react-query.gen-BXPoln4i.js";import{$r as Ce,Ai as we,B as Te,Ci as Ee,Di as De,Ei as Oe,H as ke,Mi as Ae,Oi as je,Si as Me,Ti as Ne,U as Pe,Ui as Fe,V as Ie,_i as Le,_r as Re,ai as ze,bi as Be,ci as Ve,di as He,ea as Ue,ei as We,gi as Ge,hi as Ke,ii as qe,ji as Je,ki as Ye,li as Xe,mi as Ze,ni as Qe,oi as $e,ri as et,si as tt,ti as nt,ui as rt,vi as it,wi as at,xi as ot,yi as st,z as ct}from"./index-CmaRQR9x.js";import{t as lt}from"./use-active-assistant-id-9rGx8kT9.js";import{t as ut}from"./detail-card-CA8lPa5K.js";import{t as dt}from"./environment-store-D_Bc9wnl.js";var ft=h(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),X=e(o(),1),Z=p();function pt({mode:e,onChange:t}){return(0,Z.jsx)(`div`,{className:`max-w-[280px]`,children:(0,Z.jsx)(D,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function mt({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,Z.jsxs)(ut,{id:e,title:t,subtitle:n,accessory:(0,Z.jsx)(pt,{mode:r,onChange:i}),children:[(0,Z.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Z.jsx)(`div`,{className:`mt-4`,children:a})]})}function Q({onClick:e,disabled:t}){return(0,Z.jsx)(s,{onClick:e,disabled:t,children:`Save`})}function ht({onClick:e,filled:t=!1}){return(0,Z.jsx)(s,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function gt({id:e,title:t,subtitle:n,children:r}){return(0,Z.jsxs)(ut,{id:e,title:t,subtitle:n,children:[(0,Z.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Z.jsx)(`div`,{className:`mt-4`,children:r})]})}function _t({guide:e}){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{children:e.description}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,Z.jsx)(S,{className:`h-3 w-3`})]})]})]})}function vt({status:e,message:t,isLoading:n}){return n?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,children:[(0,Z.jsx)(w,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-positive-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,title:`DNS records have been verified. Your domain is ready to send and receive email.`,children:[(0,Z.jsx)(g,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-mid-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-mid-strong)]`,title:`DNS records have been provisioned. Waiting for the email provider to verify them — this usually takes a few minutes.`,children:[(0,Z.jsx)(y,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-negative-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,title:`Domain verification failed. DNS records may not have propagated correctly. You could try releasing and re-registering the domain.`,children:[(0,Z.jsx)(_,{className:`h-3 w-3`}),`Verification failed`]}):(0,Z.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,title:`Unable to retrieve domain verification status.`,children:`Unknown status`})}var yt=`__custom__`;function bt(e){return e?!!(e.profile||e.provider||e.model):!1}function xt(e,t){let n=bt(e);return n===bt(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function St({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=bt(i),l=!i||!c?``:i.provider||i.model?yt:i.profile??``,u=l===yt,d=tt(),f=d[0]??je[0],p=d.find(e=>e===i?.provider)??f,m=Ae(p).map(e=>({value:e.id,label:e.displayName})),h=!!i?.provider&&!i?.model;function g(t){t===`__custom__`?o(e,{profile:null,provider:f,model:Je(f)??``}):t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function _(t){let n=Je(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function v(t){o(e,{...i??{},model:t})}return(0,Z.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,Z.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,Z.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,Z.jsx)(P,{value:l,onChange:g,options:a,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,Z.jsx)(A,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,Z.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(P,{value:p??``,onChange:_,options:d.map(e=>({value:e,label:we[e]??e}))})]}),(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,Z.jsx)(P,{value:i?.model??``,onChange:v,options:m})]})]}),h&&(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}function Ct({isOpen:e,onClose:t,assistantId:n}){let r=(0,X.useRef)(!1);return(0,Z.jsx)(j.Root,{open:e,onOpenChange:e=>{!e&&!r.current&&t()},children:e?(0,Z.jsx)(wt,{assistantId:n,onClose:t,onSavingChange:e=>{r.current=e}}):null})}function wt({assistantId:e,onClose:t,onSavingChange:n}){let r=u(),{data:i}=d({...W({path:{assistant_id:e}}),staleTime:3e4}),o=(0,X.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),c=(0,X.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),l=(0,X.useMemo)(()=>i?.llm?.callSites??{},[i?.llm?.callSites]),f=(0,X.useMemo)(()=>Ge(o,c),[o,c]),p=tt(),m=Y({onSuccess:t=>{J(r,{path:{assistant_id:e}},t)}}),[h,g]=(0,X.useState)(``),[_,v]=(0,X.useState)(``),[y,b]=(0,X.useState)({}),[x,S]=(0,X.useState)(!1),[C,T]=(0,X.useState)(!1),{data:E,isLoading:D,isError:O,refetch:A}=d({...G({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),F=(0,X.useMemo)(()=>(E?.callSites??[]).filter(e=>e.id!==`mainAgent`),[E]),I=!D&&!O&&!!E&&!!i,L=(0,X.useMemo)(()=>F.map(e=>e.id),[F]),R=(0,X.useMemo)(()=>{if(!I)return{};let e={};for(let t of L)if(t in y)e[t]=y[t];else{let n=l[t];e[t]=n?{...n}:{}}return e},[I,L,l,y]),z=(0,X.useMemo)(()=>new Set(L),[L]),B=(0,X.useMemo)(()=>Object.entries(l).some(([e,t])=>z.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[l,z]),V=(0,X.useMemo)(()=>{if(!I)return!1;for(let e of Object.keys(R))if(!xt(R[e],l[e]))return!0;return!1},[I,R,l]),ee=(0,X.useMemo)(()=>Object.values(R).some(e=>bt(e)&&!!e?.provider&&!e?.model),[R]),te=(0,X.useMemo)(()=>ke(f,[]).map(e=>({value:e.name,label:Te(e)})),[f]),H=(0,X.useCallback)(()=>{if(!_)return;let e={};for(let t of L)e[t]={profile:_};b(e)},[_,L]),U=(0,X.useCallback)(e=>[...ke(f,[e]).map(e=>({value:e.name,label:Te(e)})),{value:yt,label:`Custom`}],[f]),K=(0,X.useMemo)(()=>{if(!h.trim())return F;let e=h.toLowerCase();return F.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[F,h]),q=(0,X.useMemo)(()=>{if(!E)return[];let e=E.domains.map(e=>e.id),t=new Map(E.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=K.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=K.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[E,K]),ne=(0,X.useCallback)((e,t)=>{b(n=>({...n,[e]:t}))},[]),re=(0,X.useCallback)((e,t)=>{if(!t){b(t=>({...t,[e]:null}));return}let n=Ie(f,F.find(t=>t.id===e)?.defaultProfile);if(n)b(t=>({...t,[e]:{profile:n}}));else{let t=p[0]??je[0],n=Je(t)??``;b(r=>({...r,[e]:{provider:t,model:n}}))}},[F,f,p]),ie=(0,X.useCallback)(async()=>{S(!0),n?.(!0);try{let n={};for(let e of Object.keys(R)){let t=R[e]??null;n[e]=bt(t)?{profile:t?.profile??null,provider:t?.provider??null,model:t?.model??null}:null}await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),M.success(`Overrides saved.`)}catch(e){M.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{S(!1),n?.(!1)}},[R,t,m,n,e]),ae=(0,X.useCallback)(async()=>{S(!0),n?.(!0);try{let n={};for(let e of Object.keys(R))n[e]=null;await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),M.success(`Overrides reset.`)}catch(e){M.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{S(!1),n?.(!1)}},[R,t,m,n,e]);return(0,Z.jsxs)(j.Content,{size:`lg`,hideCloseButton:!0,children:[(0,Z.jsxs)(j.Header,{children:[(0,Z.jsx)(j.Title,{children:`Action Overrides`}),(0,Z.jsx)(j.Description,{children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`})]}),(0,Z.jsxs)(j.Body,{children:[(0,Z.jsx)(`div`,{className:`mb-4`,children:(0,Z.jsx)(k,{type:`search`,value:h,onChange:e=>g(e.target.value),placeholder:`Search actions…`,leftIcon:(0,Z.jsx)(Ue,{className:`h-4 w-4`}),fullWidth:!0})}),te.length>0&&(0,Z.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 flex-1 text-body-medium-default text-[var(--content-default)]`,children:`Use one profile for all actions`}),(0,Z.jsx)(P,{value:_,onChange:v,options:te,placeholder:`Choose profile…`,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:H,disabled:!_||!I||x,children:`Apply to all`})]}),D&&(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(w,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),O&&(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>void A(),children:`Retry`})]}),!D&&!O&&E&&(0,Z.jsx)(`div`,{className:`space-y-4`,children:q.length===0?(0,Z.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):q.map(({domain:e,sites:t})=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,Z.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>{let t=(()=>{let t=R[e.id]??null;return!t||!bt(t)?``:t.provider||t.model?`__custom__`:t.profile??``})(),n=e.defaultProfile?f.find(t=>t.name===e.defaultProfile)?.label??e.defaultProfile:null;return(0,Z.jsx)(St,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:n,draft:R[e.id]??null,profileOptions:U(t===``||t===`__custom__`?null:t),onDraftChange:ne,onToggle:re},e.id)})})]},e.id))})]}),(0,Z.jsxs)(j.Footer,{children:[B&&(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>T(!0),disabled:x||!I,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:t,disabled:x,children:`Cancel`}),(0,Z.jsx)(s,{variant:`primary`,size:`compact`,onClick:()=>void ie(),disabled:!V||ee||x,children:x?(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin`}):`Save`})]}),(0,Z.jsx)(N,{open:C,title:`Reset to Defaults`,message:`Every task override will be reset and will follow your active profile. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{T(!1),ae()},onCancel:()=>T(!1)})]})}function Tt({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:c}){let l=``;if(e){let t=e.label||e.name;l=e.isActive&&e.callSiteIds.length>0?`"${t}" is the active profile and is used by ${e.callSiteIds.length} call site(s). Pick a replacement profile.`:e.isActive?`"${t}" is the active profile. Pick a different active profile before deleting, or select a replacement below.`:`"${t}" is used by ${e.callSiteIds.length} call site(s). Select a replacement profile to reassign them before deleting.`}return(0,Z.jsx)(j.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,Z.jsxs)(j.Content,{size:`sm`,children:[(0,Z.jsx)(j.Header,{children:(0,Z.jsx)(j.Title,{children:`Can't Delete Profile`})}),(0,Z.jsxs)(j.Body,{className:`space-y-4`,children:[(0,Z.jsx)(m,{variant:`body-medium-default`,as:`p`,children:l}),e&&e.callSiteIds.length>0&&(0,Z.jsx)(`ul`,{className:`space-y-1 pl-1`,children:e.callSiteIds.map(e=>(0,Z.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,(0,Z.jsx)(`code`,{children:e})]},e))}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Replacement profile`}),(0,Z.jsx)(P,{"aria-label":`Replacement profile`,value:n,onChange:r,options:[{value:``,label:`Select a replacement…`},...t.map(e=>({value:e.name,label:e.label??e.name}))]})]}),i&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,Z.jsxs)(j.Footer,{children:[(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,Z.jsx)(s,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:c,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function Et(e,t){if(e){let n=Ae(e).find(e=>e.id===t);if(n)return n.displayName}let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1):t}function Dt(e,t){let n=[];e.description&&n.push(e.description);let r=e.provider_connection===`vellum`&&t?`vellum`:e.provider,i=[];if(e.model&&i.push(Et(r,e.model)),r){let e=we[r]??r;i.push(`hosted by ${e}`)}return i.length>0&&n.push(i.join(` `)),n.join(` – `)}function Ot({profile:e,vellumIsManaged:t,isDragging:n,dropTarget:r,isDeleting:i,deleteError:a,isToggling:o,onDragStart:c,onDragEnd:l,onDragOver:u,onDragLeave:d,onDrop:f,onEditClick:p,onDeleteClick:h,onStatusToggle:g}){let _=e.source===`managed`,v=e.invariant===!0,y=e.status!==`disabled`;return(0,Z.jsxs)(`div`,{className:`relative`,children:[r?.name===e.name&&!r.after&&(0,Z.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg pr-2 py-2${n?` opacity-50`:``}`,draggable:!_,onDragStart:c,onDragEnd:l,onDragOver:u,onDragLeave:d,onDrop:f,children:[(0,Z.jsx)(ft,{className:`h-4 w-4 shrink-0 ${_?`invisible`:`cursor-grab text-[var(--content-tertiary)]`}`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1${y?``:` opacity-55`}`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(m,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),_&&(0,Z.jsx)(O,{tone:`positive`,title:`Managed by Platform — this profile cannot be disabled, deleted, or renamed.`,children:`Platform`})]}),e.description||e.model||e.provider?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:Dt(e,t)}):null]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(!v||!y)&&(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center`,title:y?`Active — toggle to hide from pickers`:`Disabled — toggle to show in pickers`,children:(0,Z.jsx)(A,{checked:y,onChange:e=>g(e),disabled:o,"aria-label":`${y?`Disable`:`Enable`} ${e.label??e.name}`})}),(0,Z.jsxs)(`div`,{className:`flex w-[92px] items-center justify-end gap-2`,children:[(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,onClick:p,children:_||v?`View`:`Edit`}),(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(Fe,{}),"aria-label":`Delete ${e.label??e.name}`,disabled:_||v||i,title:_||v?`Managed profiles cannot be deleted`:void 0,onClick:h,tintColor:`var(--system-negative-strong)`})]})]})]}),r?.name===e.name&&r.after&&(0,Z.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),a?(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:a}):null]})}function kt({isOpen:e,assistantId:t,onClose:n}){let r=u(),{data:i}=d({...W({path:{assistant_id:t}}),staleTime:3e4}),o=(0,X.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),s=(0,X.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),c=i?.llm?.activeProfile??null,l=i?.llm?.callSites??{},f=(0,X.useMemo)(()=>Ge(o,s),[o,s]),p=Y({onSuccess:e=>{J(r,{path:{assistant_id:t}},e)}}),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(null),{data:v}=d({...H({path:{assistant_id:t}}),enabled:e}),y=v?.connections,b=y?.some(e=>e.name===`vellum`&&e.provider===`vellum`)??!1,x=Object.keys(o);async function S(e,n,r){let i=r?.mode??`replace`,c=!(e in o);if(i===`merge`&&!c){await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}),h(!1),_(null);return}let l={profiles:{[e]:n}};if(c&&(l.profileOrder=s.includes(e)?s:[...s,e]),c)await p.mutateAsync({path:{assistant_id:t},body:{llm:l}});else{let n=o[e];await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:null}}}});try{await p.mutateAsync({path:{assistant_id:t},body:{llm:l}})}catch(r){throw a(r,{context:`settings-ai-profile-edit-recreate`}),n!=null&&await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}).catch(()=>{}),r}}c&&M.success(`Profile "${n.label??e}" created`),h(!1),_(null)}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(j.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,Z.jsx)(At,{assistantId:t,vellumIsManaged:b,profiles:o,profileOrder:s,orderedProfiles:f,activeProfile:c,callSiteOverrides:l,onClose:n,onEditClick:e=>{_(e),h(!0)},onNewClick:()=>{_(null),h(!0)}}):null}),(0,Z.jsx)(Ce,{isOpen:m,mode:g?g.source===`managed`||g.invariant===!0?`view`:`edit`:`create`,profileName:g?.name,initialValues:g??void 0,existingNames:x,connections:y,assistantId:t,onSave:S,onCancel:()=>{h(!1),_(null)}})]})}function At({assistantId:e,vellumIsManaged:t,profiles:n,profileOrder:r,orderedProfiles:i,activeProfile:o,callSiteOverrides:c,onClose:l,onEditClick:d,onNewClick:f}){let p=u(),h=Y({onSuccess:t=>{J(p,{path:{assistant_id:e}},t)}}),[g,_]=(0,X.useState)({}),[v,y]=(0,X.useState)({}),[b,x]=(0,X.useState)(new Set),[S,C]=(0,X.useState)(null),[w,T]=(0,X.useState)(null),[E,D]=(0,X.useState)(null),[O,k]=(0,X.useState)(null),A=(0,X.useRef)(null),M=(0,X.useRef)(null),[N,P]=(0,X.useState)(null),[F,I]=(0,X.useState)(null),[L,R]=(0,X.useState)(``),[z,B]=(0,X.useState)(!1),V=(0,X.useMemo)(()=>i,[i]);async function ee(t,r){if(b.has(t.name))return!1;x(e=>new Set(e).add(t.name)),C(null);let i=r?`active`:`disabled`;if(!n[t.name])return x(e=>{let n=new Set(e);return n.delete(t.name),n}),!1;try{return await h.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t.name]:{status:i}}}}}),!0}catch(e){return a(e,{context:`settings-ai-profile-toggle`}),C(`Couldn't update "${t.label??t.name}". Please try again.`),!1}finally{x(e=>{let n=new Set(e);return n.delete(t.name),n})}}async function te(t){y(e=>({...e,[t]:!0})),_(e=>{let n={...e};return delete n[t],n});try{let n=r.filter(e=>e!==t);await h.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t]:null},profileOrder:n}}})}catch(e){a(e,{context:`settings-ai-profile-delete`}),_(e=>({...e,[t]:`Failed to delete profile. Please try again.`}))}finally{y(e=>{let n={...e};return delete n[t],n})}}function H(e){let t=V.find(t=>t.name===e)?.label??e,n=e===o,r=Object.entries(c).filter(([t,n])=>t!==`mainAgent`&&n?.profile===e).map(([e])=>e);if(n||r.length>0){P({name:e,label:t,isActive:n,callSiteIds:r}),R(``),I(null);return}te(e)}async function U(){if(!N||!L)return;B(!0),I(null);let t={};if(N.isActive&&(t.activeProfile=L),N.callSiteIds.length>0){let e={};for(let t of N.callSiteIds)e[t]={profile:L};t.callSites=e}if(Object.keys(t).length>0)try{await h.mutateAsync({path:{assistant_id:e},body:{llm:t}})}catch(e){a(e,{context:`settings-ai-profile-reassign-delete`}),I(`Failed to reassign references. Please try again.`),B(!1);return}let n=N.name;P(null),B(!1),te(n)}async function W(t,n){if(t===n.name)return;k(null);let i=r.filter(e=>e!==t),o=i.indexOf(n.name);if(o===-1)return;n.after&&(o+=1);let s=[...i.slice(0,o),t,...i.slice(o)];try{await h.mutateAsync({path:{assistant_id:e},body:{llm:{profileOrder:s}}})}catch(e){a(e,{context:`settings-ai-profile-reorder`}),k(`Failed to reorder profiles. Please try again.`)}}let G=V.filter(e=>e.name!==N?.name&&e.source!==`managed`),K=G.length>0?G:V.filter(e=>e.name!==N?.name);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(j.Content,{size:`md`,children:[(0,Z.jsxs)(j.Header,{children:[(0,Z.jsx)(j.Title,{children:`Model Profiles`}),(0,Z.jsx)(j.Description,{children:`Bundle a provider and model into a named profile. Assign profiles to specific actions or swap between them when chatting.`})]}),(0,Z.jsxs)(j.Body,{children:[V.length===0?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No profiles yet. Create one to get started.`}):(0,Z.jsx)(`div`,{className:`space-y-1`,children:V.map(e=>(0,Z.jsx)(Ot,{profile:e,vellumIsManaged:t,isDragging:w===e.name,dropTarget:E,isDeleting:v[e.name]??!1,deleteError:g[e.name],isToggling:b.has(e.name),onDragStart:t=>{A.current=e.name,T(e.name),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`)},onDragEnd:()=>{A.current=null,M.current=null,T(null),D(null)},onDragOver:t=>{t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=t.clientY>n.top+n.height/2,i={name:e.name,after:r};M.current=i,D(i)},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||(M.current=null,D(t=>t?.name===e.name?null:t))},onDrop:e=>{e.preventDefault();let t=A.current,n=M.current;A.current=null,M.current=null,T(null),D(null),t&&n&&W(t,n)},onEditClick:()=>d(e),onDeleteClick:()=>H(e.name),onStatusToggle:t=>void ee(e,t)},e.name))}),O&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:O}),S&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:S})]}),(0,Z.jsxs)(j.Footer,{className:`justify-between`,children:[(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:f,children:`+ New Profile`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Done`})]})]}),(0,Z.jsx)(Tt,{blocked:N,availableReplacements:K,replacement:L,onReplacementChange:R,error:F,saving:z,onClose:()=>{P(null),I(null)},onConfirm:()=>void U()})]})}var jt=`0.10.8`;function Mt(){return ae(jt)}function Nt({mode:e,connection:t,assistantId:n,existingNames:r,onSave:i,onCancel:a}){let[o,c]=(0,X.useState)(t?.label??``),l=t?.name??``,d=t?.provider??`anthropic`,f=t?.auth.type??`api_key`,[p,h]=(0,X.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[g,_]=(0,X.useState)(t?.baseUrl??``),[v,y]=(0,X.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[b,x]=(0,X.useState)(!1),[S,C]=(0,X.useState)(null),w=d===`openai-compatible`,[T,E]=(0,X.useState)(``),[D,O]=(0,X.useState)(!1),A=u(),M=(0,X.useMemo)(()=>Xe(p),[p]),N=f===`api_key`&&M!==null,{hasStoredCredential:P,isLoading:F}=$e({assistantId:n,credentialKind:`credential`,credentialName:M?`${M.service}:${M.field}`:``,enabled:N}),{credentials:L}=nt({assistantId:n,enabled:f===`api_key`});(0,X.useEffect)(()=>{let e=t?.provider??`anthropic`;c(t?.label??``),t?.auth.type===`api_key`?h(t.auth.credential):h(t?``:`credential/${e}/api_key`),C(null),_(t?.baseUrl??``),y(t?.models?t.models.map(e=>e.id).join(`, `):``),E(``),O(!1)},[t]);let R=l.trim().length>0;async function z(){if(R){x(!0),C(null);try{let e;if(f===`api_key`){let t=p.trim()||`credential/${d}/api_key`,r=T.trim();if(r){O(!0);try{let e=Xe(t);await V({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:d,value:r},throwOnError:!0});let i=ze(n,`credential`,e?`${e.service}:${e.field}`:``);A.setQueryData(i,!0),A.invalidateQueries({queryKey:U({path:{assistant_id:n}})})}catch{C(`Failed to save API key. Please try again.`);return}finally{O(!1)}}e={type:`api_key`,credential:t}}else if(t)e=t.auth;else{C(`Nothing to edit. Close and try again.`);return}let r=o.trim()||null,a={auth:e,label:r,...w&&{base_url:g.trim()||null,models:v.trim()?v.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:s,error:c,response:u}=await I({path:{assistant_id:n,name:t?.name??l.trim()},body:a});if(!u?.ok){C(He(u?.status,c)??Ve(u?.status));return}if(!s){C(`Server returned an empty response. Please try again.`);return}i(s)}catch{C(`Failed to save provider. Please try again.`)}finally{x(!1)}}}let B=L.filter(e=>e.service===d),ee=e!==`create`&&t?.auth.type===`api_key`,te=B.length>0||ee,H=Qe(`Enter your API key`,P);return e===`create`?(0,Z.jsx)(We,{variant:`modal`,assistantId:n,existingNames:r,defaultProviderType:d,onCreated:i,onCancel:a}):(0,Z.jsxs)(j.Content,{size:`md`,children:[(0,Z.jsxs)(j.Header,{children:[(0,Z.jsx)(j.Title,{children:`Edit Provider`}),(0,Z.jsx)(j.Description,{children:t?`Editing ${rt(t)}.`:`Edit provider settings.`})]}),(0,Z.jsxs)(j.Body,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,Z.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,Z.jsx)(k,{value:o,onChange:e=>c(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0})]}),w&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,Z.jsx)(k,{value:g,onChange:e=>_(e.target.value),placeholder:`https://api.example.com/v1`,fullWidth:!0})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,Z.jsx)(k,{value:v,onChange:e=>y(e.target.value),placeholder:`model-1, model-2`,fullWidth:!0}),(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),f===`api_key`&&(0,Z.jsx)(et,{apiKeyValue:T,onApiKeyChange:E,credential:p,onCredentialChange:h,isLoadingCredential:F,apiKeyPlaceholder:H,provider:d,providerCredentials:B,showAdvancedSection:te,onError:C}),f===`oauth_subscription`&&(0,Z.jsx)(qe,{assistantId:n,onConnected:i}),S&&(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:S})]}),(0,Z.jsxs)(j.Footer,{children:[(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,onClick:a,children:`Cancel`}),(0,Z.jsx)(s,{variant:`primary`,size:`compact`,disabled:!R||b||D,onClick:()=>void z(),children:b?`Saving…`:`Save`})]})]})}var Pt={anthropic:!0,openai:!0,gemini:!0,fireworks:!0,openrouter:!0,vellum:!0};function Ft(e){return e in Pt}function It({isOpen:e,assistantId:t,onClose:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(null),s=u(),{data:c,isLoading:l,isError:f}=d({...H({path:{assistant_id:t}}),enabled:e}),p=Mt(),{data:m}=d({...K({path:{assistant_id:t}}),enabled:e&&p}),h=(0,X.useMemo)(()=>{let e=c?.connections??[];return[...e.filter(e=>e.provider===Ye),...e.filter(e=>e.provider!==Ye)]},[c]);function g(){s.invalidateQueries({queryKey:re({path:{assistant_id:t}})}),s.invalidateQueries({queryKey:q({path:{assistant_id:t}})})}function _(e){s.invalidateQueries({queryKey:ee({path:{assistant_id:t}})}),i(!1),o(null)}let v=h.map(e=>e.name),y=()=>{i(!1),o(null)};return(0,Z.jsx)(j.Root,{open:e,onOpenChange:e=>{e||(r?y():n())},children:e?r?(0,Z.jsx)(Nt,{mode:a?`edit`:`create`,connection:a??void 0,assistantId:t,existingNames:v,onSave:_,onCancel:y}):(0,Z.jsx)(Lt,{connections:h,loading:l,isError:f,assistantId:t,supportsDefaultProvider:p,defaultConnectionName:p?m?.resolvedConnectionName??null:null,onDefaultChanged:g,onClose:n,onEditClick:e=>{o(e),i(!0)},onNewClick:()=>{o(null),i(!0)},onConnectionDeleted:()=>{s.invalidateQueries({queryKey:ee({path:{assistant_id:t}})})}}):null})}function Lt({connections:e,loading:t,isError:n,assistantId:r,supportsDefaultProvider:i,defaultConnectionName:o,onDefaultChanged:c,onClose:l,onEditClick:u,onNewClick:d,onConnectionDeleted:p}){let[h,g]=(0,X.useState)({}),[_,v]=(0,X.useState)({}),y=f({...ne(),onMutate:e=>{let t=e.body?.connectionName;t&&g(e=>{let n={...e};return delete n[t],n})},onSuccess:c,onError:(e,t)=>{a(e,{context:`settings-ai-set-default-provider`});let n=t.body?.connectionName;n&&g(e=>({...e,[n]:`Failed to set default provider. Please try again.`}))}});function b(e){Ft(e.provider)&&y.mutate({path:{assistant_id:r},body:{provider:e.provider,connectionName:e.name}})}async function x(e){v(t=>({...t,[e]:!0})),g(t=>{let n={...t};return delete n[e],n});try{let{response:t}=await F({path:{assistant_id:r,name:e}});t?.ok||t?.status===404?p(e):t?.status===409?g(t=>({...t,[e]:`This provider is in use by a profile or as the default provider. Update those settings before deleting it.`})):g(t=>({...t,[e]:`Failed to delete provider. Please try again.`}))}catch{g(t=>({...t,[e]:`Failed to delete provider. Please try again.`}))}finally{v(t=>{let n={...t};return delete n[e],n})}}return(0,Z.jsxs)(j.Content,{size:`md`,children:[(0,Z.jsxs)(j.Header,{children:[(0,Z.jsx)(j.Title,{children:`Providers`}),(0,Z.jsx)(j.Description,{children:`Manage the model providers your assistant can use.`})]}),(0,Z.jsx)(j.Body,{children:t?(0,Z.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,Z.jsx)(`div`,{className:`h-10 animate-pulse rounded-lg bg-[var(--surface-active)]`},e))}):n?(0,Z.jsx)(m,{variant:`body-medium-default`,as:`p`,className:`py-4 text-center text-(--system-negative-strong)`,children:`Failed to load providers. Please try again.`}):e.length===0?(0,Z.jsx)(m,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No providers yet. Add one to get started.`}):(0,Z.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>{let t=_[e.name]??!1,n=h[e.name],r=e.isManaged??!1,a=e.name===o,c=Ft(e.provider),l=y.isPending&&y.variables?.body?.connectionName===e.name;return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-2 py-2`,children:[(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(m,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:rt(e)}),r&&(0,Z.jsx)(O,{tone:`positive`,title:`Managed by Platform — you can rename this provider, but not edit it.`,children:`Platform`}),a&&(0,Z.jsx)(O,{tone:`info`,title:`Built-in profiles (Balanced, Quality, Speed) use this provider.`,children:`Default`})]})}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&!a&&(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,disabled:!c||l,title:c?`Use this provider for the built-in profiles.`:`Built-in profiles can't run on this provider.`,onClick:()=>b(e),children:`Set as default`}),!r&&(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,onClick:()=>u(e),children:`Edit`}),(0,Z.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(Fe,{}),"aria-label":`Delete ${rt(e)}`,disabled:r||a||t,title:r?`The Vellum provider cannot be removed`:a?`This is your default provider. Set another provider as default first.`:void 0,onClick:()=>void x(e.name),tintColor:`var(--system-negative-strong)`})]})]}),n?(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:n}):null]},e.name)})})}),(0,Z.jsxs)(j.Footer,{className:`justify-between`,children:[(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:d,children:`+ Add Provider`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Done`})]})]})}function $(e){let[t,n]=(0,X.useState)(void 0);return(0,X.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,X.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}function Rt(){let e=lt(),t=u(),{data:n}=d({...W({path:{assistant_id:e}}),staleTime:3e4}),r=Mt(),{data:i,refetch:o}=d({...K({path:{assistant_id:e}}),enabled:r}),c=i?.availability,l=n?.llm?.activeProfile??null,f=n?.llm?.advisorProfile??null,p=n?.llm?.callSites??{},{profiles:h,profileOrder:g}=ct(n?.llm,e),_=(0,X.useMemo)(()=>Ge(h,g),[h,g]),v=Y({onSuccess:n=>{J(t,{path:{assistant_id:e}},n)}}),[y,b]=$(l),[x,S]=$(f),[C,T]=(0,X.useState)(!1),[D,O]=(0,X.useState)(!1),[k,A]=(0,X.useState)(!1),j=(0,X.useMemo)(()=>ke(_,[y]),[_,y]),N=(0,X.useMemo)(()=>ke(_,[x]),[_,x]),F=Object.entries(p).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length,I=F===1?`1 Override`:F>0?`${F} Overrides`:`Overrides`,L=y!==l,R=x!==f,z=(0,X.useCallback)(async()=>{try{let t={};L&&(t.activeProfile=y),R&&(t.advisorProfile=x),await v.mutateAsync({path:{assistant_id:e},body:{llm:t}}),M.success(`Saved.`)}catch(e){M.error(`Failed to save. Please try again.`),a(e,{context:`settings-ai-language-model-save`})}},[L,R,y,x,v,e]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gt,{title:`Language Model`,subtitle:`Configure the LLMs that power your assistant`,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[c&&c.status!==`ok`&&(0,Z.jsx)(E,{tone:c.status===`unknown`?`warning`:`error`,children:c.message??`Your default provider is not available.`}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Default Profile`}),(0,Z.jsx)(P,{value:y??``,onChange:e=>{b(e===``?null:e)},placeholder:`Select a default profile…`,options:j.map(e=>({value:e.name,label:Te(e)}))}),j.length===0?(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`No profiles yet. Click Profiles below to create one.`}):null]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Advisor Profile`}),(0,Z.jsx)(P,{value:x??``,onChange:e=>{S(e===``?null:e)},placeholder:`Select an advisor profile…`,options:N.map(e=>({value:e.name,label:Te(e)}))}),(0,Z.jsx)(m,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`Which model your assistant consults for a second opinion`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>A(!0),children:`Providers`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>T(!0),children:`Profiles`}),(0,Z.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>O(!0),children:I})]}),(L||R)&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:z,disabled:v.isPending}),v.isPending&&(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]})}),e&&(0,Z.jsx)(kt,{isOpen:C,assistantId:e,onClose:()=>T(!1)}),e&&(0,Z.jsx)(Ct,{isOpen:D,onClose:()=>O(!1),assistantId:e}),e&&(0,Z.jsx)(It,{isOpen:k,assistantId:e,onClose:()=>{A(!1),r&&o()}})]})}var zt=`vellum:ai:imageGenMode`,Bt=`vellum:ai:imageGenModel`,Vt=`vellum:ai:webSearchMode`,Ht=`vellum:ai:webSearchProvider`,Ut=`vellum:ai:webFetchProvider`,Wt=`vellum:ai:emailMode`,Gt=`vellum:ai:emailByoProvider`,Kt=`vellum:voice:ttsMode`,qt=`vellum:voice:ttsProvider`,Jt=`vellum:voice:ttsApiKey:`,Yt=`vellum:voice:ttsVoiceId:`,Xt=`vellum:voice:sttMode`,Zt=`vellum:voice:sttProvider`,Qt=`vellum:voice:sttApiKey:`;function $t(){let e=lt();return(0,X.useCallback)(async(t,n)=>{try{let{data:r}=await V({path:{assistant_id:e},body:{value:n,type:`api_key`,name:t},throwOnError:!0});Ke(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?M.error(`Assistant not ready. Please try again.`):M.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}function en(){let e=lt(),i=u(),{data:o}=d({...W({path:{assistant_id:e}}),staleTime:3e4}),s=Y({onSuccess:t=>{J(i,{path:{assistant_id:e}},t)}}),c=$t(),{serverWebSearchMode:l,serverWebSearchProvider:f}=(0,X.useMemo)(()=>{if(!o)return{serverWebSearchMode:st(r(Vt,`your-own`),`your-own`),serverWebSearchProvider:r(Ht,`inference-provider-native`)};let e=o.services?.[`web-search`];return{serverWebSearchMode:st(e?.mode??r(`vellum:ai:webSearchMode`,`your-own`),`your-own`),serverWebSearchProvider:e?.provider||r(`vellum:ai:webSearchProvider`,`inference-provider-native`)}},[o]),[p,m]=(0,X.useState)(!1),[h,g]=$(l),[_,v]=$(f),[y,b]=(0,X.useState)(``),x=Be.has(_),{hasStoredCredential:S}=$e({assistantId:e,credentialKind:`api_key`,credentialName:_,enabled:x}),C=y.trim().length>0,T=p||h===`your-own`&&x&&!S&&!C||!(h!==l||(h===`managed`?`inference-provider-native`:_)!==f)&&!C,E=Qe(Ee[_]??`Enter your API key`,S),D=(0,X.useCallback)(async()=>{m(!0);let t=y.trim(),r=h===`managed`?`inference-provider-native`:_,o=it(r),l=h===`your-own`&&x&&t.length>0;try{l&&await c(r,t),await s.mutateAsync({path:{assistant_id:e},body:{services:{"web-search":{mode:h,provider:r}}}}).catch(e=>{throw M.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{m(!1);return}m(!1);try{if(n(Vt,h),n(Ht,r),l){o&&n(o,t);let r=ze(e,`api_key`,_);i.setQueryData(r,!0),i.invalidateQueries({queryKey:r}),b(``)}M.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),M.error(`Saved, but local preferences could not be written.`)}},[x,s,c,i,e,y,h,_]),O=(0,X.useCallback)(()=>{let e=it(_);e&&t(e),b(``),v(`inference-provider-native`),n(Ht,`inference-provider-native`)},[_,v]);return(0,Z.jsx)(mt,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,mode:h,onModeChange:e=>g(e),children:h===`managed`?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Web search is included with managed inference.`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:D,disabled:T}),p&&(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(P,{value:_,onChange:v,options:Me.map(e=>({value:e,label:ot[e]??e}))})]}),x&&(0,Z.jsx)(k,{label:`API Key`,type:`password`,value:y,onChange:e=>b(e.target.value),placeholder:E,fullWidth:!0}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:D,disabled:T}),p&&(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),x&&(0,Z.jsx)(ht,{onClick:O,filled:!0})]})]})})}var tn=`default`;function nn(){let e=lt(),i=u(),{data:o}=d({...W({path:{assistant_id:e}}),staleTime:3e4}),s=Y({onSuccess:t=>{J(i,{path:{assistant_id:e}},t)}}),c=$t(),l=(0,X.useMemo)(()=>o?o.services?.[`web-fetch`]?.provider||r(`vellum:ai:webFetchProvider`,tn):r(Ut,tn),[o]),[f,p]=(0,X.useState)(!1),[m,h]=$(l),[g,_]=(0,X.useState)(``),v=at.has(m),{hasStoredCredential:y}=$e({assistantId:e,credentialKind:`api_key`,credentialName:m,enabled:v}),b=g.trim().length>0,x=f||v&&!y&&!b||m===l&&!b,S=Qe(De[m]??`Enter your API key`,y),C=(0,X.useCallback)(async()=>{p(!0);let t=g.trim(),r=v&&t.length>0;try{r&&await c(m,t),await s.mutateAsync({path:{assistant_id:e},body:{services:{"web-fetch":{provider:m}}}}).catch(e=>{throw M.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{p(!1);return}p(!1);try{if(n(Ut,m),r){let r=Le(m);r&&n(r,t);let a=ze(e,`api_key`,m);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),_(``)}M.success(`Web fetch settings saved.`)}catch(e){a(e,{context:`settings-ai-web-fetch-persist-local`}),M.error(`Saved, but local preferences could not be written.`)}},[v,s,c,i,e,g,m]),T=(0,X.useCallback)(()=>{let e=Le(m);e&&t(e),_(``),h(tn),n(Ut,tn)},[m,h]);return(0,Z.jsx)(gt,{id:`web-fetch`,title:`Web Fetch`,subtitle:`Configure how your assistant reads individual web pages`,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(P,{value:m,onChange:h,options:Oe.map(e=>({value:e,label:Ne[e]??e}))})]}),v&&(0,Z.jsx)(k,{label:`API Key`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:S,fullWidth:!0}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:C,disabled:x}),f&&(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),v&&(0,Z.jsx)(ht,{onClick:T,filled:!0})]})]})})}var rn=[{id:`elevenlabs`,displayName:`ElevenLabs`,subtitle:`High-quality voice synthesis for conversations and read-aloud. Requires an ElevenLabs API key.`,supportsVoiceSelection:!0,apiKeyPlaceholder:`sk_…`,credentialsGuide:{description:`Sign in to ElevenLabs, go to your Profile, and copy your API key.`,url:`https://elevenlabs.io/app/settings/api-keys`,linkLabel:`Open ElevenLabs API Keys`}},{id:`fish-audio`,displayName:`Fish Audio`,subtitle:`Natural-sounding voice synthesis with custom voice cloning. Requires a Fish Audio API key and voice reference ID.`,supportsVoiceSelection:!0,apiKeyPlaceholder:`Enter your Fish Audio API key`,credentialsGuide:{description:`Sign in to Fish Audio, navigate to API Keys in your dashboard, and create a new key.`,url:`https://fish.audio/app/api-keys/`,linkLabel:`Open Fish Audio API Keys`}},{id:`deepgram`,displayName:`Deepgram`,subtitle:`Fast, accurate text-to-speech synthesis. Uses the same API key as Deepgram speech-to-text.`,supportsVoiceSelection:!1,apiKeyPlaceholder:`Enter your Deepgram API key`,credentialsGuide:{description:`Sign in to Deepgram, navigate to your API Keys page, and create or copy an existing key. This is the same key used for speech-to-text.`,url:`https://console.deepgram.com/`,linkLabel:`Open Deepgram Console`}},{id:`xai`,displayName:`xAI`,subtitle:`Text-to-speech from xAI with expressive voices (eve, ara, rex, sal, leo). Requires an xAI API key.`,supportsVoiceSelection:!1,apiKeyPlaceholder:`Enter your xAI API key`,credentialsGuide:{description:`Sign in to the xAI console, navigate to API Keys, and create a new key.`,url:`https://console.x.ai/`,linkLabel:`Open xAI Console`}}],an=[{id:`deepgram`,displayName:`Deepgram`,subtitle:`Fast, accurate speech-to-text transcription. Uses the same API key as Deepgram text-to-speech.`,apiKeyPlaceholder:`Enter your Deepgram API key`,credentialsGuide:{description:`Sign in to Deepgram, navigate to your API Keys page, and create or copy an existing key. This is the same key used for text-to-speech.`,url:`https://console.deepgram.com/`,linkLabel:`Open Deepgram Console`}},{id:`openai`,displayName:`OpenAI`,subtitle:`OpenAI Whisper transcription. Requires an OpenAI API key.`,apiKeyPlaceholder:`sk-…`,credentialsGuide:{description:`Sign in to the OpenAI platform, navigate to API Keys, and create a new secret key.`,url:`https://platform.openai.com/api-keys`,linkLabel:`Open OpenAI API Keys`}},{id:`macos-native`,displayName:`macOS Native Dictation`,subtitle:`Apple's on-device speech recognition, running locally through the macOS helper. Works offline and needs no API key.`,requiresNativeDictation:!0,setupWarning:`Requires macOS Dictation to be turned on: open System Settings → Keyboard, then enable Dictation. macOS downloads the on-device speech model the first time Dictation is enabled — without it, voice input produces no transcript.`}],on=[{id:`mailgun`,displayName:`Mailgun`,setupSkill:`mailgun-setup`,docsUrl:`https://www.mailgun.com/`},{id:`resend`,displayName:`Resend`,setupSkill:`resend-setup`,docsUrl:`https://resend.com/`}],sn=[`gemini-3.1-flash-image-preview`,`gemini-3-pro-image-preview`,`gpt-image-2`],cn={"gemini-3.1-flash-image-preview":`Nano Banana 2`,"gemini-3-pro-image-preview":`Nano Banana Pro`,"gpt-image-2":`GPT Image 2`};function ln(e){return e.startsWith(`gpt-`)||e.startsWith(`dall-e-`)?`openai`:(e.startsWith(`gemini-`),`gemini`)}function un({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=u(),i=l(),[o,p]=c(),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(!1),[v,y]=(0,X.useState)(null),[S,C]=(0,X.useState)(``),[T,D]=(0,X.useState)(null),[O,k]=(0,X.useState)(!1),[A,j]=(0,X.useState)(!1),[P,F]=(0,X.useState)(!1);(0,X.useEffect)(()=>{g||!t||m||(h(t),_(!0))},[t,g,m]);let I=d({...me(),enabled:!0}),L=I.data,R=L?.entitlements,z=R?.managed_email===!0,B=!!R&&!z,V=!L&&I.isError&&!I.isFetching,ee=d({...le({path:{assistant_id:e}}),enabled:!B}),te=d({...ve({path:{assistant_id:e}}),enabled:!B}),H=ee.data?.results?.[0],U=te.data?.results?.[0],W=H?`${H.subdomain}.${n}`:null,G=d({...pe({path:{assistant_id:e,id:U?.id??``}}),enabled:!!U?.id,refetchOnWindowFocus:!1}),K=d({...be({path:{assistant_id:e,id:H?.id??``}}),enabled:!!H?.id,refetchInterval:e=>{let t=e.state.data?.status;return t===`verified`||t===`failed`?!1:1e4},refetchOnWindowFocus:!0});(0,X.useEffect)(()=>{o.get(`release`)!==`1`||!H||U||(j(!0),p(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[U,H,o,p]);let q=f(_e()),ne=f(ye()),re=f(ue()),J=f(de()),Y=(0,X.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:he({path:t})}),r.invalidateQueries({queryKey:ge({path:t})}),U?.id&&r.invalidateQueries({queryKey:fe({path:{...t,id:U.id}})}),r.invalidateQueries({queryKey:Se()})},[U?.id,e,r]),ie=(0,X.useCallback)(async()=>{let t=m.trim().toLowerCase();if(!t){y(`Enter a subdomain.`);return}k(!1);try{await q.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),h(``),y(null),Y(),M.success(`Domain ${t}.${n} registered.`)}catch(e){y(oe(e,void 0,`Failed to register domain.`))}},[e,n,Y,q,m]),ae=(0,X.useCallback)(async()=>{let t=S.trim().toLowerCase();if(!t){D(`Enter an email username.`);return}try{await re.mutateAsync({path:{assistant_id:e},body:{username:t}}),C(``),D(null),Y(),M.success(`Email address created.`)}catch(e){D(oe(e,void 0,`Failed to create email address.`))}},[e,Y,re,S]),ce=(0,X.useCallback)(async()=>{if(U?.id){F(!1);try{await J.mutateAsync({path:{assistant_id:e,id:U.id}}),Y(),M.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),M.error(`Failed to remove email address.`)}}},[U?.id,e,J,Y]),xe=(0,X.useCallback)(async()=>{if(!H?.id)return;if(U){M.error(`Remove the email address first.`);return}j(!1);let t=H.subdomain;try{await ne.mutateAsync({path:{assistant_id:e,id:H.id}}),h(t),Y(),M.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),M.error(`Failed to release domain.`)}},[U,e,ne,H?.id,H?.subdomain,Y]);if(I.isLoading)return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(B)return(0,Z.jsxs)(E,{tone:`info`,icon:(0,Z.jsx)(b,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Get a dedicated email address for your assistant`,actions:(0,Z.jsx)(s,{size:`compact`,onClick:()=>i(`${se.settings.billing}?adjust_plan`),children:`Upgrade to Pro`}),children:[`Pro plans include a managed`,` `,`<your-subdomain>.${n}`,` inbox — no provider setup required. Or switch to `,(0,Z.jsx)(`strong`,{children:`Your Own`}),` to bring an existing provider.`]});let Ce=V?(0,Z.jsx)(E,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,Z.jsx)(s,{size:`compact`,variant:`outlined`,onClick:()=>I.refetch(),children:`Retry`}),children:`We couldn't reach the billing service. The form below assumes managed email is enabled for your org — if it isn't, registering a domain will fail.`}):null;return H?U?(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[Ce,(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:U.address}),(0,Z.jsx)(vt,{status:K.data?.status,message:K.data?.message,isLoading:K.isLoading}),(0,Z.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Z.jsx)(Fe,{}),onClick:()=>F(!0),disabled:J.isPending,"aria-label":`Remove email address`})]}),(0,Z.jsx)(N,{open:P,title:`Remove Email Address`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to remove `,(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:U.address}),`? Your assistant will no longer be able to send or receive email at this address.`]}),confirmLabel:`Remove`,destructive:!0,onConfirm:ce,onCancel:()=>F(!1)})]}),G.data?.usage&&(0,Z.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[G.data.usage.sent_today,` /`,` `,G.data.usage.daily_limit,` sent today ·`,` `,G.data.usage.received_today,` received`]})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[Ce,(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[H.subdomain,`.`,n]}),(0,Z.jsx)(vt,{status:K.data?.status,message:K.data?.message,isLoading:K.isLoading}),(0,Z.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Z.jsx)(Fe,{}),onClick:()=>j(!0),disabled:ne.isPending,"aria-label":`Release domain`})]}),(0,Z.jsx)(N,{open:A,title:`Release Domain`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to release `,(0,Z.jsxs)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:[H.subdomain,`.`,n]}),`? The subdomain will become available for others to claim.`]}),confirmLabel:`Release`,destructive:!0,onConfirm:xe,onCancel:()=>j(!1)})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex h-9 min-w-0 flex-1 items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${T?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,Z.jsx)(`input`,{value:S,onChange:e=>{C(e.target.value.toLowerCase()),T&&D(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!T,className:`h-full min-w-0 flex-1 bg-transparent pl-3 pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,Z.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,W]})]}),(0,Z.jsx)(s,{onClick:ae,disabled:re.isPending||!S.trim(),children:re.isPending?`Creating…`:`Create`})]}),T&&(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:T})]})]}):(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[Ce,(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,Z.jsx)(x,{subdomain:m,onSubdomainChange:e=>{h(e),v&&y(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:v}),(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Each assistant gets its own subdomain. Lowercase letters, numbers, and hyphens only.`}),(0,Z.jsx)(s,{onClick:()=>k(!0),disabled:q.isPending||!m.trim(),children:q.isPending?`Registering…`:`Register`}),(0,Z.jsx)(N,{open:O,title:`Set Subdomain`,message:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:m.trim().toLowerCase()||`subdomain`}),` will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:ie,onCancel:()=>k(!1)})]})}function dn(){let e=lt(),t=ce(),{data:o}=d({...xe(),enabled:t}),s=o?.results?.[0]?.handle,c=dt.use.emailRootDomain(),l=Ze(),[u,f]=(0,X.useState)(()=>l===`gated`?`your-own`:st(r(Wt,`managed`),`managed`)),[p,m]=(0,X.useState)(()=>{let e=r(Gt,`resend`);return e===`mailgun`||e===`resend`?e:`resend`}),h=d({queryKey:[`byoEmailCredential`,e,p],queryFn:async()=>{let{data:t}=await R({path:{assistant_id:e},body:{service:p,field:`api_key`},throwOnError:!0});return t},enabled:u===`your-own`||l===`gated`,staleTime:6e4,retry:i,meta:{errorContext:`byo_email_credential_check`}});(0,X.useEffect)(()=>{h.error&&a(h.error,{context:`byo_email_credential_check`,bestEffort:!0})},[h.error]);let g=h.data?.hasSecret===!0,_=(0,X.useCallback)(e=>{f(e),n(Wt,e)},[]),y=(0,X.useCallback)(()=>{n(Gt,p),M.success(`Email settings saved.`)},[p]),b=(0,X.useMemo)(()=>on.find(e=>e.id===p)??on[0],[p]),x=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsxs)(`span`,{children:[`Configure `,b.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:b.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,Z.jsxs)(`a`,{href:b.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,b.displayName,(0,Z.jsx)(S,{className:`h-3 w-3`})]})]})]}),w=(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(P,{value:p,onChange:e=>{(e===`mailgun`||e===`resend`)&&m(e)},options:on.map(e=>({value:e.id,label:e.displayName}))})]}),g?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--system-positive-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-default)]`,children:[(0,Z.jsx)(v,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,Z.jsxs)(`span`,{children:[b.displayName,` API key configured. To reconfigure, run the`,` `,(0,Z.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:b.setupSkill}),` `,`skill.`]})]}),(0,Z.jsxs)(`a`,{href:b.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-body-small-default text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,b.displayName,(0,Z.jsx)(S,{className:`h-3 w-3`})]})]}):x,(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(Q,{onClick:y,disabled:!1})})]});return l===`gated`?(0,Z.jsx)(gt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:w}):(0,Z.jsx)(mt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:u,onModeChange:_,children:u===`managed`?(0,Z.jsx)(`div`,{className:`space-y-4`,children:l===`disabled`?(0,Z.jsx)(Pe,{children:`Log in to the Vellum platform to manage email settings.`}):(0,Z.jsx)(un,{assistantId:e,assistantHandle:s,emailRootDomain:c})}):w})}function fn(){let e=lt(),t=u(),{data:i}=d({...W({path:{assistant_id:e}}),staleTime:3e4}),o=Y({onSuccess:n=>{J(t,{path:{assistant_id:e}},n)}}),s=$t(),[c,l]=$((0,X.useMemo)(()=>st(i?i.services?.[`image-generation`]?.mode??r(`vellum:ai:imageGenMode`,`your-own`):r(zt,`your-own`),`your-own`),[i])),[f,p]=(0,X.useState)(()=>r(Bt,`gemini-3.1-flash-image-preview`)),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(!1),v=(0,X.useCallback)(async()=>{_(!0);let r=m.trim(),i=c===`your-own`&&r.length>0;try{i&&await s(ln(f),r),await o.mutateAsync({path:{assistant_id:e},body:{services:{"image-generation":{mode:c}}}}).catch(e=>{throw M.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});try{await L({path:{assistant_id:e},body:{modelId:f},throwOnError:!0})}catch(e){throw M.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{t.invalidateQueries({queryKey:q({path:{assistant_id:e}})})}}catch{_(!1);return}_(!1);try{n(zt,c),n(Bt,f),i&&h(``),M.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),M.error(`Saved, but local preferences could not be written.`)}},[m,c,f,e,o,s,t]),y=(0,X.useCallback)(()=>{h(``),p(`gemini-3.1-flash-image-preview`),n(Bt,`gemini-3.1-flash-image-preview`)},[]);return(0,Z.jsx)(mt,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,mode:c,onModeChange:e=>l(e),children:c===`managed`?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Z.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,Z.jsx)(P,{className:`flex-1`,value:f,onChange:p,options:sn.map(e=>({value:e,label:cn[e]??e}))}),(0,Z.jsx)(Q,{onClick:v,disabled:g}),g&&(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsx)(k,{label:`API Key`,type:`password`,value:m,onChange:e=>h(e.target.value),placeholder:ln(f)===`openai`?`Enter your OpenAI API key`:`Enter your Gemini API key`,fullWidth:!0}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Z.jsx)(P,{value:f,onChange:p,options:sn.map(e=>({value:e,label:cn[e]??e}))})]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:v,disabled:g}),g&&(0,Z.jsx)(w,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),(0,Z.jsx)(ht,{onClick:y})]})]})})}async function pn(e){let{provider:t,apiKey:n,voiceId:r,text:i}=e;if(n.trim().length===0)return{kind:`error`,message:`Save an API key for this provider first.`};try{return t===`elevenlabs`?await mn(n,r,i):t===`deepgram`?await hn(n,i):t===`fish-audio`?{kind:`unsupported`,message:`Fish Audio TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:t===`xai`?{kind:`unsupported`,message:`xAI TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:{kind:`unsupported`,message:`TTS testing for "${t}" is not supported from the browser yet.`}}catch(e){return{kind:`error`,message:e instanceof Error?e.message:`Failed to reach the TTS provider.`}}}async function mn(e,t,n){let r=t.trim();if(r.length===0)return{kind:`error`,message:`Enter and save a Voice ID before testing ElevenLabs.`};let i=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(r)}?output_format=mp3_44100_128`,{method:`POST`,headers:{"xi-api-key":e,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:n,model_id:`eleven_turbo_v2_5`})});return i.ok?{kind:`audio`,blob:await i.blob()}:{kind:`error`,message:await gn(i,`ElevenLabs rejected the request.`)}}async function hn(e,t){let n=await fetch(`https://api.deepgram.com/v1/speak?model=aura-2-thalia-en`,{method:`POST`,headers:{Authorization:`Token ${e}`,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:t})});return n.ok?{kind:`audio`,blob:await n.blob()}:{kind:`error`,message:await gn(n,`Deepgram rejected the request.`)}}async function gn(e,t){try{let n=await e.text();if(n.length===0)return`${t} (HTTP ${e.status})`;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`detail`in e&&typeof e.detail==`string`)return e.detail;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message}catch{}return n.slice(0,200)}catch{return`${t} (HTTP ${e.status})`}}var _n={elevenlabs:`voiceId`,"fish-audio":`referenceId`,xai:`voiceId`};function vn(){let e=lt(),t=ie.use.name()??`your assistant`,i=ce(),a=u(),{data:o}=d({...te({path:{assistant_id:e}}),enabled:i,staleTime:1/0}),c=o?.providers??rn,{data:l}=d({...W({path:{assistant_id:e}}),enabled:i,staleTime:3e4}),f=l?.services?.tts,p=f?.provider,m=f?.mode===`managed`,h=(0,X.useMemo)(()=>st(f?.mode??r(`vellum:voice:ttsMode`,`your-own`),`your-own`),[f?.mode]),[g,_]=$(h),v=c[0]?.id??`elevenlabs`,y=(0,X.useMemo)(()=>p??r(`vellum:voice:ttsProvider`,v),[p,v]),b=!!p,[x,S]=$(y),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(``),[D,O]=(0,X.useState)(``),[A,j]=(0,X.useState)(!1),[N,F]=(0,X.useState)(!1),[I,L]=(0,X.useState)(!1),R=(0,X.useMemo)(()=>c.find(e=>e.id===x)??c[0],[x,c]),V=(0,X.useCallback)(e=>{let t=r(Jt+e,``),n=r(Yt+e,``);j(t.length>0),E(n),O(n),w(``)},[]);(0,X.useEffect)(()=>{V(x)},[x,V]);let ee=(0,X.useMemo)(()=>{let e=x!==y,t=C.trim().length>0,n=T.trim()!==D;return e||t||n||g!==h},[x,y,C,T,D,g,h]),H=(0,X.useCallback)(async()=>{let t=C.trim(),i=T.trim(),o=R.id;n(Kt,`your-own`),n(qt,o),t.length>0&&n(Jt+o,t),n(Yt+o,i);let s=t.length>0?t:r(Jt+o,``),c=_n[o];L(!0);try{if(s.length>0){let{response:t}=await z({path:{assistant_id:e},body:{service:o,field:`api_key`,value:s,label:`${R.displayName} API Key`},throwOnError:!1});if(!t?.ok)throw Error(`Failed to store API key (HTTP ${t?.status??`?`})`)}let t=m,n={...x!==y||!b||t?{provider:o}:{},...t?{mode:`your-own`}:{},...c?{providers:{[o]:{[c]:i}}}:{}};if(Object.keys(n).length>0){let{response:t}=await B({path:{assistant_id:e},body:{services:{tts:n}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}j(s.length>0),O(i),w(``),a.invalidateQueries({queryKey:q({path:{assistant_id:e}})}),M.success(`Text-to-speech settings saved`)}catch(e){M.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`)}finally{L(!1)}},[e,x,C,T,R,y,b,m,a]),U=(0,X.useCallback)(async()=>{L(!0);try{let{response:t}=await B({path:{assistant_id:e},body:{services:{tts:{mode:`managed`,provider:R.id}}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`);n(Kt,`managed`),a.invalidateQueries({queryKey:q({path:{assistant_id:e}})}),M.success(`Text-to-speech settings saved`)}catch(e){M.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`)}finally{L(!1)}},[e,R,a]),G=(0,X.useCallback)(()=>{n(Jt+x,``),j(!1),w(``)},[x]),K=(0,X.useCallback)(async()=>{F(!0);try{let e=r(Jt+x,``),n=C.trim(),i=n.length>0?n:e;if(i.length===0){M.error(`Save an API key for this provider before testing.`);return}let a=r(Yt+x,``),o=T.trim(),s=await pn({provider:x,apiKey:i,voiceId:o.length>0?o:a,text:`Hey! It's ${t}. How does this sound?`});if(s.kind!==`audio`){M.error(s.message);return}let c=URL.createObjectURL(s.blob);try{let e=new Audio(c);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(c)}}finally{F(!1)}},[t,C,x,T]),ne=A?`•••••••• (Enter a new key to replace)`:R.apiKeyPlaceholder;return(0,Z.jsx)(mt,{title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,mode:g,onModeChange:e=>_(e),children:g===`managed`?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Managed speech synthesis is included with your Vellum connection.`}),(0,Z.jsx)(Q,{onClick:U,disabled:I})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(P,{value:x,onChange:S,options:c.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Z.jsx)(k,{type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:ne,fullWidth:!0})]}),R.supportsVoiceSelection&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,Z.jsx)(k,{type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),(0,Z.jsx)(_t,{guide:R.credentialsGuide}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(s,{variant:`outlined`,onClick:K,disabled:N,children:N?`Testing…`:`Test`}),(0,Z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Z.jsx)(Q,{onClick:H,disabled:!ee||I}),A&&(0,Z.jsx)(ht,{onClick:G})]})]})]})})}var yn={deepgram:{provider:`deepgram`,credentialService:`deepgram`},openai:{provider:`openai-whisper`,credentialService:`openai`}},bn={deepgram:`deepgram`,"openai-whisper":`openai`};function xn(){let e=lt(),t=ce(),i=u(),[a]=(0,X.useState)(()=>an.filter(e=>!e.requiresNativeDictation||Re())),o=a[0]?.id??`deepgram`,{data:s}=d({...W({path:{assistant_id:e}}),enabled:t,staleTime:3e4}),c=s?.services?.stt,l=c?.provider,f=c?.mode===`managed`,p=(0,X.useMemo)(()=>st(c?.mode??r(`vellum:voice:sttMode`,`your-own`),`your-own`),[c?.mode]),[m,h]=$(p),g=(0,X.useMemo)(()=>{let e=l?bn[l]:void 0;if(e&&a.some(t=>t.id===e))return e;let t=r(Zt,o);return a.some(e=>e.id===t)?t:o},[l,a,o]),_=!!l,[v,y]=$(g),[b,x]=(0,X.useState)(``),[S,C]=(0,X.useState)(!1),[w,E]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=r(Zt,o);e===`macos-native`&&!a.some(t=>t.id===e)&&n(Zt,o)},[a,o]);let D=(0,X.useMemo)(()=>a.find(e=>e.id===v)??a[0],[a,v]),O=D.apiKeyPlaceholder!==void 0;(0,X.useEffect)(()=>{C(r(Qt+v,``).length>0),x(``)},[v]);let A=(0,X.useMemo)(()=>{let e=v!==g,t=b.trim().length>0;return e||t||m!==p},[v,g,b,m,p]),j=(0,X.useCallback)(async()=>{let t=b.trim();n(Xt,`your-own`),n(Zt,v),t.length>0&&n(Qt+v,t);let a=yn[v];E(!0);try{if(a){let n=t.length>0?t:r(Qt+v,``);if(n.length>0){let{response:t}=await z({path:{assistant_id:e},body:{service:a.credentialService,field:`api_key`,value:n,label:`${D.displayName} API Key`},throwOnError:!1});if(!t?.ok)throw Error(`Failed to store API key (HTTP ${t?.status??`?`})`)}}let n=f,o=!!a&&(v!==g||!_)||n&&(!l||l===`vellum`);if(o||n){let t=a?.provider??yn[v]?.provider??`deepgram`,{response:r}=await B({path:{assistant_id:e},body:{services:{stt:{...o?{provider:t}:{},...n?{mode:`your-own`}:{}}}},throwOnError:!1});if(!r?.ok)throw Error(`Failed to save configuration (HTTP ${r?.status??`?`})`)}t.length>0&&C(!0),x(``),i.invalidateQueries({queryKey:q({path:{assistant_id:e}})}),M.success(`Speech-to-text settings saved`)}catch(e){M.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`)}finally{E(!1)}},[e,v,b,D,g,_,f,l,i]),N=(0,X.useCallback)(async()=>{E(!0);try{let t=l&&l!==`vellum`?l:yn[v]?.provider??`deepgram`,{response:r}=await B({path:{assistant_id:e},body:{services:{stt:{mode:`managed`,provider:t}}},throwOnError:!1});if(!r?.ok)throw Error(`Failed to save configuration (HTTP ${r?.status??`?`})`);n(Xt,`managed`),v===`macos-native`&&n(Zt,o),i.invalidateQueries({queryKey:q({path:{assistant_id:e}})}),M.success(`Speech-to-text settings saved`)}catch(e){M.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`)}finally{E(!1)}},[e,l,v,o,i]),F=(0,X.useCallback)(()=>{n(Qt+v,``),C(!1),x(``)},[v]),I=S?`•••••••• (Enter a new key to replace)`:D.apiKeyPlaceholder;return(0,Z.jsx)(mt,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,mode:m,onModeChange:e=>h(e),children:m===`managed`?(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Managed transcription is included with your Vellum connection.`}),(0,Z.jsx)(Q,{onClick:N,disabled:w})]}):(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(P,{value:v,onChange:y,options:a.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),O&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Z.jsx)(k,{type:`password`,value:b,onChange:e=>x(e.target.value),placeholder:I,fullWidth:!0})]}),D.setupWarning&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(T,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,Z.jsx)(`span`,{children:D.setupWarning})]}),D.credentialsGuide&&(0,Z.jsx)(_t,{guide:D.credentialsGuide}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,Z.jsx)(Q,{onClick:j,disabled:!A||w}),S&&(0,Z.jsx)(ht,{onClick:F})]})]})})}function Sn(){return(0,X.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]),(0,Z.jsxs)(`div`,{className:`space-y-5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-4 py-2.5`,children:[(0,Z.jsx)(C,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,Z.jsxs)(`a`,{href:`https://www.vellum.ai/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--primary-base)] hover:underline`,children:[`View pricing`,(0,Z.jsx)(S,{className:`h-3.5 w-3.5`})]})]})]}),(0,Z.jsx)(Rt,{}),(0,Z.jsx)(en,{}),(0,Z.jsx)(nn,{}),(0,Z.jsx)(dn,{}),(0,Z.jsx)(fn,{}),(0,Z.jsx)(vn,{}),(0,Z.jsx)(xn,{})]})}export{Sn as AiPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./createLucideIcon-Bjb-Kuq7.js";import{n as i,r as a}from"./avatar-svg-compositor-CnDf9Ibf.js";import{t as o}from"./use-reduced-motion-CcGT6CHV.js";var s=r(`dices`,[[`rect`,{width:`12`,height:`12`,x:`2`,y:`10`,rx:`2`,ry:`2`,key:`6agr2n`}],[`path`,{d:`m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6`,key:`1o487t`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 14h.01`,key:`ssrbsk`}],[`path`,{d:`M15 6h.01`,key:`cblpky`}],[`path`,{d:`M18 9h.01`,key:`2061c0`}]]),c=e(t(),1),l=n();function u(e,t){return e+Math.random()*(t-e)}function d(e){let t=[],n=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,r;for(;(r=n.exec(e))!==null;)t.push(parseFloat(r[0]));return t}function f(e){let t=d(e),n=0,r=0,i=0;for(let e=0;e<t.length-1;e+=2)n+=t[e],r+=t[e+1],i++;return i>0?{x:n/i,y:r/i}:{x:0,y:0}}function p(e,t,n){let r=f(e),i=t*1.1;return e.replace(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,(t,a)=>{let o=parseFloat(t),s=e.slice(0,a).match(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi),c=s?s.length:0,l=c%2==0,u=l?r.x:r.y,f=d(e),p=l?c+1:c-1,m=p>=0&&p<f.length?f[p]:u,h=l?o:m,g=Math.atan2((l?m:o)-r.y,h-r.x),_=1+(Math.sin(g*2+i)*.7+Math.sin(g*3-i*.5)*.3)*n;return(u+(o-u)*_).toFixed(3)})}function m(e,t,n){let r=[e];for(let i=1;i<t;i++)r.push(p(e,i,n));return r}function h({components:e,traits:t,size:n,isAssistantBusy:r=!1,breathe:s=!0}){let d=o(),{bodyShape:f,eyeStyle:p,color:h}=a(e,t.bodyShape,t.eyeStyle,t.color),{bodyTransform:g,eyeTransform:_}=i(f,p,e,n),v=p.sourceViewBox,y=f.viewBox,b=Math.min(n/y.width,n/y.height),x=(n-y.width*b)/2,S=(n-y.height*b)/2,C=Math.min(y.width/v.width,y.height/v.height),w=e.faceCenterOverrides.find(e=>e.bodyShape===f.id&&e.eyeStyle===p.id),T=w?w.faceCenter:f.faceCenter,E=T.x-p.eyeCenter.x*C,D=T.y-p.eyeCenter.y*C,O=b*(E+p.eyeCenter.x*C)+x,k=b*(D+p.eyeCenter.y*C)+S,A=(0,c.useMemo)(()=>r?m(f.svgPath,16,.06):[f.svgPath],[f.svgPath,r]),[j,M]=(0,c.useState)(!1),[N,P]=(0,c.useState)(0),[F,I]=(0,c.useState)(0),L=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(d||r){M(!1);return}let e=!1;function t(){return setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),Math.random()<.2?setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),t())},150))},200):t())},150))},u(3e3,7e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,r]),(0,c.useEffect)(()=>{if(d||r){P(0);return}let e=!1;function t(){return setTimeout(()=>{e||(P((Math.random()<.5?-1:1)*u(1,2)),setTimeout(()=>{e||(P(0),t())},200))},u(8e3,15e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,r]),(0,c.useEffect)(()=>{if(!r||d){I(0);return}let e=0;return L.current=setInterval(()=>{e=(e+1)%A.length,I(e)},150),()=>{L.current&&clearInterval(L.current),L.current=null}},[r,d,A.length]);let R=n/2,z=n/2,B=d?`none`:r?`avatar-morph-scale 2.4s ease-in-out infinite, avatar-morph-rotate 3s ease-in-out infinite`:s?`avatar-breathe-kf 4s ease-in-out infinite`:`none`,V=r?0:N,H=j&&!r,U=A[F]??f.svgPath;return(0,l.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 ${n} ${n}`,style:{animation:B,transformOrigin:`center`},children:[(0,l.jsx)(`g`,{style:{transform:`rotate(${V}deg)`,transformOrigin:`${R}px ${z}px`,transition:V===0?`transform 0.3s ease-out`:`transform 0.2s ease-in-out`},children:(0,l.jsx)(`path`,{d:U,fill:h.hex,transform:g,style:{transition:r?`d 0.3s ease-in-out`:`none`}})}),(0,l.jsx)(`g`,{style:{transform:H?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${O}px ${k}px`,transition:`transform 0.15s ease-in-out`},children:p.paths.map((e,t)=>(0,l.jsx)(`path`,{d:e.svgPath,fill:e.color,transform:_},t))})]})}export{s as n,h as t};
@@ -1 +1 @@
1
- import{c as e,ct as t,et as n,o as r}from"./local-mode-Dydd46cS.js";import{c as i}from"./api-4X-X5R5M.js";import{At as a,_ as o,ht as s,mt as c,v as l,y as u}from"./sdk.gen-BR-xXIZm.js";import{a as d,n as f}from"./api-errors-CoE1wFl2.js";import{B as p,T as m,V as h,a as g,i as _,o as v,w as y,z as b}from"./sdk.gen-B3ej_AZQ.js";async function x(e,t){let{data:n,error:r,response:i}=await y({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return f(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:d(r,i)}}async function S(n){if(t()){let t=n?r(n):e();if(t)return{ok:!0,status:200,data:{id:t.assistantId,name:t.name??t.assistantId,status:`active`,is_local:!0,created:t.hatchedAt??``}}}if(n){let{data:e,error:t,response:r}=await h({path:{id:n},throwOnError:!1});return f(r,t,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:e}:{ok:!1,status:r.status,error:d(t,r)}}let i=await m({query:{hosting:`platform`},throwOnError:!1});if(f(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:d(i.error,i.response)};let a=i.data?.results??[];if(a.length>0)return{ok:!0,status:i.response.status,data:a[0]};let o=await m({query:{hosting:`local`},throwOnError:!1});if(f(o.response,o.error,`Failed to get assistant.`),o.response.ok){let e=o.data?.results??[];if(e.length>0)return{ok:!0,status:o.response.status,data:e[0]}}return o.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:o.response.status,error:d(o.error,o.response)}}async function C(e){let{data:t,error:n,response:r}=await a({path:{assistant_id:e},throwOnError:!1});return f(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:d(n,r)}}async function w(e){let{data:t,error:n,response:r}=await s({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}async function T(e){let{data:t,error:n,response:r}=await c({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let t=!n(),[r,i]=await Promise.all([l({path:{assistant_id:e},throwOnError:!1}),t?v({path:{assistant_id:e},throwOnError:!1}):null]);if(f(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:d(r.error,r.response)};let a=E(r.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:r.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:d(i.error,i.response)}}return{ok:!0,status:r.response.status,data:a}}async function k(e){let{data:t,error:r,response:i}=n()?await o({path:{assistant_id:e},throwOnError:!1}):await _({path:{assistant_id:e},throwOnError:!1});if(f(i,r,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:d(r,i)}}async function A(e,t){let{data:r,error:i,response:a}=n()?await u({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await g({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(f(a,i,`Failed to restore assistant backup.`),a.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:a.status,data:e}}return{ok:!1,status:a.status,error:d(i,a)}}async function j(e){let{data:t,error:n,response:r}=await b({path:{id:e},throwOnError:!1});return f(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:d(n,r)}}async function M(e){let{error:t,response:n}=await p({path:{id:e},throwOnError:!1});return f(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:d(t,n)}}async function N(){let{data:e,error:t,response:n}=await m({query:{hosting:`all`},throwOnError:!1});return f(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:d(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};
1
+ import{ct as e,l as t,o as n,tt as r}from"./local-mode-hyYI6_OH.js";import{c as i}from"./api-DjY6rho1.js";import{_ as a,kt as o,mt as s,pt as c,v as l,y as u}from"./sdk.gen-D_Qurj4O.js";import{i as d,n as f}from"./api-errors-CDe82ZvY.js";import{B as p,T as m,V as h,a as g,i as _,o as v,w as y,z as b}from"./sdk.gen-BJsTUGAk.js";async function x(e,t){let{data:n,error:r,response:i}=await y({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return f(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:d(r,i)}}async function S(r){if(e()){let e=r?n(r):t();if(e)return{ok:!0,status:200,data:{id:e.assistantId,name:e.name??e.assistantId,status:`active`,is_local:!0,created:e.hatchedAt??``}}}if(r){let{data:e,error:t,response:n}=await h({path:{id:r},throwOnError:!1});return f(n,t,`Failed to get assistant.`),n.ok?{ok:!0,status:n.status,data:e}:{ok:!1,status:n.status,error:d(t,n)}}let i=await m({query:{hosting:`platform`},throwOnError:!1});if(f(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:d(i.error,i.response)};let a=i.data?.results??[];if(a.length>0)return{ok:!0,status:i.response.status,data:a[0]};let o=await m({query:{hosting:`local`},throwOnError:!1});if(f(o.response,o.error,`Failed to get assistant.`),o.response.ok){let e=o.data?.results??[];if(e.length>0)return{ok:!0,status:o.response.status,data:e[0]}}return o.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:o.response.status,error:d(o.error,o.response)}}async function C(e){let{data:t,error:n,response:r}=await o({path:{assistant_id:e},throwOnError:!1});return f(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:d(n,r)}}async function w(e){let{data:t,error:n,response:r}=await s({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}async function T(e){let{data:t,error:n,response:r}=await c({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let t=!r(),[n,i]=await Promise.all([l({path:{assistant_id:e},throwOnError:!1}),t?v({path:{assistant_id:e},throwOnError:!1}):null]);if(f(n.response,n.error,`Failed to list assistant backups.`),!n.response.ok)return{ok:!1,status:n.response.status,error:d(n.error,n.response)};let a=E(n.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:n.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:d(i.error,i.response)}}return{ok:!0,status:n.response.status,data:a}}async function k(e){let{data:t,error:n,response:i}=r()?await a({path:{assistant_id:e},throwOnError:!1}):await _({path:{assistant_id:e},throwOnError:!1});if(f(i,n,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:d(n,i)}}async function A(e,t){let{data:n,error:i,response:a}=r()?await u({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await g({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(f(a,i,`Failed to restore assistant backup.`),a.ok){let e=n&&typeof n==`object`&&!Array.isArray(n)?n:{};return{ok:!0,status:a.status,data:e}}return{ok:!1,status:a.status,error:d(i,a)}}async function j(e){let{data:t,error:n,response:r}=await b({path:{id:e},throwOnError:!1});return f(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:d(n,r)}}async function M(e){let{error:t,response:n}=await p({path:{id:e},throwOnError:!1});return f(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:d(t,n)}}async function N(){let{data:e,error:t,response:n}=await m({query:{hosting:`all`},throwOnError:!1});return f(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:d(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-jRWAZmH_.js";import{B as t,G as n,H as ee,I as te,J as r,K as ne,L as re,Q as ie,R as i,U as a,V as o,W as s,X as c,Y as ae,Z as oe,q as l,z as se}from"./local-mode-hyYI6_OH.js";function u(e){return ie(re,e)}function ce(e){return oe(te,e)}var le=i([`end_turn`,`max_tokens`,`max_turn_requests`,`refusal`,`cancelled`]),ue=n({type:a(`acp_session_completed`),acpSessionId:r(),stopReason:le}).strict(),de=n({type:a(`acp_session_error`),acpSessionId:r(),error:r()}).strict(),fe=n({type:a(`acp_session_spawned`),acpSessionId:r(),agent:r(),parentConversationId:r(),parentToolUseId:r().optional(),task:r().optional()}).strict(),pe=i([`agent_message_chunk`,`agent_thought_chunk`,`user_message_chunk`,`tool_call`,`tool_call_update`,`plan`]),me=n({type:a(`acp_session_update`),acpSessionId:r(),updateType:pe,content:r().optional(),toolCallId:r().optional(),toolTitle:r().optional(),toolKind:r().optional(),toolStatus:r().optional(),rawInput:c().optional(),rawOutput:c().optional(),locations:t(n({path:r(),line:s().optional()})).optional(),messageId:r().optional(),seq:s().optional()}).strict(),he=n({type:a(`acp_session_usage`),acpSessionId:r(),usedTokens:s(),contextSize:s(),inputTokens:s().optional(),outputTokens:s().optional(),costAmount:s().optional(),costCurrency:r().optional()}).strict(),ge=i([`idle`,`thinking`,`streaming`,`tool_running`,`awaiting_confirmation`]),_e=i([`assistant_turn`,`user_turn`,`global`]),ve=i([`message_dequeued`,`thinking_delta`,`first_text_delta`,`tool_use_start`,`preview_start`,`tool_result_received`,`confirmation_requested`,`confirmation_resolved`,`context_compacting`,`message_complete`,`generation_cancelled`,`error_terminal`]),ye=n({type:a(`assistant_activity_state`),conversationId:r(),activityVersion:s(),phase:ge,anchor:_e,reason:ve,requestId:r().optional(),statusText:r().optional()}),be=n({type:a(`assistant_text_delta`),text:r(),messageId:r().optional(),conversationId:r().optional()}),d=n({type:a(`assistant_thinking_delta`),thinking:r(),messageId:r().optional(),conversationId:r().optional(),timestampMs:s().optional()}),f=n({type:a(`assistant_turn_start`),messageId:r(),conversationId:r().optional()}),p=n({type:a(`avatar_updated`),avatarPath:r()}),m=n({type:a(`background_tool_completed`),id:r(),conversationId:r(),status:i([`completed`,`failed`,`cancelled`]),exitCode:s().nullable().optional(),output:r().optional(),completedAt:s()}),h=n({type:a(`background_tool_started`),id:r(),toolName:r(),conversationId:r(),command:r(),startedAt:s()}),g=n({type:a(`compaction_circuit_closed`),conversationId:r()}),_=n({type:a(`compaction_circuit_open`),conversationId:r(),reason:a(`3_consecutive_failures`),openUntil:s()}),v=n({label:r(),description:r(),pattern:r()}),y=n({label:r(),scope:r()}),b=n({label:r(),scope:r()}),x=n({filePath:r(),oldContent:r(),newContent:r(),isNewFile:o()}),S=i([`allow_once`,`allow_always`,`reject_once`,`reject_always`]),C=n({optionId:r(),name:r(),kind:S}),w=i([`sandbox`,`host`]),T=n({type:a(`confirmation_request`),requestId:r(),toolName:r(),input:l(r(),c()),riskLevel:r(),riskReason:r().optional(),isContainerized:o().optional(),executionTarget:w.optional(),allowlistOptions:t(v),scopeOptions:t(y),directoryScopeOptions:t(b).optional(),diff:x.optional(),conversationId:r().optional(),persistentDecisionsAllowed:o().optional(),toolUseId:r().optional(),acpToolKind:r().optional(),acpOptions:t(C).optional()}),E=n({type:a(`contact_request`),requestId:r(),channel:r().optional(),placeholder:r().optional(),label:r().optional(),description:r().optional(),role:r().optional()}),D=i([`PROVIDER_NETWORK`,`PROVIDER_RATE_LIMIT`,`MANAGED_USAGE_LIMIT`,`PROVIDER_OVERLOADED`,`PROVIDER_API`,`IMAGE_TOO_LARGE`,`PROVIDER_BILLING`,`PROVIDER_ORDERING`,`PROVIDER_WEB_SEARCH`,`PROVIDER_NOT_CONFIGURED`,`PROVIDER_INVALID_KEY`,`MANAGED_KEY_INVALID`,`CONTEXT_TOO_LARGE`,`BUDGET_YIELD_UNRECOVERED`,`MAX_TOKENS_REACHED`,`CONVERSATION_ABORTED`,`CONVERSATION_PROCESSING_FAILED`,`DISK_SPACE_CRITICAL`,`UNKNOWN`]),O=n({type:a(`conversation_error`),conversationId:r(),code:D,userMessage:r(),retryable:o(),debugDetails:r().optional(),errorCategory:r().optional(),connectionName:r().optional(),profileName:r().optional()}),k=i([`created`,`renamed`,`deleted`,`reordered`,`seen_changed`]),A=n({type:a(`conversation_list_invalidated`),reason:k}),j=i([`memory_v3`]),M=n({type:a(`conversation_notice`),conversationId:r(),source:j,code:D,userMessage:r(),errorCategory:r().optional()}),N=n({type:a(`conversation_title_updated`),conversationId:r(),title:r()}),P=i([`disabled`,`ok`,`warning`,`critical`,`unknown`]),F=i([`agent-turns`,`background-work`,`remote-ingress`]),I=n({enabled:o(),state:P,locked:o(),acknowledged:o(),overrideActive:o(),effectivelyLocked:o(),lockId:r().nullable(),usagePercent:s().nullable(),thresholdPercent:s(),path:r().nullable(),lastCheckedAt:r().nullable(),blockedCapabilities:t(F),error:r().nullable()}),L=n({type:a(`disk_pressure_status_changed`),status:I}),xe=n({id:r(),surfaceId:r(),author:r(),content:r(),anchorStart:s().optional(),anchorEnd:s().optional(),anchorText:r().optional(),parentCommentId:r().optional(),status:r(),createdAt:s(),updatedAt:s()}),R=n({type:a(`document_comment_created`),conversationId:r(),surfaceId:r(),comment:xe}),z=n({type:a(`document_comment_deleted`),conversationId:r(),surfaceId:r(),commentId:r()}),Se=n({type:a(`document_comment_reopened`),conversationId:r(),surfaceId:r(),commentId:r()}),Ce=n({type:a(`document_comment_resolved`),conversationId:r(),surfaceId:r(),commentId:r(),resolvedBy:r()}),we=n({type:a(`document_editor_update`),conversationId:r(),surfaceId:r(),markdown:r(),mode:r()}),Te=n({type:a(`error`),message:r(),code:r().optional(),category:r().optional(),errorCategory:r().optional(),requestId:r().optional(),conversationId:r().optional()}),Ee=n({type:a(`generation_cancelled`),conversationId:r().optional()}),B=n({id:r().optional(),filename:r(),mimeType:r(),data:r(),sourceType:i([`sandbox_file`,`host_file`,`tool_block`]).optional(),sizeBytes:s().optional(),thumbnailData:r().optional(),fileBacked:o().optional(),filePath:r().optional()}),De=n({type:a(`generation_handoff`),conversationId:r().optional(),requestId:r().optional(),queuedCount:s(),messageId:r().optional(),attachments:t(B).optional(),attachmentWarnings:t(r()).optional()}),Oe=n({type:a(`home_feed_updated`),updatedAt:r(),newItemCount:s()}),ke=n({kind:i([`plugin`,`workspace`]),id:r()}),Ae=n({type:a(`hook_event`),conversationId:r().optional(),hookName:r(),owner:ke,detail:l(r(),c())}),je=n({type:a(`identity_changed`),name:r(),role:r(),personality:r(),emoji:r(),home:r()}),Me=i([`approved`,`rejected`,`answered`,`cancelled`,`superseded`]),Ne=n({type:a(`interaction_resolved`),requestId:r(),conversationId:r(),state:Me,kind:r()}),Pe=n({type:a(`message_complete`),messageId:r().optional(),conversationId:r().optional(),source:i([`main`,`aux`]).optional(),attachments:t(B).optional(),attachmentWarnings:t(r()).optional()}),Fe=n({type:a(`message_dequeued`),conversationId:r(),requestId:r()}),Ie=n({type:a(`message_queued`),conversationId:r(),requestId:r(),position:s()}),Le=n({type:a(`message_queued_deleted`),conversationId:r(),requestId:r()}),Re=n({type:a(`message_request_complete`),conversationId:r(),requestId:r(),runStillActive:o().optional()}),ze=n({type:a(`navigate_settings`),tab:r()}),Be=n({type:a(`notification_intent`),sourceEventName:r(),title:r(),body:r(),deliveryId:r().optional(),deepLinkMetadata:l(r(),c()).optional(),targetGuardianPrincipalId:r().optional(),silent:o().optional()}),Ve=n({type:a(`open_conversation`),conversationId:r(),title:r().optional(),anchorMessageId:r().optional(),focus:o().optional()}),He=n({type:a(`open_panel`),panelType:r(),data:l(r(),c()).optional(),conversationId:r().optional(),surfaceId:r().optional()}),Ue=n({type:a(`open_url`),url:r().min(1),title:r().optional(),conversationId:r().optional()}),V=n({id:r(),label:r(),description:r().optional()}),H=n({id:r(),question:r(),description:r().optional(),options:t(V),freeTextPlaceholder:r().optional()}),We=n({type:a(`question_request`),requestId:r(),questions:t(H),question:r(),description:r().optional(),options:t(V),freeTextPlaceholder:r().optional(),conversationId:r().optional(),toolUseId:r().optional()}),Ge=n({type:a(`relationship_state_updated`),updatedAt:r()}),Ke=n({type:a(`secret_request`),requestId:r(),service:r(),field:r(),label:r(),description:r().optional(),placeholder:r().optional(),conversationId:r().optional(),purpose:r().optional(),allowedTools:t(r()).optional(),allowedDomains:t(r()).optional(),allowOneTimeSend:o().optional()}),qe=n({type:r(),content:r().optional(),text:r().optional(),result:r().optional(),input:l(r(),c()).optional(),toolName:r().optional(),isError:o().optional(),toolUseId:r().optional()}).passthrough(),Je=n({type:a(`subagent_event`),conversationId:r(),subagentId:r(),event:qe}).strict(),Ye=n({type:a(`subagent_spawned`),subagentId:r(),parentConversationId:r(),label:r(),objective:r(),isFork:o().optional(),parentToolUseId:r().optional()}).strict(),U=i([`pending`,`running`,`awaiting_input`,`completed`,`failed`,`aborted`,`interrupted`]),W=n({inputTokens:s(),outputTokens:s(),estimatedCost:s()}).strict(),Xe=n({type:a(`subagent_status_changed`),subagentId:r(),status:U,error:r().optional(),usage:W.optional()}).strict(),Ze=n({type:a(`sync_changed`),tags:t(r().min(1)).min(1),originClientId:r().min(1).optional()}),Qe=i([`tool_start`,`tool_complete`,`status`]),$e=n({type:a(`tool_output_chunk`),chunk:r(),conversationId:r().optional(),toolUseId:r().optional(),subType:Qe.optional(),subToolName:r().optional(),subToolInput:r().optional(),subToolIsError:o().optional(),subToolId:r().optional(),messageId:r().optional()}),et=n({pattern:r(),label:r()}),tt=i([`anthropic-native`,`brave`,`perplexity`,`tavily`,`firecrawl`]),nt=i([`default`,`firecrawl`]),rt=n({rank:s(),title:r(),url:r(),domain:r(),faviconUrl:r().optional(),snippet:r().optional(),age:r().optional(),score:s().optional()}),it=n({query:r(),provider:tt,resultCount:s(),durationMs:s(),results:t(rt),errorMessage:r().optional()}),at=n({url:r(),finalUrl:r(),provider:nt.optional(),status:s(),contentType:r().optional(),byteCount:s(),charCount:s(),truncated:o(),title:r().optional(),domain:r(),faviconUrl:r().optional(),redirectCount:s(),durationMs:s(),errorMessage:r().optional(),mayRequireJavaScript:o().optional()}),G=n({webSearch:it.optional(),webFetch:at.optional()}),ot=n({type:a(`tool_result`),toolName:r(),result:r(),isError:o().optional(),diff:x.optional(),status:r().optional(),conversationId:r().optional(),imageData:r().optional(),imageDataList:t(r()).optional(),toolUseId:r().optional(),messageId:r().optional(),riskLevel:r().optional(),riskReason:r().optional(),matchedTrustRuleId:r().optional(),isContainerized:o().optional(),riskScopeOptions:t(et).optional(),riskAllowlistOptions:t(v).optional(),riskDirectoryScopeOptions:t(b).optional(),approvalMode:r().optional(),approvalReason:r().optional(),riskThreshold:r().optional(),activityMetadata:G.optional(),completedAt:s().optional()}),st=n({type:a(`tool_use_preview_start`),toolUseId:r(),toolName:r(),conversationId:r().optional(),messageId:r().optional(),previewStartedAt:s().optional()}),ct=n({type:a(`tool_use_start`),toolName:r(),input:l(r(),c()),toolUseId:r().optional(),messageId:r().optional(),conversationId:r().optional(),startedAt:s().optional(),previewStartedAt:s().optional()}),lt=n({type:a(`ui_surface_complete`),conversationId:r(),surfaceId:r(),summary:r(),submittedData:l(r(),c()).optional()}),ut=n({type:a(`ui_surface_dismiss`),conversationId:r(),surfaceId:r()}),dt=n({id:r(),label:r(),style:i([`primary`,`secondary`,`destructive`]).optional(),data:l(r(),c()).optional()}),ft=n({type:a(`ui_surface_show`),conversationId:r(),surfaceId:r(),surfaceType:r(),title:r().optional(),data:l(r(),c()),actions:t(dt).optional(),display:i([`inline`,`panel`]).optional(),messageId:r().optional(),persistent:o().optional(),toolCallId:r().optional()}),pt=n({type:a(`ui_surface_update`),conversationId:r(),surfaceId:r(),data:l(r(),c())}),K=n({type:a(`usage_progress`),conversationId:r(),inputTokens:s(),outputTokens:s(),estimatedCost:s(),model:r()}),mt=n({type:a(`usage_update`),conversationId:r(),inputTokens:s(),outputTokens:s(),cacheCreationInputTokens:s().optional(),cacheReadInputTokens:s().optional(),totalInputTokens:s(),totalOutputTokens:s(),estimatedCost:s(),model:r(),contextWindowTokens:s().optional(),contextWindowMaxTokens:s().optional()}),ht=n({type:a(`user_message_echo`),text:r(),conversationId:r().optional(),messageId:r().optional(),requestId:r().optional(),clientMessageId:r().optional()}).strict(),q=i([`running`,`completed`,`failed`,`aborted`,`cap_exceeded`,`interrupted`]),gt=n({type:a(`workflow_completed`),runId:r(),conversationId:r().optional(),status:q,agentsSpawned:s(),inputTokens:s(),outputTokens:s(),summary:r().optional()}).strict(),_t=n({type:a(`workflow_leaf_finished`),runId:r(),conversationId:r(),seq:s().int(),status:i([`completed`,`failed`]),label:r().optional(),inputTokens:s().optional(),outputTokens:s().optional(),resultSummary:r().optional()}).strict(),vt=n({type:a(`workflow_leaf_started`),runId:r(),conversationId:r(),seq:s().int(),label:r().optional(),phase:r().optional(),promptSummary:r().optional()}).strict(),yt=n({type:a(`workflow_progress`),runId:r(),conversationId:r().optional(),agentsSpawned:s(),phase:r().optional(),label:r().optional(),message:r().optional()}).strict(),bt=n({type:a(`workflow_started`),runId:r(),conversationId:r(),toolUseId:r().optional(),label:r().optional()}).strict(),xt=`syntheticAgentErrorMessage`,St=`compactionAgent`,Ct=3e4,wt=n({cursorInTextField:o().optional().describe(`Whether the cursor is in an editable text field when dictation started`)}).passthrough().describe(`Dictation context (app name, window title, bundle ID, cursor state, selected text)`),Tt=n({transcription:r().describe(`Raw speech transcription`),context:wt,profileId:r().describe(`Optional dictation profile ID`).optional()}),J=n({id:r(),filename:r(),mimeType:r(),sizeBytes:s(),kind:r(),data:r().optional(),thumbnailData:r().optional(),fileBacked:o().optional()}),Et=n({pattern:r(),label:r()}),Dt=n({label:r(),description:r(),pattern:r()}),Ot=n({scope:r(),label:r()}),kt=n({requestId:r(),title:r().optional(),description:r().optional(),toolName:r().optional(),riskLevel:r().optional(),riskReason:r().optional(),input:l(r(),c()).optional(),allowlistOptions:t(v).optional(),scopeOptions:t(y).optional(),directoryScopeOptions:t(b).optional(),persistentDecisionsAllowed:o().optional()}),At=n({requestId:r(),entries:t(H)}),jt=i([`approved`,`denied`,`timed_out`]),Y=n({id:r().optional(),name:r(),input:l(r(),c()),result:r().optional(),isError:o().optional(),imageData:r().optional(),imageDataList:t(r()).optional(),imageAttachmentIds:t(r()).optional(),startedAt:s().optional(),previewStartedAt:s().optional(),completedAt:s().optional(),confirmationDecision:jt.optional(),confirmationLabel:r().optional(),riskLevel:r().optional(),riskReason:r().optional(),matchedTrustRuleId:r().optional(),autoApproved:o().optional(),approvalMode:r().optional(),approvalReason:r().optional(),riskThreshold:r().optional(),riskScopeOptions:t(Et).optional(),riskAllowlistOptions:t(Dt).optional(),riskDirectoryScopeOptions:t(Ot).optional(),activityMetadata:G.optional(),scopeOptions:t(y).optional(),pendingConfirmation:kt.optional(),pendingQuestion:At.optional()}),Mt=n({id:r(),label:r(),style:r().optional(),data:l(r(),c()).optional()}),X=n({surfaceId:r(),surfaceType:r(),title:r().optional(),data:l(r(),c()),actions:t(Mt).optional(),display:r().optional(),persistent:o().optional(),completed:o().optional(),completionSummary:r().optional(),toolCallId:r().optional()}),Nt=n({subagentId:r(),label:r(),status:r(),error:r().optional(),conversationId:r().optional(),objective:r().optional()}),Pt=n({acpSessionId:r(),agent:r().optional()}),Ft=n({id:r(),toolName:r(),conversationId:r(),command:r(),startedAt:s(),status:i([`completed`,`failed`,`cancelled`]),exitCode:s().nullable(),output:r(),completedAt:s()}),It=n({appUrl:r().optional(),webUrl:r().optional()}),Lt=n({emoji:r(),op:i([`added`,`removed`]),actorDisplayName:r().optional(),targetChannelTs:r()}),Rt=n({channelId:r(),channelName:r().optional(),channelTs:r(),threadTs:r().optional(),sender:n({displayName:r().optional(),externalUserId:r().optional()}).optional(),messageLink:It.optional(),threadLink:It.optional(),eventKind:i([`message`,`reaction`]).optional(),reaction:Lt.optional()}),zt=n({type:a(`text`),text:r()}),Bt=n({type:a(`thinking`),thinking:r(),startedAt:s().optional(),completedAt:s().optional()}),Vt=n({type:a(`tool_use`),toolCall:Y}),Ht=n({type:a(`surface`),surface:X}),Ut=n({type:a(`attachment`),attachment:J}),Wt=ee(`type`,[zt,Bt,Vt,Ht,Ut]),Gt=n({id:r(),mergedMessageIds:t(r()).optional(),clientMessageId:r().optional(),role:i([`user`,`assistant`]),timestamp:r(),attachments:t(J),toolCalls:t(Y).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the tool_use variant). Flat list of tool calls.`}).optional(),surfaces:t(X).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the surface variant). Flat list of surfaces.`}).optional(),textSegments:t(r()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Text segments split by tool-call boundaries.`}).optional(),thinkingSegments:t(r()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Reasoning text extracted from thinking blocks.`}).optional(),contentOrder:t(r()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Positional "<type>:<index>" content ordering (e.g. "text:0", "thinking:1").`}).optional(),contentBlocks:t(Wt).optional(),subagentNotification:Nt.optional(),acpNotification:Pt.optional(),backgroundEventNotification:o().optional(),backgroundToolCompletion:Ft.optional(),systemCard:o().optional(),slackMessage:Rt.optional(),queueStatus:i([`queued`,`processing`]).optional(),queuePosition:s().optional()}),Kt=n({status:I}),qt=a(`notification`),Jt=i([`new`,`seen`,`acted_on`,`dismissed`]),Yt=i([`low`,`medium`,`high`,`critical`]),Xt=i([`security`,`scheduling`,`background`,`email`,`system`]),Zt=i([`heartbeat`,`memory_consolidation`,`schedule`,`auto_analysis`,`user`,`other`]),Qt=n({id:r(),label:r(),prompt:r()}),$t=i([`emailDraft`,`documentPreview`,`permissionChat`,`paymentAuth`,`toolPermission`,`updatesList`]),en=n({kind:$t}),tn=n({id:r(),type:qt,priority:s().int().min(0).max(100),title:r().optional(),summary:r(),timestamp:r(),status:Jt.default(`new`),expiresAt:r().optional(),actions:t(Qt).optional(),urgency:Yt.optional(),conversationId:r().optional(),detailPanel:en.optional(),category:Xt.optional(),noteworthy:o().optional(),fromAssistant:o().optional(),metadata:l(r(),c()).optional(),sourceType:Zt.optional(),sourceKey:r().optional(),sourceLabel:r().optional(),createdAt:r()}),nn=i([`deterministic`,`assistant`]),rn=n({id:r(),label:r(),icon:r().optional(),prompt:r(),source:nn}),an=n({greeting:r(),timeAwayLabel:r(),newCount:s().int().min(0)}),on=n({items:t(tn),updatedAt:r(),contextBanner:an,suggestedPrompts:t(rn)}),sn=n({id:r(),category:i([`voice`,`world`,`priorities`]),text:r(),confidence:i([`strong`,`uncertain`]),source:i([`onboarding`,`inferred`])}),cn=n({id:r(),name:r(),description:r(),tier:i([`unlocked`,`next-up`,`earned`]),gate:r(),unlockHint:r().optional(),ctaLabel:r().optional()}),ln=n({version:a(1),assistantId:r(),tier:ae([a(1),a(2),a(3),a(4)]),progressPercent:s(),facts:t(sn),capabilities:t(cn),conversationCount:s(),hatchedDate:r(),assistantName:r(),userName:r().optional(),updatedAt:r()}),un=n({key:r(),label:r(),ms:s()}),dn=n({phases:t(un),ttftMs:s().nullish(),totalToFirstTokenMs:s().nullish(),providerDurationMs:s().nullish(),firstTokenKind:i([`thinking`,`text`]).nullish()}),fn=n({provider:r().nullish(),model:r().nullish(),status:r().nullish(),inputTokens:s().nullish(),outputTokens:s().nullish(),cacheCreationInputTokens:s().nullish(),cacheReadInputTokens:s().nullish(),stopReason:r().nullish(),requestMessageCount:s().nullish(),requestToolCount:s().nullish(),responseMessageCount:s().nullish(),responseToolCallCount:s().nullish(),responsePreview:r().nullish(),toolCallNames:t(r()).nullish(),estimatedCostUsd:s().nullish(),durationMs:s().nullish()}),Z=n({kind:r(),label:r().nullish(),role:r().nullish(),text:r().nullish(),toolName:r().nullish(),data:c().optional(),language:r().nullish()}),pn=n({name:r().nullish(),message:r().nullish(),code:r().nullish(),provider:r().nullish(),statusCode:s().nullish(),retryAfterMs:s().nullish(),apiErrorCode:r().nullish(),apiErrorType:r().nullish(),apiErrorParam:r().nullish(),requestId:r().nullish()}),mn=n({id:r(),createdAt:s(),requestPayload:se(),responsePayload:se(),provider:r().nullish(),summary:fn.nullish(),requestSections:t(Z).nullish(),responseSections:t(Z).nullish(),agentLoopExitReason:r().nullish(),callSite:r().nullish(),error:pn.nullish(),latency:dn.nullish()}),hn=n({nodeId:r(),score:s(),semanticSimilarity:s(),recencyBoost:s(),type:r().optional()}),gn=n({reason:r(),semanticUnavailable:o(),fallbackSources:t(r())}),_n=n({enabled:o(),degraded:o(),provider:r().nullable(),model:r().nullable(),degradation:gn.nullable(),semanticHits:s().nullish(),mergedCount:s().nullish(),selectedCount:s().nullish(),tier1Count:s().nullish(),tier2Count:s().nullish(),hybridSearchLatencyMs:s().nullish(),sparseVectorUsed:o().nullish(),injectedTokens:s().nullish(),latencyMs:s().nullish(),topCandidates:t(hn),injectedText:r().nullable(),reason:r().nullable(),queryContext:r().nullable()}),vn=n({slug:r(),finalActivation:s(),ownActivation:s(),priorActivation:s(),simUser:s(),simAssistant:s(),simNow:s(),simUserRerankBoost:s().optional(),simAssistantRerankBoost:s().optional(),inRerankPool:o().optional(),spreadContribution:s(),source:r(),status:r()}),yn=n({d:s(),c_user:s(),c_assistant:s(),c_now:s(),k:s(),hops:s(),top_k:s(),epsilon:s()}),bn=n({turn:s(),mode:r(),concepts:t(vn),config:yn}),Q=n({slug:r(),source:r(),pinned:o(),sectionOrdinal:s().nullable().optional(),sectionHeading:r().nullable().optional()}),xn=n({turn:s(),live:o(),selections:t(Q),injectedText:r()}),Sn=n({messageId:r().nullish(),conversationKey:r().nullish(),conversationId:r().nullish(),conversationKind:r(),conversationTotalEstimatedCostUsd:s().nullish(),logs:t(mn),memoryRecall:_n.nullable(),memoryV2Activation:bn.nullable(),memoryV3Selection:xn.nullish()}),Cn=n({type:r(),content:r(),toolName:r().optional(),isError:o().optional(),messageId:r().optional(),toolUseId:r().optional(),input:l(r(),c()).optional()}),wn=n({subagentId:r(),objective:r().optional(),status:U.optional(),usage:W.optional(),events:t(Cn)}),Tn=n({seq:s().int(),kind:i([`agent`,`workflow`]),label:r().optional(),phase:r().optional(),promptSummary:r().optional(),status:r(),resultSummary:r().optional(),inputTokens:s().optional(),outputTokens:s().optional(),createdAt:s().nullable()}),En=n({runId:r(),status:q.optional(),agentsSpawned:s().optional(),inputTokens:s().optional(),outputTokens:s().optional(),phase:r().optional(),leaves:t(Tn)}),Dn=n({title:r().optional(),subtitle:r().optional(),body:r().optional(),metadata:t(n({label:u(),value:u()})).optional(),template:r().optional(),templateData:l(r(),c()).optional()}),On=ne(e=>{let t=(typeof e==`string`?e.split(`,`):Array.isArray(e)?e:[]).map(e=>typeof e==`string`||typeof e==`number`?String(e).trim():``).filter(e=>e.length>0);return t.length>0?t:void 0},t(r()).optional()),kn=n({prompt:u().optional(),acceptedTypes:On,maxFiles:ce().int().positive().optional().catch(void 0),maxSizeBytes:ce().positive().optional().catch(void 0)}),An=e({ACPOptionKindSchema:()=>S,ACPOptionSchema:()=>C,AcpSessionCompletedEventSchema:()=>ue,AcpSessionErrorEventSchema:()=>de,AcpSessionSpawnedEventSchema:()=>fe,AcpSessionUpdateEventSchema:()=>me,AcpSessionUpdateTypeSchema:()=>pe,AcpSessionUsageEventSchema:()=>he,AcpStopReasonSchema:()=>le,AllowlistOptionSchema:()=>v,AssistantActivityAnchorSchema:()=>_e,AssistantActivityPhaseSchema:()=>ge,AssistantActivityReasonSchema:()=>ve,AssistantActivityStateEventSchema:()=>ye,AssistantEventEnvelopeSchema:()=>jn,AssistantEventSchema:()=>$,AssistantOutboundAttachmentSchema:()=>B,AssistantTextDeltaEventSchema:()=>be,AssistantThinkingDeltaEventSchema:()=>d,AssistantTurnStartEventSchema:()=>f,AvatarUpdatedEventSchema:()=>p,BackgroundToolCompletedEventSchema:()=>m,BackgroundToolStartedEventSchema:()=>h,CALL_SITE_COMPACTION_AGENT:()=>St,CALL_SITE_SYNTHETIC_AGENT_ERROR_MESSAGE:()=>xt,CapabilitySchema:()=>cn,CardSurfaceDataSchema:()=>Dn,CompactionCircuitClosedEventSchema:()=>g,CompactionCircuitOpenEventSchema:()=>_,ConfirmationDiffSchema:()=>x,ConfirmationExecutionTargetSchema:()=>w,ConfirmationRequestEventSchema:()=>T,ContactRequestEventSchema:()=>E,ContextBannerSchema:()=>an,ConversationAttachmentBlockSchema:()=>Ut,ConversationContentBlockSchema:()=>Wt,ConversationErrorCodeSchema:()=>D,ConversationErrorEventSchema:()=>O,ConversationListInvalidatedEventSchema:()=>A,ConversationListInvalidatedReasonSchema:()=>k,ConversationMessageAttachmentSchema:()=>J,ConversationMessageSchema:()=>Gt,ConversationMessageSurfaceSchema:()=>X,ConversationMessageToolCallSchema:()=>Y,ConversationNoticeEventSchema:()=>M,ConversationNoticeSourceSchema:()=>j,ConversationSlackMessageSchema:()=>Rt,ConversationSubagentNotificationSchema:()=>Nt,ConversationSurfaceBlockSchema:()=>Ht,ConversationTextBlockSchema:()=>zt,ConversationThinkingBlockSchema:()=>Bt,ConversationTitleUpdatedEventSchema:()=>N,ConversationToolUseBlockSchema:()=>Vt,DEFAULT_TOOL_EXECUTION_TIMEOUT_SEC:()=>120,DictationContextSchema:()=>wt,DictationRequestSchema:()=>Tt,DirectoryScopeOptionSchema:()=>b,DiskPressureBlockedCapabilitySchema:()=>F,DiskPressureStateSchema:()=>P,DiskPressureStatusChangedEventSchema:()=>L,DiskPressureStatusResponseSchema:()=>Kt,DiskPressureStatusSchema:()=>I,DocumentCommentCreatedEventSchema:()=>R,DocumentCommentDeletedEventSchema:()=>z,DocumentCommentReopenedEventSchema:()=>Se,DocumentCommentResolvedEventSchema:()=>Ce,DocumentEditorUpdateEventSchema:()=>we,ErrorEventSchema:()=>Te,FactSchema:()=>sn,FeedActionSchema:()=>Qt,FeedItemCategorySchema:()=>Xt,FeedItemDetailPanelKindSchema:()=>$t,FeedItemDetailPanelSchema:()=>en,FeedItemSchema:()=>tn,FeedItemSourceTypeSchema:()=>Zt,FeedItemStatusSchema:()=>Jt,FeedItemTypeSchema:()=>qt,FeedItemUrgencySchema:()=>Yt,FileUploadSurfaceDataSchema:()=>kn,GenerationCancelledEventSchema:()=>Ee,GenerationHandoffEventSchema:()=>De,HomeFeedResponseSchema:()=>on,HomeFeedUpdatedEventSchema:()=>Oe,HookEventOwnerSchema:()=>ke,HookEventSchema:()=>Ae,IdentityChangedEventSchema:()=>je,InteractionResolutionStateSchema:()=>Me,InteractionResolvedEventSchema:()=>Ne,LLMCallErrorSchema:()=>pn,LLMCallSummarySchema:()=>fn,LLMContextSectionSchema:()=>Z,LLMRequestLogEntrySchema:()=>mn,LatencyBreakdownSchema:()=>dn,LatencyPhaseSchema:()=>un,LlmContextResponseSchema:()=>Sn,MemoryCandidateSchema:()=>hn,MemoryDegradationSchema:()=>gn,MemoryRecallLogSchema:()=>_n,MemoryV2ActivationLogSchema:()=>bn,MemoryV2ConceptRowSchema:()=>vn,MemoryV2ConfigSnapshotSchema:()=>yn,MemoryV3SelectionLogSchema:()=>xn,MemoryV3SelectionRowSchema:()=>Q,MessageCompleteEventSchema:()=>Pe,MessageDequeuedEventSchema:()=>Fe,MessageQueuedDeletedEventSchema:()=>Le,MessageQueuedEventSchema:()=>Ie,MessageRequestCompleteEventSchema:()=>Re,NavigateSettingsEventSchema:()=>ze,NotificationIntentEventSchema:()=>Be,OpenConversationEventSchema:()=>Ve,OpenPanelEventSchema:()=>He,OpenUrlEventSchema:()=>Ue,PendingToolConfirmationSchema:()=>kt,QuestionEntrySchema:()=>H,QuestionOptionSchema:()=>V,QuestionRequestEventSchema:()=>We,RelationshipStateSchema:()=>ln,RelationshipStateUpdatedEventSchema:()=>Ge,RiskScopeOptionSchema:()=>et,SSE_REPLAY_RING_AGE_LIMIT_MS:()=>Ct,SSE_REPLAY_RING_COUNT_LIMIT:()=>200,ScopeOptionSchema:()=>y,SecretRequestEventSchema:()=>Ke,SubagentDetailEventSchema:()=>Cn,SubagentDetailResponseSchema:()=>wn,SubagentEventEventSchema:()=>Je,SubagentInnerEventSchema:()=>qe,SubagentSpawnedEventSchema:()=>Ye,SubagentStatusChangedEventSchema:()=>Xe,SubagentStatusSchema:()=>U,SubagentUsageStatsSchema:()=>W,SuggestedPromptSchema:()=>rn,SuggestedPromptSourceSchema:()=>nn,SurfaceActionSchema:()=>dt,SyncChangedEventSchema:()=>Ze,ToolActivityMetadataSchema:()=>G,ToolOutputChunkEventSchema:()=>$e,ToolOutputChunkSubTypeSchema:()=>Qe,ToolResultEventSchema:()=>ot,ToolUsePreviewStartEventSchema:()=>st,ToolUseStartEventSchema:()=>ct,UISurfaceCompleteEventSchema:()=>lt,UISurfaceDismissEventSchema:()=>ut,UISurfaceShowEventSchema:()=>ft,UISurfaceUpdateEventSchema:()=>pt,UsageProgressEventSchema:()=>K,UsageUpdateEventSchema:()=>mt,UserMessageEchoEventSchema:()=>ht,WebFetchMetadataSchema:()=>at,WebSearchMetadataSchema:()=>it,WebSearchProviderIdSchema:()=>tt,WebSearchResultItemSchema:()=>rt,WorkflowCompletedEventSchema:()=>gt,WorkflowJournalResponseSchema:()=>En,WorkflowLeafFinishedEventSchema:()=>_t,WorkflowLeafSchema:()=>Tn,WorkflowLeafStartedEventSchema:()=>vt,WorkflowProgressEventSchema:()=>yt,WorkflowRunStatusSchema:()=>q,WorkflowStartedEventSchema:()=>bt}),$=ee(`type`,[ue,de,fe,me,he,ye,be,d,f,p,m,h,g,_,T,E,O,A,M,N,L,R,z,Se,Ce,we,Te,Ee,De,Oe,Ae,je,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,Je,Ye,Xe,Ze,$e,ot,st,ct,lt,ut,ft,pt,K,mt,ht,gt,_t,vt,yt,bt]),jn=n({id:r(),conversationId:r().optional(),seq:s().int().optional(),emittedAt:r(),message:$});export{kn as a,Kt as c,xt as d,K as f,Dn as i,Ct as l,$ as n,En as o,An as r,wn as s,jn as t,St as u};
@@ -1 +1 @@
1
- function e(e,t){return e&&typeof e==`object`&&!Array.isArray(e)?e:typeof e==`string`&&!e.trimStart().startsWith(`<`)?{detail:e.slice(0,500)||t?.statusText||`Request failed.`}:{detail:t?.statusText||`Request failed.`}}function t(e,t,n){if(e&&typeof e==`object`&&!Array.isArray(e)){if(`detail`in e&&typeof e.detail==`string`)return e.detail;if(`error`in e){if(typeof e.error==`string`)return e.error;if(e.error&&typeof e.error==`object`&&`message`in e.error&&typeof e.error.message==`string`)return e.error.message}if(`message`in e&&typeof e.message==`string`)return e.message}return typeof e==`string`&&e&&!e.trimStart().startsWith(`<`)?e:n??(t?`HTTP ${t.status}`:`Request failed.`)}function n(e,t,n){if(!e)throw t instanceof Error?t:Error(n)}var r=class extends Error{status;constructor(e,t){super(t),this.name=`ApiError`,this.status=e}};function i(e,n){return new r(n.status,t(e,n,`HTTP ${n.status}`))}export{e as a,i,n,t as r,r as t};
1
+ function e(e,t){return e&&typeof e==`object`&&!Array.isArray(e)?e:typeof e==`string`&&!e.trimStart().startsWith(`<`)?{detail:e.slice(0,500)||t?.statusText||`Request failed.`}:{detail:t?.statusText||`Request failed.`}}function t(e,t,n){if(e&&typeof e==`object`&&!Array.isArray(e)){if(`detail`in e&&typeof e.detail==`string`)return e.detail;if(`error`in e){if(typeof e.error==`string`)return e.error;if(e.error&&typeof e.error==`object`&&`message`in e.error&&typeof e.error.message==`string`)return e.error.message}if(`message`in e&&typeof e.message==`string`)return e.message}return typeof e==`string`&&e&&!e.trimStart().startsWith(`<`)?e:n??(t?`HTTP ${t.status}`:`Request failed.`)}function n(e,t,n){if(!e)throw t instanceof Error?t:Error(n)}var r=class extends Error{status;constructor(e,t){super(t),this.name=`ApiError`,this.status=e}};export{e as i,n,t as r,r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./input-ZpyYt_a0.js";import{t as s}from"./dropdown-BxYrCXBS.js";import{t as c}from"./is-electron-y5bNUVyG.js";import{c as l}from"./routes-Cwb-U9H-.js";import{pn as u}from"./index-_0CSPD03.js";import{a as d,i as f,n as p,o as m,r as h,s as g}from"./provider-key-ACM9xzKs.js";import"./onboarding-step-layout-2XcmxqFN.js";var _=e(t(),1),v=a();function y(){let e=i(),[t]=r(),a=t.get(`hosting`),y=c(),b=p(),[x,S]=(0,_.useState)(()=>b?.provider??f.id),[C,w]=(0,_.useState)(()=>b?.key??``),[T,E]=(0,_.useState)(()=>b?.model??m(b?.provider??f.id)??``),[D,O]=(0,_.useState)(()=>b?.baseUrl??``),[k,A]=(0,_.useState)(()=>b?.customModels??``),j=g(x)??f,M=j.models??[],N=j.requiresKey,P=M.length>0,F=x===`openai-compatible`,I=(!(N&&!F)||C.trim().length>0)&&(!P||T.trim().length>0)&&(!F||D.trim().length>0&&k.trim().length>0);return(0,v.jsx)(u,{children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${y?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,v.jsx)(`h1`,{className:y?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,v.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${y?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose the model provider your assistant should use.`}),(0,v.jsxs)(`div`,{className:`flex w-full flex-col gap-4 ${y?`mt-8`:`mt-10`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,v.jsx)(s,{"aria-label":`Provider`,value:x,onChange:e=>{let t=g(e);t&&(S(t.id),w(``),E(m(t.id)??``))},options:d.map(e=>({value:e.id,label:e.displayName}))})]}),M.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,v.jsx)(s,{"aria-label":`Model`,value:T,onChange:E,options:M.map(e=>({value:e.id,label:e.displayName}))})]}),F&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,v.jsx)(o,{type:`text`,placeholder:`http://localhost:1234/v1`,value:D,onChange:e=>O(e.target.value),fullWidth:!0})]}),(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,v.jsx)(o,{type:`text`,placeholder:`model-1, model-2`,value:k,onChange:e=>A(e.target.value),fullWidth:!0}),(0,v.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),N&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(o,{type:`password`,label:`${j.displayName} API Key`,placeholder:j.apiKeyPlaceholder??`Enter your API key`,value:C,onChange:e=>w(e.target.value),className:`touch-mobile:text-[16px]`,fullWidth:!0}),j.docsUrl&&(0,v.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,v.jsx)(`a`,{href:j.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${y?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,v.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!I,onClick:()=>{if(!I)return;let t=T.trim()||m(x);h({provider:x,key:C.trim(),...t?{model:t}:{},...F?{baseUrl:D.trim(),customModels:k.trim()}:{}}),e(a?`${l.onboarding.privacy}?hosting=${a}`:l.onboarding.privacy)},className:y?void 0:`h-11 text-base`,children:`Continue`}),(0,v.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(l.onboarding.hosting)},className:y?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{y as ApiKeyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./input-ZpyYt_a0.js";import{t as s}from"./dropdown-BMNSccmo.js";import{t as c}from"./is-electron-DBOtwp5h.js";import{c as l}from"./routes-XPLb07Av.js";import{vn as u}from"./index-CmaRQR9x.js";import{a as d,i as f,n as p,o as m,r as h,s as g}from"./provider-key-BGsg7FL-.js";import"./onboarding-step-layout-2XcmxqFN.js";var _=e(t(),1),v=a();function y(){let e=i(),[t]=r(),a=t.get(`hosting`),y=c(),b=p(),[x,S]=(0,_.useState)(()=>b?.provider??f.id),[C,w]=(0,_.useState)(()=>b?.key??``),[T,E]=(0,_.useState)(()=>b?.model??m(b?.provider??f.id)??``),[D,O]=(0,_.useState)(()=>b?.baseUrl??``),[k,A]=(0,_.useState)(()=>b?.customModels??``),j=g(x)??f,M=j.models??[],N=j.requiresKey,P=M.length>0,F=x===`openai-compatible`,I=(!(N&&!F)||C.trim().length>0)&&(!P||T.trim().length>0)&&(!F||D.trim().length>0&&k.trim().length>0);return(0,v.jsx)(u,{children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${y?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,v.jsx)(`h1`,{className:y?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,v.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${y?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose the model provider your assistant should use.`}),(0,v.jsxs)(`div`,{className:`flex w-full flex-col gap-4 ${y?`mt-8`:`mt-10`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,v.jsx)(s,{"aria-label":`Provider`,value:x,onChange:e=>{let t=g(e);t&&(S(t.id),w(``),E(m(t.id)??``))},options:d.map(e=>({value:e.id,label:e.displayName}))})]}),M.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,v.jsx)(s,{"aria-label":`Model`,value:T,onChange:E,options:M.map(e=>({value:e.id,label:e.displayName}))})]}),F&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,v.jsx)(o,{type:`text`,placeholder:`http://localhost:1234/v1`,value:D,onChange:e=>O(e.target.value),fullWidth:!0})]}),(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,v.jsx)(o,{type:`text`,placeholder:`model-1, model-2`,value:k,onChange:e=>A(e.target.value),fullWidth:!0}),(0,v.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),N&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(o,{type:`password`,label:`${j.displayName} API Key`,placeholder:j.apiKeyPlaceholder??`Enter your API key`,value:C,onChange:e=>w(e.target.value),className:`touch-mobile:text-[16px]`,fullWidth:!0}),j.docsUrl&&(0,v.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,v.jsx)(`a`,{href:j.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${y?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,v.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!I,onClick:()=>{if(!I)return;let t=T.trim()||m(x);h({provider:x,key:C.trim(),...t?{model:t}:{},...F?{baseUrl:D.trim(),customModels:k.trim()}:{}}),e(a?`${l.onboarding.privacy}?hosting=${a}`:l.onboarding.privacy)},className:y?void 0:`h-11 text-base`,children:`Continue`}),(0,v.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(l.onboarding.hosting)},className:y?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{y as ApiKeyScreen};
@@ -1 +1 @@
1
- import{t as e}from"./is-electron-y5bNUVyG.js";async function t(){return e()?await window.vellum?.app.versionInfo()??null:null}async function n(){e()&&await window.vellum?.app.openWebsite()}export{n,t};
1
+ import{t as e}from"./is-electron-DBOtwp5h.js";async function t(){return e()?await window.vellum?.app.versionInfo()??null:null}async function n(){e()&&await window.vellum?.app.openWebsite()}export{n,t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{u as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{c as r}from"./routes-Cwb-U9H-.js";var i=e(t(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(`${r.settings.debug}?tab=archive`,{replace:!0})},[e]),null}export{a as ArchiveRedirectPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{u as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{c as r}from"./routes-XPLb07Av.js";var i=e(t(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(`${r.settings.debug}?tab=archive`,{replace:!0})},[e]),null}export{a as ArchiveRedirectPage};
@@ -1 +1 @@
1
- import{n as e}from"./toast-Be8FEQ-I.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{c as r,n as i,s as a,t as o,u as s}from"./feature-flag-catalog-DpiUkDzU.js";import{h as c}from"./sdk.gen-BhtkuoSl.js";var l={...o},u={...i},d=0,f={};function p(e={}){l={...o,...e};for(let e of Object.keys(f))delete f[e]}function m(e={}){u={...i,...e}}function h(){p(),m()}var g=a(`assistant`);function _(e){return l[e]??o[e]??!1}function v(e){return u[e]??i[e]??``}var y=n(t()(t=>{let n=t;return{...o,...g.bool,hasHydrated:!1,stringFlags:{...i,...g.str},setFlags:e=>t(t=>{p(e);let n={...e,...g.bool};return Object.keys(n).some(e=>n[e]!==t[e])?n:t}),setFlag:(n,i,a)=>{let o=++d,u=()=>{if(f[n]!==o)return;delete f[n];let a=_(n);t(e=>e[n]===i?{[n]:a}:e),e.error(`Couldn't update "${r(n)?.label??n}" — change reverted.`)},p=s(n);!a||!p||(f[n]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(l[n]=i,f[n]===o&&delete f[n]):u()}).catch(u),t({[n]:g.bool[n]??i}))},markHydrated:()=>t({hasHydrated:!0}),resetForAssistantSwitch:()=>{h(),t({...o,...g.bool,hasHydrated:!1}),n({stringFlags:{...i,...g.str}})},setStringFlags:e=>n(t=>{m(e);let n={...e,...g.str},r=t.stringFlags;return Object.keys(n).some(e=>n[e]!==r[e])?{stringFlags:n}:t}),setStringFlag:(t,i,a)=>{let o=++d,l=()=>{if(f[t]!==o)return;delete f[t];let a=v(t);n(e=>e.stringFlags[t]===i?{stringFlags:{...e.stringFlags,[t]:a}}:e),e.error(`Couldn't update "${r(t)?.label??t}" — change reverted.`)},p=s(t);!a||!p||(f[t]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(u[t]=i,f[t]===o&&delete f[t]):l()}).catch(l),n(e=>({stringFlags:{...e.stringFlags,[t]:g.str[t]??i}})))}}}));export{y as t};
1
+ import{n as e}from"./toast-ZoZVyeDI.js";import{n as t,t as n}from"./create-selectors-tFGOU7xo.js";import{c as r,n as i,s as a,t as o,u as s}from"./feature-flag-catalog-C-DtLj8f.js";import{h as c}from"./sdk.gen-BhtkuoSl.js";var l={...o},u={...i},d=0,f={};function p(e={}){l={...o,...e};for(let e of Object.keys(f))delete f[e]}function m(e={}){u={...i,...e}}function h(){p(),m()}var g=a(`assistant`);function _(e){return l[e]??o[e]??!1}function v(e){return u[e]??i[e]??``}var y=n(t()(t=>{let n=t;return{...o,...g.bool,hasHydrated:!1,stringFlags:{...i,...g.str},setFlags:e=>t(t=>{p(e);let n={...e,...g.bool};return Object.keys(n).some(e=>n[e]!==t[e])?n:t}),setFlag:(n,i,a)=>{let o=++d,u=()=>{if(f[n]!==o)return;delete f[n];let a=_(n);t(e=>e[n]===i?{[n]:a}:e),e.error(`Couldn't update "${r(n)?.label??n}" — change reverted.`)},p=s(n);!a||!p||(f[n]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(l[n]=i,f[n]===o&&delete f[n]):u()}).catch(u),t({[n]:g.bool[n]??i}))},markHydrated:()=>t({hasHydrated:!0}),resetForAssistantSwitch:()=>{h(),t({...o,...g.bool,hasHydrated:!1}),n({stringFlags:{...i,...g.str}})},setStringFlags:e=>n(t=>{m(e);let n={...e,...g.str},r=t.stringFlags;return Object.keys(n).some(e=>n[e]!==r[e])?{stringFlags:n}:t}),setStringFlag:(t,i,a)=>{let o=++d,l=()=>{if(f[t]!==o)return;delete f[t];let a=v(t);n(e=>e.stringFlags[t]===i?{stringFlags:{...e.stringFlags,[t]:a}}:e),e.error(`Couldn't update "${r(t)?.label??t}" — change reverted.`)},p=s(t);!a||!p||(f[t]=o,c({path:{assistant_id:a,flag_key:p},body:{enabled:i},throwOnError:!1}).then(e=>{e.response?.ok?(u[t]=i,f[t]===o&&delete f[t]):l()}).catch(l),n(e=>({stringFlags:{...e.stringFlags,[t]:g.str[t]??i}})))}}}));export{y as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./create-selectors-tFGOU7xo.js";import{t as n}from"./impersonate-version-flag-CjFVQtQC.js";var r=t(e(e=>({name:null,version:null,assistantId:null,setIdentity:(t,r,i=null)=>{e({name:t,version:n()??r,assistantId:i})},clearIdentity:()=>e({name:null,version:null,assistantId:null})})));export{r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,t as n}from"./capture-error-anSemq95.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./loader-circle-Ck8fq3yv.js";import"./src-CheJrlfT.js";import"./tag-B6WeUtBW.js";import{n as s}from"./toast-Be8FEQ-I.js";import"./auth-store-CbvnWDS-.js";import{a as c,r as l}from"./api-Ffg_vD9E.js";import{t as u}from"./assistant-feature-flag-store-aNAjw1qx.js";import{t as d}from"./use-active-assistant-id-DwLFgABu.js";import"./environment-store-R_3zZFKL.js";var f=e(r(),1),p=a();function m({value:e,max:t,caption:n}){let r=t>0?Math.max(0,Math.min(e/t*100,100)):0,i=r>90;return(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,p.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-200`,style:{width:`${r}%`,backgroundColor:i?`var(--system-negative-strong)`:`var(--system-positive-strong)`}})}),n&&(0,p.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:n})]})}var h=7,g=2e3;function _(e){let t=(0,f.useRef)(0),n=(0,f.useRef)(null),[r,i]=(0,f.useState)(null),a=(0,f.useCallback)(()=>{if(t.current+=1,t.current>=h){t.current=0;let r=u.getState(),a=!r.settingsDeveloperNav;r.setFlag(`settingsDeveloperNav`,a,e),i(a?`Developer mode enabled`:`Developer mode disabled`),n.current!==null&&clearTimeout(n.current),n.current=setTimeout(()=>{i(null),n.current=null},g)}},[e]);return(0,f.useEffect)(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{onTap:a,message:r}}function v({version:e,loading:t,assistantId:n}){let{onTap:r,message:i}=_(n);return t?(0,p.jsxs)(`span`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,p.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading version...`]}):e?(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`button`,{type:`button`,className:`break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:r,children:e}),i&&(0,p.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:i})]}):(0,p.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`—`})}var y=`currentAssistant`,b=4e3,x=9e4;function S(e,t){return(e.memory?.maxMb??null)!==(t.memory?.maxMb??null)||(e.cpu?.maxCores??null)!==(t.cpu?.maxCores??null)}function C(){let e=d(),{data:r=null,isLoading:a,refetch:o}=i({queryKey:[y,e],queryFn:async()=>{let t=await l(e);return t.ok?t.data:null},retry:!1}),u=r?.id,[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),C=(0,f.useRef)(0),w=(0,f.useRef)(0),T=(0,f.useCallback)(async e=>{if(!u)return m(null),g(!1),null;C.current+=1;let r=C.current;g(!0);try{let t=await c(u);return r===C.current?t.ok?(m(t.data),t.data):(e?.keepStaleOnError||m(null),null):null}catch(i){return r===C.current?(e?.keepStaleOnError||m(null),!t(i)&&!e?.keepStaleOnError&&(n(i,{context:`fetch_assistant_healthz`}),s.error(`Failed to load assistant info`)),null):null}finally{r===C.current&&g(!1)}},[u]);return(0,f.useEffect)(()=>{T()},[T]),(0,f.useEffect)(()=>()=>{w.current+=1,v(!1),m(null)},[u]),{assistant:r,assistantLoading:a,healthz:p,healthzLoading:h,healthzPolling:_,refetch:(0,f.useCallback)(async()=>{await o(),await T()},[o,T]),refetchUntilResized:(0,f.useCallback)(async e=>{let t=++w.current,n=Date.now()+x;v(!0);let r=e;try{for(o();Date.now()<n&&t===w.current;){if(await new Promise(e=>setTimeout(e,b)),t!==w.current)return;let e=await T({keepStaleOnError:!0});if(t!==w.current)return;if(e){if(r==null){r=e;continue}if(S(e,r))return}}}finally{t===w.current&&v(!1)}},[T,o])}}function w(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${e.toFixed(0)} MB`}export{m as a,_ as i,C as n,v as r,w as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{n as t,t as n}from"./capture-error-BGD3-GQf.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./loader-circle-D57RZgLH.js";import"./src-CDdn26Yb.js";import"./tag-B6WeUtBW.js";import{n as s}from"./toast-ZoZVyeDI.js";import"./auth-store-B6EXnaee.js";import{a as c,r as l}from"./api-BBMl4mW3.js";import{t as u}from"./assistant-feature-flag-store-BpbbAIKZ.js";import{t as d}from"./use-active-assistant-id-9rGx8kT9.js";import"./environment-store-D_Bc9wnl.js";var f=e(r(),1),p=a();function m({value:e,max:t,caption:n}){let r=t>0?Math.max(0,Math.min(e/t*100,100)):0,i=r>90;return(0,p.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,p.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-[var(--surface-active)]`,children:(0,p.jsx)(`div`,{className:`h-full rounded-full transition-[width] duration-200`,style:{width:`${r}%`,backgroundColor:i?`var(--system-negative-strong)`:`var(--system-positive-strong)`}})}),n&&(0,p.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:n})]})}var h=7,g=2e3;function _(e){let t=(0,f.useRef)(0),n=(0,f.useRef)(null),[r,i]=(0,f.useState)(null),a=(0,f.useCallback)(()=>{if(t.current+=1,t.current>=h){t.current=0;let r=u.getState(),a=!r.settingsDeveloperNav;r.setFlag(`settingsDeveloperNav`,a,e),i(a?`Developer mode enabled`:`Developer mode disabled`),n.current!==null&&clearTimeout(n.current),n.current=setTimeout(()=>{i(null),n.current=null},g)}},[e]);return(0,f.useEffect)(()=>()=>{n.current!==null&&clearTimeout(n.current)},[]),{onTap:a,message:r}}function v({version:e,loading:t,assistantId:n}){let{onTap:r,message:i}=_(n);return t?(0,p.jsxs)(`span`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,p.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading version...`]}):e?(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`button`,{type:`button`,className:`break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:r,children:e}),i&&(0,p.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:i})]}):(0,p.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`—`})}var y=`currentAssistant`,b=4e3,x=9e4;function S(e,t){return(e.memory?.maxMb??null)!==(t.memory?.maxMb??null)||(e.cpu?.maxCores??null)!==(t.cpu?.maxCores??null)}function C(){let e=d(),{data:r=null,isLoading:a,refetch:o}=i({queryKey:[y,e],queryFn:async()=>{let t=await l(e);return t.ok?t.data:null},retry:!1}),u=r?.id,[p,m]=(0,f.useState)(null),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),C=(0,f.useRef)(0),w=(0,f.useRef)(0),T=(0,f.useCallback)(async e=>{if(!u)return m(null),g(!1),null;C.current+=1;let r=C.current;g(!0);try{let t=await c(u);return r===C.current?t.ok?(m(t.data),t.data):(e?.keepStaleOnError||m(null),null):null}catch(i){return r===C.current?(e?.keepStaleOnError||m(null),!t(i)&&!e?.keepStaleOnError&&(n(i,{context:`fetch_assistant_healthz`}),s.error(`Failed to load assistant info`)),null):null}finally{r===C.current&&g(!1)}},[u]);return(0,f.useEffect)(()=>{T()},[T]),(0,f.useEffect)(()=>()=>{w.current+=1,v(!1),m(null)},[u]),{assistant:r,assistantLoading:a,healthz:p,healthzLoading:h,healthzPolling:_,refetch:(0,f.useCallback)(async()=>{await o(),await T()},[o,T]),refetchUntilResized:(0,f.useCallback)(async e=>{let t=++w.current,n=Date.now()+x;v(!0);let r=e;try{for(o();Date.now()<n&&t===w.current;){if(await new Promise(e=>setTimeout(e,b)),t!==w.current)return;let e=await T({keepStaleOnError:!0});if(t!==w.current)return;if(e){if(r==null){r=e;continue}if(S(e,r))return}}}finally{t===w.current&&v(!1)}},[T,o])}}function w(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${e.toFixed(0)} MB`}export{m as a,_ as i,C as n,v as r,w as t};