@vellumai/web 0.10.7-dev.202607100313.fffdfea → 0.10.7-dev.202607100720.fba456e
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/{account-page-Ce-pbLMJ.js → account-page-Li0uLmLs.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-T0GBDg-W.js → acp-run-detail-panel-C0yvGSks.js} +1 -1
- package/dist/assets/{activity-steps-panel-BXXeXc19.js → activity-steps-panel-OLcpKG_k.js} +1 -1
- package/dist/assets/{advanced-page-C8Ib_u5F.js → advanced-page-CVO_Q3kI.js} +1 -1
- package/dist/assets/{ai-page-BezzLmVq.js → ai-page-C1h5NlKw.js} +1 -1
- package/dist/assets/{animated-avatar-DDpjZzRx.js → animated-avatar-CrlodWQr.js} +1 -1
- package/dist/assets/{api-Zs5JMgKY.js → api-CYdUmFnA.js} +1 -1
- package/dist/assets/{api-key-screen-B_g5hH5v.js → api-key-screen-BIMt5wXC.js} +1 -1
- package/dist/assets/{archive-page-rl2uRUik.js → archive-page-QDAZt1bN.js} +1 -1
- package/dist/assets/{assistant-status-panel-DPwgE1TF.js → assistant-status-panel-DbbksK3-.js} +1 -1
- package/dist/assets/{auth-store-CKsDsnkp.js → auth-store-CVs0OdtO.js} +1 -1
- package/dist/assets/{background-task-detail-panel-3xiHMnCC.js → background-task-detail-panel-Dvg9X_dS.js} +1 -1
- package/dist/assets/{billing-page-D-gIsav0.js → billing-page-ojEsvt_X.js} +1 -1
- package/dist/assets/{bookmarks-page-giPayf1N.js → bookmarks-page-D7myoNlj.js} +1 -1
- package/dist/assets/{build-state-BLXpH8o6.js → build-state-BOU11GPr.js} +1 -1
- package/dist/assets/{channels-page-route-DAZ5e9vo.js → channels-page-route-DGd6PLjm.js} +1 -1
- package/dist/assets/{chat-markdown-message-BuypfAkx.js → chat-markdown-message-CItp7csw.js} +1 -1
- package/dist/assets/{command-palette-C0XZVlzp.js → command-palette-BvwNadPb.js} +1 -1
- package/dist/assets/{command-palette-window-page-CxIvQGwt.js → command-palette-window-page-DMnQ_aD6.js} +1 -1
- package/dist/assets/{community-page-CwSloAl0.js → community-page-CMyh79_4.js} +1 -1
- package/dist/assets/{contacts-page-route-CBqOhX8s.js → contacts-page-route-CxCzPa-M.js} +1 -1
- package/dist/assets/{conversation-list-fetchers-tE99dnUJ.js → conversation-list-fetchers-DS9vmqfD.js} +1 -1
- package/dist/assets/{credentials-page-Bd-E5j_2.js → credentials-page-Bay5GYZG.js} +1 -1
- package/dist/assets/{debug-page-CU0jo5tG.js → debug-page-DNYNb8g1.js} +1 -1
- package/dist/assets/{deploy-dialogs-8TBhlLXZ.js → deploy-dialogs-D9ogAwUI.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-B0utUgSr.js → detail-panel-stop-button-CRcHovlo.js} +1 -1
- package/dist/assets/{developer-page-Da1bdSPK.js → developer-page-GiubU02W.js} +1 -1
- package/dist/assets/{devices-page-DC9det1s.js → devices-page-DSmfGWDc.js} +1 -1
- package/dist/assets/{dictation-overlay-page-6l-KJCrE.js → dictation-overlay-page-DJcRyCby.js} +1 -1
- package/dist/assets/{document-viewer-page-djjsg4WE.js → document-viewer-page-CNpSIR5q.js} +1 -1
- package/dist/assets/{earn-credits-modal-B4iirPUC.js → earn-credits-modal-B6EL9KHM.js} +1 -1
- package/dist/assets/{emails-page-RItjmMG5.js → emails-page-DAbdjEcM.js} +1 -1
- package/dist/assets/{general-page-BtAuGqFM.js → general-page-In-O5z14.js} +1 -1
- package/dist/assets/{hatching-screen-C71v2Kqp.js → hatching-screen-1Ib1UsQ8.js} +1 -1
- package/dist/assets/{home-page-route-DxKq7gEn.js → home-page-route-Bx4xkQr4.js} +1 -1
- package/dist/assets/{hosting-screen-DBN9hO0s.js → hosting-screen-Ce4JiQ9J.js} +1 -1
- package/dist/assets/{identity-page-route-Ck1TCmSd.js → identity-page-route-CDdf-0ZX.js} +1 -1
- package/dist/assets/index-BYfTlch9.js +113 -0
- package/dist/assets/index-BjtwYdrT.css +2 -0
- package/dist/assets/{inspect-page-BuriU_iU.js → inspect-page-Dmsojyx2.js} +1 -1
- package/dist/assets/{integrations-page-N-I7F_JQ.js → integrations-page-npAbqYD4.js} +1 -1
- package/dist/assets/{intelligence-layout-C_H2Uec7.js → intelligence-layout-B354MRxu.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-B2ozF8zY.js → keyboard-shortcuts-page-BTszfF5y.js} +1 -1
- package/dist/assets/{library-detail-page-BKj7gWNL.js → library-detail-page-Be9DFLXt.js} +1 -1
- package/dist/assets/{library-page-BJljT3MY.js → library-page-JA-4LBMj.js} +1 -1
- package/dist/assets/{login-flow-C4Ehxg-g.js → login-flow-v02gDpa1.js} +1 -1
- package/dist/assets/{login-page-CZBdlVje.js → login-page-BgsuEo8T.js} +1 -1
- package/dist/assets/{logout-page-BryU7bK_.js → logout-page-DQGYrYot.js} +1 -1
- package/dist/assets/{logs-layout-nPLZjXX5.js → logs-layout-tD5gXnKs.js} +1 -1
- package/dist/assets/{memory-router-playground-page-qIG7U97D.js → memory-router-playground-page-CnQYMmVa.js} +1 -1
- package/dist/assets/{messages-DF7pzUR8.js → messages-Bl6a3LUN.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-DpvWGGSA.js → mobile-sidebar-drawer-dvuldt8a.js} +1 -1
- package/dist/assets/{notifications-page-DBlKmak1.js → notifications-page-D0DqTrSh.js} +1 -1
- package/dist/assets/{oauth-complete-page-D8aQ3tJ_.js → oauth-complete-page-DC4_JCQY.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-CXXZdxWJ.js → oauth-popup-complete-page-Bik6u419.js} +1 -1
- package/dist/assets/{pairing-page-b1uNitAm.js → pairing-page-gcO-QeQH.js} +1 -1
- package/dist/assets/{platform-loopback-page-hCZEK9-q.js → platform-loopback-page-BIC5R_2A.js} +1 -1
- package/dist/assets/{plugins-page-C0TtdwgQ.js → plugins-page-BHEtI3Gk.js} +1 -1
- package/dist/assets/{prechat-route-CnIcxqAR.js → prechat-route-DhtyT72h.js} +1 -1
- package/dist/assets/{prefs-hu4Ft3Gc.js → prefs-CTRDnnnS.js} +1 -1
- package/dist/assets/{privacy-page-PFWKww1A.js → privacy-page-DMURyayZ.js} +1 -1
- package/dist/assets/{privacy-screen-DSr2ddPX.js → privacy-screen-DuaVQ6IQ.js} +1 -1
- package/dist/assets/{provider-callback-page-CVVL9mxY.js → provider-callback-page-DgFANe_f.js} +1 -1
- package/dist/assets/{provider-key-B9HxajGj.js → provider-key-DBiHV_K5.js} +1 -1
- package/dist/assets/{provider-signup-page-BBqT_sHe.js → provider-signup-page-BDMHfIcI.js} +1 -1
- package/dist/assets/{quick-input-page-CLwquN93.js → quick-input-page-C0Rse0qs.js} +1 -1
- package/dist/assets/react-query.gen-C6wVk6Rw.js +1 -0
- package/dist/assets/{research-mock-page-DeBKxHSz.js → research-mock-page-D_m36Jy6.js} +1 -1
- package/dist/assets/{research-onboarding-route-2nc0yKsq.js → research-onboarding-route-CEC2x5kn.js} +1 -1
- package/dist/assets/{review-terms-screen-QliTExQL.js → review-terms-screen-DdZD1jqm.js} +1 -1
- package/dist/assets/{risk-jKF7qGwV.js → risk-Dsj4oM8c.js} +1 -1
- package/dist/assets/{schedules-CQO3UwTc.js → schedules-Dj3YQqG5.js} +1 -1
- package/dist/assets/{sdk.gen-jDeNbBv8.js → sdk.gen-BwnFjFcp.js} +1 -1
- package/dist/assets/{security-page-CQfQh2wW.js → security-page-CIC8qXj0.js} +1 -1
- package/dist/assets/{select-assistant-screen-BsGcZIsZ.js → select-assistant-screen-Cd8srvtb.js} +1 -1
- package/dist/assets/{settings-layout-hvCEbqwx.js → settings-layout-VEkpa1PW.js} +1 -1
- package/dist/assets/{share-feedback-modal-BFxBtlP7.js → share-feedback-modal-BEFlSqbK.js} +1 -1
- package/dist/assets/{sidebar-tree-BaU6dAAM.js → sidebar-tree-FcJ6pHEw.js} +1 -1
- package/dist/assets/{signup-page-COVsB50a.js → signup-page-CEqH6BRM.js} +1 -1
- package/dist/assets/{site-favicon-D9Rp1QPZ.js → site-favicon-DSzk4cg0.js} +1 -1
- package/dist/assets/{skill-detail-page-D5UAAUmZ.js → skill-detail-page-CSR6eBxk.js} +1 -1
- package/dist/assets/{skill-detail-panel-DIoN-AUc.js → skill-detail-panel-DedH9GLd.js} +1 -1
- package/dist/assets/{skills-C9wbjXsQ.js → skills-CSlvOB79.js} +1 -1
- package/dist/assets/{skills-page-DhUitBj9.js → skills-page-irwMop0O.js} +1 -1
- package/dist/assets/{sound-manager-CSAwT8Vm.js → sound-manager-6UbdgQrj.js} +1 -1
- package/dist/assets/{sounds-page-DeBeDlcY.js → sounds-page-b0kjLtBm.js} +1 -1
- package/dist/assets/{subagent-detail-panel-CF-VVQJA.js → subagent-detail-panel-CTulpbUd.js} +1 -1
- package/dist/assets/{subagent-store-C-pyGmFU.js → subagent-store-D-9RtoyJ.js} +1 -1
- package/dist/assets/{system-events-page-CYqUpGpC.js → system-events-page-DrQWpC2D.js} +1 -1
- package/dist/assets/{tiptap-document-editor-aGPkbqbr.js → tiptap-document-editor-Af0WPHxQ.js} +1 -1
- package/dist/assets/{tool-detail-panel-CzkNK-ue.js → tool-detail-panel-G01JjAPo.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-BytvxNqQ.js → upgrade-cancel-page-cJyqnC7O.js} +1 -1
- package/dist/assets/{upgrade-success-page-CeuBASa8.js → upgrade-success-page-C3__rlPJ.js} +1 -1
- package/dist/assets/{usage-page-CI7scN-b.js → usage-page-BIGDjU_J.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-U9h8O8rp.js → use-edge-swipe-back-DcQxnpRK.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-JL5Jevln.js → use-invite-link-dialog-C_z3cWhR.js} +1 -1
- package/dist/assets/use-is-org-ready-B7B3xHAy.js +1 -0
- package/dist/assets/{use-onboarding-login-CP7O8ZzB.js → use-onboarding-login-XjtnziWG.js} +1 -1
- package/dist/assets/{use-skill-actions-BKfLB9Oe.js → use-skill-actions-BFrx1e4G.js} +1 -1
- package/dist/assets/{use-skill-categories-8DmU61Hs.js → use-skill-categories-7ngHJrBv.js} +1 -1
- package/dist/assets/{use-skill-detail-files-DmLQiG5u.js → use-skill-detail-files-qblcXTbq.js} +1 -1
- package/dist/assets/{viewer-store-SsoxBypb.js → viewer-store-B8-Qnbx9.js} +1 -1
- package/dist/assets/{voice-page-DX8ma3dY.js → voice-page-BVGxL6rD.js} +1 -1
- package/dist/assets/{weather-forecast-display-hxrsJwFy.js → weather-forecast-display-Dd2Uyk7j.js} +1 -1
- package/dist/assets/{welcome-screen-Drx018g8.js → welcome-screen-Cyx9Mjus.js} +1 -1
- package/dist/assets/{workflow-detail-panel-n5adDCz2.js → workflow-detail-panel-xScksXY2.js} +1 -1
- package/dist/assets/{workflow-store-B_M196cU.js → workflow-store-BL2Hgm3R.js} +1 -1
- package/dist/assets/workspace-page-Bx3ihC2n.js +1 -0
- package/dist/index.html +21 -21
- package/package.json +1 -1
- package/dist/assets/index-DQjUULFO.js +0 -113
- package/dist/assets/index-z4S53sm1.css +0 -2
- package/dist/assets/react-query.gen-DOfazqkL.js +0 -1
- package/dist/assets/use-is-org-ready-BP6_0L-A.js +0 -1
- package/dist/assets/workspace-page-CYDMc7C-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{M as t,N as n,O as r,c as i,i as a,j as o,k as s,m as c,n as l,o as u,r as d,s as f,t as p}from"./native-biometric-Czaf9IqI.js";import{t as m}from"./react-DJZBPgpf.js";import{F as h,t as g}from"./button-amTXFI-2.js";import{n as _}from"./QueryClientProvider-DKhXIxGb.js";import{t as v}from"./useQuery-B45lW1Kk.js";import{t as y}from"./useMutation-Lj4VunQV.js";import{t as b}from"./jsx-runtime-CVSDxk6A.js";import{t as x}from"./cn-C36Yvcac.js";import{t as S}from"./card-Bv5O5juh.js";import{t as ee}from"./chevron-down-qD-re7AW.js";import{t as te}from"./chevron-right-DqqmezXC.js";import{t as C}from"./loader-circle-Cz7opInR.js";import{t as w}from"./pencil-CUIr0IFo.js";import{t as T}from"./x-CkSVp1Ok.js";import{t as E}from"./notice-DkcNAP8O.js";import{t as D}from"./tag-CV4v7fRF.js";import{t as O}from"./input-CoUmPnRU.js";import{t as k}from"./toggle-CDfguvUz.js";import{n as A}from"./toast-xTp-xwYL.js";import{t as ne}from"./confirm-dialog-CSkhRFRk.js";import{t as j}from"./dropdown-ByHOpeOU.js";import{f as M,n as re,r as ie}from"./auth-store-CKsDsnkp.js";import{t as N}from"./sdk.gen-CmKfVpgB.js";import{c as P,s as ae}from"./routes-BbeIx_F9.js";import{n as oe,t as se}from"./react-query.gen-DPzPS206.js";import{B as ce,D as le,Fn as ue,H as de,Hr as fe,In as pe,Ln as me,Oi as F,S as I,Ur as L,V as R,Wr as z,b as B,kn as he,x as ge,y as V,yi as _e}from"./index-DQjUULFO.js";import{t as H}from"./use-active-assistant-id-BNRMo_Mi.js";import{t as U}from"./detail-card-RGTjHkZ8.js";import{t as W}from"./setting-row-QKgqbQ4U.js";var G=e(m(),1),K=b(),q=[{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.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,t]=(0,G.useState)(()=>r(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>n(`dockBadgesEnabled`,()=>{t(r(`dockBadgesEnabled`,!0))}),[]),[e,e=>{t(e),o(`dockBadgesEnabled`,e),e||he(0)}]}function J({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:x(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,K.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 Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=me(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.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=ve.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 ue(e.sourceKind):await pe(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,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(xe,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(J,{row:e,onToggle:p},e.id))}),r&&(0,K.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 Ce(){let e=z({platformHostedOnly:!0}),t=fe(),n=L(),r=_(),{data:i,isLoading:a,isError:o}=v({...se(),enabled:e===`full`&&t}),s=y({mutationFn:async e=>{let{data:t}=await N({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{oe(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,l=i?.access_consented??!1,u=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.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,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(k,{checked:l,disabled:u,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,K.jsx)(le,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=c(),[t,n]=(0,G.useState)(()=>a()),[r,o]=(0,G.useState)(!1),[s,m]=(0,G.useState)(`Face ID`),[h,g]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(d().then(o),l().then(m))},[e]),!e||!r)return null;let _=async()=>{g(!0);try{if(t)u(!1),await p(),n(!1);else{let e=i();e&&await f(e),u(!0),n(!0)}}finally{g(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,s,` for sign-in`]}),(0,K.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,s,` or your device passcode instead of signing in again.`]})]}),(0,K.jsx)(k,{checked:t,onChange:()=>void _(),disabled:h})]})})}function Y(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=V.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=H(),t=_(),{data:n,isError:r}=v({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,l]=(0,G.useState)(`strict`),[u,d]=(0,G.useState)(!1),f=(0,G.useRef)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||f.current||(a(B(n.interactive).id),s(B(n.autonomous).id),l(B(n.headless).id),m(!0))},[n]),(0,G.useEffect)(()=>()=>{h.current!==null&&(clearTimeout(h.current),h.current=null,g.current?.(),g.current=null)},[]);let y=(0,G.useCallback)((n,r,i)=>{if(!e||!p)return;let a=V.find(e=>e.id===n)?.riskThreshold,o=V.find(e=>e.id===r)?.riskThreshold,s=V.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,p,t]),b=(0,G.useCallback)((e,t,n)=>{h.current!==null&&clearTimeout(h.current),g.current=()=>y(e,t,n),h.current=setTimeout(()=>{g.current?.(),h.current=null,g.current=null},500)},[y]),x=(0,G.useCallback)(e=>{f.current=!0,a(e),b(e,o,c)},[o,c,b]),C=(0,G.useCallback)(e=>{f.current=!0,s(e),b(i,e,c)},[i,c,b]),w=(0,G.useCallback)(e=>{f.current=!0,l(e),b(i,o,e)},[i,o,b]),T=V.find(e=>e.id===i),E=V.find(e=>e.id===o),D=V.find(e=>e.id===c),O=!e||!p;return(0,K.jsxs)(S,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,K.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,K.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,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:i,onChange:x,options:X,disabled:O})}),T&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:T.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":u,children:[u?(0,K.jsx)(ee,{className:`h-4 w-4`}):(0,K.jsx)(te,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:u?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.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,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:o,onChange:C,options:X,disabled:O})}),E&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:E.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:c,onChange:w,options:X,disabled:O})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]})]})]})]})]})}var Z=e(h(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{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 Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,G.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await de(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,Z.createPortal)((0,K.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,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.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,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.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,K.jsx)(E,{tone:`error`,children:h}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(j,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,K.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,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.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,K.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 ke(e){return e.origin===`default`&&!e.userModified}function Ae(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 je(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 Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([R(e),R(e,{origin:`default`})]);return Ae(t,n)}return R(e)},[e]),_=(0,G.useCallback)(async()=>{o(!0);try{i(await h(p)),c(null)}catch(e){c(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[h,p]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await h(p);e||(i(t),c(null))}catch(t){e||c(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[h,p]);let v=(0,G.useCallback)(async()=>{if(d)try{await ce(e,d.id),_()}catch(e){c(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{f(null)}},[e,d,_]);return(0,Z.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.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,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(k,{checked:p,onChange:m,label:`Show all defaults`}),(0,K.jsx)(g,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(E,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(F,{className:`h-8 w-8`}),(0,K.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,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(D,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>u(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,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>f(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(_e,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),l&&(0,K.jsx)(Oe,{assistantId:e,existingRule:l,onClose:()=>u(null),onSaved:()=>{u(null),_()}}),(0,K.jsx)(ne,{open:d!==null,title:`Delete Trust Rule?`,message:d?`Remove the ${Q(d.risk).toLowerCase()}-risk rule for ${d.tool} matching "${d.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>f(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(S,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(F,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.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,K.jsx)(g,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{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`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=z({platformHostedOnly:!0}),n=ie(),i=n,a=re.use.user()?.id??null,[o,c]=(0,G.useState)(()=>r(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>r(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>s(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(we,{}),(0,K.jsx)(Se,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Te,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:n?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:ae(P.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:o,onChange:()=>{let e=!o;c(e),M(`share_analytics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),M(`share_diagnostics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(Ce,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:d,onChange:e=>{f(e),t(`llmLogRetention`,e)},options:Pe})}),(0,K.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{Ie as PrivacyPage};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{M as t,N as n,O as r,c as i,i as a,j as o,k as s,m as c,n as l,o as u,r as d,s as f,t as p}from"./native-biometric-Czaf9IqI.js";import{t as m}from"./react-DJZBPgpf.js";import{F as h,t as g}from"./button-amTXFI-2.js";import{n as _}from"./QueryClientProvider-DKhXIxGb.js";import{t as v}from"./useQuery-B45lW1Kk.js";import{t as y}from"./useMutation-Lj4VunQV.js";import{t as b}from"./jsx-runtime-CVSDxk6A.js";import{t as x}from"./cn-C36Yvcac.js";import{t as S}from"./card-Bv5O5juh.js";import{t as ee}from"./chevron-down-qD-re7AW.js";import{t as te}from"./chevron-right-DqqmezXC.js";import{t as C}from"./loader-circle-Cz7opInR.js";import{t as w}from"./pencil-CUIr0IFo.js";import{t as T}from"./x-CkSVp1Ok.js";import{t as E}from"./notice-DkcNAP8O.js";import{t as D}from"./tag-CV4v7fRF.js";import{t as O}from"./input-CoUmPnRU.js";import{t as k}from"./toggle-CDfguvUz.js";import{n as A}from"./toast-xTp-xwYL.js";import{t as ne}from"./confirm-dialog-CSkhRFRk.js";import{t as j}from"./dropdown-ByHOpeOU.js";import{f as M,n as re,r as ie}from"./auth-store-CVs0OdtO.js";import{t as N}from"./sdk.gen-CmKfVpgB.js";import{c as P,s as ae}from"./routes-BbeIx_F9.js";import{n as oe,t as se}from"./react-query.gen-DPzPS206.js";import{B as ce,D as le,Fn as ue,H as de,Hr as fe,In as pe,Ln as me,Oi as F,S as I,Ur as L,V as R,Wr as z,b as B,kn as he,x as ge,y as V,yi as _e}from"./index-BYfTlch9.js";import{t as H}from"./use-active-assistant-id-BNRMo_Mi.js";import{t as U}from"./detail-card-RGTjHkZ8.js";import{t as W}from"./setting-row-QKgqbQ4U.js";var G=e(m(),1),K=b(),q=[{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.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,t]=(0,G.useState)(()=>r(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>n(`dockBadgesEnabled`,()=>{t(r(`dockBadgesEnabled`,!0))}),[]),[e,e=>{t(e),o(`dockBadgesEnabled`,e),e||he(0)}]}function J({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:x(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,K.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 Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=me(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.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=ve.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 ue(e.sourceKind):await pe(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,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(xe,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(J,{row:e,onToggle:p},e.id))}),r&&(0,K.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 Ce(){let e=z({platformHostedOnly:!0}),t=fe(),n=L(),r=_(),{data:i,isLoading:a,isError:o}=v({...se(),enabled:e===`full`&&t}),s=y({mutationFn:async e=>{let{data:t}=await N({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{oe(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,l=i?.access_consented??!1,u=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.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,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(k,{checked:l,disabled:u,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,K.jsx)(le,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=c(),[t,n]=(0,G.useState)(()=>a()),[r,o]=(0,G.useState)(!1),[s,m]=(0,G.useState)(`Face ID`),[h,g]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(d().then(o),l().then(m))},[e]),!e||!r)return null;let _=async()=>{g(!0);try{if(t)u(!1),await p(),n(!1);else{let e=i();e&&await f(e),u(!0),n(!0)}}finally{g(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,s,` for sign-in`]}),(0,K.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,s,` or your device passcode instead of signing in again.`]})]}),(0,K.jsx)(k,{checked:t,onChange:()=>void _(),disabled:h})]})})}function Y(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=V.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=H(),t=_(),{data:n,isError:r}=v({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,l]=(0,G.useState)(`strict`),[u,d]=(0,G.useState)(!1),f=(0,G.useRef)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||f.current||(a(B(n.interactive).id),s(B(n.autonomous).id),l(B(n.headless).id),m(!0))},[n]),(0,G.useEffect)(()=>()=>{h.current!==null&&(clearTimeout(h.current),h.current=null,g.current?.(),g.current=null)},[]);let y=(0,G.useCallback)((n,r,i)=>{if(!e||!p)return;let a=V.find(e=>e.id===n)?.riskThreshold,o=V.find(e=>e.id===r)?.riskThreshold,s=V.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,p,t]),b=(0,G.useCallback)((e,t,n)=>{h.current!==null&&clearTimeout(h.current),g.current=()=>y(e,t,n),h.current=setTimeout(()=>{g.current?.(),h.current=null,g.current=null},500)},[y]),x=(0,G.useCallback)(e=>{f.current=!0,a(e),b(e,o,c)},[o,c,b]),C=(0,G.useCallback)(e=>{f.current=!0,s(e),b(i,e,c)},[i,c,b]),w=(0,G.useCallback)(e=>{f.current=!0,l(e),b(i,o,e)},[i,o,b]),T=V.find(e=>e.id===i),E=V.find(e=>e.id===o),D=V.find(e=>e.id===c),O=!e||!p;return(0,K.jsxs)(S,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,K.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,K.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,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:i,onChange:x,options:X,disabled:O})}),T&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:T.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":u,children:[u?(0,K.jsx)(ee,{className:`h-4 w-4`}):(0,K.jsx)(te,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:u?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.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,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:o,onChange:C,options:X,disabled:O})}),E&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:E.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:c,onChange:w,options:X,disabled:O})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]})]})]})]})]})}var Z=e(h(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{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 Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,G.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await de(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,Z.createPortal)((0,K.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,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.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,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.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,K.jsx)(E,{tone:`error`,children:h}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(j,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,K.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,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.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,K.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 ke(e){return e.origin===`default`&&!e.userModified}function Ae(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 je(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 Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([R(e),R(e,{origin:`default`})]);return Ae(t,n)}return R(e)},[e]),_=(0,G.useCallback)(async()=>{o(!0);try{i(await h(p)),c(null)}catch(e){c(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[h,p]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await h(p);e||(i(t),c(null))}catch(t){e||c(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[h,p]);let v=(0,G.useCallback)(async()=>{if(d)try{await ce(e,d.id),_()}catch(e){c(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{f(null)}},[e,d,_]);return(0,Z.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.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,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(k,{checked:p,onChange:m,label:`Show all defaults`}),(0,K.jsx)(g,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(E,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(F,{className:`h-8 w-8`}),(0,K.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,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(D,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>u(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,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>f(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(_e,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),l&&(0,K.jsx)(Oe,{assistantId:e,existingRule:l,onClose:()=>u(null),onSaved:()=>{u(null),_()}}),(0,K.jsx)(ne,{open:d!==null,title:`Delete Trust Rule?`,message:d?`Remove the ${Q(d.risk).toLowerCase()}-risk rule for ${d.tool} matching "${d.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>f(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(S,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(F,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.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,K.jsx)(g,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{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`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=z({platformHostedOnly:!0}),n=ie(),i=n,a=re.use.user()?.id??null,[o,c]=(0,G.useState)(()=>r(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>r(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>s(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(we,{}),(0,K.jsx)(Se,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Te,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:n?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:ae(P.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:o,onChange:()=>{let e=!o;c(e),M(`share_analytics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),M(`share_diagnostics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(Ce,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:d,onChange:e=>{f(e),t(`llmLogRetention`,e)},options:Pe})}),(0,K.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{Ie as PrivacyPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s}from"./local-mode-grqHUoNh.js";import{t as c}from"./is-electron-y5bNUVyG.js";import{d as l,i as u,n as d}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s}from"./local-mode-grqHUoNh.js";import{t as c}from"./is-electron-y5bNUVyG.js";import{d as l,i as u,n as d}from"./auth-store-CVs0OdtO.js";import{c as f}from"./routes-BbeIx_F9.js";import{d as p,f as m,p as h,u as g}from"./prefs-CTRDnnnS.js";import{t as _}from"./client-feature-flag-store-C0g8zi1W.js";import{_t as v,bt as y,ft as b,ht as x,rn as S,vt as C}from"./index-BYfTlch9.js";import{t as w}from"./step-indicator-dots-Cou0-IgA.js";import{n as T,t as E}from"./consent-controls-BZMxm0n3.js";var D=e(n(),1);function O({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var k=o();function A(){let e=i(),[n]=a(),o=d.use.user()?.id??null,A=c(),j=t(),M=C(_.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[N,P]=p(),[F,I]=m(),[L,R]=h(),[z,B]=g(),V=u();(0,D.useEffect)(()=>{j||v()},[j]);let H=n.get(`preview`)===`true`,U=(0,D.useCallback)(e=>{},[]),W=H?U:P,G=H?U:I,K=H?U:R,q=H?U:B,J=(0,D.useCallback)(()=>{if(H){e(`${f.onboarding.prechat}?preview=true`);return}if(l({userId:o,tos:L,privacy:z,shareAnalytics:N,shareDiagnostics:F,hasPlatformSession:V}),!j){let e=y(M);x(b.privacyTos,{userId:o,variant:e})}let t=n.get(`hosting`),r=new URLSearchParams;t&&r.set(`hosting`,t);let i=r.toString();e(`${O({isNative:j,isLocalHatch:s()&&t!==null&&t!==`vellum-cloud`})}${i?`?${i}`:``}`)},[z,V,j,H,e,M,n,N,F,L,o]);return(0,k.jsx)(S,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:N,shareDiagnostics:F,onShareAnalyticsChange:W,onShareDiagnosticsChange:G,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:z,tosAccepted:L,onPrivacyChange:q,onTosChange:K,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!L||!z,onClick:J,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(r,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-CVVL9mxY.js → provider-callback-page-DgFANe_f.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{S as t,_ as n}from"./native-biometric-Czaf9IqI.js";import{t as r}from"./capture-error-Dhiismgm.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{p as l,w as u}from"./local-mode-grqHUoNh.js";import{D as d,n as f}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{S as t,_ as n}from"./native-biometric-Czaf9IqI.js";import{t as r}from"./capture-error-Dhiismgm.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{p as l,w as u}from"./local-mode-grqHUoNh.js";import{D as d,n as f}from"./auth-store-CVs0OdtO.js";import{c as p}from"./api-CYdUmFnA.js";import{c as m}from"./routes-BbeIx_F9.js";import{a as h,i as g}from"./login-flow-v02gDpa1.js";import{n as _}from"./index-BYfTlch9.js";import{r as v,t as y}from"./account-shell-74OchOxg.js";var b=e(i(),1),x=c();function S(){let[e]=o(),i=a(),c=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let r=await t(),a=n(r.ok&&!!r.data.user,r.ok?[]:r.flows??[]);switch(a.kind){case`authenticated`:{if(await c(),l())try{let e=await p();if(e.ok&&e.data.length>0&&(await u(e.data,d.getState().currentOrganizationId??void 0),!E)){i(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:n}=h({returnTo:E,fallback:e,authIntent:D});n?window.location.href=t:i(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);i(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(a.message);break}}catch(e){r(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,c,E,i,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(s,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(s,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Wt as e,er as t,j as n,k as r}from"./sdk.gen-
|
|
1
|
+
import{Wt as e,er as t,j as n,k as r}from"./sdk.gen-BwnFjFcp.js";var i=[{id:`anthropic`,displayName:`Anthropic`,apiKeyPlaceholder:`sk-ant-api03-...`,docsUrl:`https://console.anthropic.com/settings/keys`,requiresKey:!0,defaultModel:`claude-sonnet-4-6`},{id:`openai`,displayName:`OpenAI`,apiKeyPlaceholder:`sk-proj-...`,docsUrl:`https://platform.openai.com/api-keys`,requiresKey:!0,defaultModel:`gpt-5.4-mini`},{id:`gemini`,displayName:`Google Gemini`,apiKeyPlaceholder:`AIza...`,docsUrl:`https://aistudio.google.com/apikey`,requiresKey:!0,defaultModel:`gemini-3-flash-preview`},{id:`ollama`,displayName:`Ollama`,apiKeyPlaceholder:null,docsUrl:`https://ollama.com/download`,requiresKey:!1,defaultModel:`llama3.2`,models:[{id:`llama3.2`,displayName:`Llama 3.2`,contextWindowTokens:128e3,maxOutputTokens:4096},{id:`mistral`,displayName:`Mistral`,contextWindowTokens:32768,maxOutputTokens:4096}]},{id:`fireworks`,displayName:`Fireworks`,apiKeyPlaceholder:`fw_...`,docsUrl:`https://fireworks.ai/account/api-keys`,requiresKey:!0,defaultModel:`accounts/fireworks/models/minimax-m3`},{id:`openrouter`,displayName:`OpenRouter`,apiKeyPlaceholder:`sk-or-v1-...`,docsUrl:`https://openrouter.ai/keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`x-ai/grok-4.20`,displayName:`Grok 4.20`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-r1-0528`,displayName:`DeepSeek R1`,contextWindowTokens:163840,maxOutputTokens:32e3}]},{id:`vercel-ai-gateway`,displayName:`Vercel AI Gateway`,apiKeyPlaceholder:`vck_...`,docsUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys&title=AI+Gateway+API+Keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`xai/grok-4.3`,displayName:`Grok 4.3`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-v4-flash`,displayName:`DeepSeek V4 Flash`,contextWindowTokens:2e5,maxOutputTokens:384e3}]},{id:`openai-compatible`,displayName:`OpenAI-compatible`,apiKeyPlaceholder:`Your provider's API key (optional)`,docsUrl:null,requiresKey:!0}],a=i[0];function o(e){return i.find(t=>t.id===e)}function s(e){let t=o(e);return t?.defaultModel??t?.models?.[0]?.id}var c=`onboarding.providerKey`,l=`custom-balanced`,u=2e5;function d(e){try{if(e===null){sessionStorage.removeItem(c);return}sessionStorage.setItem(c,JSON.stringify(e))}catch{}}function f(e){return typeof e==`object`&&!!e&&`provider`in e&&typeof e.provider==`string`&&`key`in e&&typeof e.key==`string`&&(!(`model`in e)||typeof e.model==`string`)&&(!(`baseUrl`in e)||typeof e.baseUrl==`string`)&&(!(`customModels`in e)||typeof e.customModels==`string`)}function p(){try{let e=sessionStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);return f(t)?t:null}catch{return null}}function m(){let e=p();try{sessionStorage.removeItem(c)}catch{}return e}async function h(e,n,r){let{response:i}=await t({path:{assistant_id:e},body:{type:`api_key`,name:n,value:r},throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to write provider secret`),{status:i?.status})}async function g(t,n,r,i){let a=n===`openai-compatible`,o=r||a?{type:`api_key`,credential:`credential/${n}/api_key`}:{type:`none`},s=a&&i?.baseUrl?i.baseUrl:void 0,c=a&&i?.customModels?i.customModels.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):void 0,{response:l}=await e({path:{assistant_id:t},body:{name:n,provider:n,auth:o,...s===void 0?{}:{base_url:s},...c===void 0?{}:{models:c}},throwOnError:!1});if(!l?.ok&&l?.status!==409)throw Object.assign(Error(`Failed to create provider connection`),{status:l?.status})}function _(e,t){let n=o(e)?.models?.find(e=>e.id===t),r={provider:e,model:t,provider_connection:e,source:`user`,label:`Balanced`,description:`Good balance of quality, cost, and speed`,maxTokens:n?.maxOutputTokens??16e3,contextWindow:{maxInputTokens:n?.contextWindowTokens??u}};return e===`ollama`?(r.effort=`none`,r.thinking={enabled:!1,streamThinking:!1}):(r.effort=`high`,r.thinking={enabled:!0,streamThinking:!0}),r}async function v(e,t,n){let{response:i}=await r({path:{assistant_id:e,name:l},body:_(t,n),throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to set provider profile`),{status:i?.status})}async function y(e){let{response:t}=await n({path:{assistant_id:e},body:{llm:{activeProfile:l}},throwOnError:!1});if(!t?.ok)throw Object.assign(Error(`Failed to activate provider profile`),{status:t?.status})}async function b(e){let t=m();if(!t)return;let n=t.key.trim(),r=n.length>0,i=t.provider===`openai-compatible`;(r||i)&&await h(e,t.provider,n),await g(e,t.provider,r,{baseUrl:t.baseUrl,customModels:t.customModels});let a=t.model?.trim(),o=t.customModels?.split(`,`).map(e=>e.trim()).find(e=>e),c=a||o||s(t.provider);c&&(await v(e,t.provider,c),await y(e))}export{i as a,a as i,p as n,s as o,d as r,o as s,b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{C as t,T as n,x as r}from"./native-biometric-Czaf9IqI.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{n as l}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{C as t,T as n,x as r}from"./native-biometric-Czaf9IqI.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{n as l}from"./auth-store-CVs0OdtO.js";import{c as u}from"./routes-BbeIx_F9.js";import{a as d,o as f}from"./login-flow-v02gDpa1.js";import{i as p,n as m,r as h,t as g}from"./account-shell-74OchOxg.js";import{t as _}from"./signup-shell-D4Afeijm.js";var v=e(i(),1),y=c();function b(){let e=a(),[i]=o(),c=l.use.refreshSession(),b=i.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await r();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let r=await n({email:x,username:C});if(!r.ok){if(t(r)){await c();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(r.errors[0]?.message??`Failed to complete signup.`);return}await c();let i=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});i.requiresFullPageNavigation?window.location.href=i.destination:e(i.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(s,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-Di3QykUd.js";import{Aa as a}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-Di3QykUd.js";import{Aa as a}from"./index-BYfTlch9.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:i(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:i(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(a,{size:16})})]})})}export{u as QuickInputPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./useMutation-Lj4VunQV.js";import{t}from"./queryOptions-BtNi-_9H.js";import{t as n}from"./infiniteQueryOptions-C6p49ZmI.js";import{$n as r,A as i,At as a,Bn as ee,C as te,Cn as ne,Cr as re,D as ie,Dn as ae,Dt as oe,E as se,En as ce,Et as le,F as o,Fr as ue,Ft as de,Gt as fe,Hn as pe,I as me,In as he,Ir as ge,Jt as _e,L as ve,Ln as ye,Lt as be,Mt as s,N as xe,Nr as Se,O as Ce,On as we,P as Te,Pn as Ee,R as De,Sn as Oe,Sr as ke,T as Ae,Tn as je,Tt as Me,Un as c,Ut as Ne,W as Pe,ar as Fe,br as Ie,dn as Le,dr as l,fr as u,ir as d,j as f,jn as p,jt as m,kt as h,ln as g,lr as Re,nr as ze,o as Be,on as Ve,or as He,ot as Ue,pr as We,qt as Ge,rr as Ke,sn as qe,sr as Je,st as Ye,un as Xe,ur as Ze,ut as Qe,w as $e,wn as et,wr as tt,wt as nt,x as rt,xn as it,xt as at,zn as ot}from"./sdk.gen-BwnFjFcp.js";var _=(e,t,n,r)=>{let i={_id:e,baseUrl:t?.baseUrl||(t?.client??ge).getConfig().baseUrl};return n&&(i._infinite=n),r&&(i.tags=r),t?.body&&(i.body=t.body),t?.headers&&(i.headers=t.headers),t?.path&&(i.path=t.path),t?.query&&(i.query=t.query),[i]},v=e=>_(`appsGet`,e),st=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Be({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:v(e)}),y=e=>_(`bookmarksGet`,e),ct=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await rt({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:y(e)}),lt=e=>_(`channelsAvailableGet`,e),ut=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await te({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:lt(e)}),b=e=>_(`channelsReadinessGet`,e),dt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await $e({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:b(e)}),x=e=>_(`configGet`,e),S=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ae({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:x(e)}),ft=(e,t,n)=>e.setQueryData(S(t).queryKey,n),pt=e=>({mutationFn:async t=>{let{data:n}=await f({...e,...t,throwOnError:!0});return n}}),mt=t=>e({...pt(),...t}),ht=e=>_(`configLlmCallsitesGet`,e),gt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await se({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:ht(e)}),C=e=>_(`configLlmDefaultproviderGet`,e),_t=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ie({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:C(e)}),vt=e=>({mutationFn:async t=>{let{data:n}=await Ce({...e,...t,throwOnError:!0});return n}}),yt=e=>_(`configLlmProfilesGet`,e),bt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await i({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:yt(e)}),xt=e=>_(`consolidationConfigGet`,e),St=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await xe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:xt(e)}),Ct=e=>({mutationFn:async t=>{let{data:n}=await Te({...e,...t,throwOnError:!0});return n}}),wt=t=>e({...Ct(),...t}),Tt=e=>_(`consolidationRunsGet`,e),Et=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await o({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Tt(e)}),w=(e,t)=>{let n={...e[0]};return t.body&&(n.body={...e[0].body,...t.body}),t.headers&&(n.headers={...e[0].headers,...t.headers}),t.path&&(n.path={...e[0].path,...t.path}),t.query&&(n.query={...e[0].query,...t.query}),n},T=e=>_(`consolidationRunsGet`,e,!0),Dt=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=w(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await o({...e,...i,signal:r,throwOnError:!0});return a},queryKey:T(e)}),Ot=e=>({mutationFn:async t=>{let{data:n}=await me({...e,...t,throwOnError:!0});return n}}),kt=t=>e({...Ot(),...t}),E=e=>_(`contactsGet`,e),D=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ve({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:E(e)}),At=(e,t,n)=>e.setQueryData(D(t).queryKey,n),jt=e=>({mutationFn:async t=>{let{data:n}=await De({...e,...t,throwOnError:!0});return n}}),Mt=t=>e({...jt(),...t}),Nt=e=>_(`conversationstartersGet`,e),Pt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ue({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Nt(e)}),O=e=>_(`conversationsByIdGet`,e),Ft=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Pe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:O(e)}),It=e=>({mutationFn:async t=>{let{data:n}=await Ye({...e,...t,throwOnError:!0});return n}}),Lt=t=>e({...It(),...t}),Rt=e=>({mutationFn:async t=>{let{data:n}=await Qe({...e,...t,throwOnError:!0});return n}}),zt=t=>e({...Rt(),...t}),k=e=>_(`documentsGet`,e),Bt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await at({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:k(e)}),A=e=>_(`groupsGet`,e),j=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await le({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:A(e)}),Vt=(e,t,n)=>e.setQueryData(j(t).queryKey,n),Ht=e=>({mutationFn:async t=>{let{data:n}=await oe({...e,...t,throwOnError:!0});return n}}),Ut=t=>e({...Ht(),...t}),Wt=e=>({mutationFn:async t=>{let{data:n}=await nt({...e,...t,throwOnError:!0});return n}}),Gt=t=>e({...Wt(),...t}),M=e=>({mutationFn:async t=>{let{data:n}=await Me({...e,...t,throwOnError:!0});return n}}),Kt=t=>e({...M(),...t}),qt=e=>_(`heartbeatConfigGet`,e),N=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await h({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:qt(e)}),Jt=(e,t,n)=>e.setQueryData(N(t).queryKey,n),Yt=e=>({mutationFn:async t=>{let{data:n}=await a({...e,...t,throwOnError:!0});return n}}),Xt=t=>e({...Yt(),...t}),Zt=e=>({mutationFn:async t=>{let{data:n}=await m({...e,...t,throwOnError:!0});return n}}),Qt=t=>e({...Zt(),...t}),$t=e=>_(`heartbeatRunsGet`,e),en=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await s({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:$t(e)}),P=e=>_(`heartbeatRunsGet`,e,!0),tn=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=w(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await s({...e,...i,signal:r,throwOnError:!0});return a},queryKey:P(e)}),F=e=>_(`homeFeedGet`,e),nn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await de({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:F(e)}),rn=(e,t,n)=>e.setQueryData(nn(t).queryKey,n),I=e=>_(`homeStateGet`,e),an=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await be({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:I(e)}),on=e=>_(`identityGet`,e),L=e=>_(`inferenceProviderconnectionsGet`,e),sn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ne({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:L(e)}),cn=e=>({mutationFn:async t=>{let{data:n}=await fe({...e,...t,throwOnError:!0});return n}}),R=e=>_(`integrationsSlackChannelConfigGet`,e),ln=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ge({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:R(e)}),un=e=>({mutationFn:async t=>{let{data:n}=await _e({...e,...t,throwOnError:!0});return n}}),dn=e=>_(`memoryV2NowtextGet`,e),fn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ve({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:dn(e)}),pn=e=>_(`memoryV2RouterprompttemplateGet`,e),mn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await qe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:pn(e)}),hn=e=>({mutationFn:async t=>{let{data:n}=await g({...e,...t,throwOnError:!0});return n}}),gn=t=>e({...hn(),...t}),_n=e=>_(`memoryWorkerStatusGet`,e),z=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Xe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:_n(e)}),vn=(e,t,n)=>e.setQueryData(z(t).queryKey,n),yn=e=>({mutationFn:async t=>{let{data:n}=await Le({...e,...t,throwOnError:!0});return n}}),bn=t=>e({...yn(),...t}),B=e=>_(`oauthAppsGet`,e),xn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await et({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:B(e)}),Sn=e=>({mutationFn:async t=>{let{data:n}=await je({...e,...t,throwOnError:!0});return n}}),Cn=t=>e({...Sn(),...t}),wn=e=>({mutationFn:async t=>{let{data:n}=await it({...e,...t,throwOnError:!0});return n}}),Tn=t=>e({...wn(),...t}),V=e=>_(`oauthAppsByAppIdConnectionsGet`,e),En=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Oe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:V(e)}),Dn=e=>({mutationFn:async t=>{let{data:n}=await ne({...e,...t,throwOnError:!0});return n}}),On=t=>e({...Dn(),...t}),kn=e=>({mutationFn:async t=>{let{data:n}=await ce({...e,...t,throwOnError:!0});return n}}),An=t=>e({...kn(),...t}),jn=e=>_(`oauthProvidersGet`,e),Mn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await we({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:jn(e)}),Nn=e=>_(`oauthProvidersByProviderKeyGet`,e),Pn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ae({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Nn(e)}),Fn=e=>_(`pluginsGet`,e),In=e=>({mutationFn:async t=>{let{data:n}=await p({...e,...t,throwOnError:!0});return n}}),Ln=t=>e({...In(),...t}),H=e=>_(`pluginsByNameGet`,e),Rn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ee({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:H(e)}),U=e=>_(`pluginsByNameInspectGet`,e),zn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await he({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:U(e)}),Bn=e=>({mutationFn:async t=>{let{data:n}=await ye({...e,...t,throwOnError:!0});return n}}),Vn=t=>e({...Bn(),...t}),Hn=e=>({mutationFn:async t=>{let{data:n}=await ot({...e,...t,throwOnError:!0});return n}}),Un=t=>e({...Hn(),...t}),W=e=>_(`pluginsSearchGet`,e),Wn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ee({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:W(e)}),Gn=e=>_(`retrospectiveConfigGet`,e),Kn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await pe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Gn(e)}),qn=e=>_(`retrospectiveRunsGet`,e),Jn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await c({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:qn(e)}),G=e=>_(`retrospectiveRunsGet`,e,!0),Yn=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=w(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await c({...e,...i,signal:r,throwOnError:!0});return a},queryKey:G(e)}),Xn=e=>_(`schedulesGet`,e),Zn=e=>_(`schedulesByIdRunsGet`,e),K=e=>_(`secretsGet`,e),Qn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:i}=await r({...e,...t[0],signal:n,throwOnError:!0});return i},queryKey:K(e)}),q=e=>_(`skillsGet`,e),$n=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Je({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:q(e)}),er=e=>({mutationFn:async t=>{let{data:n}=await ze({...e,...t,throwOnError:!0});return n}}),tr=t=>e({...er(),...t}),nr=e=>_(`skillsByIdGet`,e),rr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Fe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:nr(e)}),ir=e=>_(`skillsByIdFilesGet`,e),ar=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await d({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:ir(e)}),or=e=>_(`skillsByIdFilesContentGet`,e),sr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ke({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:or(e)}),cr=e=>_(`skillsCategoriesGet`,e),lr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await He({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:cr(e)}),J=e=>_(`slackChannelsGet`,e),ur=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Re({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:J(e)}),Y=e=>_(`slackUsersGet`,e),dr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ze({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Y(e)}),X=e=>_(`soundsAvailableGet`,e),fr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await l({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:X(e)}),Z=e=>_(`soundsConfigGet`,e),Q=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await u({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Z(e)}),pr=(e,t,n)=>e.setQueryData(Q(t).queryKey,n),mr=e=>({mutationFn:async t=>{let{data:n}=await We({...e,...t,throwOnError:!0});return n}}),hr=e=>_(`ttsProvidersGet`,e),gr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ie({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:hr(e)}),_r=e=>_(`usageBreakdownGet`,e),vr=e=>_(`usageDailyGet`,e),yr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ke({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:vr(e)}),br=e=>_(`usageSeriesGet`,e),xr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await re({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:br(e)}),Sr=e=>_(`usageTotalsGet`,e),Cr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await tt({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Sr(e)}),$=e=>_(`workspaceThemeGet`,e),wr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Se({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:$(e)}),Tr=e=>({mutationFn:async t=>{let{data:n}=await ue({...e,...t,throwOnError:!0});return n}}),Er=t=>e({...Tr(),...t});export{xn as $,On as $t,Vt as A,Q as At,on as B,wt as Bt,Ft as C,q as Ct,k as D,Y as Dt,Bt as E,dr as Et,en as F,_r as Ft,R as G,Gt,L as H,Mt as Ht,F as I,yr as It,mn as J,Xt as Jt,un as K,Kt,rn as L,xr as Lt,Jt as M,pr as Mt,tn as N,mr as Nt,j as O,fr as Ot,P,gr as Pt,V as Q,Tn as Qt,an as R,Cr as Rt,At as S,$n as St,Pt as T,J as Tt,cn as U,Lt as Ut,sn as V,kt as Vt,ln as W,zt as Wt,vn as X,gn as Xt,z as Y,Qt as Yt,En as Z,bn as Zt,Dt as _,K as _t,ut as a,tr as an,zn as at,D as b,rr as bt,S as c,$ as cn,Wn as ct,gt as d,Yn as dt,Cn as en,B as et,_t as f,G as ft,St as g,Qn as gt,bt as h,Xn as ht,y as i,Un as in,H as it,N as j,Z as jt,A as k,X as kt,x as l,W as lt,vt as m,Zn as mt,v as n,Ln as nn,Mn as nt,dt as o,Er as on,U as ot,C as p,Jn as pt,fn as q,Ut as qt,ct as r,Vn as rn,Rn as rt,b as s,wr as sn,Fn as st,st as t,An as tn,Pn as tt,ft as u,Kn as ut,T as v,sr as vt,O as w,ur as wt,E as x,lr as xt,Et as y,ar as yt,I as z,mt as zt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{c as o}from"./routes-BbeIx_F9.js";import{t as s}from"./client-feature-flag-store-C0g8zi1W.js";import{t as c}from"./conversation-store-BljZWolF.js";import{t as l}from"./conversation-selection-BBHkzcfy.js";import{an as u}from"./index-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{c as o}from"./routes-BbeIx_F9.js";import{t as s}from"./client-feature-flag-store-C0g8zi1W.js";import{t as c}from"./conversation-store-BljZWolF.js";import{t as l}from"./conversation-selection-BBHkzcfy.js";import{an as u}from"./index-BYfTlch9.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
|
package/dist/assets/{research-onboarding-route-2nc0yKsq.js → research-onboarding-route-CEC2x5kn.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,r as p,t as m}from"./animated-avatar-DDpjZzRx.js";import{t as h}from"./loader-circle-Cz7opInR.js";import{t as g}from"./pencil-CUIr0IFo.js";import{t as _}from"./plus-DItfr5ux.js";import{t as v}from"./x-CkSVp1Ok.js";import{t as y}from"./tag-CV4v7fRF.js";import{t as b}from"./input-CoUmPnRU.js";import{i as x,r as S,t as C}from"./dist-CxHeCOEv.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{b as E,ct as D,o as ee,p as te}from"./local-mode-grqHUoNh.js";import{Bn as O,V as k,et as A,gn as j,hn as M,zn as ne}from"./sdk.gen-jDeNbBv8.js";import{r as re}from"./api-errors-CrWDzVca.js";import{A as ie,B as ae,L as N,R as oe,n as se,z as ce}from"./auth-store-CKsDsnkp.js";import{a as le,o as ue,r as de}from"./api-Zs5JMgKY.js";import{c as fe}from"./routes-BbeIx_F9.js";import{n as pe}from"./platform-detection-BrxvFUiR.js";import{c as me,l as he}from"./prechat-P1y7ZM6C.js";import{t as P}from"./browser-timezone-2SnmKDjM.js";import{c as ge}from"./conversation-list-fetchers-tE99dnUJ.js";import{i as _e,n as ve,r as ye,t as be}from"./research-onboarding-persistence-DnuHyFyB.js";import{A as F,B as xe,C as Se,D as Ce,E as we,F as Te,I,L as Ee,M as De,N as Oe,O as ke,P as L,R as Ae,S as R,T as z,V as B,_ as je,a as Me,b as Ne,d as V,f as Pe,g as Fe,i as Ie,j as Le,k as Re,m as ze,o as Be,p as Ve,r as He,s as Ue,t as H,v as We,w as Ge,x as Ke,y as qe}from"./proxy-BzlH_XAe.js";import{t as Je}from"./AnimatePresence-C8APSgIu.js";import{t as U}from"./use-reduced-motion-CcGT6CHV.js";import{_n as Ye,gt as Xe,in as Ze,ja as W,ji as Qe,mt as $e,nt as G,on as et,or as tt,qt as nt,rn as rt,sn as it,tt as at}from"./index-DQjUULFO.js";import{n as ot,t as st}from"./onboarding-step-layout-zvLUIT7j.js";import{t as ct}from"./prechat-names-b5RkG_F-.js";var lt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function ut(e,t){return De(e)?e[lt(0,e.length,t)]:e}var dt=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return ft(this.animations,`duration`)}get iterationDuration(){return ft(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function ft(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var pt=class extends dt{then(e,t){return this.finished.finally(e).then(()=>{})}};function mt(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=we(i,a,o);return t?s(r):s}function ht(e,t){return e in t}var gt=class extends Ue{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(ht(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Pe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},K=e(n(),1);function _t(e){let t=B(()=>R(e)),{isStatic:n}=(0,K.useContext)(He);if(n){let[,n]=(0,K.useState)(e);(0,K.useEffect)(()=>t.on(`change`,n),[])}return t}function vt(e,t){let n=_t(t()),r=()=>n.set(t());return r(),xe(()=>{let t=()=>Le.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),F(r)}}),n}function yt(e){Ke.current=[],e();let t=vt(Ke.current,e);return Ke.current=void 0,t}function bt(e,t,n,r){if(typeof e==`function`)return yt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return St(e,t,n,r);let i=typeof t==`function`?t:mt(t,n,r),a=Array.isArray(e)?xt(e,i):xt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function xt(e,t){let n=B(()=>[]);return vt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function St(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=bt(e,t,n[o],r);return a}function Ct(e){e.values.forEach(e=>e.stop())}function wt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&Ne(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{wt(e,t)})})}function Tt(e,t){if(Array.isArray(t))return wt(e,t);if(typeof t==`string`)return wt(e,[t]);Ne(e,t)}function Et(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){I(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(je(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return I(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Tt(e,n)})},stop(){t.forEach(e=>{Ct(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Dt(e){return typeof e==`object`&&!Array.isArray(e)}function Ot(e,t,n,r){return e==null?[]:typeof e==`string`&&Dt(t)?Fe(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function kt(e,t,n){return e*(t+1)+n*t}function At(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function jt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Ae(e,i),r--)}}function Mt(e,t,n,r,i,a){jt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Re(i,a,r[o]),easing:ut(n,o)})}function Nt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Pt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ft=`easeInOut`,It=20;function Lt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,At(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=At(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Bt(e),{delay:l=0,times:u=Ge(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Se(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Ut(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=L(b));let r=ke(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&z(u,T),c.length===1&&c.unshift(null),m&&Ee(m<It,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${It} or apply repeat at the sequence level instead.`),m&&m<It){let e=b>0?_/b:0;b=kt(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Oe(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:ut(f,e-1))}Nt(u,m,e)}let E=w+b;Mt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(qe(p)){let e=Rt(p,s);_(m,h,zt(`default`,e))}else{let e=Ot(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Rt(r,s);for(let e in m)_(m[e],Vt(h,e),zt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Pt);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Te(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ft)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Rt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function zt(e,t){return t[e]||(t[e]=[]),t[e]}function Bt(e){return Array.isArray(e)?e:[e]}function Vt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ht=e=>typeof e==`number`,Ut=e=>e.every(Ht);function Wt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ze(e)&&!Ve(e)?new Me(t):new Be(t);n.mount(e),V.set(e,n)}function Gt(e){let t=new gt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function Kt(e,t){return qe(e)||typeof e==`number`||typeof e==`string`&&!Dt(t)}function qt(e,t,n,r){let i=[];if(Kt(e,t))i.push(Ie(e,Dt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Ot(e,t,r),o=a.length;I(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Wt:Gt;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...We(c,{...t,transition:l},{}))}}return i}function Jt(e,t,n){let r=[];return Lt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=R(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ce}).forEach(({keyframes:e,transition:t},n)=>{r.push(...qt(n,e,t))}),r}function Yt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Xt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Yt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Jt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=qt(e,i,{...c,...r},t)}let l=new pt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{Ae(t.animations,l)})),l}return i}var Zt=Xt();function Qt(){let e=B(Et);return xe(e.mount,[]),e}var $t=12;function en(e,t){let n=e.slice(0,$t).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Dhiismgm.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-C36Yvcac.js";import{t as l}from"./arrow-left-DI9551VI.js";import{t as u}from"./chevron-left-BMF1xNfR.js";import{t as d}from"./chevron-right-DqqmezXC.js";import{n as f,r as p,t as m}from"./animated-avatar-CrlodWQr.js";import{t as h}from"./loader-circle-Cz7opInR.js";import{t as g}from"./pencil-CUIr0IFo.js";import{t as _}from"./plus-DItfr5ux.js";import{t as v}from"./x-CkSVp1Ok.js";import{t as y}from"./tag-CV4v7fRF.js";import{t as b}from"./input-CoUmPnRU.js";import{i as x,r as S,t as C}from"./dist-CxHeCOEv.js";import{n as w,t as T}from"./create-selectors-8NePGNlX.js";import{b as E,ct as D,o as ee,p as te}from"./local-mode-grqHUoNh.js";import{Bn as O,V as k,et as A,gn as j,hn as M,zn as ne}from"./sdk.gen-BwnFjFcp.js";import{r as re}from"./api-errors-CrWDzVca.js";import{A as ie,B as ae,L as N,R as oe,n as se,z as ce}from"./auth-store-CVs0OdtO.js";import{a as le,o as ue,r as de}from"./api-CYdUmFnA.js";import{c as fe}from"./routes-BbeIx_F9.js";import{n as pe}from"./platform-detection-BrxvFUiR.js";import{c as me,l as he}from"./prechat-P1y7ZM6C.js";import{t as P}from"./browser-timezone-2SnmKDjM.js";import{c as ge}from"./conversation-list-fetchers-DS9vmqfD.js";import{i as _e,n as ve,r as ye,t as be}from"./research-onboarding-persistence-DnuHyFyB.js";import{A as F,B as xe,C as Se,D as Ce,E as we,F as Te,I,L as Ee,M as De,N as Oe,O as ke,P as L,R as Ae,S as R,T as z,V as B,_ as je,a as Me,b as Ne,d as V,f as Pe,g as Fe,i as Ie,j as Le,k as Re,m as ze,o as Be,p as Ve,r as He,s as Ue,t as H,v as We,w as Ge,x as Ke,y as qe}from"./proxy-BzlH_XAe.js";import{t as Je}from"./AnimatePresence-C8APSgIu.js";import{t as U}from"./use-reduced-motion-CcGT6CHV.js";import{_n as Ye,gt as Xe,in as Ze,ja as W,ji as Qe,mt as $e,nt as G,on as et,or as tt,qt as nt,rn as rt,sn as it,tt as at}from"./index-BYfTlch9.js";import{n as ot,t as st}from"./onboarding-step-layout-zvLUIT7j.js";import{t as ct}from"./prechat-names-b5RkG_F-.js";var lt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function ut(e,t){return De(e)?e[lt(0,e.length,t)]:e}var dt=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return ft(this.animations,`duration`)}get iterationDuration(){return ft(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function ft(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var pt=class extends dt{then(e,t){return this.finished.finally(e).then(()=>{})}};function mt(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=we(i,a,o);return t?s(r):s}function ht(e,t){return e in t}var gt=class extends Ue{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(ht(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Pe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},K=e(n(),1);function _t(e){let t=B(()=>R(e)),{isStatic:n}=(0,K.useContext)(He);if(n){let[,n]=(0,K.useState)(e);(0,K.useEffect)(()=>t.on(`change`,n),[])}return t}function vt(e,t){let n=_t(t()),r=()=>n.set(t());return r(),xe(()=>{let t=()=>Le.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),F(r)}}),n}function yt(e){Ke.current=[],e();let t=vt(Ke.current,e);return Ke.current=void 0,t}function bt(e,t,n,r){if(typeof e==`function`)return yt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return St(e,t,n,r);let i=typeof t==`function`?t:mt(t,n,r),a=Array.isArray(e)?xt(e,i):xt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function xt(e,t){let n=B(()=>[]);return vt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function St(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=bt(e,t,n[o],r);return a}function Ct(e){e.values.forEach(e=>e.stop())}function wt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&Ne(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{wt(e,t)})})}function Tt(e,t){if(Array.isArray(t))return wt(e,t);if(typeof t==`string`)return wt(e,[t]);Ne(e,t)}function Et(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){I(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(je(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return I(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Tt(e,n)})},stop(){t.forEach(e=>{Ct(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function Dt(e){return typeof e==`object`&&!Array.isArray(e)}function Ot(e,t,n,r){return e==null?[]:typeof e==`string`&&Dt(t)?Fe(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function kt(e,t,n){return e*(t+1)+n*t}function At(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function jt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Ae(e,i),r--)}}function Mt(e,t,n,r,i,a){jt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Re(i,a,r[o]),easing:ut(n,o)})}function Nt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Pt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ft=`easeInOut`,It=20;function Lt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,At(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=At(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Bt(e),{delay:l=0,times:u=Ge(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=Se(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Ut(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=L(b));let r=ke(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&z(u,T),c.length===1&&c.unshift(null),m&&Ee(m<It,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${It} or apply repeat at the sequence level instead.`),m&&m<It){let e=b>0?_/b:0;b=kt(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Oe(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:ut(f,e-1))}Nt(u,m,e)}let E=w+b;Mt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(qe(p)){let e=Rt(p,s);_(m,h,zt(`default`,e))}else{let e=Ot(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Rt(r,s);for(let e in m)_(m[e],Vt(h,e),zt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Pt);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Te(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ft)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Rt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function zt(e,t){return t[e]||(t[e]=[]),t[e]}function Bt(e){return Array.isArray(e)?e:[e]}function Vt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ht=e=>typeof e==`number`,Ut=e=>e.every(Ht);function Wt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ze(e)&&!Ve(e)?new Me(t):new Be(t);n.mount(e),V.set(e,n)}function Gt(e){let t=new gt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function Kt(e,t){return qe(e)||typeof e==`number`||typeof e==`string`&&!Dt(t)}function qt(e,t,n,r){let i=[];if(Kt(e,t))i.push(Ie(e,Dt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Ot(e,t,r),o=a.length;I(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Wt:Gt;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...We(c,{...t,transition:l},{}))}}return i}function Jt(e,t,n){let r=[];return Lt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=R(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ce}).forEach(({keyframes:e,transition:t},n)=>{r.push(...qt(n,e,t))}),r}function Yt(e){return Array.isArray(e)&&e.some(Array.isArray)}function Xt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Yt(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Jt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=qt(e,i,{...c,...r},t)}let l=new pt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{Ae(t.animations,l)})),l}return i}var Zt=Xt();function Qt(){let e=B(Et);return xe(e.mount,[]),e}var $t=12;function en(e,t){let n=e.slice(0,$t).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
2
2
|
`);return n?`
|
|
3
3
|
Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
|
|
4
4
|
${n}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-y5bNUVyG.js";import{d as s,i as c,n as l}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-y5bNUVyG.js";import{d as s,i as c,n as l}from"./auth-store-CVs0OdtO.js";import{t as u}from"./return-to-BwxkOGDI.js";import{c as d}from"./routes-BbeIx_F9.js";import{c as f,d as p,f as m,l as h,p as g,u as _}from"./prefs-CTRDnnnS.js";import{Oi as v,gr as y,rn as b}from"./index-BYfTlch9.js";import{n as x,t as S}from"./consent-controls-BZMxm0n3.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=g(),[M,N]=_(),[P,F]=p(),[I,L]=m(),[R]=f(),[z]=h(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(b,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(v,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{r as t,s as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./createLucideIcon-IRfcSUxS.js";import{n as a,t as o}from"./create-selectors-8NePGNlX.js";import{n as s}from"./typed-storage-5IU6qVWg.js";import{a as c}from"./diagnostics-COsnZMe5.js";import{l}from"./chat-markdown-message-BuypfAkx.js";import{t as u}from"./conversation-store-BljZWolF.js";import{c as ee,d as te}from"./messages-DF7pzUR8.js";import{b as d,n as f,t as ne,v as re,w as p,x as ie}from"./chat-B8mgARYR.js";var ae=i(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),oe=i(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),se=i(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ce=i(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),le=e(r(),1),m=1e3,ue=15,de=0,h=new Map,g=[];function fe(e){let t=`sse-${++de}`,n={id:t,abortSignal:e,initiatedAt:Date.now(),establishedAt:null,lastTrafficAt:null,lastDataAt:null,dataFrames:0,keepalives:0,endedAt:null,endReason:null};h.set(t,n),Se();let r=()=>{xe(t,`aborted`)};return e.aborted?r():e.addEventListener(`abort`,r,{once:!0}),t}function pe(e){let t=h.get(e);t&&t.establishedAt===null&&(t.establishedAt=Date.now())}function me(e,t){let n=h.get(e);if(!n)return;let r=Date.now();n.lastTrafficAt=r,t?(n.lastDataAt=r,n.dataFrames++):n.keepalives++}function he(e,t){g.push({clientId:e,receivedAt:new Date().toISOString(),...t}),g.length>m&&g.shift()}var ge=`events-tail`;function _e(e){if(e.length===0)return;let t=new Set;for(let e of g)typeof e.seq==`number`&&t.add(e.seq);for(let n of e)typeof n.seq==`number`&&t.has(n.seq)||g.push({clientId:ge,receivedAt:new Date().toISOString(),...n});for(;g.length>m;)g.shift()}function ve(){return Array.from(h.values())}function ye(e=m){let t=Math.max(0,g.length-e);return g.slice(t)}function be(e,t){if(t===null)return null;let n=1/0;for(let e of g)typeof e.seq==`number`&&(n=Math.min(n,e.seq));return n!==1/0&&n>t+1?null:g.filter(n=>n.conversationId===e&&typeof n.seq==`number`&&n.seq>t).sort((e,t)=>e.seq-t.seq)}function xe(e,t){let n=h.get(e);n&&(n.endedAt===null?(n.endedAt=Date.now(),n.endReason=t):n.endReason===`aborted`&&t!==`aborted`&&(n.endReason=t),Se())}function Se(){let e=0;for(let t of h.values())t.endedAt!==null&&e++;if(!(e<=ue))for(let[t,n]of h){if(e<=ue)break;n.endedAt!==null&&(h.delete(t),e--)}}var Ce={phase:`idle`,pendingQueuedCount:0,activeToolCallCount:0,activeTurnId:null,lastTerminalReason:null,statusText:null,liveWebActivity:{}};function we(e){return e===`queued`||e===`thinking`||e===`streaming`||e===`awaiting_user_input`}function Te(e){return e===`thinking`}function _(e){return(e.phase===`idle`||e.phase===`errored`)&&!e.activeTurnId}var Ee=o(a()((e,t)=>({...Ce,requestSend:t=>e(e=>({phase:`thinking`,activeTurnId:t??e.activeTurnId,lastTerminalReason:null,activeToolCallCount:0,statusText:null})),acceptSend:t=>e(e=>({activeTurnId:t,...e.phase===`idle`||e.phase===`errored`?{phase:`thinking`,lastTerminalReason:null}:null})),onTextDelta:()=>{let n=t();if(n.phase===`idle`||n.phase===`errored`){if(!n.activeTurnId)return;e({phase:`streaming`});return}(n.phase===`thinking`||n.phase===`queued`)&&e({phase:`streaming`})},onToolUseStart:()=>{let n=t();_(n)||e({phase:n.phase===`idle`||n.phase===`errored`||n.phase===`queued`?`thinking`:n.phase,activeToolCallCount:n.activeToolCallCount+1})},onToolResult:()=>e(e=>({activeToolCallCount:Math.max(0,e.activeToolCallCount-1)})),onToolActivityMetadata:(n,r)=>{let i=t();_(i)||e({liveWebActivity:{...i.liveWebActivity,[n]:r}})},onActivityThinking:n=>{let r=t();_(r)||r.phase!==`awaiting_user_input`&&e({phase:`thinking`,statusText:n??null})},showSurface:n=>{_(t())||n&&e({phase:`awaiting_user_input`})},updateSurface:()=>{},dismissSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},completeSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},onSecretRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},onConfirmationRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},onQuestionRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},onContactRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},completeTurn:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},handoffGeneration:()=>{_(t())||e({phase:`thinking`,activeToolCallCount:0,statusText:null})},cancelGeneration:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`cancelled`,statusText:null,liveWebActivity:{}})},onStreamError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`error`,statusText:null,liveWebActivity:{}}),onSessionError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`session_error`,statusText:null,liveWebActivity:{}}),onTurnTimeout:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`timeout`,statusText:null,liveWebActivity:{}}),onPollReconciled:n=>{let r=t();n&&n!==r.activeTurnId||we(r.phase)&&e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},resetTurn:()=>e({...Ce}),enqueueMessage:()=>e(e=>({pendingQueuedCount:e.pendingQueuedCount+1})),dequeueMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(_(n)){e({pendingQueuedCount:r});return}e({phase:`thinking`,pendingQueuedCount:r})},deleteQueuedMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(r===0&&n.phase===`queued`){e({phase:`idle`,pendingQueuedCount:0,activeTurnId:null,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}});return}e({pendingQueuedCount:r})}}))),De=3670016,Oe=[.85,.75,.65,.5],ke=2e7,Ae=new Set([`image/jpeg`,`image/jpg`,`image/png`,`image/webp`,`image/heic`,`image/heif`,`image/bmp`,`image/tiff`]),je=new Set([`jpg`,`jpeg`,`png`,`webp`,`heic`,`heif`,`bmp`,`tif`,`tiff`]);function v(e){let t=e.type.trim().toLowerCase();if(Ae.has(t))return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n?je.has(n):!1}function Me(e){return v(e)&&e.size>3670016}function Ne(e){let t=e.type.trim().toLowerCase();if(t===`image/heic`||t===`image/heif`)return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n===`heic`||n===`heif`}function Pe(e){return Me(e)||Ne(e)}function Fe(e){let t=`attachment`,n=e.trim()||t;return/\.(?:jpe?g)$/i.test(n)?n:`${n.replace(/\.[^./\\]+$/,``)||t}.jpg`}async function Ie(e){if(!Pe(e)||await Re(e))return{status:`unchanged`,file:e};if(e.size>104857600)return{status:`failed`,error:`This image is too large to process safely. Please choose a smaller image.`};let t;try{t=await Le(e)}catch{return{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}}try{let n;try{n=await Be(t,e.size)}catch{n=null}return!n||!Ne(e)&&n.size>=e.size?{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}:{status:`resized`,file:new File([n],Fe(e.name),{type:`image/jpeg`,lastModified:e.lastModified})}}finally{t.close()}}async function Le(e){if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e,{imageOrientation:`from-image`});return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}if(typeof Image>`u`)throw Error(`No browser image decoder is available.`);let t=URL.createObjectURL(e);return await new Promise((e,n)=>{let r=new Image;r.onload=()=>{e({source:r,width:r.naturalWidth||r.width,height:r.naturalHeight||r.height,close:()=>URL.revokeObjectURL(t)})},r.onerror=()=>{URL.revokeObjectURL(t),n(Error(`Image decode failed.`))},r.src=t})}async function Re(e){if(!ze(e))return!1;let t;try{t=new Uint8Array(await e.slice(0,Math.min(e.size,1024*1024)).arrayBuffer())}catch{return!0}if(!b(t,0,`RIFF`)||!b(t,8,`WEBP`))return!1;let n=y(t,`VP8X`);return n>=0&&(t[n+8]??0)&2?!0:y(t,`ANIM`)>=0||y(t,`ANMF`)>=0}function ze(e){return e.type.trim().toLowerCase()===`image/webp`||/\.webp$/i.test(e.name)}function y(e,t){for(let n=0;n<=e.length-t.length;n+=1)if(b(e,n,t))return n;return-1}function b(e,t,n){if(t+n.length>e.length)return!1;for(let r=0;r<n.length;r+=1)if(e[t+r]!==n.charCodeAt(r))return!1;return!0}async function Be(e,t){let n=e.width*e.height,r=null;if(n<=ke)for(let t of Oe){let n=await S(e.source,e.width,e.height,t);if(r=x(r,n),n&&n.size<=3670016)return n}let i=r?.size??t,a=Math.min(Math.sqrt(De/i*.9),.95);for(let t=0;t<4;t+=1){let t=Math.max(Math.floor(e.width*a),1),n=Math.max(Math.floor(e.height*a),1),o=null;for(let i of Oe){let a=await S(e.source,t,n,i);if(r=x(r,a),o=x(o,a),a&&a.size<=3670016)return a}i=o?.size??i,a*=Math.min(Math.sqrt(De/i*.9),.9)}return null}function x(e,t){return t&&(!e||t.size<e.size)?t:e}async function S(e,t,n,r){if(typeof document>`u`)return null;let i=document.createElement(`canvas`);i.width=t,i.height=n;let a=i.getContext(`2d`);if(!a||typeof i.toBlob!=`function`)return null;a.fillStyle=`#fff`,a.fillRect(0,0,t,n),a.drawImage(e,0,0,t,n);try{return await new Promise(e=>{i.toBlob(t=>e(t),`image/jpeg`,r)})}finally{i.width=0,i.height=0}}var Ve=`vellum:chatDrafts:`;function He(e){return`${Ve}${e}`}function Ue(e){let n=t(He(e),``);if(!n)return new Map;try{let e=JSON.parse(n);return typeof e!=`object`||!e||Array.isArray(e)?new Map:new Map(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return new Map}}function C(e,t){n(He(e),JSON.stringify(Object.fromEntries(t)))}function We(){return`att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Ge(e){return v(e)?`100 MB`:`50 MB`}function Ke(e){return e.size<=52428800?!0:v(e)&&e.size<=104857600}function qe(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}var w=new Map,T=null,E=new Map,D=new Set,Je=a()((e,t)=>({input:``,restoredDraftConversationId:null,attachments:[],attachmentLastError:null,setInput:t=>{e(e=>({input:typeof t==`function`?t(e.input):t}))},saveDraft:(e,t)=>{t.trim()?w.set(e,t):w.delete(e),T&&C(T,w)},clearDraft:e=>{w.delete(e),T&&C(T,w)},handleConversationSwitch:({previousKey:n,nextKey:r})=>{if(!(n!==null&&n!==r)||!n)return;let i=t().input;i.trim()?w.set(n,i):w.delete(n);let a=(r&&w.get(r))??``;e({input:a,restoredDraftConversationId:a.length>0&&r?r:null}),T&&C(T,w)},loadAssistantDrafts:(n,r)=>{if(T&&T!==n){let n=t().input;r&&(n.trim()?w.set(r,n):w.delete(r)),C(T,w),e({input:``,restoredDraftConversationId:null})}w=Ue(n),T=n},clearRestoredDraftNotice:()=>{e({restoredDraftConversationId:null})},restoreDraftIfEmpty:n=>{let r=w.get(n);r&&r.trim()&&!t().input.trim()&&e({input:r,restoredDraftConversationId:n})},addFiles:(t,n)=>{let r=Array.from(t);if(r.length===0)return;if(!n){e({attachmentLastError:`No active assistant. Please try again.`});return}let i=[],a=[];for(let e of r)Ke(e)?a.push(e):i.push(e);let o=i[0];if(e(o?{attachmentLastError:i.length===1?`${o.name} is larger than ${Ge(o)} and can't be attached.`:`${i.length} files are too large and can't be attached.`}:{attachmentLastError:null}),a.length===0)return;let s=a.map(e=>({pending:{kind:`uploading`,localId:We(),filename:e.name||`attachment`,mimeType:e.type||`application/octet-stream`,sizeBytes:e.size},file:e}));e(e=>({attachments:[...e.attachments,...s.map(e=>e.pending)]}));for(let{pending:t,file:r}of s)(async()=>{try{let i=await Ie(r);if(D.has(t.localId)){D.delete(t.localId);return}if(i.status===`failed`&&r.size>52428800){O(e,t.localId,i.error);return}let a=i.status===`failed`?r:i.file;if(a.size>52428800){O(e,t.localId,`This attachment is still larger than 50 MB after resizing. Try a smaller image.`);return}i.status===`resized`&&e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId&&e.kind===`uploading`?{...e,filename:a.name||`attachment`,mimeType:a.type||`application/octet-stream`,sizeBytes:a.size}:e)}));let o=await ee(n,a);if(D.has(t.localId)){D.delete(t.localId);return}if(!o.ok){O(e,t.localId,o.error.detail??`Upload failed`);return}let s=a.type||`application/octet-stream`,c=o.filename??(a.name||`attachment`),u=o.mimeType??s,te=o.sizeBytes??a.size,d=a;if(u.startsWith(`image/`)&&u!==s){let e=await l(n,o.id);if(D.has(t.localId)){D.delete(t.localId);return}e&&(d=e)}let f=null;try{f=URL.createObjectURL(d),E.set(t.localId,f)}catch{f=null}e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId?{kind:`uploaded`,localId:t.localId,id:o.id,filename:c,mimeType:u,sizeBytes:te,previewUrl:f,thumbnailUrl:null}:e)}))}catch{if(D.has(t.localId)){D.delete(t.localId);return}O(e,t.localId,`Upload failed`)}})()},addPathReferences:t=>{let n=[];for(let e of t){let t=e.trim();t&&n.push({kind:`path-reference`,localId:We(),path:t,filename:qe(t)||t})}n.length!==0&&e(e=>({attachments:[...e.attachments,...n],attachmentLastError:null}))},removeAttachment:t=>{e(e=>{let n=e.attachments.find(e=>e.localId===t);return n&&n.kind===`uploading`&&D.add(t),{attachments:e.attachments.filter(e=>e.localId!==t)}}),Ye(t)},resetAttachments:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&D.add(t.localId);return{attachments:[],attachmentLastError:null}})},fullReset:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&D.add(t.localId);return{attachments:[],attachmentLastError:null}}),E.forEach(e=>URL.revokeObjectURL(e)),E.clear()},dismissAttachmentError:()=>{e({attachmentLastError:null})}}));function O(e,t,n){e(e=>({attachments:e.attachments.map(e=>e.localId!==t||e.kind!==`uploading`?e:{kind:`failed`,localId:t,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,error:n})}))}function Ye(e){let t=E.get(e);t&&(URL.revokeObjectURL(t),E.delete(e))}function Xe(e){return e.reduce((e,t)=>t.kind===`uploading`?e+1:e,0)}function Ze(e){return e.filter(e=>e.kind===`uploaded`).map(e=>e.id)}function Qe(e){return e.filter(e=>e.kind===`path-reference`).map(e=>e.path)}var k=o(Je);function $e(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function et(e){let t=JSON.parse(e);return $e(t)?t:null}function A(e,t){let n=[...e??[]],r=n.findIndex(e=>e.type===`surface`&&e.surface.surfaceId===t.surfaceId);return r===-1?n.push({type:`surface`,surface:t}):n[r]={type:`surface`,surface:t},n}function tt(e,t){return e?.filter(e=>!(e.type===`surface`&&e.surface.surfaceId===t))}function nt(e,t){if(!e.surfaces?.length)return e;let n=!1,r=e.contentBlocks,i=e.surfaces.map(e=>{let i=t(e);return i!==e&&(n=!0,r=A(r,i)),i});return n?{...e,surfaces:i,contentBlocks:r}:e}function j(e,t){if(!e.surfaces?.length)return e;let n=e.surfaces.filter(t);if(n.length===e.surfaces.length)return e;let r=new Set(e.surfaces.filter(e=>!t(e)).map(e=>e.surfaceId));return{...e,surfaces:n,contentOrder:e.contentOrder?.filter(e=>!(e.type===`surface`&&r.has(e.id))),contentBlocks:e.contentBlocks?.filter(e=>!(e.type===`surface`&&r.has(e.surface.surfaceId)))}}var rt=500,it=s({keyFn:e=>`vellum:dismissed-surfaces:${e}`,scope:`user`,parseValue:e=>$e(e)?e:null,fallback:{},maxEntries:200});function at(e,t){let n=it.get(e,t);return n?new Set(n):new Set}function ot(e,t,n){let r=Array.from(n);r.length>rt&&(r=r.slice(r.length-rt)),it.set(e,t,r)}var st=[];function ct(e,t){if(!e)return st;if(t.size===0)return e;let n=!1,r=e.map(e=>{let r=j(e,e=>!t.has(e.surfaceId));return r!==e&&(n=!0),r});return n?r:e}function lt(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.tokens!=`number`||!Number.isFinite(t.tokens)||t.maxTokens!==null&&(typeof t.maxTokens!=`number`||!Number.isFinite(t.maxTokens))||t.fillRatio!==null&&(typeof t.fillRatio!=`number`||!Number.isFinite(t.fillRatio)))}var ut=s({keyFn:e=>`vellum:ctxwindow:${e}`,scope:`user`,parseValue:e=>lt(e)?e:null,fallback:{},maxEntries:200});function dt(e){return new Map(Object.entries(ut.load(e)))}function ft(e,t,n){ut.set(e,t,n)}var pt=`PROVIDER_BILLING`,mt=`PROVIDER_NOT_CONFIGURED`,ht=`MANAGED_KEY_INVALID`,gt=`credits_exhausted`,_t=`provider_billing`;function vt(e){return e?.errorCategory?e.errorCategory.endsWith(gt):e?.code===pt}function yt(e){return e?.errorCategory?e.errorCategory.endsWith(_t):!1}function bt(e){return vt(e)?`managed_credits`:yt(e)?`provider_billing`:null}function M(e){return bt(e)!==null||e?.code===mt||e?.displayAs===`modal`}function xt(e){return!!e&&!M(e)}function St(e){return e?.code===ht}var Ct={pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,pendingContactRequest:null,isSubmittingContactRequest:!1,contactRequestAccepted:!1,pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1,inlineConfirmationToolCallId:null,unknownNudgeToolCallIds:new Set},N=o(a()((e,t)=>({...Ct,showSecret:n=>{let{pendingSecret:r}=t();if(r&&r.requestId===n.requestId){let t={};for(let e of Object.keys(n))n[e]!==void 0&&(t[e]=n[e]);e({pendingSecret:{...r,...t}});return}e({pendingSecret:n,isSubmittingSecret:!1,secretSaved:!1})},submitSecretStart:()=>e({isSubmittingSecret:!0}),submitSecretEnd:t=>e({isSubmittingSecret:!1,secretSaved:t??!1}),dismissSecret:()=>e({pendingSecret:null,isSubmittingSecret:!1}),updateSecret:(n,r)=>{let{pendingSecret:i}=t();!i||i.requestId!==n||e({pendingSecret:{...i,...r}})},showConfirmation:t=>e({pendingConfirmation:t,isSubmittingConfirmation:!1}),submitConfirmationStart:()=>e({isSubmittingConfirmation:!0}),submitConfirmationEnd:()=>e({isSubmittingConfirmation:!1}),dismissConfirmation:()=>e({pendingConfirmation:null,isSubmittingConfirmation:!1}),dismissConfirmationIfMatches:n=>{let{pendingConfirmation:r}=t();!r||r.requestId!==n||e({pendingConfirmation:null,isSubmittingConfirmation:!1})},updateConfirmation:(n,r)=>{let{pendingConfirmation:i}=t();!i||i.requestId!==n||e({pendingConfirmation:{...i,...r}})},setInlineConfirmationToolCallId:t=>e({inlineConfirmationToolCallId:t}),showContactRequest:t=>e({pendingContactRequest:t,isSubmittingContactRequest:!1,contactRequestAccepted:!1}),submitContactRequestStart:()=>e({isSubmittingContactRequest:!0}),submitContactRequestEnd:()=>e({isSubmittingContactRequest:!1}),dismissContactRequest:()=>e({pendingContactRequest:null,isSubmittingContactRequest:!1}),acceptContactRequest:()=>e({contactRequestAccepted:!0}),showQuestion:t=>e({pendingQuestion:t,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),submitQuestionStart:()=>e({isSubmittingQuestion:!0}),submitQuestionEnd:()=>e({isSubmittingQuestion:!1}),dismissQuestion:()=>e({pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),dismissQuestionCard:()=>e({isQuestionCardDismissed:!0}),resetSecretAndConfirmation:()=>e({pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,inlineConfirmationToolCallId:null}),addUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;r.has(n)||e({unknownNudgeToolCallIds:new Set([...r,n])})},removeUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;if(!r.has(n))return;let i=new Set(r);i.delete(n),e({unknownNudgeToolCallIds:i})},resetAll:()=>e(Ct)})));function wt(e){if(e.length===0)return``;let t=e[0]??``;for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n][0];r&&i&&r!==` `&&r!==`
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{r as t,s as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./createLucideIcon-IRfcSUxS.js";import{n as a,t as o}from"./create-selectors-8NePGNlX.js";import{n as s}from"./typed-storage-5IU6qVWg.js";import{a as c}from"./diagnostics-COsnZMe5.js";import{l}from"./chat-markdown-message-CItp7csw.js";import{t as u}from"./conversation-store-BljZWolF.js";import{c as ee,d as te}from"./messages-Bl6a3LUN.js";import{b as d,n as f,t as ne,v as re,w as p,x as ie}from"./chat-B8mgARYR.js";var ae=i(`bolt`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),oe=i(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),se=i(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ce=i(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),le=e(r(),1),m=1e3,ue=15,de=0,h=new Map,g=[];function fe(e){let t=`sse-${++de}`,n={id:t,abortSignal:e,initiatedAt:Date.now(),establishedAt:null,lastTrafficAt:null,lastDataAt:null,dataFrames:0,keepalives:0,endedAt:null,endReason:null};h.set(t,n),Se();let r=()=>{xe(t,`aborted`)};return e.aborted?r():e.addEventListener(`abort`,r,{once:!0}),t}function pe(e){let t=h.get(e);t&&t.establishedAt===null&&(t.establishedAt=Date.now())}function me(e,t){let n=h.get(e);if(!n)return;let r=Date.now();n.lastTrafficAt=r,t?(n.lastDataAt=r,n.dataFrames++):n.keepalives++}function he(e,t){g.push({clientId:e,receivedAt:new Date().toISOString(),...t}),g.length>m&&g.shift()}var ge=`events-tail`;function _e(e){if(e.length===0)return;let t=new Set;for(let e of g)typeof e.seq==`number`&&t.add(e.seq);for(let n of e)typeof n.seq==`number`&&t.has(n.seq)||g.push({clientId:ge,receivedAt:new Date().toISOString(),...n});for(;g.length>m;)g.shift()}function ve(){return Array.from(h.values())}function ye(e=m){let t=Math.max(0,g.length-e);return g.slice(t)}function be(e,t){if(t===null)return null;let n=1/0;for(let e of g)typeof e.seq==`number`&&(n=Math.min(n,e.seq));return n!==1/0&&n>t+1?null:g.filter(n=>n.conversationId===e&&typeof n.seq==`number`&&n.seq>t).sort((e,t)=>e.seq-t.seq)}function xe(e,t){let n=h.get(e);n&&(n.endedAt===null?(n.endedAt=Date.now(),n.endReason=t):n.endReason===`aborted`&&t!==`aborted`&&(n.endReason=t),Se())}function Se(){let e=0;for(let t of h.values())t.endedAt!==null&&e++;if(!(e<=ue))for(let[t,n]of h){if(e<=ue)break;n.endedAt!==null&&(h.delete(t),e--)}}var Ce={phase:`idle`,pendingQueuedCount:0,activeToolCallCount:0,activeTurnId:null,lastTerminalReason:null,statusText:null,liveWebActivity:{}};function we(e){return e===`queued`||e===`thinking`||e===`streaming`||e===`awaiting_user_input`}function Te(e){return e===`thinking`}function _(e){return(e.phase===`idle`||e.phase===`errored`)&&!e.activeTurnId}var Ee=o(a()((e,t)=>({...Ce,requestSend:t=>e(e=>({phase:`thinking`,activeTurnId:t??e.activeTurnId,lastTerminalReason:null,activeToolCallCount:0,statusText:null})),acceptSend:t=>e(e=>({activeTurnId:t,...e.phase===`idle`||e.phase===`errored`?{phase:`thinking`,lastTerminalReason:null}:null})),onTextDelta:()=>{let n=t();if(n.phase===`idle`||n.phase===`errored`){if(!n.activeTurnId)return;e({phase:`streaming`});return}(n.phase===`thinking`||n.phase===`queued`)&&e({phase:`streaming`})},onToolUseStart:()=>{let n=t();_(n)||e({phase:n.phase===`idle`||n.phase===`errored`||n.phase===`queued`?`thinking`:n.phase,activeToolCallCount:n.activeToolCallCount+1})},onToolResult:()=>e(e=>({activeToolCallCount:Math.max(0,e.activeToolCallCount-1)})),onToolActivityMetadata:(n,r)=>{let i=t();_(i)||e({liveWebActivity:{...i.liveWebActivity,[n]:r}})},onActivityThinking:n=>{let r=t();_(r)||r.phase!==`awaiting_user_input`&&e({phase:`thinking`,statusText:n??null})},showSurface:n=>{_(t())||n&&e({phase:`awaiting_user_input`})},updateSurface:()=>{},dismissSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},completeSurface:()=>{let n=t();n.phase===`awaiting_user_input`&&n.activeToolCallCount===0&&e({phase:`thinking`})},onSecretRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},onConfirmationRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},onQuestionRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},onContactRequest:()=>{_(t())||e({phase:`awaiting_user_input`})},completeTurn:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},handoffGeneration:()=>{_(t())||e({phase:`thinking`,activeToolCallCount:0,statusText:null})},cancelGeneration:()=>{e({phase:t().pendingQueuedCount>0?`queued`:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`cancelled`,statusText:null,liveWebActivity:{}})},onStreamError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`error`,statusText:null,liveWebActivity:{}}),onSessionError:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`session_error`,statusText:null,liveWebActivity:{}}),onTurnTimeout:()=>e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,pendingQueuedCount:0,lastTerminalReason:`timeout`,statusText:null,liveWebActivity:{}}),onPollReconciled:n=>{let r=t();n&&n!==r.activeTurnId||we(r.phase)&&e({phase:`idle`,activeTurnId:null,activeToolCallCount:0,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}})},resetTurn:()=>e({...Ce}),enqueueMessage:()=>e(e=>({pendingQueuedCount:e.pendingQueuedCount+1})),dequeueMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(_(n)){e({pendingQueuedCount:r});return}e({phase:`thinking`,pendingQueuedCount:r})},deleteQueuedMessage:()=>{let n=t(),r=Math.max(0,n.pendingQueuedCount-1);if(r===0&&n.phase===`queued`){e({phase:`idle`,pendingQueuedCount:0,activeTurnId:null,lastTerminalReason:`complete`,statusText:null,liveWebActivity:{}});return}e({pendingQueuedCount:r})}}))),De=3670016,Oe=[.85,.75,.65,.5],ke=2e7,Ae=new Set([`image/jpeg`,`image/jpg`,`image/png`,`image/webp`,`image/heic`,`image/heif`,`image/bmp`,`image/tiff`]),je=new Set([`jpg`,`jpeg`,`png`,`webp`,`heic`,`heif`,`bmp`,`tif`,`tiff`]);function v(e){let t=e.type.trim().toLowerCase();if(Ae.has(t))return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n?je.has(n):!1}function Me(e){return v(e)&&e.size>3670016}function Ne(e){let t=e.type.trim().toLowerCase();if(t===`image/heic`||t===`image/heif`)return!0;let n=e.name.split(`.`).pop()?.trim().toLowerCase();return n===`heic`||n===`heif`}function Pe(e){return Me(e)||Ne(e)}function Fe(e){let t=`attachment`,n=e.trim()||t;return/\.(?:jpe?g)$/i.test(n)?n:`${n.replace(/\.[^./\\]+$/,``)||t}.jpg`}async function Ie(e){if(!Pe(e)||await Re(e))return{status:`unchanged`,file:e};if(e.size>104857600)return{status:`failed`,error:`This image is too large to process safely. Please choose a smaller image.`};let t;try{t=await Le(e)}catch{return{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}}try{let n;try{n=await Be(t,e.size)}catch{n=null}return!n||!Ne(e)&&n.size>=e.size?{status:`failed`,error:`Couldn't resize this image for upload. Try a smaller image.`}:{status:`resized`,file:new File([n],Fe(e.name),{type:`image/jpeg`,lastModified:e.lastModified})}}finally{t.close()}}async function Le(e){if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e,{imageOrientation:`from-image`});return{source:t,width:t.width,height:t.height,close:()=>t.close()}}catch{}if(typeof Image>`u`)throw Error(`No browser image decoder is available.`);let t=URL.createObjectURL(e);return await new Promise((e,n)=>{let r=new Image;r.onload=()=>{e({source:r,width:r.naturalWidth||r.width,height:r.naturalHeight||r.height,close:()=>URL.revokeObjectURL(t)})},r.onerror=()=>{URL.revokeObjectURL(t),n(Error(`Image decode failed.`))},r.src=t})}async function Re(e){if(!ze(e))return!1;let t;try{t=new Uint8Array(await e.slice(0,Math.min(e.size,1024*1024)).arrayBuffer())}catch{return!0}if(!b(t,0,`RIFF`)||!b(t,8,`WEBP`))return!1;let n=y(t,`VP8X`);return n>=0&&(t[n+8]??0)&2?!0:y(t,`ANIM`)>=0||y(t,`ANMF`)>=0}function ze(e){return e.type.trim().toLowerCase()===`image/webp`||/\.webp$/i.test(e.name)}function y(e,t){for(let n=0;n<=e.length-t.length;n+=1)if(b(e,n,t))return n;return-1}function b(e,t,n){if(t+n.length>e.length)return!1;for(let r=0;r<n.length;r+=1)if(e[t+r]!==n.charCodeAt(r))return!1;return!0}async function Be(e,t){let n=e.width*e.height,r=null;if(n<=ke)for(let t of Oe){let n=await S(e.source,e.width,e.height,t);if(r=x(r,n),n&&n.size<=3670016)return n}let i=r?.size??t,a=Math.min(Math.sqrt(De/i*.9),.95);for(let t=0;t<4;t+=1){let t=Math.max(Math.floor(e.width*a),1),n=Math.max(Math.floor(e.height*a),1),o=null;for(let i of Oe){let a=await S(e.source,t,n,i);if(r=x(r,a),o=x(o,a),a&&a.size<=3670016)return a}i=o?.size??i,a*=Math.min(Math.sqrt(De/i*.9),.9)}return null}function x(e,t){return t&&(!e||t.size<e.size)?t:e}async function S(e,t,n,r){if(typeof document>`u`)return null;let i=document.createElement(`canvas`);i.width=t,i.height=n;let a=i.getContext(`2d`);if(!a||typeof i.toBlob!=`function`)return null;a.fillStyle=`#fff`,a.fillRect(0,0,t,n),a.drawImage(e,0,0,t,n);try{return await new Promise(e=>{i.toBlob(t=>e(t),`image/jpeg`,r)})}finally{i.width=0,i.height=0}}var Ve=`vellum:chatDrafts:`;function He(e){return`${Ve}${e}`}function Ue(e){let n=t(He(e),``);if(!n)return new Map;try{let e=JSON.parse(n);return typeof e!=`object`||!e||Array.isArray(e)?new Map:new Map(Object.entries(e).filter(e=>typeof e[1]==`string`))}catch{return new Map}}function C(e,t){n(He(e),JSON.stringify(Object.fromEntries(t)))}function We(){return`att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Ge(e){return v(e)?`100 MB`:`50 MB`}function Ke(e){return e.size<=52428800?!0:v(e)&&e.size<=104857600}function qe(e){let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n===-1?t:t.slice(n+1)}var w=new Map,T=null,E=new Map,D=new Set,Je=a()((e,t)=>({input:``,restoredDraftConversationId:null,attachments:[],attachmentLastError:null,setInput:t=>{e(e=>({input:typeof t==`function`?t(e.input):t}))},saveDraft:(e,t)=>{t.trim()?w.set(e,t):w.delete(e),T&&C(T,w)},clearDraft:e=>{w.delete(e),T&&C(T,w)},handleConversationSwitch:({previousKey:n,nextKey:r})=>{if(!(n!==null&&n!==r)||!n)return;let i=t().input;i.trim()?w.set(n,i):w.delete(n);let a=(r&&w.get(r))??``;e({input:a,restoredDraftConversationId:a.length>0&&r?r:null}),T&&C(T,w)},loadAssistantDrafts:(n,r)=>{if(T&&T!==n){let n=t().input;r&&(n.trim()?w.set(r,n):w.delete(r)),C(T,w),e({input:``,restoredDraftConversationId:null})}w=Ue(n),T=n},clearRestoredDraftNotice:()=>{e({restoredDraftConversationId:null})},restoreDraftIfEmpty:n=>{let r=w.get(n);r&&r.trim()&&!t().input.trim()&&e({input:r,restoredDraftConversationId:n})},addFiles:(t,n)=>{let r=Array.from(t);if(r.length===0)return;if(!n){e({attachmentLastError:`No active assistant. Please try again.`});return}let i=[],a=[];for(let e of r)Ke(e)?a.push(e):i.push(e);let o=i[0];if(e(o?{attachmentLastError:i.length===1?`${o.name} is larger than ${Ge(o)} and can't be attached.`:`${i.length} files are too large and can't be attached.`}:{attachmentLastError:null}),a.length===0)return;let s=a.map(e=>({pending:{kind:`uploading`,localId:We(),filename:e.name||`attachment`,mimeType:e.type||`application/octet-stream`,sizeBytes:e.size},file:e}));e(e=>({attachments:[...e.attachments,...s.map(e=>e.pending)]}));for(let{pending:t,file:r}of s)(async()=>{try{let i=await Ie(r);if(D.has(t.localId)){D.delete(t.localId);return}if(i.status===`failed`&&r.size>52428800){O(e,t.localId,i.error);return}let a=i.status===`failed`?r:i.file;if(a.size>52428800){O(e,t.localId,`This attachment is still larger than 50 MB after resizing. Try a smaller image.`);return}i.status===`resized`&&e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId&&e.kind===`uploading`?{...e,filename:a.name||`attachment`,mimeType:a.type||`application/octet-stream`,sizeBytes:a.size}:e)}));let o=await ee(n,a);if(D.has(t.localId)){D.delete(t.localId);return}if(!o.ok){O(e,t.localId,o.error.detail??`Upload failed`);return}let s=a.type||`application/octet-stream`,c=o.filename??(a.name||`attachment`),u=o.mimeType??s,te=o.sizeBytes??a.size,d=a;if(u.startsWith(`image/`)&&u!==s){let e=await l(n,o.id);if(D.has(t.localId)){D.delete(t.localId);return}e&&(d=e)}let f=null;try{f=URL.createObjectURL(d),E.set(t.localId,f)}catch{f=null}e(e=>({attachments:e.attachments.map(e=>e.localId===t.localId?{kind:`uploaded`,localId:t.localId,id:o.id,filename:c,mimeType:u,sizeBytes:te,previewUrl:f,thumbnailUrl:null}:e)}))}catch{if(D.has(t.localId)){D.delete(t.localId);return}O(e,t.localId,`Upload failed`)}})()},addPathReferences:t=>{let n=[];for(let e of t){let t=e.trim();t&&n.push({kind:`path-reference`,localId:We(),path:t,filename:qe(t)||t})}n.length!==0&&e(e=>({attachments:[...e.attachments,...n],attachmentLastError:null}))},removeAttachment:t=>{e(e=>{let n=e.attachments.find(e=>e.localId===t);return n&&n.kind===`uploading`&&D.add(t),{attachments:e.attachments.filter(e=>e.localId!==t)}}),Ye(t)},resetAttachments:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&D.add(t.localId);return{attachments:[],attachmentLastError:null}})},fullReset:()=>{e(e=>{for(let t of e.attachments)t.kind===`uploading`&&D.add(t.localId);return{attachments:[],attachmentLastError:null}}),E.forEach(e=>URL.revokeObjectURL(e)),E.clear()},dismissAttachmentError:()=>{e({attachmentLastError:null})}}));function O(e,t,n){e(e=>({attachments:e.attachments.map(e=>e.localId!==t||e.kind!==`uploading`?e:{kind:`failed`,localId:t,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,error:n})}))}function Ye(e){let t=E.get(e);t&&(URL.revokeObjectURL(t),E.delete(e))}function Xe(e){return e.reduce((e,t)=>t.kind===`uploading`?e+1:e,0)}function Ze(e){return e.filter(e=>e.kind===`uploaded`).map(e=>e.id)}function Qe(e){return e.filter(e=>e.kind===`path-reference`).map(e=>e.path)}var k=o(Je);function $e(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function et(e){let t=JSON.parse(e);return $e(t)?t:null}function A(e,t){let n=[...e??[]],r=n.findIndex(e=>e.type===`surface`&&e.surface.surfaceId===t.surfaceId);return r===-1?n.push({type:`surface`,surface:t}):n[r]={type:`surface`,surface:t},n}function tt(e,t){return e?.filter(e=>!(e.type===`surface`&&e.surface.surfaceId===t))}function nt(e,t){if(!e.surfaces?.length)return e;let n=!1,r=e.contentBlocks,i=e.surfaces.map(e=>{let i=t(e);return i!==e&&(n=!0,r=A(r,i)),i});return n?{...e,surfaces:i,contentBlocks:r}:e}function j(e,t){if(!e.surfaces?.length)return e;let n=e.surfaces.filter(t);if(n.length===e.surfaces.length)return e;let r=new Set(e.surfaces.filter(e=>!t(e)).map(e=>e.surfaceId));return{...e,surfaces:n,contentOrder:e.contentOrder?.filter(e=>!(e.type===`surface`&&r.has(e.id))),contentBlocks:e.contentBlocks?.filter(e=>!(e.type===`surface`&&r.has(e.surface.surfaceId)))}}var rt=500,it=s({keyFn:e=>`vellum:dismissed-surfaces:${e}`,scope:`user`,parseValue:e=>$e(e)?e:null,fallback:{},maxEntries:200});function at(e,t){let n=it.get(e,t);return n?new Set(n):new Set}function ot(e,t,n){let r=Array.from(n);r.length>rt&&(r=r.slice(r.length-rt)),it.set(e,t,r)}var st=[];function ct(e,t){if(!e)return st;if(t.size===0)return e;let n=!1,r=e.map(e=>{let r=j(e,e=>!t.has(e.surfaceId));return r!==e&&(n=!0),r});return n?r:e}function lt(e){if(!e||typeof e!=`object`)return!1;let t=e;return!(typeof t.tokens!=`number`||!Number.isFinite(t.tokens)||t.maxTokens!==null&&(typeof t.maxTokens!=`number`||!Number.isFinite(t.maxTokens))||t.fillRatio!==null&&(typeof t.fillRatio!=`number`||!Number.isFinite(t.fillRatio)))}var ut=s({keyFn:e=>`vellum:ctxwindow:${e}`,scope:`user`,parseValue:e=>lt(e)?e:null,fallback:{},maxEntries:200});function dt(e){return new Map(Object.entries(ut.load(e)))}function ft(e,t,n){ut.set(e,t,n)}var pt=`PROVIDER_BILLING`,mt=`PROVIDER_NOT_CONFIGURED`,ht=`MANAGED_KEY_INVALID`,gt=`credits_exhausted`,_t=`provider_billing`;function vt(e){return e?.errorCategory?e.errorCategory.endsWith(gt):e?.code===pt}function yt(e){return e?.errorCategory?e.errorCategory.endsWith(_t):!1}function bt(e){return vt(e)?`managed_credits`:yt(e)?`provider_billing`:null}function M(e){return bt(e)!==null||e?.code===mt||e?.displayAs===`modal`}function xt(e){return!!e&&!M(e)}function St(e){return e?.code===ht}var Ct={pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,pendingContactRequest:null,isSubmittingContactRequest:!1,contactRequestAccepted:!1,pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1,inlineConfirmationToolCallId:null,unknownNudgeToolCallIds:new Set},N=o(a()((e,t)=>({...Ct,showSecret:n=>{let{pendingSecret:r}=t();if(r&&r.requestId===n.requestId){let t={};for(let e of Object.keys(n))n[e]!==void 0&&(t[e]=n[e]);e({pendingSecret:{...r,...t}});return}e({pendingSecret:n,isSubmittingSecret:!1,secretSaved:!1})},submitSecretStart:()=>e({isSubmittingSecret:!0}),submitSecretEnd:t=>e({isSubmittingSecret:!1,secretSaved:t??!1}),dismissSecret:()=>e({pendingSecret:null,isSubmittingSecret:!1}),updateSecret:(n,r)=>{let{pendingSecret:i}=t();!i||i.requestId!==n||e({pendingSecret:{...i,...r}})},showConfirmation:t=>e({pendingConfirmation:t,isSubmittingConfirmation:!1}),submitConfirmationStart:()=>e({isSubmittingConfirmation:!0}),submitConfirmationEnd:()=>e({isSubmittingConfirmation:!1}),dismissConfirmation:()=>e({pendingConfirmation:null,isSubmittingConfirmation:!1}),dismissConfirmationIfMatches:n=>{let{pendingConfirmation:r}=t();!r||r.requestId!==n||e({pendingConfirmation:null,isSubmittingConfirmation:!1})},updateConfirmation:(n,r)=>{let{pendingConfirmation:i}=t();!i||i.requestId!==n||e({pendingConfirmation:{...i,...r}})},setInlineConfirmationToolCallId:t=>e({inlineConfirmationToolCallId:t}),showContactRequest:t=>e({pendingContactRequest:t,isSubmittingContactRequest:!1,contactRequestAccepted:!1}),submitContactRequestStart:()=>e({isSubmittingContactRequest:!0}),submitContactRequestEnd:()=>e({isSubmittingContactRequest:!1}),dismissContactRequest:()=>e({pendingContactRequest:null,isSubmittingContactRequest:!1}),acceptContactRequest:()=>e({contactRequestAccepted:!0}),showQuestion:t=>e({pendingQuestion:t,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),submitQuestionStart:()=>e({isSubmittingQuestion:!0}),submitQuestionEnd:()=>e({isSubmittingQuestion:!1}),dismissQuestion:()=>e({pendingQuestion:null,isSubmittingQuestion:!1,isQuestionCardDismissed:!1}),dismissQuestionCard:()=>e({isQuestionCardDismissed:!0}),resetSecretAndConfirmation:()=>e({pendingSecret:null,isSubmittingSecret:!1,secretSaved:!1,pendingConfirmation:null,isSubmittingConfirmation:!1,inlineConfirmationToolCallId:null}),addUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;r.has(n)||e({unknownNudgeToolCallIds:new Set([...r,n])})},removeUnknownNudgeToolCallId:n=>{let r=t().unknownNudgeToolCallIds;if(!r.has(n))return;let i=new Set(r);i.delete(n),e({unknownNudgeToolCallIds:i})},resetAll:()=>e(Ct)})));function wt(e){if(e.length===0)return``;let t=e[0]??``;for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n][0];r&&i&&r!==` `&&r!==`
|
|
2
2
|
`&&r!==` `&&i!==` `&&i!==`
|
|
3
3
|
`&&i!==` `&&(t+=` `),t+=e[n]}return t}function P(e){let t=[];for(let n of e?.contentBlocks??[])n.type===`text`&&t.push(n.text);return wt(t)}function Tt(e){if(!(!e||e.length===0))return e.map(e=>{let{previewUrl:t,thumbnailUrl:n}=te(e.mimeType,e.data,e.thumbnailData,e.id!=null);return{id:e.id??e.filename,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes??(e.data?Math.floor(e.data.length*3/4):0),previewUrl:t,thumbnailUrl:n}})}function F(e){let t=e[e.length-1];return!!t&&t.role===`assistant`}function Et(e,t){if(!t)return null;let n=e.length-1;for(;n>=0&&e[n].role===`user`&&e[n].queueStatus===`queued`;)n--;let r=e[n];return!r||r.role!==`assistant`?null:r.id}function I(e,t){return e.findIndex(e=>e.role===`assistant`&&(e.id===t||!!e.mergedMessageIds?.includes(t)))}function L(e,t){if(!t||e.id===t)return e;let n=e.mergedMessageIds??[];return n.includes(t)?e:{...e,mergedMessageIds:[...n,t]}}function R(e,t=Date.now()){if(!e.toolCalls?.some(e=>p(e)))return null;let n=t;return{toolCalls:e.toolCalls.map(e=>p(e)?{...e,completedAt:n}:e),contentBlocks:e.contentBlocks?.map(e=>e.type===`tool_use`&&p(e.toolCall)?{type:`tool_use`,toolCall:{...e.toolCall,completedAt:n}}:e)}}function Dt(e,t,n){return e.map(e=>e.id===t?{...e,queuePosition:n}:e)}function Ot(e,t){return e.map(e=>e.id===t?{...e,queueStatus:void 0,queuePosition:void 0}:e)}function kt(e,t){return e.filter(e=>e.id!==t)}function At(e,t,n,r=Date.now()){return[...e,{id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,textSegments:[t],contentOrder:[{type:`text`,id:`0`}],contentBlocks:[{type:`text`,text:t}],timestamp:r}]}function jt(e,t,n){n&&e[e.length-1]?.type===t.type?e[e.length-1]=t:e.push(t)}function z(e,t,n,r){let i=L(e[t],r),a=[...i.textSegments??[]],o=[...i.contentOrder??[]],s=[...i.contentBlocks??[]],c=o[o.length-1]?.type===`text`&&a.length>0;c?a[a.length-1]=a[a.length-1]+n:(o.push({type:`text`,id:String(a.length)}),a.push(n)),jt(s,{type:`text`,text:a[a.length-1]},c);let l=[...e];return l[t]={...i,textSegments:a,contentOrder:o,contentBlocks:s},l}function B(e,t,n,r){let i=L(e[t],r),a=[...i.thinkingSegments??[]],o=[...i.contentOrder??[]],s=[...i.contentBlocks??[]],c=o[o.length-1]?.type===`thinking`&&a.length>0;c?a[a.length-1]=a[a.length-1]+n:(o.push({type:`thinking`,id:String(a.length)}),a.push(n)),jt(s,{type:`thinking`,thinking:a[a.length-1]},c);let l=[...e];return l[t]={...i,thinkingSegments:a,contentOrder:o,contentBlocks:s},l}function Mt(e,t,n,r,i=Date.now()){if(n){let a=I(e,n);if(a>=0)return z(e,a,t,n);if(F(e))return z(e,e.length-1,t,n);let o=r?.();return o?z([...e,o],e.length,t,n):At(e,t,n,i)}return F(e)?z(e,e.length-1,t,void 0):At(e,t,n,i)}function Nt(e,t,n,r=Date.now()){return[...e,{id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,thinkingSegments:[t],contentOrder:[{type:`thinking`,id:`0`}],contentBlocks:[{type:`thinking`,thinking:t}],timestamp:r}]}function Pt(e,t,n,r,i=Date.now()){if(n){let a=I(e,n);if(a>=0)return B(e,a,t,n);if(F(e))return B(e,e.length-1,t,n);let o=r?.();return o?B([...e,o],e.length,t,n):Nt(e,t,n,i)}return F(e)?B(e,e.length-1,t,void 0):Nt(e,t,n,i)}function Ft(e,t=Date.now()){let n=!1,r=e.map(e=>{if(e.role!==`assistant`)return e;let r=R(e,t);return r?(n=!0,{...e,...r}):e});return n?r:e}function It(e,t,n=Date.now()){let r=e[e.length-1],i=Tt(t.attachments);if(r?.role!==`assistant`)return i?[...e,{id:t.messageId??crypto.randomUUID(),...t.messageId?{}:{isOptimistic:!0},role:`assistant`,timestamp:n,attachments:i}]:e;let a=R(r,n),o=r.isOptimistic===!0&&!!t.messageId;return[...e.slice(0,-1),{...r,...o?{id:t.messageId,isOptimistic:!1}:{},...i?{attachments:i}:{},...a??{}}]}function Lt(e,t){if(t!==void 0)return e.findIndex(e=>e.role===`user`&&e.clientMessageId===t);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.role===`user`&&n.isOptimistic===!0)return t}return-1}function Rt(e,t,n=Date.now()){let r=t.messageId;if(r!==void 0&&e.some(e=>e.role===`user`&&(e.id===r||e.mergedMessageIds?.includes(r))))return e;let i=Lt(e,t.clientMessageId);if(i!==-1){if(r===void 0)return e;let t=[...e];return t[i]={...t[i],id:r,isOptimistic:!1,queueStatus:void 0,queuePosition:void 0},t}return[...e,{id:r??crypto.randomUUID(),...r===void 0?{isOptimistic:!0}:{},...t.clientMessageId?{clientMessageId:t.clientMessageId}:{},role:`user`,textSegments:[t.text],contentOrder:[{type:`text`,id:`0`}],contentBlocks:[{type:`text`,text:t.text}],timestamp:n}]}function zt(e,t=Date.now()){let n=e.length-1,r=e[n];if(!r||r.role!==`assistant`)return e;let i=R(r,t);if(!(P(r).trim().length>0||r.thinkingSegments!=null&&r.thinkingSegments.length>0||r.toolCalls!=null&&r.toolCalls.length>0||r.surfaces!=null&&r.surfaces.length>0))return e.slice(0,-1);let a=[...e];return a[n]={...r,...i??{}},a}function V(e,t){let n=[...e??[]],r=n.findIndex(e=>e.type===`tool_use`&&e.toolCall.id===t.id);return r===-1?n.push({type:`tool_use`,toolCall:t}):n[r]={type:`tool_use`,toolCall:t},n}function H(e,t,n,r){let i=L(e[t],r),a=i.toolCalls?.findIndex(e=>e.id===n.id)??-1,o=[...e];if(a!==-1){let e=[...i.toolCalls??[]],r={...e[a],...n};return e[a]=r,o[t]={...i,toolCalls:e,contentBlocks:V(i.contentBlocks,r)},o}return o[t]={...i,toolCalls:[...i.toolCalls??[],n],contentOrder:[...i.contentOrder??[],{type:`toolCall`,id:n.id}],contentBlocks:V(i.contentBlocks,n)},o}function Bt(e,t,n,r=Date.now()){if(n){let r=I(e,n);if(r>=0)return H(e,r,t,n);if(F(e))return H(e,e.length-1,t,n)}else if(F(e))return H(e,e.length-1,t);return[...e,{id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,toolCalls:[t],contentOrder:[{type:`toolCall`,id:t.id}],contentBlocks:[{type:`tool_use`,toolCall:t}],timestamp:r}]}function Vt(e,t){let n=-1,r=-1;if(t.toolUseId)for(let i=e.length-1;i>=0;i--){let a=e[i];if(a?.role!==`assistant`||!a.toolCalls?.length)continue;let o=a.toolCalls.findIndex(e=>e.id===t.toolUseId);if(o!==-1){n=i,r=o;break}}if(n===-1){if(n=e.findLastIndex(e=>e.role===`assistant`&&e.toolCalls&&e.toolCalls.length>0),n===-1)return e;let t=e[n];if(!t?.toolCalls)return e;r=t.toolCalls.findLastIndex(e=>p(e))}if(r===-1)return e;let i=e[n],a=i.toolCalls[r];if(!a)return e;let o=t.imageDataList===void 0?t.imageData===void 0?void 0:[t.imageData]:t.imageDataList,s=t.imageData===void 0?o?.[0]:t.imageData,c=[...i.toolCalls],l={...a,result:t.result,isError:t.isError,riskLevel:t.riskLevel,riskReason:t.riskReason,matchedTrustRuleId:t.matchedTrustRuleId,approvalMode:t.approvalMode,approvalReason:t.approvalReason,riskThreshold:t.riskThreshold,riskAllowlistOptions:t.riskAllowlistOptions,riskScopeOptions:t.riskScopeOptions,riskDirectoryScopeOptions:t.riskDirectoryScopeOptions,...s===void 0?{}:{imageData:s},...o===void 0?{}:{imageDataList:o},...t.activityMetadata===void 0?{}:{activityMetadata:t.activityMetadata},completedAt:t.completedAt??Date.now(),streamedOutput:void 0};c[r]=l;let u=[...e];return u[n]={...i,toolCalls:c,contentBlocks:V(i.contentBlocks,l)},u}var Ht=16384;function Ut(e){return e.length<=16384?e:e.slice(e.length-Ht)}function Wt(e,t){if(!t.chunk)return e;let n=-1,r=-1;if(t.toolUseId){if(t.messageId){let i=I(e,t.messageId);if(i>=0){let a=e[i].toolCalls?.findIndex(e=>e.id===t.toolUseId)??-1;a!==-1&&(n=i,r=a)}}if(n===-1)for(let i=e.length-1;i>=0;i--){let a=e[i];if(a?.role!==`assistant`||!a.toolCalls?.length)continue;let o=a.toolCalls.findIndex(e=>e.id===t.toolUseId);if(o!==-1){n=i,r=o;break}}}else{if(n=e.findLastIndex(e=>e.role===`assistant`&&e.toolCalls&&e.toolCalls.length>0),n===-1)return e;let t=e[n];if(!t?.toolCalls)return e;r=t.toolCalls.findLastIndex(e=>p(e))}if(n===-1||r===-1)return e;let i=e[n],a=i.toolCalls[r];if(!a)return e;let o={...a,streamedOutput:Ut((a.streamedOutput??``)+t.chunk)},s=[...i.toolCalls];s[r]=o;let c=[...e];return c[n]={...i,toolCalls:s,contentBlocks:V(i.contentBlocks,o)},c}function Gt(e,t,n,r=Date.now()){let i=-1;if(n&&(i=I(e,n)),i===-1){for(let t=e.length-1;t>=0;t--)if(e[t]?.role===`assistant`){i=t;break}}let a=[...e];if(i===-1)a.push({id:n??crypto.randomUUID(),...n?{}:{isOptimistic:!0},role:`assistant`,surfaces:[t],contentOrder:[{type:`surface`,id:t.surfaceId}],contentBlocks:[{type:`surface`,surface:t}],timestamp:r});else{let r=L(e[i],n);if(r.contentOrder?.some(e=>e.type===`surface`&&e.id===t.surfaceId)||r.surfaces?.some(e=>e.surfaceId===t.surfaceId))return e;a[i]={...r,surfaces:[...r.surfaces??[],t],contentOrder:[...r.contentOrder??[],{type:`surface`,id:t.surfaceId}],contentBlocks:A(r.contentBlocks,t)}}return a}function Kt(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r],a=i.surfaces?.findIndex(e=>e.surfaceId===t)??-1;if(a===-1)continue;let o=i.surfaces[a],s={...o.data,...n};o.data.templateData&&n.templateData&&typeof o.data.templateData==`object`&&typeof n.templateData==`object`&&(s.templateData={...o.data.templateData,...n.templateData});let c={...o,data:s},l=[...e],u=[...i.surfaces];return u[a]=c,l[r]={...i,surfaces:u,contentBlocks:A(i.contentBlocks,c)},l}return e}function qt(e,t){for(let n=e.length-1;n>=0;n--){if(!e[n].surfaces?.some(e=>e.surfaceId===t))continue;let r=[...e];return r[n]={...e[n],surfaces:e[n].surfaces?.filter(e=>e.surfaceId!==t),contentOrder:e[n].contentOrder?.filter(e=>!(e.type===`surface`&&e.id===t)),contentBlocks:tt(e[n].contentBlocks,t)},r}return e}function Jt(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r].surfaces?.find(e=>e.surfaceId===t);if(!i)continue;let a={...i,completed:!0,completionSummary:n},o=[...e];return o[r]={...e[r],surfaces:e[r].surfaces?.map(e=>e.surfaceId===t?a:e),contentBlocks:A(e[r].contentBlocks,a)},o}return e}var Yt=[`choice`,`oauth_connect`,`form`,`confirmation`,`file_upload`,`card`,`list`,`table`,`browser_view`,`task_preferences`];function Xt(e){return e==null||e.hasPendingConfirmation||e.hasUncompletedVisibleSurface}function Zt(e,t){let n=!1,r=e.map(e=>{let r=re(e,e=>e.pendingConfirmation?.requestId===t?{...e,pendingConfirmation:void 0}:e);return r!==e&&(n=!0),r});return n?r:e}function Qt(e){let t=!1,n=e.map(e=>{let n=re(e,e=>e.pendingConfirmation?{...e,pendingConfirmation:void 0}:e);return n!==e&&(t=!0),n});return t?n:e}function $t(e,t){let n=new Set;for(let e of t)if(e.surfaces)for(let t of e.surfaces)ie(t)&&n.add(t.surfaceId);return n.size===0?{updatedMessages:e,dismissedIds:n}:{updatedMessages:e.map(e=>j(e,e=>!n.has(e.surfaceId))),dismissedIds:n}}function en(e,t,n,r){for(let i=e.length-1;i>=0;i--){let a=e[i].surfaces?.find(e=>e.surfaceId===t);if(!a)continue;if(!Yt.includes(a.surfaceType))return e;let o=a.actions?.find(e=>e.id===n),s=n===`cancel`||n===`dismiss`||o?.style===`secondary`,c=[...e];return c[i]=nt(e[i],e=>e.surfaceId===t?{...e,completed:!0,completionSummary:s?`Cancelled`:r??o?.label??void 0}:e),c}return e}function tn(e,t,n){return e&&ne[e]||t||n}function U(e){return typeof e==`string`?e:void 0}function nn(e){return typeof e==`boolean`?e:void 0}function rn(e){return Array.isArray(e)?e:void 0}function an(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function W(e){return Array.isArray(e)?e:void 0}function on(e){return{requestId:typeof e.requestId==`string`?e.requestId:``,label:U(e.label),service:U(e.service),field:U(e.field),description:U(e.description),placeholder:U(e.placeholder),allowOneTimeSend:nn(e.allowOneTimeSend),allowedTools:rn(e.allowedTools),allowedDomains:rn(e.allowedDomains),purpose:U(e.purpose)}}function sn(e){let t={requestId:typeof e.requestId==`string`?e.requestId:``,title:U(e.title),description:U(e.description),toolName:U(e.toolName),riskLevel:U(e.riskLevel),riskReason:U(e.riskReason),allowlistOptions:W(e.allowlistOptions),scopeOptions:W(e.scopeOptions),directoryScopeOptions:W(e.directoryScopeOptions),persistentDecisionsAllowed:nn(e.persistentDecisionsAllowed),input:an(e.input),toolUseId:U(e.toolUseId)};return{confData:t,state:{...t,confirmLabel:U(e.confirmLabel),denyLabel:U(e.denyLabel)}}}function cn(){return`turn-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function ln(e,t){let n=Date.parse(e);return Number.isFinite(n)?n:typeof t==`number`?t:0}function un(e,t,n){switch(t.type){case`assistant_text_delta`:return Mt(e,t.text,t.messageId,void 0,n);case`assistant_thinking_delta`:return Pt(e,t.thinking,t.messageId,void 0,n);case`message_complete`:return It(e,t,n);case`user_message_echo`:return Rt(e,{text:t.text,messageId:t.messageId,clientMessageId:t.clientMessageId},n);case`assistant_activity_state`:return t.phase===`idle`?Ft(e,n):e;case`conversation_error`:return zt(e,n);case`tool_use_preview_start`:return Bt(e,{id:t.toolUseId,name:t.toolName,input:{},previewStartedAt:typeof t.previewStartedAt==`number`?t.previewStartedAt:n},t.messageId,n);case`tool_use_start`:return Bt(e,{id:t.toolUseId??`tool-${n}`,name:t.toolName,input:t.input,startedAt:`startedAt`in t&&typeof t.startedAt==`number`?t.startedAt:n,...`previewStartedAt`in t&&typeof t.previewStartedAt==`number`?{previewStartedAt:t.previewStartedAt}:{}},t.messageId,n);case`tool_result`:return Vt(e,{toolUseId:t.toolUseId,result:t.result,isError:t.isError,riskLevel:t.riskLevel,riskReason:t.riskReason,matchedTrustRuleId:t.matchedTrustRuleId,approvalMode:t.approvalMode,approvalReason:t.approvalReason,riskThreshold:t.riskThreshold,riskAllowlistOptions:t.riskAllowlistOptions,riskScopeOptions:t.riskScopeOptions,riskDirectoryScopeOptions:t.riskDirectoryScopeOptions,imageData:t.imageData,imageDataList:t.imageDataList,activityMetadata:t.activityMetadata,completedAt:`completedAt`in t&&typeof t.completedAt==`number`?t.completedAt:n});case`tool_output_chunk`:return t.chunk?Wt(e,{chunk:t.chunk,toolUseId:t.toolUseId,messageId:t.messageId}):e;case`ui_surface_show`:{let r={surfaceId:t.surfaceId,surfaceType:t.surfaceType,title:t.title,data:t.data,actions:t.actions,display:t.display};return r.display=d(r),Gt(e,r,t.messageId,n)}case`ui_surface_update`:return Kt(e,t.surfaceId,t.data);case`ui_surface_dismiss`:return qt(e,t.surfaceId);case`ui_surface_complete`:return Jt(e,t.surfaceId,t.summary);case`confirmation_request`:return f(e,{requestId:t.requestId,toolName:t.toolName,riskLevel:t.riskLevel,riskReason:t.riskReason,allowlistOptions:t.allowlistOptions,scopeOptions:t.scopeOptions,directoryScopeOptions:t.directoryScopeOptions,persistentDecisionsAllowed:t.persistentDecisionsAllowed,input:t.input,toolUseId:t.toolUseId}).updatedMessages;case`interaction_resolved`:return t.kind===`confirmation`||t.kind===`acp_confirmation`?Zt(e,t.requestId):e;default:return e}}function dn(e,t,n){if(e!==void 0){if(typeof n!=`number`)return e;switch(t.type){case`assistant_turn_start`:case`assistant_text_delta`:case`assistant_thinking_delta`:return!0;case`assistant_activity_state`:return t.phase!==`idle`;case`message_complete`:return!1;default:return e}}}function fn(e,t){let{seq:n}=t;if(typeof n==`number`&&typeof e.seq==`number`&&n<=e.seq)return e;let r=ln(t.emittedAt,n),i=un(e.messages,t.message,r),a=typeof n==`number`?Math.max(e.seq??-1,n):e.seq??null,o=dn(e.processing,t.message,n);return{...e,messages:i,seq:a,processing:o}}function pn(e,t){return t.reduce(fn,e)}function mn(e,t){return t===null?e:pn(e,t)}function hn(e){return[...new Set([e.id,...e.mergedMessageIds??[]].filter(e=>typeof e==`string`&&e.length>0))]}function G(e){let t=hn(e);return e.clientMessageId&&!t.includes(e.clientMessageId)?[...t,e.clientMessageId]:t}var gn={hasMore:!1,oldestTimestamp:null,isLoadingOlder:!1};function _n(){return{snapshot:null,optimisticSends:[],error:null,notice:null,isLoadingHistory:!0,transcriptPagination:{...gn},contextWindowUsage:null,ephemeralMetaResults:[],compactionCircuitOpenUntil:null,dismissedSurfaceIds:new Set,streamingMessageIds:new Set,pendingQueuedMessageIds:[],requestIdToMessageId:new Map,pendingLocalDeletions:new Set,confirmationToolCallMap:new Map,expandedToolCallIds:new Set,expandedCardIds:new Map,contextWindowUsageByConversation:new Map,previousConversationId:null,previousAssistantId:null,draftConversationIdResolution:!1}}function K(e,t){return typeof t==`function`?t(e):t}function vn(e,t){if(e.length===0)return e;let n=new Map;for(let e of t)for(let t of G(e))n.has(t)||n.set(t,e);let r=e.filter(e=>{let t;for(let r of G(e))if(t=n.get(r),t)break;return t?!!e.attachments?.length&&!t.attachments?.length:!0});return r.length===e.length?e:r}var q=o(a()((e,t)=>({..._n(),seedSnapshot:(n,r)=>{let i=t().snapshot;if(r.seq==null&&i!==null&&typeof i.seq==`number`){c(`history_seed_skipped_anchorless`,{conversationId:n,liveSeq:i.seq});return}let a=be(n,r.seq??null);if(a===null&&i!==null&&typeof i.seq==`number`&&typeof r.seq==`number`&&r.seq<i.seq){c(`history_seed_skipped_stale_anchor`,{conversationId:n,liveSeq:i.seq,fetchedSeq:r.seq});return}let o=mn(r,a);e(e=>({snapshot:o,optimisticSends:vn(e.optimisticSends,o.messages)}))},applyEnvelopeToSnapshot:t=>e(e=>e.snapshot?{snapshot:fn(e.snapshot,t)}:{}),addOptimisticSend:t=>e(e=>({optimisticSends:[...e.optimisticSends,t]})),setOptimisticSends:t=>e(e=>({optimisticSends:K(e.optimisticSends,t)})),patchSnapshotMessages:t=>e(e=>e.snapshot?{snapshot:{...e.snapshot,messages:t(e.snapshot.messages)}}:{}),setError:t=>e(e=>({error:K(e.error,t)})),setNotice:t=>e(e=>({notice:K(e.notice,t)})),setIsLoadingHistory:t=>e({isLoadingHistory:t}),setTranscriptPagination:t=>e(e=>({transcriptPagination:K(e.transcriptPagination,t)})),setContextWindowUsage:t=>e(e=>({contextWindowUsage:K(e.contextWindowUsage,t)})),setCompactionCircuitOpenUntil:t=>e(e=>({compactionCircuitOpenUntil:K(e.compactionCircuitOpenUntil,t)})),switchToConversation:({assistantId:n,activeConversationId:r})=>{let i=t();if(i.draftConversationIdResolution){e({draftConversationIdResolution:!1});return}let a=i.previousConversationId;if(a&&a!==r&&a){let e=N.getState();(e.pendingSecret||e.pendingConfirmation)&&u.getState().addAttentionConversationId(a)}let o=i.previousAssistantId!==null&&i.previousAssistantId!==n,s=o||i.previousAssistantId===null;c(`conversation_switch_reset`,{assistantId:n,conversationId:r,outgoingConversationId:a??null}),k.getState().handleConversationSwitch({previousKey:a??null,nextKey:r}),Ee.getState().resetTurn(),N.getState().resetAll(),o?k.getState().fullReset():k.getState().resetAttachments();let l=s?dt(n):i.contextWindowUsageByConversation;e({snapshot:null,optimisticSends:[],ephemeralMetaResults:[],error:M(i.error)?i.error:null,notice:null,isLoadingHistory:!0,transcriptPagination:{...gn},contextWindowUsage:l.get(r)??null,compactionCircuitOpenUntil:null,dismissedSurfaceIds:at(n,r),streamingMessageIds:new Set,pendingQueuedMessageIds:[],requestIdToMessageId:new Map,pendingLocalDeletions:new Set,confirmationToolCallMap:new Map,expandedToolCallIds:new Set,expandedCardIds:new Map,contextWindowUsageByConversation:l,previousConversationId:r,previousAssistantId:n,draftConversationIdResolution:!1})},markDraftResolution:()=>e({draftConversationIdResolution:!0}),setConfirmationToolCall:(t,n)=>e(e=>{let r=new Map(e.confirmationToolCallMap);return r.set(t,n),{confirmationToolCallMap:r}}),deleteConfirmationToolCall:t=>e(e=>{let n=new Map(e.confirmationToolCallMap);return n.delete(t),{confirmationToolCallMap:n}}),clearConfirmationToolCallMap:()=>e({confirmationToolCallMap:new Map}),addDismissedSurfaceId:t=>e(e=>{let n=new Set(e.dismissedSurfaceIds);return n.add(t),{dismissedSurfaceIds:n}}),addDismissedSurfaceIds:t=>e(e=>{let n=new Set(e.dismissedSurfaceIds);for(let e of t)n.add(e);return{dismissedSurfaceIds:n}}),batchUpdateStreamingMessageIds:(t,n)=>e(e=>{let r=new Set(e.streamingMessageIds);for(let e of t)r.add(e);for(let e of n)r.delete(e);return{streamingMessageIds:r}}),pushPendingQueuedMessageId:t=>e(e=>({pendingQueuedMessageIds:[...e.pendingQueuedMessageIds,t]})),shiftPendingQueuedMessageId:()=>{let n=t().pendingQueuedMessageIds;if(n.length===0)return;let[r,...i]=n;return e({pendingQueuedMessageIds:i}),r},setRequestIdMapping:(t,n)=>e(e=>{let r=new Map(e.requestIdToMessageId);return r.set(t,n),{requestIdToMessageId:r}}),popRequestIdMapping:n=>{let r=t().requestIdToMessageId,i=r.get(n);if(i!==void 0){let t=new Map(r);t.delete(n),e({requestIdToMessageId:t})}return i},addPendingLocalDeletion:t=>e(e=>{let n=new Set(e.pendingLocalDeletions);return n.add(t),{pendingLocalDeletions:n}}),consumePendingLocalDeletion:n=>{let r=t().pendingLocalDeletions;if(!r.has(n))return!1;let i=new Set(r);return i.delete(n),e({pendingLocalDeletions:i}),!0},setExpandedToolCallId:(t,n)=>e(e=>{let r=new Set(e.expandedToolCallIds);return n?r.add(t):r.delete(t),{expandedToolCallIds:r}}),setExpandedCardId:(t,n)=>e(e=>{let r=new Map(e.expandedCardIds);return r.set(t,n),{expandedCardIds:r}}),setContextWindowUsageForConversation:(t,n)=>e(e=>{let r=new Map(e.contextWindowUsageByConversation);return r.set(t,n),{contextWindowUsageByConversation:r}}),addEphemeralMetaResult:t=>e(e=>({ephemeralMetaResults:[...e.ephemeralMetaResults,t]})),clearEphemeralMetaResults:()=>e(e=>e.ephemeralMetaResults.length===0?e:{ephemeralMetaResults:[]})})));function J(e,t){if(t.length===0)return e;let n=new Map;for(let e of t)for(let t of G(e))n.has(t)||n.set(t,e);let r=[],i=new Set;for(let t of e){let e;for(let r of G(t)){let t=n.get(r);if(t){e=t;break}}if(e){i.has(e)||(r.push(e),i.add(e));continue}r.push(t)}for(let e of t)i.has(e)||r.push(e);return r}function yn(){let e=q.use.snapshot(),t=q.use.optimisticSends(),n=q.use.dismissedSurfaceIds();return(0,le.useMemo)(()=>J(ct(e?.messages,n),t),[e,t,n])}function Y(e,t,n=`…`){return e.length<=t?e:e.slice(0,t-n.length)+n}function bn(e){if(!e)return null;let t=e.split(`/`),n=t[t.length-1];return!n||n===`.`?null:n}function X(e,t){return Y(e,t,`...`)}function xn(e){if(!e)return null;let t=e.replace(/\s+/g,` `).trim().match(/(?:^|&&\s*|\|\|\s*|;\s*)(?:\S*\/)?assistant\s+browser\s+([^\s;&|]+)/i);if(!t)return null;let n=t[1].toLowerCase();return new Set([`navigate`,`click`,`type`,`screenshot`,`snapshot`,`scroll`,`hover`,`select`,`drag`,`wait`,`back`,`forward`,`refresh`,`close`,`tab`,`press_key`,`wait_for`,`extract`,`fill_credential`]).has(n)?n:`unknown`}function Z(e,t){let n=e.toLowerCase();return n!==`bash`&&n!==`host_bash`?null:xn(t)}function Sn(e){switch(e){case`navigate`:return`Opened a page`;case`click`:return`Clicked on the page`;case`type`:return`Typed on the page`;case`screenshot`:return`Took a screenshot`;case`snapshot`:return`Captured page snapshot`;case`scroll`:return`Scrolled the page`;case`hover`:return`Hovered on the page`;case`select`:return`Selected on the page`;case`drag`:return`Dragged on the page`;case`wait`:return`Waited for the page`;case`back`:return`Went back`;case`forward`:return`Went forward`;case`refresh`:return`Refreshed the page`;case`close`:return`Closed the tab`;case`tab`:return`Switched tabs`;case`press_key`:return`Pressed a key`;case`wait_for`:return`Waited for a condition`;case`extract`:return`Extracted page content`;case`fill_credential`:return`Filled a credential`;case`unknown`:return`Used the browser`}}function Cn(e){switch(e){case`navigate`:return`Opening a page`;case`click`:return`Clicking on the page`;case`type`:return`Typing on the page`;case`screenshot`:return`Taking a screenshot`;case`snapshot`:return`Capturing page snapshot`;case`scroll`:return`Scrolling the page`;case`hover`:return`Hovering on the page`;case`select`:return`Selecting on the page`;case`drag`:return`Dragging on the page`;case`wait`:return`Waiting for the page`;case`back`:return`Going back`;case`forward`:return`Going forward`;case`refresh`:return`Refreshing the page`;case`close`:return`Closing the tab`;case`tab`:return`Switching tabs`;case`press_key`:return`Pressing a key`;case`wait_for`:return`Waiting for a condition`;case`extract`:return`Extracting page content`;case`fill_credential`:return`Filling a credential`;case`unknown`:return`Using the browser`}}function wn(e){switch(e){case`navigate`:case`back`:case`forward`:case`tab`:return`compass`;case`click`:case`hover`:case`select`:case`drag`:case`scroll`:return`compass`;case`screenshot`:case`snapshot`:return`camera`;case`type`:case`press_key`:case`fill_credential`:return`compass`;case`wait`:case`wait_for`:case`refresh`:case`close`:return`compass`;case`extract`:return`compass`;case`unknown`:return`compass`}}function Tn(e,t){let n=e.toLowerCase();if(n===`bash`||n===`host_bash`){let e=t.command??t.cmd;if(typeof e==`string`)return e.replace(/\s+/g,` `).trim()}if(n===`file_read`||n===`host_file_read`||n===`file_write`||n===`host_file_write`||n===`file_edit`||n===`host_file_edit`){let e=t.file_path??t.path??t.filePath;if(typeof e==`string`)return e}if(n===`grep`||n===`glob`){let e=t.pattern??t.query;if(typeof e==`string`)return e}if(n===`web_search`){let e=t.query??t.search;if(typeof e==`string`)return e}return``}function En(e,t=``){let n=e.toLowerCase(),r=t.replace(/\s+/g,` `).trim(),i=bn(r),a=Z(e,r);if(a)return Sn(a);switch(n){case`bash`:case`host_bash`:return r?`Ran \`${X(r,30)}\``:`Ran a command`;case`file_read`:case`host_file_read`:return i?`Read ${i}`:`Read a file`;case`file_write`:case`host_file_write`:return i?`Wrote ${i}`:`Wrote a file`;case`file_edit`:case`host_file_edit`:return i?`Edited ${i}`:`Edited a file`;case`grep`:return r?`Searched for '${X(r,25)}'`:`Searched files`;case`glob`:return r?`Searched for ${X(r,25)}`:`Found files`;case`web_search`:return r?`Searched '${X(r,25)}'`:`Searched the web`;case`web_fetch`:return`Fetched a webpage`;default:return`Used ${e.replace(/_/g,` `)}`}}function Dn(e,t=``,n){let r=Z(e,t);if(r)return Cn(r);if(n){let t=e.toLowerCase();if(t===`app_create`||t===`app_refresh`||t===`app_update`)return n}switch(e.toLowerCase()){case`bash`:case`host_bash`:return`Running a command`;case`file_read`:case`host_file_read`:return`Reading a file`;case`file_write`:case`host_file_write`:return`Writing a file`;case`file_edit`:case`host_file_edit`:return`Editing a file`;case`grep`:return`Searching files`;case`glob`:return`Finding files`;case`web_search`:return`Searching the web`;case`web_fetch`:return`Fetching a webpage`;case`app_create`:return`Building your app`;case`app_refresh`:case`app_update`:return`Refreshing your app`;default:return`Running ${e.replace(/_/g,` `)}`}}function On(e){return e.split(/[_-]+/).filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `)}function kn(e,t=``){let n=Z(e,t);if(n)return wn(n);switch(e.toLowerCase()){case`bash`:case`host_bash`:return`terminal`;case`file_read`:case`host_file_read`:return`file-text`;case`file_write`:case`host_file_write`:return`file-plus`;case`file_edit`:case`host_file_edit`:return`pencil`;case`grep`:case`glob`:case`web_search`:return`search`;case`web_fetch`:return`globe`;default:return`wrench`}}var An=80;function Q(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim().length>0)return t}return``}function jn(e){if(!e)return``;let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}function Mn(e){if(!e.startsWith(`mcp__`))return null;let t=e.slice(5),n=t.indexOf(`__`);if(n===-1)return null;let r=t.slice(0,n),i=t.slice(n+2);return!r||!i?null:{serverName:r,toolMethod:i}}function $(e,t){let n=t&&typeof t==`object`?t:{},r=e.toLowerCase(),i=Q(n,`activity`,`reason`),a=Mn(e);if(a)return{title:`Using ${a.serverName}`,info:a.toolMethod,activity:i,iconName:`plug`};switch(r){case`bash`:case`host_bash`:return{title:`Working`,info:Y(Q(n,`command`,`cmd`).replace(/\s+/g,` `).trim(),An),activity:i,iconName:`terminal`};case`str_replace_editor`:case`text_editor`:{let e=Q(n,`command`).toLowerCase(),t=jn(Q(n,`path`,`file_path`,`filePath`));return e===`view`?{title:`Reading`,info:t,activity:i,iconName:`file`}:{title:`Editing`,info:t,activity:i,iconName:`pen`}}case`computer`:return{title:`Using computer`,info:Q(n,`action`),activity:i,iconName:`monitor`};case`skill_execute`:{let e=Q(n,`tool`);if(e){let t=n.input,r=$(e,t);return{...r,activity:i||r.activity}}return{title:`Using a skill`,info:Q(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`}}case`skill`:case`skill_invoke`:case`skill_load`:return{title:`Using a skill`,info:Q(n,`skill`,`name`,`skillName`),activity:i,iconName:`sparkle`};case`subagent_spawn`:return{title:`Spawning subagent`,info:Q(n,`label`,`objective`,`task`),activity:i,iconName:`user-plus`};default:return{title:e?`Running ${On(e)}`:`Running tool`,info:``,activity:i,iconName:`bolt`}}}function Nn(e){return $(e.name,e.input)}var Pn=[{open:`<thinking>`,close:`</thinking>`},{open:`<think>`,close:`</think>`}];function Fn(e){return Pn.some(t=>e.includes(t.open))}function In(e){if(!Fn(e))return null;let t=[],n=e=>{e.trim()&&t.push({type:`text`,text:e})},r=e=>{let n=e.trim();n&&t.push({type:`thinking`,thinking:n})},i=0;for(;;){let a=-1,o;for(let t of Pn){let n=e.indexOf(t.open,i);n!==-1&&(a===-1||n<a)&&(a=n,o=t)}if(!o)break;n(e.slice(i,a));let s=a+o.open.length,c=e.indexOf(o.close,s);if(c===-1)return r(e.slice(s)),t;r(e.slice(s,c)),i=c+o.close.length}return n(e.slice(i)),t}function Ln(e){return typeof e.id==`string`&&e.id.length>0}function Rn(e){return e.some(e=>e.type===`text`&&Fn(e.text))?e.flatMap(e=>{let t=e.type===`text`?In(e.text):null;return t?t.map(e=>e.type===`thinking`?{type:`thinking`,thinking:e.thinking}:{type:`text`,text:e.text}):[e]}):e}function zn(e,t){let n=t?.splitInlineThinking?Rn(e):e,r=[],i=null,a=()=>(i||(i={type:`activity`,items:[]},r.push(i)),i);for(let e of n)if(e.type===`thinking`){let t=a(),n=t.items[t.items.length-1];n?.type===`thinking`?(n.thinking=n.thinking?`${n.thinking}\n${e.thinking}`:e.thinking,e.startedAt!=null&&(n.startedAt=n.startedAt==null?e.startedAt:Math.min(n.startedAt,e.startedAt)),e.completedAt!=null&&(n.completedAt=n.completedAt==null?e.completedAt:Math.max(n.completedAt,e.completedAt))):t.items.push({type:`thinking`,thinking:e.thinking,startedAt:e.startedAt,completedAt:e.completedAt})}else if(e.type===`tool_use`){if(!Ln(e.toolCall))continue;a().items.push({type:`tool_use`,toolCall:e.toolCall})}else (e.type===`text`||e.type===`surface`)&&(i=null,r.push(e));return r}function Bn(e){let t=[],n=[];for(let r of e){if(r.type===`thinking`){r.thinking&&t.push({kind:`thinking`,text:r.thinking,startedAt:r.startedAt,completedAt:r.completedAt});continue}let e=r.toolCall;Vn(e)||(n.push(e),t.push({kind:`toolCall`,toolCall:e}))}return{cardItems:t,toolCalls:n}}function Vn(e){return!e.pendingConfirmation&&(e.name===`ui_show`||e.name===`ui_update`||e.name===`ui_dismiss`)}function Hn(e){if(e.name===`subagent_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`subagent_spawn`}function Un(e){if(e.name===`run_workflow`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`run_workflow`}function Wn(e){if(e.name===`acp_spawn`)return!0;if(e.name!==`skill_execute`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.tool===`acp_spawn`}function Gn(e){if(e.name!==`bash`&&e.name!==`host_bash`)return!1;let t=e.input;return typeof t!=`object`||!t?!1:t.background===!0}var Kn=new Set([`low`,`medium`,`high`]);function qn(e){let t=e?.toLowerCase();return t&&Kn.has(t)?t:`medium`}function Jn(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-strong)]`,text:`text-white`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-strong)]`,text:`text-black`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-strong)]`,text:`text-white`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,border:`border border-[var(--border-element)]`,label:`Workspace`};default:return{bg:`bg-[var(--content-secondary)]`,text:`text-white`,label:e??`Unknown`}}}function Yn(e){switch(e?.toLowerCase()){case`low`:return`Auto-approved at Conservative tolerance or higher`;case`medium`:return`Auto-approved at Relaxed tolerance or higher`;case`high`:return`Auto-approved only at Full Access tolerance`;default:return}}function Xn(e){switch(e?.toLowerCase()){case`low`:return{bg:`bg-[var(--system-positive-weak)]`,text:`text-[var(--system-positive-strong)]`,label:`Low`};case`medium`:return{bg:`bg-[var(--system-mid-weak)]`,text:`text-[var(--system-mid-strong)]`,label:`Medium`};case`high`:return{bg:`bg-[var(--system-negative-weak)]`,text:`text-[var(--system-negative-strong)]`,label:`High`};case`workspace`:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:`Workspace`};default:return{bg:`bg-[var(--surface-lift)]`,text:`text-[var(--content-secondary)]`,label:e?e.charAt(0).toUpperCase()+e.slice(1):`Unknown`}}}var Zn={unknown:2,low:0,medium:1,high:2},Qn={none:-1,low:0,medium:1,high:2};function $n(e,t,n){return e?.toLowerCase()!==`auto`||!n?!0:(Zn[(t??``).toLowerCase()]??-1)<=(Qn[n.toLowerCase()]??-1)}function er(e){switch(e){case`trust_rule_allowed`:return`· Auto-approved · Trust rule matched`;case`sandbox_auto_approve`:return null;case`platform_auto_approve`:return`· Auto-approved · Platform session`;default:return null}}function tr(e,t){return e===`sandbox_auto_approve`?{displayLevel:`workspace`,inherentRisk:t}:{displayLevel:t??`unknown`}}export{Ze as $,$t as A,F as B,J as C,Zt as D,G as E,Xt as F,xt as G,N as H,Ot as I,ot as J,M as K,Et as L,sn as M,on as N,Qt as O,tn as P,Qe as Q,kt as R,yn as S,hn as T,bt as U,P as V,St as W,nt as X,j as Y,et as Z,Dn as _,Yn as a,xe as at,On as b,Bn as c,_e as ct,Gn as d,me as dt,Xe as et,Un as f,fe as ft,Tn as g,ae as gt,$ as h,oe as ht,Xn as i,Ee as it,cn as j,en as k,zn as l,pe as lt,Nn as m,se as mt,er as n,we as nt,qn as o,ve as ot,Hn as p,ce as pt,ft as q,Jn as r,Te as rt,$n as s,ye as st,tr as t,k as tt,Wn as u,he as ut,kn as v,q as w,Y as x,En as y,Dt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jn as e}from"./sdk.gen-
|
|
1
|
+
import{Jn as e}from"./sdk.gen-BwnFjFcp.js";import{n as t,r as n,t as r}from"./api-errors-CrWDzVca.js";function i(e){let t=e.llm?.profiles;if(!t)return{};let n={};for(let[e,r]of Object.entries(t)){if(!r)continue;let t=r.label?.trim()||e,i=r.description?.trim()||void 0;n[e]={id:e,displayName:t,...i?{description:i}:{}}}return n}function a(e){let t=e,n=t.description??``;return{...e,description:n,cadenceDescription:t.cadenceDescription??n}}async function o(i){let{data:o,error:s,response:c}=await e({path:{assistant_id:i},throwOnError:!1});if(t(c,s,`Failed to load schedules.`),!c.ok)throw new r(c.status,n(s,c,`Failed to load schedules.`));return(o?.schedules??[]).map(a)}export{i as n,o as t};
|