@vellumai/web 0.10.12 → 0.11.0-staging.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/dist/assets/{AnimatePresence-3WpfAWHe.js → AnimatePresence-DPfyu3ET.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-CDklssHh.js → BundleConfirmPage-CChUOtcg.js} +1 -1
  3. package/dist/assets/{a2a-invite-DUYZLVQb.js → a2a-invite-pyBtaaeG.js} +1 -1
  4. package/dist/assets/{about-page-CT70Pgvf.js → about-page-DGUK5p8j.js} +1 -1
  5. package/dist/assets/access-DS79PSR3.js +1 -0
  6. package/dist/assets/{account-page-D5cJIu1-.js → account-page-D3ERiewh.js} +1 -1
  7. package/dist/assets/{account-shell-C_IH8r44.js → account-shell-Dk4aC-Ls.js} +1 -1
  8. package/dist/assets/{acp-run-actions-CAjb0Wcm.js → acp-run-actions-BH8wuBAL.js} +1 -1
  9. package/dist/assets/{acp-run-detail-panel-DqzZdPiN.js → acp-run-detail-panel-dqVK6rPq.js} +1 -1
  10. package/dist/assets/{acp-run-store-C6n-XeY_.js → acp-run-store-B_eDLRwl.js} +1 -1
  11. package/dist/assets/{activity-steps-panel-BzHQOJsQ.js → activity-steps-panel-xxl2hu3E.js} +1 -1
  12. package/dist/assets/add-credential-modal-CY_--m8L.js +1 -0
  13. package/dist/assets/{add-credits-modal-CCEMf2_U.js → add-credits-modal-fT_gTTP5.js} +1 -1
  14. package/dist/assets/ai-page-B02NwVRu.js +1 -0
  15. package/dist/assets/animated-avatar-BcgncPkc.js +1 -0
  16. package/dist/assets/api-C3QSs67k.js +1 -0
  17. package/dist/assets/{api-XwdNiVE9.js → api-LG8zI3nK.js} +1 -1
  18. package/dist/assets/{api-key-screen-BXn2F-lQ.js → api-key-screen-CvBdN6Ae.js} +1 -1
  19. package/dist/assets/{app-card-Uowaj1kh.js → app-card-CAaFL1oB.js} +1 -1
  20. package/dist/assets/{archive-redirect-page-CpKvFqvX.js → archive-redirect-page-BH7h0Lk7.js} +1 -1
  21. package/dist/assets/{assistant-feature-flag-store-CLqMw4mK.js → assistant-feature-flag-store-CAdgpPiS.js} +1 -1
  22. package/dist/assets/{assistant-status-panel-DKnWIr7_.js → assistant-status-panel-BTnD-jhG.js} +1 -1
  23. package/dist/assets/auth-store-5qq59BAN.js +2 -0
  24. package/dist/assets/avatar-random-BMSYTcJK.js +1 -0
  25. package/dist/assets/{avatar-renderer-DK54o2kQ.js → avatar-renderer-ClUVcQmf.js} +1 -1
  26. package/dist/assets/{background-task-actions-CmYMPa2o.js → background-task-actions-DmP5s0oO.js} +1 -1
  27. package/dist/assets/{background-task-detail-panel-KDqjs7i2.js → background-task-detail-panel-BCYAElGc.js} +1 -1
  28. package/dist/assets/{background-task-store-DFS8MP5D.js → background-task-store-DMP8ByUq.js} +1 -1
  29. package/dist/assets/billing-page-B5j5TW_S.js +3 -0
  30. package/dist/assets/{billing-redirect-page-BRcj5q0u.js → billing-redirect-page-B1o1rsQZ.js} +1 -1
  31. package/dist/assets/{bookmarks-page-fFnFzh4F.js → bookmarks-page-D_Jr-a4Q.js} +1 -1
  32. package/dist/assets/{browser-CNL8hh8H.js → browser-CTZVDjOL.js} +2 -2
  33. package/dist/assets/build-state-m0LQ5Iis.js +1 -0
  34. package/dist/assets/channels-page-route-BYP9SOw5.js +9 -0
  35. package/dist/assets/chat-avatar-CvEA6z0H.js +1 -0
  36. package/dist/assets/chat-markdown-message-rxPKNeTx.js +2 -0
  37. package/dist/assets/{checkbox-BY0BDJjm.js → checkbox-CRmgkYah.js} +1 -1
  38. package/dist/assets/checkout-continuation-U3Pd2nxi.js +1 -0
  39. package/dist/assets/checkout-page-C5_9GbP-.js +1 -0
  40. package/dist/assets/checkout-return-target-DI6Hb-9L.js +1 -0
  41. package/dist/assets/client-feature-flag-store-CMncoan8.js +1 -0
  42. package/dist/assets/{client-identity-BS5mQsaQ.js → client-identity-DhkdvP5w.js} +1 -1
  43. package/dist/assets/{command-palette-CsRPcIM-.js → command-palette-BTaT__fo.js} +1 -1
  44. package/dist/assets/{command-palette-window-page-BzQ_oDaq.js → command-palette-window-page-gq0zowBe.js} +1 -1
  45. package/dist/assets/{community-page-mlhk4LsN.js → community-page-CsEKt9wX.js} +1 -1
  46. package/dist/assets/{connect-page-PuRyFup0.js → connect-page-B4aTS7Yj.js} +1 -1
  47. package/dist/assets/{consent-controls-BOFoWAYO.js → consent-controls-OcgxuxS0.js} +1 -1
  48. package/dist/assets/consent-hzYg-zbh.js +1 -0
  49. package/dist/assets/{contacts-gateway-C5OljhCC.js → contacts-gateway-B6OrAmU3.js} +1 -1
  50. package/dist/assets/{contacts-page-route-VBlklzVL.js → contacts-page-route-DNoCUXE7.js} +1 -1
  51. package/dist/assets/{conversation-cache-CqCkWHT6.js → conversation-cache-DKvwwWNo.js} +1 -1
  52. package/dist/assets/{conversation-list-fetchers-D84gJs6f.js → conversation-list-fetchers-DM-Y61u5.js} +1 -1
  53. package/dist/assets/conversation-navigation-DsN0hcpL.js +1 -0
  54. package/dist/assets/{conversation-queries-Ba_1sW5M.js → conversation-queries-CWvK6RLK.js} +1 -1
  55. package/dist/assets/{credential-entry-page-Bfrl1sD_.js → credential-entry-page-CHinHO85.js} +1 -1
  56. package/dist/assets/credentials-page-BsJFuOc9.js +1 -0
  57. package/dist/assets/{danger-zone-redirect-page-DKfrmf_o.js → danger-zone-redirect-page-SU45WI74.js} +1 -1
  58. package/dist/assets/debug-page-BziypDgA.js +4 -0
  59. package/dist/assets/{deploy-dialogs-BNMcZzII.js → deploy-dialogs-DZSd5o9b.js} +1 -1
  60. package/dist/assets/{deploy-store-CxnShfQj.js → deploy-store-D6snB1j5.js} +1 -1
  61. package/dist/assets/{detail-card-CwtjhGfi.js → detail-card-Du8OuE3q.js} +1 -1
  62. package/dist/assets/{detail-panel-stop-button-C1rystDS.js → detail-panel-stop-button-BNuh6N0s.js} +1 -1
  63. package/dist/assets/{detail-shell-DcNnOqM_.js → detail-shell-Cyqr5FXJ.js} +1 -1
  64. package/dist/assets/{developer-page-Bu7HBiPJ.js → developer-page-QMFEIyBS.js} +1 -1
  65. package/dist/assets/{devices-redirect-page-Cvt_H5ig.js → devices-redirect-page-B14wK98N.js} +1 -1
  66. package/dist/assets/{diagnostics-Dva51gYK.js → diagnostics-T_96Uyh5.js} +1 -1
  67. package/dist/assets/doctor-handoff-store-CYjL1S0n.js +1 -0
  68. package/dist/assets/document-viewer-container-B7TEDeV0.js +2 -0
  69. package/dist/assets/{document-viewer-page-kV6TCXu0.js → document-viewer-page-3Eq8L562.js} +1 -1
  70. package/dist/assets/effective-timezone-CmcoXrio.js +1 -0
  71. package/dist/assets/{emails-page-D9E3uXkG.js → emails-page-Wr4wPSYl.js} +1 -1
  72. package/dist/assets/{esm-BWFeAIOX.js → esm-BKewCp71.js} +2 -2
  73. package/dist/assets/{esm-DKdDWqsF.js → esm-Deuay4YU.js} +2 -2
  74. package/dist/assets/{esm-C6-ZMSya.js → esm-Dk6A-sQ0.js} +2 -2
  75. package/dist/assets/{esm-BQjZqfJZ.js → esm-IoT87yZe.js} +2 -2
  76. package/dist/assets/{esm-BTyZM-kf.js → esm-PYpy75OW.js} +2 -2
  77. package/dist/assets/esm-xItcektK.js +2 -0
  78. package/dist/assets/{eye-bbox-DXmmg9ML.js → eye-bbox-C_V87iLg.js} +1 -1
  79. package/dist/assets/feature-flag-catalog-I9-eJQP_.js +1 -0
  80. package/dist/assets/file-markdown-DaflJFk7.js +2 -0
  81. package/dist/assets/{first-run-scope-BoT9LMYw.js → first-run-scope-CL5YbC3b.js} +1 -1
  82. package/dist/assets/{funnel-events-CK938pi2.js → funnel-events-n2IVlwTo.js} +1 -1
  83. package/dist/assets/general-page-lbkufqHg.js +1 -0
  84. package/dist/assets/{get-memory-stats-ERcqnC0Q.js → get-memory-stats-BCYSpBF6.js} +1 -1
  85. package/dist/assets/{haptics-D9eNTUq-.js → haptics-DvWjk9Fg.js} +2 -2
  86. package/dist/assets/hatching-screen-D81diZoa.js +1 -0
  87. package/dist/assets/{home-page-route-BOCisuYY.js → home-page-route-CHe8eoLz.js} +1 -1
  88. package/dist/assets/{hosting-screen-6xIW6q02.js → hosting-screen-D9atAksQ.js} +1 -1
  89. package/dist/assets/{identity-page-route-qWwRSRld.js → identity-page-route-CK3YsXCN.js} +1 -1
  90. package/dist/assets/index-0f48hi7h.js +11 -0
  91. package/dist/assets/index-UKZ4bO6i.css +2 -0
  92. package/dist/assets/{ingest-DGkxw0Go.js → ingest-BizI657K.js} +1 -1
  93. package/dist/assets/{inspect-page-CRBfQ5WU.js → inspect-page-COwvbHtX.js} +3 -3
  94. package/dist/assets/{installed-plugins-query-C29LGAEV.js → installed-plugins-query-Cgek0q7G.js} +1 -1
  95. package/dist/assets/{integration-icon-Dvjn3ytY.js → integration-icon-dv-9Zzx3.js} +1 -1
  96. package/dist/assets/integrations-page-CJOBwxXp.js +1 -0
  97. package/dist/assets/{intelligence-layout-DP9zklR6.js → intelligence-layout-MNoGhi-l.js} +1 -1
  98. package/dist/assets/{invalidate-plugin-queries-DamxiwYv.js → invalidate-plugin-queries-C3NTXkCX.js} +1 -1
  99. package/dist/assets/{keyboard-shortcuts-redirect-page--bCvhp62.js → keyboard-shortcuts-redirect-page-CBI_mZIL.js} +1 -1
  100. package/dist/assets/{latest-assistant-text-D5WR-o6J.js → latest-assistant-text-DOepZ_Io.js} +2 -2
  101. package/dist/assets/{library-detail-page-pviljaQw.js → library-detail-page-DVwI94NZ.js} +1 -1
  102. package/dist/assets/{library-page-CYYuLywk.js → library-page-CNA794WY.js} +1 -1
  103. package/dist/assets/local-mode-BTovbt13.js +39 -0
  104. package/dist/assets/{local-runtime-upgrade-BggVMXfW.js → local-runtime-upgrade-Bqn3d7Q7.js} +1 -1
  105. package/dist/assets/login-flow-CD9tyuFG.js +1 -0
  106. package/dist/assets/{login-page-DdHXGGAt.js → login-page-BNStrcnU.js} +1 -1
  107. package/dist/assets/{logout-page-DjihP6Qk.js → logout-page-CpFeuLA_.js} +1 -1
  108. package/dist/assets/{logs-layout-C84-h0Hn.js → logs-layout-BUiPeZ4I.js} +1 -1
  109. package/dist/assets/{machine-sizes-DAflIPTM.js → machine-sizes-DO8duvpy.js} +1 -1
  110. package/dist/assets/{memory-page-route-dGWTWCWF.js → memory-page-route-C0cBV7HD.js} +1 -1
  111. package/dist/assets/{memory-router-playground-page-CjUiz_bH.js → memory-router-playground-page-D4UIq8mw.js} +1 -1
  112. package/dist/assets/{messages-Dl5_cjD9.js → messages-CFcAW4iz.js} +2 -2
  113. package/dist/assets/{metric-card-CkAD9RpC.js → metric-card-05a5slPx.js} +1 -1
  114. package/dist/assets/{mobile-sidebar-drawer-CbJ5JfXT.js → mobile-sidebar-drawer-DtKU2vlu.js} +1 -1
  115. package/dist/assets/native-anchor-CeekjwVy.js +1 -0
  116. package/dist/assets/native-biometric-BAMIyaSS.js +6 -0
  117. package/dist/assets/{native-file-B6_oAU2Q.js → native-file-ySSv1sQ7.js} +2 -2
  118. package/dist/assets/navigation-resolver-DPJxzx0h.js +1 -0
  119. package/dist/assets/{not-found-DV3iLBwm.js → not-found-OqaWNmdx.js} +1 -1
  120. package/dist/assets/{notifications-page-B9vnqyB1.js → notifications-page-ClfcJeLf.js} +1 -1
  121. package/dist/assets/{oauth-complete-page-BSxiDbQm.js → oauth-complete-page-rVmA2Cl8.js} +1 -1
  122. package/dist/assets/{oauth-connection-utils-DbcihBL8.js → oauth-connection-utils-CWPUW4MK.js} +1 -1
  123. package/dist/assets/{oauth-popup-complete-page-CyYbqLoK.js → oauth-popup-complete-page-DBsOvLES.js} +1 -1
  124. package/dist/assets/{onboarding-layout-Dd5fPfE7.js → onboarding-layout-DLs1hfp_.js} +1 -1
  125. package/dist/assets/onboarding-store-bZ2qYISk.js +1 -0
  126. package/dist/assets/open-workspace-file-DtK3a84K.js +2 -0
  127. package/dist/assets/{page-empty-state-BA3_YQN2.js → page-empty-state-DT-tC1u6.js} +1 -1
  128. package/dist/assets/{page-shell-_QxBKTK3.js → page-shell-C7SUgga9.js} +1 -1
  129. package/dist/assets/{pairing-page-DPfIgf3F.js → pairing-page-ZkFipOSH.js} +1 -1
  130. package/dist/assets/{password-reset-page-D55bGMVy.js → password-reset-page-iASQZawH.js} +1 -1
  131. package/dist/assets/{personality-page-fJJd-i4s.js → personality-page-BJpW3UXD.js} +1 -1
  132. package/dist/assets/plans-page-BDKqdYNM.js +1 -0
  133. package/dist/assets/{platform-detection-CMiRPRCq.js → platform-detection-XEAAu4c-.js} +1 -1
  134. package/dist/assets/{platform-login-notice-BG9TFAJa.js → platform-login-notice-CdYiKsE8.js} +1 -1
  135. package/dist/assets/{platform-loopback-page-DunGLusR.js → platform-loopback-page-D0gXCm2S.js} +1 -1
  136. package/dist/assets/{plugin-detail-page-BngHrN8T.js → plugin-detail-page-Bx2wzKEf.js} +1 -1
  137. package/dist/assets/{plugins-page-DD0t1_pE.js → plugins-page-B2zQ2iGh.js} +1 -1
  138. package/dist/assets/{prefs-BZnS5vR_.js → prefs-bw85lYLp.js} +1 -1
  139. package/dist/assets/{privacy-page-nZvfh3dh.js → privacy-page-B0QN4qZO.js} +1 -1
  140. package/dist/assets/privacy-screen-vp4uUpm6.js +1 -0
  141. package/dist/assets/{provider-callback-page-BwANEd-K.js → provider-callback-page-BH6DES7c.js} +1 -1
  142. package/dist/assets/{provider-key-B3R8SlMJ.js → provider-key-D2Nsf9zh.js} +1 -1
  143. package/dist/assets/{provider-signup-page-Cz2DP-jP.js → provider-signup-page-BAPcG_iJ.js} +1 -1
  144. package/dist/assets/provisioning-targets-BTjyR9nk.js +1 -0
  145. package/dist/assets/{quick-input-page-CF2MJnCE.js → quick-input-page-Dq-0BGrJ.js} +1 -1
  146. package/dist/assets/{react-query.gen-r3I6j8-1.js → react-query.gen-C5c1Acuq.js} +1 -1
  147. package/dist/assets/{remote-gateway-session-BHjZ9gQ6.js → remote-gateway-session-yRYdsfDx.js} +1 -1
  148. package/dist/assets/{research-mock-page-DnbQpZcp.js → research-mock-page-BJEpxdMv.js} +1 -1
  149. package/dist/assets/research-onboarding-route-CFL3q__m.js +50 -0
  150. package/dist/assets/{research-results-view-CxhTn2J7.js → research-results-view-C4sIw2gK.js} +1 -1
  151. package/dist/assets/{resolved-assistants-store-C-PdxK8f.js → resolved-assistants-store-Dw5UuGyB.js} +1 -1
  152. package/dist/assets/retire-confirm-dialog-CsSY2-T8.js +1 -0
  153. package/dist/assets/review-terms-screen-BhyRQBjl.js +1 -0
  154. package/dist/assets/{risk-C_bbPQPd.js → risk-CdT92Vqr.js} +2 -2
  155. package/dist/assets/routes-CaP5Tqj7.js +23 -0
  156. package/dist/assets/routes-D9sNqB_o.js +1 -0
  157. package/dist/assets/{runtime-upgrade-banner-DQI-l3Yc.js → runtime-upgrade-banner-DPqzKtZU.js} +2 -2
  158. package/dist/assets/{schedules-DF5cTXBf.js → schedules-6hzhR_C_.js} +1 -1
  159. package/dist/assets/schedules-page-DVnUeaoB.js +1 -0
  160. package/dist/assets/{sdk.gen-BVAVE6A_.js → sdk.gen-BHZ0fJla.js} +1 -1
  161. package/dist/assets/{security-redirect-page-BEohiPDW.js → security-redirect-page-4DKqyPsf.js} +1 -1
  162. package/dist/assets/{select-assistant-screen-C2q8wO2f.js → select-assistant-screen-CVV3iqMy.js} +1 -1
  163. package/dist/assets/{settings-divider-CXIrJieH.js → settings-divider-Ro7lPCkV.js} +1 -1
  164. package/dist/assets/settings-layout-B_4PKJr9.js +1 -0
  165. package/dist/assets/settings-navigation-CSG7jiyJ.js +1 -0
  166. package/dist/assets/{share-feedback-modal-B05-nKgu.js → share-feedback-modal-BoWCg4KH.js} +1 -1
  167. package/dist/assets/{sidebar-tree-ByF78JHW.js → sidebar-tree-C_PPNHe5.js} +1 -1
  168. package/dist/assets/{signup-page-CGauGszD.js → signup-page-D0S_8XYw.js} +1 -1
  169. package/dist/assets/{signup-shell-Bw6r9tWP.js → signup-shell-CMsBZ8vG.js} +1 -1
  170. package/dist/assets/{site-favicon-CCyX9r-Z.js → site-favicon-BB1pYWLF.js} +1 -1
  171. package/dist/assets/skill-detail-page-CTobyK6L.js +1 -0
  172. package/dist/assets/{skill-detail-panel-crqCBZbU.js → skill-detail-panel-CNzionF7.js} +1 -1
  173. package/dist/assets/{skills-C1CAcW7T.js → skills-Cum1XWT2.js} +1 -1
  174. package/dist/assets/{skills-page-BikP-AR7.js → skills-page-DZVxAbua.js} +1 -1
  175. package/dist/assets/slack-setup-wizard-DK2F8LXc.js +1 -0
  176. package/dist/assets/{sound-manager-xEbUgFv-.js → sound-manager-Bx-OcMAz.js} +1 -1
  177. package/dist/assets/{sounds-page-9_otQ97S.js → sounds-page-C45-RF4i.js} +1 -1
  178. package/dist/assets/{src-D89CNeuT.js → src-te3YTBG-.js} +4 -4
  179. package/dist/assets/{start-screen-DSF3melT.js → start-screen-CkJiCl9b.js} +1 -1
  180. package/dist/assets/{subagent-detail-panel-q0g4JWAX.js → subagent-detail-panel-DyyMdaNO.js} +1 -1
  181. package/dist/assets/subagent-store-MDi6lBXs.js +3 -0
  182. package/dist/assets/{superpowers-page-UgdWFWsF.js → superpowers-page-CaLzK5D-.js} +1 -1
  183. package/dist/assets/{system-events-page-Bw94HLwx.js → system-events-page-DXAU01ZO.js} +1 -1
  184. package/dist/assets/{system-events-redirect-page-BGZQC8-K.js → system-events-redirect-page-Bm9bipNo.js} +1 -1
  185. package/dist/assets/{theme-stage-page-bEZxHTyN.js → theme-stage-page-BDTCmutO.js} +1 -1
  186. package/dist/assets/{threshold-presets-BO8En2q0.js → threshold-presets-BdTTHCnm.js} +1 -1
  187. package/dist/assets/{tiptap-document-editor-CyY1HRzV.js → tiptap-document-editor-CHn2wCDv.js} +1 -1
  188. package/dist/assets/{tool-detail-panel-DFMOphDJ.js → tool-detail-panel-DFrWEWKG.js} +1 -1
  189. package/dist/assets/{transcript-message-body-shared-nWAkSzar.js → transcript-message-body-shared-D9_d2c2X.js} +1 -1
  190. package/dist/assets/{trust-rules-api-C0-hkXT2.js → trust-rules-api-B5lfygCA.js} +1 -1
  191. package/dist/assets/{upgrade-cancel-page-DwxI6NLL.js → upgrade-cancel-page-eiJEAvFz.js} +1 -1
  192. package/dist/assets/{upgrade-success-page-SO92J-Rf.js → upgrade-success-page-Cb1Gl4MM.js} +1 -1
  193. package/dist/assets/{usage-redirect-page-BJBkecYr.js → usage-redirect-page-BOfJ7uot.js} +1 -1
  194. package/dist/assets/{use-active-assistant-id-Cjbsk2Q3.js → use-active-assistant-id-CldxA_-M.js} +1 -1
  195. package/dist/assets/{use-app-theme-Q42fO5Nz.js → use-app-theme-Dg8A6vPA.js} +1 -1
  196. package/dist/assets/{use-assistant-avatar-DSu2_Mzi.js → use-assistant-avatar-bwLHcMz4.js} +1 -1
  197. package/dist/assets/{use-assistant-capability-gxe56K48.js → use-assistant-capability-CDS7GbSO.js} +1 -1
  198. package/dist/assets/{use-assistant-identity-details-CpHkzjrI.js → use-assistant-identity-details-9JRWxXTQ.js} +1 -1
  199. package/dist/assets/{use-avatar-accent-var-PV9tsBJj.js → use-avatar-accent-var-vpakP1ce.js} +1 -1
  200. package/dist/assets/{use-bookmarks-BbJtKyHe.js → use-bookmarks-CK-nOiT-.js} +1 -1
  201. package/dist/assets/{use-bundled-avatar-components-Gp_YaD6o.js → use-bundled-avatar-components-Bbs4vCnX.js} +2 -2
  202. package/dist/assets/use-checkout-dismiss-refresh-CqGR_OsB.js +1 -0
  203. package/dist/assets/use-command-palette-sections-CkpUaAKs.js +1 -0
  204. package/dist/assets/{use-edge-swipe-DVeTYbmY.js → use-edge-swipe-Wm9pU2HX.js} +1 -1
  205. package/dist/assets/{use-edge-swipe-back-DDq-N20h.js → use-edge-swipe-back-BcSHNCwS.js} +1 -1
  206. package/dist/assets/{use-edit-app-DfFIonqZ.js → use-edit-app-B_Nequzs.js} +1 -1
  207. package/dist/assets/{use-effective-timezone-LqzBqHBy.js → use-effective-timezone-Dqs8OaXJ.js} +1 -1
  208. package/dist/assets/use-invite-link-dialog-CPPOduk8.js +1 -0
  209. package/dist/assets/{use-ios-app-nudge-BO8jWfr0.js → use-ios-app-nudge-B-ojl-b1.js} +1 -1
  210. package/dist/assets/use-is-org-ready-C5xlYywh.js +1 -0
  211. package/dist/assets/use-onboarding-login-DI5gvqEG.js +1 -0
  212. package/dist/assets/use-platform-assistant-id-DOsSt6k1.js +1 -0
  213. package/dist/assets/use-platform-gate-C65D14xY.js +1 -0
  214. package/dist/assets/{use-reduced-motion-Se97jRQ-.js → use-reduced-motion-W1fCe3vS.js} +1 -1
  215. package/dist/assets/{use-save-twilio-credentials-CUQ6gdIj.js → use-save-twilio-credentials-c9xG9RPK.js} +1 -1
  216. package/dist/assets/{use-skill-actions-DgK7Nmt1.js → use-skill-actions-BAAx1Eia.js} +1 -1
  217. package/dist/assets/{use-skill-detail-files-_v4zUF6S.js → use-skill-detail-files-BvOKvY0-.js} +1 -1
  218. package/dist/assets/use-sticky-profiles-CdWX0mgI.js +1 -0
  219. package/dist/assets/{use-subagent-card-data-YbAN73Fw.js → use-subagent-card-data-DHuNtSy9.js} +1 -1
  220. package/dist/assets/use-supports-credentials-settings-BbfghcWq.js +1 -0
  221. package/dist/assets/{use-swipe-engine-DRvffOuu.js → use-swipe-engine-6PcZZMVD.js} +1 -1
  222. package/dist/assets/{utils-BtC1KiH4.js → utils-B0rBxtYP.js} +1 -1
  223. package/dist/assets/{viewer-store-BDpZVbcr.js → viewer-store-DLk-jp8U.js} +1 -1
  224. package/dist/assets/{voice-list-DJeZeHuA.js → voice-list-CW8mzaHU.js} +1 -1
  225. package/dist/assets/{voice-page-DQcyxaPl.js → voice-page-0zsCIOdT.js} +1 -1
  226. package/dist/assets/{voice-picker-modal-BXMvQihh.js → voice-picker-modal-PdsZwrsV.js} +1 -1
  227. package/dist/assets/{weather-forecast-display-D2sn4QD4.js → weather-forecast-display-BAAnrNdd.js} +1 -1
  228. package/dist/assets/{web-Bj8XUknF.js → web-B3Q8ntoM.js} +1 -1
  229. package/dist/assets/{web-BE7l06mM.js → web-BlvxItuO.js} +1 -1
  230. package/dist/assets/{welcome-screen-n-cGiojh.js → welcome-screen-DwOAZpZS.js} +1 -1
  231. package/dist/assets/{workflow-detail-panel-Cq3AwWXE.js → workflow-detail-panel-DGL2BZSr.js} +1 -1
  232. package/dist/assets/{workflow-store-QV5aMjTt.js → workflow-store-lM7yKbUo.js} +1 -1
  233. package/dist/assets/workspace-page-D4NvhCv1.js +1 -0
  234. package/dist/assets/workspace-tree-query-B1A-efgV.js +1 -0
  235. package/dist/index.html +144 -141
  236. package/package.json +1 -1
  237. package/dist/assets/access-D3fUSyFH.js +0 -1
  238. package/dist/assets/ai-page-BznkOakE.js +0 -1
  239. package/dist/assets/animated-avatar-DzfEDnTh.js +0 -1
  240. package/dist/assets/api-CJFoPWHm.js +0 -1
  241. package/dist/assets/auth-store-D9BqFncz.js +0 -2
  242. package/dist/assets/billing-page-Cc5fHBn2.js +0 -3
  243. package/dist/assets/build-state-WR9nlRgM.js +0 -1
  244. package/dist/assets/channels-page-route-wxREzs6W.js +0 -9
  245. package/dist/assets/chat-avatar-DIDq1Jt5.js +0 -1
  246. package/dist/assets/chat-markdown-message-ERK48E1Z.js +0 -2
  247. package/dist/assets/client-feature-flag-store-oTfL8Oiz.js +0 -1
  248. package/dist/assets/consent-DbD2Hcbf.js +0 -1
  249. package/dist/assets/conversation-navigation-Wm7_pLFs.js +0 -1
  250. package/dist/assets/credentials-page-B-AJyMvk.js +0 -1
  251. package/dist/assets/debug-page-DWEIExMH.js +0 -4
  252. package/dist/assets/document-viewer-container-Cl4jDmfx.js +0 -2
  253. package/dist/assets/effective-timezone-qiooajmO.js +0 -1
  254. package/dist/assets/esm-CDPcGg-B.js +0 -2
  255. package/dist/assets/feature-flag-catalog-BAyJlRMY.js +0 -1
  256. package/dist/assets/file-Ddp9Dqgl.js +0 -1
  257. package/dist/assets/file-markdown-CLmQTpqL.js +0 -2
  258. package/dist/assets/general-page-DpKVqj5t.js +0 -1
  259. package/dist/assets/hatching-screen-d3SWqFKY.js +0 -1
  260. package/dist/assets/index-B0l9Wjpj.css +0 -2
  261. package/dist/assets/index-BOC87TAq.js +0 -11
  262. package/dist/assets/integrations-page-D5KWY6v-.js +0 -1
  263. package/dist/assets/local-mode-Ckii2tmN.js +0 -39
  264. package/dist/assets/login-flow-BCNBNLzu.js +0 -1
  265. package/dist/assets/native-anchor-CVNubOIm.js +0 -1
  266. package/dist/assets/native-biometric-CntdlaL-.js +0 -6
  267. package/dist/assets/onboarding-store-DutUn1E3.js +0 -1
  268. package/dist/assets/open-workspace-file-CpveqBim.js +0 -2
  269. package/dist/assets/plans-page-C-JyEPT_.js +0 -1
  270. package/dist/assets/privacy-screen-D2aDT6E6.js +0 -1
  271. package/dist/assets/research-onboarding-route-yg2iKw6i.js +0 -50
  272. package/dist/assets/retire-confirm-dialog--eF_pXhA.js +0 -1
  273. package/dist/assets/review-terms-screen-Dpk-gyJE.js +0 -1
  274. package/dist/assets/routes-BBFM42ft.js +0 -23
  275. package/dist/assets/routes-vE-2hncW.js +0 -1
  276. package/dist/assets/schedules-page-Dgu-znOf.js +0 -1
  277. package/dist/assets/settings-layout-b7iBWIT-.js +0 -1
  278. package/dist/assets/settings-navigation-BGdjm0Ki.js +0 -1
  279. package/dist/assets/skill-detail-page-GlV5JRzQ.js +0 -1
  280. package/dist/assets/slack-setup-wizard-DKj1_XdA.js +0 -1
  281. package/dist/assets/stream-watchdog-BafbDdX9.js +0 -1
  282. package/dist/assets/subagent-store-D-GPthdC.js +0 -3
  283. package/dist/assets/use-checkout-dismiss-refresh-kdxxDNpF.js +0 -1
  284. package/dist/assets/use-command-palette-sections-BWjxkwKB.js +0 -1
  285. package/dist/assets/use-invite-link-dialog-DX58-LWY.js +0 -1
  286. package/dist/assets/use-is-org-ready-X_98Cnx9.js +0 -1
  287. package/dist/assets/use-onboarding-login-B8rpbSEh.js +0 -1
  288. package/dist/assets/use-platform-gate-Dry0Nv4f.js +0 -1
  289. package/dist/assets/use-sticky-profiles-B0zVD3uk.js +0 -1
  290. package/dist/assets/workspace-page-CL9z2Jrs.js +0 -1
  291. /package/dist/assets/{app-info-qQex8Ndg.js → app-info-DefDjPEl.js} +0 -0
  292. /package/dist/assets/{app-types-CBg2__YH.js → app-types-DSkgEmV3.js} +0 -0
  293. /package/dist/assets/{apple-logo-poQac1tY.js → apple-logo--8ZT6Umn.js} +0 -0
  294. /package/dist/assets/{avatar-bundled-components-CecbESCk.js → avatar-bundled-components-DPqbVXi9.js} +0 -0
  295. /package/dist/assets/{avatar-subagent-C9WTTUjI.js → avatar-subagent-CRA2B82x.js} +0 -0
  296. /package/dist/assets/{avatar-svg-compositor-FtVPqzlC.js → avatar-svg-compositor-Dl-ckXRE.js} +0 -0
  297. /package/dist/assets/{avatar-tone-CMoWR2JX.js → avatar-tone-BKwvoDSj.js} +0 -0
  298. /package/dist/assets/{browser-timezone-C_0jBUid.js → browser-timezone-CGwaX5Uv.js} +0 -0
  299. /package/dist/assets/{build.umd-59c0EvgO.js → build.umd-Bixyt_xE.js} +0 -0
  300. /package/dist/assets/{by-tool-use-id-index-aoRP6d51.js → by-tool-use-id-index-M50wYE1f.js} +0 -0
  301. /package/dist/assets/{chat-BrL0k2UY.js → chat-CDFCY8f0.js} +0 -0
  302. /package/dist/assets/{chat-layout-slots-store-C2IFeZFr.js → chat-layout-slots-store-BJfYGnd7.js} +0 -0
  303. /package/dist/assets/{conversation-selection-3EKkKt0G.js → conversation-selection-oJy8Oht3.js} +0 -0
  304. /package/dist/assets/{conversation-store-bshB7nDP.js → conversation-store-C--wWMNW.js} +0 -0
  305. /package/dist/assets/{definitions-PikNVFdS.js → definitions-D_AmTPWg.js} +0 -0
  306. /package/dist/assets/{definitions-OhJf_HMS.js → definitions-JF3PcEff.js} +0 -0
  307. /package/dist/assets/{dictation-overlay-page-zpoNqudq.js → dictation-overlay-page-DtgaXzdF.js} +0 -0
  308. /package/dist/assets/{edge-swipe-arbiter-store-DyemvsR-.js → edge-swipe-arbiter-store-CQnDi2yf.js} +0 -0
  309. /package/dist/assets/{edit-chat-session-yPtopwB6.js → edit-chat-session-D37Qx6ol.js} +0 -0
  310. /package/dist/assets/{emoji-catalog-data-COLzb2Wj.js → emoji-catalog-data-BCc1YNMR.js} +0 -0
  311. /package/dist/assets/{environment-store-BFVmN-OW.js → environment-store-Bft0lpgv.js} +0 -0
  312. /package/dist/assets/{esm-DEY-lP80.js → esm-DNvorKcw.js} +0 -0
  313. /package/dist/assets/{external-urls-BYwuIdYk.js → external-urls-_vjsdj2L.js} +0 -0
  314. /package/dist/assets/{file-editor-DpNdd7HZ.js → file-editor-phorJEVv.js} +0 -0
  315. /package/dist/assets/{format-date-RZ9mCDCy.js → format-date-BGnM4mqL.js} +0 -0
  316. /package/dist/assets/{format-file-size-CQaPE33p.js → format-file-size-BgMTiWPt.js} +0 -0
  317. /package/dist/assets/{hard-navigate-DZlpL1No.js → hard-navigate-DyUrcxe0.js} +0 -0
  318. /package/dist/assets/{link-click-BoSQACXo.js → link-click-DLYgWZdo.js} +0 -0
  319. /package/dist/assets/{misc-DckBb5zz.js → misc-CuYswARt.js} +0 -0
  320. /package/dist/assets/{mutation-error-CwYvaYnb.js → mutation-error-DEknRDAQ.js} +0 -0
  321. /package/dist/assets/{native-deep-link-PvbVHiPM.js → native-deep-link-DCBJ-Rw0.js} +0 -0
  322. /package/dist/assets/{oauth-popup-DZEqljdC.js → oauth-popup-OhSYYlQF.js} +0 -0
  323. /package/dist/assets/{onboarding-step-layout-CURfuoh4.js → onboarding-step-layout-D9rghAjS.js} +0 -0
  324. /package/dist/assets/{optimistic-lifecycle-C2a6IJ7E.js → optimistic-lifecycle-BINTsVFx.js} +0 -0
  325. /package/dist/assets/{pdf-IQXtc7_x.js → pdf-BlwLcQAc.js} +0 -0
  326. /package/dist/assets/{plugin-attribution-DCFEMRUF.js → plugin-attribution-DrwveSW_.js} +0 -0
  327. /package/dist/assets/{plugins-surface-D4i2vqBz.js → plugins-surface-B43Op43l.js} +0 -0
  328. /package/dist/assets/{pointer-RLpjGG7A.js → pointer-BbPfN86L.js} +0 -0
  329. /package/dist/assets/{prechat-DIuViPZk.js → prechat-CeL4a_1i.js} +0 -0
  330. /package/dist/assets/{profile-metadata-h4CTeMKT.js → profile-metadata-BhqRdqUJ.js} +0 -0
  331. /package/dist/assets/{proxy-RtD8704m.js → proxy-D7UPVac3.js} +0 -0
  332. /package/dist/assets/{public-asset-CbDDcomC.js → public-asset-BBVUuTT_.js} +0 -0
  333. /package/dist/assets/{react-query.gen-Mwd5l-vZ.js → react-query.gen-BC3STDmV.js} +0 -0
  334. /package/dist/assets/{research-facts-UIXXE8D6.js → research-facts-B7Ev1zv0.js} +0 -0
  335. /package/dist/assets/{research-onboarding-persistence-CceFfAqE.js → research-onboarding-persistence-51lJoYJ2.js} +0 -0
  336. /package/dist/assets/{sandbox-bridge-DgDrAWv3.js → sandbox-bridge-BxW8HZq_.js} +0 -0
  337. /package/dist/assets/{sdk.gen-DPKrJeho.js → sdk.gen-B5ygTzyg.js} +0 -0
  338. /package/dist/assets/{setting-row-0LXvW7Kh.js → setting-row-BwXKepmJ.js} +0 -0
  339. /package/dist/assets/{status-badge-pill-z1OKPW3B.js → status-badge-pill-wJPMXQk1.js} +0 -0
  340. /package/dist/assets/{theme-preferences-ln8xC5zH.js → theme-preferences-Bb2pPRXa.js} +0 -0
  341. /package/dist/assets/{three-dot-indicator-SJcKW5cG.js → three-dot-indicator-BMvKQ_On.js} +0 -0
  342. /package/dist/assets/{use-bus-subscription-Cu4Y9DQi.js → use-bus-subscription-nUrbz9Mu.js} +0 -0
  343. /package/dist/assets/{use-copy-to-clipboard-DBVpNZOl.js → use-copy-to-clipboard-cF7ZSilD.js} +0 -0
  344. /package/dist/assets/{use-is-mobile-Bz2l7wPL.js → use-is-mobile-BlQuzI5Z.js} +0 -0
  345. /package/dist/assets/{web-7I6Bn0iP.js → web-9Cwi5jnT.js} +0 -0
  346. /package/dist/assets/{web-CBluPLFP.js → web-Bi-BvsRt.js} +0 -0
  347. /package/dist/assets/{web-Cmg3AbZk.js → web-D486_dlv.js} +0 -0
  348. /package/dist/assets/{web-DHVjLzid.js → web-DUb4LJ2M.js} +0 -0
  349. /package/dist/assets/{web-BEpNr5_U.js → web-l9DWMZeA.js} +0 -0
  350. /package/dist/assets/{web-BPyURh2Z.js → web-sr1ba6fP.js} +0 -0
  351. /package/dist/assets/{workflow-status-DXdUkbSd.js → workflow-status-HyIIhMBP.js} +0 -0
  352. /package/dist/assets/{workspace-theme-tokens-J8dqkK9n.js → workspace-theme-tokens-DNNwX-XS.js} +0 -0
  353. /package/dist/assets/{xterm-CdT0HObJ.js → xterm-DgGqTfet.js} +0 -0
  354. /package/dist/assets/{xterm-addon-fit-CPcVj1i5.js → xterm-addon-fit-BVObYBMM.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{B as r,H as i,U as a,V as o,h as s,n as c,r as l}from"./proxy-RtD8704m.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),c=(0,d.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:f}=(0,d.useContext)(l),p=m(s,e.props?.ref??e?.ref);return(0,d.useInsertionEffect)(()=>{let{width:e,height:l,top:u,left:d,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!l)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{B as r,H as i,U as a,V as o,h as s,n as c,r as l}from"./proxy-D7UPVac3.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),c=(0,d.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:f}=(0,d.useContext)(l),p=m(s,e.props?.ref??e?.ref);return(0,d.useInsertionEffect)(()=>{let{width:e,height:l,top:u,left:d,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!l)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-DckBb5zz.js";import{t as i}from"./format-file-size-CQaPE33p.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-CuYswARt.js";import{t as i}from"./format-file-size-BgMTiWPt.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{u as e}from"./routes-vE-2hncW.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{u as e}from"./routes-D9sNqB_o.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-m5eeGBnd.js";import{n as i,t as a}from"./app-info-qQex8Ndg.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-m5eeGBnd.js";import{n as i,t as a}from"./app-info-DefDjPEl.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-5qq59BAN.js";import{t}from"./assistant-feature-flag-store-CAdgpPiS.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-D9BqFncz.js";import{f as s}from"./native-biometric-CntdlaL-.js";import{u as c}from"./routes-vE-2hncW.js";import{t as l}from"./hard-navigate-DZlpL1No.js";import{n as u,t as d}from"./login-flow-BCNBNLzu.js";import{r as f,t as p}from"./account-shell-C_IH8r44.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-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-5qq59BAN.js";import{f as s}from"./native-biometric-BAMIyaSS.js";import{u as c}from"./routes-D9sNqB_o.js";import{t as l}from"./hard-navigate-DyUrcxe0.js";import{n as u,t as d}from"./login-flow-CD9tyuFG.js";import{r as f,t as p}from"./account-shell-Dk4aC-Ls.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"./notice-BMK7xqUw.js";import"./src-D89CNeuT.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
1
+ import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{t}from"./notice-BMK7xqUw.js";import"./src-te3YTBG-.js";var n=e(),r=(0,n.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,n.jsx)(`path`,{d:`M7.5 15L12.5 10L7.5 5`,stroke:`currentColor`,strokeWidth:`1.67`,strokeLinecap:`round`,strokeLinejoin:`round`})});function i({onSubmit:e,error:i,children:a,submitLabel:o,submittingLabel:s,isSubmitting:c,footer:l}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`form`,{onSubmit:e,className:`flex flex-col gap-4`,children:[i&&(0,n.jsx)(t,{tone:`error`,children:i}),(0,n.jsx)(`div`,{className:`flex flex-col gap-3`,children:a}),(0,n.jsxs)(`button`,{type:`submit`,disabled:c,className:`mt-2 inline-flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)] disabled:cursor-wait disabled:opacity-50`,children:[c?s:o,r]})]}),l&&(0,n.jsx)(`div`,{className:`mt-8 text-center`,children:l})]})}function a(e){return(0,n.jsx)(`input`,{...e,className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-4 py-3 text-sm text-[var(--content-default)] outline-none placeholder:text-[var(--content-tertiary)] focus:border-[var(--primary-base)]/50`})}function o({title:e,subtitle:t}){return(0,n.jsxs)(`div`,{className:`mb-8 text-center`,children:[(0,n.jsx)(`h1`,{className:`mb-2 font-serif text-[2rem] font-bold italic text-[var(--content-default)]`,children:e}),t&&(0,n.jsx)(`p`,{className:`text-sm text-[var(--content-secondary)]`,children:t})]})}function s({children:e}){return(0,n.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)]`,children:(0,n.jsx)(`div`,{className:`w-full max-w-[480px] px-6`,children:(0,n.jsx)(`div`,{className:`flex flex-col items-center gap-10`,children:(0,n.jsx)(`div`,{className:`w-full`,children:e})})})})}export{a as i,i as n,o as r,s as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{t}from"./createLucideIcon-CAM1RhH8.js";import{t as n}from"./code-qafFA0_-.js";import{n as r}from"./resolved-assistants-store-C-PdxK8f.js";import{Ur as i}from"./sdk.gen-BVAVE6A_.js";import{t as a}from"./public-asset-CbDDcomC.js";import{r as o}from"./acp-run-store-C6n-XeY_.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-CAM1RhH8.js";import{t as n}from"./code-qafFA0_-.js";import{n as r}from"./resolved-assistants-store-Dw5UuGyB.js";import{Wr as i}from"./sdk.gen-BHZ0fJla.js";import{t as a}from"./public-asset-BBVUuTT_.js";import{r as o}from"./acp-run-store-B_eDLRwl.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-Bj8_eutd.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-Dy5001j6.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./typography-DEI9Ra9z.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./acp-run-actions-CAjb0Wcm.js";import{t as p}from"./arrow-left-C2ylPLHq.js";import{t as m}from"./brain-BIzJCPA6.js";import{t as h}from"./chevron-down-B5A-0g8A.js";import{t as g}from"./chevron-right-HU6H84S0.js";import{t as _}from"./circle-check-CjGnAahM.js";import{t as v}from"./circle-minus-DNfBAj4g.js";import{w as y}from"./menu-BvjhxZo7.js";import{t as b}from"./code-qafFA0_-.js";import{t as x}from"./file-text-Br730Q4B.js";import{t as ee}from"./globe-CMtjL_s_.js";import{t as te}from"./repeat-GCVYEp1h.js";import{t as ne}from"./search-BVW-n8to.js";import{t as S}from"./send-Q71Exj3z.js";import{t as re}from"./square-D_e8nR-F.js";import{t as C}from"./terminal-CdCI6wMV.js";import{t as ie}from"./trash-2-L5LNgw9o.js";import{t as ae}from"./triangle-alert-CQfiAg_t.js";import{t as oe}from"./x-JBAsSOmg.js";import"./src-D89CNeuT.js";import{t as se}from"./tag-NXcyiTkK.js";import{t as w}from"./chat-markdown-message-ERK48E1Z.js";import{a as T,i as ce,n as E,r as D}from"./acp-run-store-C6n-XeY_.js";import{t as O}from"./three-dot-indicator-SJcKW5cG.js";import{t as le}from"./status-badge-pill-z1OKPW3B.js";var ue=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`}]]),k=e(n(),1),A=``;function j(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function de(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function M(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(E.length):t}function N(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function P(e,t){if(t.updateType===`agent_message_chunk`&&de(t)){N(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:M(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??A,r=M(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(N(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??A,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==A&&r&&r.kind===`agent`&&r.messageId===A&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}N(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??A,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}N(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;N(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:j(t.toolStatus,`running`),content:t.content,locations:F(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=F(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:j(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=fe(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(N(e),e.push(i)):e[r]=i;return}}}function F(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function fe(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function pe(e){let t=[];for(let n of e)P(t,n);return t}function me(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function I(){let e=null,t=[];function n(n){return t=pe(n),e=n,t}function r(r){let i=me(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)P(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,k.useRef)(null);return t.current??=I(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Bj8_eutd.js";import{t as n}from"./react-BFJW0bSv.js";import{t as r}from"./button-Dy5001j6.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./typography-DEI9Ra9z.js";import{t as o}from"./createLucideIcon-CAM1RhH8.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./acp-run-actions-BH8wuBAL.js";import{t as p}from"./arrow-left-C2ylPLHq.js";import{t as m}from"./brain-BIzJCPA6.js";import{t as h}from"./chevron-down-B5A-0g8A.js";import{t as g}from"./chevron-right-HU6H84S0.js";import{t as _}from"./circle-check-CjGnAahM.js";import{t as v}from"./circle-minus-DNfBAj4g.js";import{w as y}from"./menu-BvjhxZo7.js";import{t as b}from"./code-qafFA0_-.js";import{t as x}from"./file-text-Br730Q4B.js";import{t as ee}from"./globe-CMtjL_s_.js";import{t as te}from"./repeat-GCVYEp1h.js";import{t as ne}from"./search-BVW-n8to.js";import{t as S}from"./send-Q71Exj3z.js";import{t as re}from"./square-D_e8nR-F.js";import{t as C}from"./terminal-CdCI6wMV.js";import{t as ie}from"./trash-2-L5LNgw9o.js";import{t as ae}from"./triangle-alert-CQfiAg_t.js";import{t as oe}from"./x-JBAsSOmg.js";import"./src-te3YTBG-.js";import{t as se}from"./tag-NXcyiTkK.js";import{t as w}from"./chat-markdown-message-rxPKNeTx.js";import{a as T,i as ce,n as E,r as D}from"./acp-run-store-B_eDLRwl.js";import{t as O}from"./three-dot-indicator-BMvKQ_On.js";import{t as le}from"./status-badge-pill-wJPMXQk1.js";var ue=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`}]]),k=e(n(),1),A=``;function j(e,t){switch(e){case`complete`:case`completed`:return`completed`;case`failed`:case`error`:return`error`;case void 0:return t;default:return`running`}}function de(e){return(e.messageId?.startsWith(`local-marker-`)??!1)||(e.content?.startsWith(`↻ Steering: `)??!1)}function M(e){let t=e??``;return t.startsWith(`↻ Steering: `)?t.slice(E.length):t}function N(e){let t=e[e.length-1];t&&(t.kind===`agent`||t.kind===`thinking`)&&!t.isComplete&&(e[e.length-1]={...t,isComplete:!0})}function P(e,t){if(t.updateType===`agent_message_chunk`&&de(t)){N(e),e.push({kind:`user`,id:t.messageId??`steer-${e.length}`,content:M(t.content)});return}switch(t.updateType){case`user_message_chunk`:{let n=t.messageId??A,r=M(t.content),i=e[e.length-1];i&&i.kind===`user`&&i.id===n?e[e.length-1]={...i,content:i.content+r}:(N(e),e.push({kind:`user`,id:n,content:r}));let a=e[e.length-1].content;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.kind===`user`&&n.id.startsWith(`local-marker-`)&&n.content===a){e.splice(t,1);break}}return}case`agent_message_chunk`:{let n=t.messageId??A,r=e[e.length-1];if(r&&r.kind===`agent`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}if(n!==A&&r&&r.kind===`agent`&&r.messageId===A&&!r.isComplete&&r.content===(t.content??``)){e[e.length-1]={...r,messageId:n};return}N(e),e.push({kind:`agent`,messageId:n,content:t.content??``,isComplete:!1});return}case`agent_thought_chunk`:{let n=t.messageId??A,r=e[e.length-1];if(r&&r.kind===`thinking`&&r.messageId===n){e[e.length-1]={...r,content:r.content+(t.content??``)};return}N(e),e.push({kind:`thinking`,messageId:n,content:t.content??``,isComplete:!1});return}case`tool_call`:{let n=t.toolCallId;if(n===void 0)return;N(e),e.push({kind:`tool`,toolCallId:n,title:t.toolTitle??``,toolKind:t.toolKind,status:j(t.toolStatus,`running`),content:t.content,locations:F(t),rawInput:t.rawInput,rawOutput:t.rawOutput});return}case`tool_call_update`:{let n=t.toolCallId;if(n===void 0)return;let r=e.findIndex(e=>e.kind===`tool`&&e.toolCallId===n);if(r===-1)return;let i=e[r],a=F(t);e[r]={...i,title:t.toolTitle??i.title,toolKind:t.toolKind??i.toolKind,status:j(t.toolStatus,i.status),content:t.content??i.content,locations:a??i.locations,rawInput:t.rawInput===void 0?i.rawInput:t.rawInput,rawOutput:t.rawOutput===void 0?i.rawOutput:t.rawOutput};return}case`plan`:{let n=fe(t.content);if(n===null)return;let r=e.findIndex(e=>e.kind===`plan`),i={kind:`plan`,entries:n};r===-1?(N(e),e.push(i)):e[r]=i;return}}}function F(e){let t=e.locations;if(!Array.isArray(t))return;let n=[];for(let e of t){let t=e??{};typeof t.path==`string`&&n.push(typeof t.line==`number`?{path:t.path,line:t.line}:{path:t.path})}return n}function fe(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:Array.isArray(t?.entries)?t.entries:null;return n===null?null:n.map(e=>{let t=e??{},n=t.content??t.label??``;return{label:typeof n==`string`?n:String(n),checked:t.checked===!0||t.status===`completed`}})}function pe(e){let t=[];for(let n of e)P(t,n);return t}function me(e,t){if(e===t)return{kind:`identity`};if(e===null)return{kind:`first`};if(t.length<e.length)return{kind:`fallback`};for(let n=0;n<e.length;n++)if(e[n]!==t[n])return n===e.length-1&&t.length===e.length?{kind:`mutate-last`}:{kind:`fallback`};return t.length===e.length?{kind:`identity`}:{kind:`append`,from:e.length}}function I(){let e=null,t=[];function n(n){return t=pe(n),e=n,t}function r(r){let i=me(e,r);switch(i.kind){case`identity`:return t;case`first`:return n(r);case`append`:{let n=t.slice();for(let e=i.from;e<r.length;e++)P(n,r[e]);return e=r,t=n,t}case`mutate-last`:case`fallback`:return n(r)}}return{project:r}}function L(e){let t=(0,k.useRef)(null);return t.current??=I(),t.current.project(e)}function R(e){if(!e)return[];let t;try{t=JSON.parse(e)}catch{let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)?[]:[{type:`content`,text:e}]}let n=Array.isArray(t)?t:[t],r=[];for(let e of n){let t=z(e);t&&r.push(t)}return r}function z(e){if(typeof e!=`object`||!e)return null;let t=e;switch(t.type){case`content`:return{type:`content`,text:he(t.content)};case`diff`:return typeof t.path!=`string`||typeof t.newText!=`string`?null:{type:`diff`,path:t.path,newText:t.newText,...typeof t.oldText==`string`?{oldText:t.oldText}:{}};case`terminal`:{let e=ge(t);return e===void 0?{type:`terminal`}:{type:`terminal`,text:e}}default:return null}}function he(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e){let t=e.text;if(typeof t==`string`)return t}return``}function ge(e){if(typeof e.text==`string`)return e.text;if(typeof e.output==`string`)return e.output;if(typeof e.content==`string`)return e.content;if(typeof e.content==`object`&&e.content!==null){let t=e.content.text;if(typeof t==`string`)return t}}function B(e){if(typeof e!=`object`||!e)return;let t=e.command;return typeof t==`string`?t:void 0}function V(e){return R(e).filter(e=>e.type===`content`||e.type===`terminal`).map(e=>`text`in e?e.text??``:``).filter(e=>e.length>0).join(`
2
2
  `)}function H(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}}function U(e,t){let n=new Map;for(let t of e)t.type===`diff`&&n.set(t.path,{path:t.path,newText:t.newText,...t.oldText===void 0?{}:{oldText:t.oldText}});for(let e of t??[])n.has(e.path)||n.set(e.path,{path:e.path});return Array.from(n.values())}var W=i();function _e({content:e,isComplete:t}){return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-agent-message`,className:`flex w-full flex-col items-start text-chat text-[var(--content-default)]`,children:[(0,W.jsx)(w,{content:e}),!t&&(0,W.jsx)(O,{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(T(e))return null;if(e===`failed`)return(0,W.jsxs)(`div`,{"data-testid":`acp-chat-terminal-block`,"data-terminal-kind":`failed`,className:`flex items-start gap-2 rounded-lg bg-[var(--system-negative-weak)] px-3 py-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,"data-testid":`acp-chat-terminal-failed-icon`,className:`flex h-[12px] w-4 shrink-0 items-center justify-center`,children:(0,W.jsx)(ae,{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}){let[n,r]=(0,k.useState)(null),i=n??!t,a=e.trim().length>0,o=t?`Thought process`:`Thinking`,s=t?(0,W.jsx)(m,{"aria-hidden":!0,className:`h-3.5 w-3.5 shrink-0`}):(0,W.jsx)(O,{dotSize:5,className:`shrink-0`,"data-testid":`acp-chat-thinking-streaming`});return a?(0,W.jsxs)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:[(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":i,onClick:()=>r(!i),"data-testid":`acp-chat-thinking-toggle`,className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)] transition-colors hover:text-[var(--content-secondary)]`,children:[i?(0,W.jsx)(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`}),s,(0,W.jsx)(`span`,{children:o})]}),i&&(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-body`,className:`mt-1.5 border-l-2 border-[var(--border-base)] pl-3 text-body-small-default text-[var(--content-tertiary)]`,children:(0,W.jsx)(w,{content:e})})]}):(0,W.jsx)(`div`,{"data-testid":`acp-chat-thinking-block`,className:`w-full`,children:(0,W.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:[s,(0,W.jsx)(`span`,{children:o})]})})}var we={running:`neutral`,completed:`positive`,error:`negative`,ended:`neutral`},Te={running:`Running`,completed:`Completed`,error:`Failed`,ended:`Ended`},Ee={read:`Read file`,edit:`Edit file`,delete:`Delete file`,move:`Move file`,search:`Search`,execute:`Run command`,think:`Thinking`,fetch:`Fetch`,switch_mode:`Switch mode`},De=`Tool call`,Oe={read:x,edit:ue,delete:ie,move:s,search:ne,execute:C,think:m,fetch:ee,switch_mode:te},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,k.useState)(!1),s=(0,k.useMemo)(()=>R(e.content),[e.content]),c=(0,k.useMemo)(()=>V(e.content),[e.content]),l=(0,k.useMemo)(()=>c.split(`
3
3
  `).map(e=>e.trim()).find(e=>e.length>0&&!e.startsWith("```"))||`View output`,[c]),u=(0,k.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)(se,{tone:we[d],"data-testid":`acp-chat-tool-status`,children:Te[d]}),f&&(0,W.jsx)(O,{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)(C,{"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}){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)(w,{content:V(e),hardLineBreaks:!0})})}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-Qo7kcikX.js";import{t as n}from"./by-tool-use-id-index-aoRP6d51.js";import{a as r,i,n as a,r as o,t as s}from"./optimistic-lifecycle-C2a6IJ7E.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-Qo7kcikX.js";import{t as n}from"./by-tool-use-id-index-M50wYE1f.js";import{a as r,i,n as a,r as o,t as s}from"./optimistic-lifecycle-BINTsVFx.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-Dy5001j6.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{H as a,S as o,c as s,l as c,x as l}from"./risk-C_bbPQPd.js";import{_ as u,a as d,f,g as p,i as m,r as h,v as g,y as _}from"./transcript-message-body-shared-nWAkSzar.js";import{t as v}from"./chevron-left-CytMddTB.js";import"./src-D89CNeuT.js";import{t as y}from"./chat-markdown-message-ERK48E1Z.js";import{t as b}from"./workflow-store-QV5aMjTt.js";import{t as x}from"./background-task-store-DFS8MP5D.js";import{r as S}from"./acp-run-store-C6n-XeY_.js";import{C,a as w,i as T,n as E,r as D,s as O,y as k}from"./site-favicon-CCyX9r-Z.js";import{t as A}from"./detail-shell-DcNnOqM_.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-DFMOphDJ.js";var N=e(t(),1);function P(e,t,n){let r=m(t,n.workflow),i=e=>{let t=f(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=h(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=d(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=o(),r=b.use.byId(),i=b.use.byToolUseId(),l=b.use.notFoundRunIds(),u=b.use.hydrationFailedRunIds(),d=S.use.byId(),f=S.use.byToolUseId(),p=x.use.byId();return(0,N.useMemo)(()=>{if(!e||t==null)return null;let o=n.find(t=>a(t).includes(e));if(!o)return null;let m=c(o.contentBlocks??[],{splitInlineThinking:o.role!==`user`})[t];if(!m||m.type!==`activity`)return null;let{cardItems:h,toolCalls:g}=s(m.items);return P(h,g,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:l,hydrationFailedRunIds:u},acpById:d,acpByToolUseId:f,backgroundTaskById:p})},[n,e,t,r,i,l,u,d,f,p])}var I=r(),L=60;function R({payload:e,onClose:t}){let[r,a]=(0,N.useState)(null),o=F(e.messageId,e.groupIndex),s=o?.items??e.items,c=o?.toolCalls??e.toolCalls,l=_(s),d=u(l.steps),f=g(l.state,l.steps),m=f===`loading`,h=p(f,l.totalDurationLabel??``,d.failed),y=m&&l.currentStepTitle||h,b=new Map(c.map(e=>[e.id,e])),x=r?r.kind===`thinking`?`Thinking`:r.activity||r.title:``;return(0,I.jsx)(A,{titleNode:r?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(v,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>a(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:x})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:m?(0,I.jsx)(C,{children:y}):y}),l.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:l.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:r?(0,I.jsx)(B,{detail:r}):(0,I.jsx)(O,{steps:l.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:r,onOpenDetail:a,lookupToolCall:e=>b.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:a}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:a,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(T,{iconName:`brain`,label:l(e.text,L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(D,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(E,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(w,{step:e});let o=r(e.toolCallId);return(0,I.jsx)(T,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{o&&n(k(o))}})}function B({detail:e}){let t=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(y,{content:t??e.thinkingText??``,hardLineBreaks:!0}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import{t as i}from"./typography-DEI9Ra9z.js";import{H as a,S as o,c as s,l as c,x as l}from"./risk-CdT92Vqr.js";import{_ as u,a as d,f,g as p,i as m,r as h,v as g,y as _}from"./transcript-message-body-shared-D9_d2c2X.js";import{t as v}from"./chevron-left-CytMddTB.js";import"./src-te3YTBG-.js";import{t as y}from"./chat-markdown-message-rxPKNeTx.js";import{t as b}from"./workflow-store-lM7yKbUo.js";import{t as x}from"./background-task-store-DMP8ByUq.js";import{r as S}from"./acp-run-store-B_eDLRwl.js";import{C,a as w,i as T,n as E,r as D,s as O,y as k}from"./site-favicon-BB1pYWLF.js";import{t as A}from"./detail-shell-Cyqr5FXJ.js";import{ToolDetailBody as j,t as M}from"./tool-detail-panel-DFrWEWKG.js";var N=e(t(),1);function P(e,t,n){let r=m(t,n.workflow),i=e=>{let t=f(e,n.workflow.byToolUseId);if(t!==null&&r.has(t))return!0;let i=h(e,n.acpByToolUseId);if(i!==null&&n.acpById[i]!==void 0)return!0;let a=d(e);return a!==void 0&&n.backgroundTaskById[a]!==void 0},a=t.filter(e=>!i(e));if(a.length===t.length)return{items:e,toolCalls:t};let o=new Set(a.map(e=>e.id));return{items:e.filter(e=>e.kind!==`toolCall`||o.has(e.toolCall.id)),toolCalls:a}}function F(e,t){let n=o(),r=b.use.byId(),i=b.use.byToolUseId(),l=b.use.notFoundRunIds(),u=b.use.hydrationFailedRunIds(),d=S.use.byId(),f=S.use.byToolUseId(),p=x.use.byId();return(0,N.useMemo)(()=>{if(!e||t==null)return null;let o=n.find(t=>a(t).includes(e));if(!o)return null;let m=c(o.contentBlocks??[],{splitInlineThinking:o.role!==`user`})[t];if(!m||m.type!==`activity`)return null;let{cardItems:h,toolCalls:g}=s(m.items);return P(h,g,{workflow:{byId:r,byToolUseId:i,notFoundRunIds:l,hydrationFailedRunIds:u},acpById:d,acpByToolUseId:f,backgroundTaskById:p})},[n,e,t,r,i,l,u,d,f,p])}var I=r(),L=60;function R({payload:e,onClose:t}){let[r,a]=(0,N.useState)(null),o=F(e.messageId,e.groupIndex),s=o?.items??e.items,c=o?.toolCalls??e.toolCalls,l=_(s),d=u(l.steps),f=g(l.state,l.steps),m=f===`loading`,h=p(f,l.totalDurationLabel??``,d.failed),y=m&&l.currentStepTitle||h,b=new Map(c.map(e=>[e.id,e])),x=r?r.kind===`thinking`?`Thinking`:r.activity||r.title:``;return(0,I.jsx)(A,{titleNode:r?(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 py-0.5`,children:[(0,I.jsx)(n,{variant:`ghost`,iconOnly:(0,I.jsx)(v,{}),"aria-label":`Back to all steps`,tooltip:`All steps`,onClick:()=>a(null),className:`-ml-2.5 shrink-0`}),(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:x})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 py-0.5`,children:[(0,I.jsx)(i,{variant:`title-medium`,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:m?(0,I.jsx)(C,{children:y}):y}),l.stepCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`size-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}),(0,I.jsx)(i,{variant:`title-medium`,className:`shrink-0 whitespace-nowrap leading-snug text-[var(--content-secondary)]`,children:l.stepCount})]}):null]}),closeLabel:`Close steps`,onClose:t,children:r?(0,I.jsx)(B,{detail:r}):(0,I.jsx)(O,{steps:l.steps,timeline:!0,renderStep:t=>(0,I.jsx)(z,{step:t,activeDetail:r,onOpenDetail:a,lookupToolCall:e=>b.get(e),messageId:e.messageId,groupIndex:e.groupIndex})})})}function z({step:e,activeDetail:t,onOpenDetail:n,lookupToolCall:r,messageId:i,groupIndex:a}){if(e.kind===`thinking`){let t=i!=null&&e.thinkingItemIndex!=null?{messageId:i,thinkingGroupIndex:a,thinkingItemIndex:e.thinkingItemIndex}:{};return(0,I.jsx)(T,{iconName:`brain`,label:l(e.text,L),ariaLabel:`View thinking`,active:!1,onClick:()=>n({kind:`thinking`,toolCallId:``,toolName:``,title:`Thinking`,activity:``,input:{},status:`completed`,thinkingText:e.text,...t})})}if(e.kind===`web_search`)return(0,I.jsx)(D,{step:e});if(e.kind===`web_search_error`)return(0,I.jsx)(E,{step:e});if(e.kind!==`tool`)return(0,I.jsx)(w,{step:e});let o=r(e.toolCallId);return(0,I.jsx)(T,{iconName:e.iconName,label:e.activity||e.info||e.title,active:t?.toolCallId===e.toolCallId,onClick:()=>{o&&n(k(o))}})}function B({detail:e}){let t=M(e.kind===`thinking`?e.messageId:void 0,e.thinkingGroupIndex,e.thinkingItemIndex);return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.kind===`thinking`?(0,I.jsx)(y,{content:t??e.thinkingText??``,hardLineBreaks:!0}):(0,I.jsx)(j,{detail:e})})}export{R as ActivityStepsPanel};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.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-0Zop_GsZ.js";import{t as o}from"./loader-circle-XREx3i4W.js";import{t as s}from"./input-hw3el2GJ.js";import{t as c}from"./modal-BR4CUFBd.js";import{n as l}from"./toast-LgLp4obE.js";import{Gt as u}from"./react-query.gen-C5c1Acuq.js";import{t as d}from"./use-active-assistant-id-CldxA_-M.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-Dy5001j6.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-HU6H84S0.js";import{t as f}from"./circle-alert-DVCpoZrc.js";import{t as p}from"./loader-circle-XREx3i4W.js";import{t as m}from"./modal-BR4CUFBd.js";import{t as h}from"./dropdown-BCfnSdIZ.js";import{u as g}from"./routes-vE-2hncW.js";import{n as _,r as v}from"./browser-CNL8hh8H.js";import{ft as y,mt as b}from"./react-query.gen-Mwd5l-vZ.js";var x=t({AddCreditsModal:()=>D}),S=e(n(),1),C=u(),w=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function T(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 E(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 D({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[x]=a(),D=x.toString()?`${u}?${x.toString()}`:u,{data:O,isLoading:k}=c(y()),A=O?.allowed_top_up_amounts?.length?O.allowed_top_up_amounts:w,[j,M]=(0,S.useState)(null),N=j&&A.includes(j)?j:A[0]??w[0],P=l(b());return(0,S.useEffect)(()=>v(()=>{t(!1),n.invalidateQueries(y())}),[t,n]),(0,C.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,C.jsxs)(m.Content,{size:`sm`,children:[(0,C.jsxs)(m.Header,{children:[(0,C.jsx)(m.Title,{children:`Add Credits`}),(0,C.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,C.jsx)(m.Body,{children:(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,C.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!O,options:A.map(e=>({value:e,label:T(e)}))})]}),P.isError&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,C.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),E(P.error)]}),(0,C.jsxs)(o,{to:g.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,C.jsx)(d,{className:`size-4`})]}),(0,C.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,C.jsxs)(m.Footer,{children:[(0,C.jsx)(m.Close,{asChild:!0,children:(0,C.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,C.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,C.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:D}},{onSuccess:e=>{_(e.checkout_url)}})},disabled:P.isPending||k||!O,children:`Continue`})]})]})})}export{x as n,D 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-Dy5001j6.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-HU6H84S0.js";import{t as f}from"./circle-alert-DVCpoZrc.js";import{t as p}from"./loader-circle-XREx3i4W.js";import{t as m}from"./modal-BR4CUFBd.js";import{t as h}from"./dropdown-BCfnSdIZ.js";import{u as g}from"./routes-D9sNqB_o.js";import{n as _,r as v}from"./browser-CTZVDjOL.js";import{ft as y,mt as b}from"./react-query.gen-BC3STDmV.js";var x=t({AddCreditsModal:()=>D}),S=e(n(),1),C=u(),w=[`10.00`,`20.00`,`30.00`,`40.00`,`50.00`,`60.00`,`70.00`,`80.00`,`90.00`,`100.00`];function T(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 E(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 D({open:e,onOpenChange:t}){let n=s(),{pathname:u}=i(),[x]=a(),D=x.toString()?`${u}?${x.toString()}`:u,{data:O,isLoading:k}=c(y()),A=O?.allowed_top_up_amounts?.length?O.allowed_top_up_amounts:w,[j,M]=(0,S.useState)(null),N=j&&A.includes(j)?j:A[0]??w[0],P=l(b());return(0,S.useEffect)(()=>v(()=>{t(!1),n.invalidateQueries(y())}),[t,n]),(0,C.jsx)(m.Root,{open:e,onOpenChange:t,children:(0,C.jsxs)(m.Content,{size:`sm`,children:[(0,C.jsxs)(m.Header,{children:[(0,C.jsx)(m.Title,{children:`Add Credits`}),(0,C.jsx)(m.Description,{children:`You'll be redirected to Stripe to complete the payment.`})]}),(0,C.jsx)(m.Body,{children:(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`label`,{htmlFor:`add-credits-amount`,className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Amount`}),(0,C.jsx)(h,{id:`add-credits-amount`,value:N,onChange:e=>{M(e),P.isError&&P.reset()},disabled:k||!O,options:A.map(e=>({value:e,label:T(e)}))})]}),P.isError&&(0,C.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,C.jsx)(f,{className:`h-3.5 w-3.5 shrink-0`}),E(P.error)]}),(0,C.jsxs)(o,{to:g.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,C.jsx)(d,{className:`size-4`})]}),(0,C.jsx)(`div`,{className:`h-px w-full bg-[var(--border-subtle)]`})]})}),(0,C.jsxs)(m.Footer,{children:[(0,C.jsx)(m.Close,{asChild:!0,children:(0,C.jsx)(r,{variant:`outlined`,children:`Cancel`})}),(0,C.jsx)(r,{variant:`primary`,leftIcon:P.isPending?(0,C.jsx)(p,{className:`animate-spin`}):void 0,onClick:()=>{P.isPending||P.mutate({body:{amount:N,return_path:D}},{onSuccess:e=>{_(e.checkout_url)}})},disabled:P.isPending||k||!O,children:`Continue`})]})]})})}export{x as n,D as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r}from"./local-settings-C-dW2vkq.js";import{r as i,t as a}from"./capture-error-Bj8_eutd.js";import{t as o}from"./react-BFJW0bSv.js";import{t as s}from"./button-Dy5001j6.js";import{m as c,u as l}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as u}from"./QueryClientProvider-CMu7CkQU.js";import{t as d}from"./useQuery-Bz-fbQ-m.js";import{t as f}from"./useMutation-CXGTrp4W.js";import{t as p}from"./jsx-runtime-D3ZM-ToX.js";import{t as m}from"./cn-CJf7MmLX.js";import{t as h}from"./typography-DEI9Ra9z.js";import{t as g}from"./createLucideIcon-CAM1RhH8.js";import{t as _}from"./check-sC49_hjU.js";import{t as v}from"./chevron-down-B5A-0g8A.js";import{t as y}from"./circle-alert-DVCpoZrc.js";import{t as b}from"./circle-check-CjGnAahM.js";import{t as x}from"./clock-BYTc0Ds9.js";import{t as S}from"./external-link-CS0aVYGt.js";import{t as C}from"./info-vgPTIsGI.js";import{t as w}from"./list-DNbTcxAh.js";import{t as T}from"./loader-circle-XREx3i4W.js";import{t as E}from"./mail-CMdPNysl.js";import{t as D}from"./search-BVW-n8to.js";import{t as O}from"./trash-2-L5LNgw9o.js";import{t as k}from"./triangle-alert-CQfiAg_t.js";import{t as A}from"./notice-BMK7xqUw.js";import{M as j}from"./src-te3YTBG-.js";import{t as M}from"./tag-NXcyiTkK.js";import{t as N}from"./popover-BRpYVASI.js";import{t as P}from"./input-hw3el2GJ.js";import{t as F}from"./toggle-lfnhEAcN.js";import{t as I}from"./modal-BR4CUFBd.js";import{n as L}from"./toast-LgLp4obE.js";import{t as R}from"./confirm-dialog-UYFm4osC.js";import{t as z}from"./dropdown-BCfnSdIZ.js";import{$ as B,B as V,C as H,F as U,G as W,H as G,I as ee,J as K,K as q,L as te,M as ne,N as J,P as Y,Q as X,R as re,S as ie,T as ae,U as oe,V as se,W as ce,X as le,Y as ue,Z as de,_ as fe,a as pe,at as me,c as he,ct as ge,d as _e,et as ve,f as ye,g as be,h as xe,i as Se,it as Ce,j as we,l as Te,lt as Ee,m as De,n as Oe,nt as ke,o as Ae,ot as je,p as Me,q as Ne,r as Pe,rt as Fe,s as Ie,st as Le,t as Re,tt as ze,u as Be,v as Ve,w as He,x as Ue,y as We,z as Ge}from"./use-sticky-profiles-CdWX0mgI.js";import{Ut as Ke,Wt as qe,ar as Je,ft as Ye,j as Xe,lt as Ze,wn as Qe}from"./sdk.gen-BHZ0fJla.js";import{Bt as $e,Ft as et,H as tt,V as nt,_t as rt,c as it,d as at,f as ot,l as st,m as ct,p as lt,u as ut}from"./react-query.gen-C5c1Acuq.js";import{t as dt}from"./assistant-identity-store-DIyVo8LV.js";import{i as ft,r as pt,t as mt}from"./utils-CnB60ZJN.js";import{r as ht}from"./api-errors-CFiCT7Ap.js";import{u as gt}from"./routes-D9sNqB_o.js";import{i as _t}from"./use-platform-gate-C65D14xY.js";import{r as vt}from"./use-is-org-ready-C5xlYywh.js";import{c as yt,d as bt,f as xt,g as St,h as Ct,l as wt,lt as Tt,m as Et,o as Dt,p as Ot,s as kt,u as At,v as jt,y as Mt}from"./react-query.gen-BC3STDmV.js";import{a as Nt,i as Pt,n as Ft,o as It}from"./voice-list-CW8mzaHU.js";import{t as Lt}from"./platform-login-notice-CdYiKsE8.js";import{t as Rt}from"./use-active-assistant-id-CldxA_-M.js";import{t as zt}from"./detail-card-Du8OuE3q.js";import{t as Bt}from"./use-platform-assistant-id-DOsSt6k1.js";import{t as Vt}from"./environment-store-Bft0lpgv.js";var Ht=g(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Z=e(o(),1),Q=p();function Ut({mode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`max-w-[280px]`,children:(0,Q.jsx)(j,{ariaLabel:`Service mode`,value:e,onChange:t,items:[{value:`managed`,label:`Managed`},{value:`your-own`,label:`Your Own`}]})})}function Wt({id:e,title:t,subtitle:n,mode:r,onModeChange:i,children:a}){return(0,Q.jsxs)(zt,{id:e,title:t,subtitle:n,accessory:(0,Q.jsx)(Ut,{mode:r,onChange:i}),children:[(0,Q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:a})]})}function Gt({id:e,title:t,subtitle:n,children:r}){return(0,Q.jsxs)(zt,{id:e,title:t,subtitle:n,children:[(0,Q.jsx)(`div`,{className:`h-px bg-[var(--surface-active)]`}),(0,Q.jsx)(`div`,{className:`mt-4`,children:r})]})}function Kt(){return(0,Q.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,Q.jsx)(C,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:[`Managed services are metered and deducted from your Vellum account balance.`,` `,(0,Q.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,Q.jsx)(S,{className:`h-3.5 w-3.5`})]})]})]})}function qt({status:e,message:t,isLoading:n}){return n?(0,Q.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,Q.jsx)(T,{className:`h-3 w-3 animate-spin`}),`Checking domain…`]}):e?e===`verified`?(0,Q.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,Q.jsx)(_,{className:`h-3 w-3`}),`Domain verified`]}):e===`pending`||e===`not_started`?(0,Q.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,Q.jsx)(x,{className:`h-3 w-3`}),`Verifying domain…`]}):(0,Q.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,Q.jsx)(y,{className:`h-3 w-3`}),`Verification failed`]}):(0,Q.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 Jt({onClick:e,disabled:t}){return(0,Q.jsx)(s,{onClick:e,disabled:t,children:`Save`})}function Yt({onClick:e,filled:t=!1}){return(0,Q.jsx)(s,{variant:t?`danger`:`dangerGhost`,onClick:e,children:`Reset`})}function Xt({guide:e}){return(0,Q.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,Q.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{children:e.description}),(0,Q.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,Q.jsx)(S,{className:`h-3 w-3`})]})]})]})}var Zt=`__custom__`;function Qt(e){return e?!!(e.profile||e.provider||e.model):!1}function $t(e,t){let n=Qt(e);return n===Qt(t)?n?(e?.profile??null)===(t?.profile??null)&&(e?.provider??null)===(t?.provider??null)&&(e?.model??null)===(t?.model??null):!0:!1}function en({id:e,displayName:t,description:n,defaultProfileLabel:r,draft:i,profileOptions:a,onDraftChange:o,onToggle:s}){let c=Qt(i),l=!i||!c?``:i.provider||i.model?Zt:i.profile??``,u=l===Zt,d=se(),f=d[0]??me[0],p=d.find(e=>e===i?.provider)??f,m=Ee(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:ge(f)??``}):t===``?o(e,null):o(e,{profile:t,provider:null,model:null})}function _(t){let n=ge(t)??``;o(e,{...i??{},profile:null,provider:t,model:n})}function v(t){o(e,{...i??{},model:t})}return(0,Q.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default font-medium text-[var(--content-default)]`,children:t}),n&&(0,Q.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[n,r&&(0,Q.jsxs)(`span`,{className:`ml-1.5 text-body-small-default text-[var(--content-tertiary)] opacity-60`,children:[`· Default: `,r]})]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c&&(0,Q.jsx)(z,{value:l,onChange:g,options:a,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,Q.jsx)(F,{checked:c,onChange:t=>s(e,t),"aria-label":`Override ${t}`})]})]}),c&&u&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2 border-t border-[var(--border-base)] pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{value:p??``,onChange:_,options:d.map(e=>({value:e,label:Le[e]??e}))})]}),(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`label`,{className:`mb-1 block text-body-small-default text-[var(--content-tertiary)]`,children:`Model`}),(0,Q.jsx)(z,{value:i?.model??``,onChange:v,options:m})]})]}),h&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:`Pick a model`})]})]})}function tn({isOpen:e,onClose:t,assistantId:n}){let r=(0,Z.useRef)(!1);return(0,Q.jsx)(I.Root,{open:e,onOpenChange:e=>{!e&&!r.current&&t()},children:e?(0,Q.jsx)(nn,{assistantId:n,onClose:t,onSavingChange:e=>{r.current=e}}):null})}function nn({assistantId:e,onClose:t,onSavingChange:n}){let r=u(),{data:i}=d({...it({path:{assistant_id:e}}),staleTime:3e4}),o=(0,Z.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),c=(0,Z.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),l=(0,Z.useMemo)(()=>i?.llm?.callSites??{},[i?.llm?.callSites]),f=(0,Z.useMemo)(()=>Ne(o,c),[o,c]),p=se(),m=$e({onSuccess:t=>{ut(r,{path:{assistant_id:e}},t)}}),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)({}),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),{data:E,isLoading:O,isError:k,refetch:A}=d({...at({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1}),j=(0,Z.useMemo)(()=>(E?.callSites??[]).filter(e=>e.id!==`mainAgent`),[E]),M=!O&&!k&&!!E&&!!i,N=(0,Z.useMemo)(()=>j.map(e=>e.id),[j]),F=(0,Z.useMemo)(()=>{if(!M)return{};let e={};for(let t of N)if(t in y)e[t]=y[t];else{let n=l[t];e[t]=n?{...n}:{}}return e},[M,N,l,y]),B=(0,Z.useMemo)(()=>new Set(N),[N]),V=(0,Z.useMemo)(()=>Object.entries(l).some(([e,t])=>B.has(e)&&(t?.profile!=null||t?.provider!=null||t?.model!=null)),[l,B]),H=(0,Z.useMemo)(()=>{if(!M)return!1;for(let e of Object.keys(F))if(!$t(F[e],l[e]))return!0;return!1},[M,F,l]),U=(0,Z.useMemo)(()=>Object.values(F).some(e=>Qt(e)&&!!e?.provider&&!e?.model),[F]),W=(0,Z.useMemo)(()=>Se(f,[]).map(e=>({value:e.name,label:Oe(e)})),[f]),G=(0,Z.useCallback)(()=>{if(!_)return;let e={};for(let t of N)e[t]={profile:_};b(e)},[_,N]),ee=(0,Z.useCallback)(e=>[...Se(f,[e]).map(e=>({value:e.name,label:Oe(e)})),{value:Zt,label:`Custom`}],[f]),K=(0,Z.useMemo)(()=>{if(!h.trim())return j;let e=h.toLowerCase();return j.filter(t=>(t.displayName??``).toLowerCase().includes(e)||(t.description??``).toLowerCase().includes(e)||(t.domain??``).toLowerCase().includes(e))},[j,h]),q=(0,Z.useMemo)(()=>{if(!E)return[];let e=E.domains.map(e=>e.id),t=new Map(E.domains.map(e=>[e.id,e])),n=[];for(let r of e){let e=K.filter(e=>e.domain===r);e.length>0&&n.push({domain:t.get(r),sites:e})}let r=new Set(e),i=K.filter(e=>!r.has(e.domain));return i.length>0&&n.push({domain:{id:`other`,displayName:`Other`},sites:i}),n},[E,K]),te=(0,Z.useCallback)((e,t)=>{b(n=>({...n,[e]:t}))},[]),ne=(0,Z.useCallback)((e,t)=>{if(!t){b(t=>({...t,[e]:null}));return}let n=Pe(f,j.find(t=>t.id===e)?.defaultProfile);if(n)b(t=>({...t,[e]:{profile:n}}));else{let t=p[0]??me[0],n=ge(t)??``;b(r=>({...r,[e]:{provider:t,model:n}}))}},[j,f,p]),J=(0,Z.useCallback)(async()=>{S(!0),n?.(!0);try{let n={};for(let e of Object.keys(F)){let t=F[e]??null;n[e]=Qt(t)?{profile:t?.profile??null,provider:t?.provider??null,model:t?.model??null}:null}await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),L.success(`Overrides saved.`)}catch(e){L.error(`Failed to save overrides. Please try again.`),a(e,{context:`call_site_overrides_save`})}finally{S(!1),n?.(!1)}},[F,t,m,n,e]),Y=(0,Z.useCallback)(async()=>{S(!0),n?.(!0);try{let n={};for(let e of Object.keys(F))n[e]=null;await m.mutateAsync({path:{assistant_id:e},body:{llm:{callSites:n}}}),t(),L.success(`Overrides reset.`)}catch(e){L.error(`Failed to reset overrides. Please try again.`),a(e,{context:`call_site_overrides_reset`})}finally{S(!1),n?.(!1)}},[F,t,m,n,e]);return(0,Q.jsxs)(I.Content,{size:`lg`,hideCloseButton:!0,children:[(0,Q.jsxs)(I.Header,{children:[(0,Q.jsx)(I.Title,{children:`Action Overrides`}),(0,Q.jsx)(I.Description,{children:`Customize which model profile specific actions should use. Uses your default profile if no override is set.`})]}),(0,Q.jsxs)(I.Body,{children:[(0,Q.jsx)(`div`,{className:`mb-4`,children:(0,Q.jsx)(P,{type:`search`,value:h,onChange:e=>g(e.target.value),placeholder:`Search actions…`,leftIcon:(0,Q.jsx)(D,{className:`h-4 w-4`}),fullWidth:!0})}),W.length>0&&(0,Q.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] p-3`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-body-medium-default text-[var(--content-default)]`,children:`Use one profile for all actions`}),(0,Q.jsx)(z,{value:_,onChange:v,options:W,placeholder:`Choose profile…`,className:`w-44`,menuMinWidth:280,menuAlign:`end`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:G,disabled:!_||!M||x,children:`Apply to all`})]}),O&&(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(T,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}),k&&(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-12 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Couldn't load actions`}),(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Make sure your assistant is running`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>void A(),children:`Retry`})]}),!O&&!k&&E&&(0,Q.jsx)(`div`,{className:`space-y-4`,children:q.length===0?(0,Q.jsx)(`p`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No actions match your search.`}):q.map(({domain:e,sites:t})=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`mb-2 text-body-small-default font-semibold uppercase tracking-wider text-[var(--content-tertiary)]`,children:e.displayName}),(0,Q.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>{let t=(()=>{let t=F[e.id]??null;return!t||!Qt(t)?``:t.provider||t.model?`__custom__`:t.profile??``})(),n=e.defaultProfile?f.find(t=>t.name===e.defaultProfile)?.label??e.defaultProfile:null;return(0,Q.jsx)(en,{id:e.id,displayName:e.displayName,description:e.description,defaultProfileLabel:n,draft:F[e.id]??null,profileOptions:ee(t===``||t===`__custom__`?null:t),onDraftChange:te,onToggle:ne},e.id)})})]},e.id))})]}),(0,Q.jsxs)(I.Footer,{children:[V&&(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>w(!0),disabled:x||!M,tintColor:`var(--system-negative-strong)`,className:`mr-auto`,children:`Reset to Defaults`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:t,disabled:x,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,onClick:()=>void J(),disabled:!H||U||x,children:x?(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin`}):`Save`})]}),(0,Q.jsx)(R,{open:C,title:`Reset to Defaults`,message:`Every task override will be reset and will follow your active profile. This cannot be undone.`,confirmLabel:`Reset to Defaults`,destructive:!0,onConfirm:()=>{w(!1),Y()},onCancel:()=>w(!1)})]})}function rn({blocked:e,availableReplacements:t,replacement:n,onReplacementChange:r,error:i,saving:a,onClose:o,onConfirm:c}){let l=``;if(e){let t=e.label||e.name;l=e.isActive&&e.callSiteIds.length>0?`"${t}" is the active profile and is used by ${e.callSiteIds.length} call site(s). Pick a replacement profile.`:e.isActive?`"${t}" is the active profile. Pick a different active profile before deleting, or select a replacement below.`:`"${t}" is used by ${e.callSiteIds.length} call site(s). Select a replacement profile to reassign them before deleting.`}return(0,Q.jsx)(I.Root,{open:e!==null,onOpenChange:e=>{e||o()},children:(0,Q.jsxs)(I.Content,{size:`sm`,children:[(0,Q.jsx)(I.Header,{children:(0,Q.jsx)(I.Title,{children:`Can't Delete Profile`})}),(0,Q.jsxs)(I.Body,{className:`space-y-4`,children:[(0,Q.jsx)(h,{variant:`body-medium-default`,as:`p`,children:l}),e&&e.callSiteIds.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-1 pl-1`,children:e.callSiteIds.map(e=>(0,Q.jsxs)(`li`,{className:`text-body-small-default text-(--content-secondary)`,children:[`• `,(0,Q.jsx)(`code`,{children:e})]},e))}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Replacement profile`}),(0,Q.jsx)(z,{"aria-label":`Replacement profile`,value:n,onChange:r,options:[{value:``,label:`Select a replacement…`},...t.map(e=>({value:e.name,label:e.label??e.name}))]})]}),i&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:i})]}),(0,Q.jsxs)(I.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:!n||a,onClick:c,children:a?`Saving…`:`Reassign and Delete`})]})]})})}function an(e,t){if(e){let n=Ee(e).find(e=>e.id===t);if(n)return n.displayName}let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1):t}function on(e,t){let n=[];e.description&&n.push(e.description);let r=e.provider_connection===`vellum`&&t?`vellum`:e.provider,i=[];if(e.model&&i.push(an(r,e.model)),r){let e=Le[r]??r;i.push(`hosted by ${e}`)}return i.length>0&&n.push(i.join(` `)),n.join(` – `)}function sn({profile:e,vellumIsManaged:t,isDragging:n,dropTarget:r,isDeleting:i,deleteError:a,isToggling:o,onDragStart:c,onDragEnd:l,onDragOver:u,onDragLeave:d,onDrop:f,onEditClick:p,onDeleteClick:m,onStatusToggle:g}){let _=e.source===`managed`,v=e.invariant===!0,y=e.status!==`disabled`;return(0,Q.jsxs)(`div`,{className:`relative`,children:[r?.name===e.name&&!r.after&&(0,Q.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg pr-2 py-2${n?` opacity-50`:``}`,draggable:!_,onDragStart:c,onDragEnd:l,onDragOver:u,onDragLeave:d,onDrop:f,children:[(0,Q.jsx)(Ht,{className:`h-4 w-4 shrink-0 ${_?`invisible`:`cursor-grab text-[var(--content-tertiary)]`}`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1${y?``:` opacity-55`}`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(h,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:e.label??e.name}),_&&(0,Q.jsx)(M,{tone:`positive`,title:`Managed by Platform — this profile cannot be disabled, deleted, or renamed.`,children:`Platform`})]}),e.description||e.model||e.provider?(0,Q.jsx)(h,{variant:`body-medium-lighter`,as:`p`,className:`mt-0.5 text-(--content-tertiary)`,children:on(e,t)}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(!v||!y)&&(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center`,title:y?`Active — toggle to hide from pickers`:`Disabled — toggle to show in pickers`,children:(0,Q.jsx)(F,{checked:y,onChange:e=>g(e),disabled:o,"aria-label":`${y?`Disable`:`Enable`} ${e.label??e.name}`})}),(0,Q.jsxs)(`div`,{className:`flex w-[92px] items-center justify-end gap-2`,children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:p,children:_||v?`View`:`Edit`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(O,{}),"aria-label":`Delete ${e.label??e.name}`,disabled:_||v||i,title:_||v?`Managed profiles cannot be deleted`:void 0,onClick:m,tintColor:`var(--system-negative-strong)`})]})]})]}),r?.name===e.name&&r.after&&(0,Q.jsx)(`div`,{className:`mx-0 h-0.5 rounded-full bg-[var(--border-active)]`}),a?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:a}):null]})}function cn({isOpen:e,assistantId:t,onClose:n}){let r=u(),{data:i}=d({...it({path:{assistant_id:t}}),staleTime:3e4}),o=(0,Z.useMemo)(()=>i?.llm?.profiles??{},[i?.llm?.profiles]),s=(0,Z.useMemo)(()=>i?.llm?.profileOrder??[],[i?.llm?.profileOrder]),c=i?.llm?.activeProfile??null,l=i?.llm?.callSites??{},f=(0,Z.useMemo)(()=>Ne(o,s),[o,s]),p=$e({onSuccess:e=>{ut(r,{path:{assistant_id:t}},e)}}),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),{data:v}=d({...nt({path:{assistant_id:t}}),enabled:e}),y=v?.connections,b=y?.some(e=>e.name===`vellum`&&e.provider===`vellum`)??!1,x=Object.keys(o);async function S(e,n,r){let i=r?.mode??`replace`,c=!(e in o);if(i===`merge`&&!c){await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}),h(!1),_(null);return}let l={profiles:{[e]:n}};if(c&&(l.profileOrder=s.includes(e)?s:[...s,e]),c)await p.mutateAsync({path:{assistant_id:t},body:{llm:l}});else{let n=o[e];await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:null}}}});try{await p.mutateAsync({path:{assistant_id:t},body:{llm:l}})}catch(r){throw a(r,{context:`settings-ai-profile-edit-recreate`}),n!=null&&await p.mutateAsync({path:{assistant_id:t},body:{llm:{profiles:{[e]:n}}}}).catch(()=>{}),r}}c&&L.success(`Profile "${n.label??e}" created`),h(!1),_(null)}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(I.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,Q.jsx)(ln,{assistantId:t,vellumIsManaged:b,profiles:o,profileOrder:s,orderedProfiles:f,activeProfile:c,callSiteOverrides:l,onClose:n,onEditClick:e=>{_(e),h(!0)},onNewClick:()=>{_(null),h(!0)}}):null}),(0,Q.jsx)(we,{isOpen:m,mode:g?g.source===`managed`||g.invariant===!0?`view`:`edit`:`create`,profileName:g?.name,initialValues:g??void 0,existingNames:x,connections:y,assistantId:t,onSave:S,onCancel:()=>{h(!1),_(null)}})]})}function ln({assistantId:e,vellumIsManaged:t,profiles:n,profileOrder:r,orderedProfiles:i,activeProfile:o,callSiteOverrides:c,onClose:l,onEditClick:d,onNewClick:f}){let p=u(),m=$e({onSuccess:t=>{ut(p,{path:{assistant_id:e}},t)}}),[g,_]=(0,Z.useState)({}),[v,y]=(0,Z.useState)({}),[b,x]=(0,Z.useState)(new Set),[S,C]=(0,Z.useState)(null),[w,T]=(0,Z.useState)(null),[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(null),A=(0,Z.useRef)(null),j=(0,Z.useRef)(null),[M,N]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(null),[L,R]=(0,Z.useState)(``),[z,B]=(0,Z.useState)(!1),V=(0,Z.useMemo)(()=>i,[i]);async function H(t,r){if(b.has(t.name))return!1;x(e=>new Set(e).add(t.name)),C(null);let i=r?`active`:`disabled`;if(!n[t.name])return x(e=>{let n=new Set(e);return n.delete(t.name),n}),!1;try{return await m.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t.name]:{status:i}}}}}),!0}catch(e){return a(e,{context:`settings-ai-profile-toggle`}),C(`Couldn't update "${t.label??t.name}". Please try again.`),!1}finally{x(e=>{let n=new Set(e);return n.delete(t.name),n})}}async function U(t){y(e=>({...e,[t]:!0})),_(e=>{let n={...e};return delete n[t],n});try{let n=r.filter(e=>e!==t);await m.mutateAsync({path:{assistant_id:e},body:{llm:{profiles:{[t]:null},profileOrder:n}}})}catch(e){a(e,{context:`settings-ai-profile-delete`}),_(e=>({...e,[t]:`Failed to delete profile. Please try again.`}))}finally{y(e=>{let n={...e};return delete n[t],n})}}function W(e){let t=V.find(t=>t.name===e)?.label??e,n=e===o,r=Object.entries(c).filter(([t,n])=>t!==`mainAgent`&&n?.profile===e).map(([e])=>e);if(n||r.length>0){N({name:e,label:t,isActive:n,callSiteIds:r}),R(``),F(null);return}U(e)}async function G(){if(!M||!L)return;B(!0),F(null);let t={};if(M.isActive&&(t.activeProfile=L),M.callSiteIds.length>0){let e={};for(let t of M.callSiteIds)e[t]={profile:L};t.callSites=e}if(Object.keys(t).length>0)try{await m.mutateAsync({path:{assistant_id:e},body:{llm:t}})}catch(e){a(e,{context:`settings-ai-profile-reassign-delete`}),F(`Failed to reassign references. Please try again.`),B(!1);return}let n=M.name;N(null),B(!1),U(n)}async function ee(t,n){if(t===n.name)return;k(null);let i=r.filter(e=>e!==t),o=i.indexOf(n.name);if(o===-1)return;n.after&&(o+=1);let s=[...i.slice(0,o),t,...i.slice(o)];try{await m.mutateAsync({path:{assistant_id:e},body:{llm:{profileOrder:s}}})}catch(e){a(e,{context:`settings-ai-profile-reorder`}),k(`Failed to reorder profiles. Please try again.`)}}let K=V.filter(e=>e.name!==M?.name&&e.source!==`managed`),q=K.length>0?K:V.filter(e=>e.name!==M?.name);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I.Content,{size:`md`,children:[(0,Q.jsxs)(I.Header,{children:[(0,Q.jsx)(I.Title,{children:`Model Profiles`}),(0,Q.jsx)(I.Description,{children:`Bundle a provider and model into a named profile. Assign profiles to specific actions or swap between them when chatting.`})]}),(0,Q.jsxs)(I.Body,{children:[V.length===0?(0,Q.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.`}):(0,Q.jsx)(`div`,{className:`space-y-1`,children:V.map(e=>(0,Q.jsx)(sn,{profile:e,vellumIsManaged:t,isDragging:w===e.name,dropTarget:E,isDeleting:v[e.name]??!1,deleteError:g[e.name],isToggling:b.has(e.name),onDragStart:t=>{A.current=e.name,T(e.name),t.dataTransfer&&(t.dataTransfer.effectAllowed=`move`)},onDragEnd:()=>{A.current=null,j.current=null,T(null),D(null)},onDragOver:t=>{t.preventDefault();let n=t.currentTarget.getBoundingClientRect(),r=t.clientY>n.top+n.height/2,i={name:e.name,after:r};j.current=i,D(i)},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||(j.current=null,D(t=>t?.name===e.name?null:t))},onDrop:e=>{e.preventDefault();let t=A.current,n=j.current;A.current=null,j.current=null,T(null),D(null),t&&n&&ee(t,n)},onEditClick:()=>d(e),onDeleteClick:()=>W(e.name),onStatusToggle:t=>void H(e,t)},e.name))}),O&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:O}),S&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-2 text-(--system-negative-strong)`,children:S})]}),(0,Q.jsxs)(I.Footer,{className:`justify-between`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:f,children:`+ New Profile`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Done`})]})]}),(0,Q.jsx)(rn,{blocked:M,availableReplacements:q,replacement:L,onReplacementChange:R,error:P,saving:z,onClose:()=>{N(null),F(null)},onConfirm:()=>void G()})]})}var un=`0.10.8`;function dn(){return pt(un)}function fn({mode:e,connection:t,assistantId:n,existingNames:r,connections:i,onSave:a,onCancel:o}){let[c,l]=(0,Z.useState)(t?.label??``),d=t?.name??``,f=t?.provider??`anthropic`,p=t?.auth.type??`api_key`,[m,g]=(0,Z.useState)(()=>t?.auth.type===`api_key`?t.auth.credential:t?``:`credential/anthropic/api_key`),[_,v]=(0,Z.useState)(t?.baseUrl??``),[y,b]=(0,Z.useState)(()=>t?.models?t.models.map(e=>e.id).join(`, `):``),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=f===`openai-compatible`,[E,D]=(0,Z.useState)(``),[O,k]=(0,Z.useState)(!1),A=u(),j=(0,Z.useMemo)(()=>oe(m),[m]),M=p===`api_key`&&j!==null,{hasStoredCredential:N,isLoading:F}=V({assistantId:n,credentialKind:`credential`,credentialName:j?`${j.service}:${j.field}`:``,enabled:M}),{credentials:L}=J({assistantId:n,enabled:p===`api_key`});(0,Z.useEffect)(()=>{let e=t?.provider??`anthropic`;l(t?.label??``),t?.auth.type===`api_key`?g(t.auth.credential):g(t?``:`credential/${e}/api_key`),w(null),v(t?.baseUrl??``),b(t?.models?t.models.map(e=>e.id).join(`, `):``),D(``),k(!1)},[t]);let R=c.trim()!==(t?.label??``).trim(),z=T&&R?te(c,i,t?.name):null,B=d.trim().length>0&&z===null;async function H(){if(B){S(!0),w(null);try{let e;if(p===`api_key`){let t=m.trim()||`credential/${f}/api_key`,r=E.trim();if(r){k(!0);try{let e=oe(t);await Je({path:{assistant_id:n},body:e?{type:`credential`,name:`${e.service}:${e.field}`,value:r}:{type:`api_key`,name:f,value:r},throwOnError:!0});let i=Ge(n,`credential`,e?`${e.service}:${e.field}`:``);A.setQueryData(i,!0),A.invalidateQueries({queryKey:rt({path:{assistant_id:n}})})}catch{w(`Failed to save API key. Please try again.`);return}finally{k(!1)}}e={type:`api_key`,credential:t}}else if(t)e=t.auth;else{w(`Nothing to edit. Close and try again.`);return}let r=c.trim()||null,i={auth:e,label:r,...T&&{base_url:_.trim()||null,models:y.trim()?y.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):null}},{data:o,error:s,response:l}=await qe({path:{assistant_id:n,name:t?.name??d.trim()},body:i});if(!l?.ok){w(W(l?.status,s)??G(l?.status));return}if(!o){w(`Server returned an empty response. Please try again.`);return}a(o)}catch{w(`Failed to save provider. Please try again.`)}finally{S(!1)}}}let K=L.filter(e=>e.service===f),q=e!==`create`&&t?.auth.type===`api_key`,X=K.length>0||q,ie=Y(`Enter your API key`,N);return e===`create`?(0,Q.jsx)(ne,{variant:`modal`,assistantId:n,existingNames:r,connections:i,defaultProviderType:f,onCreated:a,onCancel:o}):(0,Q.jsxs)(I.Content,{size:`md`,children:[(0,Q.jsxs)(I.Header,{children:[(0,Q.jsx)(I.Title,{children:`Edit Provider`}),(0,Q.jsx)(I.Description,{children:t?`Editing ${ce(t)}.`:`Edit provider settings.`})]}),(0,Q.jsxs)(I.Body,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[`Display Name`,` `,(0,Q.jsx)(`span`,{className:`text-[var(--content-disabled)]`,children:`(optional)`})]}),(0,Q.jsx)(P,{value:c,onChange:e=>l(e.target.value),placeholder:`e.g. My Anthropic Key`,fullWidth:!0}),z?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:ee[z]}):null]}),T&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Base URL`}),(0,Q.jsx)(P,{value:_,onChange:e=>v(e.target.value),placeholder:`https://api.example.com/v1`,fullWidth:!0})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Models`}),(0,Q.jsx)(P,{value:y,onChange:e=>b(e.target.value),placeholder:`model-1, model-2`,fullWidth:!0}),(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:`Comma-separated model identifiers exposed by your endpoint.`})]})]}),p===`api_key`&&(0,Q.jsx)(U,{apiKeyValue:E,onApiKeyChange:D,credential:m,onCredentialChange:g,isLoadingCredential:F,apiKeyPlaceholder:ie,provider:f,providerCredentials:K,showAdvancedSection:X,onError:w}),p===`oauth_subscription`&&(0,Q.jsx)(re,{assistantId:n,onConnected:a}),C&&(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--system-negative-strong)`,children:C})]}),(0,Q.jsxs)(I.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:o,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,size:`compact`,disabled:!B||x||O,onClick:()=>void H(),children:x?`Saving…`:`Save`})]})]})}var pn={anthropic:!0,openai:!0,gemini:!0,fireworks:!0,openrouter:!0,vellum:!0};function mn(e){return e in pn}function hn(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 gn({isOpen:e,assistantId:t,onClose:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),s=u(),{data:c,isLoading:l,isError:f}=d({...nt({path:{assistant_id:t}}),enabled:e}),p=dn(),{data:m}=d({...ot({path:{assistant_id:t}}),enabled:e&&p}),h=(0,Z.useMemo)(()=>{let e=c?.connections??[];return[...e.filter(e=>e.provider===je),...e.filter(e=>e.provider!==je)]},[c]);function g(){s.invalidateQueries({queryKey:lt({path:{assistant_id:t}})}),s.invalidateQueries({queryKey:st({path:{assistant_id:t}})})}function _(e){s.invalidateQueries({queryKey:tt({path:{assistant_id:t}})}),i(!1),o(null)}let v=h.map(e=>e.name),y=()=>{i(!1),o(null)};return(0,Q.jsx)(I.Root,{open:e,onOpenChange:e=>{e||(r?y():n())},children:e?r?(0,Q.jsx)(fn,{mode:a?`edit`:`create`,connection:a??void 0,assistantId:t,existingNames:v,connections:h,onSave:_,onCancel:y}):(0,Q.jsx)(_n,{connections:h,loading:l,isError:f,assistantId:t,supportsDefaultProvider:p,defaultConnectionName:p?m?.resolvedConnectionName??null:null,onDefaultChanged:g,onClose:n,onEditClick:e=>{o(e),i(!0)},onNewClick:()=>{o(null),i(!0)},onConnectionDeleted:()=>{s.invalidateQueries({queryKey:tt({path:{assistant_id:t}})})}}):null})}function _n({connections:e,loading:t,isError:n,assistantId:r,supportsDefaultProvider:i,defaultConnectionName:o,onDefaultChanged:c,onClose:l,onEditClick:u,onNewClick:d,onConnectionDeleted:p}){let[m,g]=(0,Z.useState)({}),[_,v]=(0,Z.useState)({}),y=f({...ct(),onMutate:e=>{let t=e.body?.connectionName;t&&g(e=>{let n={...e};return delete n[t],n})},onSuccess:c,onError:(e,t)=>{a(e,{context:`settings-ai-set-default-provider`});let n=t.body?.connectionName;n&&g(e=>({...e,[n]:`Failed to set default provider. Please try again.`}))}});function b(e){mn(e.provider)&&y.mutate({path:{assistant_id:r},body:{provider:e.provider,connectionName:e.name}})}async function x(e){v(t=>({...t,[e]:!0})),g(t=>{let n={...t};return delete n[e],n});try{let{response:t}=await Ke({path:{assistant_id:r,name:e}});t?.ok||t?.status===404?p(e):t?.status===409?g(t=>({...t,[e]:`This provider is in use by a profile or as the default provider. Update those settings before deleting it.`})):g(t=>({...t,[e]:`Failed to delete provider. Please try again.`}))}catch{g(t=>({...t,[e]:`Failed to delete provider. Please try again.`}))}finally{v(t=>{let n={...t};return delete n[e],n})}}return(0,Q.jsxs)(I.Content,{size:`md`,children:[(0,Q.jsxs)(I.Header,{children:[(0,Q.jsx)(I.Title,{children:`Providers`}),(0,Q.jsx)(I.Description,{children:`Manage the model providers your assistant can use.`})]}),(0,Q.jsx)(I.Body,{children:t?(0,Q.jsx)(`div`,{className:`space-y-2 py-2`,children:[1,2,3].map(e=>(0,Q.jsx)(`div`,{className:`h-10 animate-pulse rounded-lg bg-[var(--surface-active)]`},e))}):n?(0,Q.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.`}):e.length===0?(0,Q.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.`}):(0,Q.jsx)(`div`,{className:`space-y-1`,children:e.map(e=>{let t=_[e.name]??!1,n=m[e.name],r=e.isManaged??!1,a=e.name===o,c=mn(e.provider),l=y.isPending&&y.variables?.body?.connectionName===e.name;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg px-2 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(h,{variant:`body-medium-default`,as:`span`,className:`text-(--content-default)`,children:ce(e)}),r&&(0,Q.jsx)(M,{tone:`positive`,title:`Managed by Platform — you can rename this provider, but not edit it.`,children:`Platform`}),a&&(0,Q.jsx)(M,{tone:`info`,title:`Built-in profiles (Balanced, Quality, Speed) use this provider.`,children:`Default`}),e.provider===`vellum`?null:e.provider===`openai-compatible`&&(0,Q.jsx)(M,{tone:`neutral`,title:`A provider you created — served by an OpenAI-compatible endpoint.`,children:`Custom`})]}),e.provider===`openai-compatible`?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`text-(--content-tertiary)`,children:hn(e)}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&!a&&(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:!c||l,title:c?`Use this provider for the built-in profiles.`:`Built-in profiles can't run on this provider.`,onClick:()=>b(e),children:`Set as default`}),!r&&(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:()=>u(e),children:`Edit`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(O,{}),"aria-label":`Delete ${ce(e)}`,disabled:r||a||t,title:r?`The Vellum provider cannot be removed`:a?`This is your default provider. Set another provider as default first.`:void 0,onClick:()=>void x(e.name),tintColor:`var(--system-negative-strong)`})]})]}),n?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`px-2 pb-1 text-(--system-negative-strong)`,children:n}):null]},e.name)})})}),(0,Q.jsxs)(I.Footer,{className:`justify-between`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:d,children:`+ Add Provider`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:l,children:`Done`})]})]})}function $(e){let[t,n]=(0,Z.useState)(void 0);return(0,Z.useEffect)(()=>{t!==void 0&&e===t.value&&n(void 0)},[e,t]),[t===void 0?e:t.value,(0,Z.useCallback)(e=>n(e===void 0?void 0:{value:e}),[])]}function vn(){let e=Rt(),t=u(),{data:n}=d({...it({path:{assistant_id:e}}),staleTime:3e4}),r=dn(),{data:i,refetch:o}=d({...ot({path:{assistant_id:e}}),enabled:r}),c=i?.availability,l=n?.llm?.activeProfile??null,f=n?.llm?.advisorProfile??null,p=n?.llm?.callSites??{},{profiles:m,profileOrder:g}=Re(n?.llm,e),_=(0,Z.useMemo)(()=>Ne(m,g),[m,g]),v=$e({onSuccess:n=>{ut(t,{path:{assistant_id:e}},n)}}),[y,b]=$(l),[x,S]=$(f),[C,w]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(!1),j=(0,Z.useMemo)(()=>Se(_,[y]),[_,y]),M=(0,Z.useMemo)(()=>Se(_,[x]),[_,x]),N=Object.entries(p).filter(([e,t])=>e!==`mainAgent`&&(t?.profile!=null||t?.provider!=null||t?.model!=null)).length,P=N===1?`1 Override`:N>0?`${N} Overrides`:`Overrides`,F=y!==l,I=x!==f,R=(0,Z.useCallback)(async()=>{try{let t={};F&&(t.activeProfile=y),I&&(t.advisorProfile=x),await v.mutateAsync({path:{assistant_id:e},body:{llm:t}}),L.success(`Saved.`)}catch(e){L.error(`Failed to save. Please try again.`),a(e,{context:`settings-ai-language-model-save`})}},[F,I,y,x,v,e]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Gt,{title:`Language Model`,subtitle:`Configure the LLMs that power your assistant`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[c&&c.status!==`ok`&&(0,Q.jsx)(A,{tone:c.status===`unknown`?`warning`:`error`,children:c.message??`Your default provider is not available.`}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Default Profile`}),(0,Q.jsx)(z,{value:y??``,onChange:e=>{b(e===``?null:e)},placeholder:`Select a default profile…`,options:j.map(e=>({value:e.name,label:Oe(e)}))}),j.length===0?(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`No profiles yet. Click Profiles below to create one.`}):null]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Advisor Profile`}),(0,Q.jsx)(z,{value:x??``,onChange:e=>{S(e===``?null:e)},placeholder:`Select an advisor profile…`,options:M.map(e=>({value:e.name,label:Oe(e)}))}),(0,Q.jsx)(h,{variant:`body-small-default`,as:`p`,className:`mt-1 text-(--content-tertiary)`,children:`Which model your assistant consults for a second opinion`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>k(!0),children:`Providers`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>w(!0),children:`Profiles`}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:()=>D(!0),children:P})]}),(F||I)&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Jt,{onClick:R,disabled:v.isPending}),v.isPending&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`})]})]})}),e&&(0,Q.jsx)(cn,{isOpen:C,assistantId:e,onClose:()=>w(!1)}),e&&(0,Q.jsx)(tn,{isOpen:E,onClose:()=>D(!1),assistantId:e}),e&&(0,Q.jsx)(gn,{isOpen:O,assistantId:e,onClose:()=>{k(!1),r&&o()}})]})}function yn(){let e=Rt();return(0,Z.useCallback)(async(t,n)=>{try{let{data:r}=await Je({path:{assistant_id:e},body:{value:n,type:`api_key`,name:t},throwOnError:!0});q(r)}catch(e){throw e instanceof Error&&e.message===`No assistant found`?L.error(`Assistant not ready. Please try again.`):L.error(`Failed to save ${t} API key. Please try again.`),a(e,{context:`provision_provider_key`}),e}},[e])}var bn=`0.10.12`;function xn(){return mt(bn)}function Sn(){let e=Rt(),i=u(),o=vt(),{data:s}=d({...it({path:{assistant_id:e}}),enabled:o,staleTime:3e4}),c=$e({onSuccess:t=>{ut(i,{path:{assistant_id:e}},t)}}),l=yn(),f=(0,Z.useMemo)(()=>{if(!s)return r(xe,`inference-provider-native`);let e=s.services?.[`web-search`];return(e?.mode===`managed`&&e?.provider!==`inference-provider-native`?`vellum`:e?.provider)||r(`vellum:ai:webSearchProvider`,`inference-provider-native`)},[s]),[p,m]=(0,Z.useState)(!1),[h,g]=$(f),[_,v]=(0,Z.useState)(``),y=de.has(h),{hasStoredCredential:b}=V({assistantId:e,credentialKind:`api_key`,credentialName:h,enabled:y}),x=_.trim().length>0,S=p||y&&!b&&!x||h===f&&!x,C=Y(ve[h]??`Enter your API key`,b),w=(0,Z.useCallback)(async()=>{m(!0);let t=_.trim(),r=ue(h),o=y&&t.length>0;try{o&&await l(h,t),await ft();let n=h===`vellum`?xn()?{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 L.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(xe,h),o){r&&n(r,t);let a=Ge(e,`api_key`,h);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),v(``)}L.success(`Web search settings saved.`)}catch(e){a(e,{context:`settings-ai-web-search-persist-local`}),L.error(`Saved, but local preferences could not be written.`)}},[y,c,l,i,e,_,h]),E=(0,Z.useCallback)(()=>{let e=ue(h);e&&t(e),v(``),g(`inference-provider-native`),n(xe,`inference-provider-native`)},[h,g]);return(0,Q.jsx)(Gt,{title:`Web Search`,subtitle:`Configure how your assistant should search the web`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{"aria-label":`Web search provider`,value:h,onChange:g,options:B.map(e=>({value:e,label:X[e]??e}))})]}),h===`vellum`&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Search runs through your Vellum account.`}),y&&(0,Q.jsx)(P,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:C,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Jt,{onClick:w,disabled:S}),p&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),y&&(0,Q.jsx)(Yt,{onClick:E,filled:!0})]})]})})}var Cn=`default`;function wn(){let e=Rt(),i=u(),{data:o}=d({...it({path:{assistant_id:e}}),staleTime:3e4}),s=$e({onSuccess:t=>{ut(i,{path:{assistant_id:e}},t)}}),c=yn(),l=(0,Z.useMemo)(()=>o?o.services?.[`web-fetch`]?.provider||r(`vellum:ai:webFetchProvider`,Cn):r(De,Cn),[o]),[f,p]=(0,Z.useState)(!1),[m,h]=$(l),[g,_]=(0,Z.useState)(``),v=ze.has(m),{hasStoredCredential:y}=V({assistantId:e,credentialKind:`api_key`,credentialName:m,enabled:v}),b=g.trim().length>0,x=f||v&&!y&&!b||m===l&&!b,S=Y(Ce[m]??`Enter your API key`,y),C=(0,Z.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 L.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(De,m),r){let r=K(m);r&&n(r,t);let a=Ge(e,`api_key`,m);i.setQueryData(a,!0),i.invalidateQueries({queryKey:a}),_(``)}L.success(`Web fetch settings saved.`)}catch(e){a(e,{context:`settings-ai-web-fetch-persist-local`}),L.error(`Saved, but local preferences could not be written.`)}},[v,s,c,i,e,g,m]),w=(0,Z.useCallback)(()=>{let e=K(m);e&&t(e),_(``),h(Cn),n(De,Cn)},[m,h]);return(0,Q.jsx)(Gt,{id:`web-fetch`,title:`Web Fetch`,subtitle:`Configure how your assistant reads individual web pages`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{value:m,onChange:h,options:Fe.map(e=>({value:e,label:ke[e]??e}))})]}),v&&(0,Q.jsx)(P,{label:`API Key`,type:`password`,value:g,onChange:e=>_(e.target.value),placeholder:S,fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Jt,{onClick:C,disabled:x}),f&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),v&&(0,Q.jsx)(Yt,{onClick:w,filled:!0})]})]})})}function Tn({subdomain:e,onSubdomainChange:t,domainSuffix:n,subdomainPlaceholder:r=`my-assistant`,disabled:i,autoFocus:a,prefix:o,error:s,locked:c,lockedMessage:l}){return(0,Q.jsxs)(`div`,{children:[(0,Q.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,Q.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,Q.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`.`,n]})]}),s&&(0,Q.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--system-negative-strong)]`,children:s}),c&&l&&(0,Q.jsx)(`p`,{className:`mt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:l})]})}function En({assistantId:e,assistantHandle:t,emailRootDomain:n}){let r=u(),i=l(),[o,p]=c(),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(``),[S,C]=(0,Z.useState)(null),[w,D]=(0,Z.useState)(!1),[k,j]=(0,Z.useState)(!1),[M,N]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{g||!t||m||(h(t),_(!0))},[t,g,m]);let P=d({...Tt(),enabled:!0}),F=P.data,I=F?.entitlements,z=I?.managed_email===!0,B=!!I&&!z,V=!F&&P.isError&&!P.isFetching,H=d({...yt({path:{assistant_id:e}}),enabled:!B}),U=d({...Ot({path:{assistant_id:e}}),enabled:!B}),W=H.data?.results?.[0],G=U.data?.results?.[0],ee=W?`${W.subdomain}.${n}`:null,K=d({...Ct({path:{assistant_id:e,id:G?.id??``}}),enabled:!!G?.id,refetchOnWindowFocus:!1}),q=d({...At({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,Z.useEffect)(()=>{o.get(`release`)!==`1`||!W||G||(j(!0),p(e=>{let t=new URLSearchParams(e);return t.delete(`release`),t},{replace:!0}))},[G,W,o,p]);let te=f(Dt()),ne=f(kt()),J=f(bt()),Y=f(xt()),X=(0,Z.useCallback)(()=>{let t={assistant_id:e};r.invalidateQueries({queryKey:wt({path:t})}),r.invalidateQueries({queryKey:Et({path:t})}),G?.id&&r.invalidateQueries({queryKey:St({path:{...t,id:G.id}})}),r.invalidateQueries({queryKey:Mt()})},[G?.id,e,r]),re=(0,Z.useCallback)(async()=>{let t=m.trim().toLowerCase();if(!t){y(`Enter a subdomain.`);return}D(!1);try{await te.mutateAsync({path:{assistant_id:e},body:{subdomain:t}}),h(``),y(null),X(),L.success(`Domain ${t}.${n} registered.`)}catch(e){y(ht(e,void 0,`Failed to register domain.`))}},[e,n,X,te,m]),ie=(0,Z.useCallback)(async()=>{let t=b.trim().toLowerCase();if(!t){C(`Enter an email username.`);return}try{await J.mutateAsync({path:{assistant_id:e},body:{username:t}}),x(``),C(null),X(),L.success(`Email address created.`)}catch(e){C(ht(e,void 0,`Failed to create email address.`))}},[e,X,J,b]),ae=(0,Z.useCallback)(async()=>{if(G?.id){N(!1);try{await Y.mutateAsync({path:{assistant_id:e,id:G.id}}),X(),L.success(`Email address removed.`)}catch(e){a(e,{context:`email_address_delete`}),L.error(`Failed to remove email address.`)}}},[G?.id,e,Y,X]),oe=(0,Z.useCallback)(async()=>{if(!W?.id)return;if(G){L.error(`Remove the email address first.`);return}j(!1);let t=W.subdomain;try{await ne.mutateAsync({path:{assistant_id:e,id:W.id}}),h(t),X(),L.success(`Domain released.`)}catch(e){a(e,{context:`email_domain_release`}),L.error(`Failed to release domain.`)}},[G,e,ne,W?.id,W?.subdomain,X]);if(P.isLoading)return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin`}),`Checking subscription…`]});if(B)return(0,Q.jsx)(A,{tone:`info`,icon:(0,Q.jsx)(E,{className:`h-4 w-4`,"aria-hidden":!0}),title:`Give your assistant its own email address`,actions:(0,Q.jsx)(s,{size:`compact`,onClick:()=>i(gt.plans),children:`Upgrade`}),children:`Upgrade to a plan that includes an email address for your assistant. No provider setup required.`});let se=V?(0,Q.jsx)(A,{tone:`warning`,title:`Couldn't verify subscription status`,actions:(0,Q.jsx)(s,{size:`compact`,variant:`outlined`,onClick:()=>P.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,Q.jsxs)(`div`,{className:`space-y-4`,children:[se,(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Address`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:G.address}),(0,Q.jsx)(qt,{status:q.data?.status,message:q.data?.message,isLoading:q.isLoading}),(0,Q.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(O,{}),onClick:()=>N(!0),disabled:Y.isPending,"aria-label":`Remove email address`})]}),(0,Q.jsx)(R,{open:M,title:`Remove Email Address`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to remove `,(0,Q.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:ae,onCancel:()=>N(!1)})]}),K.data?.usage&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[K.data.usage.sent_today,` /`,` `,K.data.usage.daily_limit,` sent today ·`,` `,K.data.usage.received_today,` received`]})]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[se,(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Domain`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`font-mono text-body-small-default text-[var(--content-default)]`,children:[W.subdomain,`.`,n]}),(0,Q.jsx)(qt,{status:q.data?.status,message:q.data?.message,isLoading:q.isLoading}),(0,Q.jsx)(s,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(O,{}),onClick:()=>j(!0),disabled:ne.isPending,"aria-label":`Release domain`})]}),(0,Q.jsx)(R,{open:k,title:`Release Domain`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to release `,(0,Q.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:oe,onCancel:()=>j(!1)})]}),(0,Q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Email address`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.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 ${S?`border-[var(--system-negative-strong)]`:`border-[var(--field-border)] focus-within:border-[var(--border-active)]`}`,children:[(0,Q.jsx)(`input`,{value:b,onChange:e=>{x(e.target.value.toLowerCase()),S&&C(null)},placeholder:`hi`,"aria-label":`Email username`,"aria-invalid":!!S,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,Q.jsxs)(`span`,{className:`shrink-0 pr-3 font-mono text-[var(--content-secondary)]`,children:[`@`,ee]})]}),(0,Q.jsx)(s,{onClick:ie,disabled:J.isPending||!b.trim(),children:J.isPending?`Creating…`:`Create`})]}),S&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:S})]})]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[se,(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Subdomain`}),(0,Q.jsx)(Tn,{subdomain:m,onSubdomainChange:e=>{h(e),v&&y(null)},domainSuffix:n,subdomainPlaceholder:`my-assistant`,error:v}),(0,Q.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,Q.jsx)(s,{onClick:()=>D(!0),disabled:te.isPending||!m.trim(),children:te.isPending?`Registering…`:`Register`}),(0,Q.jsx)(R,{open:w,title:`Set Subdomain`,message:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 font-mono text-[0.9em]`,children:m.trim().toLowerCase()||`subdomain`}),` will also become your assistant's public handle. You won't be able to change it once set.`]}),confirmLabel:`Confirm`,onConfirm:re,onCancel:()=>D(!1)})]})}function Dn(){let e=Rt(),t=vt(),{data:o}=d({...jt(),enabled:t}),s=o?.results?.[0]?.handle,c=Vt.use.emailRootDomain(),l=_t(),[u,f]=(0,Z.useState)(()=>l===`gated`?`your-own`:le(r(Ae,`managed`),`managed`)),[p,m]=(0,Z.useState)(()=>{let e=r(pe,`resend`);return e===`mailgun`||e===`resend`?e:`resend`}),{platformAssistantId:h,error:g}=Bt(e,l===`full`&&u===`managed`),_=h??(g?e:null),v=d({queryKey:[`byoEmailCredential`,e,p],queryFn:async()=>{let{data:t}=await Ze({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,Z.useEffect)(()=>{v.error&&a(v.error,{context:`byo_email_credential_check`,bestEffort:!0})},[v.error]);let y=v.data?.hasSecret===!0,x=(0,Z.useCallback)(e=>{f(e),n(Ae,e)},[]),w=(0,Z.useCallback)(()=>{n(pe,p),L.success(`Email settings saved.`)},[p]),E=(0,Z.useMemo)(()=>be.find(e=>e.id===p)??be[0],[p]),D=(0,Q.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,Q.jsx)(C,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`span`,{children:[`Configure `,E.displayName,` via the assistant CLI: ask the assistant to run the`,` `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:E.setupSkill}),` `,`skill. It walks you through storing the API key, detecting the domain, and (optionally) wiring up an inbound webhook.`]}),(0,Q.jsxs)(`a`,{href:E.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[`Open `,E.displayName,(0,Q.jsx)(S,{className:`h-3 w-3`})]})]})]}),O=(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{value:p,onChange:e=>{(e===`mailgun`||e===`resend`)&&m(e)},options:be.map(e=>({value:e.id,label:e.displayName}))})]}),y?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.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,Q.jsx)(b,{className:`h-4 w-4 shrink-0 text-[var(--system-positive-strong)]`}),(0,Q.jsxs)(`span`,{children:[E.displayName,` API key configured. To reconfigure, run the`,` `,(0,Q.jsx)(`code`,{className:`rounded bg-[var(--surface-active)] px-1 py-0.5 text-[12px]`,children:E.setupSkill}),` `,`skill.`]})]}),(0,Q.jsxs)(`a`,{href:E.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 `,E.displayName,(0,Q.jsx)(S,{className:`h-3 w-3`})]})]}):D,(0,Q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Q.jsx)(Jt,{onClick:w,disabled:!1})})]});return l===`gated`?(0,Q.jsx)(Gt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,children:O}):(0,Q.jsx)(Wt,{id:`email`,title:`Email`,subtitle:`Configure how your assistant sends and receives email`,mode:u,onModeChange:x,children:u===`managed`?(0,Q.jsx)(`div`,{className:`space-y-4`,children:l===`disabled`?(0,Q.jsx)(Lt,{children:`Log in to the Vellum platform to manage email settings.`}):_===null?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin`}),`Connecting to the Vellum platform…`]}):(0,Q.jsx)(En,{assistantId:_,assistantHandle:s,emailRootDomain:c})}):O})}var On=`0.11.0`;function kn(){return mt(On)}var An=`gemini-3.1-flash-image-preview`;function jn(){let e=Rt(),t=u(),i=vt(),{data:o}=d({...it({path:{assistant_id:e}}),enabled:i,staleTime:3e4}),s=$e({onSuccess:n=>{ut(t,{path:{assistant_id:e}},n)}}),c=yn(),[l,f]=$((0,Z.useMemo)(()=>{if(!o)return r(he,`gemini`);let e=o.services?.[`image-generation`];return e?.mode===`managed`?`vellum`:e?.provider||r(`vellum:ai:imageGenProvider`,`gemini`)},[o])),[p,m]=(0,Z.useState)(()=>r(Ie,An)),h=H(l),g=h.includes(p)?p:h[0]??An,[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(!1),x=Ve.map(e=>({value:e,label:We[e]??e})),S=(0,Z.useMemo)(()=>H(l).map(e=>({value:e,label:fe[e]??e})),[l]),C=l===`gemini`||l===`openai`,{hasStoredCredential:w}=V({assistantId:e,credentialKind:`api_key`,credentialName:l,enabled:C}),E=f,D=(0,Z.useCallback)(async()=>{b(!0);let r=_.trim(),i=C&&r.length>0;try{i&&await c(He(g),r),await ft();let n=l===`vellum`&&!kn()?{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 L.error(`Failed to update assistant configuration. Please try again.`),a(e,{context:`patch_daemon_config`}),e});try{await Qe({path:{assistant_id:e},body:{modelId:g},throwOnError:!0})}catch(e){throw L.error(`Failed to update image generation model. Please try again.`),a(e,{context:`set_image_gen_model`}),e}finally{t.invalidateQueries({queryKey:st({path:{assistant_id:e}})})}}catch{b(!1);return}b(!1);try{if(n(he,l),n(Ie,g),i){let n=Ge(e,`api_key`,l);t.setQueryData(n,!0),t.invalidateQueries({queryKey:n}),v(``)}L.success(`Image generation settings saved.`)}catch(e){a(e,{context:`settings-ai-image-gen-persist-local`}),L.error(`Saved, but local preferences could not be written.`)}},[_,l,C,g,e,s,c,t]),O=(0,Z.useCallback)(()=>{v(``),m(An),n(Ie,An)},[]);return(0,Q.jsx)(Gt,{title:`Image Generation`,subtitle:`Configure which model your assistant uses to generate images`,children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{"aria-label":`Image generation provider`,value:l,onChange:E,options:x})]}),l===`vellum`&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Image generation runs through your Vellum account.`}),C&&(0,Q.jsx)(P,{label:`API Key`,type:`password`,value:_,onChange:e=>v(e.target.value),placeholder:Y(l===`openai`?`Enter your OpenAI API key`:`Enter your Gemini API key`,w),fullWidth:!0}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Active Model`}),(0,Q.jsx)(z,{"aria-label":`Image generation model`,value:g,onChange:m,options:S})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Jt,{onClick:D,disabled:y}),y&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-[var(--content-disabled)]`}),C&&(0,Q.jsx)(Yt,{onClick:O})]})]})})}async function Mn(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 Nn(n,r,i):t===`deepgram`?await Pn(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 Nn(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 Fn(i,`ElevenLabs rejected the request.`)}}async function Pn(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 Fn(n,`Deepgram rejected the request.`)}}async function Fn(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 In({assistantId:e,value:t,onChange:n,className:r}){let[i,a]=(0,Z.useState)(!1),{voices:o}=Nt(e);if(o.length===0)return null;let s=o.find(e=>e.model===t)??o[0];return(0,Q.jsxs)(N.Root,{open:i,onOpenChange:a,children:[(0,Q.jsx)(N.Trigger,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":`Voice`,className:m(`flex h-9 w-full items-center gap-2 rounded-md border border-[var(--field-border)] bg-[var(--field-bg)] px-3 text-left text-body-medium-lighter text-[var(--content-default)] transition-colors focus:outline-none data-[state=open]:border-[var(--border-active)]`,r),children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:s?Pt(s.description):`Select a voice`}),(0,Q.jsx)(v,{className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0})]})}),(0,Q.jsx)(N.Content,{side:`bottom`,align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,children:(0,Q.jsx)(Ft,{assistantId:e,value:t,onChange:n,onSelect:()=>a(!1),showSource:!0})})]})}var Ln={elevenlabs:`voiceId`,"fish-audio":`referenceId`,xai:`voiceId`};function Rn({assistantId:e,hideSaveButton:t=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=Rt(),c=e??o,l=dt.use.name()??`your assistant`,f=vt(),p=u(),{data:m}=d({...et({path:{assistant_id:c}}),enabled:f,staleTime:1/0}),h=(0,Z.useMemo)(()=>{let e=m?.providers;if(!e)return ie;if(e.some(e=>e.id===`vellum`))return e;let t=ie.find(e=>e.id===`vellum`);return t?[t,...e]:e},[m]),{data:g}=d({...it({path:{assistant_id:c}}),enabled:f,staleTime:3e4}),_=g?.services?.tts,v=_?.mode===`managed`?`vellum`:_?.provider,y=`elevenlabs`,b=(0,Z.useMemo)(()=>v??r(`vellum:voice:ttsProvider`,y),[v,y]),x=!!v,[S,C]=$(b),[T,E]=(0,Z.useState)(``),[D,O]=(0,Z.useState)(``),[k,A]=(0,Z.useState)(``),[j,M]=(0,Z.useState)(!1),[N,F]=(0,Z.useState)(!1),[I,R]=(0,Z.useState)(!1),{voices:B,defaultModel:V,fetched:H}=It(c,{enabled:S===`vellum`}),U=_?.providers?.vellum?.model??V??``,[W,G]=$(U),ee=B.find(e=>e.model===W)??B[0],[K,q]=(0,Z.useState)(null),te=B.some(e=>e.model===U),ne=K??(H&&U!==``&&!te),J=(0,Z.useMemo)(()=>h.find(e=>e.id===S)??h[0],[S,h]),Y=S===`vellum`&&J.supportsVoiceSelection&&W.trim()!==``&&W.trim()!==U,X=(0,Z.useCallback)(e=>{let t=r(_e+e,``),n=r(Me+e,``);M(t.length>0),O(n),A(n),E(``)},[]);(0,Z.useEffect)(()=>{X(S)},[S,X]);let re=(0,Z.useMemo)(()=>{let e=S!==b,t=T.trim().length>0,n=D.trim()!==k;return e||t||n||Y},[S,b,T,D,k,Y]),ae=(0,Z.useCallback)(async()=>{let e=T.trim(),t=D.trim(),i=J.id;n(ye,i),e.length>0&&n(_e+i,e),n(Me+i,t);let a=e.length>0?e:r(_e+i,``),o=Ln[i];R(!0);try{if(a.length>0){let{response:e}=await Ye({path:{assistant_id:c},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]:t}}}:{},...Y?{providers:{vellum:{model:W.trim()}}}:{}};if(Object.keys(e).length>0){let{response:t}=await Xe({path:{assistant_id:c},body:{services:{tts:e}},throwOnError:!1});if(!t?.ok)throw Error(`Failed to save configuration (HTTP ${t?.status??`?`})`)}return M(a.length>0),A(t),E(``),p.invalidateQueries({queryKey:st({path:{assistant_id:c}})}),L.success(`Text-to-speech settings saved`),!0}catch(e){return L.error(e instanceof Error?e.message:`Failed to save text-to-speech settings`),!1}finally{R(!1)}},[c,S,W,Y,T,D,J,b,x,p]);(0,Z.useEffect)(()=>{a?.({hasChanges:re,saving:I,save:ae})},[a,re,I,ae]);let oe=(0,Z.useCallback)(()=>{n(_e+S,``),M(!1),E(``)},[S]),se=(0,Z.useCallback)(async()=>{F(!0);try{let e=r(_e+S,``),t=T.trim(),n=t.length>0?t:e;if(n.length===0){L.error(`Save an API key for this provider before testing.`);return}let i=r(Me+S,``),a=D.trim(),o=await Mn({provider:S,apiKey:n,voiceId:a.length>0?a:i,text:`Hey! It's ${l}. How does this sound?`});if(o.kind!==`audio`){L.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{F(!1)}},[l,T,S,D]),ce=j?`•••••••• (Enter a new key to replace)`:J.apiKeyPlaceholder,le=S===`vellum`,ue=le&&J.supportsVoiceSelection,de=(0,Q.jsxs)(s,{variant:`link`,size:`compact`,className:`inline-flex h-auto items-center gap-1 px-0 underline [--vbtn-fg:var(--content-tertiary)]`,onClick:()=>{q(!1),B.some(e=>e.model===W)||G(V||B[0]?.model||``)},children:[(0,Q.jsx)(w,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Choose from catalog`]}),fe=ue&&ne&&B.length>0?de:null;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{value:S,onChange:C,options:h.map(e=>({value:e.id,label:e.displayName})),"aria-label":`TTS provider`})]}),!le&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Q.jsx)(P,{type:`password`,value:T,onChange:e=>E(e.target.value),placeholder:ce,fullWidth:!0})]}),ue&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice`}),ne?(0,Q.jsx)(P,{type:`text`,value:W,onChange:e=>G(e.target.value),placeholder:`Enter a voice ID`,"aria-label":`Custom voice ID`,fullWidth:!0}):ee?(0,Q.jsx)(In,{assistantId:c,value:W,onChange:G}):H&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`No managed voices are currently available.`})]}),J.supportsVoiceSelection&&!le&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Voice ID`}),(0,Q.jsx)(P,{type:`text`,value:D,onChange:e=>O(e.target.value),placeholder:`Enter a voice ID`,fullWidth:!0})]}),!i&&!le&&(0,Q.jsx)(Xt,{guide:J.credentialsGuide}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!le&&(0,Q.jsx)(s,{variant:`outlined`,onClick:se,disabled:N,children:N?`Testing…`:`Test`}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[fe,!t&&(0,Q.jsx)(Jt,{onClick:ae,disabled:!re||I}),j&&!le&&(0,Q.jsx)(Yt,{onClick:oe})]})]})]})}function zn(){return(0,Q.jsx)(Gt,{id:`text-to-speech`,title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,Q.jsx)(Rn,{})})}var Bn={vellum:{provider:`vellum`},deepgram:{provider:`deepgram`,credentialService:`deepgram`},openai:{provider:`openai-whisper`,credentialService:`openai`}},Vn={vellum:`vellum`,deepgram:`deepgram`,"openai-whisper":`openai`},Hn=`deepgram`;function Un({assistantId:e,hideSaveButton:t=!1,hideCredentialsGuide:i=!1,onSaveStateChange:a}={}){let o=Rt(),s=e??o,c=vt(),l=u(),[f]=(0,Z.useState)(()=>Ue.filter(e=>!e.requiresNativeDictation||ae())),p=Hn,{data:m}=d({...it({path:{assistant_id:s}}),enabled:c,staleTime:3e4}),h=m?.services?.stt,g=h?.mode===`managed`?`vellum`:h?.provider,_=(0,Z.useMemo)(()=>{let e=g?Vn[g]:void 0;if(e&&f.some(t=>t.id===e))return e;let t=r(Be,p);return f.some(e=>e.id===t)?t:p},[g,f,p]),v=!!g,[y,b]=$(_),[x,S]=(0,Z.useState)(``),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let e=r(Be,p);e===`macos-native`&&!f.some(t=>t.id===e)&&n(Be,p)},[f,p]);let D=(0,Z.useMemo)(()=>f.find(e=>e.id===y)??f[0],[f,y]),O=D.apiKeyPlaceholder!==void 0;(0,Z.useEffect)(()=>{w(r(Te+y,``).length>0),S(``)},[y]);let A=(0,Z.useMemo)(()=>{let e=y!==_,t=x.trim().length>0;return e||t},[y,_,x]),j=(0,Z.useCallback)(async()=>{let e=x.trim();n(Be,y),e.length>0&&n(Te+y,e);let t=Bn[y];E(!0);try{if(t?.credentialService){let n=e.length>0?e:r(Te+y,``);if(n.length>0){let{response:e}=await Ye({path:{assistant_id:s},body:{service:t.credentialService,field:`api_key`,value:n,label:`${D.displayName} API Key`},throwOnError:!1});if(!e?.ok)throw Error(`Failed to store API key (HTTP ${e?.status??`?`})`)}}if(t&&(y!==_||!v)||g===`vellum`&&y!==`vellum`){let e=t?.provider??Hn,{response:n}=await Xe({path:{assistant_id:s},body:{services:{stt:{provider:e,mode:e===`vellum`?`managed`:`your-own`}}},throwOnError:!1});if(!n?.ok)throw Error(`Failed to save configuration (HTTP ${n?.status??`?`})`)}return e.length>0&&w(!0),S(``),l.invalidateQueries({queryKey:st({path:{assistant_id:s}})}),L.success(`Speech-to-text settings saved`),!0}catch(e){return L.error(e instanceof Error?e.message:`Failed to save speech-to-text settings`),!1}finally{E(!1)}},[s,y,x,D,_,v,g,l]);(0,Z.useEffect)(()=>{a?.({hasChanges:A,saving:T,save:j})},[a,A,T,j]);let M=(0,Z.useCallback)(()=>{n(Te+y,``),w(!1),S(``)},[y]),N=C?`•••••••• (Enter a new key to replace)`:D.apiKeyPlaceholder;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Provider`}),(0,Q.jsx)(z,{value:y,onChange:b,options:f.map(e=>({value:e.id,label:e.displayName})),"aria-label":`STT provider`})]}),O&&(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`API Key`}),(0,Q.jsx)(P,{type:`password`,value:x,onChange:e=>S(e.target.value),placeholder:N,fullWidth:!0})]}),D.setupWarning&&(0,Q.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,Q.jsx)(k,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-mid-strong)]`}),(0,Q.jsx)(`span`,{children:D.setupWarning})]}),!i&&D.credentialsGuide&&(0,Q.jsx)(Xt,{guide:D.credentialsGuide}),y===`vellum`&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Transcription runs through your Vellum account.`}),(!t||C)&&(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[!t&&(0,Q.jsx)(Jt,{onClick:j,disabled:!A||T}),C&&(0,Q.jsx)(Yt,{onClick:M})]})]})}function Wn(){return(0,Q.jsx)(Gt,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,Q.jsx)(Un,{})})}function Gn(){return(0,Z.useEffect)(()=>{let e=window.location.hash.slice(1);e&&requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:`start`})})},[]),(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsx)(Kt,{}),(0,Q.jsx)(vn,{}),(0,Q.jsx)(Sn,{}),(0,Q.jsx)(wn,{}),(0,Q.jsx)(Dn,{}),(0,Q.jsx)(jn,{}),(0,Q.jsx)(zn,{}),(0,Q.jsx)(Wn,{})]})}export{Gn as AiPage};
