@vellumai/web 0.11.2-dev.202608052357.8f326c2 → 0.11.2-dev.202608060103.4220693

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 (385) hide show
  1. package/dist/assets/{AnimatePresence-DYJ0_Bk3.js → AnimatePresence-DWbwz63e.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-V0d2zlXh.js → BundleConfirmPage-Cv_SyFEc.js} +1 -1
  3. package/dist/assets/{a2a-invite-Dy2RjOoo.js → a2a-invite-npRWB8T7.js} +1 -1
  4. package/dist/assets/{about-page-o0ZAOc3y.js → about-page-hRb6IdZ6.js} +1 -1
  5. package/dist/assets/access-B_Ue5hNP.js +1 -0
  6. package/dist/assets/{account-page-zmcxwVNJ.js → account-page-rU59Ep-O.js} +1 -1
  7. package/dist/assets/{acp-run-actions--5dlWIAm.js → acp-run-actions-0FzwGnnE.js} +1 -1
  8. package/dist/assets/{acp-run-detail-panel-nE9gCu7R.js → acp-run-detail-panel-C7AiCtNZ.js} +1 -1
  9. package/dist/assets/{acp-run-store-f3ZZ5vfh.js → acp-run-store-ZJ3pQsPd.js} +1 -1
  10. package/dist/assets/{activity-steps-panel-DdYYfC2l.js → activity-steps-panel-DKyW17XO.js} +1 -1
  11. package/dist/assets/{add-credential-modal-BbhS-t6m.js → add-credential-modal-ww82xtd5.js} +1 -1
  12. package/dist/assets/{add-credits-modal-CYs7jy2D.js → add-credits-modal-Dl_bKM3Q.js} +1 -1
  13. package/dist/assets/ai-page-y46TT6JI.js +1 -0
  14. package/dist/assets/{animate-BbrG8x9N.js → animate-CIunG13_.js} +1 -1
  15. package/dist/assets/{animated-avatar-DGpGKFC7.js → animated-avatar-CkKsoJMb.js} +1 -1
  16. package/dist/assets/{api-BZiTnGI9.js → api-CLTOqpKy.js} +1 -1
  17. package/dist/assets/{api-key-screen-Cp16QzTQ.js → api-key-screen-LlB7j08t.js} +1 -1
  18. package/dist/assets/{app-card-B2vj9GXs.js → app-card-ZXFRFBcf.js} +1 -1
  19. package/dist/assets/{archive-redirect-page-C36pNQ-4.js → archive-redirect-page-Dk-p7Ppj.js} +1 -1
  20. package/dist/assets/{assistant-feature-flag-store-DpUzSkiR.js → assistant-feature-flag-store-nGq3QVIl.js} +1 -1
  21. package/dist/assets/{assistant-status-panel-BXVSfnLt.js → assistant-status-panel-DI1HlJ6j.js} +1 -1
  22. package/dist/assets/{auth-store-DdDbthYF.js → auth-store-yJCo67Ft.js} +2 -2
  23. package/dist/assets/{avatar-random-BUcaogCN.js → avatar-random-NCfHkbtN.js} +1 -1
  24. package/dist/assets/{avatar-renderer-gGO0o7tZ.js → avatar-renderer-BnZamcjg.js} +1 -1
  25. package/dist/assets/{background-task-actions-C_JwuCkY.js → background-task-actions-DmNzdvaq.js} +1 -1
  26. package/dist/assets/{background-task-detail-panel-BbaPGJoC.js → background-task-detail-panel-Dp8WOL06.js} +1 -1
  27. package/dist/assets/{background-task-store-DBkMeElr.js → background-task-store-CrpkniEd.js} +1 -1
  28. package/dist/assets/{billing-page-BQKDplqv.js → billing-page-DlN9B56K.js} +3 -3
  29. package/dist/assets/billing-redirect-page-CSu1FlJL.js +1 -0
  30. package/dist/assets/{bookmarks-page-BBH6Gf3t.js → bookmarks-page-D9YwTFUh.js} +1 -1
  31. package/dist/assets/{browser-ClzlwMbU.js → browser-CznuGKM_.js} +2 -2
  32. package/dist/assets/{build-state-BJDQ-YYL.js → build-state-D4lD_ket.js} +1 -1
  33. package/dist/assets/{capture-error-D12Gu3Tx.js → capture-error-CLK3mZbB.js} +1 -1
  34. package/dist/assets/channels-page-route-Yhu3bFhL.js +9 -0
  35. package/dist/assets/{chat-avatar-DJKAfDJW.js → chat-avatar-DMmOr7G8.js} +1 -1
  36. package/dist/assets/{chat-markdown-message-DevkcKV1.js → chat-markdown-message-DGCgFO5P.js} +1 -1
  37. package/dist/assets/checkout-continuation-DuI7aHL-.js +1 -0
  38. package/dist/assets/{checkout-page-BoSIk5E1.js → checkout-page-CaZG3rjJ.js} +1 -1
  39. package/dist/assets/checkout-return-target-B-4YwlMB.js +1 -0
  40. package/dist/assets/{chunk-5KNZJZUH-Bsoom5--.js → chunk-5KNZJZUH-BUqIilZr.js} +1 -1
  41. package/dist/assets/{client-feature-flag-store-DujD6DL8.js → client-feature-flag-store-Be2Bcoa4.js} +1 -1
  42. package/dist/assets/{client-perf-BQG-cDA6.js → client-perf-Dp789Y5h.js} +1 -1
  43. package/dist/assets/{command-palette-BjQmg4u3.js → command-palette-CS_ZYr0l.js} +1 -1
  44. package/dist/assets/{command-palette-window-page-Bh5JBEN2.js → command-palette-window-page-CQb4dEi7.js} +1 -1
  45. package/dist/assets/{community-page-D7sws6nB.js → community-page-DAQjyJJK.js} +1 -1
  46. package/dist/assets/composer-settings-CNahnA2B.js +1 -0
  47. package/dist/assets/{connect-page-yTCV6KgZ.js → connect-page-BF8WrZq-.js} +1 -1
  48. package/dist/assets/consent-CJiaRrLf.js +1 -0
  49. package/dist/assets/{consent-controls-Ca5P3pZJ.js → consent-controls-CaN2Gttg.js} +1 -1
  50. package/dist/assets/{contacts-gateway-Dml5USpK.js → contacts-gateway-By_Btrsw.js} +1 -1
  51. package/dist/assets/{contacts-page-route-CHSZkgkU.js → contacts-page-route-CbHU-EQc.js} +1 -1
  52. package/dist/assets/{conversation-cache-DTVC-Arz.js → conversation-cache-BYs_C4Yj.js} +1 -1
  53. package/dist/assets/{conversation-list-fetchers-Cy2nJwv8.js → conversation-list-fetchers-B7M3yXWV.js} +1 -1
  54. package/dist/assets/{conversation-navigation-B7szrewA.js → conversation-navigation-DPr01vn2.js} +1 -1
  55. package/dist/assets/{conversation-queries-DwmulZxd.js → conversation-queries-BQ7nQXqx.js} +1 -1
  56. package/dist/assets/{copy-to-clipboard-BEBr95IB.js → copy-to-clipboard-CQJcUXdW.js} +1 -1
  57. package/dist/assets/{credential-entry-page-FuE6-zNw.js → credential-entry-page-CSWso2wX.js} +1 -1
  58. package/dist/assets/{credentials-page-DzV9oaKW.js → credentials-page-BV8RQev9.js} +1 -1
  59. package/dist/assets/{csv-preview-7mqc3Fpi.js → csv-preview-CyGRy8K8.js} +1 -1
  60. package/dist/assets/danger-zone-redirect-page-CFK3VVwE.js +1 -0
  61. package/dist/assets/{debug-page-BUFQrhk9.js → debug-page-Cjx1dxF5.js} +3 -3
  62. package/dist/assets/{deploy-dialogs-DHZF_N1t.js → deploy-dialogs-C4Lt-LEQ.js} +1 -1
  63. package/dist/assets/{deploy-store-Cn2kzFjI.js → deploy-store-DQkouuXb.js} +1 -1
  64. package/dist/assets/{developer-page-ODCd-KTH.js → developer-page-C5vbsJfn.js} +1 -1
  65. package/dist/assets/devices-redirect-page-DXes8aFC.js +1 -0
  66. package/dist/assets/{diagnostics-nTyAMjUF.js → diagnostics-hPu9iAWg.js} +1 -1
  67. package/dist/assets/{doctor-handoff-store-DdvRRI2J.js → doctor-handoff-store-Daf9oYZh.js} +1 -1
  68. package/dist/assets/{document-viewer-container-BKy-UjK2.js → document-viewer-container-_Z_ikRNx.js} +2 -2
  69. package/dist/assets/{document-viewer-page-Ctf4nXBK.js → document-viewer-page-wPKsWx-u.js} +1 -1
  70. package/dist/assets/effective-timezone-C3ee9H8L.js +1 -0
  71. package/dist/assets/{emails-page-MceQy_js.js → emails-page-BaL0Gi14.js} +1 -1
  72. package/dist/assets/{esm-CqfO9db_.js → esm-9PqBbUDe.js} +1 -1
  73. package/dist/assets/esm-B6zo3CQA.js +2 -0
  74. package/dist/assets/esm-B7HOz9Vp.js +1 -0
  75. package/dist/assets/esm-Bn_ZQSoT.js +2 -0
  76. package/dist/assets/esm-CE_pqlu2.js +2 -0
  77. package/dist/assets/{esm-B7MuL-rP.js → esm-CEyQep_q.js} +2 -2
  78. package/dist/assets/esm-CyxUuGX2.js +2 -0
  79. package/dist/assets/{esm-DapZX4Er.js → esm-DQyPAJ_S.js} +2 -2
  80. package/dist/assets/esm-ngCHCeWb.js +2 -0
  81. package/dist/assets/feature-flag-catalog-yngFrLFx.js +1 -0
  82. package/dist/assets/{file-editor-BmO5Abo9.js → file-editor-SB9y-5W2.js} +1 -1
  83. package/dist/assets/{first-run-scope-BpHkv5-k.js → first-run-scope-DErtOVg1.js} +1 -1
  84. package/dist/assets/{funnel-events-B9V_t5b_.js → funnel-events-DU8Lfoo_.js} +1 -1
  85. package/dist/assets/general-page-BHBYhrzn.js +1 -0
  86. package/dist/assets/{get-memory-stats-u6Hkt6fb.js → get-memory-stats-BMwyBfNa.js} +1 -1
  87. package/dist/assets/{haptics-Cl5TawvV.js → haptics-_9L_Cv_T.js} +2 -2
  88. package/dist/assets/{hatching-screen-mLb6zwUy.js → hatching-screen-BJrbqjWQ.js} +1 -1
  89. package/dist/assets/home-page-route-C8zaluY1.js +1 -0
  90. package/dist/assets/{hosting-screen-CcFpirzp.js → hosting-screen-CYsh4b19.js} +1 -1
  91. package/dist/assets/identity-c5s4yEox.js +1 -0
  92. package/dist/assets/{identity-page-route-BkgW24iD.js → identity-page-route-CONBFidZ.js} +1 -1
  93. package/dist/assets/index-A5kIIzqv.css +2 -0
  94. package/dist/assets/index-CeDA4Czb.js +11 -0
  95. package/dist/assets/{ingest-ChZcuVfN.js → ingest-ClEOo73s.js} +1 -1
  96. package/dist/assets/{inspect-page-C-MJ0ito.js → inspect-page-DyIkp-Nv.js} +4 -4
  97. package/dist/assets/{installed-plugins-query-BKLXToLk.js → installed-plugins-query-Dg7Fv93O.js} +1 -1
  98. package/dist/assets/{integration-icon-B2RF_VOY.js → integration-icon-CEj6of8V.js} +1 -1
  99. package/dist/assets/{integrations-page-B_74E_Fd.js → integrations-page-B7KYrsyd.js} +1 -1
  100. package/dist/assets/intelligence-layout-UE877t_c.js +1 -0
  101. package/dist/assets/{invalidate-memory-queries-m_zGW-Q9.js → invalidate-memory-queries-Ca6PUbmc.js} +1 -1
  102. package/dist/assets/{invalidate-plugin-queries-DAB1Z6NN.js → invalidate-plugin-queries-D30ce-Jg.js} +1 -1
  103. package/dist/assets/{keyboard-shortcuts-redirect-page-C0HtU0RJ.js → keyboard-shortcuts-redirect-page-CZxTQRNH.js} +1 -1
  104. package/dist/assets/{latest-assistant-text-CaoU8FYd.js → latest-assistant-text-B43DzLWc.js} +2 -2
  105. package/dist/assets/library-detail-page-BnhhhhyJ.js +1 -0
  106. package/dist/assets/{library-page-Cd47VDSq.js → library-page-BXQkXsxP.js} +1 -1
  107. package/dist/assets/{local-runtime-upgrade-nlaSDUtF.js → local-runtime-upgrade-CceHhh6f.js} +1 -1
  108. package/dist/assets/{login-flow-DeZ70QTo.js → login-flow-BUNWXcNa.js} +1 -1
  109. package/dist/assets/{login-page-ftZku03X.js → login-page-PQRFn3rm.js} +1 -1
  110. package/dist/assets/{logout-page-CWaACcpx.js → logout-page-CESAS4DQ.js} +1 -1
  111. package/dist/assets/logs-layout-CGiYBnFO.js +1 -0
  112. package/dist/assets/{media-preview-BpeDmKF8.js → media-preview-BWdX5lS7.js} +1 -1
  113. package/dist/assets/{memory-page-route-DfuDoYds.js → memory-page-route-2Cma24hj.js} +1 -1
  114. package/dist/assets/{memory-router-playground-page-BlHH40vr.js → memory-router-playground-page-CYD71b4s.js} +1 -1
  115. package/dist/assets/{message-files-panel-BStPDOo7.js → message-files-panel-BRqZjnPD.js} +1 -1
  116. package/dist/assets/{messages-DSRCvBha.js → messages-DojCvU26.js} +2 -2
  117. package/dist/assets/{metric-card-BCoLjski.js → metric-card-DnC-1uuK.js} +1 -1
  118. package/dist/assets/{mobile-sidebar-drawer-s6V18lAy.js → mobile-sidebar-drawer-Dp5_aFN3.js} +1 -1
  119. package/dist/assets/native-anchor-CFfv7Lkj.js +1 -0
  120. package/dist/assets/{native-file-BTjo719k.js → native-file-DaKTgR3O.js} +2 -2
  121. package/dist/assets/{navigation-resolver-BI9CCnQV.js → navigation-resolver-Ds8ceOlG.js} +1 -1
  122. package/dist/assets/{not-found-DvATDBn3.js → not-found-BHDAdK3g.js} +1 -1
  123. package/dist/assets/{notifications-BNNniftN.js → notifications-TG_4MvAx.js} +1 -1
  124. package/dist/assets/{notifications-page-BXgWsNWZ.js → notifications-page-Bnm4dPGF.js} +1 -1
  125. package/dist/assets/{oauth-complete-page-BtAOD5L_.js → oauth-complete-page-Da73jaDM.js} +1 -1
  126. package/dist/assets/{oauth-connection-utils-DLsnIBSh.js → oauth-connection-utils-BL8Q9wJd.js} +1 -1
  127. package/dist/assets/{oauth-popup-complete-page-BOhgbJpy.js → oauth-popup-complete-page-CMvANBBE.js} +1 -1
  128. package/dist/assets/{onboarding-layout-CERIZpQl.js → onboarding-layout--6YxmafB.js} +1 -1
  129. package/dist/assets/open-workspace-file-QoJwG6Ds.js +2 -0
  130. package/dist/assets/page-empty-state-Dmdlh7uu.js +1 -0
  131. package/dist/assets/{pairing-page-6hmn5AYC.js → pairing-page-DTjE_tSM.js} +1 -1
  132. package/dist/assets/password-reset-page-BdlNdDQg.js +1 -0
  133. package/dist/assets/{pdf-file-preview-lOeUDEY0.js → pdf-file-preview-89b8qqVs.js} +1 -1
  134. package/dist/assets/{pdf-preview-BeENvA7P.js → pdf-preview-DZZbSdA7.js} +2 -2
  135. package/dist/assets/{personality-page-C0CReo9V.js → personality-page-CDh_Z1Cy.js} +1 -1
  136. package/dist/assets/{plans-page-Ck20BasF.js → plans-page-CIwBMAZR.js} +1 -1
  137. package/dist/assets/{platform-detection-DYmzJ4FF.js → platform-detection-BKTsihBH.js} +1 -1
  138. package/dist/assets/{platform-login-notice-Yp_hMgyp.js → platform-login-notice-vVKxIiV2.js} +1 -1
  139. package/dist/assets/{platform-loopback-page-89WqXrdG.js → platform-loopback-page-CEwdrDn1.js} +1 -1
  140. package/dist/assets/plugin-detail-page-DpseogSx.js +1 -0
  141. package/dist/assets/plugins-page-DDmvxFFS.js +1 -0
  142. package/dist/assets/plugins-surface-CaIiLzzm.js +1 -0
  143. package/dist/assets/{prefs-BmjzWWYT.js → prefs-CwHnuat1.js} +1 -1
  144. package/dist/assets/{privacy-page-zFSqTAHT.js → privacy-page-FYHEwm8H.js} +1 -1
  145. package/dist/assets/{privacy-screen-CqzLuKiV.js → privacy-screen-BDtb8Z8c.js} +1 -1
  146. package/dist/assets/profile-pickers-CkwsV2EJ.js +1 -0
  147. package/dist/assets/{provider-callback-page-BBPnh2gJ.js → provider-callback-page-CnGtNu6u.js} +1 -1
  148. package/dist/assets/{provider-key-DttR9fDs.js → provider-key-CWXP_f5f.js} +1 -1
  149. package/dist/assets/{provider-signup-page-DZ823j_9.js → provider-signup-page-WEe359_N.js} +1 -1
  150. package/dist/assets/{provisioning-targets-D0PQtccl.js → provisioning-targets-P0R2EB_9.js} +1 -1
  151. package/dist/assets/{push-registration-0aiPM4d0.js → push-registration-B-Tti9tl.js} +2 -2
  152. package/dist/assets/{quick-input-page-QikxtuDe.js → quick-input-page-CJTRL6h3.js} +1 -1
  153. package/dist/assets/react-query.gen-QJi0b_h4.js +1 -0
  154. package/dist/assets/{react-query.gen-BtWMgf9p.js → react-query.gen-grRlE5uB.js} +1 -1
  155. package/dist/assets/{remove-from-device-dialog-DBILBvV0.js → remove-from-device-dialog-7iSfORoW.js} +1 -1
  156. package/dist/assets/{research-facts-BElRDNOP.js → research-facts-vZynfVok.js} +1 -1
  157. package/dist/assets/research-mock-page-B13FZzn6.js +1 -0
  158. package/dist/assets/research-onboarding-route-xp1cUmlM.js +50 -0
  159. package/dist/assets/{research-results-view-BKwsYc2G.js → research-results-view-D_ykt7SS.js} +1 -1
  160. package/dist/assets/{retire-confirm-dialog-DfJA3gNk.js → retire-confirm-dialog-Dfuz5NOi.js} +1 -1
  161. package/dist/assets/{review-terms-screen-Bo4aycGM.js → review-terms-screen-CEgjzIVP.js} +1 -1
  162. package/dist/assets/routes-D8noUpsz.js +23 -0
  163. package/dist/assets/{runtime-upgrade-banner-BRvb-9hm.js → runtime-upgrade-banner-CrwkNLWP.js} +2 -2
  164. package/dist/assets/schedules-B8i7MULW.js +1 -0
  165. package/dist/assets/{schedules-pP64xy_x.js → schedules-CEgBfnsj.js} +1 -1
  166. package/dist/assets/schedules-page-C6i3Vjr9.js +1 -0
  167. package/dist/assets/{sdk.gen-C98zmHHo.js → sdk.gen-CKpIiJ5f.js} +1 -1
  168. package/dist/assets/{sdk.gen-Dy1Bb8sS.js → sdk.gen-DQRCDUdg.js} +1 -1
  169. package/dist/assets/security-redirect-page-C89ep7IW.js +1 -0
  170. package/dist/assets/{select-assistant-screen-CvvpOL2u.js → select-assistant-screen-Ct2AME6M.js} +1 -1
  171. package/dist/assets/{settings-layout-DEgmXMTX.js → settings-layout-_OcOGyAN.js} +1 -1
  172. package/dist/assets/{settings-navigation-DPsn_RTW.js → settings-navigation-Dkim4ZoK.js} +1 -1
  173. package/dist/assets/{share-feedback-modal-C_ZkzHm2.js → share-feedback-modal-BOlCj7yr.js} +2 -2
  174. package/dist/assets/sidebar-tree-CMxE1yEd.js +1 -0
  175. package/dist/assets/{signup-page-DxZiLp7V.js → signup-page-Bo74ROdV.js} +1 -1
  176. package/dist/assets/{signup-shell-n2TrmmNi.js → signup-shell-DQoX-73u.js} +1 -1
  177. package/dist/assets/{site-favicon-BSqLa8lz.js → site-favicon-DVzLsoJw.js} +1 -1
  178. package/dist/assets/{skill-detail-page-CGyTfXe8.js → skill-detail-page-CyiOvB9n.js} +1 -1
  179. package/dist/assets/{skill-detail-panel-B_2mjYWv.js → skill-detail-panel-BPUvso1T.js} +1 -1
  180. package/dist/assets/{skills-nff5m6-i.js → skills-DZWNP26E.js} +1 -1
  181. package/dist/assets/{skills-page-Cg0SE0ee.js → skills-page-D-fcQW4c.js} +1 -1
  182. package/dist/assets/{sound-manager-C-FXxZhq.js → sound-manager-Cq4A5SDr.js} +1 -1
  183. package/dist/assets/{sounds-page-3pvZOfIz.js → sounds-page-DnbVAnre.js} +1 -1
  184. package/dist/assets/{start-screen-CdccEBwy.js → start-screen-BkGPVlos.js} +1 -1
  185. package/dist/assets/stt-language-picker-modal-B5QNaSCc.js +1 -0
  186. package/dist/assets/{subagent-detail-panel-DeRDJ-VG.js → subagent-detail-panel-CW3N1NCe.js} +1 -1
  187. package/dist/assets/{subagent-store-UWGCr-h3.js → subagent-store-Cj427eeR.js} +2 -2
  188. package/dist/assets/superpowers-page-eRqGZ5a8.js +1 -0
  189. package/dist/assets/{system-events-page-Bllpsp0u.js → system-events-page-LEwN8Ee8.js} +1 -1
  190. package/dist/assets/system-events-redirect-page-CiEQe9RX.js +1 -0
  191. package/dist/assets/telegram-setup-wizard-BV5sMCQl.js +1 -0
  192. package/dist/assets/{text-preview-B1W0_cdn.js → text-preview-DL9s6lUj.js} +1 -1
  193. package/dist/assets/{theme-stage-page-CRk2Sgds.js → theme-stage-page-DsM27Jla.js} +1 -1
  194. package/dist/assets/{threshold-presets-CQ7vI-Wq.js → threshold-presets-GDGwZUm7.js} +1 -1
  195. package/dist/assets/{tool-detail-panel-C1IqMEUv.js → tool-detail-panel-DCaHM-Nm.js} +1 -1
  196. package/dist/assets/{transcript-message-body-shared-ERITbUZZ.js → transcript-message-body-shared-B6C7du2c.js} +1 -1
  197. package/dist/assets/{trust-rules-api-B4g_XMAO.js → trust-rules-api-CxwmfvzE.js} +1 -1
  198. package/dist/assets/{upgrade-cancel-page-k1leC3hj.js → upgrade-cancel-page-B7bNua92.js} +1 -1
  199. package/dist/assets/{upgrade-success-page-C3br3mG9.js → upgrade-success-page-C4jd_Q9N.js} +1 -1
  200. package/dist/assets/{usage-redirect-page-OIC-6zlT.js → usage-redirect-page-DcAqaSTp.js} +1 -1
  201. package/dist/assets/{use-app-theme-BAGQ6WMq.js → use-app-theme-BFLF2YL6.js} +1 -1
  202. package/dist/assets/{use-assistant-avatar-CqTCEKcn.js → use-assistant-avatar-38mC0Jkv.js} +1 -1
  203. package/dist/assets/{use-assistant-capability-Dm1PUYwx.js → use-assistant-capability-BIcubtqW.js} +1 -1
  204. package/dist/assets/{use-assistant-identity-details--OUcPeMf.js → use-assistant-identity-details-LHcvF2pd.js} +1 -1
  205. package/dist/assets/{use-attachment-preview-BysA1ZwF.js → use-attachment-preview-CkHH2Ibf.js} +2 -2
  206. package/dist/assets/{use-attachment-squares-7NCLpWYL.js → use-attachment-squares-BIoIxAC3.js} +1 -1
  207. package/dist/assets/{use-avatar-accent-var-CUL1kls8.js → use-avatar-accent-var-DpG_e3Ig.js} +1 -1
  208. package/dist/assets/{use-bookmarks-D6oT8l4M.js → use-bookmarks-CTX3ihK4.js} +1 -1
  209. package/dist/assets/{use-bundled-avatar-components-BzgMHQcH.js → use-bundled-avatar-components-DjSw8dxI.js} +2 -2
  210. package/dist/assets/{use-bus-subscription-B-nzwF5c.js → use-bus-subscription-DZIrGVaz.js} +1 -1
  211. package/dist/assets/{use-checkout-dismiss-refresh-BGLPMzPo.js → use-checkout-dismiss-refresh-DhMQaZbX.js} +1 -1
  212. package/dist/assets/{use-command-palette-sections-DB63pgj1.js → use-command-palette-sections-BFfAPsT2.js} +1 -1
  213. package/dist/assets/use-copy-to-clipboard-Vm59v8pw.js +1 -0
  214. package/dist/assets/{use-edge-swipe-wUWOTDoJ.js → use-edge-swipe-C4BaeDYx.js} +1 -1
  215. package/dist/assets/use-edge-swipe-back-CxuFGO_k.js +2 -0
  216. package/dist/assets/{use-edit-app-B3laUpVt.js → use-edit-app-DGFgkIZN.js} +1 -1
  217. package/dist/assets/{use-effective-timezone-DixfAba2.js → use-effective-timezone-CXih69xh.js} +1 -1
  218. package/dist/assets/use-invite-link-dialog-CDoO5BPb.js +1 -0
  219. package/dist/assets/{use-is-org-ready-CfDbFeAv.js → use-is-org-ready-DIEDh69N.js} +1 -1
  220. package/dist/assets/{use-local-file-info-BhIb0tEw.js → use-local-file-info-BcTbepp1.js} +1 -1
  221. package/dist/assets/{use-onboarding-login-1UX8kr3n.js → use-onboarding-login-BENHRpJ7.js} +1 -1
  222. package/dist/assets/{use-platform-assistant-id-qcKyh7TU.js → use-platform-assistant-id-Csyov1YH.js} +1 -1
  223. package/dist/assets/{use-platform-gate-qZiW_iTu.js → use-platform-gate-DJ160Mvd.js} +1 -1
  224. package/dist/assets/{use-reduced-motion-Blpe7z4_.js → use-reduced-motion-CznEG-5y.js} +1 -1
  225. package/dist/assets/{use-return-to-short-circuit-BvEg4Txy.js → use-return-to-short-circuit-Cg2bldG7.js} +1 -1
  226. package/dist/assets/{use-save-twilio-credentials-D2l1lp1p.js → use-save-twilio-credentials-CGA34Sa5.js} +1 -1
  227. package/dist/assets/{use-skill-actions-CcRCA1k1.js → use-skill-actions-B0uS20FJ.js} +1 -1
  228. package/dist/assets/{use-skill-detail-files-CQ-WJaPl.js → use-skill-detail-files-DvxYWyLX.js} +1 -1
  229. package/dist/assets/use-sticky-profiles-D9xXeLvn.js +1 -0
  230. package/dist/assets/{use-subagent-card-data-2GHHTAqT.js → use-subagent-card-data-Bd1Q-MOQ.js} +1 -1
  231. package/dist/assets/{use-supports-bookmarks-sSuQiAsQ.js → use-supports-bookmarks-BvltjXLg.js} +1 -1
  232. package/dist/assets/use-supports-credentials-settings-IbwcPuoW.js +1 -0
  233. package/dist/assets/use-supports-schedule-profile-moves-D0HqbPCI.js +1 -0
  234. package/dist/assets/{use-swipe-engine--jntXWQT.js → use-swipe-engine-VZ15d2Yh.js} +1 -1
  235. package/dist/assets/{use-transcript-message-by-id-BctuW5bg.js → use-transcript-message-by-id-CYZWKZcl.js} +1 -1
  236. package/dist/assets/{use-transcript-messages-DiLp1UeC.js → use-transcript-messages-D5ch_Ony.js} +1 -1
  237. package/dist/assets/{use-voice-sample-preview-CFI53zHg.js → use-voice-sample-preview-Ck14EXPC.js} +1 -1
  238. package/dist/assets/{utils-CThlho72.js → utils-BXGlUlmA.js} +1 -1
  239. package/dist/assets/{utils-DxLFleDu.js → utils-BdO654SM.js} +1 -1
  240. package/dist/assets/{viewer-store-CYKZPTWC.js → viewer-store-BoPrn0gS.js} +1 -1
  241. package/dist/assets/voice-list-Gt_3WbZK.js +1 -0
  242. package/dist/assets/voice-page-E9C6zWRG.js +1 -0
  243. package/dist/assets/{voice-providers-note-Bg251cVL.js → voice-providers-note-CQ6hfyoG.js} +1 -1
  244. package/dist/assets/{weather-forecast-display-CR94vzni.js → weather-forecast-display-C60AEmxC.js} +1 -1
  245. package/dist/assets/{web-CavEjEDK.js → web-BEj_1I2l.js} +1 -1
  246. package/dist/assets/{web-BAiU3nLP.js → web-BVyOjKIj.js} +1 -1
  247. package/dist/assets/{web-DQIhUgWF.js → web-BckRpoMP.js} +1 -1
  248. package/dist/assets/{web-ChyXdfTw.js → web-CsWwP4XM.js} +1 -1
  249. package/dist/assets/{web-BNAi5yfE.js → web-D7ZDDoBb.js} +1 -1
  250. package/dist/assets/{web-DaSPLqzf.js → web-DFwucWcj.js} +1 -1
  251. package/dist/assets/{web-DWXVxiBd.js → web-DVXuH5_T.js} +1 -1
  252. package/dist/assets/{web-D83q0tZf.js → web-mDhR-5R9.js} +1 -1
  253. package/dist/assets/{welcome-screen-BEcYlB0z.js → welcome-screen-CgtjGmgJ.js} +1 -1
  254. package/dist/assets/{workflow-detail-panel-TI-TS9jq.js → workflow-detail-panel-B62fCHXh.js} +1 -1
  255. package/dist/assets/{workflow-store-B9ZU_HIp.js → workflow-store-Byuh_pxH.js} +1 -1
  256. package/dist/assets/{workspace-page-BUc54pAK.js → workspace-page-D6JFTUPG.js} +1 -1
  257. package/dist/assets/{workspace-tree-query-Cp0iX1ma.js → workspace-tree-query-DwyzmMPb.js} +1 -1
  258. package/dist/index.html +168 -167
  259. package/package.json +1 -1
  260. package/dist/assets/access-BAJtFqoe.js +0 -1
  261. package/dist/assets/ai-page-yPnWL7kw.js +0 -1
  262. package/dist/assets/billing-redirect-page-DzD-gw17.js +0 -1
  263. package/dist/assets/channels-page-route-EXwS83J5.js +0 -9
  264. package/dist/assets/checkout-continuation-BosraVBU.js +0 -1
  265. package/dist/assets/checkout-return-target-MgThljBf.js +0 -1
  266. package/dist/assets/composer-settings-BbnL0S4I.js +0 -1
  267. package/dist/assets/consent-eo_quPak.js +0 -1
  268. package/dist/assets/danger-zone-redirect-page-Vw3-xwk_.js +0 -1
  269. package/dist/assets/detail-drawer-DDxwk7rX.js +0 -1
  270. package/dist/assets/devices-redirect-page-BlOdkUC6.js +0 -1
  271. package/dist/assets/effective-timezone-C6X5Vt_s.js +0 -1
  272. package/dist/assets/esm-BLHa6Oh0.js +0 -2
  273. package/dist/assets/esm-BQcyWpvO.js +0 -2
  274. package/dist/assets/esm-B_ye86FS.js +0 -2
  275. package/dist/assets/esm-CAdi-he9.js +0 -2
  276. package/dist/assets/esm-CMO39ZqB.js +0 -2
  277. package/dist/assets/esm-CUQTrpPf.js +0 -1
  278. package/dist/assets/feature-flag-catalog-Cigl5R2_.js +0 -1
  279. package/dist/assets/general-page-C2MVsZ3k.js +0 -1
  280. package/dist/assets/home-page-route-BHA7jsQd.js +0 -1
  281. package/dist/assets/identity-BBf0d0zw.js +0 -1
  282. package/dist/assets/index-CRmMozzF.js +0 -11
  283. package/dist/assets/index-DHvgc0dr.css +0 -2
  284. package/dist/assets/intelligence-layout-Wt4lNkM0.js +0 -1
  285. package/dist/assets/library-detail-page-AetyuTmB.js +0 -1
  286. package/dist/assets/logs-layout-BEMvgQpO.js +0 -1
  287. package/dist/assets/native-anchor-DsUnURX5.js +0 -1
  288. package/dist/assets/open-workspace-file-CwDK0h8m.js +0 -2
  289. package/dist/assets/page-empty-state-DMOmLL3O.js +0 -1
  290. package/dist/assets/password-reset-page-CXDwVi0y.js +0 -1
  291. package/dist/assets/plugin-detail-page-BiQyCyA8.js +0 -1
  292. package/dist/assets/plugins-page-Cye6nA4l.js +0 -1
  293. package/dist/assets/plugins-surface-CLevPrO2.js +0 -1
  294. package/dist/assets/react-query.gen-DYPHpypm.js +0 -1
  295. package/dist/assets/research-mock-page-EmkK1ds5.js +0 -1
  296. package/dist/assets/research-onboarding-route-Cj6dkY7p.js +0 -50
  297. package/dist/assets/routes-D_33mNos.js +0 -23
  298. package/dist/assets/schedules-page-vXi1-n7e.js +0 -1
  299. package/dist/assets/security-redirect-page-CGulxYRa.js +0 -1
  300. package/dist/assets/sidebar-tree-BsBhkWkJ.js +0 -1
  301. package/dist/assets/slack-setup-wizard-CMOfreor.js +0 -1
  302. package/dist/assets/stt-language-picker-modal-DXB-fVhv.js +0 -1
  303. package/dist/assets/superpowers-page-CRoCYmf-.js +0 -1
  304. package/dist/assets/system-events-redirect-page-BNybm4bw.js +0 -1
  305. package/dist/assets/use-copy-to-clipboard-DMV3vpqo.js +0 -1
  306. package/dist/assets/use-edge-swipe-back-DUuGuBql.js +0 -1
  307. package/dist/assets/use-invite-link-dialog-5_6O-4p8.js +0 -1
  308. package/dist/assets/use-sticky-profiles-B3YmizgK.js +0 -1
  309. package/dist/assets/use-supports-credentials-settings-BGk1AxJ5.js +0 -1
  310. package/dist/assets/voice-list-DK2YArAa.js +0 -1
  311. package/dist/assets/voice-page-XqL5BHpr.js +0 -1
  312. /package/dist/assets/{account-shell-a78KDthk.js → account-shell-B766C-4a.js} +0 -0
  313. /package/dist/assets/{android-consumption-only-BhpxWm8b.js → android-consumption-only-DT4SppcW.js} +0 -0
  314. /package/dist/assets/{api-errors-BmlR1gU1.js → api-errors-BOG3VRJr.js} +0 -0
  315. /package/dist/assets/{app-info-CFDDITP8.js → app-info-D-aHGnE-.js} +0 -0
  316. /package/dist/assets/{app-types-BaF0YViN.js → app-types-DyIrz4FQ.js} +0 -0
  317. /package/dist/assets/{apple-logo-QxCmgL_8.js → apple-logo-_x2VgiOh.js} +0 -0
  318. /package/dist/assets/{assistant-identity-store-Dk3c04VV.js → assistant-identity-store-BoDyhR19.js} +0 -0
  319. /package/dist/assets/{avatar-bundled-components-CpUPtepI.js → avatar-bundled-components-CwoY0fNX.js} +0 -0
  320. /package/dist/assets/{avatar-subagent-CODNemgH.js → avatar-subagent-BzM5BMYE.js} +0 -0
  321. /package/dist/assets/{avatar-svg-compositor-HKhsTl-B.js → avatar-svg-compositor-BWsnZx7I.js} +0 -0
  322. /package/dist/assets/{avatar-tone-DJBf2301.js → avatar-tone-Cnko8w64.js} +0 -0
  323. /package/dist/assets/{browser-timezone-CIJphq8z.js → browser-timezone-Bt06ntni.js} +0 -0
  324. /package/dist/assets/{build.umd-kyeWXj1H.js → build.umd-dvcCFbUs.js} +0 -0
  325. /package/dist/assets/{by-tool-use-id-index-BNlydLFB.js → by-tool-use-id-index-CsMrRoeV.js} +0 -0
  326. /package/dist/assets/{chat-qr1cXxyu.js → chat-Bwc_Va4x.js} +0 -0
  327. /package/dist/assets/{chat-layout-slots-store-Df14mWpo.js → chat-layout-slots-store-4BKpWVWP.js} +0 -0
  328. /package/dist/assets/{client.gen-D6PnLgNE.js → client.gen-Cg-qIuO-.js} +0 -0
  329. /package/dist/assets/{conversation-selection-BQ2rwj3i.js → conversation-selection-CxnP6yVT.js} +0 -0
  330. /package/dist/assets/{conversation-store-CRB7YBVE.js → conversation-store-pVTpsull.js} +0 -0
  331. /package/dist/assets/{definitions-CZUniGGZ.js → definitions-BrmGLNnr.js} +0 -0
  332. /package/dist/assets/{definitions-B1ia7l5p.js → definitions-jJpSYzLZ.js} +0 -0
  333. /package/dist/assets/{detail-card-CddOBuqz.js → detail-card-DZdr9B6l.js} +0 -0
  334. /package/dist/assets/{detail-panel-stop-button-DVMJaE8I.js → detail-panel-stop-button--Ed2fhhR.js} +0 -0
  335. /package/dist/assets/{detail-shell-ModH5YJB.js → detail-shell-v2b3dq7m.js} +0 -0
  336. /package/dist/assets/{dictation-overlay-page-B0G77Lxf.js → dictation-overlay-page-B-ZiRDCN.js} +0 -0
  337. /package/dist/assets/{dist-DZjsRBrq.js → dist-CNrbwhjc.js} +0 -0
  338. /package/dist/assets/{domains-B7X7GuQ9.js → domains-tzkSJTqP.js} +0 -0
  339. /package/dist/assets/{edge-swipe-arbiter-store-DIUzg8Po.js → edge-swipe-arbiter-store-lMg00PKF.js} +0 -0
  340. /package/dist/assets/{edit-chat-session-DKHJkqrM.js → edit-chat-session-DV3JHy7m.js} +0 -0
  341. /package/dist/assets/{emoji-catalog-data-wClcJhQd.js → emoji-catalog-data-DFDbUp2o.js} +0 -0
  342. /package/dist/assets/{environment-store-CY9Rnrfi.js → environment-store-BA_V5VmV.js} +0 -0
  343. /package/dist/assets/{event-bus-CnxdyIPs.js → event-bus-CeX18MRG.js} +0 -0
  344. /package/dist/assets/{external-urls-DdNdyTc4.js → external-urls-DjcLrlMy.js} +0 -0
  345. /package/dist/assets/{eye-bbox-CL9fV-US.js → eye-bbox-C3QvquSe.js} +0 -0
  346. /package/dist/assets/{format-date-C_mIPxz2.js → format-date-BVeYupnR.js} +0 -0
  347. /package/dist/assets/{format-file-size-D1khyy5j.js → format-file-size-B3XYXmOC.js} +0 -0
  348. /package/dist/assets/{hard-navigate-DqAmkZZE.js → hard-navigate-9vglJJTR.js} +0 -0
  349. /package/dist/assets/{link-click-DEZzmUsj.js → link-click-CncSkJ2L.js} +0 -0
  350. /package/dist/assets/{machine-sizes-fKP6e9yR.js → machine-sizes-DwjJlMD9.js} +0 -0
  351. /package/dist/assets/{misc-D9--6g1n.js → misc-DkLRKNc9.js} +0 -0
  352. /package/dist/assets/{native-deep-link-CkOwTMxJ.js → native-deep-link-BmW_yAuR.js} +0 -0
  353. /package/dist/assets/{oauth-popup-DEdfcSaL.js → oauth-popup-h31BDZz7.js} +0 -0
  354. /package/dist/assets/{onboarding-step-layout-Cm0PD1db.js → onboarding-step-layout-CsE4NokU.js} +0 -0
  355. /package/dist/assets/{onboarding-store-BllETOYg.js → onboarding-store-CHNXLvVd.js} +0 -0
  356. /package/dist/assets/{optimistic-lifecycle-Zm4t_MWl.js → optimistic-lifecycle-DYPK-Ow7.js} +0 -0
  357. /package/dist/assets/{page-shell-Bp3863gv.js → page-shell-YqKSPkEs.js} +0 -0
  358. /package/dist/assets/{pdf-DxnX6KdC.js → pdf-B5nUFIPr.js} +0 -0
  359. /package/dist/assets/{plugin-attribution-C3Kyge4T.js → plugin-attribution-CqwqgBBt.js} +0 -0
  360. /package/dist/assets/{pointer-Di9xGve4.js → pointer-CbRUenvI.js} +0 -0
  361. /package/dist/assets/{prechat-D0kfFLHe.js → prechat-BhksnvOi.js} +0 -0
  362. /package/dist/assets/{preview-skeleton-Dr_FZPD0.js → preview-skeleton-SOAvtgSp.js} +0 -0
  363. /package/dist/assets/{proxy-lK4w-Bft.js → proxy-CJDjUn7E.js} +0 -0
  364. /package/dist/assets/{public-asset-Di_CM-Tf.js → public-asset-CXfLVmJu.js} +0 -0
  365. /package/dist/assets/{radio-card-nav-DJHt6k5l.js → radio-card-nav-B8eyoVlT.js} +0 -0
  366. /package/dist/assets/{remote-gateway-session-DDEJCVNh.js → remote-gateway-session-Bfkhl-bc.js} +0 -0
  367. /package/dist/assets/{research-onboarding-persistence-BBFfx020.js → research-onboarding-persistence-D4qPVBNx.js} +0 -0
  368. /package/dist/assets/{routes-DOlsNBq5.js → routes-CMywm39M.js} +0 -0
  369. /package/dist/assets/{sandbox-bridge-BNwuZJHp.js → sandbox-bridge-l7hxmFmg.js} +0 -0
  370. /package/dist/assets/{sdk.gen-DGleJJuY.js → sdk.gen-CY1afY_n.js} +0 -0
  371. /package/dist/assets/{semver-BuGHWE9o.js → semver--ZVnl9PA.js} +0 -0
  372. /package/dist/assets/{setting-row-Dgoez0aa.js → setting-row-zsrcjZm0.js} +0 -0
  373. /package/dist/assets/{settings-divider-Dt-OMhiv.js → settings-divider-CV61cc_U.js} +0 -0
  374. /package/dist/assets/{status-badge-pill-D7j-0FLr.js → status-badge-pill-DYBOsHm1.js} +0 -0
  375. /package/dist/assets/{theme-preferences-D7_-kTyl.js → theme-preferences-kKuPtjov.js} +0 -0
  376. /package/dist/assets/{three-dot-indicator-uhGzoECR.js → three-dot-indicator-kyZ3c9IW.js} +0 -0
  377. /package/dist/assets/{tiptap-document-editor-CbjVigqn.js → tiptap-document-editor-BWGVmggP.js} +0 -0
  378. /package/dist/assets/{typed-storage-F5BFQH9m.js → typed-storage-DtnBnJvT.js} +0 -0
  379. /package/dist/assets/{use-active-assistant-id-CJpO2yaM.js → use-active-assistant-id-C-H-Lp7_.js} +0 -0
  380. /package/dist/assets/{use-is-mobile-C0Jx9AxD.js → use-is-mobile-BZEx6kJ_.js} +0 -0
  381. /package/dist/assets/{workflow-status-9khXBfP6.js → workflow-status-KgjQhFZ8.js} +0 -0
  382. /package/dist/assets/{workspace-path-links-C1A7ZMlC.js → workspace-path-links-D6BeIXR9.js} +0 -0
  383. /package/dist/assets/{workspace-theme-tokens-hEF46cJM.js → workspace-theme-tokens-PCjFiNBt.js} +0 -0
  384. /package/dist/assets/{xterm-BNtr7q26.js → xterm-DgDjpthL.js} +0 -0
  385. /package/dist/assets/{xterm-addon-fit-CpLp1hvz.js → xterm-addon-fit-pdbAOgiq.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{H as r,U as i,V as a,W as o,g as s,i as c,r as l}from"./proxy-lK4w-Bft.js";var u=n(),d=e(t(),1);function f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function p(...e){return t=>{let n=!1,r=e.map(e=>{let r=f(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():f(e[t],null)}}}}function m(...e){return d.useCallback(p(...e),e)}var h=class extends d.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(s(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=s(e)&&e.offsetWidth||0,r=s(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function g({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,d.useId)(),s=(0,d.useRef)(null),l=(0,d.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:f}=(0,d.useContext)(c),p=m(s,e.props?.ref??e?.ref);return(0,d.useInsertionEffect)(()=>{let{width:e,height:c,top:u,left:d,right:p,bottom:m,direction:h}=l.current;if(t||a===!1||!s.current||!e||!c)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${u}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);f&&(y.nonce=f);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{H as r,U as i,V as a,W as o,g as s,i as c,r as l}from"./proxy-CJDjUn7E.js";var u=n(),d=e(t(),1);function f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function p(...e){return t=>{let n=!1,r=e.map(e=>{let r=f(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():f(e[t],null)}}}}function m(...e){return d.useCallback(p(...e),e)}var h=class extends d.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(s(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=s(e)&&e.offsetWidth||0,r=s(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function g({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,d.useId)(),s=(0,d.useRef)(null),l=(0,d.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:f}=(0,d.useContext)(c),p=m(s,e.props?.ref??e?.ref);return(0,d.useInsertionEffect)(()=>{let{width:e,height:c,top:u,left:d,right:p,bottom:m,direction:h}=l.current;if(t||a===!1||!s.current||!e||!c)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${u}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);f&&(y.nonce=f);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
2
2
  [data-motion-pop-id="${o}"] {
3
3
  position: absolute !important;
4
4
  width: ${e}px !important;
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./misc-D9--6g1n.js";import{t as i}from"./format-file-size-D1khyy5j.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./misc-DkLRKNc9.js";import{t as i}from"./format-file-size-B3XYXmOC.js";var a=e(t(),1),o=n(),s={verified:{label:`Verified`,className:`bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`},signed:{label:`Signed`,className:`bg-[var(--system-info-weak)] text-[var(--system-info-strong)]`},unsigned:{label:`Unsigned`,className:`bg-[var(--surface-active)] text-[var(--content-secondary)]`},tampered:{label:`Tampered — signature invalid`,className:`bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`}};function c(){let[e,t]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{window.vellum?.bundleConfirm?.getData().then(e=>{e&&t(e)})},[]),!e)return(0,o.jsx)(`div`,{className:`flex h-svh w-screen items-center justify-center bg-background text-muted-foreground select-none`,children:`Loading...`});let{manifest:l,scanResult:u,signatureResult:d,bundleSizeBytes:f}=e,p=s[d.trustTier],m=d.trustTier===`tampered`,h=u.warnings;return(0,o.jsxs)(`div`,{className:`flex h-svh w-screen flex-col bg-background px-6 pt-14 pb-6 text-foreground select-none`,children:[(0,o.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l.icon?(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:l.icon}):(0,o.jsx)(`span`,{className:`text-5xl leading-none`,children:`📦`}),(0,o.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,o.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:l.name}),l.description&&(0,o.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-sm leading-snug`,children:l.description})]})]}),(0,o.jsxs)(`div`,{className:`mt-4 flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:r(`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium`,p.className),children:p.label}),d.trustTier===`signed`&&d.signerDisplayName&&(0,o.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`by `,d.signerDisplayName]})]}),(0,o.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-sm`,children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Size`}),(0,o.jsx)(`dd`,{children:i(f)}),(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Created by`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.created_by}),l.capabilities.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,o.jsx)(`dd`,{className:`truncate`,children:l.capabilities.join(`, `)})]})]}),h.length>0&&(0,o.jsxs)(`div`,{className:`mt-4`,children:[(0,o.jsxs)(`button`,{type:`button`,className:`text-muted-foreground text-xs font-medium hover:underline`,onClick:()=>c(e=>!e),children:[n?`Hide`:`Show`,` Warnings (`,h.length,`)`]}),n&&(0,o.jsx)(`ul`,{className:`mt-1.5 space-y-1 text-xs`,children:h.map((e,t)=>(0,o.jsx)(`li`,{className:`rounded bg-[var(--system-mid-weak)] px-2 py-1 text-[var(--system-mid-strong)]`,children:e},t))})]}),(0,o.jsxs)(`div`,{className:`mt-auto flex items-center justify-end gap-3 pt-4`,children:[(0,o.jsx)(`button`,{type:`button`,className:`rounded-md border border-border px-4 py-1.5 text-sm font-medium text-foreground hover:bg-muted`,onClick:()=>window.vellum?.bundleConfirm?.respond(!1),children:`Cancel`}),(0,o.jsx)(`button`,{type:`button`,className:r(`rounded-md px-4 py-1.5 text-sm font-medium text-white`,m?`bg-red-600 hover:bg-red-700`:`bg-primary hover:bg-primary/90`),onClick:()=>window.vellum?.bundleConfirm?.respond(!0),children:m?`Install Anyway`:`Install`})]})]})}export{c as BundleConfirmPage};
@@ -1 +1 @@
1
- import{d as e}from"./routes-DOlsNBq5.js";function t(t){let n=typeof window<`u`?window.location.origin:``,r=new URLSearchParams({senderAssistantId:t.senderAssistantId,token:t.token});return`${n}${e.connect}?${r.toString()}`}function n(e){let t=e.get(`senderAssistantId`)?.trim(),n=e.get(`token`)?.trim();return!t||!n?null:{senderAssistantId:t,token:n}}export{n,t};
1
+ import{d as e}from"./routes-CMywm39M.js";function t(t){let n=typeof window<`u`?window.location.origin:``,r=new URLSearchParams({senderAssistantId:t.senderAssistantId,token:t.token});return`${n}${e.connect}?${r.toString()}`}function n(e){let t=e.get(`senderAssistantId`)?.trim(),n=e.get(`token`)?.trim();return!t||!n?null:{senderAssistantId:t,token:n}}export{n,t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./is-electron-Djuya72b.js";import{n as i,t as a}from"./app-info-CFDDITP8.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./is-electron-Djuya72b.js";import{n as i,t as a}from"./app-info-D-aHGnE-.js";var o=e(t(),1),s=n();function c(){let[e,t]=(0,o.useState)(null);(0,o.useEffect)(()=>{a().then(t)},[]);let n=e??l;return(0,s.jsxs)(`div`,{className:`flex h-svh w-screen flex-col items-center justify-center bg-background px-8 pt-14 pb-8 text-center text-foreground select-none`,children:[(0,s.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:n.appName}),(0,s.jsx)(`p`,{className:`text-muted-foreground mt-1 mb-7 text-xs`,children:`AI assistant for your Mac`}),(0,s.jsxs)(`dl`,{className:`mb-7 grid grid-cols-[auto_auto] gap-x-4 gap-y-1.5 text-sm`,children:[(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Version`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.version}),(0,s.jsx)(`dt`,{className:`text-muted-foreground text-right`,children:`Build`}),(0,s.jsx)(`dd`,{className:`text-left font-mono tabular-nums select-text`,children:n.commitSha})]}),(0,s.jsx)(`a`,{href:n.website,className:`text-primary text-sm hover:underline`,onClick:e=>{r()&&(e.preventDefault(),i())},children:new URL(n.website).host}),(0,s.jsx)(`div`,{className:`text-muted-foreground mt-auto pt-6 text-[11px]`,children:n.copyright})]})}var l={appName:`Vellum`,version:`—`,commitSha:`—`,copyright:`© ${new Date().getFullYear()} Vellum`,website:`https://vellum.ai`};export{c as AboutPage};
@@ -0,0 +1 @@
1
+ import{n as e}from"./auth-store-yJCo67Ft.js";import{t}from"./assistant-feature-flag-store-nGq3QVIl.js";function n(e,t){return t||e?.isStaff===!0||e?.email?.toLowerCase().endsWith(`@vellum.ai`)===!0}function r(){return n(e.use.user(),t.use.settingsDeveloperNav()===!0)}export{r as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{a as i,n as a,s as o}from"./auth-store-DdDbthYF.js";import{E as s}from"./platform-detection-DYmzJ4FF.js";import{d as c}from"./routes-DOlsNBq5.js";import{t as l}from"./hard-navigate-DqAmkZZE.js";import{n as u,t as d}from"./login-flow-DeZ70QTo.js";import{r as f,t as p}from"./account-shell-a78KDthk.js";var m=e(t(),1),h=r();function g(){let e=i(),t=o(),r=a.use.user(),g=a.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(u,d)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(p,{children:(0,h.jsx)(f,{title:`Loading...`})}):e?(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),l(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:`Sign out`})]})]}):(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{a as i,n as a,s as o}from"./auth-store-yJCo67Ft.js";import{E as s}from"./platform-detection-BKTsihBH.js";import{d as c}from"./routes-CMywm39M.js";import{t as l}from"./hard-navigate-9vglJJTR.js";import{n as u,t as d}from"./login-flow-BUNWXcNa.js";import{r as f,t as p}from"./account-shell-B766C-4a.js";var m=e(t(),1),h=r();function g(){let e=i(),t=o(),r=a.use.user(),g=a.use.logout(),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)(!1),x=async()=>{v(null),b(!0);try{await s(u,d)}catch(e){console.error(`[account] auth flow failed:`,e),v(`Something went wrong. Please try again.`),b(!1)}};return t?(0,h.jsx)(p,{children:(0,h.jsx)(f,{title:`Loading...`})}):e?(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome${r?.username?`, ${r.username}`:``}!`,subtitle:`You are signed in.`}),(0,h.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,h.jsx)(n,{to:c.assistant,className:`inline-flex w-full items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Go to your assistant`}),(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{await g(),l(c.account.login)},className:`cursor-pointer bg-transparent text-sm font-normal text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:`Sign out`})]})]}):(0,h.jsxs)(p,{children:[(0,h.jsx)(f,{title:`Welcome to Vellum`,subtitle:`Sign in to get started.`}),_&&(0,h.jsx)(`p`,{className:`text-center text-sm text-[var(--system-negative-strong)]`,children:_}),(0,h.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,h.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:y,className:`inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:opacity-50`,children:`Sign in`})})]})}export{g as AccountPage};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{t}from"./createLucideIcon-C1mdGPB9.js";import{t as n}from"./code-DoyWcW4T.js";import{n as r}from"./resolved-assistants-store-C1HOW7I-.js";import{Yr as i}from"./sdk.gen-Dy1Bb8sS.js";import{t as a}from"./public-asset-Di_CM-Tf.js";import{r as o}from"./acp-run-store-f3ZZ5vfh.js";var s=t(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),c=t(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),l=t(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),u=e();function d(e){let t=e.toLowerCase();if(t.includes(`claude`))return`/images/prior-assistants/claude.svg`;if(t.includes(`codex`)||t.includes(`openai`)||t.includes(`gpt`))return`/images/prior-assistants/chatgpt.svg`;if(t.includes(`copilot`))return`/images/prior-assistants/copilot.svg`}function f({agent:e,className:t=`h-4 w-4 shrink-0`}){let r=e?d(e):void 0;return r?(0,u.jsx)(`img`,{src:a(r),alt:``,"aria-hidden":!0,"data-testid":`acp-agent-icon-brand`,className:t}):(0,u.jsx)(n,{className:`${t} text-[var(--content-secondary)]`,"aria-hidden":!0})}function p(){let e=r.getState().activeAssistantId;if(!e)throw Error(`No active assistant`);return e}async function m(e){let t=p(),n=o.getState(),r=n.byId[e]?.status;n.cancelRun({acpSessionId:e,completedAt:Date.now()});try{let{response:n}=await i.post({url:`/v1/assistants/{assistant_id}/acp/{id}/cancel`,path:{assistant_id:t,id:e},body:{}});if(!n?.ok)throw Error(`Failed to stop ACP run: ${n?.status}`)}catch(t){throw r!==void 0&&o.getState().restoreRunStatus({acpSessionId:e,status:r}),t}}async function h(e,t){let{data:n,response:r}=await i.post({url:`/v1/assistants/{assistant_id}/acp/{id}/steer`,path:{assistant_id:p(),id:e},body:{instruction:t}});if(!r?.ok)throw Error(`Failed to steer ACP run: ${r?.status}`);return n}export{c as a,l as i,m as n,s as o,f as r,h as t};
1
+ import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{t}from"./createLucideIcon-C1mdGPB9.js";import{t as n}from"./code-DoyWcW4T.js";import{n as r}from"./resolved-assistants-store-C1HOW7I-.js";import{Zr as i}from"./sdk.gen-DQRCDUdg.js";import{t as a}from"./public-asset-CXfLVmJu.js";import{r as o}from"./acp-run-store-ZJ3pQsPd.js";var s=t(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),c=t(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),l=t(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),u=e();function d(e){let t=e.toLowerCase();if(t.includes(`claude`))return`/images/prior-assistants/claude.svg`;if(t.includes(`codex`)||t.includes(`openai`)||t.includes(`gpt`))return`/images/prior-assistants/chatgpt.svg`;if(t.includes(`copilot`))return`/images/prior-assistants/copilot.svg`}function f({agent:e,className:t=`h-4 w-4 shrink-0`}){let r=e?d(e):void 0;return r?(0,u.jsx)(`img`,{src:a(r),alt:``,"aria-hidden":!0,"data-testid":`acp-agent-icon-brand`,className:t}):(0,u.jsx)(n,{className:`${t} text-[var(--content-secondary)]`,"aria-hidden":!0})}function p(){let e=r.getState().activeAssistantId;if(!e)throw Error(`No active assistant`);return e}async function m(e){let t=p(),n=o.getState(),r=n.byId[e]?.status;n.cancelRun({acpSessionId:e,completedAt:Date.now()});try{let{response:n}=await i.post({url:`/v1/assistants/{assistant_id}/acp/{id}/cancel`,path:{assistant_id:t,id:e},body:{}});if(!n?.ok)throw Error(`Failed to stop ACP run: ${n?.status}`)}catch(t){throw r!==void 0&&o.getState().restoreRunStatus({acpSessionId:e,status:r}),t}}async function h(e,t){let{data:n,response:r}=await i.post({url:`/v1/assistants/{assistant_id}/acp/{id}/steer`,path:{assistant_id:p(),id:e},body:{instruction:t}});if(!r?.ok)throw Error(`Failed to steer ACP run: ${r?.status}`);return n}export{c as a,l as i,m as n,s as o,f as r,h as t};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-D12Gu3Tx.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-BENY-yx_.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./typography-BeUa5Fd-.js";import{t as o}from"./createLucideIcon-C1mdGPB9.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./acp-run-actions--5dlWIAm.js";import{t as p}from"./arrow-left-BikDV6F2.js";import{t as m}from"./brain-DPCFa4t_.js";import{t as h}from"./chevron-down-BcYoJcfl.js";import{t as g}from"./chevron-right-BcPFsjC2.js";import{t as _}from"./circle-check-CoU8jUcF.js";import{t as v}from"./circle-minus-DgnvL2Xt.js";import{w as y}from"./menu-DtLdBgbH.js";import{t as b}from"./code-DoyWcW4T.js";import"./src-4DTZIbDU.js";import{t as x}from"./file-text-BWjfiPpo.js";import{t as S}from"./globe-DN9GN4I5.js";import{t as C}from"./chat-markdown-message-DevkcKV1.js";import{t as ee}from"./repeat-DGT4k1Gr.js";import{t as te}from"./search-DZBQ2Z4C.js";import{t as ne}from"./send-JCA1n029.js";import{t as w}from"./square-B1X3dVpi.js";import{t as T}from"./terminal-CS0VBw1f.js";import{t as re}from"./trash-2-CCIeETW1.js";import{t as ie}from"./triangle-alert-CuEUegtS.js";import{t as ae}from"./x-CAGZWET-.js";import{t as oe}from"./tag-D4GIIzZF.js";import{a as E,i as se,n as D,r as O}from"./acp-run-store-f3ZZ5vfh.js";import{t as k}from"./three-dot-indicator-uhGzoECR.js";import{t as ce}from"./status-badge-pill-D7j-0FLr.js";var le=o(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=e(n(),1),j=``;function M(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function ue(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function N(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(D.length):t}function P(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function F(e,t){if(t.updateType===`agent_message_chunk`&&ue(t)){P(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:N(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??j,r=N(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(P(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==j&&r&&r.kind===`agent`&&r.messageId===j&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}P(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}P(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;P(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:M(t.toolStatus,`running`),content:t.content,locations:I(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=I(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:M(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=de(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(P(e),e.push(i)):e[r]=i;return}}}function I(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function de(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function fe(e){let t=[];for(let n of e)F(t,n);return t}function pe(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function me(){let e=null,t=[];function n(n){return t=fe(n),e=n,t}function r(r){let i=pe(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)F(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,A.useRef)(null);return t.current??=me(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-CLK3mZbB.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-BENY-yx_.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./typography-BeUa5Fd-.js";import{t as o}from"./createLucideIcon-C1mdGPB9.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./acp-run-actions-0FzwGnnE.js";import{t as p}from"./arrow-left-BikDV6F2.js";import{t as m}from"./brain-DPCFa4t_.js";import{t as h}from"./chevron-down-BcYoJcfl.js";import{t as g}from"./chevron-right-BcPFsjC2.js";import{t as _}from"./circle-check-CoU8jUcF.js";import{t as v}from"./circle-minus-DgnvL2Xt.js";import{w as y}from"./menu-DtLdBgbH.js";import{t as b}from"./code-DoyWcW4T.js";import"./src-4DTZIbDU.js";import{t as x}from"./file-text-BWjfiPpo.js";import{t as S}from"./globe-DN9GN4I5.js";import{t as C}from"./chat-markdown-message-DGCgFO5P.js";import{t as ee}from"./repeat-DGT4k1Gr.js";import{t as te}from"./search-DZBQ2Z4C.js";import{t as ne}from"./send-JCA1n029.js";import{t as w}from"./square-B1X3dVpi.js";import{t as T}from"./terminal-CS0VBw1f.js";import{t as re}from"./trash-2-CCIeETW1.js";import{t as ie}from"./triangle-alert-CuEUegtS.js";import{t as ae}from"./x-CAGZWET-.js";import{t as oe}from"./tag-D4GIIzZF.js";import{a as E,i as se,n as D,r as O}from"./acp-run-store-ZJ3pQsPd.js";import{t as k}from"./three-dot-indicator-kyZ3c9IW.js";import{t as ce}from"./status-badge-pill-DYBOsHm1.js";var le=o(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=e(n(),1),j=``;function M(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function ue(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function N(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(D.length):t}function P(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function F(e,t){if(t.updateType===`agent_message_chunk`&&ue(t)){P(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:N(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??j,r=N(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(P(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==j&&r&&r.kind===`agent`&&r.messageId===j&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}P(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??j,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}P(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;P(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:M(t.toolStatus,`running`),content:t.content,locations:I(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=I(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:M(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=de(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(P(e),e.push(i)):e[r]=i;return}}}function I(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function de(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function fe(e){let t=[];for(let n of e)F(t,n);return t}function pe(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function me(){let e=null,t=[];function n(n){return t=fe(n),e=n,t}function r(r){let i=pe(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)F(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,A.useRef)(null);return t.current??=me(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
2
2
  `)}function H(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function U(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var W=i();function _e({content:e,isComplete:t,assistantId:n}){return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,W.jsx)(C,{content:e,assistantId:n}),!t&&(0,W.jsx)(k,{className:`mt-1`,"data-testid":`acp-chat-agent-streaming`})]})}function ve({entries:e}){return e.length===0?null:(0,W.jsxs)(`div`,{"data-testid":`acp-chat-plan-block`,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5 text-[var(--content-tertiary)]`,children:[(0,W.jsx)(c,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`text-inherit`,children:`Plan`})]}),(0,W.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.map((e,t)=>(0,W.jsxs)(`li`,{"data-testid":`acp-chat-plan-entry`,"data-checked":e.checked,className:`flex items-start gap-2`,children:[e.checked?(0,W.jsx)(_,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}):(0,W.jsx)(y,{"aria-hidden":!0,className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`}),(0,W.jsx)(`span`,{className:e.checked?`text-body-small-default text-[var(--content-tertiary)] line-through`:`text-body-small-default text-[var(--content-default)]`,children:e.label})]},t))})]})}function ye(e){switch(e){case`max_tokens`:case`max_turn_requests`:return`Stopped: limit reached`;case`refusal`:return`Refused`;case`cancelled`:return`Cancelled`;default:return`Completed`}}function be(e){return new Date(e).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}function G({completedAt:e}){return e===void 0?null:(0,W.jsxs)(`span`,{"data-testid":`acp-chat-terminal-time`,children:[`at `,be(e)]})}function xe({status:e,stopReason:t,error:n,completedAt:r}){if(E(e))return null;if(e===`failed`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-lg bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,W.jsx)(ie,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{children:n??`Run failed`})]});if(e===`cancelled`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`cancelled`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(v,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{children:`Cancelled`}),(0,W.jsx)(G,{completedAt:r})]});let i=ye(t);return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`completed`,className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,W.jsx)(_,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,W.jsx)(`span`,{children:i}),(0,W.jsx)(G,{completedAt:r})]})}function Se({showDot:e,isLast:t,children:n}){return(0,W.jsxs)(`div`,{className:`relative flex items-start gap-2${t?``:` pb-4`}`,children:[!t&&(0,W.jsx)(`div`,{"aria-hidden":!0,className:`absolute bottom-0 left-[6.5px] w-px bg-[var(--border-element)] ${e?`top-[16px]`:`top-0`}`}),e?(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-timeline-dot`,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,W.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}):(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-[14px] w-[14px] shrink-0`}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:n})]})}function Ce({content:e,isComplete:t,assistantId:n}){let[r,i]=(0,A.useState)(null),a=r??!t,o=e.trim().length>0,s=t?`Thought process`:`Thinking`,c=t?(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(k,{dotSize:5,className:`shrink-0`,"data-testid":`acp-chat-thinking-streaming`});return o?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>i(!a),"data-testid":`acp-chat-thinking-toggle`,className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,children:[a?(0,W.jsx)(h,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),c,(0,W.jsx)(`span`,{children:s})]}),a&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-body`,className:`mt-1.5 border-l-2 border-[var(--border-base)] pl-3 text-body-small-default text-[var(--content-tertiary)]`,children:(0,W.jsx)(C,{content:e,assistantId:n})})]}):(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:(0,W.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:[c,(0,W.jsx)(`span`,{children:s})]})})}var we={running:`neutral`,completed:`positive`,error:`negative`,ended:`neutral`},Te={running:`Running`,completed:`Completed`,error:`Failed`,ended:`Ended`},Ee={read:`Read file`,edit:`Edit file`,delete:`Delete file`,move:`Move file`,search:`Search`,execute:`Run command`,think:`Thinking`,fetch:`Fetch`,switch_mode:`Switch mode`},De=`Tool call`,Oe={read:x,edit:le,delete:re,move:s,search:te,execute:T,think:m,fetch:S,switch_mode:ee},ke=new Set([`read`,`edit`,`delete`,`move`]);function Ae({toolKind:e}){return(0,W.jsx)(e&&Oe[e]||b,{"aria-hidden":!0,className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`})}function K({label:e,value:t,testId:n}){return(0,W.jsxs)(`div`,{"data-testid":n,children:[(0,W.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(`pre`,{className:`max-h-60 overflow-auto rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] p-2.5 font-mono text-body-small-default text-[var(--content-secondary)]`,children:t})]})}function je({block:e,isTerminal:t=!1,onOpenDiff:n,onOpenOutput:r}){let[i,o]=(0,A.useState)(!1),s=(0,A.useMemo)(()=>R(e.content),[e.content]),c=(0,A.useMemo)(()=>V(e.content),[e.content]),l=(0,A.useMemo)(()=>c.split(`
3
3
  `).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith("```"))||`View output`,[c]),u=(0,A.useMemo)(()=>U(s,e.locations),[s,e.locations]),d=t&&e.status===`running`?`ended`:e.status,f=d===`running`,p=e.toolKind&&Ee[e.toolKind]||De,m=B(e.rawInput)??e.title,_=m&&m!==p&&(!ke.has(e.toolKind??``)||u.length===0)?m:null,v=H(e.rawInput),y=H(e.rawOutput),b=v!==void 0||y!==void 0;return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-tool-card`,"data-status":e.status,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Ae,{toolKind:e.toolKind}),(0,W.jsx)(a,{variant:`body-small-emphasised`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,title:e.title,children:p}),(0,W.jsx)(oe,{tone:we[d],"data-testid":`acp-chat-tool-status`,children:Te[d]}),f&&(0,W.jsx)(k,{className:`shrink-0`,"data-testid":`acp-chat-tool-running`})]}),_&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-tool-detail`,className:`mt-1.5 font-mono text-body-small-default whitespace-pre-wrap break-words text-[var(--content-secondary)]`,children:_}),u.length>0&&(0,W.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:u.map(t=>{let r=t.oldText!==void 0||t.newText!==void 0,i=`flex max-w-full items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-1 text-body-small-default text-[var(--content-secondary)]`;return r?(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-file-chip`,onClick:()=>n(e.toolCallId,t),title:t.path,className:`${i} cursor-pointer transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(x,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path):(0,W.jsxs)(`span`,{"data-testid":`acp-chat-tool-file-ref`,title:t.path,className:i,children:[(0,W.jsx)(x,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate font-mono`,children:t.path})]},t.path)})}),c.length>0&&(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-output-open`,onClick:()=>r?.(e.toolCallId),className:`mt-2 flex w-full items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-2.5 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--border-focus)]`,children:[(0,W.jsx)(T,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:l}),(0,W.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`})]}),b&&(0,W.jsxs)(`div`,{className:`mt-2`,"data-testid":`acp-chat-tool-raw`,children:[(0,W.jsxs)(`button`,{type:`button`,"data-testid":`acp-chat-tool-raw-toggle`,"aria-expanded":i,onClick:()=>o(e=>!e),className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-default)]`,children:[i?(0,W.jsx)(h,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(g,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}),(0,W.jsx)(`span`,{children:i?`Hide raw input/output`:`Show raw input/output`})]}),i&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-2`,children:[v!==void 0&&(0,W.jsx)(K,{label:`Raw input`,value:v,testId:`acp-chat-tool-raw-input`}),y!==void 0&&(0,W.jsx)(K,{label:`Raw output`,value:y,testId:`acp-chat-tool-raw-output`})]})]})]})}function Me({content:e}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-user-turn`,className:`flex w-full justify-end`,children:(0,W.jsx)(`div`,{className:`max-w-[80%] rounded-lg bg-[var(--surface-lift)] px-4 py-3 whitespace-pre-wrap text-chat text-[var(--content-default)]`,children:e})})}function Ne(e,t){let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t}).format(e);return e>0&&e<.01?`<${n(.01)}`:n(e)}var q=new Intl.NumberFormat(`en-US`);function J({label:e,value:t}){return(0,W.jsxs)(`div`,{className:`flex items-baseline gap-1`,"data-usage-stat":e.toLowerCase(),children:[(0,W.jsx)(a,{variant:`label-small-default`,className:`text-[var(--content-tertiary)]`,children:e}),(0,W.jsx)(a,{variant:`body-small-default`,className:`text-[var(--content-secondary)] tabular-nums`,children:t})]})}function Pe({entry:e}){let{inputTokens:t,outputTokens:n,costAmount:r,costCurrency:i}=e;if(t===void 0&&n===void 0)return null;let a=t??0,o=n??0,s=r!=null&&i!=null;return(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,"data-testid":`acp-usage-meter`,children:[(0,W.jsx)(J,{label:`Input`,value:q.format(a)}),(0,W.jsx)(J,{label:`Output`,value:q.format(o)}),s&&(0,W.jsx)(J,{label:`Cost`,value:Ne(r,i)})]})}function Fe({content:e,assistantId:t}){return(0,W.jsx)(`div`,{"data-testid":`acp-chat-command-output`,className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 [&_pre]:!max-h-none`,children:(0,W.jsx)(C,{content:V(e),hardLineBreaks:!0,assistantId:t})})}var Y=2e3;function X(e){if(e===``)return[];let t=e.split(`
4
4
  `);return e.endsWith(`
@@ -1 +1 @@
1
- import{n as e,t}from"./create-selectors-B5FxuP1q.js";import{t as n}from"./by-tool-use-id-index-BNlydLFB.js";import{a as r,i,n as a,r as o,t as s}from"./optimistic-lifecycle-Zm4t_MWl.js";function c(e){return e===`initializing`||e===`running`}function l(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:case`cancelled`:return`var(--system-negative-strong)`;default:return`var(--primary-base)`}}function u(e){switch(e){case`initializing`:return`Initializing`;case`running`:return`Running`;case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Unknown`}}function d(e,t){return e===`completed`&&t===`cancelled`?{label:`Cancelled`,color:`var(--system-mid-strong)`}:{label:u(e),color:l(e)}}var f=`↻ Steering: `,p=`local-marker-`,m={byId:{},orderedIds:[],byToolUseId:new Map,highWaterMark:new Map};function h(e,t){return[...e,t]}function g(e,t){let n=new Map,r=[];for(let i of[...e,...t]){if(typeof i.seq!=`number`){r.push(i);continue}n.has(i.seq)||n.set(i.seq,i)}let i=Array.from(n.values()).sort((e,t)=>(e.seq??0)-(t.seq??0));return r.length?[...i,...r]:i}function _(e,t){let n=g(e.events,t.events),r=i(e.status,t.status,c);return{...e,events:n,status:r,stopReason:t.stopReason??e.stopReason,error:t.error??e.error,completedAt:t.completedAt??e.completedAt,usedTokens:t.usedTokens||e.usedTokens,contextSize:t.contextSize||e.contextSize,inputTokens:t.inputTokens??e.inputTokens,outputTokens:t.outputTokens??e.outputTokens,costAmount:t.costAmount??e.costAmount,costCurrency:t.costCurrency??e.costCurrency,task:e.task??t.task,parentToolUseId:e.parentToolUseId??t.parentToolUseId}}function v(e,t,n){if(typeof n!=`number`)return e;let r=e.get(t);return r!==void 0&&r>=n?e:new Map(e).set(t,n)}function y(e,t){return{getStatus:e=>e.status,isActive:c,cancelledStatus:`cancelled`,applyCancel:t=>({...t,status:`cancelled`,completedAt:e}),applyRestore:(e,t)=>({...e,status:t,completedAt:void 0}),applyRetire:n=>({...n,status:`cancelled`,stopReason:t,completedAt:e})}}var b=t(e()((e,t)=>({...m,spawnRun:r=>{let{byId:i,orderedIds:a,byToolUseId:o}=t(),s=i[r.acpSessionId];if(s){if(c(s.status))return;let t={...s,status:`running`,stopReason:void 0,error:void 0,completedAt:void 0,task:s.task??r.task,parentToolUseId:s.parentToolUseId??r.parentToolUseId},a=s.parentToolUseId?o:n(o,r.parentToolUseId,r.acpSessionId);e({byId:{...i,[r.acpSessionId]:t},byToolUseId:a});return}let l={acpSessionId:r.acpSessionId,agent:r.agent,parentConversationId:r.parentConversationId,task:r.task,status:`running`,startedAt:r.startedAt,parentToolUseId:r.parentToolUseId,usedTokens:0,contextSize:0,events:[]},u=n(o,r.parentToolUseId,r.acpSessionId);e({byId:{...i,[r.acpSessionId]:l},orderedIds:[...a,r.acpSessionId],byToolUseId:u})},receiveEvent:n=>{let{byId:r,highWaterMark:i}=t(),a=r[n.acpSessionId];a&&e({byId:{...r,[n.acpSessionId]:{...a,events:h(a.events,n.event)}},highWaterMark:v(i,n.acpSessionId,n.event.seq)})},appendLocalMarker:n=>{let{byId:r}=t(),i=r[n.acpSessionId];if(!i)return null;let a=i.events.reduce((e,t)=>typeof t.seq==`number`&&t.seq>e?t.seq:e,0),o=`${p}${i.events.length}`,s={seq:a+.5,updateType:`agent_message_chunk`,messageId:o,content:n.content};return e({byId:{...r,[n.acpSessionId]:{...i,events:[...i.events,s]}}}),o},removeLocalMarker:n=>{let{byId:r}=t(),i=r[n.acpSessionId];if(!i)return;let a=i.events.filter(e=>e.messageId!==n.markerId);a.length!==i.events.length&&e({byId:{...r,[n.acpSessionId]:{...i,events:a}}})},setTerminal:n=>{let{byId:r}=t(),i=r[n.acpSessionId];i&&e({byId:{...r,[n.acpSessionId]:{...i,status:n.status,stopReason:n.stopReason??i.stopReason,error:n.error??i.error,completedAt:n.completedAt}}})},cancelRun:n=>{let{byId:r}=t(),i=s(r[n.acpSessionId],y(n.completedAt));i&&e({byId:{...r,[n.acpSessionId]:i}})},restoreRunStatus:n=>{let{byId:r}=t(),i=a(r[n.acpSessionId],n.status,y());i&&e({byId:{...r,[n.acpSessionId]:i}})},retireMissingRuns:n=>{let{byId:r}=t(),i=y(n.completedAt,`daemon_restarted`),a=!1,s={...r};for(let e of n.acpSessionIds){let t=o(s[e],i);t&&(s[e]=t,a=!0)}a&&e({byId:s})},updateUsage:n=>{let{byId:r}=t(),i=r[n.acpSessionId];i&&e({byId:{...r,[n.acpSessionId]:{...i,usedTokens:n.usedTokens,contextSize:n.contextSize,inputTokens:n.inputTokens??i.inputTokens,outputTokens:n.outputTokens??i.outputTokens,costAmount:n.costAmount??i.costAmount,costCurrency:n.costCurrency??i.costCurrency}}})},seedFromHistory:i=>{let{byId:a,orderedIds:o,byToolUseId:s,highWaterMark:c}=t(),{byId:l,orderedIds:u}=r({entries:i,byId:a,orderedIds:o,idOf:e=>e.acpSessionId,merge:_}),d=s,f=c;for(let e of i){d=n(d,e.parentToolUseId,e.acpSessionId);for(let t of l[e.acpSessionId].events)typeof t.seq==`number`&&(f=v(f,e.acpSessionId,t.seq))}e({byId:l,orderedIds:u,byToolUseId:d,highWaterMark:f})},reset:()=>e({byId:{},orderedIds:[],byToolUseId:new Map,highWaterMark:new Map})})));export{c as a,d as i,f as n,b as r,p as t};
1
+ import{n as e,t}from"./create-selectors-B5FxuP1q.js";import{t as n}from"./by-tool-use-id-index-CsMrRoeV.js";import{a as r,i,n as a,r as o,t as s}from"./optimistic-lifecycle-DYPK-Ow7.js";function c(e){return e===`initializing`||e===`running`}function l(e){switch(e){case`completed`:return`var(--system-positive-strong)`;case`failed`:case`cancelled`:return`var(--system-negative-strong)`;default:return`var(--primary-base)`}}function u(e){switch(e){case`initializing`:return`Initializing`;case`running`:return`Running`;case`completed`:return`Completed`;case`failed`:return`Failed`;case`cancelled`:return`Cancelled`;default:return`Unknown`}}function d(e,t){return e===`completed`&&t===`cancelled`?{label:`Cancelled`,color:`var(--system-mid-strong)`}:{label:u(e),color:l(e)}}var f=`↻ Steering: `,p=`local-marker-`,m={byId:{},orderedIds:[],byToolUseId:new Map,highWaterMark:new Map};function h(e,t){return[...e,t]}function g(e,t){let n=new Map,r=[];for(let i of[...e,...t]){if(typeof i.seq!=`number`){r.push(i);continue}n.has(i.seq)||n.set(i.seq,i)}let i=Array.from(n.values()).sort((e,t)=>(e.seq??0)-(t.seq??0));return r.length?[...i,...r]:i}function _(e,t){let n=g(e.events,t.events),r=i(e.status,t.status,c);return{...e,events:n,status:r,stopReason:t.stopReason??e.stopReason,error:t.error??e.error,completedAt:t.completedAt??e.completedAt,usedTokens:t.usedTokens||e.usedTokens,contextSize:t.contextSize||e.contextSize,inputTokens:t.inputTokens??e.inputTokens,outputTokens:t.outputTokens??e.outputTokens,costAmount:t.costAmount??e.costAmount,costCurrency:t.costCurrency??e.costCurrency,task:e.task??t.task,parentToolUseId:e.parentToolUseId??t.parentToolUseId}}function v(e,t,n){if(typeof n!=`number`)return e;let r=e.get(t);return r!==void 0&&r>=n?e:new Map(e).set(t,n)}function y(e,t){return{getStatus:e=>e.status,isActive:c,cancelledStatus:`cancelled`,applyCancel:t=>({...t,status:`cancelled`,completedAt:e}),applyRestore:(e,t)=>({...e,status:t,completedAt:void 0}),applyRetire:n=>({...n,status:`cancelled`,stopReason:t,completedAt:e})}}var b=t(e()((e,t)=>({...m,spawnRun:r=>{let{byId:i,orderedIds:a,byToolUseId:o}=t(),s=i[r.acpSessionId];if(s){if(c(s.status))return;let t={...s,status:`running`,stopReason:void 0,error:void 0,completedAt:void 0,task:s.task??r.task,parentToolUseId:s.parentToolUseId??r.parentToolUseId},a=s.parentToolUseId?o:n(o,r.parentToolUseId,r.acpSessionId);e({byId:{...i,[r.acpSessionId]:t},byToolUseId:a});return}let l={acpSessionId:r.acpSessionId,agent:r.agent,parentConversationId:r.parentConversationId,task:r.task,status:`running`,startedAt:r.startedAt,parentToolUseId:r.parentToolUseId,usedTokens:0,contextSize:0,events:[]},u=n(o,r.parentToolUseId,r.acpSessionId);e({byId:{...i,[r.acpSessionId]:l},orderedIds:[...a,r.acpSessionId],byToolUseId:u})},receiveEvent:n=>{let{byId:r,highWaterMark:i}=t(),a=r[n.acpSessionId];a&&e({byId:{...r,[n.acpSessionId]:{...a,events:h(a.events,n.event)}},highWaterMark:v(i,n.acpSessionId,n.event.seq)})},appendLocalMarker:n=>{let{byId:r}=t(),i=r[n.acpSessionId];if(!i)return null;let a=i.events.reduce((e,t)=>typeof t.seq==`number`&&t.seq>e?t.seq:e,0),o=`${p}${i.events.length}`,s={seq:a+.5,updateType:`agent_message_chunk`,messageId:o,content:n.content};return e({byId:{...r,[n.acpSessionId]:{...i,events:[...i.events,s]}}}),o},removeLocalMarker:n=>{let{byId:r}=t(),i=r[n.acpSessionId];if(!i)return;let a=i.events.filter(e=>e.messageId!==n.markerId);a.length!==i.events.length&&e({byId:{...r,[n.acpSessionId]:{...i,events:a}}})},setTerminal:n=>{let{byId:r}=t(),i=r[n.acpSessionId];i&&e({byId:{...r,[n.acpSessionId]:{...i,status:n.status,stopReason:n.stopReason??i.stopReason,error:n.error??i.error,completedAt:n.completedAt}}})},cancelRun:n=>{let{byId:r}=t(),i=s(r[n.acpSessionId],y(n.completedAt));i&&e({byId:{...r,[n.acpSessionId]:i}})},restoreRunStatus:n=>{let{byId:r}=t(),i=a(r[n.acpSessionId],n.status,y());i&&e({byId:{...r,[n.acpSessionId]:i}})},retireMissingRuns:n=>{let{byId:r}=t(),i=y(n.completedAt,`daemon_restarted`),a=!1,s={...r};for(let e of n.acpSessionIds){let t=o(s[e],i);t&&(s[e]=t,a=!0)}a&&e({byId:s})},updateUsage:n=>{let{byId:r}=t(),i=r[n.acpSessionId];i&&e({byId:{...r,[n.acpSessionId]:{...i,usedTokens:n.usedTokens,contextSize:n.contextSize,inputTokens:n.inputTokens??i.inputTokens,outputTokens:n.outputTokens??i.outputTokens,costAmount:n.costAmount??i.costAmount,costCurrency:n.costCurrency??i.costCurrency}}})},seedFromHistory:i=>{let{byId:a,orderedIds:o,byToolUseId:s,highWaterMark:c}=t(),{byId:l,orderedIds:u}=r({entries:i,byId:a,orderedIds:o,idOf:e=>e.acpSessionId,merge:_}),d=s,f=c;for(let e of i){d=n(d,e.parentToolUseId,e.acpSessionId);for(let t of l[e.acpSessionId].events)typeof t.seq==`number`&&(f=v(f,e.acpSessionId,t.seq))}e({byId:l,orderedIds:u,byToolUseId:d,highWaterMark:f})},reset:()=>e({byId:{},orderedIds:[],byToolUseId:new Map,highWaterMark:new Map})})));export{c as a,d as i,f as n,b as r,p as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BENY-yx_.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-BeUa5Fd-.js";import{m as a,n as o,t as s}from"./message-content-BKoSLhMp.js";import{_ as c,a as l,f as u,g as d,i as f,r as p,v as m,y as h}from"./transcript-message-body-shared-ERITbUZZ.js";import{t as g}from"./chevron-left-C-YGuLQc.js";import"./src-4DTZIbDU.js";import{t as _}from"./chat-markdown-message-DevkcKV1.js";import{t as v}from"./workflow-store-B9ZU_HIp.js";import{t as y}from"./background-task-store-DBkMeElr.js";import{r as b}from"./acp-run-store-f3ZZ5vfh.js";import{a as x,g as S,i as C,n as w,r as T,s as E,w as D,x as O}from"./site-favicon-BSqLa8lz.js";import{t as k}from"./detail-shell-ModH5YJB.js";import{t as A}from"./use-transcript-message-by-id-BctuW5bg.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-C1IqMEUv.js";var N=e(t(),1);function P(e,t,n){let r=f(t,n.workflow),i=e=>{let t=u(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=p(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=l(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=A(e),r=v.use.byId(),i=v.use.byToolUseId(),a=v.use.notFoundRunIds(),c=v.use.hydrationFailedRunIds(),l=b.use.byId(),u=b.use.byToolUseId(),d=y.use.byId();return(0,N.useMemo)(()=>{if(!n||t==null)return null;let e=o(n.contentBlocks??[],{splitInlineThinking:n.role!==`user`})[t];if(!e||e.type!==`activity`)return null;let{cardItems:f,toolCalls:p}=s(e.items);return P(f,p,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:a,hydrationFailedRunIds:c},acpById:l,acpByToolUseId:u,backgroundTaskById:d})},[n,t,r,i,a,c,l,u,d])}var I=r(),L=60;function R({payload:e,onClose:t,assistantId:r}){let[a,o]=(0,N.useState)(null),s=F(e.messageId,e.groupIndex),l=s?.items??e.items,u=s?.toolCalls??e.toolCalls,f=h(l),p=c(f.steps),_=m(f.state,f.steps),v=_===`loading`,y=d(_,f.totalDurationLabel??``,p.failed),b=v&&f.currentStepTitle||y,x=new Map(u.map(e=>[e.id,e])),C=a?a.kind===`thinking`?`Thinking`:a.activity||a.title:``;return(0,I.jsx)(k,{titleNode:a?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(g,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>o(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:C})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:v?(0,I.jsx)(S,{children:b}):b}),f.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:f.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:a?(0,I.jsx)(B,{detail:a,assistantId:r}):(0,I.jsx)(E,{steps:f.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:a,onOpenDetail:o,lookupToolCall:e=>x.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:o}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:o,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(C,{iconName:`brain`,label:a(D(e.text),L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(T,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(w,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(x,{step:e});let s=r(e.toolCallId);return(0,I.jsx)(C,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{s&&n(O(s))}})}function B({detail:e,assistantId:t}){let n=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(_,{content:n??e.thinkingText??``,hardLineBreaks:!0,assistantId:t}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BENY-yx_.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-BeUa5Fd-.js";import{m as a,n as o,t as s}from"./message-content-BKoSLhMp.js";import{_ as c,a as l,f as u,g as d,i as f,r as p,v as m,y as h}from"./transcript-message-body-shared-B6C7du2c.js";import{t as g}from"./chevron-left-C-YGuLQc.js";import"./src-4DTZIbDU.js";import{t as _}from"./chat-markdown-message-DGCgFO5P.js";import{t as v}from"./workflow-store-Byuh_pxH.js";import{t as y}from"./background-task-store-CrpkniEd.js";import{r as b}from"./acp-run-store-ZJ3pQsPd.js";import{a as x,g as S,i as C,n as w,r as T,s as E,w as D,x as O}from"./site-favicon-DVzLsoJw.js";import{t as k}from"./detail-shell-v2b3dq7m.js";import{t as A}from"./use-transcript-message-by-id-CYZWKZcl.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-DCaHM-Nm.js";var N=e(t(),1);function P(e,t,n){let r=f(t,n.workflow),i=e=>{let t=u(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=p(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=l(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=A(e),r=v.use.byId(),i=v.use.byToolUseId(),a=v.use.notFoundRunIds(),c=v.use.hydrationFailedRunIds(),l=b.use.byId(),u=b.use.byToolUseId(),d=y.use.byId();return(0,N.useMemo)(()=>{if(!n||t==null)return null;let e=o(n.contentBlocks??[],{splitInlineThinking:n.role!==`user`})[t];if(!e||e.type!==`activity`)return null;let{cardItems:f,toolCalls:p}=s(e.items);return P(f,p,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:a,hydrationFailedRunIds:c},acpById:l,acpByToolUseId:u,backgroundTaskById:d})},[n,t,r,i,a,c,l,u,d])}var I=r(),L=60;function R({payload:e,onClose:t,assistantId:r}){let[a,o]=(0,N.useState)(null),s=F(e.messageId,e.groupIndex),l=s?.items??e.items,u=s?.toolCalls??e.toolCalls,f=h(l),p=c(f.steps),_=m(f.state,f.steps),v=_===`loading`,y=d(_,f.totalDurationLabel??``,p.failed),b=v&&f.currentStepTitle||y,x=new Map(u.map(e=>[e.id,e])),C=a?a.kind===`thinking`?`Thinking`:a.activity||a.title:``;return(0,I.jsx)(k,{titleNode:a?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(g,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>o(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:C})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:v?(0,I.jsx)(S,{children:b}):b}),f.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:f.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:a?(0,I.jsx)(B,{detail:a,assistantId:r}):(0,I.jsx)(E,{steps:f.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:a,onOpenDetail:o,lookupToolCall:e=>x.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:o}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:o,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(C,{iconName:`brain`,label:a(D(e.text),L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(T,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(w,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(x,{step:e});let s=r(e.toolCallId);return(0,I.jsx)(C,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{s&&n(O(s))}})}function B({detail:e,assistantId:t}){let n=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(_,{content:n??e.thinkingText??``,hardLineBreaks:!0,assistantId:t}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BENY-yx_.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./key-round-DwjCZmHI.js";import{t as o}from"./loader-circle-D7A_UeUb.js";import{t as s}from"./input-Dp4TsVxE.js";import{t as c}from"./modal-iaI7yGGi.js";import{n as l}from"./toast-DmMsYUgG.js";import{Yt as u}from"./react-query.gen-DYPHpypm.js";import{t as d}from"./use-active-assistant-id-CJpO2yaM.js";var f=e(t(),1),p=i();function m(e){return[`credentials-list`,e]}function h({open:e,onClose:t,onSaved:i,initialValues:h,successToastMessage:g=`Credential saved.`}){let _=d(),v=r(),[y,b]=(0,f.useState)(h?.service??``),[x,S]=(0,f.useState)(h?.field??``),[C,w]=(0,f.useState)(h?.value??``),[T,E]=(0,f.useState)(h?.label??``),D=(0,f.useRef)(h);(0,f.useLayoutEffect)(()=>{D.current=h},[h]),(0,f.useEffect)(()=>{if(e){let e=D.current;b(e?.service??``),S(e?.field??``),w(e?.value??``),E(e?.label??``)}},[e]);let O=u({onError:e=>{l.error(e.message||`Failed to save credential`)}}),k=O.isPending,A=()=>{b(``),S(``),w(``),E(``),t()};return(0,p.jsx)(c.Root,{open:e,onOpenChange:e=>{!e&&!k&&A()},children:(0,p.jsx)(c.Content,{size:`sm`,children:(0,p.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=y.trim(),n=x.trim();if(!t||!n||!C.trim())return;let r=T.trim()||void 0;O.mutate({path:{assistant_id:_},body:{service:t,field:n,value:C,label:r}},{onSuccess:()=>{v.invalidateQueries({queryKey:m(_)}),l.success(g),i?.({service:t,field:n,label:r}),A()}})},children:[(0,p.jsxs)(c.Header,{children:[(0,p.jsx)(c.Title,{icon:a,children:`Add credential`}),(0,p.jsx)(c.Description,{children:`Add an API key or token to let tools and integrations use it.`})]}),(0,p.jsxs)(c.Body,{className:`flex flex-col gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,p.jsx)(s,{label:`Service`,type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`e.g. github`,autoFocus:!0,fullWidth:!0}),(0,p.jsx)(s,{label:`Field`,type:`text`,value:x,onChange:e=>S(e.target.value),placeholder:`e.g. api_token`,fullWidth:!0})]}),(0,p.jsx)(s,{label:`Value`,type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:`Enter the secret value`,fullWidth:!0}),(0,p.jsx)(s,{label:`Label (optional)`,type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:`e.g. GitHub personal access token`,fullWidth:!0})]}),(0,p.jsxs)(c.Footer,{children:[(0,p.jsx)(n,{type:`button`,variant:`outlined`,onClick:A,disabled:k,children:`Cancel`}),(0,p.jsx)(n,{type:`submit`,variant:`primary`,disabled:k||!y.trim()||!x.trim()||!C.trim(),leftIcon:k?(0,p.jsx)(o,{className:`animate-spin`,"aria-hidden":!0}):void 0,children:`Save`})]})]})})})}export{m as n,h as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BENY-yx_.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./key-round-DwjCZmHI.js";import{t as o}from"./loader-circle-D7A_UeUb.js";import{t as s}from"./input-Dp4TsVxE.js";import{t as c}from"./modal-iaI7yGGi.js";import{n as l}from"./toast-DmMsYUgG.js";import{Xt as u}from"./react-query.gen-QJi0b_h4.js";import{t as d}from"./use-active-assistant-id-C-H-Lp7_.js";var f=e(t(),1),p=i();function m(e){return[`credentials-list`,e]}function h({open:e,onClose:t,onSaved:i,initialValues:h,successToastMessage:g=`Credential saved.`}){let _=d(),v=r(),[y,b]=(0,f.useState)(h?.service??``),[x,S]=(0,f.useState)(h?.field??``),[C,w]=(0,f.useState)(h?.value??``),[T,E]=(0,f.useState)(h?.label??``),D=(0,f.useRef)(h);(0,f.useLayoutEffect)(()=>{D.current=h},[h]),(0,f.useEffect)(()=>{if(e){let e=D.current;b(e?.service??``),S(e?.field??``),w(e?.value??``),E(e?.label??``)}},[e]);let O=u({onError:e=>{l.error(e.message||`Failed to save credential`)}}),k=O.isPending,A=()=>{b(``),S(``),w(``),E(``),t()};return(0,p.jsx)(c.Root,{open:e,onOpenChange:e=>{!e&&!k&&A()},children:(0,p.jsx)(c.Content,{size:`sm`,children:(0,p.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=y.trim(),n=x.trim();if(!t||!n||!C.trim())return;let r=T.trim()||void 0;O.mutate({path:{assistant_id:_},body:{service:t,field:n,value:C,label:r}},{onSuccess:()=>{v.invalidateQueries({queryKey:m(_)}),l.success(g),i?.({service:t,field:n,label:r}),A()}})},children:[(0,p.jsxs)(c.Header,{children:[(0,p.jsx)(c.Title,{icon:a,children:`Add credential`}),(0,p.jsx)(c.Description,{children:`Add an API key or token to let tools and integrations use it.`})]}),(0,p.jsxs)(c.Body,{className:`flex flex-col gap-3`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,p.jsx)(s,{label:`Service`,type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`e.g. github`,autoFocus:!0,fullWidth:!0}),(0,p.jsx)(s,{label:`Field`,type:`text`,value:x,onChange:e=>S(e.target.value),placeholder:`e.g. api_token`,fullWidth:!0})]}),(0,p.jsx)(s,{label:`Value`,type:`password`,value:C,onChange:e=>w(e.target.value),placeholder:`Enter the secret value`,fullWidth:!0}),(0,p.jsx)(s,{label:`Label (optional)`,type:`text`,value:T,onChange:e=>E(e.target.value),placeholder:`e.g. GitHub personal access token`,fullWidth:!0})]}),(0,p.jsxs)(c.Footer,{children:[(0,p.jsx)(n,{type:`button`,variant:`outlined`,onClick:A,disabled:k,children:`Cancel`}),(0,p.jsx)(n,{type:`submit`,variant:`primary`,disabled:k||!y.trim()||!x.trim()||!C.trim(),leftIcon:k?(0,p.jsx)(o,{className:`animate-spin`,"aria-hidden":!0}):void 0,children:`Save`})]})]})})})}export{m as n,h as t};
@@ -1 +1 @@
1
- import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-BENY-yx_.js";import{l as i,m as a,t as o}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./chevron-right-BcPFsjC2.js";import{t as f}from"./circle-alert-C1Hon9Us.js";import{t as p}from"./loader-circle-D7A_UeUb.js";import{t as m}from"./modal-iaI7yGGi.js";import{t as h}from"./dropdown-B4S4UoV4.js";import{f as g}from"./platform-detection-DYmzJ4FF.js";import{d as _}from"./routes-DOlsNBq5.js";import{n as v,r as y}from"./browser-ClzlwMbU.js";import{ht as b,pt as x}from"./react-query.gen-BtWMgf9p.js";import{t as S}from"./android-consumption-only-BhpxWm8b.js";var C=t({AddCreditsModal:()=>A}),w=e(n(),1),T=u(),E=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function D(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function O(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function k({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[g]=a(),S=g.toString()?`${u}?${g.toString()}`:u,{data:C,isLoading:k}=c(x()),A=C?.allowed_top_up_amounts?.length?C.allowed_top_up_amounts:E,[j,M]=(0,w.useState)(null),N=j&&A.includes(j)?j:A[0]??E[0],P=l(b());return(0,w.useEffect)(()=>y(()=>{t(!1),n.invalidateQueries(x())}),[t,n]),(0,T.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Add Credits`}),(0,T.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,T.jsx)(m.Body,{children:(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,T.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!C,options:A.map(e=>({value:e,label:D(e)}))})]}),P.isError&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,T.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),O(P.error)]}),(0,T.jsxs)(o,{to:_.settings.usageBillingConfigureTopUps,className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:[`Configure Automatic Top-Ups`,(0,T.jsx)(d,{className:`size-4`})]}),(0,T.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,T.jsxs)(m.Footer,{children:[(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,T.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,T.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:S}},{onSuccess:e=>{v(e.checkout_url)}})},disabled:P.isPending||k||!C,children:`Continue`})]})]})})}function A(e){return g()?(0,T.jsx)(m.Root,{open:e.open,onOpenChange:e.onOpenChange,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Billing`}),(0,T.jsx)(m.Description,{children:S})]}),(0,T.jsx)(m.Footer,{children:(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Close`})})})]})}):(0,T.jsx)(k,{...e})}export{C as n,A as t};
1
+ import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-BENY-yx_.js";import{h as i,t as a,u as o}from"./chunk-5KNZJZUH-BUqIilZr.js";import{n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./chevron-right-BcPFsjC2.js";import{t as f}from"./circle-alert-C1Hon9Us.js";import{t as p}from"./loader-circle-D7A_UeUb.js";import{t as m}from"./modal-iaI7yGGi.js";import{t as h}from"./dropdown-B4S4UoV4.js";import{f as g}from"./platform-detection-BKTsihBH.js";import{d as _}from"./routes-CMywm39M.js";import{n as v,r as y}from"./browser-CznuGKM_.js";import{ht as b,pt as x}from"./react-query.gen-grRlE5uB.js";import{t as S}from"./android-consumption-only-DT4SppcW.js";var C=t({AddCreditsModal:()=>A}),w=e(n(),1),T=u(),E=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function D(e){let t=parseFloat(e);if(Number.isNaN(t))return`0 credits`;let n=t.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return`${n.endsWith(`.00`)?n.slice(0,-3):n} credits`}function O(e){if(e&&typeof e==`object`){let t=e.amount;if(Array.isArray(t)&&typeof t[0]==`string`)return t[0]}return`Failed to create checkout session. Please try again.`}function k({open:e,onOpenChange:t}){let n=s(),{pathname:u}=o(),[g]=i(),S=g.toString()?`${u}?${g.toString()}`:u,{data:C,isLoading:k}=c(x()),A=C?.allowed_top_up_amounts?.length?C.allowed_top_up_amounts:E,[j,M]=(0,w.useState)(null),N=j&&A.includes(j)?j:A[0]??E[0],P=l(b());return(0,w.useEffect)(()=>y(()=>{t(!1),n.invalidateQueries(x())}),[t,n]),(0,T.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Add Credits`}),(0,T.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,T.jsx)(m.Body,{children:(0,T.jsxs)(`div`,{className:`space-y-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,T.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!C,options:A.map(e=>({value:e,label:D(e)}))})]}),P.isError&&(0,T.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,T.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),O(P.error)]}),(0,T.jsxs)(a,{to:_.settings.usageBillingConfigureTopUps,className:`flex items-center gap-1 text-body-small-default text-[var(--content-tertiary)] hover:text-[var(--content-secondary)]`,onClick:()=>t(!1),children:[`Configure Automatic Top-Ups`,(0,T.jsx)(d,{className:`size-4`})]}),(0,T.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,T.jsxs)(m.Footer,{children:[(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,T.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,T.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:S}},{onSuccess:e=>{v(e.checkout_url)}})},disabled:P.isPending||k||!C,children:`Continue`})]})]})})}function A(e){return g()?(0,T.jsx)(m.Root,{open:e.open,onOpenChange:e.onOpenChange,children:(0,T.jsxs)(m.Content,{size:`sm`,children:[(0,T.jsxs)(m.Header,{children:[(0,T.jsx)(m.Title,{children:`Billing`}),(0,T.jsx)(m.Description,{children:S})]}),(0,T.jsx)(m.Footer,{children:(0,T.jsx)(m.Close,{asChild:!0,children:(0,T.jsx)(r,{variant:`outlined`,children:`Close`})})})]})}):(0,T.jsx)(k,{...e})}export{C as n,A as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,l as n,o as r}from"./local-settings-Bx7FsNo5.js";import{r as i,t as a}from"./capture-error-CLK3mZbB.js";import{t as o}from"./react-BFJW0bSv.js";import{n as s,t as c}from"./button-BENY-yx_.js";import{d as l,h as u}from"./chunk-5KNZJZUH-BUqIilZr.js";import{n as d}from"./QueryClientProvider-CMu7CkQU.js";import{t as f}from"./useQuery-Bz-fbQ-m.js";import{t as p}from"./useMutation-CXGTrp4W.js";import{t as m}from"./jsx-runtime-D3ZM-ToX.js";import{t as h}from"./typography-BeUa5Fd-.js";import{t as g}from"./check-DRqtWHWc.js";import{t as _}from"./circle-alert-C1Hon9Us.js";import{t as v}from"./circle-check-CoU8jUcF.js";import{t as y}from"./menu-DtLdBgbH.js";import{t as b}from"./clock-BW3mQNGq.js";import{r as x,z as S}from"./src-4DTZIbDU.js";import{t as C}from"./ellipsis-vertical-ti9kRVDr.js";import{t as w}from"./external-link-oGdSxU8S.js";import{t as T}from"./info-DJd5yI-U.js";import{t as E}from"./list-C1YSYkTX.js";import{t as D}from"./loader-circle-D7A_UeUb.js";import{t as O}from"./mail-CgnilCq4.js";import{t as k}from"./plus-K9nUP77O.js";import{t as A}from"./search-DZBQ2Z4C.js";import{t as j}from"./trash-2-CCIeETW1.js";import{t as M}from"./triangle-alert-CuEUegtS.js";import{t as N}from"./notice-DrCduoXJ.js";import{t as P}from"./tag-D4GIIzZF.js";import{t as F}from"./popover-BJQsCNak.js";import{t as I}from"./input-Dp4TsVxE.js";import{t as L}from"./toggle-g8KBdUmy.js";import{t as R}from"./modal-iaI7yGGi.js";import{n as z}from"./toast-DmMsYUgG.js";import{t as B}from"./confirm-dialog-B3O_TlF_.js";import{t as V}from"./dropdown-B4S4UoV4.js";import{t as ee}from"./skeleton-BCJu-_x1.js";import{M as H,P as U,S as W,_ as G,a as te,b as ne,c as K,f as q,g as J,h as Y,i as re,j as X,k as ie,l as ae,m as oe,n as se,o as Z,p as ce,r as le,s as ue,t as de,v as fe,w as pe,x as me,y as he}from"./profile-pickers-CkwsV2EJ.js";import{A as ge,B as _e,C as ve,F as ye,G as be,H as xe,I as Se,L as Ce,M as we,N as Te,P as Ee,R as De,S as Oe,U as ke,V as Ae,W as je,_ as Me,a as Ne,b as Pe,c as Fe,d as Ie,f as Le,g as Re,h as ze,i as Be,j as Ve,k as He,l as Ue,m as We,n as Ge,o as Ke,p as qe,r as Je,s as Ye,t as Xe,u as Ze,x as Qe,y as $e,z as et}from"./use-sticky-profiles-D9xXeLvn.js";import{t as tt}from"./assistant-identity-store-BoDyhR19.js";import{i as nt,n as rt,o as it,r as at}from"./utils-BXGlUlmA.js";import{i as ot,r as st}from"./api-errors-BOG3VRJr.js";import{Jt as ct,On as lt,dr as ut,j as dt,pt as ft,qt as pt,ut as mt}from"./sdk.gen-DQRCDUdg.js";import{f as ht}from"./platform-detection-BKTsihBH.js";import{d as gt}from"./routes-CMywm39M.js";import{i as _t}from"./use-platform-gate-DJ160Mvd.js";import{r as vt}from"./use-is-org-ready-DIEDh69N.js";import{Bt as yt,G as bt,Gt as xt,H as St,U as Ct,W as wt,c as Tt,d as Et,f as Dt,l as Ot,m as kt,nn as At,p as jt,u as Mt,vt as Nt,xt as Pt,yt as Ft}from"./react-query.gen-QJi0b_h4.js";import{n as It}from"./use-is-mobile-BZEx6kJ_.js";import{c as Lt,d as Rt,f as zt,g as Bt,h as Vt,l as Ht,m as Ut,o as Wt,p as Gt,s as Kt,u as qt,ut as Jt,v as Yt,y as Xt}from"./react-query.gen-grRlE5uB.js";import{t as Zt}from"./platform-login-notice-vVKxIiV2.js";import{t as Qt}from"./android-consumption-only-DT4SppcW.js";import{a as $t,c as en,i as tn,n as nn,o as rn}from"./voice-list-Gt_3WbZK.js";import{n as an}from"./use-voice-sample-preview-Ck14EXPC.js";import{t as on}from"./use-active-assistant-id-C-H-Lp7_.js";import{t as sn}from"./detail-shell-v2b3dq7m.js";import{t as cn}from"./detail-card-DZdr9B6l.js";import{a as ln,d as un,u as dn}from"./schedules-B8i7MULW.js";import{t as fn}from"./use-supports-schedule-profile-moves-D0HqbPCI.js";import{t as pn}from"./use-platform-assistant-id-Csyov1YH.js";import{t as mn}from"./environment-store-BA_V5VmV.js";import{t as hn}from"./stt-language-picker-modal-B5QNaSCc.js";var Q=e(o(),1),$=m();function gn({mode:e,onChange:t}){return(0,$.jsx)(`div`,{className:`max-w-[280px]`,children:(0,$.jsx)(S,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function _n({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,$.jsxs)(cn,{id:e,title:t,subtitle:n,accessory:(0,$.jsx)(gn,{mode:r,onChange:i}),children:[(0,$.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,$.jsx)(`div`,{className:`mt-4`,children:a})]})}function vn({id:e,title:t,subtitle:n,children:r}){return(0,$.jsxs)(cn,{id:e,title:t,subtitle:n,children:[(0,$.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,$.jsx)(`div`,{className:`mt-4`,children:r})]})}function yn(){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-4 py-2.5`,children:[(0,$.jsx)(T,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,$.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,$.jsxs)(`a`,{href:`https://www.vellum.ai/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--primary-base)] hover:underline`,children:[`View pricing`,(0,$.jsx)(w,{className:`h-3.5 w-3.5`})]})]})]})}function bn({status:e,message:t,isLoading:n}){return n?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,children:[(0,$.jsx)(D,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-positive-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,title:`DNS records have been verified. Your domain is ready to send and receive email.`,children:[(0,$.jsx)(g,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-mid-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-mid-strong)]`,title:`DNS records have been provisioned. Waiting for the email provider to verify them — this usually takes a few minutes.`,children:[(0,$.jsx)(b,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--system-negative-weak)] px-2.5 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,title:`Domain verification failed. DNS records may not have propagated correctly. You could try releasing and re-registering the domain.`,children:[(0,$.jsx)(_,{className:`h-3 w-3`}),`Verification failed`]}):(0,$.jsx)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--tag-bg-neutral)] px-2.5 py-0.5 text-body-small-default text-[var(--content-quiet)]`,title:`Unable to retrieve domain verification status.`,children:`Unknown status`})}function xn({onClick:e,disabled:t}){return(0,$.jsx)(c,{onClick:e,disabled:t,children:`Save`})}function Sn({onClick:e,filled:t=!1}){return(0,$.jsx)(c,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function Cn({guide:e}){return(0,$.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,$.jsx)(T,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`span`,{children:e.description}),(0,$.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,$.jsx)(w,{className:`h-3 w-3`})]})]})]})}function wn({subdomain:e,onSubdomainChange:t,domainSuffix:n,subdomainPlaceholder:r=`my-assistant`,disabled:i,autoFocus:a,prefix:o,error:s,locked:c,lockedMessage:l}){return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex h-9 w-full items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${s?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[o,(0,$.jsx)(`input`,{value:e,onChange:e=>t(e.target.value.toLowerCase().trim()),disabled:i||c,readOnly:c,autoFocus:a,placeholder:r,"aria-label":`Subdomain`,"aria-invalid":!!s,className:`h-full min-w-0 flex-1 bg-transparent ${o?`pl-1.5`:`pl-3`} pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none disabled:cursor-not-allowed disabled:opacity-60`}),(0,$.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`.`,n]})]}),s&&(0,$.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--system-negative-strong)]`,children:s}),c&&l&&(0,$.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:l})]})}function Tn({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=d(),i=l(),o=ht(),[s,m]=u(),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[M,P]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{_||!t||h||(g(t),v(!0))},[t,_,h]);let F=f({...Jt(),enabled:!0}),I=F.data,L=I?.entitlements,R=L?.managed_email===!0,V=!!L&&!R,ee=!I&&F.isError&&!F.isFetching,H=f({...Lt({path:{assistant_id:e}}),enabled:!V}),U=f({...Gt({path:{assistant_id:e}}),enabled:!V}),W=H.data?.results?.[0],G=U.data?.results?.[0],te=W?`${W.subdomain}.${n}`:null,ne=f({...Vt({path:{assistant_id:e,id:G?.id??``}}),enabled:!!G?.id,refetchOnWindowFocus:!1}),K=f({...qt({path:{assistant_id:e,id:W?.id??``}}),enabled:!!W?.id,refetchInterval:e=>{let t=e.state.data?.status;return t===`verified`||t===`failed`?!1:1e4},refetchOnWindowFocus:!0});(0,Q.useEffect)(()=>{s.get(`release`)!==`1`||!W||G||(A(!0),m(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[G,W,s,m]);let q=p(Wt()),J=p(Kt()),Y=p(Rt()),re=p(zt()),X=(0,Q.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:Ht({path:t})}),r.invalidateQueries({queryKey:Ut({path:t})}),G?.id&&r.invalidateQueries({queryKey:Bt({path:{...t,id:G.id}})}),r.invalidateQueries({queryKey:Xt()})},[G?.id,e,r]),ie=(0,Q.useCallback)(async()=>{let t=h.trim().toLowerCase();if(!t){b(`Enter a subdomain.`);return}E(!1);try{await q.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),g(``),b(null),X(),z.success(`Domain ${t}.${n} registered.`)}catch(e){b(ot(e,void 0,`Failed to register domain.`))}},[e,n,X,q,h]),ae=(0,Q.useCallback)(async()=>{let t=x.trim().toLowerCase();if(!t){w(`Enter an email username.`);return}try{await Y.mutateAsync({path:{assistant_id:e},body:{username:t}}),S(``),w(null),X(),z.success(`Email address created.`)}catch(e){w(ot(e,void 0,`Failed to create email address.`))}},[e,X,Y,x]),oe=(0,Q.useCallback)(async()=>{if(G?.id){P(!1);try{await re.mutateAsync({path:{assistant_id:e,id:G.id}}),X(),z.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),z.error(`Failed to remove email address.`)}}},[G?.id,e,re,X]),se=(0,Q.useCallback)(async()=>{if(!W?.id)return;if(G){z.error(`Remove the email address first.`);return}A(!1);let t=W.subdomain;try{await J.mutateAsync({path:{assistant_id:e,id:W.id}}),g(t),X(),z.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),z.error(`Failed to release domain.`)}},[G,e,J,W?.id,W?.subdomain,X]);if(F.isLoading)return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(V)return(0,$.jsx)(N,{tone:`info`,icon:(0,$.jsx)(O,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Give your assistant its own email address`,actions:o?void 0:(0,$.jsx)(c,{size:`compact`,onClick:()=>i(gt.plans),children:`Upgrade`}),children:o?Qt:(0,$.jsx)($.Fragment,{children:`Upgrade to a plan that includes an email address for your assistant. No provider setup required.`})});let Z=ee?(0,$.jsx)(N,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,$.jsx)(c,{size:`compact`,variant:`outlined`,onClick:()=>F.refetch(),children:`Retry`}),children:`We couldn't reach the billing service. The form below assumes managed email is enabled for your org — if it isn't, registering a domain will fail.`}):null;return W?G?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[Z,(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:G.address}),(0,$.jsx)(bn,{status:K.data?.status,message:K.data?.message,isLoading:K.isLoading}),(0,$.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,$.jsx)(j,{}),onClick:()=>P(!0),disabled:re.isPending,"aria-label":`Remove email address`})]}),(0,$.jsx)(B,{open:M,title:`Remove Email Address`,message:(0,$.jsxs)($.Fragment,{children:[`Are you sure you want to remove`,` `,(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:G.address}),`? Your assistant will no longer be able to send or receive email at this address.`]}),confirmLabel:`Remove`,destructive:!0,onConfirm:oe,onCancel:()=>P(!1)})]}),ne.data?.usage&&(0,$.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[ne.data.usage.sent_today,` /`,` `,ne.data.usage.daily_limit,` sent today ·`,` `,ne.data.usage.received_today,` received`]})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[Z,(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[W.subdomain,`.`,n]}),(0,$.jsx)(bn,{status:K.data?.status,message:K.data?.message,isLoading:K.isLoading}),(0,$.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,$.jsx)(j,{}),onClick:()=>A(!0),disabled:J.isPending,"aria-label":`Release domain`})]}),(0,$.jsx)(B,{open:k,title:`Release Domain`,message:(0,$.jsxs)($.Fragment,{children:[`Are you sure you want to release`,` `,(0,$.jsxs)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:[W.subdomain,`.`,n]}),`? The subdomain will become available for others to claim.`]}),confirmLabel:`Release`,destructive:!0,onConfirm:se,onCancel:()=>A(!1)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex h-9 min-w-0 flex-1 items-center rounded-md border bg-[var(--field-bg)] text-body-medium-lighter transition-[border-color] duration-150 ${C?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,$.jsx)(`input`,{value:x,onChange:e=>{S(e.target.value.toLowerCase()),C&&w(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!C,className:`h-full min-w-0 flex-1 bg-transparent pl-3 pr-1 text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,$.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,te]})]}),(0,$.jsx)(c,{onClick:ae,disabled:Y.isPending||!x.trim(),children:Y.isPending?`Creating…`:`Create`})]}),C&&(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:C})]})]}):(0,$.jsxs)(`div`,{className:`space-y-3`,children:[Z,(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,$.jsx)(wn,{subdomain:h,onSubdomainChange:e=>{g(e),y&&b(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:y}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Each assistant gets its own subdomain. Lowercase letters, numbers, and hyphens only.`}),(0,$.jsx)(c,{onClick:()=>E(!0),disabled:q.isPending||!h.trim(),children:q.isPending?`Registering…`:`Register`}),(0,$.jsx)(B,{open:T,title:`Set Subdomain`,message:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:h.trim().toLowerCase()||`subdomain`}),` `,`will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:ie,onCancel:()=>E(!1)})]})}function En(){let e=on(),r=vt(),{data:o}=f({...Yt(),enabled:r}),s=o?.results?.[0]?.handle,c=mn.use.emailRootDomain(),l=_t(),[u,d]=(0,Q.useState)(()=>l===`gated`?`your-own`:oe(t(Be,`managed`),`managed`)),[p,m]=(0,Q.useState)(()=>{let e=t(Je,`resend`);return e===`mailgun`||e===`resend`?e:`resend`}),{platformAssistantId:h,error:g}=pn(e,l===`full`&&u===`managed`),_=h??(g?e:null),y=f({queryKey:[`byoEmailCredential`,e,p],queryFn:async()=>{let{data:t}=await mt({path:{assistant_id:e},body:{service:p,field:`api_key`},throwOnError:!0});return t},enabled:u===`your-own`||l===`gated`,staleTime:6e4,retry:i,meta:{errorContext:`byo_email_credential_check`}});(0,Q.useEffect)(()=>{y.error&&a(y.error,{context:`byo_email_credential_check`,bestEffort:!0})},[y.error]);let b=y.data?.hasSecret===!0,x=(0,Q.useCallback)(e=>{d(e),n(Be,e)},[]),S=(0,Q.useCallback)(()=>{n(Je,p),z.success(`Email settings saved.`)},[p]),C=(0,Q.useMemo)(()=>We.find(e=>e.id===p)??We[0],[p]),E=(0,$.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,$.jsx)(T,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsxs)(`span`,{children:[`Configure `,C.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:C.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,$.jsxs)(`a`,{href:C.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,C.displayName,(0,$.jsx)(w,{className:`h-3 w-3`})]})]})]}),O=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{value:p,onChange:e=>{(e===`mailgun`||e===`resend`)&&m(e)},options:We.map(e=>({value:e.id,label:e.displayName}))})]}),b?(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-[var(--system-positive-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-default)]`,children:[(0,$.jsx)(v,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,$.jsxs)(`span`,{children:[C.displayName,` API key configured. To reconfigure, run the`,` `,(0,$.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:C.setupSkill}),` `,`skill.`]})]}),(0,$.jsxs)(`a`,{href:C.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-body-small-default text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,C.displayName,(0,$.jsx)(w,{className:`h-3 w-3`})]})]}):E,(0,$.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,$.jsx)(xn,{onClick:S,disabled:!1})})]});return l===`gated`?(0,$.jsx)(vn,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:O}):(0,$.jsx)(_n,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:u,onModeChange:x,children:u===`managed`?(0,$.jsx)(`div`,{className:`space-y-4`,children:l===`disabled`?(0,$.jsx)(Zt,{children:`Log in to the Vellum platform to manage email settings.`}):_===null?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Connecting to the Vellum platform…`]}):(0,$.jsx)(Tn,{assistantId:_,assistantHandle:s,emailRootDomain:c})}):O})}function Dn(){let e=on();return(0,Q.useCallback)(async(t,n)=>{try{let{data:r}=await ut({path:{assistant_id:e},body:{value:n,type:`api_key`,name:t},throwOnError:!0});K(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?z.error(`Assistant not ready. Please try again.`):z.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}function On(e){let[t,n]=(0,Q.useState)(void 0);return(0,Q.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,Q.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}var kn=`0.11.0`;function An(){return rt(kn)}var jn=`gemini-3.1-flash-image-preview`;function Mn(){let e=on(),r=d(),i=vt(),{data:o}=f({...Tt({path:{assistant_id:e}}),enabled:i,staleTime:3e4}),s=xt({onSuccess:t=>{Mt(r,{path:{assistant_id:e}},t)}}),c=Dn(),[l,u]=On((0,Q.useMemo)(()=>{if(!o)return t(Ke,`gemini`);let e=o.services?.[`image-generation`];return e?.mode===`managed`?`vellum`:e?.provider||t(`vellum:ai:imageGenProvider`,`gemini`)},[o])),[p,m]=(0,Q.useState)(()=>t(Ne,jn)),h=Qe(l),g=h.includes(p)?p:h[0]??jn,[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(!1),x=Re.map(e=>({value:e,label:Me[e]??e})),S=(0,Q.useMemo)(()=>Qe(l).map(e=>({value:e,label:ze[e]??e})),[l]),C=l===`gemini`||l===`openai`,{hasStoredCredential:w}=_e({assistantId:e,credentialKind:`api_key`,credentialName:l,enabled:C}),T=u,E=(0,Q.useCallback)(async()=>{b(!0);let t=_.trim(),i=C&&t.length>0;try{i&&await c(Oe(g),t),await it();let n=l===`vellum`&&!An()?{mode:`managed`}:{provider:l,mode:l===`vellum`?`managed`:`your-own`};await s.mutateAsync({path:{assistant_id:e},body:{services:{"image-generation":n}}}).catch(e=>{throw z.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});try{await lt({path:{assistant_id:e},body:{modelId:g},throwOnError:!0})}catch(e){throw z.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{r.invalidateQueries({queryKey:Ot({path:{assistant_id:e}})})}}catch{b(!1);return}b(!1);try{if(n(Ke,l),n(Ne,g),i){let t=et(e,`api_key`,l);r.setQueryData(t,!0),r.invalidateQueries({queryKey:t}),v(``)}z.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),z.error(`Saved, but local preferences could not be written.`)}},[_,l,C,g,e,s,c,r]),O=(0,Q.useCallback)(()=>{v(``),m(jn),n(Ne,jn)},[]);return(0,$.jsx)(vn,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{"aria-label":`Image generation provider`,value:l,onChange:T,options:x})]}),l===`vellum`&&(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Image generation runs through your Vellum account.`}),C&&(0,$.jsx)(I,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:Ee(l===`openai`?`Enter your OpenAI API key`:`Enter your Gemini API key`,w),fullWidth:!0}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,$.jsx)(V,{"aria-label":`Image generation model`,value:g,onChange:m,options:S})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(xn,{onClick:E,disabled:y}),y&&(0,$.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),C&&(0,$.jsx)(Sn,{onClick:O})]})]})})}function Nn({title:e,count:t,action:n,children:r}){return(0,$.jsxs)(`section`,{className:`rounded-xl border border-[var(--border-hover)] bg-[var(--surface-overlay)] px-3 py-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,$.jsx)(h,{variant:`body-large-default`,as:`h3`,className:`text-[var(--content-secondary)]`,children:e}),t==null?null:(0,$.jsxs)(h,{variant:`body-large-default`,as:`span`,"aria-label":`${t} ${e.toLowerCase()}`,className:`text-[var(--content-disabled)]`,children:[`·`,` `,t]})]}),n]}),r==null?null:(0,$.jsx)(`div`,{className:`mt-4 border-t border-[var(--border-base)]`,children:r})]})}function Pn(e){return e.scheduleNames.length>0||e.deferredReminderCount>0||e.scheduleLookupFailed}var Fn=5;function In(e,t){return`${e} ${t}${e===1?``:`s`}`}function Ln(e){return e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(`, `)}, and ${e.at(-1)}`}function Rn(e){let t=e.label||e.name,n=[];e.isActive&&n.push(`is your default profile`),e.callSiteIds.length>0&&n.push(`is used by ${In(e.callSiteIds.length,`action override`)}`);let r=[];return e.scheduleNames.length>0&&r.push(In(e.scheduleNames.length,`schedule`)),e.deferredReminderCount>0&&r.push(In(e.deferredReminderCount,`reminder`)),r.length>0&&n.push(`runs ${Ln(r)}`),n.length===0?`Choose a replacement profile for "${t}". Anything still pointing at it moves there before it is deleted.`:`"${t}" ${Ln(n)}. Pick a replacement below and those references move to it, then "${t}" is deleted.`}function zn({title:e,items:t,mono:n}){return(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--content-tertiary)`,children:e}),(0,$.jsx)(`ul`,{className:`space-y-1 pl-1`,children:t.map(e=>(0,$.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,n?(0,$.jsx)(`code`,{children:e}):e]},e))})]})}function Bn({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:s}){let l=e?.scheduleNames??[],u=l.slice(0,Fn),d=l.length-u.length,f=e!=null&&Pn(e);return(0,$.jsx)(R.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,$.jsxs)(R.Content,{size:`sm`,children:[(0,$.jsx)(R.Header,{children:(0,$.jsx)(R.Title,{children:`Choose a Replacement Profile`})}),(0,$.jsxs)(R.Body,{className:`space-y-4`,children:[e&&(0,$.jsx)(h,{variant:`body-medium-default`,as:`p`,children:Rn(e)}),e&&e.callSiteIds.length>0&&(0,$.jsx)(zn,{title:`Action overrides`,items:e.callSiteIds,mono:!0}),u.length>0&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(zn,{title:`Schedules`,items:u}),d>0&&(0,$.jsxs)(h,{variant:`body-small-default`,as:`p`,className:`pl-1 text-(--content-tertiary)`,children:[`and `,d,` more`]})]}),e?.scheduleLookupFailed&&(0,$.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-mid-strong)`,children:`We could not check which schedules use this profile. Any schedule pinned to it moves to the replacement as well.`}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-(--content-tertiary)`,children:`Replacement profile`}),(0,$.jsx)(V,{"aria-label":`Replacement profile`,value:n,onChange:r,placeholder:`Select a replacement…`,options:t.map(e=>{let t=f&&e.status===`disabled`;return{value:e.name,label:le(e),disabled:t,tooltip:t?`Enable this profile to move schedules onto it.`:void 0}})})]}),i&&(0,$.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,$.jsxs)(R.Footer,{children:[(0,$.jsx)(c,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,$.jsx)(c,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:s,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function Vn({profile:e,isActiveProfile:t,selected:n,connections:r,deletePending:i=!1,onOpen:a,onMakeActive:o,onSetStatus:l,onDelete:u}){let d=e.source===`managed`,f=e.status===`disabled`,p=e.label??e.name,m=[];e.model&&m.push(ge(e.provider??void 0,e.model,r)),d&&m.push(`Managed by Vellum`);let h=e.availability,g=h?.status===`incomplete`,v=h!=null&&h.status!==`ok`?`${h.message??`This profile's provider is not available.`}${g?` Click to fix.`:``}`:null;return(0,$.jsx)(x,{title:(0,$.jsx)(`span`,{className:f?`opacity-55`:void 0,children:p}),subtitle:m.length>0?m.join(` • `):void 0,onClick:a,showChevron:!1,selected:n,disabled:i,contentAriaLabel:`Open profile ${p}`,trailingInteractive:!0,trailing:(0,$.jsxs)($.Fragment,{children:[v==null?null:(0,$.jsx)(s,{content:v,children:g?(0,$.jsx)(`button`,{type:`button`,onClick:a,"aria-label":v,className:`inline-flex cursor-pointer rounded-sm p-0.5 keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:(0,$.jsx)(_,{className:`h-4 w-4 text-[var(--system-mid-strong)]`,"aria-hidden":`true`})}):(0,$.jsx)(`span`,{className:`inline-flex p-0.5`,tabIndex:0,children:(0,$.jsx)(_,{className:`h-4 w-4 text-[var(--system-mid-strong)]`,"aria-label":v,role:`img`})})}),f?(0,$.jsx)(P,{tone:`neutral`,children:`Disabled`}):null,t?(0,$.jsx)(P,{tone:`positive`,children:`Default`}):null,(0,$.jsxs)(y.Root,{children:[(0,$.jsx)(y.Trigger,{asChild:!0,children:(0,$.jsx)(c,{variant:`ghost`,size:`compact`,iconOnly:(0,$.jsx)(C,{}),"aria-label":`Actions for ${p}`,disabled:i})}),(0,$.jsxs)(y.Content,{align:`end`,sideOffset:4,children:[(0,$.jsx)(y.Item,{onSelect:a,children:d?`View`:`Edit`}),!t&&!f?(0,$.jsx)(y.Item,{onSelect:o,children:`Make Default`}):null,f?(0,$.jsx)(y.Item,{onSelect:()=>l(!0),children:`Enable`}):d?null:(0,$.jsx)(y.Item,{onSelect:()=>l(!1),children:`Disable`}),d?null:(0,$.jsx)(y.Item,{onSelect:u,className:`text-[var(--system-negative-strong)] data-[highlighted]:text-[var(--system-negative-strong)]`,children:`Delete`})]})]})]})})}var Hn=`0.11.0`;function Un(){return nt(Hn)}function Wn(e,t){let n=Un(),{data:r}=f({...St({path:{assistant_id:e}}),enabled:n,staleTime:3e4}),{profiles:i,profileOrder:a}=Xe(t?.llm,e);return(0,Q.useMemo)(()=>r==null?{entries:ae(i,a).map(e=>({name:e.name,label:e.label??null,provider:e.provider??null,model:e.model??null,status:e.status===`disabled`?`disabled`:`active`,source:e.source===`managed`?`managed`:`user`,provider_connection:e.provider_connection,availability:null})),isEffectiveCatalog:!1}:{entries:r.profiles,isEffectiveCatalog:!0},[r,i,a])}function Gn(e){let t=d();return xt({onSuccess:n=>{Mt(t,{path:{assistant_id:e}},n),t.invalidateQueries({queryKey:Ct({path:{assistant_id:e}})})}})}var Kn=`0.10.8`;function qn(e){return at(Kn,e)}var Jn=`settings-ai-profile-make-active`,Yn=`Failed to set the active profile. Please try again.`;function Xn(e){let t=Gn(e),n=d(),r=qn(e),i=At({onSuccess:()=>{n.invalidateQueries({queryKey:Ot({path:{assistant_id:e}})}),n.invalidateQueries({queryKey:Ct({path:{assistant_id:e}})})}});async function o(n,r,i){try{await t.mutateAsync({path:{assistant_id:e},body:{llm:n}})}catch(e){throw a(e,{context:r}),z.error(i),e}}async function s(t){if(!r){await o({activeProfile:t},Jn,Yn);return}try{await i.mutateAsync({path:{assistant_id:e},body:{name:t}})}catch(e){let t=st(e);throw z.error(t??Yn),t||a(e,{context:Jn}),e}}return{makeActive:s,setStatus:(e,t)=>o({profiles:{[e]:{status:t?`active`:`disabled`}}},`settings-ai-profile-toggle`,`Failed to update the profile. Please try again.`),deleteProfile:(e,t,n)=>o({profiles:{[e]:null},profileOrder:t.filter(t=>t!==e),...n?.isAdvisor?{advisorProfile:null}:{}},`settings-ai-profile-delete`,`Failed to delete the profile. Please try again.`),patchLlm:o,isPending:t.isPending||i.isPending}}var Zn=`The profile was not deleted.`,Qn=`Failed to move the schedules. ${Zn}`;function $n(e){let t=st(e);return t?`${/[.!?]$/.test(t)?t:`${t}.`} ${Zn}`:Qn}function er(e,t,n){let r=Xn(e),i=d(),o=ue(),s=t?.llm?.activeProfile??null,c=t?.llm?.advisorProfile??null,l=t?.llm?.callSites??{},u=(0,Q.useMemo)(()=>t?.llm?.profiles??{},[t?.llm?.profiles]),f=(0,Q.useMemo)(()=>t?.llm?.profileOrder??[],[t?.llm?.profileOrder]),p=(0,Q.useMemo)(()=>ae(u,f),[u,f]),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),w=(0,Q.useRef)(!1);function T(e){let t=p.filter(t=>t.name===e?!1:t.status===`disabled`?!0:de(t,p,{requireOwnProviderAndModel:o})),n=t.filter(e=>e.source!==`managed`||e.name===s);return n.length>0?n:t}function E(e,t){let n=T(e).filter(e=>!t||e.status!==`disabled`);return(n.find(e=>e.name===s)??n[0])?.name??``}async function D(e){try{await r.deleteProfile(e,f,{isAdvisor:e===c}),n?.onDeleted?.(e)}catch{}}async function O(t){let n=u[t]?.label??t,r=t===s,o=Object.entries(l).filter(([e,n])=>e!==`mainAgent`&&n?.profile===t).map(([e])=>e),c=[],d=0,f=!1;if(await fn(e))try{let n=(await i.fetchQuery({...Nt({path:{assistant_id:e},query:{inference_profile:t,include_all:`true`}}),retry:!1,staleTime:0})).schedules??[];c=n.filter(e=>!e.isDeferred).map(e=>e.name),d=n.filter(e=>e.isDeferred).length}catch(e){a(e,{context:`settings-ai-profile-delete-schedule-scan`}),f=!0}if(!(r||o.length>0||c.length>0||d>0)&&!f){await D(t);return}let p={name:t,label:n,isActive:r,callSiteIds:o,scheduleNames:c,deferredReminderCount:d,scheduleLookupFailed:f};h(p),y(E(t,Pn(p))),_(null)}function k(e){t==null||w.current||(w.current=!0,C(e),O(e).finally(()=>{w.current=!1,C(null)}))}async function A(){if(!m||!v)return;if(x(!0),_(null),Pn(m))try{await ln(e,m.name,v),await i.invalidateQueries({queryKey:Ft({path:{assistant_id:e}})})}catch(e){a(e,{context:`settings-ai-profile-reassign-schedules`}),_($n(e)),x(!1);return}let t={};if(m.isActive&&(t.activeProfile=v),m.callSiteIds.length>0){let e={};for(let t of m.callSiteIds)e[t]={profile:v};t.callSites=e}if(Object.keys(t).length>0)try{await r.patchLlm(t,`settings-ai-profile-reassign-delete`,`Failed to reassign references. Please try again.`)}catch{_(`Failed to reassign references. Please try again.`),x(!1);return}let n=m.name;h(null),x(!1),D(n)}return{requestDelete:k,pendingDeleteName:S,blockedDeleteModalProps:{blocked:m,availableReplacements:T(m?.name??null),replacement:v,onReplacementChange:y,error:g,saving:b,onClose:()=>{h(null),_(null)},onConfirm:()=>void A()}}}function tr(){}function nr({assistantId:e,config:t,connections:n,selectedProfileName:r,onOpenProfile:i,onCreateProfile:a,onProfileDeleted:o}){let{entries:s}=Wn(e,t),l=Xn(e),u=er(e,t,{onDeleted:o}),d=t?.llm?.activeProfile??null;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Nn,{title:`Profiles`,action:(0,$.jsx)(c,{variant:`primary`,size:`compact`,onClick:a,leftIcon:(0,$.jsx)(k,{}),disabled:t==null,children:`Create Profile`}),children:t==null?(0,$.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`Loading profiles…`}):s.length===0?(0,$.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No profiles yet. Create one to get started.`}):s.map(e=>(0,$.jsx)(Vn,{profile:e,isActiveProfile:e.name===d,selected:e.name===r,connections:n,deletePending:u.pendingDeleteName===e.name,onOpen:()=>i(e.name),onMakeActive:()=>void l.makeActive(e.name).catch(tr),onSetStatus:t=>void l.setStatus(e.name,t).catch(tr),onDelete:()=>u.requestDelete(e.name)},e.name))}),(0,$.jsx)(Bn,{...u.blockedDeleteModalProps})]})}var rr={anthropic:!0,openai:!0,gemini:!0,fireworks:!0,openrouter:!0,vellum:!0,together:!0,"vercel-ai-gateway":!0,minimax:!0,atlascloud:!0,baseten:!0,poolside:!0};function ir(e){return e in rr}function ar(e){let t=e.baseUrl??``;try{e.baseUrl&&(t=new URL(e.baseUrl).host)}catch{}let n=[];t&&n.push(t);let r=e.models?.length??0;return r>0&&n.push(`${r} ${r===1?`model`:`models`}`),e.auth.type===`none`&&n.push(`keyless`),n.join(` · `)}function or(e){switch(e.auth.type){case`api_key`:return`Own API key`;case`oauth_subscription`:return`ChatGPT subscription`;case`none`:return`No API key needed`;default:return null}}function sr(e){if(e.provider===`vellum`)return`Included with your plan`;if(e.provider===`openai-compatible`)return ar(e);let t=[],n=e.models?.length??U(e.provider).length;n>0&&t.push(`${n} ${n===1?`model`:`models`}`);let r=or(e);return r&&t.push(r),t.join(` • `)}function cr({connection:e,isDefault:t,supportsDefaultProvider:n,selected:r,isSettingDefault:i,onOpen:a,onSetDefault:o,onDelete:s}){let l=e.isManaged??!1,u=je(e),d=ir(e.provider),f=sr(e),p=n&&!t&&d,m=!l&&a!=null,h=!l&&!t,g=p||m||h;return(0,$.jsx)(x,{title:u,subtitle:f.length>0?f:void 0,onClick:a,showChevron:!1,selected:r,contentAriaLabel:a?`Open provider ${u}`:void 0,trailingInteractive:!0,trailing:(0,$.jsxs)($.Fragment,{children:[l?(0,$.jsx)(P,{tone:`neutral`,title:`Runs on Vellum's managed credentials.`,children:`Managed`}):null,t?(0,$.jsx)(P,{tone:`info`,title:`Built-in profiles (Balanced, Quality, Cost, Speed) use this provider.`,children:`Default`}):null,e.provider===`ollama`?(0,$.jsx)(P,{tone:`neutral`,title:`Runs models on this machine.`,children:`Local`}):null,e.provider===`openai-compatible`?(0,$.jsx)(P,{tone:`neutral`,title:`A provider you created, served by an OpenAI-compatible endpoint.`,children:`Custom`}):null,g?(0,$.jsxs)(y.Root,{children:[(0,$.jsx)(y.Trigger,{asChild:!0,children:(0,$.jsx)(c,{variant:`ghost`,size:`compact`,iconOnly:(0,$.jsx)(C,{}),"aria-label":`Actions for ${u}`})}),(0,$.jsxs)(y.Content,{align:`end`,sideOffset:4,children:[m?(0,$.jsx)(y.Item,{onSelect:a,children:`Edit`}):null,p?(0,$.jsx)(y.Item,{disabled:i,onSelect:o,children:`Set as default`}):null,h?(0,$.jsx)(y.Item,{onSelect:s,className:`text-[var(--system-negative-strong)] data-[highlighted]:text-[var(--system-negative-strong)]`,children:`Delete`}):null]})]}):(0,$.jsx)(`span`,{className:`inline-block w-8`,"aria-hidden":!0})]})})}function lr(e,t){let n=d(),r={path:{assistant_id:e}},i=p({...kt(),onSuccess:()=>{n.invalidateQueries({queryKey:jt(r)}),n.invalidateQueries({queryKey:Ot(r)}),n.invalidateQueries({queryKey:Ct(r)})},onError:e=>{a(e,{context:`settings-ai-set-default-provider`}),z.error(`Failed to set the default provider. Please try again.`)}});function o(t){ir(t.provider)&&i.mutate({path:{assistant_id:e},body:{provider:t.provider,connectionName:t.name}})}function s(e){return i.isPending&&i.variables?.body?.connectionName===e}async function c(i){try{let{response:a}=await pt({path:{assistant_id:e,name:i}});a?.ok||a?.status===404?(n.invalidateQueries({queryKey:bt(r)}),t?.onDeleted?.(i)):a?.status===409?z.error(`This provider is in use by a profile or as the default provider. Update those settings before deleting it.`):z.error(`Failed to delete the provider. Please try again.`)}catch(e){a(e,{context:`settings-ai-provider-delete`}),z.error(`Failed to delete the provider. Please try again.`)}}return{setDefault:o,isSettingDefault:s,deleteConnection:c}}var ur=`0.10.8`;function dr(){return nt(ur)}function fr({assistantId:e,selectedConnectionName:t,onOpenConnection:n,onAddProvider:r,onConnectionDeleted:i}){let{data:a,isLoading:o,isError:s}=f(wt({path:{assistant_id:e}})),l=dr(),{data:u}=f({...Dt({path:{assistant_id:e}}),enabled:l}),d=l?u?.resolvedConnectionName??null:null,p=lr(e,{onDeleted:i}),m=(0,Q.useMemo)(()=>{let e=a?.connections??[];return[...e.filter(e=>e.provider===ie),...e.filter(e=>e.provider!==ie)]},[a]);return(0,$.jsx)(Nn,{title:`Providers`,action:(0,$.jsx)(c,{variant:`outlined`,size:`compact`,onClick:r,leftIcon:(0,$.jsx)(k,{}),children:`Add Provider`}),children:o?(0,$.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,$.jsx)(ee,{className:`h-10 rounded-lg`},e))}):s?(0,$.jsx)(h,{variant:`body-medium-default`,as:`p`,className:`py-4 text-center text-(--system-negative-strong)`,children:`Failed to load providers. Please try again.`}):m.length===0?(0,$.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`py-4 text-center text-(--content-tertiary)`,children:`No providers yet. Add one to get started.`}):m.map(e=>(0,$.jsx)(cr,{connection:e,isDefault:e.name===d,supportsDefaultProvider:l,selected:e.name===t,isSettingDefault:p.isSettingDefault(e.name),onOpen:e.isManaged??!1?void 0:()=>n(e.name),onSetDefault:()=>p.setDefault(e),onDelete:()=>void p.deleteConnection(e.name)},e.name))})}function pr({panel:e,onOpenPanel:t,onClosePanel:n}){let r=on(),{data:i}=f({...Tt({path:{assistant_id:r}}),staleTime:3e4}),a=dr(),{data:o}=f({...Dt({path:{assistant_id:r}}),enabled:a}),s=o?.availability,{data:l}=f({...wt({path:{assistant_id:r}})}),u=l?.connections,d=i?.llm?.callSites??{},p=Object.entries(d).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length;return(0,$.jsx)(vn,{title:`Language Model`,subtitle:`Profiles choose which model answers. Providers supply access to it`,children:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[s&&s.status!==`ok`&&(0,$.jsx)(N,{tone:s.status===`unknown`?`warning`:`error`,children:s.message??`Your default provider is not available.`}),r&&(0,$.jsx)(nr,{assistantId:r,config:i,connections:u,selectedProfileName:e?.kind===`profile`?e.name:null,onOpenProfile:e=>t({kind:`profile`,name:e}),onCreateProfile:()=>t({kind:`create-profile`}),onProfileDeleted:t=>{e?.kind===`profile`&&e.name===t&&n()}}),r&&(0,$.jsx)(fr,{assistantId:r,selectedConnectionName:e?.kind===`provider`?e.name:null,onOpenConnection:e=>t({kind:`provider`,name:e}),onAddProvider:()=>t({kind:`add-provider`}),onConnectionDeleted:t=>{e?.kind===`provider`&&e.name===t&&n()}}),(0,$.jsx)(Nn,{title:`Overrides`,count:p,action:(0,$.jsx)(c,{variant:`outlined`,size:`compact`,onClick:()=>t({kind:`overrides`}),children:`Manage`})})]})})}function mr(e,{onSaved:t}={}){let n=Gn(e),{data:r}=f({...Tt({path:{assistant_id:e}}),staleTime:3e4}),i=(0,Q.useMemo)(()=>r?.llm?.profiles??{},[r?.llm?.profiles]),o=r?.llm?.profileOrder??[];async function s(r,s,c){let l=c?.mode??`replace`,u=!(r in i);if(l===`merge`&&!u){await n.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[r]:s}}}}),t?.();return}let d={profiles:{[r]:s}};if(u&&(d.profileOrder=o.includes(r)?o:[...o,r]),u)await n.mutateAsync({path:{assistant_id:e},body:{llm:d}});else{let t=i[r];await n.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[r]:null}}}});try{await n.mutateAsync({path:{assistant_id:e},body:{llm:d}})}catch(i){throw a(i,{context:`settings-ai-profile-edit-recreate`}),t!=null&&await n.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[r]:t}}}}).catch(()=>{}),i}}u&&z.success(`Profile "${s.label??r}" created`),t?.()}return{saveProfile:s,isPending:n.isPending}}function hr({assistantId:e,profileName:t,onClose:n}){let{data:r}=f({...Tt({path:{assistant_id:e}}),staleTime:3e4}),{data:i}=f({...wt({path:{assistant_id:e}})}),a=i?.connections,o=(0,Q.useMemo)(()=>r?.llm?.profiles??{},[r?.llm?.profiles]),s=Object.keys(o),l=(0,Q.useMemo)(()=>{if(t==null)return;let e=o[t];return e?{name:t,...e}:void 0},[t,o]),u=t==null?`create`:l?.source===`managed`||l?.invariant===!0?`view`:`edit`,{saveProfile:d,isPending:p}=mr(e,{onSaved:n}),m=He({mode:u,profileName:t??void 0,initialValues:l,existingNames:s,connections:a,assistantId:e,onSave:d}),h=er(e,r,{onDeleted:()=>n()}),g=t!=null&&h.pendingDeleteName===t,_=t!=null&&r!=null&&!(t in o);(0,Q.useEffect)(()=>{_&&!m.saving&&!p&&n()},[_,m.saving,p,n]);let v=u===`view`;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(sn,{title:m.effectiveMode===`create`?`New Profile`:l?.label??t??`Profile`,closeVariant:`outlined`,onClose:n,headerTrailing:v&&m.effectiveMode!==`create`?(0,$.jsx)(P,{tone:`neutral`,children:`Managed by Vellum`}):null,headerActions:m.effectiveMode!==`create`&&!m.isReadOnly?(0,$.jsx)(c,{variant:`outlined`,size:`compact`,leftIcon:(0,$.jsx)(j,{}),tintColor:`var(--system-negative-strong)`,onClick:()=>{t!=null&&h.requestDelete(t)},disabled:m.saving||g,children:g?`Deleting…`:`Delete`}):null,footer:m.isReadOnly?(0,$.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,$.jsx)(c,{variant:`outlined`,onClick:m.switchToSaveAsNew,disabled:m.saving,children:`Save As New`}),m.hasViewModeChanges?(0,$.jsx)(c,{variant:`primary`,onClick:()=>void m.handleSave(),disabled:m.saving,children:m.saving?`Saving…`:`Save`}):null]}):(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(c,{variant:`primary`,onClick:()=>void m.handleSave(),disabled:m.isInvalid||m.saving,children:m.saving?`Saving…`:m.effectiveMode===`create`?`Create Profile`:`Save Changes`})}),children:(0,$.jsx)(Ve,{editor:m,assistantId:e,connections:a,variant:`panel`})}),(0,$.jsx)(Bn,{...h.blockedDeleteModalProps})]})}function gr({value:e,profileOptions:t,disabled:n,onChange:r}){return(0,$.jsx)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:`Advisor`}),(0,$.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`The profile your assistant consults for a second opinion when it wants to check a plan or review its own work.`})]}),(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:(0,$.jsx)(V,{value:e,onChange:r,options:t,placeholder:`Choose profile…`,className:`w-44`,menuMinWidth:280,menuAlign:`end`,disabled:n})})]})})}var _r=`__custom__`;function vr(e){return e?!!(e.profile||e.provider||e.model):!1}function yr(e,t){let n=vr(e);return n===vr(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function br({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=vr(i),l=!i||!c?``:i.provider||i.model?_r:i.profile??``,u=l===_r,d=Ae(),f=d[0]??pe[0],p=d.find(e=>e===i?.provider)??f,m=U(p).map(e=>({value:e.id,label:e.displayName})),h=!!i?.provider&&!i?.model;function g(t){t===`__custom__`?o(e,{profile:null,provider:f,model:H(f)??``}):t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function _(t){let n=H(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function v(t){o(e,{...i??{},model:t})}return(0,$.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,$.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,$.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,$.jsx)(V,{value:l,onChange:g,options:a,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,$.jsx)(L,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,$.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsxs)(`div`,{className:`flex-1`,children:[(0,$.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{value:p??``,onChange:_,options:d.map(e=>({value:e,label:X[e]??e}))})]}),(0,$.jsxs)(`div`,{className:`flex-1`,children:[(0,$.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,$.jsx)(V,{value:i?.model??``,onChange:v,options:m})]})]}),h&&(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}function xr({groups:e,drafts:t,buildProfileOptionsForRow:n,profileLabelFor:r,advisorMatchesSearch:i,onDraftChange:a,onToggle:o}){return(0,$.jsx)(`div`,{className:`space-y-4`,children:e.length===0?i?null:(0,$.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):e.map(({domain:e,sites:i})=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,$.jsx)(`div`,{className:`space-y-1`,children:i.map(e=>{let i=(()=>{let n=t[e.id]??null;return!n||!vr(n)?``:n.provider||n.model?_r:n.profile??``})(),s=e.shippedDefaultProfile??e.defaultProfile,c=s?r(s):null;return(0,$.jsx)(br,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:c,draft:t[e.id]??null,profileOptions:n(i===``||i===`__custom__`?null:i),onDraftChange:a,onToggle:o},e.id)})})]},e.id))})}function Sr(e,t){let n={};for(let r of Object.keys(e)){let i=e[r]??null;vr(i)?n[r]={profile:i?.profile??null,provider:i?.provider??null,model:i?.model??null}:r in t&&t[r]===null&&(n[r]=null)}return n}function Cr(e){let t={};for(let n of Object.keys(e))t[n]=null;return t}function wr({catalogCallSiteIds:e,persistedOverrides:t,persistedAdvisor:n,isSeeded:r}){let[i,a]=(0,Q.useState)({}),[o,s]=(0,Q.useState)(void 0),c=(0,Q.useMemo)(()=>{if(!r)return{};let n={};for(let r of e)if(r in i)n[r]=i[r];else{let e=t[r];n[r]=e?{...e}:{}}return n},[r,e,t,i]),l=o??n,u=l!==n,d=(0,Q.useMemo)(()=>{if(!r)return!1;for(let e of Object.keys(c))if(!yr(c[e],t[e]))return!0;return!1},[r,c,t]);return{drafts:c,advisorProfile:l,advisorDirty:u,callSiteDraftsDirty:d,hasUnsavedDrafts:u||d,hasValidationError:(0,Q.useMemo)(()=>Object.values(c).some(e=>vr(e)&&!!e?.provider&&!e?.model),[c]),setDraft:(0,Q.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[]),setAdvisor:(0,Q.useCallback)(e=>{s(e)},[]),buildSavePatch:(0,Q.useCallback)(()=>Sr(c,i),[c,i]),buildResetPatch:(0,Q.useCallback)(()=>Cr(c),[c])}}function Tr({assistantId:e,onClose:t}){let n=d(),{data:r}=f({...Tt({path:{assistant_id:e}}),staleTime:3e4}),i=(0,Q.useMemo)(()=>r?.llm?.profiles??{},[r?.llm?.profiles]),o=(0,Q.useMemo)(()=>r?.llm?.profileOrder??[],[r?.llm?.profileOrder]),s=(0,Q.useMemo)(()=>r?.llm?.callSites??{},[r?.llm?.callSites]),l=(0,Q.useMemo)(()=>ae(i,o),[i,o]),u=Ae(),p=ue(),m=(0,Q.useMemo)(()=>({requireOwnProviderAndModel:p}),[p]),h=xt({onSuccess:t=>{Mt(n,{path:{assistant_id:e}},t)}}),[g,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),{data:C,isLoading:w,isError:T,refetch:E}=f({...Et({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),O=(0,Q.useMemo)(()=>(C?.callSites??[]).filter(e=>e.id!==`mainAgent`),[C]),k=!w&&!T&&!!C,j=!!r,M=k&&j,N=(0,Q.useMemo)(()=>O.map(e=>e.id),[O]),P=r?.llm?.advisorProfile??``,{drafts:F,advisorProfile:L,advisorDirty:R,callSiteDraftsDirty:V,hasUnsavedDrafts:ee,hasValidationError:U,setDraft:W,setAdvisor:G,buildSavePatch:ne,buildResetPatch:K}=wr({catalogCallSiteIds:N,persistedOverrides:s,persistedAdvisor:P,isSeeded:M}),q=(0,Q.useMemo)(()=>new Set(N),[N]),J=(0,Q.useCallback)(e=>l.find(t=>t.name===e)?.label??e,[l]),Y=(0,Q.useCallback)(e=>({value:e.name,label:le(e),...se(e,l,m)===`undispatchable`?{icon:(0,$.jsx)(_,{className:`h-3.5 w-3.5 text-[var(--system-mid-strong)]`}),tooltip:te(e)}:{}}),[l,m]),X=(0,Q.useMemo)(()=>Z(l,[P],m).map(Y),[l,P,Y,m]),ie=(0,Q.useMemo)(()=>{let e=g.trim().toLowerCase();return e===``||`advisor`.includes(e)||`second opinion`.includes(e)},[g]),oe=(0,Q.useMemo)(()=>Object.entries(s).some(([e,t])=>q.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[s,q]),ce=(0,Q.useCallback)(e=>[...Z(l,[e],m).map(Y),{value:_r,label:`Custom`}],[l,Y,m]),de=(0,Q.useMemo)(()=>{if(!g.trim())return O;let e=g.toLowerCase();return O.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[O,g]),fe=(0,Q.useMemo)(()=>{if(!C)return[];let e=C.domains.map(e=>e.id),t=new Map(C.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=de.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=de.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[C,de]),me=(0,Q.useCallback)((e,t)=>{if(!t){W(e,null);return}let n=re(l,O.find(t=>t.id===e)?.defaultProfile,m);if(n)W(e,{profile:n});else{let t=u[0]??pe[0];W(e,{provider:t,model:H(t)??``})}},[O,l,u,W,m]),he=(0,Q.useCallback)(async()=>{b(!0);try{let n=ne();await h.mutateAsync({path:{assistant_id:e},body:{llm:{...V?{callSites:n}:{},...R?{advisorProfile:L}:{}}}}),t(),z.success(`Overrides saved.`)}catch(e){z.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{b(!1)}},[ne,V,R,L,t,h,e]),ge=(0,Q.useCallback)(async()=>{b(!0);try{let n=K();await h.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),z.success(`Overrides reset.`)}catch(e){z.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{b(!1)}},[K,t,h,e]);return(0,$.jsxs)(sn,{title:`Action Overrides`,closeVariant:`outlined`,onClose:t,footer:(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[oe&&(0,$.jsx)(c,{variant:`outlined`,size:`compact`,onClick:()=>S(!0),disabled:y||!M,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,$.jsx)(c,{variant:`primary`,size:`compact`,onClick:()=>void he(),disabled:!ee||U||y,children:y?(0,$.jsx)(D,{className:`h-4 w-4 animate-spin`}):`Save`})]}),children:[(0,$.jsx)(`p`,{className:`mb-4 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`mb-4`,children:(0,$.jsx)(I,{type:`search`,value:g,onChange:e=>v(e.target.value),placeholder:`Search actions…`,leftIcon:(0,$.jsx)(A,{className:`h-4 w-4`}),fullWidth:!0})}),j&&ie&&(0,$.jsxs)(`div`,{className:`mb-4`,children:[(0,$.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:`Advisor`}),(0,$.jsx)(gr,{value:L,profileOptions:X,disabled:y,onChange:G})]}),w&&(0,$.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,$.jsx)(D,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),T&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,$.jsx)(c,{variant:`outlined`,size:`compact`,onClick:()=>void E(),children:`Retry`})]}),!w&&!T&&C&&(0,$.jsx)(xr,{groups:fe,drafts:F,buildProfileOptionsForRow:ce,profileLabelFor:J,advisorMatchesSearch:ie,onDraftChange:W,onToggle:me})]}),(0,$.jsx)(B,{open:x,title:`Reset to Defaults`,message:`Every action override will be reset and will follow its default. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{S(!1),ge()},onCancel:()=>S(!1)})]})}function Er({mode:e,connection:t,assistantId:n,existingNames:r,connections:i,variant:a=`modal`,onSave:o,onCancel:s}){let[l,u]=(0,Q.useState)(t?.label??``),f=t?.name??``,p=t?.provider??`anthropic`,m=t?.auth.type??`api_key`,[g,_]=(0,Q.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[v,y]=(0,Q.useState)(t?.baseUrl??``),[b,x]=(0,Q.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(null),E=p===`openai-compatible`,[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(!1),j=d(),M=(0,Q.useMemo)(()=>ke(g),[g]),N=m===`api_key`&&M!==null,{hasStoredCredential:P,isLoading:F}=_e({assistantId:n,credentialKind:`credential`,credentialName:M?`${M.service}:${M.field}`:``,enabled:N}),{credentials:L}=Te({assistantId:n,enabled:m===`api_key`});(0,Q.useEffect)(()=>{let e=t?.provider??`anthropic`;u(t?.label??``),t?.auth.type===`api_key`?_(t.auth.credential):_(t?``:`credential/${e}/api_key`),T(null),y(t?.baseUrl??``),x(t?.models?t.models.map(e=>e.id).join(`, `):``),O(``),A(!1)},[t]);let z=l.trim()!==(t?.label??``).trim(),B=E&&z?Ce(l,i,t?.name):null,V=f.trim().length>0&&B===null;async function ee(){if(V){C(!0),T(null);try{let e;if(m===`api_key`){let t=g.trim()||`credential/${p}/api_key`,r=D.trim();if(r){A(!0);try{let e=ke(t);await ut({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:p,value:r},throwOnError:!0});let i=et(n,`credential`,e?`${e.service}:${e.field}`:``);j.setQueryData(i,!0),j.invalidateQueries({queryKey:Pt({path:{assistant_id:n}})})}catch{T(`Failed to save API key. Please try again.`);return}finally{A(!1)}}e={type:`api_key`,credential:t}}else if(t)e=t.auth;else{T(`Nothing to edit. Close and try again.`);return}let r=l.trim()||null,i={auth:e,label:r,...E&&{base_url:v.trim()||null,models:b.trim()?b.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:a,error:s,response:c}=await ct({path:{assistant_id:n,name:t?.name??f.trim()},body:i});if(!c?.ok){T(be(c?.status,s)??xe(c?.status));return}if(!a){T(`Server returned an empty response. Please try again.`);return}o(a)}catch{T(`Failed to save provider. Please try again.`)}finally{C(!1)}}}let H=L.filter(e=>e.service===p),U=e!==`create`&&t?.auth.type===`api_key`,W=H.length>0||U,G=Ee(`Enter your API key`,P);if(e===`create`)return(0,$.jsx)(we,{variant:a===`panel`?`inline`:`modal`,assistantId:n,existingNames:r,connections:i,defaultProviderType:p,onCreated:o,onCancel:s});let te=(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,$.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,$.jsx)(I,{value:l,onChange:e=>u(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0}),B?(0,$.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:Se[B]}):null]}),E&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,$.jsx)(I,{value:v,onChange:e=>y(e.target.value),placeholder:`https://api.example.com/v1`,fullWidth:!0})]}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,$.jsx)(I,{value:b,onChange:e=>x(e.target.value),placeholder:`model-1, model-2`,fullWidth:!0}),(0,$.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),m===`api_key`&&(0,$.jsx)(ye,{apiKeyValue:D,onApiKeyChange:O,credential:g,onCredentialChange:_,isLoadingCredential:F,apiKeyPlaceholder:G,provider:p,providerCredentials:H,showAdvancedSection:W,onError:T}),m===`oauth_subscription`&&(0,$.jsx)(De,{assistantId:n,onConnected:o}),w&&(0,$.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:w})]}),ne=(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{variant:`ghost`,size:`compact`,onClick:s,children:`Cancel`}),(0,$.jsx)(c,{variant:`primary`,size:`compact`,disabled:!V||S||k,onClick:()=>void ee(),children:S?`Saving…`:`Save Changes`})]});return a===`panel`?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[te,(0,$.jsx)(`div`,{className:`flex justify-end gap-2`,children:ne})]}):(0,$.jsxs)(R.Content,{size:`md`,children:[(0,$.jsxs)(R.Header,{children:[(0,$.jsx)(R.Title,{children:`Edit Provider`}),(0,$.jsx)(R.Description,{children:t?`Editing ${je(t)}.`:`Edit provider settings.`})]}),(0,$.jsx)(R.Body,{children:te}),(0,$.jsx)(R.Footer,{children:ne})]})}function Dr({assistantId:e,connectionName:t,onClose:n}){let r=d(),{data:i}=f(wt({path:{assistant_id:e}})),a=(0,Q.useMemo)(()=>i?.connections??[],[i]),o=(0,Q.useMemo)(()=>t==null?void 0:a.find(e=>e.name===t),[t,a]),s=t!=null&&i!=null&&o==null;(0,Q.useEffect)(()=>{s&&n()},[s,n]);function c(){r.invalidateQueries({queryKey:bt({path:{assistant_id:e}})}),r.invalidateQueries({queryKey:jt({path:{assistant_id:e}})}),n()}return(0,$.jsx)(sn,{title:o?je(o):`Add Provider`,closeVariant:`outlined`,onClose:n,children:t==null||o!=null?(0,$.jsx)(Er,{mode:o?`edit`:`create`,connection:o,variant:`panel`,assistantId:e,existingNames:a.map(e=>e.name),connections:a,onSave:c,onCancel:n}):null})}var Or={vellum:{provider:`vellum`},deepgram:{provider:`deepgram`,credentialService:`deepgram`},openai:{provider:`openai-whisper`,credentialService:`openai`}},kr={vellum:`vellum`,deepgram:`deepgram`,"openai-whisper":`openai`},Ar=`deepgram`;function jr({assistantId:e,hideSaveButton:r=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=on(),s=e??o,c=vt(),l=d(),[u]=(0,Q.useState)(()=>$e.filter(e=>!e.requiresNativeDictation||ve())),p=Ar,{data:m}=f({...Tt({path:{assistant_id:s}}),enabled:c,staleTime:3e4}),h=m?.services?.stt,g=h?.mode===`managed`?`vellum`:h?.provider,_=(0,Q.useMemo)(()=>{let e=g?kr[g]:void 0;if(e&&u.some(t=>t.id===e))return e;let n=t(Fe,p);return u.some(e=>e.id===n)?n:p},[g,u,p]),v=!!g,[y,b]=On(_),{available:x,currentCode:S,configuredProviderId:C,selectLanguage:w,selecting:T}=$t(s),[E,D]=(0,Q.useState)(!1),O=x&&y===_&&(Or[y]?.provider===C||!!g&&!kr[g]),[k,A]=(0,Q.useState)(``),[j,N]=(0,Q.useState)(!1),[P,F]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{let e=t(Fe,p);e===`macos-native`&&!u.some(t=>t.id===e)&&n(Fe,p)},[u,p]);let L=(0,Q.useMemo)(()=>u.find(e=>e.id===y)??u[0],[u,y]),R=L.apiKeyPlaceholder!==void 0;(0,Q.useEffect)(()=>{N(t(Ye+y,``).length>0),A(``)},[y]);let B=(0,Q.useMemo)(()=>{let e=y!==_,t=k.trim().length>0;return e||t},[y,_,k]),ee=(0,Q.useCallback)(async()=>{let e=k.trim();n(Fe,y),e.length>0&&n(Ye+y,e);let r=Or[y];F(!0);try{if(r?.credentialService){let n=e.length>0?e:t(Ye+y,``);if(n.length>0){let{response:e}=await ft({path:{assistant_id:s},body:{service:r.credentialService,field:`api_key`,value:n,label:`${L.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}}if(r&&(y!==_||!v)||g===`vellum`&&y!==`vellum`){let e=r?.provider??Ar,{response:t}=await dt({path:{assistant_id:s},body:{services:{stt:{provider:e,mode:e===`vellum`?`managed`:`your-own`}}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}return e.length>0&&N(!0),A(``),l.invalidateQueries({queryKey:Ot({path:{assistant_id:s}})}),z.success(`Speech-to-text settings saved`),!0}catch(e){return z.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`),!1}finally{F(!1)}},[s,y,k,L,_,v,g,l]);(0,Q.useEffect)(()=>{a?.({hasChanges:B,saving:P,save:ee})},[a,B,P,ee]);let H=(0,Q.useCallback)(()=>{n(Ye+y,``),N(!1),A(``)},[y]),U=j?`•••••••• (Enter a new key to replace)`:L.apiKeyPlaceholder;return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{value:y,onChange:b,options:u.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),O&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Spoken language`}),(0,$.jsx)(Ge,{"aria-label":`Spoken language`,"aria-haspopup":`dialog`,onClick:()=>D(!0),value:en(S,C)}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Applies from your next spoken turn.`}),(0,$.jsx)(hn,{open:E,onOpenChange:D,title:`Spoken language`,currentCode:S,configuredProviderId:C,selectLanguage:w,selecting:T})]}),R&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,$.jsx)(I,{type:`password`,value:k,onChange:e=>A(e.target.value),placeholder:U,fullWidth:!0})]}),L.setupWarning&&(0,$.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,$.jsx)(M,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,$.jsx)(`span`,{children:L.setupWarning})]}),!i&&L.credentialsGuide&&(0,$.jsx)(Cn,{guide:L.credentialsGuide}),y===`vellum`&&(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Transcription runs through your Vellum account.`}),(!r||j)&&(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[!r&&(0,$.jsx)(xn,{onClick:ee,disabled:!B||P}),j&&(0,$.jsx)(Sn,{onClick:H})]})]})}function Mr(){return(0,$.jsx)(vn,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,$.jsx)(jr,{})})}async function Nr(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 Pr(n,r,i):t===`deepgram`?await Fr(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 Pr(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 Ir(i,`ElevenLabs rejected the request.`)}}async function Fr(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 Ir(n,`Deepgram rejected the request.`)}}async function Ir(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})`}}function Lr({assistantId:e,value:t,onChange:n,className:r}){let[i,a]=(0,Q.useState)(!1),{voices:o}=rn(e);if(o.length===0)return null;let s=o.find(e=>e.model===t)??o[0];return(0,$.jsxs)(F.Root,{open:i,onOpenChange:a,children:[(0,$.jsx)(F.Trigger,{asChild:!0,children:(0,$.jsx)(Ge,{"aria-label":`Voice`,value:s?tn(s.description):`Select a voice`,className:r})}),(0,$.jsx)(F.Content,{side:`bottom`,align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,children:(0,$.jsx)(nn,{assistantId:e,value:t,onChange:n,onSelect:()=>a(!1),showSource:!0})})]})}var Rr={elevenlabs:`voiceId`,"fish-audio":`referenceId`,xai:`voiceId`};function zr({assistantId:e,hideSaveButton:r=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=on(),s=e??o,l=tt.use.name()??`your assistant`,u=vt(),p=d(),{data:m}=f({...yt({path:{assistant_id:s}}),enabled:u,staleTime:1/0}),h=(0,Q.useMemo)(()=>{let e=m?.providers;if(!e)return Pe;if(e.some(e=>e.id===`vellum`))return e;let t=Pe.find(e=>e.id===`vellum`);return t?[t,...e]:e},[m]),{data:g}=f({...Tt({path:{assistant_id:s}}),enabled:u,staleTime:3e4}),_=g?.services?.tts,v=_?.mode===`managed`?`vellum`:_?.provider,y=`elevenlabs`,b=(0,Q.useMemo)(()=>v??t(`vellum:voice:ttsProvider`,y),[v,y]),x=!!v,[S,C]=On(b),[w,T]=(0,Q.useState)(``),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(!1),[F,L]=(0,Q.useState)(!1),{voices:R,defaultModel:B,fetched:ee}=an(s,{enabled:S===`vellum`}),H=_?.providers?.vellum?.model??B??``,[U,W]=On(H),G=R.find(e=>e.model===U)??R[0],[te,ne]=(0,Q.useState)(null),K=R.some(e=>e.model===H),q=te??(ee&&H!==``&&!K),J=(0,Q.useMemo)(()=>h.find(e=>e.id===S)??h[0],[S,h]),Y=S===`vellum`&&J.supportsVoiceSelection&&U.trim()!==``&&U.trim()!==H,re=(0,Q.useCallback)(e=>{let n=t(Ue+e,``),r=t(Ie+e,``);M(n.length>0),O(r),A(r),T(``)},[]);(0,Q.useEffect)(()=>{re(S)},[S,re]);let X=(0,Q.useMemo)(()=>{let e=S!==b,t=w.trim().length>0,n=D.trim()!==k;return e||t||n||Y},[S,b,w,D,k,Y]),ie=(0,Q.useCallback)(async()=>{let e=w.trim(),r=D.trim(),i=J.id;n(Ze,i),e.length>0&&n(Ue+i,e),n(Ie+i,r);let a=e.length>0?e:t(Ue+i,``),o=Rr[i];L(!0);try{if(a.length>0){let{response:e}=await ft({path:{assistant_id:s},body:{service:i,field:`api_key`,value:a,label:`${J.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}let e={...S!==b||!x?{provider:i,mode:i===`vellum`?`managed`:`your-own`}:{},...o?{providers:{[i]:{[o]:r}}}:{},...Y?{providers:{vellum:{model:U.trim()}}}:{}};if(Object.keys(e).length>0){let{response:t}=await dt({path:{assistant_id:s},body:{services:{tts:e}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}return M(a.length>0),A(r),T(``),p.invalidateQueries({queryKey:Ot({path:{assistant_id:s}})}),z.success(`Text-to-speech settings saved`),!0}catch(e){return z.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`),!1}finally{L(!1)}},[s,S,U,Y,w,D,J,b,x,p]);(0,Q.useEffect)(()=>{a?.({hasChanges:X,saving:F,save:ie})},[a,X,F,ie]);let ae=(0,Q.useCallback)(()=>{n(Ue+S,``),M(!1),T(``)},[S]),oe=(0,Q.useCallback)(async()=>{P(!0);try{let e=t(Ue+S,``),n=w.trim(),r=n.length>0?n:e;if(r.length===0){z.error(`Save an API key for this provider before testing.`);return}let i=t(Ie+S,``),a=D.trim(),o=await Nr({provider:S,apiKey:r,voiceId:a.length>0?a:i,text:`Hey! It's ${l}. How does this sound?`});if(o.kind!==`audio`){z.error(o.message);return}let s=URL.createObjectURL(o.blob);try{let e=new Audio(s);await e.play(),await new Promise(t=>{e.onended=()=>t(),e.onerror=()=>t()})}finally{URL.revokeObjectURL(s)}}finally{P(!1)}},[l,w,S,D]),se=j?`•••••••• (Enter a new key to replace)`:J.apiKeyPlaceholder,Z=S===`vellum`,ce=Z&&J.supportsVoiceSelection,le=(0,$.jsxs)(c,{variant:`link`,size:`compact`,className:`inline-flex h-auto items-center gap-1 px-0 underline [--vbtn-fg:var(--content-tertiary)]`,onClick:()=>{ne(!1),R.some(e=>e.model===U)||W(B||R[0]?.model||``)},children:[(0,$.jsx)(E,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Choose from catalog`]}),ue=ce&&q&&R.length>0?le:null;return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{value:S,onChange:C,options:h.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),!Z&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,$.jsx)(I,{type:`password`,value:w,onChange:e=>T(e.target.value),placeholder:se,fullWidth:!0})]}),ce&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice`}),q?(0,$.jsx)(I,{type:`text`,value:U,onChange:e=>W(e.target.value),placeholder:`Enter a voice ID`,"aria-label":`Custom voice ID`,fullWidth:!0}):G?(0,$.jsx)(Lr,{assistantId:s,value:U,onChange:W}):ee&&(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`No managed voices are currently available.`})]}),J.supportsVoiceSelection&&!Z&&(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,$.jsx)(I,{type:`text`,value:D,onChange:e=>O(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),!i&&!Z&&(0,$.jsx)(Cn,{guide:J.credentialsGuide}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!Z&&(0,$.jsx)(c,{variant:`outlined`,onClick:oe,disabled:N,children:N?`Testing…`:`Test`}),(0,$.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[ue,!r&&(0,$.jsx)(xn,{onClick:ie,disabled:!X||F}),j&&!Z&&(0,$.jsx)(Sn,{onClick:ae})]})]})]})}function Br(){return(0,$.jsx)(vn,{id:`text-to-speech`,title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,$.jsx)(zr,{})})}var Vr=`default`;function Hr(){let e=on(),i=d(),{data:o}=f({...Tt({path:{assistant_id:e}}),staleTime:3e4}),s=xt({onSuccess:t=>{Mt(i,{path:{assistant_id:e}},t)}}),c=Dn(),l=(0,Q.useMemo)(()=>o?o.services?.[`web-fetch`]?.provider||t(`vellum:ai:webFetchProvider`,Vr):t(Le,Vr),[o]),[u,p]=(0,Q.useState)(!1),[m,h]=On(l),[g,_]=(0,Q.useState)(``),v=he.has(m),{hasStoredCredential:y}=_e({assistantId:e,credentialKind:`api_key`,credentialName:m,enabled:v}),b=g.trim().length>0,x=u||v&&!y&&!b||m===l&&!b,S=Ee(W[m]??`Enter your API key`,y),C=(0,Q.useCallback)(async()=>{p(!0);let t=g.trim(),r=v&&t.length>0;try{r&&await c(m,t),await s.mutateAsync({path:{assistant_id:e},body:{services:{"web-fetch":{provider:m}}}}).catch(e=>{throw z.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{p(!1);return}p(!1);try{if(n(Le,m),r){let r=q(m);r&&n(r,t);let a=et(e,`api_key`,m);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),_(``)}z.success(`Web fetch settings saved.`)}catch(e){a(e,{context:`settings-ai-web-fetch-persist-local`}),z.error(`Saved, but local preferences could not be written.`)}},[v,s,c,i,e,g,m]),w=(0,Q.useCallback)(()=>{let e=q(m);e&&r(e),_(``),h(Vr),n(Le,Vr)},[m,h]);return(0,$.jsx)(vn,{id:`web-fetch`,title:`Web Fetch`,subtitle:`Configure how your assistant reads individual web pages`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{value:m,onChange:h,options:me.map(e=>({value:e,label:ne[e]??e}))})]}),v&&(0,$.jsx)(I,{label:`API Key`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:S,fullWidth:!0}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(xn,{onClick:C,disabled:x}),u&&(0,$.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),v&&(0,$.jsx)(Sn,{onClick:w,filled:!0})]})]})})}var Ur=`0.10.12`;function Wr(){return rt(Ur)}function Gr(){let e=on(),i=d(),o=vt(),{data:s}=f({...Tt({path:{assistant_id:e}}),enabled:o,staleTime:3e4}),c=xt({onSuccess:t=>{Mt(i,{path:{assistant_id:e}},t)}}),l=Dn(),u=(0,Q.useMemo)(()=>{if(!s)return t(qe,`inference-provider-native`);let e=s.services?.[`web-search`];return(e?.mode===`managed`&&e?.provider!==`inference-provider-native`?`vellum`:e?.provider)||t(`vellum:ai:webSearchProvider`,`inference-provider-native`)},[s]),[p,m]=(0,Q.useState)(!1),[h,g]=On(u),[_,v]=(0,Q.useState)(``),y=Y.has(h),{hasStoredCredential:b}=_e({assistantId:e,credentialKind:`api_key`,credentialName:h,enabled:y}),x=_.trim().length>0,S=p||y&&!b&&!x||h===u&&!x,C=Ee(fe[h]??`Enter your API key`,b),w=(0,Q.useCallback)(async()=>{m(!0);let t=_.trim(),r=ce(h),o=y&&t.length>0;try{o&&await l(h,t),await it();let n=h===`vellum`?Wr()?{provider:`vellum`,mode:`managed`}:{mode:`managed`}:{provider:h,mode:`your-own`};await c.mutateAsync({path:{assistant_id:e},body:{services:{"web-search":n}}}).catch(e=>{throw z.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e})}catch{m(!1);return}m(!1);try{if(n(qe,h),o){r&&n(r,t);let a=et(e,`api_key`,h);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),v(``)}z.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),z.error(`Saved, but local preferences could not be written.`)}},[y,c,l,i,e,_,h]),T=(0,Q.useCallback)(()=>{let e=ce(h);e&&r(e),v(``),g(`inference-provider-native`),n(qe,`inference-provider-native`)},[h,g]);return(0,$.jsx)(vn,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,$.jsx)(V,{"aria-label":`Web search provider`,value:h,onChange:g,options:G.map(e=>({value:e,label:J[e]??e}))})]}),h===`vellum`&&(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Search runs through your Vellum account.`}),y&&(0,$.jsx)(I,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:C,fullWidth:!0}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(xn,{onClick:w,disabled:S}),p&&(0,$.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),y&&(0,$.jsx)(Sn,{onClick:T,filled:!0})]})]})})}function Kr(){let e=on(),t=It(),[n,r]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]);let i=(0,$.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto`,children:[(0,$.jsx)(yn,{}),(0,$.jsx)(pr,{panel:n,onOpenPanel:r,onClosePanel:()=>r(null)}),(0,$.jsx)(Gr,{}),(0,$.jsx)(Hr,{}),(0,$.jsx)(En,{}),(0,$.jsx)(Mn,{}),(0,$.jsx)(Br,{}),(0,$.jsx)(Mr,{})]}),a=`${e??`none`}:${n?.kind===`profile`?`profile:${n.name}`:n?.kind===`provider`?`provider:${n.name}`:n?.kind??`closed`}`,o=n?.kind===`provider`||n?.kind===`add-provider`,s=n!=null&&e?n.kind===`overrides`?(0,$.jsx)(Tr,{assistantId:e,onClose:()=>r(null)},a):o?(0,$.jsx)(Dr,{assistantId:e,connectionName:n.kind===`provider`?n.name:null,onClose:()=>r(null)},a):(0,$.jsx)(hr,{assistantId:e,profileName:n.kind===`profile`?n.name:null,onClose:()=>r(null)},a):null;return s&&t?(0,$.jsx)(un,{children:s}):s?(0,$.jsx)(dn,{storageKey:`aiSettingsDetailDrawerWidth`,detailKey:a,section:i,detail:s}):i}export{Kr as AiPage};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-C1mdGPB9.js";import{A as t,B as n,C as r,D as i,E as a,F as o,I as s,L as c,P as l,R as u,_ as d,a as f,b as p,c as m,f as h,h as g,j as _,k as v,m as y,o as b,p as x,s as S,w as C,y as w,z as T}from"./proxy-lK4w-Bft.js";var E=e(`dices`,[[`rect`,{width:`12`,height:`12`,x:`2`,y:`10`,rx:`2`,ry:`2`,key:`6agr2n`}],[`path`,{d:`m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6`,key:`1o487t`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 14h.01`,key:`ssrbsk`}],[`path`,{d:`M15 6h.01`,key:`cblpky`}],[`path`,{d:`M18 9h.01`,key:`2061c0`}]]),D=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function O(e,t){return l(e)?e[D(0,e.length,t)]:e}var k=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return A(this.animations,`duration`)}get iterationDuration(){return A(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function A(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var j=class extends k{then(e,t){return this.finished.finally(e).then(()=>{})}};function M(e,t){return e in t}var N=class extends m{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(M(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return x()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}};function P(e){return typeof e==`object`&&!Array.isArray(e)}function F(e,t,n,r){return e==null?[]:typeof e==`string`&&P(t)?d(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function I(e,t,n){return e*(t+1)+n*t}function L(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function R(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a.at>t&&a.at<r&&(n(e,a),i--)}}function z(e,t,n,r,i,a){R(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:_(i,a,r[o]),easing:O(n,o)})}function B(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function V(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var H=`easeInOut`,U=20;function W(e,{defaultTransition:n={},...r}={},l,u){let d=n.duration||.3,f=new Map,m=new Map,h={},g=new Map,_=0,v=0,y=0;for(let r=0;r<e.length;r++){let c=e[r];if(typeof c==`string`){g.set(c,v);continue}else if(!Array.isArray(c)){g.set(c.name,L(v,c.at,_,g));continue}let[f,b,x={}]=c;x.at!==void 0&&(v=L(v,x.at,_,g));let S=0,w=(e,r,c,l=0,f=0)=>{let p=q(e),{delay:m=0,times:h=a(p),type:g=n.type||`keyframes`,repeat:_,repeatType:b,repeatDelay:x=0,...w}=r,{ease:E=n.ease||`easeOut`,duration:D}=r,k=typeof m==`function`?m(l,f):m,A=p.length,j=C(g)?g:u?.[g||`keyframes`];if(A<=2&&j){let e=100;if(A===2&&X(p)){let t=p[1]-p[0];e=Math.abs(t)}let r={...n,...w};D!==void 0&&(r.duration=s(D));let i=t(r,e,j);E=i.ease,D=i.duration}D??=d;let M=v+k;h.length===1&&h[0]===0&&(h[1]=1);let N=h.length-p.length;if(N>0&&i(h,N),p.length===1&&p.unshift(null),_&&T(_<U,`Sequence segments can't repeat ${_} times — ignoring repeat option. Use a value below ${U} or apply repeat at the sequence level instead.`),_&&_<U){let e=D>0?x/D:0;D=I(D,_,x);let t=[...p],n=[...h];E=Array.isArray(E)?[...E]:[E];let r=[...E],i=b===`reverse`||b===`mirror`,a=t,s=r;i&&(a=[...t].reverse(),b===`reverse`&&(s=[...r].reverse().map(e=>typeof e==`function`?o(e):e)));for(let o=0;o<_;o++){let c=i&&o%2==0,l=c?a:t,u=c?s:r,d=(o+1)*(1+e);e>0&&(p.push(p[p.length-1]),h.push(d),E.push(`linear`)),p.push(...l);for(let e=0;e<l.length;e++)h.push(n[e]+d),E.push(e===0?`linear`:O(u,e-1))}B(h,_,e)}let P=M+D;z(c,p,E,h,M,P),S=Math.max(k+D,S),y=Math.max(P,y)};if(p(f)){let e=G(f,m);w(b,x,K(`default`,e))}else{let e=F(f,b,l,h),t=e.length;for(let n=0;n<t;n++){b=b,x=x;let r=e[n],i=G(r,m);for(let e in b)w(b[e],J(x,e),K(e,i),n,t)}}_=v,v+=S}return m.forEach((e,t)=>{for(let i in e){let a=e[i];a.sort(V);let o=[],s=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),s.push(c(0,y,t)),l.push(r||`easeOut`)}s[0]!==0&&(s.unshift(0),o.unshift(o[0]),l.unshift(H)),s[s.length-1]!==1&&(s.push(1),o.push(null)),f.has(t)||f.set(t,{keyframes:{},transition:{}});let u=f.get(t);u.keyframes[i]=o;let{type:d,...p}=n;u.transition[i]={...p,duration:y,ease:l,times:s,...r}}}),f}function G(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function K(e,t){return t[e]||(t[e]=[]),t[e]}function q(e){return Array.isArray(e)?e:[e]}function J(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Y=e=>typeof e==`number`,X=e=>e.every(Y);function Z(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=g(e)&&!y(e)?new b(t):new S(t);n.mount(e),h.set(e,n)}function Q(e){let t=new N({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),h.set(e,t)}function ee(e,t){return p(e)||typeof e==`number`||typeof e==`string`&&!P(t)}function $(e,t,n,r){let i=[];if(ee(e,t))i.push(f(e,P(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=F(e,t,r),o=a.length;u(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Z:Q;h.has(r)||s(r);let c=h.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...w(c,{...t,transition:l},{}))}}return i}function te(e,t,n){let i=[];return W(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=r(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:v}).forEach(({keyframes:e,transition:t},n)=>{i.push(...$(n,e,t))}),i}function ne(e){return Array.isArray(e)&&e.some(Array.isArray)}function re(e={}){let{scope:t,reduceMotion:r,skipAnimations:i}=e;function a(e,a,o){let s=[],c,l={};if(r!==void 0&&(l.reduceMotion=r),i!==void 0&&(l.skipAnimations=i),ne(e)){let{onComplete:n,...r}=a||{};typeof n==`function`&&(c=n),s=te(e,{...l,...r},t)}else{let{onComplete:n,...r}=o||{};typeof n==`function`&&(c=n),s=$(e,a,{...l,...r},t)}let u=new j(s);return c&&u.finished.then(c),t&&(t.animations.push(u),u.finished.then(()=>{n(t.animations,u)})),u}return a}var ie=re();export{E as n,ie as t};
1
+ import{t as e}from"./createLucideIcon-C1mdGPB9.js";import{A as t,B as n,C as r,D as i,E as a,F as o,I as s,L as c,P as l,R as u,_ as d,a as f,b as p,c as m,f as h,h as g,j as _,k as v,m as y,o as b,p as x,s as S,w as C,y as w,z as T}from"./proxy-CJDjUn7E.js";var E=e(`dices`,[[`rect`,{width:`12`,height:`12`,x:`2`,y:`10`,rx:`2`,ry:`2`,key:`6agr2n`}],[`path`,{d:`m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6`,key:`1o487t`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 14h.01`,key:`ssrbsk`}],[`path`,{d:`M15 6h.01`,key:`cblpky`}],[`path`,{d:`M18 9h.01`,key:`2061c0`}]]),D=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function O(e,t){return l(e)?e[D(0,e.length,t)]:e}var k=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return A(this.animations,`duration`)}get iterationDuration(){return A(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function A(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var j=class extends k{then(e,t){return this.finished.finally(e).then(()=>{})}};function M(e,t){return e in t}var N=class extends m{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(M(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return x()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}};function P(e){return typeof e==`object`&&!Array.isArray(e)}function F(e,t,n,r){return e==null?[]:typeof e==`string`&&P(t)?d(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function I(e,t,n){return e*(t+1)+n*t}function L(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function R(e,t,r){for(let i=0;i<e.length;i++){let a=e[i];a.at>t&&a.at<r&&(n(e,a),i--)}}function z(e,t,n,r,i,a){R(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:_(i,a,r[o]),easing:O(n,o)})}function B(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function V(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var H=`easeInOut`,U=20;function W(e,{defaultTransition:n={},...r}={},l,u){let d=n.duration||.3,f=new Map,m=new Map,h={},g=new Map,_=0,v=0,y=0;for(let r=0;r<e.length;r++){let c=e[r];if(typeof c==`string`){g.set(c,v);continue}else if(!Array.isArray(c)){g.set(c.name,L(v,c.at,_,g));continue}let[f,b,x={}]=c;x.at!==void 0&&(v=L(v,x.at,_,g));let S=0,w=(e,r,c,l=0,f=0)=>{let p=q(e),{delay:m=0,times:h=a(p),type:g=n.type||`keyframes`,repeat:_,repeatType:b,repeatDelay:x=0,...w}=r,{ease:E=n.ease||`easeOut`,duration:D}=r,k=typeof m==`function`?m(l,f):m,A=p.length,j=C(g)?g:u?.[g||`keyframes`];if(A<=2&&j){let e=100;if(A===2&&X(p)){let t=p[1]-p[0];e=Math.abs(t)}let r={...n,...w};D!==void 0&&(r.duration=s(D));let i=t(r,e,j);E=i.ease,D=i.duration}D??=d;let M=v+k;h.length===1&&h[0]===0&&(h[1]=1);let N=h.length-p.length;if(N>0&&i(h,N),p.length===1&&p.unshift(null),_&&T(_<U,`Sequence segments can't repeat ${_} times — ignoring repeat option. Use a value below ${U} or apply repeat at the sequence level instead.`),_&&_<U){let e=D>0?x/D:0;D=I(D,_,x);let t=[...p],n=[...h];E=Array.isArray(E)?[...E]:[E];let r=[...E],i=b===`reverse`||b===`mirror`,a=t,s=r;i&&(a=[...t].reverse(),b===`reverse`&&(s=[...r].reverse().map(e=>typeof e==`function`?o(e):e)));for(let o=0;o<_;o++){let c=i&&o%2==0,l=c?a:t,u=c?s:r,d=(o+1)*(1+e);e>0&&(p.push(p[p.length-1]),h.push(d),E.push(`linear`)),p.push(...l);for(let e=0;e<l.length;e++)h.push(n[e]+d),E.push(e===0?`linear`:O(u,e-1))}B(h,_,e)}let P=M+D;z(c,p,E,h,M,P),S=Math.max(k+D,S),y=Math.max(P,y)};if(p(f)){let e=G(f,m);w(b,x,K(`default`,e))}else{let e=F(f,b,l,h),t=e.length;for(let n=0;n<t;n++){b=b,x=x;let r=e[n],i=G(r,m);for(let e in b)w(b[e],J(x,e),K(e,i),n,t)}}_=v,v+=S}return m.forEach((e,t)=>{for(let i in e){let a=e[i];a.sort(V);let o=[],s=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),s.push(c(0,y,t)),l.push(r||`easeOut`)}s[0]!==0&&(s.unshift(0),o.unshift(o[0]),l.unshift(H)),s[s.length-1]!==1&&(s.push(1),o.push(null)),f.has(t)||f.set(t,{keyframes:{},transition:{}});let u=f.get(t);u.keyframes[i]=o;let{type:d,...p}=n;u.transition[i]={...p,duration:y,ease:l,times:s,...r}}}),f}function G(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function K(e,t){return t[e]||(t[e]=[]),t[e]}function q(e){return Array.isArray(e)?e:[e]}function J(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Y=e=>typeof e==`number`,X=e=>e.every(Y);function Z(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=g(e)&&!y(e)?new b(t):new S(t);n.mount(e),h.set(e,n)}function Q(e){let t=new N({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),h.set(e,t)}function ee(e,t){return p(e)||typeof e==`number`||typeof e==`string`&&!P(t)}function $(e,t,n,r){let i=[];if(ee(e,t))i.push(f(e,P(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=F(e,t,r),o=a.length;u(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Z:Q;h.has(r)||s(r);let c=h.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...w(c,{...t,transition:l},{}))}}return i}function te(e,t,n){let i=[];return W(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=r(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:v}).forEach(({keyframes:e,transition:t},n)=>{i.push(...$(n,e,t))}),i}function ne(e){return Array.isArray(e)&&e.some(Array.isArray)}function re(e={}){let{scope:t,reduceMotion:r,skipAnimations:i}=e;function a(e,a,o){let s=[],c,l={};if(r!==void 0&&(l.reduceMotion=r),i!==void 0&&(l.skipAnimations=i),ne(e)){let{onComplete:n,...r}=a||{};typeof n==`function`&&(c=n),s=te(e,{...l,...r},t)}else{let{onComplete:n,...r}=o||{};typeof n==`function`&&(c=n),s=$(e,a,{...l,...r},t)}let u=new j(s);return c&&u.finished.then(c),t&&(t.animations.push(u),u.finished.then(()=>{n(t.animations,u)})),u}return a}var ie=re();export{E as n,ie as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{n as r,r as i}from"./avatar-svg-compositor-HKhsTl-B.js";import{t as a}from"./use-reduced-motion-Blpe7z4_.js";var o=e(t(),1),s=n();function c(e,t){return e+Math.random()*(t-e)}function l(e){let t=[],n=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,r;for(;(r=n.exec(e))!==null;)t.push(parseFloat(r[0]));return t}function u(e){let t=0,n=0,r=0;for(let i=0;i<e.length-1;i+=2)t+=e[i],n+=e[i+1],r++;return r>0?{x:t/r,y:n/r}:{x:0,y:0}}function d(e,t,n,r,i){let a=r*1.1,o=0;return e.replace(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,()=>{let e=o;o++;let r=t[e],s=e%2==0,c=s?n.x:n.y,l=s?e+1:e-1,u=l>=0&&l<t.length?t[l]:c,d=s?r:u,f=Math.atan2((s?u:r)-n.y,d-n.x),p=1+(Math.sin(f*2+a)*.7+Math.sin(f*3-a*.5)*.3)*i;return(c+(r-c)*p).toFixed(3)})}function f(e,t,n){let r=l(e),i=u(r),a=[e];for(let o=1;o<t;o++)a.push(d(e,r,i,o,n));return a}function p({components:e,traits:t,size:n,isAssistantBusy:l=!1,breathe:u=!0}){let d=a(),{bodyShape:p,eyeStyle:m,color:h}=i(e,t.bodyShape,t.eyeStyle,t.color),{bodyTransform:g,eyeTransform:_}=r(p,m,e,n),v=m.sourceViewBox,y=p.viewBox,b=Math.min(n/y.width,n/y.height),x=(n-y.width*b)/2,S=(n-y.height*b)/2,C=Math.min(y.width/v.width,y.height/v.height),w=e.faceCenterOverrides.find(e=>e.bodyShape===p.id&&e.eyeStyle===m.id),T=w?w.faceCenter:p.faceCenter,E=T.x-m.eyeCenter.x*C,D=T.y-m.eyeCenter.y*C,O=b*(E+m.eyeCenter.x*C)+x,k=b*(D+m.eyeCenter.y*C)+S,A=(0,o.useMemo)(()=>l?f(p.svgPath,16,.06):[p.svgPath],[p.svgPath,l]),[j,M]=(0,o.useState)(!1),[N,P]=(0,o.useState)(0),F=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(d||l){M(!1);return}let e=!1;function t(){return setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),Math.random()<.2?setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),t())},150))},200):t())},150))},c(3e3,7e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,l]),(0,o.useEffect)(()=>{if(d||l){P(0);return}let e=!1;function t(){return setTimeout(()=>{e||(P((Math.random()<.5?-1:1)*c(1,2)),setTimeout(()=>{e||(P(0),t())},200))},c(8e3,15e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,l]),(0,o.useEffect)(()=>{let e=F.current;if(!e)return;let t=A[0]??p.svgPath;if(!l||d||A.length<=1){e.setAttribute(`d`,t);return}let n=0,r=setInterval(()=>{n=(n+1)%A.length;let t=A[n];t&&e.setAttribute(`d`,t)},150);return()=>{clearInterval(r),e.setAttribute(`d`,t)}},[l,d,A,p.svgPath]);let I=n/2,L=n/2,R=d?`none`:l?`avatar-morph-scale 2.4s ease-in-out infinite, avatar-morph-rotate 3s ease-in-out infinite`:u?`avatar-breathe-kf 4s ease-in-out infinite`:`none`,z=l?0:N,B=j&&!l,V=A[0]??p.svgPath;return(0,s.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 ${n} ${n}`,style:{animation:R,transformOrigin:`center`,overflow:`visible`},children:[(0,s.jsx)(`g`,{style:{transform:`rotate(${z}deg)`,transformOrigin:`${I}px ${L}px`,transition:z===0?`transform 0.3s ease-out`:`transform 0.2s ease-in-out`},children:(0,s.jsx)(`path`,{ref:F,d:V,fill:h.hex,transform:g,style:{transition:l?`d 0.3s ease-in-out`:`none`}})}),(0,s.jsx)(`g`,{style:{transform:B?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${O}px ${k}px`,transition:`transform 0.15s ease-in-out`},children:m.paths.map((e,t)=>(0,s.jsx)(`path`,{d:e.svgPath,fill:e.color,transform:_},t))})]})}export{p as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{n as r,r as i}from"./avatar-svg-compositor-BWsnZx7I.js";import{t as a}from"./use-reduced-motion-CznEG-5y.js";var o=e(t(),1),s=n();function c(e,t){return e+Math.random()*(t-e)}function l(e){let t=[],n=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,r;for(;(r=n.exec(e))!==null;)t.push(parseFloat(r[0]));return t}function u(e){let t=0,n=0,r=0;for(let i=0;i<e.length-1;i+=2)t+=e[i],n+=e[i+1],r++;return r>0?{x:t/r,y:n/r}:{x:0,y:0}}function d(e,t,n,r,i){let a=r*1.1,o=0;return e.replace(/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,()=>{let e=o;o++;let r=t[e],s=e%2==0,c=s?n.x:n.y,l=s?e+1:e-1,u=l>=0&&l<t.length?t[l]:c,d=s?r:u,f=Math.atan2((s?u:r)-n.y,d-n.x),p=1+(Math.sin(f*2+a)*.7+Math.sin(f*3-a*.5)*.3)*i;return(c+(r-c)*p).toFixed(3)})}function f(e,t,n){let r=l(e),i=u(r),a=[e];for(let o=1;o<t;o++)a.push(d(e,r,i,o,n));return a}function p({components:e,traits:t,size:n,isAssistantBusy:l=!1,breathe:u=!0}){let d=a(),{bodyShape:p,eyeStyle:m,color:h}=i(e,t.bodyShape,t.eyeStyle,t.color),{bodyTransform:g,eyeTransform:_}=r(p,m,e,n),v=m.sourceViewBox,y=p.viewBox,b=Math.min(n/y.width,n/y.height),x=(n-y.width*b)/2,S=(n-y.height*b)/2,C=Math.min(y.width/v.width,y.height/v.height),w=e.faceCenterOverrides.find(e=>e.bodyShape===p.id&&e.eyeStyle===m.id),T=w?w.faceCenter:p.faceCenter,E=T.x-m.eyeCenter.x*C,D=T.y-m.eyeCenter.y*C,O=b*(E+m.eyeCenter.x*C)+x,k=b*(D+m.eyeCenter.y*C)+S,A=(0,o.useMemo)(()=>l?f(p.svgPath,16,.06):[p.svgPath],[p.svgPath,l]),[j,M]=(0,o.useState)(!1),[N,P]=(0,o.useState)(0),F=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(d||l){M(!1);return}let e=!1;function t(){return setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),Math.random()<.2?setTimeout(()=>{e||(M(!0),setTimeout(()=>{e||(M(!1),t())},150))},200):t())},150))},c(3e3,7e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,l]),(0,o.useEffect)(()=>{if(d||l){P(0);return}let e=!1;function t(){return setTimeout(()=>{e||(P((Math.random()<.5?-1:1)*c(1,2)),setTimeout(()=>{e||(P(0),t())},200))},c(8e3,15e3))}let n=t();return()=>{e=!0,clearTimeout(n)}},[d,l]),(0,o.useEffect)(()=>{let e=F.current;if(!e)return;let t=A[0]??p.svgPath;if(!l||d||A.length<=1){e.setAttribute(`d`,t);return}let n=0,r=setInterval(()=>{n=(n+1)%A.length;let t=A[n];t&&e.setAttribute(`d`,t)},150);return()=>{clearInterval(r),e.setAttribute(`d`,t)}},[l,d,A,p.svgPath]);let I=n/2,L=n/2,R=d?`none`:l?`avatar-morph-scale 2.4s ease-in-out infinite, avatar-morph-rotate 3s ease-in-out infinite`:u?`avatar-breathe-kf 4s ease-in-out infinite`:`none`,z=l?0:N,B=j&&!l,V=A[0]??p.svgPath;return(0,s.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:n,height:n,viewBox:`0 0 ${n} ${n}`,style:{animation:R,transformOrigin:`center`,overflow:`visible`},children:[(0,s.jsx)(`g`,{style:{transform:`rotate(${z}deg)`,transformOrigin:`${I}px ${L}px`,transition:z===0?`transform 0.3s ease-out`:`transform 0.2s ease-in-out`},children:(0,s.jsx)(`path`,{ref:F,d:V,fill:h.hex,transform:g,style:{transition:l?`d 0.3s ease-in-out`:`none`}})}),(0,s.jsx)(`g`,{style:{transform:B?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${O}px ${k}px`,transition:`transform 0.15s ease-in-out`},children:m.paths.map((e,t)=>(0,s.jsx)(`path`,{d:e.svgPath,fill:e.color,transform:_},t))})]})}export{p as t};
@@ -1 +1 @@
1
- import{X as e,et as t,s as n,u as r}from"./local-mode-CGJ3Fwk2.js";import{h as i}from"./api-Bf1N-o4h.js";import{n as a,o}from"./api-errors-BmlR1gU1.js";import{H as s,T as c,U as l,V as u,a as d,i as f,o as p,w as m}from"./sdk.gen-C98zmHHo.js";import{Mt as h,_ as g,gt as _,ht as v,v as y,y as b}from"./sdk.gen-Dy1Bb8sS.js";async function x(e,t){let{data:n,error:r,response:i}=await m({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return a(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:o(r,i)}}async function S(t){if(e()){let e=t?n(t):r();if(e)return{ok:!0,status:200,data:{id:e.assistantId,name:e.name??e.assistantId,status:`active`,is_local:!0,created:e.hatchedAt??``}}}if(t){let{data:e,error:n,response:r}=await l({path:{id:t},throwOnError:!1});return a(r,n,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:e}:{ok:!1,status:r.status,error:o(n,r)}}let i=await c({query:{hosting:`platform`},throwOnError:!1});if(a(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:o(i.error,i.response)};let s=i.data?.results??[];if(s.length>0)return{ok:!0,status:i.response.status,data:s[0]};let u=await c({query:{hosting:`local`},throwOnError:!1});if(a(u.response,u.error,`Failed to get assistant.`),u.response.ok){let e=u.data?.results??[];if(e.length>0)return{ok:!0,status:u.response.status,data:e[0]}}return u.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:u.response.status,error:o(u.error,u.response)}}async function C(e){let{data:t,error:n,response:r}=await h({path:{assistant_id:e},throwOnError:!1});return a(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:o(n,r)}}async function w(e){let{data:t,error:n,response:r}=await _({path:{assistant_id:e},throwOnError:!1});if(a(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:o(e.error.message,r)}}return{ok:!1,status:r.status,error:o(n,r)}}async function T(e){let{data:t,error:n,response:r}=await v({path:{assistant_id:e},throwOnError:!1});if(a(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:o(e.error.message,r)}}return{ok:!1,status:r.status,error:o(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let n=!t(),[r,i]=await Promise.all([y({path:{assistant_id:e},throwOnError:!1}),n?p({path:{assistant_id:e},throwOnError:!1}):null]);if(a(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:o(r.error,r.response)};let s=E(r.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:r.response.status,data:[...e,...s]}}if(s.length===0&&i.response)return{ok:!1,status:i.response.status,error:o(i.error,i.response)}}return{ok:!0,status:r.response.status,data:s}}async function k(e){let{data:n,error:r,response:i}=t()?await g({path:{assistant_id:e},throwOnError:!1}):await f({path:{assistant_id:e},throwOnError:!1});if(a(i,r,`Failed to create assistant backup.`),i.ok){let e=n&&typeof n==`object`&&!Array.isArray(n)?n:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:o(r,i)}}async function A(e,n){let{data:r,error:i,response:s}=t()?await b({path:{assistant_id:e},body:{path:n.path??n.snapshot_name},throwOnError:!1}):await d({path:{assistant_id:e,snapshot_name:n.snapshot_name},throwOnError:!1});if(a(s,i,`Failed to restore assistant backup.`),s.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:s.status,data:e}}return{ok:!1,status:s.status,error:o(i,s)}}async function j(e){let{data:t,error:n,response:r}=await u({path:{id:e},throwOnError:!1});return a(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:o(n,r)}}async function M(e){let{error:t,response:n}=await s({path:{id:e},throwOnError:!1});return a(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:o(t,n)}}async function N(){let{data:e,error:t,response:n}=await c({query:{hosting:`all`},throwOnError:!1});return a(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:o(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};
1
+ import{X as e,et as t,s as n,u as r}from"./local-mode-CGJ3Fwk2.js";import{h as i}from"./api-Bf1N-o4h.js";import{n as a,o}from"./api-errors-BOG3VRJr.js";import{H as s,T as c,U as l,V as u,a as d,i as f,o as p,w as m}from"./sdk.gen-CKpIiJ5f.js";import{Mt as h,_ as g,gt as _,ht as v,v as y,y as b}from"./sdk.gen-DQRCDUdg.js";async function x(e,t){let{data:n,error:r,response:i}=await m({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return a(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:o(r,i)}}async function S(t){if(e()){let e=t?n(t):r();if(e)return{ok:!0,status:200,data:{id:e.assistantId,name:e.name??e.assistantId,status:`active`,is_local:!0,created:e.hatchedAt??``}}}if(t){let{data:e,error:n,response:r}=await l({path:{id:t},throwOnError:!1});return a(r,n,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:e}:{ok:!1,status:r.status,error:o(n,r)}}let i=await c({query:{hosting:`platform`},throwOnError:!1});if(a(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:o(i.error,i.response)};let s=i.data?.results??[];if(s.length>0)return{ok:!0,status:i.response.status,data:s[0]};let u=await c({query:{hosting:`local`},throwOnError:!1});if(a(u.response,u.error,`Failed to get assistant.`),u.response.ok){let e=u.data?.results??[];if(e.length>0)return{ok:!0,status:u.response.status,data:e[0]}}return u.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:u.response.status,error:o(u.error,u.response)}}async function C(e){let{data:t,error:n,response:r}=await h({path:{assistant_id:e},throwOnError:!1});return a(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:o(n,r)}}async function w(e){let{data:t,error:n,response:r}=await _({path:{assistant_id:e},throwOnError:!1});if(a(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:o(e.error.message,r)}}return{ok:!1,status:r.status,error:o(n,r)}}async function T(e){let{data:t,error:n,response:r}=await v({path:{assistant_id:e},throwOnError:!1});if(a(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:o(e.error.message,r)}}return{ok:!1,status:r.status,error:o(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let n=!t(),[r,i]=await Promise.all([y({path:{assistant_id:e},throwOnError:!1}),n?p({path:{assistant_id:e},throwOnError:!1}):null]);if(a(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:o(r.error,r.response)};let s=E(r.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:r.response.status,data:[...e,...s]}}if(s.length===0&&i.response)return{ok:!1,status:i.response.status,error:o(i.error,i.response)}}return{ok:!0,status:r.response.status,data:s}}async function k(e){let{data:n,error:r,response:i}=t()?await g({path:{assistant_id:e},throwOnError:!1}):await f({path:{assistant_id:e},throwOnError:!1});if(a(i,r,`Failed to create assistant backup.`),i.ok){let e=n&&typeof n==`object`&&!Array.isArray(n)?n:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:o(r,i)}}async function A(e,n){let{data:r,error:i,response:s}=t()?await b({path:{assistant_id:e},body:{path:n.path??n.snapshot_name},throwOnError:!1}):await d({path:{assistant_id:e,snapshot_name:n.snapshot_name},throwOnError:!1});if(a(s,i,`Failed to restore assistant backup.`),s.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:s.status,data:e}}return{ok:!1,status:s.status,error:o(i,s)}}async function j(e){let{data:t,error:n,response:r}=await u({path:{id:e},throwOnError:!1});return a(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:o(n,r)}}async function M(e){let{error:t,response:n}=await s({path:{id:e},throwOnError:!1});return a(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:o(t,n)}}async function N(){let{data:e,error:t,response:n}=await c({query:{hosting:`all`},throwOnError:!1});return a(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:o(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BENY-yx_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./input-Dp4TsVxE.js";import{t as s}from"./dropdown-B4S4UoV4.js";import{t as c}from"./is-electron-Djuya72b.js";import{d as l}from"./routes-DOlsNBq5.js";import{t as u}from"./onboarding-layout-CERIZpQl.js";import{a as d,c as f,i as p,o as m,r as h,s as g}from"./provider-key-DttR9fDs.js";import"./onboarding-step-layout-Cm0PD1db.js";var _=e(t(),1),v=a();function y(){let e=i(),[t]=r(),a=t.get(`hosting`),y=c(),b=h(),[x,S]=(0,_.useState)(()=>b?.provider??d.id),[C,w]=(0,_.useState)(()=>b?.key??``),[T,E]=(0,_.useState)(()=>b?.model??g(b?.provider??d.id)??``),[D,O]=(0,_.useState)(()=>b?.baseUrl??``),[k,A]=(0,_.useState)(()=>b?.customModels??``),j=f(x)??d,M=j.models??[],N=j.requiresKey,P=M.length>0,F=x===`openai-compatible`,I=(!(N&&!F)||C.trim().length>0)&&(!P||T.trim().length>0)&&(!F||D.trim().length>0&&k.trim().length>0);return(0,v.jsx)(u,{children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${y?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,v.jsx)(`h1`,{className:y?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,v.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${y?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose the model provider your assistant should use.`}),(0,v.jsxs)(`div`,{className:`flex w-full flex-col gap-4 ${y?`mt-8`:`mt-10`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,v.jsx)(s,{"aria-label":`Provider`,value:x,onChange:e=>{let t=f(e);t&&(S(t.id),w(``),E(g(t.id)??``))},options:m.map(e=>({value:e.id,label:e.displayName}))})]}),M.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,v.jsx)(s,{"aria-label":`Model`,value:T,onChange:E,options:M.map(e=>({value:e.id,label:e.displayName}))})]}),F&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,v.jsx)(o,{type:`text`,placeholder:`http://localhost:1234/v1`,value:D,onChange:e=>O(e.target.value),fullWidth:!0})]}),(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,v.jsx)(o,{type:`text`,placeholder:`model-1, model-2`,value:k,onChange:e=>A(e.target.value),fullWidth:!0}),(0,v.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),N&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(o,{type:`password`,label:`${j.displayName} API Key`,placeholder:j.apiKeyPlaceholder??`Enter your API key`,value:C,onChange:e=>w(e.target.value),className:`touch-mobile:text-[16px]`,fullWidth:!0}),j.docsUrl&&(0,v.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,v.jsx)(`a`,{href:j.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${y?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,v.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!I,onClick:()=>{if(!I)return;let t=T.trim()||g(x);p({provider:x,key:C.trim(),...t?{model:t}:{},...F?{baseUrl:D.trim(),customModels:k.trim()}:{}}),e(a?`${l.onboarding.privacy}?hosting=${a}`:l.onboarding.privacy)},className:y?void 0:`h-11 text-base`,children:`Continue`}),(0,v.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(l.onboarding.hosting)},className:y?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{y as ApiKeyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-BENY-yx_.js";import{d as r,h as i}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./input-Dp4TsVxE.js";import{t as s}from"./dropdown-B4S4UoV4.js";import{t as c}from"./is-electron-Djuya72b.js";import{d as l}from"./routes-CMywm39M.js";import{t as u}from"./onboarding-layout--6YxmafB.js";import{a as d,c as f,i as p,o as m,r as h,s as g}from"./provider-key-CWXP_f5f.js";import"./onboarding-step-layout-CsE4NokU.js";var _=e(t(),1),v=a();function y(){let e=r(),[t]=i(),a=t.get(`hosting`),y=c(),b=h(),[x,S]=(0,_.useState)(()=>b?.provider??d.id),[C,w]=(0,_.useState)(()=>b?.key??``),[T,E]=(0,_.useState)(()=>b?.model??g(b?.provider??d.id)??``),[D,O]=(0,_.useState)(()=>b?.baseUrl??``),[k,A]=(0,_.useState)(()=>b?.customModels??``),j=f(x)??d,M=j.models??[],N=j.requiresKey,P=M.length>0,F=x===`openai-compatible`,I=(!(N&&!F)||C.trim().length>0)&&(!P||T.trim().length>0)&&(!F||D.trim().length>0&&k.trim().length>0);return(0,v.jsx)(u,{children:(0,v.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${y?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,v.jsx)(`h1`,{className:y?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Connect a Model Provider`}),(0,v.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${y?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose the model provider your assistant should use.`}),(0,v.jsxs)(`div`,{className:`flex w-full flex-col gap-4 ${y?`mt-8`:`mt-10`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,v.jsx)(s,{"aria-label":`Provider`,value:x,onChange:e=>{let t=f(e);t&&(S(t.id),w(``),E(g(t.id)??``))},options:m.map(e=>({value:e.id,label:e.displayName}))})]}),M.length>0&&(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,v.jsx)(s,{"aria-label":`Model`,value:T,onChange:E,options:M.map(e=>({value:e.id,label:e.displayName}))})]}),F&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,v.jsx)(o,{type:`text`,placeholder:`http://localhost:1234/v1`,value:D,onChange:e=>O(e.target.value),fullWidth:!0})]}),(0,v.jsxs)(`div`,{className:`flex flex-col ${y?`gap-2`:`gap-1`}`,children:[(0,v.jsx)(`label`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,v.jsx)(o,{type:`text`,placeholder:`model-1, model-2`,value:k,onChange:e=>A(e.target.value),fullWidth:!0}),(0,v.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),N&&(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,v.jsx)(o,{type:`password`,label:`${j.displayName} API Key`,placeholder:j.apiKeyPlaceholder??`Enter your API key`,value:C,onChange:e=>w(e.target.value),className:`touch-mobile:text-[16px]`,fullWidth:!0}),j.docsUrl&&(0,v.jsxs)(`p`,{className:`self-start text-body-medium-lighter text-[var(--content-tertiary)]`,children:[`Don't have it?`,` `,(0,v.jsx)(`a`,{href:j.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-[var(--content-default)] underline`,children:`Get an API key here`})]})]})]}),(0,v.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${y?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,v.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!I,onClick:()=>{if(!I)return;let t=T.trim()||g(x);p({provider:x,key:C.trim(),...t?{model:t}:{},...F?{baseUrl:D.trim(),customModels:k.trim()}:{}}),e(a?`${l.onboarding.privacy}?hosting=${a}`:l.onboarding.privacy)},className:y?void 0:`h-11 text-base`,children:`Continue`}),(0,v.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>{e(l.onboarding.hosting)},className:y?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{y as ApiKeyScreen};