@vellumai/web 0.10.11-dev.202607221933.baa2119 → 0.10.11-dev.202607222129.31c06e5

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 (232) hide show
  1. package/dist/assets/{AnimatePresence-C8APSgIu.js → AnimatePresence-C42g9zWi.js} +3 -3
  2. package/dist/assets/{BundleConfirmPage-DNYvq-iC.js → BundleConfirmPage-3mylM4ZL.js} +1 -1
  3. package/dist/assets/{Combination-CRZ7Bg3f.js → Combination-DXrVEfaA.js} +1 -1
  4. package/dist/assets/{about-page-XGv9RAQu.js → about-page-CDdCEGZl.js} +1 -1
  5. package/dist/assets/{account-page-BTuXazxB.js → account-page-CzZuoekz.js} +1 -1
  6. package/dist/assets/{account-shell-CGkhTBfc.js → account-shell-Bw5tLjak.js} +1 -1
  7. package/dist/assets/{acp-run-detail-panel-MmrH2dwd.js → acp-run-detail-panel-DssICbn8.js} +4 -4
  8. package/dist/assets/{activity-steps-panel-CTrABRV1.js → activity-steps-panel-CeLVlAeY.js} +1 -1
  9. package/dist/assets/{add-credits-modal-F52jjB45.js → add-credits-modal-BFTdUmH6.js} +1 -1
  10. package/dist/assets/ai-page-ukSnDSJr.js +1 -0
  11. package/dist/assets/{animated-avatar-D36iTfMF.js → animated-avatar-6bSYRHZr.js} +1 -1
  12. package/dist/assets/{api-DkdVwOxT.js → api-CxAtNZ-r.js} +1 -1
  13. package/dist/assets/api-DqHVnn1b.js +1 -0
  14. package/dist/assets/{api-key-screen-Cr6tOl8S.js → api-key-screen-DD_TJKco.js} +1 -1
  15. package/dist/assets/{assistant-feature-flag-store-DuuDCLuS.js → assistant-feature-flag-store-Bh-_qc7v.js} +1 -1
  16. package/dist/assets/{assistant-status-panel-BhJkFBTi.js → assistant-status-panel-gpwr0glD.js} +1 -1
  17. package/dist/assets/auth-store-Lzg3kiaw.js +2 -0
  18. package/dist/assets/{background-task-detail-panel-_Bw4wSRH.js → background-task-detail-panel-BCXH3MXV.js} +1 -1
  19. package/dist/assets/billing-page-BZwgqWS1.js +3 -0
  20. package/dist/assets/{bookmarks-page-BhNbOYSg.js → bookmarks-page-B-PbfvFN.js} +1 -1
  21. package/dist/assets/{browser-CUpmd8oz.js → browser-Cvy3lr__.js} +2 -2
  22. package/dist/assets/{build-state-IyDyesd2.js → build-state-Bo2Ut5Js.js} +1 -1
  23. package/dist/assets/button-CW7wKp2r.js +1 -0
  24. package/dist/assets/{card-D8zyWtZh.js → card-Cf8bWrcq.js} +1 -1
  25. package/dist/assets/{channels-page-route-Ca1iWSkL.js → channels-page-route-DEwl411M.js} +2 -2
  26. package/dist/assets/chat-CNlH625o.js +1 -0
  27. package/dist/assets/chat-markdown-message-CjK8FRpm.js +2 -0
  28. package/dist/assets/{checkbox-1DytZ46G.js → checkbox-D5aqx2QZ.js} +1 -1
  29. package/dist/assets/{client-feature-flag-store-BI4z6UOY.js → client-feature-flag-store-BOcAh56y.js} +1 -1
  30. package/dist/assets/{command-palette-C18hRHXB.js → command-palette-DNujIsf0.js} +1 -1
  31. package/dist/assets/{command-palette-window-page-Bs7nyUOe.js → command-palette-window-page-mWNMMe4I.js} +1 -1
  32. package/dist/assets/{community-page-Bf7YWY7S.js → community-page-DEcDCjsQ.js} +1 -1
  33. package/dist/assets/{confirm-dialog-Zyfei9GV.js → confirm-dialog-DxBl6zcI.js} +1 -1
  34. package/dist/assets/{connect-page-BPS-ZbTc.js → connect-page-DuBhY8KD.js} +1 -1
  35. package/dist/assets/{consent-controls-a3lLNrbR.js → consent-controls-HYKKj225.js} +1 -1
  36. package/dist/assets/contacts-page-route-BS2duMoh.js +1 -0
  37. package/dist/assets/{credential-entry-page-Bo9MyWJX.js → credential-entry-page-CVOU9a8m.js} +1 -1
  38. package/dist/assets/{credentials-page-DZTud37s.js → credentials-page-DDgYexAA.js} +1 -1
  39. package/dist/assets/{debug-page-CXd4HoJ7.js → debug-page-B_us491I.js} +3 -3
  40. package/dist/assets/{deploy-dialogs-B2KiWrEe.js → deploy-dialogs-CB5PSyxZ.js} +1 -1
  41. package/dist/assets/{detail-card-BXVPDa5J.js → detail-card-CAHT277C.js} +1 -1
  42. package/dist/assets/{detail-panel-stop-button-ChKf-46C.js → detail-panel-stop-button-26G26Tqs.js} +1 -1
  43. package/dist/assets/developer-page-Dqug_k0U.js +1 -0
  44. package/dist/assets/{dictation-overlay-page-CZRUD9qJ.js → dictation-overlay-page-Rz3bqW3f.js} +1 -1
  45. package/dist/assets/{dist-Krx5xY9z.js → dist-B_4-HXSm.js} +1 -1
  46. package/dist/assets/{dist-y8XVYHzD.js → dist-D7fbUVVD.js} +1 -1
  47. package/dist/assets/{dist-CO5a5--H.js → dist-V7BKcICH.js} +1 -1
  48. package/dist/assets/{dist-Cul7ysiV.js → dist-kYT5dDAe.js} +1 -1
  49. package/dist/assets/{document-viewer-page-cHXNfErr.js → document-viewer-page-DmHPShuz.js} +1 -1
  50. package/dist/assets/{dropdown-BxYrCXBS.js → dropdown-DQozlhbb.js} +1 -1
  51. package/dist/assets/{emails-page-DgmWq23T.js → emails-page-s9TxP6jP.js} +1 -1
  52. package/dist/assets/{esm-CtFJECNT.js → esm-BGZHdoYP.js} +2 -2
  53. package/dist/assets/{esm-BvREcXsb.js → esm-CZhfXk6a.js} +2 -2
  54. package/dist/assets/{esm-CABHbixu.js → esm-Da6ZHZYd.js} +2 -2
  55. package/dist/assets/{esm-u9ag4ek2.js → esm-DcTPJLRl.js} +2 -2
  56. package/dist/assets/esm-LOX7qY3n.js +2 -0
  57. package/dist/assets/{esm-Dy0d6BZB.js → esm-hFTNI1fw.js} +2 -2
  58. package/dist/assets/feature-flag-catalog-W5kYlNH2.js +1 -0
  59. package/dist/assets/{file-editor-CmUOlTjl.js → file-editor-BdFicqX_.js} +1 -1
  60. package/dist/assets/{file-markdown-BXMDJYDD.js → file-markdown-BCMtcYze.js} +1 -1
  61. package/dist/assets/{general-page-BVWKFUsd.js → general-page-DsrG3cM2.js} +1 -1
  62. package/dist/assets/{haptics-CXVXviY1.js → haptics-ThOnpgA-.js} +2 -2
  63. package/dist/assets/{hatching-screen-DPCeV75d.js → hatching-screen-CuzULcU_.js} +1 -1
  64. package/dist/assets/home-page-route-Cc3ksf3X.js +1 -0
  65. package/dist/assets/{hosting-screen-Cb6yCWrz.js → hosting-screen-DufVMlwF.js} +1 -1
  66. package/dist/assets/identity-page-route-CUrEsO_0.js +7 -0
  67. package/dist/assets/index-BRSW3eiH.css +2 -0
  68. package/dist/assets/index-C7ix_asE.js +217 -0
  69. package/dist/assets/{input-ZpyYt_a0.js → input-D3MhHg0d.js} +1 -1
  70. package/dist/assets/{inspect-page-DMtLyfeS.js → inspect-page-BUAbv6xj.js} +4 -4
  71. package/dist/assets/{integrations-page-CB4Tc_d1.js → integrations-page-9JcrAORp.js} +1 -1
  72. package/dist/assets/{intelligence-layout-CxxCLiFO.js → intelligence-layout-DJjUScCy.js} +1 -1
  73. package/dist/assets/{library-detail-page-IhOT4Jph.js → library-detail-page-BCAZmbR6.js} +1 -1
  74. package/dist/assets/{library-page-BpHOV3jv.js → library-page-CiTHHvZ5.js} +1 -1
  75. package/dist/assets/{list-row-CFyYr-FU.js → list-row-CVw67M2Z.js} +1 -1
  76. package/dist/assets/{login-flow-xM94yfZy.js → login-flow-DYrO-od6.js} +1 -1
  77. package/dist/assets/{login-page-hM0g8LFI.js → login-page-DAFzFbRp.js} +1 -1
  78. package/dist/assets/{logout-page-CNz1LTSY.js → logout-page-CsPkQ-4I.js} +1 -1
  79. package/dist/assets/{logs-layout-DioKpdeF.js → logs-layout-DBJaWlOK.js} +1 -1
  80. package/dist/assets/memory-page-route-CpPfBU9j.js +2 -0
  81. package/dist/assets/{memory-router-playground-page-BCfQ2zWi.js → memory-router-playground-page-DfGhXcZW.js} +1 -1
  82. package/dist/assets/{menu-C9SOvGlk.js → menu-DSB0wFjY.js} +1 -1
  83. package/dist/assets/{metric-card-DDHse5we.js → metric-card-TrndloL3.js} +1 -1
  84. package/dist/assets/{misc-D0u5tzSd.js → misc-BMp6WHdm.js} +1 -1
  85. package/dist/assets/{mobile-sidebar-drawer-D9v0PpYI.js → mobile-sidebar-drawer-CVT3O8os.js} +1 -1
  86. package/dist/assets/{modal-BtcwNEBj.js → modal-D_Y2RPD5.js} +1 -1
  87. package/dist/assets/mutation-error-CSy2D6ry.js +1 -0
  88. package/dist/assets/native-anchor-ChGbTnsU.js +1 -0
  89. package/dist/assets/{native-file-CIQQYbIp.js → native-file-CKFw72Il.js} +2 -2
  90. package/dist/assets/{notice-DkAWz47A.js → notice-CvJ7MBx5.js} +1 -1
  91. package/dist/assets/{notifications-page-BS2GmBjD.js → notifications-page-DcHyVoSk.js} +1 -1
  92. package/dist/assets/{oauth-complete-page-mxqE6rCA.js → oauth-complete-page-DjKBNbdN.js} +1 -1
  93. package/dist/assets/{oauth-popup-complete-page-Cpf2kPNU.js → oauth-popup-complete-page-2KKVC5zM.js} +1 -1
  94. package/dist/assets/{page-empty-state-Co5e7lOF.js → page-empty-state-DhwyXbFT.js} +1 -1
  95. package/dist/assets/{page-shell-CAoXXReY.js → page-shell-BUD21prh.js} +1 -1
  96. package/dist/assets/{pairing-page-DNPxREzR.js → pairing-page-7NMcVDJj.js} +1 -1
  97. package/dist/assets/{panel-item-An-BBeyL.js → panel-item-D1WbMkez.js} +1 -1
  98. package/dist/assets/{personality-page-Ce_Qm2cp.js → personality-page-CwaMBzXV.js} +1 -1
  99. package/dist/assets/plans-page-Cre3Gpys.js +1 -0
  100. package/dist/assets/{platform-loopback-page-DRElW55V.js → platform-loopback-page-CIcVs3UP.js} +1 -1
  101. package/dist/assets/{plugin-detail-page-DAlLoybE.js → plugin-detail-page-R7HOcOd1.js} +1 -1
  102. package/dist/assets/{popover-Bl6742nZ.js → popover-BglbovUA.js} +1 -1
  103. package/dist/assets/privacy-page-CTQpOjs-.js +1 -0
  104. package/dist/assets/{privacy-screen-C05Qf8-3.js → privacy-screen-DgHmBdN-.js} +1 -1
  105. package/dist/assets/{progress-bar-Bqv7D4mZ.js → progress-bar-DrwFU9Ti.js} +1 -1
  106. package/dist/assets/{provider-callback-page-7lCx-5li.js → provider-callback-page-kcYxB4WF.js} +1 -1
  107. package/dist/assets/{provider-signup-page-BMAi3lou.js → provider-signup-page-D9aI4WFt.js} +1 -1
  108. package/dist/assets/{proxy-BzlH_XAe.js → proxy-DoUA9mK6.js} +1 -1
  109. package/dist/assets/{quick-input-page-LVkv3KP4.js → quick-input-page-D2Bqa3St.js} +1 -1
  110. package/dist/assets/{research-mock-page-7srDoNvK.js → research-mock-page-C6zrZtBI.js} +1 -1
  111. package/dist/assets/research-onboarding-route-AYDHEowO.js +43 -0
  112. package/dist/assets/{review-terms-screen-Dsntd0nU.js → review-terms-screen-BSa9jNvG.js} +1 -1
  113. package/dist/assets/{risk-DIRsQZCZ.js → risk-C-ZyBTAb.js} +1 -1
  114. package/dist/assets/{schedules-page-ANwXBbHw.js → schedules-page-gqD1Tbf8.js} +1 -1
  115. package/dist/assets/{select-assistant-screen-Byptt05K.js → select-assistant-screen-CFvCmydl.js} +1 -1
  116. package/dist/assets/{setting-row-BL-mNsNh.js → setting-row-DbMFAasE.js} +1 -1
  117. package/dist/assets/settings-divider-RhnS0iml.js +1 -0
  118. package/dist/assets/{settings-layout-Cm34rPj8.js → settings-layout-XYxLMpW0.js} +1 -1
  119. package/dist/assets/share-feedback-modal-Bjh3dK-n.js +1 -0
  120. package/dist/assets/{shared-ui-BQzVwlXn.js → shared-ui-CUd8SsYi.js} +1 -1
  121. package/dist/assets/{sidebar-tree-DrzE0Jyv.js → sidebar-tree-CDqUGPSK.js} +1 -1
  122. package/dist/assets/{signup-page-CCUuskkM.js → signup-page-DgYRwrxX.js} +1 -1
  123. package/dist/assets/{signup-shell-C--ZjbjA.js → signup-shell-BXZMEgBY.js} +1 -1
  124. package/dist/assets/{site-favicon-DewrgH-a.js → site-favicon-DHBOONR1.js} +1 -1
  125. package/dist/assets/{skill-detail-page-D_PcInrM.js → skill-detail-page-Dnh8ep5N.js} +1 -1
  126. package/dist/assets/{skill-detail-panel-QoaxPpCX.js → skill-detail-panel-DIn7RLCC.js} +1 -1
  127. package/dist/assets/{skills-C7LCNEFA.js → skills-BFnEzvAC.js} +1 -1
  128. package/dist/assets/{src-BNYQ8guL.js → src-BT0gNVcT.js} +2 -2
  129. package/dist/assets/{start-screen-BWJii2no.js → start-screen-CJb-0lgs.js} +1 -1
  130. package/dist/assets/{subagent-detail-panel-BsPcIQ85.js → subagent-detail-panel-V44LtNl6.js} +1 -1
  131. package/dist/assets/{subagent-store-Dr3FrKiG.js → subagent-store-CPEG25fH.js} +1 -1
  132. package/dist/assets/superpowers-page-X0kSM_TF.js +1 -0
  133. package/dist/assets/{system-events-page-BARlmsdY.js → system-events-page-Duos2ubJ.js} +1 -1
  134. package/dist/assets/{tag-B6WeUtBW.js → tag-CJyI1Y2J.js} +1 -1
  135. package/dist/assets/{theme-stage-page-eXVxLFfi.js → theme-stage-page-BU-Gj4c2.js} +1 -1
  136. package/dist/assets/tier-upgrade-resize-modal-CbRtJhAf.js +1 -0
  137. package/dist/assets/{tiptap-document-editor-CM8rLP9w.js → tiptap-document-editor-D1aVS6nK.js} +2 -2
  138. package/dist/assets/{toast-Be8FEQ-I.js → toast-zHo1wvF9.js} +1 -1
  139. package/dist/assets/{toggle-QSEiPr3k.js → toggle-Ca1aoG-l.js} +1 -1
  140. package/dist/assets/{tool-detail-panel-BLLGFD3k.js → tool-detail-panel-C-O4opDs.js} +1 -1
  141. package/dist/assets/typography-1kyF_Eu1.js +1 -0
  142. package/dist/assets/{upgrade-cancel-page-BN873SsM.js → upgrade-cancel-page-UaVSwAVr.js} +1 -1
  143. package/dist/assets/{upgrade-success-page-DhPly3fp.js → upgrade-success-page-CBs03tVb.js} +1 -1
  144. package/dist/assets/{use-assistant-identity-details-D2HgphdP.js → use-assistant-identity-details-CKel0e_r.js} +1 -1
  145. package/dist/assets/{use-edge-swipe-back-DDRGGiWx.js → use-edge-swipe-back-Dv1ShCT7.js} +1 -1
  146. package/dist/assets/use-invite-link-dialog-BfVPh6F5.js +1 -0
  147. package/dist/assets/use-is-org-ready-Ba5vxuqM.js +1 -0
  148. package/dist/assets/{use-onboarding-login-DxALcEIP.js → use-onboarding-login-DMLLDHRX.js} +1 -1
  149. package/dist/assets/{use-reduced-motion-CcGT6CHV.js → use-reduced-motion-DpK6cQN-.js} +1 -1
  150. package/dist/assets/{use-skill-actions-_fTnRmQu.js → use-skill-actions-DPXX5qWL.js} +1 -1
  151. package/dist/assets/{use-skill-detail-files-DSYS5cni.js → use-skill-detail-files-CuoCiyOy.js} +1 -1
  152. package/dist/assets/voice-page-DdjI8A76.js +1 -0
  153. package/dist/assets/{weather-forecast-display-CuVMLDZg.js → weather-forecast-display-0GtxW555.js} +1 -1
  154. package/dist/assets/{web-C_RyjuPn.js → web-BgxqKmFT.js} +1 -1
  155. package/dist/assets/{web-D1Wdlc7e.js → web-TTULY5zV.js} +1 -1
  156. package/dist/assets/{welcome-screen-BsESWnlC.js → welcome-screen-DZhajJW3.js} +1 -1
  157. package/dist/assets/{workflow-detail-panel-Di6HXfLP.js → workflow-detail-panel-Cw0kRLTK.js} +1 -1
  158. package/dist/assets/workspace-page-7j1DZUlp.js +1 -0
  159. package/dist/index.html +52 -51
  160. package/package.json +1 -1
  161. package/dist/assets/ai-page-Cnqe_MF7.js +0 -1
  162. package/dist/assets/api-zOKpkRT4.js +0 -1
  163. package/dist/assets/auth-store-yYPy4QuG.js +0 -2
  164. package/dist/assets/billing-page-GwV110rl.js +0 -3
  165. package/dist/assets/button-BQVYX8n_.js +0 -1
  166. package/dist/assets/chat-BDhsGoUo.js +0 -1
  167. package/dist/assets/chat-markdown-message-DdvPHLTI.js +0 -2
  168. package/dist/assets/contacts-page-route-DvE4cWB1.js +0 -1
  169. package/dist/assets/developer-page-DuGuTkuS.js +0 -1
  170. package/dist/assets/esm-B-GaVjH1.js +0 -2
  171. package/dist/assets/feature-flag-catalog-XCUDf5iL.js +0 -1
  172. package/dist/assets/home-page-route-GRWsjnoO.js +0 -1
  173. package/dist/assets/identity-page-route-Cekp7lb1.js +0 -7
  174. package/dist/assets/index-CtMfDVgi.css +0 -2
  175. package/dist/assets/index-D5iUyXUl.js +0 -217
  176. package/dist/assets/memory-page-route-BChNkOHd.js +0 -2
  177. package/dist/assets/mutation-error-C9sr8Rue.js +0 -1
  178. package/dist/assets/plans-page-CyFzFPMf.js +0 -1
  179. package/dist/assets/privacy-page-CKLXEI25.js +0 -1
  180. package/dist/assets/research-onboarding-route-B4MdewsW.js +0 -43
  181. package/dist/assets/settings-divider-jsYVGphg.js +0 -1
  182. package/dist/assets/share-feedback-modal-Do56cx6v.js +0 -1
  183. package/dist/assets/superpowers-page-DttFOVF5.js +0 -1
  184. package/dist/assets/tier-upgrade-resize-modal-BTi56abH.js +0 -1
  185. package/dist/assets/typography-Cqi8q9o7.js +0 -1
  186. package/dist/assets/use-invite-link-dialog-B7jUrCaY.js +0 -1
  187. package/dist/assets/use-is-org-ready-CoKP2L8w.js +0 -1
  188. package/dist/assets/voice-page-D5c_WgX8.js +0 -1
  189. package/dist/assets/workspace-page-BAX94prH.js +0 -1
  190. /package/dist/assets/{a2a-invite-VS3p3CfD.js → a2a-invite-sGxHSsPS.js} +0 -0
  191. /package/dist/assets/{app-info-Clwt3pCt.js → app-info-DDWMarAq.js} +0 -0
  192. /package/dist/assets/{app-types-XM5qKBD0.js → app-types-CR9QB0-8.js} +0 -0
  193. /package/dist/assets/{archive-redirect-page-Brvq3ES5.js → archive-redirect-page-emWqj2aZ.js} +0 -0
  194. /package/dist/assets/{billing-redirect-page-B3C0OqCH.js → billing-redirect-page-BFcz_1bP.js} +0 -0
  195. /package/dist/assets/{build.umd-Cygy7skA.js → build.umd-CW7LiBLq.js} +0 -0
  196. /package/dist/assets/{contacts-gateway-C1Oif2mf.js → contacts-gateway-C1Yhfk72.js} +0 -0
  197. /package/dist/assets/{danger-zone-redirect-page-DjzXSO6Q.js → danger-zone-redirect-page-CKqC2kf5.js} +0 -0
  198. /package/dist/assets/{definitions-yU7UnVpH.js → definitions-BUCExH-9.js} +0 -0
  199. /package/dist/assets/{definitions-BEx8SBhF.js → definitions-DpZNNWA7.js} +0 -0
  200. /package/dist/assets/{devices-redirect-page-aDimdAFs.js → devices-redirect-page-BBmdT-cM.js} +0 -0
  201. /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-Do3FUA8t.js} +0 -0
  202. /package/dist/assets/{environment-store-R_3zZFKL.js → environment-store-geigPfHz.js} +0 -0
  203. /package/dist/assets/{esm-BhZb3XhL.js → esm-BNfE-1QY.js} +0 -0
  204. /package/dist/assets/{format-file-size-BSrdQr7P.js → format-file-size-B9DWgk-8.js} +0 -0
  205. /package/dist/assets/{get-memory-stats-KWGzIlTp.js → get-memory-stats-CswQQLY0.js} +0 -0
  206. /package/dist/assets/{keyboard-shortcuts-redirect-page-Cwga2alP.js → keyboard-shortcuts-redirect-page-BlXA_79i.js} +0 -0
  207. /package/dist/assets/{latest-assistant-text-BKts4hYK.js → latest-assistant-text-CQ8YGbvQ.js} +0 -0
  208. /package/dist/assets/{link-click-Cw5JZikw.js → link-click-B_ZqHynd.js} +0 -0
  209. /package/dist/assets/{onboarding-step-layout-2XcmxqFN.js → onboarding-step-layout-CEt9JOpN.js} +0 -0
  210. /package/dist/assets/{password-reset-page-BJ68aXQ5.js → password-reset-page-DzLdCWhJ.js} +0 -0
  211. /package/dist/assets/{pdf-aq5Mn3GZ.js → pdf-BFBTGjwO.js} +0 -0
  212. /package/dist/assets/{plugin-attribution-6W3_ulYk.js → plugin-attribution-meUNq3wV.js} +0 -0
  213. /package/dist/assets/{plugins-page-DbqKT2CS.js → plugins-page-CeEkVNFM.js} +0 -0
  214. /package/dist/assets/{profile-metadata-CMym5q9r.js → profile-metadata-C6i7Ro9a.js} +0 -0
  215. /package/dist/assets/{provider-key-ACM9xzKs.js → provider-key-BPINSkGG.js} +0 -0
  216. /package/dist/assets/{schedules-CqDlgP0M.js → schedules-CL3Ox7Jc.js} +0 -0
  217. /package/dist/assets/{security-redirect-page-x1aDP81r.js → security-redirect-page-DYh8CKKb.js} +0 -0
  218. /package/dist/assets/{skills-page-bdypLibR.js → skills-page-CX46pcIo.js} +0 -0
  219. /package/dist/assets/{sounds-redirect-page-Blt0vV_7.js → sounds-redirect-page-DfVvXEAS.js} +0 -0
  220. /package/dist/assets/{status-badge-pill-0N6rTEBg.js → status-badge-pill-j3ke1d9o.js} +0 -0
  221. /package/dist/assets/{system-events-redirect-page-CMriM4T-.js → system-events-redirect-page-BHASNLky.js} +0 -0
  222. /package/dist/assets/{three-dot-indicator-CwchtNVS.js → three-dot-indicator-BuZzHFUJ.js} +0 -0
  223. /package/dist/assets/{usage-redirect-page-CYLunqbd.js → usage-redirect-page-1zbr09t0.js} +0 -0
  224. /package/dist/assets/{use-copy-to-clipboard-D3nUm_6n.js → use-copy-to-clipboard-Ap1ESW2j.js} +0 -0
  225. /package/dist/assets/{web-DwtkFwhF.js → web-Cfu1-OYV.js} +0 -0
  226. /package/dist/assets/{web-DE01jWtm.js → web-CpMgd0X0.js} +0 -0
  227. /package/dist/assets/{web-D2t1-p2V.js → web-D5EBYCt2.js} +0 -0
  228. /package/dist/assets/{web-DNkvgjT6.js → web-DT7Uml3n.js} +0 -0
  229. /package/dist/assets/{web-DK4RzUrM.js → web-D_z4FjB0.js} +0 -0
  230. /package/dist/assets/{web-DoV8m3zw.js → web-F3CAps0-.js} +0 -0
  231. /package/dist/assets/{xterm-DUb6-aPw.js → xterm-BSc05cUt.js} +0 -0
  232. /package/dist/assets/{xterm-addon-fit-D82wciIP.js → xterm-addon-fit-CW_qH798.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./local-settings-C-dW2vkq.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i,z as a}from"./button-BQVYX8n_.js";import{l as o,m as s,u as c}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./card-D8zyWtZh.js";import{t as m}from"./createLucideIcon-Bjb-Kuq7.js";import{t as h}from"./arrow-left-C2re-gYj.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as ee}from"./use-skill-actions-_fTnRmQu.js";import{t as S}from"./brain-Ci5ws6Wl.js";import{n as C,t as w}from"./settings-wSv59mkN.js";import{t as T}from"./check-wF3S-AV4.js";import{n as E,t as D}from"./panel-item-An-BBeyL.js";import{t as O}from"./cloud-off-DT0KnUQ4.js";import{t as te}from"./code-B_ruRFrX.js";import{t as ne}from"./download-B6XjnEzx.js";import{t as re}from"./external-link-Cczz6xJ4.js";import{t as ie}from"./globe-DgKSh933.js";import{t as k}from"./hard-drive-DVmyHlZR.js";import{t as A}from"./link-2-B9c5ZsFq.js";import{t as j}from"./loader-circle-Ck8fq3yv.js";import{t as M}from"./mic-DEmgi4rh.js";import{t as ae}from"./puzzle-C894zd87.js";import{t as oe}from"./sparkles-BK3KXCjl.js";import{t as se}from"./triangle-alert-CnjNKhNx.js";import{t as ce}from"./x-CswtfvgS.js";import"./src-BNYQ8guL.js";import{t as N}from"./tag-B6WeUtBW.js";import{t as le}from"./popover-Bl6742nZ.js";import{t as ue}from"./input-ZpyYt_a0.js";import{t as de}from"./toggle-QSEiPr3k.js";import{n as P}from"./toast-Be8FEQ-I.js";import{t as fe}from"./confirm-dialog-Zyfei9GV.js";import{t as pe}from"./file-markdown-BXMDJYDD.js";import{Bn as me,Ln as F,Rn as he,Un as ge}from"./sdk.gen-BR-xXIZm.js";import{St as _e,an as ve,at as ye,ct as be,in as xe,rn as Se,rt as Ce,st as we,xt as Te}from"./react-query.gen-DfzfX_Jv.js";import{t as Ee}from"./assistant-identity-store-CgJwLRMd.js";import{r as De}from"./utils-DvUW9GK8.js";import{u as Oe}from"./routes-D4ff4ONd.js";import{t as ke}from"./misc-D0u5tzSd.js";import{Ba as Ae,Bo as je,Fa as Me,J as Ne,Ko as Pe,Ks as I,Lo as L,Ot as Fe,Rn as Ie,Rs as Le,Yo as Re,cs as ze,hs as R,jo as z,os as Be,ys as B,zo as V,zs as H}from"./index-D5iUyXUl.js";import{n as Ve,r as He}from"./skills-C7LCNEFA.js";var Ue=m(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),We=m(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),U=e(r(),1),W=f(),Ge={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function G({external:e=!1,icon:t,iconSrc:n,size:r=`sm`,className:i}){let[a,o]=(0,U.useState)(!1);(0,U.useEffect)(()=>{o(!1)},[n]);let s=t||(e?`📦`:`🧩`),c=!!n&&!a;return(0,W.jsx)(`span`,{className:ke(`flex shrink-0 items-center justify-center`,Ge[r],i),children:c?(0,W.jsx)(`img`,{src:n,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>o(!0)}):s})}var Ke=e=>`Remove "${e}" from this assistant?`,qe=e=>`"${e}" has local edits that will be overwritten by the upgrade. Continue?`,Je=`Upgrade anyway`,Ye=`Failed to install plugin. Please try again.`,Xe=`Failed to remove plugin. Please try again.`,Ze=`Failed to upgrade plugin. Please try again.`,Qe=`Failed to update plugin. Please try again.`;function $e(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path}));return[...n,...i]}function et(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function tt(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function nt(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function rt(e){return e?e.slice(0,7):`unknown`}function K({plugin:e,surfaces:t=null,className:n}){let r=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&r.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&r.push({label:`License`,value:e.license}),t&&(t.skills.length>0&&r.push({label:`Skills`,value:String(t.skills.length)}),t.hooks.length>0&&r.push({label:`Hooks`,value:String(t.hooks.length)}),t.tools.length>0&&r.push({label:`Tools`,value:String(t.tools.length)})),(0,W.jsx)(`dl`,{className:ke(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:r.map(e=>(0,W.jsxs)(`div`,{className:`contents`,children:[(0,W.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,W.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,W.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,W.jsx)(re,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function it({plugin:e,drift:t,onInstall:n,onRemove:r,onUpgrade:a,isInstalling:o,isRemoving:s,isUpgrading:c,hasLocalEdits:l,enabled:u,onToggle:d,isToggling:f}){let[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),_=e.installed??!1,v=e.artifact??null,y=t?.status===`update-available`,b=y?`Upgrade ${rt(t?.local?.commit??null)} → ${rt(t?.remote?.commit??null)}`:void 0;return(0,W.jsxs)(W.Fragment,{children:[_?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[u!==void 0&&d?(0,W.jsx)(de,{label:`Auto-include in chat`,checked:u,onChange:()=>d(),disabled:f}):null,v?(0,W.jsx)(i,{asChild:!0,leftIcon:(0,W.jsx)(ne,{"aria-hidden":!0}),children:(0,W.jsx)(`a`,{href:v.url,download:!0,children:v.label??`Download`})}):null,y?(0,W.jsx)(i,{type:`button`,onClick:()=>{if(l){g(!0);return}a()},disabled:c,title:b,leftIcon:c?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(H,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,W.jsx)(i,{type:`button`,variant:`dangerOutline`,onClick:()=>m(!0),disabled:s,leftIcon:s?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(V,{"aria-hidden":!0}),children:`Remove`})]}):(0,W.jsx)(i,{type:`button`,onClick:n,disabled:o,leftIcon:o?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(I,{"aria-hidden":!0}),children:`Install`}),(0,W.jsx)(fe,{open:p,title:`Remove plugin`,message:Ke(e.name),confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{m(!1),r()},onCancel:()=>m(!1)}),(0,W.jsx)(fe,{open:h,title:`Upgrade plugin`,message:qe(e.name),confirmLabel:Je,destructive:!0,onConfirm:()=>{g(!1),a()},onCancel:()=>g(!1)})]})}function at(){return(0,W.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,W.jsx)(j,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function q(){return(0,W.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,W.jsx)(se,{className:`h-6 w-6`,"aria-hidden":!0}),(0,W.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,W.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function ot({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?Ye:t?Xe:n?Ze:null;return r?(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,W.jsx)(se,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function st({external:e,className:t}){let n=e?{label:`External`,icon:ie}:{label:`Local`,icon:k};return(0,W.jsx)(N,{tone:`neutral`,leftIcon:(0,U.createElement)(n.icon),className:t,children:n.label})}function J({onClick:e,isUpgrading:t=!1}={}){let n=(0,W.jsx)(N,{tone:`warning`,leftIcon:(0,U.createElement)(t?j:H,{className:t?`animate-spin`:void 0}),className:`shrink-0`,children:`Update available`});return e?(0,W.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":`Upgrade plugin`,className:`shrink-0 rounded-[6px] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:cursor-not-allowed`,children:n}):n}var ct=300*1e3;function Y({assistantId:e,name:t,enabled:n=!0}){return u({...ye({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:ct,retry:!1})}function lt(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function ut(e,t,n){let r=l(),i=n?.onRemoved,a=u({...Ce({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),o=Y({assistantId:e,name:t,enabled:a.data?.installed??!1}).data,s=(0,U.useCallback)(()=>Me(r,e,t),[e,t,r]),c=ve({onSuccess:()=>{s(),P.success(`Installed ${t||`plugin`}`)}}),d=Se({onSuccess:()=>{s(),i?.()}}),f=xe({onSuccess:e=>{s(),P.success(e.outcome===`already-up-to-date`?`${t||`Plugin`} is already up to date`:`Upgraded ${t||`plugin`} to ${rt(e.toCommit)}`)}});return{plugin:a.data??null,drift:o,isLoading:a.isLoading,isError:a.isError,install:()=>{c.mutate({path:{assistant_id:e},body:{name:t}})},remove:()=>{d.mutate({path:{assistant_id:e,name:t}})},upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:c.isPending,isRemoving:d.isPending,isUpgrading:f.isPending,isInstallError:c.isError,isRemoveError:d.isError,isUpgradeError:f.isError,hasLocalEdits:lt(o)}}var dt=`0.10.5`;function ft(){return De(dt)}function X(e,t,n,r){let i=ft(),{data:a}=u({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await me({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(i&&n&&r),staleTime:1/0,retry:!1}),[o,s]=(0,U.useState)(void 0);return(0,U.useEffect)(()=>{if(!a){s(void 0);return}let e=URL.createObjectURL(a);return s(e),()=>{URL.revokeObjectURL(e)}},[a]),o}function Z(e){let t=l(),n={queryKey:we({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=d({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?he({path:{assistant_id:e,name:t},throwOnError:!1}):F({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),P.error(Qe)},onSettled:(n,r,i)=>{Me(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function pt({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=ut(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=Z(e),C=X(e,t,o?.hasIcon,o?.iconVersion);return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,W.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,W.jsx)(h,{"aria-hidden":!0}),"aria-label":`Back to plugins`,onClick:n}),(0,W.jsx)(Q,{name:t,plugin:o,externalHint:r,iconSrc:C,drift:s,onInstall:u,onRemove:d,onUpgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t})]}),(v||y||b)&&(0,W.jsx)(ot,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,W.jsx)(p.Root,{asChild:!0,children:(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:c?(0,W.jsx)(at,{}):l||!o?(0,W.jsx)(q,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(K,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,W.jsx)(pe,{content:o.readme}):(0,W.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})]})}function Q({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let h=t?.source?.kind===`github`,g=t?h:n,_=i?.status===`update-available`;return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[g===void 0?(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,W.jsx)(G,{external:g,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,W.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,W.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,t?(0,W.jsx)(st,{external:h}):null,_?(0,W.jsx)(J,{}):null]}),t?.description?(0,W.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,W.jsx)(it,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var mt=e(a(),1);function ht({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=ut(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=Z(e),[C,w]=(0,U.useState)(null);(0,U.useEffect)(()=>{w(document.getElementById(`viewport-overlays`))},[]);let T=o?.source?.kind===`github`,E=o?T:r,D=s?.status===`update-available`,O=o?.name??t,te=X(e,t,o?.hasIcon,o?.iconVersion),ne=(0,W.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(i,{variant:`ghost`,iconOnly:(0,W.jsx)(h,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to plugins`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:O}),(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,W.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E===void 0?(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,W.jsx)(G,{external:E,icon:o?.icon??void 0,iconSrc:te,size:`md`}),(0,W.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:O})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[D?(0,W.jsx)(J,{}):null,o?(0,W.jsx)(st,{external:T}):null]})]}),o?.description?(0,W.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,W.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,W.jsx)(it,{plugin:o,drift:s,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t,onInstall:u,onRemove:d,onUpgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(ot,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,W.jsx)(p.Root,{asChild:!0,noPadding:!0,children:(0,W.jsx)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:c?(0,W.jsx)(at,{}):l||!o?(0,W.jsx)(q,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(K,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,W.jsx)(pe,{content:o.readme}):(0,W.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})})]});return C?(0,mt.createPortal)(ne,C):ne}function gt({assistantId:e,item:t,drift:n,onSelect:r,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c=!1,isRemoving:l=!1,isUpgrading:u=!1}){let d=t.status===`available`,f=n?.status===`update-available`,m=t.enabled!==void 0,h=t.enabled===!1,g=X(e,t.name,t.hasIcon,t.iconVersion);return(0,W.jsx)(p.Root,{asChild:!0,children:(0,W.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,W.jsx)(G,{size:`sm`,external:t.external,icon:t.icon,iconSrc:g,className:h?`opacity-50`:void 0}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:h?`var(--content-tertiary)`:`var(--content-emphasised)`},children:t.name}),t.version?(0,W.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,(0,W.jsx)(N,{tone:`neutral`,leftIcon:(0,W.jsx)(ae,{"aria-hidden":!0}),children:`Plugin`}),f?(0,W.jsx)(J,{onClick:s,isUpgrading:u}):null]}),(0,W.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description??`No description provided.`}),t.issues&&t.issues.length>0?(0,W.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:t.issues.join(`; `),children:[t.issues[0],t.issues.length>1?` (+${t.issues.length-1} more)`:``]}):null]}),d?c?(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!a,"aria-label":`Install plugin`,expandOnMobile:!1}):(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m?(0,W.jsx)(N,{tone:t.enabled?`positive`:`neutral`,children:t.enabled?`Enabled`:`Disabled`}):null,(0,W.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:l?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:l||u||!o,"aria-label":`Remove plugin`,expandOnMobile:!1})]})]})})}var _t={mail:ze,calendar:C,"message-circle":Be,globe:ie,zap:z,code:te,mic:M,"shopping-cart":Pe,palette:We,heart:B,settings:w,"link-2":A};function vt(e){return _t[e]}function yt({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o=`Skill categories`}){let s=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,W.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o,children:[(0,W.jsx)(bt,{icon:R,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),s.map(r=>(0,W.jsx)(bt,{icon:vt(r.icon)??R,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function bt({icon:e,label:t,count:n,isActive:r,showCount:a,onClick:o}){return(0,W.jsxs)(i,{variant:`ghost`,onClick:o,"aria-pressed":r,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:r?`var(--surface-active)`:void 0,color:r?`var(--content-default)`:`var(--content-secondary)`},children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),a&&(0,W.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}function xt({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:a=!1,isRemoving:o=!1}){let s=b(e),c=Ve(e);return(0,W.jsx)(p.Root,{asChild:!0,children:(0,W.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,W.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,W.jsx)(y,{skill:e,className:`h-7 w-7`})}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,W.jsx)(g,{origin:e.origin})]}),(0,W.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?a?(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,W.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}var St=[{value:`all`,label:`All`,icon:R},{value:`installed`,label:`Installed`,icon:Le},{value:`available`,label:`Available`,icon:I}],Ct=[{value:`skills`,label:`Skills`,icon:z},{value:`plugins`,label:`Plugins`,icon:ae}],wt=[{value:`vellum`,label:`Vellum`,icon:x},{value:`clawhub`,label:`Clawhub`,icon:ie},{value:`skillssh`,label:`skills.sh`,icon:je},{value:`custom`,label:`Custom`,icon:L},{value:`assistant-memory`,label:`Assistant's Memory`,icon:S}];function Tt({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginsSupported:d}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(ue,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search superpowers`,"aria-label":`Search superpowers`,leftIcon:(0,W.jsx)(Re,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,W.jsx)(j,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,W.jsx)(Et,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginsSupported:d})]})}function Et(e){let t=Ae(),[n,r]=(0,U.useState)(!1),a=(0,W.jsx)(i,{type:`button`,variant:`outlined`,iconOnly:(0,W.jsx)(Ue,{"aria-hidden":!0}),"aria-label":`Filter superpowers`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});if(t)return(0,W.jsx)(Dt,{...e,open:n,onOpenChange:r,trigger:a});let o=t=>{e.onFilterChange(t),r(!1)};return(0,W.jsxs)(le.Root,{open:n,onOpenChange:r,children:[(0,W.jsx)(le.Trigger,{asChild:!0,children:a}),(0,W.jsx)(le.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,W.jsxs)(`ul`,{role:`listbox`,children:[(0,W.jsx)(kt,{label:`Status`,options:St,selected:e.filter,onSelect:o}),e.pluginsSupported&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,W.jsx)(kt,{label:`Type`,options:Ct,selected:e.filter,onSelect:o})]}),(0,W.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,W.jsx)(kt,{label:`Source`,options:wt,selected:e.filter,onSelect:o})]})})]})}function Dt({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginsSupported:l,open:u,onOpenChange:d,trigger:f}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,W.jsxs)(E.Root,{open:u,onOpenChange:d,children:[(0,W.jsx)(E.Trigger,{asChild:!0,children:f}),(0,W.jsxs)(E.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,W.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,W.jsx)(E.Header,{children:(0,W.jsx)(E.Title,{children:`Filters`})}),(0,W.jsxs)(E.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,W.jsx)(Ot,{label:`Status`,children:St.map(n=>(0,W.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),l&&(0,W.jsx)(Ot,{label:`Type`,children:Ct.map(n=>(0,W.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,W.jsx)(Ot,{label:`Source`,children:wt.map(n=>(0,W.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,W.jsxs)(Ot,{label:`Categories`,children:[(0,W.jsx)($,{icon:R,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>a(null)}),p.map(e=>(0,W.jsx)($,{icon:vt(e.icon)??R,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,W.jsx)(E.Footer,{children:(0,W.jsx)(i,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>d(!1),children:`Done`})})]})]})}function Ot({label:e,children:t}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,W.jsx)(D,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,W.jsx)(T,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function kt({label:e,options:t,selected:n,onSelect:r}){return(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,W.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,W.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,W.jsx)(Le,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}var At=300*1e3,jt=[],Mt=[];async function Nt(e,t,n){let r=await ge({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(`Failed to load plugins`);return r.data??{plugins:[]}}function Pt(e,t){let[n,r]=(0,U.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,U.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function Ft(e,t=null,n=!0){let r=t??void 0,i=u({queryKey:we({path:{assistant_id:e},query:{q:void 0,category:r}}),queryFn:({signal:t})=>Nt(e,r,t),enabled:!!e&&n,staleTime:At}),a=u({...Fe(e),enabled:!!e&&n&&t!==null}),o=u({...be({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e&&n,staleTime:At}),s=(0,U.useMemo)(()=>{let e=t===null?i.data?.plugins:a.data?.plugins??i.data?.plugins;return new Set((e??jt).map(e=>e.name))},[t,a.data?.plugins,i.data?.plugins]),c=(0,U.useMemo)(()=>{let e=i.data?.plugins??jt,n=o.data?.matches??Mt;return tt($e(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!s.has(e.name))))},[i.data?.plugins,o.data?.matches,t,s]),d=t===null?i.data:a.data,f=Pt(e,d?.categoryCounts!==void 0),p=Pt(e,(d?.plugins??jt).some(e=>e.enabled!==void 0)),m=l(),h=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(h.current===e||!o.isSuccess)return;let t=d?.plugins;if(!t?.length)return;let n=new Map((o.data?.matches??Mt).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(h.current=e,m.invalidateQueries({queryKey:we({path:{assistant_id:e},query:{q:void 0}})}))},[e,o.isSuccess,o.data?.matches,d?.plugins,m]),{items:c,isLoading:i.isLoading,catalogLoading:o.isLoading,isError:i.isError,isFetching:i.isFetching||o.isFetching,catalogError:o.isError,categorySupported:f,pluginToggleSupported:p,installedCategoryCounts:d?.categoryCounts,installedPlugins:d?.plugins??jt,installedTotal:d?.totalCount,catalogMatches:o.data?.matches??Mt,unfilteredInstalledNames:s}}function It(e){return u({...Te({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}var Lt=new Set([`all`,`installed`,`available`,`skills`,`plugins`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function Rt(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:Vt(t)?t:`all`,category:n||null}}function zt(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Bt(n,`q`,t.q.trim()||null),t.filter!==void 0&&Bt(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Bt(n,`category`,t.category),n}function Bt(e,t,n){n===null?e.delete(t):e.set(t,n)}function Vt(e){return e!==null&&Lt.has(e)}function Ht(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:case`assistant-memory`:return{origin:e};default:return{}}}function Ut(e){return e!==`plugins`}function Wt(e){return e===`all`||e===`installed`||e===`available`||e===`plugins`}function Gt(e){switch(e){case`installed`:return`installed`;case`available`:return`available`;default:return`all`}}function Kt(e,t){let[n,r]=(0,U.useState)(e);return(0,U.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var qt=300,Jt=`vellum:superpowers:tipDismissed`;function Yt(e){return[...e].sort((e,t)=>e.installed===t.installed?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):e.installed?-1:1)}function Xt({assistantId:e}){let r=c(),i=o(),a=l(),d=Ae(),f=Ee.use.version(),p=Ie(),[m,h]=s(),{q:g,filter:v,category:y}=(0,U.useMemo)(()=>Rt(m),[m]),b=m.get(`plugin`),x=(0,U.useCallback)(e=>{h(t=>zt(t,e),{replace:!0})},[h]),S=m.get(`success`),C=(0,U.useRef)(!1);(0,U.useEffect)(()=>{S!==`true`||C.current||(C.current=!0,b&&P.success(`Installed ${b}`),h(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[S,b,h]);let[w,T]=(0,U.useState)(g),E=Kt(w.trim(),qt),D=(0,U.useRef)(g);(0,U.useEffect)(()=>{if(g!==D.current&&(D.current=g,g!==w.trim())){T(g);return}E!==g&&E===w.trim()&&(D.current=E,x({q:E}))},[E,g,w,x]);let O=(0,U.useCallback)(e=>x({filter:e}),[x]),te=(0,U.useCallback)(e=>x({category:e}),[x]),[ne,re]=(0,U.useState)(()=>n(Jt,!1)),ie=(0,U.useCallback)(()=>{re(!0),t(Jt,!0)},[]),k=!p&&v===`plugins`?`all`:v,A=Ut(k),j=p&&Wt(k),M=Gt(k),{handleInstall:ae,handleRemove:oe,isInstallingSkill:se,isRemovingSkill:ce,skillPendingRemoval:N,confirmRemove:le,cancelRemove:ue}=ee(e),{data:de=[]}=It(e),{origin:pe,kind:me}=(0,U.useMemo)(()=>Ht(k),[k]),F=u({..._e({path:{assistant_id:e},query:{include:`catalog`,origin:pe,kind:me,q:E||void 0,category:y??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&A}),he=u({..._e({path:{assistant_id:e},query:{include:`catalog`,origin:pe,kind:me,q:E||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&A&&y!==null}),{items:ge,isLoading:ye,catalogLoading:be,isError:Ce,isFetching:we,catalogError:Te,categorySupported:De,installedCategoryCounts:ke,installedPlugins:je,installedTotal:Ne,catalogMatches:Pe,unfilteredInstalledNames:I}=Ft(e,y,p),L=j&&(y===null||De),Fe=(0,U.useCallback)(t=>Me(a,e,t),[e,a]),[Le,Re]=(0,U.useState)(null),[ze,R]=(0,U.useState)(null),[z,Be]=(0,U.useState)(null),[B,V]=(0,U.useState)(null),[H,Ve]=(0,U.useState)(null),Ue=ve({onMutate:e=>Re(e.body.name),onSuccess:(e,t)=>P.success(`Installed ${t.body.name}`),onError:()=>P.error(Ye),onSettled:(e,t,n)=>{Re(null),Fe(n.body.name)}}),We=Se({onMutate:e=>R(e.path.name),onSuccess:(e,t)=>P.success(`Removed ${t.path.name}`),onError:()=>P.error(Xe),onSettled:(e,t,n)=>{R(null),Fe(n.path.name)}}),Ge=xe({onMutate:e=>Be(e.path.name),onSuccess:(e,t)=>P.success(e.outcome===`already-up-to-date`?`${t.path.name} is already up to date`:`Upgraded ${t.path.name} to ${rt(e.toCommit)}`),onError:()=>P.error(Ze),onSettled:(e,t,n)=>{Be(null),Fe(n.path.name)}}),G=(0,U.useCallback)(e=>h(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[h]),Qe=(0,U.useCallback)(()=>h(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[h]),$e=(0,U.useCallback)(t=>{Ue.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,Ue]),tt=(0,U.useCallback)(()=>{B&&(We.mutate({path:{assistant_id:e,name:B.name}}),V(null))},[e,B,We]),K=(0,U.useCallback)(t=>{Ge.mutate({path:{assistant_id:e,name:t},body:{}})},[e,Ge]),it=(0,U.useCallback)(()=>{H&&(K(H.name),Ve(null))},[H,K]),at=(0,U.useCallback)((e,t)=>{if(lt(t)){Ve(e);return}K(e.name)},[K]),q=(0,U.useMemo)(()=>A?F.data?.skills??[]:[],[A,F.data?.skills]),ot=(0,U.useMemo)(()=>L?nt(ge,M).filter(e=>et(e,E)):[],[L,ge,M,E]),st=(0,U.useMemo)(()=>Yt([...q.map(e=>({type:`skill`,key:`skill:${e.id}`,name:e.name,installed:_(e),skill:e})),...ot.map(e=>({type:`plugin`,key:`plugin:${e.name}`,name:e.name,installed:e.status===`installed`,item:e}))]),[q,ot]),J=y===null?F.data:he.data,ct=Zt(A,J?.skills??q,J?.categoryCounts,J?.totalCount),Y=Qt(j&&De,ke,je,Ne,Pe,I,M),{counts:ut,totalCount:dt}=(0,U.useMemo)(()=>{let e={...ct.counts};for(let[t,n]of Object.entries(Y.counts))e[t]=(e[t]??0)+n;return{counts:e,totalCount:ct.totalCount+Y.totalCount}},[ct,Y]),ft=A&&F.isLoading,X=A&&F.isError,Z=L&&ye,Q=L&&Ce,mt=(X||!A)&&(Q||!L)&&(X||Q),_t=ft||Z,vt=!!E&&(A&&F.isFetching||L&&we&&!ye),bt=w.trim().length>0;if(b&&!p&&f===null)return null;if(b&&p){let t=ge.find(e=>e.name===b),n={assistantId:e,name:b,externalHint:t?.external,enabled:t?.enabled,onBack:Qe};return d?(0,W.jsx)(ht,{...n}):(0,W.jsx)(pt,{...n})}let St=(0,W.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:_t?(0,W.jsx)(nn,{}):mt?(0,W.jsx)(rn,{}):st.length===0?L&&be&&M!==`installed`?(0,W.jsx)(nn,{}):(0,W.jsx)(an,{filter:k,category:y}):(0,W.jsx)(`ul`,{className:`flex flex-col gap-2`,children:st.map(t=>(0,W.jsx)(`li`,{children:t.type===`skill`?(0,W.jsx)(xt,{skill:t.skill,onSelect:()=>r(Oe.skills.detail(t.skill.id),{state:{listSearch:i.search}}),onInstall:()=>ae(t.skill),onRemove:()=>oe(t.skill),isInstalling:se(t.skill),isRemoving:ce(t.skill)}):t.installed?(0,W.jsx)($t,{assistantId:e,item:t.item,onSelect:()=>G(t.item),onRemove:()=>V(t.item),onUpgrade:e=>at(t.item,e),isRemoving:ze===t.item.name,isUpgrading:z===t.item.name}):(0,W.jsx)(gt,{assistantId:e,item:t.item,onSelect:()=>G(t.item),onInstall:()=>$e(t.item),isInstalling:Le===t.item.name})},t.key))})});return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!ne&&(0,W.jsx)(en,{onDismiss:ie}),(0,W.jsx)(Tt,{search:w,onSearchChange:T,filter:k,onFilterChange:O,isSearching:vt,categories:de,category:y,onCategoryChange:te,counts:ut,totalCount:dt,showCounts:!bt,pluginsSupported:p}),!_t&&!mt&&X?(0,W.jsx)(tn,{text:`Skills are temporarily unavailable. Plugins are still listed below.`}):null,!_t&&!mt&&Q?(0,W.jsx)(tn,{text:`Plugins are temporarily unavailable. Skills are still listed below.`}):null,L&&Te&&!Z&&!Q?(0,W.jsx)(tn,{text:`Plugin catalog browsing is temporarily unavailable. Installed plugins are still listed below.`}):null,(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,W.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,W.jsx)(yt,{ariaLabel:`Superpower categories`,selected:y,onSelect:te,counts:ut,totalCount:dt,showCounts:!bt,categories:de})}),St]}),(0,W.jsx)(He,{skillName:N?.name??null,onConfirm:le,onCancel:ue}),(0,W.jsx)(fe,{open:B!==null,title:`Remove plugin`,message:B?Ke(B.name):``,confirmLabel:`Remove`,destructive:!0,onConfirm:tt,onCancel:()=>V(null)}),(0,W.jsx)(fe,{open:H!==null,title:`Upgrade plugin`,message:H?qe(H.name):``,confirmLabel:Je,destructive:!0,onConfirm:it,onCancel:()=>Ve(null)})]})}function Zt(e,t,n,r){return(0,U.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};if(n&&Object.keys(n).length>0)return{counts:n,totalCount:r??t.length};let i={};for(let e of t){let t=e.category??`system`;i[t]=(i[t]??0)+1}return{counts:i,totalCount:r??t.length}},[e,t,n,r])}function Qt(e,t,n,r,i,a,o){return(0,U.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};let s={},c=o!==`available`,l=o===`all`||o===`available`;if(c)if(t&&Object.keys(t).length>0)Object.assign(s,t);else for(let e of n){let t=e.category??`system`;s[t]=(s[t]??0)+1}let u=0;if(l)for(let e of i){if(a.has(e.name))continue;let t=e.category??`system`;s[t]=(s[t]??0)+1,u+=1}let d=r??n.length;return{counts:s,totalCount:(c?d:0)+u}},[e,t,n,r,i,a,o])}function $t({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=Y({assistantId:e,name:t.name}).data;return(0,W.jsx)(gt,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function en({onDismiss:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,W.jsx)(oe,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,W.jsx)(`p`,{className:`flex-1`,children:`Create a new custom skill by describing what you want in chat, or install plugins to extend your assistant.`}),(0,W.jsx)(i,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(ce,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function tn({text:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,W.jsx)(O,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,W.jsx)(`p`,{className:`flex-1`,children:e})]})}function nn(){return(0,W.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,W.jsx)(j,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function rn(){return(0,W.jsx)(p.Root,{children:(0,W.jsxs)(p.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,W.jsx)(se,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,W.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load superpowers`}),(0,W.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function an({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=on(e,t);return(0,W.jsx)(v,{icon:i,title:n,subtitle:r})}function on(e,t){if(t)return{title:`Nothing in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:R};switch(e){case`installed`:return{title:`No Superpowers Installed`,subtitle:`Ask your assistant in chat to search for and install new skills and plugins.`,Icon:z};case`available`:return{title:`Nothing Left to Install`,subtitle:`All available skills and plugins are installed.`,Icon:Le};case`skills`:return{title:`No Skills Found`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:z};case`plugins`:return{title:`No Plugins Found`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:ae};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:z};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:z};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:z};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:z};case`assistant-memory`:return{title:`No Skills From Memory`,subtitle:`Skills your assistant authors from past conversations will appear here.`,Icon:z};default:return{title:`No Superpowers Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:O}}}function sn(){return(0,W.jsx)(Xt,{assistantId:Ne()})}export{sn as SuperpowersPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-Cqi8q9o7.js";import{t as c}from"./createLucideIcon-Bjb-Kuq7.js";import{t as l}from"./cpu-DuPtXZt_.js";import{t as u}from"./hard-drive-DVmyHlZR.js";import{t as d}from"./info-CqgkBvyS.js";import{t as f}from"./loader-circle-Ck8fq3yv.js";import{a as ee,c as te,i as p,n as m,r as h,t as ne}from"./resize-errors-ORrW5M6r.js";import{t as g}from"./triangle-alert-CnjNKhNx.js";import{t as _}from"./notice-DkAWz47A.js";import{t as v}from"./modal-BtcwNEBj.js";import{n as y}from"./toast-Be8FEQ-I.js";import{t as b}from"./dropdown-BxYrCXBS.js";import{t as x}from"./is-electron-y5bNUVyG.js";import{t as S}from"./dist-DyRKd0bN2.js";import{n as C}from"./browser-CUpmd8oz.js";import{t as w}from"./misc-D0u5tzSd.js";import{Bi as T,Gi as E,Hr as re,Li as D,Wi as ie,Ws as O,fa as ae,qi as k,vt as A,yt as j}from"./index-D5iUyXUl.js";var oe=c(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),M=`vellum.pro-checkout-intent`,se=1800*1e3;function ce(e){try{sessionStorage.setItem(M,JSON.stringify({...e,savedAt:Date.now()}))}catch{}}function le(){if(typeof sessionStorage>`u`)return null;let e=null;try{e=sessionStorage.getItem(M)}catch{return null}if(!e)return null;let t;try{t=JSON.parse(e)}catch{return N(),null}return!ue(t)||Date.now()-t.savedAt>se?(N(),null):t}function N(){try{sessionStorage.removeItem(M)}catch{}}function ue(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.savedAt==`number`?t.kind===`package`?typeof t.packageKey==`string`:t.kind===`custom`:!1}var P=e(t(),1),F=o(),de=1e3,fe=1e4,pe=3e4,I=9e4,me=I*2/3,L=2500,R=2e3,z=[`machine_size`,`subdomain`,`non_field_errors`],he={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`};function B(e,t){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=he[t.error];if(e)return e}for(let e of z){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var ge=`We couldn't finish your machine upgrade automatically. Apply it now to finish — your assistant will briefly restart.`;function _e({action:e,buttonTestId:t,className:r}){return(0,F.jsxs)(`div`,{className:w(`flex flex-col items-center gap-2`,r),children:[(0,F.jsx)(_,{tone:`warning`,className:`w-full text-left`,children:ge}),e.error!=null&&(0,F.jsx)(_,{tone:`error`,className:`w-full text-left`,children:B(e.error,`Couldn't apply changes. Please try again.`)}),(0,F.jsx)(n,{variant:`outlined`,"data-testid":t,disabled:e.pending,onClick:e.onApply,children:`Apply & Restart`})]})}function ve({icon:e}){return(0,F.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,F.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}function V({icon:e,label:t,from:n,fromDetail:r,to:i,toDetail:a}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,F.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,style:{backgroundColor:`color-mix(in oklab, var(--system-positive-strong) 10%, transparent)`},children:(0,F.jsx)(e,{className:`h-4 w-4 text-[var(--system-positive-strong)]`})}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:t}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)] line-through`,children:n}),r&&(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)] line-through`,children:r})]}),(0,F.jsx)(O,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`}),(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-default)]`,children:i}),a&&(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:a})]})]})]})]})}var H={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function ye({title:e,subtitle:t}){return(0,F.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,F.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:H,children:e}),t&&(0,F.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var be=[{bodyShape:`blob`,eyeStyle:`goofy`,color:`green`,size:56,position:`-left-4 -top-6`,rotate:-12},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:48,position:`left-1/2 -top-8 -translate-x-1/2`,rotate:6},{bodyShape:`urchin`,eyeStyle:`surprised`,color:`teal`,size:56,position:`-right-4 -top-6`,rotate:14},{bodyShape:`star`,eyeStyle:`gentle`,color:`purple`,size:44,position:`-left-6 top-1/2 -translate-y-1/2`,rotate:-20},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`pink`,size:44,position:`-right-6 top-1/2 -translate-y-1/2`,rotate:18},{bodyShape:`flower`,eyeStyle:`quirky`,color:`yellow`,size:52,position:`left-1/2 -bottom-8 -translate-x-1/2`,rotate:-8}],xe=[{bodyShape:`star`,eyeStyle:`gentle`,color:`yellow`,size:76,position:`-left-6 -top-7`,rotate:180},{bodyShape:`urchin`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[58%] -top-12 -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`gentle`,color:`green`,size:60,position:`-right-4 top-11`,rotate:1}];function Se({variant:e=`full`}){let t=A();return t?(0,F.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?xe:be).map((e,n)=>(0,F.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,F.jsx)(j,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}function Ce(){return x()||S.isNativePlatform()?`native`:`web`}function U(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function W(e){return`${U(e)}/mo`}function G(e){return`${e>0?`+`:`−`}${U(Math.abs(e))}/mo`}function K(e){return e.disabled===!0}function we({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:c}){let l=(0,P.useMemo)(()=>e.map(e=>{let t=m[e.tier]??e.label,n=o==null?`+${W(e.price_cents)}`:e.price_cents===o?`(${W(e.price_cents)}, current)`:G(e.price_cents-o);return{value:e.tier,label:`${t} ${n}`,disabled:K(e)}}),[e,o]),u=(0,P.useMemo)(()=>t.map(e=>{let t=c==null?`+${W(e.price_cents)}`:e.price_cents===c?`(${W(e.price_cents)}, current)`:G(e.price_cents-c);return{value:e.tier,label:`${e.storage_gib} GB ${t}`,disabled:K(e)}}),[t,c]);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(s,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,F.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,F.jsx)(d,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,F.jsx)(b,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:i,options:l})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(s,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,F.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,F.jsx)(d,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,F.jsx)(b,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:r??``,onChange:a,options:u})]})]})}var q=new Set([`active`,`trialing`,`past_due`]);function Te(e){return e.plan_id!==`base`&&e.package!=null&&!e.package.customized&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&q.has(e.status)}var Ee=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function J(e,t){if(e&&typeof e==`object`){for(let t of Ee)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function De(e,t){let n=e.filter(e=>!K(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Oe(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function ke(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}var Y=[`mighty`,`super`,`ultra`],Ae=[`free`,...Y];function X(e){return Ae.indexOf(e)}function je(e,t){if(e===null)return`upgrade`;let n=X(e),r=X(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function Me(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>Y.indexOf(e.key)-Y.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}function Ne(){let e=r(),t=a(T());return{changePackage:async n=>{try{let r=await t.mutateAsync({body:{package:n}});return await Promise.all([e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:D()}),e.invalidateQueries({queryKey:E()})]),r}catch(e){return y.error(J(e,`Failed to change your plan. Please try again.`)),null}},isPending:t.isPending}}var Pe={free:{tagline:`Get to know your assistant`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`Empower your assistant to level you up.`,cta:`Power Up`,priceCaption:`Billed monthly`},super:{tagline:`Give your assistant real muscle to help you grow`,cta:`Go Super`,priceCaption:`Billed monthly`,mostPopular:!0,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Our most powerful assistant. There's nothing you can't tackle together`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function Fe(e){return Pe[e]}function Z(e){return`Downgrade to ${e}`}var Q=`Your machine downsizes now and your storage stays. No refund — a prorated credit applies to your next invoice.`,Ie=`You'll be charged the prorated difference now.`;function Le({open:e,relation:t,packageName:r,pending:i,onCancel:a,onConfirm:o}){let c=t===`downgrade`;return(0,F.jsx)(v.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,F.jsxs)(v.Content,{size:`md`,hideCloseButton:!0,children:[(0,F.jsx)(v.Header,{children:(0,F.jsx)(v.Title,{icon:c?g:void 0,children:c?`Downgrade to ${r}?`:`Upgrade to ${r}?`})}),(0,F.jsx)(v.Body,{children:(0,F.jsx)(s,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:c?Q:Ie})}),(0,F.jsxs)(v.Footer,{children:[(0,F.jsx)(n,{variant:`outlined`,onClick:a,disabled:i,children:`Cancel`}),(0,F.jsx)(n,{variant:c?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:c?Z(r):`Switch to ${r}`})]})]})})}var Re={free:`#E9C91A`,mighty:`#4C9B50`,super:`#0E9B8B`,ultra:`#EF4300`},$={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function ze({tier:e,size:t=40}){let n=$[e]??$.free,r=A();return(0,F.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,F.jsx)(j,{components:r,bodyShapeId:n.bodyShape,eyeStyleId:n.eyeStyle,colorId:n.color,size:t}):(0,F.jsx)(`div`,{style:{width:t,height:t}})})}function Be(){let e=r();(0,P.useEffect)(()=>C(()=>{e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:D()}),e.invalidateQueries({queryKey:E()})}),[e])}function Ve({open:e,onClose:t}){let r=i({...re(),enabled:e}),a=i({...ie(),enabled:e}),o=r.data,s=o?.machine_size||`small`,c=o?.provisioned_storage_gib??null,d=a.data?.max_machine_tier??null,m=a.data?.selected_storage_gib??null,g=ee(d),b=g.length>0?g[g.length-1]:s,x=b!==s,S=m!=null&&(c==null||c<m),C=x||S,[w,T]=(0,P.useState)(null),E=ae({onSuccess:()=>{y.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),T(null),t()},onError:e=>{T(ne(e,`Failed to resize assistant. Please try again.`))}}),D=E.isPending,O=r.isLoading||a.isLoading;return(0,F.jsx)(v.Root,{open:e,onOpenChange:e=>{e||(T(null),t())},children:(0,F.jsxs)(v.Content,{size:`sm`,children:[(0,F.jsxs)(v.Header,{children:[(0,F.jsx)(v.Title,{icon:te,children:`Plan Updated`}),(0,F.jsx)(v.Description,{children:`Your new resources are ready. Apply them now to resize your assistant — it will briefly restart.`})]}),(0,F.jsxs)(v.Body,{children:[O?(0,F.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,F.jsx)(f,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):C?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[x&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{icon:l,label:`Machine`,from:p[s],to:p[b]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-lg bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:`CPU`}),(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-default)]`,children:h[b].split(`,`)[0].trim()})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-lg bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:`Memory`}),(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-default)]`,children:h[b].split(`,`)[1].trim()})]})]})]}),S&&(0,F.jsx)(V,{icon:u,label:`Storage`,from:c==null?`—`:`${c} GB`,to:`${m} GB`})]}):(0,F.jsx)(_,{tone:`neutral`,children:`Your assistant is already running at the maximum size for your plan.`}),w&&(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(_,{tone:`error`,children:w})})]}),(0,F.jsxs)(v.Footer,{children:[(0,F.jsx)(n,{variant:`ghost`,onClick:()=>{T(null),t()},children:`Do Later`}),(0,F.jsx)(n,{disabled:O||!C||D||!o?.id,leftIcon:D?(0,F.jsx)(f,{className:`animate-spin`}):void 0,onClick:()=>{if(!o?.id)return;T(null);let e={};x&&(e.machine_size=b),S&&m!=null&&(e.storage_gib=m),E.mutate({path:{id:o.id},body:e})},children:w?`Retry`:`Apply & Restart`})]})]})})}export{me as A,oe as B,Ce as C,_e as D,H as E,fe as F,B as I,N as L,I as M,pe as N,ye as O,de as P,le as R,W as S,ve as T,De as _,Le as a,G as b,Ne as c,je as d,q as f,Oe as g,ke as h,Re as i,L as j,R as k,Y as l,Te as m,Be as n,Z as o,J as p,ze as r,Fe as s,Ve as t,Me as u,we as v,Se as w,U as x,K as y,ce as z};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{P as n}from"./button-BQVYX8n_.js";var r=e(t(),1),i={"title-large":`text-title-large`,"title-medium":`text-title-medium`,"title-small":`text-title-small`,"body-large-lighter":`text-body-large-lighter`,"body-large-default":`text-body-large-default`,"body-medium-lighter":`text-body-medium-lighter`,"body-medium-default":`text-body-medium-default`,"body-small-default":`text-body-small-default`,"body-small-emphasised":`text-body-small-emphasised`,"label-medium-default":`text-label-medium-default`,"label-small-default":`text-label-small-default`,chat:`text-chat`};function a({variant:e,as:t=`span`,className:a,children:o,ref:s,...c}){return(0,r.createElement)(t,{...c,ref:s,"data-slot":`typography`,className:n(i[e],a)},o)}export{a as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-Cqi8q9o7.js";import{t as c}from"./check-wF3S-AV4.js";import{o as l}from"./list-row-CFyYr-FU.js";import{t as u}from"./link-2-B9c5ZsFq.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./input-ZpyYt_a0.js";import{t as p}from"./modal-BtcwNEBj.js";import{Jt as m,Qt as h,en as g}from"./sdk.gen-BR-xXIZm.js";import{G as _,K as v,U as y,W as b,o as x,s as S,x as C}from"./react-query.gen-DfzfX_Jv.js";import{r as w}from"./utils-DvUW9GK8.js";import{n as T,r as E,t as D}from"./api-errors-CoE1wFl2.js";import{n as O}from"./sdk.gen-BhtkuoSl.js";import{t as k}from"./assistant-feature-flag-store-DuuDCLuS.js";import{Bt as A,C as j,Ca as M,S as ee,Sa as N,Vt as P,b as te,x as ne}from"./index-D5iUyXUl.js";import{t as F}from"./mutation-error-C9sr8Rue.js";import{t as I}from"./a2a-invite-VS3p3CfD.js";function L(e){return e?.trim()||`your assistant`}var R=e(t(),1),z=o(),B=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],V=`trusted_contacts`,H=new Set([`platform`,`a2a`]),U=new Set([`vellum`,`whatsapp`]);function W(e){return U.has(e)}var G={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function K(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function q(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function J({open:e,assistantId:t,onClose:r}){let[i,o]=(0,R.useState)(!1),u=(0,R.useRef)(null),m=(0,R.useRef)(!1),h=a({...y({path:{assistant_id:t}})}),g=(0,R.useRef)(h.mutate);(0,R.useLayoutEffect)(()=>{g.current=h.mutate});let _=(0,R.useRef)(h.reset);(0,R.useLayoutEffect)(()=>{_.current=h.reset}),(0,R.useEffect)(()=>{e&&!m.current&&g.current({path:{assistant_id:t}}),m.current=e},[e,t]),(0,R.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let v=(0,R.useCallback)(()=>{_.current(),o(!1),u.current&&=(clearTimeout(u.current),null),r()},[r]),b=(0,R.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{o(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>o(!1),2e3)})},[]),x=h.isSuccess&&h.data.token?I({senderAssistantId:t,token:h.data.token}):``;return(0,z.jsx)(p.Root,{open:e,onOpenChange:e=>{e||v()},children:(0,z.jsxs)(p.Content,{size:`sm`,children:[(0,z.jsx)(p.Header,{children:(0,z.jsx)(p.Title,{children:`Share Connection Link`})}),(0,z.jsx)(p.Body,{children:h.isPending?(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,z.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):h.isError?(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,z.jsx)(n,{variant:`outlined`,onClick:()=>h.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):h.isSuccess?(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,z.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(f,{type:`text`,readOnly:!0,value:x,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>b(x),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,z.jsx)(c,{className:`h-4 w-4`}):(0,z.jsx)(l,{className:`h-4 w-4`})})]}),h.data.expiresAt!=null&&(0,z.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:q(h.data.expiresAt)})]}):null}),(0,z.jsx)(p.Footer,{children:(0,z.jsx)(n,{variant:`outlined`,onClick:v,children:`Done`})})]})})}function Y({onClick:e}){return(0,z.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,z.jsx)(u,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function X(e){return typeof e==`string`&&B.includes(e)}function Z(e){return H.has(e)}function Q(e){return(e?.policies??[]).filter(e=>!Z(e.channelType)&&!W(e.channelType)).map(e=>({...e,policy:X(e.policy)?e.policy:`trusted_contacts`}))}async function re(e,t,n,r){if(Z(t))throw new D(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await O({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(T(o,a,`Failed to save channel policy.`),!o.ok)throw new D(o.status,E(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new D(500,`Gateway returned no policy in response.`);return i.policy}var ie=`0.10.0`;function $(){return w(ie)}function ae(e){let t=r(),n=k.use.channelTrustFloors(),o=$(),s=n&&o,c=(0,R.useMemo)(()=>({path:{assistant_id:e}}),[e]),l=(0,R.useMemo)(()=>M(c),[c]),u=i({...N(c),enabled:s,select:Q}),d=(0,R.useMemo)(()=>{let e={};for(let t of u.data??[])P(t.channelType)&&(e[t.channelType]=t.policy);return e},[u.data]),f=a({mutationFn:({channelKey:t,policy:n})=>re(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:l}),onError:F(`Failed to save channel policy`)}),p=(0,R.useCallback)((e,t)=>{f.mutate({channelKey:e,policy:t})},[f]);return s?{policies:d,savingKey:f.isPending?f.variables?.channelKey??null:null,isLoading:u.isPending,isError:u.isError,onChange:p}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var oe={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},se=15e3;function ce({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,R.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,R.useMemo)(()=>S(o),[o]),c=i({...x(o),enabled:!!e,refetchInterval:se,select:e=>e.snapshots}),l=(0,R.useMemo)(()=>le(c.data??[]),[c.data]),u=l.some(e=>e.key===`slack`&&e.status===`ready`),d=i({...b(o),enabled:u,select:e=>e.threadMode}),f=ae(e),p=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),y=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await m(n):t===`telegram`?await h(n):t===`phone`&&await g(n)},onSettled:(t,r,i)=>{p(),i===`slack`&&j(n,e)}}),C=ne({assistantId:e}),w=ee({assistantId:e}),T=te({assistantId:e}),E=a({...v(),onSuccess:()=>{n.invalidateQueries({queryKey:_(o)})}}),D=C.mutateAsync,O=(0,R.useCallback)(async e=>{await D(e)},[D]),k=w.mutate,A=(0,R.useCallback)((e,t)=>{k({botToken:e,appToken:t})},[k]),M=E.mutate,N=(0,R.useCallback)(t=>{M({path:{assistant_id:e},body:{threadMode:t}})},[M,e]),P=T.mutateAsync,F=(0,R.useCallback)(async(e,t)=>{await P({accountSid:e,authToken:t})},[P]),I=(0,R.useCallback)(e=>{t&&t(oe[e])},[t]),L=y.mutate,z=(0,R.useCallback)(e=>{L(e)},[L]);return{channels:l,pendingChannelKey:y.isPending?y.variables??null:null,slackThreadMode:d.data,slackThreadModePending:E.isPending,channelPolicies:f.policies,policySavingKey:f.savingKey,policiesLoading:f.isLoading,policiesError:f.isError,onChannelPolicyChange:f.onChange,onSetup:t?I:void 0,onDisconnect:z,onSaveTelegramToken:O,onSaveSlackConfig:A,slackSaveStatus:w.status,slackSaveError:w.error?.message??null,onSlackThreadModeChange:N,onSaveTwilioCredentials:F}}function le(e){let t=new Map;for(let n of e)t.set(n.channel,n);return A.map(e=>{let n=t.get(e);return{key:e,status:ue(n),address:n?.channelHandle??void 0}})}function ue(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function de(e){let t=r(),[n,i]=(0,R.useState)(!1);return{isOpen:n,open:(0,R.useCallback)(()=>{i(!0)},[]),close:(0,R.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:C({path:{assistant_id:e}})})},[t,e])}}export{Y as a,B as c,L as d,Q as i,G as l,ce as n,J as o,$ as r,V as s,de as t,K as u};
@@ -1 +0,0 @@
1
- import{D as e,T as t,i as n}from"./auth-store-yYPy4QuG.js";function r(){let r=e.use.currentOrganizationId();return e.use.status(),n()?r!=null||t()!=null:!0}export{r as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r}from"./local-settings-C-dW2vkq.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-BQVYX8n_.js";import{m as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-D8zyWtZh.js";import{t as f}from"./chevron-down-DpYf9Gwq.js";import{n as p}from"./list-row-CFyYr-FU.js";import{t as m}from"./info-CqgkBvyS.js";import{j as h,k as g}from"./src-BNYQ8guL.js";import{t as _}from"./toggle-QSEiPr3k.js";import{t as v}from"./dropdown-BxYrCXBS.js";import{At as y,Mt as b,Nt as x,Ot as S}from"./react-query.gen-DfzfX_Jv.js";import{a as C,i as w,n as T,r as ee,t as E}from"./sound-manager-DHHv5UT4.js";import{$o as D,Fr as O,Ir as k,J as A,U as j,W as M,_r as te,an as N,br as ne,dr as re,fr as ie,gr as P,hr as F,in as ae,mr as I,pr as L,vr as oe,yr as se,zo as ce}from"./index-D5iUyXUl.js";import{t as R}from"./detail-card-BXVPDa5J.js";import{r as le,t as z}from"./shared-ui-BQzVwlXn.js";var B=e(i(),1),V=u();function H({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,V.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,V.jsx)(_,{checked:n,disabled:r,onChange:i,label:e})]})}function U(){return(0,V.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function W({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:s}){let[c,l]=(0,B.useState)(!1),u=n.filter(e=>!t.sounds.includes(e.filename)),d=n.length>0&&u.length===0;return(0,V.jsxs)(`div`,{className:`py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:T[e]}),(0,V.jsx)(_,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${T[e]}`})]}),t.enabled&&(0,V.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:C(e)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,V.jsx)(D,{className:`h-3 w-3`})}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,V.jsx)(ce,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,V.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):d?(0,V.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,V.jsxs)(`div`,{className:`relative inline-block`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,V.jsx)(f,{className:`h-3 w-3`})]}),c&&(0,V.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>l(!1),children:u.map(e=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),l(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function ue(){let e=s(),t=A(),n=(0,B.useMemo)(()=>y({path:{assistant_id:t}}),[t]),r=(0,B.useMemo)(()=>S({path:{assistant_id:t}}),[t]),{data:i}=c(n),{data:a}=c(r),o=i??w(),u=a?.sounds??[],f=(0,B.useMemo)(()=>({path:{assistant_id:t}}),[t]),p=l({...x(f),onMutate:async t=>{await e.cancelQueries({queryKey:n.queryKey});let r=e.getQueryData(n.queryKey);return b(e,f,t.body),{previous:r}},onError:(t,n,r)=>{r?.previous!==void 0&&b(e,f,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:n.queryKey})}}),m=(0,B.useCallback)(r=>{let i=r(e.getQueryData(n.queryKey)??w());p.mutate({path:{assistant_id:t},body:i})},[t,n.queryKey,e,p]),h=e=>{m(t=>({...t,globalEnabled:e}))},g=e=>{m(t=>({...t,volume:e}))},[_,v]=(0,B.useState)(null),C=_??o.volume,T=(e,t)=>{m(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},O=(e,t)=>{m(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},k=(e,t)=>{m(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},j=()=>{E().previewFallbackBlip(o.volume)},M=e=>{E().previewSound(e,o.volume)};return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(d,{children:[(0,V.jsx)(H,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:o.globalEnabled,onChange:h}),(0,V.jsx)(U,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,V.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:C,onChange:e=>v(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},className:`h-1 w-48 cursor-pointer`,disabled:!o.globalEnabled,"aria-label":`Sound effect volume`}),(0,V.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(C*100),`%`]})]}),(0,V.jsx)(U,{}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,V.jsxs)(`button`,{type:`button`,onClick:j,disabled:!o.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,V.jsx)(D,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,V.jsxs)(d,{children:[(0,V.jsxs)(`div`,{className:`pb-2`,children:[(0,V.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,V.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:ee.map(e=>(0,V.jsx)(W,{event:e,eventConfig:o.events[e]??{enabled:!1,sounds:[]},availableSounds:u,globalEnabled:o.globalEnabled,onToggle:t=>T(e,t),onAddSound:t=>O(e,t),onRemoveSound:t=>k(e,t),onPreview:e=>M(e)},e))})]})]})}function de(){return(0,V.jsx)(z,{title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,V.jsx)(j,{})})}function fe(){return(0,V.jsx)(z,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,V.jsx)(M,{})})}var pe=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],me=`We recommend keeping both off to start. It feels more like a real conversation.`;function he(){return(0,V.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Recommended off`})}function ge({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,V.jsx)(he,{}):null]}),t?(0,V.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,V.jsx)(_,{checked:r,onChange:i,"aria-label":e})]})}function _e({showDescription:e=!1,showRecommendedBadge:t=!1}){let n=N.use.showUserTranscript(),r=N.use.showAssistantTranscript(),i=N.use.setShowUserTranscript(),a=N.use.setShowAssistantTranscript(),o={showUserTranscript:{checked:n,onChange:i},showAssistantTranscript:{checked:r,onChange:a}};return(0,V.jsx)(V.Fragment,{children:pe.map(n=>{let r=o[n.prefKey];return(0,V.jsx)(ge,{label:n.label,description:e?n.description:void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var G=`vellum:voice:conversationTimeoutSeconds`,K=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],q={label:`Fn`,activator:L},J=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],Y=`30`,X=`text-body-small-default text-[var(--content-tertiary)]`,ve=[`voice`,`services`,`sounds`];function ye(e){return ve.includes(e)}function be(){let[e,t]=o(),n=e.get(`tab`),r=ye(n)?n:`voice`;return(0,V.jsx)(`div`,{className:`space-y-6`,children:(0,V.jsxs)(p.Root,{value:r,onValueChange:n=>{let r=new URLSearchParams(e);n===`voice`?r.delete(`tab`):r.set(`tab`,n),t(r,{replace:!0})},children:[(0,V.jsxs)(p.List,{children:[(0,V.jsx)(p.Trigger,{value:`voice`,children:`Voice`}),(0,V.jsx)(p.Trigger,{value:`services`,children:`Services`}),(0,V.jsx)(p.Trigger,{value:`sounds`,children:`Sounds`})]}),(0,V.jsx)(p.Panel,{value:`voice`,className:`pt-4`,children:(0,V.jsx)(Se,{})}),(0,V.jsx)(p.Panel,{value:`services`,className:`pt-4`,children:(0,V.jsx)(xe,{})}),(0,V.jsx)(p.Panel,{value:`sounds`,className:`pt-4`,children:(0,V.jsx)(ue,{})})]})})}function xe(){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,V.jsx)(le,{}),(0,V.jsx)(de,{}),(0,V.jsx)(fe,{})]})}function Se(){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,V.jsx)(Ce,{}),(0,V.jsx)(we,{}),(0,V.jsx)(Te,{}),(0,V.jsx)(De,{}),(0,V.jsx)(Oe,{}),(0,V.jsx)(Z,{})]})}function Z(){return(0,V.jsx)(R,{title:`Transcription`,subtitle:`Show live text of what you and the assistant say during a voice conversation.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(_e,{showDescription:!0}),(0,V.jsx)(`p`,{className:`${X} pt-1`,children:me})]})})}var Q=``;function Ce(){let[e,r]=(0,B.useState)([]),[i,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(()=>k()),l=(0,B.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),r(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{r([]),o(!1)}},[]),u=(0,B.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,B.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,B.useMemo)(()=>[{value:Q,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),f=(0,B.useCallback)(e=>{c(e),e===Q?t(O):n(O,e)},[]);return(0,V.jsx)(R,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(v,{options:d,value:d.some(e=>e.value===s)?s:Q,onChange:f,"aria-label":`Microphone`})}),i&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(a,{variant:`outlined`,onClick:u,children:`Allow Microphone Access`}),(0,V.jsx)(`span`,{className:X,children:`Grant microphone access to list your available input devices.`})]})]})})}function we(){let e=re(),[t,i]=(0,B.useState)(()=>{let t=r(I,``);return t?oe(t,{preserveFunction:e}):e?q.activator:{kind:`off`}}),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)([]),l=(0,B.useRef)(null),u=(0,B.useRef)(!1),d=(0,B.useMemo)(()=>e?[q,...K]:K,[e]),f=t.kind!==`off`,p=f&&!e,h=(0,B.useCallback)(e=>{i(e),n(I,se(e)),o(!1),c([])},[]),g=(0,B.useCallback)(()=>{o(!0),c([]),u.current=!1,requestAnimationFrame(()=>{l.current?.focus()})},[]),v=(0,B.useCallback)(()=>{o(!1),c([]),u.current=!1},[]),y=(0,B.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),b=(0,B.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){v();return}let t=y(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?L.modifiers:ne(t));return}if(t.includes(`function`)){h(L);return}u.current=!0,h({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[v,y,h]),x=(0,B.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(u.current){u.current=!1,c([]);return}y(e).length===0&&s.length>0&&h({kind:`modifierOnly`,modifiers:s})}},[y,a,s,h]);(0,B.useEffect)(()=>{if(!a)return;let e=e=>{l.current&&!l.current.contains(e.target)&&v()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,a]);let S=f&&!d.some(e=>P(e.activator,t));return(0,V.jsx)(R,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsx)(_,{checked:f,onChange:n=>{n?t.kind===`off`&&h(e?q.activator:ie):h({kind:`off`})},label:`Enable Push to Talk`}),f&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(`span`,{className:X,children:`Activation Key:`}),(0,V.jsxs)(`div`,{ref:l,tabIndex:a?0:-1,onKeyDown:a?b:void 0,onKeyUp:a?x:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[d.map(e=>{let n=P(e.activator,t);return(0,V.jsx)($,{label:e.label,selected:n,onClick:()=>h(e.activator)},e.label)}),a?(0,V.jsx)($,{label:s.length>0?te(s):`Press any key…`,selected:!0,recording:!0,onClick:v}):(0,V.jsx)($,{label:S?F(t):`Custom`,selected:S,onClick:g})]}),p&&(0,V.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,V.jsx)(m,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,V.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function $({label:e,selected:t,recording:n=!1,onClick:r}){return(0,V.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,V.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,V.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function Te(){let[e,t]=(0,B.useState)(()=>{let e=r(G,Y);return J.find(t=>t.value===e)?.value??Y});return(0,V.jsx)(R,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(v,{options:J,value:e,onChange:(0,B.useCallback)(e=>{t(e),n(G,e)},[]),"aria-label":`Conversation timeout`})})})}var Ee=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];function De(){let e=N.use.pauseBeforeReplyMs(),t=N.use.setPauseBeforeReplyMs();return(0,V.jsx)(R,{title:`Pause before reply`,subtitle:`How long the assistant waits after you stop speaking before it replies. A longer pause lets you gather your thoughts mid-sentence without being cut off.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(g,{value:(e??1200)/1e3,onValueChange:e=>{typeof e==`number`&&t(Math.round(e*1e3))},min:500/1e3,max:ae/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":`Pause before reply`})})})}function Oe(){let e=N.use.interruptSensitivity(),t=N.use.setInterruptSensitivity();return(0,V.jsx)(R,{title:`Interrupt sensitivity`,subtitle:`How easily talking over the assistant interrupts it. Lower it if the assistant cuts itself off on background noise or filler words; raise it to interrupt more quickly.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(h,{items:Ee,value:e??`medium`,onChange:t,ariaLabel:`Interrupt sensitivity`})})})}export{be as VoicePage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as i}from"./QueryClientProvider-DKhXIxGb.js";import{t as a}from"./useQuery-B45lW1Kk.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./queryOptions-BtNi-_9H.js";import{t as l}from"./createLucideIcon-Bjb-Kuq7.js";import{t as u}from"./chevron-down-DpYf9Gwq.js";import{n as d,r as f,t as p}from"./panel-item-An-BBeyL.js";import{t as m}from"./menu-C9SOvGlk.js";import{t as h}from"./download-B6XjnEzx.js";import{t as g}from"./eye-off-BQ9J3pF2.js";import{t as _}from"./eye-C2rSrbD-.js";import{t as v}from"./file-text-DA128T4K.js";import{t as y}from"./file-C8pjlmtk.js";import{t as b}from"./folder-open-7DKBH5WB.js";import{t as x}from"./loader-circle-Ck8fq3yv.js";import{t as S}from"./pencil-CsnkG5VN.js";import{t as C}from"./plus-DZZypDUF.js";import{t as w}from"./x-CswtfvgS.js";import{O as T}from"./src-BNYQ8guL.js";import{t as E}from"./input-ZpyYt_a0.js";import{t as D}from"./modal-BtcwNEBj.js";import{t as O}from"./confirm-dialog-Zyfei9GV.js";import{n as k,t as A}from"./file-markdown-BXMDJYDD.js";import{Br as j,Hr as M,Ir as N,Lr as P,Rr as F,Ur as ee,zr as I}from"./sdk.gen-BR-xXIZm.js";import{n as L}from"./native-file-CIQQYbIp.js";import{Ba as R,Io as z,J as B,Ss as V,Yo as te,vs as H,xs as U,zo as W}from"./index-D5iUyXUl.js";import{n as G,t as ne}from"./mobile-sidebar-drawer-D9v0PpYI.js";import{i as K,n as re,r as q,t as J}from"./file-editor-CmUOlTjl.js";import{t as Y}from"./format-file-size-BSrdQr7P.js";var ie=l(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),ae=l(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]),X=l(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Z=e(t(),1);async function oe(e){let{data:t,error:n}=await P({path:{assistant_id:e.assistantId},query:{path:e.path,...e.showHidden?{showHidden:`true`}:{}},parseAs:`blob`,throwOnError:!1});if(n||!(t instanceof Blob))throw Error(`Failed to download file`);await L(t,e.filename)}function se(e){if(!e)return``;let t=e.indexOf(`;`);return(t===-1?e:e.slice(0,t)).trim()}function ce(e,t){return se(t)===`application/json`?!0:(e??``).toLowerCase().endsWith(`.json`)}function le(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function ue(e){return e.split(`/`).some(e=>e.startsWith(`.`))}var Q=s();function de(e){let{assistantId:t,path:n,name:r,showHidden:i}=e,[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(!1);return{isDownloading:a,error:s,download:(0,Z.useCallback)(async()=>{c(!1),o(!0);try{await oe({assistantId:t,path:n,filename:r,showHidden:i})}catch{c(!0)}finally{o(!1)}},[t,n,r,i])}}function fe({assistantId:e,path:t,name:r,showHidden:i}){let{isDownloading:a,error:o,download:s}=de({assistantId:e,path:t,name:r,showHidden:i});return(0,Q.jsx)(n,{variant:`ghost`,size:`regular`,iconOnly:a?(0,Q.jsx)(x,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(h,{"aria-hidden":!0}),onClick:()=>void s(),disabled:a,"aria-label":`Download ${r}`,tooltip:o?`Download failed. Try again.`:`Download`})}function pe(e){return c({queryFn:async()=>{let{data:t,error:n}=await F({path:e.path,query:{path:e.query.path,...e.query.showHidden?{showHidden:`true`}:{}}});if(n)throw n;return t},queryKey:[`assistantsWorkspaceFileRetrieve`,e]})}function me({mimeType:e}){let t=e.indexOf(`;`),n=(t===-1?e:e.slice(0,t)).trim(),r=v;return n.startsWith(`image/`)?r=H:n.startsWith(`video/`)?r=z:!n.startsWith(`text/`)&&n!==`application/json`&&n!==`application/octet-stream`&&(r=y),(0,Q.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 10%, transparent)`},children:(0,Q.jsx)(r,{className:`h-3.5 w-3.5`,style:{color:`var(--content-default)`}})})}function he({viewMode:e,onChange:t}){return(0,Q.jsx)(`div`,{className:`inline-flex rounded-md p-0.5`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`},children:[`preview`,`source`].map(r=>{let i=e===r;return(0,Q.jsx)(n,{variant:`ghost`,onClick:()=>t(r),className:`h-auto rounded border-0 px-2.5 py-1 text-body-small-default hover:bg-transparent`,style:{backgroundColor:i?`var(--surface-lift)`:`transparent`,color:i?`var(--content-default)`:`var(--content-tertiary)`,boxShadow:i?`0 1px 2px rgba(0,0,0,0.15)`:void 0},children:r===`preview`?`Preview`:`Source`},r)})})}function $({name:e,mimeType:t,size:n,rightContent:r}){return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(me,{mimeType:t}),(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),n!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:Y(n)})]}),r]})}function ge({assistantId:e,path:t,mimeType:n,showHidden:r}){let{data:i,isLoading:o}=a({queryFn:async()=>{let n=await P({path:{assistant_id:e},query:{path:t,...r?{showHidden:`true`}:{}},parseAs:`blob`});if(n.error)throw n.error;return n.data},queryKey:[`assistantsWorkspaceFileContentRetrieve`,{assistantId:e,path:t,showHidden:r}],enabled:!!t}),[s,c]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>{if(!i)return;let e=URL.createObjectURL(i);return c(e),()=>{URL.revokeObjectURL(e),c(null)}},[i]),o?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Q.jsx)(x,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):s?n.startsWith(`image/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`img`,{src:s,alt:t.split(`/`).pop()??`image`,className:`max-h-[70vh] max-w-full rounded object-contain`})}):n.startsWith(`video/`)?(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-4`,children:(0,Q.jsx)(`video`,{src:s,controls:!0,className:`max-h-[70vh] max-w-full rounded`})}):null:null}function _e({assistantId:e,path:t,name:r,mimeType:i,size:a,modifiedAt:o,showHidden:s}){let{isDownloading:c,error:l,download:u}=de({assistantId:e,path:t,name:r,showHidden:s});return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:r,mimeType:i,size:a}),(0,Q.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,Q.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border p-6 text-center`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-lift)`},children:[(0,Q.jsx)(y,{className:`mx-auto h-10 w-10`,style:{color:`var(--content-tertiary)`}}),(0,Q.jsx)(`p`,{className:`mt-3 text-body-medium-default`,style:{color:`var(--content-default)`},children:r}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:i}),(0,Q.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:Y(a,`Unknown size`)}),o&&(0,Q.jsxs)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-secondary, var(--content-tertiary))`},children:[`Modified: `,new Date(o).toLocaleString()]})]}),(0,Q.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:c?(0,Q.jsx)(x,{className:`animate-spin`,"aria-hidden":!0}):(0,Q.jsx)(h,{"aria-hidden":!0}),onClick:u,disabled:c,"aria-label":`Download ${r}`,className:`mt-4`,children:c?`Downloading…`:`Download`}),l&&(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default`,style:{color:`var(--system-error)`},children:`Download failed. Try again.`})]})})]})}function ve({assistantId:e,selectedPath:t,showHidden:r,viewMode:s,onChangeViewMode:c,onBrowse:l,pathRename:u,pathDelete:d}){let f=i(),{data:p,isLoading:m}=a({...pe({path:{assistant_id:e},query:{path:t??``,showHidden:r}}),enabled:!!t}),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{if(!u)return;let{from:e,to:t}=u,n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;g(e=>e==null?e:n(e)),v(e=>e==null?e:{...e,path:n(e.path)})},[u]),(0,Z.useEffect)(()=>{if(!d)return;let{path:e}=d,t=t=>t===e||t.startsWith(`${e}/`);g(e=>e!=null&&t(e)?null:e),v(e=>e!=null&&t(e.path)?null:e)},[d]);let y=h!=null&&h===t,S=p?.content??``,C=_?.path===t?_.content:S,w=()=>{g(null),v(null)},T=o({mutationFn:async({path:t,content:n})=>{let{error:r,response:i}=await ee({path:{assistant_id:e},body:{path:t,content:n,encoding:`utf8`},throwOnError:!1});if(!i?.ok||r)throw Error(`Failed to save file`)},onSuccess:(e,t)=>{g(e=>e===t.path?null:e),v(e=>e?.path===t.path?null:e),f.invalidateQueries({queryKey:[`assistantsWorkspaceFileRetrieve`]})}}),E=C!==S,D=(0,Z.useCallback)(()=>{t&&E&&!T.isPending&&T.mutate({path:t,content:C})},[t,E,T,C]);if(!t)return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view`}),l&&(0,Q.jsx)(n,{type:`button`,onClick:l,leftIcon:(0,Q.jsx)(b,{"aria-hidden":!0}),className:`sm:hidden`,children:`Browse files`})]});if(m)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(x,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})});if(!p)return(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`File not found`})});let O=p.mimeType??`application/octet-stream`,j=p.name??t.split(`/`).pop()??t,M=k(j,O),N=ce(j,O),P=p.content!=null&&!M&&!N,F=t?ue(t):!0,I=y&&(0,Q.jsx)(re,{isDirty:E,isSaving:T.isPending,error:T.isError?`Save failed`:null,onSave:D,onDiscard:w});if(M&&p.content!=null){let e=y?C:p.content;return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,rightContent:(0,Q.jsx)(he,{viewMode:s,onChange:e=>{y&&w(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:e,fileName:j,mimeType:O,showEdit:!F&&s===`source`,isEditing:y,onToggleEdit:()=>y?w():g(t)}),s===`preview`?(0,Q.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Q.jsx)(A,{content:e})}):y?(0,Q.jsx)(q,{value:C,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content,readOnly:F,onStartEdit:()=>g(t)})]}),I]})}if(N&&p.content!=null){let e=y?C:p.content,n=le(e);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,rightContent:(0,Q.jsx)(he,{viewMode:s,onChange:e=>{y&&w(),c(e)}})}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:s===`preview`?n:e,downloadContent:e,fileName:j,mimeType:O,showEdit:!F&&s===`source`,isEditing:y,onToggleEdit:()=>y?w():g(t)}),s===`preview`?(0,Q.jsx)(K,{content:n,readOnly:!0,whiteSpace:`pre`}):y?(0,Q.jsx)(q,{value:C,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content,readOnly:F,onStartEdit:()=>g(t)})]}),I]})}return P?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,size:p.size}),(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(J,{content:y?C:p.content??``,fileName:j,mimeType:O,showEdit:!F,isEditing:y,onToggleEdit:()=>y?w():g(t)}),y?(0,Q.jsx)(q,{value:C,onChange:e=>v({path:t,content:e}),onSave:D}):(0,Q.jsx)(K,{content:p.content??``,readOnly:F,onStartEdit:()=>g(t)})]}),I]}):O.startsWith(`image/`)||O.startsWith(`video/`)?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsx)($,{name:j,mimeType:O,size:p.size,rightContent:(0,Q.jsx)(fe,{assistantId:e,path:t,name:j,showHidden:r})}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,Q.jsx)(ge,{assistantId:e,path:t,mimeType:O,showHidden:r})})]}):(0,Q.jsx)(_e,{assistantId:e,path:t,name:j,mimeType:O,size:p.size,modifiedAt:p.modifiedAt,showHidden:r})}function ye(e,t){if(t===`name`)return e;let n=e.slice();return n.sort((e,t)=>{let n=e.size??null,r=t.size??null;return n===null&&r===null?(e.name??``).localeCompare(t.name??``):n===null?1:r===null?-1:n===r?(e.name??``).localeCompare(t.name??``):r-n}),n}function be(e){return c({queryFn:async()=>{let t={};e.query?.path&&(t.path=e.query.path),e.query?.showHidden&&(t.showHidden=`true`),e.query?.includeDirSizes&&(t.includeDirSizes=`true`);let{data:n,error:r}=await M({path:e.path,query:t});if(r)throw r;if(!n)throw Error(`Failed to load workspace tree`);return n},queryKey:[`assistantsWorkspaceTreeRetrieve`,e]})}async function xe(e,t,n,r){let i=n.toLowerCase(),a=r?.toLowerCase(),{data:o}=await M({path:{assistant_id:e},query:t?{path:t}:{}});if(o?.entries?.some(e=>{let t=(e.name??``).toLowerCase();return t===i&&t!==a}))throw Error(`"${n}" already exists here.`)}function Se({entry:e}){return e.type===`directory`?(0,Q.jsx)(U,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`image/`)?(0,Q.jsx)(H,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):e.mimeType?.startsWith(`video/`)?(0,Q.jsx)(z,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(v,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`}})}function Ce({entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:p,onRequestCreate:m,depth:h}){let g=e.path??``,_=e.name??``,v=e.type===`directory`,y=n.has(g),b=r===g,x=_.startsWith(`.`),C=!ue(g),w=v&&(y||s.length>0),{data:E}=a({...be({path:{assistant_id:t},query:{path:g,showHidden:i,includeDirSizes:o===`size`}}),enabled:v&&w}),D=(0,Z.useMemo)(()=>ye(E?.entries??[],o),[E?.entries,o]),O=s===``||_.toLowerCase().includes(s);if(s!==``&&!v&&!O)return null;let k=(0,Q.jsxs)(`button`,{onClick:()=>{v?c(g):l(g)},className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{paddingLeft:`${h*14+8}px`,paddingRight:`8px`,color:b?`var(--content-default)`:x?`var(--content-tertiary)`:`var(--content-default)`,backgroundColor:b?`color-mix(in oklab, var(--primary-base) 12%, transparent)`:void 0,opacity:x&&!b?.7:1},children:[v?w?(0,Q.jsx)(u,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(f,{className:`h-3 w-3 shrink-0`,style:{color:`var(--content-tertiary)`}}):(0,Q.jsx)(`span`,{className:`h-3 w-3 shrink-0`}),(0,Q.jsx)(Se,{entry:e}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:_}),e.size!=null&&(0,Q.jsx)(`span`,{className:`shrink-0 text-label-medium-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:Y(e.size)})]});return(0,Q.jsxs)(`div`,{children:[C?(0,Q.jsxs)(T.Root,{children:[(0,Q.jsx)(T.Trigger,{children:k}),(0,Q.jsxs)(T.Content,{children:[v&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(T.Item,{leftIcon:(0,Q.jsx)(V,{className:`h-3.5 w-3.5`}),onSelect:()=>m({kind:`file`,parentPath:g}),children:`New File`}),(0,Q.jsx)(T.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>m({kind:`folder`,parentPath:g}),children:`New Folder`}),(0,Q.jsx)(T.Separator,{})]}),(0,Q.jsx)(T.Item,{leftIcon:(0,Q.jsx)(W,{className:`h-3.5 w-3.5`}),onSelect:()=>d({path:g,name:_,isDirectory:v}),children:`Delete`}),(0,Q.jsx)(T.Item,{leftIcon:(0,Q.jsx)(S,{className:`h-3.5 w-3.5`}),onSelect:()=>p({path:g,name:_,isDirectory:v}),children:`Rename`})]})]}):k,v&&w&&D.length>0&&(0,Q.jsx)(`div`,{children:D.map(e=>(0,Q.jsx)(Ce,{entry:e,assistantId:t,expandedPaths:n,selectedPath:r,showHidden:i,sortMode:o,searchLower:s,onToggleExpand:c,onSelectPath:l,onRequestDelete:d,onRequestRename:p,onRequestCreate:m,depth:h+1},e.path))})]})}function we({title:e,placeholder:t,confirmLabel:r,pendingLabel:i,initialName:a,onCancel:o,onConfirm:s,pending:c,error:l}){let u=(0,Z.useRef)(null),[d,f]=(0,Z.useState)(a??``),p=d.trim(),m=p.length>0&&(/[/\\]/.test(p)||p===`.`||p===`..`),h=p.length>0&&!m&&!c;return(0,Q.jsx)(D.Root,{open:!0,onOpenChange:e=>{!e&&!c&&o()},children:(0,Q.jsx)(D.Content,{size:`sm`,hideCloseButton:!0,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault();let t=u.current;t&&(t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(0,t.value.length)}))},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),c||o()},children:(0,Q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),h&&s(p)},children:[(0,Q.jsx)(D.Header,{children:(0,Q.jsx)(D.Title,{children:e})}),(0,Q.jsx)(D.Body,{children:(0,Q.jsx)(E,{ref:u,label:`Name`,value:d,onChange:e=>f(e.target.value),placeholder:t,errorText:l??(m?`Enter a single file or folder name without slashes.`:void 0),autoComplete:`off`,spellCheck:!1,fullWidth:!0})}),(0,Q.jsxs)(D.Footer,{children:[(0,Q.jsx)(n,{type:`button`,variant:`outlined`,onClick:o,disabled:c,children:`Cancel`}),(0,Q.jsx)(n,{type:`submit`,variant:`primary`,disabled:!h,children:c?i:r})]})]})})})}function Te({assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,onToggleExpand:l,onExpandPath:u,onSelectPath:d,onToggleShowHidden:f,onChangeSortMode:p,onPathDeleted:m,onPathRenamed:h}){let v=i(),[y,b]=(0,Z.useState)(``),x=y.trim().toLowerCase(),[S,C]=(0,Z.useState)(!1),[T,D]=(0,Z.useState)(null),[k,A]=(0,Z.useState)(null),M=(0,Z.useCallback)(()=>{D(null),A(null)},[]),{data:P,isLoading:F}=a(be({path:{assistant_id:e},query:{showHidden:s,includeDirSizes:c===`size`}})),L=(0,Z.useMemo)(()=>ye(P?.entries??[],c),[P?.entries,c]),R=(0,Z.useCallback)(()=>{for(let e of[`assistantsWorkspaceTreeRetrieve`,`assistantsWorkspaceFileRetrieve`,`assistantsWorkspaceFileContentRetrieve`])v.invalidateQueries({queryKey:[e]})},[v]),z=o({mutationFn:async t=>{let n=t.parentPath?`${t.parentPath}/${t.name}`:t.name;await xe(e,t.parentPath,t.name);let{error:r,response:i}=t.kind===`file`?await ee({path:{assistant_id:e},body:{path:n,content:``,encoding:`utf8`},throwOnError:!1}):await I({path:{assistant_id:e},body:{path:n},throwOnError:!1});if(r||!i?.ok)throw Error(typeof r==`string`?r:`Failed to create — check the name and try again.`);return{...t,path:n}},onSuccess:e=>{M(),R(),e.parentPath&&u(e.parentPath),e.kind===`file`?d(e.path):u(e.path)},onError:e=>{A(e instanceof Error?e.message:`Failed to create.`)}}),B=o({mutationFn:async t=>{let n=t.oldPath.lastIndexOf(`/`),r=n===-1?``:t.oldPath.slice(0,n),i=t.oldPath.slice(n+1),a=r?`${r}/${t.newName}`:t.newName;await xe(e,r,t.newName,i);let{error:o,response:s}=await j({path:{assistant_id:e},body:{oldPath:t.oldPath,newPath:a},throwOnError:!1});if(o||!s?.ok)throw Error(typeof o==`string`?o:`Failed to rename — check the name and try again.`);return{oldPath:t.oldPath,newPath:a}},onSuccess:({oldPath:e,newPath:t})=>{M(),R(),h(e,t)},onError:e=>{A(e instanceof Error?e.message:`Failed to rename.`)}}),V=(0,Z.useCallback)(e=>{A(null),D({type:`create`,...e})},[]),H=(0,Z.useCallback)(e=>{A(null),D({type:`rename`,path:e.path,name:e.name})},[]),[U,W]=(0,Z.useState)(null),G=o({mutationFn:async t=>{let{error:n,response:r}=await N({path:{assistant_id:e},body:{path:t.path},throwOnError:!1});if(n||!r?.ok)throw Error(typeof n==`string`?n:`Failed to delete — try again.`);return t},onSuccess:e=>{W(null),R(),m(e.path)}}),ne=(0,Z.useCallback)(e=>{G.reset(),W(e)},[G]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2.5`,style:{borderColor:`var(--border-element)`},children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-secondary)`},children:`Files`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:c===`size`?(0,Q.jsx)(ae,{"aria-hidden":!0}):(0,Q.jsx)(ie,{"aria-hidden":!0}),onClick:()=>p(c===`size`?`name`:`size`),"aria-label":c===`size`?`Sort by name`:`Sort by size`,title:c===`size`?`Sorted by size — switch to name`:`Sorted by name — switch to size`,tintColor:c===`size`?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:s?(0,Q.jsx)(_,{"aria-hidden":!0}):(0,Q.jsx)(g,{"aria-hidden":!0}),onClick:f,"aria-label":s?`Hide hidden files`:`Show hidden files`,title:s?`Hide hidden files`:`Show hidden files`,tintColor:s?`var(--content-default)`:`var(--content-tertiary)`}),(0,Q.jsx)(Ee,{open:S,onOpenChange:C,onSelectKind:e=>{C(!1),V({kind:e,parentPath:``})}})]})]}),(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(E,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Search files`,leftIcon:(0,Q.jsx)(te,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,spellCheck:!1,autoComplete:`off`}),y&&(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(w,{"aria-hidden":!0}),onClick:()=>b(``),"aria-label":`Clear search`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,tintColor:`var(--content-tertiary)`})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto py-1`,children:F?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`,style:{color:`var(--content-tertiary)`}})}):L.length?L.map(n=>(0,Q.jsx)(Ce,{entry:n,assistantId:e,expandedPaths:t,selectedPath:r,showHidden:s,sortMode:c,searchLower:x,onToggleExpand:l,onSelectPath:d,onRequestDelete:ne,onRequestRename:H,onRequestCreate:V,depth:0},n.path)):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No files found`})}),T?.type===`create`&&(0,Q.jsx)(we,{title:T.kind===`file`?`New File`:`New Folder`,placeholder:T.kind===`file`?`filename.md`:`folder-name`,confirmLabel:`Create`,pendingLabel:`Creating…`,onCancel:M,onConfirm:e=>{A(null),z.mutate({kind:T.kind,parentPath:T.parentPath,name:e})},pending:z.isPending,error:k},`create-${T.kind}-${T.parentPath}`),T?.type===`rename`&&(0,Q.jsx)(we,{title:`Rename`,placeholder:T.name,confirmLabel:`Rename`,pendingLabel:`Renaming…`,initialName:T.name,onCancel:M,onConfirm:e=>{if(e===T.name){M();return}A(null),B.mutate({oldPath:T.path,newName:e})},pending:B.isPending,error:k},`rename-${T.path}`),(0,Q.jsx)(O,{open:U!==null,title:U?.isDirectory?`Delete Folder`:`Delete File`,message:(0,Q.jsxs)(Q.Fragment,{children:[`Are you sure you want to delete`,` `,(0,Q.jsx)(`span`,{style:{color:`var(--content-default)`},children:U?.name}),U?.isDirectory?` and all of its contents`:``,`? This cannot be undone.`,G.error&&(0,Q.jsx)(`span`,{className:`mt-2 block`,style:{color:`var(--system-negative-strong)`},children:G.error.message})]}),confirmLabel:G.isPending?`Deleting…`:`Delete`,destructive:!0,isPending:G.isPending,onConfirm:()=>{U&&G.mutate(U)},onCancel:()=>W(null)})]})}function Ee({open:e,onOpenChange:t,onSelectKind:r}){return R()?(0,Q.jsxs)(d.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(d.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(C,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(d.Content,{children:[(0,Q.jsx)(d.Header,{className:`sr-only`,children:(0,Q.jsx)(d.Title,{children:`Create new`})}),(0,Q.jsxs)(d.Body,{className:`pt-0`,children:[(0,Q.jsx)(p,{icon:V,label:`New File`,onSelect:()=>r(`file`)}),(0,Q.jsx)(p,{icon:X,label:`New Folder`,onSelect:()=>r(`folder`)})]})]})]}):(0,Q.jsxs)(m.Root,{open:e,onOpenChange:t,children:[(0,Q.jsx)(m.Trigger,{asChild:!0,children:(0,Q.jsx)(n,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Q.jsx)(C,{"aria-hidden":!0}),"aria-label":`Create new file or folder`,title:`New file or folder`,tintColor:`var(--content-tertiary)`})}),(0,Q.jsxs)(m.Content,{align:`end`,sideOffset:4,children:[(0,Q.jsx)(m.Item,{leftIcon:(0,Q.jsx)(V,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`file`),children:`New File`}),(0,Q.jsx)(m.Item,{leftIcon:(0,Q.jsx)(X,{className:`h-3.5 w-3.5`}),onSelect:()=>r(`folder`),children:`New Folder`})]})]})}function De(e){let t=e.split(`/`),n=new Set;for(let e=1;e<t.length;e++)n.add(t.slice(0,e).join(`/`));return n}function Oe({assistantId:e}){let[t,n]=r(),[i,a]=(0,Z.useState)(()=>{let e=t.get(`file`);return e?De(e):new Set}),[o,s]=(0,Z.useState)(()=>t.get(`file`)),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(()=>t.get(`sort`)===`size`?`size`:`name`),[f,p]=(0,Z.useState)(`preview`);(0,Z.useEffect)(()=>{t.get(`file`)&&n(e=>{let t=new URLSearchParams(e);return t.delete(`file`),t},{replace:!0})},[]);let m=(0,Z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),h=(0,Z.useCallback)(e=>{a(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),[g,_]=(0,Z.useState)(!1),v=(0,Z.useCallback)(e=>{s(e),_(!1)},[]),[y,b]=(0,Z.useState)(null),x=(0,Z.useCallback)(e=>{let t=t=>t===e||t.startsWith(`${e}/`);s(e=>e!==null&&t(e)?null:e),a(e=>{let n=new Set([...e].filter(e=>!t(e)));return n.size===e.size?e:n}),b({path:e})},[]),[S,C]=(0,Z.useState)(null),w={assistantId:e,expandedPaths:i,selectedPath:o,showHidden:c,sortMode:u,onToggleExpand:m,onExpandPath:h,onSelectPath:v,onToggleShowHidden:()=>l(e=>!e),onChangeSortMode:d,onPathDeleted:x,onPathRenamed:(0,Z.useCallback)((e,t)=>{let n=n=>n===e?t:n.startsWith(`${e}/`)?t+n.slice(e.length):n;s(e=>e===null?e:n(e)),a(e=>{let t=!1,r=new Set;for(let i of e){let e=n(i);e!==i&&(t=!0),r.add(e)}return t?r:e}),C({from:e,to:t})},[])};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4`,children:[(0,Q.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,Q.jsx)(G,{onClick:()=>_(!0)})}),(0,Q.jsx)(ne,{open:g,onClose:()=>_(!1),title:`Files`,children:(0,Q.jsx)(Te,{...w})}),(0,Q.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-4 sm:grid-cols-[320px_1fr]`,children:[(0,Q.jsx)(`div`,{className:`hidden min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border sm:flex`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(Te,{...w})}),(0,Q.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border`,style:{backgroundColor:`var(--surface-overlay)`,borderColor:`var(--border-base)`},children:(0,Q.jsx)(ve,{assistantId:e,selectedPath:o,showHidden:c,viewMode:f,onChangeViewMode:p,onBrowse:()=>_(!0),pathRename:S,pathDelete:y})})]})]})}function ke(){return(0,Q.jsx)(Oe,{assistantId:B()})}export{ke as WorkspacePage};