@vellumai/web 0.10.9 → 0.10.10-dev.202607170046.8482d40

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 (442) hide show
  1. package/dist/assets/{AnimatePresence-TZWSGjkI.js → AnimatePresence-DqW6iWlh.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-DwVI7U0b.js → BundleConfirmPage-CQYO7UBl.js} +1 -1
  3. package/dist/assets/{Combination-Cd_aWAsj.js → Combination-BJXmG5wD.js} +1 -1
  4. package/dist/assets/{a2a-invite-CwD3hY_-.js → a2a-invite-BgcNY6-0.js} +1 -1
  5. package/dist/assets/{about-page-vayMMPxH.js → about-page-XGv9RAQu.js} +1 -1
  6. package/dist/assets/{account-page-uVMhWTmh.js → account-page-vkxiAGOl.js} +1 -1
  7. package/dist/assets/{account-shell-DaECsri2.js → account-shell-B7umdF9x.js} +1 -1
  8. package/dist/assets/{acp-run-detail-panel-DKXp8jTf.js → acp-run-detail-panel-hcso0zce.js} +4 -4
  9. package/dist/assets/activity-steps-panel-CcBw8DS-.js +1 -0
  10. package/dist/assets/{add-credits-modal-DjQdNLWh.js → add-credits-modal-DjNvi-GP.js} +1 -1
  11. package/dist/assets/ai-page-CN2rAfL9.js +1 -0
  12. package/dist/assets/animated-avatar-g_UuqPoB.js +1 -0
  13. package/dist/assets/{api-Dfrm6N2I.js → api-Bf9f0SF-.js} +1 -1
  14. package/dist/assets/api-CAksDSJ5.js +1 -0
  15. package/dist/assets/{api-key-screen-DhFeDT-n.js → api-key-screen-D1VuOnOP.js} +1 -1
  16. package/dist/assets/app-types-XM5qKBD0.js +1 -0
  17. package/dist/assets/archive-redirect-page-CzfenZ5a.js +1 -0
  18. package/dist/assets/arrow-left-C2re-gYj.js +1 -0
  19. package/dist/assets/{assistant-feature-flag-store-BA3GR2m5.js → assistant-feature-flag-store-hJs0ZthQ.js} +1 -1
  20. package/dist/assets/assistant-identity-store-CgJwLRMd.js +1 -0
  21. package/dist/assets/assistant-status-panel-C-j2xyys.js +1 -0
  22. package/dist/assets/auth-store-6jOlH4H3.js +2 -0
  23. package/dist/assets/background-task-detail-panel-D9-rHjio.js +1 -0
  24. package/dist/assets/ban-Bvfp1f1I.js +1 -0
  25. package/dist/assets/{bell-BQLonLMp.js → bell-V9BYKY__.js} +1 -1
  26. package/dist/assets/billing-page-DqCOyq6U.js +3 -0
  27. package/dist/assets/{bookmark-CNrithFf.js → bookmark-CjHh36q4.js} +1 -1
  28. package/dist/assets/{bookmarks-page-BdcnBpJK.js → bookmarks-page-CgjhMvgV.js} +1 -1
  29. package/dist/assets/{brain-BLDXGaUy.js → brain-Ci5ws6Wl.js} +1 -1
  30. package/dist/assets/browser-ANfYdLSw.js +2 -0
  31. package/dist/assets/{bug-BsuQ5ciQ.js → bug-BMI_6ziD.js} +1 -1
  32. package/dist/assets/{build-state-D-aPe0DY.js → build-state-eUN4dUUO.js} +1 -1
  33. package/dist/assets/button-BQVYX8n_.js +1 -0
  34. package/dist/assets/card-D8zyWtZh.js +1 -0
  35. package/dist/assets/channels-page-route-B71sEakK.js +9 -0
  36. package/dist/assets/chat-BDhsGoUo.js +1 -0
  37. package/dist/assets/chat-markdown-message-DA7kD5x_.js +2 -0
  38. package/dist/assets/check-CkQjevXL.js +1 -0
  39. package/dist/assets/checkbox-DpJ6rimy.js +1 -0
  40. package/dist/assets/{chevron-down-qD-re7AW.js → chevron-down-DwIPfcCg.js} +1 -1
  41. package/dist/assets/chevron-left-mpHv5ahd.js +1 -0
  42. package/dist/assets/chevron-right-DDgSinGu.js +1 -0
  43. package/dist/assets/{chevron-up-3jCod9LW.js → chevron-up-B8xt61zY.js} +1 -1
  44. package/dist/assets/{chunk-5KNZJZUH-DdS6bb-3.js → chunk-5KNZJZUH-SU6Q_tDT.js} +1 -1
  45. package/dist/assets/{circle-alert-zOqdmf25.js → circle-alert-_RJjkRGu.js} +1 -1
  46. package/dist/assets/circle-check-DWe3QGcN.js +1 -0
  47. package/dist/assets/{client-feature-flag-store-Ri-a_LuI.js → client-feature-flag-store-BF2sLP87.js} +1 -1
  48. package/dist/assets/{client-identity-DfC94VQ4.js → client-identity-ClnkJ165.js} +1 -1
  49. package/dist/assets/{clipboard-copy-DF6K1xc6.js → clipboard-copy-sWUyFbCT.js} +1 -1
  50. package/dist/assets/clock-YYSFOsux.js +1 -0
  51. package/dist/assets/{cloud-off-Db1nySkc.js → cloud-off-Cj66Ozsp.js} +1 -1
  52. package/dist/assets/code-D1zl7aOd.js +1 -0
  53. package/dist/assets/{command-palette-Bu2Qjyle.js → command-palette-cry3DjBe.js} +1 -1
  54. package/dist/assets/{command-palette-window-page-CtQ40jMw.js → command-palette-window-page-DiYxA98-.js} +1 -1
  55. package/dist/assets/community-page-Bjrv2fFx.js +1 -0
  56. package/dist/assets/{confirm-dialog-CSkhRFRk.js → confirm-dialog-kE8y7s20.js} +1 -1
  57. package/dist/assets/{connect-page-BCb6nr8x.js → connect-page-Dg9B95NR.js} +1 -1
  58. package/dist/assets/consent-C8XzlZzW.js +1 -0
  59. package/dist/assets/{consent-controls-udcijSAB.js → consent-controls-BKoyAFQL.js} +1 -1
  60. package/dist/assets/{contacts-gateway-DfyjoqNo.js → contacts-gateway-MdTfmafh.js} +1 -1
  61. package/dist/assets/{contacts-page-route-CicU-jSI.js → contacts-page-route-CpXule5I.js} +1 -1
  62. package/dist/assets/conversation-list-fetchers-CRj2YEra.js +1 -0
  63. package/dist/assets/{cpu-BJuB2Khn.js → cpu-CEyjQpZz.js} +1 -1
  64. package/dist/assets/{credential-entry-page-CRTZY2VD.js → credential-entry-page-CINUIvT7.js} +1 -1
  65. package/dist/assets/credentials-page-Bxyd05F2.js +1 -0
  66. package/dist/assets/{credit-card-BuyWdO9t.js → credit-card-BY-vD21O.js} +1 -1
  67. package/dist/assets/danger-zone-redirect-page-D5PMgW3x.js +1 -0
  68. package/dist/assets/debug-page-DgE71O7D.js +4 -0
  69. package/dist/assets/{deploy-dialogs-C6pCnoVj.js → deploy-dialogs-IR36wqsi.js} +1 -1
  70. package/dist/assets/detail-card-BQDwZw9u.js +1 -0
  71. package/dist/assets/{detail-panel-stop-button-H9sXvWGa.js → detail-panel-stop-button-7iw57s5z.js} +1 -1
  72. package/dist/assets/developer-page-CyI9M1jH.js +1 -0
  73. package/dist/assets/{device-settings-BBwtGKJb.js → device-settings-DXp9L4iB.js} +1 -1
  74. package/dist/assets/devices-redirect-page-CULscA9R.js +1 -0
  75. package/dist/assets/{diagnostics-CUmYxbmM.js → diagnostics-BmpZegnr.js} +1 -1
  76. package/dist/assets/{dictation-overlay-page-BmLNyGeD.js → dictation-overlay-page-BtLSzNia.js} +1 -1
  77. package/dist/assets/{dist-CxHeCOEv.js → dist-Btg1osd6.js} +1 -1
  78. package/dist/assets/{dist-DqmYHxdg.js → dist-CxzJhU4a.js} +1 -1
  79. package/dist/assets/dist-Df9Kbc9v.js +1 -0
  80. package/dist/assets/{dist-HJ505Xnn.js → dist-URk13ITj.js} +1 -1
  81. package/dist/assets/document-viewer-page-D2UQkY2m.js +1 -0
  82. package/dist/assets/{domain-field-C5a2iMot.js → domain-field-DKKi4dF-.js} +1 -1
  83. package/dist/assets/{download-CAuK-nZ6.js → download-B6XjnEzx.js} +1 -1
  84. package/dist/assets/dropdown-CuE5AuVj.js +1 -0
  85. package/dist/assets/effective-timezone-Cp9o8K5B.js +1 -0
  86. package/dist/assets/emails-page-B6FMCJWC.js +1 -0
  87. package/dist/assets/esm-Bg_CV71l.js +2 -0
  88. package/dist/assets/esm-C-NQQXQk.js +1 -0
  89. package/dist/assets/esm-CfdeJFC3.js +2 -0
  90. package/dist/assets/esm-D6qOHXq4.js +2 -0
  91. package/dist/assets/esm-DhG5lsUR.js +2 -0
  92. package/dist/assets/esm-Dr3kF6_n.js +2 -0
  93. package/dist/assets/esm-M2XAj3Ql.js +2 -0
  94. package/dist/assets/{external-link-Dqpx9nRm.js → external-link-Cczz6xJ4.js} +1 -1
  95. package/dist/assets/eye-C2rSrbD-.js +1 -0
  96. package/dist/assets/eye-off-BQ9J3pF2.js +1 -0
  97. package/dist/assets/feature-flag-catalog-BYQYYM0o.js +1 -0
  98. package/dist/assets/{file-DsyJLS2u.js → file-C8pjlmtk.js} +1 -1
  99. package/dist/assets/file-editor-zaQWhFtF.js +1 -0
  100. package/dist/assets/file-markdown-CIujEAvN.js +2 -0
  101. package/dist/assets/{file-text-CYJz-GvF.js → file-text-DA128T4K.js} +1 -1
  102. package/dist/assets/folder-open-7DKBH5WB.js +1 -0
  103. package/dist/assets/general-page-CdtyNT85.js +1 -0
  104. package/dist/assets/{globe-4qSOWE2N.js → globe-inD5tOKN.js} +1 -1
  105. package/dist/assets/{haptics-BOswdY5A.js → haptics-DSy7IUf8.js} +2 -2
  106. package/dist/assets/{hard-drive-rDxhoRUm.js → hard-drive-BXh9qCfi.js} +1 -1
  107. package/dist/assets/hatching-screen-By8y8slf.js +1 -0
  108. package/dist/assets/home-page-route-D8rR127z.js +1 -0
  109. package/dist/assets/{hosting-screen-nru73FGU.js → hosting-screen-iOu5c3s2.js} +1 -1
  110. package/dist/assets/identity-page-route-qTfcZp4g.js +7 -0
  111. package/dist/assets/impersonate-version-flag-DRJTfKcP.js +1 -0
  112. package/dist/assets/index-CpdQgTZI.css +2 -0
  113. package/dist/assets/index-D_wKh03d.js +211 -0
  114. package/dist/assets/{info-DsOyuMO9.js → info-DLFMsCl-.js} +1 -1
  115. package/dist/assets/ingest-DVy2v0Mj.js +1 -0
  116. package/dist/assets/input-6HVXMszw.js +1 -0
  117. package/dist/assets/{inspect-page-DoA1sfxg.js → inspect-page-rNR7--O9.js} +4 -4
  118. package/dist/assets/integrations-page-B41K84yI.js +1 -0
  119. package/dist/assets/intelligence-layout-BtlV0p8d.js +1 -0
  120. package/dist/assets/{key-round-CD3JWrs1.js → key-round-BggUE1Ns.js} +1 -1
  121. package/dist/assets/keyboard-shortcuts-redirect-page-DrBxlgF7.js +1 -0
  122. package/dist/assets/latest-assistant-text-Qj7hDn1c.js +24 -0
  123. package/dist/assets/library-detail-page-Cfc8zZ7K.js +1 -0
  124. package/dist/assets/library-page-DDo7QO-G.js +1 -0
  125. package/dist/assets/{link-2-4bMylQ5v.js → link-2-YnZe-oMg.js} +1 -1
  126. package/dist/assets/list-row-spYsDF9a.js +1 -0
  127. package/dist/assets/loader-circle-C9QrtO3C.js +1 -0
  128. package/dist/assets/local-mode-Dydd46cS.js +39 -0
  129. package/dist/assets/local-settings-C-dW2vkq.js +1 -0
  130. package/dist/assets/{log-in--aqELu3z.js → log-in-Xv-AVlu8.js} +1 -1
  131. package/dist/assets/{login-flow-DYLpX6IU.js → login-flow-KepuOYBD.js} +1 -1
  132. package/dist/assets/login-page-DF7FczXW.js +1 -0
  133. package/dist/assets/{logout-page-xucijGcq.js → logout-page-b4fcTzGe.js} +1 -1
  134. package/dist/assets/logs-layout-C_n7Nf1x.js +1 -0
  135. package/dist/assets/memory-page-route-BpqBCX0L.js +1 -0
  136. package/dist/assets/{memory-router-playground-page-DikxzmKT.js → memory-router-playground-page-BKCeJSb5.js} +1 -1
  137. package/dist/assets/menu-B672pBEP.js +1 -0
  138. package/dist/assets/messages-D7HOlpNc.js +13 -0
  139. package/dist/assets/{metric-card-cvhtzRdM.js → metric-card-ClJWxxPO.js} +1 -1
  140. package/dist/assets/mic-Dmvwrxe8.js +1 -0
  141. package/dist/assets/{minimize-2-Clnet2W7.js → minimize-2-B8VHIj-G.js} +1 -1
  142. package/dist/assets/{misc-DnHIYCE9.js → misc-D0u5tzSd.js} +1 -1
  143. package/dist/assets/{mobile-sidebar-drawer-BaL8el3Y.js → mobile-sidebar-drawer-jzcdwotk.js} +1 -1
  144. package/dist/assets/modal-bIQsMU63.js +1 -0
  145. package/dist/assets/{monitor-DfbL8_59.js → monitor-Cy7Q70-7.js} +1 -1
  146. package/dist/assets/{moon-B8qiwjrW.js → moon-jDX7sipq.js} +1 -1
  147. package/dist/assets/mutation-error-BSB3r4np.js +1 -0
  148. package/dist/assets/{native-biometric-B2cBAQ1U.js → native-biometric-B_KQURZ4.js} +1 -1
  149. package/dist/assets/native-file-kVcoTiGR.js +2 -0
  150. package/dist/assets/notice-B8UI-BOp.js +1 -0
  151. package/dist/assets/notifications-page-D3JJkCDb.js +1 -0
  152. package/dist/assets/{oauth-complete-page-SfFEsa_M.js → oauth-complete-page-DWOIdXkU.js} +1 -1
  153. package/dist/assets/{oauth-popup-complete-page-D4Xoa-Gr.js → oauth-popup-complete-page-BWsHYRdP.js} +1 -1
  154. package/dist/assets/onboarding-store-Bxw_JVDh.js +1 -0
  155. package/dist/assets/page-empty-state-M3M-Ny7y.js +1 -0
  156. package/dist/assets/page-shell-CflRXEeM.js +1 -0
  157. package/dist/assets/{pairing-page-B5xnM6XX.js → pairing-page-B04bci4y.js} +1 -1
  158. package/dist/assets/panel-item-CegzTp_l.js +1 -0
  159. package/dist/assets/password-reset-page-CNCeaWWO.js +1 -0
  160. package/dist/assets/{pencil-CUIr0IFo.js → pencil-BOTCmXXR.js} +1 -1
  161. package/dist/assets/personality-page-tI_Bdj2g.js +1 -0
  162. package/dist/assets/platform-detection-lm9it_11.js +1 -0
  163. package/dist/assets/{platform-loopback-page-_IbNDHN2.js → platform-loopback-page-Bp8C9tZw.js} +1 -1
  164. package/dist/assets/{plugin-detail-page-_iCqtxl9.js → plugin-detail-page-Dhg5mNZ7.js} +1 -1
  165. package/dist/assets/plugins-page-DE7s-sYB.js +1 -0
  166. package/dist/assets/plugins-surface-DXytDI7x.js +1 -0
  167. package/dist/assets/plus-D54jrPDF.js +1 -0
  168. package/dist/assets/popover-rW459udD.js +1 -0
  169. package/dist/assets/prechat-jJWDBLel.js +1 -0
  170. package/dist/assets/prefs-Od3axSSC.js +1 -0
  171. package/dist/assets/privacy-page-BqinM6m5.js +1 -0
  172. package/dist/assets/privacy-screen-D9_clskP.js +1 -0
  173. package/dist/assets/{usage-window-CCdJWJ0U.js → profile-metadata-VB4MBtgt.js} +1 -1
  174. package/dist/assets/progress-bar-Wa6qo8OT.js +1 -0
  175. package/dist/assets/{provider-callback-page-BoO2JgZt.js → provider-callback-page-CCcKKz8l.js} +1 -1
  176. package/dist/assets/provider-catalogs-BFoYvfUc.js +1 -0
  177. package/dist/assets/{provider-key-B-hx1r3c.js → provider-key-DqjTE9QV.js} +1 -1
  178. package/dist/assets/{provider-signup-page-DLVKMYZh.js → provider-signup-page-UutK4KOX.js} +1 -1
  179. package/dist/assets/puzzle-0_oQwgsv.js +1 -0
  180. package/dist/assets/{quick-input-page-7z8Ti2GI.js → quick-input-page-DGAeq4rS.js} +1 -1
  181. package/dist/assets/react-query.gen-BqmzUoTX.js +1 -0
  182. package/dist/assets/react-query.gen-CWfp8GEM.js +1 -0
  183. package/dist/assets/{refresh-cw-DevIHL7J.js → refresh-cw-BkscUrbN.js} +1 -1
  184. package/dist/assets/{remote-gateway-session-CBKZhJak.js → remote-gateway-session-D-udmSfx.js} +1 -1
  185. package/dist/assets/{repeat-C8Im6j--.js → repeat-BRYsTqh_.js} +1 -1
  186. package/dist/assets/research-mock-page-D73KATjt.js +1 -0
  187. package/dist/assets/research-onboarding-route-C8B_Hf6H.js +43 -0
  188. package/dist/assets/{resize-errors-DqIkO0UI.js → resize-errors-yH10K9Qq.js} +1 -1
  189. package/dist/assets/{resolved-assistants-store-DAzPZ1eV.js → resolved-assistants-store-DdHm-7v4.js} +1 -1
  190. package/dist/assets/review-terms-screen-DyaVT7tS.js +1 -0
  191. package/dist/assets/risk-DI65iZDy.js +3 -0
  192. package/dist/assets/routes-GPGveWZ8.js +1 -0
  193. package/dist/assets/schedules-CTsHce7J.js +1 -0
  194. package/dist/assets/schedules-page-waP6mp0w.js +1 -0
  195. package/dist/assets/{sdk.gen-CFgJ4K6f.js → sdk.gen-C9GJEKYV.js} +1 -1
  196. package/dist/assets/{sdk.gen-9Cdt87h5.js → sdk.gen-DTVjciY5.js} +1 -1
  197. package/dist/assets/security-redirect-page-BjDQGfTt.js +1 -0
  198. package/dist/assets/select-assistant-screen-C0fk-Wr4.js +1 -0
  199. package/dist/assets/{setting-row-imtQqr9o.js → setting-row-BrTO4FAb.js} +1 -1
  200. package/dist/assets/settings-divider-Dm6am_vC.js +1 -0
  201. package/dist/assets/settings-layout-BtjAruk-.js +1 -0
  202. package/dist/assets/settings-wSv59mkN.js +1 -0
  203. package/dist/assets/share-feedback-modal-CSwbEpOs.js +1 -0
  204. package/dist/assets/shield-check-kgUZeU9b.js +1 -0
  205. package/dist/assets/{sidebar-tree-DWJkYLPh.js → sidebar-tree-Dryg3cOs.js} +1 -1
  206. package/dist/assets/{signup-page-D2LQXMnG.js → signup-page-CNtwdwbQ.js} +1 -1
  207. package/dist/assets/{signup-shell-DCGARCES.js → signup-shell-Cc2MDy25.js} +1 -1
  208. package/dist/assets/{site-favicon-DsYdnaxV.js → site-favicon-D57oj-aP.js} +1 -1
  209. package/dist/assets/skill-detail-page-sUN279wq.js +1 -0
  210. package/dist/assets/{skill-detail-panel-B4WEYtK9.js → skill-detail-panel-Z4ygLF6y.js} +1 -1
  211. package/dist/assets/{skills-D0rhLW1_.js → skills-Blso03pM.js} +1 -1
  212. package/dist/assets/skills-page-jO3IR1Bn.js +1 -0
  213. package/dist/assets/sounds-redirect-page-SALIbUWr.js +1 -0
  214. package/dist/assets/{sparkles-PGiR5v1g.js → sparkles-BK3KXCjl.js} +1 -1
  215. package/dist/assets/{src-DZbMXyC2.js → src-yyUuGOWG.js} +39 -39
  216. package/dist/assets/start-screen-5hBKdcez.js +1 -0
  217. package/dist/assets/subagent-detail-panel-kYsr3-Go.js +4 -0
  218. package/dist/assets/{subagent-store-B4PMGakL.js → subagent-store-BBGeZyfE.js} +1 -1
  219. package/dist/assets/system-events-page-zfJm8MVb.js +1 -0
  220. package/dist/assets/system-events-redirect-page-DCoGGk63.js +1 -0
  221. package/dist/assets/tag-D0AE0-aA.js +1 -0
  222. package/dist/assets/{theme-preferences-D1vs2UH8.js → theme-preferences-D58K1K0j.js} +1 -1
  223. package/dist/assets/{theme-stage-page-8v_hsKXd.js → theme-stage-page-CwAjRBf7.js} +1 -1
  224. package/dist/assets/{tiptap-document-editor-1QvKHdlQ.js → tiptap-document-editor-DJgv0IjA.js} +2 -2
  225. package/dist/assets/toast-CZmbu5xl.js +1 -0
  226. package/dist/assets/toggle-CWrJ2t4S.js +1 -0
  227. package/dist/assets/{tool-detail-panel-DarSpKEx.js → tool-detail-panel-BX8nhSHp.js} +1 -1
  228. package/dist/assets/{triangle-alert-Z0Gq0IuB.js → triangle-alert-CnjNKhNx.js} +1 -1
  229. package/dist/assets/typed-storage-D_VAgmkX.js +1 -0
  230. package/dist/assets/typography-Cqi8q9o7.js +1 -0
  231. package/dist/assets/{upgrade-cancel-page-wop4boqC.js → upgrade-cancel-page-Dy0QpcPX.js} +1 -1
  232. package/dist/assets/{upgrade-success-page-DWPEHzlo.js → upgrade-success-page-C4qPg39w.js} +1 -1
  233. package/dist/assets/usage-redirect-page-BRSD2lQL.js +1 -0
  234. package/dist/assets/{use-active-assistant-id-CGeH4Gl6.js → use-active-assistant-id-DwLFgABu.js} +1 -1
  235. package/dist/assets/use-assistant-identity-details-Cc0ODudZ.js +1 -0
  236. package/dist/assets/{use-edge-swipe-back-R9ItWgTp.js → use-edge-swipe-back-CPKPdejt.js} +1 -1
  237. package/dist/assets/use-invite-link-dialog-B3ek9kAR.js +1 -0
  238. package/dist/assets/use-is-org-ready-0evEMlKE.js +1 -0
  239. package/dist/assets/{use-onboarding-login-BHrngniO.js → use-onboarding-login-DCGylk8M.js} +1 -1
  240. package/dist/assets/{use-reduced-motion-BPBlq9_a.js → use-reduced-motion-ztQz2c8x.js} +1 -1
  241. package/dist/assets/use-skill-actions-Bne9ss01.js +1 -0
  242. package/dist/assets/use-skill-categories-D2KEkcRq.js +1 -0
  243. package/dist/assets/{use-skill-detail-files-DDUUobr0.js → use-skill-detail-files-CULTYS0z.js} +1 -1
  244. package/dist/assets/{user-plus-DMh4_UTz.js → user-plus-KuzSTM_D.js} +1 -1
  245. package/dist/assets/utils-DvUW9GK8.js +1 -0
  246. package/dist/assets/{viewer-store-90zmUKZ4.js → viewer-store-3OqDWGlU.js} +1 -1
  247. package/dist/assets/voice-page-adm17MvI.js +1 -0
  248. package/dist/assets/weather-forecast-display-DmxpUWDF.js +1 -0
  249. package/dist/assets/web-2Lv7tn-v.js +1 -0
  250. package/dist/assets/web-BMkUTu6e.js +1 -0
  251. package/dist/assets/web-BRNP0DmG.js +1 -0
  252. package/dist/assets/web-D9chpugB.js +1 -0
  253. package/dist/assets/web-DJgVPE0A.js +1 -0
  254. package/dist/assets/web-DL2EEVnA.js +1 -0
  255. package/dist/assets/web-DbZvx-GY.js +1 -0
  256. package/dist/assets/web-DguPzvKS.js +1 -0
  257. package/dist/assets/{welcome-screen-kc41a0yS.js → welcome-screen-CxD05qtl.js} +1 -1
  258. package/dist/assets/workflow-detail-panel-USyHIhjf.js +1 -0
  259. package/dist/assets/workspace-page-B3vckeSl.js +1 -0
  260. package/dist/assets/x-BYcSiJRX.js +1 -0
  261. package/dist/index.html +142 -144
  262. package/package.json +1 -1
  263. package/dist/assets/activity-steps-panel-Bq9yj1qu.js +0 -1
  264. package/dist/assets/advanced-page-CQPwr2B4.js +0 -1
  265. package/dist/assets/ai-page-CO4dBJpg.js +0 -1
  266. package/dist/assets/animated-avatar-DMwzREGQ.js +0 -1
  267. package/dist/assets/api-DHuLwcqq.js +0 -1
  268. package/dist/assets/archive-0aqysuyd.js +0 -1
  269. package/dist/assets/archive-page-BLEqhIZ8.js +0 -1
  270. package/dist/assets/arrow-left-DI9551VI.js +0 -1
  271. package/dist/assets/assistant-identity-store-CX03CK8q.js +0 -1
  272. package/dist/assets/assistant-status-panel-CW7lTRBE.js +0 -1
  273. package/dist/assets/auth-store-65JKPW7C.js +0 -2
  274. package/dist/assets/background-task-detail-panel-ChfmmS5C.js +0 -1
  275. package/dist/assets/ban-CVKGuUAQ.js +0 -1
  276. package/dist/assets/billing-page-CaP8_CF9.js +0 -3
  277. package/dist/assets/browser-Cnr7iqbJ.js +0 -2
  278. package/dist/assets/button-amTXFI-2.js +0 -1
  279. package/dist/assets/calendar-h-mv1itX.js +0 -1
  280. package/dist/assets/card-Bv5O5juh.js +0 -1
  281. package/dist/assets/channels-page-route-DKkdGS4b.js +0 -9
  282. package/dist/assets/chat-0L0NBUcq.js +0 -1
  283. package/dist/assets/chat-markdown-message-Cp8stHaU.js +0 -2
  284. package/dist/assets/check-DFNrQERi.js +0 -1
  285. package/dist/assets/checkbox-EdyezNqo.js +0 -1
  286. package/dist/assets/chevron-left-BMF1xNfR.js +0 -1
  287. package/dist/assets/chevron-right-DqqmezXC.js +0 -1
  288. package/dist/assets/circle-check-VSiny8yl.js +0 -1
  289. package/dist/assets/cn-C36Yvcac.js +0 -1
  290. package/dist/assets/code-Czx7d7SK.js +0 -1
  291. package/dist/assets/community-page-DL_oR63v.js +0 -1
  292. package/dist/assets/composer-focus-8EISjLd_.js +0 -1
  293. package/dist/assets/constants-BQVXM0At.js +0 -1
  294. package/dist/assets/conversation-list-fetchers-_PUdRqRZ.js +0 -1
  295. package/dist/assets/conversation-selection-CfSCgJxD.js +0 -1
  296. package/dist/assets/copy-Cn1FKrEp.js +0 -1
  297. package/dist/assets/credentials-page-DDM2V8iZ.js +0 -1
  298. package/dist/assets/danger-zone-redirect-page-BpM01x_c.js +0 -1
  299. package/dist/assets/debug-page-BGhdwv9M.js +0 -4
  300. package/dist/assets/detail-card-GPqFZVmX.js +0 -1
  301. package/dist/assets/developer-page-DZdwzLQu.js +0 -1
  302. package/dist/assets/devices-page-ChwagiFL.js +0 -1
  303. package/dist/assets/dist-BItmZQO6.js +0 -1
  304. package/dist/assets/document-viewer-page-B-ShLH6Y.js +0 -1
  305. package/dist/assets/dropdown-ByHOpeOU.js +0 -1
  306. package/dist/assets/earn-credits-modal-BILKTI_F.js +0 -1
  307. package/dist/assets/effective-timezone-DYvVVpXt.js +0 -1
  308. package/dist/assets/emails-page-D_ZdkIHT.js +0 -1
  309. package/dist/assets/esm-BC-IlNg6.js +0 -2
  310. package/dist/assets/esm-BVzHqFEK.js +0 -2
  311. package/dist/assets/esm-CE4Ehw9K.js +0 -2
  312. package/dist/assets/esm-D4S5VlIC.js +0 -2
  313. package/dist/assets/esm-Ddwl5DWt.js +0 -2
  314. package/dist/assets/esm-ZgeaRH-O.js +0 -2
  315. package/dist/assets/esm-wMYgN14J.js +0 -1
  316. package/dist/assets/feature-flag-catalog-DjfXrBPD.js +0 -1
  317. package/dist/assets/file-editor-CgjwckHX.js +0 -1
  318. package/dist/assets/file-markdown-ZKvQUuGy.js +0 -2
  319. package/dist/assets/format-date-cTplgJ8P.js +0 -1
  320. package/dist/assets/general-page-61s8VehJ.js +0 -1
  321. package/dist/assets/hatching-screen-DiUygZtk.js +0 -1
  322. package/dist/assets/home-page-route-1hEkRjdv.js +0 -1
  323. package/dist/assets/identity-page-route-CbHcVb6m.js +0 -1
  324. package/dist/assets/impersonate-version-flag-BhxfH6iZ.js +0 -1
  325. package/dist/assets/index-B4Qq7TL7.js +0 -209
  326. package/dist/assets/index-CCPsEVwr.css +0 -2
  327. package/dist/assets/input-CoUmPnRU.js +0 -1
  328. package/dist/assets/integrations-page-vFP_lh3w.js +0 -1
  329. package/dist/assets/intelligence-layout-oIGPC8W1.js +0 -1
  330. package/dist/assets/keyboard-shortcuts-page-BzeIMUpj.js +0 -1
  331. package/dist/assets/library-detail-page-D0Dv3ZLJ.js +0 -1
  332. package/dist/assets/library-page-D7I-sk41.js +0 -1
  333. package/dist/assets/list-row-D5MFdbkH.js +0 -1
  334. package/dist/assets/llm-dimension-Tz2Fx8qB.js +0 -1
  335. package/dist/assets/loader-circle-Cz7opInR.js +0 -1
  336. package/dist/assets/local-mode-Bskd5bsT.js +0 -39
  337. package/dist/assets/local-settings-lVNyIOJ_.js +0 -1
  338. package/dist/assets/login-page-UotBWZu9.js +0 -1
  339. package/dist/assets/logs-layout-JUd7Ag6q.js +0 -1
  340. package/dist/assets/memory-page-route-DqM6EMFu.js +0 -1
  341. package/dist/assets/menu-Dy5QbnTj.js +0 -1
  342. package/dist/assets/messages-B2CZAuPN.js +0 -13
  343. package/dist/assets/middleware-pbPQ0upo.js +0 -1
  344. package/dist/assets/modal-D5nLWNN9.js +0 -1
  345. package/dist/assets/mutation-error-Bk_4pjgm.js +0 -1
  346. package/dist/assets/native-file-BZDk5eyB.js +0 -2
  347. package/dist/assets/notice-DkcNAP8O.js +0 -1
  348. package/dist/assets/notifications-page-BISnBOYH.js +0 -1
  349. package/dist/assets/page-shell-1qU5DIUF.js +0 -1
  350. package/dist/assets/panel-item-CouW2A55.js +0 -1
  351. package/dist/assets/password-reset-page-NF13YMiM.js +0 -1
  352. package/dist/assets/platform-detection-DGxL0AsS.js +0 -1
  353. package/dist/assets/plugins-page-DHiFqgxf.js +0 -1
  354. package/dist/assets/plugins-surface-B3Ro34dC.js +0 -1
  355. package/dist/assets/plus-DItfr5ux.js +0 -1
  356. package/dist/assets/popover-CFL4WZTr.js +0 -1
  357. package/dist/assets/prechat-BBwYr5Qb.js +0 -1
  358. package/dist/assets/prechat-names-Cjl3JzzN.js +0 -1
  359. package/dist/assets/prechat-route-BwML3ZL1.js +0 -1
  360. package/dist/assets/prefs-DNYLVDvB.js +0 -1
  361. package/dist/assets/privacy-page-DhxWA9mA.js +0 -1
  362. package/dist/assets/privacy-screen-DRGDGj0W.js +0 -1
  363. package/dist/assets/progress-bar-Ca8gmE3B.js +0 -1
  364. package/dist/assets/react-query.gen-DV9K_z-o.js +0 -1
  365. package/dist/assets/react-query.gen-LsPzqPq6.js +0 -1
  366. package/dist/assets/research-mock-page-CoMthbl4.js +0 -1
  367. package/dist/assets/research-onboarding-route-CeTflgoE.js +0 -63
  368. package/dist/assets/review-terms-screen-DAZ66rIh.js +0 -1
  369. package/dist/assets/risk-BQ3NV8r8.js +0 -3
  370. package/dist/assets/routes-BXlWEOF0.js +0 -1
  371. package/dist/assets/save-aD5JFIZf.js +0 -1
  372. package/dist/assets/schedules-Dz6392n3.js +0 -1
  373. package/dist/assets/security-page-BS1WxY0d.js +0 -1
  374. package/dist/assets/select-assistant-screen-z3B8ngdP.js +0 -1
  375. package/dist/assets/settings-layout-DFzwR63d.js +0 -1
  376. package/dist/assets/share-feedback-modal-DH2dhWbo.js +0 -1
  377. package/dist/assets/shortcut-keys-B2EE-634.js +0 -1
  378. package/dist/assets/skill-detail-page-CcZFUjdw.js +0 -1
  379. package/dist/assets/skill-icon-CgzIQCTT.js +0 -1
  380. package/dist/assets/skills-page-Di8dGQGo.js +0 -1
  381. package/dist/assets/sound-manager-CRFoAxE4.js +0 -1
  382. package/dist/assets/sounds-page-CF3gwgc9.js +0 -1
  383. package/dist/assets/stat-square-CTHnQ1jc.js +0 -1
  384. package/dist/assets/step-indicator-dots-B-KCGh9e.js +0 -1
  385. package/dist/assets/subagent-detail-panel-BqYWP0b9.js +0 -4
  386. package/dist/assets/system-events-page-DdvtYv0_.js +0 -1
  387. package/dist/assets/system-events-redirect-page-HeBGwZCZ.js +0 -1
  388. package/dist/assets/tag-CV4v7fRF.js +0 -1
  389. package/dist/assets/toast-xTp-xwYL.js +0 -1
  390. package/dist/assets/toggle-CDfguvUz.js +0 -1
  391. package/dist/assets/typed-storage-BRvgA7pX.js +0 -1
  392. package/dist/assets/typography-D5f7kt80.js +0 -1
  393. package/dist/assets/usage-page-CB5oigmL.js +0 -1
  394. package/dist/assets/use-bus-subscription-Cslzk2dW.js +0 -1
  395. package/dist/assets/use-invite-link-dialog-_LChrtmw.js +0 -1
  396. package/dist/assets/use-is-org-ready-1Xighdsa.js +0 -1
  397. package/dist/assets/use-skill-actions-mJaMNpfO.js +0 -1
  398. package/dist/assets/use-skill-categories-Bit2V2fA.js +0 -1
  399. package/dist/assets/utils-xg2dl_KJ.js +0 -1
  400. package/dist/assets/voice-page-Dfl4T4_g.js +0 -1
  401. package/dist/assets/weather-forecast-display-DOXofTcV.js +0 -1
  402. package/dist/assets/web-6YTn0Mpt.js +0 -1
  403. package/dist/assets/web-B6BDTvZe.js +0 -1
  404. package/dist/assets/web-BEtTYpif.js +0 -1
  405. package/dist/assets/web-BrbVmY32.js +0 -1
  406. package/dist/assets/web-C3rsbCeg.js +0 -1
  407. package/dist/assets/web-CBHy41qN.js +0 -1
  408. package/dist/assets/web-CIdUPUaN.js +0 -1
  409. package/dist/assets/web-DGaEiOw7.js +0 -1
  410. package/dist/assets/workflow-detail-panel-Dctg7w-3.js +0 -1
  411. package/dist/assets/workflow-store-CDrDxW5J.js +0 -1
  412. package/dist/assets/workspace-page-BWn-Je40.js +0 -1
  413. package/dist/assets/x-CkSVp1Ok.js +0 -1
  414. /package/dist/assets/{app-info-BxdEjcok.js → app-info-Clwt3pCt.js} +0 -0
  415. /package/dist/assets/{avatar-bundled-components-CMIiT9CS.js → avatar-bundled-components-ELDcio1Z.js} +0 -0
  416. /package/dist/assets/{avatar-svg-compositor-DQyPgWSC.js → avatar-svg-compositor-D7Dy9s1k.js} +0 -0
  417. /package/dist/assets/{browser-timezone-B2VEIYkv.js → browser-timezone-viO2H3SD.js} +0 -0
  418. /package/dist/assets/{build.umd-t16r8k1T.js → build.umd-D88jX3tx.js} +0 -0
  419. /package/dist/assets/{bundle-mjs-BZt35okJ.js → bundle-mjs-CK9sN9wG.js} +0 -0
  420. /package/dist/assets/{conversation-store-CynXqAcO.js → conversation-store-CnRrUeSu.js} +0 -0
  421. /package/dist/assets/{createLucideIcon-IRfcSUxS.js → createLucideIcon-Bjb-Kuq7.js} +0 -0
  422. /package/dist/assets/{definitions-Dj7uajgZ.js → definitions-EvNC1i1H.js} +0 -0
  423. /package/dist/assets/{definitions-CK0CSdwt.js → definitions-RERkHOnv.js} +0 -0
  424. /package/dist/assets/{dist-RkT480s0.js → dist-DyRKd0bN2.js} +0 -0
  425. /package/dist/assets/{edge-swipe-arbiter-store-VEaUoy3F.js → edge-swipe-arbiter-store-a9LiewmS.js} +0 -0
  426. /package/dist/assets/{emoji-catalog-data-Cp4IpzLe.js → emoji-catalog-data-D8lRMt3A.js} +0 -0
  427. /package/dist/assets/{environment-store-Bxe2pTvW.js → environment-store-BX22hkIL.js} +0 -0
  428. /package/dist/assets/{format-file-size-BLrV7wUA.js → format-file-size-DOE-vGl6.js} +0 -0
  429. /package/dist/assets/{native-deep-link-CPCbJkSt.js → native-deep-link-CbHUZ2h_.js} +0 -0
  430. /package/dist/assets/{onboarding-step-layout-Cup_f9lB.js → onboarding-step-layout-zvLUIT7j.js} +0 -0
  431. /package/dist/assets/{optimistic-lifecycle-C4YFdBr3.js → optimistic-lifecycle-BvfDBY8o.js} +0 -0
  432. /package/dist/assets/{pdf-jCZ1S_t-.js → pdf-OTWpgOp2.js} +0 -0
  433. /package/dist/assets/{pointer-qy7F2Zff.js → pointer-DcD0Nt7Z.js} +0 -0
  434. /package/dist/assets/{proxy-Cadlowdl.js → proxy-B6mdWM9d.js} +0 -0
  435. /package/dist/assets/{public-asset-WikBpVQd.js → public-asset-Cr86Gucv.js} +0 -0
  436. /package/dist/assets/{research-onboarding-persistence-D_h0dT1o.js → research-onboarding-persistence-C4LT0Ekr.js} +0 -0
  437. /package/dist/assets/{sdk.gen-CenbOmmb.js → sdk.gen-8pCB8ehU.js} +0 -0
  438. /package/dist/assets/{status-badge-pill-B_ninpnM.js → status-badge-pill-0N6rTEBg.js} +0 -0
  439. /package/dist/assets/{three-dot-indicator-BuZzHFUJ.js → three-dot-indicator-DNuHHwtA.js} +0 -0
  440. /package/dist/assets/{use-copy-to-clipboard-Ap1ESW2j.js → use-copy-to-clipboard-BCTXSMa-.js} +0 -0
  441. /package/dist/assets/{xterm-addon-fit-BmGG02AS.js → xterm-addon-fit-DNV09uVI.js} +0 -0
  442. /package/dist/assets/{xterm-CJZcgQLM.js → xterm-fGXm5t6D.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./card-Bv5O5juh.js";import{t as u}from"./circle-alert-zOqdmf25.js";import{t as d}from"./circle-check-VSiny8yl.js";import{t as f}from"./loader-circle-Cz7opInR.js";import{t as p}from"./notice-DkcNAP8O.js";import{c as m}from"./routes-BXlWEOF0.js";import{at as h,it as g}from"./react-query.gen-DV9K_z-o.js";import{D as _,Gr as v,Ur as y,Wr as b}from"./index-B4Qq7TL7.js";var x=e(t(),1),S=s(),C=1e3,w=1e4,T=2500;function E(){let e=v({platformHostedOnly:!0}),t=y(),s=b(),c=e===`full`&&t,u=r(),d=a(),[f,E]=(0,x.useState)(!1);(0,x.useEffect)(()=>{d.invalidateQueries({queryKey:h()})},[d]);let{data:j,isError:M}=o({...g(),enabled:c,refetchInterval:e=>e.state.data?.plan_id===`pro`||f?!1:C,refetchIntervalInBackground:!1}),N=c?j:void 0,P=c?M:!1;(0,x.useEffect)(()=>{if(!c)return;let e=setTimeout(()=>E(!0),w);return()=>clearTimeout(e)},[c]);let F=N?.plan_id===`pro`;(0,x.useEffect)(()=>{if(!F)return;let e=setTimeout(()=>{u(m.settings.billing,{replace:!0})},T);return()=>clearTimeout(e)},[F,u]);let I=()=>u(m.settings.billing,{replace:!0});return e===`gated`?(0,S.jsx)(i,{replace:!0,to:m.settings.general}):e===`disabled`?(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsx)(_,{children:`Log in to the Vellum platform to manage billing and usage.`})}):!c&&!s?(0,S.jsxs)(`div`,{className:`max-w-4xl space-y-6`,children:[(0,S.jsx)(p,{tone:`warning`,children:`We can't confirm your upgrade for the current assistant. Return to billing to retry.`}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(n,{variant:`primary`,"data-testid":`upgrade-success-go-to-billing`,onClick:I,children:`Go to billing`})})]}):(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsxs)(l,{padding:`lg`,children:[F?(0,S.jsx)(O,{}):P?(0,S.jsx)(A,{}):f?(0,S.jsx)(k,{}):(0,S.jsx)(D,{}),(F||P||f)&&(0,S.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,S.jsx)(n,{variant:F||P?`primary`:`outlined`,"data-testid":`upgrade-success-go-to-billing`,onClick:I,children:`Go to billing`})})]})})}function D(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(f,{className:`h-6 w-6 animate-spin text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Finalizing your upgrade…`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`Stripe is confirming your subscription. This usually takes a few seconds.`})]})}function O(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(d,{className:`h-8 w-8 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Welcome to Pro`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`Your Pro plan is active. You'll be redirected back to billing in a moment.`})]})}function k(){return(0,S.jsx)(p,{tone:`warning`,children:`We're processing your upgrade — refresh in a moment to see your new plan.`})}function A(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(u,{className:`h-8 w-8 text-[var(--system-negative-strong)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`We hit a problem checking your subscription. Your upgrade may still be processing — return to billing to refresh.`})]})}export{E as UpgradeSuccessPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-Cqi8q9o7.js";import{t as l}from"./card-D8zyWtZh.js";import{t as u}from"./circle-alert-_RJjkRGu.js";import{t as d}from"./circle-check-DWe3QGcN.js";import{t as f}from"./loader-circle-C9QrtO3C.js";import{t as p}from"./notice-B8UI-BOp.js";import{c as m}from"./routes-GPGveWZ8.js";import{it as h,rt as g}from"./react-query.gen-BqmzUoTX.js";import{H as _,ci as v,li as y,ui as b}from"./index-D_wKh03d.js";var x=e(t(),1),S=s(),C=1e3,w=1e4,T=2500;function E(){let e=b({platformHostedOnly:!0}),t=v(),s=y(),c=e===`full`&&t,u=i(),d=a(),[f,E]=(0,x.useState)(!1);(0,x.useEffect)(()=>{d.invalidateQueries({queryKey:h()})},[d]);let{data:j,isError:M}=o({...g(),enabled:c,refetchInterval:e=>e.state.data?.plan_id===`pro`||f?!1:C,refetchIntervalInBackground:!1}),N=c?j:void 0,P=c?M:!1;(0,x.useEffect)(()=>{if(!c)return;let e=setTimeout(()=>E(!0),w);return()=>clearTimeout(e)},[c]);let F=N?.plan_id===`pro`;(0,x.useEffect)(()=>{if(!F)return;let e=setTimeout(()=>{u(m.settings.billing,{replace:!0})},T);return()=>clearTimeout(e)},[F,u]);let I=()=>u(m.settings.billing,{replace:!0});return e===`gated`?(0,S.jsx)(r,{replace:!0,to:m.settings.general}):e===`disabled`?(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsx)(_,{children:`Log in to the Vellum platform to manage billing and usage.`})}):!c&&!s?(0,S.jsxs)(`div`,{className:`max-w-4xl space-y-6`,children:[(0,S.jsx)(p,{tone:`warning`,children:`We can't confirm your upgrade for the current assistant. Return to billing to retry.`}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(n,{variant:`primary`,"data-testid":`upgrade-success-go-to-billing`,onClick:I,children:`Go to billing`})})]}):(0,S.jsx)(`div`,{className:`max-w-4xl space-y-6`,children:(0,S.jsxs)(l,{padding:`lg`,children:[F?(0,S.jsx)(O,{}):P?(0,S.jsx)(A,{}):f?(0,S.jsx)(k,{}):(0,S.jsx)(D,{}),(F||P||f)&&(0,S.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,S.jsx)(n,{variant:F||P?`primary`:`outlined`,"data-testid":`upgrade-success-go-to-billing`,onClick:I,children:`Go to billing`})})]})})}function D(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(f,{className:`h-6 w-6 animate-spin text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Finalizing your upgrade…`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`Stripe is confirming your subscription. This usually takes a few seconds.`})]})}function O(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(d,{className:`h-8 w-8 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Welcome to Pro`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`Your Pro plan is active. You'll be redirected back to billing in a moment.`})]})}function k(){return(0,S.jsx)(p,{tone:`warning`,children:`We're processing your upgrade — refresh in a moment to see your new plan.`})}function A(){return(0,S.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,S.jsx)(u,{className:`h-8 w-8 text-[var(--system-negative-strong)]`,"aria-hidden":`true`}),(0,S.jsx)(c,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,S.jsx)(c,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:`We hit a problem checking your subscription. Your upgrade may still be processing — return to billing to refresh.`})]})}export{E as UpgradeSuccessPage};
