@vellumai/web 0.12.5-staging.2 → 0.12.5
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.
- package/dist/assets/{a2a-invite-2n6gRbID.js → a2a-invite-2DFcr5cK.js} +1 -1
- package/dist/assets/{about-page-N1N2ME9b.js → about-page-CPNBbifd.js} +1 -1
- package/dist/assets/{account-page-DOnTpuZ-.js → account-page-CJ_VtU8O.js} +1 -1
- package/dist/assets/{account-shell-CDePfCVi.js → account-shell-DxLEvbei.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-B3R4i5mk.js → acp-run-detail-panel-CB_kEsnS.js} +1 -1
- package/dist/assets/{activation-list-route-CHvtTpMz.js → activation-list-route-CGW4JxwN.js} +1 -1
- package/dist/assets/{activity-redirect-page-CTTRdkxc.js → activity-redirect-page-BIjoWTCA.js} +1 -1
- package/dist/assets/{activity-steps-panel-DR0Y2oZk.js → activity-steps-panel-DMQrQxtA.js} +1 -1
- package/dist/assets/add-credits-modal-Dv7XHwyy.js +1 -0
- package/dist/assets/{add-credits-modal-Bf3UIKWo.js → add-credits-modal-LuPOq4kF.js} +1 -1
- package/dist/assets/{ai-page-nn0k_IIb.js → ai-page-BYnMIWGK.js} +1 -1
- package/dist/assets/{all-chats-page-route-CPhckAtu.js → all-chats-page-route-nS138Vap.js} +1 -1
- package/dist/assets/{android-billing-handoff-Bdbyo5OG.js → android-billing-handoff-Q1a-ZHj3.js} +1 -1
- package/dist/assets/{animated-stat-square-C1mgqXq8.js → animated-stat-square--YG74D1T.js} +1 -1
- package/dist/assets/{api-key-screen-BRkuexDs.js → api-key-screen-CYEJaUQl.js} +1 -1
- package/dist/assets/app-Dy5YEvtr.css +2 -0
- package/dist/assets/{app-g1TvV-Dl.js → app-XG_RF2yi.js} +55 -55
- package/dist/assets/{app-info-R4Y_BPoT.js → app-info-zQFV6PZi.js} +1 -1
- package/dist/assets/{archive-redirect-page-Cb4LdH50.js → archive-redirect-page-DQbvA1Z-.js} +1 -1
- package/dist/assets/{assistant-handle-modal-BQBleuWg.js → assistant-handle-modal-CbatcZHT.js} +1 -1
- package/dist/assets/{assistant-inbox-page-route-CWQiF8gx.js → assistant-inbox-page-route-CxI0ViyX.js} +1 -1
- package/dist/assets/{assistant-inbox-upgrade-body-D3qYrXZU.js → assistant-inbox-upgrade-body-UUuOySwQ.js} +1 -1
- package/dist/assets/{assistant-status-panel-Dz8eNfbE.js → assistant-status-panel-Db_tR-He.js} +1 -1
- package/dist/assets/auth-store-CpGZaJMT.js +1 -0
- package/dist/assets/{auth-welcome-screen-CYoMdZVW.js → auth-welcome-screen-CCmw8K2q.js} +1 -1
- package/dist/assets/avatar-bundled-components-BOhrT2YY.js +1 -0
- package/dist/assets/{avatar-random-7_b8sN9c.js → avatar-random-ChM4pm8c.js} +2 -2
- package/dist/assets/{await-org-header-settled-BaNRynwI.js → await-org-header-settled-D7gXGNkp.js} +1 -1
- package/dist/assets/{background-task-detail-panel-DyQHMRcX.js → background-task-detail-panel-BfpAZAV7.js} +1 -1
- package/dist/assets/billing-page-D4Aw0uK5.js +3 -0
- package/dist/assets/{billing-redirect-page-DisLOg_5.js → billing-redirect-page-CPoe8Fxo.js} +1 -1
- package/dist/assets/{bookmarks-page-CaKBt1k4.js → bookmarks-page-DabizPXt.js} +1 -1
- package/dist/assets/{bundle-confirm-page-W2r6YW2S.js → bundle-confirm-page--s00f5SK.js} +1 -1
- package/dist/assets/{channel-transcript-panel-DjZfVDU6.js → channel-transcript-panel-kIskgOQO.js} +1 -1
- package/dist/assets/{channels-page-route-fjQyOftI.js → channels-page-route-DBYtimrU.js} +1 -1
- package/dist/assets/{chat-info-panel-CQwSB97L.js → chat-info-panel-C8-aLnsR.js} +1 -1
- package/dist/assets/{checkout-continuation-CGCnWbzu.js → checkout-continuation-DV6qqLmB.js} +1 -1
- package/dist/assets/{checkout-page-DoYMFyd4.js → checkout-page-CDszxDKy.js} +1 -1
- package/dist/assets/checkout-return-target-kOAtAdtD.js +1 -0
- package/dist/assets/{command-palette-D0KYxCnU.js → command-palette-CvSDYYKx.js} +1 -1
- package/dist/assets/{command-palette-window-page-BTVDAM95.js → command-palette-window-page-vfJ8M15E.js} +1 -1
- package/dist/assets/command-palette-xzqumNt2.js +1 -0
- package/dist/assets/{community-page--2IpZpKw.js → community-page-Dnrsh7JC.js} +1 -1
- package/dist/assets/{companion-accent-CBLb9Kpv.js → companion-accent-CbS8BVae.js} +1 -1
- package/dist/assets/{companion-dock-zones-page-DxuMrFf9.js → companion-dock-zones-page-CRsK4Pv9.js} +1 -1
- package/dist/assets/{companion-layout-C6tp_Wvl.js → companion-layout-DCGXuvsw.js} +1 -1
- package/dist/assets/{companion-popover-B7KpH4N8.js → companion-popover-BsoxqJOP.js} +1 -1
- package/dist/assets/{companion-popover-page-YQKBZlNX.js → companion-popover-page-B-tbPgw2.js} +1 -1
- package/dist/assets/{companion-surface-DM4lsh7V.js → companion-surface-Lu_Uj_QW.js} +1 -1
- package/dist/assets/{companion-surface-page-BvvOIZO_.js → companion-surface-page-Cu5KYGHm.js} +1 -1
- package/dist/assets/{companion-tour-entry-BBJtal5R.js → companion-tour-entry-C3txdrPi.js} +1 -1
- package/dist/assets/{companion-watch-frame-page-D_cml_5E.js → companion-watch-frame-page-CxWQHVyd.js} +1 -1
- package/dist/assets/{connect-page-De9qYGFr.js → connect-page-BnIPLsIl.js} +1 -1
- package/dist/assets/{consent-controls-gxLFaZqC.js → consent-controls-CzokWb_V.js} +1 -1
- package/dist/assets/{contacts-gateway-xRhaWZVq.js → contacts-gateway-CXKsci-d.js} +1 -1
- package/dist/assets/{contacts-page-route-DuAdAqXe.js → contacts-page-route-rxGvMBYc.js} +1 -1
- package/dist/assets/{copy-button-DUDzh1nb.js → copy-button-CDraE4Q7.js} +1 -1
- package/dist/assets/{credential-entry-page-DMfgwRck.js → credential-entry-page-CISniD8g.js} +1 -1
- package/dist/assets/{credentials-page-CMgmkOGd.js → credentials-page-CY8AWXDI.js} +1 -1
- package/dist/assets/{csv-preview-CQY-2Dx9.js → csv-preview-CIYuh6hO.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-yy5xW0mL.js → danger-zone-redirect-page-CvReBloK.js} +1 -1
- package/dist/assets/{debug-page-BU3-JUrT.js → debug-page-Bi_rgZ5l.js} +1 -1
- package/dist/assets/deploy-dialogs-C2piFvJp.js +1 -0
- package/dist/assets/{deploy-dialogs-Daud7Ibu.js → deploy-dialogs-HsxdyBbf.js} +1 -1
- package/dist/assets/{desktop-preview-content-Cg0mJFW9.js → desktop-preview-content-CV1cf7mU.js} +2 -2
- package/dist/assets/{desktop-status-DGbF0l_T.js → desktop-status-DEExfNSz.js} +1 -1
- package/dist/assets/{desktop-viewer-ClERTjPw.js → desktop-viewer-D7Wghl4J.js} +1 -1
- package/dist/assets/{detail-card-uV-Fvv0m.js → detail-card-C7tTQwmv.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-CpIFrlAa.js → detail-panel-stop-button-DnqOX8hL.js} +1 -1
- package/dist/assets/{detail-primitives-BVAXXLTM.js → detail-primitives-wlzeidYY.js} +1 -1
- package/dist/assets/{developer-page-C2US1ngx.js → developer-page-BCRjXz1c.js} +1 -1
- package/dist/assets/{devices-redirect-page-C6LAvhsi.js → devices-redirect-page-7ye90eAr.js} +1 -1
- package/dist/assets/{dictation-overlay-page-4Ws_3jMt.js → dictation-overlay-page-DOBCTXi_.js} +1 -1
- package/dist/assets/{document-load-Bc7bzEgK.js → document-load-C2pkXMId.js} +1 -1
- package/dist/assets/document-load-D-wTWGym.js +1 -0
- package/dist/assets/{document-viewer-page-rYlc99qC.js → document-viewer-page-DOzOlaOx.js} +1 -1
- package/dist/assets/{emails-page-BoKSj0Bi.js → emails-page-BcGsKx08.js} +1 -1
- package/dist/assets/{file-diff-view-D4vpp28T.js → file-diff-view-Cl9aJla4.js} +1 -1
- package/dist/assets/{file-view-mode-CFTpeJXr.js → file-view-mode-B1UgDONH.js} +1 -1
- package/dist/assets/{general-page-CCuGQaED.js → general-page-D5BxF2Og.js} +1 -1
- package/dist/assets/{hatching-screen-DlG-aMJX.js → hatching-screen-6FiOHAnm.js} +1 -1
- package/dist/assets/{hosting-screen-COVzfBVx.js → hosting-screen-CYbWPSH7.js} +1 -1
- package/dist/assets/{identity-page-route-9SdenOmX.js → identity-page-route-B7hLB4vt.js} +1 -1
- package/dist/assets/{inspect-page-9FD0Y4Wu.js → inspect-page-Q3Uns0YC.js} +3 -3
- package/dist/assets/{integrations-page-CXrP8dj3.js → integrations-page-C--xdzQF.js} +1 -1
- package/dist/assets/{intelligence-layout-_R-R-8WX.js → intelligence-layout-5NiOjPJY.js} +1 -1
- package/dist/assets/{intelligence-layout-slots-store-DfpF-AiU.js → intelligence-layout-slots-store-DTzofJ6x.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-redirect-page-CD21JSvn.js → keyboard-shortcuts-redirect-page-BXubnemT.js} +1 -1
- package/dist/assets/{latest-assistant-text-D5_fKeDo.js → latest-assistant-text-C5_QcZxG.js} +1 -1
- package/dist/assets/{library-detail-page-DG-7BXZ4.js → library-detail-page-lz31jiv2.js} +1 -1
- package/dist/assets/{library-page-DRUkvK5M.js → library-page-Cqt_PX2Z.js} +1 -1
- package/dist/assets/local-mode-BdKYdq-q.js +1 -0
- package/dist/assets/{login-page-BqaYnqWg.js → login-page-BcSmXRpH.js} +1 -1
- package/dist/assets/{logout-page-C6QRRvol.js → logout-page-BiLyA8KS.js} +1 -1
- package/dist/assets/{logs-layout-CgZTvfsn.js → logs-layout-DtEdDxuo.js} +1 -1
- package/dist/assets/{markdown-preview-CjIFQp7z.js → markdown-preview-BZ0peNgQ.js} +1 -1
- package/dist/assets/{media-preview-CQ5_mth7.js → media-preview-WLwNLylQ.js} +1 -1
- package/dist/assets/{memory-page-route-CMctq-2Y.js → memory-page-route-ULkaZxE1.js} +1 -1
- package/dist/assets/{memory-router-playground-page-dreB6wRu.js → memory-router-playground-page-BW7vZW_9.js} +1 -1
- package/dist/assets/{message-files-panel-CDRctrdn.js → message-files-panel-CjeAStji.js} +1 -1
- package/dist/assets/native-attachment-pickers-DyuoT-EL.js +1 -0
- package/dist/assets/native-file-xbQpY6mL.js +1 -0
- package/dist/assets/{notifications-page-u4JixJTc.js → notifications-page-CJRzep02.js} +1 -1
- package/dist/assets/{oauth-complete-page-C9Yh4aN1.js → oauth-complete-page-ocdI_rC8.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-T4U79Q12.js → oauth-popup-complete-page-HK8d4Spc.js} +1 -1
- package/dist/assets/paired-platform-identity-BPPyfzDM.js +1 -0
- package/dist/assets/{pairing-page-CmjjyJSK.js → pairing-page-DnBwkmV0.js} +1 -1
- package/dist/assets/password-reset-page-B6LfA1PC.js +1 -0
- package/dist/assets/{pdf-file-preview-BV59QVcL.js → pdf-file-preview-BICwIHq3.js} +1 -1
- package/dist/assets/{permission-guide-page-Zb7kuXV2.js → permission-guide-page-z6AAkvY2.js} +1 -1
- package/dist/assets/{permission-setup-D8C_-pLn.js → permission-setup-DQzKLhBn.js} +1 -1
- package/dist/assets/{personality-page-Bl2WDg64.js → personality-page-CKLYnk7H.js} +1 -1
- package/dist/assets/{personality-page-Cl6IWyFN.js → personality-page-CzJKC8lv.js} +1 -1
- package/dist/assets/{personality-sliders-CHGQlasL.js → personality-sliders-Dd3JGL5I.js} +1 -1
- package/dist/assets/{plans-page-CX_DS3pd.js → plans-page-DDs81rnq.js} +1 -1
- package/dist/assets/{platform-loopback-page-BbAZA0xo.js → platform-loopback-page-BC5gtTbI.js} +1 -1
- package/dist/assets/{plugin-detail-page-Y171rg5Z.js → plugin-detail-page-Dre4KSYH.js} +1 -1
- package/dist/assets/{plugins-page-7JFDRd3d.js → plugins-page-BJhR5JYi.js} +1 -1
- package/dist/assets/plugins-surface-B99o65kn.js +1 -0
- package/dist/assets/{preview-error-DRiLBVjC.js → preview-error-BSpmr-KH.js} +1 -1
- package/dist/assets/{privacy-page-BbzNYunu.js → privacy-page-BUf0Wrj1.js} +1 -1
- package/dist/assets/{privacy-screen-DRWTgt4o.js → privacy-screen-CRkWqj_4.js} +1 -1
- package/dist/assets/{profile-card-BUk3o7SO.js → profile-card-BDi2Aa7O.js} +1 -1
- package/dist/assets/{provider-callback-page-4eckbJpB.js → provider-callback-page-xSMG5fuv.js} +1 -1
- package/dist/assets/{provider-key-CJJJNyHJ.js → provider-key-CY2sGv7V.js} +1 -1
- package/dist/assets/{provider-signup-page-DEgiOj-f.js → provider-signup-page-CYvh6GNB.js} +1 -1
- package/dist/assets/{quick-input-page-DaqK2hi0.js → quick-input-page-Lfrb-P2b.js} +1 -1
- package/dist/assets/referral-modal--kTnJAWn.js +1 -0
- package/dist/assets/{referral-modal-IFQp20cn.js → referral-modal-Bk5N1oeX.js} +1 -1
- package/dist/assets/{research-mock-page-C9fb3mU6.js → research-mock-page-BdpSM2ZV.js} +1 -1
- package/dist/assets/{research-onboarding-route-Cm8d8gDB.js → research-onboarding-route-DLbIS8Fh.js} +1 -1
- package/dist/assets/{review-terms-screen-DMQInhYK.js → review-terms-screen-DXYmPnS3.js} +1 -1
- package/dist/assets/routes-CJexmSc5.js +1 -0
- package/dist/assets/{schedules--58e813j.js → schedules-B_xQSD0K.js} +1 -1
- package/dist/assets/{schedules-page-B6cSKNVA.js → schedules-page--mjVQq8F.js} +1 -1
- package/dist/assets/{security-redirect-page-BP_ofq6j.js → security-redirect-page-CJJqdMen.js} +1 -1
- package/dist/assets/{select-assistant-screen-BG3K7gmK.js → select-assistant-screen-CWrLBgEC.js} +1 -1
- package/dist/assets/{self-hosted-servers-BWwS6drJ.js → self-hosted-servers-ByTPcaPx.js} +1 -1
- package/dist/assets/{service-form-controls-DdqTR20W.js → service-form-controls-DtPD00wU.js} +1 -1
- package/dist/assets/{setting-row-DUPI2E5K.js → setting-row-CaZDTGD2.js} +1 -1
- package/dist/assets/settings-CF0G96O8.js +3 -0
- package/dist/assets/settings-D9aUsORh.js +3 -0
- package/dist/assets/{settings-Bxxp6jKc.js → settings-XqI4_biG.js} +1 -1
- package/dist/assets/{settings-layout-Bwhzzkgd.js → settings-layout-DNdADVFk.js} +1 -1
- package/dist/assets/{settings-B267Hpr6.js → settings-ooHvceam.js} +1 -1
- package/dist/assets/{share-feedback-modal-dOu0B-Md.js → share-feedback-modal-BcKnGtHL.js} +1 -1
- package/dist/assets/share-feedback-modal-DF6Y_Ddr.js +1 -0
- package/dist/assets/{sidebar-tree-EIcBry0H.js → sidebar-tree-BTeywUnh.js} +1 -1
- package/dist/assets/{signup-page-iMX6V56Q.js → signup-page-C3giBlX2.js} +1 -1
- package/dist/assets/{signup-shell-DE0anhe6.js → signup-shell-GSIPLhaj.js} +1 -1
- package/dist/assets/{skill-detail-page-DY4PImw4.js → skill-detail-page-Deqf_hR_.js} +1 -1
- package/dist/assets/{skill-detail-panel-C5ehfnq7.js → skill-detail-panel-Dxor1hrH.js} +1 -1
- package/dist/assets/{skill-removal-dialog-BUKv2Tas.js → skill-removal-dialog-BT--h1By.js} +1 -1
- package/dist/assets/{skills-page-D0nQMb4s.js → skills-page-KhBWpqn3.js} +1 -1
- package/dist/assets/{sounds-page-BHxwlTqF.js → sounds-page-DTRSATq6.js} +1 -1
- package/dist/assets/{start-screen-BNWpr3jU.js → start-screen-xL6YeEfA.js} +1 -1
- package/dist/assets/{step-detail-header-B4fNZIZg.js → step-detail-header-q2pswG-E.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-DfBKJmLh.js → stt-language-picker-modal-oMpmGSKQ.js} +1 -1
- package/dist/assets/{subagent-detail-panel-ByW7jl3W.js → subagent-detail-panel-BbfzXdX1.js} +1 -1
- package/dist/assets/{superpowers-page-D_RuLpvG.js → superpowers-page-Bew1AAic.js} +1 -1
- package/dist/assets/{system-events-page-C7X57xA5.js → system-events-page-CyvA59Rb.js} +1 -1
- package/dist/assets/{system-events-redirect-page-CTGlRdMz.js → system-events-redirect-page-BlGZqWyR.js} +1 -1
- package/dist/assets/{teleport-gateway-client-B-Ymh7N4.js → teleport-gateway-client-ZoYt4yRw.js} +1 -1
- package/dist/assets/{text-preview-DXRIEUbr.js → text-preview-C4goqoCR.js} +1 -1
- package/dist/assets/{theme-stage-page-T1E0J2aJ.js → theme-stage-page-wBctgsW9.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DqmlydKI.js → tiptap-document-editor-9k3KCMGt.js} +1 -1
- package/dist/assets/tool-detail-panel-BXJOMwEr.js +1 -0
- package/dist/assets/{tool-detail-panel-Cy_HQVT-.js → tool-detail-panel-D3kcmDuC.js} +1 -1
- package/dist/assets/{trait-cycle-row-BNqcZU0H.js → trait-cycle-row-Bj1z4vx9.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-BH0iigJ_.js → upgrade-cancel-page-B8aHpJFd.js} +1 -1
- package/dist/assets/{upgrade-success-page-CQTTbbGB.js → upgrade-success-page-Dj6egC1G.js} +1 -1
- package/dist/assets/{usage-redirect-page-4wBYE6Hz.js → usage-redirect-page-Cc7zOqgH.js} +1 -1
- package/dist/assets/{use-app-delete-BqUAzWOi.js → use-app-delete-S-DdyUwn.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-DsO3-hL9.js → use-assistant-identity-details-DT3Hy4pf.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-DpbPh5Dv.js → use-checkout-dismiss-refresh-DV7QRuSY.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-C_dV-uDl.js → use-edge-swipe-back-BCvtCYFp.js} +1 -1
- package/dist/assets/{use-hotkey-recorder-DSplqHTv.js → use-hotkey-recorder-BIhIsp-5.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-BbFm0xLB.js → use-invite-link-dialog-DQEUmYHq.js} +1 -1
- package/dist/assets/{use-plugins-list-v7ZdJF5y.js → use-plugins-list-DPWrP6Mv.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-e_HCiNdS.js → use-return-to-short-circuit-BVGVwuLm.js} +1 -1
- package/dist/assets/{use-side-list-room-CJYjHQez.js → use-side-list-room-DH5gDKs9.js} +1 -1
- package/dist/assets/{use-skill-actions-U5IaZ-Z1.js → use-skill-actions-CMoU5oFT.js} +1 -1
- package/dist/assets/{use-skill-detail-files-B2ECj0iR.js → use-skill-detail-files-19-kefs2.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-Bq2yot1y.js +1 -0
- package/dist/assets/{use-transcript-message-by-id-De7Rp17U.js → use-transcript-message-by-id-KYGOx3D6.js} +1 -1
- package/dist/assets/{voice-page-CUNQ2QJA.js → voice-page-Cuy1oc6q.js} +1 -1
- package/dist/assets/{wake-detail-panel-BouMf1FM.js → wake-detail-panel-B6BImUJo.js} +1 -1
- package/dist/assets/{weather-forecast-display-Ea8cYhbQ.js → weather-forecast-display-BvUd--wf.js} +1 -1
- package/dist/assets/{welcome-screen-Bh45FGdD.js → welcome-screen-CtVGX2aV.js} +1 -1
- package/dist/assets/{workflow-detail-panel-BfplcjXd.js → workflow-detail-panel-DMYrbO29.js} +1 -1
- package/dist/assets/{workspace-page-Cn3iFJgb.js → workspace-page-DPWYRJjr.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/add-credits-modal-CjhPCEo3.js +0 -1
- package/dist/assets/app-hw35VYTL.css +0 -2
- package/dist/assets/auth-store-B_1Y9Uid.js +0 -1
- package/dist/assets/avatar-bundled-components-5UFPY9JK.js +0 -1
- package/dist/assets/billing-page-JaprT6Vv.js +0 -3
- package/dist/assets/checkout-return-target-D5A2Rv1t.js +0 -1
- package/dist/assets/command-palette-Lr-NeDCr.js +0 -1
- package/dist/assets/deploy-dialogs-BaSfIbBO.js +0 -1
- package/dist/assets/document-load-CD-0uWA-.js +0 -1
- package/dist/assets/local-mode-CP6E3D3e.js +0 -1
- package/dist/assets/native-attachment-pickers-DGHZuGbD.js +0 -1
- package/dist/assets/native-file-DxOOIrLm.js +0 -1
- package/dist/assets/paired-platform-identity-X_FlXunr.js +0 -1
- package/dist/assets/password-reset-page-CDmQuW9S.js +0 -1
- package/dist/assets/plugins-surface-DAYezPv6.js +0 -1
- package/dist/assets/referral-modal-8IXUqxso.js +0 -1
- package/dist/assets/routes-CkL6GgBk.js +0 -1
- package/dist/assets/settings-Clb97agh.js +0 -3
- package/dist/assets/settings-o6cuYhH5.js +0 -3
- package/dist/assets/share-feedback-modal-fY8BlOwK.js +0 -1
- package/dist/assets/tool-detail-panel-Dqa39U7-.js +0 -1
- package/dist/assets/use-supports-credentials-settings-CMhSepvQ.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-Djziw8jC.js","assets/react-B9IgSVeK.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-DwMhK7fD.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,DC as n,HC as r,Ir as i,Ja as a,My as o,Pf as s,Qx as c,_C as l,eg as ee,gC as u,hC as d,hS as f,hh as te,iC as p,nd as ne,qv as m}from"./app-g1TvV-Dl.js";import{E as h,O as g,Xn as re,nr as _,x as v}from"./vendor-DwMhK7fD.js";import{b as y,t as b,v as x,x as S}from"./react-B9IgSVeK.js";import{Mn as C,Vn as ie,Yn as ae,_t as oe,fr as se,i as ce,in as le,nr as w,pa as T,ri as ue}from"./icons-C0wyat6T.js";var E=e(S(),1),de=e(y(),1),D=`vellum:debug:`;function O(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function fe(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:c()},overrides:O()}}var k=b(),pe=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,me=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,he={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},A=[{value:`bug_report`,icon:T,includesLogsByDefault:!0},{value:`feature_request`,icon:w,includesLogsByDefault:!1},{value:`other`,icon:C,includesLogsByDefault:!1}],j=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,ge={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function _e(){if(f())return`electron`;let e=v.getPlatform();return e===`ios`||e===`android`?e:`web`}function ve(e){return typeof e==`object`&&!!e&&`client`in e}function ye(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}var I=8192,L=/^data:([^;,]+);base64,/i,R=/^[A-Za-z0-9+/]+={0,2}$/;function z(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>z(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=z(a,t,n);i=r}return n.delete(e),i}function B(e){return z(e,e=>{if(typeof e!=`string`)return null;let t=L.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=I&&R.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function V(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),z(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function H(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function U(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await m({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function W(){if(!v.isNativePlatform())return null;try{let{App:e}=await x(async()=>{let{App:e}=await import(`./esm-Djziw8jC.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function be(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,c=new Date,l=j.find(t=>t.value===e),u=c.getTime(),d=l?.cutoffMs==null?null:u-l.cutoffMs,te=d==null?null:new Date(d).toISOString(),p=null;try{p=i?.()??null}catch{p=null}let ne=ee(p),m={collected_at:c.toISOString(),time_range:e,cutoff:te,log_window:{start_time_ms:d,end_time_ms:u},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,client_version:null,native_app:await W(),user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},h=new TextEncoder,g=h.encode(JSON.stringify(m,null,2)),re=h.encode(JSON.stringify(ne,null,2)),_=[H(`web-client-context.json`,g),H(`web-chat-diagnostics.json`,re)];if(r.queryClient)try{_.push(H(`web-asset-diagnostics.json`,h.encode(JSON.stringify(s(r.queryClient),null,2))))}catch{}let v=new TextEncoder().encode(JSON.stringify(fe(),null,2));_.push(H(`web-debug-flags.json`,v));for(let e of o){let t=e.contents.trim();t&&_.push(H(e.filename,h.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:V(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(B(n),null,2));_.push(H(`web-chat-debug-api-triage.json`,r))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(B(t),null,2));_.push(H(`web-sse-liveness-triage.json`,n))}}catch{}if(f()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));_.push(H(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);_.push(H(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await U(t,{window:{startTime:d,endTime:u},activeConversationId:n});e&&_.push(H(`platform-logs.tar.gz`,e))}_.push(new Uint8Array(1024));let y=_.reduce((e,t)=>e+t.length,0),b=new Uint8Array(y),x=0;for(let e of _)b.set(e,x),x+=e.length;let S=new Blob([b.buffer]),C=await new Response(S.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([C],`web-client-logs-${c.getTime()}.tar.gz`,{type:`application/gzip`})}function G({open:e,onClose:s,initialReason:c,initialMessage:ee,onSubmitted:m,assistantId:v,assistantVersion:y,activeConversationId:b,doctorSessionId:x,doctorSessionLog:S,getDiagnosticsSnapshot:C}){let{t:w}=h(),T=_(),D=te.use.user(),O=D?.email,fe=D?.isStaff??!1,j=(0,E.useId)(),M=(0,E.useRef)(null),N=(0,E.useRef)(null),F=(0,E.useRef)(null),I=(0,E.useRef)(null),L=(0,E.useMemo)(()=>[{value:`past_hour`,label:w(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:w(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:w(`shareFeedbackModal.timeRangeAllTime`)}],[w]),[R,z]=(0,E.useState)(c??`bug_report`),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(A.find(e=>e.value===(c??`bug_report`))?.includesLogsByDefault??!0),[Ce,we]=(0,E.useState)(!1),[K,q]=(0,E.useState)(`past_hour`),[J,Y]=(0,E.useState)([]),[Te,X]=(0,E.useState)(null),[Ee,De]=(0,E.useState)(!1),[Oe,ke]=(0,E.useState)(!1),[Z,Ae]=(0,E.useState)(!1),je=re(ne()),[Me,Q]=(0,E.useState)(!1),$=je.isPending||Me,Ne=!O,Pe=(0,E.useMemo)(()=>B.trim().length>0&&H.trim().length>0,[B,H]);(0,E.useEffect)(()=>{if(!e)return;let t=c??`bug_report`;z(t),V(ee??``),U(O??``),G(A.find(e=>e.value===t)?.includesLogsByDefault??!0),we(!1),q(`past_hour`),Y([]),ke(!1),Ae(!1),X(null),Q(!1),je.reset();let n=setTimeout(()=>{O?F.current?.focus():I.current?.focus()},50);return()=>clearTimeout(n)},[e]),a(e);let Fe=e=>{z(e),Ce||G(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},Ie=()=>{G(e=>!e),we(!0)},Le=S?.trim()?[{filename:`doctor-session.txt`,contents:S}]:[],Re=(0,E.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),s())},[s,$]),ze=(0,E.useCallback)(e=>{e.target===M.current&&!$&&s()},[s,$]),Be=(0,E.useCallback)(e=>{Y(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ye(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Ve=e=>{e.target.files&&Be(Array.from(e.target.files)),e.target.value=``},He=e=>{e.preventDefault(),De(!1),e.dataTransfer.files?.length&&Be(Array.from(e.dataTransfer.files))},Ue=e=>{e.preventDefault(),De(!0)},We=e=>{e.preventDefault(),e.currentTarget===e.target&&De(!1)},Ge=e=>{Y(t=>t.filter((t,n)=>n!==e))};return e?(0,de.createPortal)((0,k.jsx)(`div`,{ref:M,role:`dialog`,"aria-modal":`true`,"aria-labelledby":j,className:pe,onKeyDown:Re,onClick:ze,onDrop:He,onDragOver:Ue,onDragLeave:We,children:(0,k.jsxs)(`div`,{className:me,style:he,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:j,className:`!m-0 text-title-small text-[var(--content-default)]`,children:w(`shareFeedbackModal.title`)}),(0,k.jsx)(t,{variant:`ghost`,iconOnly:(0,k.jsx)(ce,{}),onClick:s,disabled:$,"aria-label":w(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[fe&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(d,{checked:Z,onChange:()=>Ae(e=>!e),"aria-label":w(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:w(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:w(`shareFeedbackModal.adminOnlyHint`)})]}),Z?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:w(`shareFeedbackModal.timeRange`)}),(0,k.jsx)(p,{options:L,value:K,onChange:q,"aria-label":w(`shareFeedbackModal.timeRangeAria`)})]}):(0,k.jsxs)(k.Fragment,{children:[Ne&&(0,k.jsx)(u,{id:`${j}-email`,ref:I,label:w(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:H,onChange:e=>U(e.target.value),leftIcon:(0,k.jsx)(ie,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:w(`shareFeedbackModal.category`)}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(xe,{option:e,isSelected:R===e.value,onSelect:()=>Fe(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),R===`bug_report`&&(0,k.jsx)(n,{tone:`info`,children:(0,k.jsx)(g,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,k.jsx)(o,{href:`https://vellum.ai/community`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),R===`feature_request`&&(0,k.jsx)(n,{tone:`info`,children:(0,k.jsx)(g,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,k.jsx)(o,{href:`https://vellum.ai/roadmap`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),(0,k.jsx)(l,{id:`${j}-message`,ref:F,label:w(R===`bug_report`?`shareFeedbackModal.messageLabelBug`:R===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:w(R===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:R===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:B,onChange:e=>V(e.target.value),fullWidth:!0}),R!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(d,{checked:W,onChange:Ie,"aria-label":w(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:w(`shareFeedbackModal.includeDiagnostics`)})]}),(0,k.jsx)(r,{content:w(`shareFeedbackModal.diagnosticsTooltip`),children:(0,k.jsx)(`button`,{type:`button`,"aria-label":w(`shareFeedbackModal.aboutDiagnosticsAria`),className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(se,{className:`h-3.5 w-3.5`})})})]}),W&&(0,k.jsx)(p,{options:L,value:K,onChange:q,"aria-label":w(`shareFeedbackModal.timeRangeAria`)})]}),f()&&b&&R!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(d,{checked:Oe,onChange:()=>ke(e=>!e),"aria-label":w(`shareFeedbackModal.includeConversationAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:w(`shareFeedbackModal.includeConversation`)})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[w(`shareFeedbackModal.attachments`),J.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,J.length,`/`,P]})]}),(0,k.jsx)(t,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(le,{}),onClick:()=>N.current?.click(),disabled:J.length>=P,children:w(`shareFeedbackModal.addFiles`)}),(0,k.jsx)(`input`,{ref:N,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Ve,className:`hidden`})]}),J.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:J.map((e,t)=>(0,k.jsx)(Se,{file:e,onRemove:()=>Ge(t)},`${e.name}-${t}`))}),Ee&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:w(`shareFeedbackModal.dropFiles`)})]})]}),Te&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:Te})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(ae,{className:`h-4 w-4 animate-spin`}),w(Z?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(t,{variant:`ghost`,onClick:s,children:w(`shareFeedbackModal.cancel`)}),Z?(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(ue,{}),onClick:async()=>{if(!$){X(null),Q(!0);try{let e=await be(K,v??null,f()?Oe?b??null:null:b??null,{diagnosticsProvider:C,queryClient:T,doctorSessionId:x,extraLogFiles:Le});if(!e){X(`Diagnostics export isn't supported in this browser.`);return}await i(e,e.name),s()}catch(e){X(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:w(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(oe,{}),onClick:async()=>{if(!(!Pe||$)){X(null),Q(!0);try{let e=W&&R!==`feature_request`?await be(K,v??null,f()?Oe?b??null:null:b??null,{diagnosticsProvider:C,queryClient:T,doctorSessionId:x,extraLogFiles:Le}):null,t=_e(),n;if(t===`electron`)try{n=(await window.vellum?.app.versionInfo())?.version??n}catch{}let r=t=>je.mutateAsync({headers:{"Content-Type":null},body:{message:B.trim(),classification:ge[R],email:H.trim(),client:t,client_version:n,...v?{assistant_id:v}:{},...y?{assistant_version:y}:{},...x?{doctor_session_id:x}:{},...e?{logs_file:e}:{},...J.length?{attachments:J}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}});try{await r(t)}catch(e){if(t!==`android`||!ve(e))throw e;await r(`web`)}m?.(),s()}catch(e){X(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Pe,children:w(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function xe({option:e,isSelected:t,onSelect:n}){let{t:r}=h(),i=e.icon,a=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:a})]})}function Se({file:e,onRemove:n}){let{t:r}=h(),i=e.type.startsWith(`image/`),a=(0,E.useMemo)(()=>i?URL.createObjectURL(e):null,[e,i]);return(0,E.useEffect)(()=>{if(a)return()=>URL.revokeObjectURL(a)},[a]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[i&&a?(0,k.jsx)(`img`,{src:a,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(le,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(t,{shape:`pill`,variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(ce,{}),onClick:n,"aria-label":r(`shareFeedbackModal.removeAttachmentAria`,{name:e.name}),className:`absolute top-0.5 right-0.5 h-4 w-4 bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{V as n,B as r,G as t};
|
|
2
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,DC as n,HC as r,Ir as i,Ja as a,My as o,Pf as s,Qx as c,_C as l,eg as ee,gC as u,hC as d,hS as f,hh as te,iC as p,nd as ne,qv as m}from"./app-XG_RF2yi.js";import{E as h,O as g,Xn as re,nr as _,x as v}from"./vendor-DwMhK7fD.js";import{b as y,t as b,v as x,x as S}from"./react-B9IgSVeK.js";import{Mn as C,Vn as ie,Yn as ae,_t as oe,fr as se,i as ce,in as le,nr as w,pa as T,ri as ue}from"./icons-C0wyat6T.js";var E=e(S(),1),de=e(y(),1),D=`vellum:debug:`;function O(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(D))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function fe(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:c()},overrides:O()}}var k=b(),pe=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,me=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,he={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},A=[{value:`bug_report`,icon:T,includesLogsByDefault:!0},{value:`feature_request`,icon:w,includesLogsByDefault:!1},{value:`other`,icon:C,includesLogsByDefault:!1}],j=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,ge={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function _e(){if(f())return`electron`;let e=v.getPlatform();return e===`ios`||e===`android`?e:`web`}function ve(e){return typeof e==`object`&&!!e&&`client`in e}function ye(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}var I=8192,L=/^data:([^;,]+);base64,/i,R=/^[A-Za-z0-9+/]+={0,2}$/;function z(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>z(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=z(a,t,n);i=r}return n.delete(e),i}function B(e){return z(e,e=>{if(typeof e!=`string`)return null;let t=L.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=I&&R.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function V(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),z(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function H(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function U(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await m({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function W(){if(!v.isNativePlatform())return null;try{let{App:e}=await x(async()=>{let{App:e}=await import(`./esm-Djziw8jC.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function be(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,c=new Date,l=j.find(t=>t.value===e),u=c.getTime(),d=l?.cutoffMs==null?null:u-l.cutoffMs,te=d==null?null:new Date(d).toISOString(),p=null;try{p=i?.()??null}catch{p=null}let ne=ee(p),m={collected_at:c.toISOString(),time_range:e,cutoff:te,log_window:{start_time_ms:d,end_time_ms:u},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,client_version:null,native_app:await W(),user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},h=new TextEncoder,g=h.encode(JSON.stringify(m,null,2)),re=h.encode(JSON.stringify(ne,null,2)),_=[H(`web-client-context.json`,g),H(`web-chat-diagnostics.json`,re)];if(r.queryClient)try{_.push(H(`web-asset-diagnostics.json`,h.encode(JSON.stringify(s(r.queryClient),null,2))))}catch{}let v=new TextEncoder().encode(JSON.stringify(fe(),null,2));_.push(H(`web-debug-flags.json`,v));for(let e of o){let t=e.contents.trim();t&&_.push(H(e.filename,h.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:V(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(B(n),null,2));_.push(H(`web-chat-debug-api-triage.json`,r))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(B(t),null,2));_.push(H(`web-sse-liveness-triage.json`,n))}}catch{}if(f()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));_.push(H(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);_.push(H(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await U(t,{window:{startTime:d,endTime:u},activeConversationId:n});e&&_.push(H(`platform-logs.tar.gz`,e))}_.push(new Uint8Array(1024));let y=_.reduce((e,t)=>e+t.length,0),b=new Uint8Array(y),x=0;for(let e of _)b.set(e,x),x+=e.length;let S=new Blob([b.buffer]),C=await new Response(S.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([C],`web-client-logs-${c.getTime()}.tar.gz`,{type:`application/gzip`})}function G({open:e,onClose:s,initialReason:c,initialMessage:ee,onSubmitted:m,assistantId:v,assistantVersion:y,activeConversationId:b,doctorSessionId:x,doctorSessionLog:S,getDiagnosticsSnapshot:C}){let{t:w}=h(),T=_(),D=te.use.user(),O=D?.email,fe=D?.isStaff??!1,j=(0,E.useId)(),M=(0,E.useRef)(null),N=(0,E.useRef)(null),F=(0,E.useRef)(null),I=(0,E.useRef)(null),L=(0,E.useMemo)(()=>[{value:`past_hour`,label:w(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:w(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:w(`shareFeedbackModal.timeRangeAllTime`)}],[w]),[R,z]=(0,E.useState)(c??`bug_report`),[B,V]=(0,E.useState)(``),[H,U]=(0,E.useState)(``),[W,G]=(0,E.useState)(A.find(e=>e.value===(c??`bug_report`))?.includesLogsByDefault??!0),[Ce,we]=(0,E.useState)(!1),[K,q]=(0,E.useState)(`past_hour`),[J,Y]=(0,E.useState)([]),[Te,X]=(0,E.useState)(null),[Ee,De]=(0,E.useState)(!1),[Oe,ke]=(0,E.useState)(!1),[Z,Ae]=(0,E.useState)(!1),je=re(ne()),[Me,Q]=(0,E.useState)(!1),$=je.isPending||Me,Ne=!O,Pe=(0,E.useMemo)(()=>B.trim().length>0&&H.trim().length>0,[B,H]);(0,E.useEffect)(()=>{if(!e)return;let t=c??`bug_report`;z(t),V(ee??``),U(O??``),G(A.find(e=>e.value===t)?.includesLogsByDefault??!0),we(!1),q(`past_hour`),Y([]),ke(!1),Ae(!1),X(null),Q(!1),je.reset();let n=setTimeout(()=>{O?F.current?.focus():I.current?.focus()},50);return()=>clearTimeout(n)},[e]),a(e);let Fe=e=>{z(e),Ce||G(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},Ie=()=>{G(e=>!e),we(!0)},Le=S?.trim()?[{filename:`doctor-session.txt`,contents:S}]:[],Re=(0,E.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),s())},[s,$]),ze=(0,E.useCallback)(e=>{e.target===M.current&&!$&&s()},[s,$]),Be=(0,E.useCallback)(e=>{Y(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ye(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Ve=e=>{e.target.files&&Be(Array.from(e.target.files)),e.target.value=``},He=e=>{e.preventDefault(),De(!1),e.dataTransfer.files?.length&&Be(Array.from(e.dataTransfer.files))},Ue=e=>{e.preventDefault(),De(!0)},We=e=>{e.preventDefault(),e.currentTarget===e.target&&De(!1)},Ge=e=>{Y(t=>t.filter((t,n)=>n!==e))};return e?(0,de.createPortal)((0,k.jsx)(`div`,{ref:M,role:`dialog`,"aria-modal":`true`,"aria-labelledby":j,className:pe,onKeyDown:Re,onClick:ze,onDrop:He,onDragOver:Ue,onDragLeave:We,children:(0,k.jsxs)(`div`,{className:me,style:he,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:j,className:`!m-0 text-title-small text-[var(--content-default)]`,children:w(`shareFeedbackModal.title`)}),(0,k.jsx)(t,{variant:`ghost`,iconOnly:(0,k.jsx)(ce,{}),onClick:s,disabled:$,"aria-label":w(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[fe&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(d,{checked:Z,onChange:()=>Ae(e=>!e),"aria-label":w(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:w(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:w(`shareFeedbackModal.adminOnlyHint`)})]}),Z?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:w(`shareFeedbackModal.timeRange`)}),(0,k.jsx)(p,{options:L,value:K,onChange:q,"aria-label":w(`shareFeedbackModal.timeRangeAria`)})]}):(0,k.jsxs)(k.Fragment,{children:[Ne&&(0,k.jsx)(u,{id:`${j}-email`,ref:I,label:w(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:H,onChange:e=>U(e.target.value),leftIcon:(0,k.jsx)(ie,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:w(`shareFeedbackModal.category`)}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(xe,{option:e,isSelected:R===e.value,onSelect:()=>Fe(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),R===`bug_report`&&(0,k.jsx)(n,{tone:`info`,children:(0,k.jsx)(g,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,k.jsx)(o,{href:`https://vellum.ai/community`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),R===`feature_request`&&(0,k.jsx)(n,{tone:`info`,children:(0,k.jsx)(g,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,k.jsx)(o,{href:`https://vellum.ai/roadmap`,tone:`quiet`,className:`text-[var(--content-default)]`,glyph:!1})}})}),(0,k.jsx)(l,{id:`${j}-message`,ref:F,label:w(R===`bug_report`?`shareFeedbackModal.messageLabelBug`:R===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:w(R===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:R===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:B,onChange:e=>V(e.target.value),fullWidth:!0}),R!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(d,{checked:W,onChange:Ie,"aria-label":w(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:w(`shareFeedbackModal.includeDiagnostics`)})]}),(0,k.jsx)(r,{content:w(`shareFeedbackModal.diagnosticsTooltip`),children:(0,k.jsx)(`button`,{type:`button`,"aria-label":w(`shareFeedbackModal.aboutDiagnosticsAria`),className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(se,{className:`h-3.5 w-3.5`})})})]}),W&&(0,k.jsx)(p,{options:L,value:K,onChange:q,"aria-label":w(`shareFeedbackModal.timeRangeAria`)})]}),f()&&b&&R!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(d,{checked:Oe,onChange:()=>ke(e=>!e),"aria-label":w(`shareFeedbackModal.includeConversationAria`)}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:w(`shareFeedbackModal.includeConversation`)})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[w(`shareFeedbackModal.attachments`),J.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,J.length,`/`,P]})]}),(0,k.jsx)(t,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(le,{}),onClick:()=>N.current?.click(),disabled:J.length>=P,children:w(`shareFeedbackModal.addFiles`)}),(0,k.jsx)(`input`,{ref:N,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Ve,className:`hidden`})]}),J.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:J.map((e,t)=>(0,k.jsx)(Se,{file:e,onRemove:()=>Ge(t)},`${e.name}-${t}`))}),Ee&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:w(`shareFeedbackModal.dropFiles`)})]})]}),Te&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:Te})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(ae,{className:`h-4 w-4 animate-spin`}),w(Z?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(t,{variant:`ghost`,onClick:s,children:w(`shareFeedbackModal.cancel`)}),Z?(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(ue,{}),onClick:async()=>{if(!$){X(null),Q(!0);try{let e=await be(K,v??null,f()?Oe?b??null:null:b??null,{diagnosticsProvider:C,queryClient:T,doctorSessionId:x,extraLogFiles:Le});if(!e){X(`Diagnostics export isn't supported in this browser.`);return}await i(e,e.name),s()}catch(e){X(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:w(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,k.jsx)(t,{variant:`primary`,leftIcon:(0,k.jsx)(oe,{}),onClick:async()=>{if(!(!Pe||$)){X(null),Q(!0);try{let e=W&&R!==`feature_request`?await be(K,v??null,f()?Oe?b??null:null:b??null,{diagnosticsProvider:C,queryClient:T,doctorSessionId:x,extraLogFiles:Le}):null,t=_e(),n;if(t===`electron`)try{n=(await window.vellum?.app.versionInfo())?.version??n}catch{}let r=t=>je.mutateAsync({headers:{"Content-Type":null},body:{message:B.trim(),classification:ge[R],email:H.trim(),client:t,client_version:n,...v?{assistant_id:v}:{},...y?{assistant_version:y}:{},...x?{doctor_session_id:x}:{},...e?{logs_file:e}:{},...J.length?{attachments:J}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}});try{await r(t)}catch(e){if(t!==`android`||!ve(e))throw e;await r(`web`)}m?.(),s()}catch(e){X(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Pe,children:w(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function xe({option:e,isSelected:t,onSelect:n}){let{t:r}=h(),i=e.icon,a=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:a})]})}function Se({file:e,onRemove:n}){let{t:r}=h(),i=e.type.startsWith(`image/`),a=(0,E.useMemo)(()=>i?URL.createObjectURL(e):null,[e,i]);return(0,E.useEffect)(()=>{if(a)return()=>URL.revokeObjectURL(a)},[a]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[i&&a?(0,k.jsx)(`img`,{src:a,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(le,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(t,{shape:`pill`,variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(ce,{}),onClick:n,"aria-label":r(`shareFeedbackModal.removeAttachmentAria`,{name:e.name}),className:`absolute top-0.5 right-0.5 h-4 w-4 bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{V as n,B as r,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./share-feedback-modal-BcKnGtHL.js";export{e as ShareFeedbackModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{AC as t,BC as n,Ko as r,Pa as i,QS as a,Yl as o,bg as s,hS as c,mS as l}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{AC as t,BC as n,Ko as r,Pa as i,QS as a,Yl as o,bg as s,hS as c,mS as l}from"./app-XG_RF2yi.js";import{E as u}from"./vendor-DwMhK7fD.js";import{d,f,n as p,t as m,x as h}from"./react-B9IgSVeK.js";import{Gi as g,za as _}from"./icons-C0wyat6T.js";import{t as v}from"./use-edge-swipe-back-BCvtCYFp.js";import{t as y}from"./link-click-CR9uUEsb.js";var b=e(h(),1),x=`data-page-transition`,S=400,C;function w(){return typeof document<`u`&&typeof document.startViewTransition==`function`}function T(){return s()&&w()}function E(e,t,n,r){if(!T()){e(t,r);return}document.documentElement.setAttribute(x,n),C!==void 0&&clearTimeout(C),C=setTimeout(()=>{C=void 0,document.documentElement.removeAttribute(x)},S),e(t,{...r,viewTransition:!0})}var D=m();function O({sidebar:e,children:a,actions:s,backHref:m,title:h=`Settings`,menuRoute:g=l.settings.root,menuReplacesContentOnMobile:y=!1}){let{t:x}=u(),{pathname:S}=d(),C=f(),w=S===g,T=o(),O=T&&w,k=!(O&&y),A=(0,b.useRef)(null),j=(0,b.useRef)(null);(0,b.useLayoutEffect)(()=>{j.current?.scrollTo(0,0)},[S]);let M=w?m:g;v({containerRef:A,onBack:(0,b.useCallback)(()=>{C(M)},[C,M]),enabled:T,navKey:S,prefetchHref:M});let N=c(),P=x(w?`sidebarShell.backFrom`:`sidebarShell.backToMenu`,{title:h}),F=(0,D.jsx)(n,{variant:`ghost`,iconOnly:(0,D.jsx)(_,{}),"aria-label":P,tintColor:`var(--content-secondary)`,onClick:()=>E(C,M,`pop`)}),I=(0,D.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":x(`sidebarShell.backFrom`,{title:h}),className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,D.jsx)(p,{to:m,className:`flex items-center justify-center no-underline`,children:(0,D.jsx)(_,{size:16,"aria-hidden":`true`})})});return(0,D.jsxs)(`div`,{ref:A,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:N?`3.75rem`:`1rem`},children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[F,(0,D.jsx)(t,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:h}),(0,D.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),N?(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,D.jsx)(r,{placement:`electron`,className:`px-0 pt-0`}),(0,D.jsx)(i,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,D.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[I,(0,D.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:h})]}),(0,D.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:s})]}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[T?null:(0,D.jsx)(`aside`,{className:`w-64 shrink-0 overflow-y-auto`,"aria-label":x(`sidebarShell.navigationAria`,{title:h}),children:e}),O?(0,D.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6`,children:e}):null,k?(0,D.jsx)(`main`,{ref:j,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:px-6 md:pt-0 ${O?`hidden`:`flex`}`,children:a}):null]})]})]})}function k({items:e,bottomItems:t,indexPath:n}){let{t:r}=u(),{pathname:i}=d(),s=f(),c=o(),l=(e,t,r)=>{let{href:o,onSelect:l}=e,u=o!=null&&(i===o||i.startsWith(o+`/`)||!c&&r&&n!=null&&i===n);return(0,D.jsxs)(b.Fragment,{children:[(0,D.jsx)(a.Item,{icon:e.icon,label:e.label,active:u,trailingIcon:o==null?void 0:g,trailingIconClassName:o==null?void 0:`md:hidden`,href:o,onSelect:l,onClick:o==null?void 0:e=>{y(e)||(e.preventDefault(),E(s,o,`push`))}}),!t&&(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,D.jsxs)(`nav`,{"aria-label":r(`sidebarTree.ariaLabel`),className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>l(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`flex-1`}),(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>l(e,n===t.length-1,!1))]})]})}export{O as n,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$c as t,By as n,Qc as r,bn as i}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$c as t,By as n,Qc as r,bn as i}from"./app-XG_RF2yi.js";import{E as a,O as o,d as s,f as c}from"./vendor-DwMhK7fD.js";import{t as l,x as u}from"./react-B9IgSVeK.js";import{n as d,t as f}from"./use-return-to-short-circuit-BVGVwuLm.js";import{t as p}from"./signup-shell-GSIPLhaj.js";var m=e(u(),1),h=l();function g({words:e}){let[t,n]=(0,m.useState)(0),r=(0,m.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,m.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,h.jsxs)(`span`,{className:`signup__rotating`,children:[(0,h.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,h.jsx)(c,{mode:`wait`,children:(0,h.jsxs)(s.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var _=[`signupScreen.headlineRoles.personalIntelligence`,`signupScreen.headlineRoles.softwareEngineer`,`signupScreen.headlineRoles.financeOps`,`signupScreen.headlineRoles.householdManager`,`signupScreen.headlineRoles.gtmEngineer`,`signupScreen.headlineRoles.productLead`];function v({returnTo:e}){let{t:s}=a(`account`),c=(0,m.useMemo)(()=>_.map(e=>s(e)),[s]),[l,u]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1),v=(i,a)=>{u(null),f(!0),n(r,t(e,{authIntent:i}),{returnTo:e,intent:i}).catch(e=>{console.error(a,e),u(s(`authErrors.genericFailure`))}).finally(()=>{f(!1)})};return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`signup__title`,children:[s(`signupScreen.headlineLead`),(0,h.jsx)(`br`,{}),(0,h.jsx)(g,{words:c})]}),(0,h.jsx)(`p`,{className:`signup__subtitle`,children:s(`signupScreen.subtitle`)}),(0,h.jsx)(`div`,{className:`signup__buttons`,children:(0,h.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{v(`signup`,`[signup] auth flow failed:`)},disabled:d,children:s(`signupScreen.continue`)})}),l&&(0,h.jsx)(`p`,{className:`signup__error`,children:l}),(0,h.jsx)(`p`,{className:`signup__footer`,children:(0,h.jsx)(o,{i18nKey:`signupScreen.haveAccountPrompt`,ns:`account`,components:{signIn:(0,h.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{v(void 0,`[signup] sign-in flow failed:`)},disabled:d})}})}),(0,h.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,h.jsx)(i,{size:16}),s(`signupScreen.downloadMac`)]})]})}function y(){let e=f();return e.kind===`wait`?(0,h.jsx)(p,{children:(0,h.jsx)(d,{})}):e.kind===`redirect`?e.node:(0,h.jsx)(v,{returnTo:e.returnTo})}export{y as SignupPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wi as e}from"./app-
|
|
1
|
+
import{wi as e}from"./app-XG_RF2yi.js";import{d as t}from"./vendor-DwMhK7fD.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({children:n}){return(0,r.jsxs)(t.div,{"data-theme":`dark`,className:`signup`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,r.jsxs)(`div`,{className:`signup__left`,children:[(0,r.jsx)(`div`,{className:`signup__logo`,children:(0,r.jsx)(`img`,{src:e(`/vellum-logo-white.svg`),alt:`Vellum`,width:82,height:25})}),(0,r.jsx)(`div`,{className:`signup__form`,children:n})]}),(0,r.jsx)(t.div,{className:`signup__right`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,delay:.15},"aria-hidden":!0,children:(0,r.jsx)(`video`,{className:`signup__video`,src:e(`/vellum-scene-cut.mp4`),autoPlay:!0,loop:!0,muted:!0,playsInline:!0})})]})}export{i as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,CS as n,FC as r,Gt as i,Km as a,OC as o,Rn as s,Ut as c,WC as l,XS as u,Yl as d,_m as f,dC as p,g as m,h,hm as g,jS as _,mS as v,mm as y,nt as b,vy as x,xc as S,zn as C}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,CS as n,FC as r,Gt as i,Km as a,OC as o,Rn as s,Ut as c,WC as l,XS as u,Yl as d,_m as f,dC as p,g as m,h,hm as g,jS as _,mS as v,mm as y,nt as b,vy as x,xc as S,zn as C}from"./app-XG_RF2yi.js";import{$n as w,E as T,nr as E}from"./vendor-DwMhK7fD.js";import{_ as D,b as O,d as k,f as A,h as j,r as M,t as N,x as ee}from"./react-B9IgSVeK.js";import{A as P,Br as F,D as I,Gi as L,Ha as R,Ya as z,Yn as B,Zr as V,kr as H,qi as te,za as U}from"./icons-C0wyat6T.js";import{a as W,n as G,r as K,t as ne}from"./use-skill-actions-CMoU5oFT.js";import{t as re}from"./use-edge-swipe-back-BCvtCYFp.js";import{t as ie}from"./diff-rows-D2cn4P1P.js";import{t as q}from"./skill-icon-CWKAcXVy.js";import{n as J,t as Y}from"./use-skill-detail-files-19-kefs2.js";import{t as ae}from"./skill-removal-dialog-BT--h1By.js";import{a as X,i as oe,n as se,r as ce,t as le}from"./file-view-mode-B1UgDONH.js";var ue=z(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Z=e(ee(),1),Q=N();function $(){return(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}var de=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,fe=/^diff --git a\/(.+) b\/\1$/;function pe(e,t){let n=e.replace(/^[ab]\//,``),r=`skills/${t}/`;return n.startsWith(r)?n.slice(r.length):n}function me(e){let t=e.slice(4).replace(/\t$/,``);return t===`/dev/null`?null:t}function he(e,t){let n=[],r=null,i=0,a=0,o=!1,s=!1;for(let c of e.split(`
|
|
2
2
|
`)){if(c.startsWith(`diff --git `)){r={path:pe(fe.exec(c)?.[1]??(c.split(` `).slice(3).join(` `)||``),t),rows:[],added:0,removed:0},n.push(r),i=0,a=0,o=!1,s=!1;continue}if(!r)continue;let e=de.exec(c);if(e){i=Number(e[1]),a=Number(e[2]),o=!0,r.rows.length>0&&r.rows.push({type:`meta`,text:c});continue}if(!c.startsWith(`\\ No newline`)){if(!o&&(c.startsWith(`+++ `)||c.startsWith(`--- `))){let e=me(c);e!==null&&(c.startsWith(`+++ `)||!s)&&(r.path=pe(e,t),s=c.startsWith(`+++ `));continue}!o&&(c.startsWith(`index `)||c.startsWith(`new file mode `)||c.startsWith(`deleted file mode `)||c.startsWith(`similarity index `)||c.startsWith(`rename `)||c.startsWith(`old mode `)||c.startsWith(`new mode `)||c.startsWith(`Binary files `))||(c.startsWith(`+`)?(r.rows.push({type:`add`,text:c.slice(1),newNo:a}),r.added+=1,a+=1):c.startsWith(`-`)?(r.rows.push({type:`del`,text:c.slice(1),oldNo:i}),r.removed+=1,i+=1):c.startsWith(` `)&&(r.rows.push({type:`ctx`,text:c.slice(1),oldNo:i,newNo:a}),i+=1,a+=1))}}return{files:n,added:n.reduce((e,t)=>e+t.added,0),removed:n.reduce((e,t)=>e+t.removed,0)}}async function ge(e,t,n){let{data:r,error:i,response:a}=await x({path:{assistant_id:e,id:t},throwOnError:!1,signal:n});if(!a||!a.ok){if(a?.status===404)return null;throw a?_(i,a):i??Error(`Failed to fetch skill history.`)}return r??null}function _e(e){return e.isLoading?!1:e.isError||e.revisionCount>0}function ve(e,t){let n=!!(e&&t),r=w({queryKey:g({path:{assistant_id:e??``,id:t}}),queryFn:({signal:n})=>ge(e??``,t,n),enabled:n,refetchOnWindowFocus:!1});return{history:r.data??null,revisions:r.data?.revisions??[],truncatedByCompaction:r.data?.truncatedByCompaction??!1,isLoading:r.isLoading,isError:r.isError}}function ye({assistantId:e,skillId:t}){let{t:n}=T(`intelligence`),{revisions:r,truncatedByCompaction:i,isLoading:a,isError:o}=ve(e,t);return a?(0,Q.jsx)($,{}):o?(0,Q.jsx)(xe,{children:n(`skillRevisionHistory.loadError`)}):(0,Q.jsx)(be,{skillId:t,revisions:r,truncatedByCompaction:i})}function be({skillId:e,revisions:t,truncatedByCompaction:n}){let{t:r}=T(`intelligence`);return t.length===0?(0,Q.jsx)(xe,{children:r(`skillRevisionHistory.noChanges`)}):(0,Q.jsxs)(u.Root,{type:`multiple`,className:`flex flex-col gap-2 p-3`,children:[t.map(t=>(0,Q.jsx)(Se,{revision:t,skillId:e},t.id)),n&&(0,Q.jsx)(`p`,{className:`px-1 pt-1 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillRevisionHistory.truncatedNotice`)})]})}function xe({children:e}){return(0,Q.jsx)(`p`,{className:`px-3 py-10 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e})}function Se({revision:e,skillId:t}){let{t:n}=T(`intelligence`),r=(0,Z.useMemo)(()=>he(e.diff,t),[e.diff,t]);return(0,Q.jsxs)(u.Item,{value:e.id,className:`overflow-hidden rounded-md border`,style:{borderColor:`var(--border-base)`},children:[(0,Q.jsxs)(u.Trigger,{className:`group flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-[var(--surface-hover)]`,children:[(0,Q.jsx)(L,{className:`h-4 w-4 shrink-0 transition-transform group-data-[state=open]:rotate-90`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:i(e.changedAt)}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:e.files.join(` · `)})]}),r.added>0&&(0,Q.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-positive-strong)`},children:[`+`,r.added]}),r.removed>0&&(0,Q.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-negative-strong)`},children:[`−`,r.removed]})]}),(0,Q.jsxs)(u.Content,{className:`border-t`,style:{borderColor:`var(--border-base)`},children:[(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:c(e.changedAt)}),r.files.length===0?(0,Q.jsx)(`p`,{className:`px-3 pb-3 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:n(`skillRevisionHistory.noPreviewForChange`)}):r.files.map(e=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`border-t px-3 py-1.5 font-mono text-body-small-default`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:e.path}),(0,Q.jsx)(`div`,{className:`py-1`,children:(0,Q.jsx)(ie,{rows:e.rows})})]},e.path))]})]})}function Ce(e){return e===`history`?`history`:`files`}function we({assistantId:e,skill:n,tab:r,onTabChange:i,onBack:a,backToConversation:s=!1,onInstall:c,onRemove:l,isInstalling:u=!1,isRemoving:d=!1,sourceConversationId:f}){let{t:h}=T(`intelligence`),g=K(n),_=m(n),{fileEntries:v,setSelectedPath:y,activePath:b,activeFile:x,isFilesLoading:S,fileContent:C,isBinary:w,isContentLoading:E}=Y(e,n.id),{revisions:D,isLoading:O,isError:k}=ve(e,n.id),A=_e({isLoading:O,isError:k,revisionCount:D.length}),j=A?r:`files`,M=(0,Q.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Q.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,Q.jsx)(U,{"aria-hidden":!0}),"aria-label":h(s?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:a}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Q.jsx)(q,{skill:n,className:`h-8 w-8 text-3xl`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:n.name}),(0,Q.jsx)(W,{origin:n.origin})]}),(0,Q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:n.description}),(0,Q.jsx)(J,{skill:{origin:n.origin,sourceConversationId:f},className:`mt-1`})]})]}),g?u?(0,Q.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Q.jsx)(B,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Q.jsx)(t,{type:`button`,onClick:c,disabled:!c,leftIcon:(0,Q.jsx)(R,{"aria-hidden":!0}),children:h(`skillDetail.install`)}):(0,Q.jsx)(t,{type:`button`,variant:_?`dangerOutline`:`outlined`,onClick:l,disabled:!_||d||!l,loading:d,leftIcon:(0,Q.jsx)(P,{"aria-hidden":!0}),children:h(`skillDetail.remove`)})]})]}),N=(0,Q.jsx)(o.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Q.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:S?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Q.jsx)(B,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):v.length===0?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:h(`skillDetail.noFilesAvailable`)}):v.map(e=>{let t=b===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>y(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Q.jsx)(H,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Q.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:E?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):x?(0,Q.jsx)(Te,{assistantId:e,skillId:n.id,fileName:x.name,filePath:x.path,content:C,isBinary:w,editable:n.kind===`installed`},`${n.id}/${x.path}`):(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:h(`skillDetail.selectFilePrompt`)})})]})});return(0,Q.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[M,(0,Q.jsxs)(p.Root,{value:j,onValueChange:e=>i(Ce(e)),className:`flex min-h-0 flex-1 flex-col`,children:[A&&(0,Q.jsxs)(p.List,{className:`mb-3`,children:[(0,Q.jsx)(p.Trigger,{value:`files`,children:h(`skillDetail.filesTab`)}),(0,Q.jsx)(p.Trigger,{value:`history`,children:h(`skillDetail.historyTab`)})]}),(0,Q.jsx)(p.Panel,{value:`files`,forceMount:!0,className:`min-h-0 flex-1 flex-col`,style:{display:j===`files`?`flex`:`none`},children:N}),A&&(0,Q.jsx)(p.Panel,{value:`history`,className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(o.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,Q.jsx)(ye,{assistantId:e,skillId:n.id})})})})]})]})}function Te({assistantId:e,skillId:r,fileName:i,filePath:o,content:c,isBinary:l,editable:u}){let{t:d}=T(`intelligence`),f=E(),[p,m]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(`formatted`),b=`skills/${r}/${o}`,x=a({onSuccess:()=>{m(!1),_(``),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),f.invalidateQueries({queryKey:[{_id:`skillsByIdHistoryGet`}]}),o===`SKILL.md`&&h(f,e)},onError:e=>{n(e,{context:`skill-file-save`,bestEffort:!0})}}),w=p&&g!==(c??``),D=(0,Z.useCallback)(()=>{!w||x.isPending||x.mutate({path:{assistant_id:e},body:{path:b,content:g,encoding:`utf8`}})},[w,x,e,b,g]),O=(0,Z.useCallback)(()=>{m(!0),_(c??``),x.reset()},[c,x]),k=(0,Z.useCallback)(()=>{m(!1),_(``),x.reset()},[x]);if(l)return(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`skillFileContent.binaryFile`)});if(c===null)return(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`skillFileContent.noPreviewAvailable`,{fileName:i})});let A=u?(0,Q.jsx)(t,{variant:`ghost`,size:`regular`,iconOnly:(0,Q.jsx)(V,{"aria-hidden":!0}),onClick:()=>void S(b),"aria-label":d(`skillDetail.openInWorkspaceAriaLabel`),className:`hover:bg-[var(--surface-base)]`}):void 0;return C(i,void 0)&&!p?(0,Q.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Q.jsx)(se,{content:c,fileName:i,showEdit:u,isEditing:!1,onToggleEdit:O,leading:(0,Q.jsx)(le,{mode:v,onChange:y}),extraActions:A}),v===`formatted`?(0,Q.jsx)(s,{content:c}):(0,Q.jsx)(X,{content:c,readOnly:!u,onStartEdit:O})]})}):(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Q.jsx)(se,{content:p?g:c,fileName:i,showEdit:u,isEditing:p,onToggleEdit:()=>p?k():O(),extraActions:A}),p?(0,Q.jsx)(oe,{value:g,onChange:_,onSave:D}):(0,Q.jsx)(X,{content:c,readOnly:!u,onStartEdit:O})]}),p&&(0,Q.jsx)(ce,{isDirty:w,isSaving:x.isPending,error:x.isError?d(`skillDetail.saveFailed`):null,onSave:D,onDiscard:k})]})}var Ee=e(O(),1);function De({content:e,defaultMode:t=`formatted`,className:n}){let[r,i]=(0,Z.useState)(t);return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`flex justify-end px-4 pt-2`,children:(0,Q.jsx)(le,{mode:r,onChange:i})}),r===`formatted`?(0,Q.jsx)(`div`,{className:l(`min-h-0 flex-1 overflow-auto`,n),children:(0,Q.jsx)(s,{content:e})}):(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(X,{content:e,readOnly:!0})})]})}function Oe({fileName:e,content:t,isBinary:n}){let{t:r}=T(`intelligence`);return n?(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillFileContent.binaryFile`)}):t===null?(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r(`skillFileContent.noPreviewAvailable`,{fileName:e})}):C(e,void 0)?(0,Q.jsx)(De,{content:t,className:`px-6 py-4`}):(0,Q.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function ke({assistantId:e,skill:n,onBack:r,backToConversation:i=!1,onInstall:a,onRemove:s,isInstalling:c=!1,isRemoving:l=!1,swipeContainerRef:u,sourceConversationId:d}){let{t:f}=T(`intelligence`),p=K(n),h=m(n),{fileEntries:g,setSelectedPath:_,activePath:v,activeFile:y,isFilesLoading:b,fileContent:x,isBinary:S,isContentLoading:C}=Y(e,n.id),[w,E]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{E(document.getElementById(`viewport-overlays`))},[]);let D=(0,Q.jsxs)(`div`,{ref:u,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,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(U,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":f(i?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:r,className:`max-md:bg-[var(--surface-active)]`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:n.name}),(0,Q.jsx)(Ae,{available:p,removable:h,isInstalling:c,isRemoving:l,onInstall:a,onRemove:s})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(q,{skill:n,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Q.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:n.name})]}),(0,Q.jsx)(W,{origin:n.origin})]}),(0,Q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description}),(0,Q.jsx)(J,{skill:{origin:n.origin,sourceConversationId:d}})]}),(0,Q.jsx)(o.Root,{asChild:!0,noPadding:!0,children:(0,Q.jsxs)(`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,Q.jsx)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:(0,Q.jsx)(Me,{fileEntries:g,activePath:v,activeName:y?.name??null,onSelect:_})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:b||C?(0,Q.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Q.jsx)(B,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):y?(0,Q.jsx)(Oe,{fileName:y.name,content:x,isBinary:S},y.path):(0,Q.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:f(`skillDetail.selectFilePrompt`)})})]})})]});return w?(0,Ee.createPortal)(D,w):D}function Ae({available:e,removable:n,isInstalling:r,isRemoving:i,onInstall:a,onRemove:o}){let{t:s}=T(`intelligence`);return r||i?(0,Q.jsx)(t,{variant:`ghost`,loading:!0,iconOnly:i?(0,Q.jsx)(P,{"aria-hidden":!0}):(0,Q.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":s(`skillDetail.pendingAriaLabel`),className:`max-md:bg-[var(--surface-active)]`}):e?(0,Q.jsx)(t,{variant:`ghost`,iconOnly:(0,Q.jsx)(R,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.installSkillAriaLabel`),onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):n?(0,Q.jsx)(t,{variant:`dangerGhost`,iconOnly:(0,Q.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.removeSkillAriaLabel`),onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Q.jsx)(t,{variant:`dangerGhost`,iconOnly:(0,Q.jsx)(P,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:s(`skillRow.bundledSkillsCannotBeRemoved`),"aria-label":s(`skillRow.bundledSkillCannotBeRemovedAriaLabel`),className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function je(e){return(e??``).endsWith(`/directory`)}function Me({fileEntries:e,activePath:t,activeName:n,onSelect:i}){let{t:a}=T(`intelligence`),o=n??a(`skillDetail.selectAFile`);return e.length===0?(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Q.jsx)(Ne,{}),(0,Q.jsx)(`span`,{className:`truncate`,children:o})]}):(0,Q.jsxs)(r.Root,{children:[(0,Q.jsx)(r.Trigger,{children:(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Q.jsx)(Ne,{}),(0,Q.jsx)(`span`,{className:`truncate`,children:o}),(0,Q.jsx)(te,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Q.jsx)(r.Content,{align:`start`,children:e.map(e=>{let n=je(e.mimeType);return(0,Q.jsx)(r.Item,{onSelect:()=>i(e.path),leftIcon:n?(0,Q.jsx)(H,{}):(0,Q.jsx)(F,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Ne(){return(0,Q.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Q.jsx)(F,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function Pe(){let{t:e}=T(`intelligence`);return(0,Q.jsx)(G,{icon:I,iconColor:`var(--system-negative-strong)`,title:e(`skillsErrorState.title`),subtitle:e(`skillsErrorState.subtitle`)})}function Fe(){let{t:e}=T(`intelligence`),n=b(),{skillId:r}=j(),i=A(),a=k(),{pathname:o}=a,s=d(),c=(0,Z.useRef)(null),l=a.state,u=typeof l?.listSearch==`string`?l.listSearch:``,p=typeof l?.backTo==`string`&&l.backTo.startsWith(`/`)&&!l.backTo.startsWith(`//`)?l.backTo:null,[m,h]=D(),g=Ce(m.get(`tab`)),_=(0,Z.useCallback)(e=>{let t=new URLSearchParams(m);e===`history`?t.set(`tab`,`history`):t.delete(`tab`),h(t,{replace:!0,state:a.state})},[m,h,a.state]),x=w({...f({path:{assistant_id:n},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),S=p??`${v.superpowers}${u}`,C=(0,Z.useCallback)(()=>{i(S)},[i,S]),E=(0,Z.useCallback)(()=>{i(S,{replace:!0})},[i,S]);re({containerRef:c,onBack:C,enabled:s,navKey:o,prefetchHref:S.split(`?`)[0]??S});let{handleInstall:O,handleRemove:N,isInstallingSkill:ee,isRemovingSkill:P,skillPendingRemoval:F,confirmRemove:I,cancelRemove:L}=ne(n,{onRemoved:E}),R=x.data,z=(0,Z.useMemo)(()=>R?.find(e=>e.id===r)??null,[R,r]),B=w({...y({path:{assistant_id:n,id:r??``}}),enabled:!!r&&z?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!r)return(0,Q.jsx)(M,{to:v.superpowers,replace:!0});if(x.isLoading)return(0,Q.jsx)($,{});if(x.isError&&!z)return(0,Q.jsx)(Pe,{});if(!z&&x.isFetching)return(0,Q.jsx)($,{});if(!z)return(0,Q.jsx)(G,{icon:ue,title:e(`skillDetailPage.notFoundTitle`),subtitle:e(`skillDetailPage.notFoundSubtitle`),children:(0,Q.jsx)(t,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Q.jsx)(U,{"aria-hidden":!0}),onClick:C,children:e(p?`skillDetailPage.backToConversation`:`skillDetailPage.backToSuperpowers`)})});let V={assistantId:n,skill:z,onBack:C,backToConversation:p!==null,onInstall:()=>O(z),onRemove:()=>N(z),isInstalling:ee(z),isRemoving:P(z),sourceConversationId:B.data??void 0};return(0,Q.jsxs)(Q.Fragment,{children:[s?(0,Q.jsx)(ke,{...V,swipeContainerRef:c}):(0,Q.jsx)(we,{...V,tab:g,onTabChange:_}),(0,Q.jsx)(ae,{skillName:F?.name??null,onConfirm:I,onCancel:L})]})}export{Fe as SkillDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{AC as t,BC as n,CS as r,DC as i,FC as a,Gm as o,Qn as s,Rn as c,Yb as l,_ as u,er as d,g as f,h as p,mS as m,mm as h}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{AC as t,BC as n,CS as r,DC as i,FC as a,Gm as o,Qn as s,Rn as c,Yb as l,_ as u,er as d,g as f,h as p,mS as m,mm as h}from"./app-XG_RF2yi.js";import{$n as g,E as _,nr as v}from"./vendor-DwMhK7fD.js";import{d as y,f as b,t as x,x as S}from"./react-B9IgSVeK.js";import{$r as C,A as w,ha as T}from"./icons-C0wyat6T.js";import{n as E,t as D}from"./use-skill-detail-files-19-kefs2.js";import{t as O}from"./skill-removal-dialog-BT--h1By.js";var k=e(S(),1),A=x();function j({skillId:e,onClose:x}){let{t:S}=_(`chat`),j=b(),M=y(),N=v(),P=l.use.activeAssistantId(),[F,I]=(0,k.useState)(!1),L=g({...h({path:{assistant_id:P??``,id:e}}),select:e=>e.skill,enabled:!!P}),R=L.data,{skillMd:z,fileContent:B,isFilesPending:V,isContentPending:H}=D(P,e),U=o({onSuccess:()=>{P&&p(N,P),x()},onError:e=>{r(e,{context:`skill-detail-panel-remove`})}}),W=()=>{P&&(U.mutate({path:{assistant_id:P,id:e}}),I(!1))},G=L.isPending||V||z!=null&&H,K=R!=null&&f(R);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(s,{icon:R?.emoji?(0,A.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:R.emoji}):void 0,Glyph:T,title:R?.name??S(`skillDetailPanel.titleFallback`),closeLabel:S(`skillDetailPanel.closeDetails`),onClose:x,headerActions:K?(0,A.jsxs)(a.Root,{children:[(0,A.jsx)(a.Trigger,{asChild:!0,children:(0,A.jsx)(n,{variant:`outlined`,iconOnly:(0,A.jsx)(C,{}),"aria-label":S(`skillDetailPanel.actionsAria`),tooltip:S(`skillDetailPanel.moreTooltip`),className:`shrink-0`})}),(0,A.jsx)(a.Content,{side:`bottom`,align:`end`,children:(0,A.jsx)(a.Item,{leftIcon:(0,A.jsx)(w,{size:14}),onSelect:()=>I(!0),children:S(`skillDetailPanel.removeSkill`)})})]}):void 0,footer:(0,A.jsx)(`div`,{className:`flex justify-end`,children:(0,A.jsx)(n,{onClick:()=>{x(),j(m.skills.detail(e),{state:u(M)})},children:S(`skillDetailPanel.goToSkill`)})}),children:L.isError&&!R?(0,A.jsx)(i,{tone:`error`,children:S(`skillDetailPanel.loadError`)}):G?(0,A.jsx)(d,{placement:`panel`}):(0,A.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[R?.description&&(0,A.jsx)(t,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:R.description}),R&&(0,A.jsx)(E,{skill:R,onNavigate:x}),B&&(0,A.jsx)(`div`,{children:(0,A.jsx)(c,{content:B})})]})}),(0,A.jsx)(O,{skillName:F&&R?R.name:null,onConfirm:W,onCancel:()=>I(!1)})]})}export{j as SkillDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{oC as e}from"./app-
|
|
1
|
+
import{oC as e}from"./app-XG_RF2yi.js";import{E as t}from"./vendor-DwMhK7fD.js";import{t as n}from"./react-B9IgSVeK.js";var r=n();function i({skillName:n,onConfirm:i,onCancel:a}){let{t:o}=t();return(0,r.jsx)(e,{open:n!==null,title:o(`skillRemovalDialog.title`),message:n?o(`skillRemovalDialog.message`,{name:n}):``,confirmLabel:o(`skillRemovalDialog.remove`),destructive:!0,onConfirm:i,onCancel:a})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mS as e}from"./app-
|
|
1
|
+
import{mS as e}from"./app-XG_RF2yi.js";import{_ as t,r as n,t as r}from"./react-B9IgSVeK.js";var i=r();function a(){let[r]=t(),a=r.get(`skill`);if(a)return(0,i.jsx)(n,{to:e.skills.detail(a),replace:!0});let o=r.toString();return(0,i.jsx)(n,{to:`${e.superpowers}${o?`?${o}`:``}`,replace:!0})}export{a as SkillsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$l as t,OC as n,Ql as r,Xl as i,Zl as a,bm as o,hC as s,nt as c,vm as l,xm as u,ym as d}from"./app-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$l as t,OC as n,Ql as r,Xl as i,Zl as a,bm as o,hC as s,nt as c,vm as l,xm as u,ym as d}from"./app-XG_RF2yi.js";import{$n as f,E as p,Xn as m,nr as h}from"./vendor-DwMhK7fD.js";import{t as g,x as _}from"./react-B9IgSVeK.js";import{A as v,qi as y,zt as b}from"./icons-C0wyat6T.js";var x=e(_(),1),S=g(),C={task_complete:`soundsSections.soundEventTaskComplete`,needs_input:`soundsSections.soundEventNeedsInput`,task_failed:`soundsSections.soundEventTaskFailed`,notification:`soundsSections.soundEventNotification`,new_conversation:`soundsSections.soundEventNewConversation`,message_sent:`soundsSections.soundEventMessageSent`,character_poke:`soundsSections.soundEventCharacterPoke`,random:`soundsSections.soundEventRandom`};function w(e,t){return t(C[e])}function T({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(s,{checked:n,disabled:r,onChange:i,label:e})]})}function E(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function D({event:e,eventConfig:n,availableSounds:r,globalEnabled:i,onToggle:a,onAddSound:o,onRemoveSound:c,onPreview:l,t:u}){let[d,f]=(0,x.useState)(!1),p=w(e,u),m=r.filter(e=>!n.sounds.includes(e.filename)),h=r.length>0&&m.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:p}),(0,S.jsx)(s,{checked:n.enabled,disabled:!i,onChange:a,label:u(`soundsSections.enableEvent`,{eventName:p})})]}),n.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[n.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:u(`soundsSections.defaultBlip`)}):n.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:t(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(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":u(`soundsSections.previewSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(b,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>c(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":u(`soundsSections.removeSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(v,{className:`h-3 w-3`})})]})]},e)),r.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:u(`soundsSections.noSoundFiles`)}):h?(0,S.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:u(`soundsSections.allSoundsAdded`)}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(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:[u(`soundsSections.addSound`),(0,S.jsx)(y,{className:`h-3 w-3`})]}),d&&(0,S.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:()=>f(!1),children:m.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{o(e.filename),f(!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 O(){let{t:e}=p(`settings`),t=h(),s=c(),g=(0,x.useMemo)(()=>d({path:{assistant_id:s}}),[s]),_=(0,x.useMemo)(()=>l({path:{assistant_id:s}}),[s]),{data:v}=f(g),{data:y}=f(_),C=v??r(),w=y?.sounds??[],O=(0,x.useMemo)(()=>({path:{assistant_id:s}}),[s]),k=m({...u(O),onMutate:async e=>{await t.cancelQueries({queryKey:g.queryKey});let n=t.getQueryData(g.queryKey);return o(t,O,e.body),{previous:n}},onError:(e,n,r)=>{r?.previous!==void 0&&o(t,O,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:g.queryKey})}}),A=(0,x.useCallback)(e=>{let n=e(t.getQueryData(g.queryKey)??r());k.mutate({path:{assistant_id:s},body:n})},[s,g.queryKey,t,k]),j=e=>{A(t=>({...t,globalEnabled:e}))},M=e=>{A(t=>({...t,volume:e}))},[N,P]=(0,x.useState)(null),F=N??C.volume,I=(e,t)=>{A(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},L=(e,t)=>{A(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]}}}})},R=(e,t)=>{A(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},z=()=>{i().previewFallbackBlip(C.volume)},B=e=>{i().previewSound(e,C.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(n,{children:[(0,S.jsx)(T,{label:e(`soundsSections.enableSoundEffects`),description:e(`soundsSections.enableSoundEffectsDescription`),checked:C.globalEnabled,onChange:j}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.volume`)}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:F,onChange:e=>P(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},className:`h-1 w-48 cursor-pointer`,disabled:!C.globalEnabled,"aria-label":e(`soundsSections.volumeAriaLabel`)}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(F*100),`%`]})]}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.previewDefaultBlip`)}),(0,S.jsxs)(`button`,{type:`button`,onClick:z,disabled:!C.globalEnabled,className:`inline-flex cursor-pointer 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)] transition-colors hover:bg-[var(--surface-hover)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(b,{className:`h-3.5 w-3.5`}),e(`soundsSections.preview`)]})]})]}),(0,S.jsxs)(n,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:e(`soundsSections.soundEventsTitle`)}),(0,S.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`soundsSections.soundEventsDescription`)})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:a.map(t=>(0,S.jsx)(D,{event:t,eventConfig:C.events[t]??{enabled:!1,sounds:[]},availableSounds:w,globalEnabled:C.globalEnabled,onToggle:e=>I(t,e),onAddSound:e=>L(t,e),onRemoveSound:e=>R(t,e),onPreview:e=>B(e),t:e},t))})]})]})}function k(){return(0,S.jsx)(O,{})}export{k as SoundsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BC as e,Ci as t,ki as n,mS as r,rb as i}from"./app-
|
|
1
|
+
import{BC as e,Ci as t,ki as n,mS as r,rb as i}from"./app-XG_RF2yi.js";import{E as a}from"./vendor-DwMhK7fD.js";import{f as o,t as s}from"./react-B9IgSVeK.js";var c=s();function l(){let{t:s}=a(`onboarding`),l=o();return(0,c.jsx)(t,{avatarWave:`around`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 md:min-h-full md:pb-6 text-[var(--content-default)]`,children:(0,c.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,c.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:s(`welcome.title`)}),(0,c.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:s(`welcome.body`)}),(0,c.jsx)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,c.jsx)(e,{variant:`primary`,size:`large`,fullWidth:!0,onClick:()=>void l(`${r.onboarding.privacy}?${i}=1`,n),children:s(`startScreen.createAssistant`)})})]})})})}export{l as StartScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Et as e,Gn as t,Qr as n,kh as r}from"./app-
|
|
1
|
+
import{Et as e,Gn as t,Qr as n,kh as r}from"./app-XG_RF2yi.js";import{E as i}from"./vendor-DwMhK7fD.js";import{t as a}from"./react-B9IgSVeK.js";import{xa as o}from"./icons-C0wyat6T.js";import{c as s,i as c}from"./tool-detail-panel-D3kcmDuC.js";var l=a();function u(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:n(e.toolName,e.input).iconName}function d({detail:n,source:i}){let a=s(i,n.toolCallId);return(a?r(a):n.status===`running`)?(0,l.jsx)(t,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,l.jsx)(e[u(n)]??o,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function f(e){let{t}=i(`chat`);return e?e.kind===`thinking`?t(`thinkingDetail.title`):c(e):``}export{f as n,d as t};
|
package/dist/assets/{stt-language-picker-modal-DfBKJmLh.js → stt-language-picker-modal-oMpmGSKQ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{at as e,cC as t}from"./app-
|
|
1
|
+
import{at as e,cC as t}from"./app-XG_RF2yi.js";import{E as n}from"./vendor-DwMhK7fD.js";import{t as r}from"./react-B9IgSVeK.js";var i=r();function a({open:r,onOpenChange:a,title:o,currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d}){let{t:f}=n();return(0,i.jsx)(t.Root,{open:r,onOpenChange:a,children:(0,i.jsxs)(t.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,i.jsxs)(t.Header,{children:[(0,i.jsx)(t.Title,{children:o}),(0,i.jsx)(t.Description,{children:f(`sttLanguagePickerModal.description`)})]}),(0,i.jsx)(t.Body,{children:(0,i.jsx)(e,{currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d,onDone:()=>a(!1)})})]})})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$r as t,AC as n,At as r,BC as i,Ct as a,Ei as o,Ft as s,Gr as c,It as l,Jn as u,Kn as d,Kr as f,Mt as p,Nt as m,Ot as h,Pt as g,Qn as _,St as v,Tt as y,Yb as b,Zr as x,du as S,ei as C,fu as w,kt as T,lu as E,pu as D,qn as O,qo as k,tr as A,uu as j,wt as M}from"./app-g1TvV-Dl.js";import{E as N,d as P,f as ee,s as te}from"./vendor-DwMhK7fD.js";import{t as F,x as I}from"./react-B9IgSVeK.js";import{Cr as L,Gi as R,Ha as z,Ki as B,ha as V}from"./icons-C0wyat6T.js";import{n as H,r as U,t as W}from"./animated-stat-square-C1mgqXq8.js";import{o as G,t as K}from"./detail-primitives-BVAXXLTM.js";import{t as ne}from"./detail-panel-stop-button-CpIFrlAa.js";import{t as q}from"./status-badge-pill-qGQ5gRiz.js";import{a as J,c as re,l as ie,n as ae,s as oe,t as se}from"./tool-detail-panel-Cy_HQVT-.js";import{n as ce,t as le}from"./step-detail-header-B4fNZIZg.js";var Y=e(I(),1),X=F();function ue({status:e}){return(0,X.jsx)(q,{color:w(e),label:D(e)})}function de(e,t){let n=b.use.activeAssistantId(),r=t??n,{subagentId:i,conversationId:a}=e,o=e.history===null;return(0,Y.useEffect)(()=>{o&&r&&a&&E.getState().loadHistoryIfNeeded(r,i)},[o,r,i,a]),(0,Y.useCallback)(()=>r?E.getState().loadHistoryIfNeeded(r,i):Promise.resolve(),[r,i])}function Z(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?m(n,t):``}`}function Q(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function fe(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function pe(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function me(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return x(n.text)}}function he(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ge({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:i,isRunning:a=!1}){let[o,s]=(0,Y.useState)(new Set),c=n??o,l=(0,Y.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(i){i(t);return}s(t)},[i]),u=(0,Y.useMemo)(()=>r(e),[e]);return u.length===0?null:(0,X.jsx)(`div`,{className:`flex w-full flex-col`,children:u.map((e,n)=>{let r=Z(e,n),i=n===u.length-1;return(0,X.jsx)(_e,{section:e,isLast:i,isActiveTail:i&&a,expanded:c.has(r),sectionKeyValue:r,onToggle:l,onStepDetailClick:t},r)})})}var _e=(0,Y.memo)(function({section:e,isLast:t,isActiveTail:r,expanded:i,sectionKeyValue:o,onToggle:c,onStepDetailClick:u}){let{t:f}=N(`chat`),_=l(),b=te(),S=p(e.steps),C=S===`running`&&!r?`completed`:S,w=C===`running`||r,E=e.steps[0]?.kind===`thinking`,D=e.steps.length,O=e.label===`Searching the web`,A=O?pe(e):void 0,j=D>=2,F=e.steps.some(e=>g(e,_)||!!u&&!!he(e)),I=C===`running`?``:s(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),R=C===`running`?Q(e):void 0,z=C===`running`&&!O?fe(R,e.label):``,B=O&&(C===`running`||!!A),H=A??e.label,U=E&&w,W=U?me(e)??e.label:void 0,G=C===`running`||B||U||!!I,K=`${D} step${D===1?``:`s`}`;return(0,X.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:k(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,X.jsx)(h,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!F,"aria-expanded":F?i:void 0,onClick:F?()=>c(o):void 0,className:k(`flex h-[22px] w-full items-center gap-2 text-left`,F&&`cursor-pointer`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,X.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,X.jsx)(T,{status:w?`running`:C,isThinking:E&&!w}),(0,X.jsx)(n,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),G&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),B?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(d,{currentStepTitle:``,currentStepInfo:H})]}):U?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(d,{currentStepTitle:``,currentStepInfo:W??e.label})]}):C===`running`?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(d,{currentStepTitle:``,currentStepInfo:z})]}):I?(0,X.jsx)(n,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:f(`subagentPhaseTimeline.workedFor`,{duration:I})}):null,F&&j&&(0,X.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,X.jsx)(n,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:K})})]}),(0,X.jsx)(ee,{initial:!1,children:F&&i&&(0,X.jsx)(P.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:b?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let r=u?he(e):void 0;if(r&&u){if(e.kind===`tool`)return(0,X.jsx)(M,{variant:`tool`,iconName:e.iconName,label:_({activity:e.activity,actionDisplayKey:e.actionDisplayKey,fallback:e.activity||e.info||e.title}),ariaLabel:f(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>u(r)},m(e,t));if(e.kind===`thinking`)return(0,X.jsx)(M,{variant:`tool`,iconName:`brain`,label:x(e.text),ariaLabel:f(`subagentPhaseTimeline.viewReasoning`),onClick:()=>u(r)},m(e,t));if(e.kind===`web_search`)return(0,X.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:f(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>u(r)},m(e,t));if(e.kind===`web_search_error`)return(0,X.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:f(`subagentPhaseTimeline.viewSearchError`),onClick:()=>u(r)},m(e,t))}return e.kind===`web_search`?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,X.jsx)(n,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,X.jsx)(a,{step:e})]},m(e,t)):e.kind===`web_search_error`?(0,X.jsx)(v,{step:e},m(e,t)):(0,X.jsx)(y,{step:e},m(e,t))})})},`phase-steps`)})]})});function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function ve(e=c){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let s=C(t,o);switch(s.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,c=n.slice(),l=r.slice();for(let t=s.from;t<a;t++)e(c,l,o[t]);return t=o,n=c,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function ye(e){let t=(0,Y.useRef)(null);return t.current??=ve(),t.current.project(e)}var be={running:0,completed:1,error:2,denied:2};function xe(e,t){return{...e,kind:e.kind??t.kind,result:e.result??t.result,streamedOutput:e.streamedOutput??t.streamedOutput,durationLabel:e.durationLabel||t.durationLabel,searchQuery:e.searchQuery||t.searchQuery,searchResults:e.searchResults?.length?e.searchResults:t.searchResults??e.searchResults,status:be[t.status]>be[e.status]?t.status:e.status}}function Se(e,t){return e?t?xe(f(Object.keys(e.input).length>0?e:{...e,input:t.input}),t):f(e):t}function Ce({entry:e,onClose:r,onStop:a,onRequestDetail:s,assistantId:c}){let{t:l}=N(`chat`),d=S(e.status),f=te(),p=o(),m=(0,Y.useMemo)(()=>O(e.subagentId),[e.subagentId]),{steps:h}=t(e.events),g=ye(e.events),v=(0,Y.useMemo)(()=>({kind:`subagent`,subagentId:e.subagentId}),[e.subagentId]),y=de(e,c),[b,x]=(0,Y.useState)(null),C=(0,Y.useRef)(g),w=(0,Y.useRef)(e.history);(0,Y.useLayoutEffect)(()=>{C.current=g,w.current=e.history},[g,e.history]);let T=(0,Y.useCallback)(e=>{w.current===null&&y(),(C.current.has(e)||oe(w.current?.messages??[],e))&&x(e)},[y]),[E,D]=(0,Y.useState)(new Set),[k,M]=(0,Y.useState)(!1),[ee,F]=(0,Y.useState)(e.subagentId);ee!==e.subagentId&&(F(e.subagentId),M(!1),x(null),D(new Set));let I=j(e);(0,Y.useEffect)(()=>{s&&I&&e.events.length===0&&s(e.subagentId)},[e.subagentId,I,e.events.length,s]);let L=Se(re(v,b),b?g.get(b):void 0),V=(0,Y.useCallback)(()=>x(null),[]),q=ce(L),Z=L?q:e.label,Q=!!(L&&L.kind!==`thinking`);return(0,X.jsx)(_,{headerAbove:L&&(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,X.jsx)(i,{variant:`link`,onClick:V,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,X.jsx)(n,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,X.jsx)(R,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,X.jsx)(n,{variant:`body-small-default`,as:`span`,title:q,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:q})]}),icon:(0,X.jsxs)(X.Fragment,{children:[L&&(0,X.jsx)(i,{variant:`outlined`,iconOnly:(0,X.jsx)(B,{}),onClick:V,"aria-label":l(`subagentDetailPanel.backToTimelineAria`),tooltip:l(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),L?(0,X.jsx)(le,{detail:L,source:J}):p?(0,X.jsx)(u,{components:p,bodyShapeId:m.bodyShape,eyeStyleId:m.eyeStyle,colorId:m.color,size:32}):(0,X.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:Q?void 0:Z,titleNode:Q&&L?(0,X.jsx)(ae,{detail:L,source:J}):void 0,headerTrailing:(0,X.jsx)(ue,{status:e.status}),headerActions:d&&a?(0,X.jsx)(ne,{onStop:()=>a(e.subagentId),ariaLabel:l(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:l(`subagentDetailPanel.closeDetail`),onClose:r,children:(0,X.jsx)(P.div,{className:`flex flex-col gap-5`,initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:L?(0,X.jsx)(X.Fragment,{children:L.kind===`thinking`?(0,X.jsx)(ie,{detail:L,assistantId:c}):(0,X.jsx)(se,{detail:L,source:J,assistantId:c})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,X.jsx)(W,{icon:(0,X.jsx)(z,{}),target:e.inputTokens,format:e=>H(Math.round(e)),label:l(`subagentDetailPanel.input`)}),(0,X.jsx)(W,{icon:(0,X.jsx)(U,{}),target:e.outputTokens,format:e=>H(Math.round(e)),label:l(`subagentDetailPanel.output`)})]}),e.objective&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:l(`subagentDetailPanel.objective`)}),(0,X.jsx)(K,{label:l(`subagentDetailPanel.objective`),expanded:k,onExpandedChange:M,children:(0,X.jsx)(n,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.objective})},e.subagentId),(0,X.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:l(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,X.jsx)(ge,{steps:h,expandedKeys:E,onExpandedKeysChange:D,onStepDetailClick:T,isRunning:d},e.subagentId):(0,X.jsx)(A,{placement:`section`,children:l(`subagentDetailPanel.noEventsYet`)})]})]})},L?`detail`:`list`)})}export{Ce as SubagentDetailPanel};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$r as t,AC as n,At as r,BC as i,Ct as a,Ei as o,Ft as s,Gr as c,It as l,Jn as u,Kn as d,Kr as f,Mt as p,Nt as m,Ot as h,Pt as g,Qn as _,St as v,Tt as y,Yb as b,Zr as x,du as S,ei as C,fu as w,kt as T,lu as E,pu as D,qn as O,qo as k,tr as A,uu as j,wt as M}from"./app-XG_RF2yi.js";import{E as N,d as P,f as ee,s as te}from"./vendor-DwMhK7fD.js";import{t as F,x as I}from"./react-B9IgSVeK.js";import{Cr as L,Gi as R,Ha as z,Ki as B,ha as V}from"./icons-C0wyat6T.js";import{n as H,r as U,t as W}from"./animated-stat-square--YG74D1T.js";import{o as G,t as K}from"./detail-primitives-wlzeidYY.js";import{t as ne}from"./detail-panel-stop-button-DnqOX8hL.js";import{t as q}from"./status-badge-pill-qGQ5gRiz.js";import{a as J,c as re,l as ie,n as ae,s as oe,t as se}from"./tool-detail-panel-D3kcmDuC.js";import{n as ce,t as le}from"./step-detail-header-q2pswG-E.js";var Y=e(I(),1),X=F();function ue({status:e}){return(0,X.jsx)(q,{color:w(e),label:D(e)})}function de(e,t){let n=b.use.activeAssistantId(),r=t??n,{subagentId:i,conversationId:a}=e,o=e.history===null;return(0,Y.useEffect)(()=>{o&&r&&a&&E.getState().loadHistoryIfNeeded(r,i)},[o,r,i,a]),(0,Y.useCallback)(()=>r?E.getState().loadHistoryIfNeeded(r,i):Promise.resolve(),[r,i])}function Z(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?m(n,t):``}`}function Q(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function fe(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function pe(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function me(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return x(n.text)}}function he(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ge({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:i,isRunning:a=!1}){let[o,s]=(0,Y.useState)(new Set),c=n??o,l=(0,Y.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(i){i(t);return}s(t)},[i]),u=(0,Y.useMemo)(()=>r(e),[e]);return u.length===0?null:(0,X.jsx)(`div`,{className:`flex w-full flex-col`,children:u.map((e,n)=>{let r=Z(e,n),i=n===u.length-1;return(0,X.jsx)(_e,{section:e,isLast:i,isActiveTail:i&&a,expanded:c.has(r),sectionKeyValue:r,onToggle:l,onStepDetailClick:t},r)})})}var _e=(0,Y.memo)(function({section:e,isLast:t,isActiveTail:r,expanded:i,sectionKeyValue:o,onToggle:c,onStepDetailClick:u}){let{t:f}=N(`chat`),_=l(),b=te(),S=p(e.steps),C=S===`running`&&!r?`completed`:S,w=C===`running`||r,E=e.steps[0]?.kind===`thinking`,D=e.steps.length,O=e.label===`Searching the web`,A=O?pe(e):void 0,j=D>=2,F=e.steps.some(e=>g(e,_)||!!u&&!!he(e)),I=C===`running`?``:s(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),R=C===`running`?Q(e):void 0,z=C===`running`&&!O?fe(R,e.label):``,B=O&&(C===`running`||!!A),H=A??e.label,U=E&&w,W=U?me(e)??e.label:void 0,G=C===`running`||B||U||!!I,K=`${D} step${D===1?``:`s`}`;return(0,X.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:k(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,X.jsx)(h,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!F,"aria-expanded":F?i:void 0,onClick:F?()=>c(o):void 0,className:k(`flex h-[22px] w-full items-center gap-2 text-left`,F&&`cursor-pointer`),children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,X.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,X.jsx)(T,{status:w?`running`:C,isThinking:E&&!w}),(0,X.jsx)(n,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),G&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),B?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(L,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(d,{currentStepTitle:``,currentStepInfo:H})]}):U?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(d,{currentStepTitle:``,currentStepInfo:W??e.label})]}):C===`running`?(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,X.jsx)(V,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsx)(d,{currentStepTitle:``,currentStepInfo:z})]}):I?(0,X.jsx)(n,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:f(`subagentPhaseTimeline.workedFor`,{duration:I})}):null,F&&j&&(0,X.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,X.jsx)(n,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:K})})]}),(0,X.jsx)(ee,{initial:!1,children:F&&i&&(0,X.jsx)(P.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:b?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,X.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let r=u?he(e):void 0;if(r&&u){if(e.kind===`tool`)return(0,X.jsx)(M,{variant:`tool`,iconName:e.iconName,label:_({activity:e.activity,actionDisplayKey:e.actionDisplayKey,fallback:e.activity||e.info||e.title}),ariaLabel:f(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>u(r)},m(e,t));if(e.kind===`thinking`)return(0,X.jsx)(M,{variant:`tool`,iconName:`brain`,label:x(e.text),ariaLabel:f(`subagentPhaseTimeline.viewReasoning`),onClick:()=>u(r)},m(e,t));if(e.kind===`web_search`)return(0,X.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:f(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>u(r)},m(e,t));if(e.kind===`web_search_error`)return(0,X.jsx)(M,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:f(`subagentPhaseTimeline.viewSearchError`),onClick:()=>u(r)},m(e,t))}return e.kind===`web_search`?(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,X.jsx)(n,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,X.jsx)(a,{step:e})]},m(e,t)):e.kind===`web_search_error`?(0,X.jsx)(v,{step:e},m(e,t)):(0,X.jsx)(y,{step:e},m(e,t))})})},`phase-steps`)})]})});function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function ve(e=c){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let s=C(t,o);switch(s.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,c=n.slice(),l=r.slice();for(let t=s.from;t<a;t++)e(c,l,o[t]);return t=o,n=c,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function ye(e){let t=(0,Y.useRef)(null);return t.current??=ve(),t.current.project(e)}var be={running:0,completed:1,error:2,denied:2};function xe(e,t){return{...e,kind:e.kind??t.kind,result:e.result??t.result,streamedOutput:e.streamedOutput??t.streamedOutput,durationLabel:e.durationLabel||t.durationLabel,searchQuery:e.searchQuery||t.searchQuery,searchResults:e.searchResults?.length?e.searchResults:t.searchResults??e.searchResults,status:be[t.status]>be[e.status]?t.status:e.status}}function Se(e,t){return e?t?xe(f(Object.keys(e.input).length>0?e:{...e,input:t.input}),t):f(e):t}function Ce({entry:e,onClose:r,onStop:a,onRequestDetail:s,assistantId:c}){let{t:l}=N(`chat`),d=S(e.status),f=te(),p=o(),m=(0,Y.useMemo)(()=>O(e.subagentId),[e.subagentId]),{steps:h}=t(e.events),g=ye(e.events),v=(0,Y.useMemo)(()=>({kind:`subagent`,subagentId:e.subagentId}),[e.subagentId]),y=de(e,c),[b,x]=(0,Y.useState)(null),C=(0,Y.useRef)(g),w=(0,Y.useRef)(e.history);(0,Y.useLayoutEffect)(()=>{C.current=g,w.current=e.history},[g,e.history]);let T=(0,Y.useCallback)(e=>{w.current===null&&y(),(C.current.has(e)||oe(w.current?.messages??[],e))&&x(e)},[y]),[E,D]=(0,Y.useState)(new Set),[k,M]=(0,Y.useState)(!1),[ee,F]=(0,Y.useState)(e.subagentId);ee!==e.subagentId&&(F(e.subagentId),M(!1),x(null),D(new Set));let I=j(e);(0,Y.useEffect)(()=>{s&&I&&e.events.length===0&&s(e.subagentId)},[e.subagentId,I,e.events.length,s]);let L=Se(re(v,b),b?g.get(b):void 0),V=(0,Y.useCallback)(()=>x(null),[]),q=ce(L),Z=L?q:e.label,Q=!!(L&&L.kind!==`thinking`);return(0,X.jsx)(_,{headerAbove:L&&(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,X.jsx)(i,{variant:`link`,onClick:V,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,X.jsx)(n,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,X.jsx)(R,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,X.jsx)(n,{variant:`body-small-default`,as:`span`,title:q,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:q})]}),icon:(0,X.jsxs)(X.Fragment,{children:[L&&(0,X.jsx)(i,{variant:`outlined`,iconOnly:(0,X.jsx)(B,{}),onClick:V,"aria-label":l(`subagentDetailPanel.backToTimelineAria`),tooltip:l(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),L?(0,X.jsx)(le,{detail:L,source:J}):p?(0,X.jsx)(u,{components:p,bodyShapeId:m.bodyShape,eyeStyleId:m.eyeStyle,colorId:m.color,size:32}):(0,X.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:Q?void 0:Z,titleNode:Q&&L?(0,X.jsx)(ae,{detail:L,source:J}):void 0,headerTrailing:(0,X.jsx)(ue,{status:e.status}),headerActions:d&&a?(0,X.jsx)(ne,{onStop:()=>a(e.subagentId),ariaLabel:l(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:l(`subagentDetailPanel.closeDetail`),onClose:r,children:(0,X.jsx)(P.div,{className:`flex flex-col gap-5`,initial:{opacity:0},animate:{opacity:1},transition:f?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:L?(0,X.jsx)(X.Fragment,{children:L.kind===`thinking`?(0,X.jsx)(ie,{detail:L,assistantId:c}):(0,X.jsx)(se,{detail:L,source:J,assistantId:c})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,X.jsx)(W,{icon:(0,X.jsx)(z,{}),target:e.inputTokens,format:e=>H(Math.round(e)),label:l(`subagentDetailPanel.input`)}),(0,X.jsx)(W,{icon:(0,X.jsx)(U,{}),target:e.outputTokens,format:e=>H(Math.round(e)),label:l(`subagentDetailPanel.output`)})]}),e.objective&&(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:l(`subagentDetailPanel.objective`)}),(0,X.jsx)(K,{label:l(`subagentDetailPanel.objective`),expanded:k,onExpandedChange:M,children:(0,X.jsx)(n,{variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)]`,children:e.objective})},e.subagentId),(0,X.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(G,{as:`h3`,children:l(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,X.jsx)(ge,{steps:h,expandedKeys:E,onExpandedKeysChange:D,onStepDetailClick:T,isRunning:d},e.subagentId):(0,X.jsx)(A,{placement:`section`,children:l(`subagentDetailPanel.noEventsYet`)})]})]})},L?`detail`:`list`)})}export{Ce as SubagentDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,FS as n,Hm as r,Ir as i,MS as a,My as o,OC as s,PC as c,Rn as l,SC as u,Um as d,Wm as f,Yl as p,Zx as m,_m as h,em as g,g as _,gC as v,gm as y,hC as b,mS as x,nm as S,nt as C,ny as ee,oC as w,qo as te,ry as T,sC as E,tm as ne,vC as D,xC as O,xa as re,zC as k,zc as ie}from"./app-g1TvV-Dl.js";import{$n as A,E as j,Xn as ae,j as M,nr as oe}from"./vendor-DwMhK7fD.js";import{_ as se,b as ce,d as le,f as ue,t as N,x as P}from"./react-B9IgSVeK.js";import{$ as de,A as F,Bi as fe,Cr as pe,D as me,Ha as I,Ji as he,Mn as ge,P as _e,Pt as L,Vi as ve,Vn as ye,Ya as R,Yn as z,Zr as be,_r as xe,b as Se,gt as Ce,ha as we,i as Te,ir as B,mi as Ee,oa as De,r as V,ri as Oe,sn as ke,st as H,tr as Ae,vt as je,wn as Me,xr as Ne,yi as Pe,za as Fe}from"./icons-C0wyat6T.js";import{a as Ie,i as Le,n as U,o as Re,r as W,t as ze}from"./use-skill-actions-U5IaZ-Z1.js";import{t as Be}from"./skill-icon-CWKAcXVy.js";import{t as Ve}from"./skill-removal-dialog-BUKv2Tas.js";import{t as He}from"./plugins-surface-DAYezPv6.js";import{c as Ue,i as We,l as Ge,n as Ke,o as qe,r as Je,s as Ye,u as Xe}from"./use-plugins-list-v7ZdJF5y.js";import{t as Ze}from"./use-debounced-value-DS3f___V.js";var Qe=R(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),G=e(P(),1),$e=e=>M(`pluginConstants.removeConfirmMessage`,{ns:`intelligence`,name:e}),et=e=>M(`pluginConstants.riskyUpgradeConfirmMessage`,{ns:`intelligence`,name:e}),tt=M(`pluginConstants.riskyUpgradeConfirmLabel`,{ns:`intelligence`}),nt=M(`pluginConstants.installError`,{ns:`intelligence`}),rt=M(`pluginConstants.removeError`,{ns:`intelligence`}),it=M(`pluginConstants.upgradeError`,{ns:`intelligence`}),at=M(`pluginConstants.toggleError`,{ns:`intelligence`}),K=N();function ot(e){try{return new URL(e,window.location.href).pathname.split(`/`).pop()||`plugin-artifact`}catch{return`plugin-artifact`}}function st({plugin:e,surfaces:t=null,className:n}){let{t:r}=j(`intelligence`),i=e.source?.kind===`github`?e.source.repo:r(`pluginDetailShared.localSource`),a=e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null,s=[{label:r(`pluginDetailShared.sourceLabel`),value:i,href:a??void 0}];return e.homepage&&s.push({label:r(`pluginDetailShared.homepageLabel`),value:e.homepage,href:e.homepage}),e.license&&s.push({label:r(`pluginDetailShared.licenseLabel`),value:e.license}),t&&(t.skills.length>0&&s.push({label:r(`pluginDetailShared.skillsLabel`),value:String(t.skills.length)}),t.hooks.length>0&&s.push({label:r(`pluginDetailShared.hooksLabel`),value:String(t.hooks.length)}),t.tools.length>0&&s.push({label:r(`pluginDetailShared.toolsLabel`),value:String(t.tools.length)})),(0,K.jsx)(`dl`,{className:te(`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:s.map(e=>(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,K.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,K.jsxs)(o,{href:e.href,tone:`default`,className:`inline-flex items-center gap-1`,glyph:!1,children:[e.value,(0,K.jsx)(be,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function q({plugin:e,drift:n,onInstall:r,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l,hasLocalEdits:u,enabled:d,onToggle:f,isToggling:p}){let{t:m}=j(`intelligence`),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),y=e.installed??!1,x=e.artifact??null,S=n?.status===`update-available`,C=S?m(`pluginDetailShared.upgradeTitle`,{fromSha:Ge(n?.local?.commit??null),toSha:Ge(n?.remote?.commit??null)}):void 0;return(0,K.jsxs)(K.Fragment,{children:[y?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[d!==void 0&&f?(0,K.jsx)(b,{label:m(`pluginDetailShared.autoIncludeInChat`),checked:d,onChange:()=>f(),disabled:p}):null,x?(0,K.jsx)(t,{type:`button`,leftIcon:(0,K.jsx)(Oe,{"aria-hidden":!0}),onClick:()=>void i(x.url,ot(x.url)),children:x.label??m(`pluginDetailShared.download`)}):null,S?(0,K.jsx)(t,{type:`button`,onClick:()=>{if(u){v(!0);return}o()},disabled:l,title:C,loading:l,leftIcon:(0,K.jsx)(ve,{"aria-hidden":!0}),children:m(`pluginDetailShared.upgrade`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,onClick:()=>g(!0),disabled:c,loading:c,leftIcon:(0,K.jsx)(F,{"aria-hidden":!0}),children:m(`pluginDetailShared.remove`)})]}):(0,K.jsx)(t,{type:`button`,onClick:r,disabled:s,loading:s,leftIcon:(0,K.jsx)(I,{"aria-hidden":!0}),children:m(`pluginDetailShared.install`)}),(0,K.jsx)(w,{open:h,title:m(`pluginDetailShared.removePluginTitle`),message:$e(e.name),confirmLabel:m(`pluginDetailShared.remove`),destructive:!0,onConfirm:()=>{g(!1),a()},onCancel:()=>g(!1)}),(0,K.jsx)(w,{open:_,title:m(`pluginDetailShared.upgradePluginTitle`),message:et(e.name),confirmLabel:tt,destructive:!0,onConfirm:()=>{v(!1),o()},onCancel:()=>v(!1)})]})}function ct(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,K.jsx)(z,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function lt(){let{t:e}=j(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,K.jsx)(me,{className:`h-6 w-6`,"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`text-body-medium-default`,children:e(`pluginDetailShared.loadErrorTitle`)}),(0,K.jsx)(`p`,{className:`text-body-small-lighter`,children:e(`pluginDetailShared.loadErrorDetail`)})]})}function J({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?nt:t?rt:n?it:null;return r?(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-active)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,K.jsx)(me,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function ut({external:e,className:t}){let{t:n}=j(`intelligence`),r=e?{label:n(`pluginOriginBadge.external`),icon:pe}:{label:n(`pluginOriginBadge.local`),icon:Ne};return(0,K.jsx)(u,{tone:`neutral`,leftIcon:(0,G.createElement)(r.icon),className:t,children:r.label})}function Y({onClick:e,isUpgrading:t=!1}={}){let{t:n}=j(`intelligence`),r=(0,G.createElement)(t?z:ve,{className:t?`animate-spin`:void 0}),i=n(`updateAvailableBadge.updateAvailable`);return e?(0,K.jsx)(O,{tone:`warning`,leftIcon:r,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":n(`updateAvailableBadge.upgradePluginAriaLabel`),className:`shrink-0`,children:i}):(0,K.jsx)(u,{tone:`warning`,leftIcon:r,className:`shrink-0`,children:i})}var dt=300*1e3;function X({assistantId:e,name:t,enabled:n=!0}){return A({...ne({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:dt,retry:!1})}function ft(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Z(e,t,n){let{t:r}=j(`intelligence`),i=oe(),a=n?.onInstalled,o=n?.onRemoved,s=A({...g({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),c=X({assistantId:e,name:t,enabled:s.data?.installed??!1}).data,l=(0,G.useCallback)(()=>ie(i,e,t),[e,t,i]),u=We(e,t,{onInstalled:a,onRemoved:o}),f=d({onSuccess:e=>{l(),E.success(e.outcome===`already-up-to-date`?r(`pluginToast.alreadyUpToDate`,{name:t||r(`pluginToast.pluginFallbackCapitalized`)}):r(`pluginToast.upgraded`,{name:t||r(`pluginToast.pluginFallback`),sha:Ge(e.toCommit)}))}});return{plugin:s.data??null,drift:c,isLoading:s.isLoading,isError:s.isError,install:u.install,remove:u.remove,upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:u.isInstalling,isRemoving:u.isRemoving,isUpgrading:f.isPending,isInstallError:u.isInstallError,isRemoveError:u.isRemoveError,isUpgradeError:f.isError,hasLocalEdits:ft(c)}}function pt(e){let t=oe(),n={queryKey:S({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=ae({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?T({path:{assistant_id:e,name:t},throwOnError:!1}):ee({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),E.error(at)},onSettled:(n,r,i)=>{ie(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function mt({assistantId:e,name:n,onBack:r,externalHint:i,enabled:a}){let{plugin:o,drift:c,isLoading:u,isError:d,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:r}),{t:S}=j(`intelligence`),{toggle:C,togglingName:ee}=pt(e),w=Je(e,n,o?.hasIcon,o?.iconVersion);return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,K.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,K.jsx)(Fe,{"aria-hidden":!0}),"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:r}),(0,K.jsx)(ht,{name:n,plugin:o,externalHint:i,iconSrc:w,drift:c,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:a,onToggle:()=>C(n,!a),isToggling:ee===n})]}),(v||y||b)&&(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,K.jsx)(s.Root,{asChild:!0,children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:u?(0,K.jsx)(ct,{}):d||!o?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:o,surfaces:c?.surfaces??null}),o.readme?(0,K.jsx)(l,{content:o.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})]})}function ht({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{t:h}=j(`intelligence`),g=t?.source?.kind===`github`,_=t?g:n,v=i?.status===`update-available`;return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[_===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(Xe,{external:_,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:h(`pluginDetail.version`,{version:t.version})}):null,t?(0,K.jsx)(ut,{external:g}):null,v?(0,K.jsx)(Y,{}):null]}),t?.description?(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,K.jsx)(q,{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 gt=e(ce(),1);function _t({assistantId:e,name:n,onBack:r,externalHint:i,enabled:a}){let{plugin:o,drift:c,isLoading:u,isError:d,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:r}),{t:S}=j(`intelligence`),{toggle:C,togglingName:ee}=pt(e),[w,te]=(0,G.useState)(null);(0,G.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let T=o?.source?.kind===`github`,E=o?T:i,ne=c?.status===`update-available`,D=o?.name??n,O=Je(e,n,o?.hasIcon,o?.iconVersion),re=(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(t,{variant:`ghost`,iconOnly:(0,K.jsx)(Fe,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:r,className:`max-md:bg-[var(--surface-active)]`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:D}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(Xe,{external:E,icon:o?.icon??void 0,iconSrc:O,size:`md`}),(0,K.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:D})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[ne?(0,K.jsx)(Y,{}):null,o?(0,K.jsx)(ut,{external:T}):null]})]}),o?.description?(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,K.jsx)(q,{plugin:o,drift:c,enabled:a,onToggle:()=>C(n,!a),isToggling:ee===n,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,K.jsx)(s.Root,{asChild:!0,noPadding:!0,children:(0,K.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,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:u?(0,K.jsx)(ct,{}):d||!o?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:o,surfaces:c?.surfaces??null}),o.readme?(0,K.jsx)(l,{content:o.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})})]});return w?(0,gt.createPortal)(re,w):re}function vt({assistantId:e,item:n,drift:r,onSelect:i,onInstall:a,onRemove:o,onUpgrade:c,isInstalling:l=!1,isRemoving:d=!1,isUpgrading:f=!1}){let{t:p}=j(`intelligence`),m=n.status===`available`,h=r?.status===`update-available`,g=n.enabled!==void 0,_=n.enabled===!1,v=Je(e,n.name,n.hasIcon,n.iconVersion);return(0,K.jsx)(s.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:i,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())},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,K.jsx)(Xe,{size:`sm`,external:n.external,icon:n.icon,iconUrl:n.iconUrl,iconSrc:v,className:_?`opacity-50`:void 0}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:_?`var(--content-tertiary)`:`var(--content-emphasised)`},children:n.name}),n.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:p(`pluginListRow.version`,{version:n.version})}):null,(0,K.jsx)(u,{tone:`neutral`,leftIcon:(0,K.jsx)(L,{"aria-hidden":!0}),children:p(`pluginListRow.pluginTag`)}),h?(0,K.jsx)(Y,{onClick:c,isUpgrading:f}):null]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description??p(`pluginListRow.noDescription`)}),n.issues&&n.issues.length>0?(0,K.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:n.issues.join(`; `),children:[n.issues[0],n.issues.length>1?p(`pluginListRow.moreIssues`,{count:n.issues.length-1}):null]}):null]}),m?l?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),disabled:!0,"aria-label":p(`pluginListRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!a,"aria-label":p(`pluginListRow.installPluginAriaLabel`),expandOnMobile:!1}):(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[g?(0,K.jsx)(u,{tone:n.enabled?`positive`:`neutral`,children:n.enabled?p(`pluginListRow.enabled`):p(`pluginListRow.disabled`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:d,iconOnly:(0,K.jsx)(F,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:d||f||!o,"aria-label":p(`pluginListRow.removePluginAriaLabel`),expandOnMobile:!1})]})]})})}var yt={mail:ye,calendar:De,"message-circle":ge,globe:pe,zap:V,code:Ee,mic:Me,"shopping-cart":H,palette:ke,heart:xe,settings:Ce,"link-2":Ae};function bt(e){return yt[e]}var Q={email:`categories.email`,calendar:`categories.calendar`,messaging:`categories.messaging`,browsing:`categories.browsing`,productivity:`categories.productivity`,development:`categories.development`,voice:`categories.voice`,commerce:`categories.commerce`,content:`categories.content`,health:`categories.health`,system:`categories.system`,integrations:`categories.integrations`,other:`categories.other`};function xt({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o}){let{t:s}=j(`intelligence`),c=e=>{let t=Q[e.slug];return t?s(t,e.label):e.label},l=[...a].sort((e,t)=>c(e).localeCompare(c(t)));return(0,K.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o??s(`categorySidebar.skillCategoriesAriaLabel`),children:[(0,K.jsx)(St,{icon:B,label:s(`categorySidebar.all`),count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),l.map(r=>(0,K.jsx)(St,{icon:bt(r.icon)??B,label:c(r),count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function St({icon:e,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,K.jsxs)(t,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,K.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function Ct({skill:e,onSelect:n,onInstall:r,onRemove:i,isInstalling:a=!1,isRemoving:o=!1}){let{t:c}=j(`intelligence`),l=W(e),u=_(e);return(0,K.jsx)(s.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},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,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,K.jsx)(Be,{skill:e,className:`h-7 w-7`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,K.jsx)(Ie,{origin:e.origin})]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),l?a?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),disabled:!0,"aria-label":c(`skillRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!r,"aria-label":c(`skillRow.installSkillAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:o,iconOnly:(0,K.jsx)(F,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),i?.()},disabled:!u||o||!i,"aria-label":c(u?`skillRow.removeSkillAriaLabel`:`skillRow.bundledSkillCannotBeRemovedAriaLabel`),title:u?void 0:c(`skillRow.bundledSkillsCannotBeRemoved`),expandOnMobile:!1})]})})}function $(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`all`:return t(`superpowersFilters.filterLabel.all`);case`installed`:return t(`superpowersFilters.filterLabel.installed`);case`available`:return t(`superpowersFilters.filterLabel.available`);case`skills`:return t(`superpowersFilters.filterLabel.skills`);case`plugins`:return t(`superpowersFilters.filterLabel.plugins`);case`custom`:return t(`superpowersFilters.filterLabel.custom`);case`assistant-memory`:return t(`superpowersFilters.filterLabel.assistantMemory`)}}function wt(){let{t:e}=j(`intelligence`);return{statusFilters:[{value:`all`,label:$(`all`,e),icon:B},{value:`installed`,label:$(`installed`,e),icon:fe},{value:`available`,label:$(`available`,e),icon:I}],typeFilters:[{value:`skills`,label:$(`skills`,e),icon:V},{value:`plugins`,label:$(`plugins`,e),icon:L}],originFilters:[{value:`vellum`,label:$(`vellum`,e),icon:Re},{value:`clawhub`,label:$(`clawhub`,e),icon:pe},{value:`skillssh`,label:$(`skillssh`,e),icon:_e},{value:`custom`,label:$(`custom`,e),icon:Se},{value:`assistant-memory`,label:$(`assistant-memory`,e),icon:we}]}}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,showCategories:f}){let{t:p}=j(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(v,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:p(`superpowersFilters.searchPlaceholder`),"aria-label":p(`superpowersFilters.searchAriaLabel`),leftIcon:(0,K.jsx)(je,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,K.jsx)(z,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,K.jsx)(Et,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginsSupported:d,showCategories:f})]})}function Et(e){let{t:n}=j(`intelligence`),r=re(),[i,a]=(0,G.useState)(!1),{statusFilters:o,typeFilters:s,originFilters:c}=wt(),l=(0,K.jsx)(t,{type:`button`,variant:`outlined`,iconOnly:(0,K.jsx)(Qe,{"aria-hidden":!0}),"aria-label":n(`superpowersFilters.filterAriaLabel`),"aria-haspopup":r?`dialog`:`listbox`,"aria-expanded":i,tintColor:`var(--primary-base)`});if(r)return(0,K.jsx)(Dt,{...e,open:i,onOpenChange:a,trigger:l});let u=t=>{e.onFilterChange(t),a(!1)};return(0,K.jsxs)(D.Root,{open:i,onOpenChange:a,children:[(0,K.jsx)(D.Trigger,{asChild:!0,children:l}),(0,K.jsx)(D.Content,{align:`end`,sideOffset:4,className:`w-44`,children:(0,K.jsxs)(`ul`,{role:`listbox`,children:[(0,K.jsx)(Mt,{label:n(`superpowersFilters.statusLabel`),options:o,selected:e.filter,onSelect:u}),e.pluginsSupported&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:n(`superpowersFilters.typeLabel`),options:s,selected:e.filter,onSelect:u})]}),(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:n(`superpowersFilters.sourceLabel`),options:c,selected:e.filter,onSelect:u}),e.showCategories&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(jt,{categories:e.categories,category:e.category,counts:e.counts,totalCount:e.totalCount,showCounts:e.showCounts,allLabel:n(`superpowersFilters.filterLabel.all`),categoriesLabel:n(`superpowersFilters.categoriesLabel`),onSelect:t=>{e.onCategoryChange(t),a(!1)}})]})]})})]})}function Dt({filter:e,onFilterChange:n,categories:r,category:i,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginsSupported:l,showCategories:u,open:d,onOpenChange:f,trigger:p}){let{t:m}=j(`intelligence`),{statusFilters:h,typeFilters:g,originFilters:_}=wt();return(0,K.jsxs)(k.Root,{open:d,onOpenChange:f,children:[(0,K.jsx)(k.Trigger,{asChild:!0,children:p}),(0,K.jsxs)(k.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,K.jsx)(k.Header,{children:(0,K.jsx)(k.Title,{children:m(`superpowersFilters.filtersTitle`)})}),(0,K.jsxs)(k.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,K.jsx)(Ot,{label:m(`superpowersFilters.statusLabel`),children:h.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),l&&(0,K.jsx)(Ot,{label:m(`superpowersFilters.typeLabel`),children:g.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),(0,K.jsx)(Ot,{label:m(`superpowersFilters.sourceLabel`),children:_.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),u&&(0,K.jsxs)(Ot,{label:m(`superpowersFilters.categoriesLabel`),children:[(0,K.jsx)(kt,{icon:B,label:m(`superpowersFilters.filterLabel.all`),active:i===null,badge:c?s:void 0,onSelect:()=>a(null)}),At(r).map(e=>(0,K.jsx)(kt,{icon:bt(e.icon)??B,label:e.label,active:i===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,K.jsx)(k.Footer,{children:(0,K.jsx)(t,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>f(!1),children:m(`superpowersFilters.done`)})})]})]})}function Ot({label:e,children:t}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function kt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,K.jsx)(c,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,K.jsx)(he,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function At(e){return[...e].sort((e,t)=>e.label.localeCompare(t.label))}function jt({categories:e,category:t,counts:n,totalCount:r,showCounts:i,allLabel:a,categoriesLabel:o,onSelect:s}){return(0,K.jsx)(Nt,{label:o,children:(0,K.jsx)(`ul`,{className:`max-h-48 overflow-y-auto`,children:[{slug:null,label:a,count:r},...At(e).map(e=>({slug:e.slug,label:e.label,count:n[e.slug]??0}))].map(e=>{let n=t===e.slug;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(e.slug),role:`option`,"aria-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${n?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),i&&(0,K.jsx)(`span`,{style:{color:`var(--content-tertiary)`},children:e.count})]})},e.slug??`all`)})})})}function Mt({label:e,options:t,selected:n,onSelect:r}){return(0,K.jsx)(Nt,{label:e,children:(0,K.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${i?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,K.jsx)(fe,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})})}function Nt({label:e,children:t}){return(0,K.jsxs)(`li`,{role:`group`,"aria-label":e,children:[(0,K.jsx)(`div`,{className:`px-2 py-1.5 text-body-small-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t]})}function Pt(e){return A({...y({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}var Ft=new Set([`all`,`installed`,`available`,`skills`,`plugins`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function It(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:zt(t)?t:`all`,category:n||null}}function Lt(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Rt(n,`q`,t.q.trim()||null),t.filter!==void 0&&Rt(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Rt(n,`category`,t.category),n}function Rt(e,t,n){n===null?e.delete(t):e.set(t,n)}function zt(e){return e!==null&&Ft.has(e)}function Bt(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 Vt(e){return e!==`plugins`}function Ht(e){return e===`all`||e===`installed`||e===`available`||e===`plugins`}function Ut(e){switch(e){case`installed`:return`installed`;case`available`:return`available`;default:return`all`}}var Wt=300,Gt=`vellum:superpowers:tipDismissed`;function Kt(e){return[...e].sort((e,t)=>e.installed===t.installed?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):e.installed?-1:1)}function qt({assistantId:e}){let{t}=j(`intelligence`),i=ue(),o=le(),s=oe(),c=p(),l=m.use.version(),u=He(),[g,_]=se(),{q:v,filter:y,category:b}=(0,G.useMemo)(()=>It(g),[g]),S=g.get(`plugin`),C=(0,G.useCallback)(e=>{_(t=>Lt(t,e),{replace:!0})},[_]),ee=g.get(`success`),te=(0,G.useRef)(!1);(0,G.useEffect)(()=>{ee!==`true`||te.current||(te.current=!0,S&&E.success(t(`pluginToast.installed`,{name:S})),_(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[ee,S,_,t]);let[T,ne]=(0,G.useState)(v),D=Ze(T.trim(),Wt),O=(0,G.useRef)(v);(0,G.useEffect)(()=>{if(v!==O.current&&(O.current=v,v!==T.trim())){ne(v);return}D!==v&&D===T.trim()&&(O.current=D,C({q:D}))},[D,v,T,C]);let re=(0,G.useCallback)(e=>C({filter:e}),[C]),k=(0,G.useCallback)(e=>C({category:e}),[C]),[ae,M]=(0,G.useState)(()=>a(Gt,!1)),ce=(0,G.useCallback)(()=>{M(!0),n(Gt,!0)},[]),N=!u&&y===`plugins`?`all`:y,P=Vt(N),de=u&&Ht(N),F=Ut(N),{handleInstall:fe,handleRemove:pe,isInstallingSkill:me,isRemovingSkill:I,skillPendingRemoval:he,confirmRemove:ge,cancelRemove:_e}=ze(e),{data:L=[]}=Pt(e),{origin:ve,kind:ye}=(0,G.useMemo)(()=>Bt(N),[N]),R=A({...h({path:{assistant_id:e},query:{include:`catalog`,origin:ve,kind:ye,q:D||void 0,category:b??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&P}),z=A({...h({path:{assistant_id:e},query:{include:`catalog`,origin:ve,kind:ye,q:D||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&P&&b!==null}),{items:be,isLoading:xe,catalogLoading:Se,isError:Ce,isFetching:we,catalogError:Te,categorySupported:B,installedCategoryCounts:Ee,installedPlugins:De,installedTotal:V,catalogMatches:Oe,unfilteredInstalledNames:ke}=Ke(e,b,u),H=de&&(b===null||B),Ae=(0,G.useCallback)(t=>ie(s,e,t),[e,s]),[je,Me]=(0,G.useState)(null),[Ne,Pe]=(0,G.useState)(null),[Fe,Ie]=(0,G.useState)(null),[U,Re]=(0,G.useState)(null),[W,Be]=(0,G.useState)(null),We=f({onMutate:e=>Me(e.body.name),onSuccess:(e,n)=>E.success(t(`pluginToast.installed`,{name:n.body.name})),onError:()=>E.error(nt),onSettled:(e,t,n)=>{Me(null),Ae(n.body.name)}}),Je=r({onMutate:e=>Pe(e.path.name),onSuccess:(e,n)=>{E.success(t(`pluginToast.removed`,{name:n.path.name})),qe(e.warnings,t)},onError:()=>E.error(rt),onSettled:(e,t,n)=>{Pe(null),Ae(n.path.name)}}),Xe=d({onMutate:e=>Ie(e.path.name),onSuccess:(e,n)=>E.success(e.outcome===`already-up-to-date`?t(`pluginToast.alreadyUpToDate`,{name:n.path.name}):t(`pluginToast.upgraded`,{name:n.path.name,sha:Ge(e.toCommit)})),onError:()=>E.error(it),onSettled:(e,t,n)=>{Ie(null),Ae(n.path.name)}}),Qe=(0,G.useCallback)(e=>_(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[_]),at=(0,G.useCallback)(()=>_(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[_]),ot=(0,G.useCallback)(t=>{We.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,We]),st=(0,G.useCallback)(()=>{U&&(Je.mutate({path:{assistant_id:e,name:U.name}}),Re(null))},[e,U,Je]),q=(0,G.useCallback)(t=>{Xe.mutate({path:{assistant_id:e,name:t},body:{}})},[e,Xe]),ct=(0,G.useCallback)(()=>{W&&(q(W.name),Be(null))},[W,q]),lt=(0,G.useCallback)((e,t)=>{if(ft(t)){Be(e);return}q(e.name)},[q]),J=(0,G.useMemo)(()=>P?R.data?.skills??[]:[],[P,R.data?.skills]),ut=(0,G.useMemo)(()=>H?Ye(be,F).filter(e=>Ue(e,D)):[],[H,be,F,D]),Y=(0,G.useMemo)(()=>Kt([...J.map(e=>({type:`skill`,key:`skill:${e.id}`,name:e.name,installed:Le(e),skill:e})),...ut.map(e=>({type:`plugin`,key:`plugin:${e.name}`,name:e.name,installed:e.status===`installed`,item:e}))]),[J,ut]),dt=b===null?R.data:z.data,X=Jt(P,dt?.skills??J,dt?.categoryCounts,dt?.totalCount),Z=Yt(de&&B,Ee,De,V,Oe,ke,F),{counts:pt,totalCount:ht}=(0,G.useMemo)(()=>{let e={...X.counts};for(let[t,n]of Object.entries(Z.counts))e[t]=(e[t]??0)+n;return{counts:e,totalCount:X.totalCount+Z.totalCount}},[X,Z]),gt=P&&R.isLoading,yt=P&&R.isError,bt=H&&xe,Q=H&&Ce,St=(yt||!P)&&(Q||!H)&&(yt||Q),$=gt||bt,wt=!!D&&(P&&R.isFetching||H&&we&&!xe),Et=T.trim().length>0;if(S&&!u&&l===null)return null;if(S&&u){let t=be.find(e=>e.name===S),n={assistantId:e,name:S,externalHint:t?.external,enabled:t?.enabled,onBack:at};return c?(0,K.jsx)(_t,{...n}):(0,K.jsx)(mt,{...n})}let Dt=(0,K.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:$?(0,K.jsx)($t,{}):St?(0,K.jsx)(en,{}):Y.length===0?H&&Se&&F!==`installed`?(0,K.jsx)($t,{}):(0,K.jsx)(tn,{filter:N,category:b}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:Y.map(t=>(0,K.jsx)(`li`,{children:t.type===`skill`?(0,K.jsx)(Ct,{skill:t.skill,onSelect:()=>i(x.skills.detail(t.skill.id),{state:{listSearch:o.search}}),onInstall:()=>fe(t.skill),onRemove:()=>pe(t.skill),isInstalling:me(t.skill),isRemoving:I(t.skill)}):t.installed?(0,K.jsx)(Xt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onRemove:()=>Re(t.item),onUpgrade:e=>lt(t.item,e),isRemoving:Ne===t.item.name,isUpgrading:Fe===t.item.name}):(0,K.jsx)(vt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onInstall:()=>ot(t.item),isInstalling:je===t.item.name})},t.key))})});return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!ae&&(0,K.jsx)(Zt,{onDismiss:ce}),(0,K.jsx)(Tt,{search:T,onSearchChange:ne,filter:N,onFilterChange:re,isSearching:wt,categories:L,category:b,onCategoryChange:k,counts:pt,totalCount:ht,showCounts:!Et,pluginsSupported:u,showCategories:c}),!$&&!St&&yt?(0,K.jsx)(Qt,{text:t(`superpowersTab.skillsUnavailableNotice`)}):null,!$&&!St&&Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.pluginsUnavailableNotice`)}):null,H&&Te&&!bt&&!Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.catalogBrowsingUnavailableNotice`)}):null,(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[!c&&(0,K.jsx)(`aside`,{className:`w-56 shrink-0 overflow-y-auto`,children:(0,K.jsx)(xt,{ariaLabel:t(`superpowersTab.categoriesAriaLabel`),selected:b,onSelect:k,counts:pt,totalCount:ht,showCounts:!Et,categories:L})}),Dt]}),(0,K.jsx)(Ve,{skillName:he?.name??null,onConfirm:ge,onCancel:_e}),(0,K.jsx)(w,{open:U!==null,title:t(`pluginDetailShared.removePluginTitle`),message:U?$e(U.name):``,confirmLabel:t(`pluginDetailShared.remove`),destructive:!0,onConfirm:st,onCancel:()=>Re(null)}),(0,K.jsx)(w,{open:W!==null,title:t(`pluginDetailShared.upgradePluginTitle`),message:W?et(W.name):``,confirmLabel:tt,destructive:!0,onConfirm:ct,onCancel:()=>Be(null)})]})}function Jt(e,t,n,r){return(0,G.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 Yt(e,t,n,r,i,a,o){return(0,G.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 Xt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=X({assistantId:e,name:t.name}).data;return(0,K.jsx)(vt,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function Zt({onDismiss:e}){let{t:n}=j(`intelligence`);return(0,K.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,K.jsx)(de,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,K.jsx)(`p`,{className:`flex-1`,children:n(`superpowersTab.tipBannerText`)}),(0,K.jsx)(t,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,K.jsx)(Te,{"aria-hidden":!0}),onClick:e,"aria-label":n(`superpowersTab.dismissTipAriaLabel`),tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Qt({text:e}){return(0,K.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,K.jsx)(Pe,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`flex-1`,children:e})]})}function $t(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,K.jsx)(z,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function en(){let{t:e}=j(`intelligence`);return(0,K.jsx)(s.Root,{children:(0,K.jsxs)(s.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,K.jsx)(me,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-negative-strong)`},"aria-hidden":!0}),(0,K.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e(`superpowersTab.errorStateTitle`)}),(0,K.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e(`superpowersTab.errorStateSubtitle`)})]})})}function tn({filter:e,category:t}){let{t:n}=j(`intelligence`),{title:r,subtitle:i,Icon:a}=nn(e,t,n);return(0,K.jsx)(U,{icon:a,title:r,subtitle:i})}function nn(e,t,n){if(t)return{title:n(`superpowersTab.emptyState.categoryTitle`),subtitle:n(`superpowersTab.emptyState.categorySubtitle`),Icon:B};switch(e){case`installed`:return{title:n(`superpowersTab.emptyState.installedTitle`),subtitle:n(`superpowersTab.emptyState.installedSubtitle`),Icon:V};case`available`:return{title:n(`superpowersTab.emptyState.availableTitle`),subtitle:n(`superpowersTab.emptyState.availableSubtitle`),Icon:fe};case`skills`:return{title:n(`superpowersTab.emptyState.skillsTitle`),subtitle:n(`superpowersTab.emptyState.skillsSubtitle`),Icon:V};case`plugins`:return{title:n(`superpowersTab.emptyState.pluginsTitle`),subtitle:n(`superpowersTab.emptyState.pluginsSubtitle`),Icon:L};case`vellum`:return{title:n(`superpowersTab.emptyState.vellumTitle`),subtitle:n(`superpowersTab.emptyState.vellumSubtitle`),Icon:V};case`clawhub`:return{title:n(`superpowersTab.emptyState.clawhubTitle`),subtitle:n(`superpowersTab.emptyState.clawhubSubtitle`),Icon:V};case`skillssh`:return{title:n(`superpowersTab.emptyState.skillsshTitle`),subtitle:n(`superpowersTab.emptyState.skillsshSubtitle`),Icon:V};case`custom`:return{title:n(`superpowersTab.emptyState.customTitle`),subtitle:n(`superpowersTab.emptyState.customSubtitle`),Icon:V};case`assistant-memory`:return{title:n(`superpowersTab.emptyState.assistantMemoryTitle`),subtitle:n(`superpowersTab.emptyState.assistantMemorySubtitle`),Icon:V};default:return{title:n(`superpowersTab.emptyState.defaultTitle`),subtitle:n(`superpowersTab.emptyState.defaultSubtitle`),Icon:Pe}}}function rn(){return(0,K.jsx)(qt,{assistantId:C()})}export{rn as SuperpowersPage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{BC as t,FS as n,Hm as r,Ir as i,MS as a,My as o,OC as s,PC as c,Rn as l,SC as u,Um as d,Wm as f,Yl as p,Zx as m,_m as h,em as g,g as _,gC as v,gm as y,hC as b,mS as x,nm as S,nt as C,ny as ee,oC as w,qo as te,ry as T,sC as E,tm as ne,vC as D,xC as O,xa as re,zC as k,zc as ie}from"./app-XG_RF2yi.js";import{$n as A,E as j,Xn as ae,j as M,nr as oe}from"./vendor-DwMhK7fD.js";import{_ as se,b as ce,d as le,f as ue,t as N,x as P}from"./react-B9IgSVeK.js";import{$ as de,A as F,Bi as fe,Cr as pe,D as me,Ha as I,Ji as he,Mn as ge,P as _e,Pt as L,Vi as ve,Vn as ye,Ya as R,Yn as z,Zr as be,_r as xe,b as Se,gt as Ce,ha as we,i as Te,ir as B,mi as Ee,oa as De,r as V,ri as Oe,sn as ke,st as H,tr as Ae,vt as je,wn as Me,xr as Ne,yi as Pe,za as Fe}from"./icons-C0wyat6T.js";import{a as Ie,i as Le,n as U,o as Re,r as W,t as ze}from"./use-skill-actions-CMoU5oFT.js";import{t as Be}from"./skill-icon-CWKAcXVy.js";import{t as Ve}from"./skill-removal-dialog-BT--h1By.js";import{t as He}from"./plugins-surface-B99o65kn.js";import{c as Ue,i as We,l as Ge,n as Ke,o as qe,r as Je,s as Ye,u as Xe}from"./use-plugins-list-DPWrP6Mv.js";import{t as Ze}from"./use-debounced-value-DS3f___V.js";var Qe=R(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),G=e(P(),1),$e=e=>M(`pluginConstants.removeConfirmMessage`,{ns:`intelligence`,name:e}),et=e=>M(`pluginConstants.riskyUpgradeConfirmMessage`,{ns:`intelligence`,name:e}),tt=M(`pluginConstants.riskyUpgradeConfirmLabel`,{ns:`intelligence`}),nt=M(`pluginConstants.installError`,{ns:`intelligence`}),rt=M(`pluginConstants.removeError`,{ns:`intelligence`}),it=M(`pluginConstants.upgradeError`,{ns:`intelligence`}),at=M(`pluginConstants.toggleError`,{ns:`intelligence`}),K=N();function ot(e){try{return new URL(e,window.location.href).pathname.split(`/`).pop()||`plugin-artifact`}catch{return`plugin-artifact`}}function st({plugin:e,surfaces:t=null,className:n}){let{t:r}=j(`intelligence`),i=e.source?.kind===`github`?e.source.repo:r(`pluginDetailShared.localSource`),a=e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null,s=[{label:r(`pluginDetailShared.sourceLabel`),value:i,href:a??void 0}];return e.homepage&&s.push({label:r(`pluginDetailShared.homepageLabel`),value:e.homepage,href:e.homepage}),e.license&&s.push({label:r(`pluginDetailShared.licenseLabel`),value:e.license}),t&&(t.skills.length>0&&s.push({label:r(`pluginDetailShared.skillsLabel`),value:String(t.skills.length)}),t.hooks.length>0&&s.push({label:r(`pluginDetailShared.hooksLabel`),value:String(t.hooks.length)}),t.tools.length>0&&s.push({label:r(`pluginDetailShared.toolsLabel`),value:String(t.tools.length)})),(0,K.jsx)(`dl`,{className:te(`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:s.map(e=>(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,K.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,K.jsxs)(o,{href:e.href,tone:`default`,className:`inline-flex items-center gap-1`,glyph:!1,children:[e.value,(0,K.jsx)(be,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function q({plugin:e,drift:n,onInstall:r,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l,hasLocalEdits:u,enabled:d,onToggle:f,isToggling:p}){let{t:m}=j(`intelligence`),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),y=e.installed??!1,x=e.artifact??null,S=n?.status===`update-available`,C=S?m(`pluginDetailShared.upgradeTitle`,{fromSha:Ge(n?.local?.commit??null),toSha:Ge(n?.remote?.commit??null)}):void 0;return(0,K.jsxs)(K.Fragment,{children:[y?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[d!==void 0&&f?(0,K.jsx)(b,{label:m(`pluginDetailShared.autoIncludeInChat`),checked:d,onChange:()=>f(),disabled:p}):null,x?(0,K.jsx)(t,{type:`button`,leftIcon:(0,K.jsx)(Oe,{"aria-hidden":!0}),onClick:()=>void i(x.url,ot(x.url)),children:x.label??m(`pluginDetailShared.download`)}):null,S?(0,K.jsx)(t,{type:`button`,onClick:()=>{if(u){v(!0);return}o()},disabled:l,title:C,loading:l,leftIcon:(0,K.jsx)(ve,{"aria-hidden":!0}),children:m(`pluginDetailShared.upgrade`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,onClick:()=>g(!0),disabled:c,loading:c,leftIcon:(0,K.jsx)(F,{"aria-hidden":!0}),children:m(`pluginDetailShared.remove`)})]}):(0,K.jsx)(t,{type:`button`,onClick:r,disabled:s,loading:s,leftIcon:(0,K.jsx)(I,{"aria-hidden":!0}),children:m(`pluginDetailShared.install`)}),(0,K.jsx)(w,{open:h,title:m(`pluginDetailShared.removePluginTitle`),message:$e(e.name),confirmLabel:m(`pluginDetailShared.remove`),destructive:!0,onConfirm:()=>{g(!1),a()},onCancel:()=>g(!1)}),(0,K.jsx)(w,{open:_,title:m(`pluginDetailShared.upgradePluginTitle`),message:et(e.name),confirmLabel:tt,destructive:!0,onConfirm:()=>{v(!1),o()},onCancel:()=>v(!1)})]})}function ct(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,K.jsx)(z,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function lt(){let{t:e}=j(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,K.jsx)(me,{className:`h-6 w-6`,"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`text-body-medium-default`,children:e(`pluginDetailShared.loadErrorTitle`)}),(0,K.jsx)(`p`,{className:`text-body-small-lighter`,children:e(`pluginDetailShared.loadErrorDetail`)})]})}function J({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?nt:t?rt:n?it:null;return r?(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-active)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,K.jsx)(me,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function ut({external:e,className:t}){let{t:n}=j(`intelligence`),r=e?{label:n(`pluginOriginBadge.external`),icon:pe}:{label:n(`pluginOriginBadge.local`),icon:Ne};return(0,K.jsx)(u,{tone:`neutral`,leftIcon:(0,G.createElement)(r.icon),className:t,children:r.label})}function Y({onClick:e,isUpgrading:t=!1}={}){let{t:n}=j(`intelligence`),r=(0,G.createElement)(t?z:ve,{className:t?`animate-spin`:void 0}),i=n(`updateAvailableBadge.updateAvailable`);return e?(0,K.jsx)(O,{tone:`warning`,leftIcon:r,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":n(`updateAvailableBadge.upgradePluginAriaLabel`),className:`shrink-0`,children:i}):(0,K.jsx)(u,{tone:`warning`,leftIcon:r,className:`shrink-0`,children:i})}var dt=300*1e3;function X({assistantId:e,name:t,enabled:n=!0}){return A({...ne({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:dt,retry:!1})}function ft(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Z(e,t,n){let{t:r}=j(`intelligence`),i=oe(),a=n?.onInstalled,o=n?.onRemoved,s=A({...g({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),c=X({assistantId:e,name:t,enabled:s.data?.installed??!1}).data,l=(0,G.useCallback)(()=>ie(i,e,t),[e,t,i]),u=We(e,t,{onInstalled:a,onRemoved:o}),f=d({onSuccess:e=>{l(),E.success(e.outcome===`already-up-to-date`?r(`pluginToast.alreadyUpToDate`,{name:t||r(`pluginToast.pluginFallbackCapitalized`)}):r(`pluginToast.upgraded`,{name:t||r(`pluginToast.pluginFallback`),sha:Ge(e.toCommit)}))}});return{plugin:s.data??null,drift:c,isLoading:s.isLoading,isError:s.isError,install:u.install,remove:u.remove,upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:u.isInstalling,isRemoving:u.isRemoving,isUpgrading:f.isPending,isInstallError:u.isInstallError,isRemoveError:u.isRemoveError,isUpgradeError:f.isError,hasLocalEdits:ft(c)}}function pt(e){let t=oe(),n={queryKey:S({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=ae({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?T({path:{assistant_id:e,name:t},throwOnError:!1}):ee({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),E.error(at)},onSettled:(n,r,i)=>{ie(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function mt({assistantId:e,name:n,onBack:r,externalHint:i,enabled:a}){let{plugin:o,drift:c,isLoading:u,isError:d,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:r}),{t:S}=j(`intelligence`),{toggle:C,togglingName:ee}=pt(e),w=Je(e,n,o?.hasIcon,o?.iconVersion);return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,K.jsx)(t,{type:`button`,variant:`ghost`,iconOnly:(0,K.jsx)(Fe,{"aria-hidden":!0}),"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:r}),(0,K.jsx)(ht,{name:n,plugin:o,externalHint:i,iconSrc:w,drift:c,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:a,onToggle:()=>C(n,!a),isToggling:ee===n})]}),(v||y||b)&&(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,K.jsx)(s.Root,{asChild:!0,children:(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:u?(0,K.jsx)(ct,{}):d||!o?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:o,surfaces:c?.surfaces??null}),o.readme?(0,K.jsx)(l,{content:o.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})]})}function ht({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{t:h}=j(`intelligence`),g=t?.source?.kind===`github`,_=t?g:n,v=i?.status===`update-available`;return(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[_===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(Xe,{external:_,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:h(`pluginDetail.version`,{version:t.version})}):null,t?(0,K.jsx)(ut,{external:g}):null,v?(0,K.jsx)(Y,{}):null]}),t?.description?(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,K.jsx)(q,{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 gt=e(ce(),1);function _t({assistantId:e,name:n,onBack:r,externalHint:i,enabled:a}){let{plugin:o,drift:c,isLoading:u,isError:d,install:f,remove:p,upgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=Z(e,n,{onRemoved:r}),{t:S}=j(`intelligence`),{toggle:C,togglingName:ee}=pt(e),[w,te]=(0,G.useState)(null);(0,G.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let T=o?.source?.kind===`github`,E=o?T:i,ne=c?.status===`update-available`,D=o?.name??n,O=Je(e,n,o?.hasIcon,o?.iconVersion),re=(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(t,{variant:`ghost`,iconOnly:(0,K.jsx)(Fe,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":S(`pluginDetail.backToPluginsAriaLabel`),onClick:r,className:`max-md:bg-[var(--surface-active)]`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:D}),(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E===void 0?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,K.jsx)(Xe,{external:E,icon:o?.icon??void 0,iconSrc:O,size:`md`}),(0,K.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:D})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[ne?(0,K.jsx)(Y,{}):null,o?(0,K.jsx)(ut,{external:T}):null]})]}),o?.description?(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,K.jsx)(q,{plugin:o,drift:c,enabled:a,onToggle:()=>C(n,!a),isToggling:ee===n,onInstall:f,onRemove:p,onUpgrade:m,isInstalling:h,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsx)(J,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,K.jsx)(s.Root,{asChild:!0,noPadding:!0,children:(0,K.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,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:u?(0,K.jsx)(ct,{}):d||!o?(0,K.jsx)(lt,{}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(st,{plugin:o,surfaces:c?.surfaces??null}),o.readme?(0,K.jsx)(l,{content:o.readme}):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:S(`pluginDetail.noReadme`)})]})})})})]});return w?(0,gt.createPortal)(re,w):re}function vt({assistantId:e,item:n,drift:r,onSelect:i,onInstall:a,onRemove:o,onUpgrade:c,isInstalling:l=!1,isRemoving:d=!1,isUpgrading:f=!1}){let{t:p}=j(`intelligence`),m=n.status===`available`,h=r?.status===`update-available`,g=n.enabled!==void 0,_=n.enabled===!1,v=Je(e,n.name,n.hasIcon,n.iconVersion);return(0,K.jsx)(s.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:i,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())},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,K.jsx)(Xe,{size:`sm`,external:n.external,icon:n.icon,iconUrl:n.iconUrl,iconSrc:v,className:_?`opacity-50`:void 0}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:_?`var(--content-tertiary)`:`var(--content-emphasised)`},children:n.name}),n.version?(0,K.jsx)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:p(`pluginListRow.version`,{version:n.version})}):null,(0,K.jsx)(u,{tone:`neutral`,leftIcon:(0,K.jsx)(L,{"aria-hidden":!0}),children:p(`pluginListRow.pluginTag`)}),h?(0,K.jsx)(Y,{onClick:c,isUpgrading:f}):null]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:n.description??p(`pluginListRow.noDescription`)}),n.issues&&n.issues.length>0?(0,K.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:n.issues.join(`; `),children:[n.issues[0],n.issues.length>1?p(`pluginListRow.moreIssues`,{count:n.issues.length-1}):null]}):null]}),m?l?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),disabled:!0,"aria-label":p(`pluginListRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!a,"aria-label":p(`pluginListRow.installPluginAriaLabel`),expandOnMobile:!1}):(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[g?(0,K.jsx)(u,{tone:n.enabled?`positive`:`neutral`,children:n.enabled?p(`pluginListRow.enabled`):p(`pluginListRow.disabled`)}):null,(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:d,iconOnly:(0,K.jsx)(F,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:d||f||!o,"aria-label":p(`pluginListRow.removePluginAriaLabel`),expandOnMobile:!1})]})]})})}var yt={mail:ye,calendar:De,"message-circle":ge,globe:pe,zap:V,code:Ee,mic:Me,"shopping-cart":H,palette:ke,heart:xe,settings:Ce,"link-2":Ae};function bt(e){return yt[e]}var Q={email:`categories.email`,calendar:`categories.calendar`,messaging:`categories.messaging`,browsing:`categories.browsing`,productivity:`categories.productivity`,development:`categories.development`,voice:`categories.voice`,commerce:`categories.commerce`,content:`categories.content`,health:`categories.health`,system:`categories.system`,integrations:`categories.integrations`,other:`categories.other`};function xt({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o}){let{t:s}=j(`intelligence`),c=e=>{let t=Q[e.slug];return t?s(t,e.label):e.label},l=[...a].sort((e,t)=>c(e).localeCompare(c(t)));return(0,K.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o??s(`categorySidebar.skillCategoriesAriaLabel`),children:[(0,K.jsx)(St,{icon:B,label:s(`categorySidebar.all`),count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),l.map(r=>(0,K.jsx)(St,{icon:bt(r.icon)??B,label:c(r),count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function St({icon:e,label:n,count:r,isActive:i,showCount:a,onClick:o}){return(0,K.jsxs)(t,{variant:`ghost`,onClick:o,"aria-pressed":i,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:i?`var(--surface-active)`:void 0,color:i?`var(--content-default)`:`var(--content-secondary)`},children:[(0,K.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,K.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:n})]}),a&&(0,K.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:r})]})}function Ct({skill:e,onSelect:n,onInstall:r,onRemove:i,isInstalling:a=!1,isRemoving:o=!1}){let{t:c}=j(`intelligence`),l=W(e),u=_(e);return(0,K.jsx)(s.Root,{asChild:!0,children:(0,K.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},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,K.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,K.jsx)(Be,{skill:e,className:`h-7 w-7`})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,K.jsx)(Ie,{origin:e.origin})]}),(0,K.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),l?a?(0,K.jsx)(t,{type:`button`,loading:!0,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),disabled:!0,"aria-label":c(`skillRow.installingAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,iconOnly:(0,K.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!r,"aria-label":c(`skillRow.installSkillAriaLabel`),expandOnMobile:!1}):(0,K.jsx)(t,{type:`button`,variant:`dangerOutline`,loading:o,iconOnly:(0,K.jsx)(F,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),i?.()},disabled:!u||o||!i,"aria-label":c(u?`skillRow.removeSkillAriaLabel`:`skillRow.bundledSkillCannotBeRemovedAriaLabel`),title:u?void 0:c(`skillRow.bundledSkillsCannotBeRemoved`),expandOnMobile:!1})]})})}function $(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`all`:return t(`superpowersFilters.filterLabel.all`);case`installed`:return t(`superpowersFilters.filterLabel.installed`);case`available`:return t(`superpowersFilters.filterLabel.available`);case`skills`:return t(`superpowersFilters.filterLabel.skills`);case`plugins`:return t(`superpowersFilters.filterLabel.plugins`);case`custom`:return t(`superpowersFilters.filterLabel.custom`);case`assistant-memory`:return t(`superpowersFilters.filterLabel.assistantMemory`)}}function wt(){let{t:e}=j(`intelligence`);return{statusFilters:[{value:`all`,label:$(`all`,e),icon:B},{value:`installed`,label:$(`installed`,e),icon:fe},{value:`available`,label:$(`available`,e),icon:I}],typeFilters:[{value:`skills`,label:$(`skills`,e),icon:V},{value:`plugins`,label:$(`plugins`,e),icon:L}],originFilters:[{value:`vellum`,label:$(`vellum`,e),icon:Re},{value:`clawhub`,label:$(`clawhub`,e),icon:pe},{value:`skillssh`,label:$(`skillssh`,e),icon:_e},{value:`custom`,label:$(`custom`,e),icon:Se},{value:`assistant-memory`,label:$(`assistant-memory`,e),icon:we}]}}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,showCategories:f}){let{t:p}=j(`intelligence`);return(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(v,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:p(`superpowersFilters.searchPlaceholder`),"aria-label":p(`superpowersFilters.searchAriaLabel`),leftIcon:(0,K.jsx)(je,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,K.jsx)(z,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,K.jsx)(Et,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginsSupported:d,showCategories:f})]})}function Et(e){let{t:n}=j(`intelligence`),r=re(),[i,a]=(0,G.useState)(!1),{statusFilters:o,typeFilters:s,originFilters:c}=wt(),l=(0,K.jsx)(t,{type:`button`,variant:`outlined`,iconOnly:(0,K.jsx)(Qe,{"aria-hidden":!0}),"aria-label":n(`superpowersFilters.filterAriaLabel`),"aria-haspopup":r?`dialog`:`listbox`,"aria-expanded":i,tintColor:`var(--primary-base)`});if(r)return(0,K.jsx)(Dt,{...e,open:i,onOpenChange:a,trigger:l});let u=t=>{e.onFilterChange(t),a(!1)};return(0,K.jsxs)(D.Root,{open:i,onOpenChange:a,children:[(0,K.jsx)(D.Trigger,{asChild:!0,children:l}),(0,K.jsx)(D.Content,{align:`end`,sideOffset:4,className:`w-44`,children:(0,K.jsxs)(`ul`,{role:`listbox`,children:[(0,K.jsx)(Mt,{label:n(`superpowersFilters.statusLabel`),options:o,selected:e.filter,onSelect:u}),e.pluginsSupported&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:n(`superpowersFilters.typeLabel`),options:s,selected:e.filter,onSelect:u})]}),(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(Mt,{label:n(`superpowersFilters.sourceLabel`),options:c,selected:e.filter,onSelect:u}),e.showCategories&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`my-1 h-px bg-[var(--border-base)]`}),(0,K.jsx)(jt,{categories:e.categories,category:e.category,counts:e.counts,totalCount:e.totalCount,showCounts:e.showCounts,allLabel:n(`superpowersFilters.filterLabel.all`),categoriesLabel:n(`superpowersFilters.categoriesLabel`),onSelect:t=>{e.onCategoryChange(t),a(!1)}})]})]})})]})}function Dt({filter:e,onFilterChange:n,categories:r,category:i,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginsSupported:l,showCategories:u,open:d,onOpenChange:f,trigger:p}){let{t:m}=j(`intelligence`),{statusFilters:h,typeFilters:g,originFilters:_}=wt();return(0,K.jsxs)(k.Root,{open:d,onOpenChange:f,children:[(0,K.jsx)(k.Trigger,{asChild:!0,children:p}),(0,K.jsxs)(k.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,K.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,K.jsx)(k.Header,{children:(0,K.jsx)(k.Title,{children:m(`superpowersFilters.filtersTitle`)})}),(0,K.jsxs)(k.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,K.jsx)(Ot,{label:m(`superpowersFilters.statusLabel`),children:h.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),l&&(0,K.jsx)(Ot,{label:m(`superpowersFilters.typeLabel`),children:g.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),(0,K.jsx)(Ot,{label:m(`superpowersFilters.sourceLabel`),children:_.map(t=>(0,K.jsx)(kt,{icon:t.icon,label:t.label,active:e===t.value,onSelect:()=>n(t.value)},t.value))}),u&&(0,K.jsxs)(Ot,{label:m(`superpowersFilters.categoriesLabel`),children:[(0,K.jsx)(kt,{icon:B,label:m(`superpowersFilters.filterLabel.all`),active:i===null,badge:c?s:void 0,onSelect:()=>a(null)}),At(r).map(e=>(0,K.jsx)(kt,{icon:bt(e.icon)??B,label:e.label,active:i===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,K.jsx)(k.Footer,{children:(0,K.jsx)(t,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>f(!1),children:m(`superpowersFilters.done`)})})]})]})}function Ot({label:e,children:t}){return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function kt({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,K.jsx)(c,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,K.jsx)(he,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function At(e){return[...e].sort((e,t)=>e.label.localeCompare(t.label))}function jt({categories:e,category:t,counts:n,totalCount:r,showCounts:i,allLabel:a,categoriesLabel:o,onSelect:s}){return(0,K.jsx)(Nt,{label:o,children:(0,K.jsx)(`ul`,{className:`max-h-48 overflow-y-auto`,children:[{slug:null,label:a,count:r},...At(e).map(e=>({slug:e.slug,label:e.label,count:n[e.slug]??0}))].map(e=>{let n=t===e.slug;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(e.slug),role:`option`,"aria-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${n?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:e.label}),i&&(0,K.jsx)(`span`,{style:{color:`var(--content-tertiary)`},children:e.count})]})},e.slug??`all`)})})})}function Mt({label:e,options:t,selected:n,onSelect:r}){return(0,K.jsx)(Nt,{label:e,children:(0,K.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-body-medium-default transition-colors hover:bg-[var(--surface-hover)] ${i?`text-[var(--primary-base)]`:`text-[var(--content-secondary)] hover:text-[var(--content-emphasised)]`}`,children:[(0,K.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,K.jsx)(fe,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})})}function Nt({label:e,children:t}){return(0,K.jsxs)(`li`,{role:`group`,"aria-label":e,children:[(0,K.jsx)(`div`,{className:`px-2 py-1.5 text-body-small-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e}),t]})}function Pt(e){return A({...y({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}var Ft=new Set([`all`,`installed`,`available`,`skills`,`plugins`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function It(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:zt(t)?t:`all`,category:n||null}}function Lt(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Rt(n,`q`,t.q.trim()||null),t.filter!==void 0&&Rt(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Rt(n,`category`,t.category),n}function Rt(e,t,n){n===null?e.delete(t):e.set(t,n)}function zt(e){return e!==null&&Ft.has(e)}function Bt(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 Vt(e){return e!==`plugins`}function Ht(e){return e===`all`||e===`installed`||e===`available`||e===`plugins`}function Ut(e){switch(e){case`installed`:return`installed`;case`available`:return`available`;default:return`all`}}var Wt=300,Gt=`vellum:superpowers:tipDismissed`;function Kt(e){return[...e].sort((e,t)=>e.installed===t.installed?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):e.installed?-1:1)}function qt({assistantId:e}){let{t}=j(`intelligence`),i=ue(),o=le(),s=oe(),c=p(),l=m.use.version(),u=He(),[g,_]=se(),{q:v,filter:y,category:b}=(0,G.useMemo)(()=>It(g),[g]),S=g.get(`plugin`),C=(0,G.useCallback)(e=>{_(t=>Lt(t,e),{replace:!0})},[_]),ee=g.get(`success`),te=(0,G.useRef)(!1);(0,G.useEffect)(()=>{ee!==`true`||te.current||(te.current=!0,S&&E.success(t(`pluginToast.installed`,{name:S})),_(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[ee,S,_,t]);let[T,ne]=(0,G.useState)(v),D=Ze(T.trim(),Wt),O=(0,G.useRef)(v);(0,G.useEffect)(()=>{if(v!==O.current&&(O.current=v,v!==T.trim())){ne(v);return}D!==v&&D===T.trim()&&(O.current=D,C({q:D}))},[D,v,T,C]);let re=(0,G.useCallback)(e=>C({filter:e}),[C]),k=(0,G.useCallback)(e=>C({category:e}),[C]),[ae,M]=(0,G.useState)(()=>a(Gt,!1)),ce=(0,G.useCallback)(()=>{M(!0),n(Gt,!0)},[]),N=!u&&y===`plugins`?`all`:y,P=Vt(N),de=u&&Ht(N),F=Ut(N),{handleInstall:fe,handleRemove:pe,isInstallingSkill:me,isRemovingSkill:I,skillPendingRemoval:he,confirmRemove:ge,cancelRemove:_e}=ze(e),{data:L=[]}=Pt(e),{origin:ve,kind:ye}=(0,G.useMemo)(()=>Bt(N),[N]),R=A({...h({path:{assistant_id:e},query:{include:`catalog`,origin:ve,kind:ye,q:D||void 0,category:b??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&P}),z=A({...h({path:{assistant_id:e},query:{include:`catalog`,origin:ve,kind:ye,q:D||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&P&&b!==null}),{items:be,isLoading:xe,catalogLoading:Se,isError:Ce,isFetching:we,catalogError:Te,categorySupported:B,installedCategoryCounts:Ee,installedPlugins:De,installedTotal:V,catalogMatches:Oe,unfilteredInstalledNames:ke}=Ke(e,b,u),H=de&&(b===null||B),Ae=(0,G.useCallback)(t=>ie(s,e,t),[e,s]),[je,Me]=(0,G.useState)(null),[Ne,Pe]=(0,G.useState)(null),[Fe,Ie]=(0,G.useState)(null),[U,Re]=(0,G.useState)(null),[W,Be]=(0,G.useState)(null),We=f({onMutate:e=>Me(e.body.name),onSuccess:(e,n)=>E.success(t(`pluginToast.installed`,{name:n.body.name})),onError:()=>E.error(nt),onSettled:(e,t,n)=>{Me(null),Ae(n.body.name)}}),Je=r({onMutate:e=>Pe(e.path.name),onSuccess:(e,n)=>{E.success(t(`pluginToast.removed`,{name:n.path.name})),qe(e.warnings,t)},onError:()=>E.error(rt),onSettled:(e,t,n)=>{Pe(null),Ae(n.path.name)}}),Xe=d({onMutate:e=>Ie(e.path.name),onSuccess:(e,n)=>E.success(e.outcome===`already-up-to-date`?t(`pluginToast.alreadyUpToDate`,{name:n.path.name}):t(`pluginToast.upgraded`,{name:n.path.name,sha:Ge(e.toCommit)})),onError:()=>E.error(it),onSettled:(e,t,n)=>{Ie(null),Ae(n.path.name)}}),Qe=(0,G.useCallback)(e=>_(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[_]),at=(0,G.useCallback)(()=>_(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[_]),ot=(0,G.useCallback)(t=>{We.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,We]),st=(0,G.useCallback)(()=>{U&&(Je.mutate({path:{assistant_id:e,name:U.name}}),Re(null))},[e,U,Je]),q=(0,G.useCallback)(t=>{Xe.mutate({path:{assistant_id:e,name:t},body:{}})},[e,Xe]),ct=(0,G.useCallback)(()=>{W&&(q(W.name),Be(null))},[W,q]),lt=(0,G.useCallback)((e,t)=>{if(ft(t)){Be(e);return}q(e.name)},[q]),J=(0,G.useMemo)(()=>P?R.data?.skills??[]:[],[P,R.data?.skills]),ut=(0,G.useMemo)(()=>H?Ye(be,F).filter(e=>Ue(e,D)):[],[H,be,F,D]),Y=(0,G.useMemo)(()=>Kt([...J.map(e=>({type:`skill`,key:`skill:${e.id}`,name:e.name,installed:Le(e),skill:e})),...ut.map(e=>({type:`plugin`,key:`plugin:${e.name}`,name:e.name,installed:e.status===`installed`,item:e}))]),[J,ut]),dt=b===null?R.data:z.data,X=Jt(P,dt?.skills??J,dt?.categoryCounts,dt?.totalCount),Z=Yt(de&&B,Ee,De,V,Oe,ke,F),{counts:pt,totalCount:ht}=(0,G.useMemo)(()=>{let e={...X.counts};for(let[t,n]of Object.entries(Z.counts))e[t]=(e[t]??0)+n;return{counts:e,totalCount:X.totalCount+Z.totalCount}},[X,Z]),gt=P&&R.isLoading,yt=P&&R.isError,bt=H&&xe,Q=H&&Ce,St=(yt||!P)&&(Q||!H)&&(yt||Q),$=gt||bt,wt=!!D&&(P&&R.isFetching||H&&we&&!xe),Et=T.trim().length>0;if(S&&!u&&l===null)return null;if(S&&u){let t=be.find(e=>e.name===S),n={assistantId:e,name:S,externalHint:t?.external,enabled:t?.enabled,onBack:at};return c?(0,K.jsx)(_t,{...n}):(0,K.jsx)(mt,{...n})}let Dt=(0,K.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:$?(0,K.jsx)($t,{}):St?(0,K.jsx)(en,{}):Y.length===0?H&&Se&&F!==`installed`?(0,K.jsx)($t,{}):(0,K.jsx)(tn,{filter:N,category:b}):(0,K.jsx)(`ul`,{className:`flex flex-col gap-2`,children:Y.map(t=>(0,K.jsx)(`li`,{children:t.type===`skill`?(0,K.jsx)(Ct,{skill:t.skill,onSelect:()=>i(x.skills.detail(t.skill.id),{state:{listSearch:o.search}}),onInstall:()=>fe(t.skill),onRemove:()=>pe(t.skill),isInstalling:me(t.skill),isRemoving:I(t.skill)}):t.installed?(0,K.jsx)(Xt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onRemove:()=>Re(t.item),onUpgrade:e=>lt(t.item,e),isRemoving:Ne===t.item.name,isUpgrading:Fe===t.item.name}):(0,K.jsx)(vt,{assistantId:e,item:t.item,onSelect:()=>Qe(t.item),onInstall:()=>ot(t.item),isInstalling:je===t.item.name})},t.key))})});return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!ae&&(0,K.jsx)(Zt,{onDismiss:ce}),(0,K.jsx)(Tt,{search:T,onSearchChange:ne,filter:N,onFilterChange:re,isSearching:wt,categories:L,category:b,onCategoryChange:k,counts:pt,totalCount:ht,showCounts:!Et,pluginsSupported:u,showCategories:c}),!$&&!St&&yt?(0,K.jsx)(Qt,{text:t(`superpowersTab.skillsUnavailableNotice`)}):null,!$&&!St&&Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.pluginsUnavailableNotice`)}):null,H&&Te&&!bt&&!Q?(0,K.jsx)(Qt,{text:t(`superpowersTab.catalogBrowsingUnavailableNotice`)}):null,(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[!c&&(0,K.jsx)(`aside`,{className:`w-56 shrink-0 overflow-y-auto`,children:(0,K.jsx)(xt,{ariaLabel:t(`superpowersTab.categoriesAriaLabel`),selected:b,onSelect:k,counts:pt,totalCount:ht,showCounts:!Et,categories:L})}),Dt]}),(0,K.jsx)(Ve,{skillName:he?.name??null,onConfirm:ge,onCancel:_e}),(0,K.jsx)(w,{open:U!==null,title:t(`pluginDetailShared.removePluginTitle`),message:U?$e(U.name):``,confirmLabel:t(`pluginDetailShared.remove`),destructive:!0,onConfirm:st,onCancel:()=>Re(null)}),(0,K.jsx)(w,{open:W!==null,title:t(`pluginDetailShared.upgradePluginTitle`),message:W?et(W.name):``,confirmLabel:tt,destructive:!0,onConfirm:ct,onCancel:()=>Be(null)})]})}function Jt(e,t,n,r){return(0,G.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 Yt(e,t,n,r,i,a,o){return(0,G.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 Xt({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=X({assistantId:e,name:t.name}).data;return(0,K.jsx)(vt,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function Zt({onDismiss:e}){let{t:n}=j(`intelligence`);return(0,K.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,K.jsx)(de,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,K.jsx)(`p`,{className:`flex-1`,children:n(`superpowersTab.tipBannerText`)}),(0,K.jsx)(t,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,K.jsx)(Te,{"aria-hidden":!0}),onClick:e,"aria-label":n(`superpowersTab.dismissTipAriaLabel`),tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Qt({text:e}){return(0,K.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,K.jsx)(Pe,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,K.jsx)(`p`,{className:`flex-1`,children:e})]})}function $t(){return(0,K.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,K.jsx)(z,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function en(){let{t:e}=j(`intelligence`);return(0,K.jsx)(s.Root,{children:(0,K.jsxs)(s.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,K.jsx)(me,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-negative-strong)`},"aria-hidden":!0}),(0,K.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e(`superpowersTab.errorStateTitle`)}),(0,K.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e(`superpowersTab.errorStateSubtitle`)})]})})}function tn({filter:e,category:t}){let{t:n}=j(`intelligence`),{title:r,subtitle:i,Icon:a}=nn(e,t,n);return(0,K.jsx)(U,{icon:a,title:r,subtitle:i})}function nn(e,t,n){if(t)return{title:n(`superpowersTab.emptyState.categoryTitle`),subtitle:n(`superpowersTab.emptyState.categorySubtitle`),Icon:B};switch(e){case`installed`:return{title:n(`superpowersTab.emptyState.installedTitle`),subtitle:n(`superpowersTab.emptyState.installedSubtitle`),Icon:V};case`available`:return{title:n(`superpowersTab.emptyState.availableTitle`),subtitle:n(`superpowersTab.emptyState.availableSubtitle`),Icon:fe};case`skills`:return{title:n(`superpowersTab.emptyState.skillsTitle`),subtitle:n(`superpowersTab.emptyState.skillsSubtitle`),Icon:V};case`plugins`:return{title:n(`superpowersTab.emptyState.pluginsTitle`),subtitle:n(`superpowersTab.emptyState.pluginsSubtitle`),Icon:L};case`vellum`:return{title:n(`superpowersTab.emptyState.vellumTitle`),subtitle:n(`superpowersTab.emptyState.vellumSubtitle`),Icon:V};case`clawhub`:return{title:n(`superpowersTab.emptyState.clawhubTitle`),subtitle:n(`superpowersTab.emptyState.clawhubSubtitle`),Icon:V};case`skillssh`:return{title:n(`superpowersTab.emptyState.skillsshTitle`),subtitle:n(`superpowersTab.emptyState.skillsshSubtitle`),Icon:V};case`custom`:return{title:n(`superpowersTab.emptyState.customTitle`),subtitle:n(`superpowersTab.emptyState.customSubtitle`),Icon:V};case`assistant-memory`:return{title:n(`superpowersTab.emptyState.assistantMemoryTitle`),subtitle:n(`superpowersTab.emptyState.assistantMemorySubtitle`),Icon:V};default:return{title:n(`superpowersTab.emptyState.defaultTitle`),subtitle:n(`superpowersTab.emptyState.defaultSubtitle`),Icon:Pe}}}function rn(){return(0,K.jsx)(qt,{assistantId:C()})}export{rn as SuperpowersPage};
|