(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,734550,e=>{"use strict";var t=e.i(659350),o=e.i(663456),n=e.i(136562),a=e.i(596376),r=e.i(530798);e.i(707060);var s=e.i(196991),i=e.i(288265),l=e.i(375702),d=e.i(901869);let u=e.i(156332).U.records.map((e,t)=>({id:`m${String(t+1).padStart(2,"0")}`,text:e})),c=({instructions:e,yes:t,no:o})=>({type:"noul",instructions:e,criteria:{true:t,false:o}}),p={cancel:c({instructions:"Is this customer at risk of cancelling?",yes:"They threaten to leave, plan to, or are shopping around.",no:"A question, a bug report, praise, or a routine request."}),refund:c({instructions:"Does this customer want money back?",yes:"Asks for a refund, a credit, or a reversed charge.",no:"Money is not the ask."}),angry:c({instructions:"Is this customer angry or frustrated?",yes:"Irritated, exasperated, threatening, or repeatedly let down.",no:"Neutral, curious, or pleased."}),bug:c({instructions:"Is this customer reporting something broken?",yes:"An error, crash, failure, or wrong behavior.",no:"A question or request about something that works."}),human:c({instructions:"Does this need a person, not a help article?",yes:"Account-specific, urgent, emotional, or needs a manual action.",no:"A generic how-to a help article fully answers."})},h=["cancel","refund","angry","bug","human"],m={cancel:"Cancelling",refund:"Refund",angry:"Angry",bug:"Bug",human:"Needs a person"},f=`import { OpenRouter } from '@openrouter/sdk'; const openRouter = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); // i18n-exempt: technical -- demo dataset sent to the model verbatim const q = (instructions, yes, no) => ({ type: 'noul', instructions, criteria: { true: yes, false: no } }); const questions = { // i18n-exempt: technical -- demo dataset sent to the model verbatim cancel: q('${p.cancel.instructions}', '${p.cancel.criteria?.true??""}', '${p.cancel.criteria?.false??""}'), // i18n-exempt: technical -- demo dataset sent to the model verbatim refund: q('${p.refund.instructions}', '${p.refund.criteria?.true??""}', '${p.refund.criteria?.false??""}'), // i18n-exempt: technical -- demo dataset sent to the model verbatim angry: q('${p.angry.instructions}', '${p.angry.criteria?.true??""}', '${p.angry.criteria?.false??""}'), // i18n-exempt: technical -- demo dataset sent to the model verbatim bug: q('${p.bug.instructions}', '${p.bug.criteria?.true??""}', '${p.bug.criteria?.false??""}'), // i18n-exempt: technical -- demo dataset sent to the model verbatim human: q('${p.human.instructions}', '${p.human.criteria?.true??""}', '${p.human.criteria?.false??""}'), }; // One request covers a batch of messages. Each question names the message it is about. const { answers } = await openRouter.alpha.decisions.create({ decisionsRequest: { // i18n-exempt: technical -- demo dataset sent to the model verbatim model: 'typesafe/jev-1.13', // i18n-exempt: technical -- demo dataset sent to the model verbatim state: { messages }, // [{ id: 'm01', text: '…' }, …] about 19 per request questions: Object.fromEntries(messages.flatMap((m) => Object.entries(questions).map(([key, question]) => [ \`$\{m.id}_$\{key}\`, // i18n-exempt: technical -- demo dataset sent to the model verbatim { ...question, instructions: \`$\{question.instructions} (message $\{m.id})\` }, ]))), }, }); answers.m01_cancel.noul; // 0.97, the probability of "yes"`;var g=e.i(797521),y=e.i(647204),w=e.i(16043),b=e.i(13718),v=e.i(595106);let k=u.length*h.length,S=[];for(let e=0;eh.map(t=>({m:e,k:t}))),q=(e,t)=>`${e}_${t}`;function x(e){return void 0===e?"text-muted-foreground/50":e>=.5?"font-medium text-foreground":"text-muted-foreground"}function j(e){return m[e]}var T=e.i(521965);let O={cancel:"w-24",refund:"w-20",angry:"w-16",bug:"w-14",human:"w-36"};function A(e){return(0,t.jsx)(r.TableHead,{className:"text-right",sortKey:e,sortFirstDirection:"descending",children:m[e]},e)}function C(e){return(0,t.jsx)("col",{className:O[e]},e)}e.s(["TriageRecipe",0,function(){let e,c,O,P,_,N,$,R,W,E,M,F,D,B,H,J,L,U,G,z,K,V,Y=(0,o.c)(80),Z=(0,i.f)(),{run:Q,llm:X,startedAt:ee,shown:et,sortKey:eo,answered:en,done:ea,both:er,agree:es,rows:ei,note:el,racing:ed,TOTAL:eu,setShown:ec,setSortKey:ep,start:eh,stop:em,value:ef,cellText:eg,mobileRowText:ey,cellClass:ew}=function(){let e,t,n,a,r,s,l,d,c,f,T,O,A,C,P,_,N,$,R,W,E,M=(0,o.c)(79),F=(0,i.f)(),D=(0,g.f)();M[0]===Symbol.for("react.memo_cache_sentinel")?(e={status:"idle",answers:{},requests:0,failed:0,cost:0},M[0]=e):e=M[0];let[B,H]=(0,w.useState)(e);M[1]===Symbol.for("react.memo_cache_sentinel")?(t={status:"idle",answers:{},calls:0,failed:0,cost:0},M[1]=t):t=M[1];let[J,L]=(0,w.useState)(t),[U,G]=(0,w.useState)(0),[z,K]=(0,w.useState)("jev"),[V,Y]=(0,w.useState)(null),Z=(0,w.useRef)(null);M[2]===Symbol.for("react.memo_cache_sentinel")?(n=()=>()=>Z.current?.abort(),a=[],M[2]=n,M[3]=a):(n=M[2],a=M[3]),(0,w.useEffect)(n,a),M[4]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{!function({abortRef:e,setRun:t,setLlm:o,setSortKey:n,setStartedAt:a}){e.current?.abort();let r=new AbortController;e.current=r,t({status:"sending",answers:{},requests:0,failed:0,cost:0}),o({status:"sending",answers:{},calls:0,failed:0,cost:0}),n(null);let s=performance.now();a(s),(0,v.f)({items:S,limit:S.length,fn:e=>(0,b.A)({state:{description:"Support messages from customers of a B2B software product.",messages:e},questions:Object.fromEntries(e.flatMap(e=>Object.entries(p).map(([t,o])=>[`${e.id}_${t}`,{...o,instructions:`${o.instructions} (message ${e.id})`}])))},r.signal),onSettle:(e,o)=>{if(r.signal.aborted)return;let n=(0,b.a)(o);t(e=>{if((0,y.V)(n))return{...e,requests:e.requests+1,failed:e.failed+1};let t={...e.answers};for(let[e,o]of Object.entries(n.data.answers))"noul"===o.type&&(t[e]=o.noul);return{...e,answers:t,requests:e.requests+1,cost:e.cost+(n.data.usage.cost??0)}})}}).then(e=>{if(r.signal.aborted)return;let o=e.map(b.a),a=o.every(y.V),i=o[0];t(e=>({...e,status:a?"error":"done",ms:Math.round(performance.now()-s),error:a&&i&&(0,y.V)(i)?i.error:void 0})),a||n(h[0]??null)}),(0,v.f)({items:I,limit:32,fn:({m:e,k:t})=>{let o,n;return(0,b.e)({model:"openai/gpt-6-luna",system:"Answer the question about the customer message. Reply only with JSON.",user:(o=p[t],n=e.text,`${o.instructions} Yes means: ${o.criteria?.true??""} No means: ${o.criteria?.false??""} Message: "${n}"`),schema:{type:"object",properties:{answer:{type:"boolean"}},required:["answer"],additionalProperties:!1}},r.signal)},onSettle:(e,t)=>{if(r.signal.aborted)return;let n=(0,b.a)(t);if((0,y.V)(n))return o(e=>({...e,calls:e.calls+1,failed:e.failed+1}));let a=I[e];a&&o(e=>({...e,answers:{...e.answers,[q(a.m.id,a.k)]:!!n.data.json.answer},calls:e.calls+1,cost:e.cost+(n.data.usage.cost??0)}))}}).then(e=>{if(r.signal.aborted)return;let t=e.filter(e=>(0,y.C)((0,b.a)(e))).length;o(e=>({...e,status:t?"done":"error",ms:Math.round(performance.now()-s)}))})}({abortRef:Z,setRun:H,setLlm:L,setSortKey:Y,setStartedAt:G})},M[4]=r):r=M[4];let Q=r;M[5]!==U?(s=()=>{Z.current?.abort();let e=Math.round(performance.now()-U);H(t=>"sending"===t.status?{...t,status:"done",ms:e,stopped:!0}:t),L(t=>"sending"===t.status?{...t,status:"done",ms:e,stopped:!0}:t)},M[5]=U,M[6]=s):s=M[6];let X=s;M[7]!==B.answers?(l=Object.keys(B.answers),M[7]=B.answers,M[8]=l):l=M[8];let ee=l.length,et="done"===B.status;M[9]!==B.answers?(d=(e,t)=>B.answers[q(e,t)],M[9]=B.answers,M[10]=d):d=M[10];let eo=d;M[11]!==J.answers?(c=(e,t)=>J.answers[q(e,t)],M[11]=J.answers,M[12]=c):c=M[12];let en=c;M[13]!==eo||M[14]!==en||M[15]!==z?(f=(e,t)=>(function({shown:e,jev:t,llm:o}){return"jev"===e?t:void 0!==o?+!!o:void 0})({shown:z,jev:eo(e,t),llm:en(e,t)}),M[13]=eo,M[14]=en,M[15]=z,M[16]=f):f=M[16];let ea=f;M[17]!==V||M[18]!==ea?(T=V?[...u].sort((e,t)=>(ea(t.id,V)??-1)-(ea(e.id,V)??-1)):u,M[17]=V,M[18]=ea,M[19]=T):T=M[19];let er=T;M[20]!==ea?(O=e=>u.filter(t=>(ea(t.id,e)??0)>=.5).length,M[20]=ea,M[21]=O):O=M[21];let es=O;M[22]!==J.answers?(A=Object.keys(J.answers),M[22]=J.answers,M[23]=A):A=M[23],M[24]!==B.answers||M[25]!==A?(C=A.filter(e=>void 0!==B.answers[e]),M[24]=B.answers,M[25]=A,M[26]=C):C=M[26];let ei=C;M[27]!==ei||M[28]!==J.answers||M[29]!==B.answers?(P=ei.filter(e=>{let t=B.answers[e];return void 0!==t&&t>=.5===J.answers[e]}),M[27]=ei,M[28]=J.answers,M[29]=B.answers,M[30]=P):P=M[30];let el=P.length;if(M[31]!==ee||M[32]!==et||M[33]!==F||M[34]!==es||M[35]!==B.stopped||M[36]!==z){let e;M[38]!==es?(e=e=>`${es(e)} ${m[e].toLowerCase()}`,M[38]=es,M[39]=e):e=M[39],_=function({shown:e,stopped:t,done:o,answered:n,likely:a,gt:r}){return"jev"===e&&t?r("Stopped after {answered} of {total} answers.",{answered:n,total:k}):"jev"===e&&o?r("Likely yes: {answers}.",{answers:a}):void 0}({shown:z,stopped:B.stopped,done:et,answered:ee,likely:h.map(e).join(" · "),gt:F}),M[31]=ee,M[32]=et,M[33]=F,M[34]=es,M[35]=B.stopped,M[36]=z,M[37]=_}else _=M[37];let ed=_;M[40]!==F||M[41]!==J.status||M[42]!==J.stopped||M[43]!==B.status||M[44]!==z?(N=function({shown:e,runStatus:t,llmStatus:o,llmStopped:n,gt:a}){return"jev"===e&&"sending"===t||"llm"===e&&"sending"===o?"…":"llm"!==e||n?"":a("failed")}({shown:z,runStatus:B.status,llmStatus:J.status,llmStopped:J.stopped,gt:F}),M[40]=F,M[41]=J.status,M[42]=J.stopped,M[43]=B.status,M[44]=z,M[45]=N):N=M[45];let eu=N;M[46]!==eu||M[47]!==D||M[48]!==F||M[49]!==z?($=e=>void 0===e?eu:"jev"===z?D.ratio(e,{preset:"metric-exact"})??"—":e?F("Yes"):F("No"),M[46]=eu,M[47]=D,M[48]=F,M[49]=z,M[50]=$):$=M[50];let ec=$;M[51]!==D||M[52]!==z||M[53]!==ea?(R=(e,t)=>"jev"===z?t.map(t=>{let o=D.ratio(ea(e,t),{preset:"metric-exact"});return`${m[t]} ${o??"—"}`}).join(" · "):t.map(j).join(" · "),M[51]=D,M[52]=z,M[53]=ea,M[54]=R):R=M[54];let ep=R;M[55]!==eu||M[56]!==F||M[57]!==ep||M[58]!==B.status?(W=e=>{let{messageId:t,asked:o,keys:n}=e;return"idle"!==B.status&&o?n.length?ep(t,n):F("No to all five"):"idle"===B.status?"":eu},M[55]=eu,M[56]=F,M[57]=ep,M[58]=B.status,M[59]=W):W=M[59];let eh=W,em="sending"===B.status||"sending"===J.status;return M[60]!==el||M[61]!==ee||M[62]!==ei||M[63]!==ec||M[64]!==et||M[65]!==eu||M[66]!==es||M[67]!==J||M[68]!==eh||M[69]!==ed||M[70]!==em||M[71]!==er||M[72]!==B||M[73]!==z||M[74]!==V||M[75]!==U||M[76]!==X||M[77]!==ea?(E={run:B,llm:J,startedAt:U,shown:z,sortKey:V,answered:ee,done:et,both:ei,agree:el,rows:er,note:ed,empty:eu,racing:em,TOTAL:k,setShown:K,setSortKey:Y,start:Q,stop:X,value:ea,likely:es,cellText:ec,mobileRowText:eh,cellClass:x},M[60]=el,M[61]=ee,M[62]=ei,M[63]=ec,M[64]=et,M[65]=eu,M[66]=es,M[67]=J,M[68]=eh,M[69]=ed,M[70]=em,M[71]=er,M[72]=B,M[73]=z,M[74]=V,M[75]=U,M[76]=X,M[77]=ea,M[78]=E):E=M[78],E}();Y[0]===Symbol.for("react.memo_cache_sentinel")?(e={code:f,filename:"triage.ts"},Y[0]=e):e=Y[0],Y[1]!==Z?(c=Z("Run on 95 messages"),Y[1]=Z,Y[2]=c):c=Y[2],Y[3]!==Z?(O=Z("Run again"),Y[3]=Z,Y[4]=O):O=Y[4],Y[5]!==Z?(P=Z("Running…"),Y[5]=Z,Y[6]=P):P=Y[6];let eb=ed?"sending":Q.status;if(Y[7]!==eh||Y[8]!==em||Y[9]!==c||Y[10]!==O||Y[11]!==P||Y[12]!==eb?(_=(0,t.jsx)(d.K,{idle:c,again:O,running:P,status:eb,onClick:eh,onStop:em}),Y[7]=eh,Y[8]=em,Y[9]=c,Y[10]=O,Y[11]=P,Y[12]=eb,Y[13]=_):_=Y[13],Y[14]!==eu||Y[15]!==en||Y[16]!==X||Y[17]!==Q||Y[18]!==ee?(N="idle"!==Q.status?{startedAt:ee,jev:(0,T.I)(Q,{done:en,total:eu,calls:Q.requests}),llm:(0,T.i)(X,{total:eu})}:void 0,Y[14]=eu,Y[15]=en,Y[16]=X,Y[17]=Q,Y[18]=ee,Y[19]=N):N=Y[19],Y[20]!==es||Y[21]!==er.length?($={same:es,of:er.length},Y[20]=es,Y[21]=er.length,Y[22]=$):$=Y[22],Y[23]!==eu||Y[24]!==ec||Y[25]!==et||Y[26]!==_||Y[27]!==N||Y[28]!==$?(R=(0,t.jsx)(l.n,{controls:_,total:eu,shown:et,onShown:ec,llmName:"Chat model",race:N,agreement:$}),Y[23]=eu,Y[24]=ec,Y[25]=et,Y[26]=_,Y[27]=N,Y[28]=$,Y[29]=R):R=Y[29],Y[30]!==Q.error||Y[31]!==Q.status?(W="error"===Q.status&&(0,t.jsx)(a.J,{variant:"negative",children:Q.error}),Y[30]=Q.error,Y[31]=Q.status,Y[32]=W):W=Y[32],Y[33]!==ea||Y[34]!==Z||Y[35]!==Q.failed||Y[36]!==Q.requests?(E=ea&&Q.failed>0&&(0,t.jsx)(a.J,{variant:"warning",children:Z("{failed} of {requests} requests failed. Those rows stay empty.",{failed:Q.failed,requests:Q.requests})}),Y[33]=ea,Y[34]=Z,Y[35]=Q.failed,Y[36]=Q.requests,Y[37]=E):E=Y[37],Y[38]!==E||Y[39]!==R||Y[40]!==W?(M=(0,t.jsxs)(t.Fragment,{children:[R,W,E]}),Y[38]=E,Y[39]=R,Y[40]=W,Y[41]=M):M=Y[41],Y[42]!==el?(F=el&&(0,t.jsx)(d.N,{children:el}),Y[42]=el,Y[43]=F):F=Y[43],Y[44]!==eo?(D=eo?{key:eo,direction:"desc"}:null,Y[44]=eo,Y[45]=D):D=Y[45],Y[46]!==en||Y[47]!==ep?(B=en?e=>{let t=h.find(t=>t===e?.key);t&&ep(t)}:void 0,Y[46]=en,Y[47]=ep,Y[48]=B):B=Y[48],Y[49]===Symbol.for("react.memo_cache_sentinel")?(H=(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{}),h.map(C)]}),Y[49]=H):H=Y[49],Y[50]===Symbol.for("react.memo_cache_sentinel")?(J=(0,t.jsx)(r.TableHeader,{sticky:!0,children:(0,t.jsxs)(r.TableRow,{interactive:!1,children:[(0,t.jsx)(r.TableHead,{children:(0,t.jsx)(s.T,{children:"Message"})}),h.map(A)]})}),Y[50]=J):J=Y[50],Y[51]!==ew||Y[52]!==eg||Y[53]!==ei||Y[54]!==ef){let e;Y[56]!==ew||Y[57]!==eg||Y[58]!==ef?(e=e=>(0,t.jsxs)(r.TableRow,{children:[(0,t.jsx)(r.TableCell,{className:"or-table__cell--wrap-words",children:e.text}),h.map(o=>{let a=ef(e.id,o);return(0,t.jsx)(r.TableCell,{className:(0,n.f)("text-right tabular-nums transition-colors duration-300",ew(a)),children:eg(a)},o)})]},e.id),Y[56]=ew,Y[57]=eg,Y[58]=ef,Y[59]=e):e=Y[59],L=ei.map(e),Y[51]=ew,Y[52]=eg,Y[53]=ei,Y[54]=ef,Y[55]=L}else L=Y[55];if(Y[60]!==L?(U=(0,t.jsx)(r.TableBody,{children:L}),Y[60]=L,Y[61]=U):U=Y[61],Y[62]!==D||Y[63]!==B||Y[64]!==U?(G=(0,t.jsxs)(r.Table,{pageScroll:!0,containerClassName:"hidden md:block",sort:D,onSortChange:B,children:[H,J,U]}),Y[62]=D,Y[63]=B,Y[64]=U,Y[65]=G):G=Y[65],Y[66]!==ey||Y[67]!==ei||Y[68]!==ef){let e;Y[70]!==ey||Y[71]!==ef?(e=e=>{let o=h.some(t=>void 0!==ef(e.id,t)),n=h.filter(t=>(ef(e.id,t)??0)>=.5);return(0,t.jsxs)("li",{className:"flex flex-col gap-1 border-t border-border/50 px-4 py-3 first:border-t-0",children:[(0,t.jsx)("p",{className:"text-body text-foreground",children:e.text}),(0,t.jsx)("p",{className:"text-size-overline tabular-nums text-muted-foreground",children:ey({messageId:e.id,asked:o,keys:n})})]},e.id)},Y[70]=ey,Y[71]=ef,Y[72]=e):e=Y[72],z=ei.map(e),Y[66]=ey,Y[67]=ei,Y[68]=ef,Y[69]=z}else z=Y[69];return Y[73]!==z?(K=(0,t.jsx)("ul",{className:"rounded-(--radius-lg) border border-border md:hidden",children:z}),Y[73]=z,Y[74]=K):K=Y[74],Y[75]!==M||Y[76]!==F||Y[77]!==G||Y[78]!==K?(V=(0,t.jsxs)(d.B,{id:"triage",code:e,controls:M,children:[F,G,K]}),Y[75]=M,Y[76]=F,Y[77]=G,Y[78]=K,Y[79]=V):V=Y[79],V}],734550)},156332,e=>{"use strict";var t=e.i(628504);let o="anthropic/claude-haiku-4.5",n="You convert an LLM classification prompt into typed questions for Jev, a decision model that answers typed questions about a `record` with calibrated probabilities.\nRules:\n- Produce the fewest questions that capture every judgment the prompt asks for. One narrow, coherent judgment per question.\n- Use `choice` for one-of-N labels. Give every option a description of when it applies, and add an `other` or `none` option when nothing may fit.\n- Use `noul` for each independent yes/no label, with `true_when` and `false_when` describing concrete situations.\n- Use `score` for ordered degrees, with 2 to 6 levels whose descriptions are concrete situations, lowest first. The level index is the score.\n- Put the judgment in `instructions` and the answer definitions in options, levels or true_when/false_when. Refer to the text being judged as `record`.\n- ids are snake_case and stable. Never ask for free text, counting or arithmetic: Jev cannot count.\n- `state_description` is one sentence saying what a record is.",a={type:"object",properties:{state_description:{type:"string"},questions:{type:"array",items:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:["noul","choice","score"]},instructions:{type:"string"},options:{type:"array",items:{type:"object",properties:{name:{type:"string"},description:{type:"string"}},required:["name","description"],additionalProperties:!1}},levels:{type:"array",items:{type:"string"}},true_when:{type:"string"},false_when:{type:"string"}},required:["id","type","instructions","options","levels","true_when","false_when"],additionalProperties:!1}}},required:["state_description","questions"],additionalProperties:!1},r=[{id:"support",label:"Support",prompt:`You are a support triage assistant for a B2B SaaS product. For each incoming customer message, return JSON with: - category: one of billing, bug, feature_request, account_access, other - urgency: 1 (can wait a week) to 4 (drop everything, customer is blocked or losing money) - needs_human: true if a person must reply, false if a canned answer or a docs link would fully resolve it - sentiment: negative, neutral or positive`,records:["I was charged twice this month, please refund the duplicate.","Login loop on Safari after the latest update, cannot get past the password screen.","Would be great if the export supported CSV as well as PDF.","How do I add a teammate to my workspace?","Our whole team is locked out and we have a client demo in 40 minutes.","Thanks for the quick turnaround yesterday, the fix works.","The invoice still shows our old company name, can you update it?","Dashboard widgets render blank on Firefox 130, console shows a TypeError.","Any plans for a dark mode on mobile?","I forgot my password and the reset email never arrives.","This is the third outage this month. We cannot keep running our business like this.","Where do I find the SSO settings?","The API is returning 429s since 3pm UTC even though we are well under our limit.","Can I pay annually instead of monthly?","Please cancel my subscription effective immediately.","The new sidebar looks great, nice work.","Webhook deliveries are delayed by about ten minutes today.","Is there a student discount?","Two-factor codes are rejected even though my phone time is correct.","We need an audit log export for our SOC 2 audit next week.","Mobile app crashes on launch after updating to iOS 19.1.","Can you add Slack notifications for failed jobs?","What is the difference between the Team and Business plans?","Our admin left the company and nobody else can manage billing.","The search returns results from archived projects, which is confusing.","Downgrading to the free plan for now, budget cuts.","Love the product but the onboarding tour keeps reappearing every login.","Payment failed for invoice 8821, the card was declined but it works elsewhere.","Data from yesterday afternoon is missing from the reports. Was there an incident?","How do I change the timezone for scheduled reports?","Could you support Markdown in comments?","The bulk import silently drops rows with commas in the name field.","Just wanted to say the support team has been excellent, thank you.","My account says it is suspended but I paid last week.","PDF export cuts off the last page of long documents.","Requesting a W-9 form for our accounts payable team.","Keyboard shortcut Cmd+K stopped working in the latest release.","I cannot invite users with a .gov email, the form says invalid domain.","It would help if the calendar view showed weekends in a different color.","Production sync has been failing for six hours and our customers see stale prices.","What are your data retention policies?","Charged in USD even though the account is set to EUR.","The status page says all systems operational but uploads have been failing for an hour.","Can we get a dedicated account manager on our plan?","Feature request: recurring tasks with custom intervals.","The Android widget shows yesterday count instead of today.","How long does the free trial last?","Promo code SUMMER25 says expired but the email I got today says valid until Friday.","Getting a blank white screen on the settings page, hard refresh does not help.","We are evaluating alternatives for next quarter, can someone walk us through the roadmap?","Please delete my account and all my data.","The API docs mention a batch endpoint that returns 404.","Nice touch with the confetti on project completion.","Emails from your system land in spam for our whole domain.","I need to transfer ownership of a workspace to a colleague.","Add an option to disable the AI suggestions, they are distracting.","The receipt for March is missing from the billing page.","Comments sometimes post twice when I hit Enter quickly.","Is the platform HIPAA compliant?","Cannot log in with Google, it says account already exists with email.","Rate limit errors on the reports endpoint, started after the 2.14 deploy.","Pricing page and checkout show different prices for the Team plan.","Would love a way to pin favorite projects to the top.","Our SSO login redirects to a 500 error page since this morning, 200 employees affected.","How do I export everything before my trial ends tomorrow?","The tooltip text overlaps the button on narrow screens.","Thanks, resolved, you can close this.","We were told a refund would be issued two weeks ago and nothing has arrived.","Please add Portuguese to the supported languages.","Upload of a 90 MB file hangs at 99 percent.","What happens to our data if we cancel?","A former employee still has access even though we removed them a month ago.","The Zapier integration stopped triggering yesterday.","Could the weekly digest email be sent on Mondays instead of Sundays?","Tax was not applied to our last invoice and finance is asking why.","Charts flicker when switching tabs quickly, minor but annoying.","Who do I contact about a partnership?","Account verification email link says expired immediately after clicking.","Any ETA on the public API v2? We are blocking a project on it.","The app logged me out mid-form and I lost twenty minutes of work.","Can I get a copy of your DPA for legal review?","Everything is working fine, just checking whether there is a referral program.","Wrong tier is showing on our account, we upgraded to Business on Tuesday.","Search is slow today, taking over ten seconds per query.","It would be useful to duplicate a project with all its settings.","Honestly Notion does this better and cheaper, why am I paying you?","Cannot remove a credit card that is no longer valid.","Notifications arrive twice, once by email and once in app, can I pick one?","Is there an offline mode?","The mobile app asks for camera permission it does not need.","Customer data export contains other customers rows. This is urgent and serious.","How do I enable SCIM provisioning?","Great release notes this month, very clear.","The trial ended but I was never given a chance to enter payment details.","Requesting a call to discuss an enterprise agreement for 400 seats."]},{id:"reviews",label:"Reviews",prompt:`Analyze app store reviews for our note-taking app. For each review, return JSON with: - area: the product area the review is mostly about, one of onboarding, performance, pricing, sync, design, other - reports_bug: true if the review describes something broken or not working - stars: your estimate of the rating the reviewer would give, 1 to 5 - mentions_competitor: true if another product is named or clearly referenced`,records:["Sync between my iPad and Mac is instant. Finally an app that just works.","Crashes every time I paste an image. Unusable until fixed.","The subscription price doubled this year with no new features. Cancelling.","Beautiful typography, the reading mode is a joy.","Took me twenty minutes to figure out how to create a folder. Not intuitive.","Switched from Evernote and never looked back.","Notes disappeared after the last update. I lost two months of journaling.","Fast, minimal, no nonsense. Exactly what I wanted.","The free tier is generous, thank you for not paywalling search.","Search is painfully slow once you have a few thousand notes.","Why does the onboarding force me to create an account before I can try anything?","Apple Notes does everything this does for free.","Dark mode has a pure black background that makes the text vibrate. Please offer a dark grey option.","Sync conflicts every day between phone and laptop, I end up with duplicate notes.","Solid app. Would be five stars if it had a web version.","The tutorial was short and actually useful. Nice start.","Scrolling stutters on my two year old Android phone.","Lifetime license option would win me over. I do not want another subscription.","Handwriting recognition is shockingly good.","Widgets stopped updating after iOS 19.","The icon redesign is ugly, bring back the old one.","Obsidian is more powerful but this is friendlier for my parents.","Export to PDF loses all my headings.","Love it. Use it every day for meeting notes.","Cheaper than Notion and I do not need the database stuff anyway.","The app logs me out every few days and I have to re-enter my password.","Startup time is about four seconds, feels slow for a notes app.","The templates gallery during setup gave me a great starting point.","Sync uses a lot of battery in the background.","Pricing is fair for what you get.","Tags are hidden three menus deep. Discoverability needs work.","Rock solid for two years. Never lost a note.","Cannot sign in with my work Google account, keeps saying try again.","The new sidebar wastes a lot of space on small screens.","Import from Bear worked perfectly, every tag came across.","Wish there were a family plan.","The app feels premium. Animations are smooth and purposeful.","Sync works but takes minutes, not seconds. Google Keep is instant.","Text gets cut off in the widget on the lock screen.","Great for students. The free plan covers everything I need.","I got charged for a year after the trial without any warning email.","Keyboard lag when typing long notes on the web app.","Very confusing first run, I had no idea what the three panes were for.","Offline mode is flawless, edited notes on a flight and everything merged fine.","Please add a monthly plan, the yearly upfront cost is too much.","The share sheet integration on iOS is the best I have seen.","Formatting toolbar covers the text I am editing on phone.","It is fine. Does what it says.","Would be great if it could import my Apple Notes attachments too.","Two stars until they fix the duplicate notes bug.","The purple accent everywhere is a bit much.","Blazing fast search even with ten thousand notes. Impressive engineering.","The upgrade prompt appears every single time I open the app. Stop.","Pen latency on iPad is noticeable compared to GoodNotes.","Backups to iCloud silently failed for a month. Found out the hard way.","Simple, elegant, reliable.","The onboarding video autoplayed with sound in a quiet office. Not a fan.","Crash on launch after the 4.2 update on Pixel 9.","Cheaper than the alternatives and the team ships fixes quickly.","The app is gorgeous but I cannot find the settings for line spacing.","Sync broke after I renamed a folder, half my notes moved to the root.","Finally a notes app that respects my privacy. End to end encryption sold me.","The web clipper saves pages beautifully.","I keep hitting the paywall on features that were free last year.","Slow to open large notes with many images.","Their support replied within an hour and fixed my sync issue. Five stars for that alone.","Notion is bloated. This is the antidote.","The color themes are gorgeous but the default font is too thin.","Getting started was effortless, signed in with Apple and imported in one tap.","App drains my battery even when I am not using it.","Not worth the price for a single person.","The link previews in notes are a lovely detail.","Every time I switch devices I have to re-download all attachments.","Meh. Nothing special but nothing broken either.","The AI summary feature is surprisingly accurate.","Zooming into photos inside notes is janky.","Introductory discount was nice, renewal price was a shock.","Please let me reorder notebooks by drag and drop.","The app froze while I was presenting from it. Embarrassing.","I moved my whole team here from Confluence. Way simpler.","Month view in the journal is exactly what I needed.","Setup asked me a dozen questions before I could write a single note.","The reading mode text is too small and I cannot change it.","Sync status icon is unclear, a spinner would help.","Clean, quick, dependable. Recommended.","Photos I attach on my phone show up rotated on the desktop.","Competitors offer student pricing, you should too.","It works.","Beautiful app, buggy sync. Torn between two and four stars.","The password lock screen is a nice privacy touch."]},{id:"leads",label:"Leads",prompt:`You qualify inbound leads from our website contact form. For each message, return JSON with: - company_size: one of solo, small (2-50), mid (51-500), enterprise (500+), unknown - intent: 0 (just browsing) to 3 (ready to buy this quarter) - needs_enterprise: true if they mention SSO, SLAs, security reviews, procurement, custom contracts or data residency - route_to_sales: true if a salesperson should follow up personally rather than sending self-serve resources`,records:["Hi, I run a small design studio with 8 people. Looking to replace our current tool before the end of the month. Can we get a demo?","Just curious what your pricing looks like for a single user.","We are a 2,000 person healthcare company. Need SSO, a signed BAA and data residency in the EU before procurement will even look at this.","Student here, is there a free plan?","Our 120 person engineering org is evaluating three vendors this quarter. Please send security documentation and a quote for 150 seats.","I saw your post on Hacker News. Neat product.","Head of Ops at a 60 person logistics company. Budget approved, want to start in October. Who do I talk to?","Does the API support webhooks?","Fortune 500 retailer. We require a 99.9 percent SLA and a dedicated support channel. Legal will need to review your MSA.","Freelance consultant, want to try it on one client project first.","We have 30 people across three offices and need something everyone will actually use. Is there a trial?","Comparing you with two competitors for a 400 seat rollout. Can you match their annual discount?","How does your product handle GDPR?","Startup of 12, just raised our seed round, need to set up tooling fast. Happy to pay annually.","Government agency. Procurement requires a FedRAMP equivalent or a documented exception process.","Not looking to buy, writing a blog post comparing tools. Could you answer a few questions?","Our team of 5 has been on the free plan for a year. Ready to upgrade if you have a small team price.","Enterprise architect at a bank. Need to know whether you support SAML and SCIM before we go further.","I would like to unsubscribe from your newsletter.","We are a 700 person SaaS company. The CFO wants a consolidated contract for all departments by Q4.","Hobbyist. Is the personal plan really free forever?","Small nonprofit, 15 staff, do you offer a nonprofit discount?","Our security team needs your SOC 2 Type II report and a penetration test summary.","Manager of a 45 person support team. We are unhappy with our current vendor and their renewal is in six weeks.","Can I import from a spreadsheet?","Agency with 250 staff. We want a pilot with 20 users first, then a company wide rollout if it works.","Looking for a job, do you have open positions in engineering?","Sole proprietor, need invoicing and not much else. Is that a fit?","We are a 5,000 employee manufacturer and our IT team requires on-premise or private cloud deployment.","Interested but no budget until next fiscal year, which starts in April.","Two founders, pre-revenue, want the cheapest plan that has the API.","Director of Marketing, 300 person company. We need to sign this month to hit a campaign deadline. Please call me.","What integrations do you have with Salesforce?","School district with 900 staff. Purchasing must go through our approved vendor process.","Just downloaded the app, looks good so far.","We run a 20 person law firm. Confidentiality is critical, where is data stored?","Series B company, 180 employees, moving off a homegrown tool. Ready to evaluate seriously.","Do you have a Zapier integration?","Global consulting firm. Any deal needs to go through our procurement portal and legal will redline your terms.","Retired teacher, want to organize my recipes. Which plan?","Team of 9 at an ad agency, we want to start Monday, can you help us migrate?","How is your product different from Asana?","Our compliance lead asked whether you can sign a custom DPA and commit to a 4 hour incident response SLA.","Mid size hospital network, about 3,000 staff. Early research stage, no timeline yet.","I am a developer, want to build on your API for a side project.","Company of 75. We have a signed budget of 20k for this and want to move fast.","Can you send me a brochure?","Our CISO requires SSO enforcement and audit logs exported to our SIEM. 1,200 users.","Small bakery chain, 4 locations, 35 staff. Need scheduling and simple task tracking.","Testing several tools for a client recommendation, no purchase intent on my side.","VP Engineering, 90 person team. We need a decision by the end of the sprint, two weeks out.","Is there a lifetime deal?","Public company, 10,000 plus employees. Any vendor must complete our 200 question security questionnaire.","Our 3 person team is happy on free, just wondering what paid adds.","Photographer, one person business, want to try before I commit.","We are 500 people and growing. Interested in a multi year contract if the price is right.","How do I reset my password?","Medium sized university department, 40 staff, grants pay for software so we need an invoice not a card.","Insurance company, need a data residency guarantee in Canada and a signed SLA. Legal is copied.","Read your docs, love the approach, nothing to buy yet.","Regional accounting firm, 150 staff, tax season is our deadline and we want to be live by January.","Chief of staff at a 2,500 person company. The CEO asked me to shortlist vendors by Friday.","Can I get a quote for 12 users billed annually?","We tried you last year and left. What has changed?","Nonprofit with 600 volunteers and 20 staff. Do volunteers count as seats?","Our IT department blocks tools without SSO. Do you support Okta?","Small team, 6 people, evaluating for a project starting next week.","Enterprise procurement here. Please provide your W-9, insurance certificate and vendor onboarding forms.","Are you hiring designers?","Restaurant group with 800 employees but only 30 would use the software. Which size are we?","Curious about the roadmap for mobile.","We need 50 seats, a custom contract term of 18 months and quarterly invoicing.","Podcaster, just me and an editor. Is the small team plan for two people?","Bank holding company. Our vendor risk team requires a completed SIG questionnaire before any trial.","Team of 25, decision maker here, want pricing and a demo this week.","Do you offer training sessions for new customers?","Family business of 11 people. The owner wants to see it before we spend anything.","Airline with 40,000 staff. Pilot program for 100 users in one department first, then we will see.","I am comparing your free plan with a competitor free plan for a personal project.","Marketing agency, 55 people, our contract with the current vendor ends in 30 days and we will not renew.","What is your uptime history?","Startup founder, 3 people, we will pay whatever, just need it to work today.","Municipal government, 1,100 employees. All purchases over 10k go to an RFP.","Not a lead, I am a vendor offering you SEO services.","Clinic with 22 staff, need HIPAA compliance confirmed in writing before we proceed.","Ready to purchase 8 seats right now, checkout is failing though.","Large telecom. Evaluating for a 3,000 seat deployment in 2027, gathering information only.","Solo developer, do you have startup credits?","Our 350 person company needs SSO and an SLA and we want to sign before quarter end. Send the paperwork.","Just saying hi, great product."]}],s=r[0]??{id:"triage",label:"Triage",prompt:"",records:[]};e.s(["w",0,o,"v",0,"Claude Haiku 4.5","R",0,a,"y",0,n,"A",0,32,"e",0,"openai/gpt-6-luna","Z",0,"Chat model","_",0,20,"z",0,r,"U",0,s,"V",0,function(e){let t={};for(let o of e.questions)"choice"===o.type?t[o.id]={type:"string",enum:Object.keys(o.criteria),description:o.instructions}:"score"===o.type?t[o.id]={type:"integer",minimum:0,maximum:o.criteria.length-1,description:`${o.instructions} Levels: ${o.criteria.map((e,t)=>`${t} = ${e}`).join("; ")}`}:t[o.id]={type:"boolean",description:o.instructions};return{type:"object",properties:t,required:e.questions.map(e=>e.id),additionalProperties:!1}},"f",0,e=>`${e} Reply only with JSON matching the schema.`,"$",0,function(e){let r=(e,t)=>e.replaceAll("\n",` ${" ".repeat(t)}`),s=e?r(JSON.stringify(Object.fromEntries(e.questions.map(({id:e,...t})=>[e,t])),null,2),0):"{ /* the questions Claude writes appear here after Run */ }",i=e?JSON.stringify(e.stateDescription):"'One row of the data.'";return`import { OpenRouter } from '@openrouter/sdk'; const openRouter = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); // Stage one: Claude rewrites the prompt as typed questions, as strict JSON. const rules = [ ${n.split("\n").map(e=>` ${JSON.stringify(e).replaceAll(/^"|"$/g,"'")},`).join("\n")} ].join('\\n'); const schema = ${r(JSON.stringify(a,null,2),0)}; const compiled = await openRouter.chat.send({ chatRequest: { model: '${o}', messages: [{ role: 'system', content: rules }, { role: 'user', content: prompt }], responseFormat: { type: 'json_schema', jsonSchema: { name: 'questions', strict: true, schema } }, reasoning: { enabled: false }, }, }); // compiled.choices[0].message.content is { state_description, questions: [...] }. // Mapped to Jev's shape (options become a criteria object, levels a criteria array): const questions = ${s}; // Stage two: Jev answers every question for every row, 20 rows per request. // Each question names the row it is about, so one request can carry them all. const { answers } = await openRouter.alpha.decisions.create({ decisionsRequest: { model: '${t.T}', state: { description: ${i}, records }, // [{ id: 'r001', record: '…' }, …] questions: Object.fromEntries(records.flatMap((r) => Object.entries(questions).map(([id, q]) => [ \`$\{r.id}__$\{id}\`, { ...q, instructions: \`For the record with id "$\{r.id}": $\{q.instructions}\` }, ]))), }, }); // answers.r001__: .choice with probabilities per option, .noul as the probability of yes, .score with a legend.`},"F",0,function(e){let t=e.questions.map(e=>{if("choice"===e.type)return{id:e.id,type:"choice",instructions:e.instructions,criteria:Object.fromEntries(e.options.map(e=>[e.name,e.description]))};if("score"===e.type)return{id:e.id,type:"score",instructions:e.instructions,criteria:e.levels};let t=e.true_when||e.false_when?{true:e.true_when,false:e.false_when}:void 0;return{id:e.id,type:"noul",instructions:e.instructions,...t?{criteria:t}:{}}});return{stateDescription:e.state_description,questions:t}}])},595106,521965,e=>{"use strict";async function t(e){let{items:t,limit:o,fn:n,onSettle:a}=e,r=Array(t.length),s=0;async function i(){for(;s