@vellumai/web 0.10.0-staging.1 → 0.10.0-staging.3

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 (170) hide show
  1. package/dist/assets/{BundleConfirmPage-DJIGg7bK.js → BundleConfirmPage-CkXUMWg6.js} +1 -1
  2. package/dist/assets/account-page-B5rB7loj.js +1 -0
  3. package/dist/assets/{add-credits-modal-DvrQcX_K.js → add-credits-modal-BEX4_5jj.js} +1 -1
  4. package/dist/assets/{advanced-page-yAmIJ0-O.js → advanced-page-9RUi4YCF.js} +1 -1
  5. package/dist/assets/ai-page-CZj92XF4.js +1 -0
  6. package/dist/assets/{api-CGh7zC7Z.js → api-BSHLYsxJ.js} +1 -1
  7. package/dist/assets/{api-key-screen-CSIU6tlW.js → api-key-screen-CUKjlF2C.js} +1 -1
  8. package/dist/assets/{archive-page-C2M9DCgh.js → archive-page-YsBlmevd.js} +1 -1
  9. package/dist/assets/{assistant-api-ClCDtfaz.js → assistant-api-D7r6RWoh.js} +1 -1
  10. package/dist/assets/{assistant-feature-flag-store-BMVR2Dx7.js → assistant-feature-flag-store-D2CUHsmL.js} +1 -1
  11. package/dist/assets/{assistant-identity-store-BIu8LXuD.js → assistant-identity-store-BFaMpt_3.js} +1 -1
  12. package/dist/assets/{assistant-status-panel-CqM_xxPL.js → assistant-status-panel-CMdqv7mF.js} +1 -1
  13. package/dist/assets/auth-store-CrTf0uWL.js +7 -0
  14. package/dist/assets/{billing-page-BFPsW1V-.js → billing-page-DgX2YBSA.js} +3 -3
  15. package/dist/assets/{bookmarks-page-Cuqjyd6n.js → bookmarks-page-DRcIBBva.js} +1 -1
  16. package/dist/assets/{build-state-CI5r3DCj.js → build-state-DqzVxR37.js} +1 -1
  17. package/dist/assets/{client-feature-flag-store-C1ws4QpG.js → client-feature-flag-store-ivPVcKfH.js} +1 -1
  18. package/dist/assets/{command-palette-c-GkLSgn.js → command-palette-BXEAR93M.js} +1 -1
  19. package/dist/assets/{command-palette-window-page-DmXX3g9_.js → command-palette-window-page-5SP_Ft4Y.js} +1 -1
  20. package/dist/assets/{community-page-fRxEWvml.js → community-page-D5-exeNr.js} +1 -1
  21. package/dist/assets/{connect-page-fCkHk4FB.js → connect-page-Bvs0EgCJ.js} +1 -1
  22. package/dist/assets/{consent-controls-C1u7ZVkJ.js → consent-controls-cNdj_gb8.js} +1 -1
  23. package/dist/assets/{contacts-page-route-DWj-5GZ2.js → contacts-page-route-C9T-8Sdr.js} +1 -1
  24. package/dist/assets/{conversation-queries-C5J_wBFK.js → conversation-queries-Dt4RoWIo.js} +1 -1
  25. package/dist/assets/{debug-page-NtJJIUeZ.js → debug-page-ClQetFUa.js} +2 -2
  26. package/dist/assets/{deploy-dialogs-ZukSD1Ok.js → deploy-dialogs-BtpYB7B8.js} +1 -1
  27. package/dist/assets/{developer-page-uTOD0kmX.js → developer-page-DQs8SZ8K.js} +1 -1
  28. package/dist/assets/{devices-page-t38uJ_Rj.js → devices-page-VsRsz6XP.js} +1 -1
  29. package/dist/assets/{dictation-overlay-page-bgPMse-0.js → dictation-overlay-page-C5HFJIsY.js} +1 -1
  30. package/dist/assets/{document-viewer-page-4J5Pxy_g.js → document-viewer-page-BLBwWqM4.js} +1 -1
  31. package/dist/assets/{earn-credits-modal-Dw8Q142A.js → earn-credits-modal-Dig03UD-.js} +1 -1
  32. package/dist/assets/{emails-page-DtWzs4ko.js → emails-page-D9R72EQW.js} +1 -1
  33. package/dist/assets/esm--X8IY1ec.js +1 -0
  34. package/dist/assets/{esm-BhnwM79d.js → esm-Cs-ixW_a.js} +2 -2
  35. package/dist/assets/{esm-CiJceiot.js → esm-DkmmS1Rg.js} +2 -2
  36. package/dist/assets/{esm-D18RlLzi.js → esm-DxJBeF-2.js} +2 -2
  37. package/dist/assets/{esm-Fz1t-KBM.js → esm-JmlvYCir.js} +2 -2
  38. package/dist/assets/{esm-RSkzRC1V.js → esm-LyzWW9Z1.js} +2 -2
  39. package/dist/assets/{feature-flag-catalog-zKzlKAIS.js → feature-flag-catalog-DEr38CMM.js} +1 -1
  40. package/dist/assets/{file-editor-Dsmrsieh.js → file-editor-HQXiGdH-.js} +1 -1
  41. package/dist/assets/{general-page-BmuGD9t1.js → general-page-CMr5RhNh.js} +1 -1
  42. package/dist/assets/hatching-screen-BAzE4aGD.js +1 -0
  43. package/dist/assets/{home-page-route-B9TWPA_Z.js → home-page-route-JenDSLBl.js} +1 -1
  44. package/dist/assets/hosting-screen-dPfTLCnv.js +1 -0
  45. package/dist/assets/{identity-page-route-C_hcLi9A.js → identity-page-route-r9ZgIw8g.js} +1 -1
  46. package/dist/assets/{index-DjBiif5r.js → index-BiN-6kWM.js} +31 -31
  47. package/dist/assets/{inspect-page-Ds4ete37.js → inspect-page-2cNMjT4e.js} +3 -3
  48. package/dist/assets/{install-BTdfOS56.js → install-CHMiF_Hw.js} +1 -1
  49. package/dist/assets/{integrations-page-BcINhzsa.js → integrations-page-BiLM3QyR.js} +1 -1
  50. package/dist/assets/{intelligence-layout-D4ZCqIzW.js → intelligence-layout-CjDxFKQO.js} +1 -1
  51. package/dist/assets/{keyboard-shortcuts-page-0nrN6XlU.js → keyboard-shortcuts-page-DIhG1FK_.js} +1 -1
  52. package/dist/assets/{library-detail-page-DRWl6nzT.js → library-detail-page-CjeBxuMc.js} +1 -1
  53. package/dist/assets/{library-page-tkcbXp1r.js → library-page-BFIPthR_.js} +1 -1
  54. package/dist/assets/{login-flow-B745Do-L.js → login-flow-BMwbZfKA.js} +1 -1
  55. package/dist/assets/{login-page-mv9EfrL5.js → login-page-KDH0IZ6y.js} +1 -1
  56. package/dist/assets/{logout-page-orHUxw4u.js → logout-page-DI7i4Hok.js} +1 -1
  57. package/dist/assets/{logs-layout-DRmlEOMI.js → logs-layout-BEMQQY7S.js} +1 -1
  58. package/dist/assets/{mcp-page-D3WCeVhI.js → mcp-page-B7tUTzT0.js} +1 -1
  59. package/dist/assets/{memory-router-playground-page-1HTpZRzo.js → memory-router-playground-page-JdkTEwPy.js} +1 -1
  60. package/dist/assets/{metric-card-CXCuWhNG.js → metric-card-B3EBP9m4.js} +1 -1
  61. package/dist/assets/{mobile-sidebar-drawer-Bx5YTlNy.js → mobile-sidebar-drawer-DuJUmy0b.js} +1 -1
  62. package/dist/assets/{native-file-Cd0uSBuG.js → native-file-CbhjzPxL.js} +2 -2
  63. package/dist/assets/{notifications-page-Z4rBfcim.js → notifications-page-CmOvbV59.js} +1 -1
  64. package/dist/assets/{oauth-complete-page-dL5TWauu.js → oauth-complete-page-R_1ODIIi.js} +1 -1
  65. package/dist/assets/{oauth-popup-complete-page-ygMAHToC.js → oauth-popup-complete-page-YECuZtPs.js} +1 -1
  66. package/dist/assets/{pairing-page-B_goGm8F.js → pairing-page-BtaFWq0w.js} +1 -1
  67. package/dist/assets/{platform-loopback-page-40umE5Nz.js → platform-loopback-page-Wie5xEwr.js} +1 -1
  68. package/dist/assets/{plugin-detail-page-BnQ2kf7Y.js → plugin-detail-page-D6Gve0qx.js} +1 -1
  69. package/dist/assets/{plugins-page-pcTOnJpU.js → plugins-page-DA-JrehF.js} +1 -1
  70. package/dist/assets/{prechat-route-Cbk86DeT.js → prechat-route-BhzvRsw3.js} +1 -1
  71. package/dist/assets/{prefs-DjG8e7dK.js → prefs-Mrqh1A7Y.js} +1 -1
  72. package/dist/assets/{privacy-page-ChgL1FV8.js → privacy-page-Yex5OJjZ.js} +1 -1
  73. package/dist/assets/{privacy-screen-CND_dL-J.js → privacy-screen-ccjT4S0F.js} +1 -1
  74. package/dist/assets/{provider-callback-page-BB-waTRl.js → provider-callback-page-BS-DqV_M.js} +1 -1
  75. package/dist/assets/{provider-signup-page-DKG8Ow1Y.js → provider-signup-page-Beuafn_s.js} +1 -1
  76. package/dist/assets/{proxy-BaYss8LN.js → proxy-CQsxT9tJ.js} +1 -1
  77. package/dist/assets/{quick-input-page-rj5DDrdc.js → quick-input-page-0PEcj6WT.js} +1 -1
  78. package/dist/assets/{research-mock-page-Crn0z5z6.js → research-mock-page-D0-sKBpu.js} +1 -1
  79. package/dist/assets/{research-onboarding-route-BtoNZ0do.js → research-onboarding-route-ZTgUGnrN.js} +2 -2
  80. package/dist/assets/{review-terms-screen-BvG3xAnz.js → review-terms-screen-DLWgKysx.js} +1 -1
  81. package/dist/assets/sdk.gen-DRL3oRwz.js +1 -0
  82. package/dist/assets/{select-assistant-screen-EaSNw87g.js → select-assistant-screen-LNX6PpzR.js} +1 -1
  83. package/dist/assets/{settings-layout-0KMmprEe.js → settings-layout-BA0suokL.js} +1 -1
  84. package/dist/assets/{share-feedback-modal-DDiWBGt6.js → share-feedback-modal-CFgHvfgR.js} +1 -1
  85. package/dist/assets/{sidebar-tree-SP7fohd6.js → sidebar-tree-DALLHIeG.js} +1 -1
  86. package/dist/assets/{signup-page-mHalxyN4.js → signup-page-13TRI3CC.js} +1 -1
  87. package/dist/assets/{signup-shell-CIXfwueV.js → signup-shell-D6LXKfGy.js} +1 -1
  88. package/dist/assets/{skills-page-D_3kRG_-.js → skills-page-DiopOlcy.js} +1 -1
  89. package/dist/assets/{sounds-page-DWJKkT-Q.js → sounds-page-DE47aZrz.js} +1 -1
  90. package/dist/assets/{step-indicator-dots-CxPpUjj-.js → step-indicator-dots-BOKv1I4C.js} +1 -1
  91. package/dist/assets/{subagent-detail-panel-CO8xcBkY.js → subagent-detail-panel-BdPp2LMK.js} +1 -1
  92. package/dist/assets/{system-events-page-BT7c7g29.js → system-events-page-DcaF2EuX.js} +1 -1
  93. package/dist/assets/{tiptap-document-editor-CH0hLQg8.js → tiptap-document-editor-DjIQ9tCC.js} +1 -1
  94. package/dist/assets/{tool-detail-panel-DjQRk3C4.js → tool-detail-panel-C6uFi3_6.js} +1 -1
  95. package/dist/assets/{trace-page-DXoNPNF2.js → trace-page-4MU66DDM.js} +1 -1
  96. package/dist/assets/typed-storage-SkUUNYR1.js +1 -0
  97. package/dist/assets/{upgrade-cancel-page-D3ClLquH.js → upgrade-cancel-page-D2-xTACq.js} +1 -1
  98. package/dist/assets/{upgrade-success-page-D8M_sxa0.js → upgrade-success-page-DLjl6978.js} +1 -1
  99. package/dist/assets/{usage-page-CdTcaS_i.js → usage-page-CCBqWkRU.js} +1 -1
  100. package/dist/assets/use-is-org-ready-BoWiaeMc.js +1 -0
  101. package/dist/assets/{use-onboarding-login-CrYY0jua.js → use-onboarding-login-CxXV3Iue.js} +1 -1
  102. package/dist/assets/{use-reduced-motion-C9zjvTsb.js → use-reduced-motion-CXbk4fYO.js} +1 -1
  103. package/dist/assets/{utils-BjpQXgRD.js → utils-B5-aBe5u.js} +1 -1
  104. package/dist/assets/{voice-page-DYQ_Bjkg.js → voice-page-VrJ7AZrg.js} +1 -1
  105. package/dist/assets/{weather-forecast-display-PvQnLjFm.js → weather-forecast-display-DKMPxDv5.js} +1 -1
  106. package/dist/assets/{web-CUsG7AaW.js → web-DKvxfNu_.js} +1 -1
  107. package/dist/assets/{welcome-screen-Csr3Xjbb.js → welcome-screen-DVeLGZKg.js} +1 -1
  108. package/dist/assets/{workflow-detail-panel-C1hoa9n4.js → workflow-detail-panel-BgDWu3_4.js} +1 -1
  109. package/dist/assets/{workspace-page-D2jf__1O.js → workspace-page-BlVlfXIt.js} +1 -1
  110. package/dist/index.html +39 -38
  111. package/package.json +1 -1
  112. package/dist/assets/account-page-B-pFQ4QZ.js +0 -1
  113. package/dist/assets/ai-page-CSwTzhul.js +0 -1
  114. package/dist/assets/auth-store-CyAWX99c.js +0 -6
  115. package/dist/assets/hatching-screen-D9XPAXWn.js +0 -1
  116. package/dist/assets/hosting-screen-BFr_zyC4.js +0 -1
  117. package/dist/assets/sdk.gen-D7k-QjYl.js +0 -1
  118. package/dist/assets/use-is-org-ready-CMpj-2ts.js +0 -1
  119. /package/dist/assets/{about-page-CVV-MCho.js → about-page-Bue2vNnY.js} +0 -0
  120. /package/dist/assets/{account-shell-e28XT1Gw.js → account-shell-oWV1wIYb.js} +0 -0
  121. /package/dist/assets/{avatar-bundled-components-D6zRL_dw.js → avatar-bundled-components-UfXe4Pfu.js} +0 -0
  122. /package/dist/assets/{avatar-svg-compositor-BDV_OAev.js → avatar-svg-compositor-Bbqkq_FE.js} +0 -0
  123. /package/dist/assets/{build.umd-BrMpqUXB.js → build.umd-TjHHwLRY.js} +0 -0
  124. /package/dist/assets/{composer-focus-zRjwsXmH.js → composer-focus-DP3jFn8K.js} +0 -0
  125. /package/dist/assets/{contacts-gateway-AXbkzYpn.js → contacts-gateway-Cf32jSYa.js} +0 -0
  126. /package/dist/assets/{conversation-selection-DCYDhK6e.js → conversation-selection-BMndnV1U.js} +0 -0
  127. /package/dist/assets/{conversation-store-CBtnzP2n.js → conversation-store-BSxi0r0X.js} +0 -0
  128. /package/dist/assets/{danger-zone-redirect-page-BiH15rFW.js → danger-zone-redirect-page-5H-AuIvi.js} +0 -0
  129. /package/dist/assets/{definitions-DhIUJp4x.js → definitions-BqAtozTh.js} +0 -0
  130. /package/dist/assets/{detail-card-DeCfFKxN.js → detail-card-CLwQ17AA.js} +0 -0
  131. /package/dist/assets/{edit-chat-session-BUoLTWlo.js → edit-chat-session-B1tanC3Z.js} +0 -0
  132. /package/dist/assets/{effective-timezone-DKIHYiQs.js → effective-timezone-wo2Bhl1P.js} +0 -0
  133. /package/dist/assets/{emoji-catalog-data-BRNanslS.js → emoji-catalog-data-B6Q5tPZJ.js} +0 -0
  134. /package/dist/assets/{environment-store-BPyWfH08.js → environment-store-Ck7wXCrL.js} +0 -0
  135. /package/dist/assets/{format-2xr96iXO.js → format-B12w_G9l.js} +0 -0
  136. /package/dist/assets/{format-date-CVdOzfYM.js → format-date-B6hTwbOM.js} +0 -0
  137. /package/dist/assets/{format-file-size-HIBUjVRS.js → format-file-size-DxhjMSDx.js} +0 -0
  138. /package/dist/assets/{haptics-1zSZHQps.js → haptics-BtSYrQNK.js} +0 -0
  139. /package/dist/assets/{impersonate-version-flag-BBe6qZWh.js → impersonate-version-flag-ZdQOgpO3.js} +0 -0
  140. /package/dist/assets/{lib-CLT_iFkF.js → lib-CQbq3OZw.js} +0 -0
  141. /package/dist/assets/{llm-dimension-Czl_J9gg.js → llm-dimension-Cs4q1Ovq.js} +0 -0
  142. /package/dist/assets/{misc-BurDhv2T.js → misc-Bo3spjOe.js} +0 -0
  143. /package/dist/assets/{native-deep-link-CFFM1NaG.js → native-deep-link-_WT_7c80.js} +0 -0
  144. /package/dist/assets/{page-shell-CTmljSuy.js → page-shell-C0oiLAoY.js} +0 -0
  145. /package/dist/assets/{password-reset-page-DJQASQbj.js → password-reset-page-Cf5SQHDV.js} +0 -0
  146. /package/dist/assets/{pdf-DDcCO6Ea.js → pdf-CMJp1GoR.js} +0 -0
  147. /package/dist/assets/{prechat-names-Dl1bWxyY.js → prechat-names-BZIP2Y-H.js} +0 -0
  148. /package/dist/assets/{provider-key-AiDfAj3X.js → provider-key-DH6JmPXt.js} +0 -0
  149. /package/dist/assets/{public-asset-DSNbX6CW.js → public-asset-Dp-i4xhW.js} +0 -0
  150. /package/dist/assets/{reduced-motion-C-oXOoz4.js → reduced-motion-Do7LyjE6.js} +0 -0
  151. /package/dist/assets/{schedules-BfL_KgUR.js → schedules-DqkGi2Lm.js} +0 -0
  152. /package/dist/assets/{semver-CWB8BPhv.js → semver-DmouQEQK.js} +0 -0
  153. /package/dist/assets/{setting-row-Bke-X9s7.js → setting-row-IILQu7AE.js} +0 -0
  154. /package/dist/assets/{sound-manager-Cuz_K65T.js → sound-manager-CC2af7bI.js} +0 -0
  155. /package/dist/assets/{subagent-status-BZXtYoyE.js → subagent-status-CaVVlphf.js} +0 -0
  156. /package/dist/assets/{system-events-redirect-page-BhFhVZX3.js → system-events-redirect-page-CmooXfba.js} +0 -0
  157. /package/dist/assets/{usage-window-DOM_y3PN.js → usage-window-BO_9IIjX.js} +0 -0
  158. /package/dist/assets/{use-active-assistant-id-BtGthKQp.js → use-active-assistant-id-512RohBL.js} +0 -0
  159. /package/dist/assets/{use-bus-subscription-DSrmmjvt.js → use-bus-subscription-RUbeQDfy.js} +0 -0
  160. /package/dist/assets/{use-is-mobile-C0ubX5Es.js → use-is-mobile-CvT53Qs1.js} +0 -0
  161. /package/dist/assets/{use-plugin-drift-DyjoyDBs.js → use-plugin-drift-BUHRYq2W.js} +0 -0
  162. /package/dist/assets/{viewer-store-Cfso5FNU.js → viewer-store-CInCucV8.js} +0 -0
  163. /package/dist/assets/{web-D5xtOjGa.js → web-4XHemeeJ.js} +0 -0
  164. /package/dist/assets/{web-D9FZSZCN.js → web-BEsXuN9d.js} +0 -0
  165. /package/dist/assets/{web-DgFXqVj3.js → web-BcNl6r2T.js} +0 -0
  166. /package/dist/assets/{web-liDG2TJr.js → web-BorhjBfF.js} +0 -0
  167. /package/dist/assets/{web-1_PP1DD_.js → web-CVJTgRoJ.js} +0 -0
  168. /package/dist/assets/{web-Ci20mxIU.js → web-DALQZUJ4.js} +0 -0
  169. /package/dist/assets/{xterm-DDh2F3IU.js → xterm-BJ2bbKsF.js} +0 -0
  170. /package/dist/assets/{xterm-addon-fit-CyzlQnJv.js → xterm-addon-fit-BJTajn72.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-liDG2TJr.js","assets/dist-nMnxT9pm.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-nMnxT9pm.js";var n=t(`Browser`,{web:()=>e(()=>import(`./web-liDG2TJr.js`).then(e=>new e.BrowserWeb),__vite__mapDeps([0,1]))});export{n as Browser};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-BorhjBfF.js","assets/dist-nMnxT9pm.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-nMnxT9pm.js";var n=t(`Browser`,{web:()=>e(()=>import(`./web-BorhjBfF.js`).then(e=>new e.BrowserWeb),__vite__mapDeps([0,1]))});export{n as Browser};
@@ -1 +1 @@
1
- var e={version:1,flags:[{id:`auto-analyze`,scope:`assistant`,key:`auto-analyze`,label:`Auto-analyze conversations`,description:`Automatically trigger conversation analysis on the same cadence as memory extraction (batch threshold, idle debounce, end-of-conversation). The analysis agent has full tool access and writes back to memory and skills without user approval.`,defaultEnabled:!1},{id:`user-hosted-enabled`,scope:`client`,key:`user-hosted-enabled`,label:`User Hosted Enabled`,description:`Enable user-hosted onboarding flow`,defaultEnabled:!1},{id:`pre-chat-onboarding-experiment-2026-06-06`,scope:`client`,key:`pre-chat-onboarding-experiment-2026-06-06`,label:`Pre-chat Onboarding Experiment 2026-06-06`,description:`Pre-chat onboarding experiment with control and variant-a arms. Control shows the full funnel; variant-a shows the condensed pared-down flow.`,defaultEnabled:`control`,values:[`control`,`variant-a`]},{id:`experiment-activation-flow-2026-06-03`,scope:`both`,key:`experiment-activation-flow-2026-06-03`,label:`Activation Flow Experiment 2026-06-03`,description:`Multivariate activation-flow experiment. control = standard flow; variant-a = activation rail; personal-page = new sign-up-page variant (front-end only). Targeted via LaunchDarkly.`,defaultEnabled:`control`,values:[`control`,`variant-a`,`personal-page`]},{id:`local-docker-enabled`,scope:`client`,key:`local-docker-enabled`,label:`Local Docker Mode`,description:`When enabled, the Local hosting option uses Docker under the hood for sandboxed execution, hiding the separate Docker card`,defaultEnabled:!1},{id:`a2a-channel`,scope:`assistant`,key:`a2a-channel`,label:`A2A Channel`,description:`Enable the A2A (Agent-to-Agent) channel for inter-assistant communication via the open A2A protocol`,defaultEnabled:!1},{id:`trace-collection`,scope:`assistant`,key:`trace-collection`,label:`Trace Collection`,description:`Gate per-turn conversation trace (user/assistant/tool-call/tool-response) collection. The daemon attaches a trace to its turn telemetry only when this flag AND the owner's share_diagnostics consent are both on. Defaults off (fail-closed) — the live value is delivered from LaunchDarkly.`,defaultEnabled:!1},{id:`workspace-tools-watcher`,scope:`assistant`,key:`workspace-tools-watcher`,label:`Workspace tools file watcher`,description:"Hot-reload workspace tool overrides under `<workspaceDir>/tools/` by watching the directory and re-registering tools as files change. When disabled, workspace tools still load from disk once at daemon startup, but live edits require a restart to take effect.",defaultEnabled:!1},{id:`settings-developer-nav`,scope:`assistant`,key:`settings-developer-nav`,label:`Settings Developer Nav`,description:`Control Developer nav visibility in macOS settings`,defaultEnabled:!1},{id:`developer-menu-items`,scope:`client`,key:`developer-menu-items`,label:`Developer Menu Items`,description:`Show Component Gallery and Replay Onboarding in the menu bar`,defaultEnabled:!1},{id:`ces-tools`,scope:`assistant`,key:`ces-tools`,label:`CES Tool Exposure`,description:`Register Credential Execution Service tools (credential-grant, credential-revoke, credential-list) in the agent loop`,defaultEnabled:!1},{id:`ces-shell-lockdown`,scope:`assistant`,key:`ces-shell-lockdown`,label:`CES Shell Lockdown`,description:`Enforce untrusted-agent shell lockdown when CES credentials are active, restricting direct shell access to credentialed services`,defaultEnabled:!1},{id:`ces-secure-install`,scope:`assistant`,key:`ces-secure-install`,label:`CES Secure Command Installation`,description:`Enable secure tool/command installation via CES instead of direct shell execution for untrusted agents`,defaultEnabled:!1},{id:`ces-grant-audit`,scope:`assistant`,key:`ces-grant-audit`,label:`CES Grant & Audit Inspection`,description:`Surface credential grant and audit inspection endpoints for reviewing active grants and access logs`,defaultEnabled:!1},{id:`settings-embedding-provider`,scope:`assistant`,key:`settings-embedding-provider`,label:`Embedding Provider Settings`,description:`Show the Embedding service card in Models & Services settings`,defaultEnabled:!1},{id:`multi-platform-assistant`,scope:`client`,key:`multi-platform-assistant`,label:`Multi-Platform Assistant Switcher`,description:`Enable the menu-bar assistant switcher for managing multiple platform-hosted assistants (new/switch/retire)`,defaultEnabled:!1},{id:`quick-input`,scope:`client`,key:`quick-input`,label:`Quick Input`,description:`Enable the Quick Input popover on right-click of the menu bar icon`,defaultEnabled:!1},{id:`expand-completed-steps`,scope:`client`,key:`expand-completed-steps`,label:`Expand Completed Steps`,description:`Auto-expand completed tool call step groups instead of showing them collapsed`,defaultEnabled:!1},{id:`message-tts`,scope:`assistant`,key:`message-tts`,label:`Message Text-to-Speech`,description:`Show a speaker button on assistant messages to generate and play the message as audio via Fish Audio TTS`,defaultEnabled:!1},{id:`backward-releases`,scope:`assistant`,key:`backward-releases`,label:`Backward Releases`,description:`Show older versions in the version picker, allowing rollback to previous releases`,defaultEnabled:!1},{id:`voice-mode`,scope:`assistant`,key:`voice-mode`,label:`Voice Mode`,description:`Show the live voice conversation button in the composer`,defaultEnabled:!1},{id:`fast-mode`,scope:`assistant`,key:`fast-mode`,label:`Fast Mode`,description:`Enable Anthropic fast mode for Opus models (4.6, 4.7, 4.8), delivering up to 2.5x higher output tokens per second at premium pricing`,defaultEnabled:!1},{id:`teleport`,scope:`client`,key:`teleport`,label:`Teleport`,description:`Enable teleport UI in General settings for moving assistants between hosting environments`,defaultEnabled:!1},{id:`apple-container`,scope:`client`,key:`apple-container`,label:`Apple Container`,description:`Enable assistant sandboxing via Apple Containers on macOS 26+, providing a lightweight native sandbox without third-party dependencies`,defaultEnabled:!1},{id:`bookmarks`,scope:`client`,key:`bookmarks`,label:`Message Bookmarks`,description:`Show the bookmark icon on messages and enable the Bookmarks tab in Settings`,defaultEnabled:!1},{id:`fork-from-message`,scope:`client`,key:`fork-from-message`,label:`Fork from Message`,description:`Show the 'Fork from here' option in message overflow menus`,defaultEnabled:!1},{id:`home-tab`,scope:`client`,key:`home-tab`,label:`Home Tab`,description:`Replace the knowledge graph top-level tab with a new Home page showing relationship progression, facts, and capability tiers`,defaultEnabled:!1},{id:`meet`,scope:`assistant`,key:`meet`,label:`Google Meet`,description:`Enables the Google Meet joining bot and the meet-join skill.`,defaultEnabled:!1},{id:`scroll-debug-overlay`,scope:`client`,key:`scroll-debug-overlay`,label:`Scroll Debug Overlay`,description:`Show a live HUD in the top-right of the conversation with scroll geometry, velocity, update rate, and anchor-preserver activity. Developer diagnostic for investigating scroll jank.`,defaultEnabled:!1},{id:`coding-agents-panel`,scope:`client`,key:`coding-agents-panel`,label:`Coding Agents Panel`,description:`Gate native macOS Coding Agents panel entry points and inline ACP session deep links.`,defaultEnabled:!1},{id:`compaction-playground`,scope:`assistant`,key:`compaction-playground`,label:`Compaction Playground`,description:`Expose the developer-only Compaction Playground tab in macOS Settings and enable the /playground/* HTTP endpoints for exercising compaction conditions. Dev-only; default off.`,defaultEnabled:!1},{id:`app-control`,scope:`assistant`,key:`app-control`,label:`App Control`,description:`Enable the app-control skill (per-app screenshot + raw input bypassing AX tree)`,defaultEnabled:!1},{id:`analyze-conversation`,scope:`assistant`,key:`analyze-conversation`,label:`Analyze Conversation`,description:`Show the 'Analyze' / 'Analyze conversation' option in conversation context menus and the conversation title actions dropdown.`,defaultEnabled:!1},{id:`external-plugins`,scope:`assistant`,key:`external-plugins`,label:`External Plugins`,description:"Enable the external-plugin install path: the `assistant plugins` CLI subcommand and the declarative external-plugin loader convention (`<workspaceDir>/plugins/<name>/` directories containing `package.json` plus interface dirs). Gates an unstable surface that may change shape before stabilizing.",defaultEnabled:!1},{id:`velvet-theme`,scope:`client`,key:`velvet-theme`,label:`Velvet Theme`,description:`Show the Velvet theme option in the macOS appearance settings. Velvet is a dark-mode variant with red/pink accent colors.`,defaultEnabled:!1},{id:`query-complexity-routing`,scope:`assistant`,key:`query-complexity-routing`,label:`Query Complexity Routing`,description:`Automatically route user messages to the most appropriate inference profile based on query complexity. Simple queries use the speed profile, complex queries escalate to the quality profile. The user is notified of each switch and can opt out by pinning a profile on the conversation.`,defaultEnabled:!1},{id:`queue-steering`,scope:`assistant`,key:`queue-steering`,label:`Queue Steering`,description:`Enable the 'Push to agent' button on queued messages, allowing users to steer the assistant to a specific queued message by aborting the current generation and promoting the message to the head of the queue.`,defaultEnabled:!1},{id:`chat-pull-to-refresh-enabled`,scope:`client`,key:`chat-pull-to-refresh-enabled`,label:`Chat Pull to Refresh`,description:`Enable pull-to-refresh gesture in the chat view.`,defaultEnabled:!1},{id:`platform-notifications`,scope:`client`,key:`platform-notifications`,label:`Platform Notifications`,description:`Enable the Notifications tab in settings.`,defaultEnabled:!1},{id:`centralized-assistant-status`,scope:`client`,key:`centralized-assistant-status`,label:`Centralized Assistant Status`,description:`Enable client polling of the centralized assistant operational status endpoint.`,defaultEnabled:!1},{id:`preview-channel`,scope:`client`,key:`preview-channel`,label:`Preview Channel`,description:`Enable user-facing Preview release channel controls in assistant settings.`,defaultEnabled:!1},{id:`rollback-enabled`,scope:`assistant`,key:`rollback-enabled`,label:`Rollback Enabled`,description:`Show older versions in the version picker, allowing rollback to previous releases.`,defaultEnabled:!1},{id:`self-hosted-assistant`,scope:`client`,key:`self-hosted-assistant`,label:`Self-Hosted Assistant`,description:`Enable self-hosted assistant configuration.`,defaultEnabled:!1},{id:`web-remote-ingress`,scope:`assistant`,key:`web-remote-ingress`,label:`Web Remote Ingress`,description:`Serve the web client over a public tunnel and enable browser pairing for self-hosted assistants.`,defaultEnabled:!1},{id:`settings-sleep-policy`,scope:`assistant`,key:`settings-sleep-policy`,label:`Settings Sleep Policy`,description:`Enable sleep policy settings.`,defaultEnabled:!1},{id:`velvet`,scope:`client`,key:`velvet`,label:`Velvet`,description:`Enable the Velvet design theme.`,defaultEnabled:!1},{id:`memory-router-playground`,scope:`client`,key:`memory-router-playground`,label:`Memory Router Playground`,description:`Expose the developer-only Memory Router Playground tab in macOS Settings and the /assistant/memory-router-playground web page for dry-running v4 router config overrides against the live page index. Dev-only; default off.`,defaultEnabled:!1},{id:`memory-v3-shadow`,scope:`assistant`,key:`memory-v3-shadow`,label:`Memory v3 Shadow`,description:`When on, runs the new memory-v3 topic-tree retrieval alongside v2 in shadow mode: logs selections to memory_v3_selections, does not modify injected context. Off by default.`,defaultEnabled:!1},{id:`self-intro-greeting`,scope:`both`,key:`self-intro-greeting`,label:`Self-intro first message`,description:`On the first conversation, send a natural self-introduction (e.g. "Hi Vela, I'm alex. Nice to meet you.") on the user's behalf and route it through real LLM inference, instead of serving the canned first greeting. Names come from the onboarding context; falls back to the canned greeting when no name is known. Exposed to clients so pre-hatch onboarding can compute the source-of-truth initial message, and to the assistant so older clients can still be gated server-side. See assistant/src/daemon/first-greeting.ts (buildSelfIntroMessage).`,defaultEnabled:!1},{id:`research-onboarding`,scope:`client`,key:`research-onboarding`,label:`Research onboarding (spike)`,description:`Spike: replace pre-chat onboarding with a web-research "here's what I know about you" flow, including a Google Calendar "Let's chat tomorrow" step shown over the streaming research. Gates the /assistant/onboarding/research route and the research mock harness. Off by default; enable locally via the feature-flags panel.`,defaultEnabled:!1},{id:`channel-trust-floors`,scope:`assistant`,key:`channel-trust-floors`,label:`Channel Trust Floors`,description:`Expose the Channel Trust Floors settings card (per-channel inbound admission policy) on the Privacy settings page. When off, the card is hidden and channels fall back to their default admission floors. Off by default while the feature is in development.`,defaultEnabled:!1},{id:`mcp-settings`,scope:`assistant`,key:`mcp-settings`,label:`MCP Settings`,description:`Show the MCP page in Settings for managing Model Context Protocol server connections: view status, enable/disable, configure, and inspect registered tools per server.`,defaultEnabled:!1}]};function t(e,t){return e===t||e===`both`}var n=e.flags,r={};function i(e){return r[e]||e.split(`-`).map((e,t)=>e===`ui`?`UI`:t===0?e:e[0].toUpperCase()+e.slice(1)).join(``)}function a(e){let r={};for(let a of n)typeof a.defaultEnabled==`boolean`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}function o(e){let r={};for(let a of n)typeof a.defaultEnabled==`string`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}var s=a(`client`),c=a(`assistant`),l=o(`client`),u=o(`assistant`),d=new Map;for(let e of n)d.set(i(e.key),e);var f=new Map;for(let e of n)f.set(i(e.key),e.key);function p(e){return i(e)}function m(e){return f.get(e)}function h(e){return d.get(e)}var g=`VITE_VELLUM_FLAG_`;function _(e){return e.toLowerCase().replace(/_/g,`-`)}var v=new Set([`true`,`1`,`yes`,`on`]),y=new Set([`false`,`0`,`no`,`off`]);function b(e){let t=e.toLowerCase();return v.has(t)?!0:y.has(t)?!1:e}function x(){if(typeof window<`u`&&window.__VELLUM_FLAG_OVERRIDES__!=null)return{...window.__VELLUM_FLAG_OVERRIDES__};let e={},t={BASE_URL:`/assistant/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_PLATFORM_MODE:`false`};for(let n of Object.keys(t))if(n.startsWith(g)){let r=_(n.slice(17)),i=t[n];i!=null&&(e[r]=b(i))}return e}var S=null;function C(){return S===null&&(S=x()),S}var w=new Map;for(let e of n)w.set(e.key,e);function T(e){let n=C(),r={},i={};for(let[a,o]of Object.entries(n)){let n=w.get(a);if(!n||!t(n.scope,e))continue;let s=p(a);typeof o==`boolean`?r[s]=o:i[s]=o}return{bool:r,str:i}}export{p as a,h as c,l as i,t as l,u as n,n as o,s as r,T as s,c as t,m as u};
1
+ var e={version:1,flags:[{id:`auto-analyze`,scope:`assistant`,key:`auto-analyze`,label:`Auto-analyze conversations`,description:`Automatically trigger conversation analysis on the same cadence as memory extraction (batch threshold, idle debounce, end-of-conversation). The analysis agent has full tool access and writes back to memory and skills without user approval.`,defaultEnabled:!1},{id:`user-hosted-enabled`,scope:`client`,key:`user-hosted-enabled`,label:`User Hosted Enabled`,description:`Enable user-hosted onboarding flow`,defaultEnabled:!1},{id:`pre-chat-onboarding-experiment-2026-06-06`,scope:`client`,key:`pre-chat-onboarding-experiment-2026-06-06`,label:`Pre-chat Onboarding Experiment 2026-06-06`,description:`Pre-chat onboarding experiment with control and variant-a arms. Control shows the full funnel; variant-a shows the condensed pared-down flow.`,defaultEnabled:`control`,values:[`control`,`variant-a`]},{id:`experiment-activation-flow-2026-06-03`,scope:`both`,key:`experiment-activation-flow-2026-06-03`,label:`Activation Flow Experiment 2026-06-03`,description:`Multivariate activation-flow experiment. control = standard flow; variant-a = activation rail; personal-page = new sign-up-page variant (front-end only). Targeted via LaunchDarkly.`,defaultEnabled:`control`,values:[`control`,`variant-a`,`personal-page`]},{id:`local-docker-enabled`,scope:`client`,key:`local-docker-enabled`,label:`Local Docker Mode`,description:`When enabled, the Local hosting option uses Docker under the hood for sandboxed execution, hiding the separate Docker card`,defaultEnabled:!1},{id:`a2a-channel`,scope:`assistant`,key:`a2a-channel`,label:`A2A Channel`,description:`Enable the A2A (Agent-to-Agent) channel for inter-assistant communication via the open A2A protocol`,defaultEnabled:!1},{id:`trace-collection`,scope:`assistant`,key:`trace-collection`,label:`Trace Collection`,description:`Gate per-turn conversation trace (user/assistant/tool-call/tool-response) collection. The daemon attaches a trace to its turn telemetry only when this flag AND the owner's share_diagnostics consent are both on. Defaults off (fail-closed) — the live value is delivered from LaunchDarkly.`,defaultEnabled:!1},{id:`workspace-tools-watcher`,scope:`assistant`,key:`workspace-tools-watcher`,label:`Workspace tools file watcher`,description:"Hot-reload workspace tool overrides under `<workspaceDir>/tools/` by watching the directory and re-registering tools as files change. When disabled, workspace tools still load from disk once at daemon startup, but live edits require a restart to take effect.",defaultEnabled:!1},{id:`settings-developer-nav`,scope:`assistant`,key:`settings-developer-nav`,label:`Settings Developer Nav`,description:`Control Developer nav visibility in macOS settings`,defaultEnabled:!1},{id:`developer-menu-items`,scope:`client`,key:`developer-menu-items`,label:`Developer Menu Items`,description:`Show Component Gallery and Replay Onboarding in the menu bar`,defaultEnabled:!1},{id:`ces-tools`,scope:`assistant`,key:`ces-tools`,label:`CES Tool Exposure`,description:`Register Credential Execution Service tools (credential-grant, credential-revoke, credential-list) in the agent loop`,defaultEnabled:!1},{id:`ces-shell-lockdown`,scope:`assistant`,key:`ces-shell-lockdown`,label:`CES Shell Lockdown`,description:`Enforce untrusted-agent shell lockdown when CES credentials are active, restricting direct shell access to credentialed services`,defaultEnabled:!1},{id:`ces-secure-install`,scope:`assistant`,key:`ces-secure-install`,label:`CES Secure Command Installation`,description:`Enable secure tool/command installation via CES instead of direct shell execution for untrusted agents`,defaultEnabled:!1},{id:`ces-grant-audit`,scope:`assistant`,key:`ces-grant-audit`,label:`CES Grant & Audit Inspection`,description:`Surface credential grant and audit inspection endpoints for reviewing active grants and access logs`,defaultEnabled:!1},{id:`settings-embedding-provider`,scope:`assistant`,key:`settings-embedding-provider`,label:`Embedding Provider Settings`,description:`Show the Embedding service card in Models & Services settings`,defaultEnabled:!1},{id:`multi-platform-assistant`,scope:`client`,key:`multi-platform-assistant`,label:`Multi-Platform Assistant Switcher`,description:`Enable the menu-bar assistant switcher for managing multiple platform-hosted assistants (new/switch/retire)`,defaultEnabled:!1},{id:`quick-input`,scope:`client`,key:`quick-input`,label:`Quick Input`,description:`Enable the Quick Input popover on right-click of the menu bar icon`,defaultEnabled:!1},{id:`expand-completed-steps`,scope:`client`,key:`expand-completed-steps`,label:`Expand Completed Steps`,description:`Auto-expand completed tool call step groups instead of showing them collapsed`,defaultEnabled:!1},{id:`message-tts`,scope:`assistant`,key:`message-tts`,label:`Message Text-to-Speech`,description:`Show a speaker button on assistant messages to generate and play the message as audio via Fish Audio TTS`,defaultEnabled:!1},{id:`backward-releases`,scope:`assistant`,key:`backward-releases`,label:`Backward Releases`,description:`Show older versions in the version picker, allowing rollback to previous releases`,defaultEnabled:!1},{id:`voice-mode`,scope:`assistant`,key:`voice-mode`,label:`Voice Mode`,description:`Show the live voice conversation button in the composer`,defaultEnabled:!1},{id:`fast-mode`,scope:`assistant`,key:`fast-mode`,label:`Fast Mode`,description:`Enable Anthropic fast mode for Opus models (4.6, 4.7, 4.8), delivering up to 2.5x higher output tokens per second at premium pricing`,defaultEnabled:!1},{id:`teleport`,scope:`client`,key:`teleport`,label:`Teleport`,description:`Enable teleport UI in General settings for moving assistants between hosting environments`,defaultEnabled:!1},{id:`apple-container`,scope:`client`,key:`apple-container`,label:`Apple Container`,description:`Enable assistant sandboxing via Apple Containers on macOS 26+, providing a lightweight native sandbox without third-party dependencies`,defaultEnabled:!1},{id:`bookmarks`,scope:`client`,key:`bookmarks`,label:`Message Bookmarks`,description:`Show the bookmark icon on messages and enable the Bookmarks tab in Settings`,defaultEnabled:!1},{id:`fork-from-message`,scope:`client`,key:`fork-from-message`,label:`Fork from Message`,description:`Show the 'Fork from here' option in message overflow menus`,defaultEnabled:!1},{id:`home-tab`,scope:`client`,key:`home-tab`,label:`Home Tab`,description:`Replace the knowledge graph top-level tab with a new Home page showing relationship progression, facts, and capability tiers`,defaultEnabled:!1},{id:`meet`,scope:`assistant`,key:`meet`,label:`Google Meet`,description:`Enables the Google Meet joining bot and the meet-join skill.`,defaultEnabled:!1},{id:`scroll-debug-overlay`,scope:`client`,key:`scroll-debug-overlay`,label:`Scroll Debug Overlay`,description:`Show a live HUD in the top-right of the conversation with scroll geometry, velocity, update rate, and anchor-preserver activity. Developer diagnostic for investigating scroll jank.`,defaultEnabled:!1},{id:`coding-agents-panel`,scope:`client`,key:`coding-agents-panel`,label:`Coding Agents Panel`,description:`Gate native macOS Coding Agents panel entry points and inline ACP session deep links.`,defaultEnabled:!1},{id:`compaction-playground`,scope:`assistant`,key:`compaction-playground`,label:`Compaction Playground`,description:`Expose the developer-only Compaction Playground tab in macOS Settings and enable the /playground/* HTTP endpoints for exercising compaction conditions. Dev-only; default off.`,defaultEnabled:!1},{id:`app-control`,scope:`assistant`,key:`app-control`,label:`App Control`,description:`Enable the app-control skill (per-app screenshot + raw input bypassing AX tree)`,defaultEnabled:!1},{id:`analyze-conversation`,scope:`assistant`,key:`analyze-conversation`,label:`Analyze Conversation`,description:`Show the 'Analyze' / 'Analyze conversation' option in conversation context menus and the conversation title actions dropdown.`,defaultEnabled:!1},{id:`external-plugins`,scope:`assistant`,key:`external-plugins`,label:`External Plugins`,description:"Enable the external-plugin install path: the `assistant plugins` CLI subcommand and the declarative external-plugin loader convention (`<workspaceDir>/plugins/<name>/` directories containing `package.json` plus interface dirs). Gates an unstable surface that may change shape before stabilizing.",defaultEnabled:!1},{id:`velvet-theme`,scope:`client`,key:`velvet-theme`,label:`Velvet Theme`,description:`Show the Velvet theme option in the macOS appearance settings. Velvet is a dark-mode variant with red/pink accent colors.`,defaultEnabled:!1},{id:`query-complexity-routing`,scope:`assistant`,key:`query-complexity-routing`,label:`Query Complexity Routing`,description:`Automatically route user messages to the most appropriate inference profile based on query complexity. Simple queries use the speed profile, complex queries escalate to the quality profile. The user is notified of each switch and can opt out by pinning a profile on the conversation.`,defaultEnabled:!1},{id:`queue-steering`,scope:`assistant`,key:`queue-steering`,label:`Queue Steering`,description:`Enable the 'Push to agent' button on queued messages, allowing users to steer the assistant to a specific queued message by aborting the current generation and promoting the message to the head of the queue.`,defaultEnabled:!1},{id:`chat-pull-to-refresh-enabled`,scope:`client`,key:`chat-pull-to-refresh-enabled`,label:`Chat Pull to Refresh`,description:`Enable pull-to-refresh gesture in the chat view.`,defaultEnabled:!1},{id:`platform-notifications`,scope:`client`,key:`platform-notifications`,label:`Platform Notifications`,description:`Enable the Notifications tab in settings.`,defaultEnabled:!1},{id:`centralized-assistant-status`,scope:`client`,key:`centralized-assistant-status`,label:`Centralized Assistant Status`,description:`Enable client polling of the centralized assistant operational status endpoint.`,defaultEnabled:!1},{id:`preview-channel`,scope:`client`,key:`preview-channel`,label:`Preview Channel`,description:`Enable user-facing Preview release channel controls in assistant settings.`,defaultEnabled:!1},{id:`rollback-enabled`,scope:`assistant`,key:`rollback-enabled`,label:`Rollback Enabled`,description:`Show older versions in the version picker, allowing rollback to previous releases.`,defaultEnabled:!1},{id:`self-hosted-assistant`,scope:`client`,key:`self-hosted-assistant`,label:`Self-Hosted Assistant`,description:`Enable self-hosted assistant configuration.`,defaultEnabled:!1},{id:`web-remote-ingress`,scope:`assistant`,key:`web-remote-ingress`,label:`Web Remote Ingress`,description:`Serve the web client over a public tunnel and enable browser pairing for self-hosted assistants.`,defaultEnabled:!1},{id:`settings-sleep-policy`,scope:`assistant`,key:`settings-sleep-policy`,label:`Settings Sleep Policy`,description:`Enable sleep policy settings.`,defaultEnabled:!1},{id:`velvet`,scope:`client`,key:`velvet`,label:`Velvet`,description:`Enable the Velvet design theme.`,defaultEnabled:!1},{id:`memory-router-playground`,scope:`client`,key:`memory-router-playground`,label:`Memory Router Playground`,description:`Expose the developer-only Memory Router Playground tab in macOS Settings and the /assistant/memory-router-playground web page for dry-running v4 router config overrides against the live page index. Dev-only; default off.`,defaultEnabled:!1},{id:`memory-v3-shadow`,scope:`assistant`,key:`memory-v3-shadow`,label:`Memory v3 Shadow`,description:`When on, runs the new memory-v3 topic-tree retrieval alongside v2 in shadow mode: logs selections to memory_v3_selections, does not modify injected context. Off by default.`,defaultEnabled:!1},{id:`self-intro-greeting`,scope:`both`,key:`self-intro-greeting`,label:`Self-intro first message`,description:`On the first conversation, send a natural self-introduction (e.g. "Hi Vela, I'm alex. Nice to meet you.") on the user's behalf and route it through real LLM inference, instead of serving the canned first greeting. Names come from the onboarding context; falls back to the canned greeting when no name is known. Exposed to clients so pre-hatch onboarding can compute the source-of-truth initial message, and to the assistant so older clients can still be gated server-side. See assistant/src/daemon/first-greeting.ts (buildSelfIntroMessage).`,defaultEnabled:!1},{id:`research-onboarding`,scope:`client`,key:`research-onboarding`,label:`Research onboarding (spike)`,description:`Spike: replace pre-chat onboarding with a web-research "here's what I know about you" flow, including a Google Calendar "Let's chat tomorrow" step shown over the streaming research. Gates the /assistant/onboarding/research route and the research mock harness. Off by default; enable locally via the feature-flags panel.`,defaultEnabled:!1},{id:`channel-trust-floors`,scope:`assistant`,key:`channel-trust-floors`,label:`Channel Trust Floors`,description:`Expose the Channel Trust Floors settings card (per-channel inbound admission policy) on the Privacy settings page. When off, the card is hidden and channels fall back to their default admission floors. Off by default while the feature is in development.`,defaultEnabled:!1},{id:`mcp-settings`,scope:`assistant`,key:`mcp-settings`,label:`MCP Settings`,description:`Show the MCP page in Settings for managing Model Context Protocol server connections: view status, enable/disable, configure, and inspect registered tools per server.`,defaultEnabled:!1},{id:`os-beta`,scope:`assistant`,key:`os-beta`,label:`OS Beta`,description:`Enable the OS Beta model profile (GLM 5.2 / Fireworks) in the assistant's model profile selection.`,defaultEnabled:!1}]};function t(e,t){return e===t||e===`both`}var n=e.flags,r={};function i(e){return r[e]||e.split(`-`).map((e,t)=>e===`ui`?`UI`:t===0?e:e[0].toUpperCase()+e.slice(1)).join(``)}function a(e){let r={};for(let a of n)typeof a.defaultEnabled==`boolean`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}function o(e){let r={};for(let a of n)typeof a.defaultEnabled==`string`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}var s=a(`client`),c=a(`assistant`),l=o(`client`),u=o(`assistant`),d=new Map;for(let e of n)d.set(i(e.key),e);var f=new Map;for(let e of n)f.set(i(e.key),e.key);function p(e){return i(e)}function m(e){return f.get(e)}function h(e){return d.get(e)}var g=`VITE_VELLUM_FLAG_`;function _(e){return e.toLowerCase().replace(/_/g,`-`)}var v=new Set([`true`,`1`,`yes`,`on`]),y=new Set([`false`,`0`,`no`,`off`]);function b(e){let t=e.toLowerCase();return v.has(t)?!0:y.has(t)?!1:e}function x(){if(typeof window<`u`&&window.__VELLUM_FLAG_OVERRIDES__!=null)return{...window.__VELLUM_FLAG_OVERRIDES__};let e={},t={BASE_URL:`/assistant/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_PLATFORM_MODE:`false`};for(let n of Object.keys(t))if(n.startsWith(g)){let r=_(n.slice(17)),i=t[n];i!=null&&(e[r]=b(i))}return e}var S=null;function C(){return S===null&&(S=x()),S}var w=new Map;for(let e of n)w.set(e.key,e);function T(e){let n=C(),r={},i={};for(let[a,o]of Object.entries(n)){let n=w.get(a);if(!n||!t(n.scope,e))continue;let s=p(a);typeof o==`boolean`?r[s]=o:i[s]=o}return{bool:r,str:i}}export{p as a,h as c,l as i,t as l,u as n,n as o,s as r,T as s,c as t,m as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./pencil-lwgMCqyH.js";import{$a as a,Za as o,ho as s}from"./index-DjBiif5r.js";var c=e(t(),1),l=r(),u=`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`;function d({content:e,downloadContent:t,fileName:r,mimeType:u=`text/plain`,showEdit:d,isEditing:f,onToggleEdit:p,extraActions:m}){let[h,g]=(0,c.useState)(!1),_=(0,c.useRef)(null),v=(0,c.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{g(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>g(!1),1500)})},[e]),y=t??e,b=(0,c.useCallback)(()=>{let e=new Blob([y],{type:u}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=r,n.click(),URL.revokeObjectURL(t)},[y,r,u]);return(0,c.useEffect)(()=>()=>{_.current&&clearTimeout(_.current)},[]),f?null:(0,l.jsxs)(`div`,{className:`absolute right-3 top-3 z-10 flex items-center gap-1 rounded-md bg-[var(--surface-primary)] shadow-sm`,children:[d&&p&&(0,l.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:(0,l.jsx)(i,{"aria-hidden":!0}),onClick:p,"aria-label":`Edit file`,className:`hover:bg-[var(--surface-base)]`}),m,(0,l.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:h?(0,l.jsx)(s,{"aria-hidden":!0}):(0,l.jsx)(a,{"aria-hidden":!0}),onClick:v,"aria-label":h?`Copied`:`Copy file contents`,className:`hover:bg-[var(--surface-base)]`}),(0,l.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:(0,l.jsx)(o,{"aria-hidden":!0}),onClick:b,"aria-label":`Download file`,className:`hover:bg-[var(--surface-base)]`})]})}function f({value:e,onChange:t,onSave:n}){return(0,l.jsx)(`textarea`,{className:`m-0 h-full w-full resize-none overflow-auto border-none bg-transparent p-4 text-body-medium-lighter leading-relaxed outline-none`,style:{color:`var(--content-default)`,fontFamily:u},value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),n())},spellCheck:!1})}function p({isDirty:e,isSaving:t,error:r,onSave:i,onDiscard:a}){return(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t px-3 py-2`,style:{borderColor:`var(--border-element)`},children:[r&&(0,l.jsx)(`span`,{className:`mr-auto text-body-small-default`,style:{color:`var(--system-error)`},children:r}),(0,l.jsx)(n,{variant:`ghost`,size:`compact`,disabled:t,onClick:a,children:`Discard`}),(0,l.jsx)(n,{variant:`primary`,size:`compact`,disabled:!e||t,onClick:i,children:t?`Saving…`:`Save`})]})}function m({content:e,readOnly:t,whiteSpace:n=`pre-wrap`,onStartEdit:r}){return(0,l.jsx)(`pre`,{className:`m-0 h-full overflow-auto p-4 text-body-medium-lighter leading-relaxed${t?``:` cursor-text`}`,style:{color:`var(--content-default)`,fontFamily:u,whiteSpace:n},onClick:t?void 0:r,children:e})}export{m as i,p as n,f as r,d as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./pencil-lwgMCqyH.js";import{$a as a,Za as o,ho as s}from"./index-BiN-6kWM.js";var c=e(t(),1),l=r(),u=`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`;function d({content:e,downloadContent:t,fileName:r,mimeType:u=`text/plain`,showEdit:d,isEditing:f,onToggleEdit:p,extraActions:m}){let[h,g]=(0,c.useState)(!1),_=(0,c.useRef)(null),v=(0,c.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{g(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>g(!1),1500)})},[e]),y=t??e,b=(0,c.useCallback)(()=>{let e=new Blob([y],{type:u}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=r,n.click(),URL.revokeObjectURL(t)},[y,r,u]);return(0,c.useEffect)(()=>()=>{_.current&&clearTimeout(_.current)},[]),f?null:(0,l.jsxs)(`div`,{className:`absolute right-3 top-3 z-10 flex items-center gap-1 rounded-md bg-[var(--surface-primary)] shadow-sm`,children:[d&&p&&(0,l.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:(0,l.jsx)(i,{"aria-hidden":!0}),onClick:p,"aria-label":`Edit file`,className:`hover:bg-[var(--surface-base)]`}),m,(0,l.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:h?(0,l.jsx)(s,{"aria-hidden":!0}):(0,l.jsx)(a,{"aria-hidden":!0}),onClick:v,"aria-label":h?`Copied`:`Copy file contents`,className:`hover:bg-[var(--surface-base)]`}),(0,l.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:(0,l.jsx)(o,{"aria-hidden":!0}),onClick:b,"aria-label":`Download file`,className:`hover:bg-[var(--surface-base)]`})]})}function f({value:e,onChange:t,onSave:n}){return(0,l.jsx)(`textarea`,{className:`m-0 h-full w-full resize-none overflow-auto border-none bg-transparent p-4 text-body-medium-lighter leading-relaxed outline-none`,style:{color:`var(--content-default)`,fontFamily:u},value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),n())},spellCheck:!1})}function p({isDirty:e,isSaving:t,error:r,onSave:i,onDiscard:a}){return(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t px-3 py-2`,style:{borderColor:`var(--border-element)`},children:[r&&(0,l.jsx)(`span`,{className:`mr-auto text-body-small-default`,style:{color:`var(--system-error)`},children:r}),(0,l.jsx)(n,{variant:`ghost`,size:`compact`,disabled:t,onClick:a,children:`Discard`}),(0,l.jsx)(n,{variant:`primary`,size:`compact`,disabled:!e||t,onClick:i,children:t?`Saving…`:`Save`})]})}function m({content:e,readOnly:t,whiteSpace:n=`pre-wrap`,onStartEdit:r}){return(0,l.jsx)(`pre`,{className:`m-0 h-full overflow-auto p-4 text-body-medium-lighter leading-relaxed${t?``:` cursor-text`}`,style:{color:`var(--content-default)`,fontFamily:u,whiteSpace:n},onClick:t?void 0:r,children:e})}export{m as i,p as n,f as r,d as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./capture-error-B0wqOYKY.js";import{t as s}from"./react-DJZBPgpf.js";import{t as c}from"./button-D7s2Q_uG.js";import{d as l,t as u}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as d}from"./QueryClientProvider-DKhXIxGb.js";import{t as f}from"./useQuery-B45lW1Kk.js";import{t as p}from"./useMutation-Lj4VunQV.js";import{t as m}from"./jsx-runtime-CVSDxk6A.js";import{t as h}from"./cn-DvW5mxZR.js";import{t as g}from"./dropdown-yOV5eJnU.js";import{c as _,l as v,n as y}from"./src-D6Nu2Lol.js";import{t as b}from"./confirm-dialog-DbNUkFt6.js";import{t as x}from"./notice-G5Imd5pC.js";import{t as S}from"./tag-BadGF3FB.js";import{t as C}from"./input-CwdmSRlD.js";import{t as w}from"./toggle-_vZlLDBV.js";import{n as T}from"./stat-square-B5tBfA4w.js";import{t as E}from"./modal-DX6UN7b0.js";import{n as D}from"./toast-DLWkiWW6.js";import{d as O,f as k,s as A}from"./local-mode-9ZkSq1Fr.js";import{t as j}from"./is-electron-BuSDabCt.js";import{n as M}from"./resolved-assistants-store-DMuRxkZC.js";import{t as N}from"./createLucideIcon-DIlBzeWM.js";import{t as P}from"./bell-CSP2EUlP.js";import{t as F}from"./chevron-right-HpmykQ8I.js";import{t as I}from"./circle-alert-C5TvMkJV.js";import{t as L}from"./hard-drive-C6sJQKXL.js";import{t as R}from"./loader-circle-CTs38Ovl.js";import{t as z}from"./moon-C0wLM1iN.js";import{a as ee,c as te,o as ne,r as re,s as ie,t as ae}from"./resize-errors-tz_Tui32.js";import{t as oe}from"./sparkles-B9QIWdq0.js";import{t as se}from"./triangle-alert-M_S_Pe8C.js";import{n as B,r as V,t as H}from"./api-errors-CwAGZ-xJ.js";import{G as U,_ as W,a as ce,b as le,g as ue,n as de,u as fe,x as pe,y as me}from"./auth-store-CyAWX99c.js";import{t as he}from"./client.gen-Cuv6iN0E.js";import{S as ge,j as _e,q as ve,z as ye}from"./sdk.gen-D7k-QjYl.js";import{a as G}from"./routes-BKwsRssF.js";import{t as K}from"./client-feature-flag-store-C1ws4QpG.js";import{n as q,t as be}from"./semver-CWB8BPhv.js";import{t as xe}from"./assistant-feature-flag-store-BMVR2Dx7.js";import{t as Se}from"./proxy-BaYss8LN.js";import{t as Ce}from"./use-reduced-motion-C9zjvTsb.js";import{Bn as we,Cr as Te,Dn as Ee,Dr as De,Fn as Oe,Ft as ke,It as Ae,J as je,Ji as Me,K as Ne,Ki as Pe,Ln as Fe,Mn as Ie,Mt as Le,Nn as Re,Or as ze,Pn as Be,Pt as Ve,Qi as He,Qr as Ue,Rn as We,Sa as Ge,Vr as Ke,Xr as qe,Zr as Je,Zt as Ye,_n as Xe,ar as Ze,ca as Qe,d as $e,et,f as tt,ho as nt,jr as rt,jt as it,l as at,la as ot,mo as st,s as ct,sr as lt,u as ut,ua as dt,v as J,za as ft,zn as pt}from"./index-DjBiif5r.js";import{t as mt}from"./use-active-assistant-id-BtGthKQp.js";import{t as Y}from"./detail-card-DeCfFKxN.js";import{t as ht}from"./environment-store-BPyWfH08.js";import{i as gt,n as X,r as _t,t as vt}from"./assistant-status-panel-CqM_xxPL.js";var yt=N(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),bt=N(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(s(),1),xt=ue,St=`Please choose a different handle.`;async function Ct(e,t){let{data:n,error:r,response:i}=await _e({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:V(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=pe(r,`handle`,xt.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=pe(r,`handle`,St);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:V(r,i,`Failed to save handle.`)}}async function wt(e,t,n){let{data:r,error:i,response:a}=await ge({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(B(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new H(a.status,a.status===429?`Too many checks — try again in a moment.`:V(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function Tt(e){return/\d{2,}$/.test(e)}var Q=m(),Et=300,Dt=1400;function Ot({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:s,fieldId:l}){let[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(null),b=Ce(),x=(0,Z.useRef)(null),S=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),w=S===e.toLowerCase();(0,Z.useEffect)(()=>{if(w||S.length===0){h(!1),x.current?.abort();return}let e=new AbortController;x.current?.abort(),x.current=e,h(!0);let t=window.setTimeout(async()=>{try{let t=await i(S,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||y(t instanceof Error?t.message:`Couldn't check availability.`)}finally{e.signal.aborted||h(!1)}},Et);return()=>{window.clearTimeout(t),e.abort()}},[S,w,i]);let T=(()=>{if(v)return v;if(f&&!f.available){let e=f.code;return f.message??(e?xt[e]:`Please choose a different handle.`)}return null})(),E=T?n:w?r??null:m?`Checking availability…`:f?.available?`Available.`:null,O=!w&&!m&&f?.available!==!1&&g!==`saving`,k=(0,Z.useCallback)(async()=>{if(!O)return;_(`saving`),y(null);let e=await a(S);if(e.kind===`ok`){_(`saved`),o(e.data),D.success(s),window.setTimeout(()=>_(`idle`),Dt);return}if(e.kind===`taken`){_(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){_(`idle`),p({available:!1,code:e.code,message:e.message});return}_(`error`),y(e.message),D.error(e.message)},[O,S,o,a,s]),A=(()=>{if(w&&u.length>0||u.length===0)return null;let e=m?`checking`:f?.available?`available`:f?.available===!1?`invalid`:null;return e?(0,Q.jsx)(je,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(Se.span,{initial:b?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:b?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(nt,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":`Available`}),e===`invalid`&&(0,Q.jsx)(I,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":`Not available`})]},e)}):null})(),j=(()=>{switch(g){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(R,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),`Saving…`]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(nt,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Saved`]});default:return`Save`}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(C,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),y(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:A,errorText:T??void 0,helperText:E??void 0,"aria-invalid":!!T,fullWidth:!0,"data-testid":`${l}-input`}),(!w||g!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(c,{variant:`primary`,size:`compact`,onClick:k,disabled:!O,"aria-live":`polite`,"data-testid":`${l}-save`,children:j})})]})}function kt({initial:e,onSaved:t}){let n=de.use.refreshSession(),r=Tt(e.username)?`Your handle was auto-generated at signup — pick one you like.`:void 0,i=(0,Z.useCallback)(async e=>await le({username:e}),[]),a=(0,Z.useCallback)((e,t)=>W(e,t),[]),o=(0,Z.useCallback)(e=>{t(e),n()},[t,n]);return(0,Q.jsx)(Ot,{initialHandle:e.username,inputLabel:`User handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:r,checkAvailable:a,save:i,onSaved:o,saveSuccessToast:`Profile updated.`,fieldId:`user-handle`})}function At({assistant:e,onSaved:t}){let n=e.handle??``,r=f({...Xe({path:{assistant_id:e.id}})}).data?.results?.[0],i=!!r&&r.subdomain.toLowerCase()===n.toLowerCase(),a=n.length===0?`Your assistant doesn't have a handle yet — claim one to make it mentionable.`:void 0,o=(0,Z.useCallback)(async t=>await Ct(e.id,t),[e.id]),s=(0,Z.useCallback)((t,n)=>wt(e.id,t,n),[e.id]);return i?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(C,{label:`Assistant handle`,value:n,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant's handle is locked because it's used as its email subdomain. To change it,`,` `,(0,Q.jsx)(u,{to:`${G.settings.ai}?release=1#email`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`release the subdomain`}),` `,`first.`]})]}):(0,Q.jsx)(Ot,{initialHandle:n,inputLabel:`Assistant handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:a,checkAvailable:s,save:o,onSaved:t,saveSuccessToast:`Assistant handle updated.`,fieldId:`assistant-handle`})}function jt(){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-3 w-72 animate-pulse rounded bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-60 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-7 w-16 animate-pulse rounded-md bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Loading your profile…`})]})}function Mt({assistant:e}={}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=Ce(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return me().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),(0,Q.jsx)(Y,{title:`Profile`,subtitle:`Manage your user and assistant public handles.`,children:r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(Se.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(kt,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(At,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(jt,{})})}var Nt=Ee({query:{hosting:`platform`}});function Pt(){let e=mt(),t=f(Nt),n=t.data?.results??[];return t.isPending||n.length<2?null:(0,Q.jsx)(Y,{title:`Switch Assistant`,subtitle:`Choose which assistant is active for this account.`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(t=>{let n=t.id===e;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(Ge,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:t.name||`Unnamed`}),t.status!==`active`&&(0,Q.jsx)(S,{tone:`warning`,children:t.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:n?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(nt,{className:`h-4 w-4`}),`Active`]}):(0,Q.jsx)(c,{variant:`outlined`,size:`compact`,disabled:t.status!==`active`,onClick:()=>{U(t.id),D.success(`Switched active assistant.`)},children:`Switch`})})]},t.id)})})})}var Ft=[{label:`Never`,seconds:0},{label:`5 min`,seconds:300,devOnly:!0},{label:`10 min`,seconds:600,devOnly:!0},{label:`1 hour`,seconds:3600},{label:`3 hours`,seconds:10800},{label:`1 day`,seconds:86400},{label:`3 days`,seconds:259200},{label:`7 days`,seconds:604800},{label:`14 days`,seconds:1209600},{label:`30 days`,seconds:2592e3}];function It(e){if(e===0)return`Never (sleep disabled)`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0&&n>0)return`${t}d ${n}h`;if(t>0)return`${t} day${t===1?``:`s`}`;if(n>0)return`${n} hour${n===1?``:`s`}`;let r=Math.floor(e/60);return r>0?`${r} minute${r===1?``:`s`}`:`${e}s`}function Lt({assistantId:e}){let t=d(),n=ht.use.isNonProduction(),r=(0,Z.useMemo)(()=>Ft.filter(e=>!e.devOnly||n),[n]),{data:i,isLoading:a,isError:o}=f(pt({path:{id:e}})),s=(0,Z.useMemo)(()=>i?.idle_timeout_seconds??259200,[i]),[l,u]=(0,Z.useState)(null),p=l??s,m=l!==null,h=ze({onSuccess:()=>{D.success(`Sleep policy saved.`),u(null),t.invalidateQueries({queryKey:we({path:{id:e}})})},onError:()=>{D.error(`Failed to save sleep policy. Please try again.`)}});return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin`}),`Loading sleep settings...`]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load sleep policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Idle timeout`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`How long the assistant can be idle before it is put to sleep. "Never" disables idle sleep entirely.`}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:r.map(e=>(0,Q.jsx)(c,{variant:`outlined`,active:p===e.seconds,onClick:()=>u(e.seconds),children:e.label},e.seconds))}),(0,Q.jsxs)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:[`Current: `,It(p)]})]}),m&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(c,{variant:`primary`,leftIcon:h.isPending?(0,Q.jsx)(R,{className:`animate-spin`}):void 0,onClick:()=>h.mutate({path:{id:e},body:{idle_timeout_seconds:p}}),disabled:h.isPending,children:`Save`}),(0,Q.jsx)(c,{variant:`outlined`,onClick:()=>u(null),disabled:h.isPending,children:`Cancel`})]})]})}function Rt(e,t,n){let r=[e.version];return e.version===n&&r.push(`(latest)`),t&&e.version===t&&r.push(`(current)`),r.join(` `)}var zt=3e3;function Bt(e,t){return t&&e===`preview`?`preview`:`stable`}function Vt({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let i=xe.use.rollbackEnabled(),a=K.use.previewChannel(),o=d(),s=Bt(n,a),l=s===`preview`,[u,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(null),[_,v]=(0,Z.useState)(null),[y,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(null),E=e=>e&&h.current&&e===h.current?(queueMicrotask(()=>{T(S?`Successfully rolled back to version ${h.current}.`:`Successfully updated to version ${h.current}.`),m(!1),h.current=null,v(null),D.success(S?`Rollback complete — assistant is healthy.`:`Update complete — assistant is healthy.`),r?.()}),!1):zt;f({...Fe({path:{id:e}}),refetchInterval:u?e=>E(e.state.data?.current_release_version):!1});let{data:O,isLoading:k}=f(Te({query:{channel:s}})),A=O?.find(e=>e.is_stable!==!1)??O?.[0],j=_??A?.version??null,M=(0,Z.useMemo)(()=>{if(!i||!j||!t)return!1;let e=q(j),n=q(t);return!e||!n?!1:be(e,n)<0},[i,j,t]),N=(0,Z.useMemo)(()=>{if(!j)return!1;if(!t)return!0;let e=q(j),n=q(t);if(!e||!n)return j!==t;let r=be(e,n);return i?r!==0:r>0},[i,j,t]),P=p({mutationFn:async t=>{let{data:n}=await ve({path:{id:e},body:t,throwOnError:!0});return n}}),F=p({mutationFn:async t=>{let{data:n}=await ye({path:{id:e},body:t,throwOnError:!0});return n}});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:t??`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:l?`Preview release`:N?M?`Rollback to`:`Update to`:`Selected`}),(0,Q.jsx)(`span`,{className:`block min-w-0`,children:k?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`}),`Loading...`]}):O&&O.length>0?i?(0,Q.jsx)(g,{value:j??``,onChange:e=>v(e===A?.version?null:e),disabled:u||P.isPending||F.isPending,options:O.map(e=>({value:e.version,label:Rt(e,t,A?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:A?Rt(A,t,A.version):`—`}):`No releases available`})]})]}),(0,Q.jsx)(c,{variant:M?`outlined`:`primary`,className:`min-w-[160px]`,leftIcon:P.isPending||F.isPending||u?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(dt,{}),onClick:()=>x(!0),disabled:!N||P.isPending||F.isPending||u||k||!O?.length,children:u?S?`Rolling back...`:`Updating...`:M?`Rollback`:l?`Update preview`:`Update`}),l&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Using Preview releases.`,` `,(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`,children:`Switch back to Stable`})]}),!N&&t&&j&&!k&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:w??`You are already on this version.`}),(0,Q.jsx)(b,{open:y,title:M?`Rollback assistant`:l?`Update preview release`:`Update assistant`,message:M?`Rollback to version ${j??`unknown`}? The assistant will be briefly unavailable.`:l?`Update to preview version ${j??`latest`}? The assistant will be briefly unavailable during the update.`:`Update to version ${j??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:M?`Rollback`:l?`Update preview`:`Update`,onConfirm:async()=>{x(!1),T(null);let t=_??void 0;try{if(M){let e=await F.mutateAsync({version:t});h.current=e.version??t??null,D.success(e.detail||`Rollback to ${t} initiated.`)}else{let e=await P.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){D.warning(e.detail);return}h.current=e.version??t??null,D.success(e.detail||`Update to ${e.version??t??`latest`} initiated.`)}C(M),m(!0),o.invalidateQueries({queryKey:We({path:{id:e}})})}catch{D.error(M?`Failed to trigger rollback. Please try again.`:`Failed to trigger update. Please try again.`)}},onCancel:()=>x(!1)})]})}function Ht(){let e=tt.useValue();if(Ye())return null;let t=ut()?`Cmd`:`Ctrl`;return(0,Q.jsx)(Y,{title:`Composer`,children:(0,Q.jsx)(w,{checked:e,onChange:tt.save,label:`Send with ${t}+Enter`,helperText:`When enabled, Enter inserts a new line and ${t}+Enter sends.`})})}function Ut(){let e=Ae({platformHostedOnly:!0}),t=ke(),n=de.use.user()?.id??null,r=de.use.logout(),[i,a]=(0,Z.useState)(!1),o=rt({onSuccess:async()=>{D.success(`Account deletion requested. You will be logged out shortly.`),fe(n),await r(),Ke(G.account.login)},onError:()=>{D.error(`Failed to request account deletion. Please try again.`)}}),s=e===`full`&&t;return(0,Z.useEffect)(()=>{s&&i&&a(!1)},[s,i]),e===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Delete Account`,subtitle:`Permanently delete your account and all associated data.`,variant:`danger`,children:e===`disabled`?(0,Q.jsx)(J,{children:`Log in to the Vellum platform to delete your account.`}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(c,{variant:`dangerOutline`,onClick:()=>a(!0),disabled:o.isPending||s,className:`self-start`,children:`Delete My Account`}),s&&(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})}),(0,Q.jsx)(b,{open:i,title:`Delete Account`,message:`This will permanently delete your account and all associated data. This action cannot be undone.`,confirmLabel:`Delete Account`,destructive:!0,onConfirm:()=>{if(s){a(!1);return}a(!1),o.mutate({})},onCancel:()=>a(!1)})]})}function Wt({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(Y,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(c,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function Gt(){return $e()?(0,Q.jsx)(Wt,{title:`Get the iOS App`,subtitle:`The Vellum iOS app gives you a native experience.`,benefits:[{icon:P,text:`Push notifications`},{icon:yt,text:`Biometric login`},{icon:bt,text:`Native haptics`},{icon:He,text:`Home screen access`}],ctaLabel:`Download`,ctaLeftIcon:(0,Q.jsx)(He,{size:16}),onAction:()=>{at(),ct()}}):null}async function Kt(){if(!j())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function qt(e){if(!j())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function Jt(){let[e,t]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{Kt().then(t)},[]);let n=async e=>{t(e);try{await qt(e)}catch{t(!e)}};return(0,Q.jsx)(Y,{title:`Launch at Login`,subtitle:`Automatically start Vellum when you log in to your Mac.`,children:(0,Q.jsx)(w,{checked:e,onChange:e=>void n(e),"aria-label":`Launch at Login`})})}function Yt({className:e}){return(0,Q.jsx)(`div`,{role:`presentation`,className:h(`h-px w-full bg-[var(--border-base)]`,e)})}var $=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Xt(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...$]}function Zt(){return n(`mediaEmbedsEnabled`,!0)}function Qt(){let e=i(`mediaEmbedDomains`,``);return e?Xt(e):[...$]}function $t(){let[e,n]=(0,Z.useState)(()=>Zt()),[i,a]=(0,Z.useState)(()=>Qt()),[o,s]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(``),d=(0,Z.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},h=e=>{p(i.filter(t=>t!==e))},g=()=>{p([...$])},_=i.length===$.length&&i.every((e,t)=>e===$[t]);return(0,Q.jsxs)(Y,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,Q.jsx)(w,{checked:e,onChange:f})]}),e&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Yt,{})}),(0,Q.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,Q.jsx)(st,{className:`h-4 w-4`,"aria-hidden":!0}):(0,Q.jsx)(F,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,Q.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Q.jsx)(C,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Q.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:g,disabled:_,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,Q.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(Pe,{}),onClick:()=>h(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function en(e){return e===`preview`?`preview`:`stable`}function tn(e){if(!e)return`Unknown`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown`:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function nn(e){return e.source_release_version?`Stable ${e.source_release_version}`:e.snapshot_name}function rn(e){return e.filter(e=>e.ready_to_use)}function an(e){return e?.feature_enabled===!1}function on({assistantId:e,onComplete:t}){let n=K.use.previewChannel(),r=d(),[i,a]=(0,Z.useState)(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,m]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),_=Be({path:{assistant_id:e}}),v=Oe({path:{assistant_id:e}}),b=We({path:{id:e}}),{data:C,isLoading:w,isError:T}=f({..._,enabled:n,retry:!1}),E=C?.preview_backups??[],O=(0,Z.useMemo)(()=>rn(E),[E]),k=O[0],A=O.find(e=>e.snapshot_name===h)??k,j=()=>{r.invalidateQueries({queryKey:v}),r.invalidateQueries({queryKey:b}),t?.()},M=p(Ie()),N=p(Re()),P=en(C?.current_channel),F=M.isPending||N.isPending,I=F||an(C)||!C?.latest_preview_release,L=u===`restore_backup`&&!A;if((0,Z.useEffect)(()=>{a(P===`preview`?`release-channel`:void 0)},[P]),!n)return null;let z=C?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y.Root,{type:`single`,collapsible:!0,value:i,onValueChange:e=>a(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(y.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(y.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Release Channel`}),C&&(0,Q.jsx)(S,{tone:P===`preview`?`warning`:`neutral`,children:P===`preview`?`Preview`:`Stable`})]}),(0,Q.jsx)(st,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(y.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[w&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin`}),`Loading release channel...`]}),T&&(0,Q.jsx)(x,{tone:`error`,title:`Could not load release channel status`,children:`Refresh this page before changing release channels.`}),C&&(0,Q.jsxs)(Q.Fragment,{children:[an(C)&&(0,Q.jsx)(x,{tone:`neutral`,title:`Preview channel is unavailable`,children:`The Preview channel is not enabled for this assistant.`}),P===`stable`?(0,Q.jsx)(sn,{status:C,isChangingChannel:F,optInDisabled:I,onOptIn:()=>s(!0)}):(0,Q.jsx)(cn,{status:C,isChangingChannel:F,onOptOut:()=>{let e=k;g(e?.snapshot_name??``),m(e?`restore_backup`:z?`standard_upgrade`:`restore_backup`),l(!0)}})]})]})})]})}),(0,Q.jsx)(un,{open:o,isPending:M.isPending,previewVersion:C?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await M.mutateAsync({path:{assistant_id:e}});D.success(t.detail||`Preview channel enabled.`),s(!1),j()}catch(e){D.error(V(e,void 0,`Could not enable Preview channel.`))}},onCancel:()=>s(!1)}),(0,Q.jsx)(dn,{open:c,backups:O,mode:u,selectedSnapshotName:A?.snapshot_name??``,isPending:N.isPending,restoreModeDisabled:L,standardUpgradeAvailable:z,onModeChange:m,onSnapshotChange:g,onConfirm:async()=>{if(!L)try{let t=await N.mutateAsync({path:{assistant_id:e},body:u===`restore_backup`?{mode:`restore_backup`,snapshot_name:A?.snapshot_name}:{mode:`standard_upgrade`}});D.success(t.detail||`Stable channel enabled.`),l(!1),j()}catch(e){D.error(V(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>l(!1)})]})}function sn({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ln,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(x,{tone:`neutral`,title:`No Preview release is available`,children:`Stable remains the only available release channel.`}),(0,Q.jsx)(c,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(ot,{}),disabled:n,onClick:r,children:`Opt in to Preview`})]})}function cn({status:e,isChangingChannel:t,onOptOut:n}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ln,{status:e}),(0,Q.jsx)(c,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(Qe,{}),disabled:t,onClick:n,children:`Switch back to Stable`})]})}function ln({status:e}){return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Stable`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??`None`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Preview`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??`None`})]})]})}function un({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){return(0,Q.jsx)(E.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(E.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:se,children:`Opt in to Preview`}),(0,Q.jsx)(E.Description,{children:`Preview releases may be unstable. A 90-day safety backup is taken before the image changes.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(x,{tone:`warning`,title:`Data loss may occur when returning to Stable`,children:`Preview data may not be compatible with the Stable channel. The safety backup lets you restore the Stable-channel data that existed before opt-in.`}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:`Create and verify a Preview safety backup.`}),(0,Q.jsxs)(`li`,{children:[`Switch to Preview image `,n??`latest`,`.`]}),(0,Q.jsx)(`li`,{children:`Run the normal upgrade path and wait for health.`})]})]})}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(c,{variant:`outlined`,disabled:t,onClick:i,children:`Cancel`}),(0,Q.jsx)(c,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(ot,{}),onClick:r,children:t?`Switching...`:`Take Backup and Switch`})]})]})})}function dn({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:a,standardUpgradeAvailable:o,onModeChange:s,onSnapshotChange:l,onConfirm:u,onCancel:d}){return(0,Q.jsx)(E.Root,{open:e,onOpenChange:e=>!e&&d(),children:(0,Q.jsxs)(E.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:se,children:`Switch back to Stable`}),(0,Q.jsx)(E.Description,{children:`Choose how this assistant should leave the Preview channel.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(v,{value:n,onValueChange:s,disabled:i,"aria-label":`Stable channel return method`,children:[(0,Q.jsx)(_,{value:`restore_backup`,disabled:t.length===0,label:`Restore safety backup`,helperText:`Return to the Stable-channel data captured before Preview opt-in.`}),(0,Q.jsx)(_,{value:`standard_upgrade`,disabled:!o,label:`Switch to Stable without restoring backup`,helperText:o?`Keep the current data and directly switch to the Stable image.`:`Unavailable because the latest Stable release is older than this assistant's Preview release.`})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[`Safety backup`,(0,Q.jsx)(g,{value:r,onChange:l,disabled:i,options:t.map(e=>({value:e.snapshot_name,label:`${nn(e)} - ${tn(e.created_at)}`}))})]}),n===`restore_backup`&&t.length===0&&!o&&(0,Q.jsx)(x,{tone:`error`,title:`Stable requires a safety backup`,children:`This Preview release is newer than the latest Stable release, so switching directly is blocked. Wait for a newer Stable release, or run Vellum Doctor if the safety backup is missing.`}),n===`standard_upgrade`&&(0,Q.jsx)(x,{tone:`error`,title:`Preview data may not survive this`,children:`Switching directly to the Stable image without restoring the safety backup may cause data loss or leave the assistant unusable if Preview data is incompatible with Stable.`})]})}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(c,{variant:`outlined`,disabled:i,onClick:d,children:`Cancel`}),(0,Q.jsx)(c,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||a||n===`standard_upgrade`&&!o,leftIcon:i?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(dt,{}),onClick:u,children:i?`Switching...`:`Switch to Stable`})]})]})})}function fn({assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}){let o=l(),s=f(lt()),d=s.data,p=!e.is_local,m=d?.plan_id===`pro`,h=f({...Ze(),enabled:m}),_=e.machine_size||`small`,v=ee(h.data?.max_machine_tier??null),y=(0,Z.useMemo)(()=>ne(v,_,(0,Q.jsx)(S,{tone:`positive`,children:`Current`})),[v,_]),b=h.data?.selected_storage_gib??null,[C,w]=(0,Z.useState)(!1),T=v.length>0?v[v.length-1]:null,[O,k]=(0,Z.useState)(null),A=O??T??_,[j,M]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(null),F=De({onSuccess:(e,n)=>{D.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),P(null),k(null),w(!1),n.body?.machine_size==null?i():a(t)},onError:e=>{P(ae(e,`Failed to resize assistant. Please try again.`))}});if(s.isError&&d==null)return(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(x,{tone:`error`,children:`Could not load your subscription. Please try again.`})});let I=m&&v.includes(A)&&A!==_?A:null,z=m&&b!=null&&!0,se=m&&v.length>0&&ie(_)<ie(v[v.length-1]),B=F.isPending||r,V=b==null?t?.disk?.totalMb??null:b*1024,H=t?.disk&&V!=null?{value:t.disk.usedMb,max:V,caption:`${X(t.disk.usedMb)} of ${X(V)}`}:null,U=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,W=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:`${X(t.memory.currentMb)} of ${X(t.memory.maxMb)}`}:null,ce=p?m?z?(0,Q.jsxs)(`button`,{type:`button`,disabled:B,onClick:()=>w(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(oe,{className:`h-3.5 w-3.5`}),`Increase Storage`]}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,disabled:B,onClick:()=>w(!0),children:`Resize`}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,onClick:()=>M(`storage`),children:`Resize`}):null,le=p?m?se?(0,Q.jsxs)(`button`,{type:`button`,disabled:B,onClick:()=>w(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(oe,{className:`h-3.5 w-3.5`}),`Increase Size`]}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,disabled:B,onClick:()=>w(!0),children:`Resize`}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,onClick:()=>M(`machine`),children:`Resize`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,compactAccessory:!0,accessory:(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,iconOnly:n||r?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(dt,{}),tooltip:r?`Applying resize…`:`Refresh resource metrics`,"aria-label":`Refresh resource metrics`,disabled:n||r,onClick:()=>void i()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(L,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Disk`})]}),ce]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Storage`}),H?(0,Q.jsx)(gt,{value:H.value,max:H.max,caption:H.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Unavailable`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(te,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Machine`}),(0,Q.jsx)(S,{tone:`neutral`,children:re[_]})]}),le]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`CPU`}),U?(0,Q.jsx)(gt,{value:U.value,max:U.max,caption:U.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Memory`}),W?(0,Q.jsx)(gt,{value:W.value,max:W.max,caption:W.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(E.Root,{open:j!=null,onOpenChange:e=>{e||M(null)},children:(0,Q.jsxs)(E.Content,{size:`sm`,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{children:`Upgrade to Pro`}),(0,Q.jsx)(E.Description,{children:j===`storage`?`Upgrade to the Pro plan to increase your storage allocation and get more space for your assistant.`:`Upgrade to the Pro plan to unlock larger machine sizes with more CPU and memory for your assistant.`})]}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(c,{variant:`ghost`,onClick:()=>M(null),children:`Cancel`}),(0,Q.jsx)(c,{onClick:()=>{M(null),o(`${G.settings.billing}?adjust_plan=1`)},children:`Upgrade`})]})]})}),(0,Q.jsx)(E.Root,{open:C,onOpenChange:e=>{e||(w(!1),k(null),P(null))},children:(0,Q.jsxs)(E.Content,{size:`sm`,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:te,children:`Resize Assistant`}),(0,Q.jsx)(E.Description,{children:`Resize your assistant's compute and storage. Your assistant will briefly restart.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[v.length===0?(0,Q.jsx)(x,{tone:`warning`,children:`No machine tier configured. Visit the community for help.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:`Machine Size`}),(0,Q.jsx)(g,{options:y,value:A,onChange:k,"aria-label":`Compute machine size`,"data-testid":`resize-machine-size`})]}),z?(0,Q.jsx)(x,{tone:`info`,children:`Storage will be expanded to ${b} GiB.`}):(0,Q.jsx)(x,{tone:`neutral`,children:`Storage will not change.`}),N&&(0,Q.jsx)(x,{tone:`error`,children:N})]})}),(0,Q.jsxs)(E.Footer,{className:`items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:[`Need more?`,` `,(0,Q.jsx)(u,{to:`${G.settings.billing}?adjust_plan=1`,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>w(!1),children:`Upgrade plan`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(c,{variant:`ghost`,onClick:()=>{w(!1),k(null),P(null)},children:`Cancel`}),(0,Q.jsx)(c,{disabled:I==null&&!z||B,leftIcon:B?(0,Q.jsx)(R,{className:`animate-spin`}):void 0,onClick:()=>{P(null);let t={};I!=null&&(t.machine_size=I),z&&b!=null&&(t.storage_gib=b),F.mutate({path:{id:e.id},body:t})},children:N?`Retry`:`Apply`})]})]})]})})]})}function pn({assistantId:e}){let t=l(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(c,{variant:`dangerOutline`,onClick:()=>r(!0),className:`shrink-0`,children:`Retire Assistant`}),(0,Q.jsx)(it,{open:n,isPending:i,onConfirm:async()=>{a(!0);let n=await Le(e);if(n.ok){r(!1),t(n.nextRoute,{replace:!0});return}D.error(n.error),a(!1),r(!1)},onCancel:()=>r(!1)})]})}var mn=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function hn(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...mn].sort()}function gn(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);if(n){let e=n[1]===`-`?-1:1,t=parseInt(n[2]??`0`,10),r=parseInt(n[3]??`0`,10);i=e*(t*60+r)}}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function _n(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function vn(e){if(!e)return`Not set`;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}function yn({value:e,onChange:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useMemo)(()=>hn().map(e=>gn(e)).filter(e=>e!==null),[]);(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>{a(n.trim().toLowerCase())},200);return()=>window.clearTimeout(e)},[n]),(0,Z.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]);let d=(0,Z.useMemo)(()=>i?u.filter(e=>e.city.toLowerCase().includes(i)||e.region.toLowerCase().includes(i)||e.offsetLabel.toLowerCase().includes(i)||e.identifier.toLowerCase().includes(i)):u,[u,i]),f=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]),p=e=>{t(e),r(``),s(!1),l.current?.blur()};return(0,Q.jsxs)(`div`,{ref:c,className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Closest city`}),(0,Q.jsxs)(`div`,{className:`relative w-full md:max-w-[280px]`,children:[(0,Q.jsx)(C,{ref:l,type:`text`,value:n,placeholder:f||`Search city or country...`,onChange:e=>{r(e.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:e=>{e.key===`Escape`&&(r(``),s(!1),l.current?.blur())},fullWidth:!0}),o&&d.length>0&&(0,Q.jsx)(`div`,{className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] overflow-y-auto rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,children:d.slice(0,200).map(t=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>p(t.identifier),className:`flex w-full cursor-pointer items-center justify-between gap-3 px-3 py-2 text-left text-body-medium-lighter transition-colors ${t.identifier===e?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-default)] hover:bg-[var(--surface-active)]`}`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:t.city}),t.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:t.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:_n(t.identifier)}),(0,Q.jsx)(`span`,{children:t.offsetLabel})]})]},t.identifier))})]})]}),(0,Q.jsx)(Yt,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Time zone`}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:vn(e)})]})]})}function bn(){let e=K.use.velvet(),[t,n]=(0,Z.useState)(()=>Je({velvetEnabled:e}));return(0,Z.useEffect)(()=>{n(Je({velvetEnabled:e}))},[e]),(0,Z.useEffect)(()=>a(`theme`,()=>{n(Je({velvetEnabled:e}))}),[e]),(0,Z.useEffect)(()=>{qe(t)},[t]),(0,Q.jsx)(Y,{title:`Theme`,children:(0,Q.jsx)(`div`,{className:`max-w-[360px]`,children:(0,Q.jsx)(T,{ariaLabel:`Theme`,value:t,onChange:e=>{n(e),Ue(e),qe(e)},items:[{value:`system`,label:`System`,icon:(0,Q.jsx)(Ge,{className:`h-4 w-4`})},{value:`light`,label:`Light`,icon:(0,Q.jsx)(Me,{className:`h-4 w-4`})},{value:`dark`,label:`Dark`,icon:(0,Q.jsx)(z,{className:`h-4 w-4`})},...e?[{value:`velvet`,label:`Velvet`,icon:(0,Q.jsx)(ft,{className:`h-4 w-4`})}]:[]]})})})}function xn(){let e=M.use.activeAssistantId(),[t,n]=(0,Z.useState)(()=>i(`timezone`,``)),a=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{a.current=e},[e]);let s=(0,Z.useRef)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(()=>{}),u=e=>{if(s.current){c.current=e;return}let t=a.current;if(!t){c.current=null;return}s.current=!0,c.current=null,he.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{o(e,{context:`settings-timezone-override`})}).finally(()=>{s.current=!1;let e=c.current;c.current=null,e!==null&&l.current(e)})};return(0,Z.useEffect)(()=>{l.current=u}),(0,Q.jsx)(Y,{title:`Timezone`,subtitle:`Used when displaying times and scheduling reminders.`,children:(0,Q.jsx)(yn,{value:t,onChange:e=>{n(e),r(`timezone`,e),u(e)}})})}function Sn(){let{assistant:e,assistantLoading:t,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}=_t(),s=K.use.multiPlatformAssistant(),c=xe.use.settingsSleepPolicy(),u=ce(),d=l(),f=Ae(),p=Ae({platformHostedOnly:!0}),m=Ve(),h=et({assistantId:e?.id??null,enabled:p===`full`&&m}),g=e?.is_local&&!k()?null:e,_=A(),v=k()&&!!e&&!!_&&O(_);return(0,Z.useEffect)(()=>{!e||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[e]),(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[h.status&&h.mode!==`inactive`&&(0,Q.jsx)(Ne,{status:h.status,mode:h.mode,isAcknowledging:h.isAcknowledging,acknowledgeError:h.acknowledgeError?.message??null,onAcknowledge:()=>void h.acknowledge(),onReviewWorkspaceData:()=>void d(`${G.workspace}?sort=size`),onUpgradeStorage:p===`full`?()=>void d(`${G.settings.billing}?adjust_plan=1`):null}),(0,Q.jsx)(Y,{title:`General`,children:(0,Q.jsx)(vt,{assistant:g,assistantLoading:t,healthz:n,healthzLoading:r})}),u&&f===`full`&&(0,Q.jsx)(Mt,{assistant:m?g:null}),p===`full`&&e&&(0,Q.jsx)(fn,{assistant:e,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}),p===`disabled`&&(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to manage compute resources.`})}),(0,Q.jsx)(bn,{}),(0,Q.jsx)(Ht,{}),j()&&(0,Q.jsx)(Jt,{}),p===`full`&&g&&(0,Q.jsxs)(Y,{title:`Software Updates`,children:[(0,Q.jsx)(Vt,{assistantId:g.id,currentVersion:n?.version??g.current_release_version??null,releaseChannel:g.release_channel,onUpgradeComplete:()=>{a()}}),(0,Q.jsx)(on,{assistantId:g.id,onComplete:()=>{a()}})]}),p===`disabled`&&(0,Q.jsx)(Y,{title:`Software Updates`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to manage software updates.`})}),(0,Q.jsx)(Gt,{}),p===`full`&&g&&c&&(0,Q.jsx)(Y,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(Lt,{assistantId:g.id})}),p===`disabled`&&c&&(0,Q.jsx)(Y,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to manage sleep policy.`})}),(0,Q.jsx)(xn,{}),(0,Q.jsx)($t,{}),s&&(0,Q.jsx)(Pt,{}),(f===`full`||v)&&g&&(0,Q.jsx)(Y,{variant:`danger`,title:`Retire Assistant`,subtitle:`Permanently retire this assistant and delete all associated data.`,children:(0,Q.jsx)(pn,{assistantId:g.id})}),f===`disabled`&&!v&&(0,Q.jsx)(Y,{variant:`danger`,title:`Retire Assistant`,subtitle:`Permanently retire this assistant and delete all associated data.`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to retire this assistant.`})}),(0,Q.jsx)(Ut,{})]})}export{Sn as GeneralPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./capture-error-B0wqOYKY.js";import{t as s}from"./react-DJZBPgpf.js";import{t as c}from"./button-D7s2Q_uG.js";import{d as l,t as u}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as d}from"./QueryClientProvider-DKhXIxGb.js";import{t as f}from"./useQuery-B45lW1Kk.js";import{t as p}from"./useMutation-Lj4VunQV.js";import{t as m}from"./jsx-runtime-CVSDxk6A.js";import{t as h}from"./cn-DvW5mxZR.js";import{t as g}from"./dropdown-yOV5eJnU.js";import{c as _,l as v,n as y}from"./src-D6Nu2Lol.js";import{t as b}from"./confirm-dialog-DbNUkFt6.js";import{t as x}from"./notice-G5Imd5pC.js";import{t as S}from"./tag-BadGF3FB.js";import{t as C}from"./input-CwdmSRlD.js";import{t as w}from"./toggle-_vZlLDBV.js";import{n as T}from"./stat-square-B5tBfA4w.js";import{t as E}from"./modal-DX6UN7b0.js";import{n as D}from"./toast-DLWkiWW6.js";import{d as O,f as k,s as A}from"./local-mode-9ZkSq1Fr.js";import{t as j}from"./is-electron-BuSDabCt.js";import{n as M}from"./resolved-assistants-store-DMuRxkZC.js";import{t as N}from"./createLucideIcon-DIlBzeWM.js";import{t as P}from"./bell-CSP2EUlP.js";import{t as F}from"./chevron-right-HpmykQ8I.js";import{t as I}from"./circle-alert-C5TvMkJV.js";import{t as L}from"./hard-drive-C6sJQKXL.js";import{t as R}from"./loader-circle-CTs38Ovl.js";import{t as z}from"./moon-C0wLM1iN.js";import{a as ee,c as te,o as ne,r as re,s as ie,t as ae}from"./resize-errors-tz_Tui32.js";import{t as oe}from"./sparkles-B9QIWdq0.js";import{t as se}from"./triangle-alert-M_S_Pe8C.js";import{n as B,r as V,t as H}from"./api-errors-CwAGZ-xJ.js";import{K as U,_ as W,a as ce,b as le,g as ue,n as de,u as fe,x as pe,y as me}from"./auth-store-CrTf0uWL.js";import{t as he}from"./client.gen-Cuv6iN0E.js";import{S as ge,V as _e,Y as ve,j as ye}from"./sdk.gen-DRL3oRwz.js";import{a as G}from"./routes-BKwsRssF.js";import{t as K}from"./client-feature-flag-store-ivPVcKfH.js";import{n as q,t as be}from"./semver-DmouQEQK.js";import{t as xe}from"./assistant-feature-flag-store-D2CUHsmL.js";import{t as Se}from"./proxy-CQsxT9tJ.js";import{t as Ce}from"./use-reduced-motion-CXbk4fYO.js";import{Bn as we,Cr as Te,Dn as Ee,Dr as De,Fn as Oe,Ft as ke,It as Ae,J as je,Ji as Me,K as Ne,Ki as Pe,Ln as Fe,Mn as Ie,Mt as Le,Nn as Re,Or as ze,Pn as Be,Pt as Ve,Qi as He,Qr as Ue,Rn as We,Sa as Ge,Vr as Ke,Xr as qe,Zr as Je,Zt as Ye,_n as Xe,ar as Ze,ca as Qe,d as $e,et,f as tt,ho as nt,jr as rt,jt as it,l as at,la as ot,mo as st,s as ct,sr as lt,u as ut,ua as dt,v as J,za as ft,zn as pt}from"./index-BiN-6kWM.js";import{t as mt}from"./use-active-assistant-id-512RohBL.js";import{t as Y}from"./detail-card-CLwQ17AA.js";import{t as ht}from"./environment-store-Ck7wXCrL.js";import{i as gt,n as X,r as _t,t as vt}from"./assistant-status-panel-CMdqv7mF.js";var yt=N(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),bt=N(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(s(),1),xt=ue,St=`Please choose a different handle.`;async function Ct(e,t){let{data:n,error:r,response:i}=await ye({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:V(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=pe(r,`handle`,xt.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=pe(r,`handle`,St);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:V(r,i,`Failed to save handle.`)}}async function wt(e,t,n){let{data:r,error:i,response:a}=await ge({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(B(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new H(a.status,a.status===429?`Too many checks — try again in a moment.`:V(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function Tt(e){return/\d{2,}$/.test(e)}var Q=m(),Et=300,Dt=1400;function Ot({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:s,fieldId:l}){let[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(null),b=Ce(),x=(0,Z.useRef)(null),S=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),w=S===e.toLowerCase();(0,Z.useEffect)(()=>{if(w||S.length===0){h(!1),x.current?.abort();return}let e=new AbortController;x.current?.abort(),x.current=e,h(!0);let t=window.setTimeout(async()=>{try{let t=await i(S,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||y(t instanceof Error?t.message:`Couldn't check availability.`)}finally{e.signal.aborted||h(!1)}},Et);return()=>{window.clearTimeout(t),e.abort()}},[S,w,i]);let T=(()=>{if(v)return v;if(f&&!f.available){let e=f.code;return f.message??(e?xt[e]:`Please choose a different handle.`)}return null})(),E=T?n:w?r??null:m?`Checking availability…`:f?.available?`Available.`:null,O=!w&&!m&&f?.available!==!1&&g!==`saving`,k=(0,Z.useCallback)(async()=>{if(!O)return;_(`saving`),y(null);let e=await a(S);if(e.kind===`ok`){_(`saved`),o(e.data),D.success(s),window.setTimeout(()=>_(`idle`),Dt);return}if(e.kind===`taken`){_(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){_(`idle`),p({available:!1,code:e.code,message:e.message});return}_(`error`),y(e.message),D.error(e.message)},[O,S,o,a,s]),A=(()=>{if(w&&u.length>0||u.length===0)return null;let e=m?`checking`:f?.available?`available`:f?.available===!1?`invalid`:null;return e?(0,Q.jsx)(je,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(Se.span,{initial:b?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:b?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(nt,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":`Available`}),e===`invalid`&&(0,Q.jsx)(I,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":`Not available`})]},e)}):null})(),j=(()=>{switch(g){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(R,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),`Saving…`]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(nt,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Saved`]});default:return`Save`}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(C,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),y(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:A,errorText:T??void 0,helperText:E??void 0,"aria-invalid":!!T,fullWidth:!0,"data-testid":`${l}-input`}),(!w||g!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(c,{variant:`primary`,size:`compact`,onClick:k,disabled:!O,"aria-live":`polite`,"data-testid":`${l}-save`,children:j})})]})}function kt({initial:e,onSaved:t}){let n=de.use.refreshSession(),r=Tt(e.username)?`Your handle was auto-generated at signup — pick one you like.`:void 0,i=(0,Z.useCallback)(async e=>await le({username:e}),[]),a=(0,Z.useCallback)((e,t)=>W(e,t),[]),o=(0,Z.useCallback)(e=>{t(e),n()},[t,n]);return(0,Q.jsx)(Ot,{initialHandle:e.username,inputLabel:`User handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:r,checkAvailable:a,save:i,onSaved:o,saveSuccessToast:`Profile updated.`,fieldId:`user-handle`})}function At({assistant:e,onSaved:t}){let n=e.handle??``,r=f({...Xe({path:{assistant_id:e.id}})}).data?.results?.[0],i=!!r&&r.subdomain.toLowerCase()===n.toLowerCase(),a=n.length===0?`Your assistant doesn't have a handle yet — claim one to make it mentionable.`:void 0,o=(0,Z.useCallback)(async t=>await Ct(e.id,t),[e.id]),s=(0,Z.useCallback)((t,n)=>wt(e.id,t,n),[e.id]);return i?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(C,{label:`Assistant handle`,value:n,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant's handle is locked because it's used as its email subdomain. To change it,`,` `,(0,Q.jsx)(u,{to:`${G.settings.ai}?release=1#email`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`release the subdomain`}),` `,`first.`]})]}):(0,Q.jsx)(Ot,{initialHandle:n,inputLabel:`Assistant handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:a,checkAvailable:s,save:o,onSaved:t,saveSuccessToast:`Assistant handle updated.`,fieldId:`assistant-handle`})}function jt(){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-3 w-72 animate-pulse rounded bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-60 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-7 w-16 animate-pulse rounded-md bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Loading your profile…`})]})}function Mt({assistant:e}={}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=Ce(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return me().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),(0,Q.jsx)(Y,{title:`Profile`,subtitle:`Manage your user and assistant public handles.`,children:r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(Se.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(kt,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(At,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(jt,{})})}var Nt=Ee({query:{hosting:`platform`}});function Pt(){let e=mt(),t=f(Nt),n=t.data?.results??[];return t.isPending||n.length<2?null:(0,Q.jsx)(Y,{title:`Switch Assistant`,subtitle:`Choose which assistant is active for this account.`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(t=>{let n=t.id===e;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(Ge,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:t.name||`Unnamed`}),t.status!==`active`&&(0,Q.jsx)(S,{tone:`warning`,children:t.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:n?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(nt,{className:`h-4 w-4`}),`Active`]}):(0,Q.jsx)(c,{variant:`outlined`,size:`compact`,disabled:t.status!==`active`,onClick:()=>{U(t.id),D.success(`Switched active assistant.`)},children:`Switch`})})]},t.id)})})})}var Ft=[{label:`Never`,seconds:0},{label:`5 min`,seconds:300,devOnly:!0},{label:`10 min`,seconds:600,devOnly:!0},{label:`1 hour`,seconds:3600},{label:`3 hours`,seconds:10800},{label:`1 day`,seconds:86400},{label:`3 days`,seconds:259200},{label:`7 days`,seconds:604800},{label:`14 days`,seconds:1209600},{label:`30 days`,seconds:2592e3}];function It(e){if(e===0)return`Never (sleep disabled)`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0&&n>0)return`${t}d ${n}h`;if(t>0)return`${t} day${t===1?``:`s`}`;if(n>0)return`${n} hour${n===1?``:`s`}`;let r=Math.floor(e/60);return r>0?`${r} minute${r===1?``:`s`}`:`${e}s`}function Lt({assistantId:e}){let t=d(),n=ht.use.isNonProduction(),r=(0,Z.useMemo)(()=>Ft.filter(e=>!e.devOnly||n),[n]),{data:i,isLoading:a,isError:o}=f(pt({path:{id:e}})),s=(0,Z.useMemo)(()=>i?.idle_timeout_seconds??259200,[i]),[l,u]=(0,Z.useState)(null),p=l??s,m=l!==null,h=ze({onSuccess:()=>{D.success(`Sleep policy saved.`),u(null),t.invalidateQueries({queryKey:we({path:{id:e}})})},onError:()=>{D.error(`Failed to save sleep policy. Please try again.`)}});return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin`}),`Loading sleep settings...`]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load sleep policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Idle timeout`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`How long the assistant can be idle before it is put to sleep. "Never" disables idle sleep entirely.`}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:r.map(e=>(0,Q.jsx)(c,{variant:`outlined`,active:p===e.seconds,onClick:()=>u(e.seconds),children:e.label},e.seconds))}),(0,Q.jsxs)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:[`Current: `,It(p)]})]}),m&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(c,{variant:`primary`,leftIcon:h.isPending?(0,Q.jsx)(R,{className:`animate-spin`}):void 0,onClick:()=>h.mutate({path:{id:e},body:{idle_timeout_seconds:p}}),disabled:h.isPending,children:`Save`}),(0,Q.jsx)(c,{variant:`outlined`,onClick:()=>u(null),disabled:h.isPending,children:`Cancel`})]})]})}function Rt(e,t,n){let r=[e.version];return e.version===n&&r.push(`(latest)`),t&&e.version===t&&r.push(`(current)`),r.join(` `)}var zt=3e3;function Bt(e,t){return t&&e===`preview`?`preview`:`stable`}function Vt({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let i=xe.use.rollbackEnabled(),a=K.use.previewChannel(),o=d(),s=Bt(n,a),l=s===`preview`,[u,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(null),[_,v]=(0,Z.useState)(null),[y,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(null),E=e=>e&&h.current&&e===h.current?(queueMicrotask(()=>{T(S?`Successfully rolled back to version ${h.current}.`:`Successfully updated to version ${h.current}.`),m(!1),h.current=null,v(null),D.success(S?`Rollback complete — assistant is healthy.`:`Update complete — assistant is healthy.`),r?.()}),!1):zt;f({...Fe({path:{id:e}}),refetchInterval:u?e=>E(e.state.data?.current_release_version):!1});let{data:O,isLoading:k}=f(Te({query:{channel:s}})),A=O?.find(e=>e.is_stable!==!1)??O?.[0],j=_??A?.version??null,M=(0,Z.useMemo)(()=>{if(!i||!j||!t)return!1;let e=q(j),n=q(t);return!e||!n?!1:be(e,n)<0},[i,j,t]),N=(0,Z.useMemo)(()=>{if(!j)return!1;if(!t)return!0;let e=q(j),n=q(t);if(!e||!n)return j!==t;let r=be(e,n);return i?r!==0:r>0},[i,j,t]),P=p({mutationFn:async t=>{let{data:n}=await ve({path:{id:e},body:t,throwOnError:!0});return n}}),F=p({mutationFn:async t=>{let{data:n}=await _e({path:{id:e},body:t,throwOnError:!0});return n}});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:t??`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:l?`Preview release`:N?M?`Rollback to`:`Update to`:`Selected`}),(0,Q.jsx)(`span`,{className:`block min-w-0`,children:k?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`}),`Loading...`]}):O&&O.length>0?i?(0,Q.jsx)(g,{value:j??``,onChange:e=>v(e===A?.version?null:e),disabled:u||P.isPending||F.isPending,options:O.map(e=>({value:e.version,label:Rt(e,t,A?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:A?Rt(A,t,A.version):`—`}):`No releases available`})]})]}),(0,Q.jsx)(c,{variant:M?`outlined`:`primary`,className:`min-w-[160px]`,leftIcon:P.isPending||F.isPending||u?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(dt,{}),onClick:()=>x(!0),disabled:!N||P.isPending||F.isPending||u||k||!O?.length,children:u?S?`Rolling back...`:`Updating...`:M?`Rollback`:l?`Update preview`:`Update`}),l&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Using Preview releases.`,` `,(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`,children:`Switch back to Stable`})]}),!N&&t&&j&&!k&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:w??`You are already on this version.`}),(0,Q.jsx)(b,{open:y,title:M?`Rollback assistant`:l?`Update preview release`:`Update assistant`,message:M?`Rollback to version ${j??`unknown`}? The assistant will be briefly unavailable.`:l?`Update to preview version ${j??`latest`}? The assistant will be briefly unavailable during the update.`:`Update to version ${j??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:M?`Rollback`:l?`Update preview`:`Update`,onConfirm:async()=>{x(!1),T(null);let t=_??void 0;try{if(M){let e=await F.mutateAsync({version:t});h.current=e.version??t??null,D.success(e.detail||`Rollback to ${t} initiated.`)}else{let e=await P.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){D.warning(e.detail);return}h.current=e.version??t??null,D.success(e.detail||`Update to ${e.version??t??`latest`} initiated.`)}C(M),m(!0),o.invalidateQueries({queryKey:We({path:{id:e}})})}catch{D.error(M?`Failed to trigger rollback. Please try again.`:`Failed to trigger update. Please try again.`)}},onCancel:()=>x(!1)})]})}function Ht(){let e=tt.useValue();if(Ye())return null;let t=ut()?`Cmd`:`Ctrl`;return(0,Q.jsx)(Y,{title:`Composer`,children:(0,Q.jsx)(w,{checked:e,onChange:tt.save,label:`Send with ${t}+Enter`,helperText:`When enabled, Enter inserts a new line and ${t}+Enter sends.`})})}function Ut(){let e=Ae({platformHostedOnly:!0}),t=ke(),n=de.use.user()?.id??null,r=de.use.logout(),[i,a]=(0,Z.useState)(!1),o=rt({onSuccess:async()=>{D.success(`Account deletion requested. You will be logged out shortly.`),fe(n),await r(),Ke(G.account.login)},onError:()=>{D.error(`Failed to request account deletion. Please try again.`)}}),s=e===`full`&&t;return(0,Z.useEffect)(()=>{s&&i&&a(!1)},[s,i]),e===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Delete Account`,subtitle:`Permanently delete your account and all associated data.`,variant:`danger`,children:e===`disabled`?(0,Q.jsx)(J,{children:`Log in to the Vellum platform to delete your account.`}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(c,{variant:`dangerOutline`,onClick:()=>a(!0),disabled:o.isPending||s,className:`self-start`,children:`Delete My Account`}),s&&(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})}),(0,Q.jsx)(b,{open:i,title:`Delete Account`,message:`This will permanently delete your account and all associated data. This action cannot be undone.`,confirmLabel:`Delete Account`,destructive:!0,onConfirm:()=>{if(s){a(!1);return}a(!1),o.mutate({})},onCancel:()=>a(!1)})]})}function Wt({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(Y,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(c,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function Gt(){return $e()?(0,Q.jsx)(Wt,{title:`Get the iOS App`,subtitle:`The Vellum iOS app gives you a native experience.`,benefits:[{icon:P,text:`Push notifications`},{icon:yt,text:`Biometric login`},{icon:bt,text:`Native haptics`},{icon:He,text:`Home screen access`}],ctaLabel:`Download`,ctaLeftIcon:(0,Q.jsx)(He,{size:16}),onAction:()=>{at(),ct()}}):null}async function Kt(){if(!j())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function qt(e){if(!j())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function Jt(){let[e,t]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{Kt().then(t)},[]);let n=async e=>{t(e);try{await qt(e)}catch{t(!e)}};return(0,Q.jsx)(Y,{title:`Launch at Login`,subtitle:`Automatically start Vellum when you log in to your Mac.`,children:(0,Q.jsx)(w,{checked:e,onChange:e=>void n(e),"aria-label":`Launch at Login`})})}function Yt({className:e}){return(0,Q.jsx)(`div`,{role:`presentation`,className:h(`h-px w-full bg-[var(--border-base)]`,e)})}var $=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Xt(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...$]}function Zt(){return n(`mediaEmbedsEnabled`,!0)}function Qt(){let e=i(`mediaEmbedDomains`,``);return e?Xt(e):[...$]}function $t(){let[e,n]=(0,Z.useState)(()=>Zt()),[i,a]=(0,Z.useState)(()=>Qt()),[o,s]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(``),d=(0,Z.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},h=e=>{p(i.filter(t=>t!==e))},g=()=>{p([...$])},_=i.length===$.length&&i.every((e,t)=>e===$[t]);return(0,Q.jsxs)(Y,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,Q.jsx)(w,{checked:e,onChange:f})]}),e&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Yt,{})}),(0,Q.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,Q.jsx)(st,{className:`h-4 w-4`,"aria-hidden":!0}):(0,Q.jsx)(F,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,Q.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Q.jsx)(C,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Q.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:g,disabled:_,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,Q.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(Pe,{}),onClick:()=>h(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function en(e){return e===`preview`?`preview`:`stable`}function tn(e){if(!e)return`Unknown`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown`:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function nn(e){return e.source_release_version?`Stable ${e.source_release_version}`:e.snapshot_name}function rn(e){return e.filter(e=>e.ready_to_use)}function an(e){return e?.feature_enabled===!1}function on({assistantId:e,onComplete:t}){let n=K.use.previewChannel(),r=d(),[i,a]=(0,Z.useState)(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,m]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),_=Be({path:{assistant_id:e}}),v=Oe({path:{assistant_id:e}}),b=We({path:{id:e}}),{data:C,isLoading:w,isError:T}=f({..._,enabled:n,retry:!1}),E=C?.preview_backups??[],O=(0,Z.useMemo)(()=>rn(E),[E]),k=O[0],A=O.find(e=>e.snapshot_name===h)??k,j=()=>{r.invalidateQueries({queryKey:v}),r.invalidateQueries({queryKey:b}),t?.()},M=p(Ie()),N=p(Re()),P=en(C?.current_channel),F=M.isPending||N.isPending,I=F||an(C)||!C?.latest_preview_release,L=u===`restore_backup`&&!A;if((0,Z.useEffect)(()=>{a(P===`preview`?`release-channel`:void 0)},[P]),!n)return null;let z=C?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y.Root,{type:`single`,collapsible:!0,value:i,onValueChange:e=>a(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(y.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(y.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Release Channel`}),C&&(0,Q.jsx)(S,{tone:P===`preview`?`warning`:`neutral`,children:P===`preview`?`Preview`:`Stable`})]}),(0,Q.jsx)(st,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(y.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[w&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(R,{className:`h-4 w-4 animate-spin`}),`Loading release channel...`]}),T&&(0,Q.jsx)(x,{tone:`error`,title:`Could not load release channel status`,children:`Refresh this page before changing release channels.`}),C&&(0,Q.jsxs)(Q.Fragment,{children:[an(C)&&(0,Q.jsx)(x,{tone:`neutral`,title:`Preview channel is unavailable`,children:`The Preview channel is not enabled for this assistant.`}),P===`stable`?(0,Q.jsx)(sn,{status:C,isChangingChannel:F,optInDisabled:I,onOptIn:()=>s(!0)}):(0,Q.jsx)(cn,{status:C,isChangingChannel:F,onOptOut:()=>{let e=k;g(e?.snapshot_name??``),m(e?`restore_backup`:z?`standard_upgrade`:`restore_backup`),l(!0)}})]})]})})]})}),(0,Q.jsx)(un,{open:o,isPending:M.isPending,previewVersion:C?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await M.mutateAsync({path:{assistant_id:e}});D.success(t.detail||`Preview channel enabled.`),s(!1),j()}catch(e){D.error(V(e,void 0,`Could not enable Preview channel.`))}},onCancel:()=>s(!1)}),(0,Q.jsx)(dn,{open:c,backups:O,mode:u,selectedSnapshotName:A?.snapshot_name??``,isPending:N.isPending,restoreModeDisabled:L,standardUpgradeAvailable:z,onModeChange:m,onSnapshotChange:g,onConfirm:async()=>{if(!L)try{let t=await N.mutateAsync({path:{assistant_id:e},body:u===`restore_backup`?{mode:`restore_backup`,snapshot_name:A?.snapshot_name}:{mode:`standard_upgrade`}});D.success(t.detail||`Stable channel enabled.`),l(!1),j()}catch(e){D.error(V(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>l(!1)})]})}function sn({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ln,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(x,{tone:`neutral`,title:`No Preview release is available`,children:`Stable remains the only available release channel.`}),(0,Q.jsx)(c,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(ot,{}),disabled:n,onClick:r,children:`Opt in to Preview`})]})}function cn({status:e,isChangingChannel:t,onOptOut:n}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ln,{status:e}),(0,Q.jsx)(c,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(Qe,{}),disabled:t,onClick:n,children:`Switch back to Stable`})]})}function ln({status:e}){return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Stable`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??`None`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Preview`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??`None`})]})]})}function un({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){return(0,Q.jsx)(E.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(E.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:se,children:`Opt in to Preview`}),(0,Q.jsx)(E.Description,{children:`Preview releases may be unstable. A 90-day safety backup is taken before the image changes.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(x,{tone:`warning`,title:`Data loss may occur when returning to Stable`,children:`Preview data may not be compatible with the Stable channel. The safety backup lets you restore the Stable-channel data that existed before opt-in.`}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:`Create and verify a Preview safety backup.`}),(0,Q.jsxs)(`li`,{children:[`Switch to Preview image `,n??`latest`,`.`]}),(0,Q.jsx)(`li`,{children:`Run the normal upgrade path and wait for health.`})]})]})}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(c,{variant:`outlined`,disabled:t,onClick:i,children:`Cancel`}),(0,Q.jsx)(c,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(ot,{}),onClick:r,children:t?`Switching...`:`Take Backup and Switch`})]})]})})}function dn({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:a,standardUpgradeAvailable:o,onModeChange:s,onSnapshotChange:l,onConfirm:u,onCancel:d}){return(0,Q.jsx)(E.Root,{open:e,onOpenChange:e=>!e&&d(),children:(0,Q.jsxs)(E.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:se,children:`Switch back to Stable`}),(0,Q.jsx)(E.Description,{children:`Choose how this assistant should leave the Preview channel.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(v,{value:n,onValueChange:s,disabled:i,"aria-label":`Stable channel return method`,children:[(0,Q.jsx)(_,{value:`restore_backup`,disabled:t.length===0,label:`Restore safety backup`,helperText:`Return to the Stable-channel data captured before Preview opt-in.`}),(0,Q.jsx)(_,{value:`standard_upgrade`,disabled:!o,label:`Switch to Stable without restoring backup`,helperText:o?`Keep the current data and directly switch to the Stable image.`:`Unavailable because the latest Stable release is older than this assistant's Preview release.`})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[`Safety backup`,(0,Q.jsx)(g,{value:r,onChange:l,disabled:i,options:t.map(e=>({value:e.snapshot_name,label:`${nn(e)} - ${tn(e.created_at)}`}))})]}),n===`restore_backup`&&t.length===0&&!o&&(0,Q.jsx)(x,{tone:`error`,title:`Stable requires a safety backup`,children:`This Preview release is newer than the latest Stable release, so switching directly is blocked. Wait for a newer Stable release, or run Vellum Doctor if the safety backup is missing.`}),n===`standard_upgrade`&&(0,Q.jsx)(x,{tone:`error`,title:`Preview data may not survive this`,children:`Switching directly to the Stable image without restoring the safety backup may cause data loss or leave the assistant unusable if Preview data is incompatible with Stable.`})]})}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(c,{variant:`outlined`,disabled:i,onClick:d,children:`Cancel`}),(0,Q.jsx)(c,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||a||n===`standard_upgrade`&&!o,leftIcon:i?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(dt,{}),onClick:u,children:i?`Switching...`:`Switch to Stable`})]})]})})}function fn({assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}){let o=l(),s=f(lt()),d=s.data,p=!e.is_local,m=d?.plan_id===`pro`,h=f({...Ze(),enabled:m}),_=e.machine_size||`small`,v=ee(h.data?.max_machine_tier??null),y=(0,Z.useMemo)(()=>ne(v,_,(0,Q.jsx)(S,{tone:`positive`,children:`Current`})),[v,_]),b=h.data?.selected_storage_gib??null,[C,w]=(0,Z.useState)(!1),T=v.length>0?v[v.length-1]:null,[O,k]=(0,Z.useState)(null),A=O??T??_,[j,M]=(0,Z.useState)(null),[N,P]=(0,Z.useState)(null),F=De({onSuccess:(e,n)=>{D.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),P(null),k(null),w(!1),n.body?.machine_size==null?i():a(t)},onError:e=>{P(ae(e,`Failed to resize assistant. Please try again.`))}});if(s.isError&&d==null)return(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(x,{tone:`error`,children:`Could not load your subscription. Please try again.`})});let I=m&&v.includes(A)&&A!==_?A:null,z=m&&b!=null&&!0,se=m&&v.length>0&&ie(_)<ie(v[v.length-1]),B=F.isPending||r,V=b==null?t?.disk?.totalMb??null:b*1024,H=t?.disk&&V!=null?{value:t.disk.usedMb,max:V,caption:`${X(t.disk.usedMb)} of ${X(V)}`}:null,U=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,W=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:`${X(t.memory.currentMb)} of ${X(t.memory.maxMb)}`}:null,ce=p?m?z?(0,Q.jsxs)(`button`,{type:`button`,disabled:B,onClick:()=>w(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(oe,{className:`h-3.5 w-3.5`}),`Increase Storage`]}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,disabled:B,onClick:()=>w(!0),children:`Resize`}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,onClick:()=>M(`storage`),children:`Resize`}):null,le=p?m?se?(0,Q.jsxs)(`button`,{type:`button`,disabled:B,onClick:()=>w(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(oe,{className:`h-3.5 w-3.5`}),`Increase Size`]}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,disabled:B,onClick:()=>w(!0),children:`Resize`}):(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,onClick:()=>M(`machine`),children:`Resize`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,compactAccessory:!0,accessory:(0,Q.jsx)(c,{variant:`ghost`,size:`compact`,iconOnly:n||r?(0,Q.jsx)(R,{className:`animate-spin`}):(0,Q.jsx)(dt,{}),tooltip:r?`Applying resize…`:`Refresh resource metrics`,"aria-label":`Refresh resource metrics`,disabled:n||r,onClick:()=>void i()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(L,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Disk`})]}),ce]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Storage`}),H?(0,Q.jsx)(gt,{value:H.value,max:H.max,caption:H.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Unavailable`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(te,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Machine`}),(0,Q.jsx)(S,{tone:`neutral`,children:re[_]})]}),le]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`CPU`}),U?(0,Q.jsx)(gt,{value:U.value,max:U.max,caption:U.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Memory`}),W?(0,Q.jsx)(gt,{value:W.value,max:W.max,caption:W.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(R,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(E.Root,{open:j!=null,onOpenChange:e=>{e||M(null)},children:(0,Q.jsxs)(E.Content,{size:`sm`,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{children:`Upgrade to Pro`}),(0,Q.jsx)(E.Description,{children:j===`storage`?`Upgrade to the Pro plan to increase your storage allocation and get more space for your assistant.`:`Upgrade to the Pro plan to unlock larger machine sizes with more CPU and memory for your assistant.`})]}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(c,{variant:`ghost`,onClick:()=>M(null),children:`Cancel`}),(0,Q.jsx)(c,{onClick:()=>{M(null),o(`${G.settings.billing}?adjust_plan=1`)},children:`Upgrade`})]})]})}),(0,Q.jsx)(E.Root,{open:C,onOpenChange:e=>{e||(w(!1),k(null),P(null))},children:(0,Q.jsxs)(E.Content,{size:`sm`,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:te,children:`Resize Assistant`}),(0,Q.jsx)(E.Description,{children:`Resize your assistant's compute and storage. Your assistant will briefly restart.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[v.length===0?(0,Q.jsx)(x,{tone:`warning`,children:`No machine tier configured. Visit the community for help.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:`Machine Size`}),(0,Q.jsx)(g,{options:y,value:A,onChange:k,"aria-label":`Compute machine size`,"data-testid":`resize-machine-size`})]}),z?(0,Q.jsx)(x,{tone:`info`,children:`Storage will be expanded to ${b} GiB.`}):(0,Q.jsx)(x,{tone:`neutral`,children:`Storage will not change.`}),N&&(0,Q.jsx)(x,{tone:`error`,children:N})]})}),(0,Q.jsxs)(E.Footer,{className:`items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:[`Need more?`,` `,(0,Q.jsx)(u,{to:`${G.settings.billing}?adjust_plan=1`,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>w(!1),children:`Upgrade plan`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(c,{variant:`ghost`,onClick:()=>{w(!1),k(null),P(null)},children:`Cancel`}),(0,Q.jsx)(c,{disabled:I==null&&!z||B,leftIcon:B?(0,Q.jsx)(R,{className:`animate-spin`}):void 0,onClick:()=>{P(null);let t={};I!=null&&(t.machine_size=I),z&&b!=null&&(t.storage_gib=b),F.mutate({path:{id:e.id},body:t})},children:N?`Retry`:`Apply`})]})]})]})})]})}function pn({assistantId:e}){let t=l(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(c,{variant:`dangerOutline`,onClick:()=>r(!0),className:`shrink-0`,children:`Retire Assistant`}),(0,Q.jsx)(it,{open:n,isPending:i,onConfirm:async()=>{a(!0);let n=await Le(e);if(n.ok){r(!1),t(n.nextRoute,{replace:!0});return}D.error(n.error),a(!1),r(!1)},onCancel:()=>r(!1)})]})}var mn=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function hn(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...mn].sort()}function gn(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);if(n){let e=n[1]===`-`?-1:1,t=parseInt(n[2]??`0`,10),r=parseInt(n[3]??`0`,10);i=e*(t*60+r)}}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function _n(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function vn(e){if(!e)return`Not set`;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}function yn({value:e,onChange:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useMemo)(()=>hn().map(e=>gn(e)).filter(e=>e!==null),[]);(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>{a(n.trim().toLowerCase())},200);return()=>window.clearTimeout(e)},[n]),(0,Z.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]);let d=(0,Z.useMemo)(()=>i?u.filter(e=>e.city.toLowerCase().includes(i)||e.region.toLowerCase().includes(i)||e.offsetLabel.toLowerCase().includes(i)||e.identifier.toLowerCase().includes(i)):u,[u,i]),f=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]),p=e=>{t(e),r(``),s(!1),l.current?.blur()};return(0,Q.jsxs)(`div`,{ref:c,className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Closest city`}),(0,Q.jsxs)(`div`,{className:`relative w-full md:max-w-[280px]`,children:[(0,Q.jsx)(C,{ref:l,type:`text`,value:n,placeholder:f||`Search city or country...`,onChange:e=>{r(e.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:e=>{e.key===`Escape`&&(r(``),s(!1),l.current?.blur())},fullWidth:!0}),o&&d.length>0&&(0,Q.jsx)(`div`,{className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] overflow-y-auto rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,children:d.slice(0,200).map(t=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>p(t.identifier),className:`flex w-full cursor-pointer items-center justify-between gap-3 px-3 py-2 text-left text-body-medium-lighter transition-colors ${t.identifier===e?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-default)] hover:bg-[var(--surface-active)]`}`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:t.city}),t.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:t.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:_n(t.identifier)}),(0,Q.jsx)(`span`,{children:t.offsetLabel})]})]},t.identifier))})]})]}),(0,Q.jsx)(Yt,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Time zone`}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:vn(e)})]})]})}function bn(){let e=K.use.velvet(),[t,n]=(0,Z.useState)(()=>Je({velvetEnabled:e}));return(0,Z.useEffect)(()=>{n(Je({velvetEnabled:e}))},[e]),(0,Z.useEffect)(()=>a(`theme`,()=>{n(Je({velvetEnabled:e}))}),[e]),(0,Z.useEffect)(()=>{qe(t)},[t]),(0,Q.jsx)(Y,{title:`Theme`,children:(0,Q.jsx)(`div`,{className:`max-w-[360px]`,children:(0,Q.jsx)(T,{ariaLabel:`Theme`,value:t,onChange:e=>{n(e),Ue(e),qe(e)},items:[{value:`system`,label:`System`,icon:(0,Q.jsx)(Ge,{className:`h-4 w-4`})},{value:`light`,label:`Light`,icon:(0,Q.jsx)(Me,{className:`h-4 w-4`})},{value:`dark`,label:`Dark`,icon:(0,Q.jsx)(z,{className:`h-4 w-4`})},...e?[{value:`velvet`,label:`Velvet`,icon:(0,Q.jsx)(ft,{className:`h-4 w-4`})}]:[]]})})})}function xn(){let e=M.use.activeAssistantId(),[t,n]=(0,Z.useState)(()=>i(`timezone`,``)),a=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{a.current=e},[e]);let s=(0,Z.useRef)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(()=>{}),u=e=>{if(s.current){c.current=e;return}let t=a.current;if(!t){c.current=null;return}s.current=!0,c.current=null,he.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{o(e,{context:`settings-timezone-override`})}).finally(()=>{s.current=!1;let e=c.current;c.current=null,e!==null&&l.current(e)})};return(0,Z.useEffect)(()=>{l.current=u}),(0,Q.jsx)(Y,{title:`Timezone`,subtitle:`Used when displaying times and scheduling reminders.`,children:(0,Q.jsx)(yn,{value:t,onChange:e=>{n(e),r(`timezone`,e),u(e)}})})}function Sn(){let{assistant:e,assistantLoading:t,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}=_t(),s=K.use.multiPlatformAssistant(),c=xe.use.settingsSleepPolicy(),u=ce(),d=l(),f=Ae(),p=Ae({platformHostedOnly:!0}),m=Ve(),h=et({assistantId:e?.id??null,enabled:p===`full`&&m}),g=e?.is_local&&!k()?null:e,_=A(),v=k()&&!!e&&!!_&&O(_);return(0,Z.useEffect)(()=>{!e||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[e]),(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[h.status&&h.mode!==`inactive`&&(0,Q.jsx)(Ne,{status:h.status,mode:h.mode,isAcknowledging:h.isAcknowledging,acknowledgeError:h.acknowledgeError?.message??null,onAcknowledge:()=>void h.acknowledge(),onReviewWorkspaceData:()=>void d(`${G.workspace}?sort=size`),onUpgradeStorage:p===`full`?()=>void d(`${G.settings.billing}?adjust_plan=1`):null}),(0,Q.jsx)(Y,{title:`General`,children:(0,Q.jsx)(vt,{assistant:g,assistantLoading:t,healthz:n,healthzLoading:r})}),u&&f===`full`&&(0,Q.jsx)(Mt,{assistant:m?g:null}),p===`full`&&e&&(0,Q.jsx)(fn,{assistant:e,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}),p===`disabled`&&(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to manage compute resources.`})}),(0,Q.jsx)(bn,{}),(0,Q.jsx)(Ht,{}),j()&&(0,Q.jsx)(Jt,{}),p===`full`&&g&&(0,Q.jsxs)(Y,{title:`Software Updates`,children:[(0,Q.jsx)(Vt,{assistantId:g.id,currentVersion:n?.version??g.current_release_version??null,releaseChannel:g.release_channel,onUpgradeComplete:()=>{a()}}),(0,Q.jsx)(on,{assistantId:g.id,onComplete:()=>{a()}})]}),p===`disabled`&&(0,Q.jsx)(Y,{title:`Software Updates`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to manage software updates.`})}),(0,Q.jsx)(Gt,{}),p===`full`&&g&&c&&(0,Q.jsx)(Y,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(Lt,{assistantId:g.id})}),p===`disabled`&&c&&(0,Q.jsx)(Y,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to manage sleep policy.`})}),(0,Q.jsx)(xn,{}),(0,Q.jsx)($t,{}),s&&(0,Q.jsx)(Pt,{}),(f===`full`||v)&&g&&(0,Q.jsx)(Y,{variant:`danger`,title:`Retire Assistant`,subtitle:`Permanently retire this assistant and delete all associated data.`,children:(0,Q.jsx)(pn,{assistantId:g.id})}),f===`disabled`&&!v&&(0,Q.jsx)(Y,{variant:`danger`,title:`Retire Assistant`,subtitle:`Permanently retire this assistant and delete all associated data.`,children:(0,Q.jsx)(J,{children:`Log in to the Vellum platform to retire this assistant.`})}),(0,Q.jsx)(Ut,{})]})}export{Sn as GeneralPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./capture-error-B0wqOYKY.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./button-D7s2Q_uG.js";import{d as a,h as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./progress-bar-BOKTRqXE.js";import{N as ee,_ as te,b as u,f as d,g as f,o as p,r as ne,w as re}from"./local-mode-9ZkSq1Fr.js";import{t as m}from"./is-electron-BuSDabCt.js";import{n as h}from"./resolved-assistants-store-DMuRxkZC.js";import{r as ie}from"./api-errors-CwAGZ-xJ.js";import{A as ae,K as g,Z as _,et as oe,l as v,n as y,nt as b,q as x,rt as se,tt as ce}from"./auth-store-CrTf0uWL.js";import{a as le,o as ue,r as S}from"./api-BSHLYsxJ.js";import{a as C}from"./routes-BKwsRssF.js";import{r as w,t as T}from"./build-state-DqzVxR37.js";import{i as de,p as fe}from"./prefs-Mrqh1A7Y.js";import{t as E}from"./avatar-svg-compositor-Bbqkq_FE.js";import{Lr as D,Pr as O,Rr as k,ft as A}from"./index-BiN-6kWM.js";import{t as pe}from"./provider-key-DH6JmPXt.js";import{BUNDLED_COMPONENTS as j}from"./avatar-bundled-components-UfXe4Pfu.js";var M=e(r(),1);async function me(e,t,r){try{await D(e)||await k(e,t),r.invalidateQueries({queryKey:O(e)})}catch(e){n(e,{context:`onboarding_avatar_sync`})}}function N(e){let t=e=>e[Math.floor(Math.random()*e.length)];return{bodyShape:t(e.bodyShapes).id,eyeStyle:t(e.eyeStyles).id,color:t(e.colors).id}}var P=c(),F=3e3,he=800,I=3e5,L=null,R=null,ge={initializing:0,provisioning:.33,connecting:.66,ready:1},z=1500,_e={initializing:`Getting things ready…`,provisioning:`Setting up your assistant…`,connecting:`Connecting to your assistant…`,ready:`Ready`};function ve(e,t,n){if(e>=t)return t;let r=1-(1-Math.min(1,n/z))**3;return e+(t-e)*r}function ye(){let e=w(T(),{kind:`hatch-gate`});return e.action===`redirect`?{kind:`redirect`,to:e.to}:e.action===`wait`?{kind:`wait`}:{kind:`proceed`}}function B(){let e=a(),r=s(),[c]=o(),w=c.get(`hosting`),T=c.get(`fail`),D=m(),O=d()&&w!==null&&w!==`vellum-cloud`,k=y.use.sessionStatus(),z=O?_(k):k,[B]=(0,M.useState)(()=>N(j)),V=(0,M.useMemo)(()=>{let e=E(j,B.bodyShape,B.eyeStyle,B.color,320);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`},[B]),[H,U]=(0,M.useState)(`initializing`),[W,G]=(0,M.useState)(null),[be,K]=(0,M.useState)(!1),[xe,Se]=(0,M.useState)(0),[Ce,q]=(0,M.useState)(0),[we,J]=(0,M.useState)(0),Y=(0,M.useRef)(H),X=(0,M.useRef)(0),Z=(0,M.useRef)(0),Q=(0,M.useRef)(0),$=(0,M.useCallback)(e=>{X.current=Q.current,Z.current=Date.now(),Y.current=e,U(e),J(e=>e+1)},[]);return(0,M.useEffect)(()=>{if(T!==null){G(`Simulated hatch failure (developer menu → Replay Hatch Failure).`);return}let i=ye();if(i.kind===`redirect`){e(i.to,{replace:!0});return}if(i.kind===`wait`)return;K(!1);let a=!1,o=null,s=null,c=null,l=Date.now(),m,_=!1,E=!1,D=de(),k=()=>{try{fe(``)}catch(e){n(e,{context:`onboarding_mark_completed`})}q(1),Q.current=1,X.current=1,U(`ready`),Y.current=`ready`,s=setTimeout(()=>{a||(async()=>{if(await x.checkAssistant(),!a){if(ae()){x.markExpectingFirstMessage(),e(`${C.assistant}?onboarding=1`,{replace:!0});return}e(C.onboarding.prechat,{replace:!0})}})()},he)},A=e=>me(e,B,r),j=async()=>{if($(`provisioning`),!O){try{let e=await S(),t=b(e);if(!a&&e.ok&&t.kind===`active`){d()&&u({assistantId:e.data.id,name:e.data.name,cloud:`vellum`,runtimeUrl:p(),hatchedAt:new Date().toISOString(),organizationId:v.getState().currentOrganizationId??void 0}),k();return}t.kind===`auto_hatch`&&(E=!0)}catch{}if(a)return}if(O){try{L||=re(void 0,w===`docker`?`docker`:void 0);let e=await L;if(L=null,a)return;if(!e.ok){G(e.error??`Failed to hatch local assistant.`);return}await f(),e.assistantId&&g(e.assistantId),$(`connecting`);let t=!1;for(;!a&&!t;){let e=ne();if(e)try{let n=await fetch(`${e}/readyz`);if(n.ok){let e=await n.json();if(e&&typeof e==`object`&&`status`in e&&e.status===`ok`){ee(),await te(),t=!0;break}}}catch{}if(Date.now()-l>=I){G(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{c=setTimeout(e,F)}),c=null}if(a)return;if(e.assistantId&&await y.getState().connectLocalAssistant(e.assistantId),e.assistantId){try{await pe(e.assistantId)}catch(e){n(e,{context:`onboarding_apply_provider_key`})}h.getState().upsertFromApi({id:e.assistantId,name:e.assistantId,status:`active`,is_local:!0,created:new Date().toISOString()}),g(e.assistantId),A(e.assistantId)}k()}catch{if(L=null,a)return;G(`Failed to hatch local assistant. Check CLI logs for details.`)}return}try{R||=ue(D?{version:D}:void 0);let e=await R;if(R=null,a)return;if(e.ok&&(m=e.data.id),_=e.ok&&e.status===201,!e.ok){if(t(`Onboarding hatch request failed`,{level:`warning`,extra:{status:e.status,error:e.error}}),ce(e.status,e.error)){G(oe),K(!0);return}if(!se(e.status)){G(ie(e.error,void 0,`Failed to start your assistant. Please try again.`));return}}}catch(e){if(R=null,n(e,{context:`onboarding_hatch_assistant`}),a)return}M(0)},M=e=>{a||(o=setTimeout(N,e))},N=async()=>{if(!a){if(Date.now()-l>=I){t(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:I}}),G(`Your assistant is taking longer than expected. Please try again.`);return}try{let e=await S(m);if(a||m&&!e.ok&&e.status===404&&(m=void 0,e=await S(),a))return;let t=b(e);if(t.kind===`active`){if(e.ok){let t=e.data.id;for(h.getState().upsertFromApi(e.data),g(t),(_||E)&&A(t),d()&&u({assistantId:t,name:e.data.name,cloud:`vellum`,runtimeUrl:p(),hatchedAt:new Date().toISOString(),organizationId:v.getState().currentOrganizationId??void 0}),$(`connecting`);!a;){try{if((await le(t)).ok)break}catch{}if(Date.now()-l>=I){G(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{o=setTimeout(e,F)}),o=null}if(a)return}k();return}if(t.kind===`error`){G(t.message);return}t.kind!==`auto_hatch`&&Y.current===`provisioning`&&$(`connecting`),M(F)}catch(e){if(n(e,{context:`onboarding_poll_assistant`}),a)return;M(F)}}};return j(),()=>{a=!0,o&&clearTimeout(o),s&&clearTimeout(s),c&&clearTimeout(c)}},[xe,T,B,z,e,r,$,O]),(0,M.useEffect)(()=>{Z.current===0&&(Z.current=Date.now());let e,t=()=>{let n=Date.now()-Z.current,r=ge[Y.current],i=ve(X.current,r,n);Q.current=i,q(i),r-i>1e-6&&(e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[we]),W?(0,P.jsx)(A,{children:(0,P.jsxs)(`div`,{role:`alert`,className:`mx-auto flex w-full max-w-xl flex-col items-center ${D?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40`} text-center text-[var(--content-default)]`,children:[(0,P.jsx)(`h1`,{className:D?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:`Something went wrong`}),(0,P.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${D?`mt-3.5`:`mt-4`}`,children:W}),be&&(0,P.jsxs)(`div`,{className:`mt-6 flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,P.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Get started today with a local assistant`}),(0,P.jsx)(i,{asChild:!0,variant:`primary`,size:`regular`,fullWidth:!0,className:D?void 0:`h-11 text-base`,children:(0,P.jsx)(`a`,{href:`${window.location.origin}/download`,children:`Download the macOS app`})})]}),(0,P.jsx)(`img`,{src:V,alt:``,width:160,height:160,className:`${D?`my-auto py-8`:`my-16`} onboarding-avatar-failed`}),(0,P.jsxs)(`div`,{className:`flex w-full flex-col ${D?`gap-2.5 max-w-[280px]`:`gap-2 max-w-sm`}`,children:[(0,P.jsx)(i,{variant:`primary`,size:`regular`,fullWidth:!0,className:D?void 0:`h-11 text-base`,onClick:()=>{X.current=0,Z.current=Date.now(),Y.current=`initializing`,Q.current=0,U(`initializing`),q(0),J(e=>e+1),G(null),K(!1),Se(e=>e+1)},children:`Try again`}),(0,P.jsx)(i,{variant:`outlined`,size:`regular`,fullWidth:!0,className:D?void 0:`h-11 text-base`,onClick:()=>void e(O?C.onboarding.hosting:C.onboarding.privacy,{replace:!0}),children:`Back`})]})]})}):(0,P.jsx)(A,{children:(0,P.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${D?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40`} text-center text-[var(--content-default)]`,children:[(0,P.jsx)(`h1`,{className:D?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:H===`ready`?`Your assistant is ready!`:`Waking up…`}),H!==`ready`&&(0,P.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${D?`mt-3.5`:`mt-4`}`,children:`Hang tight — your assistant will have a few questions for you once it's up.`}),(0,P.jsx)(`img`,{src:V,alt:``,width:160,height:160,className:`${D?`my-auto py-8`:`my-16`} ${H===`ready`?`onboarding-avatar-awake`:`onboarding-avatar-pulse`}`}),(0,P.jsx)(l,{value:Ce,height:6,className:`w-full ${D?`max-w-[200px]`:`max-w-sm`}`,"aria-label":`Assistant startup progress`}),(0,P.jsx)(`p`,{className:`text-[var(--content-tertiary)] ${D?`mt-4 text-label-small-default`:`mt-3 text-body-small-default`}`,children:_e[H]})]})})}export{B as HatchingScreen};