@@ -0,0 +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-Dl-ckXRE.js";import{t as a}from"./use-reduced-motion-W1fCe3vS.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`},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};
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-jRWAZmH_.js";import{B as t,G as n,H as r,I as ee,J as i,K as a,L as te,Q as ne,R as o,U as s,V as c,W as l,X as u,Y as d,Z as re,q as f,z as ie}from"./local-mode-BTovbt13.js";function p(e){return ne(te,e)}function ae(e){return re(ee,e)}var oe=o([`end_turn`,`max_tokens`,`max_turn_requests`,`refusal`,`cancelled`]),se=n({type:s(`acp_session_completed`),acpSessionId:i(),stopReason:oe}).strict(),ce=n({type:s(`acp_session_error`),acpSessionId:i(),error:i()}).strict(),le=n({type:s(`acp_session_spawned`),acpSessionId:i(),agent:i(),parentConversationId:i(),parentToolUseId:i().optional(),task:i().optional()}).strict(),ue=o([`agent_message_chunk`,`agent_thought_chunk`,`user_message_chunk`,`tool_call`,`tool_call_update`,`plan`]),de=n({type:s(`acp_session_update`),acpSessionId:i(),updateType:ue,content:i().optional(),toolCallId:i().optional(),toolTitle:i().optional(),toolKind:i().optional(),toolStatus:i().optional(),rawInput:u().optional(),rawOutput:u().optional(),locations:t(n({path:i(),line:l().optional()})).optional(),messageId:i().optional(),seq:l().optional()}).strict(),fe=n({type:s(`acp_session_usage`),acpSessionId:i(),usedTokens:l(),contextSize:l(),inputTokens:l().optional(),outputTokens:l().optional(),costAmount:l().optional(),costCurrency:i().optional()}).strict(),pe=n({type:s(`app_files_changed`),appId:i()}),me=o([`idle`,`thinking`,`streaming`,`tool_running`,`awaiting_confirmation`]),he=o([`assistant_turn`,`user_turn`,`global`]),ge=o([`message_dequeued`,`thinking_delta`,`first_text_delta`,`tool_use_start`,`preview_start`,`tool_result_received`,`confirmation_requested`,`confirmation_resolved`,`context_compacting`,`message_complete`,`generation_cancelled`,`error_terminal`]),_e=n({type:s(`assistant_activity_state`),conversationId:i(),activityVersion:l(),phase:me,anchor:he,reason:ge,requestId:i().optional(),statusText:i().optional()}),ve=n({type:s(`assistant_status`),version:i().optional(),keyFingerprint:i().optional()}),ye=n({type:s(`assistant_text_delta`),text:i(),messageId:i().optional(),conversationId:i().optional()}),be=n({type:s(`assistant_thinking_delta`),thinking:i(),messageId:i().optional(),conversationId:i().optional(),timestampMs:l().optional()}),xe=n({type:s(`assistant_turn_start`),messageId:i(),conversationId:i().optional()}),Se=n({type:s(`avatar_updated`),avatarPath:i()}),Ce=n({type:s(`background_tool_completed`),id:i(),conversationId:i(),status:o([`completed`,`failed`,`cancelled`]),exitCode:l().nullable().optional(),output:i().optional(),completedAt:l()}),we=n({type:s(`background_tool_started`),id:i(),toolName:i(),conversationId:i(),command:i(),startedAt:l()}),Te=n({id:i(),messageId:i(),conversationId:i(),conversationTitle:i().nullable(),messagePreview:i(),messageRole:i(),messageCreatedAt:l(),createdAt:l()}),Ee=n({type:s(`bookmark.created`),bookmark:Te}),De=n({type:s(`bookmark.deleted`),messageId:i()}),Oe=n({type:s(`client_settings_update`),key:i(),value:i()}),ke=n({type:s(`compaction_circuit_closed`),conversationId:i()}),Ae=n({type:s(`compaction_circuit_open`),conversationId:i(),reason:s(`3_consecutive_failures`),openUntil:l()}),je=n({type:s(`config_changed`)}),m=n({label:i(),description:i(),pattern:i()}),h=n({label:i(),scope:i()}),g=n({label:i(),scope:i()}),_=n({filePath:i(),oldContent:i(),newContent:i(),isNewFile:c()}),Me=o([`allow_once`,`allow_always`,`reject_once`,`reject_always`]),Ne=n({optionId:i(),name:i(),kind:Me}),Pe=o([`sandbox`,`host`]),v=n({type:s(`confirmation_request`),requestId:i(),toolName:i(),input:f(i(),u()),riskLevel:i(),riskReason:i().optional(),isContainerized:c().optional(),executionTarget:Pe.optional(),allowlistOptions:t(m),scopeOptions:t(h),directoryScopeOptions:t(g).optional(),diff:_.optional(),conversationId:i().optional(),persistentDecisionsAllowed:c().optional(),toolUseId:i().optional(),acpToolKind:i().optional(),acpOptions:t(Ne).optional()}),y=n({type:s(`confirmation_state_changed`),conversationId:i(),requestId:i(),state:o([`pending`,`approved`,`denied`,`timed_out`,`resolved_stale`]),source:o([`button`,`inline_nl`,`auto_deny`,`timeout`,`system`]),causedByRequestId:i().optional(),decisionText:i().optional(),toolUseId:i().optional()}),Fe=n({type:s(`contact_request`),requestId:i(),channel:i().optional(),placeholder:i().optional(),label:i().optional(),description:i().optional(),role:i().optional()}),Ie=n({type:s(`contacts_changed`)}),Le=n({type:s(`context_compacted`),conversationId:i(),previousEstimatedInputTokens:l(),estimatedInputTokens:l(),maxInputTokens:l(),thresholdTokens:l(),compactedMessages:l(),summaryCalls:l(),summaryInputTokens:l(),summaryOutputTokens:l(),summaryModel:i(),summaryCharCount:l().optional(),summaryHeaderCount:l().optional(),summaryHadMemoryEcho:c().optional()}),b=o([`PROVIDER_NETWORK`,`PROVIDER_RATE_LIMIT`,`MANAGED_USAGE_LIMIT`,`PROVIDER_OVERLOADED`,`PROVIDER_API`,`IMAGE_TOO_LARGE`,`PROVIDER_BILLING`,`PROVIDER_ORDERING`,`PROVIDER_WEB_SEARCH`,`PROVIDER_NOT_CONFIGURED`,`PROVIDER_INVALID_KEY`,`MANAGED_KEY_INVALID`,`CONTEXT_TOO_LARGE`,`BUDGET_YIELD_UNRECOVERED`,`MAX_TOKENS_REACHED`,`CONVERSATION_ABORTED`,`CONVERSATION_PROCESSING_FAILED`,`DISK_SPACE_CRITICAL`,`UNKNOWN`]),Re=n({type:s(`conversation_error`),conversationId:i(),code:b,userMessage:i(),retryable:c(),debugDetails:i().optional(),errorCategory:i().optional(),connectionName:i().optional(),profileName:i().optional()}),ze=n({type:s(`conversation_inference_profile_updated`),conversationId:i(),profile:i().nullable(),sessionId:i().nullable().optional(),expiresAt:l().nullable().optional()}),Be=o([`created`,`renamed`,`deleted`,`reordered`,`seen_changed`]),Ve=n({type:s(`conversation_list_invalidated`),reason:Be}),He=o([`memory_v3`]),Ue=n({type:s(`conversation_notice`),conversationId:i(),source:He,code:b,userMessage:i(),errorCategory:i().optional()}),We=n({type:s(`conversation_title_updated`),conversationId:i(),title:i()}),Ge=o([`disabled`,`ok`,`warning`,`critical`,`unknown`]),Ke=o([`agent-turns`,`background-work`,`remote-ingress`]),x=n({enabled:c(),state:Ge,locked:c(),acknowledged:c(),overrideActive:c(),effectivelyLocked:c(),lockId:i().nullable(),usagePercent:l().nullable(),thresholdPercent:l(),path:i().nullable(),lastCheckedAt:i().nullable(),blockedCapabilities:t(Ke),error:i().nullable()}),qe=n({type:s(`disk_pressure_status_changed`),status:x}),Je=n({id:i(),surfaceId:i(),author:i(),content:i(),anchorStart:l().optional(),anchorEnd:l().optional(),anchorText:i().optional(),parentCommentId:i().optional(),status:i(),createdAt:l(),updatedAt:l()}),Ye=n({type:s(`document_comment_created`),conversationId:i(),surfaceId:i(),comment:Je}),Xe=n({type:s(`document_comment_deleted`),conversationId:i(),surfaceId:i(),commentId:i()}),Ze=n({type:s(`document_comment_reopened`),conversationId:i(),surfaceId:i(),commentId:i()}),Qe=n({type:s(`document_comment_resolved`),conversationId:i(),surfaceId:i(),commentId:i(),resolvedBy:i()}),$e=n({type:s(`document_editor_show`),conversationId:i(),surfaceId:i(),title:i(),initialContent:i()}),et=n({type:s(`document_editor_update`),conversationId:i(),surfaceId:i(),markdown:i(),mode:i()}),tt=n({type:s(`error`),message:i(),code:i().optional(),category:i().optional(),errorCategory:i().optional(),requestId:i().optional(),conversationId:i().optional()}),nt=n({type:s(`generation_cancelled`),conversationId:i().optional()}),S=n({id:i().optional(),filename:i(),mimeType:i(),data:i(),sourceType:o([`sandbox_file`,`host_file`,`tool_block`]).optional(),sizeBytes:l().optional(),thumbnailData:i().optional(),fileBacked:c().optional(),filePath:i().optional()}),rt=n({type:s(`generation_handoff`),conversationId:i().optional(),requestId:i().optional(),queuedCount:l(),messageId:i().optional(),attachments:t(S).optional(),attachmentWarnings:t(i()).optional()}),it=n({type:s(`heartbeat_alert`),title:i(),body:i()}),at=n({type:s(`heartbeat_conversation_created`),conversationId:i(),title:i()}),ot=n({type:s(`home_feed_updated`),updatedAt:i(),newItemCount:l()}),st=n({kind:o([`plugin`,`workspace`]),id:i()}),ct=n({type:s(`hook_event`),conversationId:i().optional(),hookName:i(),owner:st,detail:f(i(),u())}),lt=n({tool:s(`start`),app:i(),args:t(i()).optional()}),ut=n({tool:s(`observe`),app:i(),settle_ms:l().optional()}),dt=n({tool:s(`press`),app:i(),key:i(),modifiers:t(i()).optional(),duration_ms:l().optional()}),ft=n({tool:s(`combo`),app:i(),keys:t(i()),duration_ms:l().optional()}),pt=n({key:i(),modifiers:t(i()).optional(),duration_ms:l().optional(),gap_ms:l().optional()}),mt=r(`tool`,[lt,ut,dt,ft,n({tool:s(`sequence`),app:i(),steps:t(pt)}),n({tool:s(`type`),app:i(),text:i()}),n({tool:s(`click`),app:i(),x:l(),y:l(),button:o([`left`,`right`,`middle`]).optional(),double:c().optional()}),n({tool:s(`drag`),app:i(),from_x:l(),from_y:l(),to_x:l(),to_y:l(),button:o([`left`,`right`,`middle`]).optional()}),n({tool:s(`stop`),app:i().optional(),reason:i().optional()})]),ht=n({type:s(`host_app_control_request`),requestId:i(),conversationId:i(),toolName:i(),input:mt}),gt=n({type:s(`host_app_control_cancel`),requestId:i(),conversationId:i()}),_t=n({type:s(`host_bash_request`),requestId:i(),conversationId:i(),command:i(),working_dir:i().optional(),timeout_seconds:l().optional(),env:f(i(),i()).optional(),targetClientId:i().optional()}),vt=n({type:s(`host_bash_cancel`),requestId:i(),conversationId:i(),targetClientId:i().optional()}),yt=n({type:s(`host_browser_request`),requestId:i(),conversationId:i(),cdpMethod:i(),cdpParams:f(i(),u()).optional(),cdpSessionId:i().optional(),timeout_seconds:l().optional()}),bt=n({type:s(`host_browser_cancel`),requestId:i()}),xt=n({type:s(`host_cu_request`),requestId:i(),conversationId:i(),targetClientId:i().optional(),toolName:i(),input:f(i(),u()),stepNumber:l(),reasoning:i().optional()}),St=n({type:s(`host_cu_cancel`),requestId:i(),conversationId:i(),targetClientId:i().optional()}),Ct=r(`operation`,[n({type:s(`host_file_request`),requestId:i(),conversationId:i(),targetClientId:i().optional(),operation:s(`read`),path:i(),offset:l().optional(),limit:l().optional()}),n({type:s(`host_file_request`),requestId:i(),conversationId:i(),targetClientId:i().optional(),operation:s(`write`),path:i(),content:i()}),n({type:s(`host_file_request`),requestId:i(),conversationId:i(),targetClientId:i().optional(),operation:s(`edit`),path:i(),old_string:i(),new_string:i(),replace_all:c().optional()})]),wt=n({type:s(`host_file_cancel`),requestId:i(),conversationId:i(),targetClientId:i().optional()}),Tt=r(`direction`,[n({type:s(`host_transfer_request`),requestId:i(),conversationId:i(),targetClientId:i().optional(),direction:s(`to_host`),transferId:i(),destPath:i(),sizeBytes:l(),sha256:i(),overwrite:c()}),n({type:s(`host_transfer_request`),requestId:i(),conversationId:i(),targetClientId:i().optional(),direction:s(`to_sandbox`),transferId:i(),sourcePath:i()})]),Et=n({type:s(`host_transfer_cancel`),requestId:i(),conversationId:i(),targetClientId:i().optional()}),Dt=o([`sampler`,`chat`]),Ot=n({type:s(`host_ui_snapshot_request`),requestId:i(),view:Dt,tokens:f(i(),i()).optional()}),kt=n({type:s(`host_ui_snapshot_cancel`),requestId:i()}),At=n({type:s(`identity_changed`),name:i(),role:i(),personality:i(),emoji:i(),home:i()}),jt=o([`approved`,`rejected`,`answered`,`cancelled`,`superseded`]),Mt=n({type:s(`interaction_resolved`),requestId:i(),conversationId:i(),state:jt,kind:i()}),C=n({semanticUnavailable:c(),reason:i(),fallbackSources:t(i())}),Nt=n({key:i(),type:i(),kind:i(),finalScore:l(),semantic:l(),recency:l()}),Pt=n({type:s(`memory_recalled`),provider:i(),model:i(),degradation:C.optional(),semanticHits:l(),tier1Count:l(),tier2Count:l(),hybridSearchLatencyMs:l(),sparseVectorUsed:c(),mergedCount:l(),selectedCount:l(),injectedTokens:l(),latencyMs:l(),topCandidates:t(Nt)}),Ft=n({type:s(`memory_status`),enabled:c(),degraded:c(),degradation:C.optional(),reason:i().optional(),provider:i().optional(),model:i().optional()}),It=n({type:s(`message_complete`),messageId:i().optional(),conversationId:i().optional(),source:o([`main`,`aux`]).optional(),attachments:t(S).optional(),attachmentWarnings:t(i()).optional()}),Lt=n({type:s(`message_dequeued`),conversationId:i(),requestId:i()}),Rt=n({type:s(`message_queued`),conversationId:i(),requestId:i(),position:l()}),zt=n({type:s(`message_queued_deleted`),conversationId:i(),requestId:i()}),Bt=n({type:s(`message_request_complete`),conversationId:i(),requestId:i(),runStillActive:c().optional()}),Vt=n({type:s(`message_steered`),conversationId:i(),requestId:i()}),Ht=n({id:i(),displayName:i()}),Ut=n({id:i(),displayName:i(),models:t(Ht),defaultModel:i(),apiKeyUrl:i().optional(),apiKeyPlaceholder:i().optional()}),Wt=n({type:s(`model_info`),conversationId:i().optional(),model:i(),provider:i(),configuredProviders:t(i()).optional(),availableModels:t(Ht).optional(),allProviders:t(Ut).optional()}),Gt=n({type:s(`navigate_settings`),tab:i()}),Kt=n({type:s(`notification_conversation_created`),conversationId:i(),title:i(),sourceEventName:i(),targetGuardianPrincipalId:i().optional(),groupId:i().optional(),source:i().optional(),silent:c().optional()}),qt=n({type:s(`notification_intent`),sourceEventName:i(),title:i(),body:i(),deliveryId:i().optional(),deepLinkMetadata:f(i(),u()).optional(),targetGuardianPrincipalId:i().optional(),silent:c().optional()}),Jt=n({type:s(`oauth_connect_result`),success:c(),service:i().optional(),grantedScopes:t(i()).optional(),accountInfo:i().optional(),error:i().optional()}),Yt=n({type:s(`open_conversation`),conversationId:i(),title:i().optional(),anchorMessageId:i().optional(),focus:c().optional()}),Xt=n({type:s(`open_panel`),panelType:i(),data:f(i(),u()).optional(),conversationId:i().optional(),surfaceId:i().optional()}),Zt=n({type:s(`open_url`),url:i().min(1),title:i().optional(),conversationId:i().optional()}),Qt=n({type:s(`platform_disconnected`)}),w=n({id:i(),label:i(),description:i().optional()}),T=n({id:i(),question:i(),description:i().optional(),options:t(w),freeTextPlaceholder:i().optional()}),$t=n({type:s(`question_request`),requestId:i(),questions:t(T),question:i(),description:i().optional(),options:t(w),freeTextPlaceholder:i().optional(),conversationId:i().optional(),toolUseId:i().optional()}),en=n({captureScope:o([`display`,`window`]).optional(),displayId:i().optional(),windowId:l().optional(),includeAudio:c().optional(),includeMicrophone:c().optional(),promptForSource:c().optional()}),tn=n({type:s(`recording_start`),recordingId:i(),attachToConversationId:i().optional(),options:en.optional(),operationToken:i().optional()}),nn=n({type:s(`recording_stop`),recordingId:i()}),rn=n({type:s(`recording_pause`),recordingId:i()}),an=n({type:s(`recording_resume`),recordingId:i()}),on=n({type:s(`relationship_state_updated`),updatedAt:i()}),sn=n({type:s(`schedule_conversation_created`),conversationId:i(),scheduleJobId:i(),title:i()}),cn=n({type:s(`secret_request`),requestId:i(),service:i(),field:i(),label:i(),description:i().optional(),placeholder:i().optional(),conversationId:i().optional(),purpose:i().optional(),allowedTools:t(i()).optional(),allowedDomains:t(i()).optional(),allowOneTimeSend:c().optional()}),ln=n({type:s(`service_group_update_complete`),installedVersion:i(),success:c(),rolledBackToVersion:i().optional()}),un=n({type:s(`service_group_update_progress`),statusMessage:i()}),dn=n({type:s(`service_group_update_starting`),targetVersion:i(),expectedDowntimeSeconds:l()}),fn=n({type:s(`show_platform_login`)}),pn=n({type:s(`skills_state_changed`),name:i(),state:o([`enabled`,`disabled`,`installed`,`uninstalled`])}),mn=n({type:s(`sounds_config_updated`)}),hn=n({type:i(),content:i().optional(),text:i().optional(),result:i().optional(),input:f(i(),u()).optional(),toolName:i().optional(),isError:c().optional(),toolUseId:i().optional()}).passthrough(),gn=n({type:s(`subagent_event`),conversationId:i(),subagentId:i(),event:hn}).strict(),_n=n({type:s(`subagent_spawned`),subagentId:i(),parentConversationId:i(),label:i(),objective:i(),isFork:c().optional(),parentToolUseId:i().optional()}).strict(),E=o([`pending`,`running`,`awaiting_input`,`completed`,`failed`,`aborted`,`interrupted`]),D=n({inputTokens:l(),outputTokens:l(),estimatedCost:l()}).strict(),vn=n({type:s(`subagent_status_changed`),subagentId:i(),status:E,error:i().optional(),usage:D.optional()}).strict(),yn=n({type:s(`sync_changed`),tags:t(i().min(1)).min(1),originClientId:i().min(1).optional()}),bn=n({type:s(`tool_input_delta`),toolName:i(),content:i(),conversationId:i().optional(),toolUseId:i().optional(),messageId:i().optional()}),xn=o([`tool_start`,`tool_complete`,`status`]),Sn=n({type:s(`tool_output_chunk`),chunk:i(),conversationId:i().optional(),toolUseId:i().optional(),subType:xn.optional(),subToolName:i().optional(),subToolInput:i().optional(),subToolIsError:c().optional(),subToolId:i().optional(),messageId:i().optional()}),Cn=n({pattern:i(),label:i()}),wn=o([`anthropic-native`,`brave`,`perplexity`,`tavily`,`firecrawl`]),Tn=o([`default`,`firecrawl`]),En=n({rank:l(),title:i(),url:i(),domain:i(),faviconUrl:i().optional(),snippet:i().optional(),age:i().optional(),score:l().optional()}),Dn=n({query:i(),provider:wn,resultCount:l(),durationMs:l(),results:t(En),errorMessage:i().optional()}),On=n({url:i(),finalUrl:i(),provider:Tn.optional(),status:l(),contentType:i().optional(),byteCount:l(),charCount:l(),truncated:c(),title:i().optional(),domain:i(),faviconUrl:i().optional(),redirectCount:l(),durationMs:l(),errorMessage:i().optional(),mayRequireJavaScript:c().optional()}),O=n({webSearch:Dn.optional(),webFetch:On.optional()}),kn=n({type:s(`tool_result`),toolName:i(),result:i(),isError:c().optional(),diff:_.optional(),status:i().optional(),conversationId:i().optional(),imageData:i().optional(),imageDataList:t(i()).optional(),toolUseId:i().optional(),messageId:i().optional(),riskLevel:i().optional(),riskReason:i().optional(),matchedTrustRuleId:i().optional(),isContainerized:c().optional(),riskScopeOptions:t(Cn).optional(),riskAllowlistOptions:t(m).optional(),riskDirectoryScopeOptions:t(g).optional(),approvalMode:i().optional(),approvalReason:i().optional(),riskThreshold:i().optional(),activityMetadata:O.optional(),errorCode:i().optional(),completedAt:l().optional()}),An=n({type:s(`tool_use_preview_start`),toolUseId:i(),toolName:i(),conversationId:i().optional(),messageId:i().optional(),previewStartedAt:l().optional()}),jn=n({type:s(`tool_use_start`),toolName:i(),input:f(i(),u()),toolUseId:i().optional(),messageId:i().optional(),conversationId:i().optional(),startedAt:l().optional(),previewStartedAt:l().optional()}),Mn=n({type:s(`ui_surface_complete`),conversationId:i(),surfaceId:i(),summary:i(),submittedData:f(i(),u()).optional()}),Nn=n({type:s(`ui_surface_dismiss`),conversationId:i(),surfaceId:i()}),Pn=n({id:i(),label:i(),style:o([`primary`,`secondary`,`destructive`]).optional(),data:f(i(),u()).optional()}),Fn=n({type:s(`ui_surface_show`),conversationId:i(),surfaceId:i(),surfaceType:i(),title:i().optional(),data:f(i(),u()),actions:t(Pn).optional(),display:o([`inline`,`panel`]).optional(),messageId:i().optional(),persistent:c().optional(),toolCallId:i().optional()}),In=n({type:s(`ui_surface_undo_result`),conversationId:i(),surfaceId:i(),success:c(),remainingUndos:l()}),Ln=n({type:s(`ui_surface_update`),conversationId:i(),surfaceId:i(),data:f(i(),u())}),k=n({type:s(`usage_progress`),conversationId:i(),inputTokens:l(),outputTokens:l(),estimatedCost:l(),model:i()}),Rn=n({type:s(`usage_update`),conversationId:i(),inputTokens:l(),outputTokens:l(),cacheCreationInputTokens:l().optional(),cacheReadInputTokens:l().optional(),totalInputTokens:l(),totalOutputTokens:l(),estimatedCost:l(),model:i(),contextWindowTokens:l().optional(),contextWindowMaxTokens:l().optional()}),zn=n({type:s(`user_message_echo`),text:i(),conversationId:i().optional(),messageId:i().optional(),requestId:i().optional(),clientMessageId:i().optional()}).strict(),A=o([`running`,`completed`,`failed`,`aborted`,`cap_exceeded`,`interrupted`]),Bn=n({type:s(`workflow_completed`),runId:i(),conversationId:i().optional(),status:A,agentsSpawned:l(),inputTokens:l(),outputTokens:l(),summary:i().optional()}).strict(),Vn=n({type:s(`workflow_leaf_finished`),runId:i(),conversationId:i(),seq:l().int(),status:o([`completed`,`failed`]),label:i().optional(),inputTokens:l().optional(),outputTokens:l().optional(),resultSummary:i().optional()}).strict(),Hn=n({type:s(`workflow_leaf_started`),runId:i(),conversationId:i(),seq:l().int(),label:i().optional(),phase:i().optional(),promptSummary:i().optional()}).strict(),Un=n({type:s(`workflow_progress`),runId:i(),conversationId:i().optional(),agentsSpawned:l(),phase:i().optional(),label:i().optional(),message:i().optional()}).strict(),Wn=n({type:s(`workflow_started`),runId:i(),conversationId:i(),toolUseId:i().optional(),label:i().optional()}).strict(),Gn=`syntheticAgentErrorMessage`,Kn=`compactionAgent`,qn=3e4,Jn=n({cursorInTextField:c().optional().describe(`Whether the cursor is in an editable text field when dictation started`)}).passthrough().describe(`Dictation context (app name, window title, bundle ID, cursor state, selected text)`),Yn=n({transcription:i().describe(`Raw speech transcription`),context:Jn,profileId:i().describe(`Optional dictation profile ID`).optional()}),j=n({id:i(),filename:i(),mimeType:i(),sizeBytes:l(),kind:i(),data:i().optional(),thumbnailData:i().optional(),fileBacked:c().optional()}),Xn=n({pattern:i(),label:i()}),Zn=n({label:i(),description:i(),pattern:i()}),Qn=n({scope:i(),label:i()}),$n=n({requestId:i(),title:i().optional(),description:i().optional(),toolName:i().optional(),riskLevel:i().optional(),riskReason:i().optional(),input:f(i(),u()).optional(),allowlistOptions:t(m).optional(),scopeOptions:t(h).optional(),directoryScopeOptions:t(g).optional(),persistentDecisionsAllowed:c().optional()}),er=n({requestId:i(),entries:t(T)}),tr=o([`approved`,`denied`,`timed_out`]),M=n({id:i().optional(),name:i(),input:f(i(),u()),result:i().optional(),isError:c().optional(),errorCode:i().optional(),imageData:i().optional(),imageDataList:t(i()).optional(),imageAttachmentIds:t(i()).optional(),startedAt:l().optional(),previewStartedAt:l().optional(),completedAt:l().optional(),confirmationDecision:tr.optional(),confirmationLabel:i().optional(),riskLevel:i().optional(),riskReason:i().optional(),matchedTrustRuleId:i().optional(),autoApproved:c().optional(),approvalMode:i().optional(),approvalReason:i().optional(),riskThreshold:i().optional(),riskScopeOptions:t(Xn).optional(),riskAllowlistOptions:t(Zn).optional(),riskDirectoryScopeOptions:t(Qn).optional(),activityMetadata:O.optional(),scopeOptions:t(h).optional(),pendingConfirmation:$n.optional(),pendingQuestion:er.optional()}),nr=n({id:i(),label:i(),style:i().optional(),data:f(i(),u()).optional()}),N=n({surfaceId:i(),surfaceType:i(),title:i().optional(),data:f(i(),u()),actions:t(nr).optional(),display:i().optional(),persistent:c().optional(),completed:c().optional(),completionSummary:i().optional(),toolCallId:i().optional()}),rr=n({subagentId:i(),label:i(),status:i(),error:i().optional(),conversationId:i().optional(),objective:i().optional()}),ir=n({acpSessionId:i(),agent:i().optional()}),ar=n({id:i(),toolName:i(),conversationId:i(),command:i(),startedAt:l(),status:o([`completed`,`failed`,`cancelled`]),exitCode:l().nullable(),output:i(),completedAt:l()}),or=n({appUrl:i().optional(),webUrl:i().optional()}),sr=n({emoji:i(),op:o([`added`,`removed`]),actorDisplayName:i().optional(),targetChannelTs:i()}),cr=n({channelId:i(),channelName:i().optional(),channelTs:i(),threadTs:i().optional(),sender:n({displayName:i().optional(),externalUserId:i().optional()}).optional(),messageLink:or.optional(),threadLink:or.optional(),eventKind:o([`message`,`reaction`]).optional(),reaction:sr.optional()}),lr=n({type:s(`text`),text:i()}),ur=n({type:s(`thinking`),thinking:i(),startedAt:l().optional(),completedAt:l().optional()}),dr=n({type:s(`tool_use`),toolCall:M}),fr=n({type:s(`surface`),surface:N}),pr=n({type:s(`attachment`),attachment:j}),mr=r(`type`,[lr,ur,dr,fr,pr]),hr=n({id:i(),mergedMessageIds:t(i()).optional(),clientMessageId:i().optional(),role:o([`user`,`assistant`]),timestamp:i(),attachments:t(j),toolCalls:t(M).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the tool_use variant). Flat list of tool calls.`}).optional(),surfaces:t(N).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks (the surface variant). Flat list of surfaces.`}).optional(),textSegments:t(i()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Text segments split by tool-call boundaries.`}).optional(),thinkingSegments:t(i()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Reasoning text extracted from thinking blocks.`}).optional(),contentOrder:t(i()).meta({deprecated:!0,description:`Deprecated: superseded by contentBlocks. Positional "<type>:<index>" content ordering (e.g. "text:0", "thinking:1").`}).optional(),contentBlocks:t(mr).optional(),subagentNotification:rr.optional(),acpNotification:ir.optional(),backgroundEventNotification:c().optional(),backgroundToolCompletion:ar.optional(),systemCard:c().optional(),slackMessage:cr.optional(),queueStatus:o([`queued`,`processing`]).optional(),queuePosition:l().optional()}),gr=n({status:x}),_r=s(`notification`),vr=o([`new`,`seen`,`acted_on`,`dismissed`]),yr=o([`low`,`medium`,`high`,`critical`]),br=o([`security`,`scheduling`,`background`,`email`,`system`]),xr=o([`heartbeat`,`memory_consolidation`,`schedule`,`auto_analysis`,`user`,`other`]),Sr=n({id:i(),label:i(),prompt:i()}),Cr=o([`emailDraft`,`documentPreview`,`permissionChat`,`paymentAuth`,`toolPermission`,`updatesList`]),wr=n({kind:Cr}),Tr=n({id:i(),type:_r,priority:l().int().min(0).max(100),title:i().optional(),summary:i(),timestamp:i(),status:vr.default(`new`),expiresAt:i().optional(),actions:t(Sr).optional(),urgency:yr.optional(),conversationId:i().optional(),detailPanel:wr.optional(),category:br.optional(),noteworthy:c().optional(),fromAssistant:c().optional(),metadata:f(i(),u()).optional(),sourceType:xr.optional(),sourceKey:i().optional(),sourceLabel:i().optional(),createdAt:i()}),Er=o([`deterministic`,`assistant`]),Dr=n({id:i(),label:i(),icon:i().optional(),prompt:i(),source:Er}),Or=n({greeting:i(),timeAwayLabel:i(),newCount:l().int().min(0)}),kr=n({items:t(Tr),updatedAt:i(),contextBanner:Or,suggestedPrompts:t(Dr)}),Ar=n({id:i(),category:o([`voice`,`world`,`priorities`]),text:i(),confidence:o([`strong`,`uncertain`]),source:o([`onboarding`,`inferred`])}),jr=n({id:i(),name:i(),description:i(),tier:o([`unlocked`,`next-up`,`earned`]),gate:i(),unlockHint:i().optional(),ctaLabel:i().optional()}),Mr=n({version:s(1),assistantId:i(),tier:d([s(1),s(2),s(3),s(4)]),progressPercent:l(),facts:t(Ar),capabilities:t(jr),conversationCount:l(),hatchedDate:i(),assistantName:i(),userName:i().optional(),updatedAt:i()}),Nr=n({key:i(),label:i(),ms:l()}),Pr=n({key:i(),label:i(),ms:l(),subPhases:t(Nr).optional()}),Fr=n({phases:t(Pr),ttftMs:l().nullish(),totalToFirstTokenMs:l().nullish(),providerDurationMs:l().nullish(),firstTokenKind:o([`thinking`,`text`]).nullish()}),Ir=n({provider:i().nullish(),model:i().nullish(),status:i().nullish(),inputTokens:l().nullish(),outputTokens:l().nullish(),cacheCreationInputTokens:l().nullish(),cacheReadInputTokens:l().nullish(),stopReason:i().nullish(),requestMessageCount:l().nullish(),requestToolCount:l().nullish(),responseMessageCount:l().nullish(),responseToolCallCount:l().nullish(),responsePreview:i().nullish(),toolCallNames:t(i()).nullish(),estimatedCostUsd:l().nullish(),durationMs:l().nullish()}),P=n({kind:i(),label:i().nullish(),role:i().nullish(),text:i().nullish(),toolName:i().nullish(),data:u().optional(),language:i().nullish()}),Lr=n({name:i().nullish(),message:i().nullish(),code:i().nullish(),provider:i().nullish(),statusCode:l().nullish(),retryAfterMs:l().nullish(),apiErrorCode:i().nullish(),apiErrorType:i().nullish(),apiErrorParam:i().nullish(),requestId:i().nullish()}),Rr=n({id:i(),createdAt:l(),requestPayload:ie(),responsePayload:ie(),provider:i().nullish(),summary:Ir.nullish(),requestSections:t(P).nullish(),responseSections:t(P).nullish(),agentLoopExitReason:i().nullish(),callSite:i().nullish(),error:Lr.nullish(),latency:Fr.nullish()}),zr=n({nodeId:i(),score:l(),semanticSimilarity:l(),recencyBoost:l(),type:i().optional()}),Br=n({reason:i(),semanticUnavailable:c(),fallbackSources:t(i())}),Vr=n({enabled:c(),degraded:c(),provider:i().nullable(),model:i().nullable(),degradation:Br.nullable(),semanticHits:l().nullish(),mergedCount:l().nullish(),selectedCount:l().nullish(),tier1Count:l().nullish(),tier2Count:l().nullish(),hybridSearchLatencyMs:l().nullish(),sparseVectorUsed:c().nullish(),injectedTokens:l().nullish(),latencyMs:l().nullish(),topCandidates:t(zr),injectedText:i().nullable(),reason:i().nullable(),queryContext:i().nullable()}),Hr=n({slug:i(),finalActivation:l(),ownActivation:l(),priorActivation:l(),simUser:l(),simAssistant:l(),simNow:l(),simUserRerankBoost:l().optional(),simAssistantRerankBoost:l().optional(),inRerankPool:c().optional(),spreadContribution:l(),source:i(),status:i()}),Ur=n({d:l(),c_user:l(),c_assistant:l(),c_now:l(),k:l(),hops:l(),top_k:l(),epsilon:l()}),Wr=n({turn:l(),mode:i(),concepts:t(Hr),config:Ur}),Gr=n({slug:i(),source:i(),pinned:c(),sectionOrdinal:l().nullable().optional(),sectionHeading:i().nullable().optional()}),Kr=n({turn:l(),live:c(),selections:t(Gr),injectedText:i()}),qr=n({messageId:i().nullish(),conversationKey:i().nullish(),conversationId:i().nullish(),conversationKind:i(),conversationTotalEstimatedCostUsd:l().nullish(),logs:t(Rr),memoryRecall:Vr.nullable(),memoryV2Activation:Wr.nullable(),memoryV3Selection:Kr.nullish()}),Jr=n({type:i(),content:i(),toolName:i().optional(),isError:c().optional(),messageId:i().optional(),toolUseId:i().optional(),input:f(i(),u()).optional()}),Yr=n({subagentId:i(),objective:i().optional(),status:E.optional(),usage:D.optional(),events:t(Jr),label:i().optional(),parentToolUseId:i().optional()}),Xr=n({seq:l().int(),kind:o([`agent`,`workflow`]),label:i().optional(),phase:i().optional(),promptSummary:i().optional(),status:i(),resultSummary:i().optional(),inputTokens:l().optional(),outputTokens:l().optional(),createdAt:l().nullable()}),Zr=n({runId:i(),status:A.optional(),agentsSpawned:l().optional(),inputTokens:l().optional(),outputTokens:l().optional(),phase:i().optional(),leaves:t(Xr)});function F(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Qr(e){if(F(e))return e;if(typeof e==`string`)try{let t=JSON.parse(e);if(F(t))return t}catch{}return{}}var I=()=>i().optional().catch(void 0),L=()=>c().optional().catch(void 0),R=()=>l().finite().optional().catch(void 0);function z(e){return a(e=>Array.isArray(e)?e.filter(F):[],t(e))}var B=n({title:i().optional(),subtitle:i().optional(),body:i().optional(),metadata:t(n({label:p(),value:p()})).optional(),template:i().optional(),templateData:f(i(),u()).optional()}),$r=a(e=>{let t=(typeof e==`string`?e.split(`,`):Array.isArray(e)?e:[]).map(e=>typeof e==`string`||typeof e==`number`?String(e).trim():``).filter(e=>e.length>0);return t.length>0?t:void 0},t(i()).optional()),V=n({prompt:p().optional(),acceptedTypes:$r,maxFiles:ae().int().positive().optional().catch(void 0),maxSizeBytes:ae().positive().optional().catch(void 0)}),H=n({text:i().catch(``),label:I(),language:I()});function ei(e,t){let n={...t};for(let t of[`text`,`label`,`language`])typeof n[t]!=`string`&&typeof e[t]==`string`&&(n[t]=e[t]);return H.parse(n)}var U=n({id:i(),title:i(),description:I(),recommended:L(),data:f(i(),u()).optional().catch(void 0)}),ti=a(e=>Array.isArray(e)?e.flatMap(e=>{if(!F(e))return[];let t=typeof e.id==`string`?e.id.trim():``,n=typeof e.title==`string`?e.title.trim():typeof e.label==`string`?e.label.trim():``;return!t||!n?[]:[{...e,id:t,title:n}]}):[],t(U)),W=n({description:I(),options:ti,selectionMode:a(e=>e===`multiple`?`multiple`:`single`,o([`single`,`multiple`])),commitOnSelect:L(),submitLabel:I()}),G=n({providerKey:a(e=>typeof e==`string`?e.trim():e,i()).catch(``),displayName:I(),description:I(),logoUrl:i().nullable().optional().catch(void 0)}),K=n({id:i().catch(``),type:o([`text`,`textarea`,`select`,`toggle`,`number`,`password`]).catch(`text`),label:i().catch(``),placeholder:I(),required:L(),defaultValue:d([i(),l(),c()]).optional().catch(void 0),options:t(n({label:p(),value:p()})).optional().catch(void 0)}),ni=n({id:i().catch(``),title:i().catch(``),description:I(),fields:z(K)}),q=n({description:I(),fields:z(K),submitLabel:I(),pages:z(ni).optional().catch(void 0),pageLabels:n({next:I(),back:I(),submit:I()}).optional().catch(void 0),progressStyle:o([`bar`,`tabs`]).optional().catch(void 0)}),ri=n({id:i().catch(``),title:i().catch(``),subtitle:I(),icon:I(),selected:L()}),J=n({items:z(ri),selectionMode:o([`single`,`multiple`,`none`]).catch(`none`)}),ii=n({id:i().catch(``),label:i().catch(``),width:R()}),ai=n({text:p().catch(``),icon:I(),iconColor:I()}),oi=n({id:i().catch(``),cells:f(i(),d([i(),ai]).catch(``)).catch({}),selectable:L(),selected:L()}),Y=n({columns:z(ii),rows:z(oi),selectionMode:o([`none`,`single`,`multiple`]).optional().catch(void 0),caption:I()}),X=n({message:i().catch(``),detail:I(),confirmLabel:I(),confirmedLabel:I(),cancelLabel:I(),destructive:L()}),si=n({title:i().catch(``),subtitle:I(),description:I(),icon:I(),metrics:t(n({label:p(),value:p()})).optional().catch(void 0),context:o([`app_create`,`general`]).optional().catch(void 0),previewImage:I()}),ci=n({html:i().catch(``),width:R(),height:R(),appId:I(),dirName:I(),reloadGeneration:R(),status:I(),preview:si.optional().catch(void 0)}),li=n({title:i().catch(``),surfaceId:i().catch(``),subtitle:I(),content:I(),mimeType:I()}),ui=o([`completed`,`partial`,`failed`,`in_progress`]),Z=o([`neutral`,`positive`,`warning`,`negative`]),di=o([`items`,`timeline`,`diff`,`artifacts`,`warnings`]),fi=()=>({label:p().catch(``),value:d([i(),l()]).catch(``)}),pi=n({...fi(),detail:I(),tone:Z.optional().catch(void 0)}),mi=n(fi()),hi=n({id:I(),title:p().catch(``),description:I(),status:I(),tone:Z.optional().catch(void 0),metadata:z(mi).optional().catch(void 0),href:I()}),gi=n({label:I(),before:I(),after:I()}),_i=n({id:I(),title:p().catch(``),description:I(),type:di.optional().catch(void 0),items:z(hi).optional().catch(void 0),diffs:z(gi).optional().catch(void 0)}),vi=n({eyebrow:I(),status:ui.optional().catch(void 0),summary:I(),metrics:z(pi).optional().catch(void 0),sections:z(_i).optional().catch(void 0)}),Q=[`card`,`channel_setup`,`choice`,`copy_block`,`oauth_connect`,`form`,`list`,`table`,`confirmation`,`dynamic_page`,`file_upload`,`document_preview`,`task_preferences`,`work_result`,`skill_card`,`call_summary`],yi=o(Q),bi=[`skill_card`,`call_summary`],xi=new Set(bi);function Si(e){return xi.has(e)}var Ci=Q.filter(e=>!Si(e));new Set(Q);var wi={card:B,channel_setup:f(i(),u()),choice:W,copy_block:H,oauth_connect:G,form:q,list:J,table:Y,confirmation:X,dynamic_page:ci,file_upload:V,document_preview:li,task_preferences:f(i(),u()),work_result:vi,skill_card:f(i(),u()),call_summary:f(i(),u())},Ti=e({ACPOptionKindSchema:()=>Me,ACPOptionSchema:()=>Ne,AcpSessionCompletedEventSchema:()=>se,AcpSessionErrorEventSchema:()=>ce,AcpSessionSpawnedEventSchema:()=>le,AcpSessionUpdateEventSchema:()=>de,AcpSessionUpdateTypeSchema:()=>ue,AcpSessionUsageEventSchema:()=>fe,AcpStopReasonSchema:()=>oe,AllowlistOptionSchema:()=>m,AppFilesChangedEventSchema:()=>pe,AssistantActivityAnchorSchema:()=>he,AssistantActivityPhaseSchema:()=>me,AssistantActivityReasonSchema:()=>ge,AssistantActivityStateEventSchema:()=>_e,AssistantEventEnvelopeSchema:()=>Ei,AssistantEventSchema:()=>$,AssistantOutboundAttachmentSchema:()=>S,AssistantStatusEventSchema:()=>ve,AssistantTextDeltaEventSchema:()=>ye,AssistantThinkingDeltaEventSchema:()=>be,AssistantTurnStartEventSchema:()=>xe,AvatarUpdatedEventSchema:()=>Se,BackgroundToolCompletedEventSchema:()=>Ce,BackgroundToolStartedEventSchema:()=>we,BookmarkCreatedEventSchema:()=>Ee,BookmarkDeletedEventSchema:()=>De,BookmarkSummarySchema:()=>Te,CALL_SITE_COMPACTION_AGENT:()=>Kn,CALL_SITE_SYNTHETIC_AGENT_ERROR_MESSAGE:()=>Gn,CapabilitySchema:()=>jr,CardSurfaceDataSchema:()=>B,ChoiceOptionSchema:()=>U,ChoiceSurfaceDataSchema:()=>W,ClientSettingsUpdateEventSchema:()=>Oe,CompactionCircuitClosedEventSchema:()=>ke,CompactionCircuitOpenEventSchema:()=>Ae,ConfigChangedEventSchema:()=>je,ConfirmationDiffSchema:()=>_,ConfirmationExecutionTargetSchema:()=>Pe,ConfirmationRequestEventSchema:()=>v,ConfirmationStateChangedEventSchema:()=>y,ConfirmationSurfaceDataSchema:()=>X,ContactRequestEventSchema:()=>Fe,ContactsChangedEventSchema:()=>Ie,ContextBannerSchema:()=>Or,ContextCompactedEventSchema:()=>Le,ConversationAttachmentBlockSchema:()=>pr,ConversationContentBlockSchema:()=>mr,ConversationErrorCodeSchema:()=>b,ConversationErrorEventSchema:()=>Re,ConversationInferenceProfileUpdatedEventSchema:()=>ze,ConversationListInvalidatedEventSchema:()=>Ve,ConversationListInvalidatedReasonSchema:()=>Be,ConversationMessageAttachmentSchema:()=>j,ConversationMessageSchema:()=>hr,ConversationMessageSurfaceSchema:()=>N,ConversationMessageToolCallSchema:()=>M,ConversationNoticeEventSchema:()=>Ue,ConversationNoticeSourceSchema:()=>He,ConversationSlackMessageSchema:()=>cr,ConversationSubagentNotificationSchema:()=>rr,ConversationSurfaceBlockSchema:()=>fr,ConversationTextBlockSchema:()=>lr,ConversationThinkingBlockSchema:()=>ur,ConversationTitleUpdatedEventSchema:()=>We,ConversationToolUseBlockSchema:()=>dr,CopyBlockSurfaceDataSchema:()=>H,DAEMON_INTERNAL_SURFACE_TYPES:()=>bi,DEFAULT_TOOL_EXECUTION_TIMEOUT_SEC:()=>120,DictationContextSchema:()=>Jn,DictationRequestSchema:()=>Yn,DirectoryScopeOptionSchema:()=>g,DiskPressureBlockedCapabilitySchema:()=>Ke,DiskPressureStateSchema:()=>Ge,DiskPressureStatusChangedEventSchema:()=>qe,DiskPressureStatusResponseSchema:()=>gr,DiskPressureStatusSchema:()=>x,DocumentCommentCreatedEventSchema:()=>Ye,DocumentCommentDeletedEventSchema:()=>Xe,DocumentCommentReopenedEventSchema:()=>Ze,DocumentCommentResolvedEventSchema:()=>Qe,DocumentEditorShowEventSchema:()=>$e,DocumentEditorUpdateEventSchema:()=>et,DocumentPreviewSurfaceDataSchema:()=>li,DynamicPagePreviewSchema:()=>si,DynamicPageSurfaceDataSchema:()=>ci,ErrorEventSchema:()=>tt,FactSchema:()=>Ar,FeedActionSchema:()=>Sr,FeedItemCategorySchema:()=>br,FeedItemDetailPanelKindSchema:()=>Cr,FeedItemDetailPanelSchema:()=>wr,FeedItemSchema:()=>Tr,FeedItemSourceTypeSchema:()=>xr,FeedItemStatusSchema:()=>vr,FeedItemTypeSchema:()=>_r,FeedItemUrgencySchema:()=>yr,FileUploadSurfaceDataSchema:()=>V,FormFieldSchema:()=>K,FormPageSchema:()=>ni,FormSurfaceDataSchema:()=>q,GenerationCancelledEventSchema:()=>nt,GenerationHandoffEventSchema:()=>rt,HeartbeatAlertEventSchema:()=>it,HeartbeatConversationCreatedEventSchema:()=>at,HomeFeedResponseSchema:()=>kr,HomeFeedUpdatedEventSchema:()=>ot,HookEventOwnerSchema:()=>st,HookEventSchema:()=>ct,HostAppControlCancelEventSchema:()=>gt,HostAppControlInputSchema:()=>mt,HostAppControlRequestEventSchema:()=>ht,HostAppControlSequenceStepSchema:()=>pt,HostBashCancelEventSchema:()=>vt,HostBashRequestEventSchema:()=>_t,HostBrowserCancelEventSchema:()=>bt,HostBrowserRequestEventSchema:()=>yt,HostCuCancelEventSchema:()=>St,HostCuRequestEventSchema:()=>xt,HostFileCancelEventSchema:()=>wt,HostFileRequestEventSchema:()=>Ct,HostTransferCancelEventSchema:()=>Et,HostTransferRequestEventSchema:()=>Tt,HostUiSnapshotCancelEventSchema:()=>kt,HostUiSnapshotRequestEventSchema:()=>Ot,HostUiSnapshotViewSchema:()=>Dt,IdentityChangedEventSchema:()=>At,InteractionResolutionStateSchema:()=>jt,InteractionResolvedEventSchema:()=>Mt,LLMCallErrorSchema:()=>Lr,LLMCallSummarySchema:()=>Ir,LLMContextSectionSchema:()=>P,LLMRequestLogEntrySchema:()=>Rr,LatencyBreakdownSchema:()=>Fr,LatencyPhaseSchema:()=>Pr,ListItemSchema:()=>ri,ListSurfaceDataSchema:()=>J,LlmContextResponseSchema:()=>qr,MODEL_INVOKABLE_SURFACE_TYPES:()=>Ci,MemoryCandidateSchema:()=>zr,MemoryDegradationSchema:()=>Br,MemoryRecallLogSchema:()=>Vr,MemoryRecalledCandidateDebugSchema:()=>Nt,MemoryRecalledDegradationSchema:()=>C,MemoryRecalledEventSchema:()=>Pt,MemoryStatusEventSchema:()=>Ft,MemoryV2ActivationLogSchema:()=>Wr,MemoryV2ConceptRowSchema:()=>Hr,MemoryV2ConfigSnapshotSchema:()=>Ur,MemoryV3SelectionLogSchema:()=>Kr,MemoryV3SelectionRowSchema:()=>Gr,MessageCompleteEventSchema:()=>It,MessageDequeuedEventSchema:()=>Lt,MessageQueuedDeletedEventSchema:()=>zt,MessageQueuedEventSchema:()=>Rt,MessageRequestCompleteEventSchema:()=>Bt,MessageSteeredEventSchema:()=>Vt,ModelInfoEventSchema:()=>Wt,NavigateSettingsEventSchema:()=>Gt,NotificationConversationCreatedEventSchema:()=>Kt,NotificationIntentEventSchema:()=>qt,OAuthConnectResultEventSchema:()=>Jt,OAuthConnectSurfaceDataSchema:()=>G,OpenConversationEventSchema:()=>Yt,OpenPanelEventSchema:()=>Xt,OpenUrlEventSchema:()=>Zt,PendingToolConfirmationSchema:()=>$n,PlatformDisconnectedEventSchema:()=>Qt,QuestionEntrySchema:()=>T,QuestionOptionSchema:()=>w,QuestionRequestEventSchema:()=>$t,RecordingOptionsSchema:()=>en,RecordingPauseEventSchema:()=>rn,RecordingResumeEventSchema:()=>an,RecordingStartEventSchema:()=>tn,RecordingStopEventSchema:()=>nn,RelationshipStateSchema:()=>Mr,RelationshipStateUpdatedEventSchema:()=>on,RiskScopeOptionSchema:()=>Cn,SSE_REPLAY_RING_AGE_LIMIT_MS:()=>qn,SSE_REPLAY_RING_COUNT_LIMIT:()=>200,SURFACE_DATA_SCHEMAS:()=>wi,SURFACE_TYPES:()=>Q,ScheduleConversationCreatedEventSchema:()=>sn,ScopeOptionSchema:()=>h,SecretRequestEventSchema:()=>cn,ServiceGroupUpdateCompleteEventSchema:()=>ln,ServiceGroupUpdateProgressEventSchema:()=>un,ServiceGroupUpdateStartingEventSchema:()=>dn,ShowPlatformLoginEventSchema:()=>fn,SkillStateChangedEventSchema:()=>pn,SoundsConfigUpdatedEventSchema:()=>mn,SubagentDetailEventSchema:()=>Jr,SubagentDetailResponseSchema:()=>Yr,SubagentEventEventSchema:()=>gn,SubagentInnerEventSchema:()=>hn,SubagentSpawnedEventSchema:()=>_n,SubagentStatusChangedEventSchema:()=>vn,SubagentStatusSchema:()=>E,SubagentUsageStatsSchema:()=>D,SuggestedPromptSchema:()=>Dr,SuggestedPromptSourceSchema:()=>Er,SurfaceActionSchema:()=>Pn,SurfaceTypeSchema:()=>yi,SyncChangedEventSchema:()=>yn,TableCellValueSchema:()=>ai,TableColumnSchema:()=>ii,TableRowSchema:()=>oi,TableSurfaceDataSchema:()=>Y,ToolActivityMetadataSchema:()=>O,ToolInputDeltaEventSchema:()=>bn,ToolOutputChunkEventSchema:()=>Sn,ToolOutputChunkSubTypeSchema:()=>xn,ToolResultEventSchema:()=>kn,ToolUsePreviewStartEventSchema:()=>An,ToolUseStartEventSchema:()=>jn,UISurfaceCompleteEventSchema:()=>Mn,UISurfaceDismissEventSchema:()=>Nn,UISurfaceShowEventSchema:()=>Fn,UISurfaceUndoResultEventSchema:()=>In,UISurfaceUpdateEventSchema:()=>Ln,UsageProgressEventSchema:()=>k,UsageUpdateEventSchema:()=>Rn,UserMessageEchoEventSchema:()=>zn,WebFetchMetadataSchema:()=>On,WebSearchMetadataSchema:()=>Dn,WebSearchProviderIdSchema:()=>wn,WebSearchResultItemSchema:()=>En,WorkResultDiffSchema:()=>gi,WorkResultItemSchema:()=>hi,WorkResultMetadataSchema:()=>mi,WorkResultMetricSchema:()=>pi,WorkResultSectionSchema:()=>_i,WorkResultSectionTypeSchema:()=>di,WorkResultStatusSchema:()=>ui,WorkResultSurfaceDataSchema:()=>vi,WorkResultToneSchema:()=>Z,WorkflowCompletedEventSchema:()=>Bn,WorkflowJournalResponseSchema:()=>Zr,WorkflowLeafFinishedEventSchema:()=>Vn,WorkflowLeafSchema:()=>Xr,WorkflowLeafStartedEventSchema:()=>Hn,WorkflowProgressEventSchema:()=>Un,WorkflowRunStatusSchema:()=>A,WorkflowStartedEventSchema:()=>Wn,coerceSurfaceDataRecord:()=>Qr,isDaemonInternalSurfaceType:()=>Si,normalizeCopyBlockShowData:()=>ei}),$=r(`type`,[se,ce,le,de,fe,pe,_e,ve,ye,be,xe,Se,Ce,we,Ee,De,Oe,ke,Ae,je,v,y,Fe,Ie,Le,Re,ze,Ve,Ue,We,qe,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,ct,gt,ht,vt,_t,bt,yt,St,xt,wt,Ct,Et,Tt,kt,Ot,At,Mt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,rn,an,tn,nn,on,sn,cn,ln,un,dn,fn,pn,mn,gn,_n,vn,yn,bn,Sn,kn,An,jn,Mn,Nn,Fn,In,Ln,k,Rn,zn,Bn,Vn,Hn,Un,Wn]),Ei=n({id:i(),conversationId:i().optional(),seq:l().int().optional(),emittedAt:i(),message:$});export{Kn as _,W as a,E as b,V as c,G as d,Y as f,qn as g,gr as h,B as i,q as l,Yr as m,$ as n,X as o,Zr as p,Ti as r,H as s,Ei as t,J as u,Gn as v,k as y};
@@ -1 +1 @@
1
- import{c as e,ct as t,et as n,o as r}from"./local-mode-Ckii2tmN.js";import{h as i}from"./api-CJFoPWHm.js";import{At as a,_ as o,ht as s,mt as c,v as l,y as u}from"./sdk.gen-BVAVE6A_.js";import{a as d,n as f}from"./api-errors-CFiCT7Ap.js";import{B as p,T as m,V as h,a as g,i as _,o as v,w as y,z as b}from"./sdk.gen-BIu1DgTs.js";async function x(e,t){let{data:n,error:r,response:i}=await y({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return f(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:d(r,i)}}async function S(n){if(t()){let t=n?r(n):e();if(t)return{ok:!0,status:200,data:{id:t.assistantId,name:t.name??t.assistantId,status:`active`,is_local:!0,created:t.hatchedAt??``}}}if(n){let{data:e,error:t,response:r}=await h({path:{id:n},throwOnError:!1});return f(r,t,`Failed to get assistant.`),r.ok?{ok:!0,status:r.status,data:e}:{ok:!1,status:r.status,error:d(t,r)}}let i=await m({query:{hosting:`platform`},throwOnError:!1});if(f(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:d(i.error,i.response)};let a=i.data?.results??[];if(a.length>0)return{ok:!0,status:i.response.status,data:a[0]};let o=await m({query:{hosting:`local`},throwOnError:!1});if(f(o.response,o.error,`Failed to get assistant.`),o.response.ok){let e=o.data?.results??[];if(e.length>0)return{ok:!0,status:o.response.status,data:e[0]}}return o.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:o.response.status,error:d(o.error,o.response)}}async function C(e){let{data:t,error:n,response:r}=await a({path:{assistant_id:e},throwOnError:!1});return f(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:d(n,r)}}async function w(e){let{data:t,error:n,response:r}=await s({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}async function T(e){let{data:t,error:n,response:r}=await c({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let t=!n(),[r,i]=await Promise.all([l({path:{assistant_id:e},throwOnError:!1}),t?v({path:{assistant_id:e},throwOnError:!1}):null]);if(f(r.response,r.error,`Failed to list assistant backups.`),!r.response.ok)return{ok:!1,status:r.response.status,error:d(r.error,r.response)};let a=E(r.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:r.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:d(i.error,i.response)}}return{ok:!0,status:r.response.status,data:a}}async function k(e){let{data:t,error:r,response:i}=n()?await o({path:{assistant_id:e},throwOnError:!1}):await _({path:{assistant_id:e},throwOnError:!1});if(f(i,r,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:d(r,i)}}async function A(e,t){let{data:r,error:i,response:a}=n()?await u({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await g({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(f(a,i,`Failed to restore assistant backup.`),a.ok){let e=r&&typeof r==`object`&&!Array.isArray(r)?r:{};return{ok:!0,status:a.status,data:e}}return{ok:!1,status:a.status,error:d(i,a)}}async function j(e){let{data:t,error:n,response:r}=await b({path:{id:e},throwOnError:!1});return f(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:d(n,r)}}async function M(e){let{error:t,response:n}=await p({path:{id:e},throwOnError:!1});return f(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:d(t,n)}}async function N(){let{data:e,error:t,response:n}=await m({query:{hosting:`all`},throwOnError:!1});return f(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:d(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};
1
+ import{c as e,lt as t,o as n,tt as r}from"./local-mode-BTovbt13.js";import{h as i}from"./api-C3QSs67k.js";import{At as a,_ as o,ht as s,mt as c,v as l,y as u}from"./sdk.gen-BHZ0fJla.js";import{a as d,n as f}from"./api-errors-CFiCT7Ap.js";import{B as p,T as m,V as h,a as g,i as _,o as v,w as y,z as b}from"./sdk.gen-BIu1DgTs.js";async function x(e,t){let{data:n,error:r,response:i}=await y({body:e??{},query:t?{mode:t}:void 0,throwOnError:!1});return f(i,r,`Failed to hatch assistant.`),i.ok?{ok:!0,status:i.status,data:n}:{ok:!1,status:i.status,error:d(r,i)}}async function S(r){if(t()){let t=r?n(r):e();if(t)return{ok:!0,status:200,data:{id:t.assistantId,name:t.name??t.assistantId,status:`active`,is_local:!0,created:t.hatchedAt??``}}}if(r){let{data:e,error:t,response:n}=await h({path:{id:r},throwOnError:!1});return f(n,t,`Failed to get assistant.`),n.ok?{ok:!0,status:n.status,data:e}:{ok:!1,status:n.status,error:d(t,n)}}let i=await m({query:{hosting:`platform`},throwOnError:!1});if(f(i.response,i.error,`Failed to get assistant.`),!i.response.ok)return{ok:!1,status:i.response.status,error:d(i.error,i.response)};let a=i.data?.results??[];if(a.length>0)return{ok:!0,status:i.response.status,data:a[0]};let o=await m({query:{hosting:`local`},throwOnError:!1});if(f(o.response,o.error,`Failed to get assistant.`),o.response.ok){let e=o.data?.results??[];if(e.length>0)return{ok:!0,status:o.response.status,data:e[0]}}return o.response.ok?{ok:!1,status:404,error:{detail:`No assistants found`}}:{ok:!1,status:o.response.status,error:d(o.error,o.response)}}async function C(e){let{data:t,error:n,response:r}=await a({path:{assistant_id:e},throwOnError:!1});return f(r,n,`Failed to get assistant healthz.`),r.ok&&t?{ok:!0,status:r.status,data:t}:{ok:!1,status:r.status,error:d(n,r)}}async function w(e){let{data:t,error:n,response:r}=await s({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to get assistant disk pressure status.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}async function T(e){let{data:t,error:n,response:r}=await c({path:{assistant_id:e},throwOnError:!1});if(f(r,n,`Failed to acknowledge assistant disk pressure.`),r.ok){let e=i.safeParse(t);return e.success?{ok:!0,status:r.status,data:e.data}:{ok:!1,status:r.status,error:d(e.error.message,r)}}return{ok:!1,status:r.status,error:d(n,r)}}function E(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};if(Array.isArray(t.backups))return t.backups;let n=t,r=[],i=n.local?.snapshots;if(Array.isArray(i))for(let e of i)r.push({snapshot_name:e.filename,pvc:``,created_at:e.created_at,ready_to_use:!0,backup_type:`scheduled`,path:e.path});if(Array.isArray(n.offsite)){for(let e of n.offsite)if(Array.isArray(e.snapshots))for(let t of e.snapshots)r.push({snapshot_name:t.filename,pvc:``,created_at:t.created_at,ready_to_use:!t.encrypted,backup_type:`scheduled`,path:t.path})}return r}function D(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{};return Array.isArray(t.backups)?t.backups:[]}async function O(e){let t=!r(),[n,i]=await Promise.all([l({path:{assistant_id:e},throwOnError:!1}),t?v({path:{assistant_id:e},throwOnError:!1}):null]);if(f(n.response,n.error,`Failed to list assistant backups.`),!n.response.ok)return{ok:!1,status:n.response.status,error:d(n.error,n.response)};let a=E(n.data);if(i){if(i.response?.ok){let e=D(i.data);return{ok:!0,status:n.response.status,data:[...e,...a]}}if(a.length===0&&i.response)return{ok:!1,status:i.response.status,error:d(i.error,i.response)}}return{ok:!0,status:n.response.status,data:a}}async function k(e){let{data:t,error:n,response:i}=r()?await o({path:{assistant_id:e},throwOnError:!1}):await _({path:{assistant_id:e},throwOnError:!1});if(f(i,n,`Failed to create assistant backup.`),i.ok){let e=t&&typeof t==`object`&&!Array.isArray(t)?t:{};return{ok:!0,status:i.status,data:e}}return{ok:!1,status:i.status,error:d(n,i)}}async function A(e,t){let{data:n,error:i,response:a}=r()?await u({path:{assistant_id:e},body:{path:t.path??t.snapshot_name},throwOnError:!1}):await g({path:{assistant_id:e,snapshot_name:t.snapshot_name},throwOnError:!1});if(f(a,i,`Failed to restore assistant backup.`),a.ok){let e=n&&typeof n==`object`&&!Array.isArray(n)?n:{};return{ok:!0,status:a.status,data:e}}return{ok:!1,status:a.status,error:d(i,a)}}async function j(e){let{data:t,error:n,response:r}=await b({path:{id:e},throwOnError:!1});return f(r,n,`Failed to restart assistant.`),r.ok?{ok:!0,data:t&&typeof t==`object`&&!Array.isArray(t)?t:{}}:{ok:!1,status:r.status,error:d(n,r)}}async function M(e){let{error:t,response:n}=await p({path:{id:e},throwOnError:!1});return f(n,t,`Failed to retire assistant.`),n.ok?{ok:!0}:{ok:!1,status:n.status,error:d(t,n)}}async function N(){let{data:e,error:t,response:n}=await m({query:{hosting:`all`},throwOnError:!1});return f(n,t,`Failed to list assistants.`),n.ok?{ok:!0,status:n.status,data:e?.results??[]}:{ok:!1,status:n.status,error:d(t,n)}}export{C as a,N as c,M as d,w as i,j as l,k as n,x as o,S as r,O as s,T as t,A as u};