PageSourceSearch

https://chat.lindy.ai/assets/labs-CqpSmtP3.js

js lindy.ai collected 2026-09-24 18:02:56 UTC 14,239 bytes, 1 lines download raw bytes

1import{j as e,r as a}from"./entry-BCe1jibU.js";import{gr as Z,gs as ee,gt as te,gu as ae,gv as se,gw as ne,gx as le,gy as ie,gz as oe,gA as re,gB as ce,gC as de,gD as ue,gE as me,gF as pe}from"./graphql-4Y3Cu4kt.js";import{u as q,a as k}from"./api-CXtf3Ayw.js";import{D as B,Q as H,E as W,a as c,b as o,g as U,C as X,f as z,J as K,N as _,e as x,c as J}from"./primitives-PzVjDGvc.js";import{c as O}from"./adminView-DkbsldBq.js";import"./adminLayout-OU-AekOj.js";import"./icons-B6i7AQrN.js";import"./pathPrefix-DU8I2oCO.js";import"./types-CjJu7saM.js";import"./auth-CgkXDIO7.js";import"./EvalCloneMarker-DeoTUGFR.js";import"./operations-Dn0xY-u2.js";import"./session-C75oaowB.js";import"./identity-X0DTFeA9.js";import"./Identity-QN8NXWkM.js";import"./billing-XWNTP5pu.js";import"./speechToText-BOPKEWM6.js";import"./types-CLw4uLQj.js";import"./shellCache-Br8NUPQk.js";import"./index-pNUg2pyP.js";const ge=Z,he=ae,xe=le,je=ie,be=se,ye=ne,ve=re,fe=oe;function ze(){const s=q(he,{},{fetchPolicy:"network-only"}),g=q(ve,{}),d=k(xe),f=k(je),r=k(be),R=k(ye),p=k(fe),[j,b]=a.useState("runs"),[y,h]=a.useState(""),[u,n]=a.useState(""),[m,v]=a.useState("500"),[Q,D]=a.useState(""),[V,N]=a.useState([]),[F,E]=a.useState(""),[G,w]=a.useState(""),[A,S]=a.useState(""),[T,$]=a.useState(null),[P,i]=a.useState(null),l=s.data?.adminEmailLabDatasets??[],M=s.data?.adminEmailLabRuns??[],C=()=>s.refresh();return e.jsxs(B,{title:"Email Lab",description:"Evaluate reply classification and draft generation against labeled Gmail datasets.",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:["runs","datasets","playground"].map(t=>e.jsx(O,{level:j===t?"primary":"outline",onClick:()=>b(t),children:t==="runs"?`Runs (${M.length})`:t==="datasets"?`Datasets (${l.length})`:"Playground"},t))}),e.jsxs(H,{loading:s.loading,error:s.error,onRetry:s.refresh,children:[j==="runs"?e.jsxs("div",{className:"space-y-4",children:[e.jsx(c,{title:"Start evaluation run",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(o,{value:Q,onChange:D,placeholder:"Run name"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map(t=>e.jsxs(U,{checked:V.includes(t.nodeId),onChange:L=>N(I=>L?[...I,t.nodeId]:I.filter(Y=>Y!==t.nodeId)),children:[t.name," (",t.emailCount,")"]},t.nodeId))}),e.jsx(O,{disabled:!Q.trim()||V.length===0,loading:r.loading,onClick:async()=>{const t=await r.mutate({input:{name:Q.trim(),datasetIds:V}});t.startEmailLabRun.message?i(t.startEmailLabRun.message):C()},children:"Start run"})]})}),M.length===0?e.jsx(W,{children:"No runs yet"}):M.map(t=>e.jsx(c,{title:t.name,children:e.jsxs("div",{className:"flex flex-wrap justify-between gap-3",children:[e.jsxs("div",{className:"text-sm text-slate-11",children:[e.jsxs("div",{children:[t.status," ·"," ",t.datasets.map(L=>L.name).join(", ")]}),e.jsx("div",{children:t.metrics?`${t.metrics.processedEmails}/${t.metrics.totalEmails} processed · precision ${t.metrics.precision??"—"} · recall ${t.metrics.recall??"—"} · F2 ${t.metrics.f2??"—"}`:"Metrics pending"})]}),e.jsx(X,{loading:R.loading,confirmation:`Delete run "${t.name}"?`,onConfirm:async()=>{await R.mutate({input:{runId:t.nodeId}}),C()},children:"Delete"})]})},t.nodeId))]}):null,j==="datasets"?e.jsxs("div",{className:"space-y-4",children:[e.jsxs(c,{title:"Create dataset",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[e.jsx(o,{value:y,onChange:h,placeholder:"Gmail address"}),e.jsx(o,{value:u,onChange:n,placeholder:"Dataset name"}),e.jsx(o,{type:"number",value:m,onChange:v,placeholder:"Max emails"})]}),e.jsx(O,{className:"mt-3",disabled:!y.trim()||!u.trim(),loading:d.loading,onClick:async()=>{const t=await d.mutate({input:{email:y.trim(),name:u.trim(),maxEmails:Number(m)}});t.createEmailLabDataset.message?i(t.createEmailLabDataset.message):C()},children:"Create dataset"})]}),l.map(t=>e.jsx(c,{title:t.name,children:e.jsxs("div",{className:"flex flex-wrap justify-between gap-3",children:[e.jsxs("div",{className:"text-sm text-slate-11",children:[t.gmailAddress," · ",t.emailCount," emails ·"," ",t.positiveCount," replied · ",t.negativeCount," ","not replied"]}),e.jsx(X,{loading:f.loading,confirmation:`Delete dataset "${t.name}" and all of its entries?`,onConfirm:async()=>{await f.mutate({input:{datasetId:t.nodeId}}),C()},children:"Delete"})]})},t.nodeId))]}):null,j==="playground"?e.jsx(c,{title:"Single email playground",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(o,{value:F,onChange:E,placeholder:"From"}),e.jsx(o,{value:G,onChange:w,placeholder:"Subject"}),e.jsx(z,{value:A,onChange:S,placeholder:"Email body",className:"min-h-40"}),e.jsx(O,{disabled:!F.trim()||!A.trim(),loading:p.loading,onClick:async()=>{const t=await p.mutate({input:{from:F,subject:G,bodyText:A,needsReplyPrompt:g.data?.adminEmailLabDefaults.needsReplyPrompt??"",generateReplyPrompt:g.data?.adminEmailLabDefaults.generateReplyPrompt??"",needsReplyModel:"lg",generateReplyModel:"lg"}});$(t.evalSingleEmail)},children:"Evaluate email"}),T?e.jsx(K,{value:T}):null]})}):null]}),P?e.jsx(_,{tone:"red",children:P}):null]})}const Se=ee,Ce=te;function Le(){const s=q(Se,{},{fetchPolicy:"network-only"}
1),g=k(Ce),[d,f]=a.useState(""),[r,R]=a.useState("All"),[p,j]=a.useState(""),[b,y]=a.useState(""),h=(s.data?.adminEmailLabV2Pairs??[]).filter(n=>{const m=n.latestLabel?.qualityScore??0;return`${n.inboundContext.subject??""} ${n.userSent.bodyText} ${n.lindyDraft.bodyText}`.toLowerCase().includes(d.toLowerCase())&&(r==="All"||r==="Needs attention"&&m<6||r==="Solid"&&m>=6&&m<8||r==="Excellent"&&m>=8)}),u=h.find(n=>n.id===p)??s.data?.adminEmailLabV2Pairs.find(n=>n.id===p);return e.jsxs(B,{title:"Email lab v2",description:"Compare Lindy drafts with what users actually sent and inspect judge labels.",actions:e.jsx(O,{loading:g.loading,onClick:async()=>{const n=await g.mutate({input:{draftType:"general",limit:50}});n.startEmailLabV2IngestAndLabel.data?(y(Object.entries(n.startEmailLabV2IngestAndLabel.data).map(([m,v])=>`${m}: ${v}`).join(", ")),s.refresh()):y(n.startEmailLabV2IngestAndLabel.message??"Ingest failed")},children:"Import & label 50 drafts"}),children:[b?e.jsx(_,{children:b}):null,e.jsx(c,{children:e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(o,{value:d,onChange:f,placeholder:"Search drafts..."}),e.jsx(J,{value:r,onChange:R,children:["All","Needs attention","Solid","Excellent"].map(n=>e.jsx("option",{children:n},n))})]})}),e.jsx(H,{loading:s.loading,error:s.error,onRetry:s.refresh,children:e.jsxs("div",{className:"grid min-w-0 gap-4 lg:grid-cols-[22rem_minmax(0,1fr)]",children:[e.jsx(c,{title:`Comparisons (${h.length})`,children:e.jsx("div",{className:"max-h-[65vh] space-y-2 overflow-y-auto",children:h.map(n=>e.jsxs("button",{type:"button",className:"w-full rounded-md border border-edge p-3 text-left hover:bg-slate-2",onClick:()=>j(n.id),children:[e.jsx("div",{className:"truncate font-medium",children:n.inboundContext.subject??"No subject"}),e.jsxs("div",{className:"text-xs text-slate-10",children:[n.latestLabel?.emailCategory??"Unlabeled"," · score"," ",n.latestLabel?.qualityScore??"—"]})]},n.id))})}),u?e.jsxs("div",{className:"space-y-4",children:[e.jsx(c,{title:"Inbound context",children:e.jsx(K,{value:u.inboundContext})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(c,{title:"Lindy draft",children:e.jsx("pre",{className:"whitespace-pre-wrap text-sm",children:u.lindyDraft.bodyText})}),e.jsx(c,{title:"User sent",children:e.jsx("pre",{className:"whitespace-pre-wrap text-sm",children:u.userSent.bodyText})})]}),e.jsx(c,{title:"Judge label",children:e.jsx(K,{value:u.latestLabel})})]}):e.jsx(W,{children:"Select a comparison"})]})})]})}function Xe(){const s=q(ge,{});return s.loading?e.jsx(B,{title:"Email lab v2",children:e.jsx(H,{loading:!0,error:null,children:null})}):s.error||!s.data?.me.enabledFeatureFlags.includes("email-lab-v2")?e.jsx(B,{title:"Page not found",children:e.jsx(W,{children:"This page is not available for your account."})}):e.jsx(Le,{})}const Re=ce,De=de;function Ye(){const s=q(Re,{}),g=k(De),[d,f]=a.useState(""),[r,R]=a.useState("AUTO"),[p,j]=a.useState(!0),[b,y]=a.useState(""),[h,u]=a.useState(""),[n,m]=a.useState(""),[v,Q]=a.useState(""),[D,V]=a.useState(""),[N,F]=a.useState(""),[E,G]=a.useState(""),[w,A]=a.useState(""),[S,T]=a.useState(null),[$,P]=a.useState(null),i=l=>l.trim()||null;return e.jsxs(B,{title:"Meeting recap lab",description:"Render the meeting recap email and thumbnail without sending it.",children:[e.jsx(H,{loading:s.loading,error:s.error,onRetry:s.refresh,children:e.jsx(c,{title:"Preview configuration",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{label:"Meeting",children:e.jsxs(J,{value:d,onChange:f,children:[e.jsx("option",{value:"",children:"Select a meeting…"}),(s.data?.meetingRecapLabMeetings??[]).map(l=>e.jsxs("option",{value:l.id,children:[l.title," ·"," ",new Date(l.meetingDate).toLocaleString()," ·"," ",l.externalAttendeeCount," external"]},l.id))]})}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[e.jsx(x,{label:"Face mode",children:e.jsxs(J,{value:r,onChange:R,children:[e.jsx("option",{value:"AUTO",children:"Auto detect"}),e.jsx("option",{value:"FACE",children:"Force person"}),e.jsx("option",{value:"NO_FACE",children:"Force no person"})]})}),e.jsx(x,{label:"Image model",children:e.jsx(J,{value:b||s.data?.meetingRecapLabDefaults.defaultModel||"",onChange:y,children:(s.data?.meetingRecapLabDefaults.availableModels??[]).map(l
1=>e.jsx("option",{value:l.slug,children:l.label},l.slug))})}),e.jsx(U,{checked:p,onChange:j,children:"Re-run guest-frame selection"})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(x,{label:"Quote override",children:e.jsx(o,{value:h,onChange:u})}),e.jsx(x,{label:"Subject override",children:e.jsx(o,{value:n,onChange:m})}),e.jsx(x,{label:"CTA line override",children:e.jsx(o,{value:v,onChange:Q})})]}),[["Image prompt override",D,V],["No-person image prompt override",N,F],["Vision gate prompt override",E,G],["Quote extraction prompt override",w,A]].map(([l,M,C])=>e.jsx(x,{label:l,children:e.jsx(z,{value:M,onChange:C,className:"font-mono text-xs"})},l)),e.jsx(O,{disabled:!d,loading:g.loading,onClick:async()=>{P(null);const l=await g.mutate({input:{meetingId:d,faceMode:r,regenerateFrame:p,modelOverride:i(b),imagePromptOverride:i(D),noPersonImagePromptOverride:i(N),gatePromptOverride:i(E),quotePromptOverride:i(w),quoteOverride:i(h),subjectOverride:i(n),ctaLineOverride:i(v)}});T(l.previewMeetingRecap.data??null),P(l.previewMeetingRecap.message??null)},children:"Preview recap"})]})})}),$?e.jsx(_,{tone:"red",children:$}):null,S?e.jsx(K,{value:S}):null]})}const Ne=me,Ee=pe,we=ue;function Ze(){const s=q(Ne,{first:50,after:null},{fetchPolicy:"network-only"}),g=k(Ee),[d,f]=a.useState(""),[r,R]=a.useState(""),[p,j]=a.useState(""),[b,y]=a.useState("0"),[h,u]=a.useState(!0),[n,m]=a.useState(!1),[v,Q]=a.useState(!1),[D,V]=a.useState(""),[N,F]=a.useState(""),[E,G]=a.useState(""),[w,A]=a.useState(""),[S,T]=a.useState(""),[$,P]=a.useState(""),i=q(we,{id:S},{disabled:!S,fetchPolicy:"network-only"}),l=i.data?.node?.status,M=i.refresh;a.useEffect(()=>{if(!S||l!=="running"&&l!=="queued")return;const t=window.setTimeout(()=>M(),2e3);return()=>window.clearTimeout(t)},[M,S,l]);const C=s.data?.cosSimulationOnboardingPromptVariants??[];return e.jsxs(B,{title:"COS Simulation",description:"Run Chief of Staff against synthetic context. Provider writes stay suppressed and send-shaped network requests trip the safety detector.",children:[e.jsx(_,{tone:"amber",children:"Simulation context is synthetic. Review every deliverable, suppressed action, and tripwire hit before locking evidence."}),e.jsx(c,{title:"Scenario",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[e.jsx(x,{label:"Prompt variant",children:e.jsxs(J,{value:p,onChange:t=>{j(t);const L=C.find(I=>I.key===t);L?.entries[0]&&f(L.entries[0].prompt)},children:[e.jsx("option",{value:"",children:"Custom prompt"}),C.map(t=>e.jsx("option",{value:t.key,children:t.name},t.key))]})}),e.jsx(x,{label:"Entry index",children:e.jsx(o,{type:"number",value:b,onChange:y})}),e.jsx(x,{label:"Model override",children:e.jsx(o,{value:r,onChange:R})})]}),e.jsx(x,{label:"Prompt",children:e.jsx(z,{value:d,onChange:f,className:"min-h-40"})}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-4",children:[e.jsx(o,{value:D,onChange:V,placeholder:"Persona name"}),e.jsx(o,{value:N,onChange:F,placeholder:"Persona email"}),e.jsx(o,{value:E,onChange:G,placeholder:"Persona location"}),e.jsx(o,{value:w,onChange:A,placeholder:"Persona phone"})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsx(U,{checked:h,onChange:u,children:"Simulate no-web results"}),e.jsx(U,{checked:n,onChange:m,children:"Fake Google connection"}),e.jsx(U,{checked:v,onChange:Q,children:"Fake Microsoft connection"})]}),e.jsx(O,{disabled:!d.trim(),loading:g.loading,onClick:async()=>{const t=D||N||E||w?{name:D||void 0,email:N||void 0,location:E||void 0,phone:w||void 0}:null,L=await g.mutate({input:{prompt:d,mode:"fresh-signup",model:r.trim()||null,noWeb:h,variantKey:p||null,entryIndex:p?Number(b):null,persona:t,connections:n||v?{google:n,microsoft:v}:null}}),I=L.runCosSimulation.data?.run;I?(T(I.nodeId),P(`Simulation ${I.id} started`),s.refresh()):P(L.runCosSimulation.message??"Run failed")},children:"Run simulation"})]})}),$?e.jsx(_,{children:$}):null,i.data?.node?e.jsx(K,{value:i.data.node}):null,e.jsx(H,{loading:s.loading,error:s.error,onRetry:s.refresh,children:e.jsx(c,{title:"Run history",children:e.jsx("div",{className:"space-y-2",children:(s.data?.cosSimulationRuns.edges??[]).map(({node:t})=>e.jsxs("button",{type:"button",className:"grid w-full gap-1 rounded-md border border-edge p-3 text-left sm:grid-cols-[1fr_auto]",onClick:()=>T(t.runNodeId),children:[e.jsx("span",{className:"truncate",children:t.prompt}),e.jsxs("span",{className:"text-xs text-slate-10",children:[t.status," · ",t.evidenceStatus," ·"," ",new Date(t.createdAt).toLocaleStr
1ing()]})]},t.id))})})})]})}export{Ze as CosSimulationView,Xe as EmailLabV2GatedView,Le as EmailLabV2View,ze as EmailLabView,Ye as MeetingRecapView};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.