@@ -0,0 +1 @@
1
+ import{m as e,n as t}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{c as r}from"./routes-GPGveWZ8.js";var i=n();function a(){let[n]=e(),a=new URLSearchParams(n);return a.set(`tab`,`usage`),(0,i.jsx)(t,{replace:!0,to:`${r.settings.billing}?${a.toString()}`})}export{a as UsageRedirectPage};
@@ -1 +1 @@
1
- import{n as e}from"./resolved-assistants-store-DAzPZ1eV.js";function t(){let t=e.use.activeAssistantId();if(!t)throw Error(`useActiveAssistantId() called outside ActiveAssistantGate — either mount the route under <ActiveAssistantGate> or read the raw store via useResolvedAssistantsStore.use.activeAssistantId().`);return t}export{t};
1
+ import{n as e}from"./resolved-assistants-store-DdHm-7v4.js";function t(){let t=e.use.activeAssistantId();if(!t)throw Error(`useActiveAssistantId() called outside ActiveAssistantGate — either mount the route under <ActiveAssistantGate> or read the raw store via useResolvedAssistantsStore.use.activeAssistantId().`);return t}export{t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r}from"./button-BQVYX8n_.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import"./src-yyUuGOWG.js";import{V as o,_n as s,et as c,gn as l}from"./sdk.gen-C9GJEKYV.js";import{r as u}from"./api-Bf9f0SF-.js";import{t as d}from"./proxy-B6mdWM9d.js";import{t as f}from"./use-reduced-motion-ztQz2c8x.js";import{Cn as p,Sn as m,Tn as h,jr as g}from"./index-D_wKh03d.js";import{l as _,n as v,t as y}from"./latest-assistant-text-Qj7hDn1c.js";var b=e(n(),1),x=a(),S=.25,C=.46,w=.3,T=.85,E=.4,D=14,O=8;function k({components:e,traits:t,stage:n,entrance:r=!1,entranceDelay:i=0}){let a=f(),{w:o,h:s}=n,[c,l]=(0,b.useState)({x:0,y:0});(0,b.useEffect)(()=>{if(a)return;let e=e=>{l({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[a]);let u=r&&!a,[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(!r);(0,b.useEffect)(()=>{if(a||!_)return;let e=!1,t,n=n=>{e||(g(!0),t=setTimeout(()=>{e||(g(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[a,_,r]);let y=(0,b.useMemo)(()=>{let n=e.eyeStyles.find(e=>e.id===t.eyeStyle);return n?{paths:n.paths,bbox:p(n.paths.map(e=>m(e.svgPath)))}:null},[e,t.eyeStyle]);if(!y||o===0||s===0)return null;let k=o*T,A=Math.min(Math.min(o,s)*w,k*y.bbox.h/y.bbox.w),j=A*y.bbox.w/y.bbox.h,M=(o-j)/2,N=s-(1-S)*A,P=E*s-(N+A/2),F=(C-S)*A,I=y.bbox.x+y.bbox.w/2,L=y.bbox.y+y.bbox.h/2;return(0,x.jsx)(d.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:M,top:N,width:j,height:A,transformOrigin:`center`},initial:u?{y:P,scale:.35}:!1,animate:u?{y:[P,F,0],scale:[.35,1,1]}:{y:0,scale:1},transition:u?{duration:1,delay:i,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>v(!0),children:(0,x.jsx)(`div`,{style:{transform:`translate(${c.x*D}px, ${c.y*O}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,x.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:j,height:A,style:{overflow:`visible`,display:`block`},children:(0,x.jsx)(`g`,{style:{transform:h?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${I}px ${L}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,x.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})}var A=w*(1-S),j=`#17191C`,M=24,N=.2,P=96,F=160,I=(0,b.createContext)(null);function L(){let e=(0,b.useContext)(I);if(!e)throw Error(`useAssistantStage must be used inside <AssistantStage>`);return e}function R(e,t){return!e||!t?null:e.colors.find(e=>e.id===t.color)?.hex??null}function z({components:e,traits:t,customImageUrl:n,entrance:i=!1,children:a,className:o}){let{ref:s,size:c}=v(),l=R(e,t)??j,u=h(l),d=!!(e&&t),f=!d&&!!n,p=Math.round(Math.min(F,Math.max(P,Math.min(c.w,c.h)*N))),m=c.h-p-M,g=d?Math.round(A*Math.min(c.w,c.h))+16:f?p+M+16:24;return(0,x.jsxs)(`div`,{ref:s,className:r(`relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-[var(--border-base)]`,o),style:{backgroundColor:l,color:u.fg},children:[d&&e&&t&&(0,x.jsx)(k,{components:e,traits:t,stage:c,entrance:i}),f&&n&&(0,x.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2] overflow-hidden rounded-full ring-4 ring-white/25`,style:{left:(c.w-p)/2,top:m,width:p,height:p},children:(0,x.jsx)(`img`,{src:n,alt:``,className:`h-full w-full object-cover`,draggable:!1})}),(0,x.jsx)(I.Provider,{value:{stage:c,tone:u,bottomReserve:g},children:(0,x.jsx)(`div`,{className:`relative z-10 flex min-h-0 flex-1 flex-col`,children:a})})]})}var B=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`},{id:`playful-serious`,left:`Playful`,right:`Serious`},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`}],V=50,H=1500,U=12e4,W=e=>new Promise(t=>setTimeout(t,e));async function G({assistantId:e,content:n,title:r,context:i}){let a,u=!1;try{let t=await c({path:{assistant_id:e},body:{conversationType:`standard`,title:r},throwOnError:!1});if(a=t.data?.id,!t.response?.ok||!a)return!1;let i={conversationId:a,content:n,sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await s({path:{assistant_id:e},body:i,throwOnError:!1})).response?.ok)return!1;let o=Date.now()+U,d=``,f=0,p=!1;for(;Date.now()<o;){await W(H);let t=await l({path:{assistant_id:e},query:{conversationId:a},throwOnError:!1}),n=y(t.data?.messages??[]);if(n&&(f=n===d?f+1:0,d=n),t.data?.processing===!0&&(p=!0),_({processing:t.data?.processing,sawProcessing:p,hasReply:n.length>0,stableReads:f})){u=!0;break}}}catch(e){t(e,{context:i})}finally{if(a)try{await o({path:{assistant_id:e,id:a},throwOnError:!1})}catch(e){t(e,{context:`${i}_archive`})}}return u}function K(e){return[`assistant-identity-details`,e]}function q(e){return i({queryKey:K(e),queryFn:async()=>{let[t,n]=await Promise.all([g(e),u(e).catch(()=>({ok:!1,status:0,error:{}}))]);return{identity:t,createdAt:n.ok?n.data.created:null}}})}export{V as a,L as c,B as i,q as n,z as o,G as r,R as s,K as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./edge-swipe-arbiter-store-VEaUoy3F.js";import{An as r,kn as i}from"./index-B4Qq7TL7.js";var a=e(t(),1),o=200,s=180,c=200,l=.25,u=50;function d(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function f({containerRef:e,onBack:t,enabled:f,navKey:p}){let m=(0,a.useRef)(t);(0,a.useLayoutEffect)(()=>{m.current=t},[t]);let h=(0,a.useRef)(!1),g=(0,a.useRef)(new Set),_=(0,a.useRef)(!1),v=n.use.registerBackOwner(),y=n.use.unregisterBackOwner();(0,a.useEffect)(()=>{if(f)return v(),y},[f,v,y]),(0,a.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&d(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform ${o}ms ease-out`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),d(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>d(e),o+u)},C=e=>{e.style.transition=`transform ${s}ms ease-in`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*l);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,m.current(),b(()=>{h.current&&(h.current=!1,d(e))},c*2)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,s+u)};r({enabled:f,onConfirm:()=>{let t=e.current;t&&(t.style.transition=`none`,t.style.willChange=`transform`)},onMove:(t,n)=>{let r=e.current;r&&x(r,i(t,n))},onCommit:()=>{let t=e.current;if(!t){m.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):d(n))}}),(0,a.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),d(t))};t.style.transition=`transform ${c}ms ease-out, opacity ${c}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,c+u);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),d(t)}},[p,e])}export{f as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./edge-swipe-arbiter-store-a9LiewmS.js";import{Hn as r,Un as i}from"./index-D_wKh03d.js";var a=e(t(),1),o=200,s=180,c=200,l=.25,u=50;function d(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function f({containerRef:e,onBack:t,enabled:f,navKey:p}){let m=(0,a.useRef)(t);(0,a.useLayoutEffect)(()=>{m.current=t},[t]);let h=(0,a.useRef)(!1),g=(0,a.useRef)(new Set),_=(0,a.useRef)(!1),v=n.use.registerBackOwner(),y=n.use.unregisterBackOwner();(0,a.useEffect)(()=>{if(f)return v(),y},[f,v,y]),(0,a.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&d(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform ${o}ms ease-out`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),d(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>d(e),o+u)},C=e=>{e.style.transition=`transform ${s}ms ease-in`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*l);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,m.current(),b(()=>{h.current&&(h.current=!1,d(e))},c*2)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,s+u)};i({enabled:f,onConfirm:()=>{let t=e.current;t&&(t.style.transition=`none`,t.style.willChange=`transform`)},onMove:(t,n)=>{let i=e.current;i&&x(i,r(t,n))},onCommit:()=>{let t=e.current;if(!t){m.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):d(n))}}),(0,a.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),d(t))};t.style.transition=`transform ${c}ms ease-out, opacity ${c}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,c+u);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),d(t)}},[p,e])}export{f as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-Cqi8q9o7.js";import{t as c}from"./check-CkQjevXL.js";import{o as l}from"./list-row-spYsDF9a.js";import{t as u}from"./link-2-YnZe-oMg.js";import{t as d}from"./loader-circle-C9QrtO3C.js";import{t as f}from"./input-6HVXMszw.js";import{t as p}from"./modal-bIQsMU63.js";import{$t as m,Zt as h,qt as g}from"./sdk.gen-C9GJEKYV.js";import{G as _,K as v,U as y,W as b,o as x,s as ee,x as S}from"./react-query.gen-CWfp8GEM.js";import{r as C}from"./utils-DvUW9GK8.js";import{n as w,r as T,t as E}from"./api-errors-CrWDzVca.js";import{n as D}from"./sdk.gen-8pCB8ehU.js";import{t as O}from"./assistant-feature-flag-store-hJs0ZthQ.js";import{Bt as k,C as A,S as j,b as te,vr as M,x as ne,yr as N,zt as P}from"./index-D_wKh03d.js";import{t as F}from"./mutation-error-BSB3r4np.js";import{t as I}from"./a2a-invite-BgcNY6-0.js";function L(e){return e?.trim()||`your assistant`}var R=e(t(),1),z=o(),B=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],V=`trusted_contacts`,H=new Set([`platform`,`a2a`]),U=new Set([`vellum`,`whatsapp`]);function W(e){return U.has(e)}var G={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function K(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function q(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function J({open:e,assistantId:t,onClose:r}){let[i,o]=(0,R.useState)(!1),u=(0,R.useRef)(null),m=(0,R.useRef)(!1),h=a({...y({path:{assistant_id:t}})}),g=(0,R.useRef)(h.mutate);(0,R.useLayoutEffect)(()=>{g.current=h.mutate});let _=(0,R.useRef)(h.reset);(0,R.useLayoutEffect)(()=>{_.current=h.reset}),(0,R.useEffect)(()=>{e&&!m.current&&g.current({path:{assistant_id:t}}),m.current=e},[e,t]),(0,R.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let v=(0,R.useCallback)(()=>{_.current(),o(!1),u.current&&=(clearTimeout(u.current),null),r()},[r]),b=(0,R.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{o(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>o(!1),2e3)})},[]),x=h.isSuccess&&h.data.token?I({senderAssistantId:t,token:h.data.token}):``;return(0,z.jsx)(p.Root,{open:e,onOpenChange:e=>{e||v()},children:(0,z.jsxs)(p.Content,{size:`sm`,children:[(0,z.jsx)(p.Header,{children:(0,z.jsx)(p.Title,{children:`Share Connection Link`})}),(0,z.jsx)(p.Body,{children:h.isPending?(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,z.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):h.isError?(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,z.jsx)(n,{variant:`outlined`,onClick:()=>h.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):h.isSuccess?(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,z.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(f,{type:`text`,readOnly:!0,value:x,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>b(x),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,z.jsx)(c,{className:`h-4 w-4`}):(0,z.jsx)(l,{className:`h-4 w-4`})})]}),h.data.expiresAt!=null&&(0,z.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:q(h.data.expiresAt)})]}):null}),(0,z.jsx)(p.Footer,{children:(0,z.jsx)(n,{variant:`outlined`,onClick:v,children:`Done`})})]})})}function Y({onClick:e}){return(0,z.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,z.jsx)(u,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function X(e){return typeof e==`string`&&B.includes(e)}function Z(e){return H.has(e)}function Q(e){return(e?.policies??[]).filter(e=>!Z(e.channelType)&&!W(e.channelType)).map(e=>({...e,policy:X(e.policy)?e.policy:`trusted_contacts`}))}async function re(e,t,n,r){if(Z(t))throw new E(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await D({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(w(o,a,`Failed to save channel policy.`),!o.ok)throw new E(o.status,T(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new E(500,`Gateway returned no policy in response.`);return i.policy}var ie=`0.10.0`;function $(){return C(ie)}function ae(e){let t=r(),n=O.use.channelTrustFloors(),o=$(),s=n&&o,c=(0,R.useMemo)(()=>({path:{assistant_id:e}}),[e]),l=(0,R.useMemo)(()=>N(c),[c]),u=i({...M(c),enabled:s,select:Q}),d=(0,R.useMemo)(()=>{let e={};for(let t of u.data??[])k(t.channelType)&&(e[t.channelType]=t.policy);return e},[u.data]),f=a({mutationFn:({channelKey:t,policy:n})=>re(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:l}),onError:F(`Failed to save channel policy`)}),p=(0,R.useCallback)((e,t)=>{f.mutate({channelKey:e,policy:t})},[f]);return s?{policies:d,savingKey:f.isPending?f.variables?.channelKey??null:null,isLoading:u.isPending,isError:u.isError,onChange:p}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var oe={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},se=15e3;function ce({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,R.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,R.useMemo)(()=>ee(o),[o]),c=i({...x(o),enabled:!!e,refetchInterval:se,select:e=>e.snapshots}),l=(0,R.useMemo)(()=>le(c.data??[]),[c.data]),u=l.some(e=>e.key===`slack`&&e.status===`ready`),d=i({...b(o),enabled:u,select:e=>e.threadMode}),f=ae(e),p=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),y=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await g(n):t===`telegram`?await h(n):t===`phone`&&await m(n)},onSettled:(t,r,i)=>{p(),i===`slack`&&A(n,e)}}),S=ne({assistantId:e}),C=j({assistantId:e}),w=te({assistantId:e}),T=a({...v(),onSuccess:()=>{n.invalidateQueries({queryKey:_(o)})}}),E=S.mutateAsync,D=(0,R.useCallback)(async e=>{await E(e)},[E]),O=C.mutate,k=(0,R.useCallback)((e,t)=>{O({botToken:e,appToken:t})},[O]),M=T.mutate,N=(0,R.useCallback)(t=>{M({path:{assistant_id:e},body:{threadMode:t}})},[M,e]),P=w.mutateAsync,F=(0,R.useCallback)(async(e,t)=>{await P({accountSid:e,authToken:t})},[P]),I=(0,R.useCallback)(e=>{t&&t(oe[e])},[t]),L=y.mutate,z=(0,R.useCallback)(e=>{L(e)},[L]);return{channels:l,pendingChannelKey:y.isPending?y.variables??null:null,slackThreadMode:d.data,slackThreadModePending:T.isPending,channelPolicies:f.policies,policySavingKey:f.savingKey,policiesLoading:f.isLoading,policiesError:f.isError,onChannelPolicyChange:f.onChange,onSetup:t?I:void 0,onDisconnect:z,onSaveTelegramToken:D,onSaveSlackConfig:k,slackSaveStatus:C.status,slackSaveError:C.error?.message??null,onSlackThreadModeChange:N,onSaveTwilioCredentials:F}}function le(e){let t=new Map;for(let n of e)t.set(n.channel,n);return P.map(e=>{let n=t.get(e);return{key:e,status:ue(n),address:n?.channelHandle??void 0}})}function ue(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function de(e){let t=r(),[n,i]=(0,R.useState)(!1);return{isOpen:n,open:(0,R.useCallback)(()=>{i(!0)},[]),close:(0,R.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:S({path:{assistant_id:e}})})},[t,e])}}export{Y as a,B as c,L as d,Q as i,G as l,ce as n,J as o,$ as r,V as s,de as t,K as u};
@@ -0,0 +1 @@
1
+ import{E as e,i as t}from"./auth-store-6jOlH4H3.js";function n(){let n=e.use.currentOrganizationId();return!t()||n!=null}export{n as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{u as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{f as i}from"./native-biometric-B2cBAQ1U.js";import{c as a}from"./routes-BXlWEOF0.js";import{n as o,t as s}from"./build-state-D-aPe0DY.js";import{n as c}from"./login-flow-DYLpX6IU.js";var l=e(t(),1);function u(e){let t=n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=(0,l.useRef)(0);return{loading:u,error:f,login:async()=>{let n=e??o(s({sessionSettled:!0,isAuthenticated:!0}),t.pathname),r=++m.current;p(null),d(!0);try{await i(c,`${a.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==m.current)return;p(`Something went wrong. Please try again.`),d(!1)}},cancel:()=>{m.current++,d(!1),p(null),r()&&window.vellum?.auth?.cancelOAuth()}}}export{u as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{l as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{f as i}from"./native-biometric-B_KQURZ4.js";import{c as a}from"./routes-GPGveWZ8.js";import{n as o,t as s}from"./build-state-eUN4dUUO.js";import{n as c}from"./login-flow-KepuOYBD.js";var l=e(t(),1);function u(e){let t=n(),[u,d]=(0,l.useState)(!1),[f,p]=(0,l.useState)(null),m=(0,l.useRef)(0);return{loading:u,error:f,login:async()=>{let n=e??o(s({sessionSettled:!0,isAuthenticated:!0}),t.pathname),r=++m.current;p(null),d(!0);try{await i(c,`${a.account.providerCallback}?returnTo=${encodeURIComponent(n)}`,{returnTo:n})}catch{if(r!==m.current)return;p(`Something went wrong. Please try again.`),d(!1)}},cancel:()=>{m.current++,d(!1),p(null),r()&&window.vellum?.auth?.cancelOAuth()}}}export{u as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{c as n,l as r,u as i}from"./proxy-Cadlowdl.js";var a=e(t(),1);function o(){!r.current&&n();let[e]=(0,a.useState)(i.current);return e}export{o as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{c as n,l as r,u as i}from"./proxy-B6mdWM9d.js";var a=e(t(),1);function o(){!r.current&&n();let[e]=(0,a.useState)(i.current);return e}export{o as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DKhXIxGb.js";import{t as r}from"./useMutation-Lj4VunQV.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./card-D8zyWtZh.js";import{t as o}from"./createLucideIcon-Bjb-Kuq7.js";import{t as s}from"./brain-Ci5ws6Wl.js";import{t as c}from"./globe-inD5tOKN.js";import{t as l}from"./loader-circle-C9QrtO3C.js";import{t as u}from"./puzzle-0_oQwgsv.js";import{t as d}from"./triangle-alert-CnjNKhNx.js";import"./src-yyUuGOWG.js";import{t as f}from"./tag-D0AE0-aA.js";import{lr as p}from"./sdk.gen-C9GJEKYV.js";import{an as m}from"./react-query.gen-CWfp8GEM.js";import{n as h,r as g,t as _}from"./api-errors-CrWDzVca.js";import{Bi as v,Li as y}from"./index-D_wKh03d.js";import{t as b}from"./skills-Blso03pM.js";var x=o(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),S=e(t(),1),C=i();function w({skill:e,className:t,fallback:n=`🧩`}){let[r,i]=(0,S.useState)(!1);return e.icon&&!r?(0,C.jsx)(`img`,{src:`/assistant/skills/${e.id}/${e.icon}`,alt:``,className:`${t} object-contain`,onError:()=>i(!0)}):(0,C.jsx)(`span`,{className:t,children:e.emoji??n})}var T={vellum:{label:`Vellum`,icon:x},clawhub:{label:`Clawhub`,icon:c},skillssh:{label:`skills.sh`,icon:v},custom:{label:`Custom`,icon:y},"assistant-memory":{label:`Assistant's Memory`,icon:s}};function E({origin:e}){let t=e in T?T[e]:{label:e.replace(/-/g,` `),icon:u};return(0,C.jsx)(f,{tone:`neutral`,leftIcon:(0,S.createElement)(t.icon),className:`capitalize`,children:t.label})}function D(e){return e.kind===`installed`||e.kind===`bundled`}function O(e){return e.kind===`catalog`}function k({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:r,children:i}){return(0,C.jsx)(a.Root,{children:(0,C.jsxs)(a.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,C.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,C.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,C.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r}),i]})})}function A(){return(0,C.jsx)(k,{icon:d,iconColor:`var(--system-danger)`,title:`Failed to load skills`,subtitle:`Something went wrong. Try refreshing the page.`})}function j(){return(0,C.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,C.jsx)(l,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}async function M(e,t,n){let{data:r,error:i,response:a}=await p({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1});if(h(a,i,`Failed to install skill.`),!a.ok)throw new _(a.status,g(i,a,`Failed to install skill.`));return r??{ok:!0}}function N(e,{onRemoved:t}={}){let i=n(),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(null),d=(0,S.useCallback)(()=>{b(i,e)},[e,i]),f=r({mutationFn:t=>M(e,t),onMutate:e=>o(e),onSettled:()=>{o(null),d()}}),p=m({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),h=(0,S.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),g=(0,S.useCallback)(e=>{u(e)},[]),_=(0,S.useCallback)(()=>{l&&(p.mutate({path:{assistant_id:e,id:l.id}}),u(null))},[e,l,p]),v=(0,S.useCallback)(()=>{u(null)},[]);return{handleInstall:h,handleRemove:g,isInstallingSkill:(0,S.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,S.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:_,cancelRemove:v}}export{O as a,w as c,k as i,x as l,j as n,D as o,A as r,E as s,N as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./button-BQVYX8n_.js";import{t}from"./useQuery-B45lW1Kk.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./createLucideIcon-Bjb-Kuq7.js";import{n as i,t as a}from"./settings-wSv59mkN.js";import{t as o}from"./code-D1zl7aOd.js";import{t as s}from"./globe-inD5tOKN.js";import{t as c}from"./link-2-YnZe-oMg.js";import{t as l}from"./mic-Dmvwrxe8.js";import"./src-yyUuGOWG.js";import{xt as u}from"./react-query.gen-CWfp8GEM.js";import{Ki as d,ba as f,ga as p,ji as m,la as h,sa as g}from"./index-D_wKh03d.js";var _=r(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),v={mail:h,calendar:i,"message-circle":g,globe:s,zap:m,code:o,mic:l,"shopping-cart":d,palette:r(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),heart:f,settings:a,"link-2":c};function y(e){return v[e]}var b=n();function x({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o=`Skill categories`}){let s=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,b.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o,children:[(0,b.jsx)(S,{icon:p,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),s.map(r=>(0,b.jsx)(S,{icon:y(r.icon)??p,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function S({icon:t,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,b.jsxs)(e,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,b.jsx)(t,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,b.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,b.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function C(e){return t({...u({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}export{_ as i,x as n,y as r,C as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{vt as a,yt as o}from"./react-query.gen-LsPzqPq6.js";import{c as s}from"./routes-BXlWEOF0.js";import{t as c}from"./misc-DnHIYCE9.js";import{ja as l}from"./index-B4Qq7TL7.js";var u=i();function d({skill:e,className:t,onNavigate:r}){return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,u.jsxs)(n,{to:s.conversation(e.sourceConversationId),onClick:r,className:c(`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)] hover:underline`,t),children:[`Learned from this conversation`,(0,u.jsx)(l,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var f=e(t(),1);function p(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function m(e,t){let[n,i]=(0,f.useState)(null),s=r({...o({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,f.useMemo)(()=>s.data?.files??[],[s.data]),l=(0,f.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=p(c,n),d=r({...a({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:s.isLoading,isFilesPending:s.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{d as n,m as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{vt as a,yt as o}from"./react-query.gen-CWfp8GEM.js";import{c as s}from"./routes-GPGveWZ8.js";import{t as c}from"./misc-D0u5tzSd.js";import{Ha as l}from"./index-D_wKh03d.js";var u=i();function d({skill:e,className:t,onNavigate:r}){return e.origin!==`assistant-memory`||!e.sourceConversationId?null:(0,u.jsxs)(n,{to:s.conversation(e.sourceConversationId),onClick:r,className:c(`inline-flex w-fit items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)] hover:underline`,t),children:[`Learned from this conversation`,(0,u.jsx)(l,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0})]})}var f=e(t(),1);function p(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function m(e,t){let[n,i]=(0,f.useState)(null),s=r({...o({path:{assistant_id:e??``,id:t}}),select:e=>e??null,enabled:!!e}),c=(0,f.useMemo)(()=>s.data?.files??[],[s.data]),l=(0,f.useMemo)(()=>c.find(e=>e.name===`SKILL.md`),[c]),u=p(c,n),d=r({...a({path:{assistant_id:e??``,id:t},query:{path:u??``}}),select:e=>e??null,enabled:!!(e&&u)});return{fileEntries:c,skillMd:l,selectedPath:n,setSelectedPath:i,activePath:u,activeFile:c.find(e=>e.path===u),isFilesLoading:s.isLoading,isFilesPending:s.isPending,fileContent:d.data?.content??null,isBinary:!!d.data?.isBinary,isContentLoading:d.isLoading,isContentPending:d.isPending}}export{d as n,m as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-IRfcSUxS.js";var t=e(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./assistant-identity-store-CgJwLRMd.js";import{n as t,r as n,t as r}from"./semver-DIkpaM51.js";function i(e,t,n={}){return t(e.getState())?Promise.resolve():new Promise(r=>{let i,a=()=>{i!==void 0&&clearTimeout(i),o(),r()},o=e.subscribe(e=>{t(e)&&a()});n.timeoutMs!==void 0&&(i=setTimeout(a,n.timeoutMs))})}function a(t){return c(e.use.version(),t)}function o(t,n){let r=e.use.assistantId();return a(t)&&n!=null&&n===r}function s(t){let n=e.getState().version;return c(n,t)}function c(e,i){if(!e)return!1;let a=n(e),o=n(i);if(!a||!o)return!1;let s=r({...a,pre:null},{...o,pre:null});if(s!==0)return s>0;let c=a.pre!==null&&a.pre.startsWith(`dev`),l=o.pre!==null&&o.pre.startsWith(`dev`);return c&&l?t(a.pre,o.pre)>=0:c===l?!0:c}var l=5e3;function u(t=l){return i(e,e=>!!e.version,{timeoutMs:t})}export{i as a,u as i,o as n,a as r,s as t};
@@ -1 +1 @@
1
- import{t as e}from"./capture-error-Dhiismgm.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{bt as r,n as i}from"./sdk.gen-CFgJ4K6f.js";var a=new Map;function o(e,t){return`${e}::${t}`}function s(e,t){let n=o(e,t),r=a.get(n);return r??(r=i({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw a.delete(n),e}),a.set(n,r)),r}function c(e,t,n){a.set(o(e,t),Promise.resolve(n))}function l(e,t){a.delete(o(e,t))}function u(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function d(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`activity-steps`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`skill-detail`||n===`channel-setup`?e[t]:n}function f(e,t){return e.messageId!=null||t.messageId!=null?e.messageId===t.messageId&&e.groupIndex===t.groupIndex:e.toolCalls[0]?.id===t.toolCalls[0]?.id}function p(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var m={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentSurfaceId:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeActivitySteps:null,viewBeforeActivitySteps:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeSkillDetailId:null,viewBeforeSkillDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0,ruleEditorRequestToolCallId:null},h=n(t()((t,n)=>({...m,setMainView:e=>{n().mainView!==e&&t({mainView:e})},setIntelligenceTab:e=>{n().intelligenceTab!==e&&t({intelligenceTab:e})},openApp:e=>{t({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(r,a)=>{t({mainView:`app`,activeAppId:a,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await i({path:{assistant_id:r,id:a},throwOnError:!0});if(n().activeAppId!==a)return;t({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),c(r,e.appId,e.html)}catch(r){if(n().activeAppId!==a)return;u(r)||e(r,{context:`openApp`}),t({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{t({openedAppState:e})},handleAppLoadFailed:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{t({isAppMinimized:!n().isAppMinimized})},handleAppUnpinned:e=>{let t=n();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(n().closeApp(),!0)},enterAppEditing:()=>{t({mainView:`app-editing`})},exitAppEditing:()=>{t({mainView:`app`})},openSubagentDetail:e=>{t({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:d(n(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{t({mainView:n().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{t({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:d(n(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{t({mainView:n().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{t({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:d(n(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{t({mainView:n().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{t({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:d(n(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{t({mainView:n().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openSkillDetail:e=>{t({mainView:`skill-detail`,activeSkillDetailId:e,viewBeforeSkillDetail:d(n(),`viewBeforeSkillDetail`)})},closeSkillDetail:()=>{t({mainView:n().viewBeforeSkillDetail,activeSkillDetailId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:n().openSubagentDetail(t);return;case`workflow`:n().openWorkflowDetail(t);return;case`acp-run`:n().openAcpRunDetail(t);return;case`background-task`:n().openBackgroundTaskDetail(t);return;default:}},closeActiveDetail:()=>{switch(n().mainView){case`subagent-detail`:n().closeSubagentDetail();return;case`workflow-detail`:n().closeWorkflowDetail();return;case`acp-run-detail`:n().closeAcpRunDetail();return;case`background-task-detail`:n().closeBackgroundTaskDetail();return;default:return}},openChannelSetup:e=>{t({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:d(n(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{t({mainView:n().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&p(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditor:e=>{e&&t(t=>({ruleEditorRequestSeq:t.ruleEditorRequestSeq+1,ruleEditorRequestToolCallId:e}))},openActivitySteps:e=>{t({mainView:`activity-steps`,activeActivitySteps:e,viewBeforeActivitySteps:d(n(),`viewBeforeActivitySteps`)})},toggleActivitySteps:e=>{let t=n(),r=t.activeActivitySteps;t.mainView===`activity-steps`&&r!=null&&f(r,e)?n().closeActivitySteps():n().openActivitySteps(e)},closeActivitySteps:()=>{t({mainView:n().viewBeforeActivitySteps,activeActivitySteps:null})},openDocument:()=>{t({mainView:`document`,openedDocumentState:null,viewBeforeDocument:d(n(),`viewBeforeDocument`)})},loadDocument:async(e,i)=>{let a=d(n(),`viewBeforeDocument`);t({mainView:`document`,activeDocumentSurfaceId:i,openedDocumentState:null,viewBeforeDocument:a});try{let{data:o}=await r({path:{assistant_id:e,id:i},throwOnError:!0});if(n().activeDocumentSurfaceId!==i)return;if(!o){t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null});return}t({openedDocumentState:{surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``}})}catch{if(n().activeDocumentSurfaceId!==i)return;t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null})}},setLoadedDocument:e=>{t({openedDocumentState:e})},updateDocumentContent:(e,r,i)=>{let a=n();if(!a.openedDocumentState||a.openedDocumentState.surfaceId!==e)return;let o=a.openedDocumentState,s=i===`append`?o.content+r:r;t({openedDocumentState:{...o,content:s}})},handleDocumentLoadFailed:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},closeDocument:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},refreshAssets:()=>{t({assetsRefreshKey:n().assetsRefreshKey+1})},reset:()=>t({...m})})));export{s as a,l as i,p as n,c as o,h as r,f as t};
1
+ import{t as e}from"./capture-error-Dhiismgm.js";import{n as t,t as n}from"./create-selectors-8NePGNlX.js";import{bt as r,n as i}from"./sdk.gen-C9GJEKYV.js";var a=new Map;function o(e,t){return`${e}::${t}`}function s(e,t){let n=o(e,t),r=a.get(n);return r??(r=i({path:{assistant_id:e,id:t},throwOnError:!0}).then(e=>e.data.html).catch(e=>{throw a.delete(n),e}),a.set(n,r)),r}function c(e,t,n){a.set(o(e,t),Promise.resolve(n))}function l(e,t){a.delete(o(e,t))}function u(e){if(typeof e!=`object`||!e)return!1;let t=e.error;if(typeof t!=`object`||!t||t.code!==`NOT_FOUND`)return!1;let n=t.message;return typeof n==`string`&&n.startsWith(`App not found`)}function d(e,t){let n=e.mainView;return n===`document`||n===`subagent-detail`||n===`tool-detail`||n===`activity-steps`||n===`workflow-detail`||n===`acp-run-detail`||n===`background-task-detail`||n===`skill-detail`||n===`channel-setup`?e[t]:n}function f(e,t){return e.messageId!=null||t.messageId!=null?e.messageId===t.messageId&&e.groupIndex===t.groupIndex:e.toolCalls[0]?.id===t.toolCalls[0]?.id}function p(e,t){return t.messageId==null?e.thinkingText===t.thinkingText:e.messageId===t.messageId&&e.thinkingGroupIndex===t.thinkingGroupIndex&&e.thinkingItemIndex===t.thinkingItemIndex}var m={mainView:`chat`,activeAppId:null,openedAppState:null,activeDocumentSurfaceId:null,openedDocumentState:null,isAppMinimized:!1,intelligenceTab:`identity`,assetsRefreshKey:0,viewBeforeDocument:`chat`,activeSubagentId:null,viewBeforeSubagentDetail:`chat`,activeToolDetail:null,viewBeforeToolDetail:`chat`,activeActivitySteps:null,viewBeforeActivitySteps:`chat`,activeWorkflowRunId:null,viewBeforeWorkflowDetail:`chat`,activeAcpRunId:null,viewBeforeAcpRunDetail:`chat`,activeBackgroundTaskId:null,viewBeforeBackgroundTaskDetail:`chat`,activeSkillDetailId:null,viewBeforeSkillDetail:`chat`,activeChannelSetup:null,viewBeforeChannelSetup:`chat`,ruleEditorRequestSeq:0,ruleEditorRequestToolCallId:null},h=n(t()((t,n)=>({...m,setMainView:e=>{n().mainView!==e&&t({mainView:e})},setIntelligenceTab:e=>{n().intelligenceTab!==e&&t({intelligenceTab:e})},openApp:e=>{t({mainView:`app`,activeAppId:e,openedAppState:null,isAppMinimized:!1})},loadApp:async(r,a)=>{t({mainView:`app`,activeAppId:a,openedAppState:null,isAppMinimized:!1});try{let{data:e}=await i({path:{assistant_id:r,id:a},throwOnError:!0});if(n().activeAppId!==a)return;t({openedAppState:{appId:e.appId,dirName:e.dirName,name:e.name,html:e.html}}),c(r,e.appId,e.html)}catch(r){if(n().activeAppId!==a)return;u(r)||e(r,{context:`openApp`}),t({mainView:`chat`,activeAppId:null,openedAppState:null})}},setLoadedApp:e=>{t({openedAppState:e})},handleAppLoadFailed:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null})},closeApp:()=>{t({mainView:`chat`,activeAppId:null,openedAppState:null,isAppMinimized:!1})},toggleAppMinimized:()=>{t({isAppMinimized:!n().isAppMinimized})},handleAppUnpinned:e=>{let t=n();return t.activeAppId!==e||t.mainView!==`app`&&t.mainView!==`app-editing`?!1:(n().closeApp(),!0)},enterAppEditing:()=>{t({mainView:`app-editing`})},exitAppEditing:()=>{t({mainView:`app`})},openSubagentDetail:e=>{t({mainView:`subagent-detail`,activeSubagentId:e,viewBeforeSubagentDetail:d(n(),`viewBeforeSubagentDetail`)})},closeSubagentDetail:()=>{t({mainView:n().viewBeforeSubagentDetail,activeSubagentId:null})},openWorkflowDetail:e=>{t({mainView:`workflow-detail`,activeWorkflowRunId:e,viewBeforeWorkflowDetail:d(n(),`viewBeforeWorkflowDetail`)})},closeWorkflowDetail:()=>{t({mainView:n().viewBeforeWorkflowDetail,activeWorkflowRunId:null})},openAcpRunDetail:e=>{t({mainView:`acp-run-detail`,activeAcpRunId:e,viewBeforeAcpRunDetail:d(n(),`viewBeforeAcpRunDetail`)})},closeAcpRunDetail:()=>{t({mainView:n().viewBeforeAcpRunDetail,activeAcpRunId:null})},openBackgroundTaskDetail:e=>{t({mainView:`background-task-detail`,activeBackgroundTaskId:e,viewBeforeBackgroundTaskDetail:d(n(),`viewBeforeBackgroundTaskDetail`)})},closeBackgroundTaskDetail:()=>{t({mainView:n().viewBeforeBackgroundTaskDetail,activeBackgroundTaskId:null})},openSkillDetail:e=>{t({mainView:`skill-detail`,activeSkillDetailId:e,viewBeforeSkillDetail:d(n(),`viewBeforeSkillDetail`)})},closeSkillDetail:()=>{t({mainView:n().viewBeforeSkillDetail,activeSkillDetailId:null})},openProcessDetail:({kind:e,id:t})=>{switch(e){case`subagent`:n().openSubagentDetail(t);return;case`workflow`:n().openWorkflowDetail(t);return;case`acp-run`:n().openAcpRunDetail(t);return;case`background-task`:n().openBackgroundTaskDetail(t);return;default:}},closeActiveDetail:()=>{switch(n().mainView){case`subagent-detail`:n().closeSubagentDetail();return;case`workflow-detail`:n().closeWorkflowDetail();return;case`acp-run-detail`:n().closeAcpRunDetail();return;case`background-task-detail`:n().closeBackgroundTaskDetail();return;default:return}},openChannelSetup:e=>{t({mainView:`channel-setup`,activeChannelSetup:e,viewBeforeChannelSetup:d(n(),`viewBeforeChannelSetup`)})},closeChannelSetup:()=>{t({mainView:n().viewBeforeChannelSetup,activeChannelSetup:null})},openToolDetail:e=>{t({mainView:`tool-detail`,activeToolDetail:e,viewBeforeToolDetail:d(n(),`viewBeforeToolDetail`)})},toggleToolDetail:e=>{let t=n(),r=t.activeToolDetail;t.mainView===`tool-detail`&&r!=null&&(e.kind===`thinking`?r.kind===`thinking`&&p(r,e):r.kind!==`thinking`&&r.toolCallId===e.toolCallId)?n().closeToolDetail():n().openToolDetail(e)},closeToolDetail:()=>{t({mainView:n().viewBeforeToolDetail,activeToolDetail:null})},requestRuleEditor:e=>{e&&t(t=>({ruleEditorRequestSeq:t.ruleEditorRequestSeq+1,ruleEditorRequestToolCallId:e}))},openActivitySteps:e=>{t({mainView:`activity-steps`,activeActivitySteps:e,viewBeforeActivitySteps:d(n(),`viewBeforeActivitySteps`)})},toggleActivitySteps:e=>{let t=n(),r=t.activeActivitySteps;t.mainView===`activity-steps`&&r!=null&&f(r,e)?n().closeActivitySteps():n().openActivitySteps(e)},closeActivitySteps:()=>{t({mainView:n().viewBeforeActivitySteps,activeActivitySteps:null})},openDocument:()=>{t({mainView:`document`,openedDocumentState:null,viewBeforeDocument:d(n(),`viewBeforeDocument`)})},loadDocument:async(e,i)=>{let a=d(n(),`viewBeforeDocument`);t({mainView:`document`,activeDocumentSurfaceId:i,openedDocumentState:null,viewBeforeDocument:a});try{let{data:o}=await r({path:{assistant_id:e,id:i},throwOnError:!0});if(n().activeDocumentSurfaceId!==i)return;if(!o){t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null});return}t({openedDocumentState:{surfaceId:o.surfaceId,conversationId:o.conversationId,documentName:o.title??`Untitled`,content:o.content??``}})}catch{if(n().activeDocumentSurfaceId!==i)return;t({mainView:a,activeDocumentSurfaceId:null,openedDocumentState:null})}},setLoadedDocument:e=>{t({openedDocumentState:e})},updateDocumentContent:(e,r,i)=>{let a=n();if(!a.openedDocumentState||a.openedDocumentState.surfaceId!==e)return;let o=a.openedDocumentState,s=i===`append`?o.content+r:r;t({openedDocumentState:{...o,content:s}})},handleDocumentLoadFailed:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},closeDocument:()=>{t({mainView:n().viewBeforeDocument,activeDocumentSurfaceId:null,openedDocumentState:null})},refreshAssets:()=>{t({assetsRefreshKey:n().assetsRefreshKey+1})},reset:()=>t({...m})})));export{s as a,l as i,p as n,c as o,h as r,f as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r}from"./local-settings-C-dW2vkq.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-BQVYX8n_.js";import{m as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-D8zyWtZh.js";import{t as f}from"./chevron-down-DwIPfcCg.js";import{n as p}from"./list-row-spYsDF9a.js";import{t as m}from"./info-DLFMsCl-.js";import{t as h}from"./triangle-alert-CnjNKhNx.js";import{j as g,k as _}from"./src-yyUuGOWG.js";import{t as v}from"./input-6HVXMszw.js";import{t as y}from"./toggle-CWrJ2t4S.js";import{n as b}from"./toast-CZmbu5xl.js";import{t as x}from"./dropdown-CuE5AuVj.js";import{dt as S,j as C}from"./sdk.gen-C9GJEKYV.js";import{At as w,Mt as T,Nt as E,Ot as D,Pt as O,c as ee,l as te}from"./react-query.gen-CWfp8GEM.js";import{t as ne}from"./assistant-identity-store-CgJwLRMd.js";import{t as re}from"./use-is-org-ready-0evEMlKE.js";import{$i as k,$n as A,Br as j,Lr as M,Rr as N,Vr as P,ar as ie,cr as F,er as I,hr as L,ir as R,mr as z,nn as B,nr as V,or as ae,pr as H,rr as oe,sr as se,tn as ce,tr as U,zi as le,zr as ue}from"./index-D_wKh03d.js";import{t as W}from"./use-active-assistant-id-DwLFgABu.js";import{t as G}from"./detail-card-BQDwZw9u.js";import{E as de,S as fe,T as pe,a as me,b as he,f as K,g as q,h as ge,m as J,o as _e,p as Y,w as ve,x as ye}from"./provider-catalogs-BFoYvfUc.js";var X=e(i(),1),Z=u();function be({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,Z.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,Z.jsx)(y,{checked:n,disabled:r,onChange:i,label:e})]})}function xe(){return(0,Z.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function Se({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:s}){let[c,l]=(0,X.useState)(!1),u=n.filter(e=>!t.sounds.includes(e.filename)),d=n.length>0&&u.length===0;return(0,Z.jsxs)(`div`,{className:`py-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:N[e]}),(0,Z.jsx)(y,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${N[e]}`})]}),t.enabled&&(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:P(e)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,Z.jsx)(k,{className:`h-3 w-3`})}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,Z.jsx)(le,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,Z.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):d?(0,Z.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,Z.jsxs)(`div`,{className:`relative inline-block`,children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,Z.jsx)(f,{className:`h-3 w-3`})]}),c&&(0,Z.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>l(!1),children:u.map(e=>(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),l(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function Ce(){let e=s(),t=W(),n=(0,X.useMemo)(()=>w({path:{assistant_id:t}}),[t]),r=(0,X.useMemo)(()=>D({path:{assistant_id:t}}),[t]),{data:i}=c(n),{data:a}=c(r),o=i??j(),u=a?.sounds??[],f=(0,X.useMemo)(()=>({path:{assistant_id:t}}),[t]),p=l({...E(f),onMutate:async t=>{await e.cancelQueries({queryKey:n.queryKey});let r=e.getQueryData(n.queryKey);return T(e,f,t.body),{previous:r}},onError:(t,n,r)=>{r?.previous!==void 0&&T(e,f,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:n.queryKey})}}),m=(0,X.useCallback)(r=>{let i=r(e.getQueryData(n.queryKey)??j());p.mutate({path:{assistant_id:t},body:i})},[t,n.queryKey,e,p]),h=e=>{m(t=>({...t,globalEnabled:e}))},g=e=>{m(t=>({...t,volume:e}))},[_,v]=(0,X.useState)(null),y=_??o.volume,b=(e,t)=>{m(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},x=(e,t)=>{m(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},S=(e,t)=>{m(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},C=()=>{M().previewFallbackBlip(o.volume)},O=e=>{M().previewSound(e,o.volume)};return(0,Z.jsxs)(`div`,{className:`space-y-6`,children:[(0,Z.jsxs)(d,{children:[(0,Z.jsx)(be,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:o.globalEnabled,onChange:h}),(0,Z.jsx)(xe,{}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,Z.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,Z.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:y,onChange:e=>v(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},className:`h-1 w-48 cursor-pointer`,disabled:!o.globalEnabled,"aria-label":`Sound effect volume`}),(0,Z.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(y*100),`%`]})]}),(0,Z.jsx)(xe,{}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,Z.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,Z.jsxs)(`button`,{type:`button`,onClick:C,disabled:!o.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,Z.jsx)(k,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,Z.jsxs)(d,{children:[(0,Z.jsxs)(`div`,{className:`pb-2`,children:[(0,Z.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,Z.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,Z.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:ue.map(e=>(0,Z.jsx)(Se,{event:e,eventConfig:o.events[e]??{enabled:!1,sounds:[]},availableSounds:u,globalEnabled:o.globalEnabled,onToggle:t=>b(e,t),onAddSound:t=>x(e,t),onRemoveSound:t=>S(e,t),onPreview:e=>O(e)},e))})]})]})}async function we(e){let{provider:t,apiKey:n,voiceId:r,text:i}=e;if(n.trim().length===0)return{kind:`error`,message:`Save an API key for this provider first.`};try{return t===`elevenlabs`?await Te(n,r,i):t===`deepgram`?await Ee(n,i):t===`fish-audio`?{kind:`unsupported`,message:`Fish Audio TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:t===`xai`?{kind:`unsupported`,message:`xAI TTS is only supported in the desktop app today. Use ElevenLabs or Deepgram to test from the browser.`}:{kind:`unsupported`,message:`TTS testing for "${t}" is not supported from the browser yet.`}}catch(e){return{kind:`error`,message:e instanceof Error?e.message:`Failed to reach the TTS provider.`}}}async function Te(e,t,n){let r=t.trim();if(r.length===0)return{kind:`error`,message:`Enter and save a Voice ID before testing ElevenLabs.`};let i=await fetch(`https://api.elevenlabs.io/v1/text-to-speech/${encodeURIComponent(r)}?output_format=mp3_44100_128`,{method:`POST`,headers:{"xi-api-key":e,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:n,model_id:`eleven_turbo_v2_5`})});return i.ok?{kind:`audio`,blob:await i.blob()}:{kind:`error`,message:await De(i,`ElevenLabs rejected the request.`)}}async function Ee(e,t){let n=await fetch(`https://api.deepgram.com/v1/speak?model=aura-2-thalia-en`,{method:`POST`,headers:{Authorization:`Token ${e}`,"Content-Type":`application/json`,Accept:`audio/mpeg`},body:JSON.stringify({text:t})});return n.ok?{kind:`audio`,blob:await n.blob()}:{kind:`error`,message:await De(n,`Deepgram rejected the request.`)}}async function De(e,t){try{let n=await e.text();if(n.length===0)return`${t} (HTTP ${e.status})`;try{let e=JSON.parse(n);if(e&&typeof e==`object`&&`detail`in e&&typeof e.detail==`string`)return e.detail;if(e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`)return e.message}catch{}return n.slice(0,200)}catch{return`${t} (HTTP ${e.status})`}}var Oe={elevenlabs:`voiceId`,"fish-audio":`referenceId`,xai:`voiceId`};function ke(){let e=W(),t=ne.use.name()??`your assistant`,i=re(),o=s(),{data:l}=c({...O({path:{assistant_id:e}}),enabled:i,staleTime:1/0}),u=(0,X.useMemo)(()=>{let e=l?.providers;if(!e)return _e;if(e.some(e=>e.id===`vellum`))return e;let t=_e.find(e=>e.id===`vellum`);return t?[t,...e]:e},[l]),{data:d}=c({...ee({path:{assistant_id:e}}),enabled:i,staleTime:3e4}),f=d?.services?.tts,p=f?.mode===`managed`?`vellum`:f?.provider,m=`elevenlabs`,h=(0,X.useMemo)(()=>p??r(`vellum:voice:ttsProvider`,m),[p,m]),g=!!p,[_,y]=he(h),[w,T]=(0,X.useState)(``),[E,D]=(0,X.useState)(``),[k,A]=(0,X.useState)(``),[j,M]=(0,X.useState)(!1),[N,P]=(0,X.useState)(!1),[ie,F]=(0,X.useState)(!1),I=(0,X.useMemo)(()=>u.find(e=>e.id===_)??u[0],[_,u]),L=(0,X.useCallback)(e=>{let t=r(J+e,``),n=r(q+e,``);M(t.length>0),D(n),A(n),T(``)},[]);(0,X.useEffect)(()=>{L(_)},[_,L]);let R=(0,X.useMemo)(()=>{let e=_!==h,t=w.trim().length>0,n=E.trim()!==k;return e||t||n},[_,h,w,E,k]),z=(0,X.useCallback)(async()=>{let t=w.trim(),i=E.trim(),a=I.id;n(ge,a),t.length>0&&n(J+a,t),n(q+a,i);let s=t.length>0?t:r(J+a,``),c=Oe[a];F(!0);try{if(s.length>0){let{response:t}=await S({path:{assistant_id:e},body:{service:a,field:`api_key`,value:s,label:`${I.displayName} API Key`},throwOnError:!1});if(!t?.ok)throw Error(`Failed to store API key (HTTP ${t?.status??`?`})`)}let t={..._!==h||!g?{provider:a,mode:a===`vellum`?`managed`:`your-own`}:{},...c?{providers:{[a]:{[c]:i}}}:{}};if(Object.keys(t).length>0){let{response:n}=await C({path:{assistant_id:e},body:{services:{tts:t}},throwOnError:!1});if(!n?.ok)throw Error(`Failed to save configuration (HTTP ${n?.status??`?`})`)}M(s.length>0),A(i),T(``),o.invalidateQueries({queryKey:te({path:{assistant_id:e}})}),b.success(`Text-to-speech settings saved`)}catch(e){b.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`)}finally{F(!1)}},[e,_,w,E,I,h,g,o]),B=(0,X.useCallback)(()=>{n(J+_,``),M(!1),T(``)},[_]),V=(0,X.useCallback)(async()=>{P(!0);try{let e=r(J+_,``),n=w.trim(),i=n.length>0?n:e;if(i.length===0){b.error(`Save an API key for this provider before testing.`);return}let a=r(q+_,``),o=E.trim(),s=await we({provider:_,apiKey:i,voiceId:o.length>0?o:a,text:`Hey! It's ${t}. How does this sound?`});if(s.kind!==`audio`){b.error(s.message);return}let c=URL.createObjectURL(s.blob);try{let e=new Audio(c);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(c)}}finally{P(!1)}},[t,w,_,E]),ae=j?`•••••••• (Enter a new key to replace)`:I.apiKeyPlaceholder,H=_===`vellum`;return(0,Z.jsx)(ye,{title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(x,{value:_,onChange:y,options:u.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),!H&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Z.jsx)(v,{type:`password`,value:w,onChange:e=>T(e.target.value),placeholder:ae,fullWidth:!0})]}),I.supportsVoiceSelection&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,Z.jsx)(v,{type:`text`,value:E,onChange:e=>D(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),(0,Z.jsx)(fe,{guide:I.credentialsGuide}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!H&&(0,Z.jsx)(a,{variant:`outlined`,onClick:V,disabled:N,children:N?`Testing…`:`Test`}),(0,Z.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Z.jsx)(de,{onClick:z,disabled:!R||ie}),j&&!H&&(0,Z.jsx)(pe,{onClick:B})]})]})]})})}var Ae={vellum:{provider:`vellum`},deepgram:{provider:`deepgram`,credentialService:`deepgram`},openai:{provider:`openai-whisper`,credentialService:`openai`}},je={vellum:`vellum`,deepgram:`deepgram`,"openai-whisper":`openai`},Me=`deepgram`;function Ne(){let e=W(),t=re(),i=s(),[a]=(0,X.useState)(()=>me.filter(e=>!e.requiresNativeDictation||H())),o=Me,{data:l}=c({...ee({path:{assistant_id:e}}),enabled:t,staleTime:3e4}),u=l?.services?.stt,d=u?.mode===`managed`?`vellum`:u?.provider,f=(0,X.useMemo)(()=>{let e=d?je[d]:void 0;if(e&&a.some(t=>t.id===e))return e;let t=r(Y,o);return a.some(e=>e.id===t)?t:o},[d,a,o]),p=!!d,[m,g]=he(f),[_,y]=(0,X.useState)(``),[w,T]=(0,X.useState)(!1),[E,D]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=r(Y,o);e===`macos-native`&&!a.some(t=>t.id===e)&&n(Y,o)},[a,o]);let O=(0,X.useMemo)(()=>a.find(e=>e.id===m)??a[0],[a,m]),ne=O.apiKeyPlaceholder!==void 0;(0,X.useEffect)(()=>{T(r(K+m,``).length>0),y(``)},[m]);let k=(0,X.useMemo)(()=>{let e=m!==f,t=_.trim().length>0;return e||t},[m,f,_]),A=(0,X.useCallback)(async()=>{let t=_.trim();n(Y,m),t.length>0&&n(K+m,t);let a=Ae[m];D(!0);try{if(a?.credentialService){let n=t.length>0?t:r(K+m,``);if(n.length>0){let{response:t}=await S({path:{assistant_id:e},body:{service:a.credentialService,field:`api_key`,value:n,label:`${O.displayName} API Key`},throwOnError:!1});if(!t?.ok)throw Error(`Failed to store API key (HTTP ${t?.status??`?`})`)}}if(a&&(m!==f||!p)||d===`vellum`&&m!==`vellum`){let t=a?.provider??Me,{response:n}=await C({path:{assistant_id:e},body:{services:{stt:{provider:t,mode:t===`vellum`?`managed`:`your-own`}}},throwOnError:!1});if(!n?.ok)throw Error(`Failed to save configuration (HTTP ${n?.status??`?`})`)}t.length>0&&T(!0),y(``),i.invalidateQueries({queryKey:te({path:{assistant_id:e}})}),b.success(`Speech-to-text settings saved`)}catch(e){b.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`)}finally{D(!1)}},[e,m,_,O,f,p,d,i]),j=(0,X.useCallback)(()=>{n(K+m,``),T(!1),y(``)},[m]),M=w?`•••••••• (Enter a new key to replace)`:O.apiKeyPlaceholder;return(0,Z.jsx)(ye,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Z.jsx)(x,{value:m,onChange:g,options:a.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),ne&&(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Z.jsx)(v,{type:`password`,value:_,onChange:e=>y(e.target.value),placeholder:M,fullWidth:!0})]}),O.setupWarning&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(h,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,Z.jsx)(`span`,{children:O.setupWarning})]}),O.credentialsGuide&&(0,Z.jsx)(fe,{guide:O.credentialsGuide}),m===`vellum`&&(0,Z.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Transcription runs through your Vellum account.`}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,Z.jsx)(de,{onClick:A,disabled:!k||E}),w&&(0,Z.jsx)(pe,{onClick:j})]})]})})}var Pe=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],Fe=`We recommend keeping both off to start. It feels more like a real conversation.`;function Ie(){return(0,Z.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Recommended off`})}function Le({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,Z.jsx)(Ie,{}):null]}),t?(0,Z.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,Z.jsx)(y,{checked:r,onChange:i,"aria-label":e})]})}function Re({showDescription:e=!1,showRecommendedBadge:t=!1}){let n=B.use.showUserTranscript(),r=B.use.showAssistantTranscript(),i=B.use.setShowUserTranscript(),a=B.use.setShowAssistantTranscript(),o={showUserTranscript:{checked:n,onChange:i},showAssistantTranscript:{checked:r,onChange:a}};return(0,Z.jsx)(Z.Fragment,{children:Pe.map(n=>{let r=o[n.prefKey];return(0,Z.jsx)(Le,{label:n.label,description:e?n.description:void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var ze=`vellum:voice:conversationTimeoutSeconds`,Be=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],Q={label:`Fn`,activator:U},Ve=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],He=`30`,$=`text-body-small-default text-[var(--content-tertiary)]`,Ue=[`voice`,`services`,`sounds`];function We(e){return Ue.includes(e)}function Ge(){let[e,t]=o(),n=e.get(`tab`),r=We(n)?n:`voice`;return(0,Z.jsx)(`div`,{className:`space-y-6`,children:(0,Z.jsxs)(p.Root,{value:r,onValueChange:n=>{let r=new URLSearchParams(e);n===`voice`?r.delete(`tab`):r.set(`tab`,n),t(r,{replace:!0})},children:[(0,Z.jsxs)(p.List,{children:[(0,Z.jsx)(p.Trigger,{value:`voice`,children:`Voice`}),(0,Z.jsx)(p.Trigger,{value:`services`,children:`Services`}),(0,Z.jsx)(p.Trigger,{value:`sounds`,children:`Sounds`})]}),(0,Z.jsx)(p.Panel,{value:`voice`,className:`pt-4`,children:(0,Z.jsx)(qe,{})}),(0,Z.jsx)(p.Panel,{value:`services`,className:`pt-4`,children:(0,Z.jsx)(Ke,{})}),(0,Z.jsx)(p.Panel,{value:`sounds`,className:`pt-4`,children:(0,Z.jsx)(Ce,{})})]})})}function Ke(){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Z.jsx)(ve,{}),(0,Z.jsx)(ke,{}),(0,Z.jsx)(Ne,{})]})}function qe(){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Z.jsx)(Xe,{}),(0,Z.jsx)(Ze,{}),(0,Z.jsx)($e,{}),(0,Z.jsx)(tt,{}),(0,Z.jsx)(nt,{}),(0,Z.jsx)(Je,{})]})}function Je(){return(0,Z.jsx)(G,{title:`Transcription`,subtitle:`Show live text of what you and the assistant say during a voice conversation.`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(Re,{showDescription:!0}),(0,Z.jsx)(`p`,{className:`${$} pt-1`,children:Fe})]})})}var Ye=``;function Xe(){let[e,r]=(0,X.useState)([]),[i,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(()=>L()),l=(0,X.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),r(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{r([]),o(!1)}},[]),u=(0,X.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,X.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,X.useMemo)(()=>[{value:Ye,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),f=(0,X.useCallback)(e=>{c(e),e===Ye?t(z):n(z,e)},[]);return(0,Z.jsx)(G,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`div`,{className:`max-w-xs`,children:(0,Z.jsx)(x,{options:d,value:d.some(e=>e.value===s)?s:Ye,onChange:f,"aria-label":`Microphone`})}),i&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(a,{variant:`outlined`,onClick:u,children:`Allow Microphone Access`}),(0,Z.jsx)(`span`,{className:$,children:`Grant microphone access to list your available input devices.`})]})]})})}function Ze(){let e=A(),[t,i]=(0,X.useState)(()=>{let t=r(V,``);return t?ae(t,{preserveFunction:e}):e?Q.activator:{kind:`off`}}),[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)([]),l=(0,X.useRef)(null),u=(0,X.useRef)(!1),d=(0,X.useMemo)(()=>e?[Q,...Be]:Be,[e]),f=t.kind!==`off`,p=f&&!e,h=(0,X.useCallback)(e=>{i(e),n(V,se(e)),o(!1),c([])},[]),g=(0,X.useCallback)(()=>{o(!0),c([]),u.current=!1,requestAnimationFrame(()=>{l.current?.focus()})},[]),_=(0,X.useCallback)(()=>{o(!1),c([]),u.current=!1},[]),v=(0,X.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),b=(0,X.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){_();return}let t=v(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?U.modifiers:F(t));return}if(t.includes(`function`)){h(U);return}u.current=!0,h({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[_,v,h]),x=(0,X.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(u.current){u.current=!1,c([]);return}v(e).length===0&&s.length>0&&h({kind:`modifierOnly`,modifiers:s})}},[v,a,s,h]);(0,X.useEffect)(()=>{if(!a)return;let e=e=>{l.current&&!l.current.contains(e.target)&&_()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[_,a]);let S=f&&!d.some(e=>R(e.activator,t));return(0,Z.jsx)(G,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(y,{checked:f,onChange:n=>{n?t.kind===`off`&&h(e?Q.activator:I):h({kind:`off`})},label:`Enable Push to Talk`}),f&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:$,children:`Activation Key:`}),(0,Z.jsxs)(`div`,{ref:l,tabIndex:a?0:-1,onKeyDown:a?b:void 0,onKeyUp:a?x:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[d.map(e=>{let n=R(e.activator,t);return(0,Z.jsx)(Qe,{label:e.label,selected:n,onClick:()=>h(e.activator)},e.label)}),a?(0,Z.jsx)(Qe,{label:s.length>0?ie(s):`Press any key…`,selected:!0,recording:!0,onClick:_}):(0,Z.jsx)(Qe,{label:S?oe(t):`Custom`,selected:S,onClick:g})]}),p&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,Z.jsx)(m,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,Z.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function Qe({label:e,selected:t,recording:n=!1,onClick:r}){return(0,Z.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,Z.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,Z.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function $e(){let[e,t]=(0,X.useState)(()=>{let e=r(ze,He);return Ve.find(t=>t.value===e)?.value??He});return(0,Z.jsx)(G,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,Z.jsx)(`div`,{className:`max-w-xs`,children:(0,Z.jsx)(x,{options:Ve,value:e,onChange:(0,X.useCallback)(e=>{t(e),n(ze,e)},[]),"aria-label":`Conversation timeout`})})})}var et=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];function tt(){let e=B.use.pauseBeforeReplyMs(),t=B.use.setPauseBeforeReplyMs();return(0,Z.jsx)(G,{title:`Pause before reply`,subtitle:`How long the assistant waits after you stop speaking before it replies. A longer pause lets you gather your thoughts mid-sentence without being cut off.`,children:(0,Z.jsx)(`div`,{className:`max-w-xs`,children:(0,Z.jsx)(_,{value:(e??1200)/1e3,onValueChange:e=>{typeof e==`number`&&t(Math.round(e*1e3))},min:500/1e3,max:ce/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":`Pause before reply`})})})}function nt(){let e=B.use.interruptSensitivity(),t=B.use.setInterruptSensitivity();return(0,Z.jsx)(G,{title:`Interrupt sensitivity`,subtitle:`How easily talking over the assistant interrupts it. Lower it if the assistant cuts itself off on background noise or filler words; raise it to interrupt more quickly.`,children:(0,Z.jsx)(`div`,{className:`max-w-xs`,children:(0,Z.jsx)(g,{items:et,value:e??`medium`,onChange:t,ariaLabel:`Interrupt sensitivity`})})})}export{Ge as VoicePage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./moon-jDX7sipq.js";import{t as i}from"./misc-D0u5tzSd.js";import{Aa as a,Ea as o,Ma as s,Na as c,Oa as l,Pi as u,Vi as d,Wi as f,at as p,it as m,ja as h,ka as g,nt as _,rt as v}from"./index-D_wKh03d.js";var y=e(t(),1),b={"sun.max.fill":{icon:d,className:`text-orange-500`},"cloud.sun.fill":{icon:g,className:`text-amber-400`},"moon.fill":{icon:r,className:`text-blue-400`},"cloud.moon.fill":{icon:h,className:`text-blue-400`},"cloud.fill":{icon:l,className:`text-stone-400`},"cloud.rain.fill":{icon:a,className:`text-blue-400`},snowflake:{icon:f,className:`text-blue-300`},"cloud.bolt.fill":{icon:s,className:`text-orange-500`},"cloud.fog.fill":{icon:c,className:`text-stone-400`}},x={sunny:{icon:d,className:`text-orange-500`},clear:{icon:d,className:`text-orange-500`},"partly cloudy":{icon:g,className:`text-amber-400`},"mostly sunny":{icon:g,className:`text-amber-400`},cloudy:{icon:l,className:`text-stone-400`},overcast:{icon:l,className:`text-stone-400`},rainy:{icon:a,className:`text-blue-400`},rain:{icon:a,className:`text-blue-400`},drizzle:{icon:a,className:`text-blue-400`},snow:{icon:f,className:`text-blue-300`},snowy:{icon:f,className:`text-blue-300`},thunderstorm:{icon:s,className:`text-orange-500`},thunder:{icon:s,className:`text-orange-500`},foggy:{icon:c,className:`text-stone-400`},fog:{icon:c,className:`text-stone-400`},mist:{icon:c,className:`text-stone-400`},hazy:{icon:c,className:`text-stone-400`},night:{icon:r,className:`text-blue-400`},"mainly clear":{icon:d,className:`text-orange-500`},"mostly cloudy":{icon:l,className:`text-stone-400`},breezy:{icon:u,className:`text-stone-400`},windy:{icon:u,className:`text-stone-400`},cool:{icon:l,className:`text-stone-400`},warm:{icon:d,className:`text-orange-500`},hot:{icon:d,className:`text-orange-500`},cold:{icon:f,className:`text-blue-300`},"cold snap":{icon:f,className:`text-blue-300`},"warm, mostly sunny":{icon:g,className:`text-amber-400`},"cooler, breezy":{icon:u,className:`text-stone-400`}},S={icon:l,className:`text-stone-400`};function C(e){let t=b[e];if(t)return t;let n=e.toLowerCase(),r=x[n];if(r)return r;for(let[e,t]of Object.entries(x))if(n.includes(e))return t;return S}function w(e){if(typeof e==`string`){let t=e.match(/^(\d+)\s*mph\s*(.*)/i);if(t)return{speed:Number(t[1]),direction:t[2]?.trim()||void 0}}return{}}function T(e){let t;if(typeof e.location==`string`)t=e.location;else{let n=m(e.location);n&&typeof n.name==`string`&&(t=n.name)}if(!t)return null;let n=m(e.current),r=v(n?.temp)??v(e.currentTemp)??v(e.temperature)??v(e.temp),i=v(n?.feelsLike)??v(n?.feels_like)??v(n?.apparentTemperature)??v(e.feelsLike)??v(e.feels_like)??v(e.apparentTemperature),a=p(n?.condition)??p(e.condition),o=v(n?.humidity)??v(e.humidity),s=w(n?.wind??e.wind),c=v(n?.windSpeed)??v(n?.wind_speed)??v(e.windSpeed)??v(e.wind_speed)??s.speed,l=p(n?.windDirection)??p(n?.wind_direction)??p(e.windDirection)??p(e.wind_direction)??s.direction,u=m(e.units),d=p(u?.temperature)??p(n?.unit)??p(e.unit)??`F`,f=p(u?.speed)??p(e.windUnit)??p(e.wind_unit),h=_(e.hourly).map((e,t)=>({id:p(e.id)??String(t),time:p(e.time)??``,icon:p(e.icon)??p(e.condition)??`cloud.fill`,temp:v(e.tempC)??v(e.temp)??v(e.temperature),tempC:v(e.tempC)})),g=_([e.forecast,e.daily,e.days].find(Array.isArray)).map((e,t)=>({id:p(e.id)??String(t),day:p(e.day)??p(e.date),dayLabel:p(e.dayLabel)??p(e.date),icon:p(e.icon)??p(e.condition)??`cloud.fill`,low:v(e.low),high:v(e.high),lowC:v(e.lowC),highC:v(e.highC),precip:v(e.precip)??v(e.precipitation)??v(e.precipitationProbability),condition:p(e.condition)}));return{location:t,currentTemp:r,feelsLike:i,condition:a,humidity:o,windSpeed:c,windDirection:l,windUnit:f,unit:d,hourly:h.length>0?h:void 0,forecast:g.length>0?g:void 0}}function E(e){return e*9/5+32}function D(e){return(e-32)*5/9}function O(e,t,n){if(e===void 0)return null;let r=e;return t&&!n&&(r=D(e)),!t&&n&&(r=E(e)),`${Math.round(r)}`}function k(e,t,n){return e.tempC===void 0?e.temp===void 0?null:O(e.temp,t,n):O(e.tempC,!1,n)}function A(e,t,n){return e.lowC===void 0?O(e.low,t,n):O(e.lowC,!1,n)}function j(e,t,n){return e.highC===void 0?O(e.high,t,n):O(e.highC,!1,n)}var M=n();function N({icon:e,size:t=20}){let{icon:n,className:r}=C(e);return(0,M.jsx)(n,{width:t,height:t,className:r})}function P({useFahrenheit:e,onToggle:t}){return(0,M.jsxs)(`div`,{className:`flex overflow-hidden rounded-md border border-[var(--border-element)]`,children:[(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!0),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-[var(--primary-base)] text-[var(--content-inset)]`:`bg-transparent text-[var(--content-quiet)]`),children:`°F`}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>t(!1),className:i(`px-2 py-0.5 text-body-small-default transition-colors`,e?`bg-transparent text-[var(--content-quiet)]`:`bg-[var(--primary-base)] text-[var(--content-inset)]`),children:`°C`})]})}function F({data:e,sourceIsFahrenheit:t,useFahrenheit:n,onToggle:r}){let i=e.location,a=O(e.currentTemp,t,n),s=O(e.feelsLike,t,n),c=n?`F`:`C`,l=e.forecast?.[0],d=l?j(l,t,n):null,f=l?A(l,t,n):null,p=null;return e.windSpeed!==void 0&&(p=`${Math.round(e.windSpeed)} ${e.windUnit??`mph`}`,e.windDirection&&(p=`${e.windDirection} ${p}`)),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i}),a!==null&&(0,M.jsxs)(`div`,{className:`mt-1 text-4xl font-light text-[var(--content-default)]`,children:[a,`°`,c]}),e.condition&&(0,M.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-quiet)]`,children:e.condition})]}),(0,M.jsx)(P,{useFahrenheit:n,onToggle:r})]}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[s!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`Feels like `,s,`°`]}),d!==null&&f!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-quiet)]`,children:[`H:`,d,`° L:`,f,`°`]}),p&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(u,{width:12,height:12}),p]}),e.humidity!==void 0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2 py-0.5 text-label-medium-default text-[var(--content-tertiary)]`,children:[(0,M.jsx)(o,{width:12,height:12}),e.humidity,`%`]})]})]})}function I({hourly:e,sourceIsFahrenheit:t,useFahrenheit:n}){return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex gap-3 overflow-x-auto`,children:e.map((e,r)=>{let i=e.time.toLowerCase()===`now`,a=k(e,t,n);return(0,M.jsxs)(`div`,{className:`flex min-w-[3rem] shrink-0 flex-col items-center gap-1`,children:[(0,M.jsx)(`span`,{className:i?`text-body-small-emphasised text-[var(--content-default)]`:`text-label-medium-default text-[var(--content-quiet)]`,children:i?`Now`:e.time}),(0,M.jsx)(N,{icon:e.icon,size:18}),a!==null&&(0,M.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-default)]`,children:[a,`°`]})]},e.id??r)})})})}function L({forecast:e,currentTemp:t,sourceIsFahrenheit:n,useFahrenheit:r}){let{globalMin:a,globalMax:o}=(0,y.useMemo)(()=>{let t=1/0,n=-1/0;for(let r of e){let e=r.lowC??r.low,i=r.highC??r.high;e!==void 0&&e<t&&(t=e),i!==void 0&&i>n&&(n=i)}return{globalMin:t===1/0?0:t,globalMax:n===-1/0?100:n}},[e]),s=o-a||1;return(0,M.jsx)(`div`,{className:`mt-3 border-t border-[var(--border-element)] pt-3`,children:(0,M.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map((e,c)=>{let l=e.dayLabel??e.day??`Day ${c+1}`,u=l.toLowerCase()===`today`,d=A(e,n,r),f=j(e,n,r),p=e.precip,m=e.lowC??e.low??a,h=e.highC??e.high??o,g=(m-a)/s*100,_=(h-a)/s*100,v=Math.max(_-g,2),y=null;if(u&&t!==void 0){let r=(e.lowC!==void 0||e.highC!==void 0)&&n?(t-32)*5/9:t;y=h===m?50:(Math.max(m,Math.min(h,r))-m)/(h-m)*100}return(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:i(`w-12 shrink-0 truncate text-body-small-default`,u?`text-[var(--content-default)]`:`text-[var(--content-quiet)]`),children:l}),(0,M.jsxs)(`div`,{className:`flex w-10 shrink-0 items-center justify-center gap-0.5`,children:[(0,M.jsx)(N,{icon:e.icon,size:16}),p!==void 0&&p>0&&(0,M.jsxs)(`span`,{className:`text-label-small-default text-blue-400`,children:[Math.round(p),`%`]})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-faint)]`,children:d===null?`--`:`${d}°`}),(0,M.jsxs)(`div`,{className:`relative h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--border-subtle)]`,children:[(0,M.jsx)(`div`,{className:`absolute top-0 h-full rounded-full bg-[var(--primary-base)]`,style:{left:`${g}%`,width:`${v}%`}}),y!==null&&(0,M.jsx)(`div`,{className:`absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-[var(--aux-white)] bg-[var(--aux-white)] shadow-sm`,style:{left:`${g+y/100*v}%`}})]}),(0,M.jsx)(`span`,{className:`w-7 shrink-0 text-right text-body-small-default text-[var(--content-default)]`,children:f===null?`--`:`${f}°`})]},e.id??c)})})})}function R({templateData:e,fallback:t}){let n=(0,y.useMemo)(()=>T(e),[e]),r=n?.unit?.toUpperCase()===`F`||n?.unit?.toLowerCase()===`fahrenheit`,[i,a]=(0,y.useState)(null),o=i??r;return!n||n.currentTemp===void 0&&!n.forecast?.length?t??null:(0,M.jsxs)(`div`,{className:`mt-3`,children:[(0,M.jsx)(F,{data:n,sourceIsFahrenheit:r,useFahrenheit:o,onToggle:a}),n.hourly&&n.hourly.length>0&&(0,M.jsx)(I,{hourly:n.hourly,sourceIsFahrenheit:r,useFahrenheit:o}),n.forecast&&n.forecast.length>0&&(0,M.jsx)(L,{forecast:n.forecast,currentTemp:n.currentTemp,sourceIsFahrenheit:r,useFahrenheit:o})]})}export{R as WeatherForecastDisplay};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./dist-DyRKd0bN2.js";import{n}from"./definitions-RERkHOnv.js";function r(e){let t=e.split(`/`).filter(e=>e!==`.`),n=[];return t.forEach(e=>{e===`..`&&n.length>0&&n[n.length-1]!==`..`?n.pop():n.push(e)}),n.join(`/`)}function i(e,t){e=r(e),t=r(t);let n=e.split(`/`),i=t.split(`/`);return e!==t&&n.every((e,t)=>e===i[t])}var a=class r extends e{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME=`Disc`,this._writeCmds=[`add`,`put`,`delete`],this.downloadFile=async e=>{let n=t(e,e.webFetchExtra),r=await fetch(e.url,n),i;if(!e.progress)i=await r.blob();else if(!r?.body)i=new Blob;else{let t=r.body.getReader(),n=0,a=[],o=r.headers.get(`content-type`),s=parseInt(r.headers.get(`content-length`)||`0`,10);for(;;){let{done:r,value:i}=await t.read();if(r)break;a.push(i),n+=i?.length||0;let o={url:e.url,bytes:n,contentLength:s};this.notifyListeners(`progress`,o)}let c=new Uint8Array(n),l=0;for(let e of a)e!==void 0&&(c.set(e,l),l+=e.length);i=new Blob([c.buffer],{type:o||void 0})}return{path:(await this.writeFile({path:e.path,directory:e.directory??void 0,recursive:e.recursive??!1,data:i})).uri,blob:i}}}readFileInChunks(e,t){throw this.unavailable(`Method not implemented.`)}async initDb(){if(this._db!==void 0)return this._db;if(!(`indexedDB`in window))throw this.unavailable(`This browser doesn't support IndexedDB`);return new Promise((e,t)=>{let n=indexedDB.open(this.DB_NAME,this.DB_VERSION);n.onupgradeneeded=r.doUpgrade,n.onsuccess=()=>{this._db=n.result,e(n.result)},n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`db blocked`)}})}static doUpgrade(e){let t=e.target.result;switch(e.oldVersion){default:t.objectStoreNames.contains(`FileStorage`)&&t.deleteObjectStore(`FileStorage`),t.createObjectStore(`FileStorage`,{keyPath:`path`}).createIndex(`by_folder`,`folder`)}}async dbRequest(e,t){let n=this._writeCmds.indexOf(e)===-1?`readonly`:`readwrite`;return this.initDb().then(r=>new Promise((i,a)=>{let o=r.transaction([`FileStorage`],n).objectStore(`FileStorage`)[e](...t);o.onsuccess=()=>i(o.result),o.onerror=()=>a(o.error)}))}async dbIndexRequest(e,t,n){let r=this._writeCmds.indexOf(t)===-1?`readonly`:`readwrite`;return this.initDb().then(i=>new Promise((a,o)=>{let s=i.transaction([`FileStorage`],r).objectStore(`FileStorage`).index(e)[t](...n);s.onsuccess=()=>a(s.result),s.onerror=()=>o(s.error)}))}getPath(e,t){let n=t===void 0?``:t.replace(/^[/]+|[/]+$/g,``),r=``;return e!==void 0&&(r+=`/`+e),t!==``&&(r+=`/`+n),r}async clear(){(await this.initDb()).transaction([`FileStorage`],`readwrite`).objectStore(`FileStorage`).clear()}async readFile(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0)throw Error(`File does not exist.`);return{data:n.content?n.content:``}}async writeFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=e.recursive,a=await this.dbRequest(`get`,[t]);if(a&&a.type===`directory`)throw Error(`The supplied path is a directory.`);let o=t.substr(0,t.lastIndexOf(`/`));if(await this.dbRequest(`get`,[o])===void 0){let t=o.indexOf(`/`,1);if(t!==-1){let n=o.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:i})}}if(!r&&!(n instanceof Blob)&&(n=n.indexOf(`,`)>=0?n.split(`,`)[1]:n,!this.isBase64String(n)))throw Error(`The supplied data is not valid base64 content.`);let s=Date.now(),c={path:t,folder:o,type:`file`,size:n instanceof Blob?n.size:n.length,ctime:s,mtime:s,content:n};return await this.dbRequest(`put`,[c]),{uri:c.path}}async appendFile(e){let t=this.getPath(e.directory,e.path),n=e.data,r=e.encoding,i=t.substr(0,t.lastIndexOf(`/`)),a=Date.now(),o=a,s=await this.dbRequest(`get`,[t]);if(s&&s.type===`directory`)throw Error(`The supplied path is a directory.`);if(await this.dbRequest(`get`,[i])===void 0){let t=i.indexOf(`/`,1);if(t!==-1){let n=i.substr(t);await this.mkdir({path:n,directory:e.directory,recursive:!0})}}if(!r&&!this.isBase64String(n))throw Error(`The supplied data is not valid base64 content.`);if(s!==void 0){if(s.content instanceof Blob)throw Error(`The occupied entry contains a Blob object which cannot be appended to.`);n=s.content!==void 0&&!r?btoa(atob(s.content)+atob(n)):s.content+n,o=s.ctime}let c={path:t,folder:i,type:`file`,size:n.length,ctime:o,mtime:a,content:n};await this.dbRequest(`put`,[c])}async deleteFile(e){let t=this.getPath(e.directory,e.path);if(await this.dbRequest(`get`,[t])===void 0)throw Error(`File does not exist.`);if((await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)])).length!==0)throw Error(`Folder is not empty.`);await this.dbRequest(`delete`,[t])}async mkdir(e){let t=this.getPath(e.directory,e.path),n=e.recursive,r=t.substr(0,t.lastIndexOf(`/`)),i=(t.match(/\//g)||[]).length,a=await this.dbRequest(`get`,[r]),o=await this.dbRequest(`get`,[t]);if(i===1)throw Error(`Cannot create Root directory`);if(o!==void 0)throw Error(`Current directory does already exist.`);if(!n&&i!==2&&a===void 0)throw Error(`Parent directory must exist`);if(n&&i!==2&&a===void 0){let t=r.substr(r.indexOf(`/`,1));await this.mkdir({path:t,directory:e.directory,recursive:n})}let s=Date.now(),c={path:t,folder:r,type:`directory`,size:0,ctime:s,mtime:s};await this.dbRequest(`put`,[c])}async rmdir(e){let{path:t,directory:n,recursive:r}=e,i=this.getPath(n,t),a=await this.dbRequest(`get`,[i]);if(a===void 0)throw Error(`Folder does not exist.`);if(a.type!==`directory`)throw Error(`Requested path is not a directory`);let o=await this.readdir({path:t,directory:n});if(o.files.length!==0&&!r)throw Error(`Folder is not empty`);for(let e of o.files){let i=`${t}/${e.name}`;(await this.stat({path:i,directory:n})).type===`file`?await this.deleteFile({path:i,directory:n}):await this.rmdir({path:i,directory:n,recursive:r})}await this.dbRequest(`delete`,[i])}async readdir(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(e.path!==``&&n===void 0)throw Error(`Folder does not exist.`);let r=await this.dbIndexRequest(`by_folder`,`getAllKeys`,[IDBKeyRange.only(t)]);return{files:await Promise.all(r.map(async e=>{let n=await this.dbRequest(`get`,[e]);return n===void 0&&(n=await this.dbRequest(`get`,[e+`/`])),{name:e.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}))}}async getUri(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);return n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),{uri:n?.path||t}}async stat(e){let t=this.getPath(e.directory,e.path),n=await this.dbRequest(`get`,[t]);if(n===void 0&&(n=await this.dbRequest(`get`,[t+`/`])),n===void 0)throw Error(`Entry does not exist.`);return{name:n.path.substring(t.length+1),type:n.type,size:n.size,ctime:n.ctime,mtime:n.mtime,uri:n.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:`granted`}}async checkPermissions(){return{publicStorage:`granted`}}async _copy(e,t=!1){let{toDirectory:r}=e,{to:a,from:o,directory:s}=e;if(!a||!o)throw Error(`Both to and from must be provided`);r||=s;let c=this.getPath(s,o),l=this.getPath(r,a);if(c===l)return{uri:l};if(i(c,l))throw Error(`To path cannot contain the from path`);let u;try{u=await this.stat({path:a,directory:r})}catch{let e=a.split(`/`);e.pop();let t=e.join(`/`);if(e.length>0&&(await this.stat({path:t,directory:r})).type!==`directory`)throw Error(`Parent directory of the to path is a file`)}if(u&&u.type===`directory`)throw Error(`Cannot overwrite a directory with a file`);let d=await this.stat({path:o,directory:s}),f=async(e,t,n)=>{let i=this.getPath(r,e),a=await this.dbRequest(`get`,[i]);a.ctime=t,a.mtime=n,await this.dbRequest(`put`,[a])},p=d.ctime?d.ctime:Date.now();switch(d.type){case`file`:{let e=await this.readFile({path:o,directory:s});t&&await this.deleteFile({path:o,directory:s});let i;!(e.data instanceof Blob)&&!this.isBase64String(e.data)&&(i=n.UTF8);let c=await this.writeFile({path:a,directory:r,data:e.data,encoding:i});return t&&await f(a,p,d.mtime),c}case`directory`:{if(u)throw Error(`Cannot move a directory over an existing object`);try{await this.mkdir({path:a,directory:r,recursive:!1}),t&&await f(a,p,d.mtime)}catch{}let e=(await this.readdir({path:o,directory:s})).files;for(let n of e)await this._copy({from:`${o}/${n.name}`,to:`${a}/${n.name}`,directory:s,toDirectory:r},t);t&&await this.rmdir({path:o,directory:s})}}return{uri:l}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}};a._debug=!0;export{a as FilesystemWeb};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";function t(){let e=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,t=`unknown`,n=e?e.type||e.effectiveType:null;if(n&&typeof n==`string`)switch(n){case`bluetooth`:case`cellular`:t=`cellular`;break;case`none`:t=`none`;break;case`ethernet`:case`wifi`:case`wimax`:t=`wifi`;break;case`other`:case`unknown`:t=`unknown`;break;case`slow-2g`:case`2g`:case`3g`:t=`cellular`;break;case`4g`:t=`wifi`;break;default:break}return t}var n=class extends e{constructor(){super(),this.handleOnline=()=>{let e={connected:!0,connectionType:t()};this.notifyListeners(`networkStatusChange`,e)},this.handleOffline=()=>{this.notifyListeners(`networkStatusChange`,{connected:!1,connectionType:`none`})},typeof window<`u`&&(window.addEventListener(`online`,this.handleOnline),window.addEventListener(`offline`,this.handleOffline))}async getStatus(){if(!window.navigator)throw this.unavailable(`Browser does not support the Network Information API`);let e=window.navigator.onLine,n=t();return{connected:e,connectionType:e?n:`none`}}};new n;export{n as NetworkWeb};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";import{n as t,t as n}from"./definitions-EvNC1i1H.js";var r=class extends e{constructor(){super(...arguments),this.selectionStarted=!1}async impact(e){let t=this.patternForImpact(e?.style);this.vibrateWithPattern(t)}async notification(e){let t=this.patternForNotification(e?.type);this.vibrateWithPattern(t)}async vibrate(e){let t=e?.duration||300;this.vibrateWithPattern([t])}async selectionStart(){this.selectionStarted=!0}async selectionChanged(){this.selectionStarted&&this.vibrateWithPattern([70])}async selectionEnd(){this.selectionStarted=!1}patternForImpact(e=n.Heavy){return e===n.Medium?[43]:e===n.Light?[20]:[61]}patternForNotification(e=t.Success){return e===t.Warning?[30,40,30,50,60]:e===t.Error?[27,45,50]:[35,65,21]}vibrateWithPattern(e){if(navigator.vibrate)navigator.vibrate(e);else throw this.unavailable(`Browser does not support the vibrate API`)}};export{r as HapticsWeb};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{constructor(){super(),this.handleVisibilityChange=()=>{let e={isActive:document.hidden!==!0};this.notifyListeners(`appStateChange`,e),document.hidden?this.notifyListeners(`pause`,null):this.notifyListeners(`resume`,null)},document.addEventListener(`visibilitychange`,this.handleVisibilityChange,!1)}exitApp(){throw this.unimplemented(`Not implemented on web.`)}async getInfo(){throw this.unimplemented(`Not implemented on web.`)}async getLaunchUrl(){return{url:``}}async getState(){return{isActive:document.hidden!==!0}}async minimizeApp(){throw this.unimplemented(`Not implemented on web.`)}async toggleBackButtonHandler(){throw this.unimplemented(`Not implemented on web.`)}async getAppLanguage(){return{value:navigator.language.split(`-`)[0].toLowerCase()}}};export{t as AppWeb};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{async canShare(){return typeof navigator>`u`||!navigator.share?{value:!1}:{value:!0}}async share(e){if(typeof navigator>`u`||!navigator.share)throw this.unavailable(`Share API not available in this browser`);return await navigator.share({title:e.title,text:e.text,url:e.url}),{}}};export{t as ShareWeb};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{async getSafeAreaInsets(){return{insets:{top:0,left:0,right:0,bottom:0}}}async getStatusBarHeight(){return{statusBarHeight:0}}setImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}unsetImmersiveNavigationBar(){throw this.unimplemented(`Method not supported on Web.`)}};export{t as SafeAreaWeb};
@@ -0,0 +1 @@
1
+ import{n as e}from"./dist-DyRKd0bN2.js";var t=class extends e{constructor(){super(),this._lastWindow=null}async open(e){this._lastWindow=window.open(e.url,e.windowName||`_blank`)}async close(){return new Promise((e,t)=>{this._lastWindow==null?t(`No active window to close!`):(this._lastWindow.close(),this._lastWindow=null,e())})}};new t;export{t as BrowserWeb};
@@ -1 +1 @@
1
- import{t as e}from"./button-amTXFI-2.js";import{d as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{u as r}from"./local-mode-Bskd5bsT.js";import{c as i}from"./routes-BXlWEOF0.js";import{t as a}from"./use-onboarding-login-BHrngniO.js";import{on as o}from"./index-B4Qq7TL7.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
1
+ import{t as e}from"./button-BQVYX8n_.js";import{u as t}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{l as r}from"./local-mode-Dydd46cS.js";import{c as i}from"./routes-GPGveWZ8.js";import{t as a}from"./use-onboarding-login-DCGylk8M.js";import{pn as o}from"./index-D_wKh03d.js";var s=n();function c(){let n=t(),{loading:c,error:l,login:u,cancel:d}=a();return(0,s.jsx)(o,{children:(0,s.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 text-[var(--content-default)]`,children:(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,s.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Welcome to Vellum`}),(0,s.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Your own personal intelligence is just a step away.`}),l&&(0,s.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:l}),(0,s.jsxs)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,s.jsx)(e,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:c?d:()=>void u(),children:c?`Cancel`:`Log In`}),(0,s.jsx)(e,{variant:`ghost`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{c&&d(),r()?n(i.selectAssistant):n(i.onboarding.hosting)},children:`Continue without account`})]})]})})})}export{c as WelcomeScreen};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-Cqi8q9o7.js";import{t as a}from"./arrow-left-C2re-gYj.js";import{n as o,r as s,t as c}from"./metric-card-ClJWxxPO.js";import{t as l}from"./ban-Bvfp1f1I.js";import{t as u}from"./chevron-right-DDgSinGu.js";import{t as d}from"./circle-check-DWe3QGcN.js";import{t as f}from"./triangle-alert-CnjNKhNx.js";import{t as p}from"./x-BYcSiJRX.js";import"./src-yyUuGOWG.js";import{n as m,r as h,t as g}from"./workflow-status-PqQ1OqJN.js";import{t as _}from"./proxy-B6mdWM9d.js";import{t as v}from"./AnimatePresence-DqW6iWlh.js";import{t as y}from"./use-reduced-motion-ztQz2c8x.js";import{t as b}from"./three-dot-indicator-DNuHHwtA.js";import{Ii as x,Ni as S,Ui as C,Wa as w,ft as T,pt as E,ut as D}from"./index-D_wKh03d.js";import{t as O}from"./status-badge-pill-0N6rTEBg.js";var k=e(t(),1),A=r();function j({onClick:e,ariaLabel:t}){return(0,A.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e,className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:[(0,A.jsx)(C,{className:`h-3 w-3`,fill:`currentColor`}),(0,A.jsx)(i,{variant:`label-small-default`,children:`Stop`})]})}function M({title:e,body:t,emptyText:n}){return(0,A.jsxs)(`div`,{className:`mb-5`,children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:e}),t?(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:t}):(0,A.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]})}function N({leaf:e}){let t=e.status===`running`?`Running…`:`No result summary`;return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(w,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens??0,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens??0,format:e=>o(Math.round(e)),label:`Output`})]}),(0,A.jsx)(M,{title:`Prompt`,body:e.promptSummary,emptyText:`No prompt summary`}),(0,A.jsx)(M,{title:`Result`,body:e.resultSummary,emptyText:t})]})}function P({status:e}){return(0,A.jsx)(O,{color:m(e),label:h(e)})}function F(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:return`var(--system-negative-strong)`;case`cancelled`:return`var(--content-secondary)`;default:return`var(--primary-base)`}}function I(e){switch(e){case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Running`}}function L({status:e}){return(0,A.jsx)(O,{color:F(e),label:I(e)})}function R({status:e}){let t=y(),n=`h-3.5 w-3.5 shrink-0`,r;return r=e===`running`?(0,A.jsx)(b,{className:`shrink-0`,dotSize:4,gap:2}):e===`completed`?(0,A.jsx)(d,{className:n,style:{color:`var(--system-positive-strong)`}}):e===`failed`?(0,A.jsx)(f,{className:n,style:{color:`var(--system-negative-strong)`}}):(0,A.jsx)(l,{className:n,style:{color:`var(--content-secondary)`},role:`img`,"aria-label":`Cancelled`}),(0,A.jsx)(v,{mode:`wait`,initial:!1,children:(0,A.jsx)(_.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:t?{duration:0}:{duration:.15,ease:[.16,1,.3,1]},className:`flex shrink-0 items-center`,children:r},e)})}function z({runId:e,leaf:t,components:n,onSelect:r}){let a=t.label??`Subagent ${t.seq}`,o=t.promptSummary,s=D(`${e}:${t.seq}`);return(0,A.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Open ${a} details`,className:`flex w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] px-2 py-1.5 text-left transition-colors hover:bg-[var(--surface-overlay)]`,children:(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(R,{status:t.status}),n?(0,A.jsx)(E,{components:n,bodyShapeId:s.bodyShape,eyeStyleId:s.eyeStyle,colorId:s.color,size:16}):(0,A.jsx)(`div`,{style:{width:16,height:16,flexShrink:0},"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-medium-default`,title:a,className:`max-w-[60%] shrink-0 truncate text-[var(--content-default)]`,children:a}),o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)] opacity-10`,children:`|`}),(0,A.jsx)(i,{variant:`body-medium-lighter`,title:o,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:o})]})]})})}function B({entry:e,onClose:t,onStop:r,onRequestJournal:l}){let d=g(e.status),f=y(),m=e.label??e.runId,h=e.agentsSpawned||e.leaves.size,v=T(),b=[...e.leaves.values()].sort((e,t)=>e.seq-t.seq),[C,O]=(0,k.useState)(null),[M,F]=(0,k.useState)(e.runId);M!==e.runId&&(F(e.runId),O(null));let I=C==null?void 0:e.leaves.get(C),R=I?D(`${e.runId}:${I.seq}`):void 0,B=(0,k.useCallback)(()=>O(null),[]),V=I?I.label??`Subagent ${I.seq}`:``,H=I?V:m,U=d?`live`:`final`;return(0,k.useEffect)(()=>{l?.(e.runId)},[e.runId,U,l]),(0,A.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[I&&(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:B,title:m,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,children:m})}),(0,A.jsx)(u,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,A.jsx)(i,{variant:`body-small-default`,as:`span`,title:V,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:V})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[I&&(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(a,{}),onClick:B,"aria-label":`Back to subagents`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),I?v&&R?(0,A.jsx)(E,{components:v,bodyShapeId:R.bodyShape,eyeStyleId:R.eyeStyle,colorId:R.color,size:32}):(0,A.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}):(0,A.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] bg-[var(--surface-overlay)]`,children:(0,A.jsx)(S,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})}),(0,A.jsx)(i,{variant:`title-medium`,title:H,className:`min-w-0 shrink truncate text-[var(--content-default)]`,children:H}),I?(0,A.jsx)(L,{status:I.status}):(0,A.jsx)(P,{status:e.status}),(0,A.jsx)(`span`,{className:`flex-1`}),d&&r&&(0,A.jsx)(j,{onClick:()=>r(e.runId),ariaLabel:`Stop workflow`}),(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(p,{}),onClick:t,"aria-label":`Close workflow detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,A.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:(0,A.jsx)(_.div,{initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:I?(0,A.jsx)(N,{leaf:I}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`mb-5 grid grid-cols-3 gap-3`,children:[(0,A.jsx)(c,{icon:(0,A.jsx)(w,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>o(Math.round(e)),label:`Input`}),(0,A.jsx)(c,{icon:(0,A.jsx)(s,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>o(Math.round(e)),label:`Output`}),(0,A.jsx)(c,{icon:(0,A.jsx)(x,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:h,format:e=>o(Math.round(e)),label:`Agents`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Subagents`}),b.length===0?(0,A.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No subagents yet`}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1`,children:b.map(t=>(0,A.jsx)(z,{runId:e.runId,leaf:t,components:v,onSelect:()=>O(t.seq)},t.seq))})]})]})},I?String(I.seq):`list`)})]})}export{B as WorkflowDetailPanel};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{t as l}from"./createLucideIcon-Bjb-Kuq7.js";import{t as u}from"./chevron-down-DwIPfcCg.js";import{t as d}from"./chevron-right-DDgSinGu.js";import{t as f}from"./menu-B672pBEP.js";import{t as p}from"./download-B6XjnEzx.js";import{t as m}from"./eye-off-BQ9J3pF2.js";import{t as h}from"./eye-C2rSrbD-.js";import{t as g}from"./file-text-DA128T4K.js";import{t as _}from"./file-C8pjlmtk.js";import{t as v}from"./folder-open-7DKBH5WB.js";import{t as y}from"./loader-circle-C9QrtO3C.js";import{t as b}from"./pencil-BOTCmXXR.js";import{t as x}from"./plus-D54jrPDF.js";import{t as S}from"./x-BYcSiJRX.js";import{O as C}from"./src-yyUuGOWG.js";import{t as w}from"./input-6HVXMszw.js";import{t as T}from"./modal-bIQsMU63.js";import{n as E,t as D}from"./panel-item-CegzTp_l.js";import{t as O}from"./confirm-dialog-kE8y7s20.js";import{n as k,t as A}from"./file-markdown-CIujEAvN.js";import{Ar as j,Ir as M,Lr as ee,Mr as N,Nr as te,Pr as P,jr as F}from"./sdk.gen-C9GJEKYV.js";import{n as I}from"./native-file-kVcoTiGR.js";import{Ca as L,Fi as R,Fr as z,Sa as B,Yi as ne,ya as V,zi as H}from"./index-D_wKh03d.js";import{t as U}from"./use-active-assistant-id-DwLFgABu.js";import{n as W,t as re}from"./mobile-sidebar-drawer-jzcdwotk.js";import{i as G,n as ie,r as K,t as q}from"./file-editor-zaQWhFtF.js";import{t as J}from"./format-file-size-DOE-vGl6.js";var ae=l(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),oe=l(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),Y=l(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),X=e(t(),1);async function se(e){let{data:t,error:n}=await F({path:{assistant_id:e.assistantId},query:{path:e.path,...e.showHidden?{showHidden:`true`}:{}},parseAs:`blob`,throwOnError:!1});if(n||!(t instanceof Blob))throw Error(`Failed to download file`);await I(t,e.filename)}function ce(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function le(e,t){return ce(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function ue(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function de(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Z=s();function fe(e){let{assistantId:t,path:n,name:r,showHidden:i}=e,[a,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(!1);return{isDownloading:a,error:s,download:(0,X.useCallback)(async()=>{c(!1),o(!0);try{await se({assistantId:t,path:n,filename:r,showHidden:i})}catch{c(!0)}finally{o(!1)}},[t,n,r,i])}}function pe({assistantId:e,path:t,name:r,showHidden:i}){let{isDownloading:a,error:o,download:s}=fe({assistantId:e,path:t,name:r,showHidden:i});return(0,Z.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:a?(0,Z.jsx)(y,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(p,{"aria-hidden":!0}),onClick:()=>void s(),disabled:a,"aria-label":`Download ${r}`,tooltip:o?`Download failed. Try again.`:`Download`})}function me(e){return c({queryFn:async()=>{let{data:t,error:n}=await N({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function he({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=g;return n.startsWith(`image/`)?r=V:n.startsWith(`video/`)?r=R:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=_),(0,Z.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Z.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function ge({viewMode:e,onChange:t}){return(0,Z.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Z.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function Q({name:e,mimeType:t,size:n,rightContent:r}){return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(he,{mimeType:t}),(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:J(n)})]}),r]})}function _e({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await F({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,X.useState)(null);return(0,X.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Z.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function ve({assistantId:e,path:t,name:r,mimeType:i,size:a,modifiedAt:o,showHidden:s}){let{isDownloading:c,error:l,download:u}=fe({assistantId:e,path:t,name:r,showHidden:s});return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:r,mimeType:i,size:a}),(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Z.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Z.jsx)(_,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Z.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:r}),(0,Z.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:i}),(0,Z.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:J(a,`Unknown size`)}),o&&(0,Z.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(o).toLocaleString()]})]}),(0,Z.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:c?(0,Z.jsx)(y,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(p,{"aria-hidden":!0}),onClick:u,disabled:c,"aria-label":`Download ${r}`,className:`mt-4`,children:c?`Downloading…`:`Download`}),l&&(0,Z.jsx)(`p`,{className:`mt-2 text-body-small-default`,style:{color:`var(--system-error)`},children:`Download failed. Try again.`})]})})]})}function ye({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...me({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,X.useState)(null),[_,b]=(0,X.useState)(null);(0,X.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),b(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,X.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),b(e=>e!=null&&t(e.path)?null:e)},[d]);let x=h!=null&&h===t,S=p?.content??``,C=_?.path===t?_.content:S,w=()=>{g(null),b(null)},T=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await ee({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),b(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=C!==S,D=(0,X.useCallback)(()=>{t&&E&&!T.isPending&&T.mutate({path:t,content:C})},[t,E,T,C]);if(!t)return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Z.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Z.jsx)(v,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(y,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,j=p.name??t.split(`/`).pop()??t,M=k(j,O),N=le(j,O),te=p.content!=null&&!M&&!N,P=t?de(t):!0,F=x&&(0,Z.jsx)(ie,{isDirty:E,isSaving:T.isPending,error:T.isError?`Save failed`:null,onSave:D,onDiscard:w});if(M&&p.content!=null){let e=x?C:p.content;return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:j,mimeType:O,rightContent:(0,Z.jsx)(ge,{viewMode:s,onChange:e=>{x&&w(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:e,fileName:j,mimeType:O,showEdit:!P&&s===`source`,isEditing:x,onToggleEdit:()=>x?w():g(t)}),s===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(A,{content:e})}):x?(0,Z.jsx)(K,{value:C,onChange:e=>b({path:t,content:e}),onSave:D}):(0,Z.jsx)(G,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}if(N&&p.content!=null){let e=x?C:p.content,n=ue(e);return(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:j,mimeType:O,rightContent:(0,Z.jsx)(ge,{viewMode:s,onChange:e=>{x&&w(),c(e)}})}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:s===`preview`?n:e,downloadContent:e,fileName:j,mimeType:O,showEdit:!P&&s===`source`,isEditing:x,onToggleEdit:()=>x?w():g(t)}),s===`preview`?(0,Z.jsx)(G,{content:n,readOnly:!0,whiteSpace:`pre`}):x?(0,Z.jsx)(K,{value:C,onChange:e=>b({path:t,content:e}),onSave:D}):(0,Z.jsx)(G,{content:p.content,readOnly:P,onStartEdit:()=>g(t)})]}),F]})}return te?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:j,mimeType:O,size:p.size}),(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(q,{content:x?C:p.content??``,fileName:j,mimeType:O,showEdit:!P,isEditing:x,onToggleEdit:()=>x?w():g(t)}),x?(0,Z.jsx)(K,{value:C,onChange:e=>b({path:t,content:e}),onSave:D}):(0,Z.jsx)(G,{content:p.content??``,readOnly:P,onStartEdit:()=>g(t)})]}),F]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsx)(Q,{name:j,mimeType:O,size:p.size,rightContent:(0,Z.jsx)(pe,{assistantId:e,path:t,name:j,showHidden:r})}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Z.jsx)(_e,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Z.jsx)(ve,{assistantId:e,path:t,name:j,mimeType:O,size:p.size,modifiedAt:p.modifiedAt,showHidden:r})}function be(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function xe(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await M({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function Se(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await M({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function Ce({entry:e}){return e.type===`directory`?(0,Z.jsx)(B,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Z.jsx)(V,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Z.jsx)(R,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(g,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function we({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:f,onRequestRename:p,onRequestCreate:m,depth:h}){let g=e.path??``,_=e.name??``,v=e.type===`directory`,y=n.has(g),x=r===g,S=_.startsWith(`.`),w=!de(g),T=v&&(y||s.length>0),{data:E}=a({...xe({path:{assistant_id:t},query:{path:g,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&T}),D=(0,X.useMemo)(()=>be(E?.entries??[],o),[E?.entries,o]),O=s===``||_.toLowerCase().includes(s);if(s!==``&&!v&&!O)return null;let k=(0,Z.jsxs)(`button`,{onClick:()=>{v?c(g):l(g)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${h*14+8}px`,paddingRight:`8px`,color:x?`var(--content-default)`:S?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:x?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:S&&!x?.7:1},children:[v?T?(0,Z.jsx)(u,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(d,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Z.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Z.jsx)(Ce,{entry:e}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:_}),e.size!=null&&(0,Z.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:J(e.size)})]});return(0,Z.jsxs)(`div`,{children:[w?(0,Z.jsxs)(C.Root,{children:[(0,Z.jsx)(C.Trigger,{children:k}),(0,Z.jsxs)(C.Content,{children:[v&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(C.Item,{leftIcon:(0,Z.jsx)(L,{className:`h-3.5 w-3.5`}),onSelect:()=>m({kind:`file`,parentPath:g}),children:`New File`}),(0,Z.jsx)(C.Item,{leftIcon:(0,Z.jsx)(Y,{className:`h-3.5 w-3.5`}),onSelect:()=>m({kind:`folder`,parentPath:g}),children:`New Folder`}),(0,Z.jsx)(C.Separator,{})]}),(0,Z.jsx)(C.Item,{leftIcon:(0,Z.jsx)(H,{className:`h-3.5 w-3.5`}),onSelect:()=>f({path:g,name:_,isDirectory:v}),children:`Delete`}),(0,Z.jsx)(C.Item,{leftIcon:(0,Z.jsx)(b,{className:`h-3.5 w-3.5`}),onSelect:()=>p({path:g,name:_,isDirectory:v}),children:`Rename`})]})]}):k,v&&T&&D.length>0&&(0,Z.jsx)(`div`,{children:D.map(e=>(0,Z.jsx)(we,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:f,onRequestRename:p,onRequestCreate:m,depth:h+1},e.path))})]})}function $({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,X.useRef)(null),[d,f]=(0,X.useState)(a??``),p=d.trim(),m=p.length>0&&(/[/\\]/.test(p)||p===`.`||p===`..`),h=p.length>0&&!m&&!c;return(0,Z.jsx)(T.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Z.jsx)(T.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Z.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h&&s(p)},children:[(0,Z.jsx)(T.Header,{children:(0,Z.jsx)(T.Title,{children:e})}),(0,Z.jsx)(T.Body,{children:(0,Z.jsx)(w,{ref:u,label:`Name`,value:d,onChange:e=>f(e.target.value),placeholder:t,errorText:l??(m?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Z.jsxs)(T.Footer,{children:[(0,Z.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,disabled:!h,children:c?i:r})]})]})})})}function Te({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:d,onToggleShowHidden:f,onChangeSortMode:p,onPathDeleted:g,onPathRenamed:_}){let v=i(),[y,b]=(0,X.useState)(``),x=y.trim().toLowerCase(),[C,T]=(0,X.useState)(!1),[E,D]=(0,X.useState)(null),[k,A]=(0,X.useState)(null),M=(0,X.useCallback)(()=>{D(null),A(null)},[]),{data:N,isLoading:F}=a(xe({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),I=(0,X.useMemo)(()=>be(N?.entries??[],c),[N?.entries,c]),L=(0,X.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),R=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await Se(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await ee({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await te({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{M(),L(),e.parentPath&&u(e.parentPath),e.kind===`file`?d(e.path):u(e.path)},onError:e=>{A(e instanceof Error?e.message:`Failed to create.`)}}),z=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await Se(e,r,t.newName,i);let{error:o,response:s}=await P({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{M(),L(),_(e,t)},onError:e=>{A(e instanceof Error?e.message:`Failed to rename.`)}}),B=(0,X.useCallback)(e=>{A(null),D({type:`create`,...e})},[]),V=(0,X.useCallback)(e=>{A(null),D({type:`rename`,path:e.path,name:e.name})},[]),[H,U]=(0,X.useState)(null),W=o({mutationFn:async t=>{let{error:n,response:r}=await j({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{U(null),L(),g(e.path)}}),re=(0,X.useCallback)(e=>{W.reset(),U(e)},[W]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Z.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Z.jsx)(oe,{"aria-hidden":!0}):(0,Z.jsx)(ae,{"aria-hidden":!0}),onClick:()=>p(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Z.jsx)(h,{"aria-hidden":!0}):(0,Z.jsx)(m,{"aria-hidden":!0}),onClick:f,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Z.jsx)(Ee,{open:C,onOpenChange:T,onSelectKind:e=>{T(!1),B({kind:e,parentPath:``})}})]})]}),(0,Z.jsx)(`div`,{className:`px-3 py-2`,children:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(w,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Search files`,leftIcon:(0,Z.jsx)(ne,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(S,{"aria-hidden":!0}),onClick:()=>b(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:F?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):I.length?I.map(n=>(0,Z.jsx)(we,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:x,onToggleExpand:l,onSelectPath:d,onRequestDelete:re,onRequestRename:V,onRequestCreate:B,depth:0},n.path)):(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),E?.type===`create`&&(0,Z.jsx)($,{title:E.kind===`file`?`New File`:`New Folder`,placeholder:E.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:M,onConfirm:e=>{A(null),R.mutate({kind:E.kind,parentPath:E.parentPath,name:e})},pending:R.isPending,error:k},`create-${E.kind}-${E.parentPath}`),E?.type===`rename`&&(0,Z.jsx)($,{title:`Rename`,placeholder:E.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:E.name,onCancel:M,onConfirm:e=>{if(e===E.name){M();return}A(null),z.mutate({oldPath:E.path,newName:e})},pending:z.isPending,error:k},`rename-${E.path}`),(0,Z.jsx)(O,{open:H!==null,title:H?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Z.jsxs)(Z.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Z.jsx)(`span`,{style:{color:`var(--content-default)`},children:H?.name}),H?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,W.error&&(0,Z.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:W.error.message})]}),confirmLabel:W.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:W.isPending,onConfirm:()=>{H&&W.mutate(H)},onCancel:()=>U(null)})]})}function Ee({open:e,onOpenChange:t,onSelectKind:r}){return z()?(0,Z.jsxs)(E.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(E.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(x,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(E.Content,{children:[(0,Z.jsx)(E.Header,{className:`sr-only`,children:(0,Z.jsx)(E.Title,{children:`Create new`})}),(0,Z.jsxs)(E.Body,{className:`pt-0`,children:[(0,Z.jsx)(D,{icon:L,label:`New File`,onSelect:()=>r(`file`)}),(0,Z.jsx)(D,{icon:Y,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Z.jsxs)(f.Root,{open:e,onOpenChange:t,children:[(0,Z.jsx)(f.Trigger,{asChild:!0,children:(0,Z.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(x,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Z.jsxs)(f.Content,{align:`end`,sideOffset:4,children:[(0,Z.jsx)(f.Item,{leftIcon:(0,Z.jsx)(L,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Z.jsx)(f.Item,{leftIcon:(0,Z.jsx)(Y,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function De(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Oe({assistantId:e}){let[t,n]=r(),[i,a]=(0,X.useState)(()=>{let e=t.get(`file`);return e?De(e):new Set}),[o,s]=(0,X.useState)(()=>t.get(`file`)),[c,l]=(0,X.useState)(!1),[u,d]=(0,X.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,X.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,X.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,X.useState)(!1),v=(0,X.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,X.useState)(null),x=(0,X.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,X.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,X.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Z.jsx)(W,{onClick:()=>_(!0)})}),(0,Z.jsx)(re,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Z.jsx)(Te,{...w})}),(0,Z.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Z.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Z.jsx)(Te,{...w})}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Z.jsx)(ye,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function ke(){return(0,Z.jsx)(Oe,{assistantId:U()})}export{ke as WorkspacePage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-Bjb-Kuq7.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};