@vellumai/web 0.11.0-staging.1 → 0.11.0-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/access-DS79PSR3.js +1 -0
- package/dist/assets/{account-page-BQkbkIBf.js → account-page-D3ERiewh.js} +1 -1
- package/dist/assets/{acp-run-actions-BWR9i8MT.js → acp-run-actions-BH8wuBAL.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-np07jHCY.js → acp-run-detail-panel-dqVK6rPq.js} +1 -1
- package/dist/assets/{activity-steps-panel-DA5HdB61.js → activity-steps-panel-xxl2hu3E.js} +1 -1
- package/dist/assets/{add-credential-modal-rP3DdyDH.js → add-credential-modal-CY_--m8L.js} +1 -1
- package/dist/assets/{ai-page-eBXLZw6t.js → ai-page-B02NwVRu.js} +1 -1
- package/dist/assets/{api-CI6Y6DLb.js → api-C3QSs67k.js} +1 -1
- package/dist/assets/{api-BlN0EOWF.js → api-LG8zI3nK.js} +1 -1
- package/dist/assets/{api-key-screen-B6aLgYrf.js → api-key-screen-CvBdN6Ae.js} +1 -1
- package/dist/assets/{app-card-A7PMnlAT.js → app-card-CAaFL1oB.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-DV5Zr1c4.js → assistant-feature-flag-store-CAdgpPiS.js} +1 -1
- package/dist/assets/{assistant-status-panel-CxMEVjFY.js → assistant-status-panel-BTnD-jhG.js} +1 -1
- package/dist/assets/{auth-store-BW4V6iLb.js → auth-store-5qq59BAN.js} +1 -1
- package/dist/assets/{avatar-random-BiEMZGl7.js → avatar-random-BMSYTcJK.js} +1 -1
- package/dist/assets/{background-task-actions-Y-aaTGGd.js → background-task-actions-DmP5s0oO.js} +1 -1
- package/dist/assets/{background-task-detail-panel-CGAeD1Ym.js → background-task-detail-panel-BCYAElGc.js} +1 -1
- package/dist/assets/{billing-page-5GkNMPN6.js → billing-page-B5j5TW_S.js} +1 -1
- package/dist/assets/{bookmarks-page-B1-9GBEx.js → bookmarks-page-D_Jr-a4Q.js} +1 -1
- package/dist/assets/build-state-m0LQ5Iis.js +1 -0
- package/dist/assets/{channels-page-route-BLy5uT8z.js → channels-page-route-BYP9SOw5.js} +1 -1
- package/dist/assets/{chat-avatar-DQx81apI.js → chat-avatar-CvEA6z0H.js} +1 -1
- package/dist/assets/{chat-markdown-message-CdM44BjA.js → chat-markdown-message-rxPKNeTx.js} +1 -1
- package/dist/assets/{checkout-continuation-DIMnSvv3.js → checkout-continuation-U3Pd2nxi.js} +1 -1
- package/dist/assets/{checkout-page-BZQpdPLT.js → checkout-page-C5_9GbP-.js} +1 -1
- package/dist/assets/{client-feature-flag-store-BDrcV52r.js → client-feature-flag-store-CMncoan8.js} +1 -1
- package/dist/assets/{command-palette-window-page-DAC710zo.js → command-palette-window-page-gq0zowBe.js} +1 -1
- package/dist/assets/{contacts-page-route-BF8J2JDt.js → contacts-page-route-DNoCUXE7.js} +1 -1
- package/dist/assets/{conversation-cache-DU44A0zv.js → conversation-cache-DKvwwWNo.js} +1 -1
- package/dist/assets/{conversation-list-fetchers-DLZho4T7.js → conversation-list-fetchers-DM-Y61u5.js} +1 -1
- package/dist/assets/conversation-navigation-DsN0hcpL.js +1 -0
- package/dist/assets/{conversation-queries-Bvh4bAZ6.js → conversation-queries-CWvK6RLK.js} +1 -1
- package/dist/assets/{credentials-page-DzlUvhn4.js → credentials-page-BsJFuOc9.js} +1 -1
- package/dist/assets/{debug-page-TgklOyxq.js → debug-page-BziypDgA.js} +1 -1
- package/dist/assets/{deploy-dialogs-Day3_9Lh.js → deploy-dialogs-DZSd5o9b.js} +1 -1
- package/dist/assets/{deploy-store-Brp7LoZ_.js → deploy-store-D6snB1j5.js} +1 -1
- package/dist/assets/{developer-page-BobJIDnJ.js → developer-page-QMFEIyBS.js} +1 -1
- package/dist/assets/{document-viewer-container-BIS1iPUz.js → document-viewer-container-B7TEDeV0.js} +1 -1
- package/dist/assets/{document-viewer-page-CcGTGI8C.js → document-viewer-page-3Eq8L562.js} +1 -1
- package/dist/assets/{emails-page-CbAcUM70.js → emails-page-Wr4wPSYl.js} +1 -1
- package/dist/assets/{eye-bbox-DU39FEUp.js → eye-bbox-C_V87iLg.js} +1 -1
- package/dist/assets/feature-flag-catalog-I9-eJQP_.js +1 -0
- package/dist/assets/{first-run-scope-DKYDP-Kz.js → first-run-scope-CL5YbC3b.js} +1 -1
- package/dist/assets/{general-page-CtfWmXZi.js → general-page-lbkufqHg.js} +1 -1
- package/dist/assets/{get-memory-stats-DMSpgqW_.js → get-memory-stats-BCYSpBF6.js} +1 -1
- package/dist/assets/hatching-screen-D81diZoa.js +1 -0
- package/dist/assets/{home-page-route-BV2GBxZi.js → home-page-route-CHe8eoLz.js} +1 -1
- package/dist/assets/{hosting-screen-CTtZrpXi.js → hosting-screen-D9atAksQ.js} +1 -1
- package/dist/assets/{identity-page-route-DsU3eoey.js → identity-page-route-CK3YsXCN.js} +1 -1
- package/dist/assets/{index-DMFNBbtE.js → index-0f48hi7h.js} +1 -1
- package/dist/assets/{inspect-page-BcTmA6nR.js → inspect-page-COwvbHtX.js} +1 -1
- package/dist/assets/{installed-plugins-query-C29LGAEV.js → installed-plugins-query-Cgek0q7G.js} +1 -1
- package/dist/assets/{integrations-page-CTST1yxp.js → integrations-page-CJOBwxXp.js} +1 -1
- package/dist/assets/{invalidate-plugin-queries-DamxiwYv.js → invalidate-plugin-queries-C3NTXkCX.js} +1 -1
- package/dist/assets/{latest-assistant-text-C0pZSmc9.js → latest-assistant-text-DOepZ_Io.js} +2 -2
- package/dist/assets/{library-detail-page-CI4p4bVi.js → library-detail-page-DVwI94NZ.js} +1 -1
- package/dist/assets/{library-page-SAKHIHZb.js → library-page-CNA794WY.js} +1 -1
- package/dist/assets/{local-runtime-upgrade-CoFpjlw3.js → local-runtime-upgrade-Bqn3d7Q7.js} +1 -1
- package/dist/assets/{login-flow-B4pa-3II.js → login-flow-CD9tyuFG.js} +1 -1
- package/dist/assets/{login-page-CVnwfJ3R.js → login-page-BNStrcnU.js} +1 -1
- package/dist/assets/{logout-page-km3RHlGI.js → logout-page-CpFeuLA_.js} +1 -1
- package/dist/assets/{logs-layout-D4Ubybh3.js → logs-layout-BUiPeZ4I.js} +1 -1
- package/dist/assets/{memory-page-route-JRgoyHnC.js → memory-page-route-C0cBV7HD.js} +1 -1
- package/dist/assets/{memory-router-playground-page-DvbF6E2-.js → memory-router-playground-page-D4UIq8mw.js} +1 -1
- package/dist/assets/{messages-Coz9buJR.js → messages-CFcAW4iz.js} +2 -2
- package/dist/assets/navigation-resolver-DPJxzx0h.js +1 -0
- package/dist/assets/{notifications-page-CWtQZnHw.js → notifications-page-ClfcJeLf.js} +1 -1
- package/dist/assets/{open-workspace-file-DNaU5wg2.js → open-workspace-file-DtK3a84K.js} +2 -2
- package/dist/assets/{page-empty-state-L-3_3LSi.js → page-empty-state-DT-tC1u6.js} +1 -1
- package/dist/assets/{personality-page-B621HU2-.js → personality-page-BJpW3UXD.js} +1 -1
- package/dist/assets/{plans-page-DAVt4mwm.js → plans-page-BDKqdYNM.js} +1 -1
- package/dist/assets/{platform-login-notice-BaCrIk0m.js → platform-login-notice-CdYiKsE8.js} +1 -1
- package/dist/assets/{platform-loopback-page-jBGJSmyh.js → platform-loopback-page-D0gXCm2S.js} +1 -1
- package/dist/assets/{privacy-page-DZEcN0PF.js → privacy-page-B0QN4qZO.js} +1 -1
- package/dist/assets/privacy-screen-vp4uUpm6.js +1 -0
- package/dist/assets/{provider-callback-page-BeDYWdc_.js → provider-callback-page-BH6DES7c.js} +1 -1
- package/dist/assets/{provider-key-1rLTitmu.js → provider-key-D2Nsf9zh.js} +1 -1
- package/dist/assets/{provider-signup-page-CVKaVhiB.js → provider-signup-page-BAPcG_iJ.js} +1 -1
- package/dist/assets/{react-query.gen-r3I6j8-1.js → react-query.gen-C5c1Acuq.js} +1 -1
- package/dist/assets/{research-onboarding-route-DwRSK3R4.js → research-onboarding-route-CFL3q__m.js} +2 -2
- package/dist/assets/{retire-confirm-dialog-BuS97P1t.js → retire-confirm-dialog-CsSY2-T8.js} +1 -1
- package/dist/assets/{review-terms-screen-CTNEkesk.js → review-terms-screen-BhyRQBjl.js} +1 -1
- package/dist/assets/{risk-DmicWnoH.js → risk-CdT92Vqr.js} +1 -1
- package/dist/assets/{routes-Bzk5oLRb.js → routes-CaP5Tqj7.js} +14 -14
- package/dist/assets/{runtime-upgrade-banner-DPMpuefs.js → runtime-upgrade-banner-DPqzKtZU.js} +1 -1
- package/dist/assets/{schedules-DIpn4jGl.js → schedules-6hzhR_C_.js} +1 -1
- package/dist/assets/{schedules-page-A9pwMmex.js → schedules-page-DVnUeaoB.js} +1 -1
- package/dist/assets/{sdk.gen-BVAVE6A_.js → sdk.gen-BHZ0fJla.js} +1 -1
- package/dist/assets/{select-assistant-screen-BPXqMOtp.js → select-assistant-screen-CVV3iqMy.js} +1 -1
- package/dist/assets/{settings-layout-CrOIplp2.js → settings-layout-B_4PKJr9.js} +1 -1
- package/dist/assets/{settings-navigation-Ccol_TOM.js → settings-navigation-CSG7jiyJ.js} +1 -1
- package/dist/assets/{share-feedback-modal-IyuFKIAE.js → share-feedback-modal-BoWCg4KH.js} +1 -1
- package/dist/assets/{sidebar-tree-_HwQiPki.js → sidebar-tree-C_PPNHe5.js} +1 -1
- package/dist/assets/{signup-page-D44Im_Pf.js → signup-page-D0S_8XYw.js} +1 -1
- package/dist/assets/{site-favicon-DzmWythg.js → site-favicon-BB1pYWLF.js} +1 -1
- package/dist/assets/{skill-detail-page-HW_A5KMG.js → skill-detail-page-CTobyK6L.js} +1 -1
- package/dist/assets/{skill-detail-panel-CrwVImjM.js → skill-detail-panel-CNzionF7.js} +1 -1
- package/dist/assets/{skills-Djg056es.js → skills-Cum1XWT2.js} +1 -1
- package/dist/assets/{sound-manager-DlaDOZ8r.js → sound-manager-Bx-OcMAz.js} +1 -1
- package/dist/assets/{sounds-page-CtII5pFQ.js → sounds-page-C45-RF4i.js} +1 -1
- package/dist/assets/{subagent-detail-panel-tuHcbKyo.js → subagent-detail-panel-DyyMdaNO.js} +1 -1
- package/dist/assets/subagent-store-MDi6lBXs.js +3 -0
- package/dist/assets/{superpowers-page-f4EChE6q.js → superpowers-page-CaLzK5D-.js} +1 -1
- package/dist/assets/{system-events-page-oxkNLamU.js → system-events-page-DXAU01ZO.js} +1 -1
- package/dist/assets/{theme-stage-page-5wL3M-2c.js → theme-stage-page-BDTCmutO.js} +1 -1
- package/dist/assets/{tool-detail-panel-BqhEUAMJ.js → tool-detail-panel-DFrWEWKG.js} +1 -1
- package/dist/assets/{transcript-message-body-shared-D3uxHQt5.js → transcript-message-body-shared-D9_d2c2X.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-BRA25NVC.js → upgrade-cancel-page-eiJEAvFz.js} +1 -1
- package/dist/assets/{upgrade-success-page-BlZDEVkm.js → upgrade-success-page-Cb1Gl4MM.js} +1 -1
- package/dist/assets/{use-app-theme-CGie3Dma.js → use-app-theme-Dg8A6vPA.js} +1 -1
- package/dist/assets/{use-assistant-avatar-IcRIy2-c.js → use-assistant-avatar-bwLHcMz4.js} +1 -1
- package/dist/assets/{use-assistant-capability-C8pZDYlr.js → use-assistant-capability-CDS7GbSO.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-CE6-JkNE.js → use-assistant-identity-details-9JRWxXTQ.js} +1 -1
- package/dist/assets/{use-bookmarks-CIhaNp5_.js → use-bookmarks-CK-nOiT-.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-BpmG1OQ0.js → use-checkout-dismiss-refresh-CqGR_OsB.js} +1 -1
- package/dist/assets/{use-command-palette-sections-CXU-OW-6.js → use-command-palette-sections-CkpUaAKs.js} +1 -1
- package/dist/assets/{use-edit-app-CYK9-rGD.js → use-edit-app-B_Nequzs.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-DdiGDpLS.js → use-invite-link-dialog-CPPOduk8.js} +1 -1
- package/dist/assets/{use-ios-app-nudge-t0SIn8xv.js → use-ios-app-nudge-B-ojl-b1.js} +1 -1
- package/dist/assets/{use-is-org-ready-D0q2NIZU.js → use-is-org-ready-C5xlYywh.js} +1 -1
- package/dist/assets/{use-onboarding-login-BmYpiSIt.js → use-onboarding-login-DI5gvqEG.js} +1 -1
- package/dist/assets/{use-platform-assistant-id-Cm5BfOD8.js → use-platform-assistant-id-DOsSt6k1.js} +1 -1
- package/dist/assets/{use-platform-gate-bFyCaLbM.js → use-platform-gate-C65D14xY.js} +1 -1
- package/dist/assets/{use-save-twilio-credentials-Bm-WW_5V.js → use-save-twilio-credentials-c9xG9RPK.js} +1 -1
- package/dist/assets/{use-skill-actions-C4J1lG_r.js → use-skill-actions-BAAx1Eia.js} +1 -1
- package/dist/assets/{use-skill-detail-files-BKtCag3o.js → use-skill-detail-files-BvOKvY0-.js} +1 -1
- package/dist/assets/{use-sticky-profiles-mC9bd8xU.js → use-sticky-profiles-CdWX0mgI.js} +1 -1
- package/dist/assets/{use-subagent-card-data-Dp1wCoRB.js → use-subagent-card-data-DHuNtSy9.js} +1 -1
- package/dist/assets/{utils-BCDvGOqU.js → utils-B0rBxtYP.js} +1 -1
- package/dist/assets/{viewer-store-Ct0SDE-n.js → viewer-store-DLk-jp8U.js} +1 -1
- package/dist/assets/{voice-list-IdN1mqlX.js → voice-list-CW8mzaHU.js} +1 -1
- package/dist/assets/{voice-page-CxWJ-zo7.js → voice-page-0zsCIOdT.js} +1 -1
- package/dist/assets/{voice-picker-modal-BHRanF0C.js → voice-picker-modal-PdsZwrsV.js} +1 -1
- package/dist/assets/{welcome-screen-jOvMiW_R.js → welcome-screen-DwOAZpZS.js} +1 -1
- package/dist/assets/{workflow-store-CMNMu-fc.js → workflow-store-lM7yKbUo.js} +1 -1
- package/dist/assets/workspace-page-D4NvhCv1.js +1 -0
- package/dist/assets/{workspace-tree-query-COH0vdQ-.js → workspace-tree-query-B1A-efgV.js} +1 -1
- package/dist/index.html +61 -61
- package/package.json +1 -1
- package/dist/assets/access-CHoOc28F.js +0 -1
- package/dist/assets/build-state-DaLynPsy.js +0 -1
- package/dist/assets/conversation-navigation-Bo95jhXQ.js +0 -1
- package/dist/assets/feature-flag-catalog-TjLF99gJ.js +0 -1
- package/dist/assets/hatching-screen-Btkqf3MF.js +0 -1
- package/dist/assets/navigation-resolver-D4jPigYv.js +0 -1
- package/dist/assets/privacy-screen-DXkQbNvk.js +0 -1
- package/dist/assets/subagent-store-CQKOOAm6.js +0 -3
- package/dist/assets/workspace-page-BZBNul96.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./useQuery-Bz-fbQ-m.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./card-DRIctGVs.js";import"./src-te3YTBG-.js";import{pn as o}from"./sdk.gen-BVAVE6A_.js";import{J as s,h as c,q as l}from"./react-query.gen-r3I6j8-1.js";import{s as u}from"./auth-store-BW4V6iLb.js";import{t as d}from"./client-feature-flag-store-BDrcV52r.js";import{t as f}from"./access-CHoOc28F.js";import{t as p}from"./use-active-assistant-id-CldxA_-M.js";var m=e(t(),1),h=class extends Error{status;constructor(e,t){super(t),this.name=`SimulateMemoryRouterError`,this.status=e}};async function g(e,t,n){let{data:r,response:i}=await o({path:{assistant_id:e},body:t,signal:n,throwOnError:!1}),a=i?await i.clone().text().catch(()=>``):``;if(!i||!i.ok)throw new h(i?.status??0,a||i?.statusText||`Failed to simulate memory router`);if(!r)throw new h(i.status,`Empty response from memory router simulator endpoint`);return{response:r,rawRequest:JSON.stringify(t,null,2),rawResponse:_(a)}}function _(e){if(e.length===0)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function v(e){return r({mutationFn:async t=>{if(!e)throw new h(0,`Missing assistantId`);return g(e,t)}})}function y(e){return n({...c({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4})}function b(e){return n({...s({path:{assistant_id:e}}),enabled:!!e,staleTime:1440*60*1e3})}function x(e){return n({...l({path:{assistant_id:e}}),enabled:!!e,staleTime:1/0})}var S=i();function C(){let e=f(),t=u(),n=d.use.memoryRouterPlayground();return t?(0,S.jsx)($,{children:`Loading…`}):!e||!n?(0,S.jsx)($,{children:`Memory router playground is not available.`}):(0,S.jsx)(T,{})}var w={tier1:``,tier2:``,batch:``,profile:``,customPrompt:``};function T(){let e=p(),t=v(e),n=v(e),r=y(e),i=b(e),a=x(e),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)([{assistantMessage:``,userMessage:``}]),[u,d]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(u)return;let e=a.data?.nowText;typeof e==`string`&&o===``&&s(e)},[a.data?.nowText,o,u]);let[f,h]=(0,m.useState)(w),[g,_]=(0,m.useState)(w),[C,T]=(0,m.useState)(null),[D,k]=(0,m.useState)(null),j=c[c.length-1].userMessage,M=e=>{let r=e===`A`?f:g,i=e===`A`?T:k,a=e===`A`?t:n;i(null);let s;try{s=E(r)}catch(e){i(e instanceof Error?e.message:`Invalid override input`);return}let l=r.profile.trim().length>0?r.profile:void 0,u=r.customPrompt.trim().length>0?r.customPrompt:void 0,d=c.map((e,t)=>t===c.length-1?{...e,userMessage:e.userMessage.trim()}:e);a.mutate({recentTurnPairs:d,nowText:o,...s?{configOverrides:s}:{},...l===void 0?{}:{profileOverride:l},...u===void 0?{}:{routerPromptOverride:u}})},N=()=>{M(`A`),M(`B`)},P=j.trim().length>0,I=P&&!t.isPending,L=P&&!n.isPending;return(0,S.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-y-auto`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-6`,children:[(0,S.jsx)(ee,{}),(0,S.jsx)(O,{nowText:o,onNowTextChange:e=>{d(!0),s(e)},onReloadNowText:()=>{let e=a.data?.nowText;typeof e==`string`&&(s(e),d(!1))},nowTextLoading:a.isLoading,pairs:c,onPairsChange:l}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(A,{paneId:`A`,overrides:f,onChange:h,onRun:()=>M(`A`),canRun:I,isRunning:t.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``}),(0,S.jsx)(A,{paneId:`B`,overrides:g,onChange:_,onRun:()=>M(`B`),canRun:L,isRunning:n.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``})]}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(te,{onClick:N,disabled:!P||t.isPending||n.isPending,isRunning:t.isPending||n.isPending})}),(0,S.jsx)(ne,{visible:t.data!==void 0&&n.data!==void 0}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(F,{paneId:`A`,userMessage:j,mutation:t,otherResult:n.data?.response,validation:C}),(0,S.jsx)(F,{paneId:`B`,userMessage:j,mutation:n,otherResult:t.data?.response,validation:D})]})]})})}function E(e){let t={...D(`tier1_size`,e.tier1),...D(`tier2_size`,e.tier2),...D(`batch_size`,e.batch)};return Object.keys(t).length===0?void 0:t}function D(e,t){let n=t.trim();if(n===``)return{};if(n===`null`)return{[e]:null};let r=Number(n);if(!Number.isInteger(r)||r<1)throw Error(`${e} must be a positive integer or 'null' (got "${n}")`);return{[e]:r}}function ee(){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`h1`,{className:`text-body-large-default`,style:{color:`var(--content-default)`},children:`Memory Router Playground`}),(0,S.jsxs)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:[`Dry-run the v4 router with custom tier/batch overrides. Read-only — no rows are written to `,(0,S.jsx)(`code`,{children:`memory_v2_injection_events`}),` or`,` `,(0,S.jsx)(`code`,{children:`memory_v2_activation_logs`}),`, and no activation state is mutated. Leave an override blank to inherit the live config value; enter`,` `,(0,S.jsx)(`code`,{children:`null`}),` to explicitly disable a tier.`]})]})}function O({nowText:e,onNowTextChange:t,onReloadNowText:n,nowTextLoading:r,pairs:i,onPairsChange:o}){let s=(e,t)=>{o(i.map((n,r)=>r===e?{...n,...t}:n))},c=()=>{o([{assistantMessage:``,userMessage:``},...i])},l=e=>{e!==i.length-1&&o(i.filter((t,n)=>n!==e))};return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Conversational context (shared by both panes)`}),(0,S.jsx)(k,{id:`memory-router-playground-now`,label:`<now> block`,value:e,onChange:t,rows:6,monospace:!0,placeholder:r?`Loading current NOW.md…`:`Pre-filled with the live NOW.md. Edit to test alternate states.`,trailing:(0,S.jsx)(`button`,{type:`button`,onClick:n,disabled:r,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r?`not-allowed`:`pointer`},children:`Reload live NOW.md`})}),(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`Recent (assistant, user) pairs · oldest first`}),(0,S.jsx)(`button`,{type:`button`,onClick:c,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:`pointer`},children:`+ Add older pair`})]}),i.map((e,t)=>{let n=t===i.length-1;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border p-3`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`},children:[(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsxs)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[`Pair `,t+1,` of `,i.length,n?` · most recent`:``]}),!n&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`rounded px-2 py-1 text-label-default`,style:{background:`transparent`,color:`var(--system-negative-strong)`,border:`none`,cursor:`pointer`},children:`Remove`})]}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-assistant`,label:`[assistant]: reply`,value:e.assistantMessage,onChange:e=>s(t,{assistantMessage:e}),rows:3,placeholder:t===0&&i.length===1?`Leave blank for a first-turn scenario.`:`Assistant's reply that came before the user message below.`}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-user`,label:n?`Just-arrived [user]: message`:`[user]: message`,value:e.userMessage,onChange:e=>s(t,{userMessage:e}),rows:3,placeholder:n?`e.g. what should we ship next`:`User's message.`,required:n})]},t)})]})})}function k({id:e,label:t,value:n,onChange:r,rows:i,placeholder:a,monospace:o,trailing:s,required:c}){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`label`,{htmlFor:e,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[t,c?` *`:``]}),s]}),(0,S.jsx)(`textarea`,{id:e,value:n,onChange:e=>r(e.target.value),rows:i,placeholder:a,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,resize:`vertical`,...o?{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`}:{}}})]})}function A({paneId:e,overrides:t,onChange:n,onRun:r,canRun:i,isRunning:o,profiles:s,activeProfile:c,defaultPromptTemplate:l}){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsxs)(`div`,{className:`text-body-medium-default`,style:{color:q(e)},children:[`Config `,e]}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,S.jsx)(N,{paneId:e,label:`tier1_size`,value:t.tier1,onChange:e=>n({...t,tier1:e})}),(0,S.jsx)(N,{paneId:e,label:`tier2_size`,value:t.tier2,onChange:e=>n({...t,tier2:e})}),(0,S.jsx)(N,{paneId:e,label:`batch_size`,value:t.batch,onChange:e=>n({...t,batch:e})})]}),(0,S.jsx)(M,{paneId:e,value:t.profile,onChange:e=>n({...t,profile:e}),profiles:s,activeProfile:c}),(0,S.jsx)(j,{paneId:e,value:t.customPrompt,onChange:e=>n({...t,customPrompt:e}),defaultTemplate:l}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(`button`,{type:`button`,onClick:r,disabled:!i,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:i?`var(--system-positive-strong)`:`var(--surface-overlay)`,color:i?`var(--content-on-positive)`:`var(--content-disabled)`,border:`none`,cursor:i?`pointer`:`not-allowed`},children:o?`Running…`:`Run ${e}`})})]})})}function j({paneId:e,value:t,onChange:n,defaultTemplate:r}){let[i,a]=(0,m.useState)(!1),o=`memory-router-playground-${e}-prompt`,s=t.trim().length>0;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`text-label-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[i?`▾`:`▸`,` System prompt`,` `,(0,S.jsxs)(`span`,{style:{color:`var(--content-tertiary)`},children:[`(`,s?`custom`:`bundled`,`)`]})]}),i&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:r.length===0,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r.length===0?`not-allowed`:`pointer`},children:`Load default`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(``),disabled:!s,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:s?`pointer`:`not-allowed`},children:`Reset`})]})]}),i&&(0,S.jsx)(`textarea`,{id:o,value:t,onChange:e=>n(e.target.value),rows:12,placeholder:`Custom router system prompt. Available placeholders:
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./useQuery-Bz-fbQ-m.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./card-DRIctGVs.js";import"./src-te3YTBG-.js";import{pn as o}from"./sdk.gen-BHZ0fJla.js";import{J as s,h as c,q as l}from"./react-query.gen-C5c1Acuq.js";import{s as u}from"./auth-store-5qq59BAN.js";import{t as d}from"./client-feature-flag-store-CMncoan8.js";import{t as f}from"./access-DS79PSR3.js";import{t as p}from"./use-active-assistant-id-CldxA_-M.js";var m=e(t(),1),h=class extends Error{status;constructor(e,t){super(t),this.name=`SimulateMemoryRouterError`,this.status=e}};async function g(e,t,n){let{data:r,response:i}=await o({path:{assistant_id:e},body:t,signal:n,throwOnError:!1}),a=i?await i.clone().text().catch(()=>``):``;if(!i||!i.ok)throw new h(i?.status??0,a||i?.statusText||`Failed to simulate memory router`);if(!r)throw new h(i.status,`Empty response from memory router simulator endpoint`);return{response:r,rawRequest:JSON.stringify(t,null,2),rawResponse:_(a)}}function _(e){if(e.length===0)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function v(e){return r({mutationFn:async t=>{if(!e)throw new h(0,`Missing assistantId`);return g(e,t)}})}function y(e){return n({...c({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4})}function b(e){return n({...s({path:{assistant_id:e}}),enabled:!!e,staleTime:1440*60*1e3})}function x(e){return n({...l({path:{assistant_id:e}}),enabled:!!e,staleTime:1/0})}var S=i();function C(){let e=f(),t=u(),n=d.use.memoryRouterPlayground();return t?(0,S.jsx)($,{children:`Loading…`}):!e||!n?(0,S.jsx)($,{children:`Memory router playground is not available.`}):(0,S.jsx)(T,{})}var w={tier1:``,tier2:``,batch:``,profile:``,customPrompt:``};function T(){let e=p(),t=v(e),n=v(e),r=y(e),i=b(e),a=x(e),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)([{assistantMessage:``,userMessage:``}]),[u,d]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(u)return;let e=a.data?.nowText;typeof e==`string`&&o===``&&s(e)},[a.data?.nowText,o,u]);let[f,h]=(0,m.useState)(w),[g,_]=(0,m.useState)(w),[C,T]=(0,m.useState)(null),[D,k]=(0,m.useState)(null),j=c[c.length-1].userMessage,M=e=>{let r=e===`A`?f:g,i=e===`A`?T:k,a=e===`A`?t:n;i(null);let s;try{s=E(r)}catch(e){i(e instanceof Error?e.message:`Invalid override input`);return}let l=r.profile.trim().length>0?r.profile:void 0,u=r.customPrompt.trim().length>0?r.customPrompt:void 0,d=c.map((e,t)=>t===c.length-1?{...e,userMessage:e.userMessage.trim()}:e);a.mutate({recentTurnPairs:d,nowText:o,...s?{configOverrides:s}:{},...l===void 0?{}:{profileOverride:l},...u===void 0?{}:{routerPromptOverride:u}})},N=()=>{M(`A`),M(`B`)},P=j.trim().length>0,I=P&&!t.isPending,L=P&&!n.isPending;return(0,S.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-y-auto`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-6`,children:[(0,S.jsx)(ee,{}),(0,S.jsx)(O,{nowText:o,onNowTextChange:e=>{d(!0),s(e)},onReloadNowText:()=>{let e=a.data?.nowText;typeof e==`string`&&(s(e),d(!1))},nowTextLoading:a.isLoading,pairs:c,onPairsChange:l}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(A,{paneId:`A`,overrides:f,onChange:h,onRun:()=>M(`A`),canRun:I,isRunning:t.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``}),(0,S.jsx)(A,{paneId:`B`,overrides:g,onChange:_,onRun:()=>M(`B`),canRun:L,isRunning:n.isPending,profiles:r.data?.profiles??[],activeProfile:r.data?.activeProfile??null,defaultPromptTemplate:i.data?.template??``})]}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(te,{onClick:N,disabled:!P||t.isPending||n.isPending,isRunning:t.isPending||n.isPending})}),(0,S.jsx)(ne,{visible:t.data!==void 0&&n.data!==void 0}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,S.jsx)(F,{paneId:`A`,userMessage:j,mutation:t,otherResult:n.data?.response,validation:C}),(0,S.jsx)(F,{paneId:`B`,userMessage:j,mutation:n,otherResult:t.data?.response,validation:D})]})]})})}function E(e){let t={...D(`tier1_size`,e.tier1),...D(`tier2_size`,e.tier2),...D(`batch_size`,e.batch)};return Object.keys(t).length===0?void 0:t}function D(e,t){let n=t.trim();if(n===``)return{};if(n===`null`)return{[e]:null};let r=Number(n);if(!Number.isInteger(r)||r<1)throw Error(`${e} must be a positive integer or 'null' (got "${n}")`);return{[e]:r}}function ee(){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`h1`,{className:`text-body-large-default`,style:{color:`var(--content-default)`},children:`Memory Router Playground`}),(0,S.jsxs)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:[`Dry-run the v4 router with custom tier/batch overrides. Read-only — no rows are written to `,(0,S.jsx)(`code`,{children:`memory_v2_injection_events`}),` or`,` `,(0,S.jsx)(`code`,{children:`memory_v2_activation_logs`}),`, and no activation state is mutated. Leave an override blank to inherit the live config value; enter`,` `,(0,S.jsx)(`code`,{children:`null`}),` to explicitly disable a tier.`]})]})}function O({nowText:e,onNowTextChange:t,onReloadNowText:n,nowTextLoading:r,pairs:i,onPairsChange:o}){let s=(e,t)=>{o(i.map((n,r)=>r===e?{...n,...t}:n))},c=()=>{o([{assistantMessage:``,userMessage:``},...i])},l=e=>{e!==i.length-1&&o(i.filter((t,n)=>n!==e))};return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Conversational context (shared by both panes)`}),(0,S.jsx)(k,{id:`memory-router-playground-now`,label:`<now> block`,value:e,onChange:t,rows:6,monospace:!0,placeholder:r?`Loading current NOW.md…`:`Pre-filled with the live NOW.md. Edit to test alternate states.`,trailing:(0,S.jsx)(`button`,{type:`button`,onClick:n,disabled:r,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r?`not-allowed`:`pointer`},children:`Reload live NOW.md`})}),(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`Recent (assistant, user) pairs · oldest first`}),(0,S.jsx)(`button`,{type:`button`,onClick:c,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:`pointer`},children:`+ Add older pair`})]}),i.map((e,t)=>{let n=t===i.length-1;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border p-3`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`},children:[(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsxs)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[`Pair `,t+1,` of `,i.length,n?` · most recent`:``]}),!n&&(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`rounded px-2 py-1 text-label-default`,style:{background:`transparent`,color:`var(--system-negative-strong)`,border:`none`,cursor:`pointer`},children:`Remove`})]}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-assistant`,label:`[assistant]: reply`,value:e.assistantMessage,onChange:e=>s(t,{assistantMessage:e}),rows:3,placeholder:t===0&&i.length===1?`Leave blank for a first-turn scenario.`:`Assistant's reply that came before the user message below.`}),(0,S.jsx)(k,{id:`memory-router-playground-pair-${t}-user`,label:n?`Just-arrived [user]: message`:`[user]: message`,value:e.userMessage,onChange:e=>s(t,{userMessage:e}),rows:3,placeholder:n?`e.g. what should we ship next`:`User's message.`,required:n})]},t)})]})})}function k({id:e,label:t,value:n,onChange:r,rows:i,placeholder:a,monospace:o,trailing:s,required:c}){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`label`,{htmlFor:e,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[t,c?` *`:``]}),s]}),(0,S.jsx)(`textarea`,{id:e,value:n,onChange:e=>r(e.target.value),rows:i,placeholder:a,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,resize:`vertical`,...o?{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`}:{}}})]})}function A({paneId:e,overrides:t,onChange:n,onRun:r,canRun:i,isRunning:o,profiles:s,activeProfile:c,defaultPromptTemplate:l}){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,S.jsxs)(`div`,{className:`text-body-medium-default`,style:{color:q(e)},children:[`Config `,e]}),(0,S.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,S.jsx)(N,{paneId:e,label:`tier1_size`,value:t.tier1,onChange:e=>n({...t,tier1:e})}),(0,S.jsx)(N,{paneId:e,label:`tier2_size`,value:t.tier2,onChange:e=>n({...t,tier2:e})}),(0,S.jsx)(N,{paneId:e,label:`batch_size`,value:t.batch,onChange:e=>n({...t,batch:e})})]}),(0,S.jsx)(M,{paneId:e,value:t.profile,onChange:e=>n({...t,profile:e}),profiles:s,activeProfile:c}),(0,S.jsx)(j,{paneId:e,value:t.customPrompt,onChange:e=>n({...t,customPrompt:e}),defaultTemplate:l}),(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsx)(`button`,{type:`button`,onClick:r,disabled:!i,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:i?`var(--system-positive-strong)`:`var(--surface-overlay)`,color:i?`var(--content-on-positive)`:`var(--content-disabled)`,border:`none`,cursor:i?`pointer`:`not-allowed`},children:o?`Running…`:`Run ${e}`})})]})})}function j({paneId:e,value:t,onChange:n,defaultTemplate:r}){let[i,a]=(0,m.useState)(!1),o=`memory-router-playground-${e}-prompt`,s=t.trim().length>0;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`text-label-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[i?`▾`:`▸`,` System prompt`,` `,(0,S.jsxs)(`span`,{style:{color:`var(--content-tertiary)`},children:[`(`,s?`custom`:`bundled`,`)`]})]}),i&&(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:r.length===0,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r.length===0?`not-allowed`:`pointer`},children:`Load default`}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>n(``),disabled:!s,className:`rounded px-2 py-1 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:s?`pointer`:`not-allowed`},children:`Reset`})]})]}),i&&(0,S.jsx)(`textarea`,{id:o,value:t,onChange:e=>n(e.target.value),rows:12,placeholder:`Custom router system prompt. Available placeholders:
|
|
2
2
|
{{ASSISTANT_NAME}}, {{USER_NAME}}, {{PAGE_INDEX}}
|
|
3
3
|
Leave blank to use the bundled template. "Load default" seeds the textarea with the bundled body for editing.`,className:`rounded-md border px-3 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,resize:`vertical`,minHeight:`120px`}})]})}function M({paneId:e,value:t,onChange:n,profiles:r,activeProfile:i}){let a=`memory-router-playground-${e}-profile`,o=i!==null&&i.length>0?`inherit active (${i})`:`inherit active`;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`label`,{htmlFor:a,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`llm.profiles override`}),(0,S.jsxs)(`select`,{id:a,value:t,onChange:e=>n(e.target.value),className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`},children:[(0,S.jsx)(`option`,{value:``,children:o}),r.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))]})]})}function N({paneId:e,label:t,value:n,onChange:r}){let i=`memory-router-playground-${e}-${t}`;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`label`,{htmlFor:i,className:`text-label-default`,style:{color:`var(--content-secondary)`},children:t}),(0,S.jsx)(`input`,{id:i,value:n,onChange:e=>r(e.target.value),placeholder:`inherit`,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`}})]})}function te({onClick:e,disabled:t,isRunning:n}){return(0,S.jsx)(`button`,{type:`button`,onClick:e,disabled:t,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:t?`var(--surface-overlay)`:`var(--primary-base)`,color:t?`var(--content-disabled)`:`var(--content-on-primary)`,border:`none`,cursor:t?`not-allowed`:`pointer`},children:n?`Running…`:`Run both`})}function ne({visible:e}){return e?(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 rounded-md px-4 py-2 text-label-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`},children:[(0,S.jsx)(P,{marker:`●`,markerColor:`var(--content-default)`,label:`in both`}),(0,S.jsx)(P,{marker:`◆`,markerColor:q(`A`),label:`A only`}),(0,S.jsx)(P,{marker:`◇`,markerColor:q(`B`),label:`B only`})]}):null}function P({marker:e,markerColor:t,label:n}){return(0,S.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`span`,{style:{color:t},children:e}),(0,S.jsx)(`span`,{children:n})]})}function F({paneId:e,userMessage:t,mutation:n,otherResult:r,validation:i}){let a=n.data;return(0,S.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,S.jsx)(R,{paneId:e}),i!==null&&(0,S.jsx)(Q,{message:i}),n.isError&&(0,S.jsx)(Q,{message:n.error instanceof Error?n.error.message:`Failed to run simulation`}),a!==void 0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(z,{paneId:e,userMessage:t,result:a.response,otherResult:r}),(0,S.jsx)(I,{paneId:e,rawRequest:a.rawRequest,rawResponse:a.rawResponse})]})]})}function I({paneId:e,rawRequest:t,rawResponse:n}){let[r,i]=(0,m.useState)(!1);return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`text-label-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[r?`▾`:`▸`,` Raw API exchange`]}),r&&(0,S.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,S.jsx)(L,{label:`Request (Pane ${e})`,body:t}),(0,S.jsx)(L,{label:`Response (Pane ${e})`,body:n})]})]})})}function L({label:e,body:t}){return(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:e}),(0,S.jsx)(`pre`,{className:`overflow-auto rounded-md border px-3 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,maxHeight:`320px`,whiteSpace:`pre`},children:t.length===0?`(empty)`:t})]})}function R({paneId:e}){return(0,S.jsxs)(`div`,{className:`text-body-medium-default`,style:{color:q(e)},children:[`Pane `,e]})}function z({paneId:e,userMessage:t,result:n,otherResult:r}){let i=(0,m.useMemo)(()=>B(n,r),[n,r]),a=(0,m.useMemo)(()=>W(n),[n]);return(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,S.jsx)(H,{result:n,userMessage:t,otherResult:r,counts:(0,m.useMemo)(()=>V(i),[i])}),(0,S.jsx)(U,{result:n}),n.failureReason!==null&&(0,S.jsx)(Q,{message:`Router failure: ${n.failureReason}`}),a.length===0?(0,S.jsx)(X,{}):a.map(t=>(0,S.jsx)(Y,{paneId:e,source:t.source,slugs:t.slugs,scores:n.scores,diff:i},t.source))]})}function B(e,t){let n=new Map;if(t===void 0){for(let t of e.selectedSlugs)n.set(t,`both`);return n}let r=new Set(t.selectedSlugs);for(let t of e.selectedSlugs)n.set(t,r.has(t)?`both`:`only-here`);return n}function V(e){let t=0,n=0;for(let r of e.values())r===`both`?t++:n++;return{total:e.size,shared:t,unique:n}}function H({result:e,userMessage:t,otherResult:n,counts:r}){let i=[{label:`User message`,value:t},{label:`Total candidate pages`,value:e.totalCandidatePages.toLocaleString()},{label:`Selected`,value:`${e.selectedSlugs.length} (live max_page_ids: ${e.effectiveConfig.max_page_ids})`}];return n!==void 0&&i.push({label:`Diff`,value:`${r.shared} shared · ${r.unique} unique to this pane`}),(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Summary`}),(0,S.jsx)(Z,{rows:i})]})})}function U({result:e}){let t=[`tier1_size`,`tier2_size`,`batch_size`,`max_page_ids`].map(t=>{let n=e.effectiveConfig[t],r=e.overrides[t];return{label:t,value:`${n===null?`null`:String(n)}${r===void 0?``:` (override)`}`}});return t.push({label:`llm.profiles override`,value:e.profileOverride===null?`inherit active`:`${e.profileOverride} (override)`}),t.push({label:`system prompt`,value:e.routerPromptOverridden?`custom`:`bundled`}),(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`Effective config`}),(0,S.jsx)(Z,{rows:t})]})})}function W(e){let t=new Map;for(let n of e.selectedSlugs){let r=e.sourceBySlug[n];if(r===void 0)continue;let i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.keys()].sort((e,t)=>G(e)-G(t)).map(e=>({source:e,slugs:t.get(e)}))}function G(e){return e===`tier1`?0:e===`tier2`?1:e.startsWith(`tier3:`)?2+Number(e.slice(6)):2**53-1}function K(e){return e===`tier1`?`tier 1`:e===`tier2`?`tier 2`:e.startsWith(`tier3:`)?`tier 3 · b${e.slice(6)}`:e}function q(e){return e===`A`?`var(--system-mid-strong)`:`var(--primary-base)`}function J(e,t){return t===`both`?{color:`var(--content-default)`,marker:`●`}:{color:q(e),marker:e===`A`?`◆`:`◇`}}function Y({paneId:e,source:t,slugs:n,scores:r,diff:i}){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:K(t)}),(0,S.jsxs)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:[n.length,` `,n.length===1?`page`:`pages`]})]}),(0,S.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(n=>{let{color:a,marker:o}=J(e,i.get(n)??`only-here`);return(0,S.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3`,children:[(0,S.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,S.jsx)(`span`,{style:{color:a},children:o}),(0,S.jsx)(`code`,{className:`text-body-medium-default`,style:{color:a},children:n})]}),t===`tier2`&&(0,S.jsxs)(`span`,{className:`tabular-nums text-label-default`,style:{color:`var(--content-secondary)`},children:[`EMA `,(r[n]??0).toFixed(3)]})]},n)})})]})})}function X(){return(0,S.jsx)(a,{children:(0,S.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:`No pages selected`}),(0,S.jsx)(`span`,{className:`text-label-default`,style:{color:`var(--content-secondary)`},children:`The router returned an empty selection. Try a more specific query, or relax the override values.`})]})})}function Z({rows:e}){return(0,S.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(({label:e,value:t})=>(0,S.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`shrink-0 text-label-default`,style:{color:`var(--content-secondary)`},children:e}),(0,S.jsx)(`span`,{className:`text-right text-body-medium-lighter`,style:{color:`var(--content-default)`},children:t})]},e))})}function Q({message:e}){return(0,S.jsx)(`div`,{className:`rounded-md px-4 py-3 text-body-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--system-negative-strong)`},children:e})}function $({children:e}){return(0,S.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-8 text-label-default`,style:{color:`var(--content-tertiary)`},children:e})}export{C as MemoryRouterPlaygroundPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./capture-error-Bj8_eutd.js";import{Cn as t,
|
|
1
|
+
import{t as e}from"./capture-error-Bj8_eutd.js";import{Cn as t,Rr as n,Sn as r,Ur as i,bn as a,u as o,xn as s}from"./sdk.gen-BHZ0fJla.js";import{t as c}from"./assistant-identity-store-DIyVo8LV.js";import{r as l,t as u}from"./semver-BpijV4FQ.js";import{n as d}from"./api-errors-CFiCT7Ap.js";import{n as f}from"./platform-detection-XEAAu4c-.js";import{a as p,r as m}from"./prechat-CeL4a_1i.js";import{t as h}from"./effective-timezone-CmcoXrio.js";var g=/^\[File attachment\] (.+?), type=([^,\n]+?)(?:, size=([^\n]+))?$/,_=/^([\d.]+)\s*(B|KB|MB|GB)$/;function v(e){let t=_.exec(e.trim());if(!t)return 0;let n=Number.parseFloat(t[1]);if(!Number.isFinite(n))return 0;switch(t[2]){case`B`:return Math.round(n);case`KB`:return Math.round(n*1024);case`MB`:return Math.round(n*1024*1024);case`GB`:return Math.round(n*1024*1024*1024);default:return 0}}function y(e){let t=e.indexOf(`[File attachment] `);if(t<0||!(t===0||e[t-1]===`
|
|
2
2
|
`))return{cleanedContent:e,attachments:void 0};let n=t>0&&e[t-1]===`
|
|
3
3
|
`?e.slice(0,t-1):e.slice(0,t),r=[];for(let n of e.slice(t).split(`
|
|
4
4
|
`)){let e=g.exec(n);if(!e)continue;let[,t,i,a]=e;r.push({id:`rehydrated:${r.length}`,filename:t,mimeType:i,sizeBytes:a?v(a):0,previewUrl:null,thumbnailUrl:null})}return{cleanedContent:n,attachments:r.length>0?r:void 0}}var b=[`users/guardian.md`,`users/default.md`],x=`## Onboarding Context`;function S(e){let t=[x,``];return e.preferredName&&t.push(`- **Preferred name:** ${e.preferredName}`),e.occupation&&t.push(`- **Role:** ${e.occupation}`),e.commonWork.length>0&&t.push(`- **Common work:** ${e.commonWork.join(`; `)}`),e.dailyTools.length>0&&t.push(`- **Daily tools:** ${e.dailyTools.join(`, `)}`),t.push(``),t.join(`
|
|
@@ -10,4 +10,4 @@ import{t as e}from"./capture-error-Bj8_eutd.js";import{Cn as t,Hr as n,Lr as r,S
|
|
|
10
10
|
`),n.endsWith(`
|
|
11
11
|
|
|
12
12
|
`)||(n+=`
|
|
13
|
-
`),n+t}async function w(e,t){let{data:
|
|
13
|
+
`),n+t}async function w(e,t){let{data:r,error:i,response:a}=await n({path:{assistant_id:e},query:{path:t},throwOnError:!1});if(d(a,i,`Failed to fetch onboarding profile file`),a.status===404)return null;if(!a.ok)throw Error(`Failed to fetch onboarding profile file (${a.status})`);if(r?.isBinary)throw Error(`Onboarding profile file is binary`);return typeof r?.content==`string`?r.content:null}async function T(e,t,n){let{error:r,response:a}=await i({path:{assistant_id:e},body:{path:t,content:n},throwOnError:!1});if(d(a,r,`Failed to write onboarding profile file`),!a.ok)throw Error(`Failed to write onboarding profile file (${a.status})`)}async function E(e,t,n){await T(e,t,C(await w(e,t),n))}async function D(e,t){let n=S(p(t));await Promise.allSettled(b.map(t=>E(e,t,n)))}function O(e,t,n,r){let i=e.toLowerCase().startsWith(`video/`);return{previewUrl:t&&(!i||i&&!r)?`data:${e};base64,${t}`:null,thumbnailUrl:n?`data:image/jpeg;base64,${n}`:null}}function k(e){return e.map(e=>{let{previewUrl:t,thumbnailUrl:n}=O(e.mimeType,e.data,e.thumbnailData,!0);return{id:e.id,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,previewUrl:t,thumbnailUrl:n}})}function A(e){return e===`inline`||e===`panel`?e:void 0}function j(e){return{surfaceId:e.surfaceId,surfaceType:e.surfaceType,title:e.title,data:e.data,actions:e.actions,display:A(e.display),completed:e.completed,completionSummary:e.completionSummary,toolCallId:e.toolCallId}}function M(e){return e.map(j)}function N(e){if(typeof e==`number`)return e;if(typeof e==`string`){let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}}function P(e){if(!e||e.length===0)return{segments:void 0,attachments:void 0};let t=[];return{segments:e.map(e=>{let{cleanedContent:n,attachments:r}=y(e);return r&&t.push(...r),n}),attachments:t.length>0?t.map((e,t)=>({...e,id:`rehydrated:${t}`})):void 0}}function F(e){let{segments:t,attachments:n}=P(e.textSegments&&e.textSegments.length>0?e.textSegments:void 0),r=e.attachments&&e.attachments.length>0?k(e.attachments):void 0,i=V(e.contentOrder),a=H(e),o=e.toolCalls&&e.toolCalls.length>0?z(e.toolCalls,e.id):void 0,s=N(e.timestamp),c=e.thinkingSegments&&e.thinkingSegments.length>0?e.thinkingSegments:void 0,l={id:e.id,role:e.role};e.mergedMessageIds?.length&&(l.mergedMessageIds=e.mergedMessageIds),e.clientMessageId&&(l.clientMessageId=e.clientMessageId),e.surfaces&&(l.surfaces=M(e.surfaces)),a&&(l.contentBlocks=a),t&&(l.textSegments=t),i&&(l.contentOrder=i),c&&(l.thinkingSegments=c),e.subagentNotification&&(l.isSubagentNotification=!0),e.acpNotification&&(l.isAcpNotification=!0),e.backgroundEventNotification&&(l.isBackgroundEventNotification=!0),e.systemCard&&(l.isSystemCard=!0),e.slackMessage&&(l.slackMessage=e.slackMessage),o&&(l.toolCalls=o),s!=null&&(l.timestamp=s),e.queueStatus&&(l.queueStatus=e.queueStatus),e.queuePosition!=null&&(l.queuePosition=e.queuePosition);let u=r??n;return u&&(l.attachments=u),l}var I=`0.8.6`;function L(){let e=c.getState().version;if(!e)return`conversationKey`;let t=l(e),n=l(I);return!t||!n?`conversationKey`:u({...t,pre:null},n)>=0?`conversationId`:`conversationKey`}function R(e){return{id:e.id,toolName:e.toolName,conversationId:e.conversationId,command:e.command,startedAt:e.startedAt,status:e.status,exitCode:e.exitCode,output:e.output,completedAt:e.completedAt}}function z(e,t){return e.map((e,n)=>{let{confirmationDecision:r,...i}=e;return{...i,id:e.id??`tool-history-${t}-${n}`,...r===void 0?{}:{confirmationDecision:r}}})}function B(e){if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;if(typeof t.type==`string`&&typeof t.id==`string`)return{type:t.type,id:t.id}}if(typeof e==`string`){let t=e.indexOf(`:`);if(t>0)return{type:e.slice(0,t),id:e.slice(t+1)}}return null}function V(e){if(!e||e.length===0)return;let t=[];for(let n of e){let e=B(n);e&&t.push(e)}return t.length>0?t:void 0}function H(e){if(e.contentBlocks!==void 0)return e.contentBlocks;let t=V(e.contentOrder);if(!t)return;let n=[];for(let{type:r,id:i}of t){let t=Number.parseInt(i,10);if(!Number.isNaN(t))switch(r){case`text`:{let r=e.textSegments?.[t];if(r==null)break;let{cleanedContent:i}=y(r);i.trim().length>0&&n.push({type:`text`,text:i});break}case`thinking`:{let r=e.thinkingSegments?.[t];r!=null&&n.push({type:`thinking`,thinking:r});break}case`tool`:case`toolCall`:{let r=e.toolCalls?.[t];r&&n.push({type:`tool_use`,toolCall:{...r,id:r.id??`tool-history-${e.id}-${t}`}});break}case`surface`:{let r=e.surfaces?.[t];r&&n.push({type:`surface`,surface:r});break}case`attachment`:{let r=e.attachments[t];r&&n.push({type:`attachment`,attachment:r});break}}}return n.length>0?n:void 0}async function U(e,t,n){let r=n?.latestPageLimit==null?{conversationId:t}:{conversationId:t,page:`latest`,limit:n.latestPageLimit},{data:i,error:o,response:s}=await a({path:{assistant_id:e},query:r,throwOnError:!1});if(d(s,o,`Failed to fetch conversation messages`),!s.ok)throw Error(`Failed to fetch conversation messages (HTTP ${s.status})`);return i}async function W(e,t){let n=t.name||`attachment`,r=t.type||`application/octet-stream`,{data:i,error:a,response:s}=await o({path:{assistant_id:e},body:{file:t,filename:n,mimeType:r},throwOnError:!1});if(d(s,a,`Failed to upload attachment`),!s.ok){let e=a&&typeof a==`object`&&!Array.isArray(a)?a:{},t=(typeof e.detail==`string`?e.detail:void 0)??(typeof e.error==`string`?e.error:void 0)??`HTTP ${s.status}`;return{ok:!1,status:s.status,error:{detail:t}}}let c=i?.id;return c?{ok:!0,id:c,...typeof i.filename==`string`?{filename:i.filename}:{},...typeof i.mimeType==`string`?{mimeType:i.mimeType}:{},...typeof i.sizeBytes==`number`?{sizeBytes:i.sizeBytes}:{}}:{ok:!1,status:422,error:{detail:`Upload response did not include an attachment id.`}}}async function G(t,n,r,i={}){let{attachmentIds:a=[],onboarding:o,clientMessageId:c,inferenceProfile:l,enabledPlugins:u,hidden:p,bypassSecretCheck:g}=i,_={content:r,sourceChannel:`vellum`,interface:`web`,clientOs:f()},v=h();v&&(_.clientTimezone=v);let y=L();(n!==null||y!==`conversationId`)&&(_[y]=n),a.length>0&&(_.attachmentIds=a),c&&(_.clientMessageId=c),l&&(_.inferenceProfile=l),u!=null&&(_.enabledPlugins=u),p&&(_.hidden=!0),g&&(_.bypassSecretCheck=!0);let b=o?m(o):void 0;if(b){let e={tools:b.tools,tasks:b.tasks,tone:b.tone};b.userName!==void 0&&(e.userName=b.userName),b.occupation!==void 0&&(e.occupation=b.occupation),b.assistantName!==void 0&&(e.assistantName=b.assistantName),b.googleConnected!==void 0&&(e.googleConnected=b.googleConnected),b.googleScopes!==void 0&&(e.googleScopes=b.googleScopes),b.priorAssistants!==void 0&&(e.priorAssistants=b.priorAssistants),b.cohort!==void 0&&(e.cohort=b.cohort),b.bootstrapTemplate!==void 0&&(e.bootstrapTemplate=b.bootstrapTemplate),b.initialMessage!==void 0&&b.initialMessage.trim().toLowerCase().replace(/[.!?]+$/,``)!==`wake up, my friend`&&(e.initialMessage=b.initialMessage),b.skills!==void 0&&(e.skills=b.skills),b.researchFindings!==void 0&&(e.researchFindings=b.researchFindings),b.title!==void 0&&(e.title=b.title),_.onboarding=e}b&&D(t,b).catch(t=>e(t,{context:`persistPreChatOnboardingProfile`}));let{data:x,error:S,response:C}=await s({path:{assistant_id:t},body:_,throwOnError:!1});if(d(C,S,`Failed to send chat message`),!C.ok){let e=S&&typeof S==`object`&&!Array.isArray(S)?S:{},t=e.error&&typeof e.error==`object`&&!Array.isArray(e.error)?e.error:{};return{ok:!1,status:C.status,error:{code:typeof e.code==`string`?e.code:typeof t.code==`string`?t.code:typeof e.error==`string`?e.error:void 0,detail:(typeof e.detail==`string`?e.detail:void 0)??(typeof e.message==`string`?e.message:void 0)??(typeof t.message==`string`?t.message:void 0)??`HTTP ${C.status}`}}}let w=x;if(!w?.accepted)return{ok:!1,status:422,error:{detail:`Message was not accepted by the assistant.`}};let T=typeof w.conversationId==`string`?w.conversationId:void 0;return T===void 0?{ok:!1,status:422,error:{detail:`Assistant accepted the message but did not return a conversation id.`}}:w.queued?{ok:!0,queued:!0,assistantId:t,conversationId:T,requestId:typeof w.requestId==`string`?w.requestId:void 0}:typeof w.messageId==`string`?{ok:!0,assistantId:t,conversationId:T,messageId:w.messageId}:{ok:!1,status:422,error:{detail:`Message was not accepted by the assistant.`}}}function K(e){return{"X-Vellum-Conversation-Id":e}}async function q(e,n,r){try{let{response:i}=await t({path:{assistant_id:e,id:r},query:{conversationId:n},headers:K(n),throwOnError:!1});return i?.ok?`steered`:i?.status===404?`not_steerable`:`request_failed`}catch{return`request_failed`}}async function J(e,t,n){try{let{response:i}=await r({path:{assistant_id:e,id:n},query:{conversationId:t},headers:K(t),throwOnError:!1});return i?.ok??!1}catch{return!1}}export{q as a,F as c,G as i,j as l,U as n,R as o,H as r,W as s,J as t,O as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,_ as t}from"./native-biometric-BAMIyaSS.js";import{u as n}from"./routes-D9sNqB_o.js";function r({isLocalHatch:e}){return e?n.onboarding.hatching:n.onboarding.research}function i(e){return e.tosAccepted&&e.privacyConsent}function a(e){return i(e)&&e.analyticsConsentCurrent&&e.diagnosticsConsentCurrent}var o=`${n.assistant}/onboarding`,s=new Set([n.onboarding.hosting,n.onboarding.apiKey]),c=new Set([n.welcome,n.selectAssistant]);function l(e){return e.startsWith(`${o}/`)||e===o}function u(e){return e?n.welcome:n.onboarding.privacy}var d=new Set([`${n.settings.root}/billing`,n.settings.usage]);function f(e,t){if(!d.has(e))return!1;let n=t.indexOf(`?`);return n<0?!1:new URLSearchParams(t.slice(n+1)).has(`session_id`)}var p=`post_checkout`;function m(){return`${r({isLocalHatch:!1})}?hosting=vellum-cloud&${p}=1`}var h=new Set([n.onboarding.hatching,n.onboarding.research]);function g(t){let n=e(t,``);if(!n.startsWith(`/`))return null;let r=n.indexOf(`?`);return r<0||!h.has(n.slice(0,r))||new URLSearchParams(n.slice(r+1)).get(`post_checkout`)!==`1`?null:n}function _(e){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))try{return new URL(e,`http://placeholder.invalid`).pathname}catch{return e}return e}function v(e,t){return t===n.welcome?e.hasAssistants?n.selectAssistant:n.onboarding.hosting:t===n.selectAssistant?`${t}?fromLogin=1`:t}function y(e,t){switch(t.kind){case`route-guard`:return x(e,t.pathname);case`onboarding-intercept`:return P(e,t.intendedDestination);case`hatch-gate`:return F(e);case`post-auth`:return R(t.authIntent,t.returnTo,t.fallback);case`post-retire`:return z(e)}}var b=[S,C,w,E,D,O,A,M,N];function x(e,t){let n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;for(let n of b){let i=n(e,r,t);if(i)return i}return{action:`allow`}}function S(e){return e.sessionSettled?null:{action:`wait`}}function C(e,t,n){if(e.hasPlatformHostedAssistant||!f(t,n)||!e.isAuthenticated)return null;if(!e.isLocalMode&&!e.assistantsHydrated)return{action:`wait`};if(e.isLocalMode){if(e.platformSession===`unknown`)return{action:`wait`,waitFor:`platform-session`};if(e.platformSession!==`present`)return null}return{action:`redirect`,to:m()}}function w(e,t,n){return!e.isGatewayAuth||g(n)?null:{action:`allow`}}function T(e,t){let r=e.remoteGatewayPublicPathPrefix;return!e.isRemoteGateway||!r?t:t===r?n.assistant:t.startsWith(`${r}/`)?t.slice(r.length):t}function E(e,t,r){if(!e.isRemoteGateway||e.isAuthenticated)return null;let i=T(e,r);return{action:`redirect`,to:`${n.remotePair}?returnTo=${encodeURIComponent(i)}`}}function D(e,t,r){return e.isAuthenticated?null:e.isLocalMode&&(l(t)||c.has(t))?t===n.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:n.onboarding.hosting}:{action:`allow`}:e.isLocalMode&&!e.hasAssistants?{action:`redirect`,to:n.welcome}:e.isLocalMode?{action:`redirect`,to:n.selectAssistant}:{action:`redirect`,to:`${n.account.login}?returnTo=${encodeURIComponent(r)}`}}function O(e,t){return c.has(t)?e.isLocalMode?t===n.selectAssistant&&!e.hasAssistants?{action:`redirect`,to:n.onboarding.hosting}:{action:`allow`}:{action:`redirect`,to:n.assistant}:s.has(t)&&!e.isLocalMode?{action:`redirect`,to:n.assistant}:null}function k(e,t){let r=u(e.isLocalMode);if(r!==n.onboarding.privacy)return r;let i=g(t);return i?`${r}?returnTo=${encodeURIComponent(i)}`:r}function A(e,t,r){return t===n.reviewTerms?{action:`allow`}:l(t)?j(e,t,r):null}function j(e,t,r){if(!h.has(t))return{action:`allow`};if(t===n.onboarding.research){if(!e.isLocalMode&&!e.consentHydrated)return{action:`wait`};if(e.consentHydrationTimedOut)return{action:`allow`}}if(!i(e))return{action:`redirect`,to:k(e,r)};if(t===n.onboarding.research&&g(r)&&!e.isPlatformDisabled&&e.platformSession===`present`&&!a(e)){let e=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${e}`}}return{action:`allow`}}function M(e,t,r){if(e.hasAssistants||t===n.checkout)return null;if(e.isLocalMode)return e.platformSession===`unknown`?{action:`wait`,waitFor:`platform-session`}:e.platformSession===`present`?{action:`redirect`,to:n.onboarding.hosting}:{action:`redirect`,to:n.welcome};if(!e.assistantsHydrated||!e.consentHydrated)return{action:`wait`};if(!i(e))return{action:`redirect`,to:n.onboarding.privacy};if(!a(e)){let e=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${e}`}}return{action:`redirect`,to:n.onboarding.hatching}}function N(e,t,r){if(e.isPlatformDisabled||e.platformSession!==`present`||a(e))return null;if(!e.consentHydrated&&!e.isLocalMode)return{action:`wait`};let i=encodeURIComponent(r);return{action:`redirect`,to:`${n.reviewTerms}?returnTo=${i}`}}function P(e,t){if(e.isLocalMode&&e.hasAssistants||i(e))return{action:`allow`};let r=_(t);return!r.startsWith(n.assistant)||r.startsWith(`${n.assistant}/onboarding`)||r===n.reviewTerms?{action:`allow`}:{action:`redirect`,to:u(e.isLocalMode)}}function F(e){return e.sessionSettled?!e.isAuthenticated&&!e.isLocalMode?{action:`redirect`,to:n.account.login}:i(e)?!e.isLocalMode&&!a(e)?{action:`redirect`,to:n.reviewTerms}:{action:`allow`}:{action:`redirect`,to:u(e.isLocalMode)}:{action:`wait`}}var I=`/import`;function L(e){return e===I||e.startsWith(`${I}?`)||e.startsWith(`${I}/`)}function R(n,r,i){let a=e(r,i),o=t({intent:n,returnTo:a});return n===`signup`&&L(a)?{action:`redirect`,to:a}:{action:`redirect`,to:o}}function z(e){return e.hasAssistants?{action:`redirect`,to:e.isLocalMode?n.selectAssistant:n.assistant}:e.isLocalMode?e.platformSession===`present`?{action:`redirect`,to:n.onboarding.hosting}:{action:`redirect`,to:n.welcome}:{action:`redirect`,to:n.onboarding.privacy}}export{r as a,y as i,g as n,v as r,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./createLucideIcon-CAM1RhH8.js";import{t as c}from"./bell-Ct4a9v6Y.js";import{t as l}from"./check-sC49_hjU.js";import{t as u}from"./menu-BvjhxZo7.js";import{t as d}from"./loader-circle-XREx3i4W.js";import{t as f}from"./moon-BJzODLTY.js";import{t as p}from"./triangle-alert-CQfiAg_t.js";import{t as m}from"./notice-BMK7xqUw.js";import{t as h}from"./popover-BRpYVASI.js";import{t as g}from"./input-hw3el2GJ.js";import{n as _,t as v}from"./panel-item-CrtoJCrd.js";import{n as y}from"./toast-LgLp4obE.js";import{u as b}from"./routes-D9sNqB_o.js";import{i as x,r as S,t as C}from"./use-platform-gate-bFyCaLbM.js";import{n as w}from"./use-is-mobile-BlQuzI5Z.js";import{Ct as T,St as E,_t as D,bt as O,vt as k,xt as A,yt as j}from"./react-query.gen-BC3STDmV.js";import{t as M}from"./platform-login-notice-BaCrIk0m.js";import{r as N}from"./format-date-BGnM4mqL.js";import{t as P}from"./mutation-error-DEknRDAQ.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:j()}),e.invalidateQueries({queryKey:T()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(E()),s=w(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:P(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(O()),l=a(A()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:P(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,N(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,N(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=x({platformHostedOnly:!0}),t=C(),o=S(),s=r(),l=w(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,T]=(0,L.useState)([]),{data:E,isLoading:O,isError:A,refetch:j}=i({...k({query:{status:u}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?O:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?A:!1,z=t?E?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(D()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(M,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void j(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./createLucideIcon-CAM1RhH8.js";import{t as c}from"./bell-Ct4a9v6Y.js";import{t as l}from"./check-sC49_hjU.js";import{t as u}from"./menu-BvjhxZo7.js";import{t as d}from"./loader-circle-XREx3i4W.js";import{t as f}from"./moon-BJzODLTY.js";import{t as p}from"./triangle-alert-CQfiAg_t.js";import{t as m}from"./notice-BMK7xqUw.js";import{t as h}from"./popover-BRpYVASI.js";import{t as g}from"./input-hw3el2GJ.js";import{n as _,t as v}from"./panel-item-CrtoJCrd.js";import{n as y}from"./toast-LgLp4obE.js";import{u as b}from"./routes-D9sNqB_o.js";import{i as x,r as S,t as C}from"./use-platform-gate-C65D14xY.js";import{n as w}from"./use-is-mobile-BlQuzI5Z.js";import{Ct as T,St as E,_t as D,bt as O,vt as k,xt as A,yt as j}from"./react-query.gen-BC3STDmV.js";import{t as M}from"./platform-login-notice-CdYiKsE8.js";import{r as N}from"./format-date-BGnM4mqL.js";import{t as P}from"./mutation-error-DEknRDAQ.js";var F=s(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=s(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),L=e(t(),1);function R(e){e.invalidateQueries({queryKey:j()}),e.invalidateQueries({queryKey:T()})}function z(e){return e.snoozed_until?new Date(e.snoozed_until)>new Date:!1}var B=[{label:`1 hour`,hours:1},{label:`4 hours`,hours:4},{label:`24 hours`,hours:24},{label:`1 week`,hours:168}],V=o();function H({notificationId:e,currentlySnoozed:t,children:n}){let i=r(),o=a(E()),s=w(),[c,l]=(0,L.useState)(!1),d=()=>R(i),f=t=>{let n=new Date(new Date().getTime()+t*60*60*1e3).toISOString();o.mutate({path:{id:e},body:{snoozed_until:n}},{onSuccess:d,onError:P(`Failed to snooze notification`)})},p=()=>{o.mutate({path:{id:e},body:{snoozed_until:null}},{onSuccess:d,onError:P(`Failed to clear snooze`)})};return s?(0,V.jsxs)(_.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:n}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Snooze until…`})}),(0,V.jsxs)(_.Body,{children:[B.map(({label:e,hours:t})=>(0,V.jsx)(v,{label:e,onSelect:()=>{o.isPending||(l(!1),f(t))}},e)),t&&(0,V.jsx)(v,{label:`Clear snooze`,onSelect:()=>{o.isPending||(l(!1),p())}})]})]})]}):(0,V.jsxs)(u.Root,{open:c,onOpenChange:l,children:[(0,V.jsx)(u.Trigger,{children:n}),(0,V.jsxs)(u.Content,{align:`start`,className:`min-w-[12rem]`,children:[(0,V.jsx)(u.Label,{children:`Snooze until…`}),B.map(({label:e,hours:t})=>(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>f(t),children:e},e)),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(u.Separator,{}),(0,V.jsx)(u.Item,{disabled:o.isPending,onSelect:()=>p(),children:`Clear snooze`})]})]})]})}function U({existingRules:e,onClose:t,onPauseCreated:n,onPauseDeleted:i,hideTitle:o=!1}){let s=r(),c=a(O()),l=a(A()),[u,f]=(0,L.useState)(``),p=()=>R(s),m=()=>{let e=new Date(new Date().getTime()+365*24*60*60*1e3).toISOString();c.mutate({body:{notification_type:`alert`,dedupe_key_prefix:``,reason:u.trim()||`User requested pause`,expires_at:e}},{onSuccess:e=>{n(e),p(),t()},onError:P(`Failed to pause alerts`)})},h=e=>{l.mutate({path:{rule_id:e}},{onSuccess:()=>{i(e),p(),t()},onError:P(`Failed to resume alerts`)})},_=c.isPending||l.isPending;return(0,V.jsxs)(`div`,{children:[!o&&(0,V.jsx)(`p`,{className:`mb-2 text-body-medium-default text-[var(--content-default)]`,children:`Pause alerts`}),e.length>0?(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Active pause rules:`}),e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-2 py-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-default)]`,children:e.reason||`All alerts paused`}),e.expires_at&&(0,V.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Expires `,N(e.expires_at)]})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>h(e.id),disabled:_,className:`ml-2 shrink-0 cursor-pointer rounded px-2 py-1 text-body-small-default text-[var(--system-negative-strong)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:`Resume`})]},e.id))]}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Temporarily mute all alert notifications.`}),(0,V.jsx)(g,{type:`text`,value:u,onChange:e=>f(e.target.value),placeholder:`Reason (optional)`}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m(),disabled:_,className:`w-full cursor-pointer rounded-md bg-[var(--primary-base)] px-3 py-1.5 text-body-medium-default text-[var(--content-inset)] transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`,children:c.isPending?(0,V.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}),`Pausing…`]}):`Pause all alerts`})]})]})}function W({notification:e,onAck:t,isAcking:n}){let r=e.notification_type===`alert`,i=z(e),a=!e.is_read;return(0,V.jsxs)(`div`,{className:`relative rounded-lg border border-[var(--border-base)] p-4`,style:{background:e.is_resolved?`var(--surface-base)`:`var(--surface-lift)`,opacity:e.is_resolved?.75:1},children:[(0,V.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,V.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-start gap-1`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[a&&!e.is_resolved&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 shrink-0 rounded-full bg-[var(--primary-base)]`}),r&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-negative-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[(0,V.jsx)(p,{className:`h-3 w-3`}),`Alert`]}),i&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[var(--surface-base)] px-2 py-0.5 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),`Snoozed`]}),e.is_resolved&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--system-positive-strong)_14%,transparent)] px-2 py-0.5 text-body-small-default text-[var(--system-positive-strong)]`,children:[(0,V.jsx)(l,{className:`h-3 w-3`}),`Resolved`]})]}),(0,V.jsx)(`h3`,{className:`text-body-medium-default leading-tight`,style:{color:e.is_resolved?`var(--content-secondary)`:`var(--content-default)`},children:e.title}),e.body&&(0,V.jsx)(`p`,{className:`text-body-small-default leading-relaxed text-[var(--content-secondary)]`,children:e.body})]})}),(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 text-body-small-default text-[var(--content-secondary)]`,children:[(0,V.jsxs)(`span`,{children:[`Last seen `,N(e.last_seen_at)]}),e.occurrence_count>1&&(0,V.jsxs)(`span`,{children:[`· `,e.occurrence_count,`× occurrences`]})]}),!e.is_resolved&&(0,V.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 border-t border-[var(--border-base)] pt-3`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>t(e.id,a),disabled:n,className:`flex cursor-pointer items-center gap-1.5 rounded-md px-3 py-1.5 text-body-small-default transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,style:{background:a?`var(--primary-base)`:`var(--surface-base)`,color:a?`var(--content-inset)`:`var(--content-secondary)`},children:[n?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(l,{className:`h-3 w-3`}),a?`Mark as read`:`Mark as unread`]}),(0,V.jsx)(H,{notificationId:e.id,currentlySnoozed:i,children:(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,children:[(0,V.jsx)(f,{className:`h-3 w-3`}),i?`Change snooze`:`Snooze`]})})]})]})}function G(){let e=x({platformHostedOnly:!0}),t=C(),o=S(),s=r(),l=w(),[u,f]=(0,L.useState)(`open`),[p,g]=(0,L.useState)(!1),[v,T]=(0,L.useState)([]),{data:E,isLoading:O,isError:A,refetch:j}=i({...k({query:{status:u}}),enabled:e===`full`&&t}),N=e===`full`&&o||(t?O:!1);(0,L.useEffect)(()=>{!t&&p&&g(!1)},[t,p]);let P=t?A:!1,z=t?E?.results??[]:[],B=z.filter(e=>!e.is_read&&!e.is_resolved),H=a(D()),[G,K]=(0,L.useState)(new Set),[q,J]=(0,L.useState)(!1),Y=(0,L.useCallback)(()=>R(s),[s]),X=async(e,t)=>{K(t=>new Set(t).add(e));try{await H.mutateAsync({path:{id:e},body:{acknowledged:t}}),Y()}catch(e){y.error(e instanceof Error?e.message:`Failed to update notification`)}finally{K(t=>{let n=new Set(t);return n.delete(e),n})}},Z=async()=>{if(!(B.length===0||q)){J(!0);try{await Promise.allSettled(B.map(e=>H.mutateAsync({path:{id:e.id},body:{acknowledged:!0}})))}finally{Y(),J(!1)}}},Q=(0,V.jsxs)(`button`,{type:`button`,className:`flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80`,title:`Pause alerts`,children:[(0,V.jsx)(F,{className:`h-3.5 w-3.5`}),`Pause alerts`]}),$=(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e))});return e===`gated`?(0,V.jsx)(n,{replace:!0,to:b.settings.general}):e===`disabled`?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]})]}),(0,V.jsx)(M,{children:`Log in to the Vellum platform to view notifications.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Notifications`}),(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:`Platform alerts and status notifications`})]}),t&&(l?(0,V.jsxs)(_.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(_.Trigger,{asChild:!0,children:Q}),(0,V.jsxs)(_.Content,{children:[(0,V.jsx)(_.Header,{children:(0,V.jsx)(_.Title,{children:`Pause alerts`})}),(0,V.jsx)(_.Body,{children:(0,V.jsx)(U,{existingRules:v,onClose:()=>g(!1),onPauseCreated:e=>T(t=>[...t,e]),onPauseDeleted:e=>T(t=>t.filter(t=>t.id!==e)),hideTitle:!0})})]})]}):(0,V.jsxs)(h.Root,{open:p,onOpenChange:g,children:[(0,V.jsx)(h.Trigger,{asChild:!0,children:Q}),(0,V.jsx)(h.Content,{align:`end`,className:`w-72`,children:$})]}))]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`div`,{className:`flex gap-1 rounded-md border border-[var(--border-base)] bg-[var(--surface-base)] p-1`,children:[`open`,`resolved`].map(e=>{let t=u===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>f(e),className:`cursor-pointer rounded px-3 py-1 text-body-small-default capitalize transition-colors`,style:{background:t?`var(--surface-lift)`:`transparent`,color:t?`var(--content-default)`:`var(--content-secondary)`,boxShadow:t?`0 1px 2px rgba(0,0,0,0.08)`:void 0},children:e},e)})}),u===`open`&&B.length>1&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>void Z(),disabled:q,className:`ml-auto flex cursor-pointer items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-transparent px-3 py-1.5 text-body-small-default text-[var(--content-secondary)] transition-opacity hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50`,children:[q?(0,V.jsx)(d,{className:`h-3 w-3 animate-spin`}):(0,V.jsx)(I,{className:`h-3 w-3`}),`Mark all as read (`,B.length,`)`]})]}),N?(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,V.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Loading notifications…`]}):P?(0,V.jsxs)(m,{tone:`error`,children:[`Failed to load notifications.`,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>void j(),className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):z.length===0?(0,V.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,V.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,V.jsx)(c,{className:`h-5 w-5 text-[var(--content-secondary)]`})}),(0,V.jsxs)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`No `,u,` notifications`]}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:u===`open`?`You're all caught up!`:`Nothing to show here.`})]}):(0,V.jsx)(`div`,{className:`space-y-3`,children:z.map(e=>(0,V.jsx)(W,{notification:e,onAck:(e,t)=>void X(e,t),isAcking:G.has(e.id)},e.id))})]})}export{G as NotificationsPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-
|
|
2
|
-
import{t as e}from"./preload-helper-Cv2QeVDK.js";import{u as t}from"./routes-D9sNqB_o.js";async function n(n){let{router:r}=await e(async()=>{let{router:e}=await import(`./routes-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-CaP5Tqj7.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/api-C3QSs67k.js","assets/local-mode-BTovbt13.js","assets/is-electron-m5eeGBnd.js","assets/create-selectors-Qo7kcikX.js","assets/react-BFJW0bSv.js","assets/local-settings-C-dW2vkq.js","assets/api-LG8zI3nK.js","assets/sdk.gen-BIu1DgTs.js","assets/client.gen-CV05d-kw.js","assets/sdk.gen-BHZ0fJla.js","assets/api-errors-CFiCT7Ap.js","assets/use-assistant-avatar-bwLHcMz4.js","assets/utils-CnB60ZJN.js","assets/assistant-identity-store-DIyVo8LV.js","assets/impersonate-version-flag-4Ki_3iKD.js","assets/semver-BpijV4FQ.js","assets/QueryClientProvider-CMu7CkQU.js","assets/jsx-runtime-D3ZM-ToX.js","assets/useQuery-Bz-fbQ-m.js","assets/use-ios-app-nudge-B-ojl-b1.js","assets/funnel-events-n2IVlwTo.js","assets/prefs-bw85lYLp.js","assets/onboarding-store-bZ2qYISk.js","assets/device-settings-DXp9L4iB.js","assets/consent-hzYg-zbh.js","assets/ingest-BizI657K.js","assets/client-identity-DhkdvP5w.js","assets/platform-detection-XEAAu4c-.js","assets/native-biometric-BAMIyaSS.js","assets/domains-DWRzNRJy.js","assets/routes-D9sNqB_o.js","assets/dist-BwAT3VYQ.js","assets/use-bus-subscription-nUrbz9Mu.js","assets/event-bus-DSxmBYhD.js","assets/client-feature-flag-store-CMncoan8.js","assets/feature-flag-catalog-I9-eJQP_.js","assets/theme-preferences-Bb2pPRXa.js","assets/typed-storage-9Sn8tkE7.js","assets/button-Dy5001j6.js","assets/cn-CJf7MmLX.js","assets/bundle-mjs-BQxDdOEo.js","assets/src-te3YTBG-.js","assets/dist-oCfq2a_n.js","assets/dist-CaYJ736y.js","assets/dist-jXSU-ejH.js","assets/checkbox-CRmgkYah.js","assets/createLucideIcon-CAM1RhH8.js","assets/check-sC49_hjU.js","assets/typography-DEI9Ra9z.js","assets/list-row-B1wPb2Au.js","assets/chevron-right-HU6H84S0.js","assets/menu-BvjhxZo7.js","assets/Combination-CkAMwkbS.js","assets/popover-BRpYVASI.js","assets/toast-LgLp4obE.js","assets/circle-alert-DVCpoZrc.js","assets/circle-check-CjGnAahM.js","assets/info-vgPTIsGI.js","assets/x-JBAsSOmg.js","assets/panel-item-CrtoJCrd.js","assets/dist-DC9QooLF.js","assets/card-DRIctGVs.js","assets/confirm-dialog-UYFm4osC.js","assets/loader-circle-XREx3i4W.js","assets/triangle-alert-CQfiAg_t.js","assets/modal-BR4CUFBd.js","assets/dropdown-BCfnSdIZ.js","assets/chevron-down-B5A-0g8A.js","assets/input-hw3el2GJ.js","assets/notice-BMK7xqUw.js","assets/progress-bar-C_T5_pf2.js","assets/tag-NXcyiTkK.js","assets/toggle-lfnhEAcN.js","assets/src-CfUWwwYf.css","assets/use-sticky-profiles-CdWX0mgI.js","assets/react-query.gen-C5c1Acuq.js","assets/useMutation-CXGTrp4W.js","assets/infiniteQueryOptions-CqLc14_4.js","assets/queryOptions-CMSBCFOf.js","assets/use-is-org-ready-C5xlYywh.js","assets/auth-store-5qq59BAN.js","assets/remote-gateway-session-yRYdsfDx.js","assets/capture-error-Bj8_eutd.js","assets/resolved-assistants-store-Dw5UuGyB.js","assets/use-platform-gate-C65D14xY.js","assets/eye-bbox-C_V87iLg.js","assets/runtime-upgrade-banner-DPqzKtZU.js","assets/react-query.gen-BC3STDmV.js","assets/local-runtime-upgrade-Bqn3d7Q7.js","assets/diagnostics-T_96Uyh5.js","assets/misc-CuYswARt.js","assets/cloud-off-BCBGTmt0.js","assets/moon-BJzODLTY.js","assets/refresh-cw-DzPnoeCh.js","assets/wrench-0WW0zkkG.js","assets/chunk-5KNZJZUH-Bsoom5--.js","assets/retire-confirm-dialog-CsSY2-T8.js","assets/navigation-resolver-DPJxzx0h.js","assets/research-onboarding-persistence-51lJoYJ2.js","assets/build-state-m0LQ5Iis.js","assets/use-command-palette-sections-CkpUaAKs.js","assets/chat-CDFCY8f0.js","assets/haptics-DvWjk9Fg.js","assets/settings-CfuLzwIw.js","assets/chevron-left-CytMddTB.js","assets/globe-CMtjL_s_.js","assets/layout-grid-DA_CfD6d.js","assets/message-square-CQGiY4zk.js","assets/monitor-B1y28fS1.js","assets/search-BVW-n8to.js","assets/zoom-in-CaLYwni-.js","assets/add-credential-modal-CY_--m8L.js","assets/use-active-assistant-id-CldxA_-M.js","assets/key-round-0Zop_GsZ.js","assets/app-card-CAaFL1oB.js","assets/edge-swipe-arbiter-store-CQnDi2yf.js","assets/viewer-store-DLk-jp8U.js","assets/pointer-BbPfN86L.js","assets/sandbox-bridge-BxW8HZq_.js","assets/external-link-CS0aVYGt.js","assets/puzzle-BVC3TGko.js","assets/use-edit-app-B_Nequzs.js","assets/use-is-mobile-BlQuzI5Z.js","assets/conversation-store-C--wWMNW.js","assets/edit-chat-session-D37Qx6ol.js","assets/chevron-up-2Qqarz0p.js","assets/minimize-2-CaXsUqSp.js","assets/pencil-D38YNe2r.js","assets/avatar-renderer-ClUVcQmf.js","assets/avatar-svg-compositor-Dl-ckXRE.js","assets/chat-avatar-CvEA6z0H.js","assets/animated-avatar-BcgncPkc.js","assets/use-reduced-motion-W1fCe3vS.js","assets/proxy-D7UPVac3.js","assets/sound-manager-Bx-OcMAz.js","assets/apple-logo--8ZT6Umn.js","assets/use-discord-nudge-C_QdHIeX.js","assets/middleware-HE0NLvPl.js","assets/integration-icon-dv-9Zzx3.js","assets/public-asset-BBVUuTT_.js","assets/chat-layout-slots-store-BJfYGnd7.js","assets/document-viewer-container-B7TEDeV0.js","assets/circle-check-big-DSsDH5_6.js","assets/download-CywcQLB2.js","assets/file-text-Br730Q4B.js","assets/message-square-text-D0Q7W58R.js","assets/send-Q71Exj3z.js","assets/trash-2-L5LNgw9o.js","assets/user-_zNqL48O.js","assets/not-found-OqaWNmdx.js","assets/arrow-left-C2ylPLHq.js","assets/sparkles-Ccrj7hxd.js","assets/platform-login-notice-CdYiKsE8.js","assets/use-onboarding-login-DI5gvqEG.js","assets/login-flow-CD9tyuFG.js","assets/log-in-CqVJRYe-.js","assets/slack-setup-wizard-DK2F8LXc.js","assets/use-copy-to-clipboard-cF7ZSilD.js","assets/clipboard-copy-JwIceweN.js","assets/voice-list-CW8mzaHU.js","assets/square-D_e8nR-F.js","assets/volume-2-CvT-JEIl.js","assets/voice-picker-modal-PdsZwrsV.js","assets/use-save-twilio-credentials-c9xG9RPK.js","assets/sdk.gen-B5ygTzyg.js","assets/mail-CMdPNysl.js","assets/message-circle-BsH7vHtN.js","assets/acp-run-store-B_eDLRwl.js","assets/by-tool-use-id-index-M50wYE1f.js","assets/optimistic-lifecycle-BINTsVFx.js","assets/messages-CFcAW4iz.js","assets/prechat-CeL4a_1i.js","assets/effective-timezone-CmcoXrio.js","assets/browser-timezone-CGwaX5Uv.js","assets/background-task-store-DMP8ByUq.js","assets/risk-CdT92Vqr.js","assets/chat-markdown-message-rxPKNeTx.js","assets/file-markdown-DaflJFk7.js","assets/workspace-tree-query-B1A-efgV.js","assets/browser-CTZVDjOL.js","assets/native-anchor-CeekjwVy.js","assets/eye-off-Jdx8qkOK.js","assets/eye-BMVGQXHT.js","assets/acp-run-actions-BH8wuBAL.js","assets/code-qafFA0_-.js","assets/background-task-actions-DmP5s0oO.js","assets/transcript-message-body-shared-D9_d2c2X.js","assets/site-favicon-BB1pYWLF.js","assets/three-dot-indicator-BMvKQ_On.js","assets/AnimatePresence-DPfyu3ET.js","assets/brain-BIzJCPA6.js","assets/user-plus-oiIr9ey8.js","assets/subagent-store-MDi6lBXs.js","assets/circle-x-17dBxF06.js","assets/file-plus-C3SBA8ll.js","assets/terminal-CdCI6wMV.js","assets/detail-shell-Cyqr5FXJ.js","assets/surface-parse-helpers-CEJ3tQ9Q.js","assets/conversation-navigation-DsN0hcpL.js","assets/workflow-store-lM7yKbUo.js","assets/workflow-status-HyIIhMBP.js","assets/conversation-selection-oJy8Oht3.js","assets/use-subagent-card-data-DHuNtSy9.js","assets/access-DS79PSR3.js","assets/assistant-feature-flag-store-CAdgpPiS.js","assets/research-results-view-C4sIw2gK.js","assets/research-facts-B7Ev1zv0.js","assets/ban-B__z3LwE.js","assets/utils-B0rBxtYP.js","assets/format-date-BGnM4mqL.js","assets/bell-Ct4a9v6Y.js","assets/clock-BYTc0Ds9.js","assets/list-DNbTcxAh.js","assets/rotate-ccw-BjzeX7qz.js","assets/shield-check-22NwY9JM.js","assets/invalidate-plugin-queries-C3NTXkCX.js","assets/first-run-scope-CL5YbC3b.js","assets/oauth-connection-utils-CWPUW4MK.js","assets/native-deep-link-DCBJ-Rw0.js","assets/oauth-popup-OhSYYlQF.js","assets/onboarding-layout-DLs1hfp_.js","assets/settings-navigation-CSG7jiyJ.js","assets/hard-navigate-DyUrcxe0.js","assets/use-supports-bookmarks-C3J7FtDn.js","assets/bug-VUcJFHwN.js","assets/chart-column-BLKW3sjY.js","assets/sliders-horizontal-slneqAyY.js","assets/mic-xmDFUbCL.js","assets/users-iLvfYFOP.js","assets/workspace-theme-tokens-DNNwX-XS.js","assets/conversation-queries-CWvK6RLK.js","assets/conversation-list-fetchers-DM-Y61u5.js","assets/use-app-theme-Dg8A6vPA.js","assets/use-assistant-capability-CDS7GbSO.js","assets/use-avatar-accent-var-vpakP1ce.js","assets/avatar-bundled-components-DPqbVXi9.js","assets/use-bookmarks-CK-nOiT-.js","assets/use-edge-swipe-Wm9pU2HX.js","assets/use-swipe-engine-6PcZZMVD.js","assets/plugins-surface-B43Op43l.js","assets/installed-plugins-query-Cgek0q7G.js","assets/doctor-handoff-store-CYjL1S0n.js","assets/threshold-presets-BdTTHCnm.js","assets/shield-fzs_emVe.js","assets/trust-rules-api-B5lfygCA.js","assets/dictation-overlay-pePw7mLd.js","assets/native-file-ySSv1sQ7.js","assets/deploy-store-D6snB1j5.js","assets/avatar-subagent-CRA2B82x.js","assets/avatar-tone-BKwvoDSj.js","assets/conversation-cache-DKvwwWNo.js","assets/external-urls-_vjsdj2L.js","assets/use-bundled-avatar-components-Bbs4vCnX.js","assets/use-effective-timezone-Dqs8OaXJ.js","assets/useInfiniteQuery-Dk8q0n49.js","assets/arrow-down-to-line-Bh_5sIPp.js","assets/arrow-right-B-jRJNWP.js","assets/arrow-up-BNd4Gpy7.js","assets/upload-Bdbyo_ok.js","assets/circle-minus-DNfBAj4g.js","assets/cloud-RlApB3rO.js","assets/coins-Hrmb9tmj.js","assets/credit-card-C1RL73Rt.js","assets/dices-DcuIF52A.js","assets/ellipsis-DnoqTkj4.js","assets/file-code-BDHws4Dk.js","assets/folder-DF8nFp7N.js","assets/hard-drive-DWFPKcXI.js","assets/heart-789ajxtB.js","assets/video-BcgduiJ6.js","assets/inbox-B6TknLsk.js","assets/laptop-DSZhU52i.js","assets/paperclip-c8Xlrnx4.js","assets/link-BfUb7cwC.js","assets/log-out-B4hsBWnk.js","assets/play-B0-JEtcm.js","assets/plus-jH3kAliM.js","assets/smartphone-mDNwm_ss.js","assets/sun-Dw0t1n1O.js","assets/workflow-cWWiPi3K.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Cv2QeVDK.js";import{u as t}from"./routes-D9sNqB_o.js";async function n(n){let{router:r}=await e(async()=>{let{router:e}=await import(`./routes-CaP5Tqj7.js`).then(e=>e.n);return{router:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282]));await r.navigate(`${t.workspace}?file=${encodeURIComponent(n)}`)}export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{I as t}from"./src-te3YTBG-.js";import{Qn as n,Xn as r,Yn as i,Zn as a,er as o,tr as s}from"./sdk.gen-
|
|
1
|
+
import{t as e}from"./jsx-runtime-D3ZM-ToX.js";import{I as t}from"./src-te3YTBG-.js";import{Qn as n,Xn as r,Yn as i,Zn as a,er as o,tr as s}from"./sdk.gen-BHZ0fJla.js";import{ht as c}from"./react-query.gen-C5c1Acuq.js";import{n as l,r as u,t as d}from"./api-errors-CFiCT7Ap.js";import{t as f}from"./schedules-6hzhR_C_.js";var p=e();function m({storageKey:e,detailKey:n,section:r,detail:i}){return(0,p.jsx)(t,{className:`min-h-0 flex-1`,storageKey:e,defaultRightWidth:480,minLeftWidth:320,minRightWidth:400,hideDivider:!0,left:(0,p.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col pr-[var(--app-spacing-lg)]`,children:r}),right:(0,p.jsx)(`div`,{className:`home-detail-drawer`,children:i},n)})}function h({children:e}){return(0,p.jsx)(`div`,{className:`fixed inset-0 z-30 bg-[var(--surface-overlay)]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`},children:e})}async function g(e,t){let{error:n,response:r}=await o({path:{assistant_id:e},body:t,throwOnError:!1});if(l(r,n,`Failed to create schedule.`),!r.ok)throw new d(r.status,u(n,r,`Failed to create schedule.`))}async function _(e){return f(e)}function v(e){return{queryKey:c({path:{assistant_id:e??``}}),queryFn:()=>e?_(e):Promise.resolve([]),staleTime:1e4}}async function y(e,t,n=10,r){let{data:i,error:o,response:s}=await a({path:{assistant_id:e,id:t},query:{limit:n,before:r},throwOnError:!1});if(l(s,o,`Failed to load schedule runs.`),!s.ok)throw new d(s.status,u(o,s,`Failed to load schedule runs.`));return{runs:i?.runs??[],nextCursor:i?.nextCursor??null}}async function b(e,t){let{data:n,error:r,response:i}=await s({path:{assistant_id:e},query:{from:t.from,to:t.to},throwOnError:!1});if(l(i,r,`Failed to load schedule usage.`),!i.ok)throw new d(i.status,u(r,i,`Failed to load schedule usage.`));return n?.summaries??[]}async function x(e,t,r){let{error:i,response:a}=await n({path:{assistant_id:e,id:t},body:{enabled:r},throwOnError:!1});if(l(a,i,`Failed to toggle schedule.`),!a.ok)throw new d(a.status,u(i,a,`Failed to toggle schedule.`))}async function S(e,t){let{error:n,response:r}=await i({path:{assistant_id:e,id:t},throwOnError:!1});if(l(r,n,`Failed to delete schedule.`),!r.ok&&r.status!==204)throw new d(r.status,u(n,r,`Failed to delete schedule.`))}async function C(e,t){let{error:n,response:i}=await r({path:{assistant_id:e,id:t},throwOnError:!1});if(l(i,n,`Failed to run schedule.`),!i.ok)throw new d(i.status,u(n,i,`Failed to run schedule.`))}function w({icon:e,title:t,description:n,actions:r}){return(0,p.jsxs)(`div`,{className:`flex h-full min-h-[400px] flex-col items-center justify-center gap-4 px-4 py-24 text-center`,children:[(0,p.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,p.jsx)(e,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,p.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:t}),(0,p.jsx)(`p`,{className:`max-w-md text-body-medium-lighter text-[var(--content-tertiary)]`,children:n}),r?(0,p.jsx)(`div`,{className:`flex flex-col items-center gap-3`,children:r}):null]})}export{b as a,x as c,y as i,m as l,g as n,C as o,S as r,v as s,w as t,h as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{u as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./arrow-left-C2ylPLHq.js";import{t as s}from"./sparkles-Ccrj7hxd.js";import"./src-te3YTBG-.js";import{i as c,r as l,t as u}from"./dist-oCfq2a_n.js";import{n as d}from"./toast-LgLp4obE.js";import{u as f}from"./routes-D9sNqB_o.js";import{n as p}from"./use-assistant-avatar-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{u as n}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./arrow-left-C2ylPLHq.js";import{t as s}from"./sparkles-Ccrj7hxd.js";import"./src-te3YTBG-.js";import{i as c,r as l,t as u}from"./dist-oCfq2a_n.js";import{n as d}from"./toast-LgLp4obE.js";import{u as f}from"./routes-D9sNqB_o.js";import{n as p}from"./use-assistant-avatar-bwLHcMz4.js";import{t as m}from"./use-active-assistant-id-CldxA_-M.js";import{a as h,c as g,i as _,o as v,s as y}from"./latest-assistant-text-DOepZ_Io.js";import{a as b,c as x,i as S,n as C,o as w,r as T,t as E}from"./use-assistant-identity-details-9JRWxXTQ.js";var D=e(t(),1),O=a(),k=`rgba(36, 41, 46, 0.25)`,A=`#FDFDFC`;function j({axis:e,value:t,onValueChange:n,tone:r,disabled:i}){return(0,O.jsxs)(`div`,{className:`flex w-full shrink-0 flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,style:{opacity:i?.7:1},children:[(0,O.jsx)(`span`,{className:`order-1 flex-1 text-left text-sm sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r.fg},children:e.left}),(0,O.jsx)(`span`,{className:`order-2 flex-1 text-right text-sm sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r.fg},children:e.right}),(0,O.jsxs)(u,{className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??b),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,O.jsx)(c,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:k}}),(0,O.jsx)(l,{className:`block h-5 w-5 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100 sm:h-6 sm:w-6`,style:{backgroundColor:A}})]})]})}async function M({assistantId:e,values:t,assistantName:n}){return T({assistantId:e,content:g(t,void 0,n),title:`Updating personality`,context:`identity_personality_update`})}function N(){let e=m(),t=n(),a=r(),{components:o,traits:s,customImageUrl:c}=p(e),l=C(e),u=i({queryKey:v(e),queryFn:()=>h(e)}),[g,b]=(0,D.useState)(null),[x,S]=(0,D.useState)(!1),T=g??u.data??{},k=l.data?.identity?.name||`Assistant`;return(0,O.jsx)(w,{components:o,traits:s,customImageUrl:c,entrance:!0,children:(0,O.jsx)(P,{assistantName:k,values:T,onValueChange:(e,t)=>b({...T,[e]:t}),applying:x,onUpdate:()=>{S(!0);let n=_(T);M({assistantId:e,values:n,assistantName:l.data?.identity?.name}).then(async r=>{S(!1),r?(await y(e,n),a.invalidateQueries({queryKey:v(e)}),a.invalidateQueries({queryKey:E(e)}),d.success(`Personality updated — come say hi!`),t(f.identity)):d.error(`The personality update didn't go through. Please try again.`)})},onBack:()=>void t(f.identity)})})}function P({assistantName:e,values:t,onValueChange:n,applying:r,onUpdate:i,onBack:a}){let{tone:c,bottomReserve:l}=x();return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{type:`button`,onClick:a,className:`absolute top-4 left-4 z-20 flex cursor-pointer items-center gap-1.5 rounded-full py-2 pr-4 pl-3 text-body-medium-default backdrop-blur-sm transition-all duration-150 active:scale-[0.97] ${c.isLight?`bg-black/10 hover:bg-black/20`:`bg-white/10 hover:bg-white/20`}`,style:{color:c.fg},children:[(0,O.jsx)(o,{className:`h-4 w-4`,"aria-hidden":!0}),`Back`]}),(0,O.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6`,style:{paddingBottom:l},children:[(0,O.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:`12%`}}),(0,O.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 text-center`,children:[(0,O.jsx)(`h1`,{className:`text-[2.6rem] leading-none max-sm:text-[2rem]`,style:{fontFamily:`var(--font-serif)`},children:`Shape my personality`}),(0,O.jsx)(`p`,{className:`max-w-md text-[15px]`,style:{color:c.fgMuted},children:`Slide the dials, then hit update — I’ll rewrite myself to match.`})]}),(0,O.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),(0,O.jsx)(`div`,{className:`flex w-full max-w-2xl shrink-0 flex-col`,children:S.map((e,i)=>(0,O.jsxs)(D.Fragment,{children:[i>0&&(0,O.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,O.jsx)(j,{axis:e,value:t[e.id]??b,onValueChange:t=>n(e.id,t),tone:c,disabled:r})]},e.id))}),(0,O.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-12`}),(0,O.jsx)(`button`,{type:`button`,onClick:i,disabled:r,className:`flex min-h-11 min-w-[240px] max-w-full shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[10px] px-6 py-2 text-body-medium-default transition-transform duration-150 active:scale-[0.97] disabled:cursor-default disabled:opacity-80 disabled:active:scale-100`,style:{backgroundColor:c.isLight?`#1A1A1A`:`#FFFFFF`,color:c.isLight?`#FFFFFF`:`#1A1A1A`},children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-transparent`,style:{borderTopColor:c.isLight?`#FFFFFF`:`#1A1A1A`,borderRightColor:c.isLight?`#FFFFFF`:`#1A1A1A`}}),(0,O.jsxs)(`span`,{className:`min-w-0 text-center`,children:[e,` is rewriting itself…`]})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(s,{className:`h-4 w-4`,"aria-hidden":!0}),`Update personality`]})})]})]})}export{N as PersonalityPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as i}from"./QueryClientProvider-CMu7CkQU.js";import{t as a}from"./useQuery-Bz-fbQ-m.js";import{t as o}from"./useMutation-CXGTrp4W.js";import{t as s}from"./jsx-runtime-D3ZM-ToX.js";import{t as c}from"./typography-DEI9Ra9z.js";import{t as l}from"./arrow-left-C2ylPLHq.js";import{t as u}from"./circle-check-CjGnAahM.js";import{D as d,M as f,N as p,O as m,P as h,S as g,a as _,b as v,c as y,d as ee,i as b,k as te,l as ne,m as re,n as ie,o as x,p as ae,r as S,t as oe,u as se}from"./use-checkout-dismiss-refresh-BpmG1OQ0.js";import{t as C}from"./sliders-horizontal-slneqAyY.js";import{t as ce}from"./loader-circle-XREx3i4W.js";import{t as w}from"./triangle-alert-CQfiAg_t.js";import{t as T}from"./tag-NXcyiTkK.js";import{t as E}from"./modal-BR4CUFBd.js";import{n as D}from"./toast-LgLp4obE.js";import{t as le}from"./is-electron-m5eeGBnd.js";import{x as ue}from"./native-biometric-BAMIyaSS.js";import{u as O}from"./routes-D9sNqB_o.js";import{i as de,r as fe,t as pe}from"./use-platform-gate-bFyCaLbM.js";import{n as me}from"./browser-CTZVDjOL.js";import{$ as he,dt as ge,et as _e,lt as ve,ut as ye}from"./react-query.gen-BC3STDmV.js";import{t as k}from"./use-bundled-avatar-components-Bbs4vCnX.js";import{t as A}from"./machine-sizes-DO8duvpy.js";import{t as be}from"./checkout-return-target-DI6Hb-9L.js";var j=e(t(),1),M=s(),N=`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`;function xe({className:e,onConfigure:t,configureDisabled:r,isCurrent:i=!1,currentSummary:a}){return(0,M.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,M.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,M.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,M.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,M.jsx)(C,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),i?(0,M.jsx)(T,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Your Current Plan`}):null]}),(0,M.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:a??N})]})]}),(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,M.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,M.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function Se({open:e,lostFeatures:t,pending:r,onCancel:i,onConfirm:a}){let o=t.length>0;return(0,M.jsx)(E.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,M.jsxs)(E.Content,{size:`md`,hideCloseButton:!0,children:[(0,M.jsx)(E.Header,{children:(0,M.jsx)(E.Title,{icon:w,children:`Downgrade to Free?`})}),(0,M.jsxs)(E.Body,{children:[(0,M.jsx)(c,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:o?`Downgrading removes the following Pro features. You'll be taken to Stripe to cancel your subscription.`:`You'll be taken to Stripe to cancel your subscription.`}),o?(0,M.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(c,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,M.jsxs)(E.Footer,{children:[(0,M.jsx)(n,{variant:`outlined`,onClick:i,disabled:r,children:`Cancel`}),(0,M.jsx)(n,{variant:`danger`,onClick:a,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:`Downgrade to Free`})]})]})})}function P({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:d,intent:f=`upgrade`,pending:p,onCta:m}){let h=f===`downgrade`&&!d;return(0,M.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,M.jsx)(y,{tier:e,size:50}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!h&&!d?(0,M.jsx)(T,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Recommended`}):null]}),(0,M.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:r})]}),(0,M.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,M.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,M.jsx)(n,{variant:h?`outlined`:`primary`,fullWidth:!0,disabled:d||p,onClick:m,children:d?`Current Plan`:o}),(0,M.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,M.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,M.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,M.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(u,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,M.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var Ce=`#0A0A0B`,we=`https://www.vellum.ai/docs/pricing`;k();var Te=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function Ee(e){return`${v(e)}/month`}function F(e){return`${x(e)} Computer`}function De(e,t){let n=e.credits_usd??0;return[F(e),`${e.storage_gib} GB Storage`,`${v(n*100)} in credits included`,...t]}function Oe(e,t){let n=[`${e.machineTier?A[e.machineTier]??e.machineTier:_} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=e.creditTier.match(/^credits_(\d+)$/)?.[1];n.push(h(t,e.creditTier)?.label??(r==null?`Credit bundle`:`${r} credits`))}return n.join(` · `)}function I(){let e=r(),t=i(),s=le(),c=de({platformHostedOnly:!0}),u=pe(),h=fe(),_=c===`full`&&u,v=c===`full`&&h,y=a({...ve(),enabled:_}),x=a({...he(),enabled:_}),C=o(ge()),{changePackage:w,isPending:T}=ee(),{changeTiers:E,isPending:k,current:A,currentReady:N}=se({enabled:_});oe();let[F,I]=(0,j.useState)(!1),[ke,L]=(0,j.useState)(!1),[Ae,R]=(0,j.useState)(!1),[z,B]=(0,j.useState)(null),[je,V]=(0,j.useState)(!1),[Me,H]=(0,j.useState)(void 0),U=y.data,W=x.data?.plans.find(e=>e.id===`pro`),G=W?.packages??[],K=G.length>0,q=U?.plan_id===`pro`,J=d(g(U)),Ne=new Set(x.data?.plans.find(e=>e.id===`base`)?.included_features??[]),Pe=(W?.included_features??[]).filter(e=>!Ne.has(e)),Y=F||T||J.isPending,Fe=(0,j.useMemo)(()=>!q||A.storageTier==null?null:{machineTier:A.machineTier,storageTier:A.storageTier,creditTier:A.creditTier},[q,A.machineTier,A.storageTier,A.creditTier]),X=!_&&!v,Ie=_&&!x.isLoading&&!K,Z=X||y.isError||Ie;(0,j.useEffect)(()=>{Z&&e(X?O.settings.usageBilling:`${O.settings.usageBilling}&adjust_plan`,{replace:!0})},[Z,X,e]);let Le=()=>{(window.history.state?.idx??0)>0?e(-1):e(O.settings.usageBilling)},Q=async e=>{I(!0);try{let n=await C.mutateAsync({body:{...e,return_target:be()}});n.status===`redirect`&&n.checkout_url?(ue(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),me(n.checkout_url)):(await t.invalidateQueries({queryKey:ye()}),await t.invalidateQueries({queryKey:_e()}))}catch(e){D.error(ae(e,`Failed to start the upgrade checkout. Please try again.`))}finally{I(!1)}},$;if(U&&W&&K){let t=U.plan_id===`base`?`free`:te(U.package)?U.package.key:null,n=q&&t===null&&N&&A.storageGib!=null,r=n?Oe(A,W):void 0,i=n=>{if(!Y){if(q){if(n===`free`){R(!0);return}let r=G.find(e=>e.key===n);if(!r||f(t,r.key)===`current`)return;if(!re(U)){e(`${O.settings.usage}?tab=billing&adjust_plan`);return}B(r);return}n!==`free`&&Q({target_plan_id:`pro`,package:n,confirm:!0})}},a=()=>{R(!1),J.mutate({})},o=async()=>{if(!z)return;let e=z,n=f(t,e.key),r=await w(e.key);if(r){if(B(null),r.status===`no_op`){D.success(`You're already on this plan.`);return}n===`downgrade`?D.success(`Downgraded to ${e.name}.`):(H(void 0),V(!0))}},s=z?t===null?`switch`:f(t,z.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,c=e=>Q({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),l=async e=>{let t=await E(e);t&&(L(!1),t.needsResize||t.creditChanged?(H(t.creditChanged?e.creditTier:void 0),V(!0)):D.success(`Plan updated.`))},u=()=>{Y||q&&!N||L(!0)},d=[...G].sort((e,t)=>m.indexOf(e.key)-m.indexOf(t.key)),h=b(`free`),g=q?`downgrade`:f(t,`free`);$=(0,M.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,M.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,M.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Give your assistant more power`}),(0,M.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Choose the level that matches how much you want it to take on.`})]}),(0,M.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,M.jsx)(P,{tierKey:`free`,name:`Free`,tagline:h?.tagline??``,priceLabel:`$0/month`,priceCaption:h?.priceCaption??`Forever`,ctaLabel:g===`downgrade`?S(`Free`):h?.cta??`Start Free`,features:Te,tone:`dark`,isCurrent:t===`free`,intent:g,pending:Y,onCta:()=>i(`free`)}),d.map(e=>{let n=b(e.key),r=f(t,e.key);return(0,M.jsx)(P,{tierKey:e.key,name:e.name,tagline:n?.tagline??``,priceLabel:Ee(e.total_price_cents),priceCaption:n?.priceCaption??`Billed monthly`,ctaLabel:r===`downgrade`?S(e.name):n?.cta??e.name,features:De(e,n?.extraFeatures??[]),recommended:n?.recommended,tone:n?.recommended?`light`:`dark`,isCurrent:t===e.key,intent:r,pending:Y,onCta:()=>i(e.key)},e.key)})]}),(0,M.jsx)(xe,{className:`mt-6 sm:mt-10`,onConfigure:u,configureDisabled:q&&!N||Y,isCurrent:n,currentSummary:r}),(0,M.jsx)(ne,{open:ke,proPlan:W,pending:F||k,currentStorageGib:q?A.storageGib:null,initialSelection:Fe,onClose:()=>L(!1),onContinue:e=>{q?l(e):c(e)}}),(0,M.jsx)(ie,{open:z!==null,relation:s,packageName:z?.name??``,targetPackage:z,pending:T,onCancel:()=>B(null),onConfirm:()=>void o()}),(0,M.jsx)(Se,{open:Ae,lostFeatures:Pe,pending:J.isPending,onCancel:()=>R(!1),onConfirm:a}),(0,M.jsx)(p,{mode:`resize`,open:je,onClose:()=>{V(!1),H(void 0)},resizeCredits:Me}),(0,M.jsxs)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,M.jsx)(`a`,{href:we,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,M.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,M.jsx)(ce,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,M.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:Ce},children:[(0,M.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:s?`3rem`:`2rem`},children:(0,M.jsx)(n,{variant:`outlined`,leftIcon:(0,M.jsx)(l,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:Le,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,M.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:s?`5rem`:`4rem`},children:$})]})}export{I as PlansPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-Dy5001j6.js";import{u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{n as i}from"./QueryClientProvider-CMu7CkQU.js";import{t as a}from"./useQuery-Bz-fbQ-m.js";import{t as o}from"./useMutation-CXGTrp4W.js";import{t as s}from"./jsx-runtime-D3ZM-ToX.js";import{t as c}from"./typography-DEI9Ra9z.js";import{t as l}from"./arrow-left-C2ylPLHq.js";import{t as u}from"./circle-check-CjGnAahM.js";import{D as d,M as f,N as p,O as m,P as h,S as g,a as _,b as v,c as y,d as ee,i as b,k as te,l as ne,m as re,n as ie,o as x,p as ae,r as S,t as oe,u as se}from"./use-checkout-dismiss-refresh-CqGR_OsB.js";import{t as C}from"./sliders-horizontal-slneqAyY.js";import{t as ce}from"./loader-circle-XREx3i4W.js";import{t as w}from"./triangle-alert-CQfiAg_t.js";import{t as T}from"./tag-NXcyiTkK.js";import{t as E}from"./modal-BR4CUFBd.js";import{n as D}from"./toast-LgLp4obE.js";import{t as le}from"./is-electron-m5eeGBnd.js";import{x as ue}from"./native-biometric-BAMIyaSS.js";import{u as O}from"./routes-D9sNqB_o.js";import{i as de,r as fe,t as pe}from"./use-platform-gate-C65D14xY.js";import{n as me}from"./browser-CTZVDjOL.js";import{$ as he,dt as ge,et as _e,lt as ve,ut as ye}from"./react-query.gen-BC3STDmV.js";import{t as k}from"./use-bundled-avatar-components-Bbs4vCnX.js";import{t as A}from"./machine-sizes-DO8duvpy.js";import{t as be}from"./checkout-return-target-DI6Hb-9L.js";var j=e(t(),1),M=s(),N=`Select custom CPU power, Ram and Storage. Or just throw in some tokens.`;function xe({className:e,onConfigure:t,configureDisabled:r,isCurrent:i=!1,currentSummary:a}){return(0,M.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,M.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Need something more tailored to your needs?`}),(0,M.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,M.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,M.jsx)(C,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:`Custom Plan`}),i?(0,M.jsx)(T,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:`Your Current Plan`}):null]}),(0,M.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:a??N})]})]}),(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,M.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:`Billed monthly`}),(0,M.jsx)(n,{variant:`outlined`,onClick:t,disabled:r,children:`Configure`})]})]})]})}function Se({open:e,lostFeatures:t,pending:r,onCancel:i,onConfirm:a}){let o=t.length>0;return(0,M.jsx)(E.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,M.jsxs)(E.Content,{size:`md`,hideCloseButton:!0,children:[(0,M.jsx)(E.Header,{children:(0,M.jsx)(E.Title,{icon:w,children:`Downgrade to Free?`})}),(0,M.jsxs)(E.Body,{children:[(0,M.jsx)(c,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:o?`Downgrading removes the following Pro features. You'll be taken to Stripe to cancel your subscription.`:`You'll be taken to Stripe to cancel your subscription.`}),o?(0,M.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(c,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,M.jsxs)(E.Footer,{children:[(0,M.jsx)(n,{variant:`outlined`,onClick:i,disabled:r,children:`Cancel`}),(0,M.jsx)(n,{variant:`danger`,onClick:a,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:`Downgrade to Free`})]})]})})}function P({tierKey:e,name:t,tagline:r,priceLabel:i,priceCaption:a,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:d,intent:f=`upgrade`,pending:p,onCta:m}){let h=f===`downgrade`&&!d;return(0,M.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,M.jsx)(y,{tier:e,size:50}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!h&&!d?(0,M.jsx)(T,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:`Recommended`}):null]}),(0,M.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:r})]}),(0,M.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:i}),(0,M.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:a})]}),(0,M.jsx)(n,{variant:h?`outlined`:`primary`,fullWidth:!0,disabled:d||p,onClick:m,children:d?`Current Plan`:o}),(0,M.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,M.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:`Includes:`}),(0,M.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,M.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,M.jsx)(u,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,M.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}var Ce=`#0A0A0B`,we=`https://www.vellum.ai/docs/pricing`;k();var Te=[`Small Computer`,`4 GB Storage`,`Pay-as-you-go credits`];function Ee(e){return`${v(e)}/month`}function F(e){return`${x(e)} Computer`}function De(e,t){let n=e.credits_usd??0;return[F(e),`${e.storage_gib} GB Storage`,`${v(n*100)} in credits included`,...t]}function Oe(e,t){let n=[`${e.machineTier?A[e.machineTier]??e.machineTier:_} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=e.creditTier.match(/^credits_(\d+)$/)?.[1];n.push(h(t,e.creditTier)?.label??(r==null?`Credit bundle`:`${r} credits`))}return n.join(` · `)}function I(){let e=r(),t=i(),s=le(),c=de({platformHostedOnly:!0}),u=pe(),h=fe(),_=c===`full`&&u,v=c===`full`&&h,y=a({...ve(),enabled:_}),x=a({...he(),enabled:_}),C=o(ge()),{changePackage:w,isPending:T}=ee(),{changeTiers:E,isPending:k,current:A,currentReady:N}=se({enabled:_});oe();let[F,I]=(0,j.useState)(!1),[ke,L]=(0,j.useState)(!1),[Ae,R]=(0,j.useState)(!1),[z,B]=(0,j.useState)(null),[je,V]=(0,j.useState)(!1),[Me,H]=(0,j.useState)(void 0),U=y.data,W=x.data?.plans.find(e=>e.id===`pro`),G=W?.packages??[],K=G.length>0,q=U?.plan_id===`pro`,J=d(g(U)),Ne=new Set(x.data?.plans.find(e=>e.id===`base`)?.included_features??[]),Pe=(W?.included_features??[]).filter(e=>!Ne.has(e)),Y=F||T||J.isPending,Fe=(0,j.useMemo)(()=>!q||A.storageTier==null?null:{machineTier:A.machineTier,storageTier:A.storageTier,creditTier:A.creditTier},[q,A.machineTier,A.storageTier,A.creditTier]),X=!_&&!v,Ie=_&&!x.isLoading&&!K,Z=X||y.isError||Ie;(0,j.useEffect)(()=>{Z&&e(X?O.settings.usageBilling:`${O.settings.usageBilling}&adjust_plan`,{replace:!0})},[Z,X,e]);let Le=()=>{(window.history.state?.idx??0)>0?e(-1):e(O.settings.usageBilling)},Q=async e=>{I(!0);try{let n=await C.mutateAsync({body:{...e,return_target:be()}});n.status===`redirect`&&n.checkout_url?(ue(e.package?{kind:`package`,packageKey:e.package}:{kind:`custom`,machineTier:e.machine_tier??null,storageTier:e.storage_tier??null,creditTier:e.credit_tier??null}),me(n.checkout_url)):(await t.invalidateQueries({queryKey:ye()}),await t.invalidateQueries({queryKey:_e()}))}catch(e){D.error(ae(e,`Failed to start the upgrade checkout. Please try again.`))}finally{I(!1)}},$;if(U&&W&&K){let t=U.plan_id===`base`?`free`:te(U.package)?U.package.key:null,n=q&&t===null&&N&&A.storageGib!=null,r=n?Oe(A,W):void 0,i=n=>{if(!Y){if(q){if(n===`free`){R(!0);return}let r=G.find(e=>e.key===n);if(!r||f(t,r.key)===`current`)return;if(!re(U)){e(`${O.settings.usage}?tab=billing&adjust_plan`);return}B(r);return}n!==`free`&&Q({target_plan_id:`pro`,package:n,confirm:!0})}},a=()=>{R(!1),J.mutate({})},o=async()=>{if(!z)return;let e=z,n=f(t,e.key),r=await w(e.key);if(r){if(B(null),r.status===`no_op`){D.success(`You're already on this plan.`);return}n===`downgrade`?D.success(`Downgraded to ${e.name}.`):(H(void 0),V(!0))}},s=z?t===null?`switch`:f(t,z.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,c=e=>Q({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),l=async e=>{let t=await E(e);t&&(L(!1),t.needsResize||t.creditChanged?(H(t.creditChanged?e.creditTier:void 0),V(!0)):D.success(`Plan updated.`))},u=()=>{Y||q&&!N||L(!0)},d=[...G].sort((e,t)=>m.indexOf(e.key)-m.indexOf(t.key)),h=b(`free`),g=q?`downgrade`:f(t,`free`);$=(0,M.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,M.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,M.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:`Give your assistant more power`}),(0,M.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:`Choose the level that matches how much you want it to take on.`})]}),(0,M.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,M.jsx)(P,{tierKey:`free`,name:`Free`,tagline:h?.tagline??``,priceLabel:`$0/month`,priceCaption:h?.priceCaption??`Forever`,ctaLabel:g===`downgrade`?S(`Free`):h?.cta??`Start Free`,features:Te,tone:`dark`,isCurrent:t===`free`,intent:g,pending:Y,onCta:()=>i(`free`)}),d.map(e=>{let n=b(e.key),r=f(t,e.key);return(0,M.jsx)(P,{tierKey:e.key,name:e.name,tagline:n?.tagline??``,priceLabel:Ee(e.total_price_cents),priceCaption:n?.priceCaption??`Billed monthly`,ctaLabel:r===`downgrade`?S(e.name):n?.cta??e.name,features:De(e,n?.extraFeatures??[]),recommended:n?.recommended,tone:n?.recommended?`light`:`dark`,isCurrent:t===e.key,intent:r,pending:Y,onCta:()=>i(e.key)},e.key)})]}),(0,M.jsx)(xe,{className:`mt-6 sm:mt-10`,onConfigure:u,configureDisabled:q&&!N||Y,isCurrent:n,currentSummary:r}),(0,M.jsx)(ne,{open:ke,proPlan:W,pending:F||k,currentStorageGib:q?A.storageGib:null,initialSelection:Fe,onClose:()=>L(!1),onContinue:e=>{q?l(e):c(e)}}),(0,M.jsx)(ie,{open:z!==null,relation:s,packageName:z?.name??``,targetPackage:z,pending:T,onCancel:()=>B(null),onConfirm:()=>void o()}),(0,M.jsx)(Se,{open:Ae,lostFeatures:Pe,pending:J.isPending,onCancel:()=>R(!1),onConfirm:a}),(0,M.jsx)(p,{mode:`resize`,open:je,onClose:()=>{V(!1),H(void 0)},resizeCredits:Me}),(0,M.jsxs)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:[`You can cancel or change your plan anytime you want. To learn more`,` `,(0,M.jsx)(`a`,{href:we,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`,children:`Read our Docs.`})]})]})}else $=(0,M.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,M.jsx)(ce,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":`Loading plans`})});return(0,M.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:Ce},children:[(0,M.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:s?`3rem`:`2rem`},children:(0,M.jsx)(n,{variant:`outlined`,leftIcon:(0,M.jsx)(l,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:Le,className:`[-webkit-app-region:no-drag]`,children:`Back`})}),(0,M.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:s?`5rem`:`4rem`},children:$})]})}export{I as PlansPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-Dy5001j6.js";import{l as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./log-in-CqVJRYe-.js";import{t as i}from"./notice-BMK7xqUw.js";import{t as a}from"./use-onboarding-login-
|
|
1
|
+
import{t as e}from"./button-Dy5001j6.js";import{l as t}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as n}from"./jsx-runtime-D3ZM-ToX.js";import{t as r}from"./log-in-CqVJRYe-.js";import{t as i}from"./notice-BMK7xqUw.js";import{t as a}from"./use-onboarding-login-DI5gvqEG.js";var o=n();function s({children:n,className:s}){let{pathname:c,search:l,hash:u}=t(),{loading:d,login:f,cancel:p}=a(`${c}${l}${u}`);return(0,o.jsx)(i,{tone:`info`,className:s,actions:(0,o.jsx)(e,{variant:`ghost`,leftIcon:d?void 0:(0,o.jsx)(r,{className:`h-4 w-4`}),onClick:d?p:()=>void f(),children:d?`Cancel`:`Log In`}),children:n})}export{s as t};
|
package/dist/assets/{platform-loopback-page-jBGJSmyh.js → platform-loopback-page-D0gXCm2S.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{j as a,w as o}from"./local-mode-BTovbt13.js";import{D as s,n as c}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{m as n,u as r}from"./chunk-5KNZJZUH-Bsoom5--.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{j as a,w as o}from"./local-mode-BTovbt13.js";import{D as s,n as c}from"./auth-store-5qq59BAN.js";import{c as l}from"./api-LG8zI3nK.js";import{g as u}from"./native-biometric-BAMIyaSS.js";import{u as d}from"./routes-D9sNqB_o.js";var f=e(t(),1),p=i(),m=`vellum:loopback:state`,h=`vellum:loopback:returnTo`;function g(){let[e]=n(),t=r(),[i,g]=(0,f.useState)(null);return(0,f.useEffect)(()=>{let n=e.get(`state`),r=e.get(`session_token`),i=sessionStorage.getItem(m),f=sessionStorage.getItem(h)||d.assistant;if(sessionStorage.removeItem(m),sessionStorage.removeItem(h),!n||n!==i){g(`Login failed: state mismatch. Please try again.`);return}if(!r){g(`Login failed: no session token received. Please try again.`);return}if(!/^[a-zA-Z0-9]+$/.test(r)){g(`Login failed: invalid session token.`);return}(async()=>{if(!await a(r)){g(`Login failed: couldn't reach the local Vellum server to store the session. Please try again.`);return}await c.getState().initSession(),await u(!0);try{let e=await l();if(e.ok&&e.data.length>0){await o(e.data,s.getState().currentOrganizationId??void 0),t(d.assistant,{replace:!0});return}}catch{}t(f,{replace:!0})})()},[e,t]),i?(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:i}),(0,p.jsx)(`button`,{type:`button`,className:`mt-4 rounded-lg border border-[var(--border-disabled)] px-4 py-2 text-sm hover:bg-[var(--surface-lift)]`,onClick:()=>void t(d.welcome),children:`Back to Welcome`})]})}):(0,p.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,p.jsx)(`p`,{className:`text-body-medium-default`,children:`Completing login...`})})}export{g as PlatformLoopbackPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-BFJW0bSv.js";import{F as s,t as c}from"./button-Dy5001j6.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./cn-CJf7MmLX.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./chevron-down-B5A-0g8A.js";import{t as g}from"./chevron-right-HU6H84S0.js";import{t as _}from"./loader-circle-XREx3i4W.js";import{c as v,o as y,r as b,t as x}from"./threshold-presets-BdTTHCnm.js";import{t as S}from"./pencil-D38YNe2r.js";import{t as C}from"./shield-check-22NwY9JM.js";import{t as w}from"./trash-2-L5LNgw9o.js";import{t as T}from"./x-JBAsSOmg.js";import{t as E}from"./notice-BMK7xqUw.js";import{t as D}from"./tag-NXcyiTkK.js";import{t as O}from"./input-hw3el2GJ.js";import{t as k}from"./toggle-lfnhEAcN.js";import{n as A}from"./toast-LgLp4obE.js";import{t as j}from"./confirm-dialog-UYFm4osC.js";import{t as M}from"./dropdown-BCfnSdIZ.js";import{n as N,p as P,r as F}from"./auth-store-BW4V6iLb.js";import{t as ee}from"./sdk.gen-BIu1DgTs.js";import{c as te,i as ne,m as re,n as ie,o as I,r as ae,s as oe,t as se}from"./native-biometric-BAMIyaSS.js";import{l as ce,u as le}from"./routes-D9sNqB_o.js";import{i as L,r as ue,t as de}from"./use-platform-gate-bFyCaLbM.js";import{f as fe,p as pe}from"./prefs-bw85lYLp.js";import{n as me,t as R}from"./react-query.gen-BC3STDmV.js";import{a as z,c as he,n as ge,o as _e,r as B,s as ve,u as ye}from"./trust-rules-api-B5lfygCA.js";import{t as be}from"./platform-login-notice-BaCrIk0m.js";import{t as V}from"./use-active-assistant-id-CldxA_-M.js";import{t as H}from"./detail-card-Du8OuE3q.js";import{t as U}from"./setting-row-BwXKepmJ.js";import{t as xe}from"./settings-divider-Ro7lPCkV.js";var W=e(o(),1),G=f(),K=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||_e(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ye(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Se.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ve(e.sourceKind):await he(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=L({platformHostedOnly:!0}),t=de(),n=ue(),r=l(),{data:i,isLoading:a,isError:o}=u({...R(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{me(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(k,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(be,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=re(),[t,n]=(0,W.useState)(()=>ne()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(ae().then(i),ie().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)I(!1),await se(),n(!1);else{let e=te();e&&await oe(e),I(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(k,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(k,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(O,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(w,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=x.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=V(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>y(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,d]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[S,C]=(0,W.useState)(!1),w=(0,W.useRef)(null),T=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(b(n.interactive).id),s(b(n.autonomous).id),d(b(n.headless).id),C(!0))},[n]),(0,W.useEffect)(()=>()=>{w.current!==null&&(clearTimeout(w.current),w.current=null,T.current?.(),T.current=null)},[]);let E=(0,W.useCallback)((n,r,i)=>{if(!e||!S)return;let a=x.find(e=>e.id===n)?.riskThreshold,o=x.find(e=>e.id===r)?.riskThreshold,s=x.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||v(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,S,t]),D=(0,W.useCallback)((e,t,n)=>{w.current!==null&&clearTimeout(w.current),T.current=()=>E(e,t,n),w.current=setTimeout(()=>{T.current?.(),w.current=null,T.current=null},500)},[E]),O=(0,W.useCallback)(e=>{_.current=!0,a(e),D(e,o,c)},[o,c,D]),k=(0,W.useCallback)(e=>{_.current=!0,s(e),D(i,e,c)},[i,c,D]),A=(0,W.useCallback)(e=>{_.current=!0,d(e),D(i,o,e)},[i,o,D]),j=x.find(e=>e.id===i),N=x.find(e=>e.id===o),P=x.find(e=>e.id===c),F=!e||!S;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:i,onChange:O,options:Y,disabled:F})}),j&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:j.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:o,onChange:k,options:Y,disabled:F})}),N&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:N.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:c,onChange:A,options:Y,disabled:F})}),P&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:P.description})]})]})]})]})]})}var X=e(s(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await z(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(T,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(E,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(M,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let v=(0,W.useCallback)(async()=>{if(f)try{await ge(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(k,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(E,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(C,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(D,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(S,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(w,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(j,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=V(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(C,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=L({platformHostedOnly:!0}),t=F(),n=t,a=N.use.user()?.id??null,[o]=fe(),[s]=pe(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:ce(le.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{P(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{P(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We as PrivacyPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-DXp9L4iB.js";import{t as o}from"./react-BFJW0bSv.js";import{F as s,t as c}from"./button-Dy5001j6.js";import{n as l}from"./QueryClientProvider-CMu7CkQU.js";import{t as u}from"./useQuery-Bz-fbQ-m.js";import{t as d}from"./useMutation-CXGTrp4W.js";import{t as f}from"./jsx-runtime-D3ZM-ToX.js";import{t as p}from"./cn-CJf7MmLX.js";import{t as m}from"./card-DRIctGVs.js";import{t as h}from"./chevron-down-B5A-0g8A.js";import{t as g}from"./chevron-right-HU6H84S0.js";import{t as _}from"./loader-circle-XREx3i4W.js";import{c as v,o as y,r as b,t as x}from"./threshold-presets-BdTTHCnm.js";import{t as S}from"./pencil-D38YNe2r.js";import{t as C}from"./shield-check-22NwY9JM.js";import{t as w}from"./trash-2-L5LNgw9o.js";import{t as T}from"./x-JBAsSOmg.js";import{t as E}from"./notice-BMK7xqUw.js";import{t as D}from"./tag-NXcyiTkK.js";import{t as O}from"./input-hw3el2GJ.js";import{t as k}from"./toggle-lfnhEAcN.js";import{n as A}from"./toast-LgLp4obE.js";import{t as j}from"./confirm-dialog-UYFm4osC.js";import{t as M}from"./dropdown-BCfnSdIZ.js";import{n as N,p as P,r as F}from"./auth-store-5qq59BAN.js";import{t as ee}from"./sdk.gen-BIu1DgTs.js";import{c as te,i as ne,m as re,n as ie,o as I,r as ae,s as oe,t as se}from"./native-biometric-BAMIyaSS.js";import{l as ce,u as le}from"./routes-D9sNqB_o.js";import{i as L,r as ue,t as de}from"./use-platform-gate-C65D14xY.js";import{f as fe,p as pe}from"./prefs-bw85lYLp.js";import{n as me,t as R}from"./react-query.gen-BC3STDmV.js";import{a as z,c as he,n as ge,o as _e,r as B,s as ve,u as ye}from"./trust-rules-api-B5lfygCA.js";import{t as be}from"./platform-login-notice-CdYiKsE8.js";import{t as V}from"./use-active-assistant-id-CldxA_-M.js";import{t as H}from"./detail-card-Du8OuE3q.js";import{t as U}from"./setting-row-BwXKepmJ.js";import{t as xe}from"./settings-divider-Ro7lPCkV.js";var W=e(o(),1),G=f(),K=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||_e(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=ye(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Se.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ve(e.sourceKind):await he(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=L({platformHostedOnly:!0}),t=de(),n=ue(),r=l(),{data:i,isLoading:a,isError:o}=u({...R(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await ee({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{me(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(k,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,G.jsx)(be,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=re(),[t,n]=(0,W.useState)(()=>ne()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(ae().then(i),ie().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)I(!1),await se(),n(!1);else{let e=te();e&&await oe(e),I(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(k,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(k,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(O,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(w,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=x.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=V(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>y(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,d]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[S,C]=(0,W.useState)(!1),w=(0,W.useRef)(null),T=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(b(n.interactive).id),s(b(n.autonomous).id),d(b(n.headless).id),C(!0))},[n]),(0,W.useEffect)(()=>()=>{w.current!==null&&(clearTimeout(w.current),w.current=null,T.current?.(),T.current=null)},[]);let E=(0,W.useCallback)((n,r,i)=>{if(!e||!S)return;let a=x.find(e=>e.id===n)?.riskThreshold,o=x.find(e=>e.id===r)?.riskThreshold,s=x.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||v(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,S,t]),D=(0,W.useCallback)((e,t,n)=>{w.current!==null&&clearTimeout(w.current),T.current=()=>E(e,t,n),w.current=setTimeout(()=>{T.current?.(),w.current=null,T.current=null},500)},[E]),O=(0,W.useCallback)(e=>{_.current=!0,a(e),D(e,o,c)},[o,c,D]),k=(0,W.useCallback)(e=>{_.current=!0,s(e),D(i,e,c)},[i,c,D]),A=(0,W.useCallback)(e=>{_.current=!0,d(e),D(i,o,e)},[i,o,D]),j=x.find(e=>e.id===i),N=x.find(e=>e.id===o),P=x.find(e=>e.id===c),F=!e||!S;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:i,onChange:O,options:Y,disabled:F})}),j&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:j.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:o,onChange:k,options:Y,disabled:F})}),N&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:N.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:c,onChange:A,options:Y,disabled:F})}),P&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:P.description})]})]})]})]})]})}var X=e(s(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await z(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(T,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(E,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(M,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let v=(0,W.useCallback)(async()=>{if(f)try{await ge(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(k,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(E,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(C,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(D,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(S,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(w,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(j,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=V(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(C,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=L({platformHostedOnly:!0}),t=F(),n=t,a=N.use.user()?.id??null,[o]=fe(),[s]=pe(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:ce(le.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{P(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{P(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(M,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We as PrivacyPage};
|