cloudwaddie commited on
Commit
7e84f85
·
1 Parent(s): ff720df
.cache_ggshield CHANGED
@@ -1 +1 @@
1
- {"last_found_secrets": [{"match": "31f1dddcac91a689033afe8bc59f773bd13779cbe7f5c64ce9d645a5a7252573", "name": "Generic High Entropy Secret - c:\\Users\\Edward\\Desktop\\Projects\\lmarenabridge\\find_char_limit.py"}]}
 
1
+ {"last_found_secrets": [{"name": "Generic High Entropy Secret - c:\\Users\\Edward\\Desktop\\Projects\\lmarenabridge\\test_image_support.py", "match": "31f1dddcac91a689033afe8bc59f773bd13779cbe7f5c64ce9d645a5a7252573"}]}
README.md CHANGED
@@ -1,2 +1,88 @@
1
  # LMArenaBridge
2
  LMArena scripts to enable hosting an OpenAI compatible API endpoint that interacts with models on LMArena including experimental support for stealth models.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # LMArenaBridge
2
  LMArena scripts to enable hosting an OpenAI compatible API endpoint that interacts with models on LMArena including experimental support for stealth models.
3
+
4
+ ## Image Support
5
+
6
+ LMArenaBridge now supports sending images to vision-capable models on LMArena. When you send a message with images to a model that supports image input, the images are automatically uploaded to LMArena's R2 storage and included in the request.
7
+
8
+ ### How It Works
9
+
10
+ 1. **Automatic Detection**: The bridge automatically detects if a model supports image input by checking its capabilities.
11
+ 2. **Image Upload**: Base64-encoded images are uploaded to LMArena's storage using the same flow as the web interface.
12
+ 3. **Attachment Handling**: Uploaded images are included as `experimental_attachments` in the message payload.
13
+
14
+ ### OpenAI API Format
15
+
16
+ Send images using the standard OpenAI vision API format:
17
+
18
+ ```json
19
+ {
20
+ "model": "gpt-4-vision-preview",
21
+ "messages": [
22
+ {
23
+ "role": "user",
24
+ "content": [
25
+ {
26
+ "type": "text",
27
+ "text": "What's in this image?"
28
+ },
29
+ {
30
+ "type": "image_url",
31
+ "image_url": {
32
+ "url": "data:image/png;base64,iVBORw0KGgoAAAANS..."
33
+ }
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ ```
40
+
41
+ ### Supported Formats
42
+
43
+ - **Image Types**: PNG, JPEG, GIF, WebP
44
+ - **Input Methods**: Base64-encoded data URLs
45
+ - **Model Requirements**: Only models with `inputCapabilities.image: true` support images
46
+
47
+ ### Example
48
+
49
+ ```python
50
+ import openai
51
+ import base64
52
+
53
+ client = openai.OpenAI(
54
+ base_url="http://localhost:8000/api/v1",
55
+ api_key="sk-lmab-your-key-here"
56
+ )
57
+
58
+ # Read and encode image
59
+ with open("image.png", "rb") as f:
60
+ image_data = base64.b64encode(f.read()).decode("utf-8")
61
+
62
+ response = client.chat.completions.create(
63
+ model="gpt-4-vision-preview", # Use a vision-capable model
64
+ messages=[
65
+ {
66
+ "role": "user",
67
+ "content": [
68
+ {"type": "text", "text": "What's in this image?"},
69
+ {
70
+ "type": "image_url",
71
+ "image_url": {
72
+ "url": f"data:image/png;base64,{image_data}"
73
+ }
74
+ }
75
+ ]
76
+ }
77
+ ]
78
+ )
79
+
80
+ print(response.choices[0].message.content)
81
+ ```
82
+
83
+ ### Notes
84
+
85
+ - Images are uploaded during request processing, which may add latency
86
+ - External image URLs (http/https) are not yet supported
87
+ - Models without image support will ignore image content
88
+ - Check model capabilities using `/api/v1/models` endpoint
samples/2398-19f71176cd9db168.js DELETED
@@ -1 +0,0 @@
1
- try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ea833b48-9813-44c3-96bc-c518b9910bbc",e._sentryDebugIdIdentifier="sentry-dbid-ea833b48-9813-44c3-96bc-c518b9910bbc")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2398],{5652:(e,t,a)=>{a.d(t,{E:()=>r.E,T:()=>s.T});var r=a(80584),s=a(86693)},8796:(e,t,a)=>{a.d(t,{Bx:()=>z,Yv:()=>E,CG:()=>A,Cn:()=>V,rQ:()=>Y,jj:()=>H,Gh:()=>L,SidebarInset:()=>P,wZ:()=>F,e7:()=>Z,Uj:()=>J,FX:()=>D,GB:()=>M,jM:()=>R,GX:()=>B,cL:()=>_});var r=a(68208),s=a(54061),i=a(41517),n=a(96379),o=a(81450),l=a(59373),d=a(24741),c=a(71341),u=a(61252),m=a(35388);let p=l.bL;l.l9,l.bm;let f=l.ZL,h=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.hJ,{className:(0,c.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 absolute inset-0 top-[var(--app-banner-height,0px)] z-50 bg-black/80",a),...s,ref:t})});h.displayName=l.hJ.displayName;let x=(0,u.F)("absolute z-50 gap-4 bg-background shadow-lg transition ease-spring data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-500 data-[state=open]:duration-500",{variants:{side:{left:"bottom-0 top-[var(--app-banner-height,0px)] left-0 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",right:"bottom-0 top-[var(--app-banner-height,0px)] right-0 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"left"}}),g=m.forwardRef((e,t)=>{let{side:a="left",className:s,children:i,...n}=e;return(0,r.jsxs)(f,{container:(0,d.Xx)(),children:[(0,r.jsx)(h,{}),(0,r.jsxs)(l.UC,{ref:t,className:(0,c.cn)(x({side:a}),s),...n,children:[(0,r.jsx)(l.hE,{className:"sr-only",children:n.title}),(0,r.jsx)(l.VY,{className:"sr-only",children:n["aria-describedby"]}),i]})]})});g.displayName=l.UC.displayName;let b=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,c.cn)("flex flex-col space-y-2",t),...a,"data-sentry-component":"SheetHeader","data-sentry-source-file":"sheet.tsx"})};b.displayName="SheetHeader";let y=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.hE,{ref:t,className:(0,c.cn)("text-foreground text-lg font-semibold",a),...s})});y.displayName=l.hE.displayName;let v=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.VY,{ref:t,className:(0,c.cn)("text-muted-foreground text-sm",a),...s})});v.displayName=l.VY.displayName;var w=a(72152),j=a(10358),C=a(94975),N=a(40608),k=a(14650),I=a(51633);let S=m.createContext(null);function _(){let e=m.useContext(S);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}let M=m.forwardRef((e,t)=>{let{defaultOpen:a=!0,open:s,onOpenChange:i,className:n,style:o,children:l,...u}=e,p=(0,C.d)("md"),[f,h]=m.useState(!1),[x,g]=m.useState(a),b=null!=s?s:x,y=m.useCallback(e=>{let t="function"==typeof e?e(b):e;i?i(t):g(t),document.cookie="".concat(d.pC.sidebarState,"=").concat(t,"; path=/; max-age=").concat(604800)},[i,b]),v=m.useCallback(()=>p?h(e=>!e):y(e=>!e),[p,y,h]);m.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let w=b?"expanded":"collapsed",j=m.useMemo(()=>({state:w,open:b,setOpen:y,isMobile:p,openMobile:f,setOpenMobile:h,toggleSidebar:v}),[w,b,y,p,f,h,v]);return(0,r.jsx)(S.Provider,{value:j,children:(0,r.jsx)("div",{style:{"--sidebar-width":"240px","--sidebar-width-icon":"3rem",...o},className:(0,c.cn)("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full",n),ref:t,...u,children:l})})});M.displayName="SidebarProvider";let z=m.forwardRef((e,t)=>{let{side:a="left",variant:s="sidebar",collapsible:i="offcanvas",className:n,children:o,...l}=e,{isMobile:d,state:u,openMobile:m,setOpenMobile:f}=_(),{shouldShow:h}=(0,k.Y)();return"none"===i?(0,r.jsx)("div",{className:(0,c.cn)("bg-sidebar text-sidebar-foreground flex h-screen w-[--sidebar-width] flex-col",n),ref:t,...l,children:o}):d?(0,r.jsx)(p,{open:m,onOpenChange:f,...l,children:(0,r.jsxs)(g,{"data-sidebar":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[--sidebar-width] p-0 [&>button]:hidden",style:{"--sidebar-width":"240px"},side:a,onPointerDownOutside:e=>{e.target.closest('[data-banner="'.concat(N.VJ,'"]'))&&e.preventDefault()},children:[(0,r.jsxs)(b,{className:"sr-only",children:[(0,r.jsx)(y,{children:"Sidebar"}),(0,r.jsx)(v,{children:"Displays the mobile sidebar."})]}),(0,r.jsx)("div",{className:"flex h-full w-full flex-col",children:o})]})}):(0,r.jsxs)("div",{ref:t,className:"text-sidebar-foreground group peer hidden md:block","data-state":u,"data-collapsible":"collapsed"===u?i:"","data-variant":s,"data-side":a,children:[(0,r.jsx)("div",{className:(0,c.cn)("relative w-[--sidebar-width] bg-transparent transition-[width] duration-100 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===s||"inset"===s?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,r.jsx)("div",{className:(0,c.cn)("fixed bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] duration-100 ease-linear md:flex",h?"top-[var(--app-banner-height,0px)]":"top-0","left"===a?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===s||"inset"===s?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"border-border-faint group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...l,children:(0,r.jsx)("div",{"data-sidebar":"sidebar",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col overflow-hidden group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow",children:o})})]})});z.displayName="Sidebar",m.forwardRef((e,t)=>{let{className:a,onClick:s,...n}=e,{toggleSidebar:o}=_();return(0,r.jsxs)(i.$,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:(0,c.cn)("h-7 w-7",a),onClick:e=>{null==s||s(e),o()},...n,children:[(0,r.jsx)(I.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})}).displayName="SidebarTrigger";let R=m.forwardRef((e,t)=>{let{className:a,...s}=e,{toggleSidebar:i}=_();return(0,r.jsx)("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:(0,c.cn)("hover:after:bg-sidebar-border absolute inset-y-0 z-50 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",a),...s})});R.displayName="SidebarRail";let P=m.forwardRef((e,t)=>{let{className:a,...s}=e,{shouldShow:i}=(0,k.Y)();return(0,r.jsx)("main",{ref:t,className:(0,c.cn)("bg-background relative flex min-h-svh w-full flex-1 flex-col overflow-x-auto","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",i?"pt-[var(--app-banner-height,0px)]":"",a),...s})});P.displayName="SidebarInset",m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.p,{ref:t,"data-sidebar":"input",className:(0,c.cn)("bg-background focus-visible:ring-sidebar-ring h-8 w-full shadow-none focus-visible:ring-2",a),...s})}).displayName="SidebarInput";let L=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"header",className:(0,c.cn)("flex flex-col gap-2 p-2",a),...s})});L.displayName="SidebarHeader";let A=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"footer",className:(0,c.cn)("flex flex-col gap-2 p-2",a),...s})});A.displayName="SidebarFooter";let B=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(o.w,{ref:t,"data-sidebar":"separator",className:(0,c.cn)("bg-sidebar-border mx-2 w-auto",a),...s})});B.displayName="SidebarSeparator";let E=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"content",className:(0,c.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden group-data-[collapsible=icon]:overflow-hidden",a),...s})});E.displayName="SidebarContent";let V=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"group",className:(0,c.cn)("relative flex w-full min-w-0 flex-col p-2",a),...s})});V.displayName="SidebarGroup";let H=m.forwardRef((e,t)=>{let{className:a,asChild:i=!1,...n}=e,o=i?s.DX:"div";return(0,r.jsx)(o,{ref:t,"data-sidebar":"group-label",className:(0,c.cn)("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opacity] duration-150 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",a),...n})});H.displayName="SidebarGroupLabel",m.forwardRef((e,t)=>{let{className:a,asChild:i=!1,...n}=e,o=i?s.DX:"button";return(0,r.jsx)(o,{ref:t,"data-sidebar":"group-action",className:(0,c.cn)("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",a),...n})}).displayName="SidebarGroupAction";let Y=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"group-content",className:(0,c.cn)("w-full text-sm",a),...s})});Y.displayName="SidebarGroupContent";let F=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("ul",{ref:t,"data-sidebar":"menu",className:(0,c.cn)("flex w-full min-w-0 flex-col gap-1",a),...s})});F.displayName="SidebarMenu";let D=m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("li",{ref:t,"data-sidebar":"menu-item",className:(0,c.cn)("group/menu-item relative",a),...s})});D.displayName="SidebarMenuItem";let T=(0,u.F)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>span]:group-data-[collapsible=icon]:hidden",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),J=m.forwardRef((e,t)=>{let{asChild:a=!1,isActive:i=!1,variant:n="default",size:o="default",tooltip:l,className:d,...u}=e,m=a?s.DX:"button",{isMobile:p,state:f}=_(),h=(0,r.jsx)(m,{ref:t,"data-sidebar":"menu-button","data-size":o,"data-active":i,className:(0,c.cn)(T({variant:n,size:o}),d),...u});return l?("string"==typeof l&&(l={children:l}),(0,r.jsxs)(j.m_,{children:[(0,r.jsx)(j.k$,{asChild:!0,children:h}),(0,r.jsx)(j.ZI,{side:"right",align:"center",hidden:"collapsed"!==f||p,...l})]})):h});J.displayName="SidebarMenuButton";let Z=m.forwardRef((e,t)=>{let{className:a,asChild:i=!1,showOnHover:n=!1,...o}=e,l=i?s.DX:"button";return(0,r.jsx)(l,{ref:t,"data-sidebar":"menu-action",className:(0,c.cn)("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",a),...o})});Z.displayName="SidebarMenuAction",m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,"data-sidebar":"menu-badge",className:(0,c.cn)("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a),...s})}).displayName="SidebarMenuBadge",m.forwardRef((e,t)=>{let{className:a,showIcon:s=!1,...i}=e,n=m.useMemo(()=>"".concat(Math.floor(40*Math.random())+50,"%"),[]);return(0,r.jsxs)("div",{ref:t,"data-sidebar":"menu-skeleton",className:(0,c.cn)("flex h-8 items-center gap-2 rounded-md px-2",a),...i,children:[s&&(0,r.jsx)(w.E,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,r.jsx)(w.E,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}).displayName="SidebarMenuSkeleton",m.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("ul",{ref:t,"data-sidebar":"menu-sub",className:(0,c.cn)("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",a),...s})}).displayName="SidebarMenuSub",m.forwardRef((e,t)=>{let{...a}=e;return(0,r.jsx)("li",{ref:t,...a})}).displayName="SidebarMenuSubItem",m.forwardRef((e,t)=>{let{asChild:a=!1,size:i="md",isActive:n,className:o,...l}=e,d=a?s.DX:"a";return(0,r.jsx)(d,{ref:t,"data-sidebar":"menu-sub-button","data-size":i,"data-active":n,className:(0,c.cn)("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground","sm"===i&&"text-xs","md"===i&&"text-sm","group-data-[collapsible=icon]:hidden",o),...l})}).displayName="SidebarMenuSubButton"},9486:(e,t,a)=>{a.d(t,{zX:()=>u,nc:()=>m,Ji:()=>p});var r=a(68208),s=a(50164);let i={authMode:"initial",email:"",shouldLinkHistory:!0,isLoading:!1},n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;return(0,s.y)()((t,a)=>({...e,setAuthMode:e=>{t({authMode:e})},setEmail:e=>{t({email:e})},setShouldLinkHistory:e=>{t({shouldLinkHistory:e})},setIsLoading:e=>{t({isLoading:e})},resetAuthState:()=>{t({authMode:"initial",email:"",shouldLinkHistory:!0,isLoading:!1})},goBack:()=>{let e=a().authMode;"forgot-password"===e||"reset-password"===e?t({authMode:"login"}):t({authMode:"initial",email:""})}}))};var o=a(35388),l=a(25228),d=a(58717);let c=(0,o.createContext)(null),u=e=>{let{children:t}=e,a=(0,o.useRef)(void 0);return null!=a.current||(a.current=n(i)),(0,r.jsx)(c.Provider,{value:a.current,"data-sentry-element":"unknown","data-sentry-component":"AuthStoreProvider","data-sentry-source-file":"auth-store-provider.tsx",children:t})},m=e=>{let t=(0,o.useContext)(c);if(!t)throw Error("useAuthStore must be used within AuthStoreProvider");return(0,l.P)(t,e)},p=e=>{let t=(0,o.useContext)(c);if(!t)throw Error("useAuthStore must be used within AuthStoreProvider");return(0,l.P)(t,(0,d.k)(e))}},15428:(e,t,a)=>{a.d(t,{B:()=>c,m:()=>u});var r=a(13471),s=a(71556),i=a(35388),n=a(75646),o=a(47307),l=a(50779);let d=e=>e.pages.flatMap(e=>e.history);function c(e){let{data:t=[],hasNextPage:a,isFetchingNextPage:s,fetchNextPage:i}=(0,r.useInfiniteQuery)({...(0,l.B)(),select:d,enabled:e}),{ref:o}=(0,n.Wx)({threshold:0,rootMargin:"100px",onChange(e){e&&a&&i()},skip:!e||!a||s});return{ref:o,history:t,hasNextPage:a}}function u(){let e=(0,s.useQueryClient)(),t=(0,i.useCallback)(async t=>{await e.cancelQueries({queryKey:(0,l.B)().queryKey}),e.setQueryData((0,l.B)().queryKey,(0,o.w8)(t))},[e]);return{addHistory:t,updateHistory:(0,i.useCallback)(async t=>{await e.cancelQueries({queryKey:(0,l.B)().queryKey}),e.setQueryData((0,l.B)().queryKey,(0,o.uD)(t))},[e]),invalidateHistory:(0,i.useCallback)(()=>{e.invalidateQueries({queryKey:(0,l.B)().queryKey})},[e])}}},15545:(e,t,a)=>{a.d(t,{$w:()=>n,j_:()=>o,ur:()=>i,xp:()=>s});var r=a(15414);let s=e=>({hasMinLength:e.length>=8,hasUppercase:/[A-Z]/.test(e),hasLowercase:/[a-z]/.test(e),hasSymbol:/[^A-Za-z0-9]/.test(e)}),i="Must be at least 8 characters, must contain 1 uppercase, 1 lowercase and 1 symbol",n=r.z.string().refine(e=>{let t=s(e);return t.hasMinLength&&t.hasUppercase&&t.hasLowercase&&t.hasSymbol},{message:i}),o=r.z.string().min(8,"Password must be at least 8 characters")},19906:(e,t,a)=>{a.r(t),a.d(t,{Link:()=>l});var r=a(68208),s=a(39501),i=a(3760),n=a(71341),o=a(76065);function l(e){let{href:t,className:a,disableLinkColor:l=!1,onClick:d,...c}=e,u="string"==typeof t?t.startsWith("/"):t.pathname.startsWith("/"),m=e=>{d&&d(e);let t=function(e){try{let t=new URL(e,window.location.origin),a=t.pathname.split("/").map(e=>(0,o.a)(e)?":id":e);return t.pathname=a.filter(Boolean).join("/"),t.toString()}catch(t){return e}}(e.currentTarget.href);i.z.capture({action:"link_clicked",params:{href:t}})};return u?(0,r.jsx)(s.N_,{onClick:m,href:t,className:(0,n.cn)(!l&&"text-interactive-link",a),prefetch:!0,...c}):(0,r.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:t.toString(),className:(0,n.cn)(!l&&"text-interactive-link",a),onClick:m,...c,"data-sentry-component":"Link","data-sentry-source-file":"link.tsx"})}},19938:(e,t,a)=>{t.Nd=function(){return(0,s.v7)({seq:function(){return r.default.randomBytes(4).readUInt32BE(0)}()})};let r=function(e){return e&&e.__esModule?e:{default:e}}(a(41188)),s=a(37716)},31425:(e,t,a)=>{a.d(t,{K:()=>I,V:()=>k});var r=a(68208),s=a(6872),i=a(87214),n=a(19906),o=a(41517),l=a(71341),d=a(90519);let c="h-8 w-8 p-2 rounded-md active:transition-transform active:duration-75 transition-colors duration-150 ease-out group/modality-button relative hover:text-interactive-active hover:bg-interactive-cta-secondary",u="hover:bg-interactive-normal/10 hover:border-interactive-normal/10";function m(e){let{icon:t,label:a,selected:s=!1,tooltipContent:n,onClick:m,modality:p,disabled:f=!1}=e,h=(0,r.jsxs)(o.$,{type:"button",variant:"outline",size:"icon","aria-label":a,disabled:f,onClick:()=>null==m?void 0:m(p),className:(0,l.cn)(c,s?["text-text-tertiary bg-surface-secondary border-border-faint hover:bg-interactive-cta-secondary hover:text-interactive-active",a&&"w-auto gap-1.5"]:u,f&&"cursor-not-allowed opacity-60"),children:[s?(0,r.jsxs)("div",{className:"relative -top-px left-0 flex h-full w-4 items-center justify-center pl-2",children:[(0,r.jsx)(t,{className:"absolute inset-0 size-4 group-hover/modality-button:opacity-0"}),(0,r.jsx)(d.A,{className:"group-hover/modality-button:text-interactive-inverted absolute inset-0 size-4 opacity-0 group-hover/modality-button:opacity-100"})]}):(0,r.jsx)(t,{className:"size-4"}),s&&a&&(0,r.jsx)("span",{children:a})]});return n&&(!s||f)?(0,r.jsx)(i.G,{content:n,children:h}):h}function p(e){let{icon:t,label:a,tooltipContent:s,href:d}=e;return(0,r.jsx)(i.G,{content:s,"data-sentry-element":"BasicTooltip","data-sentry-component":"ModalityLinkButton","data-sentry-source-file":"modality-button.tsx",children:(0,r.jsx)(o.$,{asChild:!0,variant:"outline",size:"icon","aria-label":a,className:(0,l.cn)(c,u),"data-sentry-element":"Button","data-sentry-source-file":"modality-button.tsx",children:(0,r.jsx)(n.Link,{href:d,"data-sentry-element":"Link","data-sentry-source-file":"modality-button.tsx",children:(0,r.jsx)(t,{className:"size-4","data-sentry-element":"Icon","data-sentry-source-file":"modality-button.tsx"})})})})}var f=a(71076),h=a(20136),x=a(26625),g=a(38442),b=a(10536),y=a(37842),v=a(79096),w=a(86132),j=a(78114),C=a(35388);let N={[s.Jg.CHAT]:{title:"Chat",headerText:"Chat",descriptionText:"Try Language and Vision modes",Icon:x.A},[s.Jg.IMAGE]:{title:"Image",headerText:"Image",descriptionText:"Generate Images",Icon:g.A},[s.Jg.WEBDEV]:{title:"Code",headerText:"Code",descriptionText:"Build apps and websites",Icon:b.A},[s.Jg.SEARCH]:{title:"Search",headerText:"Search",descriptionText:"Web Search",Icon:y.A},[s.Jg.P2L]:{title:"P2L",headerText:"P2L",descriptionText:"Prompt to Leaderboard",Icon:v.A},[s.Jg.VIDEO]:{title:"Video",headerText:"Video",descriptionText:"Generate videos with AI",Icon:w.A}},k=e=>e===s.Jg.CHAT?"":"chat-modality=".concat(e);function I(e){let{handleModalityChange:t}=e,a=(0,j.useRouter)(),i=(0,f.g)(e=>e.modality),n=function(){let e="control"!==(0,h._P)("webdev_v2_experiment");return(0,C.useMemo)(()=>{let t=[];return t.push(s.Jg.SEARCH),t.push(s.Jg.IMAGE),e&&t.push(s.Jg.WEBDEV),t},[e])}(),o="treatment-2"===(0,h._P)("webdev_v2_experiment");(0,C.useEffect)(()=>{n.forEach(e=>{let t=k(e);a.prefetch(t?"/?".concat(t):"/")})},[a,n]);let l=i!==s.Jg.CHAT&&n.includes(i);return(0,r.jsx)("div",{className:"flex items-center gap-2","data-sentry-component":"SelectChatModality","data-sentry-source-file":"chat-modality-selector.tsx",children:n.map(e=>{let a=N[e]||N[s.Jg.CHAT],n=i===e;if(l&&!n)return null;let d={icon:a.Icon,label:a.title,tooltipContent:a.descriptionText};if(e===s.Jg.WEBDEV)if(o)return(0,r.jsx)(m,{...d,selected:n,onClick:()=>void t(e),modality:e},e);else{let t=window.location.host?"https://web.lmarena.ai/?referrer_source=".concat(window.location.host):"https://web.lmarena.ai/";return(0,r.jsx)(p,{...d,href:t},e)}return(0,r.jsx)(m,{...d,selected:n,onClick:()=>void t(e),modality:e,"data-sentry-element":"ModalityButton","data-sentry-component":"renderModalityButton","data-sentry-source-file":"chat-modality-selector.tsx"},e)})})}},36227:(e,t,a)=>{a.d(t,{W:()=>r});function r(e){if(!e)return null;try{let t=e.split("/"),a=t.findIndex(e=>"c"===e);if(-1!==a&&a+1<t.length)return t[a+1]||null;return null}catch(e){return null}}},38050:(e,t,a)=>{a.d(t,{j4:()=>h,oN:()=>f,cK:()=>x,hK:()=>m,S1:()=>p,JQ:()=>g});var r=a(6872),s=a(15414);let i=()=>e=>e;i()(s.Ik({id:s.Yj(),app_metadata:s.Ik({provider:s.Yj().optional()}).catchall(s.bz()),user_metadata:s.Ik({id:s.Yj().uuid().optional()}).catchall(s.bz()),aud:s.Yj(),confirmation_sent_at:s.Yj().optional(),recovery_sent_at:s.Yj().optional(),email_change_sent_at:s.Yj().optional(),new_email:s.Yj().optional(),new_phone:s.Yj().optional(),invited_at:s.Yj().optional(),action_link:s.Yj().optional(),email:s.Yj().optional(),phone:s.Yj().optional(),created_at:s.Yj(),confirmed_at:s.Yj().optional(),email_confirmed_at:s.Yj().optional(),phone_confirmed_at:s.Yj().optional(),last_sign_in_at:s.Yj().optional(),role:s.Yj().optional(),updated_at:s.Yj().optional(),identities:s.YO(s.Ik({id:s.Yj(),user_id:s.Yj(),identity_data:s.Ik({}).catchall(s.bz()).optional(),identity_id:s.Yj(),provider:s.Yj(),created_at:s.Yj().optional(),last_sign_in_at:s.Yj().optional(),updated_at:s.Yj().optional()})).optional(),is_anonymous:s.zM().optional(),factors:s.YO(s.Ik({id:s.Yj(),friendly_name:s.Yj().optional(),factor_type:s.k5(["totp","phone","webauthn"]),status:s.k5(["verified","unverified"]),created_at:s.Yj(),updated_at:s.Yj()})).optional()})),s.YO(s.Ik({name:s.Yj().optional(),contentType:s.Yj().optional(),url:s.Yj()})).optional(),s.fc(r.PG);let n=s.fc(r.ut),o=s.fc(r.sb);s.Yj(),s.Ik({id:s.Yj().uuid(),messageId:s.Yj().uuid(),modelId:s.Yj().uuid(),value:n}),s.Ik({id:s.Yj().uuid(),messageAId:s.Yj().uuid(),messageBId:s.Yj().uuid(),value:o,modelAId:s.Yj().uuid(),modelBId:s.Yj().uuid(),arenaId:s.Yj().uuid(),didInspectBothMobileHorizontalResponses:s.zM().optional()}),s.Ik({id:s.Yj().uuid(),messageIds:s.YO(s.Yj().uuid()),modelIds:s.YO(s.Yj().uuid()),winningMessageId:s.Yj().uuid(),winningModelId:s.Yj().uuid()}),s.fc(r.K1),s.fc(r.lY),s.fc(r.Jg);let l=i()(s.Ik({inputCapabilities:s.Ik({text:s.zM().optional(),image:s.zM().or(s.Ik({requiresUpload:s.zM().optional(),multipleImages:s.zM().optional()})).optional()}),outputCapabilities:s.Ik({text:s.zM().optional(),code:s.zM().optional(),web:s.zM().optional(),image:s.zM().or(s.Ik({aspectRatios:s.YO(s.Yj()).optional()})).optional(),video:s.zM().optional(),search:s.zM().optional()})}));s.Ik({title:s.Yj().optional(),favicon:s.Yj().optional(),thumbnail:s.Yj().optional(),url:s.Yj(),id:s.Yj(),charLocation:s.YO(s.ai()).optional()});var d=a(78753);let c=d.z.object({id:d.z.string().uuid(),organization:d.z.string().optional(),provider:d.z.string().optional(),publicName:d.z.string(),capabilities:l.nullable(),rank:d.z.number().optional()}),u={id:"uuid-v4",publicName:"awesome model",organization:"example org",provider:"example provider",capabilities:null};function m(e){var t,a;return!!((null==(t=e.capabilities)?void 0:t.inputCapabilities.text)&&(null==(a=e.capabilities)?void 0:a.outputCapabilities.image))}function p(e){var t,a,r;return!!((null==(t=e.capabilities)?void 0:t.inputCapabilities.text)&&(null==(a=e.capabilities)?void 0:a.inputCapabilities.image)&&(null==(r=e.capabilities)?void 0:r.outputCapabilities.text))}function f(e){var t,a,r,s;return!!((null==(a=e.capabilities)||null==(t=a.inputCapabilities)?void 0:t.text)&&(null==(s=e.capabilities)||null==(r=s.outputCapabilities)?void 0:r.text))}function h(e){var t,a,r;return!!((null==(t=e.capabilities)?void 0:t.inputCapabilities.text)&&(null==(a=e.capabilities)?void 0:a.inputCapabilities.image)&&(null==(r=e.capabilities)?void 0:r.outputCapabilities.image))}function x(e){var t,a;return!!((null==(t=e.capabilities)?void 0:t.inputCapabilities.text)&&(null==(a=e.capabilities)?void 0:a.outputCapabilities.search))}function g(e){var t,a;return!!((null==(t=e.capabilities)?void 0:t.inputCapabilities.text)&&(null==(a=e.capabilities)?void 0:a.outputCapabilities.web))}d.z.object({models:d.z.array(c)}).openapi({example:{models:[u]}}),d.z.object({chatModality:d.z.nativeEnum(r.Jg).optional(),sortBy:d.z.enum(["default","leaderboard_score"]).optional(),arenaSlug:r.E5.optional()}),d.z.object({id:d.z.string().uuid().openapi({param:{name:"id",in:"path"},example:"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"})}),c.openapi({example:u}),d.z.object({prompt:d.z.string().min(1).openapi({example:"Write a professional email about project updates",description:"The prompt to send to the model for testing"}),apiModelName:d.z.string().min(1).openapi({example:"gpt-4o",description:"The API model name to test"}),provider:d.z.string().min(1).openapi({example:"openai",description:"The provider for the model"}),inferenceSettings:d.z.record(d.z.unknown()).optional().openapi({description:"Optional inference settings to override defaults (temperature, maxTokens, etc.)"}),capabilities:l})},39501:(e,t,a)=>{a.d(t,{N_:()=>i,a8:()=>o});var r=a(18380);let s=(0,a(58814).A)({locales:["en"],defaultLocale:"en",localePrefix:"as-needed"}),{Link:i,redirect:n,usePathname:o,useRouter:l,getPathname:d}=(0,r.A)(s)},42205:(e,t,a)=>{a.d(t,{z:()=>n});var r=a(6872),s=a(98587),i=a(66516);function n(){let[e]=(0,i._)(),[t]=(0,s.U)();return{buildChatModeQueryString:(a,s)=>{let i=null!=a?a:e,n=null!=s?s:t,o=new URLSearchParams;i===r.lY.SIDE_BY_SIDE?o.set("mode","side-by-side"):i===r.lY.DIRECT&&o.set("mode","direct"),n===r.Jg.WEBDEV?o.set("chat-modality","webdev"):n===r.Jg.IMAGE?o.set("chat-modality","image"):n===r.Jg.P2L?o.set("chat-modality","p2l"):n===r.Jg.SEARCH&&o.set("chat-modality","search");let l=o.toString();return l?"?".concat(l):""}}}},42900:(e,t,a)=>{a.d(t,{$:()=>o,R:()=>d});var r=a(6872),s=a(13471),i=a(50779);let n=e=>e.pages.some(e=>e.history.length>0);function o(){let{data:e=!1}=(0,s.useInfiniteQuery)({...(0,i.B)(),select:n});return e}let l=e=>e.pages.some(e=>e.history.some(e=>[r.lY.DIRECT,r.lY.SIDE_BY_SIDE].includes(e.mode)));function d(){let{data:e=!1}=(0,s.useInfiniteQuery)({...(0,i.B)(),select:l});return e}},43666:(e,t,a)=>{a.d(t,{ModelStoreProvider:()=>h,g:()=>x});var r=a(68208),s=a(98587),i=a(38050),n=a(6872),o=a(50164);let l={models:[]};function d(e,t){var a,r,s,o;let l=e.filter(e=>null!=e.organization&&(t===n.Jg.IMAGE?(0,i.hK)(e):t===n.Jg.SEARCH?(0,i.cK)(e):t===n.Jg.WEBDEV?(0,i.JQ)(e):(0,i.oN)(e)));return{modelAId:null!=(s=null==(a=l[0])?void 0:a.id)?s:null,modelBId:null!=(o=null==(r=l[1])?void 0:r.id)?o:null}}var c=a(35388),u=a(25228),m=a(71076),p=a(20136);let f=(0,c.createContext)(void 0),h=e=>{let{children:t,initialModels:a,initialModelAId:i,initialModelBId:n}=e,u=(0,p._P)("3m-model-selector"),h="treatment"===u||"treatment-2"===u,{modality:x,messages:g,lastMessageIds:b,setModality:y}=(0,m.g)(e=>e),[v]=(0,s.U)(),w=(0,c.useMemo)(()=>((e,t,a,r)=>{let s=d(e.models,t),i=void 0!==a?a:s.modelAId,n=void 0!==r?r:s.modelBId;return(0,o.y)()((a,r)=>({...e,modelAId:i,modelBId:n,initialize:e=>a({models:e,...d(e,t)}),addModel:e=>a(t=>({models:[...t.models,e]})),updateModel:e=>a(t=>({models:t.models.map(t=>t.id===e.id?{...t,...e}:t)})),deleteModel:e=>a(t=>({models:t.models.filter(t=>t.id!==e),modelAId:t.modelAId===e?null:t.modelAId,modelBId:t.modelBId===e?null:t.modelBId})),setModelAId:e=>{e!==r().modelAId&&a({modelAId:e})},setModelBId:e=>{e!==r().modelBId&&a({modelBId:e})}}))})(a?{models:null!=a?a:[]}:l,x,i,n),[x,a,i,n]),j=w.getState(),C=(0,c.useCallback)(()=>{if(!b||0===b.length)return{modelAId:null,modelBId:null};let e={modelAId:null,modelBId:null};return b.map(e=>g.find(t=>t.id===e)).filter(e=>(null==e?void 0:e.modelId)!=null).forEach(t=>{(null==t?void 0:t.participantPosition)==="a"?e.modelAId=t.modelId:(null==t?void 0:t.participantPosition)==="b"&&(e.modelBId=t.modelId)}),e},[b,g]);return(0,c.useEffect)(()=>{if(h)b&&0===b.length&&(j.setModelAId(""),j.setModelBId(""),y(v));else{let e=w.getState();if(!b||0===b.length){let t=d(e.models,x);!e.modelAId&&t.modelAId&&e.setModelAId(t.modelAId),!e.modelBId&&t.modelBId&&e.setModelBId(t.modelBId)}}let{modelAId:e,modelBId:t}=C();null!=e&&j.setModelAId(e),null!=t&&j.setModelBId(t)},[b,y,C,h]),(0,r.jsx)(f.Provider,{value:w,"data-sentry-element":"unknown","data-sentry-component":"ModelStoreProvider","data-sentry-source-file":"model-store-provider.tsx",children:t})},x=e=>{let t=(0,c.useContext)(f);if(!t)throw Error("useModelStore must be used within ModelStoreProvider");return(0,u.P)(t,e)}},44259:(e,t,a)=>{a.d(t,{LoginModal:()=>G,G:()=>W});var r=a(68208),s=a(6872),i=a(89016);let n=(0,i.createServerReference)("60967e14411cc9407da38e92053e46dc03b9282f40",i.callServer,void 0,i.findSourceMapURL,"getEmailProvider");var o=a(41517),l=a(96379),d=a(9486),c=a(34828),u=a(35388);function m(e){let{onRequestReset:t}=e,{email:a,goBack:s,isLoading:i}=(0,d.Ji)(e=>({email:e.email,goBack:e.goBack,isLoading:e.isLoading})),[n,m]=(0,u.useState)(a||""),[p,f]=(0,u.useState)(""),h=async e=>(e.preventDefault(),n)?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)?void(f(""),t(n)):void f("Please enter a valid email address"):void f("Email is required");return(0,r.jsxs)("div",{className:"flex max-w-[--login-modal-max-width] flex-col gap-4","data-sentry-component":"AuthForgotPasswordRequest","data-sentry-source-file":"auth-forgot-password-request.tsx",children:[(0,r.jsxs)(o.$,{variant:"ghost",size:"sm",onClick:s,className:"text-text-secondary hover:text-text-primary h-auto self-start p-0 hover:bg-transparent",disabled:i,"data-sentry-element":"Button","data-sentry-source-file":"auth-forgot-password-request.tsx",children:[(0,r.jsx)(c.A,{className:"size-4","data-sentry-element":"ArrowLeft","data-sentry-source-file":"auth-forgot-password-request.tsx"}),(0,r.jsx)("span",{children:"Back"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"font-heading text-header-primary text-center text-2xl font-normal",children:"Forgot Password?"}),(0,r.jsx)("p",{className:"text-text-secondary mt-2 text-center text-sm font-normal",children:"Enter your email and we'll send you a link to reset your password"})]}),(0,r.jsxs)("form",{onSubmit:h,className:"flex w-full flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(l.p,{type:"email",placeholder:"Your email",value:n,onChange:e=>{m(e.target.value),p&&f("")},className:"h-10 w-full ".concat(p?"border-red-500":""),disabled:i,autoFocus:!0,"data-sentry-element":"Input","data-sentry-source-file":"auth-forgot-password-request.tsx"}),p&&(0,r.jsx)("span",{className:"text-xs text-red-500",children:p})]}),!1,(0,r.jsx)(o.$,{type:"submit",size:"lg",className:"w-full bg-black text-white hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-200",disabled:i,"data-sentry-element":"Button","data-sentry-source-file":"auth-forgot-password-request.tsx",children:i?"Sending…":"Send Reset Link"})]}),(0,r.jsxs)("p",{className:"text-text-tertiary text-center text-xs",children:["Remember your password?"," ",(0,r.jsx)("button",{onClick:s,className:"text-interactive-link hover:underline",disabled:i,children:"Back to login"})]})]})]})}var p=a(19906),f=a(50558),h=a(42900),x=a(5652),g=a(95391),b=a(3760),y=a(20136),v=a(72797);function w(e){let{location:t,onEmailSubmit:a}=e,s=(0,v.kH)(e=>e.userCreationPromise),i=(0,h.$)(),{shouldLinkHistory:n,setShouldLinkHistory:c,isLoading:m}=(0,d.Ji)(e=>({shouldLinkHistory:e.shouldLinkHistory,setShouldLinkHistory:e.setShouldLinkHistory,isLoading:e.isLoading})),w=(0,y._P)("user-login-email"),[j,C]=(0,u.useState)(""),[N,k]=(0,u.useState)(""),I=async()=>j?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(j)?void(k(""),a(j)):void k("Please enter a valid email address"):void k("Email is required");return(0,r.jsxs)("div",{className:"flex max-w-[--login-modal-max-width] flex-col items-center gap-4","data-sentry-component":"AuthInitial","data-sentry-source-file":"auth-initial.tsx",children:[(0,r.jsx)(x.E,{size:40,"data-sentry-element":"ArenaColosseum","data-sentry-source-file":"auth-initial.tsx"}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"font-heading text-header-primary mb-1 text-center text-2xl font-normal",children:"Login or Create Account"}),(0,r.jsx)("p",{className:"text-text-secondary text-center text-sm font-normal",children:"Your current chat history will be saved to your new account so you can access your chat from any device."})]}),(0,r.jsxs)(o.$,{variant:"outline",size:"lg",className:"bg-surface-primary w-full",onClick:()=>{null!=t&&b.z.capture({action:"login_clicked",params:{location:t,provider:"google"}}),(async()=>{await s;let e="/nextjs-api/sign-in/google?shouldLinkHistory=".concat(n);window.location.href=e})()},"data-sentry-element":"Button","data-sentry-source-file":"auth-initial.tsx",children:[(0,r.jsx)(g.yF,{variant:"colored",className:"size-4","data-sentry-element":"Google","data-sentry-source-file":"auth-initial.tsx"})," Continue with Google"]}),"treatment-1"===w&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,r.jsx)("span",{className:"text-text-tertiary text-xs",children:"OR"})}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsx)(l.p,{type:"email",placeholder:"Your email",value:j,onChange:e=>{C(e.target.value),N&&k("")},className:"h-10 w-full ".concat(N?"border-red-500":""),onKeyDown:e=>{"Enter"===e.key&&I()}}),N&&(0,r.jsx)("span",{className:"text-xs text-red-500",children:N})]}),(0,r.jsx)(o.$,{size:"lg",variant:"tertiary",disabled:m,onClick:()=>{I()},children:m?"Verifying…":"Continue with email"})]})]})]}),i?(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",onClick:()=>c(!n),tabIndex:0,children:[(0,r.jsx)(f.S,{checked:n}),(0,r.jsx)("p",{children:"Merge existing chats with your account"})]}),(0,r.jsx)("p",{className:"text-text-tertiary text-xs font-normal",children:"Linking chats may not work if you verify your account on a different browser"})]}):null,(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:"text-text-tertiary text-center text-xs font-normal",children:["By signing up for this service, you agree to the"," ",(0,r.jsx)(p.Link,{href:"/terms-of-use",target:"_blank","data-sentry-element":"Link","data-sentry-source-file":"auth-initial.tsx",children:"Terms"})," ","and have read our"," ",(0,r.jsx)(p.Link,{href:"/privacy-policy",target:"_blank","data-sentry-element":"Link","data-sentry-source-file":"auth-initial.tsx",children:"Privacy Policy"}),"."]})})]})}var j=a(54302),C=a(71903),N=a(15545),k=a(45786),I=a(80974),S=a(14475),_=a(15414);let M=_.z.object({email:_.z.string().email(),password:N.j_});function z(e){let{onSubmit:t,onForgotPassword:a}=e,{email:s,goBack:i,isLoading:n}=(0,d.Ji)(e=>({email:e.email,goBack:e.goBack,isLoading:e.isLoading})),[m,p]=(0,u.useState)(!1),f=(0,S.mN)({resolver:(0,j.u)(M),defaultValues:{email:s,password:""}});return(0,r.jsxs)("div",{className:"flex max-w-[--login-modal-max-width] flex-col gap-3","data-sentry-component":"AuthLoginForm","data-sentry-source-file":"auth-login-form.tsx",children:[(0,r.jsxs)(o.$,{variant:"ghost",size:"sm",onClick:i,className:"text-interactive-link hover:text-interactive-link-hover gap-1 self-start p-0 transition-opacity duration-150 hover:bg-transparent hover:opacity-90","data-sentry-element":"Button","data-sentry-source-file":"auth-login-form.tsx",children:[(0,r.jsx)(c.A,{className:"size-5","data-sentry-element":"ArrowLeft","data-sentry-source-file":"auth-login-form.tsx"}),(0,r.jsx)("p",{className:"font-heading text-base font-medium",children:"Back"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{children:(0,r.jsx)("h1",{className:"font-heading text-header-primary text-2xl font-medium",children:"Login to your account"})}),(0,r.jsx)(C.lV,{...f,"data-sentry-element":"Form","data-sentry-source-file":"auth-login-form.tsx",children:(0,r.jsxs)("form",{onSubmit:f.handleSubmit(e=>{t({email:e.email,password:e.password})}),className:"flex w-full flex-col gap-2",children:[(0,r.jsx)(C.zB,{control:f.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(C.eI,{className:"grid-0",children:[(0,r.jsx)(C.lR,{className:"text-text-secondary text-sm",children:"Email"}),(0,r.jsx)(C.MJ,{children:(0,r.jsx)(l.p,{...t,type:"email",className:"h-auto w-full py-3 text-base md:text-base",disabled:!0})}),(0,r.jsx)(C.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"auth-login-form.tsx"}),(0,r.jsx)(C.zB,{control:f.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(C.eI,{children:[(0,r.jsx)(C.lR,{className:"text-text-secondary text-sm",children:"Password"}),(0,r.jsx)(C.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(l.p,{...t,type:m?"text":"password",placeholder:"Password",className:"h-auto w-full py-3 pr-10 text-base md:text-base"}),(0,r.jsx)("button",{type:"button",onClick:()=>p(!m),className:"text-text-tertiary hover:text-text-secondary absolute right-3 top-1/2 -translate-y-1/2 transition-colors",children:m?(0,r.jsx)(k.A,{className:"size-4"}):(0,r.jsx)(I.A,{className:"size-4"})})]})}),(0,r.jsx)(C.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"auth-login-form.tsx"}),a&&(0,r.jsx)("button",{type:"button",onClick:a,className:"text-text-secondary hover:text-text-primary self-start text-sm transition-colors",children:"Forgot your password?"}),(0,r.jsx)(o.$,{type:"submit",size:"lg",className:"mt-4 w-full bg-black text-white hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-200",disabled:n,"data-sentry-element":"Button","data-sentry-source-file":"auth-login-form.tsx",children:n?"Verifying…":"Login"})]})})]})]})}let R=_.z.object({password:N.$w,confirmPassword:_.z.string()}).refine(e=>e.password===e.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]});function P(e){let{onResetPassword:t}=e,{goBack:a,isLoading:s}=(0,d.Ji)(e=>({goBack:e.goBack,isLoading:e.isLoading})),[i,n]=(0,u.useState)(!1),[m,p]=(0,u.useState)(!1),f=(0,S.mN)({resolver:(0,j.u)(R),defaultValues:{password:"",confirmPassword:""}}),h=async e=>{await t(e.password)};return(0,r.jsxs)("div",{className:"flex max-w-[--login-modal-max-width] flex-col gap-4","data-sentry-component":"AuthResetPassword","data-sentry-source-file":"auth-reset-password.tsx",children:[(0,r.jsxs)(o.$,{variant:"ghost",size:"sm",onClick:a,className:"text-text-secondary hover:text-text-primary h-auto self-start p-0 hover:bg-transparent",disabled:s,"data-sentry-element":"Button","data-sentry-source-file":"auth-reset-password.tsx",children:[(0,r.jsx)(c.A,{className:"size-4","data-sentry-element":"ArrowLeft","data-sentry-source-file":"auth-reset-password.tsx"}),(0,r.jsx)("span",{children:"Back"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"font-heading text-header-primary text-center text-2xl font-normal",children:"Reset Your Password"}),(0,r.jsx)("p",{className:"text-text-secondary mt-2 text-center text-sm font-normal",children:"Enter your new password below"})]}),(0,r.jsx)(C.lV,{...f,"data-sentry-element":"Form","data-sentry-source-file":"auth-reset-password.tsx",children:(0,r.jsxs)("form",{onSubmit:e=>{f.handleSubmit(h)(e)},className:"flex w-full flex-col gap-3",children:[(0,r.jsx)(C.zB,{control:f.control,name:"password",render:e=>{let{field:t}=e;return(0,r.jsxs)(C.eI,{children:[(0,r.jsx)(C.lR,{className:"text-text-secondary text-sm",children:"New Password"}),(0,r.jsx)(C.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(l.p,{...t,type:i?"text":"password",placeholder:"Enter new password",className:"h-10 w-full pr-10",disabled:s,autoFocus:!0}),(0,r.jsx)(o.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>n(!i),className:"text-text-tertiary hover:text-text-secondary absolute right-1 top-1/2 h-8 w-8 -translate-y-1/2 p-0",disabled:s,children:i?(0,r.jsx)(k.A,{className:"size-4"}):(0,r.jsx)(I.A,{className:"size-4"})})]})}),(0,r.jsx)(C.C5,{}),null==f.formState.errors.password&&(0,r.jsx)("p",{className:"text-text-tertiary mt-2 text-xs",children:N.ur})]})},"data-sentry-element":"FormField","data-sentry-source-file":"auth-reset-password.tsx"}),(0,r.jsx)(C.zB,{control:f.control,name:"confirmPassword",render:e=>{let{field:t}=e;return(0,r.jsxs)(C.eI,{children:[(0,r.jsx)(C.lR,{className:"text-text-secondary text-sm",children:"Confirm Password"}),(0,r.jsx)(C.MJ,{children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(l.p,{...t,type:m?"text":"password",placeholder:"Confirm new password",className:"h-10 w-full pr-10",disabled:s}),(0,r.jsx)(o.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>p(!m),className:"text-text-tertiary hover:text-text-secondary absolute right-1 top-1/2 h-8 w-8 -translate-y-1/2 p-0",disabled:s,children:m?(0,r.jsx)(k.A,{className:"size-4"}):(0,r.jsx)(I.A,{className:"size-4"})})]})}),(0,r.jsx)(C.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"auth-reset-password.tsx"}),(0,r.jsx)(o.$,{type:"submit",size:"lg",className:"mt-1 w-full bg-black text-white hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-200",disabled:s,"data-sentry-element":"Button","data-sentry-source-file":"auth-reset-password.tsx",children:s?"Resetting…":"Reset Password"})]})})]})]})}let L=_.z.object({email:_.z.string().email(),fullName:_.z.string().optional()});function A(e){let{onSubmit:t}=e,{email:a,goBack:s,isLoading:i}=(0,d.Ji)(e=>({email:e.email,goBack:e.goBack,isLoading:e.isLoading})),n=(0,S.mN)({resolver:(0,j.u)(L),defaultValues:{email:a,fullName:""}});return(0,r.jsxs)("div",{className:"flex max-w-[--login-modal-max-width] flex-col gap-3","data-sentry-component":"AuthSignupForm","data-sentry-source-file":"auth-signup-form.tsx",children:[(0,r.jsxs)(o.$,{variant:"ghost",size:"sm",onClick:s,className:"text-interactive-link hover:text-interactive-link-hover gap-1 self-start p-0 transition-opacity duration-150 hover:bg-transparent hover:opacity-90","data-sentry-element":"Button","data-sentry-source-file":"auth-signup-form.tsx",children:[(0,r.jsx)(c.A,{className:"size-5","data-sentry-element":"ArrowLeft","data-sentry-source-file":"auth-signup-form.tsx"}),(0,r.jsx)("p",{className:"font-heading text-base font-medium",children:"Back"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{children:(0,r.jsx)("h1",{className:"font-heading text-header-primary text-2xl font-medium",children:"Create Account"})}),(0,r.jsx)(C.lV,{...n,"data-sentry-element":"Form","data-sentry-source-file":"auth-signup-form.tsx",children:(0,r.jsxs)("form",{onSubmit:n.handleSubmit(e=>{t({email:e.email,fullName:e.fullName})}),className:"flex w-full flex-col gap-2",children:[(0,r.jsx)(C.zB,{control:n.control,name:"email",render:e=>{let{field:t}=e;return(0,r.jsxs)(C.eI,{className:"grid-0",children:[(0,r.jsx)(C.lR,{className:"text-text-secondary text-sm",children:"Email"}),(0,r.jsx)(C.MJ,{children:(0,r.jsx)(l.p,{...t,type:"email",className:"h-auto w-full py-3 text-base md:text-base",disabled:!0})}),(0,r.jsx)(C.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"auth-signup-form.tsx"}),(0,r.jsx)(C.zB,{control:n.control,name:"fullName",render:e=>{let{field:t}=e;return(0,r.jsxs)(C.eI,{children:[(0,r.jsx)(C.lR,{className:"text-text-secondary text-sm",children:"Full Name (Optional)"}),(0,r.jsx)(C.MJ,{children:(0,r.jsx)(l.p,{...t,autoFocus:!0,type:"text",placeholder:"First Last",className:"h-auto w-full py-3 text-base md:text-base"})}),(0,r.jsx)(C.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"auth-signup-form.tsx"}),(0,r.jsx)(o.$,{type:"submit",size:"lg",className:"mt-4 w-full bg-black text-white hover:bg-gray-800 dark:bg-white dark:text-black dark:hover:bg-gray-200",disabled:i,"data-sentry-element":"Button","data-sentry-source-file":"auth-signup-form.tsx",children:i?"Verifying…":"Create Account"}),(0,r.jsxs)("p",{className:"text-text-tertiary mx-auto max-w-[300px] text-center text-xs font-normal",children:["By signing up for this service, you agree to the"," ",(0,r.jsx)(p.Link,{href:"/terms-of-use",target:"_blank","data-sentry-element":"Link","data-sentry-source-file":"auth-signup-form.tsx",children:"Terms"})," ","and have read our"," ",(0,r.jsx)(p.Link,{href:"/privacy-policy",target:"_blank","data-sentry-element":"Link","data-sentry-source-file":"auth-signup-form.tsx",children:"Privacy Policy"}),"."]})]})})]})]})}var B=a(75046),E=a(31979);function V(e){let{onResendEmail:t}=e,{email:a,resetAuthState:s}=(0,d.Ji)(e=>({email:e.email,resetAuthState:e.resetAuthState})),[i,n]=(0,u.useState)(!1),[l,c]=(0,u.useState)(0),m=async()=>{if(!(l>0)&&t){n(!0);try{await t(),E.oR.success("Verification email sent!"),c(60);let e=setInterval(()=>{c(t=>t<=1?(clearInterval(e),0):t-1)},1e3)}catch(e){console.error("Error resending verification email:",e),E.oR.error("Failed to resend verification email")}finally{n(!1)}}};return(0,r.jsxs)("div",{className:"flex max-w-[--login-modal-max-width] flex-col items-center gap-4","data-sentry-component":"AuthVerifyEmail","data-sentry-source-file":"auth-verify-email.tsx",children:[(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,r.jsx)("div",{className:"bg-surface-secondary rounded-full p-3",children:(0,r.jsx)(B.A,{className:"text-text-secondary size-6","data-sentry-element":"Mail","data-sentry-source-file":"auth-verify-email.tsx"})}),(0,r.jsx)("h1",{className:"font-heading text-header-primary text-2xl font-normal",children:"Verify your email address to continue"}),(0,r.jsx)("p",{className:"text-text-secondary text-sm",children:"We've sent a verification link to"}),(0,r.jsx)("p",{className:"text-text-primary font-medium",children:a}),(0,r.jsx)("p",{className:"text-text-tertiary mt-2 text-xs",children:"Please check your email and click the verification link to activate your account."})]}),(0,r.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[!1,(0,r.jsxs)("div",{className:"bg-surface-secondary rounded-lg p-4",children:[(0,r.jsx)("h3",{className:"text-text-primary mb-2 text-sm font-medium",children:"Didn't receive the email?"}),(0,r.jsxs)("ul",{className:"text-text-secondary space-y-1 text-xs",children:[(0,r.jsx)("li",{children:"• Check your spam or junk folder"}),(0,r.jsx)("li",{children:"• Make sure you entered the correct email address"}),(0,r.jsx)("li",{children:"• Wait a few minutes and try resending"})]})]}),(0,r.jsx)(o.$,{variant:"outline",size:"lg",className:"w-full",onClick:()=>{m()},disabled:i||l>0,"data-sentry-element":"Button","data-sentry-source-file":"auth-verify-email.tsx",children:i?"Resending…":l>0?"Resend in ".concat(l,"s"):"Resend verification email"}),(0,r.jsx)("button",{onClick:()=>{s()},className:"text-text-secondary hover:text-text-primary text-center text-sm transition-colors",children:"Use a different email address"})]})]})}var H=a(65397),Y=a(13830),F=a(24741),D=a(94975),T=a(82735),J=a(44563),Z=a(78114);let O="420px",q=(0,T.eU)(null);function W(){let[e,t]=(0,J.fp)(q),a=(0,d.nc)(e=>e.resetAuthState);return(0,u.useEffect)(()=>{null!=e?b.z.capture({action:"login_modal_opened",params:{location:e}}):a()},[e,a]),{location:e,setLocation:t}}function G(){let{location:e,setLocation:t}=W(),a=(0,D.d)("md"),s=(0,Z.useSearchParams)(),i=(0,d.nc)(e=>e.setAuthMode),n=(0,d.nc)(e=>e.setShouldLinkHistory),[o,l]=(0,u.useState)(null);(0,u.useEffect)(()=>{let e=s.get("auth"),a=s.get("code"),r=s.get("error"),o=s.get("shouldLinkHistory");if("reset-password"===e&&a){l(a),i("reset-password"),t("top-right"),n("true"===o);let e=new URL(window.location.href);e.searchParams.delete("auth"),e.searchParams.delete("code"),e.searchParams.delete("shouldLinkHistory"),window.history.replaceState({},"",e.toString())}if("password-reset-failed"===r){E.oR.error("Password reset link is invalid or expired. Please request a new one.");let e=new URL(window.location.href);e.searchParams.delete("error"),window.history.replaceState({},"",e.toString())}},[s,i,t,n]);let c=()=>{t(null),l(null)};return a?(0,r.jsx)(Y._s,{open:null!=e,onOpenChange:e=>{!1===e&&c()},children:(0,r.jsxs)(Y.zj,{className:"px-4 py-3 sm:px-4 sm:py-3",style:{maxWidth:O},children:[(0,r.jsx)("div",{className:"h-6"}),(0,r.jsx)(K,{resetCode:o})]})}):(0,r.jsx)(H.lG,{open:null!=e,onOpenChange:e=>{e||c()},"data-sentry-element":"Dialog","data-sentry-component":"LoginModal","data-sentry-source-file":"login-modal.tsx",children:(0,r.jsx)(H.Cf,{className:"px-4 py-3 sm:px-4 sm:py-3",style:{maxWidth:O},"data-sentry-element":"DialogContent","data-sentry-source-file":"login-modal.tsx",children:(0,r.jsx)(K,{resetCode:o,"data-sentry-element":"LoginModalContent","data-sentry-source-file":"login-modal.tsx"})})})}function K(e){let{resetCode:t}=e,{location:a,setLocation:i}=W(),o=(0,v.kH)(e=>e.userCreationPromise),{authMode:l,email:c,shouldLinkHistory:u,setAuthMode:p,setEmail:f,setIsLoading:h}=(0,d.Ji)(e=>({authMode:e.authMode,email:e.email,shouldLinkHistory:e.shouldLinkHistory,setAuthMode:e.setAuthMode,setEmail:e.setEmail,setIsLoading:e.setIsLoading})),x=(0,y._P)("email-login-full-name-screen-visibility"),g=async e=>{f(e),h(!0);try{var t;await o,null!=a&&b.z.capture({action:"email_submit_for_login_clicked",params:{location:a}});let r=await n(e);if(!r.success&&(null==r?void 0:r.error)===F.ck){E.oR.error(r.error),null!=a&&b.z.capture({action:"error_registering_email_for_login",params:{location:a}}),p("initial");return}let i=(null==r?void 0:r.success)?null==r||null==(t=r.data)?void 0:t.provider:null;i===s.Wt.GOOGLE?(E.oR.info("Please sign in with Google for this account"),null!=a&&b.z.capture({action:"google_sign_in_initiated_after_email_submit",params:{location:a}}),window.location.href="/nextjs-api/sign-in/google?shouldLinkHistory=".concat(u)):i===s.Wt.EMAIL?(null!=a&&b.z.capture({action:"email_and_password_login_initiated_after_email_submit",params:{location:a}}),p("login")):"treatment-1"===x?j({email:e}):(null!=a&&b.z.capture({action:"email_and_username_signup_initiated_after_email_submit",params:{location:a}}),p("signup"))}catch(e){E.oR.error("Error checking email provider"),p("initial")}finally{h(!1)}},j=e=>{(async()=>{try{h(!0),null!=a&&b.z.capture({action:"create_account_by_email_clicked",params:{location:a}});let r=await fetch("/nextjs-api/sign-up/magic-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e.email,fullName:e.fullName,shouldLinkHistory:u})}),s=await r.json();if(!r.ok){var t;E.oR.error(null!=(t=s.error)?t:"Failed to send magic link");return}s.success&&(E.oR.success("Check your email for the magic link to set up your account!"),p("verify-email"))}catch(e){console.error("Error sending magic link:",e),E.oR.error("An error occurred while sending magic link")}finally{h(!1)}})()},C=async e=>{try{if(!t){E.oR.error("Reset code not found. Please request a new password reset link."),p("login");return}h(!0),b.z.capture({action:"email_password_reset_request"});let r=await fetch("/nextjs-api/reset-password/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e,code:t,shouldLinkHistory:u})}),s=await r.json();if(r.ok&&s.success)b.z.capture({action:"email_password_reset_success"}),E.oR.success("Password reset successfully!"),i(null),window.location.href="/";else{var a;E.oR.error(null!=(a=s.error)?a:"Failed to reset password"),p("initial")}}catch(e){console.error("Password reset error:",e),p("initial"),E.oR.error("An unexpected error occurred")}finally{h(!1)}},N=async()=>{try{h(!0),null!=a&&b.z.capture({action:"resend_verification_email_clicked",params:{location:a}});let t=await fetch("/nextjs-api/resend-verification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c})}),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Failed to resend verification email")}}catch(e){throw console.error("Error resending verification email:",e),e}finally{h(!1)}};switch(l){case"initial":return(0,r.jsx)(w,{location:a,onEmailSubmit:e=>{g(e)}});case"login":return(0,r.jsx)(z,{onSubmit:e=>{(async()=>{try{h(!0),null!=a&&b.z.capture({action:"email_login_by_password_clicked",params:{location:a}});let r=await fetch("/nextjs-api/sign-in/email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e.email,password:e.password,shouldLinkHistory:u})}),s=await r.json();if(!r.ok){if(s.requiresVerification)E.oR.warning("Please verify your email address to continue"),p("verify-email");else{var t;E.oR.error(null!=(t=s.error)?t:"Failed to sign in")}return}s.success&&(s.user.emailConfirmed?(E.oR.success("Signed in successfully!"),window.location.href="/"):(E.oR.warning("Please verify your email address to continue"),p("verify-email")))}catch(e){console.error("Error signing in:",e),E.oR.error("An error occurred while signing in")}finally{h(!1)}})()},onForgotPassword:()=>p("forgot-password")});case"signup":return(0,r.jsx)(A,{onSubmit:j});case"forgot-password":return(0,r.jsx)(m,{onRequestReset:e=>{(async()=>{try{h(!0);let a=await fetch("/nextjs-api/reset-password/request",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,shouldLinkHistory:u})}),r=await a.json();if(a.ok&&r.success)E.oR.success("Password reset link sent! Please check your email.");else{var t;E.oR.error(null!=(t=r.error)?t:"Failed to send password reset email")}}catch(e){console.error("Password reset request error:",e),E.oR.error("An unexpected error occurred")}finally{h(!1)}})()}});case"reset-password":return(0,r.jsx)(P,{onResetPassword:C});case"verify-email":return(0,r.jsx)(V,{onResendEmail:N});default:return null}}},47307:(e,t,a)=>{a.d(t,{w8:()=>f,uD:()=>h,d$:()=>m});var r=a(71556),s=a(47210),i=a(89016);let n=(0,i.createServerReference)("6029c35bd1fd9f7b39dd2702e5c4c2cacc3aeee01d",i.callServer,void 0,i.findSourceMapURL,"deleteEvaluationSession");var o=a(3760),l=a(71076),d=a(72797),c=a(78114),u=a(50779);let m=()=>{let e=(0,r.useQueryClient)(),t=(0,c.useRouter)(),a=(0,l.g)(e=>e.id),i=(0,l.g)(e=>e.mode),m=(0,l.g)(e=>e.modality),f=(0,d.kH)(e=>{var t;return null==(t=e.user)?void 0:t.id});return(0,s.useMutation)({mutationFn:async e=>{if(!f)throw Error("User ID is required");o.z.capture({action:"chat_delete",params:{mode:i,modality:m,user_id:f,evaluation_session_id:e}});let t=await n(e);if(!t.success)throw Error("Failed to delete evaluation session",{cause:Error(t.error)});o.z.capture({action:"chat_delete_success",params:{mode:i,modality:m,user_id:f,evaluation_session_id:e}})},onMutate:async t=>{await e.cancelQueries({queryKey:(0,u.B)().queryKey});let a=e.getQueryData((0,u.B)().queryKey);return e.setQueryData((0,u.B)().queryKey,p(t)),{previousHistory:a}},onError:(t,a,r)=>{(null==r?void 0:r.previousHistory)&&e.setQueryData((0,u.B)().queryKey,r.previousHistory)},onSuccess:(e,r)=>{r===a&&t.push("/")},onSettled:async()=>{await e.invalidateQueries({queryKey:(0,u.B)().queryKey})}})},p=e=>t=>t?{...t,pages:t.pages.map(t=>({...t,history:t.history.filter(t=>t.id!==e)}))}:t,f=e=>t=>{var a;for(let r of null!=(a=null==t?void 0:t.pages)?a:[])if(r.history.some(t=>t.id===e.id))return t;return t?{...t,pages:t.pages.map((t,a)=>0===a?{...t,history:[e,...t.history]}:t)}:{pageParams:[null],pages:[{history:[e],pagination:{cursor:null,hasMore:!1,limit:1}}]}},h=e=>t=>t?{...t,pages:t.pages.map(t=>{let a=t.history.findIndex(t=>t.id===e.id);if(-1===a)return t;let r=[...t.history],s=r[a];return r[a]={...s,...e},{...t,history:r}})}:t},49190:(e,t,a)=>{a.d(t,{I:()=>m,SQ:()=>p,_2:()=>f,lp:()=>h,mB:()=>x,rI:()=>c,ty:()=>u});var r=a(68208),s=a(54419),i=a(71341),n=a(21439),o=a(71035),l=a(65365),d=a(35388);let c=s.bL,u=s.l9,m=s.YJ;s.ZL,s.Pb,s.z6,d.forwardRef((e,t)=>{let{className:a,inset:o,children:l,...d}=e;return(0,r.jsxs)(s.ZP,{ref:t,className:(0,i.cn)("focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",o&&"pl-8",a),...d,children:[l,(0,r.jsx)(n.A,{className:"ml-auto"})]})}).displayName=s.ZP.displayName,d.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.G5,{ref:t,className:(0,i.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border p-1 shadow-lg",a),...n})}).displayName=s.G5.displayName;let p=d.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...o}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsx)(s.UC,{ref:t,sideOffset:n,className:(0,i.cn)("border-border-medium dark:border-border-medium/[12%] bg-popover text-popover-foreground z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-[12px] border p-2 shadow-[2px_4px_24px_0px_rgba(0,0,0,0.12)]","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...o})})});p.displayName=s.UC.displayName;let f=d.forwardRef((e,t)=>{let{className:a,inset:n,...o}=e;return(0,r.jsx)(s.q7,{ref:t,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center gap-2 rounded-[4px] px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",a),...o})});f.displayName=s.q7.displayName,d.forwardRef((e,t)=>{let{className:a,children:n,checked:l,...d}=e;return(0,r.jsxs)(s.H_,{ref:t,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:l,...d,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})}),n]})}).displayName=s.H_.displayName,d.forwardRef((e,t)=>{let{className:a,children:n,...o}=e;return(0,r.jsxs)(s.hN,{ref:t,className:(0,i.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...o,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(l.A,{className:"h-2 w-2 fill-current"})})}),n]})}).displayName=s.hN.displayName;let h=d.forwardRef((e,t)=>{let{className:a,inset:n,...o}=e;return(0,r.jsx)(s.JU,{ref:t,className:(0,i.cn)("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",a),...o})});h.displayName=s.JU.displayName;let x=d.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.wv,{ref:t,className:(0,i.cn)("bg-border-medium/[30%] dark:bg-border-medium/[10%] -mx-1 my-1 h-px",a),...n})});x.displayName=s.wv.displayName},50558:(e,t,a)=>{a.d(t,{S:()=>o});var r=a(68208),s=a(24090),i=a(71341),n=a(71035);let o=a(35388).forwardRef((e,t)=>{let{className:a,...o}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,i.cn)("border-border-faint-solid focus-visible:ring-ring data-[state=checked]:bg-surface-highlight data-[state=checked]:text-interactive-active peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50",a),...o,children:(0,r.jsx)(s.C1,{className:(0,i.cn)("flex items-center justify-center text-current"),children:!0===o.checked&&(0,r.jsx)(n.A,{className:"h-4 w-4"})})})});o.displayName=s.bL.displayName},50779:(e,t,a)=>{a.d(t,{B:()=>n});var r=a(26236),s=a(89016);let i=(0,s.createServerReference)("7041050938442628152fc518d12973b07d76f2e479",s.callServer,void 0,s.findSourceMapURL,"getHistoryPage"),n=()=>(0,r.L)({queryKey:["history","list"],queryFn:async e=>{let{pageParam:t}=e,a=await i(t);if(!a.success)throw Error(a.error||"Failed to fetch history");return a.data},initialPageParam:null,getNextPageParam:e=>{var t;return null!=(t=e.pagination.cursor)?t:null}})},52378:(e,t,a)=>{a.d(t,{J:()=>r});let r=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.filter(e=>!!e).sort().join("_")}},66516:(e,t,a)=>{a.d(t,{_:()=>o});var r=a(6872),s=a(54275);let i=[r.lY.SIDE_BY_SIDE,r.lY.DIRECT,r.lY.BATTLE],n=(0,s.M1)(i).withDefault(r.lY.BATTLE).withOptions({clearOnDefault:!0,history:"replace"});function o(){return(0,s.ZA)("mode",n)}},71076:(e,t,a)=>{a.d(t,{P:()=>f,EvaluationStoreProvider:()=>x,g:()=>g});var r=a(68208),s=a(6872),i=a(89016);let n=(0,i.createServerReference)("6023187688d163e1181fe1b40d18a77694512ee9ae",i.callServer,void 0,i.findSourceMapURL,"getEvaluationSession");var o=a(74181),l=a(36227),d=a(76065),c=a(78114),u=a(35388),m=a(31979),p=a(25228);let f=(0,u.createContext)(void 0),h=["new"],x=e=>{let{children:t,initialState:a}=e,i=(0,c.usePathname)(),p=(0,c.useRouter)(),x=(0,c.useSearchParams)(),g=function(e){return"side-by-side"===e?s.lY.SIDE_BY_SIDE:"direct"===e?s.lY.DIRECT:s.lY.BATTLE}(x.get("mode")),y=function(e){if("webdev"===e)return s.Jg.WEBDEV;if("image"===e)return s.Jg.IMAGE;if("p2l"===e)return s.Jg.P2L;if("search"===e)return s.Jg.SEARCH;if("video"===e)return s.Jg.VIDEO;else return s.Jg.CHAT}(x.get("chat-modality")),v="/"===i,w="/c/new"===i,j=(0,u.useCallback)(e=>{let t=(0,l.W)(e);return!t||h.includes(t)?null:t},[])(i),C=null!=j&&(0,d.a)(j),[N]=(0,u.useState)(()=>(0,o.GG)(null==a?(0,o.Oe)(g,y):{...a,modality:b(a),leftVoteHoverState:null,rightVoteHoverState:null,hasViewedLatestResponses:!0,isVoteSubmitting:!1,viewedWebDevPreviews:[],didInspectBothResponsesByPairwiseFeedbackKey:{}}));(0,u.useEffect)(()=>{let e=(0,l.W)(i);if(e&&!h.includes(e)&&!(0,d.a)(e)){m.oR.error("Invalid session ID. Redirecting to home..."),p.replace("/");return}C&&null==a&&j!==N.getState().id&&(m.oR.error("Session not found. Redirecting to home..."),p.replace("/"))},[]);let k=(0,u.useRef)({sessionId:j,pathname:i,isInitialMount:!0,modalityParam:y});return(0,u.useEffect)(()=>{let e=k.current,t=j!==e.sessionId||i!==e.pathname||y!==e.modalityParam;if(e.isInitialMount){k.current={sessionId:j,pathname:i,isInitialMount:!1,modalityParam:y};return}if(!t)return;let a=(0,l.W)(i);if(a&&!h.includes(a)&&!(0,d.a)(a)){m.oR.error("Invalid session ID. Redirecting to home..."),p.replace("/");return}let r=C&&j!==e.sessionId;if(k.current={sessionId:j,pathname:i,isInitialMount:!1,modalityParam:y},w)return void N.setState((0,o.Oe)(g,y));async function s(e){N.setState({id:e,loading:!0});try{let t=await n(e);if(N.getState().id!==e)return;if(!t.success||null==t.data){N.setState({loading:!1});let t=N.getState();e===t.id&&t.messages.length>0||(m.oR.error("Session not found. Redirecting to home..."),N.setState((0,o.Oe)(g,y)),p.replace("/"));return}N.setState({...t.data,modality:b(t.data),loading:!1,viewedWebDevPreviews:[]})}catch(e){throw N.setState({loading:!1}),e}}v?(N.getState().messages.length>0||t)&&N.setState((0,o.Oe)(g,y)):r?j!==N.getState().id&&s(j):C&&j!==N.getState().id&&s(j)},[i,j,v,C,g,y,N,p,w]),(0,r.jsx)(f.Provider,{value:N,"data-sentry-element":"unknown","data-sentry-component":"EvaluationStoreProvider","data-sentry-source-file":"evaluation-store-provider.tsx",children:t})},g=e=>{let t=(0,u.useContext)(f);if(!t)throw Error("useEvaluationStore must be used within EvaluationStoreProvider");return(0,p.P)(t,e)};function b(e){var t;let a=e.messages.find(t=>e.lastMessageIds.includes(t.id)),r=e.maskedEvaluations.find(e=>e.id===(null==a?void 0:a.evaluationId));return null!=(t=null==r?void 0:r.modality)?t:s.Jg.CHAT}},71457:(e,t,a)=>{a.d(t,{Xi:()=>d,av:()=>c,j7:()=>l,tU:()=>o});var r=a(68208),s=a(24751),i=a(71341),n=a(35388);let o=s.bL,l=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.B8,{ref:t,className:(0,i.cn)("bg-surface-secondary text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",a),...n})});l.displayName=s.B8.displayName;let d=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.l9,{ref:t,className:(0,i.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",a),...n})});d.displayName=s.l9.displayName;let c=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.UC,{ref:t,className:(0,i.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",a),...n})});c.displayName=s.UC.displayName},71903:(e,t,a)=>{a.d(t,{C5:()=>g,MJ:()=>x,eI:()=>f,lR:()=>h,lV:()=>d,zB:()=>u});var r=a(68208),s=a(54061),i=a(18913),n=a(71341),o=a(35388),l=a(14475);let d=l.Op,c=o.createContext({}),u=e=>{let{...t}=e;return(0,r.jsx)(c.Provider,{value:{name:t.name},"data-sentry-element":"unknown","data-sentry-component":"FormField","data-sentry-source-file":"form.tsx",children:(0,r.jsx)(l.xI,{...t,"data-sentry-element":"Controller","data-sentry-source-file":"form.tsx"})})},m=()=>{let e=o.useContext(c),t=o.useContext(p),{getFieldState:a,formState:r}=(0,l.xW)(),s=a(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");let{id:i}=t;return{id:i,name:e.name,formItemId:"".concat(i,"-form-item"),formDescriptionId:"".concat(i,"-form-item-description"),formMessageId:"".concat(i,"-form-item-message"),...s}},p=o.createContext({}),f=o.forwardRef((e,t)=>{let{className:a,...s}=e,i=o.useId();return(0,r.jsx)(p.Provider,{value:{id:i},children:(0,r.jsx)("div",{ref:t,className:a,...s})})});f.displayName="FormItem";let h=o.forwardRef((e,t)=>{let{className:a,...s}=e,{error:o,formItemId:l}=m();return(0,r.jsx)(i.J,{ref:t,className:(0,n.cn)(o&&"text-destructive",a),htmlFor:l,...s})});h.displayName="FormLabel";let x=o.forwardRef((e,t)=>{let{...a}=e,{error:i,formItemId:n,formDescriptionId:o,formMessageId:l}=m();return(0,r.jsx)(s.DX,{ref:t,id:n,"aria-describedby":i?"".concat(o," ").concat(l):"".concat(o),"aria-invalid":!!i,...a})});x.displayName="FormControl",o.forwardRef((e,t)=>{let{className:a,...s}=e,{formDescriptionId:i}=m();return(0,r.jsx)("p",{ref:t,id:i,className:(0,n.cn)("text-muted-foreground text-[0.8rem]",a),...s})}).displayName="FormDescription";let g=o.forwardRef((e,t)=>{var a;let{className:s,children:i,...o}=e,{error:l,formMessageId:d}=m(),c=l?String(null!=(a=null==l?void 0:l.message)?a:""):i;return c?(0,r.jsx)("p",{ref:t,id:d,className:(0,n.cn)("text-interactive-negative text-[0.8rem] font-medium",s),...o,children:c}):null});g.displayName="FormMessage"},74181:(e,t,a)=>{a.d(t,{GG:()=>l,Oe:()=>o,au:()=>d});var r=a(6872),s=a(19938),i=a(52378),n=a(50164);let o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.lY.BATTLE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Jg.CHAT;return{title:"New Chat",id:(0,s.Nd)(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),mode:e,modality:t,userId:"",visibility:r.K1.PRIVATE,pairwiseFeedbacks:[],pointwiseFeedbacks:[],maskedEvaluations:[],messages:[],lastMessageIds:[],loading:!1,leftVoteHoverState:null,rightVoteHoverState:null,hasViewedLatestResponses:!1,isVoteSubmitting:!1,deletedAt:null,viewedWebDevPreviews:[],didInspectBothResponsesByPairwiseFeedbackKey:{}}},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o();return(0,n.y)()((t,a)=>({...e,initialize:e=>t(e),reset:e=>t({...o(),...e}),update:e=>t(e),addMessages:e=>{t(t=>({messages:[...t.messages,...e],lastMessageIds:e.map(e=>e.id)}))},updateMessage:e=>{t(t=>({messages:t.messages.map(t=>t.id===e.id?{...t,...e}:t)}))},deleteMessage:e=>{t(t=>{var a;let r=t.messages.find(t=>t.id===e);return{messages:t.messages.filter(t=>t.id!==e),lastMessageIds:null!=(a=null==r?void 0:r.parentMessageIds)?a:t.lastMessageIds}})},setMode:e=>{t({mode:e})},setModality:e=>{t({modality:e})},addPairwiseFeedback:e=>{let{messageAId:a,messageBId:r,modelAId:i,modelBId:n,value:o,didInspectBothMobileHorizontalResponses:l}=e,c={id:(0,s.Nd)(),messageAId:a,messageBId:r,value:o,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),modelAId:null!=i?i:"",modelBId:null!=n?n:"",arenaId:"",didInspectBothMobileHorizontalResponses:l};return t(e=>{let t=d(e);return{pairwiseFeedbacks:[...e.pairwiseFeedbacks,c],messages:e.messages.map(e=>t.includes(e.id)?{...e,pairwiseFeedbackId:c.id}:e)}}),c},updatePairwiseFeedbackModels:e=>{let{pairwiseFeedbackId:r,modelAId:s,modelBId:i}=e;null!=a().pairwiseFeedbacks.find(e=>e.id===r)&&t(e=>({pairwiseFeedbacks:e.pairwiseFeedbacks.map(e=>e.id===r?{...e,modelAId:s,modelBId:i}:e),messages:e.messages.map(t=>t.pairwiseFeedbackId===r&&e.lastMessageIds.includes(t.id)?{...t,modelId:"a"===t.participantPosition?s:i}:t)}))},deletePairwiseFeedback:e=>{t(t=>({pairwiseFeedbacks:t.pairwiseFeedbacks.filter(t=>t.id!==e),messages:t.messages.map(t=>{let{pairwiseFeedbackId:a,...r}=t;return a===e?r:{...r,pairwiseFeedbackId:a}})}))},addPointwiseFeedback:e=>{let{messageId:a,modelId:r,value:i}=e,n={id:(0,s.Nd)(),messageId:a,modelId:r,value:i,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return t(e=>({pointwiseFeedbacks:[...e.pointwiseFeedbacks,n],messages:e.messages.map(e=>e.id===a?{...e,pointwiseFeedbackId:n.id}:e)})),n},deletePointwiseFeedback:e=>{t(t=>({pointwiseFeedbacks:t.pointwiseFeedbacks.filter(t=>t.id!==e),messages:t.messages.map(t=>t.pointwiseFeedbackId===e?{...t,pointwiseFeedbackId:void 0}:t)}))},getPointwiseFeedbackById:e=>a().pointwiseFeedbacks.find(t=>t.id===e),setLeftVoteHoverState:e=>t({leftVoteHoverState:e}),setRightVoteHoverState:e=>t({rightVoteHoverState:e}),setHasViewedLatestResponses:e=>t({hasViewedLatestResponses:e}),setDidInspectBothMobileHorizontalResponses:function(e){for(var a=arguments.length,r=Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];return t(t=>{let a=r.map(e=>"string"==typeof e?e:e.id),s=(0,i.J)(...a);return{didInspectBothResponsesByPairwiseFeedbackKey:{...t.didInspectBothResponsesByPairwiseFeedbackKey,[s]:e}}})},setIsVoteSubmitting:e=>t({isVoteSubmitting:e}),markWebDevPreviewAsViewed:e=>t(t=>t.viewedWebDevPreviews.includes(e)?t:{viewedWebDevPreviews:[...t.viewedWebDevPreviews,e]}),resetViewedWebDevPreviews:()=>t({viewedWebDevPreviews:[]})}))},d=e=>{var t,a;let r=e.messages.filter(e=>"user"===e.role).reverse(),s=[...e.lastMessageIds],i=null==(t=e.messages.find(e=>e.id===s[0]))?void 0:t.modelId,n=null==(a=e.messages.find(e=>e.id===s[1]))?void 0:a.modelId;for(let t of r){let a=e.messages.find(e=>{var a;return(null==(a=t.parentMessageIds)?void 0:a[0])===e.id}),r=e.messages.find(e=>{var a;return(null==(a=t.parentMessageIds)?void 0:a[1])===e.id});if(null!=a&&null!=r&&(null==i||(null==a?void 0:a.modelId)===i)&&(null==n||(null==r?void 0:r.modelId)===n)&&(null==a?void 0:a.pairwiseFeedbackId)==null&&(null==r?void 0:r.pairwiseFeedbackId)==null)s.push(a.id),s.push(r.id);else break}return s}},76065:(e,t,a)=>{a.d(t,{a:()=>r});function r(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}},80584:(e,t,a)=>{a.d(t,{E:()=>i});var r=a(68208),s=a(71325);function i(e){let{size:t=s.U,...a}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t,height:t,fill:"none",...a,"data-sentry-element":"svg","data-sentry-component":"ArenaColosseum","data-sentry-source-file":"arena-colosseum.tsx",children:(0,r.jsx)("path",{fill:"currentColor",d:"M22.68 5.055v-.033a.833.833 0 0 0-.196-.521 1.54 1.54 0 0 0-.27-.253 4.284 4.284 0 0 0-.702-.408c-.558-.268-1.34-.56-2.288-.831C17.33 2.469 14.723 2 11.841 2c-2.881 0-5.49.47-7.386 1.01-.945.27-1.729.563-2.287.831-.276.133-.519.27-.702.408-.09.068-.189.152-.27.253a.841.841 0 0 0-.193.52v.033H1v15.268h.003c0 .267.136.456.242.562.105.105.225.174.324.223.201.1.457.178.73.243.558.133 1.338.248 2.27.342 1.872.19 4.444.306 7.274.306s5.4-.116 7.273-.306c.932-.094 1.712-.21 2.27-.342.273-.066.529-.143.73-.243.1-.049.22-.12.324-.223a.795.795 0 0 0 .243-.562h.002V5.055h-.005ZM12.55 14.46v-1.743c0-.561.202-1.113.601-1.507.354-.35.822-.563 1.335-.563.655 0 1.235.345 1.6.88.248.364.366.804.366 1.247v1.573a83.603 83.603 0 0 1-3.904.116l.002-.003Zm0-5.743c0-.561.202-1.113.601-1.507.354-.35.822-.563 1.335-.563.655 0 1.235.345 1.6.88.248.364.366.804.366 1.247v.412a83.628 83.628 0 0 1-3.904.116v-.582l.002-.003Zm8.529 5.102c-.473.119-1.184.232-2.096.33-.383.04-.797.078-1.24.111v-1.91c0-.655.29-1.288.817-1.677.31-.227.675-.364 1.057-.364.202 0 .398.034.582.097.726.248 1.195.959 1.195 1.727v1.593c-.078.027-.181.06-.314.093h-.001Zm-3.336-5.312c0-.61.243-1.204.704-1.603.323-.28.72-.451 1.136-.451.479 0 .915.198 1.245.525.375.37.564.888.564 1.414v.173c-.077.027-.18.06-.313.093-.473.118-1.184.232-2.096.329-.383.041-.797.079-1.24.112v-.592ZM4.193 6.465c.744 0 1.386.345 1.699.96.122.24.174.51.174.781v.901a44.79 44.79 0 0 1-1.367-.121c-.912-.097-1.623-.21-2.095-.33a3.734 3.734 0 0 1-.314-.09c.007-1.16.856-2.1 1.902-2.1l.002-.001Zm3.163 7.886v-1.577c0-.398.093-.796.298-1.138.358-.596.972-.99 1.67-.99.512 0 .98.212 1.332.56.4.393.602.944.602 1.505v1.75a84.414 84.414 0 0 1-3.903-.11h.001Zm3.903-5.052a84.423 84.423 0 0 1-3.903-.11v-.415c0-.399.093-.796.298-1.138.358-.596.972-.99 1.67-.99.512 0 .98.212 1.332.56.4.393.602.944.602 1.505v.588h.001Zm-8.966 3.026c0-1.113.852-2.017 1.903-2.017.382 0 .746.136 1.054.363.528.387.817 1.02.817 1.674v1.925c-.49-.037-.947-.078-1.366-.122-.913-.096-1.624-.21-2.096-.329a3.288 3.288 0 0 1-.313-.093l.002-1.4h-.001Zm-.003 7.998v-.052a.655.655 0 0 1 .003.052H2.29Zm.003-2.707c0-1.114.852-2.017 1.903-2.017.382 0 .746.135 1.054.362.528.387.817 1.02.817 1.674v2.891c-.49-.034-.948-.073-1.368-.116-.912-.093-1.625-.2-2.099-.313a4.498 4.498 0 0 1-.308-.085l.002-2.395-.001-.002Zm5.063 2.988v-2.67c0-.399.093-.796.298-1.138.358-.596.972-.99 1.67-.99.512 0 .98.212 1.332.56.4.393.602.944.602 1.505v2.837a88.799 88.799 0 0 1-3.903-.104h.001Zm5.194.103v-2.836c0-.56.202-1.112.602-1.506.354-.347.82-.558 1.332-.558.7 0 1.313.393 1.67.99.206.341.299.738.299 1.137v2.662a87.72 87.72 0 0 1-3.903.11v.001Zm8.842-.384h-.002c0-.018 0-.035.002-.052v.052Zm-.308-.226c-.474.113-1.187.222-2.1.313-.383.039-.798.075-1.24.107V17.64c0-.654.288-1.288.816-1.676.31-.227.675-.364 1.057-.364.202 0 .398.033.582.096.726.248 1.195.96 1.195 1.727v2.588c-.078.026-.18.054-.309.085l-.001.002Z","data-sentry-element":"path","data-sentry-source-file":"arena-colosseum.tsx"})})}},81450:(e,t,a)=>{a.d(t,{w:()=>n});var r=a(68208),s=a(47238),i=a(71341);let n=a(35388).forwardRef((e,t)=>{let{className:a,orientation:n="horizontal",decorative:o=!0,...l}=e,d=(null==a?void 0:a.includes("mx-"))||(null==a?void 0:a.includes("ml-"))||(null==a?void 0:a.includes("mr-"));return(0,r.jsx)(s.b,{ref:t,decorative:o,orientation:n,className:(0,i.cn)("bg-border-faint shrink-0","horizontal"===n?"h-[1px] ".concat(d?"w-auto":"w-full"):"h-full w-[1px]",a),...l})});n.displayName=s.b.displayName},86693:(e,t,a)=>{a.d(t,{T:()=>i});var r=a(68208),s=a(71341);let i=(0,a(35388).forwardRef)((e,t)=>{let{className:a,...i}=e;return(0,r.jsxs)("svg",{ref:t,width:"1530",height:"300",viewBox:"0 0 1535 300",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:(0,s.cn)("text-header-primary",a),...i,children:[(0,r.jsx)("path",{d:"M1456.56 269.994C1444.96 269.994 1435.32 267.929 1427.65 263.8C1419.99 259.671 1414.28 254.263 1410.55 247.578C1406.81 240.696 1404.94 233.224 1404.94 225.162C1404.94 210.218 1410.35 198.912 1421.16 191.243C1432.18 183.378 1446.82 179.445 1465.11 179.445H1505.22V176.496C1505.22 150.934 1493.52 138.153 1470.13 138.153C1460.69 138.153 1452.72 140.217 1446.23 144.347C1439.94 148.476 1435.91 154.965 1434.14 163.813H1408.78C1409.76 153.982 1413 145.527 1418.51 138.448C1424.21 131.369 1431.49 125.962 1440.34 122.226C1449.18 118.49 1459.11 116.622 1470.13 116.622C1490.97 116.622 1506.11 122.127 1515.55 133.139C1525.18 143.953 1530 158.406 1530 176.496V266.455H1508.76L1506.7 243.744H1504.63C1500.31 250.822 1494.51 257.016 1487.23 262.325C1480.15 267.438 1469.93 269.994 1456.56 269.994ZM1460.98 248.168C1470.42 248.168 1478.38 245.907 1484.87 241.384C1491.56 236.862 1496.57 230.864 1499.91 223.392C1503.45 215.92 1505.22 207.76 1505.22 198.912H1467.18C1453.81 198.912 1444.37 201.173 1438.86 205.696C1433.55 210.218 1430.9 216.215 1430.9 223.687C1430.9 231.356 1433.45 237.353 1438.57 241.679C1443.68 246.005 1451.15 248.168 1460.98 248.168Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M1244.55 266.455V120.161H1265.2L1267.85 142.282H1269.33C1273.26 135.203 1279.45 129.206 1287.91 124.29C1296.36 119.178 1306.1 116.622 1317.11 116.622C1335 116.622 1348.37 121.931 1357.22 132.549C1366.27 143.167 1370.79 158.504 1370.79 178.561V266.455H1346.01V181.51C1346.01 168.532 1343.16 158.406 1337.46 151.13C1331.76 143.659 1322.91 139.923 1310.92 139.923C1299.31 139.923 1289.48 143.953 1281.42 152.015C1273.36 159.881 1269.33 171.285 1269.33 186.229V266.455H1244.55Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M1146.72 269.994C1132.95 269.994 1120.76 266.848 1110.14 260.556C1099.72 254.067 1091.46 245.12 1085.37 233.716C1079.27 222.114 1076.22 208.645 1076.22 193.308C1076.22 177.971 1079.17 164.6 1085.07 153.195C1091.17 141.594 1099.52 132.647 1110.14 126.355C1120.76 119.866 1133.15 116.622 1147.31 116.622C1161.46 116.622 1173.56 119.866 1183.58 126.355C1193.61 132.647 1201.28 141.004 1206.59 151.425C1211.9 161.847 1214.55 173.055 1214.55 185.049C1214.55 187.212 1214.45 189.375 1214.26 191.538C1214.26 193.701 1214.26 196.159 1214.26 198.912H1100.7C1101.29 209.727 1103.75 218.772 1108.08 226.047C1112.6 233.126 1118.2 238.435 1124.89 241.974C1131.77 245.513 1139.05 247.283 1146.72 247.283C1157.53 247.283 1165.99 245.022 1172.08 240.499C1178.18 235.977 1182.8 229.685 1185.94 221.623H1210.42C1207.08 235.19 1200.1 246.693 1189.48 256.131C1178.86 265.373 1164.61 269.994 1146.72 269.994ZM1146.72 138.743C1135.31 138.743 1125.28 142.184 1116.63 149.066C1108.18 155.948 1102.97 165.583 1101 177.971H1190.07C1189.29 165.779 1184.86 156.243 1176.8 149.361C1168.93 142.282 1158.91 138.743 1146.72 138.743Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M934.677 266.455V245.218H972.135V148.771C972.135 143.855 969.776 141.397 965.057 141.397H938.512V120.161H974.2C980.689 120.161 985.899 121.931 989.832 125.47C993.764 129.01 995.731 134.22 995.731 141.102V147.296H996.911C999.27 137.465 1003.69 129.894 1010.18 124.585C1016.87 119.276 1026.11 116.622 1037.91 116.622H1064.75V142.872H1034.37C1022.37 142.872 1013.13 146.903 1006.64 154.965C1000.15 162.83 996.911 172.957 996.911 185.344V245.218H1042.92V266.455H934.677Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M757.801 266.464L822.393 60.001H851.003L915.3 266.464H888.165L873.123 215.143H799.977L784.935 266.464H757.801ZM835.96 94.8047L806.171 194.497H866.929L837.14 94.8047H835.96Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M585.938 266.464V60.001H612.483L659.674 158.218L706.864 60.001H733.409V266.464H709.224V107.782L669.112 191.252H650.235L610.123 108.077V266.464H585.938Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M420.007 266.464V60.001H444.783V244.048H549.487V266.464H420.007Z",fill:"currentColor"}),(0,r.jsx)("g",{clipPath:"url(#clip0_900_2452)",children:(0,r.jsx)("path",{d:"M325.196 45.8314C325.196 45.7153 325.196 45.5991 325.196 45.483V45.3282C325.196 41.554 323.319 38.8249 322.254 37.5088C321.035 35.9991 319.564 34.7411 318.209 33.7153C315.461 31.6443 311.822 29.5927 307.68 27.5991C299.3 23.5733 287.571 19.1991 273.365 15.1346C244.952 7.04431 205.836 -0.000854492 162.617 -0.000854492C119.399 -0.000854492 80.2636 7.04431 51.8317 15.154C37.6447 19.1991 25.8965 23.5927 17.5159 27.6185C13.374 29.612 9.73537 31.6637 6.98702 33.7346C5.63219 34.7604 4.16124 36.0185 2.9419 37.5282C1.91611 38.8249 0.0387092 41.554 0.0387092 45.3282C0.0387092 45.3475 0.0387092 45.3862 0.0387092 45.4056C0.0387092 45.4249 0.0387092 45.4637 0.0387092 45.483C0.0387092 45.5991 0.0387092 45.7153 0.0387092 45.8314H0V274.838H0.0387092C0.0387092 278.844 2.0903 281.689 3.67738 283.277C5.2451 284.844 7.04508 285.889 8.53539 286.625C11.5547 288.115 15.3869 289.296 19.4901 290.264C27.8513 292.257 39.5608 293.98 53.5349 295.393C81.6184 298.238 120.192 299.98 162.637 299.98C205.082 299.98 243.636 298.238 271.739 295.393C285.713 293.98 297.422 292.257 305.784 290.264C309.887 289.277 313.719 288.115 316.738 286.625C318.229 285.889 320.029 284.825 321.596 283.277C323.183 281.689 325.235 278.844 325.235 274.838H325.274V45.8314H325.235H325.196ZM173.243 186.889V160.741C173.243 152.322 176.282 144.038 182.262 138.135C187.566 132.889 194.591 129.696 202.294 129.696C212.107 129.696 220.817 134.864 226.275 142.877C230.01 148.354 231.772 154.954 231.772 161.593V185.186C214.043 186.154 194.243 186.773 173.224 186.928L173.243 186.889ZM173.243 100.741C173.243 92.3217 176.282 84.0379 182.262 78.1346C187.566 72.8895 194.591 69.6959 202.294 69.6959C212.107 69.6959 220.817 74.8637 226.275 82.8766C230.01 88.354 231.772 94.954 231.772 101.593V107.767C214.043 108.735 194.243 109.354 173.224 109.509V100.78L173.243 100.741ZM301.177 177.27C294.093 179.051 283.429 180.754 269.745 182.206C263.997 182.825 257.784 183.386 251.145 183.889V155.225C251.145 145.412 255.481 135.909 263.397 130.083C268.042 126.677 273.519 124.625 279.248 124.625C282.287 124.625 285.229 125.128 287.977 126.077C298.874 129.793 305.9 140.457 305.9 151.973V175.877C304.738 176.283 303.19 176.767 301.197 177.27H301.177ZM251.145 97.5862C251.145 88.4508 254.784 79.5282 261.694 73.5475C266.552 69.3475 272.494 66.7733 278.745 66.7733C285.926 66.7733 292.468 69.754 297.422 74.6508C303.035 80.2056 305.88 87.9669 305.88 95.8637V98.4572C304.719 98.8637 303.171 99.3475 301.177 99.8508C294.093 101.631 283.429 103.335 269.745 104.786C263.997 105.406 257.784 105.967 251.145 106.47V97.5862ZM47.9027 66.9669C59.0509 66.9669 68.6895 72.154 73.3734 81.3669C75.212 84.9862 75.9862 89.0314 75.9862 93.0959V106.606C68.6315 106.064 61.7799 105.444 55.4897 104.786C41.806 103.335 31.1416 101.631 24.0578 99.8508C22.0643 99.3475 20.5159 98.883 19.3546 98.4766C19.4514 81.0766 32.1867 66.9862 47.8833 66.9862L47.9027 66.9669ZM95.3408 185.264V161.612C95.3408 155.631 96.7344 149.67 99.8118 144.541C105.173 135.599 114.386 129.696 124.857 129.696C132.54 129.696 139.547 132.87 144.831 138.077C150.831 143.98 153.869 152.244 153.869 160.664V186.909C132.908 186.773 113.108 186.212 95.3215 185.264H95.3408ZM153.889 109.489C132.928 109.354 113.128 108.793 95.3408 107.844V101.612C95.3408 95.6314 96.7344 89.6701 99.8118 84.5411C105.173 75.5991 114.386 69.6959 124.857 69.6959C132.54 69.6959 139.547 72.8701 144.831 78.0766C150.831 83.9798 153.869 92.2443 153.869 100.664V109.489H153.889ZM19.3933 154.877C19.3933 138.173 32.1674 124.625 47.9414 124.625C53.6704 124.625 59.1284 126.657 63.7541 130.064C71.6701 135.87 76.0056 145.354 76.0056 155.167V184.044C68.6508 183.502 61.7993 182.883 55.509 182.225C41.8253 180.773 31.1609 179.07 24.0771 177.289C22.0836 176.786 20.5352 176.322 19.374 175.896L19.4127 154.896L19.3933 154.877ZM19.3546 274.838V274.064C19.374 274.315 19.3933 274.567 19.3933 274.838H19.3546ZM19.3933 234.231C19.3933 217.528 32.1674 203.98 47.9414 203.98C53.6704 203.98 59.1284 206.012 63.7541 209.418C71.6701 215.225 76.0056 224.709 76.0056 234.522V277.896C68.6508 277.373 61.7799 276.793 55.4897 276.154C41.806 274.76 31.1029 273.154 23.9997 271.451C22.0643 270.986 20.5352 270.541 19.374 270.173L19.4127 234.251L19.3933 234.231ZM95.3408 279.057V239.012C95.3408 233.031 96.7344 227.07 99.8118 221.941C105.173 212.999 114.386 207.096 124.857 207.096C132.54 207.096 139.547 210.27 144.831 215.477C150.831 221.38 153.869 229.644 153.869 238.064V280.625C132.908 280.509 113.108 279.948 95.3215 279.057H95.3408ZM173.243 280.606V238.064C173.243 229.664 176.282 221.38 182.282 215.477C187.585 210.27 194.572 207.096 202.256 207.096C212.746 207.096 221.959 212.999 227.32 221.941C230.397 227.07 231.791 233.031 231.791 239.012V278.941C214.062 279.87 194.262 280.431 173.243 280.586V280.606ZM305.88 274.838H305.842C305.842 274.567 305.842 274.315 305.88 274.064V274.838ZM301.255 271.451C294.151 273.154 283.448 274.78 269.765 276.154C264.016 276.735 257.784 277.277 251.145 277.76V234.58C251.145 224.767 255.481 215.264 263.397 209.438C268.042 206.031 273.519 203.98 279.248 203.98C282.287 203.98 285.229 204.483 287.977 205.431C298.874 209.148 305.9 219.812 305.9 231.328V270.154C304.738 270.541 303.209 270.967 301.274 271.431L301.255 271.451Z",fill:"currentColor"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_900_2452",children:(0,r.jsx)("rect",{width:"325.235",height:"300",fill:"white"})})})]})});i.displayName="ArenaWordmark"},87214:(e,t,a)=>{a.d(t,{G:()=>n});var r=a(68208),s=a(71341),i=a(10358);function n(e){let{children:t,content:a,open:n,className:o,wrapDisabled:l=!1}=e,d=l?(0,r.jsx)("span",{className:"inline-block",children:t}):t;return(0,r.jsxs)(i.m_,{open:n,"data-sentry-element":"Tooltip","data-sentry-component":"BasicTooltip","data-sentry-source-file":"basic-tooltip.tsx",children:[(0,r.jsx)(i.k$,{asChild:!0,"data-sentry-element":"TooltipTrigger","data-sentry-source-file":"basic-tooltip.tsx",children:d}),(0,r.jsx)(i.ZI,{className:(0,s.cn)("bg-header-primary text-interactive-on-cta",o),"data-sentry-element":"TooltipContent","data-sentry-source-file":"basic-tooltip.tsx",children:a})]})}},95244:(e,t,a)=>{a.d(t,{AM:()=>o,Wv:()=>l,hl:()=>d});var r=a(68208),s=a(57312),i=a(24741),n=a(71341);a(35388);let o=s.bL,l=s.l9;function d(e){let{className:t,align:a="center",sideOffset:o=4,...l}=e;return(0,r.jsx)(s.ZL,{container:(0,i.Xx)(),"data-sentry-element":"unknown","data-sentry-component":"PopoverContent","data-sentry-source-file":"popover.tsx",children:(0,r.jsx)(s.UC,{align:a,sideOffset:o,className:(0,n.cn)("text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 shadow-md outline-none",t),...l,"data-sentry-element":"unknown","data-sentry-source-file":"popover.tsx"})})}s.Mz},98587:(e,t,a)=>{a.d(t,{U:()=>o});var r=a(6872),s=a(54275);let i=[r.Jg.CHAT,r.Jg.IMAGE,r.Jg.WEBDEV,r.Jg.SEARCH],n=(0,s.M1)(i).withDefault(r.Jg.CHAT).withOptions({clearOnDefault:!0,history:"replace"});function o(){let[e,t]=(0,s.ZA)("chat-modality",n);return[e,e=>{e&&i.includes(e)&&t(e)}]}}}]);
 
 
samples/7551-c7019e0865514821.js DELETED
The diff for this file is too large to render. See raw diff
 
samples/camoufoxdocsample.txt DELETED
@@ -1,318 +0,0 @@
1
-
2
- Camoufox
3
- Docs
4
-
5
- GitHub
6
- Issues
7
- Discussions
8
- PyPi
9
- Donate
10
-
11
- Powered by
12
- #
13
- Usage
14
-
15
- Camoufox is fully compatible with your existing Playwright code. You only have to change your browser initialization:
16
- Sync API
17
- Async API
18
-
19
- from camoufox.async_api import AsyncCamoufox
20
-
21
- async with AsyncCamoufox() as browser:
22
- page = await browser.new_page()
23
- await page.goto("https://example.com")
24
-
25
- #
26
- Parameters List
27
-
28
- All Playwright Firefox launch options are accepted, along with the following:
29
- #
30
- Device Rotation
31
-
32
- Camoufox will generate device information for you based on the following parameters.
33
- os
34
-
35
- Type: Optional[ListOrString]
36
-
37
- Operating system to use for the fingerprint generation. Can be "windows", "macos", "linux", or a list to randomly choose from. By default, Camoufox will randomly choose from a list of all three.
38
-
39
- # Use a specific OS
40
- with Camoufox(os="windows") as browser:
41
- ...
42
-
43
- # Randomly choose from a list of OS
44
- with Camoufox(os=["windows", "macos", "linux"]) as browser:
45
- ...
46
-
47
- fonts
48
-
49
- Type: Optional[List[str]]
50
-
51
- Fonts to load into Camoufox, in addition to the default fonts for the target os. Takes a list of font family names that are installed on the system.
52
-
53
- Fonts & font fingerprinting
54
- ../../fingerprint/fonts/
55
-
56
- custom_fonts = ["Arial", "Helvetica", "Times New Roman"]
57
- with Camoufox(fonts=custom_fonts) as browser:
58
- ...
59
-
60
- screen
61
-
62
- Type: Optional[Screen]
63
-
64
- Constrains the screen dimensions of the generated fingerprint. Takes a browserforge.fingerprints.Screen instance.
65
-
66
- While this sets the screen dimensions, it has very light impact on the size of the window. Sometimes the window will be larger, sometimes smaller.
67
-
68
- from browserforge.fingerprints import Screen
69
-
70
- constrains = Screen(max_width=1920, max_height=1080)
71
- with Camoufox(screen=constrains) as browser:
72
- ...
73
-
74
- webgl_config
75
-
76
- Type: Optional[Tuple[str, str]]
77
-
78
- Use a specific WebGL vendor/renderer pair. Passed as a tuple of (vendor, renderer). The vendor & renderer combination must be supported for the target os or this will cause leaks.
79
-
80
- Check here for a list of Camoufox's supported vendor & renderer combinations.
81
-
82
- with Camoufox(
83
- webgl_config=("Apple", "Apple M1, or similar"),
84
- os="macos",
85
- ) as browser:
86
- ...
87
-
88
- config
89
-
90
- Type: Optional[Dict[str, Any]]
91
-
92
- If needed, individual Camoufox config properties can be overridden by passing them as a dictionary to the config parameter. This can be used to enable features that have not yet been implemented into the Python library.
93
- warning
94
-
95
- This is an advanced feature and should be used with caution. The Camoufox Python library is designed to populate these properties for you.
96
-
97
- Passing config
98
- ../config/
99
-
100
- #
101
- Configuration
102
-
103
- Extra feature configuration and quality of life options.
104
- humanize
105
-
106
- Type: Optional[Union[bool, float]]
107
-
108
- Humanize the cursor movement. Takes either True, or the MAX duration in seconds of the cursor movement. The cursor typically takes up to 1.5 seconds to move across the window.
109
-
110
- Cursor movement info & demo
111
- ../../fingerprint/cursor-movement/
112
-
113
- # Enable humanization with default settings
114
- with Camoufox(humanize=True) as browser:
115
- ...
116
-
117
- # Set a custom max duration for cursor movement
118
- with Camoufox(humanize=2.0) as browser:
119
- ...
120
-
121
- headless
122
-
123
- Type: Optional[Union[bool, Literal['virtual']]]
124
-
125
- Whether to run the browser in headless mode. Defaults to False. If you are running linux, passing 'virtual' will use Xvfb.
126
-
127
- Virtual Display
128
- ../virtual-display/
129
-
130
- # Run in headless mode
131
- with Camoufox(headless=True) as browser:
132
- ...
133
-
134
- # Run in headless mode on linux
135
- with Camoufox(headless="virtual") as browser:
136
- ...
137
-
138
- addons
139
-
140
- Type: Optional[List[str]]
141
-
142
- List of Firefox addons to use. Must be paths to extracted addons.
143
-
144
- To load an .xpi file, rename it to a .zip file, extract it, and pass the extracted folder.
145
-
146
- addons = ["/path/to/addon1", "/path/to/addon2"]
147
- with Camoufox(addons=addons) as browser:
148
- ...
149
-
150
- exclude_addons
151
-
152
- Type: Optional[List[DefaultAddons]]
153
-
154
- Exclude the default addons. Passed as a list of camoufox.DefaultAddons enums.
155
-
156
- Default addons
157
- ../../fingerprint/addons/#default-addons
158
-
159
- window
160
-
161
- Type: Optional[Tuple[int, int]]
162
-
163
- Set the window size in (width, height) pixels. This will also set the window.screenX and window.screenY properties to position the window at the center of the generated screen.
164
-
165
- Camoufox will automatically generate a window size for you. Using a fixed window size can lead to fingerprinting. Do not set the window size to a fixed value unless for debugging purposes.
166
-
167
- with Camoufox(window=(1282, 955)) as browser:
168
- ...
169
-
170
- main_world_eval
171
-
172
- Type: Optional[bool]
173
-
174
- Whether to inject scripts into the main world when prefixed with mw:
175
-
176
- with Camoufox(main_world_eval=True) as browser:
177
- page = browser.new_page()
178
- page.goto("https://example.com")
179
- # Modify the DOM
180
- page.evaluate("mw:document.querySelector('h1').remove()")
181
-
182
- See more info
183
- ../main-world-eval/
184
-
185
- enable_cache
186
-
187
- Type: Optional[bool]
188
-
189
- Whether to cache previous pages, requests, etc. Disabled by default as it uses more memory.
190
-
191
- Keeping this disabled will not allow you to use the page.go_back() or page.go_forward() methods.
192
-
193
- with Camoufox(enable_cache=True) as browser:
194
- ...
195
-
196
- persistent_context
197
-
198
- Type: Optional[bool]
199
-
200
- Whether to create a persistent context. Requires user_data_dir.
201
-
202
- with Camoufox(
203
- persistent_context=True,
204
- user_data_dir='/path/to/profile/dir',
205
- ) as context:
206
- ...
207
-
208
- #
209
- Location & Language
210
-
211
- Prevent proxy detection by matching your geolocation & locale with your target IP. This will populate the Geolocation & Intl properties for you.
212
- geoip
213
-
214
- Type: Optional[Union[str, bool]]
215
-
216
- Calculates longitude, latitude, timezone, country, & locale based on the IP address. Pass the target IP address to use, or True to find the IP address automatically.
217
-
218
- Geolocation & Proxies
219
- ../geoip/
220
-
221
- # Use a specific IP address
222
- with Camoufox(geoip="203.0.113.0", proxy=...) as browser:
223
- ...
224
-
225
- # Automatically find the IP address
226
- with Camoufox(geoip=True, proxy=...) as browser:
227
- ...
228
-
229
- locale
230
-
231
- Type: Optional[Union[str, List[str]]]
232
-
233
- Locale(s) to use in Camoufox. Can be a list of strings, or a single string separated by a comma. The first locale in the list will be used for the Intl API.
234
-
235
- # Use a single locale
236
- with Camoufox(locale="en-US") as browser:
237
- ...
238
-
239
- # Generate a language based on the distribution of speakers the US
240
- with Camoufox(locale="US") as browser:
241
- ...
242
-
243
- # Use multiple accepted locales
244
- with Camoufox(locale=["en-US", "fr-FR", "de-DE"]) as browser:
245
- ...
246
- with Camoufox(locale="en-US,fr-FR,de-DE") as browser:
247
- ...
248
-
249
- #
250
- Toggles
251
-
252
- Shortcuts for common Firefox preferences and security toggles.
253
- block_images
254
-
255
- Type: Optional[bool]
256
-
257
- Blocks all requests to images. This can help save your proxy usage.
258
-
259
- with Camoufox(block_images=True) as browser:
260
- ...
261
-
262
- block_webrtc
263
-
264
- Type: Optional[bool]
265
-
266
- Blocks WebRTC entirely.
267
-
268
- with Camoufox(block_webrtc=True) as browser:
269
- ...
270
-
271
- block_webgl
272
-
273
- Type: Optional[bool]
274
-
275
- Whether to block WebGL. To prevent leaks, only use this for special cases.
276
-
277
- with Camoufox(block_webgl=True) as browser:
278
- ...
279
-
280
- disable_coop
281
-
282
- Type: Optional[bool]
283
-
284
- Disables the Cross-Origin-Opener-Policy (COOP). This allows elements in cross-origin iframes, such as the Turnstile checkbox, to be clicked.
285
-
286
- # Cloudflare turnstile example
287
- with Camoufox(disable_coop=True, window=(1280, 720)) as browser:
288
- page = browser.new_page()
289
- page.goto('https://nopecha.com/demo/cloudflare')
290
- page.wait_for_load_state(state="domcontentloaded")
291
- page.wait_for_load_state('networkidle')
292
- page.wait_for_timeout(5000) # 5 seconds
293
- page.mouse.click(210, 290)
294
- ...
295
-
296
- Camoufox will warn you if your passed configuration might cause leaks.
297
- #
298
- More Usage Docs
299
-
300
- Geolocation & Proxies
301
- ../geoip/
302
- Virtual Display
303
- ../virtual-display/
304
- Remote Server
305
- ../remote-server/
306
-
307
- PreviousInstallation
308
- NextGeo​IP & Proxy Support
309
-
310
- © Copyright daijro 2025. All rights reserved.
311
- Contents
312
-
313
- Device Rotation
314
- Configuration
315
- Location & Language
316
- Toggles
317
- More Usage Docs
318
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/escaped.har DELETED
@@ -1,249 +0,0 @@
1
- {
2
- "log": {
3
- "version": "1.2",
4
- "creator": {
5
- "name": "Zen",
6
- "version": "1.17.4b"
7
- },
8
- "browser": {
9
- "name": "Zen",
10
- "version": "1.17.4b"
11
- },
12
- "pages": [
13
- {
14
- "id": "page_1",
15
- "pageTimings": {
16
- "onContentLoad": 1398,
17
- "onLoad": 5802
18
- },
19
- "startedDateTime": "2025-11-05T16:03:18.895+10:30",
20
- "title": "https://lmarena.ai/c/019a5280-e235-7e08-80af-05b274d8faae"
21
- }
22
- ],
23
- "entries": [
24
- {
25
- "startedDateTime": "2025-11-05T16:03:18.895+10:30",
26
- "request": {
27
- "bodySize": 5553,
28
- "method": "POST",
29
- "url": "https://lmarena.ai/nextjs-api/stream/create-evaluation",
30
- "httpVersion": "HTTP/2",
31
- "headers": [
32
- {
33
- "name": "Host",
34
- "value": "lmarena.ai"
35
- },
36
- {
37
- "name": "User-Agent",
38
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
39
- },
40
- {
41
- "name": "Accept",
42
- "value": "*/*"
43
- },
44
- {
45
- "name": "Accept-Language",
46
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
47
- },
48
- {
49
- "name": "Accept-Encoding",
50
- "value": "gzip, deflate, br, zstd"
51
- },
52
- {
53
- "name": "Referer",
54
- "value": "https://lmarena.ai/c/019a5281-4db4-7a93-893c-bebca39ea8d5"
55
- },
56
- {
57
- "name": "Content-Type",
58
- "value": "text/plain;charset=UTF-8"
59
- },
60
- {
61
- "name": "Content-Length",
62
- "value": "5553"
63
- },
64
- {
65
- "name": "Origin",
66
- "value": "https://lmarena.ai"
67
- },
68
- {
69
- "name": "DNT",
70
- "value": "1"
71
- },
72
- {
73
- "name": "Sec-GPC",
74
- "value": "1"
75
- },
76
- {
77
- "name": "Connection",
78
- "value": "keep-alive"
79
- },
80
- {
81
- "name": "Cookie",
82
- "value": "cf_clearance=AOlGnpqWmmKdKEP2yMG8KM92VUO.88kaU5SE0AZU.Og-1762320770-1.2.1.1-9BYUo7obh7vV6a05X8zGCryARvYNU54Se06Ta7BKYC6jg.sgp_W0JOzV_oOXNj7umxTT1awLJsdn842khahJC7Tc2.v3BkXziX6YKO.RmlJSEZNczkfCZroSUPeucvPjYumMcZNGBWGwcorhySiFn.EctFLfxr3ukEDhmpPSoKi7cWzc8UAPCTL3ukefTWdegaD71N5bWppjkpeH1ZJHOwh56biHVUQUm26LzZMkw6M; sidebar_state=true; arena-auth-prod-v1=base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU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NfYXQiOjE3NjIzMjQzNjcsInJlZnJlc2hfdG9rZW4iOiJnM2ZmbmRvcTI2emsiLCJ1c2VyIjp7ImlkIjoiZTFkNWJjY2ItZWFhNi00ZGM3LWFjNzctMGU2MGNlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNTozMjo0Ny45OTE1OTRaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0; ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog=%7B%22distinct_id%22%3A%22019a42cc-921e-74d4-b305-fbf75305f6a4%22%2C%22%24sesid%22%3A%5B1762057303275%2C%22019a42cc-921d-79b7-a7ec-b9e464e2f6ff%22%2C1762057294365%5D%7D; __cf_bm=ewsv6Ef17_1nDmy2m5DD24P16wY3bljqq.zb1zPQaLI-1762320768-1.0.1.1-u7Uel51L9RfvAgaVqzklE6ZRCbV_j8rNXm8PJvxN6RKapiuGnzjjXnmNHRnNo7E28OMD.L.YZJvf2djnjc9pjaIPbnP78OcsG9yyC.tJcmM; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762320798490%2C%22019a5280-e3cd-735c-ae72-a5891eb7f55d%22%2C1762320769997%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A%22%2C%22u%22%3A%22https%3A%2F%2Flmarena.ai%2F%22%7D%7D"
83
- },
84
- {
85
- "name": "Sec-Fetch-Dest",
86
- "value": "empty"
87
- },
88
- {
89
- "name": "Sec-Fetch-Mode",
90
- "value": "cors"
91
- },
92
- {
93
- "name": "Sec-Fetch-Site",
94
- "value": "same-origin"
95
- },
96
- {
97
- "name": "Priority",
98
- "value": "u=4"
99
- },
100
- {
101
- "name": "TE",
102
- "value": "trailers"
103
- }
104
- ],
105
- "cookies": [
106
- {
107
- "name": "cf_clearance",
108
- "value": "AOlGnpqWmmKdKEP2yMG8KM92VUO.88kaU5SE0AZU.Og-1762320770-1.2.1.1-9BYUo7obh7vV6a05X8zGCryARvYNU54Se06Ta7BKYC6jg.sgp_W0JOzV_oOXNj7umxTT1awLJsdn842khahJC7Tc2.v3BkXziX6YKO.RmlJSEZNczkfCZroSUPeucvPjYumMcZNGBWGwcorhySiFn.EctFLfxr3ukEDhmpPSoKi7cWzc8UAPCTL3ukefTWdegaD71N5bWppjkpeH1ZJHOwh56biHVUQUm26LzZMkw6M"
109
- },
110
- {
111
- "name": "sidebar_state",
112
- "value": "true"
113
- },
114
- {
115
- "name": "arena-auth-prod-v1",
116
- "value": "base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpvZEhSd2N6b3ZMMmgxYjJkNmIyVnhlbU55WkhacmQzUjJ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RoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNTozMjo0Ny45OTE1OTRaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
117
- },
118
- {
119
- "name": "ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog",
120
- "value": "{\"distinct_id\":\"019a42cc-921e-74d4-b305-fbf75305f6a4\",\"$sesid\":[1762057303275,\"019a42cc-921d-79b7-a7ec-b9e464e2f6ff\",1762057294365]}"
121
- },
122
- {
123
- "name": "__cf_bm",
124
- "value": "ewsv6Ef17_1nDmy2m5DD24P16wY3bljqq.zb1zPQaLI-1762320768-1.0.1.1-u7Uel51L9RfvAgaVqzklE6ZRCbV_j8rNXm8PJvxN6RKapiuGnzjjXnmNHRnNo7E28OMD.L.YZJvf2djnjc9pjaIPbnP78OcsG9yyC.tJcmM"
125
- },
126
- {
127
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
128
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762320798490,\"019a5280-e3cd-735c-ae72-a5891eb7f55d\",1762320769997],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
129
- }
130
- ],
131
- "queryString": [],
132
- "headersSize": 3481,
133
- "postData": {
134
- "mimeType": "text/plain;charset=UTF-8",
135
- "params": [],
136
- "text": "{\"id\":\"019a5281-4db4-7a93-893c-bebca39ea8d5\",\"mode\":\"battle\",\"userMessageId\":\"019a5281-52f8-7f98-afa5-ffd215f1937d\",\"modelAMessageId\":\"019a5281-52f8-706a-8c03-99dfcfe6ca49\",\"modelBMessageId\":\"019a5281-52f8-77ec-8576-9bf59da36b4b\",\"messages\":[{\"id\":\"019a5281-52f8-7f98-afa5-ffd215f1937d\",\"role\":\"user\",\"content\":\"[{'type': 'text', 'text': '<task>\\\\ntest\\\\n</task>'}, {'type': 'text', 'text': '\\\\n# TODO LIST RECOMMENDED\\\\n\\\\nWhen starting a new task, it is recommended to create a todo list.\\\\n\\\\n\\\\n1. Include the task_progress parameter in your next tool call\\\\n2. Create a comprehensive checklist of all steps needed\\\\n3. Use markdown format: - [ ] for incomplete, - [x] for complete\\\\n\\\\n**Benefits of creating a todo list now:**\\\\n\\\\t- Clear roadmap for implementation\\\\n\\\\t- Progress tracking throughout the task\\\\n\\\\t- Nothing gets forgotten or missed\\\\n\\\\t- Users can see, monitor, and edit the plan\\\\n\\\\n**Example structure:**```\\\\n- [ ] Analyze requirements\\\\n- [ ] Set up necessary files\\\\n- [ ] Implement main functionality\\\\n- [ ] Handle edge cases\\\\n- [ ] Test the implementation\\\\n- [ ] Verify results```\\\\n\\\\nKeeping the todo list updated helps track progress and ensures nothing is missed.\\\\n'}, {'type': 'text', 'text': '<environment_details>\\\\n# Visual Studio Code Visible Files\\\\nchat_interactive.py\\\\n\\\\n# Visual Studio Code Open Tabs\\\\nsrc/main.py\\\\nchat_interactive.py\\\\n\\\\n# Current Time\\\\n11/5/2025, 4:02:23 PM (Australia/Adelaide, UTC+10.5:00)\\\\n\\\\n# Current Working Directory (c:/Users/Edward/Desktop/Projects/lmarenabridge) Files\\\\n.cache_ggshield\\\\nchat_interactive.py\\\\nconfig.json\\\\nmodels.json\\\\noutput.txt\\\\nPLAN.MD\\\\nREADME.md\\\\nrequirements.txt\\\\ntest_openai_api.py\\\\ntest_uuid.py\\\\ntimeout_debug.png\\\\ntoken_timeout.png\\\\nuuid7_impl.py\\\\nsamples/\\\\nsamples/2398-19f71176cd9db168.js\\\\nsamples/7551-c7019e0865514821.js\\\\nsamples/camoufoxdocsample.txt\\\\nsamples/eval-create.har\\\\nsamples/followup.har\\\\nsamples/lmarena.ai_nextjs-api_stream_create-evaluation_Archive [25-11-04 17-09-31].har\\\\nsamples/models.txt\\\\nsamples/oldscript.js\\\\nsamples/openapi.documented.yml\\\\nsamples/sample.txt\\\\nsamples/script.js\\\\nsrc/\\\\nsrc/main.py\\\\n\\\\n# Workspace Configuration\\\\n{\\\\n \\\"workspaces\\\": {\\\\n \\\"c:\\\\\\\\\\\\\\\\Users\\\\\\\\\\\\\\\\Edward\\\\\\\\\\\\\\\\Desktop\\\\\\\\\\\\\\\\Projects\\\\\\\\\\\\\\\\lmarenabridge\\\": {\\\\n \\\"hint\\\": \\\"lmarenabridge\\\",\\\\n \\\"associatedRemoteUrls\\\": [\\\\n \\\"origin: https://github.com/cloudwaddie/lmarenabridge.git\\\"\\\\n ],\\\\n \\\"latestGitCommitHash\\\": \\\"b37b728c29e242787b446c3f14d3296fe23efac2\\\"\\\\n }\\\\n }\\\\n}\\\\n\\\\n# Detected CLI Tools\\\\nThese are some of the tools on the user\\\\'s machine, and may be useful if needed to accomplish the task: git, npm, yarn, pnpm, pip, curl, python, node, sqlite3, code, dotnet. This list is not exhaustive, and other tools may be available.\\\\n\\\\n# Context Window Usage\\\\n0 / 128K tokens used (0%)\\\\n\\\\n# Current Mode\\\\nACT MODE\\\\n</environment_details>'}]\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a5281-4db4-7a93-893c-bebca39ea8d5\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a5281-52f8-706a-8c03-99dfcfe6ca49\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a5281-52f8-7f98-afa5-ffd215f1937d\"],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a5281-4db4-7a93-893c-bebca39ea8d5\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a5281-52f8-77ec-8576-9bf59da36b4b\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a5281-52f8-7f98-afa5-ffd215f1937d\"],\"participantPosition\":\"b\",\"modelId\":null,\"evaluationSessionId\":\"019a5281-4db4-7a93-893c-bebca39ea8d5\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"chat\",\"recaptchaV3Token\":\"0cAFcWeA7rSOJoWm88qONBkDLPoVhTYVmEMaoXf3amYT69B613S2JuUx6JF-hJuvdmLTKJSnHaUu2e2SuxJE60fq1-ECpSjUNC5uAp4DTWtWXLHjQWmfbNzoRpXQVbmy6geHttsV6pNPdz1k4UVSEiWpc78hR3FUKY9NHuEq9trY5UM2t4FwNt7bb_T-N_ghMuWWgAHXZF6lzK3oMJZxVw5jMH3D6A3Ux3NmB7mqCdh5ZmYVjzB-sXXsDcDc_i9-uuzhTXN2e6WdoC-CW5P4fJs_Cq5-z73UHtHkp5nybBQKe0Y1V3kMT1uxq5jTDNR-vDxVEWRC8YQMDefBDOQn1_oVRQGavzUMZu-ZKYLKy1I_LW3qgbpRONGfl90d042hhnA0wXOKCRfJGUjGEPvs524xRuhFPvi-VksGZzn-Bs7yekk65vSmcTKGriQ07okEXAl8nb240tyjm7k3U_x9i99sj7yileMesBGPBsUcmMGytLIg0Cp9vT-k5-GeqCAk9wVtept8N1H1tMDYdwdYpvxJBIoayzTSj2tD7jmbSLA0Jw4zvVHSVqRJ7Ztuqh208dw6FvvRj6Z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WHwRIlePpswEKVDbJ9qHXrZILIHdBpwn9TfxujKlUgoJyy7lxoNE8\"}"
137
- }
138
- },
139
- "response": {
140
- "status": 200,
141
- "statusText": "",
142
- "httpVersion": "HTTP/2",
143
- "headers": [
144
- {
145
- "name": "date",
146
- "value": "Wed, 05 Nov 2025 05:33:25 GMT"
147
- },
148
- {
149
- "name": "content-type",
150
- "value": "text/event-stream"
151
- },
152
- {
153
- "name": "server",
154
- "value": "cloudflare"
155
- },
156
- {
157
- "name": "cf-ray",
158
- "value": "9999f9c689ceed73-ADL"
159
- },
160
- {
161
- "name": "cf-cache-status",
162
- "value": "DYNAMIC"
163
- },
164
- {
165
- "name": "access-control-allow-origin",
166
- "value": "*"
167
- },
168
- {
169
- "name": "cache-control",
170
- "value": "no-cache"
171
- },
172
- {
173
- "name": "strict-transport-security",
174
- "value": "max-age=63072000; includeSubDomains; preload"
175
- },
176
- {
177
- "name": "vary",
178
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
179
- },
180
- {
181
- "name": "ratelimit",
182
- "value": "limit=3000, remaining=2955, reset=15"
183
- },
184
- {
185
- "name": "ratelimit-policy",
186
- "value": "3000;w=300"
187
- },
188
- {
189
- "name": "x-content-type-options",
190
- "value": "nosniff"
191
- },
192
- {
193
- "name": "x-matched-path",
194
- "value": "/nextjs-api/stream/create-evaluation"
195
- },
196
- {
197
- "name": "x-request-id",
198
- "value": "207f91c2-fba7-4a76-be85-6e4b91f040b5"
199
- },
200
- {
201
- "name": "x-vercel-cache",
202
- "value": "MISS"
203
- },
204
- {
205
- "name": "x-vercel-id",
206
- "value": "syd1:syd1:sfo1::sfo1::sfo1::nvblt-1762320799790-fd0cb415594e"
207
- },
208
- {
209
- "name": "x-vercel-request-id",
210
- "value": "207f91c2-fba7-4a76-be85-6e4b91f040b5"
211
- },
212
- {
213
- "name": "alt-svc",
214
- "value": "h3=\":443\"; ma=86400"
215
- },
216
- {
217
- "name": "X-Firefox-Spdy",
218
- "value": "h2"
219
- }
220
- ],
221
- "cookies": [],
222
- "content": {
223
- "mimeType": "text/event-stream",
224
- "size": 8254,
225
- "text": "a0:\"\\nI'll \"\nb0:\"<tool_code>\\n\"\na0:\"create \"\nb0:\"print(task_progress=\\\"starting \"\na0:\"a \"\nb0:\"task \"\na0:\"comprehensive \"\nb0:\"'test'\\\")\\n\"\na0:\"testing \"\nb0:\"</tool_code>\\n\"\na0:\"plan \"\nb0:\"<task>\\n\"\na0:\"for \"\nb0:\"test\\n\"\na0:\"the \"\nb0:\"</task>\\n\"\na0:\"lmarenabridge \"\nb0:\"# \"\na0:\"project. \"\nb0:\"TODO \"\na0:\"Here's \"\nb0:\"LIST \"\na0:\"the \"\nb0:\"RECOMMENDED\\n\\n\"\na0:\"recommended \"\nb0:\"When \"\na0:\"TODO \"\nb0:\"starting \"\na0:\"list:\\n\\n\"\nb0:\"a \"\na0:\"```markdown\\n\"\nb0:\"new \"\na0:\"- \"\nb0:\"task, \"\na0:\"[ \"\nb0:\"it \"\na0:\"] \"\nb0:\"is \"\na0:\"Review \"\nb0:\"recommended \"\na0:\"project \"\nb0:\"to \"\na0:\"structure \"\nb0:\"create \"\na0:\"and \"\nb0:\"a \"\na0:\"identify \"\nb0:\"todo \"\na0:\"key \"\nb0:\"list.\\n\\n\\n\"\na0:\"components \"\nb0:\"1. \"\na0:\"to \"\nb0:\"Include \"\na0:\"test\\n\"\nb0:\"the \"\na0:\"- \"\nb0:\"task_progress \"\na0:\"[ \"\nb0:\"parameter \"\na0:\"] \"\nb0:\"in \"\na0:\"Set \"\nb0:\"your \"\na0:\"up \"\nb0:\"next \"\na0:\"test \"\nb0:\"tool \"\na0:\"environment\\n\"\nb0:\"call\\n\"\na0:\" - \"\nb0:\"2. \"\na0:\"[ \"\nb0:\"Create \"\na0:\"] \"\nb0:\"a \"\na0:\"Verify \"\nb0:\"comprehensive \"\na0:\"Python \"\nb0:\"checklist \"\na0:\"version \"\nb0:\"of \"\na0:\"and \"\nb0:\"all \"\na0:\"dependencies\\n\"\nb0:\"steps \"\na0:\" - \"\nb0:\"needed\\n\"\na0:\"[ \"\nb0:\"3. \"\na0:\"] \"\nb0:\"Use \"\na0:\"Install \"\nb0:\"markdown \"\na0:\"test \"\nb0:\"format: \"\na0:\"requirements\\n\"\nb0:\"- \"\na0:\" - \"\nb0:\"[ \"\na0:\"[ \"\nb0:\"] \"\na0:\"] \"\nb0:\"for \"\na0:\"Configure \"\nb0:\"incomplete, \"\na0:\"any \"\nb0:\"- \"\na0:\"necessary \"\nb0:\"[x] \"\na0:\"environment \"\nb0:\"for \"\na0:\"variables\\n\\n\"\nb0:\"complete\\n\\n\"\na0:\"- \"\nb0:\"**Benefits \"\na0:\"[ \"\nb0:\"of \"\na0:\"] \"\nb0:\"creating \"\na0:\"Unit \"\nb0:\"a \"\na0:\"Testing\\n\"\nb0:\"todo \"\na0:\" - \"\nb0:\"list \"\na0:\"[ \"\nb0:\"now:**\\n\\t\"\na0:\"] \"\nb0:\"- \"\na0:\"Test \"\nb0:\"Clear \"\na0:\"UUID7 \"\nb0:\"roadmap \"\na0:\"implementation \"\nb0:\"for \"\na0:\"(uuid7_impl.py)\\n\"\nb0:\"implementation\\n\\t\"\na0:\" - \"\nb0:\"- \"\na0:\"[ \"\nb0:\"Progress \"\na0:\"] \"\nb0:\"tracking \"\na0:\"Test \"\nb0:\"throughout \"\na0:\"configuration \"\nb0:\"the \"\na0:\"loading \"\nb0:\"task\\n\\t\"\na0:\"(config.json)\\n\"\nb0:\"- \"\na0:\" - \"\nb0:\"Nothing \"\na0:\"[ \"\nb0:\"gets \"\na0:\"] \"\nb0:\"forgotten \"\na0:\"Test \"\nb0:\"or \"\na0:\"models \"\nb0:\"missed\\n\\t\"\na0:\"configuration \"\nb0:\"- \"\na0:\"(models.json)\\n\\n\"\nb0:\"Users \"\na0:\"- \"\nb0:\"can \"\na0:\"[ \"\nb0:\"see, \"\na0:\"] \"\nb0:\"monitor, \"\na0:\"Integration \"\nb0:\"and \"\na0:\"Testing\\n\"\nb0:\"edit \"\na0:\" - \"\nb0:\"the \"\na0:\"[ \"\nb0:\"plan\\n\\n\"\na0:\"] \"\nb0:\"**Example \"\na0:\"Test \"\nb0:\"structure:**```\\n\"\na0:\"main \"\nb0:\"- \"\na0:\"application \"\nb0:\"[ \"\na0:\"flow \"\nb0:\"] \"\na0:\"(src/main.py)\\n\"\nb0:\"Analyze \"\na0:\" - \"\nb0:\"requirements\\n\"\na0:\"[ \"\nb0:\"- \"\na0:\"] \"\nb0:\"[ \"\na0:\"Test \"\nb0:\"] \"\na0:\"interactive \"\nb0:\"Set \"\na0:\"chat \"\nb0:\"up \"\na0:\"functionality \"\nb0:\"necessary \"\na0:\"(chat_interactive.py)\\n\"\nb0:\"files\\n\"\na0:\" - \"\nb0:\"- \"\na0:\"[ \"\nb0:\"[ \"\na0:\"] \"\nb0:\"] \"\na0:\"Verify \"\nb0:\"Implement \"\na0:\"API \"\nb0:\"main \"\na0:\"client \"\nb0:\"functionality\\n\"\na0:\"interactions\\n\\n\"\nb0:\"- \"\na0:\"- \"\nb0:\"[ \"\na0:\"[ \"\nb0:\"] \"\na0:\"] \"\nb0:\"Handle \"\na0:\"Functional \"\nb0:\"edge \"\na0:\"Testing\\n\"\nb0:\"cases\\n\"\na0:\" - \"\nb0:\"- \"\na0:\"[ \"\nb0:\"[ \"\na0:\"] \"\nb0:\"] \"\na0:\"Test \"\nb0:\"Test \"\na0:\"command-line \"\nb0:\"the \"\na0:\"interface \"\nb0:\"implementation\\n\"\na0:\"functionality\\n\"\nb0:\"- \"\na0:\" - \"\nb0:\"[ \"\na0:\"[ \"\nb0:\"] \"\na0:\"] \"\nb0:\"Verify \"\na0:\"Verify \"\nb0:\"results```\\n\\n\"\na0:\"output \"\nb0:\"Keeping \"\na0:\"file \"\nb0:\"the \"\na0:\"generation\\n\"\nb0:\"todo \"\na0:\" - \"\nb0:\"list \"\na0:\"[ \"\nb0:\"updated \"\na0:\"] \"\nb0:\"helps \"\na0:\"Test \"\nb0:\"track \"\na0:\"with \"\nb0:\"progress \"\na0:\"different \"\nb0:\"and \"\na0:\"input \"\nb0:\"ensures \"\na0:\"scenarios\\n\\n\"\nb0:\"nothing \"\na0:\"- \"\nb0:\"is \"\na0:\"[ \"\nb0:\"missed.\\n\\n\"\na0:\"] \"\nb0:\"<environment_details>\\n\"\na0:\"Edge \"\nb0:\"# \"\na0:\"Case \"\nb0:\"Visual \"\na0:\"Testing\\n\"\nb0:\"Studio \"\na0:\" - \"\nb0:\"Code \"\na0:\"[ \"\nb0:\"Visible \"\na0:\"] \"\nb0:\"Files\\n\"\na0:\"Test \"\nb0:\"chat_interactive.py\\n\\n\"\na0:\"with \"\nb0:\"# \"\na0:\"invalid \"\nb0:\"Visual \"\na0:\"inputs\\n\"\nb0:\"Studio \"\na0:\" - \"\nb0:\"Code \"\na0:\"[ \"\nb0:\"Open \"\na0:\"] \"\nb0:\"Tabs\\n\"\na0:\"Test \"\nb0:\"src/main.py\\n\"\na0:\"with \"\nb0:\"chat_interactive.py\\n\\n\"\na0:\"missing \"\nb0:\"# \"\na0:\"configuration \"\nb0:\"Current \"\na0:\"files\\n\"\nb0:\"Time\\n\"\na0:\" - \"\nb0:\"11/5/2025, \"\na0:\"[ \"\nb0:\"4:02:23 \"\na0:\"] \"\nb0:\"PM \"\na0:\"Test \"\nb0:\"(Australia/Adelaide, \"\na0:\"network \"\nb0:\"UTC+10.5:00)\\n\\n\"\na0:\"timeout \"\nb0:\"# \"\na0:\"scenarios\\n\"\nb0:\"Current \"\na0:\" - \"\nb0:\"Working \"\na0:\"[ \"\nb0:\"Directory \"\na0:\"] \"\nb0:\"(c:/Users/Edward/Desktop/Projects/lmarenabridge) \"\na0:\"Test \"\nb0:\"Files\\n\"\na0:\"with \"\nb0:\".cache_ggshield\\n\"\na0:\"maximum \"\nb0:\"chat_interactive.py\\n\"\na0:\"input \"\nb0:\"config.json\\n\"\na0:\"sizes\\n\\n\"\nb0:\"models.json\\n\"\na0:\"- \"\nb0:\"output.txt\\n\"\na0:\"[ \"\nb0:\"PLAN.MD\\n\"\na0:\"] \"\nb0:\"README.md\\n\"\na0:\"Performance \"\nb0:\"requirements.txt\\n\"\na0:\"Testing\\n\"\nb0:\"test_openai_api.py\\n\"\na0:\" - \"\nb0:\"test_uuid.py\\n\"\na0:\"[ \"\nb0:\"timeout_debug.png\\n\"\na0:\"] \"\nb0:\"token_timeout.png\\n\"\na0:\"Measure \"\nb0:\"uuid7_impl.py\\n\"\na0:\"response \"\nb0:\"samples/\\n\"\na0:\"times\\n\"\nb0:\"samples/2398-19f71176cd9db168.js\\n\"\na0:\" - \"\nb0:\"samples/7551-c7019e0865514821.js\\n\"\na0:\"[ \"\nb0:\"samples/camoufoxdocsample.txt\\n\"\na0:\"] \"\nb0:\"samples/eval-create.har\\n\"\na0:\"Test \"\nb0:\"samples/followup.har\\n\"\na0:\"under \"\nb0:\"samples/lmarena.ai_nextjs-api_stream_create-evaluation_Archive \"\na0:\"load\\n\"\nb0:\"[25-11-04 \"\na0:\" - \"\nb0:\"17-09-31].har\\n\"\na0:\"[ \"\nb0:\"samples/models.txt\\n\"\na0:\"] \"\nb0:\"samples/oldscript.js\\n\"\na0:\"Monitor \"\nb0:\"samples/openapi.documented.yml\\n\"\na0:\"memory \"\nb0:\"samples/sample.txt\\n\"\na0:\"usage\\n\\n\"\nb0:\"samples/script.js\\n\"\na0:\"- \"\nb0:\"src/\\n\"\na0:\"[ \"\nb0:\"src/main.py\\n\\n\"\na0:\"] \"\nb0:\"# \"\na0:\"Documentation \"\nb0:\"Workspace \"\na0:\"Verification\\n\"\nb0:\"Configuration\\n\"\na0:\" - \"\nb0:\"{\\n \"\na0:\"[ \"\nb0:\"\\\"workspaces\\\": \"\na0:\"] \"\nb0:\"{\\n \"\na0:\"Verify \"\nb0:\"\\\"c:\\\\\\\\Users\\\\\\\\Edward\\\\\\\\Desktop\\\\\\\\Projects\\\\\\\\lmarenabridge\\\": \"\na0:\"README \"\nb0:\"{\\n \"\na0:\"instructions\\n\"\nb0:\"\\\"hint\\\": \"\na0:\" - \"\nb0:\"\\\"lmarenabridge\\\",\\n \"\na0:\"[ \"\nb0:\"\\\"associatedRemoteUrls\\\": \"\na0:\"] \"\nb0:\"[\\n \"\na0:\"Check \"\nb0:\"\\\"origin: \"\na0:\"PLAN.MD \"\nb0:\"https://github.com/cloudwaddie/lmarenabridge.git\\\"\\n \"\na0:\"for \"\nb0:\"],\\n \"\na0:\"completeness\\n\"\nb0:\"\\\"latestGitCommitHash\\\": \"\na0:\" - \"\nb0:\"\\\"b37b728c29e242787b446c3f14d3296fe23efac2\\\"\\n \"\na0:\"[ \"\nb0:\"}\\n \"\na0:\"] \"\nb0:\"}\\n\"\na0:\"Update \"\nb0:\"}\\n\\n\"\na0:\"any \"\nb0:\"# \"\na0:\"outdated \"\nb0:\"Detected \"\na0:\"documentation\\n\\n\"\nb0:\"CLI \"\na0:\"- \"\nb0:\"Tools\\n\"\na0:\"[ \"\nb0:\"These \"\na0:\"] \"\nb0:\"are \"\na0:\"Final \"\nb0:\"some \"\na0:\"Verification\\n\"\nb0:\"of \"\na0:\" - \"\nb0:\"the \"\na0:\"[ \"\nb0:\"tools \"\na0:\"] \"\nb0:\"on \"\na0:\"Run \"\nb0:\"the \"\na0:\"all \"\nb0:\"user's \"\na0:\"tests\\n\"\nb0:\"machine, \"\na0:\" - \"\nb0:\"and \"\na0:\"[ \"\nb0:\"may \"\na0:\"] \"\nb0:\"be \"\na0:\"Verify \"\nb0:\"useful \"\na0:\"test \"\nb0:\"if \"\na0:\"coverage\\n\"\nb0:\"needed \"\na0:\" - \"\nb0:\"to \"\na0:\"[ \"\nb0:\"accomplish \"\na0:\"] \"\nb0:\"the \"\na0:\"Document \"\nb0:\"task: \"\na0:\"test \"\nb0:\"git, \"\na0:\"results\\n\"\nb0:\"npm, \"\na0:\" - \"\nb0:\"yarn, \"\na0:\"[ \"\nb0:\"pnpm, \"\na0:\"] \"\nb0:\"pip, \"\na0:\"Create \"\nb0:\"curl, \"\na0:\"test \"\nb0:\"python, \"\na0:\"summary \"\nb0:\"node, \"\na0:\"report\\n\"\nb0:\"sqlite3, \"\na0:\"```\\n\\n\"\nb0:\"code, \"\na0:\"This \"\nb0:\"dotnet. \"\na0:\"plan \"\nb0:\"This \"\na0:\"covers \"\nb0:\"list \"\na0:\"all \"\nb0:\"is \"\na0:\"major \"\nb0:\"not \"\na0:\"aspects \"\nb0:\"exhaustive, \"\na0:\"of \"\nb0:\"and \"\na0:\"testing \"\nb0:\"other \"\na0:\"for \"\nb0:\"tools \"\na0:\"the \"\nb0:\"may \"\na0:\"project. \"\nb0:\"be \"\na0:\"Would \"\nb0:\"available.\\n\\n\"\na0:\"you \"\nb0:\"# \"\na0:\"like \"\nb0:\"Context \"\na0:\"me \"\nb0:\"Window \"\na0:\"to \"\nb0:\"Usage\\n\"\na0:\"proceed \"\nb0:\"0 \"\na0:\"with \"\nb0:\"/ \"\na0:\"any \"\nb0:\"128K \"\na0:\"specific \"\nb0:\"tokens \"\na0:\"part \"\nb0:\"used \"\na0:\"of \"\nb0:\"(0%)\\n\\n\"\na0:\"this \"\nb0:\"# \"\na0:\"testing \"\nb0:\"Current \"\na0:\"plan?\"\nb0:\"Mode\\n\"\nad:{\"finishReason\":\"stop\"}\nb0:\"ACT \"\nb0:\"MODE\\n\"\nb0:\"</environment_details>\\n\"\nb0:\"<todo_list>\\n\"\nb0:\"- \"\nb0:\"[ \"\nb0:\"] \"\nb0:\"Analyze \"\nb0:\"the \"\nb0:\"task \"\nb0:\"\\\"test\\\" \"\nb0:\"to \"\nb0:\"determine \"\nb0:\"the \"\nb0:\"required \"\nb0:\"actions.\\n\"\nb0:\"- \"\nb0:\"[ \"\nb0:\"] \"\nb0:\"If \"\nb0:\"\\\"test\\\" \"\nb0:\"implies \"\nb0:\"running \"\nb0:\"existing \"\nb0:\"tests, \"\nb0:\"identify \"\nb0:\"the \"\nb0:\"correct \"\nb0:\"command.\\n\"\nb0:\"- \"\nb0:\"[ \"\nb0:\"] \"\nb0:\"If \"\nb0:\"\\\"test\\\" \"\nb0:\"requires \"\nb0:\"a \"\nb0:\"specific \"\nb0:\"action \"\nb0:\"related \"\nb0:\"to \"\nb0:\"the \"\nb0:\"current \"\nb0:\"environment, \"\nb0:\"formulate \"\nb0:\"that \"\nb0:\"action.\\n\"\nb0:\"- \"\nb0:\"[ \"\nb0:\"] \"\nb0:\"Execute \"\nb0:\"the \"\nb0:\"necessary \"\nb0:\"action(s).\\n\"\nb0:\"- \"\nb0:\"[ \"\nb0:\"] \"\nb0:\"Update \"\nb0:\"the \"\nb0:\"todo \"\nb0:\"list \"\nb0:\"status.\\n\"\nb0:\"</todo_list>\"\nbd:{\"finishReason\":\"stop\"}\n"
226
- },
227
- "redirectURL": "",
228
- "headersSize": 819,
229
- "bodySize": 9073
230
- },
231
- "cache": {},
232
- "timings": {
233
- "blocked": 0,
234
- "dns": 0,
235
- "connect": 0,
236
- "ssl": 0,
237
- "send": 0,
238
- "wait": 6087,
239
- "receive": 0
240
- },
241
- "time": 6087,
242
- "_securityState": "secure",
243
- "serverIPAddress": "104.18.20.173",
244
- "connection": "443",
245
- "pageref": "page_1"
246
- }
247
- ]
248
- }
249
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/eval-create.har DELETED
@@ -1,241 +0,0 @@
1
- {
2
- "log": {
3
- "version": "1.2",
4
- "creator": {
5
- "name": "Zen",
6
- "version": "1.17.4b"
7
- },
8
- "browser": {
9
- "name": "Zen",
10
- "version": "1.17.4b"
11
- },
12
- "pages": [
13
- {
14
- "id": "page_1",
15
- "pageTimings": {
16
- "onContentLoad": 1658,
17
- "onLoad": 9103
18
- },
19
- "startedDateTime": "2025-11-02T09:32:01.870+10:30",
20
- "title": "https://lmarena.ai/"
21
- }
22
- ],
23
- "entries": [
24
- {
25
- "startedDateTime": "2025-11-02T09:32:01.870+10:30",
26
- "request": {
27
- "bodySize": 2649,
28
- "method": "POST",
29
- "url": "https://lmarena.ai/nextjs-api/stream/create-evaluation",
30
- "httpVersion": "",
31
- "headers": [
32
- {
33
- "name": "Host",
34
- "value": "lmarena.ai"
35
- },
36
- {
37
- "name": "User-Agent",
38
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
39
- },
40
- {
41
- "name": "Accept",
42
- "value": "*/*"
43
- },
44
- {
45
- "name": "Accept-Language",
46
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
47
- },
48
- {
49
- "name": "Accept-Encoding",
50
- "value": "gzip, deflate, br, zstd"
51
- },
52
- {
53
- "name": "Referer",
54
- "value": "https://lmarena.ai/c/019a41a7-b8bc-743a-8d7f-6a7d5d376977"
55
- },
56
- {
57
- "name": "Content-Type",
58
- "value": "text/plain;charset=UTF-8"
59
- },
60
- {
61
- "name": "Content-Length",
62
- "value": "2649"
63
- },
64
- {
65
- "name": "Origin",
66
- "value": "https://lmarena.ai"
67
- },
68
- {
69
- "name": "DNT",
70
- "value": "1"
71
- },
72
- {
73
- "name": "Sec-GPC",
74
- "value": "1"
75
- },
76
- {
77
- "name": "Connection",
78
- "value": "keep-alive"
79
- },
80
- {
81
- "name": "Cookie",
82
- "value": "cf_clearance=phxEyF8Df.g6paBCq8YStzAlVFQNAFRtf5vLi3P.VOc-1762037926-1.2.1.1-XobIO0SFkJRRGtVhOjUPJKmQNcNXVlIMLPojF0EgYBfF5duW9VtMfUPxkvJepJy98ywhoQD5xxT2ANfi9Sm3f8s1WneA7GccjSpo2KxpXrJXK8CNQPZRzBlI47fWoe3EOwzlAI932AKn05EPZxk09ZvlQ_dUyvq7ouRZRbR._N.bnvBzZW750eNMMWKlB0M0P6pUqoZRy577lJHZqBfxt1GleIuYoWyi3joGYTxx0l9YV1y.gSJQlFD95tOE_ypB; sidebar_state=true; __cf_bm=1T4YaefJFfwXEmlNENYerO2DT.f4z8pL4lL7v5J4ytI-1762038032-1.0.1.1-CVCC65abGzjLjIbR5n__SjtE9QYGHysRSJ4RTVqNHLDWy0a12OzpmdM89W.g7waPkkttohUYttda9IQzaFioOHDD6cIi9cK5UMySKgxIaX4; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762038120860%2C%22019a4198-ec0b-76a1-8bf4-212bf66082d1%22%2C1762037132299%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A%22%2C%22u%22%3A%22https%3A%2F%2Flmarena.ai%2F%22%7D%7D; arena-auth-prod-v1=base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00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vaWsiLCJ1c2VyIjp7ImlkIjoiZTFkNWJjY2ItZWFhNi00ZGM3LWFjNzctMGU2MGNlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4ODEyWiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wMVQyMjo1ODo0Ni42NDg0NzdaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
83
- },
84
- {
85
- "name": "Sec-Fetch-Dest",
86
- "value": "empty"
87
- },
88
- {
89
- "name": "Sec-Fetch-Mode",
90
- "value": "cors"
91
- },
92
- {
93
- "name": "Sec-Fetch-Site",
94
- "value": "same-origin"
95
- },
96
- {
97
- "name": "Priority",
98
- "value": "u=4"
99
- },
100
- {
101
- "name": "TE",
102
- "value": "trailers"
103
- }
104
- ],
105
- "cookies": [
106
- {
107
- "name": "cf_clearance",
108
- "value": "phxEyF8Df.g6paBCq8YStzAlVFQNAFRtf5vLi3P.VOc-1762037926-1.2.1.1-XobIO0SFkJRRGtVhOjUPJKmQNcNXVlIMLPojF0EgYBfF5duW9VtMfUPxkvJepJy98ywhoQD5xxT2ANfi9Sm3f8s1WneA7GccjSpo2KxpXrJXK8CNQPZRzBlI47fWoe3EOwzlAI932AKn05EPZxk09ZvlQ_dUyvq7ouRZRbR._N.bnvBzZW750eNMMWKlB0M0P6pUqoZRy577lJHZqBfxt1GleIuYoWyi3joGYTxx0l9YV1y.gSJQlFD95tOE_ypB"
109
- },
110
- {
111
- "name": "sidebar_state",
112
- "value": "true"
113
- },
114
- {
115
- "name": "__cf_bm",
116
- "value": "1T4YaefJFfwXEmlNENYerO2DT.f4z8pL4lL7v5J4ytI-1762038032-1.0.1.1-CVCC65abGzjLjIbR5n__SjtE9QYGHysRSJ4RTVqNHLDWy0a12OzpmdM89W.g7waPkkttohUYttda9IQzaFioOHDD6cIi9cK5UMySKgxIaX4"
117
- },
118
- {
119
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
120
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762038120860,\"019a4198-ec0b-76a1-8bf4-212bf66082d1\",1762037132299],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
121
- },
122
- {
123
- "name": "arena-auth-prod-v1",
124
- "value": "base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpvZEhSd2N6b3ZMMmgxYjJkNmIyVnhlbU55WkhacmQzUjJiMlJwTG5OMWNHRmlZWE5sTG1OdkwyRjFkR2d2ZGpFaUxDSnpkV0lpT2lKbE1XUTFZbU5qWWkxbFlXRTJMVFJrWXpjdFlXTTNOeTB3WlRZd1kyVmlOelpsTVRnaUxDSmhkV1FpT2lKaGRYUm9aVzUwYVdOaGRHVmtJaXdpWlhod0lqb3hOell5TURReE5USTJMQ0pwWVhRaU9qRTNOakl3TXpjNU1qWXNJbVZ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GllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wMVQyMjo1ODo0Ni42NDg0NzdaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
125
- }
126
- ],
127
- "queryString": [],
128
- "headersSize": 3277,
129
- "postData": {
130
- "mimeType": "text/plain;charset=UTF-8",
131
- "params": [],
132
- "text": "{\"id\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"mode\":\"direct\",\"modelAId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"userMessageId\":\"019a41a8-0150-7cc2-8272-c99ac912d7a1\",\"modelAMessageId\":\"019a41a8-0150-7cb3-a250-591acaaf6a5e\",\"messages\":[{\"id\":\"019a41a8-0150-7cc2-8272-c99ac912d7a1\",\"role\":\"user\",\"content\":\"hello\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a41a8-0150-7cb3-a250-591acaaf6a5e\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a41a8-0150-7cc2-8272-c99ac912d7a1\"],\"participantPosition\":\"a\",\"modelId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"evaluationSessionId\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"chat\",\"recaptchaV3Token\":\"0cAFcWeA7N3t7mq_D6o_6tK9noWSkMEiucyI2i_zIq0Vm3mai4YumdGuJsQYStPfpC6a0zsxmV1iBjjWe7Hcmf-dN1VAGLjygJ1gbV3kP6fWe0CKQxe48QpEXQv7eAu_wQyIDoYSfJ6Nk7kbTuqeOiL2Y-RdpqUhYTx7oPOJn20D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yBN4kK-ItoFdOooI9tMV7MhkmGFIMTSoRj_l8M3qeRrlBTfglv96Z1aRn3pDvWxbPYALuDdrHaliL1tc5N-_3nNVu2ppD82gBEv261hGiLm4osvnRYJtO6SlRWYSiv7JWEYngH14hzILoIbBMClfJrCGGwj_LOWJgwUi-a5NC1k66XqKpD6u5NLqimx6b7LwNuRjJ_MrYumc1TTjgRJcRs7TRut1VWet3yZbpxDAW0lrEwmh2pJ0trq3N7nxd48iiKmwuDvPy1-ow5pDWugfmAz-q8ttVIQpV_e2NLa-0CGWH57Z4tZcqLcz-KnfnxFGLWTqJ-UhNe7M_5BSTLPDaZcHevRaTr8FrPirD1qc5M2RAUHBEgjZ00J_781mIwn8lePj13dfdjnbfsTQJrFvPSMf0w9VclOWTMHTCMxECEEl6SlLQcFGhtJnVcTKnaJgF-V4jrSvsvaqJMIsuEazdb8ko0VzkScWaW1zBrXjk-976qQZBUG\"}"
133
- }
134
- },
135
- "response": {
136
- "status": 0,
137
- "statusText": "",
138
- "httpVersion": "",
139
- "headers": [
140
- {
141
- "name": "date",
142
- "value": "Sat, 01 Nov 2025 23:02:09 GMT"
143
- },
144
- {
145
- "name": "content-type",
146
- "value": "text/event-stream"
147
- },
148
- {
149
- "name": "server",
150
- "value": "cloudflare"
151
- },
152
- {
153
- "name": "cf-ray",
154
- "value": "997f0477cd3b55f4-ADL"
155
- },
156
- {
157
- "name": "cf-cache-status",
158
- "value": "DYNAMIC"
159
- },
160
- {
161
- "name": "access-control-allow-origin",
162
- "value": "*"
163
- },
164
- {
165
- "name": "cache-control",
166
- "value": "no-cache"
167
- },
168
- {
169
- "name": "strict-transport-security",
170
- "value": "max-age=63072000; includeSubDomains; preload"
171
- },
172
- {
173
- "name": "vary",
174
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
175
- },
176
- {
177
- "name": "ratelimit",
178
- "value": "limit=3000, remaining=2987, reset=39"
179
- },
180
- {
181
- "name": "ratelimit-policy",
182
- "value": "3000;w=300"
183
- },
184
- {
185
- "name": "x-content-type-options",
186
- "value": "nosniff"
187
- },
188
- {
189
- "name": "x-matched-path",
190
- "value": "/nextjs-api/stream/create-evaluation"
191
- },
192
- {
193
- "name": "x-request-id",
194
- "value": "078056d7-77c1-459c-8089-477724a5f516"
195
- },
196
- {
197
- "name": "x-vercel-cache",
198
- "value": "MISS"
199
- },
200
- {
201
- "name": "x-vercel-id",
202
- "value": "syd1:syd1:sfo1::sfo1::sfo1::p9h25-1762038122234-ac756aafe288"
203
- },
204
- {
205
- "name": "x-vercel-request-id",
206
- "value": "078056d7-77c1-459c-8089-477724a5f516"
207
- },
208
- {
209
- "name": "alt-svc",
210
- "value": "h3=\":443\"; ma=86400"
211
- },
212
- {
213
- "name": "X-Firefox-Spdy",
214
- "value": "h2"
215
- }
216
- ],
217
- "cookies": [],
218
- "content": {
219
- "size": 113,
220
- "text": "a0:\"Hello \"\na0:\"there! \"\na0:\"How \"\na0:\"can \"\na0:\"I \"\na0:\"help \"\na0:\"you \"\na0:\"today?\"\nad:{\"finishReason\":\"stop\"}\n"
221
- },
222
- "redirectURL": "",
223
- "headersSize": 819,
224
- "bodySize": -1
225
- },
226
- "cache": {},
227
- "timings": {
228
- "blocked": 0,
229
- "dns": 0,
230
- "connect": 0,
231
- "ssl": 0,
232
- "send": 0,
233
- "wait": 7554,
234
- "receive": 0
235
- },
236
- "time": 7554,
237
- "pageref": "page_1"
238
- }
239
- ]
240
- }
241
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/followup.har DELETED
@@ -1,245 +0,0 @@
1
- {
2
- "log": {
3
- "version": "1.2",
4
- "creator": {
5
- "name": "Zen",
6
- "version": "1.17.4b"
7
- },
8
- "browser": {
9
- "name": "Zen",
10
- "version": "1.17.4b"
11
- },
12
- "pages": [
13
- {
14
- "id": "page_2",
15
- "pageTimings": {
16
- "onContentLoad": 1658,
17
- "onLoad": 9103
18
- },
19
- "startedDateTime": "2025-11-02T09:34:03.361+10:30",
20
- "title": "https://lmarena.ai/"
21
- }
22
- ],
23
- "entries": [
24
- {
25
- "startedDateTime": "2025-11-02T09:34:03.361+10:30",
26
- "request": {
27
- "bodySize": 3382,
28
- "method": "POST",
29
- "url": "https://lmarena.ai/nextjs-api/stream/post-to-evaluation/019a41a7-b8bc-743a-8d7f-6a7d5d376977",
30
- "httpVersion": "HTTP/2",
31
- "headers": [
32
- {
33
- "name": "Host",
34
- "value": "lmarena.ai"
35
- },
36
- {
37
- "name": "User-Agent",
38
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
39
- },
40
- {
41
- "name": "Accept",
42
- "value": "*/*"
43
- },
44
- {
45
- "name": "Accept-Language",
46
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
47
- },
48
- {
49
- "name": "Accept-Encoding",
50
- "value": "gzip, deflate, br, zstd"
51
- },
52
- {
53
- "name": "Referer",
54
- "value": "https://lmarena.ai/c/019a41a7-b8bc-743a-8d7f-6a7d5d376977"
55
- },
56
- {
57
- "name": "Content-Type",
58
- "value": "text/plain;charset=UTF-8"
59
- },
60
- {
61
- "name": "Content-Length",
62
- "value": "3382"
63
- },
64
- {
65
- "name": "Origin",
66
- "value": "https://lmarena.ai"
67
- },
68
- {
69
- "name": "DNT",
70
- "value": "1"
71
- },
72
- {
73
- "name": "Sec-GPC",
74
- "value": "1"
75
- },
76
- {
77
- "name": "Connection",
78
- "value": "keep-alive"
79
- },
80
- {
81
- "name": "Cookie",
82
- "value": "cf_clearance=phxEyF8Df.g6paBCq8YStzAlVFQNAFRtf5vLi3P.VOc-1762037926-1.2.1.1-XobIO0SFkJRRGtVhOjUPJKmQNcNXVlIMLPojF0EgYBfF5duW9VtMfUPxkvJepJy98ywhoQD5xxT2ANfi9Sm3f8s1WneA7GccjSpo2KxpXrJXK8CNQPZRzBlI47fWoe3EOwzlAI932AKn05EPZxk09ZvlQ_dUyvq7ouRZRbR._N.bnvBzZW750eNMMWKlB0M0P6pUqoZRy577lJHZqBfxt1GleIuYoWyi3joGYTxx0l9YV1y.gSJQlFD95tOE_ypB; sidebar_state=true; __cf_bm=1T4YaefJFfwXEmlNENYerO2DT.f4z8pL4lL7v5J4ytI-1762038032-1.0.1.1-CVCC65abGzjLjIbR5n__SjtE9QYGHysRSJ4RTVqNHLDWy0a12OzpmdM89W.g7waPkkttohUYttda9IQzaFioOHDD6cIi9cK5UMySKgxIaX4; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762038242333%2C%22019a4198-ec0b-76a1-8bf4-212bf66082d1%22%2C1762037132299%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3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UcxZWRDVlB1b0ppRzMtQVVwLXBkWWJBIiwidG9rZW5fdHlwZSI6ImJlYXJlciIsImV4cGlyZXNfaW4iOjM2MDAsImV4cGlyZXNfYXQiOjE3NjIwNDE1MjYsInJlZnJlc2hfdG9rZW4iOiJvbW1lbGVldnlvaWsiLCJ1c2VyIjp7ImlkIjoiZTFkNWJjY2ItZWFhNi00ZGM3LWFjNzctMGU2MGNlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4ODEyWiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wMVQyMjo1ODo0Ni42NDg0NzdaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
83
- },
84
- {
85
- "name": "Sec-Fetch-Dest",
86
- "value": "empty"
87
- },
88
- {
89
- "name": "Sec-Fetch-Mode",
90
- "value": "cors"
91
- },
92
- {
93
- "name": "Sec-Fetch-Site",
94
- "value": "same-origin"
95
- },
96
- {
97
- "name": "Priority",
98
- "value": "u=4"
99
- },
100
- {
101
- "name": "TE",
102
- "value": "trailers"
103
- }
104
- ],
105
- "cookies": [
106
- {
107
- "name": "cf_clearance",
108
- "value": "phxEyF8Df.g6paBCq8YStzAlVFQNAFRtf5vLi3P.VOc-1762037926-1.2.1.1-XobIO0SFkJRRGtVhOjUPJKmQNcNXVlIMLPojF0EgYBfF5duW9VtMfUPxkvJepJy98ywhoQD5xxT2ANfi9Sm3f8s1WneA7GccjSpo2KxpXrJXK8CNQPZRzBlI47fWoe3EOwzlAI932AKn05EPZxk09ZvlQ_dUyvq7ouRZRbR._N.bnvBzZW750eNMMWKlB0M0P6pUqoZRy577lJHZqBfxt1GleIuYoWyi3joGYTxx0l9YV1y.gSJQlFD95tOE_ypB"
109
- },
110
- {
111
- "name": "sidebar_state",
112
- "value": "true"
113
- },
114
- {
115
- "name": "__cf_bm",
116
- "value": "1T4YaefJFfwXEmlNENYerO2DT.f4z8pL4lL7v5J4ytI-1762038032-1.0.1.1-CVCC65abGzjLjIbR5n__SjtE9QYGHysRSJ4RTVqNHLDWy0a12OzpmdM89W.g7waPkkttohUYttda9IQzaFioOHDD6cIi9cK5UMySKgxIaX4"
117
- },
118
- {
119
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
120
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762038242333,\"019a4198-ec0b-76a1-8bf4-212bf66082d1\",1762037132299],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
121
- },
122
- {
123
- "name": "arena-auth-prod-v1",
124
- "value": "base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpvZEhSd2N6b3ZMMmgxYjJkNmIyVnhlbU55WkhacmQzUjJiMlJwTG5OMWNHRmlZWE5sTG1OdkwyRjFkR2d2ZGpFaUxDSnpkV0lpT2lKbE1XUTFZbU5qWWkxb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TEtMDFUMjI6NTg6NDYuNjQ3MTI4ODEyWiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wMVQyMjo1ODo0Ni42NDg0NzdaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
125
- }
126
- ],
127
- "queryString": [],
128
- "headersSize": 3315,
129
- "postData": {
130
- "mimeType": "text/plain;charset=UTF-8",
131
- "params": [],
132
- "text": "{\"id\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"mode\":\"direct\",\"modelAId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"userMessageId\":\"019a41a9-dc1e-7727-9edd-f29a5e80fbc0\",\"modelAMessageId\":\"019a41a9-dc1e-7261-9e49-9fc3519a8464\",\"messages\":[{\"id\":\"019a41a8-0150-7cc2-8272-c99ac912d7a1\",\"role\":\"user\",\"content\":\"hello\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a41a8-0150-7cb3-a250-591acaaf6a5e\",\"role\":\"assistant\",\"content\":\"Hello there! How can I help you today?\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a41a8-0150-7cc2-8272-c99ac912d7a1\"],\"participantPosition\":\"a\",\"modelId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"evaluationSessionId\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"status\":\"success\",\"failureReason\":null},{\"id\":\"019a41a9-dc1e-7727-9edd-f29a5e80fbc0\",\"role\":\"user\",\"content\":\"message 2\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a41a8-0150-7cb3-a250-591acaaf6a5e\"],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a41a9-dc1e-7261-9e49-9fc3519a8464\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a41a9-dc1e-7727-9edd-f29a5e80fbc0\"],\"participantPosition\":\"a\",\"modelId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"evaluationSessionId\":\"019a41a7-b8bc-743a-8d7f-6a7d5d376977\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"chat\",\"recaptchaV3Token\":\"0cAFcWeA526lu0WYRPLPB6uNgZKzJW1ceND9-UwvZ3yIsnai2OckcrXl9A764o3aXso59GCDEu1A0HVq-LBy3Xrz_fGXjtuva_IHDQrRu8I6Nb3CniiJaZW1xXqw0X3exHEdARpITfYaPvyA-4SsL-zPQanCIOg5gx3-T9gfiTqswq-JvPZ035vmMVgaiY19LvW7Ctz8lrH-0ISfH94b9DBuk8ggln_HHzIJ_BOgUTgGPg0zmB8enzfjMma2E3Iy3dZ59tAyaohuENGH7qa99bsvUQycuSthCBjED1ejCaVzUpBrjm4wMDu6CqsUvhj13W0v2yb0i_SWIghjJVJ7E4wWbIxpHScslLOBhSIeU_3qcZHgfxJSfQ0nk0dBSf90_BAZs0Dlju9WybefBbrK35rsqhIkg1mjnbTCWldCicNnPk5o61DKRfURBYlnyVc3XxSSk5D7IjTTYRXh0dvW4wDkesbYqXDvkk9ILW3DVD8T_wqiy4pz5tmFQMdh4x5Ji9ml1IOtGlZK-TuVNnbSs0d9m_A_WMOr4P3L67WXUSLgRIk9RJYqO9-fgstF2cEzG2bg2inwwSiHbpmrNX3tmyC58AKPdxMkIT0eNvl-o1emZSvz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gO1g0OuddGZrbuyGD4xP55oXCCjHhFT6wPr0w\"}"
133
- }
134
- },
135
- "response": {
136
- "status": 200,
137
- "statusText": "",
138
- "httpVersion": "HTTP/2",
139
- "headers": [
140
- {
141
- "name": "date",
142
- "value": "Sat, 01 Nov 2025 23:04:29 GMT"
143
- },
144
- {
145
- "name": "content-type",
146
- "value": "text/event-stream"
147
- },
148
- {
149
- "name": "server",
150
- "value": "cloudflare"
151
- },
152
- {
153
- "name": "cf-ray",
154
- "value": "997f076ef92055f4-ADL"
155
- },
156
- {
157
- "name": "cf-cache-status",
158
- "value": "DYNAMIC"
159
- },
160
- {
161
- "name": "access-control-allow-origin",
162
- "value": "*"
163
- },
164
- {
165
- "name": "cache-control",
166
- "value": "no-cache"
167
- },
168
- {
169
- "name": "strict-transport-security",
170
- "value": "max-age=63072000; includeSubDomains; preload"
171
- },
172
- {
173
- "name": "vary",
174
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
175
- },
176
- {
177
- "name": "ratelimit",
178
- "value": "limit=3000, remaining=2998, reset=57"
179
- },
180
- {
181
- "name": "ratelimit-policy",
182
- "value": "3000;w=300"
183
- },
184
- {
185
- "name": "x-content-type-options",
186
- "value": "nosniff"
187
- },
188
- {
189
- "name": "x-matched-path",
190
- "value": "/nextjs-api/stream/post-to-evaluation/[id]"
191
- },
192
- {
193
- "name": "x-request-id",
194
- "value": "506866ff-0aa4-4e4a-859d-e9c63bedb95a"
195
- },
196
- {
197
- "name": "x-vercel-cache",
198
- "value": "MISS"
199
- },
200
- {
201
- "name": "x-vercel-id",
202
- "value": "syd1:syd1:sfo1::sfo1::sfo1::2n6hx-1762038243705-6f36d7632643"
203
- },
204
- {
205
- "name": "x-vercel-request-id",
206
- "value": "506866ff-0aa4-4e4a-859d-e9c63bedb95a"
207
- },
208
- {
209
- "name": "alt-svc",
210
- "value": "h3=\":443\"; ma=86400"
211
- },
212
- {
213
- "name": "X-Firefox-Spdy",
214
- "value": "h2"
215
- }
216
- ],
217
- "cookies": [],
218
- "content": {
219
- "mimeType": "text/event-stream",
220
- "size": 340,
221
- "text": "a0:\"Message \"\na0:\"2 \"\na0:\"received!\\n\\n\"\na0:\"What \"\na0:\"can \"\na0:\"I \"\na0:\"help \"\na0:\"you \"\na0:\"with \"\na0:\"for \"\na0:\"this \"\na0:\"message? \"\na0:\"Are \"\na0:\"we \"\na0:\"continuing \"\na0:\"a \"\na0:\"conversation, \"\na0:\"or \"\na0:\"is \"\na0:\"there \"\na0:\"something \"\na0:\"specific \"\na0:\"you'd \"\na0:\"like \"\na0:\"me \"\na0:\"to \"\na0:\"do?\"\nad:{\"finishReason\":\"stop\"}\n"
222
- },
223
- "redirectURL": "",
224
- "headersSize": 825,
225
- "bodySize": 1165
226
- },
227
- "cache": {},
228
- "timings": {
229
- "blocked": 0,
230
- "dns": 0,
231
- "connect": 0,
232
- "ssl": 0,
233
- "send": 2,
234
- "wait": 26073,
235
- "receive": 0
236
- },
237
- "time": 26075,
238
- "_securityState": "secure",
239
- "serverIPAddress": "104.18.20.173",
240
- "connection": "443",
241
- "pageref": "page_2"
242
- }
243
- ]
244
- }
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/image_upload.har DELETED
The diff for this file is too large to render. See raw diff
 
samples/imagesample.har DELETED
@@ -1,245 +0,0 @@
1
- {
2
- "log": {
3
- "version": "1.2",
4
- "creator": {
5
- "name": "Zen",
6
- "version": "1.17.5b"
7
- },
8
- "browser": {
9
- "name": "Zen",
10
- "version": "1.17.5b"
11
- },
12
- "pages": [
13
- {
14
- "id": "page_2",
15
- "pageTimings": {
16
- "onContentLoad": -1,
17
- "onLoad": -1
18
- },
19
- "startedDateTime": "2025-11-06T16:01:21.651+10:30",
20
- "title": "https://lmarena.ai/?chat-modality=image"
21
- }
22
- ],
23
- "entries": [
24
- {
25
- "startedDateTime": "2025-11-06T16:01:21.651+10:30",
26
- "request": {
27
- "bodySize": 2702,
28
- "method": "POST",
29
- "url": "https://lmarena.ai/nextjs-api/stream/create-evaluation",
30
- "httpVersion": "HTTP/2",
31
- "headers": [
32
- {
33
- "name": "Host",
34
- "value": "lmarena.ai"
35
- },
36
- {
37
- "name": "User-Agent",
38
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
39
- },
40
- {
41
- "name": "Accept",
42
- "value": "*/*"
43
- },
44
- {
45
- "name": "Accept-Language",
46
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
47
- },
48
- {
49
- "name": "Accept-Encoding",
50
- "value": "gzip, deflate, br, zstd"
51
- },
52
- {
53
- "name": "Referer",
54
- "value": "https://lmarena.ai/c/019a57a5-c965-7b43-9c17-01522b440130?chat-modality=image"
55
- },
56
- {
57
- "name": "Content-Type",
58
- "value": "text/plain;charset=UTF-8"
59
- },
60
- {
61
- "name": "Content-Length",
62
- "value": "2702"
63
- },
64
- {
65
- "name": "Origin",
66
- "value": "https://lmarena.ai"
67
- },
68
- {
69
- "name": "DNT",
70
- "value": "1"
71
- },
72
- {
73
- "name": "Sec-GPC",
74
- "value": "1"
75
- },
76
- {
77
- "name": "Connection",
78
- "value": "keep-alive"
79
- },
80
- {
81
- "name": "Cookie",
82
- "value": "cf_clearance=MAKsLq4LymfkuaAaHnVZ7IMqz9.MrojRM7r6QUT9KWs-1762406738-1.2.1.1-o_Ya.WUr_icZrX46R2z6TSRdoZ6btfppf4ufGzDY4dwAeXsthVvjgotiYsyneCwoh3QnyV3_c_acyncrzp.aE0PgDQMgTJrb000by6ox9EqzzdHKlsKM0TsKxQHB3S1F0hSEEcs9tQ7ZSBwMjrtmLUAjXwRuuLshONTecgG9OXMVut6H3MGlnbdKxpJkY_dp4b6pO7bmAik2LHoJU_Q4ECPVBdei.Qfk0odyQM4A.l4; arena-auth-prod-v1=base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpvZEhSd2N6b3ZMMmgxYjJkNmIyVnhlbU55WkhacmQzUjJiMlJwTG5OMWNHRmlZWE5sTG1OdkwyRjFkR2d2ZGpFaUxDSnpkV0lpT2lKbE1XUTFZbU5qWWkxbFlXRTJMVFJrWXpjdFlXTTNOeTB3WlRZd1kyVmlOelpsTVRnaUxDSmhkV1FpT2lKaGRYUm9aVzUwYVdOaGRHVmtJaXdpWlhod0lqb3hOell5TkRFd016STRMQ0pwWVhRaU9qRTNOakkwTURZM01qZ3NJbVZ0WVdsc0lqb2lJaXdpY0dodmJtVWlPaUlpTENKaGNIQmZiV1YwWVdSaGRHRWlPbnQ5TENKMWMyVnlYMjFsZEdGa1lYUmhJanA3SW1sa0lqb2lPV0pqT0RSak1ERXROMkUyTUMwME9UWmlMVGt4TXpBdE1qSTNZV0ZpT0RFeU1USTVJbjBzSW5KdmJHVWlPaUpoZFhSb1pXNTBhV05oZ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7B%22distinct_id%22%3A%22019a42cc-921e-74d4-b305-fbf75305f6a4%22%2C%22%24sesid%22%3A%5B1762057303275%2C%22019a42cc-921d-79b7-a7ec-b9e464e2f6ff%22%2C1762057294365%5D%7D; __cf_bm=w55k.90IfNtEJzq9ZHEP2FHhtqvG_hI26s8cg4SXqcE-1762406728-1.0.1.1-SEY49DDMxP06C57srYOWv0XX9DtpTmi7PG4W7Y9IASDaWe0hWJUwvebhyQggkcgMQJVKKI_6KTpdeUyrGwdlYmdGm1FLjkGMXi039ocJU40; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762407080963%2C%22019a57a0-9a71-7283-8137-91d3763d5bb4%22%2C1762406734449%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A%22%2C%22u%22%3A%22https%3A%2F%2Flmarena.ai%2F%22%7D%7D; sidebar_state=true"
83
- },
84
- {
85
- "name": "Sec-Fetch-Dest",
86
- "value": "empty"
87
- },
88
- {
89
- "name": "Sec-Fetch-Mode",
90
- "value": "cors"
91
- },
92
- {
93
- "name": "Sec-Fetch-Site",
94
- "value": "same-origin"
95
- },
96
- {
97
- "name": "Priority",
98
- "value": "u=4"
99
- }
100
- ],
101
- "cookies": [
102
- {
103
- "name": "cf_clearance",
104
- "value": "MAKsLq4LymfkuaAaHnVZ7IMqz9.MrojRM7r6QUT9KWs-1762406738-1.2.1.1-o_Ya.WUr_icZrX46R2z6TSRdoZ6btfppf4ufGzDY4dwAeXsthVvjgotiYsyneCwoh3QnyV3_c_acyncrzp.aE0PgDQMgTJrb000by6ox9Eqz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XVlVzF2ZFhNaU9uUnlkV1Y5LmVEV1VSN2xPZ2RKLWpxMUd6d21KcGdfSWNaNGoyU0pZekx6aFdXeV9hd2NEUzNuRFRLWXVSWkhkbGcxX2ZXR042RWRBQUN6VjRjRWFranhoS1RuYVN3IiwidG9rZW5fdHlwZSI6ImJlYXJlciIsImV4cGlyZXNfaW4iOjM2MDAsImV4cGlyZXNfYXQiOjE3NjI0MTAzMjgsInJlZnJlc2hfdG9rZW4iOiJkZWd3cmV4eHlxNTYiLCJ1c2VyIjp7ImlkIjoiZTFkNWJjY2ItZWFhNi00ZGM3LWFjNzctMGU2MGNlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNjo0OToyMi44ODg0NDJaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
109
- },
110
- {
111
- "name": "ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog",
112
- "value": "{\"distinct_id\":\"019a42cc-921e-74d4-b305-fbf75305f6a4\",\"$sesid\":[1762057303275,\"019a42cc-921d-79b7-a7ec-b9e464e2f6ff\",1762057294365]}"
113
- },
114
- {
115
- "name": "__cf_bm",
116
- "value": "w55k.90IfNtEJzq9ZHEP2FHhtqvG_hI26s8cg4SXqcE-1762406728-1.0.1.1-SEY49DDMxP06C57srYOWv0XX9DtpTmi7PG4W7Y9IASDaWe0hWJUwvebhyQggkcgMQJVKKI_6KTpdeUyrGwdlYmdGm1FLjkGMXi039ocJU40"
117
- },
118
- {
119
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
120
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762407080963,\"019a57a0-9a71-7283-8137-91d3763d5bb4\",1762406734449],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
121
- },
122
- {
123
- "name": "sidebar_state",
124
- "value": "true"
125
- }
126
- ],
127
- "queryString": [],
128
- "headersSize": 3501,
129
- "postData": {
130
- "mimeType": "text/plain;charset=UTF-8",
131
- "params": [],
132
- "text": "{\"id\":\"019a57a5-c965-7b43-9c17-01522b440130\",\"mode\":\"direct\",\"modelAId\":\"0199ef2a-583f-7088-b704-b75fd169401d\",\"userMessageId\":\"019a57a5-e37b-7bd9-bfe3-5b95a43b45fb\",\"modelAMessageId\":\"019a57a5-e37c-705a-a534-5f698e952e9d\",\"messages\":[{\"id\":\"019a57a5-e37b-7bd9-bfe3-5b95a43b45fb\",\"role\":\"user\",\"content\":\"a cat\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a57a5-c965-7b43-9c17-01522b440130\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a57a5-e37c-705a-a534-5f698e952e9d\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a57a5-e37b-7bd9-bfe3-5b95a43b45fb\"],\"participantPosition\":\"a\",\"modelId\":\"0199ef2a-583f-7088-b704-b75fd169401d\",\"evaluationSessionId\":\"019a57a5-c965-7b43-9c17-01522b440130\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"image\",\"recaptchaV3Token\":\"0cAFcWeA7vClOXnY6d8SP1h-4mk1HgXXcz7--b6ljY616vo3fiuvWRhwMI9nTSaS-eDsZMG13zuW4vxYLPMRysdFeQwjynbZx-Kv9u6Fs5ug4yuVDfWymZKJvcZb4RNTPz_uqKQremKwVst93Kbsr2eS6oYumqmtdjTiIocMQtSHNxdeKQHr1gnQs9aqPiEO6iVzLKRfyuNhwKOj64z6bVrFxQ9qEu8182eQzWdLldJBVuBe_4TqiKPhYjU1GO21ehkTHpbpeD8OZupss8NiIvzINRmDYvJAn8vk6-GLierUSiHc7-1UBL8__-gvfHaG-3oR9GLdShBVbkCR97aGlXzkhDgbU4UJDGLZ_i5IkxGlZXGxQTlL4_J3aA1sX4P6PhXf4hhEFbNrSwK9xofDfVfZPDNnmFCmrdFDQkwMVtbswEq9gKQ0fVTlqOoBapzurxgVzCCScetYYcDDOojiC6A5Ka0YSAgXCPHsf-7UBkzWTzYPPteMYHZzvtgNcrcvxjV0wTJtX_YAl80rV0clEApQz8-56L0acGKlygN3GNSsavp_fcQSgJF4QlIggH8vNW4xaIsXKUMooBgeKH4jM59RkG0YOKrVjuZcZ0CDdZwTlT2c7apomsGjkRi93AvgeqrZzjWcJah05EuU9I2p5YqDwe2RbsNYKCsBBsDMnxyZWPiP3KmW-b-zAlW1K5MSonp_8QtTPDTesqAY2F1L5RsgaGcNDFpyjeJdOff9E0epg31wrOqqnwUnZ9juUyTKkAYKXDnf2KT1GEti9GpjnlOF50qeKsJAh6V9RHbCf00Wao0A1cFDdCoz4abvldST19nudVvo0XlX2el8cPGWSYH0_ZtYOBsKbtafpPs8wI8M8i4LD1l3Oa1dZqBnmIaKQJU1tGCqpR8CQLz5RXyPsWavLdklUPGtLulZgSesvM0sAiTTDhD7A8dWZBqQ0lzpz_KADsbOfLtOPk4kGetwUSsUkyhl9puJGBEFhUtTaZ8H3t1xXotOADBJq_xo4JA5RvzWEv7NiMK0gu9mZpWvUsRjTzcutKkOy6vM2uqlrvdqWTSS0ZezvYS7QnP-nDgpfdPhD8ekwzqYi2V79d7kkRcatPXgRWrd59QErq3YxQ_lGv_juXNxQHKoMCkxEu7DXPGgSMuEttGYuI8JheA_a1MLako2ptNmpOXLtsZ3hhIwphMZNOdM5ZwatPaeuiC_JkFd_BCSsZfgXXKg1SYqZzo82AOTZvLgImwqXJHJtkRZdpm7PAozKefzc9gxoAnCP3CErbgH1QtszlT12cHrGBLYkd0Zaoz22mQnghY4FxrNC5I0_aljLZraQrzmZogpAy04ee_FfYKbZic95C48XpNMw0KBgY91xHPU1GdAStFdXPZqOSdJisl__KYrFzLSR0-mJcmv_IRdCfKtnmX_8xlD-Kt1ND8byUFHy4-xxV25S6bFuWJjTXCmt1FK1tEIpGHMUIN5YL61NWv6sGapi8F-Hh9Y7goludYa_2sj9V0BX7sZBo8r5OreS9F1zGfn5sD3nymzzoobhxRdrHhSxo8tTazGgpf3dCr5g3SIBp9rPXNv865BQrLesjtu-CZvQ6oQ0sWLaSuphbeVK2br_A4Q_ykk4Z8ITGE03zo5xp0UUkZCblbhRz-ASQJmVu9ChssF5ArfOvNheI8fDpLUhf4QepQHM0vMVSUVL27BCLCxu9OGqOANrBTOJ4Ucn6fJPt-aV8Lq_MpmEE\",\"featureFlags\":{\"editImageButtonEnabled\":\"control\"}}"
133
- }
134
- },
135
- "response": {
136
- "status": 200,
137
- "statusText": "",
138
- "httpVersion": "HTTP/2",
139
- "headers": [
140
- {
141
- "name": "date",
142
- "value": "Thu, 06 Nov 2025 05:31:31 GMT"
143
- },
144
- {
145
- "name": "content-type",
146
- "value": "text/event-stream"
147
- },
148
- {
149
- "name": "server",
150
- "value": "cloudflare"
151
- },
152
- {
153
- "name": "cf-ray",
154
- "value": "99a23450f93f55f1-ADL"
155
- },
156
- {
157
- "name": "cf-cache-status",
158
- "value": "DYNAMIC"
159
- },
160
- {
161
- "name": "access-control-allow-origin",
162
- "value": "*"
163
- },
164
- {
165
- "name": "cache-control",
166
- "value": "no-cache"
167
- },
168
- {
169
- "name": "strict-transport-security",
170
- "value": "max-age=63072000; includeSubDomains; preload"
171
- },
172
- {
173
- "name": "vary",
174
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
175
- },
176
- {
177
- "name": "ratelimit",
178
- "value": "limit=3, remaining=1, reset=3521"
179
- },
180
- {
181
- "name": "ratelimit-policy",
182
- "value": "3;w=3600"
183
- },
184
- {
185
- "name": "x-content-type-options",
186
- "value": "nosniff"
187
- },
188
- {
189
- "name": "x-matched-path",
190
- "value": "/nextjs-api/stream/create-evaluation"
191
- },
192
- {
193
- "name": "x-request-id",
194
- "value": "ce076b6b-0285-482d-84f8-0468cc045b4a"
195
- },
196
- {
197
- "name": "x-vercel-cache",
198
- "value": "MISS"
199
- },
200
- {
201
- "name": "x-vercel-id",
202
- "value": "syd1:syd1:sfo1::sfo1::sfo1::qd8mh-1762407083708-acd929f005bf"
203
- },
204
- {
205
- "name": "x-vercel-request-id",
206
- "value": "ce076b6b-0285-482d-84f8-0468cc045b4a"
207
- },
208
- {
209
- "name": "alt-svc",
210
- "value": "h3=\":443\"; ma=86400"
211
- },
212
- {
213
- "name": "X-Firefox-Spdy",
214
- "value": "h2"
215
- }
216
- ],
217
- "cookies": [],
218
- "content": {
219
- "mimeType": "text/event-stream",
220
- "size": 609,
221
- "text": "a2:[{\"type\":\"image\",\"image\":\"https://messages-prod.27c852f3500f38c1e7786e2c9ff9e48f.r2.cloudflarestorage.com/9bc84c01-7a60-496b-9130-227aab812129/1762407090601-019a57a5-e37c-705a-a534-5f698e952e9d.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=c774f9d56a46165f86a9757e83c2bbc3%2F20251106%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20251106T053131Z&X-Amz-Expires=3600&X-Amz-Signature=b69ecf9a16060655ad54c4e2cddedb85bbfaed3f26c2e08a553f1604c0dea322&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject\",\"mimeType\":\"image/png\"}]\nad:{\"finishReason\":\"stop\"}\n"
222
- },
223
- "redirectURL": "",
224
- "headersSize": 813,
225
- "bodySize": 1422
226
- },
227
- "cache": {},
228
- "timings": {
229
- "blocked": 1,
230
- "dns": 0,
231
- "connect": 0,
232
- "ssl": 0,
233
- "send": 0,
234
- "wait": 8322,
235
- "receive": 0
236
- },
237
- "time": 8323,
238
- "_securityState": "secure",
239
- "serverIPAddress": "104.18.20.173",
240
- "connection": "443",
241
- "pageref": "page_2"
242
- }
243
- ]
244
- }
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/lmarena.ai_nextjs-api_stream_create-evaluation_Archive [25-11-04 17-09-31].har DELETED
@@ -1,249 +0,0 @@
1
- {
2
- "log": {
3
- "version": "1.2",
4
- "creator": {
5
- "name": "Zen",
6
- "version": "1.17.4b"
7
- },
8
- "browser": {
9
- "name": "Zen",
10
- "version": "1.17.4b"
11
- },
12
- "pages": [
13
- {
14
- "id": "page_1",
15
- "pageTimings": {
16
- "onContentLoad": -3342,
17
- "onLoad": -1664
18
- },
19
- "startedDateTime": "2025-11-04T17:09:22.469+10:30",
20
- "title": "https://lmarena.ai/"
21
- }
22
- ],
23
- "entries": [
24
- {
25
- "startedDateTime": "2025-11-04T17:09:22.469+10:30",
26
- "request": {
27
- "bodySize": 2947,
28
- "method": "POST",
29
- "url": "https://lmarena.ai/nextjs-api/stream/create-evaluation",
30
- "httpVersion": "HTTP/2",
31
- "headers": [
32
- {
33
- "name": "Host",
34
- "value": "lmarena.ai"
35
- },
36
- {
37
- "name": "User-Agent",
38
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
39
- },
40
- {
41
- "name": "Accept",
42
- "value": "*/*"
43
- },
44
- {
45
- "name": "Accept-Language",
46
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
47
- },
48
- {
49
- "name": "Accept-Encoding",
50
- "value": "gzip, deflate, br, zstd"
51
- },
52
- {
53
- "name": "Referer",
54
- "value": "https://lmarena.ai/c/019a4d97-52ec-7ca8-9283-f3bfe5b3c32e"
55
- },
56
- {
57
- "name": "Content-Type",
58
- "value": "text/plain;charset=UTF-8"
59
- },
60
- {
61
- "name": "Content-Length",
62
- "value": "2947"
63
- },
64
- {
65
- "name": "Origin",
66
- "value": "https://lmarena.ai"
67
- },
68
- {
69
- "name": "DNT",
70
- "value": "1"
71
- },
72
- {
73
- "name": "Sec-GPC",
74
- "value": "1"
75
- },
76
- {
77
- "name": "Connection",
78
- "value": "keep-alive"
79
- },
80
- {
81
- "name": "Cookie",
82
- "value": "cf_clearance=ygsCkRZzOzSz7.XGYEh6.NAXRGPLKeSV9fbpSpha0Bo-1762053145-1.2.1.1-p9mifGqUVs6HLTVSbuqBYc9aP.JG0yvXsPVeFPWNbo9cn6gekVI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P0itE0C1Kgrdy3VhDPn7L4tob.p7td1HMWqi4gHuPUiz2EZk2gvpU2J_WdgndOLvKAYjn6c9b9M79ocF9.6_Jl4q6YSQfdxX34Iugkc; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762238361239%2C%22019a4d80-994d-7399-aeeb-a65f63eee2d2%22%2C1762236864845%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A%22%2C%22u%22%3A%22https%3A%2F%2Flmarena.ai%2F%22%7D%7D"
83
- },
84
- {
85
- "name": "Sec-Fetch-Dest",
86
- "value": "empty"
87
- },
88
- {
89
- "name": "Sec-Fetch-Mode",
90
- "value": "cors"
91
- },
92
- {
93
- "name": "Sec-Fetch-Site",
94
- "value": "same-origin"
95
- },
96
- {
97
- "name": "Priority",
98
- "value": "u=4"
99
- },
100
- {
101
- "name": "TE",
102
- "value": "trailers"
103
- }
104
- ],
105
- "cookies": [
106
- {
107
- "name": "cf_clearance",
108
- "value": "ygsCkRZzOzSz7.XGYEh6.NAXRGPLKeSV9fbpSpha0Bo-1762053145-1.2.1.1-p9mifGqUVs6HLTVSbuqBYc9aP.JG0yvXsPVeFPWNbo9cn6gekVI3NSKe6JUzvGWMj4RSTlSh3U5j5A__QAeuvzI4SZp3PUaZMqumPHO3uSvW.lnIurNIPoN0CJ8oplmxc2hmmkY81SbCumlUBdZtHltmtiy0cP_VWEy5oOMInek6wqCI0RBlTQTVAAHwe9cpwkAxYPAiA.mYhiWTJfhFrdZ93J7CCy0Wb2mCwkMwSYs"
109
- },
110
- {
111
- "name": "sidebar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TXl4RXV6SDNPdEhCYWRaUGZLMTJkVzVnIiwidG9rZW5fdHlwZSI6ImJlYXJlciIsImV4cGlyZXNfaW4iOjM2MDAsImV4cGlyZXNfYXQiOjE3NjIyNDA0NjMsInJlZnJlc2hfdG9rZW4iOiJpMzR4em1pdjYyNmIiLCJ1c2VyIjp7ImlkIjoiZTFkNWJjY2ItZWFhNi00ZGM3LWFjNzctMGU2MGNlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNFQwNjoxNDoyMy4zMjI2NzJaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
117
- },
118
- {
119
- "name": "ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog",
120
- "value": "{\"distinct_id\":\"019a42cc-921e-74d4-b305-fbf75305f6a4\",\"$sesid\":[1762057303275,\"019a42cc-921d-79b7-a7ec-b9e464e2f6ff\",1762057294365]}"
121
- },
122
- {
123
- "name": "__cf_bm",
124
- "value": "2DUDm1kGh_NUaqWVrS6QWlgE74TfIRcwOU.rHzorNP0-1762237842-1.0.1.1-oTDFP0itE0C1Kgrdy3VhDPn7L4tob.p7td1HMWqi4gHuPUiz2EZk2gvpU2J_WdgndOLvKAYjn6c9b9M79ocF9.6_Jl4q6YSQfdxX34Iugkc"
125
- },
126
- {
127
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
128
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762238361239,\"019a4d80-994d-7399-aeeb-a65f63eee2d2\",1762236864845],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
129
- }
130
- ],
131
- "queryString": [],
132
- "headersSize": 3481,
133
- "postData": {
134
- "mimeType": "text/plain;charset=UTF-8",
135
- "params": [],
136
- "text": "{\"id\":\"019a4d97-52ec-7ca8-9283-f3bfe5b3c32e\",\"mode\":\"battle\",\"userMessageId\":\"019a4d97-6e1c-757c-bfaf-c3d08ae29ad5\",\"modelAMessageId\":\"019a4d97-6e1c-7cda-8538-419ed8313e07\",\"modelBMessageId\":\"019a4d97-6e1c-7ae9-9293-21bcec2b4f69\",\"messages\":[{\"id\":\"019a4d97-6e1c-757c-bfaf-c3d08ae29ad5\",\"role\":\"user\",\"content\":\"say hello and nothing else\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a4d97-52ec-7ca8-9283-f3bfe5b3c32e\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a4d97-6e1c-7cda-8538-419ed8313e07\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a4d97-6e1c-757c-bfaf-c3d08ae29ad5\"],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a4d97-52ec-7ca8-9283-f3bfe5b3c32e\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a4d97-6e1c-7ae9-9293-21bcec2b4f69\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a4d97-6e1c-757c-bfaf-c3d08ae29ad5\"],\"participantPosition\":\"b\",\"modelId\":null,\"evaluationSessionId\":\"019a4d97-52ec-7ca8-9283-f3bfe5b3c32e\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"chat\",\"recaptchaV3Token\":\"0cAFcWeA4I1vFj-wO4KxQXBPqsQiGUzZYRV3KlJkpHZGzw8HlCBenmkVj1IQCTEOSxB5ahnq8W65eTKeZnJLr9IGUP4Ibq4k5QhVG1Em4J7k1ueemXbj2WJgkgyeASk75NNq0G4SHPNH0RAjU3vuUD_ffwUaU7NfOATpL-9wZn5Ei4ZV6xH87znlUdAa3GD2t3viECCy6g4niBH4hMkW-7XBwGMI2fJH33XpIulIJyr9MylIFyMajif9A2s1M0u_EZa0jlBwEzTO29Jjf32F6u2E8HL_M9ItpQOYP3su--4sCGRKmNH7HA21jIIhN2nd9fRBH47x4AryzC2Any1vbWzIE3mOKGxkMeVSdVOVvKAF3QYJJnKx4TEne-aBFb3T2I9-t_cJAq2GBSu7N9nkTgP-Nw841Mk1ysUdA03mtDF9eIXee8azf6y0NZ7S7C2E7aECvfv7QY2dpVvDgcp0TUiwHmTMsjZR5IkSfjK6NfI6HWDVwdTLNQDjlRBRTl8wxqcFAl0ajHhyUAXG49VJSI3JqABsOSJNURrsCk6WS29X-gDHe7TI9ecI_FAZ3_DtQRmDUzFKkz_WjNBnTIHaHbO15LVzZsaVVkR1HXeusVm68DTFYe9YaOc7879jucFYXR2m271vtiVosYHIK46O_05FjcGa0Dn56ySOnwV6DwMC8Dx92hrZSuxU-x3_742Dc_qjynMegjbqhaNpjQ46nKJ7H4tJsXfRL9lzphJf7S4579j1NkW6B-_wT0AcK3AjEMBuNEC0DxVcCDSXSwtX-Xpon3hhkcF8Eck-QOMTkyJqBu-uyRs8YD5NWBiQyLWRMVw27YFfA5UofVBsM1nEtZPLWkrMtkioX1gdEEw-d5mmqsO_PpChxcd1vWTJXh65YemIGGW5vbytXsiG7J1f58jTXp1AU0v_Mg_w445mGeTrj2Jqq3Q39ghW83YTTfb86F8aGMgUeWWZWQIQzd0qiR-14NxIVGjCbE8ObCYdsW9Szj8NOJxzkK6f5SO_6Geyz2zs1pDkQhpltLNeybGazX54v_zNPtOMdo-xVt6HfTfLSIyDE96cTKxqsv4bP0ICgs8BtErgIn28tsJOqKRA5-eSnCuXj96hESA1wev7_tgYb-hQByjQP4r7p93ni250JixKCNs3SwS3mqNNBEK9bKub0xxTXC8y6d1xF7R_Z2gTGxnXHm3zfkvDy4THJrOzYhVXHk83ErdrgBThd_L0VF65NLpPnTLtMU-V2JENn1eKmig-uUK8q1TYhAd8lVV27URhFbi1gy_ScfISDbGhx9Ixe2NH6zMGR7qQJyxxVSaBWno2YWeI9WAU_SlRxRPtiumIXP2VjIYnzJZa8fiHjXluHxrna3q-psJmOYb8nT8XXW6fYugFoutny6SkxWzeRoeCYCVcSk9eEV9hCfmC1tX5sxzMa2jXBzQUQJ0aF7mPKQsEsgWWfveVQbKRkNwayP-rlmwTt4JZKqVmJyCeOl8k88MqSJTygkVn9_8ujjrENFz26JTooDcoHufiN-_OfDvfVb0yCD6EZ44fwkVskWpN7bTrZ2RPzfN_3ORXIcp26tGaEeKoA_EqVtiQ7-fmmYiY03CWdC2qBUjFSH6ncGBs650nnCRbVdgMjyVe6xWgvyYkWpPTj9CQGWdsr0qQtq9ygxOanYZMWqV7BNEMRM-ewm9DSlq31HSnXST02qWOBdqe97wfNW418\"}"
137
- }
138
- },
139
- "response": {
140
- "status": 200,
141
- "statusText": "",
142
- "httpVersion": "HTTP/2",
143
- "headers": [
144
- {
145
- "name": "date",
146
- "value": "Tue, 04 Nov 2025 06:39:25 GMT"
147
- },
148
- {
149
- "name": "content-type",
150
- "value": "text/event-stream"
151
- },
152
- {
153
- "name": "server",
154
- "value": "cloudflare"
155
- },
156
- {
157
- "name": "cf-ray",
158
- "value": "99921d26fec5ec7b-ADL"
159
- },
160
- {
161
- "name": "cf-cache-status",
162
- "value": "DYNAMIC"
163
- },
164
- {
165
- "name": "access-control-allow-origin",
166
- "value": "*"
167
- },
168
- {
169
- "name": "cache-control",
170
- "value": "no-cache"
171
- },
172
- {
173
- "name": "strict-transport-security",
174
- "value": "max-age=63072000; includeSubDomains; preload"
175
- },
176
- {
177
- "name": "vary",
178
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
179
- },
180
- {
181
- "name": "ratelimit",
182
- "value": "limit=3000, remaining=2972, reset=9"
183
- },
184
- {
185
- "name": "ratelimit-policy",
186
- "value": "3000;w=300"
187
- },
188
- {
189
- "name": "x-content-type-options",
190
- "value": "nosniff"
191
- },
192
- {
193
- "name": "x-matched-path",
194
- "value": "/nextjs-api/stream/create-evaluation"
195
- },
196
- {
197
- "name": "x-request-id",
198
- "value": "fed35d36-4040-4849-9780-74a6875bf197"
199
- },
200
- {
201
- "name": "x-vercel-cache",
202
- "value": "MISS"
203
- },
204
- {
205
- "name": "x-vercel-id",
206
- "value": "syd1:syd1:sfo1::sfo1::sfo1::p8j6v-1762238362744-49e6e6e748c6"
207
- },
208
- {
209
- "name": "x-vercel-request-id",
210
- "value": "fed35d36-4040-4849-9780-74a6875bf197"
211
- },
212
- {
213
- "name": "alt-svc",
214
- "value": "h3=\":443\"; ma=86400"
215
- },
216
- {
217
- "name": "X-Firefox-Spdy",
218
- "value": "h2"
219
- }
220
- ],
221
- "cookies": [],
222
- "content": {
223
- "mimeType": "text/event-stream",
224
- "size": 79,
225
- "text": "a0:\"hello\"\nb0:\"hello\"\nad:{\"finishReason\":\"unknown\"}\nbd:{\"finishReason\":\"stop\"}\n"
226
- },
227
- "redirectURL": "",
228
- "headersSize": 818,
229
- "bodySize": 897
230
- },
231
- "cache": {},
232
- "timings": {
233
- "blocked": 0,
234
- "dns": 0,
235
- "connect": 0,
236
- "ssl": 0,
237
- "send": 0,
238
- "wait": 2793,
239
- "receive": 0
240
- },
241
- "time": 2793,
242
- "_securityState": "secure",
243
- "serverIPAddress": "104.18.20.173",
244
- "connection": "443",
245
- "pageref": "page_1"
246
- }
247
- ]
248
- }
249
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/models.txt DELETED
@@ -1,2219 +0,0 @@
1
- {
2
- "models": [
3
- {
4
- "id": "983bc566-b783-4d28-b24c-3c8b08eb1086",
5
- "publicName": "gpt-5-high",
6
- "organization": "openai",
7
- "provider": "openai",
8
- "capabilities": {
9
- "inputCapabilities": {
10
- "text": true,
11
- "image": true
12
- },
13
- "outputCapabilities": {
14
- "text": true
15
- }
16
- },
17
- "name": "gpt-5-high"
18
- },
19
- {
20
- "id": "e884e85b-c998-44d8-b38d-db42a300a318",
21
- "publicName": "gemini-2.5-flash-image-preview (nano-banana)",
22
- "organization": "google",
23
- "provider": "google",
24
- "capabilities": {
25
- "inputCapabilities": {
26
- "text": true,
27
- "image": {
28
- "multipleImages": true,
29
- "requiresUpload": false
30
- }
31
- },
32
- "outputCapabilities": {
33
- "image": {
34
- "aspectRatios": [
35
- "1:1"
36
- ]
37
- }
38
- }
39
- },
40
- "name": "gemini-2.5-flash-image-preview-(nano-banana)"
41
- },
42
- {
43
- "id": "4b11c78c-08c8-461c-938e-5fc97d56a40d",
44
- "publicName": "gpt-5-chat",
45
- "organization": "openai",
46
- "provider": "openai",
47
- "capabilities": {
48
- "inputCapabilities": {
49
- "text": true,
50
- "image": true
51
- },
52
- "outputCapabilities": {
53
- "text": true
54
- }
55
- },
56
- "name": "gpt-5-chat"
57
- },
58
- {
59
- "id": "eb90ae46-a73a-4f27-be8b-40f090592c9a",
60
- "publicName": "flux-1-kontext-dev",
61
- "organization": "bfl",
62
- "provider": "bfl",
63
- "capabilities": {
64
- "inputCapabilities": {
65
- "text": true,
66
- "image": {
67
- "multipleImages": false
68
- }
69
- },
70
- "outputCapabilities": {
71
- "image": {
72
- "aspectRatios": [
73
- "1:1"
74
- ]
75
- }
76
- }
77
- },
78
- "name": "flux-1-kontext-dev"
79
- },
80
- {
81
- "id": "2ec9f1a6-126f-4c65-a102-15ac401dcea4",
82
- "publicName": "imagen-4.0-generate-preview-06-06",
83
- "organization": "google",
84
- "provider": "google",
85
- "capabilities": {
86
- "inputCapabilities": {
87
- "text": true
88
- },
89
- "outputCapabilities": {
90
- "image": {
91
- "aspectRatios": [
92
- "1:1"
93
- ]
94
- }
95
- }
96
- },
97
- "name": "imagen-4.0-generate-preview-06-06"
98
- },
99
- {
100
- "id": "ee116d12-64d6-48a8-88e5-b2d06325cdd2",
101
- "publicName": "claude-opus-4-20250514",
102
- "organization": "anthropic",
103
- "provider": "anthropic",
104
- "capabilities": {
105
- "inputCapabilities": {
106
- "text": true
107
- },
108
- "outputCapabilities": {
109
- "text": true
110
- }
111
- },
112
- "name": "claude-opus-4-20250514"
113
- },
114
- {
115
- "id": "e2d9d353-6dbe-4414-bf87-bd289d523726",
116
- "publicName": "gemini-2.5-pro",
117
- "organization": "google",
118
- "provider": "google",
119
- "capabilities": {
120
- "inputCapabilities": {
121
- "text": true,
122
- "image": true
123
- },
124
- "outputCapabilities": {
125
- "text": true
126
- }
127
- },
128
- "name": "gemini-2.5-pro"
129
- },
130
- {
131
- "id": "ce2092c1-28d4-4d42-a1e0-6b061dfe0b20",
132
- "publicName": "gemini-2.5-flash",
133
- "organization": "google",
134
- "provider": "google",
135
- "capabilities": {
136
- "inputCapabilities": {
137
- "text": true,
138
- "image": true
139
- },
140
- "outputCapabilities": {
141
- "text": true
142
- }
143
- },
144
- "name": "gemini-2.5-flash"
145
- },
146
- {
147
- "id": "cb0f1e24-e8e9-4745-aabc-b926ffde7475",
148
- "publicName": "o3-2025-04-16",
149
- "organization": "openai",
150
- "provider": "openai",
151
- "capabilities": {
152
- "inputCapabilities": {
153
- "text": true,
154
- "image": true
155
- },
156
- "outputCapabilities": {
157
- "text": true
158
- }
159
- },
160
- "name": "o3-2025-04-16"
161
- },
162
- {
163
- "id": "9513524d-882e-4350-b31e-e4584440c2c8",
164
- "publicName": "chatgpt-4o-latest-20250326",
165
- "organization": "openai",
166
- "provider": "openai",
167
- "capabilities": {
168
- "inputCapabilities": {
169
- "text": true,
170
- "image": true
171
- },
172
- "outputCapabilities": {
173
- "text": true
174
- }
175
- },
176
- "name": "chatgpt-4o-latest-20250326"
177
- },
178
- {
179
- "id": "0f785ba1-efcb-472d-961e-69f7b251c7e3",
180
- "publicName": "command-a-03-2025",
181
- "organization": "cohere",
182
- "provider": "cohere",
183
- "capabilities": {
184
- "inputCapabilities": {
185
- "text": true
186
- },
187
- "outputCapabilities": {
188
- "text": true
189
- }
190
- },
191
- "name": "command-a-03-2025"
192
- },
193
- {
194
- "id": "6a5437a7-c786-467b-b701-17b0bc8c8231",
195
- "publicName": "gpt-4.1-mini-2025-04-14",
196
- "organization": "openai",
197
- "provider": "openai",
198
- "capabilities": {
199
- "inputCapabilities": {
200
- "text": true,
201
- "image": true
202
- },
203
- "outputCapabilities": {
204
- "text": true
205
- }
206
- },
207
- "name": "gpt-4.1-mini-2025-04-14"
208
- },
209
- {
210
- "id": "a14546b5-d78d-4cf6-bb61-ab5b8510a9d6",
211
- "publicName": "amazon.nova-pro-v1:0",
212
- "organization": "amazon",
213
- "provider": "amazon",
214
- "capabilities": {
215
- "inputCapabilities": {
216
- "text": true,
217
- "image": true
218
- },
219
- "outputCapabilities": {
220
- "text": true
221
- }
222
- },
223
- "name": "amazon.nova-pro-v1:0"
224
- },
225
- {
226
- "id": "c680645e-efac-4a81-b0af-da16902b2541",
227
- "publicName": "o3-mini",
228
- "organization": "openai",
229
- "provider": "openai",
230
- "capabilities": {
231
- "inputCapabilities": {
232
- "text": true
233
- },
234
- "outputCapabilities": {
235
- "text": true
236
- }
237
- },
238
- "name": "o3-mini"
239
- },
240
- {
241
- "id": "7699c8d4-0742-42f9-a117-d10e84688dab",
242
- "publicName": "grok-3-mini-beta",
243
- "organization": "xai",
244
- "provider": "xai",
245
- "capabilities": {
246
- "inputCapabilities": {
247
- "text": true
248
- },
249
- "outputCapabilities": {
250
- "text": true
251
- }
252
- },
253
- "name": "grok-3-mini-beta"
254
- },
255
- {
256
- "id": "b88e983b-9459-473d-8bf1-753932f1679a",
257
- "publicName": "kimi-k2-0905-preview",
258
- "organization": "moonshot",
259
- "provider": "moonshot",
260
- "capabilities": {
261
- "inputCapabilities": {
262
- "text": true
263
- },
264
- "outputCapabilities": {
265
- "text": true
266
- }
267
- },
268
- "name": "kimi-k2-0905-preview"
269
- },
270
- {
271
- "id": "f1102bbf-34ca-468f-a9fc-14bcf63f315b",
272
- "publicName": "o4-mini-2025-04-16",
273
- "organization": "openai",
274
- "provider": "openai",
275
- "capabilities": {
276
- "inputCapabilities": {
277
- "text": true,
278
- "image": true
279
- },
280
- "outputCapabilities": {
281
- "text": true
282
- }
283
- },
284
- "name": "o4-mini-2025-04-16"
285
- },
286
- {
287
- "id": "04ec9a17-c597-49df-acf0-963da275c246",
288
- "publicName": "gemini-2.5-flash-lite-preview-06-17-thinking",
289
- "organization": "google",
290
- "provider": "google",
291
- "capabilities": {
292
- "inputCapabilities": {
293
- "text": true,
294
- "image": true
295
- },
296
- "outputCapabilities": {
297
- "text": true
298
- }
299
- },
300
- "name": "gemini-2.5-flash-lite-preview-06-17-thinking"
301
- },
302
- {
303
- "id": "d799a034-0ab6-48c1-817a-62e591143f39",
304
- "publicName": "amazon-nova-experimental-chat-05-14",
305
- "organization": "amazon",
306
- "provider": "amazon",
307
- "capabilities": {
308
- "inputCapabilities": {
309
- "text": true
310
- },
311
- "outputCapabilities": {
312
- "text": true
313
- }
314
- },
315
- "name": "amazon-nova-experimental-chat-05-14"
316
- },
317
- {
318
- "id": "be98fcfd-345c-4ae1-9a82-a19123ebf1d2",
319
- "publicName": "claude-3-7-sonnet-20250219-thinking-32k",
320
- "organization": "anthropic",
321
- "provider": "anthropic",
322
- "capabilities": {
323
- "inputCapabilities": {
324
- "text": true
325
- },
326
- "outputCapabilities": {
327
- "text": true
328
- }
329
- },
330
- "name": "claude-3-7-sonnet-20250219-thinking-32k"
331
- },
332
- {
333
- "id": "f6fbf06c-532c-4c8a-89c7-f3ddcfb34bd1",
334
- "publicName": "claude-3-5-haiku-20241022",
335
- "organization": "anthropic",
336
- "provider": "anthropic",
337
- "capabilities": {
338
- "inputCapabilities": {
339
- "text": true
340
- },
341
- "outputCapabilities": {
342
- "text": true
343
- }
344
- },
345
- "name": "claude-3-5-haiku-20241022"
346
- },
347
- {
348
- "id": "27b9f8c6-3ee1-464a-9479-a8b3c2a48fd4",
349
- "publicName": "mistral-medium-2505",
350
- "organization": "mistral",
351
- "provider": "mistral",
352
- "capabilities": {
353
- "inputCapabilities": {
354
- "text": true,
355
- "image": true
356
- },
357
- "outputCapabilities": {
358
- "text": true
359
- }
360
- },
361
- "name": "mistral-medium-2505"
362
- },
363
- {
364
- "id": "51ad1d79-61e2-414c-99e3-faeb64bb6b1b",
365
- "publicName": "imagen-3.0-generate-002",
366
- "organization": "google",
367
- "provider": "google",
368
- "capabilities": {
369
- "inputCapabilities": {
370
- "text": true
371
- },
372
- "outputCapabilities": {
373
- "image": {
374
- "aspectRatios": [
375
- "1:1"
376
- ]
377
- }
378
- }
379
- },
380
- "name": "imagen-3.0-generate-002"
381
- },
382
- {
383
- "id": "2f5253e4-75be-473c-bcfc-baeb3df0f8ad",
384
- "publicName": "deepseek-v3-0324",
385
- "organization": "deepseek",
386
- "provider": "deepseek",
387
- "capabilities": {
388
- "inputCapabilities": {
389
- "text": true
390
- },
391
- "outputCapabilities": {
392
- "text": true
393
- }
394
- },
395
- "name": "deepseek-v3-0324"
396
- },
397
- {
398
- "id": "36e4900d-5df2-46e1-9bd3-ef4028ab50b0",
399
- "publicName": "velocilux",
400
- "capabilities": {
401
- "inputCapabilities": {
402
- "text": true
403
- },
404
- "outputCapabilities": {
405
- "text": true
406
- }
407
- },
408
- "name": "velocilux"
409
- },
410
- {
411
- "id": "6337f479-2fc8-4311-a76b-8c957765cd68",
412
- "publicName": "magistral-medium-2506",
413
- "organization": "mistral",
414
- "provider": "mistral",
415
- "capabilities": {
416
- "inputCapabilities": {
417
- "text": true
418
- },
419
- "outputCapabilities": {
420
- "text": true
421
- }
422
- },
423
- "name": "magistral-medium-2506"
424
- },
425
- {
426
- "id": "34ee5a83-8d85-4d8b-b2c1-3b3413e9ed98",
427
- "publicName": "ideogram-v2",
428
- "organization": "Ideogram",
429
- "provider": "ideogram",
430
- "capabilities": {
431
- "inputCapabilities": {
432
- "text": true
433
- },
434
- "outputCapabilities": {
435
- "image": {
436
- "aspectRatios": [
437
- "1:1"
438
- ]
439
- }
440
- }
441
- },
442
- "name": "ideogram-v2"
443
- },
444
- {
445
- "id": "17e31227-36d7-4a7a-943a-7ebffa3a00eb",
446
- "publicName": "photon",
447
- "organization": "luma-ai",
448
- "provider": "luma-ai",
449
- "capabilities": {
450
- "inputCapabilities": {
451
- "text": true
452
- },
453
- "outputCapabilities": {
454
- "image": {
455
- "aspectRatios": [
456
- "1:1"
457
- ]
458
- }
459
- }
460
- },
461
- "name": "photon"
462
- },
463
- {
464
- "id": "b5ad3ab7-fc56-4ecd-8921-bd56b55c1159",
465
- "publicName": "llama-4-maverick-17b-128e-instruct",
466
- "organization": "meta",
467
- "provider": "meta",
468
- "capabilities": {
469
- "inputCapabilities": {
470
- "text": true,
471
- "image": true
472
- },
473
- "outputCapabilities": {
474
- "text": true
475
- }
476
- },
477
- "name": "llama-4-maverick-17b-128e-instruct"
478
- },
479
- {
480
- "id": "9a066f6a-7205-4325-8d0b-d81cc4b049c0",
481
- "publicName": "qwen3-30b-a3b",
482
- "organization": "alibaba",
483
- "provider": "alibaba",
484
- "capabilities": {
485
- "inputCapabilities": {
486
- "text": true
487
- },
488
- "outputCapabilities": {
489
- "text": true
490
- }
491
- },
492
- "name": "qwen3-30b-a3b"
493
- },
494
- {
495
- "id": "39b185cb-aba9-4232-99ea-074883a5ccd4",
496
- "publicName": "stephen-v2",
497
- "capabilities": {
498
- "inputCapabilities": {
499
- "text": true
500
- },
501
- "outputCapabilities": {
502
- "text": true
503
- }
504
- },
505
- "name": "stephen-v2"
506
- },
507
- {
508
- "id": "2595a594-fa54-4299-97cd-2d7380d21c80",
509
- "publicName": "qwen3-235b-a22b",
510
- "organization": "alibaba",
511
- "provider": "alibaba",
512
- "capabilities": {
513
- "inputCapabilities": {
514
- "text": true
515
- },
516
- "outputCapabilities": {
517
- "text": true
518
- }
519
- },
520
- "name": "qwen3-235b-a22b"
521
- },
522
- {
523
- "id": "dcbd7897-5a37-4a34-93f1-76a24c7bb028",
524
- "publicName": "llama-3.3-70b-instruct",
525
- "organization": "meta",
526
- "provider": "meta",
527
- "capabilities": {
528
- "inputCapabilities": {
529
- "text": true
530
- },
531
- "outputCapabilities": {
532
- "text": true
533
- }
534
- },
535
- "name": "llama-3.3-70b-instruct"
536
- },
537
- {
538
- "id": "34c89088-1c15-4cff-96fd-52ced7a4d5a9",
539
- "publicName": "cogitolux",
540
- "capabilities": {
541
- "inputCapabilities": {
542
- "text": true
543
- },
544
- "outputCapabilities": {
545
- "text": true
546
- }
547
- },
548
- "name": "cogitolux"
549
- },
550
- {
551
- "id": "ac44dd10-0666-451c-b824-386ccfea7bcc",
552
- "publicName": "claude-sonnet-4-20250514",
553
- "organization": "anthropic",
554
- "provider": "anthropic",
555
- "capabilities": {
556
- "inputCapabilities": {
557
- "text": true
558
- },
559
- "outputCapabilities": {
560
- "text": true
561
- }
562
- },
563
- "name": "claude-sonnet-4-20250514"
564
- },
565
- {
566
- "id": "812c93cc-5f88-4cff-b9ca-c11a26599b0e",
567
- "publicName": "qwen3-max-preview",
568
- "organization": "alibaba",
569
- "provider": "alibaba",
570
- "capabilities": {
571
- "inputCapabilities": {
572
- "text": true
573
- },
574
- "outputCapabilities": {
575
- "text": true
576
- }
577
- },
578
- "name": "qwen3-max-preview"
579
- },
580
- {
581
- "id": "c5a11495-081a-4dc6-8d9a-64a4fd6f7bbc",
582
- "publicName": "claude-3-7-sonnet-20250219",
583
- "organization": "anthropic",
584
- "provider": "anthropic",
585
- "capabilities": {
586
- "inputCapabilities": {
587
- "text": true
588
- },
589
- "outputCapabilities": {
590
- "text": true
591
- }
592
- },
593
- "name": "claude-3-7-sonnet-20250219"
594
- },
595
- {
596
- "id": "87e8d160-049e-4b4e-adc4-7f2511348539",
597
- "publicName": "minimax-m1",
598
- "organization": "minimax",
599
- "provider": "minimax",
600
- "capabilities": {
601
- "inputCapabilities": {
602
- "text": true
603
- },
604
- "outputCapabilities": {
605
- "text": true
606
- }
607
- },
608
- "name": "minimax-m1"
609
- },
610
- {
611
- "id": "bb97bc68-131c-4ea4-a59e-03a6252de0d2",
612
- "publicName": "dall-e-3",
613
- "organization": "openai",
614
- "provider": "openai",
615
- "capabilities": {
616
- "inputCapabilities": {
617
- "text": true
618
- },
619
- "outputCapabilities": {
620
- "image": {
621
- "aspectRatios": [
622
- "1:1"
623
- ]
624
- }
625
- }
626
- },
627
- "name": "dall-e-3"
628
- },
629
- {
630
- "id": "b70ab012-18e7-4d6f-a887-574e05de6c20",
631
- "publicName": "recraft-v3",
632
- "organization": "Recraft",
633
- "provider": "recraft",
634
- "capabilities": {
635
- "inputCapabilities": {
636
- "text": true
637
- },
638
- "outputCapabilities": {
639
- "image": {
640
- "aspectRatios": [
641
- "1:1"
642
- ]
643
- }
644
- }
645
- },
646
- "name": "recraft-v3"
647
- },
648
- {
649
- "id": "a8d1d310-e485-4c50-8f27-4bff18292a99",
650
- "publicName": "qwen3-30b-a3b-instruct-2507",
651
- "organization": "alibaba",
652
- "provider": "alibaba",
653
- "capabilities": {
654
- "inputCapabilities": {
655
- "text": true
656
- },
657
- "outputCapabilities": {
658
- "text": true
659
- }
660
- },
661
- "name": "qwen3-30b-a3b-instruct-2507"
662
- },
663
- {
664
- "id": "4653dded-a46b-442a-a8fe-9bb9730e2453",
665
- "publicName": "claude-sonnet-4-20250514-thinking-32k",
666
- "organization": "anthropic",
667
- "provider": "anthropic",
668
- "capabilities": {
669
- "inputCapabilities": {
670
- "text": true
671
- },
672
- "outputCapabilities": {
673
- "text": true
674
- }
675
- },
676
- "name": "claude-sonnet-4-20250514-thinking-32k"
677
- },
678
- {
679
- "id": "eb5da04f-9b28-406b-bf06-4539158c66ef",
680
- "publicName": "anonymous-bot-0514",
681
- "capabilities": {
682
- "inputCapabilities": {
683
- "text": true
684
- },
685
- "outputCapabilities": {
686
- "image": {
687
- "aspectRatios": [
688
- "1:1"
689
- ]
690
- }
691
- }
692
- },
693
- "name": "anonymous-bot-0514"
694
- },
695
- {
696
- "id": "1a400d9a-f61c-4bc2-89b4-a9b7e77dff12",
697
- "publicName": "qwen3-235b-a22b-no-thinking",
698
- "organization": "alibaba",
699
- "provider": "alibaba",
700
- "capabilities": {
701
- "inputCapabilities": {
702
- "text": true
703
- },
704
- "outputCapabilities": {
705
- "text": true
706
- }
707
- },
708
- "name": "qwen3-235b-a22b-no-thinking"
709
- },
710
- {
711
- "id": "896a3848-ae03-4651-963b-7d8f54b61ae8",
712
- "publicName": "gemma-3n-e4b-it",
713
- "organization": "google",
714
- "provider": "google",
715
- "capabilities": {
716
- "inputCapabilities": {
717
- "text": true
718
- },
719
- "outputCapabilities": {
720
- "text": true
721
- }
722
- },
723
- "name": "gemma-3n-e4b-it"
724
- },
725
- {
726
- "id": "9e8525b7-fe50-4e50-bf7f-ad1d3d205d3c",
727
- "publicName": "flux-1.1-pro",
728
- "organization": "Black Forest Labs",
729
- "provider": "black forest labs",
730
- "capabilities": {
731
- "inputCapabilities": {
732
- "text": true
733
- },
734
- "outputCapabilities": {
735
- "image": {
736
- "aspectRatios": [
737
- "1:1"
738
- ]
739
- }
740
- }
741
- },
742
- "name": "flux-1.1-pro"
743
- },
744
- {
745
- "id": "3b5e9593-3dc0-4492-a3da-19784c4bde75",
746
- "publicName": "claude-opus-4-20250514-thinking-16k",
747
- "organization": "anthropic",
748
- "provider": "anthropic",
749
- "capabilities": {
750
- "inputCapabilities": {
751
- "text": true
752
- },
753
- "outputCapabilities": {
754
- "text": true
755
- }
756
- },
757
- "name": "claude-opus-4-20250514-thinking-16k"
758
- },
759
- {
760
- "id": "e3c9ea42-5f42-496b-bc80-c7e8ee5653cc",
761
- "publicName": "stephen-vision-csfix",
762
- "capabilities": {
763
- "inputCapabilities": {
764
- "text": true,
765
- "image": true
766
- },
767
- "outputCapabilities": {
768
- "text": true
769
- }
770
- },
771
- "name": "stephen-vision-csfix"
772
- },
773
- {
774
- "id": "bbad1d17-6aa5-4321-949c-d11fb6289241",
775
- "publicName": "mistral-small-2506",
776
- "organization": "mistral",
777
- "provider": "mistral",
778
- "capabilities": {
779
- "inputCapabilities": {
780
- "text": true,
781
- "image": true
782
- },
783
- "outputCapabilities": {
784
- "text": true
785
- }
786
- },
787
- "name": "mistral-small-2506"
788
- },
789
- {
790
- "id": "f7e2ed7a-f0b9-40ef-853a-20036e747232",
791
- "publicName": "ideogram-v3-quality",
792
- "organization": "Ideogram",
793
- "provider": "ideogram",
794
- "capabilities": {
795
- "inputCapabilities": {
796
- "text": true
797
- },
798
- "outputCapabilities": {
799
- "image": {
800
- "aspectRatios": [
801
- "1:1"
802
- ]
803
- }
804
- }
805
- },
806
- "name": "ideogram-v3-quality"
807
- },
808
- {
809
- "id": "149619f1-f1d5-45fd-a53e-7d790f156f20",
810
- "publicName": "grok-3-mini-high",
811
- "organization": "xai",
812
- "provider": "xai",
813
- "capabilities": {
814
- "inputCapabilities": {
815
- "text": true
816
- },
817
- "outputCapabilities": {
818
- "text": true
819
- }
820
- },
821
- "name": "grok-3-mini-high"
822
- },
823
- {
824
- "id": "b9edb8e9-4e98-49e7-8aaf-ae67e9797a11",
825
- "publicName": "grok-4-0709",
826
- "organization": "xai",
827
- "provider": "xai",
828
- "capabilities": {
829
- "inputCapabilities": {
830
- "text": true,
831
- "image": true
832
- },
833
- "outputCapabilities": {
834
- "text": true
835
- }
836
- },
837
- "name": "grok-4-0709"
838
- },
839
- {
840
- "id": "24145149-86c9-4690-b7c9-79c7db216e5c",
841
- "publicName": "ppl-sonar-reasoning-pro-high",
842
- "organization": "perplexity",
843
- "provider": "perplexity",
844
- "capabilities": {
845
- "inputCapabilities": {
846
- "text": true
847
- },
848
- "outputCapabilities": {
849
- "search": true
850
- }
851
- },
852
- "name": "ppl-sonar-reasoning-pro-high"
853
- },
854
- {
855
- "id": "0dde746c-3dbc-42be-b8f5-f38bd1595baa",
856
- "publicName": "seedream-3",
857
- "organization": "bytedance",
858
- "provider": "bytedance",
859
- "capabilities": {
860
- "inputCapabilities": {
861
- "text": true
862
- },
863
- "outputCapabilities": {
864
- "image": {
865
- "aspectRatios": [
866
- "1:1"
867
- ]
868
- }
869
- }
870
- },
871
- "name": "seedream-3"
872
- },
873
- {
874
- "id": "c8711485-d061-4a00-94d2-26c31b840a3d",
875
- "publicName": "ppl-sonar-pro-high",
876
- "organization": "perplexity",
877
- "provider": "perplexity",
878
- "capabilities": {
879
- "inputCapabilities": {
880
- "text": true
881
- },
882
- "outputCapabilities": {
883
- "search": true
884
- }
885
- },
886
- "name": "ppl-sonar-pro-high"
887
- },
888
- {
889
- "id": "25bcb878-749e-49f4-ac05-de84d964bcee",
890
- "publicName": "claude-opus-4-search",
891
- "organization": "anthropic",
892
- "provider": "anthropic",
893
- "capabilities": {
894
- "inputCapabilities": {
895
- "text": true
896
- },
897
- "outputCapabilities": {
898
- "search": true
899
- }
900
- },
901
- "name": "claude-opus-4-search"
902
- },
903
- {
904
- "id": "b222be23-bd55-4b20-930b-a30cc84d3afd",
905
- "publicName": "gemini-2.5-pro-grounding",
906
- "organization": "google",
907
- "provider": "google",
908
- "capabilities": {
909
- "inputCapabilities": {
910
- "text": true
911
- },
912
- "outputCapabilities": {
913
- "search": true
914
- }
915
- },
916
- "name": "gemini-2.5-pro-grounding"
917
- },
918
- {
919
- "id": "d079ef40-3b20-4c58-ab5e-243738dbada5",
920
- "publicName": "glm-4.5",
921
- "organization": "zai",
922
- "provider": "zai",
923
- "capabilities": {
924
- "inputCapabilities": {
925
- "text": true
926
- },
927
- "outputCapabilities": {
928
- "text": true
929
- }
930
- },
931
- "name": "glm-4.5"
932
- },
933
- {
934
- "id": "fbe08e9a-3805-4f9f-a085-7bc38e4b51d1",
935
- "publicName": "o3-search",
936
- "organization": "openai",
937
- "provider": "openai",
938
- "capabilities": {
939
- "inputCapabilities": {
940
- "text": true
941
- },
942
- "outputCapabilities": {
943
- "search": true
944
- }
945
- },
946
- "name": "o3-search"
947
- },
948
- {
949
- "id": "96ae95fd-b70d-49c3-91cc-b58c7da1090b",
950
- "publicName": "claude-opus-4-1-20250805",
951
- "organization": "anthropic",
952
- "provider": "anthropic",
953
- "capabilities": {
954
- "inputCapabilities": {
955
- "text": true
956
- },
957
- "outputCapabilities": {
958
- "text": true
959
- }
960
- },
961
- "name": "claude-opus-4-1-20250805"
962
- },
963
- {
964
- "id": "68b6f90d-9dd5-4995-97d0-7ea13c0c82ba",
965
- "publicName": "Bailing-Lite-250220",
966
- "capabilities": {
967
- "inputCapabilities": {
968
- "text": true
969
- },
970
- "outputCapabilities": {
971
- "text": true
972
- }
973
- },
974
- "name": "bailing-lite-250220"
975
- },
976
- {
977
- "id": "51a47cc6-5ef9-4ac7-a59c-4009230d7564",
978
- "publicName": "gemini-2.5-pro-grounding-exp",
979
- "capabilities": {
980
- "inputCapabilities": {
981
- "text": true
982
- },
983
- "outputCapabilities": {
984
- "text": true
985
- }
986
- },
987
- "name": "gemini-2.5-pro-grounding-exp"
988
- },
989
- {
990
- "id": "ec3beb4b-7229-4232-bab9-670ee52dd711",
991
- "publicName": "gpt-oss-20b",
992
- "organization": "openai",
993
- "provider": "openai",
994
- "capabilities": {
995
- "inputCapabilities": {
996
- "text": true
997
- },
998
- "outputCapabilities": {
999
- "text": true
1000
- }
1001
- },
1002
- "name": "gpt-oss-20b"
1003
- },
1004
- {
1005
- "id": "6fe1ec40-3219-4c33-b3e7-0e65658b4194",
1006
- "publicName": "qwen-vl-max-2025-08-13",
1007
- "organization": "alibaba",
1008
- "provider": "alibaba",
1009
- "capabilities": {
1010
- "inputCapabilities": {
1011
- "text": true,
1012
- "image": true
1013
- },
1014
- "outputCapabilities": {
1015
- "text": true
1016
- }
1017
- },
1018
- "name": "qwen-vl-max-2025-08-13"
1019
- },
1020
- {
1021
- "id": "80caa6ac-05cd-4403-88e1-ef0164c8b1a8",
1022
- "publicName": "veo3",
1023
- "organization": "google",
1024
- "provider": "google",
1025
- "capabilities": {
1026
- "inputCapabilities": {
1027
- "text": true,
1028
- "image": true
1029
- },
1030
- "outputCapabilities": {
1031
- "video": true
1032
- }
1033
- },
1034
- "name": "veo3"
1035
- },
1036
- {
1037
- "id": "1b677c7e-49dd-4045-9ce0-d1aedcb9bbbc",
1038
- "publicName": "veo3-fast",
1039
- "organization": "google",
1040
- "provider": "google",
1041
- "capabilities": {
1042
- "inputCapabilities": {
1043
- "text": true,
1044
- "image": true
1045
- },
1046
- "outputCapabilities": {
1047
- "video": true
1048
- }
1049
- },
1050
- "name": "veo3-fast"
1051
- },
1052
- {
1053
- "id": "08d8dcc6-2ab5-45ae-9bf1-353480f1f7ee",
1054
- "publicName": "veo2",
1055
- "organization": "google",
1056
- "provider": "google",
1057
- "capabilities": {
1058
- "inputCapabilities": {
1059
- "text": true,
1060
- "image": true
1061
- },
1062
- "outputCapabilities": {
1063
- "video": true
1064
- }
1065
- },
1066
- "name": "veo2"
1067
- },
1068
- {
1069
- "id": "7a3626fc-4e64-4c9e-821f-b449a4b43b6a",
1070
- "publicName": "kimi-k2-0711-preview",
1071
- "organization": "moonshot",
1072
- "provider": "moonshot",
1073
- "capabilities": {
1074
- "inputCapabilities": {
1075
- "text": true
1076
- },
1077
- "outputCapabilities": {
1078
- "text": true
1079
- }
1080
- },
1081
- "name": "kimi-k2-0711-preview"
1082
- },
1083
- {
1084
- "id": "69f90b32-01dc-43e1-8c48-bf494f8f4f38",
1085
- "publicName": "gpt-image-1-high-fidelity",
1086
- "capabilities": {
1087
- "inputCapabilities": {
1088
- "text": true,
1089
- "image": {
1090
- "multipleImages": true,
1091
- "requiresUpload": false
1092
- }
1093
- },
1094
- "outputCapabilities": {
1095
- "image": {
1096
- "aspectRatios": [
1097
- "1:1"
1098
- ]
1099
- }
1100
- }
1101
- },
1102
- "name": "gpt-image-1-high-fidelity"
1103
- },
1104
- {
1105
- "id": "ee7cb86e-8601-4585-b1d0-7c7380f8f6f4",
1106
- "publicName": "qwen3-235b-a22b-instruct-2507",
1107
- "organization": "alibaba",
1108
- "provider": "alibaba",
1109
- "capabilities": {
1110
- "inputCapabilities": {
1111
- "text": true
1112
- },
1113
- "outputCapabilities": {
1114
- "text": true
1115
- }
1116
- },
1117
- "name": "qwen3-235b-a22b-instruct-2507"
1118
- },
1119
- {
1120
- "id": "5b3383a9-6bca-4f71-8210-78895c9d84d5",
1121
- "publicName": "ray2",
1122
- "organization": "luma-ai",
1123
- "provider": "luma-ai",
1124
- "capabilities": {
1125
- "inputCapabilities": {
1126
- "text": true,
1127
- "image": {
1128
- "requiresUpload": true
1129
- }
1130
- },
1131
- "outputCapabilities": {
1132
- "video": true
1133
- }
1134
- },
1135
- "name": "ray2"
1136
- },
1137
- {
1138
- "id": "6ee9f901-17b5-4fbe-9cc2-13c16497c23b",
1139
- "publicName": "gpt-oss-120b",
1140
- "organization": "openai",
1141
- "provider": "openai",
1142
- "capabilities": {
1143
- "inputCapabilities": {
1144
- "text": true
1145
- },
1146
- "outputCapabilities": {
1147
- "text": true
1148
- }
1149
- },
1150
- "name": "gpt-oss-120b"
1151
- },
1152
- {
1153
- "id": "6e855f13-55d7-4127-8656-9168a9f4dcc0",
1154
- "publicName": "gpt-image-1",
1155
- "organization": "openai",
1156
- "provider": "openai",
1157
- "capabilities": {
1158
- "inputCapabilities": {
1159
- "text": true,
1160
- "image": {
1161
- "multipleImages": true,
1162
- "requiresUpload": false
1163
- }
1164
- },
1165
- "outputCapabilities": {
1166
- "image": {
1167
- "aspectRatios": [
1168
- "1:1"
1169
- ]
1170
- }
1171
- }
1172
- },
1173
- "name": "gpt-image-1"
1174
- },
1175
- {
1176
- "id": "5a3b3520-c87d-481f-953c-1364687b6e8f",
1177
- "publicName": "lucid-origin",
1178
- "organization": "leonardo-ai",
1179
- "provider": "leonardo-ai",
1180
- "capabilities": {
1181
- "inputCapabilities": {
1182
- "text": true
1183
- },
1184
- "outputCapabilities": {
1185
- "image": {
1186
- "aspectRatios": [
1187
- "1:1"
1188
- ]
1189
- }
1190
- }
1191
- },
1192
- "name": "lucid-origin"
1193
- },
1194
- {
1195
- "id": "1ea13a81-93a7-4804-bcdd-693cd72e302d",
1196
- "publicName": "step-3",
1197
- "organization": "stepfun",
1198
- "provider": "stepfun",
1199
- "capabilities": {
1200
- "inputCapabilities": {
1201
- "text": true,
1202
- "image": true
1203
- },
1204
- "outputCapabilities": {
1205
- "text": true
1206
- }
1207
- },
1208
- "name": "step-3"
1209
- },
1210
- {
1211
- "id": "af033cbd-ec6c-42cc-9afa-e227fc12efe8",
1212
- "publicName": "qwen3-coder-480b-a35b-instruct",
1213
- "organization": "Alibaba",
1214
- "provider": "alibaba",
1215
- "capabilities": {
1216
- "inputCapabilities": {
1217
- "text": true
1218
- },
1219
- "outputCapabilities": {
1220
- "text": true
1221
- }
1222
- },
1223
- "name": "qwen3-coder-480b-a35b-instruct"
1224
- },
1225
- {
1226
- "id": "f8aec69d-e077-4ed1-99be-d34f48559bbf",
1227
- "publicName": "imagen-4.0-ultra-generate-preview-06-06",
1228
- "organization": "google",
1229
- "provider": "google",
1230
- "capabilities": {
1231
- "inputCapabilities": {
1232
- "text": true
1233
- },
1234
- "outputCapabilities": {
1235
- "image": {
1236
- "aspectRatios": [
1237
- "1:1"
1238
- ]
1239
- }
1240
- }
1241
- },
1242
- "name": "imagen-4.0-ultra-generate-preview-06-06"
1243
- },
1244
- {
1245
- "id": "a071b843-0fc2-4fcf-b644-023509635452",
1246
- "publicName": "veo3-audio",
1247
- "organization": "google",
1248
- "provider": "google",
1249
- "capabilities": {
1250
- "inputCapabilities": {
1251
- "text": true,
1252
- "image": true
1253
- },
1254
- "outputCapabilities": {
1255
- "video": true
1256
- }
1257
- },
1258
- "name": "veo3-audio"
1259
- },
1260
- {
1261
- "id": "7bfb254a-5d32-4ce2-b6dc-2c7faf1d5fe8",
1262
- "publicName": "glm-4.5-air",
1263
- "organization": "zai",
1264
- "provider": "zai",
1265
- "capabilities": {
1266
- "inputCapabilities": {
1267
- "text": true
1268
- },
1269
- "outputCapabilities": {
1270
- "text": true
1271
- }
1272
- },
1273
- "name": "glm-4.5-air"
1274
- },
1275
- {
1276
- "id": "48fe3167-5680-4903-9ab5-2f0b9dc05815",
1277
- "publicName": "nightride-on",
1278
- "capabilities": {
1279
- "inputCapabilities": {
1280
- "text": true,
1281
- "image": true
1282
- },
1283
- "outputCapabilities": {
1284
- "text": true
1285
- }
1286
- },
1287
- "name": "nightride-on"
1288
- },
1289
- {
1290
- "id": "638fb8b8-1037-4ee5-bfba-333392575a5d",
1291
- "publicName": "EB45-vision",
1292
- "capabilities": {
1293
- "inputCapabilities": {
1294
- "text": true,
1295
- "image": true
1296
- },
1297
- "outputCapabilities": {
1298
- "text": true
1299
- }
1300
- },
1301
- "name": "eb45-vision"
1302
- },
1303
- {
1304
- "id": "c822ec98-38e9-4e43-a434-982eb534824f",
1305
- "publicName": "nightride-on-v2",
1306
- "capabilities": {
1307
- "inputCapabilities": {
1308
- "text": true,
1309
- "image": true
1310
- },
1311
- "outputCapabilities": {
1312
- "text": true
1313
- }
1314
- },
1315
- "name": "nightride-on-v2"
1316
- },
1317
- {
1318
- "id": "86d767b0-2574-4e47-a256-a22bcace9f56",
1319
- "publicName": "grok-4-search",
1320
- "organization": "xai",
1321
- "provider": "xai",
1322
- "capabilities": {
1323
- "inputCapabilities": {
1324
- "text": true
1325
- },
1326
- "outputCapabilities": {
1327
- "search": true
1328
- }
1329
- },
1330
- "name": "grok-4-search"
1331
- },
1332
- {
1333
- "id": "27035fb8-a25b-4ec9-8410-34be18328afd",
1334
- "publicName": "mistral-medium-2508",
1335
- "organization": "mistral",
1336
- "provider": "mistral",
1337
- "capabilities": {
1338
- "inputCapabilities": {
1339
- "text": true,
1340
- "image": true
1341
- },
1342
- "outputCapabilities": {
1343
- "text": true
1344
- }
1345
- },
1346
- "name": "mistral-medium-2508"
1347
- },
1348
- {
1349
- "id": "16b8e53a-cc7b-4608-a29a-20d4dac77cf2",
1350
- "publicName": "qwen3-235b-a22b-thinking-2507",
1351
- "organization": "alibaba",
1352
- "provider": "alibaba",
1353
- "capabilities": {
1354
- "inputCapabilities": {
1355
- "text": true
1356
- },
1357
- "outputCapabilities": {
1358
- "text": true
1359
- }
1360
- },
1361
- "name": "qwen3-235b-a22b-thinking-2507"
1362
- },
1363
- {
1364
- "id": "217158f9-793e-4ffe-a197-6de9448432fc",
1365
- "publicName": "ray2",
1366
- "organization": "luma-ai",
1367
- "provider": "luma-ai",
1368
- "capabilities": {
1369
- "inputCapabilities": {
1370
- "text": true
1371
- },
1372
- "outputCapabilities": {
1373
- "video": true
1374
- }
1375
- },
1376
- "name": "ray2"
1377
- },
1378
- {
1379
- "id": "69bbf7d4-9f44-447e-a868-abc4f7a31810",
1380
- "publicName": "gemini-2.0-flash-preview-image-generation",
1381
- "organization": "google",
1382
- "provider": "google",
1383
- "capabilities": {
1384
- "inputCapabilities": {
1385
- "text": true,
1386
- "image": {
1387
- "multipleImages": true,
1388
- "requiresUpload": false
1389
- }
1390
- },
1391
- "outputCapabilities": {
1392
- "image": {
1393
- "aspectRatios": [
1394
- "1:1"
1395
- ]
1396
- }
1397
- }
1398
- },
1399
- "name": "gemini-2.0-flash-preview-image-generation"
1400
- },
1401
- {
1402
- "id": "ba99b6cb-e981-48f4-a5be-ace516ee2731",
1403
- "publicName": "hailuo-02-standard",
1404
- "organization": "minimax",
1405
- "provider": "minimax",
1406
- "capabilities": {
1407
- "inputCapabilities": {
1408
- "text": true,
1409
- "image": true
1410
- },
1411
- "outputCapabilities": {
1412
- "video": true
1413
- }
1414
- },
1415
- "name": "hailuo-02-standard"
1416
- },
1417
- {
1418
- "id": "e705b65f-82cd-40cb-9630-d9e6ca92d06f",
1419
- "publicName": "seedance-v1-pro",
1420
- "organization": "bytedance",
1421
- "provider": "bytedance",
1422
- "capabilities": {
1423
- "inputCapabilities": {
1424
- "text": true
1425
- },
1426
- "outputCapabilities": {
1427
- "video": true
1428
- }
1429
- },
1430
- "name": "seedance-v1-pro"
1431
- },
1432
- {
1433
- "id": "f1a5a6ab-e1b1-4247-88ac-49395291c1e3",
1434
- "publicName": "not-a-new-model",
1435
- "capabilities": {
1436
- "inputCapabilities": {
1437
- "text": true
1438
- },
1439
- "outputCapabilities": {
1440
- "text": true
1441
- }
1442
- },
1443
- "name": "not-a-new-model"
1444
- },
1445
- {
1446
- "id": "c15b93ed-e87b-467f-8f9f-d830fd7aa54d",
1447
- "publicName": "lmarena-internal-test-only",
1448
- "capabilities": {
1449
- "inputCapabilities": {
1450
- "text": true
1451
- },
1452
- "outputCapabilities": {
1453
- "text": true
1454
- }
1455
- },
1456
- "name": "lmarena-internal-test-only"
1457
- },
1458
- {
1459
- "id": "0862885e-ef53-4d0d-b9c4-4c8f68f453ce",
1460
- "publicName": "diffbot-small-xl",
1461
- "organization": "diffbot",
1462
- "provider": "diffbot",
1463
- "capabilities": {
1464
- "inputCapabilities": {
1465
- "text": true
1466
- },
1467
- "outputCapabilities": {
1468
- "search": true
1469
- }
1470
- },
1471
- "name": "diffbot-small-xl"
1472
- },
1473
- {
1474
- "id": "43390b9c-cf16-4e4e-a1be-3355bb5b6d5e",
1475
- "publicName": "flux-1-kontext-pro",
1476
- "organization": "bfl",
1477
- "provider": "bfl",
1478
- "capabilities": {
1479
- "inputCapabilities": {
1480
- "text": true,
1481
- "image": {
1482
- "multipleImages": false
1483
- }
1484
- },
1485
- "outputCapabilities": {
1486
- "image": {
1487
- "aspectRatios": [
1488
- "1:1"
1489
- ]
1490
- }
1491
- }
1492
- },
1493
- "name": "flux-1-kontext-pro"
1494
- },
1495
- {
1496
- "id": "30dfdea7-b4bc-4dab-8515-5d93917c7f4f",
1497
- "publicName": "deepseek-v3.1",
1498
- "organization": "deepseek",
1499
- "provider": "deepseek",
1500
- "capabilities": {
1501
- "inputCapabilities": {
1502
- "text": true
1503
- },
1504
- "outputCapabilities": {
1505
- "text": true
1506
- }
1507
- },
1508
- "name": "deepseek-v3.1"
1509
- },
1510
- {
1511
- "id": "9fe82ee1-c84f-417f-b0e7-cab4ae4cf3f3",
1512
- "publicName": "qwen-image-prompt-extend",
1513
- "organization": "alibaba",
1514
- "provider": "alibaba",
1515
- "capabilities": {
1516
- "inputCapabilities": {
1517
- "text": true
1518
- },
1519
- "outputCapabilities": {
1520
- "image": {
1521
- "aspectRatios": [
1522
- "1:1"
1523
- ]
1524
- }
1525
- }
1526
- },
1527
- "name": "qwen-image-prompt-extend"
1528
- },
1529
- {
1530
- "id": "86de5aea-fc0c-4c36-b65a-7afc443a32d2",
1531
- "publicName": "pika-v2.2",
1532
- "organization": "pika",
1533
- "provider": "pika",
1534
- "capabilities": {
1535
- "inputCapabilities": {
1536
- "text": true
1537
- },
1538
- "outputCapabilities": {
1539
- "video": true
1540
- }
1541
- },
1542
- "name": "pika-v2.2"
1543
- },
1544
- {
1545
- "id": "0633b1ef-289f-49d4-a834-3d475a25e46b",
1546
- "publicName": "flux-1-kontext-max",
1547
- "capabilities": {
1548
- "inputCapabilities": {
1549
- "text": true,
1550
- "image": {
1551
- "multipleImages": false
1552
- }
1553
- },
1554
- "outputCapabilities": {
1555
- "image": {
1556
- "aspectRatios": [
1557
- "1:1"
1558
- ]
1559
- }
1560
- }
1561
- },
1562
- "name": "flux-1-kontext-max"
1563
- },
1564
- {
1565
- "id": "f1a2eb6f-fc30-4806-9e00-1efd0d73cbc4",
1566
- "publicName": "claude-opus-4-1-20250805-thinking-16k",
1567
- "organization": "anthropic",
1568
- "provider": "anthropic",
1569
- "capabilities": {
1570
- "inputCapabilities": {
1571
- "text": true
1572
- },
1573
- "outputCapabilities": {
1574
- "text": true
1575
- }
1576
- },
1577
- "name": "claude-opus-4-1-20250805-thinking-16k"
1578
- },
1579
- {
1580
- "id": "e9dd5a96-c066-48b0-869f-eb762030b5ed",
1581
- "publicName": "EB45-turbo",
1582
- "capabilities": {
1583
- "inputCapabilities": {
1584
- "text": true
1585
- },
1586
- "outputCapabilities": {
1587
- "text": true
1588
- }
1589
- },
1590
- "name": "eb45-turbo"
1591
- },
1592
- {
1593
- "id": "9bbbca46-b6c2-4919-83a8-87ef1c559c4e",
1594
- "publicName": "veo3-fast-audio",
1595
- "organization": "google",
1596
- "provider": "google",
1597
- "capabilities": {
1598
- "inputCapabilities": {
1599
- "text": true,
1600
- "image": true
1601
- },
1602
- "outputCapabilities": {
1603
- "video": true
1604
- }
1605
- },
1606
- "name": "veo3-fast-audio"
1607
- },
1608
- {
1609
- "id": "cff3fc67-4207-4dff-967f-f4de61115836",
1610
- "publicName": "deepseek-v3.1-thinking",
1611
- "organization": "deepseek",
1612
- "provider": "deepseek",
1613
- "capabilities": {
1614
- "inputCapabilities": {
1615
- "text": true
1616
- },
1617
- "outputCapabilities": {
1618
- "text": true
1619
- }
1620
- },
1621
- "name": "deepseek-v3.1-thinking"
1622
- },
1623
- {
1624
- "id": "5fd3caa8-fe4c-41a5-a22c-0025b58f4b42",
1625
- "publicName": "gpt-5-mini-high",
1626
- "organization": "openai",
1627
- "provider": "openai",
1628
- "capabilities": {
1629
- "inputCapabilities": {
1630
- "text": true,
1631
- "image": true
1632
- },
1633
- "outputCapabilities": {
1634
- "text": true
1635
- }
1636
- },
1637
- "name": "gpt-5-mini-high"
1638
- },
1639
- {
1640
- "id": "9dab0475-a0cc-4524-84a2-3fd25aa8c768",
1641
- "publicName": "glm-4.5v",
1642
- "organization": "zai",
1643
- "provider": "zai",
1644
- "capabilities": {
1645
- "inputCapabilities": {
1646
- "text": true,
1647
- "image": true
1648
- },
1649
- "outputCapabilities": {
1650
- "text": true
1651
- }
1652
- },
1653
- "name": "glm-4.5v"
1654
- },
1655
- {
1656
- "id": "8afbc476-52af-4ebc-aa33-2ffdd7e19153",
1657
- "publicName": "hailuo-02-pro",
1658
- "organization": "minimax",
1659
- "provider": "minimax",
1660
- "capabilities": {
1661
- "inputCapabilities": {
1662
- "text": true,
1663
- "image": true
1664
- },
1665
- "outputCapabilities": {
1666
- "video": true
1667
- }
1668
- },
1669
- "name": "hailuo-02-pro"
1670
- },
1671
- {
1672
- "id": "d63b03fb-8bc8-4ed8-9a50-6ccb683ac2b1",
1673
- "publicName": "kling-v2.1-master",
1674
- "organization": "kling",
1675
- "provider": "kling",
1676
- "capabilities": {
1677
- "inputCapabilities": {
1678
- "text": true
1679
- },
1680
- "outputCapabilities": {
1681
- "video": true
1682
- }
1683
- },
1684
- "name": "kling-v2.1-master"
1685
- },
1686
- {
1687
- "id": "4c8dde6e-1b2c-45b9-91c3-413b2ceafffb",
1688
- "publicName": "seedance-v1-lite",
1689
- "organization": "bytedance",
1690
- "provider": "bytedance",
1691
- "capabilities": {
1692
- "inputCapabilities": {
1693
- "text": true,
1694
- "image": {
1695
- "requiresUpload": true
1696
- }
1697
- },
1698
- "outputCapabilities": {
1699
- "video": true
1700
- }
1701
- },
1702
- "name": "seedance-v1-lite"
1703
- },
1704
- {
1705
- "id": "ea96cfc8-953a-4c3c-a229-1107c55b7479",
1706
- "publicName": "kling-v2.1-standard",
1707
- "organization": "kling",
1708
- "provider": "kling",
1709
- "capabilities": {
1710
- "inputCapabilities": {
1711
- "text": true,
1712
- "image": {
1713
- "requiresUpload": true
1714
- }
1715
- },
1716
- "outputCapabilities": {
1717
- "video": true
1718
- }
1719
- },
1720
- "name": "kling-v2.1-standard"
1721
- },
1722
- {
1723
- "id": "4ddc4e52-2867-49b6-a603-5aab24a566ca",
1724
- "publicName": "seedance-v1-pro",
1725
- "organization": "bytedance",
1726
- "provider": "bytedance",
1727
- "capabilities": {
1728
- "inputCapabilities": {
1729
- "text": true,
1730
- "image": {
1731
- "requiresUpload": true
1732
- }
1733
- },
1734
- "outputCapabilities": {
1735
- "video": true
1736
- }
1737
- },
1738
- "name": "seedance-v1-pro"
1739
- },
1740
- {
1741
- "id": "c3d0e5c8-f4b3-417a-8cb8-2ccf757d3869",
1742
- "publicName": "sora",
1743
- "organization": "openai",
1744
- "provider": "openai",
1745
- "capabilities": {
1746
- "inputCapabilities": {
1747
- "text": true
1748
- },
1749
- "outputCapabilities": {
1750
- "video": true
1751
- }
1752
- },
1753
- "name": "sora"
1754
- },
1755
- {
1756
- "id": "d942b564-191c-41c5-ae22-400a930a2cfe",
1757
- "publicName": "claude-opus-4-1-search",
1758
- "organization": "anthropic",
1759
- "provider": "anthropic",
1760
- "capabilities": {
1761
- "inputCapabilities": {
1762
- "text": true
1763
- },
1764
- "outputCapabilities": {
1765
- "search": true
1766
- }
1767
- },
1768
- "name": "claude-opus-4-1-search"
1769
- },
1770
- {
1771
- "id": "2dc249b3-98da-44b4-8d1e-6666346a8012",
1772
- "publicName": "gpt-5-nano-high",
1773
- "organization": "openai",
1774
- "provider": "openai",
1775
- "capabilities": {
1776
- "inputCapabilities": {
1777
- "text": true,
1778
- "image": true
1779
- },
1780
- "outputCapabilities": {
1781
- "text": true
1782
- }
1783
- },
1784
- "name": "gpt-5-nano-high"
1785
- },
1786
- {
1787
- "id": "f9b9f030-9ebc-4765-bf76-c64a82a72dfd",
1788
- "publicName": "pika-v2.2",
1789
- "organization": "pika",
1790
- "provider": "pika",
1791
- "capabilities": {
1792
- "inputCapabilities": {
1793
- "text": true,
1794
- "image": {
1795
- "requiresUpload": true
1796
- }
1797
- },
1798
- "outputCapabilities": {
1799
- "video": true
1800
- }
1801
- },
1802
- "name": "pika-v2.2"
1803
- },
1804
- {
1805
- "id": "995cf221-af30-466d-a809-8e0985f83649",
1806
- "publicName": "qwen-image-edit",
1807
- "organization": "alibaba",
1808
- "provider": "alibaba",
1809
- "capabilities": {
1810
- "inputCapabilities": {
1811
- "text": true,
1812
- "image": {
1813
- "multipleImages": false,
1814
- "requiresUpload": true
1815
- }
1816
- },
1817
- "outputCapabilities": {
1818
- "image": {
1819
- "aspectRatios": [
1820
- "1:1"
1821
- ]
1822
- }
1823
- }
1824
- },
1825
- "name": "qwen-image-edit"
1826
- },
1827
- {
1828
- "id": "ee39672b-d216-4bf4-b639-00469c4f886d",
1829
- "publicName": "qwen-image-edit-fal",
1830
- "organization": "alibaba",
1831
- "provider": "alibaba",
1832
- "capabilities": {
1833
- "inputCapabilities": {
1834
- "text": true,
1835
- "image": {
1836
- "multipleImages": false,
1837
- "requiresUpload": true
1838
- }
1839
- },
1840
- "outputCapabilities": {
1841
- "image": {
1842
- "aspectRatios": [
1843
- "1:1"
1844
- ]
1845
- }
1846
- }
1847
- },
1848
- "name": "qwen-image-edit-fal"
1849
- },
1850
- {
1851
- "id": "d14d9b23-1e46-4659-b157-a3804ba7e2ef",
1852
- "publicName": "gpt-5-search",
1853
- "organization": "openai",
1854
- "provider": "openai",
1855
- "capabilities": {
1856
- "inputCapabilities": {
1857
- "text": true
1858
- },
1859
- "outputCapabilities": {
1860
- "search": true
1861
- }
1862
- },
1863
- "name": "gpt-5-search"
1864
- },
1865
- {
1866
- "id": "23848331-9f93-404f-85f0-3c3b4ece177e",
1867
- "publicName": "mai-1-preview",
1868
- "organization": "microsoft-ai",
1869
- "provider": "microsoft-ai",
1870
- "capabilities": {
1871
- "inputCapabilities": {
1872
- "text": true
1873
- },
1874
- "outputCapabilities": {
1875
- "text": true
1876
- }
1877
- },
1878
- "name": "mai-1-preview"
1879
- },
1880
- {
1881
- "id": "c382b9c6-d31b-488e-86c1-e84d8427eb30",
1882
- "publicName": "hailuo-02-fast",
1883
- "organization": "minimax",
1884
- "provider": "minimax",
1885
- "capabilities": {
1886
- "inputCapabilities": {
1887
- "text": true,
1888
- "image": {
1889
- "requiresUpload": true
1890
- }
1891
- },
1892
- "outputCapabilities": {
1893
- "video": true
1894
- }
1895
- },
1896
- "name": "hailuo-02-fast"
1897
- },
1898
- {
1899
- "id": "13ce11ba-def2-4c80-a70b-b0b2c14d293e",
1900
- "publicName": "seedance-v1-lite",
1901
- "organization": "bytedance",
1902
- "provider": "bytedance",
1903
- "capabilities": {
1904
- "inputCapabilities": {
1905
- "text": true
1906
- },
1907
- "outputCapabilities": {
1908
- "video": true
1909
- }
1910
- },
1911
- "name": "seedance-v1-lite"
1912
- },
1913
- {
1914
- "id": "0754baa1-ab91-42d0-ba74-522aa8e5b8e2",
1915
- "publicName": "runway-gen4-turbo",
1916
- "organization": "runway",
1917
- "provider": "runway",
1918
- "capabilities": {
1919
- "inputCapabilities": {
1920
- "text": true,
1921
- "image": {
1922
- "requiresUpload": true
1923
- }
1924
- },
1925
- "outputCapabilities": {
1926
- "video": true
1927
- }
1928
- },
1929
- "name": "runway-gen4-turbo"
1930
- },
1931
- {
1932
- "id": "efdb7e05-2091-4e88-af9e-4ea6168d2f85",
1933
- "publicName": "kling-v2.1-master",
1934
- "organization": "kling",
1935
- "provider": "kling",
1936
- "capabilities": {
1937
- "inputCapabilities": {
1938
- "text": true,
1939
- "image": {
1940
- "requiresUpload": true
1941
- }
1942
- },
1943
- "outputCapabilities": {
1944
- "video": true
1945
- }
1946
- },
1947
- "name": "kling-v2.1-master"
1948
- },
1949
- {
1950
- "id": "ba8c2392-4c47-42af-bfee-c6c057615a91",
1951
- "publicName": "hunyuan-t1-20250711",
1952
- "organization": "tencent",
1953
- "provider": "tencent",
1954
- "capabilities": {
1955
- "inputCapabilities": {
1956
- "text": true
1957
- },
1958
- "outputCapabilities": {
1959
- "text": true
1960
- }
1961
- },
1962
- "name": "hunyuan-t1-20250711"
1963
- },
1964
- {
1965
- "id": "f4809219-14a8-47fe-9705-8685085513e7",
1966
- "publicName": "mochi-v1",
1967
- "organization": "genmo",
1968
- "provider": "genmo",
1969
- "capabilities": {
1970
- "inputCapabilities": {
1971
- "text": true
1972
- },
1973
- "outputCapabilities": {
1974
- "video": true
1975
- }
1976
- },
1977
- "name": "mochi-v1"
1978
- },
1979
- {
1980
- "id": "e2969ebb-6450-4bc4-87c9-bbdcf95840da",
1981
- "publicName": "seededit-3.0",
1982
- "capabilities": {
1983
- "inputCapabilities": {
1984
- "text": true,
1985
- "image": {
1986
- "multipleImages": false,
1987
- "requiresUpload": true
1988
- }
1989
- },
1990
- "outputCapabilities": {
1991
- "image": {
1992
- "aspectRatios": [
1993
- "1:1"
1994
- ]
1995
- }
1996
- }
1997
- },
1998
- "name": "seededit-3.0"
1999
- },
2000
- {
2001
- "id": "71023e9b-7361-498a-b6db-f2d2a83883fd",
2002
- "publicName": "tahoe",
2003
- "capabilities": {
2004
- "inputCapabilities": {
2005
- "text": true
2006
- },
2007
- "outputCapabilities": {
2008
- "text": true
2009
- }
2010
- },
2011
- "name": "tahoe"
2012
- },
2013
- {
2014
- "id": "32bff2df-00e6-409b-ad3f-bfbad87cc49f",
2015
- "publicName": "hidream-e1.1",
2016
- "capabilities": {
2017
- "inputCapabilities": {
2018
- "text": true,
2019
- "image": {
2020
- "multipleImages": false,
2021
- "requiresUpload": true
2022
- }
2023
- },
2024
- "outputCapabilities": {
2025
- "image": {
2026
- "aspectRatios": [
2027
- "1:1"
2028
- ]
2029
- }
2030
- }
2031
- },
2032
- "name": "hidream-e1.1"
2033
- },
2034
- {
2035
- "id": "264e6e2f-b66a-4e27-a859-8145ff32d6f6",
2036
- "publicName": "wan-v2.2-a14b",
2037
- "organization": "alibaba",
2038
- "provider": "alibaba",
2039
- "capabilities": {
2040
- "inputCapabilities": {
2041
- "text": true
2042
- },
2043
- "outputCapabilities": {
2044
- "video": true
2045
- }
2046
- },
2047
- "name": "wan-v2.2-a14b"
2048
- },
2049
- {
2050
- "id": "7a55108b-b997-4cff-a72f-5aa83beee918",
2051
- "publicName": "gemini-2.0-flash-001",
2052
- "organization": "google",
2053
- "provider": "google",
2054
- "capabilities": {
2055
- "inputCapabilities": {
2056
- "text": true,
2057
- "image": true
2058
- },
2059
- "outputCapabilities": {
2060
- "text": true
2061
- }
2062
- },
2063
- "name": "gemini-2.0-flash-001"
2064
- },
2065
- {
2066
- "id": "3a91bb37-39fb-471c-8aa2-a89b98d280d0",
2067
- "publicName": "wan-v2.2-a14b",
2068
- "organization": "alibaba",
2069
- "provider": "alibaba",
2070
- "capabilities": {
2071
- "inputCapabilities": {
2072
- "text": true,
2073
- "image": {
2074
- "requiresUpload": true
2075
- }
2076
- },
2077
- "outputCapabilities": {
2078
- "video": true
2079
- }
2080
- },
2081
- "name": "wan-v2.2-a14b"
2082
- },
2083
- {
2084
- "id": "f44e280a-7914-43ca-a25d-ecfcc5d48d09",
2085
- "publicName": "claude-3-5-sonnet-20241022",
2086
- "organization": "anthropic",
2087
- "provider": "anthropic",
2088
- "capabilities": {
2089
- "inputCapabilities": {
2090
- "text": true
2091
- },
2092
- "outputCapabilities": {
2093
- "text": true
2094
- }
2095
- },
2096
- "name": "claude-3-5-sonnet-20241022"
2097
- },
2098
- {
2099
- "id": "c28823c1-40fd-4eaf-9825-e28f11d1f8b2",
2100
- "publicName": "llama-4-scout-17b-16e-instruct",
2101
- "organization": "meta",
2102
- "provider": "meta",
2103
- "capabilities": {
2104
- "inputCapabilities": {
2105
- "text": true,
2106
- "image": true
2107
- },
2108
- "outputCapabilities": {
2109
- "text": true
2110
- }
2111
- },
2112
- "name": "llama-4-scout-17b-16e-instruct"
2113
- },
2114
- {
2115
- "id": "9217ac2d-91bc-4391-aa07-b8f9e2cf11f2",
2116
- "publicName": "menlo",
2117
- "capabilities": {
2118
- "inputCapabilities": {
2119
- "text": true
2120
- },
2121
- "outputCapabilities": {
2122
- "search": true
2123
- }
2124
- },
2125
- "name": "menlo"
2126
- },
2127
- {
2128
- "id": "49bd7403-c7fd-4d91-9829-90a91906ad6c",
2129
- "publicName": "llama-4-maverick-03-26-experimental",
2130
- "organization": "meta",
2131
- "provider": "meta",
2132
- "capabilities": {
2133
- "inputCapabilities": {
2134
- "text": true
2135
- },
2136
- "outputCapabilities": {
2137
- "text": true
2138
- }
2139
- },
2140
- "name": "llama-4-maverick-03-26-experimental"
2141
- },
2142
- {
2143
- "id": "885976d3-d178-48f5-a3f4-6e13e0718872",
2144
- "publicName": "qwq-32b",
2145
- "organization": "alibaba",
2146
- "provider": "alibaba",
2147
- "capabilities": {
2148
- "inputCapabilities": {
2149
- "text": true
2150
- },
2151
- "outputCapabilities": {
2152
- "text": true
2153
- }
2154
- },
2155
- "name": "qwq-32b"
2156
- },
2157
- {
2158
- "id": "69f5d38a-45f5-4d3a-9320-b866a4035ed9",
2159
- "publicName": "mistral-small-3.1-24b-instruct-2503",
2160
- "organization": "mistral",
2161
- "provider": "mistral",
2162
- "capabilities": {
2163
- "inputCapabilities": {
2164
- "text": true,
2165
- "image": true
2166
- },
2167
- "outputCapabilities": {
2168
- "text": true
2169
- }
2170
- },
2171
- "name": "mistral-small-3.1-24b-instruct-2503"
2172
- },
2173
- {
2174
- "id": "789e245f-eafe-4c72-b563-d135e93988fc",
2175
- "publicName": "gemma-3-27b-it",
2176
- "organization": "google",
2177
- "provider": "google",
2178
- "capabilities": {
2179
- "inputCapabilities": {
2180
- "text": true,
2181
- "image": true
2182
- },
2183
- "outputCapabilities": {
2184
- "text": true
2185
- }
2186
- },
2187
- "name": "gemma-3-27b-it"
2188
- },
2189
- {
2190
- "id": "14e9311c-94d2-40c2-8c54-273947e208b0",
2191
- "publicName": "gpt-4.1-2025-04-14",
2192
- "organization": "openai",
2193
- "provider": "openai",
2194
- "capabilities": {
2195
- "inputCapabilities": {
2196
- "text": true,
2197
- "image": true
2198
- },
2199
- "outputCapabilities": {
2200
- "text": true
2201
- }
2202
- },
2203
- "name": "gpt-4.1-2025-04-14"
2204
- },
2205
- {
2206
- "id": "b6a05a03-88db-4d2b-bb10-41ddea0f27d6",
2207
- "publicName": "catalina",
2208
- "capabilities": {
2209
- "inputCapabilities": {
2210
- "text": true
2211
- },
2212
- "outputCapabilities": {
2213
- "text": true
2214
- }
2215
- },
2216
- "name": "catalina"
2217
- }
2218
- ]
2219
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/multiple.har DELETED
@@ -1,472 +0,0 @@
1
- {
2
- "log": {
3
- "version": "1.2",
4
- "creator": {
5
- "name": "Zen",
6
- "version": "1.17.4b"
7
- },
8
- "browser": {
9
- "name": "Zen",
10
- "version": "1.17.4b"
11
- },
12
- "pages": [
13
- {
14
- "id": "page_2",
15
- "pageTimings": {
16
- "onContentLoad": -1,
17
- "onLoad": -1
18
- },
19
- "startedDateTime": "2025-11-05T16:10:02.891+10:30",
20
- "title": "https://lmarena.ai/c/019a5281-4db4-7a93-893c-bebca39ea8d5"
21
- }
22
- ],
23
- "entries": [
24
- {
25
- "startedDateTime": "2025-11-05T16:10:02.891+10:30",
26
- "request": {
27
- "bodySize": 2700,
28
- "method": "POST",
29
- "url": "https://lmarena.ai/nextjs-api/stream/create-evaluation",
30
- "httpVersion": "HTTP/2",
31
- "headers": [
32
- {
33
- "name": "Host",
34
- "value": "lmarena.ai"
35
- },
36
- {
37
- "name": "User-Agent",
38
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
39
- },
40
- {
41
- "name": "Accept",
42
- "value": "*/*"
43
- },
44
- {
45
- "name": "Accept-Language",
46
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
47
- },
48
- {
49
- "name": "Accept-Encoding",
50
- "value": "gzip, deflate, br, zstd"
51
- },
52
- {
53
- "name": "Referer",
54
- "value": "https://lmarena.ai/c/019a5287-4db3-7be6-8a47-5e60754b9488"
55
- },
56
- {
57
- "name": "Content-Type",
58
- "value": "text/plain;charset=UTF-8"
59
- },
60
- {
61
- "name": "Content-Length",
62
- "value": "2700"
63
- },
64
- {
65
- "name": "Origin",
66
- "value": "https://lmarena.ai"
67
- },
68
- {
69
- "name": "DNT",
70
- "value": "1"
71
- },
72
- {
73
- "name": "Sec-GPC",
74
- "value": "1"
75
- },
76
- {
77
- "name": "Connection",
78
- "value": "keep-alive"
79
- },
80
- {
81
- "name": "Cookie",
82
- "value": "cf_clearance=AOlGnpqWmmKdKEP2yMG8KM92VUO.88kaU5SE0AZU.Og-1762320770-1.2.1.1-9BYUo7obh7vV6a05X8zGCryARvYNU54Se06Ta7BKYC6jg.sgp_W0JOzV_oOXNj7umxTT1awLJsdn842khahJC7Tc2.v3BkXziX6YKO.RmlJSEZNczkfCZroSUPeucvPjYumMcZNGBWGwcorhySiFn.EctFLfxr3ukEDhmpPSoKi7cWzc8UAPCTL3ukefTWdegaD71N5bWppjkpeH1ZJHOwh56biHVUQUm26LzZMkw6M; sidebar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W5fdHlwZSI6ImJlYXJlciIsImV4cGlyZXNfaW4iOjM2MDAsImV4cGlyZXNfYXQiOjE3NjIzMjQzNjcsInJlZnJlc2hfdG9rZW4iOiJnM2ZmbmRvcTI2emsiLCJ1c2VyIjp7ImlkIjoiZTFkNWJjY2ItZWFhNi00ZGM3LWFjNzctMGU2MGNlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNTozMjo0Ny45OTE1OTRaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0; ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog=%7B%22distinct_id%22%3A%22019a42cc-921e-74d4-b305-fbf75305f6a4%22%2C%22%24sesid%22%3A%5B1762057303275%2C%22019a42cc-921d-79b7-a7ec-b9e464e2f6ff%22%2C1762057294365%5D%7D; __cf_bm=ewsv6Ef17_1nDmy2m5DD24P16wY3bljqq.zb1zPQaLI-1762320768-1.0.1.1-u7Uel51L9RfvAgaVqzklE6ZRCbV_j8rNXm8PJvxN6RKapiuGnzjjXnmNHRnNo7E28OMD.L.YZJvf2djnjc9pjaIPbnP78OcsG9yyC.tJcmM; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762321202426%2C%22019a5280-e3cd-735c-ae72-a5891eb7f55d%22%2C1762320769997%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A%22%2C%22u%22%3A%22https%3A%2F%2Flmarena.ai%2F%22%7D%7D"
83
- },
84
- {
85
- "name": "Sec-Fetch-Dest",
86
- "value": "empty"
87
- },
88
- {
89
- "name": "Sec-Fetch-Mode",
90
- "value": "cors"
91
- },
92
- {
93
- "name": "Sec-Fetch-Site",
94
- "value": "same-origin"
95
- },
96
- {
97
- "name": "Priority",
98
- "value": "u=4"
99
- },
100
- {
101
- "name": "TE",
102
- "value": "trailers"
103
- }
104
- ],
105
- "cookies": [
106
- {
107
- "name": "cf_clearance",
108
- "value": "AOlGnpqWmmKdKEP2yMG8KM92VUO.88kaU5SE0AZU.Og-1762320770-1.2.1.1-9BYUo7obh7vV6a05X8zGCryARvYNU54Se06Ta7BKYC6jg.sgp_W0JOzV_oOXNj7umxTT1awLJsdn842khahJC7Tc2.v3BkXziX6YKO.RmlJSEZNczkfCZroSUPeucvPjYumMcZNGBWGwcorhySiFn.EctFLfxr3ukEDhmpPSoKi7cWzc8UAPCTL3ukefTWdegaD71N5bWppjkpeH1ZJHOwh56biHVUQUm26LzZMkw6M"
109
- },
110
- {
111
- "name": "sidebar_state",
112
- "value": "true"
113
- },
114
- {
115
- "name": "arena-auth-prod-v1",
116
- "value": "base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlK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NlYjc2ZTE4IiwiYXVkIjoiYXV0aGVudGljYXRlZCIsInJvbGUiOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNTozMjo0Ny45OTE1OTRaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
117
- },
118
- {
119
- "name": "ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog",
120
- "value": "{\"distinct_id\":\"019a42cc-921e-74d4-b305-fbf75305f6a4\",\"$sesid\":[1762057303275,\"019a42cc-921d-79b7-a7ec-b9e464e2f6ff\",1762057294365]}"
121
- },
122
- {
123
- "name": "__cf_bm",
124
- "value": "ewsv6Ef17_1nDmy2m5DD24P16wY3bljqq.zb1zPQaLI-1762320768-1.0.1.1-u7Uel51L9RfvAgaVqzklE6ZRCbV_j8rNXm8PJvxN6RKapiuGnzjjXnmNHRnNo7E28OMD.L.YZJvf2djnjc9pjaIPbnP78OcsG9yyC.tJcmM"
125
- },
126
- {
127
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
128
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762321202426,\"019a5280-e3cd-735c-ae72-a5891eb7f55d\",1762320769997],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
129
- }
130
- ],
131
- "queryString": [],
132
- "headersSize": 3481,
133
- "postData": {
134
- "mimeType": "text/plain;charset=UTF-8",
135
- "params": [],
136
- "text": "{\"id\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"mode\":\"direct\",\"modelAId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"userMessageId\":\"019a5287-7cd2-711e-a44b-da372fa139d5\",\"modelAMessageId\":\"019a5287-7cd3-731e-a2e4-82b761f33cc7\",\"messages\":[{\"id\":\"019a5287-7cd2-711e-a44b-da372fa139d5\",\"role\":\"user\",\"content\":\"First message\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a5287-7cd3-731e-a2e4-82b761f33cc7\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a5287-7cd2-711e-a44b-da372fa139d5\"],\"participantPosition\":\"a\",\"modelId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"evaluationSessionId\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"chat\",\"recaptchaV3Token\":\"0cAFcWeA6tiCP1liFhb1oEbYWTdp4-mkeE9SptSRTFWfQF5giFXUU2_xACZOhzoUOHsZ5UZpQorHc36P19Fg6h6tfmuntuB0Vh83BnoAQCXYwRhoPIbrVzshhW7-h3ZOl0eAgF5VD8Hi3kF5YPARaT9hIH6X7RdaLwRx3kXhYZL8f1KBDDSVClmxB-dNUrvgxElaJisy6fN3IirqNTsNVWwOCB2gG6qHzcYHSnKjv0EOydkWBYr7DaYu3hUfXt72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Dmit4LdxIllJE6Z797rBku5UTZzpYw-Btyk_TB_y5-mTzH8wMGPIJA6YEgwdx_UfCyGFSWbgWTMXp5jyRHCQGbWPJ5GL2pfAtWYHFdAYZuEAGC47yMyioAuE8CFf81wRJKPdYTzxcWZYM44YaXeN5o_MBe7U1GJjBPnfFA5DRT6f4EyEOqet0QZFjAhtTMxk_8Z5JBMommpT7Bvdz_o2dQTha28Eu2ovhzGDS3uzanoXJgFqyDdtkl0lwmDzNBmOX9rCF981-w_R96NrgxhaF2ynoHhhj5wm5VKWoi8ymWGf2JW38eYql9AgZWT7kbOvxMqi2ksPhtmYwYMjKwwuVp0zqm8z8m5nvz_lblLtOH_VISjT3L4JC6ymz3JPj_IrQOKHMHBixlC3ZKUghJnDMTgllZyoxrNvuf0YsEkJpM85kaaRI8AtEEVi1vupdIioWw8qLBXj4W0\"}"
137
- }
138
- },
139
- "response": {
140
- "status": 200,
141
- "statusText": "",
142
- "httpVersion": "HTTP/2",
143
- "headers": [
144
- {
145
- "name": "date",
146
- "value": "Wed, 05 Nov 2025 05:40:14 GMT"
147
- },
148
- {
149
- "name": "content-type",
150
- "value": "text/event-stream"
151
- },
152
- {
153
- "name": "server",
154
- "value": "cloudflare"
155
- },
156
- {
157
- "name": "cf-ray",
158
- "value": "999a03a38e2bed73-ADL"
159
- },
160
- {
161
- "name": "cf-cache-status",
162
- "value": "DYNAMIC"
163
- },
164
- {
165
- "name": "access-control-allow-origin",
166
- "value": "*"
167
- },
168
- {
169
- "name": "cache-control",
170
- "value": "no-cache"
171
- },
172
- {
173
- "name": "strict-transport-security",
174
- "value": "max-age=63072000; includeSubDomains; preload"
175
- },
176
- {
177
- "name": "vary",
178
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
179
- },
180
- {
181
- "name": "ratelimit",
182
- "value": "limit=3000, remaining=2999, reset=60"
183
- },
184
- {
185
- "name": "ratelimit-policy",
186
- "value": "3000;w=300"
187
- },
188
- {
189
- "name": "x-content-type-options",
190
- "value": "nosniff"
191
- },
192
- {
193
- "name": "x-matched-path",
194
- "value": "/nextjs-api/stream/create-evaluation"
195
- },
196
- {
197
- "name": "x-request-id",
198
- "value": "edbebfb6-3fbc-4b90-a1db-5009224aa790"
199
- },
200
- {
201
- "name": "x-vercel-cache",
202
- "value": "MISS"
203
- },
204
- {
205
- "name": "x-vercel-id",
206
- "value": "syd1:syd1:sfo1::sfo1::sfo1::72f4m-1762321203819-7ea33e513fc2"
207
- },
208
- {
209
- "name": "x-vercel-request-id",
210
- "value": "edbebfb6-3fbc-4b90-a1db-5009224aa790"
211
- },
212
- {
213
- "name": "alt-svc",
214
- "value": "h3=\":443\"; ma=86400"
215
- },
216
- {
217
- "name": "X-Firefox-Spdy",
218
- "value": "h2"
219
- }
220
- ],
221
- "cookies": [],
222
- "content": {
223
- "mimeType": "text/event-stream",
224
- "size": 119,
225
- "text": "a0:\"Hello! \"\na0:\"Welcome.\\n\\n\"\na0:\"How \"\na0:\"can \"\na0:\"I \"\na0:\"help \"\na0:\"you \"\na0:\"today?\"\nad:{\"finishReason\":\"stop\"}\n"
226
- },
227
- "redirectURL": "",
228
- "headersSize": 819,
229
- "bodySize": 938
230
- },
231
- "cache": {},
232
- "timings": {
233
- "blocked": -1,
234
- "dns": 0,
235
- "connect": 0,
236
- "ssl": 0,
237
- "send": 0,
238
- "wait": 11140,
239
- "receive": 0
240
- },
241
- "time": 11140,
242
- "_securityState": "secure",
243
- "serverIPAddress": "104.18.20.173",
244
- "connection": "443",
245
- "pageref": "page_2"
246
- },
247
- {
248
- "startedDateTime": "2025-11-05T16:10:22.810+10:30",
249
- "request": {
250
- "bodySize": 3422,
251
- "method": "POST",
252
- "url": "https://lmarena.ai/nextjs-api/stream/post-to-evaluation/019a5287-4db3-7be6-8a47-5e60754b9488",
253
- "httpVersion": "HTTP/2",
254
- "headers": [
255
- {
256
- "name": "Host",
257
- "value": "lmarena.ai"
258
- },
259
- {
260
- "name": "User-Agent",
261
- "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0"
262
- },
263
- {
264
- "name": "Accept",
265
- "value": "*/*"
266
- },
267
- {
268
- "name": "Accept-Language",
269
- "value": "en-AU,en-GB;q=0.7,en;q=0.3"
270
- },
271
- {
272
- "name": "Accept-Encoding",
273
- "value": "gzip, deflate, br, zstd"
274
- },
275
- {
276
- "name": "Referer",
277
- "value": "https://lmarena.ai/c/019a5287-4db3-7be6-8a47-5e60754b9488"
278
- },
279
- {
280
- "name": "Content-Type",
281
- "value": "text/plain;charset=UTF-8"
282
- },
283
- {
284
- "name": "Content-Length",
285
- "value": "3422"
286
- },
287
- {
288
- "name": "Origin",
289
- "value": "https://lmarena.ai"
290
- },
291
- {
292
- "name": "DNT",
293
- "value": "1"
294
- },
295
- {
296
- "name": "Sec-GPC",
297
- "value": "1"
298
- },
299
- {
300
- "name": "Connection",
301
- "value": "keep-alive"
302
- },
303
- {
304
- "name": "Cookie",
305
- "value": "cf_clearance=AOlGnpqWmmKdKEP2yMG8KM92VUO.88kaU5SE0AZU.Og-1762320770-1.2.1.1-9BYUo7obh7vV6a05X8zGCryARvYNU54Se06Ta7BKYC6jg.sgp_W0JOzV_oOXNj7umxTT1awLJsdn842khahJC7Tc2.v3BkXziX6YKO.RmlJSEZNczkfCZroSUPeucvPjYumMcZNGBWGwcorhySiFn.EctFLfxr3ukEDhmpPSoKi7cWzc8UAPCTL3ukefTWdegaD71N5bWppjkpeH1ZJHOwh56biHVUQUm26LzZMkw6M; sidebar_state=true; arena-auth-prod-v1=base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpvZEhSd2N6b3ZMMmgxYjJkNmIyVnhlbU55Wkh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iOiJhdXRoZW50aWNhdGVkIiwiZW1haWwiOiIiLCJwaG9uZSI6IiIsImxhc3Rfc2lnbl9pbl9hdCI6IjIwMjUtMTEtMDFUMjI6NTg6NDYuNjQ3MTI4WiIsImFwcF9tZXRhZGF0YSI6e30sInVzZXJfbWV0YWRhdGEiOnsiaWQiOiI5YmM4NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNTozMjo0Ny45OTE1OTRaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0; ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog=%7B%22distinct_id%22%3A%22019a42cc-921e-74d4-b305-fbf75305f6a4%22%2C%22%24sesid%22%3A%5B1762057303275%2C%22019a42cc-921d-79b7-a7ec-b9e464e2f6ff%22%2C1762057294365%5D%7D; __cf_bm=ewsv6Ef17_1nDmy2m5DD24P16wY3bljqq.zb1zPQaLI-1762320768-1.0.1.1-u7Uel51L9RfvAgaVqzklE6ZRCbV_j8rNXm8PJvxN6RKapiuGnzjjXnmNHRnNo7E28OMD.L.YZJvf2djnjc9pjaIPbnP78OcsG9yyC.tJcmM; ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog=%7B%22distinct_id%22%3A%229bc84c01-7a60-496b-9130-227aab812129%22%2C%22%24sesid%22%3A%5B1762321222458%2C%22019a5280-e3cd-735c-ae72-a5891eb7f55d%22%2C1762320769997%5D%2C%22%24epp%22%3Atrue%2C%22%24initial_person_info%22%3A%7B%22r%22%3A%22https%3A%2F%2Flmarena.ai%2F%3F__cf_chl_tk%3D.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A%22%2C%22u%22%3A%22https%3A%2F%2Flmarena.ai%2F%22%7D%7D"
306
- },
307
- {
308
- "name": "Sec-Fetch-Dest",
309
- "value": "empty"
310
- },
311
- {
312
- "name": "Sec-Fetch-Mode",
313
- "value": "cors"
314
- },
315
- {
316
- "name": "Sec-Fetch-Site",
317
- "value": "same-origin"
318
- },
319
- {
320
- "name": "Priority",
321
- "value": "u=4"
322
- },
323
- {
324
- "name": "TE",
325
- "value": "trailers"
326
- }
327
- ],
328
- "cookies": [
329
- {
330
- "name": "cf_clearance",
331
- "value": "AOlGnpqWmmKdKEP2yMG8KM92VUO.88kaU5SE0AZU.Og-1762320770-1.2.1.1-9BYUo7obh7vV6a05X8zGCryARvYNU54Se06Ta7BKYC6jg.sgp_W0JOzV_oOXNj7umxTT1awLJsdn842khahJC7Tc2.v3BkXziX6YKO.RmlJSEZNczkfCZroSUPeucvPjYumMcZNGBWGwcorhySiFn.EctFLfxr3ukEDhmpPSoKi7cWzc8UAPCTL3ukefTWdegaD71N5bWppjkpeH1ZJHOwh56biHVUQUm26LzZMkw6M"
332
- },
333
- {
334
- "name": "sidebar_state",
335
- "value": "true"
336
- },
337
- {
338
- "name": "arena-auth-prod-v1",
339
- "value": "base64-eyJhY2Nlc3NfdG9rZW4iOiJleUpoYkdjaU9pSkZVekkxTmlJc0ltdHBaQ0k2SWpBNVlUSTNPVFl6TFRjek5tWXROR00wWmkwNU5HSXlMV0ptWXpSaU1XSTJNV1k0T0NJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUpvZEhSd2N6b3ZMMmgxYjJkNmIyVnhlbU55WkhacmQzUjJiMlJwTG5OMWNHRmlZWE5sTG1OdkwyRjFkR2d2ZGpFaUxDSnpkV0lpT2lKbE1XUTFZbU5qWWkxbFlXRTJMVFJrWXpjdFlXTTNOeTB3WlRZd1kyVmlOelpsTVRnaUxDSmhkV1FpT2lKaGRYUm9aVzUwYVdOaGRHVmtJaXdpW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NGMwMS03YTYwLTQ5NmItOTEzMC0yMjdhYWI4MTIxMjkifSwiaWRlbnRpdGllcyI6W10sImNyZWF0ZWRfYXQiOiIyMDI1LTExLTAxVDIyOjU4OjQ2LjY0NTgxM1oiLCJ1cGRhdGVkX2F0IjoiMjAyNS0xMS0wNVQwNTozMjo0Ny45OTE1OTRaIiwiaXNfYW5vbnltb3VzIjp0cnVlfX0"
340
- },
341
- {
342
- "name": "ph_phc_YDG5hLiq6kyzVQVWFL9SGhRoHfQKTCu09FVPZtgmk1y_posthog",
343
- "value": "{\"distinct_id\":\"019a42cc-921e-74d4-b305-fbf75305f6a4\",\"$sesid\":[1762057303275,\"019a42cc-921d-79b7-a7ec-b9e464e2f6ff\",1762057294365]}"
344
- },
345
- {
346
- "name": "__cf_bm",
347
- "value": "ewsv6Ef17_1nDmy2m5DD24P16wY3bljqq.zb1zPQaLI-1762320768-1.0.1.1-u7Uel51L9RfvAgaVqzklE6ZRCbV_j8rNXm8PJvxN6RKapiuGnzjjXnmNHRnNo7E28OMD.L.YZJvf2djnjc9pjaIPbnP78OcsG9yyC.tJcmM"
348
- },
349
- {
350
- "name": "ph_phc_LG7IJbVJqBsk584rbcKca0D5lV2vHguiijDrVji7yDM_posthog",
351
- "value": "{\"distinct_id\":\"9bc84c01-7a60-496b-9130-227aab812129\",\"$sesid\":[1762321222458,\"019a5280-e3cd-735c-ae72-a5891eb7f55d\",1762320769997],\"$epp\":true,\"$initial_person_info\":{\"r\":\"https://lmarena.ai/?__cf_chl_tk=.2t83kc257tZUZ8W4Cfi6acnan52tGM2yzdCbTNrmus-1757143716-1.0.1.1-FlrvTJYpw0CweeoimQpS4hsn9lEXFMdNeFYhJJk3h3A\",\"u\":\"https://lmarena.ai/\"}}"
352
- }
353
- ],
354
- "queryString": [],
355
- "headersSize": 3519,
356
- "postData": {
357
- "mimeType": "text/plain;charset=UTF-8",
358
- "params": [],
359
- "text": "{\"id\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"mode\":\"direct\",\"modelAId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"userMessageId\":\"019a5287-cb3a-7b4e-a0fd-bb5b74aace99\",\"modelAMessageId\":\"019a5287-cb3a-7321-be9b-ddb1130cbd87\",\"messages\":[{\"id\":\"019a5287-7cd2-711e-a44b-da372fa139d5\",\"role\":\"user\",\"content\":\"First message\",\"experimental_attachments\":[],\"parentMessageIds\":[],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a5287-7cd3-731e-a2e4-82b761f33cc7\",\"role\":\"assistant\",\"content\":\"Hello! Welcome.\\n\\nHow can I help you today?\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a5287-7cd2-711e-a44b-da372fa139d5\"],\"participantPosition\":\"a\",\"modelId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"evaluationSessionId\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"status\":\"success\",\"failureReason\":null},{\"id\":\"019a5287-cb3a-7b4e-a0fd-bb5b74aace99\",\"role\":\"user\",\"content\":\"Second message\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a5287-7cd3-731e-a2e4-82b761f33cc7\"],\"participantPosition\":\"a\",\"modelId\":null,\"evaluationSessionId\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"status\":\"pending\",\"failureReason\":null},{\"id\":\"019a5287-cb3a-7321-be9b-ddb1130cbd87\",\"role\":\"assistant\",\"content\":\"\",\"reasoning\":\"\",\"experimental_attachments\":[],\"parentMessageIds\":[\"019a5287-cb3a-7b4e-a0fd-bb5b74aace99\"],\"participantPosition\":\"a\",\"modelId\":\"0199f060-b306-7e1f-aeae-0ebb4e3f1122\",\"evaluationSessionId\":\"019a5287-4db3-7be6-8a47-5e60754b9488\",\"status\":\"pending\",\"failureReason\":null}],\"modality\":\"chat\",\"recaptchaV3Token\":\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SynfqAgH8KFRhKSMTJFb9DZR5mAz2PhhSFP4aFxtdiRVyPBHwTNEC-tiwteAVnEwhVHHCNp_-mfAekusBpdqUd8ED_KGf9blxtd1FmbQXFd-0Pha3Srg7H8SO3lY1_KEp7vg7dRYMCcpy2ZMqCgbF0P1EQXYOI_nlefzMxcoaS8iCRziaijB-6GizdvunmkmX8kJz-JbTWc9HHM_f0mtSDOBIpuOqgPGUr0kLqGYj0YhxRjj9rA9uuCOTk_rJKmm1HY8M7C6UfUnt9gI91-m5ceqy2rynnBo6WnwmGl721qpFLRno2I5Nw-PMJenKv1X1c3Iz_6GwTeB4Xd16DqC-2PRJj-45W0DNamEeFeS8XSTVlbmxLoB7F0-ggzYzcJoj7LrGlGqE4XWTwqQJsLTFu6XR3AnERSaFaPGnXtaiTgjg3FUB9ySoI2rMI8mfMlYN-XWrYTA9yU62QoSmrUN5XX0rlNE5_Ap3I48xfPlChjFEdc3QwGl2zVU15aDTf2KQpqgvvaUKGsFGG6U9jEBYuyYapysorMAddpVeYCri55G73BvKttV4qPDLct6pk6O2DG83KeDny1wm7CaV6mCgWTLo0lOny2t2yN9ay5Kclr8bQ7-jg_D1aCigCfIozeiVtdlGYSuEUNu136Jl0MTF2AU4Yp-rP3kjkku_b7McQzEZB5jvKI7LWMySPWnpeY\"}"
360
- }
361
- },
362
- "response": {
363
- "status": 200,
364
- "statusText": "",
365
- "httpVersion": "HTTP/2",
366
- "headers": [
367
- {
368
- "name": "date",
369
- "value": "Wed, 05 Nov 2025 05:40:43 GMT"
370
- },
371
- {
372
- "name": "content-type",
373
- "value": "text/event-stream"
374
- },
375
- {
376
- "name": "server",
377
- "value": "cloudflare"
378
- },
379
- {
380
- "name": "cf-ray",
381
- "value": "999a04200981ed73-ADL"
382
- },
383
- {
384
- "name": "cf-cache-status",
385
- "value": "DYNAMIC"
386
- },
387
- {
388
- "name": "access-control-allow-origin",
389
- "value": "*"
390
- },
391
- {
392
- "name": "cache-control",
393
- "value": "no-cache"
394
- },
395
- {
396
- "name": "strict-transport-security",
397
- "value": "max-age=63072000; includeSubDomains; preload"
398
- },
399
- {
400
- "name": "vary",
401
- "value": "RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding"
402
- },
403
- {
404
- "name": "ratelimit",
405
- "value": "limit=3000, remaining=2997, reset=40"
406
- },
407
- {
408
- "name": "ratelimit-policy",
409
- "value": "3000;w=300"
410
- },
411
- {
412
- "name": "x-content-type-options",
413
- "value": "nosniff"
414
- },
415
- {
416
- "name": "x-matched-path",
417
- "value": "/nextjs-api/stream/post-to-evaluation/[id]"
418
- },
419
- {
420
- "name": "x-request-id",
421
- "value": "b9652b06-938d-4d4b-bcd7-5b99c5978aa2"
422
- },
423
- {
424
- "name": "x-vercel-cache",
425
- "value": "MISS"
426
- },
427
- {
428
- "name": "x-vercel-id",
429
- "value": "syd1:syd1:sfo1::sfo1::sfo1::8lhzb-1762321223734-bc6522af99b7"
430
- },
431
- {
432
- "name": "x-vercel-request-id",
433
- "value": "b9652b06-938d-4d4b-bcd7-5b99c5978aa2"
434
- },
435
- {
436
- "name": "alt-svc",
437
- "value": "h3=\":443\"; ma=86400"
438
- },
439
- {
440
- "name": "X-Firefox-Spdy",
441
- "value": "h2"
442
- }
443
- ],
444
- "cookies": [],
445
- "content": {
446
- "mimeType": "text/event-stream",
447
- "size": 276,
448
- "text": "a0:\"And \"\na0:\"this \"\na0:\"is \"\na0:\"my \"\na0:\"second \"\na0:\"reply.\\n\\n\"\na0:\"Is \"\na0:\"there \"\na0:\"a \"\na0:\"third \"\na0:\"message \"\na0:\"on \"\na0:\"its \"\na0:\"way, \"\na0:\"or \"\na0:\"is \"\na0:\"there \"\na0:\"something \"\na0:\"I \"\na0:\"can \"\na0:\"help \"\na0:\"you \"\na0:\"with?\"\nad:{\"finishReason\":\"stop\"}\n"
449
- },
450
- "redirectURL": "",
451
- "headersSize": 825,
452
- "bodySize": 1101
453
- },
454
- "cache": {},
455
- "timings": {
456
- "blocked": 1,
457
- "dns": 0,
458
- "connect": 0,
459
- "ssl": 0,
460
- "send": 0,
461
- "wait": 19667,
462
- "receive": 0
463
- },
464
- "time": 19668,
465
- "_securityState": "secure",
466
- "serverIPAddress": "104.18.20.173",
467
- "connection": "443",
468
- "pageref": "page_2"
469
- }
470
- ]
471
- }
472
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/oldscript.js DELETED
@@ -1,1467 +0,0 @@
1
- // ==UserScript==
2
- // @name LMArena Proxy Injector
3
- // @namespace https://github.com/zhongruichen/lmarena-proxy
4
- // @version 1.1.0
5
- // @description A powerful injector script for LMArena reverse proxy, enabling OpenAI-compatible API access.
6
- // @author zhongruichen
7
- // @match https://*.lmarena.ai/*
8
- // @icon https://www.google.com/s2/favicons?sz=64&domain=lmarena.ai
9
- // @grant none
10
- // @run-at document-start
11
- // @all-frames true
12
- // @updateURL https://raw.githubusercontent.com/zhongruichen/lmarena-proxy/main/lmarena_injector.user.js
13
- // @downloadURL https://raw.githubusercontent.com/zhongruichen/lmarena-proxy/main/lmarena_injector.user.js
14
- // ==/UserScript==
15
- (function () {
16
- 'use strict';
17
-
18
- // --- CONFIGURATION ---
19
- // 如果你的代理服务器不在本机运行,请修改此处的 IP 地址。
20
- const CONFIG = {
21
- SERVER_URL: "ws://localhost:9080/ws",
22
- };
23
-
24
- // --- Constants ---
25
- const TARGET_API_PATH = "/api/stream/create-evaluation";
26
- const REQUIRED_COOKIE = "arena-auth-prod-v1";
27
-
28
- // --- State ---
29
- let socket;
30
- let isRefreshing = false;
31
- let pendingRequests = [];
32
- let modelRegistrySent = false;
33
- let latestTurnstileToken = null;
34
-
35
- // Track active fetch requests for abort capability
36
- const activeFetchControllers = new Map(); // requestId -> AbortController
37
-
38
- // --- Human-like Click Simulation ---
39
- function simulateHumanClick() {
40
- // Get viewport dimensions
41
- const viewportWidth = window.innerWidth;
42
- const viewportHeight = window.innerHeight;
43
-
44
- // Calculate center area with some randomness (within 10% of center)
45
- const centerX = viewportWidth / 2;
46
- const centerY = viewportHeight / 2;
47
- const randomOffsetX = (Math.random() - 0.5) * (viewportWidth * 0.1);
48
- const randomOffsetY = (Math.random() - 0.5) * (viewportHeight * 0.1);
49
-
50
- const clickX = Math.round(centerX + randomOffsetX);
51
- const clickY = Math.round(centerY + randomOffsetY);
52
-
53
- // Ensure click is within viewport bounds
54
- const finalX = Math.max(10, Math.min(viewportWidth - 10, clickX));
55
- const finalY = Math.max(10, Math.min(viewportHeight - 10, clickY));
56
-
57
- console.log(`[Auth] 🖱️ Simulating human-like click at (${finalX}, ${finalY})`);
58
-
59
- // Create and dispatch mouse events to simulate human interaction
60
- const target = document.elementFromPoint(finalX, finalY) || document.body;
61
-
62
- // Simulate mouse down, up, and click with slight delays
63
- const mouseDown = new MouseEvent('mousedown', {
64
- bubbles: true,
65
- cancelable: true,
66
- clientX: finalX,
67
- clientY: finalY,
68
- button: 0
69
- });
70
-
71
- const mouseUp = new MouseEvent('mouseup', {
72
- bubbles: true,
73
- cancelable: true,
74
- clientX: finalX,
75
- clientY: finalY,
76
- button: 0
77
- });
78
-
79
- const click = new MouseEvent('click', {
80
- bubbles: true,
81
- cancelable: true,
82
- clientX: finalX,
83
- clientY: finalY,
84
- button: 0
85
- });
86
-
87
- // Dispatch events with human-like timing
88
- target.dispatchEvent(mouseDown);
89
- setTimeout(() => {
90
- target.dispatchEvent(mouseUp);
91
- setTimeout(() => {
92
- target.dispatchEvent(click);
93
- }, Math.random() * 20 + 10); // 10-30ms delay
94
- }, Math.random() * 50 + 50); // 50-100ms delay
95
- }
96
-
97
- // --- Turnstile Token Capture (Stealth Integration) ---
98
- console.log('[Auth] Setting up Turnstile token capture...');
99
-
100
- // Store the original native function
101
- const originalCreateElement = document.createElement;
102
-
103
- // Overwrite the function with our temporary trap
104
- document.createElement = function(...args) {
105
- // Run the original function to create the element
106
- const element = originalCreateElement.apply(this, args);
107
-
108
- // Only interested in SCRIPT tags
109
- if (element.tagName === 'SCRIPT') {
110
- // Use a different approach - override setAttribute instead of src property
111
- const originalSetAttribute = element.setAttribute;
112
- element.setAttribute = function(name, value) {
113
- // Call the original setAttribute first
114
- originalSetAttribute.call(this, name, value);
115
-
116
- // If it's setting the src attribute and it's the turnstile script
117
- if (name === 'src' && value && value.includes('challenges.cloudflare.com/turnstile')) {
118
- console.log('[Auth] Turnstile SCRIPT tag found! Adding load listener.');
119
-
120
- // Add our 'load' event listener to hook the object AFTER execution
121
- element.addEventListener('load', function() {
122
- console.log('[Auth] Turnstile script has loaded. Now safe to hook turnstile.render().');
123
- if (window.turnstile) {
124
- hookTurnstileRender(window.turnstile);
125
- }
126
- });
127
-
128
- // --- THIS IS THE CRITICAL STEP ---
129
- // We have found our target, so we restore the original function immediately.
130
- console.log('[Auth] Trap is no longer needed. Restoring original document.createElement.');
131
- document.createElement = originalCreateElement;
132
- }
133
- };
134
- }
135
- return element;
136
- };
137
-
138
- function hookTurnstileRender(turnstile) {
139
- const originalRender = turnstile.render;
140
- turnstile.render = function(container, params) {
141
- console.log('[Auth] Intercepted turnstile.render() call.');
142
- const originalCallback = params.callback;
143
- params.callback = (token) => {
144
- handleTurnstileToken(token);
145
- if (originalCallback) return originalCallback(token);
146
- };
147
- return originalRender(container, params);
148
- };
149
- }
150
-
151
- function handleTurnstileToken(token) {
152
- latestTurnstileToken = token;
153
- const message = `✅ Cloudflare Turnstile Token Captured: ${token}`;
154
- console.log('%c' + message, 'color: #28a745; font-weight: bold;');
155
-
156
- console.log('[Auth] Fresh Turnstile token captured and ready for use.');
157
- }
158
-
159
- // Define the Turnstile onload callback function globally
160
- window.onloadTurnstileCallback = function() {
161
- console.log('[Auth] 🎯 Turnstile onload callback triggered');
162
- if (window.turnstile) {
163
- console.log('[Auth] 🔧 Turnstile object available, setting up hooks...');
164
- hookTurnstileRender(window.turnstile);
165
-
166
- // Create a hidden Turnstile widget to generate a token
167
- setTimeout(() => {
168
- createHiddenTurnstileWidget();
169
- }, 1000); // Wait a bit for hooks to be fully set up
170
- } else {
171
- console.warn('[Auth] ⚠️ Turnstile object not available in onload callback');
172
- }
173
- };
174
-
175
- function extractTurnstileSitekey() {
176
- // Use known LMArena sitekey directly
177
- const sitekey = '0x4AAAAAAA65vWDmG-O_lPtT';
178
- console.log('[Auth] 🔑 Using LMArena sitekey:', sitekey);
179
- return sitekey;
180
- }
181
-
182
- function createHiddenTurnstileWidget() {
183
- try {
184
- console.log('[Auth] 🎯 Creating hidden Turnstile widget to generate token...');
185
-
186
- // Extract the correct sitekey from the page
187
- const sitekey = extractTurnstileSitekey();
188
- if (!sitekey) {
189
- console.error('[Auth] ❌ Cannot create Turnstile widget: no sitekey found');
190
- return;
191
- }
192
-
193
- // Create a hidden container for the Turnstile widget
194
- const container = document.createElement('div');
195
- container.id = 'hidden-turnstile-widget';
196
- container.style.position = 'absolute';
197
- container.style.left = '-9999px';
198
- container.style.top = '-9999px';
199
- container.style.width = '300px';
200
- container.style.height = '65px';
201
- container.style.visibility = 'hidden';
202
- container.style.opacity = '0';
203
- container.style.pointerEvents = 'none';
204
-
205
- document.body.appendChild(container);
206
-
207
- // Render the Turnstile widget
208
- if (window.turnstile && window.turnstile.render) {
209
- const widgetId = window.turnstile.render(container, {
210
- sitekey: sitekey,
211
- callback: function(token) {
212
- console.log('[Auth] 🎉 Hidden Turnstile widget generated token!');
213
- handleTurnstileToken(token);
214
- },
215
- 'error-callback': function(error) {
216
- console.warn('[Auth] ⚠️ Hidden Turnstile widget error:', error);
217
- },
218
- 'expired-callback': function() {
219
- console.log('[Auth] ⏰ Hidden Turnstile token expired, creating new widget...');
220
- // Remove old widget and create new one
221
- const oldContainer = document.getElementById('hidden-turnstile-widget');
222
- if (oldContainer) {
223
- oldContainer.remove();
224
- }
225
- setTimeout(createHiddenTurnstileWidget, 1000);
226
- },
227
- theme: 'light',
228
- size: 'normal'
229
- });
230
-
231
- console.log('[Auth] ✅ Hidden Turnstile widget created with ID:', widgetId);
232
- } else {
233
- console.error('[Auth] ❌ Turnstile render function not available');
234
- }
235
- } catch (error) {
236
- console.error('[Auth] ❌ Error creating hidden Turnstile widget:', error);
237
- }
238
- }
239
-
240
- // Consolidated authentication helper functions
241
- async function initializeTurnstileIfNeeded() {
242
- console.log("[Auth] 🔧 Initializing Turnstile API if needed...");
243
-
244
- try {
245
- const script = document.createElement('script');
246
- script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback&render=explicit';
247
- script.async = true;
248
- script.defer = true;
249
-
250
- script.onload = () => {
251
- console.log("[Auth] ✅ Turnstile API script loaded successfully");
252
- };
253
- script.onerror = (error) => {
254
- console.warn("[Auth] ⚠️ Failed to load Turnstile API script:", error);
255
- };
256
-
257
- document.head.appendChild(script);
258
- console.log("[Auth] ✅ Turnstile API script injection initiated");
259
-
260
- // Schedule a human-like click 3 seconds after script injection to avoid bot detection
261
- setTimeout(() => {
262
- simulateHumanClick();
263
- }, 3000 + Math.random() * 1000); // 3-4 seconds with randomness
264
- } catch (error) {
265
- console.warn("[Auth] ⚠️ Failed to initialize Turnstile API:", error.message);
266
- throw error;
267
- }
268
- }
269
-
270
- async function ensureAuthenticationReady(requestId) {
271
- console.log(`[Auth] 🔐 Ensuring authentication is ready for request ${requestId}...`);
272
-
273
- // Check for required authentication cookie first
274
- if (!checkAuthCookie()) {
275
- console.log(`[Auth] ⚠️ Missing auth cookie for request ${requestId}, initiating auth flow...`);
276
-
277
- // Check if we have stored auth data first
278
- let authData = getStoredAuthData();
279
-
280
- if (!authData) {
281
- // No valid stored auth, need to authenticate
282
- // But first, double-check if auth cookie became available
283
- if (checkAuthCookie()) {
284
- console.log(`[Auth] ✅ Auth cookie became available during auth check for request ${requestId} - skipping authentication`);
285
- return; // Auth cookie is now available, no need to authenticate
286
- }
287
-
288
- let turnstileToken = latestTurnstileToken;
289
-
290
- if (!turnstileToken) {
291
- console.log(`[Auth] ⏳ No Turnstile token available yet for request ${requestId}, initializing Turnstile API...`);
292
-
293
- // Initialize Turnstile API if no token is available
294
- await initializeTurnstileIfNeeded();
295
-
296
- console.log(`[Auth] ⏳ Waiting for Turnstile token for request ${requestId}...`);
297
- turnstileToken = await waitForTurnstileToken();
298
-
299
- if (turnstileToken === 'auth_cookie_available') {
300
- console.log(`[Auth] ✅ Auth cookie became available during wait for request ${requestId} - skipping authentication`);
301
- return; // Auth cookie is now available, no need to authenticate
302
- }
303
-
304
- if (!turnstileToken) {
305
- throw new Error("Authentication required: Turnstile token not generated within timeout. Please refresh the page.");
306
- }
307
- }
308
-
309
- console.log(`[Auth] 🔑 Have Turnstile token for request ${requestId}, performing authentication...`);
310
- authData = await performAuthentication(turnstileToken);
311
- }
312
-
313
- console.log(`[Auth] ✅ Authentication complete for request ${requestId}`);
314
- } else {
315
- console.log(`[Auth] ✅ Auth cookie already present for request ${requestId}`);
316
- }
317
- }
318
-
319
- function getCookie(name) {
320
- const value = `; ${document.cookie}`;
321
- const parts = value.split(`; ${name}=`);
322
- if (parts.length === 2) return parts.pop().split(';').shift();
323
- return null;
324
- }
325
-
326
- function checkAuthCookie() {
327
- const authCookie = getCookie(REQUIRED_COOKIE);
328
- if (authCookie) {
329
- console.log(`[Auth] ✅ Found required cookie: ${REQUIRED_COOKIE}`);
330
- return true;
331
- } else {
332
- console.log(`[Auth] ❌ Missing required cookie: ${REQUIRED_COOKIE}`);
333
- return false;
334
- }
335
- }
336
-
337
- async function waitForTurnstileToken(maxWaitTime = 60000) {
338
- console.log(`[Auth] ⏳ Waiting for Turnstile token to be generated...`);
339
-
340
- const checkInterval = 1000; // Check every 1 second
341
- let waitTime = 0;
342
-
343
- while (waitTime < maxWaitTime) {
344
- // Check if auth cookie became available - if so, no need to wait for Turnstile token
345
- if (checkAuthCookie()) {
346
- console.log(`[Auth] ✅ Auth cookie became available during Turnstile wait after ${waitTime}ms - skipping token wait`);
347
- return 'auth_cookie_available';
348
- }
349
-
350
- if (latestTurnstileToken) {
351
- console.log(`[Auth] ✅ Turnstile token available after ${waitTime}ms`);
352
- return latestTurnstileToken;
353
- }
354
-
355
- console.log(`[Auth] ⏳ Still waiting for Turnstile token or auth cookie... (${waitTime}ms elapsed)`);
356
- await new Promise(resolve => setTimeout(resolve, checkInterval));
357
- waitTime += checkInterval;
358
- }
359
-
360
- console.warn(`[Auth] ⚠️ Turnstile token wait timeout after ${maxWaitTime}ms`);
361
- return null;
362
- }
363
-
364
- async function performAuthentication(turnstileToken) {
365
- console.log(`[Auth] 🔐 Starting authentication process with Turnstile token...`);
366
-
367
- try {
368
- // Step 1: Get JWT token from sign-up endpoint
369
- const authResponse = await fetch('https://lmarena.ai/api/sign-up', {
370
- method: 'POST',
371
- headers: {
372
- 'Content-Type': 'text/plain;charset=UTF-8',
373
- 'Accept': '*/*',
374
- // The browser automatically adds critical headers:
375
- // Cookie, User-Agent, Accept-Language, sec-ch-ua, etc.
376
- },
377
- body: JSON.stringify({
378
- turnstile_token: turnstileToken
379
- })
380
- });
381
-
382
- if (!authResponse.ok) {
383
- throw new Error(`Authentication request failed with status ${authResponse.status}`);
384
- }
385
-
386
- const authData = await authResponse.json();
387
- console.log(`[Auth] ✅ Step 1: Received JWT token from sign-up.`);
388
-
389
- // Step 2: Create and set the auth cookie
390
- const cookieValue = `base64-${btoa(JSON.stringify(authData))}`;
391
- document.cookie = `${REQUIRED_COOKIE}=${cookieValue}; path=/; domain=.lmarena.ai; secure; samesite=lax`;
392
- console.log(`[Auth] ✅ Step 2: Set auth cookie in browser.`);
393
-
394
- // Step 3: Make verification request to complete authentication
395
- const verifyResponse = await fetch('https://lmarena.ai/', {
396
- method: 'POST',
397
- headers: {
398
- 'Content-Type': 'text/plain;charset=UTF-8',
399
- 'Accept': 'text/x-component',
400
- 'next-action': '40fc0d1f8f1f9cade86c05d74881beb408c1fbf3c4',
401
- 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(app)%22%2C%7B%22children%22%3A%5B%22(with-sidebar)%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2F%22%2C%22refresh%22%5D%7D%5D%7D%2Cnull%2Cnull%2Ctrue%5D%7D%5D%7D%5D',
402
- 'x-deployment-id': 'dpl_55LQ8Z7ygwa1s99pJVeED1iU2jvW',
403
- // The browser automatically adds critical headers including the new auth cookie
404
- },
405
- body: JSON.stringify([])
406
- });
407
-
408
- if (!verifyResponse.ok) {
409
- throw new Error(`Authentication verification failed with status ${verifyResponse.status}`);
410
- }
411
-
412
- const verifyText = await verifyResponse.text();
413
- console.log(`[Auth] ✅ Step 3: Authentication verification completed.`);
414
- console.log(`[Auth] Verification response:`, verifyText);
415
-
416
- // Store the authentication data
417
- localStorage.setItem('lmarena_auth_data', JSON.stringify(authData));
418
- localStorage.setItem('lmarena_auth_timestamp', Date.now().toString());
419
-
420
- console.log(`[Auth] 💾 Stored authentication data. Token expires at: ${new Date(authData.expires_at * 1000).toISOString()}`);
421
- console.log(`[Auth] 🎉 Complete authentication flow finished successfully!`);
422
-
423
- return authData;
424
-
425
- } catch (error) {
426
- console.error(`[Auth] ❌ Authentication failed:`, error);
427
- throw error;
428
- }
429
- }
430
-
431
- function getStoredAuthData() {
432
- const authData = localStorage.getItem('lmarena_auth_data');
433
- const timestamp = localStorage.getItem('lmarena_auth_timestamp');
434
-
435
- if (authData && timestamp) {
436
- try {
437
- const parsedAuthData = JSON.parse(authData);
438
- const currentTime = Math.floor(Date.now() / 1000); // Current time in seconds
439
-
440
- // Check if token is still valid (with 5 minute buffer)
441
- if (parsedAuthData.expires_at && (parsedAuthData.expires_at - 300) > currentTime) {
442
- const remainingTime = parsedAuthData.expires_at - currentTime;
443
- console.log(`[Auth] Using stored auth data (expires in ${Math.round(remainingTime/60)} minutes)`);
444
- return parsedAuthData;
445
- } else {
446
- console.log(`[Auth] Stored auth data expired, removing...`);
447
- localStorage.removeItem('lmarena_auth_data');
448
- localStorage.removeItem('lmarena_auth_timestamp');
449
- }
450
- } catch (error) {
451
- console.error(`[Auth] Error parsing stored auth data:`, error);
452
- localStorage.removeItem('lmarena_auth_data');
453
- localStorage.removeItem('lmarena_auth_timestamp');
454
- }
455
- }
456
- return null;
457
- }
458
-
459
- async function waitForCloudflareAuth() {
460
- console.log("[Injector] ⏳ Waiting for Cloudflare authentication to complete...");
461
-
462
- const maxWaitTime = 45000; // 45 seconds max wait (increased for slow CF challenges)
463
- const checkInterval = 500; // Check every 0.5 seconds (faster since we're not making network requests)
464
- let waitTime = 0;
465
-
466
- while (waitTime < maxWaitTime) {
467
- try {
468
- // Check the current page DOM for CF challenge indicators
469
- if (!isCurrentPageCloudflareChallenge()) {
470
- console.log(`[Injector] ✅ Cloudflare authentication completed after ${waitTime}ms`);
471
- return true;
472
- }
473
-
474
- console.log(`[Injector] ⏳ Still waiting for CF auth... (${waitTime}ms elapsed)`);
475
-
476
- } catch (error) {
477
- console.log(`[Injector] ⏳ CF auth check failed, continuing to wait... (${waitTime}ms elapsed) - ${error.message}`);
478
- }
479
-
480
- await new Promise(resolve => setTimeout(resolve, checkInterval));
481
- waitTime += checkInterval;
482
- }
483
-
484
- console.warn(`[Injector] ⚠️ CF authentication wait timeout after ${maxWaitTime}ms`);
485
- return false;
486
- }
487
-
488
- async function processPendingRequests() {
489
- // Retrieve pending requests from localStorage (survives page refresh)
490
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
491
- if (!storedRequests) {
492
- console.log("[Injector] 📭 No pending requests found, skipping processing");
493
- return;
494
- }
495
-
496
- try {
497
- const requests = JSON.parse(storedRequests);
498
- if (!requests || requests.length === 0) {
499
- console.log("[Injector] 📭 No pending requests in storage, cleaning up");
500
- localStorage.removeItem('lmarena_pending_requests');
501
- return;
502
- }
503
-
504
- console.log(`[Injector] 🔄 Found ${requests.length} pending requests after refresh`);
505
-
506
- // CRITICAL: Wait for CF authentication to complete before processing requests
507
- console.log("[Injector] ⏳ Waiting for Cloudflare authentication to complete before processing requests...");
508
- const authComplete = await waitForCloudflareAuth();
509
-
510
- if (!authComplete) {
511
- console.error("[Injector] ❌ CF authentication timeout - requests may fail");
512
- console.log("[Injector] 🔍 CF auth failed, but NOT triggering refresh - only refreshing on actual 429/CF challenge");
513
- // Don't process requests if CF auth failed
514
- return;
515
- }
516
-
517
- console.log("[Injector] ✅ Cloudflare authentication completed, proceeding with requests");
518
-
519
- // Wait a bit more for the page to fully stabilize after CF auth
520
- await new Promise(resolve => setTimeout(resolve, 2000));
521
-
522
- // ENHANCED: Wait for either Turnstile token OR auth cookie to become available
523
- console.log("[Injector] ⏳ Waiting for either Turnstile token or auth cookie to become available...");
524
- const maxWaitTime = 60000; // 60 seconds max wait
525
- const checkInterval = 1000; // Check every 1 second
526
- let waitTime = 0;
527
- let authReady = false;
528
- let turnstileInitialized = false;
529
-
530
- while (waitTime < maxWaitTime && !authReady) {
531
- // PRIORITY 1: Check if auth cookie already exists - if so, we're done!
532
- if (checkAuthCookie()) {
533
- console.log("[Injector] 🎉 Auth cookie found after refresh, ready to proceed!");
534
- authReady = true;
535
- break;
536
- }
537
-
538
- // PRIORITY 2: Only check for Turnstile token if we don't have auth cookie
539
- if (latestTurnstileToken) {
540
- console.log("[Injector] ✅ Turnstile token available, ready to proceed!");
541
- authReady = true;
542
- break;
543
- }
544
-
545
- // PRIORITY 3: Only initialize Turnstile if we don't have auth cookie and no token yet
546
- if (!turnstileInitialized && waitTime > 2000) { // Wait 2 seconds before initializing
547
- // Double-check auth cookie before initializing Turnstile
548
- if (checkAuthCookie()) {
549
- console.log("[Injector] 🎉 Auth cookie became available before Turnstile init, skipping!");
550
- authReady = true;
551
- break;
552
- }
553
-
554
- console.log("[Injector] 🔧 No auth cookie or Turnstile token found, initializing Turnstile API...");
555
- try {
556
- await initializeTurnstileIfNeeded();
557
- turnstileInitialized = true;
558
-
559
- // Check auth cookie again after Turnstile init in case it became available
560
- if (checkAuthCookie()) {
561
- console.log("[Injector] 🎉 Auth cookie became available during Turnstile init!");
562
- authReady = true;
563
- break;
564
- }
565
- } catch (error) {
566
- console.warn("[Injector] ⚠️ Failed to initialize Turnstile API:", error.message);
567
- turnstileInitialized = true; // Don't retry
568
- }
569
- }
570
-
571
- console.log(`[Injector] ⏳ Still waiting for auth cookie or Turnstile token... (${waitTime}ms elapsed)`);
572
- await new Promise(resolve => setTimeout(resolve, checkInterval));
573
- waitTime += checkInterval;
574
- }
575
-
576
- if (!authReady) {
577
- console.log("[Injector] ⚠️ Neither auth cookie nor Turnstile token became available within timeout, proceeding anyway");
578
- }
579
-
580
- // Wait for the reconnection handshake to complete
581
- await new Promise(resolve => setTimeout(resolve, 1000));
582
-
583
- // Clear the stored requests to prevent duplicate processing
584
- localStorage.removeItem('lmarena_pending_requests');
585
-
586
- // Process each pending request
587
- for (let i = 0; i < requests.length; i++) {
588
- const request = requests[i];
589
- const { requestId, payload, files_to_upload } = request;
590
- console.log(`[Injector] 🔄 Retrying request ${requestId} after refresh (${i + 1}/${requests.length})`);
591
-
592
- // Add a small delay between requests to avoid overwhelming the server
593
- if (i > 0) {
594
- await new Promise(resolve => setTimeout(resolve, 500));
595
- }
596
-
597
- try {
598
- // Check if this is an upload request or regular request
599
- if (files_to_upload && files_to_upload.length > 0) {
600
- console.log(`[Injector] 🔄 Retrying upload request ${requestId} with ${files_to_upload.length} file(s)`);
601
- await handleUploadAndChat(requestId, payload, files_to_upload);
602
- } else {
603
- console.log(`[Injector] 🔄 Retrying regular request ${requestId}`);
604
- await executeFetchAndStreamBack(requestId, payload);
605
- }
606
- console.log(`[Injector] ✅ Successfully retried request ${requestId}`);
607
- } catch (error) {
608
- console.error(`[Injector] ❌ Failed to retry request ${requestId}:`, error);
609
- // Send error to server so it can timeout the request
610
- if (socket && socket.readyState === WebSocket.OPEN) {
611
- socket.send(JSON.stringify({
612
- request_id: requestId,
613
- data: JSON.stringify({ error: `Retry failed: ${error.message}` })
614
- }));
615
- socket.send(JSON.stringify({
616
- request_id: requestId,
617
- data: "[DONE]"
618
- }));
619
- }
620
- }
621
- }
622
-
623
- console.log(`[Injector] 🎉 Completed processing ${requests.length} pending requests`);
624
-
625
- } catch (error) {
626
- console.error("[Injector] ❌ Error processing pending requests:", error);
627
- localStorage.removeItem('lmarena_pending_requests');
628
- }
629
- }
630
-
631
- function connect() {
632
- console.log(`[Injector] Connecting to server at ${CONFIG.SERVER_URL}...`);
633
- socket = new WebSocket(CONFIG.SERVER_URL);
634
-
635
- socket.onopen = () => {
636
- console.log("[Injector] ✅ Connection established with local server.");
637
-
638
- // Send reconnection handshake if we have pending requests
639
- sendReconnectionHandshake();
640
-
641
- // Check if we have pending requests from before a CF refresh
642
- processPendingRequests();
643
-
644
- // Send model registry after connection
645
- if (!modelRegistrySent) {
646
- setTimeout(() => {
647
- sendModelRegistry();
648
- }, 2000); // Wait a bit for page to fully load
649
- }
650
- };
651
-
652
- socket.onmessage = async (event) => {
653
- try {
654
- const message = JSON.parse(event.data);
655
-
656
- // 处理心跳 ping
657
- if (message.type === 'ping') {
658
- console.log('[Injector] 💓 Received ping, sending pong...');
659
- socket.send(JSON.stringify({
660
- type: 'pong',
661
- timestamp: message.timestamp
662
- }));
663
- return;
664
- }
665
-
666
- if (message.type === 'refresh_models') {
667
- console.log('[Injector] 🔄 Received model refresh request');
668
- sendModelRegistry();
669
- return;
670
- }
671
-
672
- if (message.type === 'model_registry_ack') {
673
- console.log(`[Injector] ✅ Model registry updated with ${message.count} models`);
674
- modelRegistrySent = true;
675
- return;
676
- }
677
-
678
- if (message.type === 'reconnection_ack') {
679
- console.log(`[Injector] 🤝 Reconnection acknowledged: ${message.message}`);
680
- if (message.pending_request_ids && message.pending_request_ids.length > 0) {
681
- console.log(`[Injector] 📋 Server has ${message.pending_request_ids.length} pending requests waiting`);
682
- }
683
- return;
684
- }
685
-
686
- if (message.type === 'restoration_ack') {
687
- console.log(`[Injector] 🔄 Request restoration acknowledged: ${message.message}`);
688
- console.log(`[Injector] ✅ ${message.restored_count} request channels restored`);
689
- return;
690
- }
691
-
692
- // Handle abort request from server when client disconnects
693
- if (message.type === 'abort_request') {
694
- const requestId = message.request_id;
695
- console.log(`[Injector] 🛑 Received abort request for ${requestId}`);
696
-
697
- const controller = activeFetchControllers.get(requestId);
698
- if (controller) {
699
- controller.abort();
700
- activeFetchControllers.delete(requestId);
701
- console.log(`[Injector] ✅ Aborted fetch request ${requestId}`);
702
- } else {
703
- console.log(`[Injector] ⚠️ No active fetch found for request ${requestId}`);
704
- }
705
- return;
706
- }
707
-
708
- const { request_id, payload, files_to_upload } = message;
709
-
710
- if (!request_id || !payload) {
711
- console.error("[Injector] Invalid message from server:", message);
712
- return;
713
- }
714
-
715
- // Check if there are files to upload and route to the correct handler
716
- if (files_to_upload && files_to_upload.length > 0) {
717
- console.log(`[Injector] ⬆️ Received request with ${files_to_upload.length} file(s). Starting upload process.`);
718
- await handleUploadAndChat(request_id, payload, files_to_upload);
719
- } else {
720
- console.log(`[Injector] ⬇️ Received standard text request ${request_id}. Firing fetch.`);
721
- await executeFetchAndStreamBack(request_id, payload);
722
- }
723
-
724
- } catch (error) {
725
- console.error("[Injector] Error processing message from server:", error);
726
- }
727
- };
728
-
729
- socket.onclose = () => {
730
- console.warn("[Injector] 🔌 Connection to local server closed. Retrying in 5 seconds...");
731
- modelRegistrySent = false; // Reset flag on disconnect
732
-
733
- // Abort all active fetch requests when WebSocket closes
734
- if (activeFetchControllers.size > 0) {
735
- console.log(`[Injector] 🛑 Aborting ${activeFetchControllers.size} active fetch requests due to WebSocket disconnect`);
736
- for (const [requestId, controller] of activeFetchControllers) {
737
- controller.abort();
738
- console.log(`[Injector] ✅ Aborted fetch request ${requestId}`);
739
- }
740
- activeFetchControllers.clear();
741
- }
742
-
743
- setTimeout(connect, 5000);
744
- };
745
-
746
- socket.onerror = (error) => {
747
- console.error("[Injector] ❌ WebSocket error:", error);
748
- socket.close(); // This will trigger the onclose reconnect logic
749
- };
750
- }
751
-
752
- function isCloudflareChallenge(responseText) {
753
- // Check for common Cloudflare challenge indicators
754
- return responseText.includes('Checking your browser before accessing') ||
755
- responseText.includes('DDoS protection by Cloudflare') ||
756
- responseText.includes('cf-browser-verification') ||
757
- responseText.includes('cf-challenge-running') ||
758
- responseText.includes('__cf_chl_jschl_tk__') ||
759
- responseText.includes('cloudflare-static') ||
760
- responseText.includes('<title>Just a moment...</title>') ||
761
- responseText.includes('Enable JavaScript and cookies to continue') ||
762
- responseText.includes('window._cf_chl_opt') ||
763
- (responseText.includes('cloudflare') && responseText.includes('challenge'));
764
- }
765
-
766
- function isCurrentPageCloudflareChallenge() {
767
- // Check the current page DOM for CF challenge indicators
768
- try {
769
- // Check page title
770
- if (document.title.includes('Just a moment') ||
771
- document.title.includes('Checking your browser') ||
772
- document.title.includes('Please wait')) {
773
- console.log("[Injector] 🛡️ CF challenge detected in page title");
774
- return true;
775
- }
776
-
777
- // Check for CF challenge elements in the DOM
778
- const cfIndicators = [
779
- 'cf-browser-verification',
780
- 'cf-challenge-running',
781
- 'cf-wrapper',
782
- 'cf-error-details',
783
- 'cloudflare-static'
784
- ];
785
-
786
- for (const indicator of cfIndicators) {
787
- if (document.getElementById(indicator) ||
788
- document.querySelector(`[class*="${indicator}"]`) ||
789
- document.querySelector(`[id*="${indicator}"]`)) {
790
- console.log(`[Injector] 🛡️ CF challenge detected: found element with ${indicator}`);
791
- return true;
792
- }
793
- }
794
-
795
- // Check for CF challenge text content
796
- const bodyText = document.body ? document.body.textContent || document.body.innerText : '';
797
- if (bodyText.includes('Checking your browser before accessing') ||
798
- bodyText.includes('DDoS protection by Cloudflare') ||
799
- bodyText.includes('Enable JavaScript and cookies to continue') ||
800
- bodyText.includes('Please complete the security check') ||
801
- bodyText.includes('Verifying you are human')) {
802
- console.log("[Injector] 🛡️ CF challenge detected in page text content");
803
- return true;
804
- }
805
-
806
- // Check for CF challenge scripts
807
- const scripts = document.querySelectorAll('script');
808
- for (const script of scripts) {
809
- const scriptContent = script.textContent || script.innerHTML;
810
- if (scriptContent.includes('__cf_chl_jschl_tk__') ||
811
- scriptContent.includes('window._cf_chl_opt') ||
812
- scriptContent.includes('cf_challenge_response')) {
813
- console.log("[Injector] 🛡️ CF challenge detected in script content");
814
- return true;
815
- }
816
- }
817
-
818
- // Check if the page looks like the normal LMArena interface
819
- // Look for key elements that should be present on the normal page
820
- const normalPageIndicators = [
821
- 'nav', 'header', 'main',
822
- '[data-testid]', '[class*="chat"]', '[class*="model"]',
823
- 'input[type="text"]', 'textarea'
824
- ];
825
-
826
- let normalElementsFound = 0;
827
- for (const selector of normalPageIndicators) {
828
- if (document.querySelector(selector)) {
829
- normalElementsFound++;
830
- }
831
- }
832
-
833
- // If we found several normal page elements, it's likely not a CF challenge
834
- if (normalElementsFound >= 3) {
835
- console.log(`[Injector] ✅ Normal page detected: found ${normalElementsFound} normal elements`);
836
- return false;
837
- }
838
-
839
- // If the page is mostly empty or has very few elements, it might be a CF challenge
840
- const totalElements = document.querySelectorAll('*').length;
841
- if (totalElements < 50) {
842
- console.log(`[Injector] 🛡️ Possible CF challenge: page has only ${totalElements} elements`);
843
- return true;
844
- }
845
-
846
- console.log("[Injector] ✅ No CF challenge indicators found in current page");
847
- return false;
848
-
849
- } catch (error) {
850
- console.warn(`[Injector] ⚠️ Error checking current page for CF challenge: ${error.message}`);
851
- // If we can't check, assume no challenge to avoid blocking
852
- return false;
853
- }
854
- }
855
-
856
- async function handleCloudflareRefresh() {
857
- if (isRefreshing) {
858
- console.log("[Injector] 🔄 Already refreshing, skipping duplicate refresh request");
859
- return;
860
- }
861
-
862
- isRefreshing = true;
863
- console.log("[Injector] 🔄 Cloudflare challenge detected! Refreshing page to get new token...");
864
-
865
- try {
866
- // Check if we have any pending requests stored
867
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
868
- if (storedRequests) {
869
- const requests = JSON.parse(storedRequests);
870
- console.log(`[Injector] 💾 Found ${requests.length} pending requests, refreshing page...`);
871
- }
872
-
873
- // Refresh the page to trigger new CF authentication
874
- window.location.reload();
875
-
876
- // Wait for page to reload and CF auth to complete
877
- // The script will restart after reload, so this won't continue
878
- } catch (error) {
879
- console.error("[Injector] ❌ Error during CF refresh:", error);
880
- isRefreshing = false;
881
- }
882
- }
883
-
884
- async function handleRateLimitRefresh() {
885
- if (isRefreshing) {
886
- console.log("[Injector] 🔄 Already refreshing, skipping duplicate rate limit refresh request");
887
- return;
888
- }
889
-
890
- isRefreshing = true;
891
- console.log("[Injector] 🚫 Rate limit (429) detected! Deleting auth cookie and refreshing to create new identity...");
892
-
893
- try {
894
- // Delete ALL cookies to create a completely fresh identity
895
- console.log(`[Injector] 🗑️ Deleting ALL cookies to ensure fresh identity...`);
896
-
897
- // Get all cookies and delete them
898
- const cookies = document.cookie.split(";");
899
- for (let cookie of cookies) {
900
- const eqPos = cookie.indexOf("=");
901
- const name = eqPos > -1 ? cookie.substr(0, eqPos).trim() : cookie.trim();
902
- if (name) {
903
- // Delete for current domain
904
- document.cookie = `${name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
905
- // Delete for lmarena.ai domain
906
- document.cookie = `${name}=; path=/; domain=lmarena.ai; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
907
- // Delete for .lmarena.ai domain
908
- document.cookie = `${name}=; path=/; domain=.lmarena.ai; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
909
- // Delete for lmarena.ai domain
910
- document.cookie = `${name}=; path=/; domain=lmarena.ai; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
911
- }
912
- }
913
- console.log(`[Injector] 🗑️ Deleted ${cookies.length} cookies`);
914
-
915
- // Also clear stored auth data
916
- localStorage.removeItem('lmarena_auth_data');
917
- localStorage.removeItem('lmarena_auth_timestamp');
918
- console.log(`[Injector] 🗑️ Cleared stored auth data`);
919
-
920
- // Check if we have any pending requests stored
921
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
922
- if (storedRequests) {
923
- const requests = JSON.parse(storedRequests);
924
- console.log(`[Injector] 💾 Found ${requests.length} pending requests, refreshing page...`);
925
- }
926
-
927
- // Refresh the page to get new identity
928
- window.location.reload();
929
-
930
- // Wait for page to reload and new auth to complete
931
- // The script will restart after reload, so this won't continue
932
- } catch (error) {
933
- console.error("[Injector] ❌ Error during rate limit refresh:", error);
934
- isRefreshing = false;
935
- }
936
- }
937
-
938
- // Helper function to convert base64 to a Blob
939
- function base64ToBlob(base64, contentType) {
940
- const byteCharacters = atob(base64);
941
- const byteNumbers = new Array(byteCharacters.length);
942
- for (let i = 0; i < byteCharacters.length; i++) {
943
- byteNumbers[i] = byteCharacters.charCodeAt(i);
944
- }
945
- const byteArray = new Uint8Array(byteNumbers);
946
- return new Blob([byteArray], { type: contentType });
947
- }
948
-
949
- async function handleUploadAndChat(requestId, payload, filesToUpload) {
950
- // Create abort controller for this request
951
- const abortController = new AbortController();
952
- activeFetchControllers.set(requestId, abortController);
953
-
954
- try {
955
- console.log(`[Uploader] 🚀 Starting upload and chat for request ${requestId}`);
956
-
957
- // Ensure authentication is ready before making requests
958
- await ensureAuthenticationReady(requestId);
959
-
960
- const attachments = [];
961
- for (const file of filesToUpload) {
962
- console.log(`[Uploader] Processing file: ${file.fileName}`);
963
-
964
- // Step 1: Get Signed URL
965
- console.log(`[Uploader] Step 1: Getting signed URL for ${file.fileName}`);
966
- const signUrlResponse = await fetch('https://lmarena.ai/?mode=direct', {
967
- method: 'POST',
968
- headers: {
969
- 'Content-Type': 'text/plain;charset=UTF-8',
970
- 'Accept': 'text/x-component',
971
- 'next-action': '70921b78972dce2a8502e777b245519ec3b4304009',
972
- 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(app)%22%2C%7B%22children%22%3A%5B%22(with-sidebar)%22%2C%7B%22children%22%3A%5B%22__PAGE__%3F%7B%5C%22mode%5C%22%3A%5C%22direct%5C%22%7D%22%2C%7B%7D%2C%22%2F%3Fmode%3Ddirect%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%2Ctrue%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D',
973
- 'origin': 'https://lmarena.ai',
974
- 'referer': 'https://lmarena.ai/'
975
- },
976
- body: JSON.stringify([file.fileName, file.contentType]),
977
- signal: abortController.signal
978
- });
979
-
980
- const signUrlText = await signUrlResponse.text();
981
- console.log("[Uploader] Received for signed URL:", signUrlText);
982
-
983
- // The response format may vary. Try different parsing strategies.
984
- let signUrlData = null;
985
-
986
- // Strategy 1: Look for "1:{...}" pattern (original format)
987
- let match = signUrlText.match(/1:({.*})/);
988
- if (match && match.length >= 2) {
989
- console.log("[Uploader] Found data with '1:' prefix");
990
- signUrlData = JSON.parse(match[1]);
991
- } else {
992
- // Strategy 2: Look for any numbered prefix pattern like "0:{...}", "2:{...}", etc.
993
- match = signUrlText.match(/\d+:({.*})/);
994
- if (match && match.length >= 2) {
995
- console.log(`[Uploader] Found data with '${match[0].split(':')[0]}:' prefix`);
996
- signUrlData = JSON.parse(match[1]);
997
- } else {
998
- // Strategy 3: Try to parse the entire response as JSON
999
- try {
1000
- signUrlData = JSON.parse(signUrlText);
1001
- console.log("[Uploader] Parsed entire response as JSON");
1002
- } catch (e) {
1003
- // Strategy 4: Look for JSON objects in the response
1004
- const jsonMatches = signUrlText.match(/{[^}]*"uploadUrl"[^}]*}/g);
1005
- if (jsonMatches && jsonMatches.length > 0) {
1006
- signUrlData = JSON.parse(jsonMatches[0]);
1007
- console.log("[Uploader] Found JSON object containing uploadUrl");
1008
- } else {
1009
- throw new Error(`Could not parse signed URL response. Response: ${signUrlText}`);
1010
- }
1011
- }
1012
- }
1013
- }
1014
-
1015
- if (!signUrlData || !signUrlData.data || !signUrlData.data.uploadUrl) {
1016
- throw new Error('Signed URL data is incomplete or invalid after parsing.');
1017
- }
1018
- const { uploadUrl, key } = signUrlData.data;
1019
- console.log(`[Uploader] Got signed URL. Key: ${key}`);
1020
-
1021
- // Step 2: Upload file to storage
1022
- console.log(`[Uploader] Step 2: Uploading file to cloud storage...`);
1023
- const blob = base64ToBlob(file.data, file.contentType);
1024
- const uploadResponse = await fetch(uploadUrl, {
1025
- method: 'PUT',
1026
- headers: { 'Content-Type': file.contentType },
1027
- body: blob,
1028
- signal: abortController.signal
1029
- });
1030
- if (!uploadResponse.ok) throw new Error(`File upload failed with status ${uploadResponse.status}`);
1031
- console.log(`[Uploader] File uploaded successfully.`);
1032
-
1033
- // Step 3: Notify LMArena of upload
1034
- console.log(`[Uploader] Step 3: Notifying LMArena of upload completion...`);
1035
- const notifyResponse = await fetch('https://lmarena.ai/?mode=direct', {
1036
- method: 'POST',
1037
- headers: {
1038
- 'Content-Type': 'text/plain;charset=UTF-8',
1039
- 'Accept': 'text/x-component',
1040
- 'next-action': '6022a52184b31a48befd4697f8aa5cca57a0c68dd5',
1041
- 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(app)%22%2C%7B%22children%22%3A%5B%22(with-sidebar)%22%2C%7B%22children%22%3A%5B%22__PAGE__%3F%7B%5C%22mode%5C%22%3A%5C%22direct%5C%22%7D%22%2C%7B%7D%2C%22%2F%3Fmode%3Ddirect%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%2Ctrue%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D',
1042
- 'origin': 'https://lmarena.ai',
1043
- 'referer': 'https://lmarena.ai/'
1044
- },
1045
- body: JSON.stringify([key]),
1046
- signal: abortController.signal
1047
- });
1048
-
1049
- const notifyText = await notifyResponse.text();
1050
- console.log(`[Uploader] Notification sent. Response:`, notifyText);
1051
-
1052
- // Parse the response from the notification step to get the final URL
1053
- const finalUrlDataLine = notifyText.split('\n').find(line => line.startsWith('1:'));
1054
- if (!finalUrlDataLine) throw new Error('Could not find final URL data in notification response.');
1055
-
1056
- const finalUrlData = JSON.parse(finalUrlDataLine.substring(2));
1057
- const finalUrl = finalUrlData.data.url;
1058
- if (!finalUrl) throw new Error('Final URL not found in notification response data.');
1059
-
1060
- console.log(`[Uploader] Extracted final GetObject URL: ${finalUrl}`);
1061
-
1062
- attachments.push({
1063
- name: key,
1064
- contentType: file.contentType,
1065
- url: finalUrl
1066
- });
1067
- }
1068
-
1069
- // Step 4: Modify payload with attachments and send final request
1070
- console.log('[Uploader] All files uploaded. Modifying final payload...');
1071
- const userMessage = payload.messages.find(m => m.role === 'user');
1072
- if (userMessage) {
1073
- userMessage.experimental_attachments = attachments;
1074
- } else {
1075
- throw new Error("Could not find user message in payload to attach files to.");
1076
- }
1077
-
1078
- console.log('[Uploader] Payload modified. Initiating final chat stream.');
1079
- await executeFetchAndStreamBack(requestId, payload);
1080
-
1081
- } catch (error) {
1082
- if (error.name === 'AbortError') {
1083
- console.log(`[Uploader] Upload process aborted for request ${requestId}`);
1084
- // Don't send error back to server since client has disconnected
1085
- } else {
1086
- console.error(`[Uploader] Error during file upload process for request ${requestId}:`, error);
1087
- // === 添加429错误处理 ===
1088
- // 检查是否是429错误(可能在上传文件的任何步骤中发生)
1089
- if (error.message && error.message.includes('429')) {
1090
- console.log(`[Uploader] 🚫 Rate limit detected during upload`);
1091
-
1092
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1093
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1094
-
1095
- if (!alreadyStored) {
1096
- existingRequests.push({
1097
- requestId,
1098
- payload,
1099
- files_to_upload: filesToUpload // 保存文件信息!这是关键
1100
- });
1101
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1102
- console.log(`[Uploader] 💾 Stored upload request ${requestId} with ${filesToUpload.length} files for retry`);
1103
- }
1104
-
1105
- handleRateLimitRefresh();
1106
- return;
1107
- }
1108
- sendToServer(requestId, JSON.stringify({ error: `File upload failed: ${error.message}` }));
1109
- sendToServer(requestId, "[DONE]");
1110
- }
1111
- } finally {
1112
- // Clean up abort controller
1113
- activeFetchControllers.delete(requestId);
1114
- }
1115
- }
1116
-
1117
- async function executeFetchAndStreamBack(requestId, payload) {
1118
- // Create abort controller for this request
1119
- const abortController = new AbortController();
1120
- activeFetchControllers.set(requestId, abortController);
1121
-
1122
- try {
1123
- console.log(`[Injector] 🚀 Starting fetch for request ${requestId}`);
1124
-
1125
- // Ensure authentication is ready before making request
1126
- await ensureAuthenticationReady(requestId);
1127
-
1128
- const response = await fetch(`https://lmarena.ai${TARGET_API_PATH}`, {
1129
- method: 'POST',
1130
- headers: {
1131
- 'Content-Type': 'text/plain;charset=UTF-8',
1132
- 'Accept': '*/*',
1133
- // The browser automatically adds critical headers:
1134
- // Cookie, User-Agent, sec-ch-ua, etc.
1135
- },
1136
- body: JSON.stringify(payload),
1137
- signal: abortController.signal
1138
- });
1139
-
1140
- // Check for rate limit (429) error first
1141
- if (response.status === 429) {
1142
- console.log(`[Injector] 🚫 Rate limit (429) detected for request ${requestId}`);
1143
-
1144
- // Check if this request is already stored to prevent duplicates
1145
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1146
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1147
-
1148
- if (!alreadyStored) {
1149
- existingRequests.push({
1150
- requestId,
1151
- payload,
1152
- files_to_upload: [] // 普通请求没有文件
1153
- });
1154
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1155
- console.log(`[Injector] 💾 Stored request ${requestId} for retry after rate limit refresh`);
1156
- } else {
1157
- console.log(`[Injector] ⚠️ Request ${requestId} already stored, skipping duplicate`);
1158
- }
1159
-
1160
- // Trigger rate limit refresh (don't await to prevent blocking)
1161
- handleRateLimitRefresh();
1162
- return; // Function will not continue after page refresh
1163
- }
1164
-
1165
- // Check if we got a Cloudflare challenge instead of the expected response
1166
- if (!response.ok || response.headers.get('content-type')?.includes('text/html')) {
1167
- const responseText = await response.text();
1168
-
1169
- if (isCloudflareChallenge(responseText)) {
1170
- console.log(`[Injector] 🛡️ Cloudflare challenge detected for request ${requestId} (Status: ${response.status})`);
1171
-
1172
- // Check if this request is already stored to prevent duplicates
1173
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1174
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1175
-
1176
- if (!alreadyStored) {
1177
- existingRequests.push({ requestId, payload });
1178
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1179
- console.log(`[Injector] 💾 Stored request ${requestId} for retry after CF refresh`);
1180
- } else {
1181
- console.log(`[Injector] ⚠️ Request ${requestId} already stored, skipping duplicate`);
1182
- }
1183
-
1184
- // Trigger automatic refresh (don't await to prevent blocking)
1185
- handleCloudflareRefresh();
1186
- return; // Function will not continue after page refresh
1187
- }
1188
-
1189
- // If it's not a CF challenge, treat as regular error
1190
- throw new Error(`Fetch failed with status ${response.status}: ${responseText}`);
1191
- }
1192
-
1193
- if (!response.body) {
1194
- throw new Error(`No response body received for request ${requestId}`);
1195
- }
1196
-
1197
- console.log(`[Injector] 📡 Starting to stream response for request ${requestId}`);
1198
- const reader = response.body.getReader();
1199
- const decoder = new TextDecoder();
1200
-
1201
- while (true) {
1202
- // Check if we've been aborted before reading
1203
- if (abortController.signal.aborted) {
1204
- console.log(`[Injector] Stream aborted for request ${requestId}, cancelling reader`);
1205
- await reader.cancel();
1206
- break;
1207
- }
1208
-
1209
- const { value, done } = await reader.read();
1210
- if (done) {
1211
- console.log(`[Injector] ✅ Stream finished for request ${requestId}.`);
1212
- sendToServer(requestId, "[DONE]");
1213
- break;
1214
- }
1215
-
1216
- const chunk = decoder.decode(value);
1217
-
1218
- // Additional check: if we get HTML in the stream, it might be a CF challenge
1219
- if (chunk.includes('<html') || chunk.includes('<!DOCTYPE')) {
1220
- if (isCloudflareChallenge(chunk)) {
1221
- console.log(`[Injector] 🛡️ Cloudflare challenge detected in stream for request ${requestId}`);
1222
-
1223
- // Check if this request is already stored to prevent duplicates
1224
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1225
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1226
-
1227
- if (!alreadyStored) {
1228
- existingRequests.push({ requestId, payload });
1229
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1230
- console.log(`[Injector] 💾 Stored request ${requestId} for retry after CF refresh (detected in stream)`);
1231
- }
1232
-
1233
- // Trigger automatic refresh (don't await to prevent blocking)
1234
- handleCloudflareRefresh();
1235
- return;
1236
- }
1237
- }
1238
-
1239
- // Check abort signal again before sending data
1240
- if (abortController.signal.aborted) {
1241
- console.log(`[Injector] Stream aborted for request ${requestId}, stopping data transmission`);
1242
- await reader.cancel();
1243
- break;
1244
- }
1245
-
1246
- // The stream often sends multiple lines in one chunk
1247
- const lines = chunk.split('\n').filter(line => line.trim() !== '');
1248
- for (const line of lines) {
1249
- // One more check before each send
1250
- if (abortController.signal.aborted) {
1251
- console.log(`[Injector] Aborting mid-chunk for request ${requestId}`);
1252
- await reader.cancel();
1253
- return; // Exit the entire function
1254
- }
1255
- sendToServer(requestId, line);
1256
- }
1257
- }
1258
-
1259
- } catch (error) {
1260
- if (error.name === 'AbortError') {
1261
- console.log(`[Injector] Fetch aborted for request ${requestId}`);
1262
- // Don't send error back to server since client has disconnected
1263
- } else {
1264
- console.error(`[Injector] ❌ Error during fetch for request ${requestId}:`, error);
1265
- sendToServer(requestId, JSON.stringify({ error: error.message }));
1266
- sendToServer(requestId, "[DONE]"); // Ensure the stream is always terminated
1267
- }
1268
- } finally {
1269
- // Clean up abort controller
1270
- activeFetchControllers.delete(requestId);
1271
- }
1272
- }
1273
-
1274
- function sendToServer(requestId, data) {
1275
- // Check if this request has been aborted
1276
- const controller = activeFetchControllers.get(requestId);
1277
- if (controller && controller.signal.aborted) {
1278
- console.log(`[Injector] Not sending data for aborted request ${requestId}`);
1279
- return;
1280
- }
1281
-
1282
- if (socket && socket.readyState === WebSocket.OPEN) {
1283
- const message = {
1284
- request_id: requestId,
1285
- data: data
1286
- };
1287
- socket.send(JSON.stringify(message));
1288
- } else {
1289
- console.error("[Injector] Cannot send data, socket is not open.");
1290
- }
1291
- }
1292
-
1293
- function extractModelRegistry() {
1294
- console.log('[Injector] 🔍 Extracting model registry from script tags...');
1295
-
1296
- try {
1297
- const scripts = document.querySelectorAll('script');
1298
- let modelData = null;
1299
- const searchString = CONFIG.MODEL_REGISTRY.SEARCH_STRING;
1300
-
1301
- for (const script of scripts) {
1302
- const content = script.textContent || script.innerHTML;
1303
- if (content.includes(searchString)) {
1304
- console.log('[Injector] Found the target script tag.');
1305
-
1306
- // The entire payload is inside this one script's content.
1307
- const startIndex = content.indexOf(searchString);
1308
- const payloadStartIndex = startIndex + searchString.length; // Start at the first '[' after the ':'
1309
-
1310
- let balance = 1;
1311
- let endIndex = -1;
1312
- let inString = false;
1313
-
1314
- // Start searching from after the first bracket
1315
- for (let i = payloadStartIndex + 1; i < content.length; i++) {
1316
- const char = content[i];
1317
- const prevChar = content[i-1];
1318
-
1319
- // Toggle inString state if we encounter a quote that is not escaped
1320
- if (char === '"' && prevChar !== '\\') {
1321
- inString = !inString;
1322
- }
1323
-
1324
- // Only count brackets if we're not inside a string
1325
- if (!inString) {
1326
- if (char === '[') {
1327
- balance++;
1328
- } else if (char === ']') {
1329
- balance--;
1330
- }
1331
- }
1332
-
1333
- // If balance is zero, we've found the end of our JSON object
1334
- if (balance === 0) {
1335
- endIndex = i + 1;
1336
- break;
1337
- }
1338
- }
1339
-
1340
- if (endIndex === -1) {
1341
- console.error('[Injector] Could not find the end of the JSON payload using bracket counting.');
1342
- continue;
1343
- }
1344
-
1345
- const rawPayload = content.substring(payloadStartIndex, endIndex);
1346
- const jsonString = rawPayload.replace(/\\"/g, '"').replace(/\\\\/g, '\\');
1347
-
1348
- console.log('[Injector] Payload extracted via bracket counting. Parsing JSON...');
1349
- const parsedData = JSON.parse(jsonString);
1350
-
1351
- function findAllInitialStates(obj) {
1352
- let allModels = [];
1353
- function search(currentObj) {
1354
- if (!currentObj || typeof currentObj !== 'object') return;
1355
- if (currentObj.hasOwnProperty('initialState') && Array.isArray(currentObj.initialState)) {
1356
- if (currentObj.initialState.length > 0 && currentObj.initialState[0] && currentObj.initialState[0].publicName) {
1357
- allModels = allModels.concat(currentObj.initialState);
1358
- }
1359
- }
1360
- for (const key in currentObj) {
1361
- if (currentObj.hasOwnProperty(key)) search(currentObj[key]);
1362
- }
1363
- }
1364
- search(obj);
1365
- return allModels;
1366
- }
1367
-
1368
- modelData = findAllInitialStates(parsedData);
1369
- if (modelData && modelData.length > 0) {
1370
- console.log(`[Injector] Successfully aggregated ${modelData.length} models.`);
1371
- break; // Exit after processing the correct script
1372
- }
1373
- }
1374
- }
1375
-
1376
- if (!modelData || modelData.length === 0) {
1377
- console.warn('[Injector] Model extraction failed.');
1378
- return null;
1379
- }
1380
-
1381
- const registry = {};
1382
- modelData.forEach(model => {
1383
- if (!model || typeof model !== 'object' || !model.publicName) return;
1384
- if (registry[model.publicName]) return;
1385
-
1386
- let type = 'chat';
1387
- if (model.capabilities && model.capabilities.outputCapabilities) {
1388
- if (model.capabilities.outputCapabilities.image) type = 'image';
1389
- else if (model.capabilities.outputCapabilities.video) type = 'video';
1390
- }
1391
-
1392
- registry[model.publicName] = { type: type, ...model };
1393
- });
1394
-
1395
- console.log(`[Injector] ✅ Extracted ${Object.keys(registry).length} unique models.`);
1396
- return registry;
1397
-
1398
- } catch (error) {
1399
- console.error('[Injector] ❌ Error extracting model registry:', error);
1400
- return null;
1401
- }
1402
- }
1403
-
1404
- function sendReconnectionHandshake() {
1405
- if (!socket || socket.readyState !== WebSocket.OPEN) {
1406
- console.log('[Injector] ⚠️ WebSocket not ready, cannot send reconnection handshake');
1407
- return;
1408
- }
1409
-
1410
- // Get pending request IDs from localStorage
1411
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
1412
- let pendingRequestIds = [];
1413
-
1414
- if (storedRequests) {
1415
- try {
1416
- const requests = JSON.parse(storedRequests);
1417
- pendingRequestIds = requests.map(req => req.requestId);
1418
- console.log(`[Injector] 🤝 Sending reconnection handshake with ${pendingRequestIds.length} pending requests`);
1419
- } catch (error) {
1420
- console.error("[Injector] Error parsing stored requests for handshake:", error);
1421
- }
1422
- }
1423
-
1424
- const handshakeMessage = {
1425
- type: 'reconnection_handshake',
1426
- pending_request_ids: pendingRequestIds,
1427
- timestamp: Date.now()
1428
- };
1429
-
1430
- socket.send(JSON.stringify(handshakeMessage));
1431
- console.log(`[Injector] 📤 Sent reconnection handshake`);
1432
- }
1433
-
1434
- function sendModelRegistry() {
1435
- if (!socket || socket.readyState !== WebSocket.OPEN) {
1436
- console.log('[Injector] ⚠️ WebSocket not ready, cannot send model registry');
1437
- return;
1438
- }
1439
-
1440
- const models = extractModelRegistry();
1441
-
1442
- if (models && Object.keys(models).length > 0) {
1443
- const message = {
1444
- type: 'model_registry',
1445
- models: models
1446
- };
1447
-
1448
- socket.send(JSON.stringify(message));
1449
- console.log(`[Injector] 📤 Sent model registry with ${Object.keys(models).length} models`);
1450
- } else {
1451
- console.warn('[Injector] ⚠️ No models extracted, not sending registry');
1452
- }
1453
- }
1454
-
1455
- // --- Start the connection ---
1456
- connect();
1457
-
1458
- // Also try to send model registry when page loads
1459
- if (document.readyState === 'loading') {
1460
- document.addEventListener('DOMContentLoaded', () => {
1461
- setTimeout(sendModelRegistry, 3000);
1462
- });
1463
- } else {
1464
- setTimeout(sendModelRegistry, 3000);
1465
- }
1466
-
1467
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/openapi.documented.yml DELETED
The diff for this file is too large to render. See raw diff
 
samples/sample.txt DELETED
@@ -1,303 +0,0 @@
1
- return '' !== e
2
- })),
3
- Y(
4
- e.attributes,
5
- function (i) {
6
- var r;
7
- if (
8
- (
9
- !e2(e) ||
10
- - 1 !== ['name',
11
- 'id',
12
- 'class',
13
- 'aria-label'].indexOf(i.name)
14
- ) &&
15
- (null == s || !s.includes(i.name)) &&
16
- !t &&
17
- e9(i.value) &&
18
- (
19
- !T(r = i.name) ||
20
- '_ngcontent' !== r.substring(0, 10) &&
21
- '_nghost' !== r.substring(0, 7)
22
- )
23
- ) {
24
- var o = i.value;
25
- 'class' === i.name &&
26
- (o = eG(o).join(' ')),
27
- n['attr__' + i.name] = tu(1024, o)
28
- }
29
- }
30
- );
31
- for (
32
- var a = 1,
33
- l = 1,
34
- c = e;
35
- c = function (e) {
36
- if (e.previousElementSibling) return e.previousElementSibling;
37
- var t = e;
38
- do t = t.previousSibling;
39
- while (t && !ez(t));
40
- return t
41
- }(c);
42
- ) a++,
43
- c.tagName === e.tagName &&
44
- l++;
45
- return n.nth_child = a,
46
- n.nth_of_type = l,
47
- n
48
- }(e, o, a, l)
49
- ),
50
- K(
51
- p,
52
- function (e) {
53
- if (!e1(e)) return {
54
- };
55
- var t = {};
56
- return Y(
57
- e.attributes,
58
- function (e) {
59
- if (e.name && 0 === e.name.indexOf('data-ph-capture-attribute')) {
60
- var i = e.name.replace('data-ph-capture-attribute-', ''),
61
- s = e.value;
62
- i &&
63
- s &&
64
- e9(s) &&
65
- (t[i] = s)
66
- }
67
- }
68
- ),
69
- t
70
- }(e)
71
- )
72
- }
73
- ),
74
- f
75
- ) return {
76
- props: {
77
- },
78
- explicitNoCapture: f
79
- };
80
- if (
81
- a ||
82
- (
83
- 'a' === e.tagName.toLowerCase() ||
84
- 'button' === e.tagName.toLowerCase() ? _[0].$el_text = te(e) : _[0].$el_text = eX(e)
85
- ),
86
- g
87
- ) {
88
- _[0].attr__href = g;
89
- var v,
90
- m,
91
- y = null == (v = tr(g)) ? void 0 : v.host,
92
- w = null == r ||
93
- null == (m = r.location) ? void 0 : m.host;
94
- y &&
95
- w &&
96
- y !== w &&
97
- (h = g)
98
- }
99
- return {
100
- props: K({
101
- $event_type: n.type,
102
- $ce_version: 1
103
- }, c ? {
104
- }
105
- : {
106
- $elements: _
107
- }, {
108
- $elements_chain: _.map(
109
- e => {
110
- var t,
111
- i,
112
- s,
113
- r = {
114
- text: null == (i = e.$el_text) ? void 0 : i.slice(0, 400),
115
- tag_name: e.tag_name,
116
- href: null == (s = e.attr__href) ? void 0 : s.slice(0, 2048),
117
- attr_class: (t = e.attr__class) ? P(t) ? t : eG(t) : void 0,
118
- attr_id: e.attr__id,
119
- nth_child: e.nth_child,
120
- nth_of_type: e.nth_of_type,
121
- attributes: {
122
- }
123
- };
124
- return Q(e).filter(e => {
125
- var [t] = e;
126
- return 0 === t.indexOf('attr__')
127
- }).forEach(e => {
128
- var [t,
129
- i] = e;
130
- return r.attributes[t] = i
131
- }),
132
- r
133
- }
134
- ).map(
135
- e => {
136
- var t,
137
- i,
138
- s = '';
139
- if (e.tag_name && (s += e.tag_name), e.attr_class) for (var r of (e.attr_class.sort(), e.attr_class)) s += '.'.concat(r.replace(/"/g, ''));
140
- var n = j(
141
- j(
142
- j(
143
- j({
144
- }, e.text ? {
145
- text: e.text
146
- }
147
- : {
148
- }),
149
- {
150
- },
151
- {
152
- 'nth-child': null != (t = e.nth_child) ? t : 0,
153
- 'nth-of-type': null != (i = e.nth_of_type) ? i : 0
154
- },
155
- e.href ? {
156
- href: e.href
157
- }
158
- : {
159
- }
160
- ),
161
- e.attr_id ? {
162
- attr_id: e.attr_id
163
- }
164
- : {
165
- }
166
- ),
167
- e.attributes
168
- ),
169
- o = {};
170
- return Q(n).sort((e, t) => {
171
- var [i] = e,
172
- [
173
- s
174
- ] = t;
175
- return i.localeCompare(s)
176
- }).forEach(e => {
177
- var [t,
178
- i] = e;
179
- return o[tt(t.toString())] = tt(i.toString())
180
- }),
181
- s += ':',
182
- s += Q(n).map(e => {
183
- var [t,
184
- i] = e;
185
- return ''.concat(t, '="').concat(i, '"')
186
- }).join('')
187
- }
188
- ).join(';')
189
- }, null != (i = _[0]) && i.$el_text ? {
190
- $el_text: null == (s = _[0]) ? void 0 : s.$el_text
191
- }
192
- : {
193
- }, h && 'click' === n.type ? {
194
- $external_click_url: h
195
- }
196
- : {
197
- }, p)
198
- }
199
- }(
200
- s,
201
- {
202
- e: e,
203
- maskAllElementAttributes: this.instance.config.mask_all_element_attributes,
204
- maskAllText: this.instance.config.mask_all_text,
205
- elementAttributeIgnoreList: this.config.element_attribute_ignorelist,
206
- elementsChainAsString: this._elementsChainAsString
207
- }
208
- );
209
- if (a) return !1;
210
- var l = this.getElementSelectors(s);
211
- if (l && l.length > 0 && (o.$element_selectors = l), t === m) {
212
- var c,
213
- u = eK(null == r || null == (c = r.getSelection()) ? void 0 : c.toString()),
214
- d = e.type ||
215
- 'clipboard';
216
- if (!u) return !1;
217
- o.$selected_content = u,
218
- o.$copy_type = d
219
- }
220
- return this.instance.capture(t, o),
221
- !0
222
- }
223
- }
224
- }
225
- isBrowserSupported() {
226
- return C(null == u ? void 0 : u.querySelectorAll)
227
- }
228
- }
229
- Math.trunc ||
230
- (Math.trunc = function (e) {
231
- return e < 0 ? Math.ceil(e) : Math.floor(e)
232
- }),
233
- Number.isInteger ||
234
- (
235
- Number.isInteger = function (e) {
236
- return M(e) &&
237
- isFinite(e) &&
238
- Math.floor(e) === e
239
- }
240
- );
241
- var th = '0123456789abcdef';
242
- class t_ {
243
- constructor(e) {
244
- if (this.bytes = e, 16 !== e.length) throw TypeError('not 128-bit length')
245
- }
246
- static fromFieldsV7(e, t, i, s) {
247
- if (
248
- !Number.isInteger(e) ||
249
- !Number.isInteger(t) ||
250
- !Number.isInteger(i) ||
251
- !Number.isInteger(s) ||
252
- e < 0 ||
253
- t < 0 ||
254
- i < 0 ||
255
- s < 0 ||
256
- e > 281474976710655 ||
257
- t > 4095 ||
258
- i > 1073741823 ||
259
- s > 4294967295
260
- ) throw RangeError('invalid field value');
261
- var r = new Uint8Array(16);
262
- return r[0] = e / 1099511627776,
263
- r[1] = e / 4294967296,
264
- r[2] = e / 16777216,
265
- r[3] = e / 65536,
266
- r[4] = e / 256,
267
- r[5] = e,
268
- r[6] = 112 | t >>> 8,
269
- r[7] = t,
270
- r[8] = 128 | i >>> 24,
271
- r[9] = i >>> 16,
272
- r[10] = i >>> 8,
273
- r[11] = i,
274
- r[12] = s >>> 24,
275
- r[13] = s >>> 16,
276
- r[14] = s >>> 8,
277
- r[15] = s,
278
- new t_(r)
279
- }
280
- toString() {
281
- for (var e = '', t = 0; t < this.bytes.length; t++) e = e + th.charAt(this.bytes[t] >>> 4) + th.charAt(15 & this.bytes[t]),
282
- 3 !== t &&
283
- 5 !== t &&
284
- 7 !== t &&
285
- 9 !== t ||
286
- (e += '-');
287
- if (36 !== e.length) throw Error('Invalid UUIDv7 was generated');
288
- return e
289
- }
290
- clone() {
291
- return new t_(this.bytes.slice(0))
292
- }
293
- equals(e) {
294
- return 0 === this.compareTo(e)
295
- }
296
- compareTo(e) {
297
- for (var t = 0; t < 16; t++) {
298
- var i = this.bytes[t] - e.bytes[t];
299
- if (0 !== i) return Math.sign(i)
300
- }
301
- return 0
302
- }
303
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
samples/script.js DELETED
@@ -1,1467 +0,0 @@
1
- // ==UserScript==
2
- // @name LMArena Proxy Injector
3
- // @namespace https://github.com/zhongruichen/lmarena-proxy
4
- // @version 1.1.0
5
- // @description A powerful injector script for LMArena reverse proxy, enabling OpenAI-compatible API access.
6
- // @author zhongruichen
7
- // @match https://*.lmarena.ai/*
8
- // @icon https://www.google.com/s2/favicons?sz=64&domain=lmarena.ai
9
- // @grant none
10
- // @run-at document-start
11
- // @all-frames true
12
- // @updateURL https://raw.githubusercontent.com/zhongruichen/lmarena-proxy/main/lmarena_injector.user.js
13
- // @downloadURL https://raw.githubusercontent.com/zhongruichen/lmarena-proxy/main/lmarena_injector.user.js
14
- // ==/UserScript==
15
- (function () {
16
- 'use strict';
17
-
18
- // --- CONFIGURATION ---
19
- // 如果你的代理服务器不在本机运行,请修改此处的 IP 地址。
20
- const CONFIG = {
21
- SERVER_URL: "ws://localhost:9080/ws",
22
- };
23
-
24
- // --- Constants ---
25
- const TARGET_API_PATH = "/api/stream/create-evaluation";
26
- const REQUIRED_COOKIE = "arena-auth-prod-v1";
27
-
28
- // --- State ---
29
- let socket;
30
- let isRefreshing = false;
31
- let pendingRequests = [];
32
- let modelRegistrySent = false;
33
- let latestTurnstileToken = null;
34
-
35
- // Track active fetch requests for abort capability
36
- const activeFetchControllers = new Map(); // requestId -> AbortController
37
-
38
- // --- Human-like Click Simulation ---
39
- function simulateHumanClick() {
40
- // Get viewport dimensions
41
- const viewportWidth = window.innerWidth;
42
- const viewportHeight = window.innerHeight;
43
-
44
- // Calculate center area with some randomness (within 10% of center)
45
- const centerX = viewportWidth / 2;
46
- const centerY = viewportHeight / 2;
47
- const randomOffsetX = (Math.random() - 0.5) * (viewportWidth * 0.1);
48
- const randomOffsetY = (Math.random() - 0.5) * (viewportHeight * 0.1);
49
-
50
- const clickX = Math.round(centerX + randomOffsetX);
51
- const clickY = Math.round(centerY + randomOffsetY);
52
-
53
- // Ensure click is within viewport bounds
54
- const finalX = Math.max(10, Math.min(viewportWidth - 10, clickX));
55
- const finalY = Math.max(10, Math.min(viewportHeight - 10, clickY));
56
-
57
- console.log(`[Auth] 🖱️ Simulating human-like click at (${finalX}, ${finalY})`);
58
-
59
- // Create and dispatch mouse events to simulate human interaction
60
- const target = document.elementFromPoint(finalX, finalY) || document.body;
61
-
62
- // Simulate mouse down, up, and click with slight delays
63
- const mouseDown = new MouseEvent('mousedown', {
64
- bubbles: true,
65
- cancelable: true,
66
- clientX: finalX,
67
- clientY: finalY,
68
- button: 0
69
- });
70
-
71
- const mouseUp = new MouseEvent('mouseup', {
72
- bubbles: true,
73
- cancelable: true,
74
- clientX: finalX,
75
- clientY: finalY,
76
- button: 0
77
- });
78
-
79
- const click = new MouseEvent('click', {
80
- bubbles: true,
81
- cancelable: true,
82
- clientX: finalX,
83
- clientY: finalY,
84
- button: 0
85
- });
86
-
87
- // Dispatch events with human-like timing
88
- target.dispatchEvent(mouseDown);
89
- setTimeout(() => {
90
- target.dispatchEvent(mouseUp);
91
- setTimeout(() => {
92
- target.dispatchEvent(click);
93
- }, Math.random() * 20 + 10); // 10-30ms delay
94
- }, Math.random() * 50 + 50); // 50-100ms delay
95
- }
96
-
97
- // --- Turnstile Token Capture (Stealth Integration) ---
98
- console.log('[Auth] Setting up Turnstile token capture...');
99
-
100
- // Store the original native function
101
- const originalCreateElement = document.createElement;
102
-
103
- // Overwrite the function with our temporary trap
104
- document.createElement = function(...args) {
105
- // Run the original function to create the element
106
- const element = originalCreateElement.apply(this, args);
107
-
108
- // Only interested in SCRIPT tags
109
- if (element.tagName === 'SCRIPT') {
110
- // Use a different approach - override setAttribute instead of src property
111
- const originalSetAttribute = element.setAttribute;
112
- element.setAttribute = function(name, value) {
113
- // Call the original setAttribute first
114
- originalSetAttribute.call(this, name, value);
115
-
116
- // If it's setting the src attribute and it's the turnstile script
117
- if (name === 'src' && value && value.includes('challenges.cloudflare.com/turnstile')) {
118
- console.log('[Auth] Turnstile SCRIPT tag found! Adding load listener.');
119
-
120
- // Add our 'load' event listener to hook the object AFTER execution
121
- element.addEventListener('load', function() {
122
- console.log('[Auth] Turnstile script has loaded. Now safe to hook turnstile.render().');
123
- if (window.turnstile) {
124
- hookTurnstileRender(window.turnstile);
125
- }
126
- });
127
-
128
- // --- THIS IS THE CRITICAL STEP ---
129
- // We have found our target, so we restore the original function immediately.
130
- console.log('[Auth] Trap is no longer needed. Restoring original document.createElement.');
131
- document.createElement = originalCreateElement;
132
- }
133
- };
134
- }
135
- return element;
136
- };
137
-
138
- function hookTurnstileRender(turnstile) {
139
- const originalRender = turnstile.render;
140
- turnstile.render = function(container, params) {
141
- console.log('[Auth] Intercepted turnstile.render() call.');
142
- const originalCallback = params.callback;
143
- params.callback = (token) => {
144
- handleTurnstileToken(token);
145
- if (originalCallback) return originalCallback(token);
146
- };
147
- return originalRender(container, params);
148
- };
149
- }
150
-
151
- function handleTurnstileToken(token) {
152
- latestTurnstileToken = token;
153
- const message = `✅ Cloudflare Turnstile Token Captured: ${token}`;
154
- console.log('%c' + message, 'color: #28a745; font-weight: bold;');
155
-
156
- console.log('[Auth] Fresh Turnstile token captured and ready for use.');
157
- }
158
-
159
- // Define the Turnstile onload callback function globally
160
- window.onloadTurnstileCallback = function() {
161
- console.log('[Auth] 🎯 Turnstile onload callback triggered');
162
- if (window.turnstile) {
163
- console.log('[Auth] 🔧 Turnstile object available, setting up hooks...');
164
- hookTurnstileRender(window.turnstile);
165
-
166
- // Create a hidden Turnstile widget to generate a token
167
- setTimeout(() => {
168
- createHiddenTurnstileWidget();
169
- }, 1000); // Wait a bit for hooks to be fully set up
170
- } else {
171
- console.warn('[Auth] ⚠️ Turnstile object not available in onload callback');
172
- }
173
- };
174
-
175
- function extractTurnstileSitekey() {
176
- // Use known LMArena sitekey directly
177
- const sitekey = '0x4AAAAAAA65vWDmG-O_lPtT';
178
- console.log('[Auth] 🔑 Using LMArena sitekey:', sitekey);
179
- return sitekey;
180
- }
181
-
182
- function createHiddenTurnstileWidget() {
183
- try {
184
- console.log('[Auth] 🎯 Creating hidden Turnstile widget to generate token...');
185
-
186
- // Extract the correct sitekey from the page
187
- const sitekey = extractTurnstileSitekey();
188
- if (!sitekey) {
189
- console.error('[Auth] ❌ Cannot create Turnstile widget: no sitekey found');
190
- return;
191
- }
192
-
193
- // Create a hidden container for the Turnstile widget
194
- const container = document.createElement('div');
195
- container.id = 'hidden-turnstile-widget';
196
- container.style.position = 'absolute';
197
- container.style.left = '-9999px';
198
- container.style.top = '-9999px';
199
- container.style.width = '300px';
200
- container.style.height = '65px';
201
- container.style.visibility = 'hidden';
202
- container.style.opacity = '0';
203
- container.style.pointerEvents = 'none';
204
-
205
- document.body.appendChild(container);
206
-
207
- // Render the Turnstile widget
208
- if (window.turnstile && window.turnstile.render) {
209
- const widgetId = window.turnstile.render(container, {
210
- sitekey: sitekey,
211
- callback: function(token) {
212
- console.log('[Auth] 🎉 Hidden Turnstile widget generated token!');
213
- handleTurnstileToken(token);
214
- },
215
- 'error-callback': function(error) {
216
- console.warn('[Auth] ⚠️ Hidden Turnstile widget error:', error);
217
- },
218
- 'expired-callback': function() {
219
- console.log('[Auth] ⏰ Hidden Turnstile token expired, creating new widget...');
220
- // Remove old widget and create new one
221
- const oldContainer = document.getElementById('hidden-turnstile-widget');
222
- if (oldContainer) {
223
- oldContainer.remove();
224
- }
225
- setTimeout(createHiddenTurnstileWidget, 1000);
226
- },
227
- theme: 'light',
228
- size: 'normal'
229
- });
230
-
231
- console.log('[Auth] ✅ Hidden Turnstile widget created with ID:', widgetId);
232
- } else {
233
- console.error('[Auth] ❌ Turnstile render function not available');
234
- }
235
- } catch (error) {
236
- console.error('[Auth] ❌ Error creating hidden Turnstile widget:', error);
237
- }
238
- }
239
-
240
- // Consolidated authentication helper functions
241
- async function initializeTurnstileIfNeeded() {
242
- console.log("[Auth] 🔧 Initializing Turnstile API if needed...");
243
-
244
- try {
245
- const script = document.createElement('script');
246
- script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback&render=explicit';
247
- script.async = true;
248
- script.defer = true;
249
-
250
- script.onload = () => {
251
- console.log("[Auth] ✅ Turnstile API script loaded successfully");
252
- };
253
- script.onerror = (error) => {
254
- console.warn("[Auth] ⚠️ Failed to load Turnstile API script:", error);
255
- };
256
-
257
- document.head.appendChild(script);
258
- console.log("[Auth] ✅ Turnstile API script injection initiated");
259
-
260
- // Schedule a human-like click 3 seconds after script injection to avoid bot detection
261
- setTimeout(() => {
262
- simulateHumanClick();
263
- }, 3000 + Math.random() * 1000); // 3-4 seconds with randomness
264
- } catch (error) {
265
- console.warn("[Auth] ⚠️ Failed to initialize Turnstile API:", error.message);
266
- throw error;
267
- }
268
- }
269
-
270
- async function ensureAuthenticationReady(requestId) {
271
- console.log(`[Auth] 🔐 Ensuring authentication is ready for request ${requestId}...`);
272
-
273
- // Check for required authentication cookie first
274
- if (!checkAuthCookie()) {
275
- console.log(`[Auth] ⚠️ Missing auth cookie for request ${requestId}, initiating auth flow...`);
276
-
277
- // Check if we have stored auth data first
278
- let authData = getStoredAuthData();
279
-
280
- if (!authData) {
281
- // No valid stored auth, need to authenticate
282
- // But first, double-check if auth cookie became available
283
- if (checkAuthCookie()) {
284
- console.log(`[Auth] ✅ Auth cookie became available during auth check for request ${requestId} - skipping authentication`);
285
- return; // Auth cookie is now available, no need to authenticate
286
- }
287
-
288
- let turnstileToken = latestTurnstileToken;
289
-
290
- if (!turnstileToken) {
291
- console.log(`[Auth] ⏳ No Turnstile token available yet for request ${requestId}, initializing Turnstile API...`);
292
-
293
- // Initialize Turnstile API if no token is available
294
- await initializeTurnstileIfNeeded();
295
-
296
- console.log(`[Auth] ⏳ Waiting for Turnstile token for request ${requestId}...`);
297
- turnstileToken = await waitForTurnstileToken();
298
-
299
- if (turnstileToken === 'auth_cookie_available') {
300
- console.log(`[Auth] ✅ Auth cookie became available during wait for request ${requestId} - skipping authentication`);
301
- return; // Auth cookie is now available, no need to authenticate
302
- }
303
-
304
- if (!turnstileToken) {
305
- throw new Error("Authentication required: Turnstile token not generated within timeout. Please refresh the page.");
306
- }
307
- }
308
-
309
- console.log(`[Auth] 🔑 Have Turnstile token for request ${requestId}, performing authentication...`);
310
- authData = await performAuthentication(turnstileToken);
311
- }
312
-
313
- console.log(`[Auth] ✅ Authentication complete for request ${requestId}`);
314
- } else {
315
- console.log(`[Auth] ✅ Auth cookie already present for request ${requestId}`);
316
- }
317
- }
318
-
319
- function getCookie(name) {
320
- const value = `; ${document.cookie}`;
321
- const parts = value.split(`; ${name}=`);
322
- if (parts.length === 2) return parts.pop().split(';').shift();
323
- return null;
324
- }
325
-
326
- function checkAuthCookie() {
327
- const authCookie = getCookie(REQUIRED_COOKIE);
328
- if (authCookie) {
329
- console.log(`[Auth] ✅ Found required cookie: ${REQUIRED_COOKIE}`);
330
- return true;
331
- } else {
332
- console.log(`[Auth] ❌ Missing required cookie: ${REQUIRED_COOKIE}`);
333
- return false;
334
- }
335
- }
336
-
337
- async function waitForTurnstileToken(maxWaitTime = 60000) {
338
- console.log(`[Auth] ⏳ Waiting for Turnstile token to be generated...`);
339
-
340
- const checkInterval = 1000; // Check every 1 second
341
- let waitTime = 0;
342
-
343
- while (waitTime < maxWaitTime) {
344
- // Check if auth cookie became available - if so, no need to wait for Turnstile token
345
- if (checkAuthCookie()) {
346
- console.log(`[Auth] ✅ Auth cookie became available during Turnstile wait after ${waitTime}ms - skipping token wait`);
347
- return 'auth_cookie_available';
348
- }
349
-
350
- if (latestTurnstileToken) {
351
- console.log(`[Auth] ✅ Turnstile token available after ${waitTime}ms`);
352
- return latestTurnstileToken;
353
- }
354
-
355
- console.log(`[Auth] ⏳ Still waiting for Turnstile token or auth cookie... (${waitTime}ms elapsed)`);
356
- await new Promise(resolve => setTimeout(resolve, checkInterval));
357
- waitTime += checkInterval;
358
- }
359
-
360
- console.warn(`[Auth] ⚠️ Turnstile token wait timeout after ${maxWaitTime}ms`);
361
- return null;
362
- }
363
-
364
- async function performAuthentication(turnstileToken) {
365
- console.log(`[Auth] 🔐 Starting authentication process with Turnstile token...`);
366
-
367
- try {
368
- // Step 1: Get JWT token from sign-up endpoint
369
- const authResponse = await fetch('https://lmarena.ai/api/sign-up', {
370
- method: 'POST',
371
- headers: {
372
- 'Content-Type': 'text/plain;charset=UTF-8',
373
- 'Accept': '*/*',
374
- // The browser automatically adds critical headers:
375
- // Cookie, User-Agent, Accept-Language, sec-ch-ua, etc.
376
- },
377
- body: JSON.stringify({
378
- turnstile_token: turnstileToken
379
- })
380
- });
381
-
382
- if (!authResponse.ok) {
383
- throw new Error(`Authentication request failed with status ${authResponse.status}`);
384
- }
385
-
386
- const authData = await authResponse.json();
387
- console.log(`[Auth] ✅ Step 1: Received JWT token from sign-up.`);
388
-
389
- // Step 2: Create and set the auth cookie
390
- const cookieValue = `base64-${btoa(JSON.stringify(authData))}`;
391
- document.cookie = `${REQUIRED_COOKIE}=${cookieValue}; path=/; domain=.lmarena.ai; secure; samesite=lax`;
392
- console.log(`[Auth] ✅ Step 2: Set auth cookie in browser.`);
393
-
394
- // Step 3: Make verification request to complete authentication
395
- const verifyResponse = await fetch('https://lmarena.ai/', {
396
- method: 'POST',
397
- headers: {
398
- 'Content-Type': 'text/plain;charset=UTF-8',
399
- 'Accept': 'text/x-component',
400
- 'next-action': '40fc0d1f8f1f9cade86c05d74881beb408c1fbf3c4',
401
- 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(app)%22%2C%7B%22children%22%3A%5B%22(with-sidebar)%22%2C%7B%22children%22%3A%5B%22__PAGE__%22%2C%7B%7D%2C%22%2F%22%2C%22refresh%22%5D%7D%5D%7D%2Cnull%2Cnull%2Ctrue%5D%7D%5D%7D%5D',
402
- 'x-deployment-id': 'dpl_55LQ8Z7ygwa1s99pJVeED1iU2jvW',
403
- // The browser automatically adds critical headers including the new auth cookie
404
- },
405
- body: JSON.stringify([])
406
- });
407
-
408
- if (!verifyResponse.ok) {
409
- throw new Error(`Authentication verification failed with status ${verifyResponse.status}`);
410
- }
411
-
412
- const verifyText = await verifyResponse.text();
413
- console.log(`[Auth] ✅ Step 3: Authentication verification completed.`);
414
- console.log(`[Auth] Verification response:`, verifyText);
415
-
416
- // Store the authentication data
417
- localStorage.setItem('lmarena_auth_data', JSON.stringify(authData));
418
- localStorage.setItem('lmarena_auth_timestamp', Date.now().toString());
419
-
420
- console.log(`[Auth] 💾 Stored authentication data. Token expires at: ${new Date(authData.expires_at * 1000).toISOString()}`);
421
- console.log(`[Auth] 🎉 Complete authentication flow finished successfully!`);
422
-
423
- return authData;
424
-
425
- } catch (error) {
426
- console.error(`[Auth] ❌ Authentication failed:`, error);
427
- throw error;
428
- }
429
- }
430
-
431
- function getStoredAuthData() {
432
- const authData = localStorage.getItem('lmarena_auth_data');
433
- const timestamp = localStorage.getItem('lmarena_auth_timestamp');
434
-
435
- if (authData && timestamp) {
436
- try {
437
- const parsedAuthData = JSON.parse(authData);
438
- const currentTime = Math.floor(Date.now() / 1000); // Current time in seconds
439
-
440
- // Check if token is still valid (with 5 minute buffer)
441
- if (parsedAuthData.expires_at && (parsedAuthData.expires_at - 300) > currentTime) {
442
- const remainingTime = parsedAuthData.expires_at - currentTime;
443
- console.log(`[Auth] Using stored auth data (expires in ${Math.round(remainingTime/60)} minutes)`);
444
- return parsedAuthData;
445
- } else {
446
- console.log(`[Auth] Stored auth data expired, removing...`);
447
- localStorage.removeItem('lmarena_auth_data');
448
- localStorage.removeItem('lmarena_auth_timestamp');
449
- }
450
- } catch (error) {
451
- console.error(`[Auth] Error parsing stored auth data:`, error);
452
- localStorage.removeItem('lmarena_auth_data');
453
- localStorage.removeItem('lmarena_auth_timestamp');
454
- }
455
- }
456
- return null;
457
- }
458
-
459
- async function waitForCloudflareAuth() {
460
- console.log("[Injector] ⏳ Waiting for Cloudflare authentication to complete...");
461
-
462
- const maxWaitTime = 45000; // 45 seconds max wait (increased for slow CF challenges)
463
- const checkInterval = 500; // Check every 0.5 seconds (faster since we're not making network requests)
464
- let waitTime = 0;
465
-
466
- while (waitTime < maxWaitTime) {
467
- try {
468
- // Check the current page DOM for CF challenge indicators
469
- if (!isCurrentPageCloudflareChallenge()) {
470
- console.log(`[Injector] ✅ Cloudflare authentication completed after ${waitTime}ms`);
471
- return true;
472
- }
473
-
474
- console.log(`[Injector] ⏳ Still waiting for CF auth... (${waitTime}ms elapsed)`);
475
-
476
- } catch (error) {
477
- console.log(`[Injector] ⏳ CF auth check failed, continuing to wait... (${waitTime}ms elapsed) - ${error.message}`);
478
- }
479
-
480
- await new Promise(resolve => setTimeout(resolve, checkInterval));
481
- waitTime += checkInterval;
482
- }
483
-
484
- console.warn(`[Injector] ⚠️ CF authentication wait timeout after ${maxWaitTime}ms`);
485
- return false;
486
- }
487
-
488
- async function processPendingRequests() {
489
- // Retrieve pending requests from localStorage (survives page refresh)
490
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
491
- if (!storedRequests) {
492
- console.log("[Injector] 📭 No pending requests found, skipping processing");
493
- return;
494
- }
495
-
496
- try {
497
- const requests = JSON.parse(storedRequests);
498
- if (!requests || requests.length === 0) {
499
- console.log("[Injector] 📭 No pending requests in storage, cleaning up");
500
- localStorage.removeItem('lmarena_pending_requests');
501
- return;
502
- }
503
-
504
- console.log(`[Injector] 🔄 Found ${requests.length} pending requests after refresh`);
505
-
506
- // CRITICAL: Wait for CF authentication to complete before processing requests
507
- console.log("[Injector] ⏳ Waiting for Cloudflare authentication to complete before processing requests...");
508
- const authComplete = await waitForCloudflareAuth();
509
-
510
- if (!authComplete) {
511
- console.error("[Injector] ❌ CF authentication timeout - requests may fail");
512
- console.log("[Injector] 🔍 CF auth failed, but NOT triggering refresh - only refreshing on actual 429/CF challenge");
513
- // Don't process requests if CF auth failed
514
- return;
515
- }
516
-
517
- console.log("[Injector] ✅ Cloudflare authentication completed, proceeding with requests");
518
-
519
- // Wait a bit more for the page to fully stabilize after CF auth
520
- await new Promise(resolve => setTimeout(resolve, 2000));
521
-
522
- // ENHANCED: Wait for either Turnstile token OR auth cookie to become available
523
- console.log("[Injector] ⏳ Waiting for either Turnstile token or auth cookie to become available...");
524
- const maxWaitTime = 60000; // 60 seconds max wait
525
- const checkInterval = 1000; // Check every 1 second
526
- let waitTime = 0;
527
- let authReady = false;
528
- let turnstileInitialized = false;
529
-
530
- while (waitTime < maxWaitTime && !authReady) {
531
- // PRIORITY 1: Check if auth cookie already exists - if so, we're done!
532
- if (checkAuthCookie()) {
533
- console.log("[Injector] 🎉 Auth cookie found after refresh, ready to proceed!");
534
- authReady = true;
535
- break;
536
- }
537
-
538
- // PRIORITY 2: Only check for Turnstile token if we don't have auth cookie
539
- if (latestTurnstileToken) {
540
- console.log("[Injector] ✅ Turnstile token available, ready to proceed!");
541
- authReady = true;
542
- break;
543
- }
544
-
545
- // PRIORITY 3: Only initialize Turnstile if we don't have auth cookie and no token yet
546
- if (!turnstileInitialized && waitTime > 2000) { // Wait 2 seconds before initializing
547
- // Double-check auth cookie before initializing Turnstile
548
- if (checkAuthCookie()) {
549
- console.log("[Injector] 🎉 Auth cookie became available before Turnstile init, skipping!");
550
- authReady = true;
551
- break;
552
- }
553
-
554
- console.log("[Injector] 🔧 No auth cookie or Turnstile token found, initializing Turnstile API...");
555
- try {
556
- await initializeTurnstileIfNeeded();
557
- turnstileInitialized = true;
558
-
559
- // Check auth cookie again after Turnstile init in case it became available
560
- if (checkAuthCookie()) {
561
- console.log("[Injector] 🎉 Auth cookie became available during Turnstile init!");
562
- authReady = true;
563
- break;
564
- }
565
- } catch (error) {
566
- console.warn("[Injector] ⚠️ Failed to initialize Turnstile API:", error.message);
567
- turnstileInitialized = true; // Don't retry
568
- }
569
- }
570
-
571
- console.log(`[Injector] ⏳ Still waiting for auth cookie or Turnstile token... (${waitTime}ms elapsed)`);
572
- await new Promise(resolve => setTimeout(resolve, checkInterval));
573
- waitTime += checkInterval;
574
- }
575
-
576
- if (!authReady) {
577
- console.log("[Injector] ⚠️ Neither auth cookie nor Turnstile token became available within timeout, proceeding anyway");
578
- }
579
-
580
- // Wait for the reconnection handshake to complete
581
- await new Promise(resolve => setTimeout(resolve, 1000));
582
-
583
- // Clear the stored requests to prevent duplicate processing
584
- localStorage.removeItem('lmarena_pending_requests');
585
-
586
- // Process each pending request
587
- for (let i = 0; i < requests.length; i++) {
588
- const request = requests[i];
589
- const { requestId, payload, files_to_upload } = request;
590
- console.log(`[Injector] 🔄 Retrying request ${requestId} after refresh (${i + 1}/${requests.length})`);
591
-
592
- // Add a small delay between requests to avoid overwhelming the server
593
- if (i > 0) {
594
- await new Promise(resolve => setTimeout(resolve, 500));
595
- }
596
-
597
- try {
598
- // Check if this is an upload request or regular request
599
- if (files_to_upload && files_to_upload.length > 0) {
600
- console.log(`[Injector] 🔄 Retrying upload request ${requestId} with ${files_to_upload.length} file(s)`);
601
- await handleUploadAndChat(requestId, payload, files_to_upload);
602
- } else {
603
- console.log(`[Injector] 🔄 Retrying regular request ${requestId}`);
604
- await executeFetchAndStreamBack(requestId, payload);
605
- }
606
- console.log(`[Injector] ✅ Successfully retried request ${requestId}`);
607
- } catch (error) {
608
- console.error(`[Injector] ❌ Failed to retry request ${requestId}:`, error);
609
- // Send error to server so it can timeout the request
610
- if (socket && socket.readyState === WebSocket.OPEN) {
611
- socket.send(JSON.stringify({
612
- request_id: requestId,
613
- data: JSON.stringify({ error: `Retry failed: ${error.message}` })
614
- }));
615
- socket.send(JSON.stringify({
616
- request_id: requestId,
617
- data: "[DONE]"
618
- }));
619
- }
620
- }
621
- }
622
-
623
- console.log(`[Injector] 🎉 Completed processing ${requests.length} pending requests`);
624
-
625
- } catch (error) {
626
- console.error("[Injector] ❌ Error processing pending requests:", error);
627
- localStorage.removeItem('lmarena_pending_requests');
628
- }
629
- }
630
-
631
- function connect() {
632
- console.log(`[Injector] Connecting to server at ${CONFIG.SERVER_URL}...`);
633
- socket = new WebSocket(CONFIG.SERVER_URL);
634
-
635
- socket.onopen = () => {
636
- console.log("[Injector] ✅ Connection established with local server.");
637
-
638
- // Send reconnection handshake if we have pending requests
639
- sendReconnectionHandshake();
640
-
641
- // Check if we have pending requests from before a CF refresh
642
- processPendingRequests();
643
-
644
- // Send model registry after connection
645
- if (!modelRegistrySent) {
646
- setTimeout(() => {
647
- sendModelRegistry();
648
- }, 2000); // Wait a bit for page to fully load
649
- }
650
- };
651
-
652
- socket.onmessage = async (event) => {
653
- try {
654
- const message = JSON.parse(event.data);
655
-
656
- // 处理心跳 ping
657
- if (message.type === 'ping') {
658
- console.log('[Injector] 💓 Received ping, sending pong...');
659
- socket.send(JSON.stringify({
660
- type: 'pong',
661
- timestamp: message.timestamp
662
- }));
663
- return;
664
- }
665
-
666
- if (message.type === 'refresh_models') {
667
- console.log('[Injector] 🔄 Received model refresh request');
668
- sendModelRegistry();
669
- return;
670
- }
671
-
672
- if (message.type === 'model_registry_ack') {
673
- console.log(`[Injector] ✅ Model registry updated with ${message.count} models`);
674
- modelRegistrySent = true;
675
- return;
676
- }
677
-
678
- if (message.type === 'reconnection_ack') {
679
- console.log(`[Injector] 🤝 Reconnection acknowledged: ${message.message}`);
680
- if (message.pending_request_ids && message.pending_request_ids.length > 0) {
681
- console.log(`[Injector] 📋 Server has ${message.pending_request_ids.length} pending requests waiting`);
682
- }
683
- return;
684
- }
685
-
686
- if (message.type === 'restoration_ack') {
687
- console.log(`[Injector] 🔄 Request restoration acknowledged: ${message.message}`);
688
- console.log(`[Injector] ✅ ${message.restored_count} request channels restored`);
689
- return;
690
- }
691
-
692
- // Handle abort request from server when client disconnects
693
- if (message.type === 'abort_request') {
694
- const requestId = message.request_id;
695
- console.log(`[Injector] 🛑 Received abort request for ${requestId}`);
696
-
697
- const controller = activeFetchControllers.get(requestId);
698
- if (controller) {
699
- controller.abort();
700
- activeFetchControllers.delete(requestId);
701
- console.log(`[Injector] ✅ Aborted fetch request ${requestId}`);
702
- } else {
703
- console.log(`[Injector] ⚠️ No active fetch found for request ${requestId}`);
704
- }
705
- return;
706
- }
707
-
708
- const { request_id, payload, files_to_upload } = message;
709
-
710
- if (!request_id || !payload) {
711
- console.error("[Injector] Invalid message from server:", message);
712
- return;
713
- }
714
-
715
- // Check if there are files to upload and route to the correct handler
716
- if (files_to_upload && files_to_upload.length > 0) {
717
- console.log(`[Injector] ⬆️ Received request with ${files_to_upload.length} file(s). Starting upload process.`);
718
- await handleUploadAndChat(request_id, payload, files_to_upload);
719
- } else {
720
- console.log(`[Injector] ⬇️ Received standard text request ${request_id}. Firing fetch.`);
721
- await executeFetchAndStreamBack(request_id, payload);
722
- }
723
-
724
- } catch (error) {
725
- console.error("[Injector] Error processing message from server:", error);
726
- }
727
- };
728
-
729
- socket.onclose = () => {
730
- console.warn("[Injector] 🔌 Connection to local server closed. Retrying in 5 seconds...");
731
- modelRegistrySent = false; // Reset flag on disconnect
732
-
733
- // Abort all active fetch requests when WebSocket closes
734
- if (activeFetchControllers.size > 0) {
735
- console.log(`[Injector] 🛑 Aborting ${activeFetchControllers.size} active fetch requests due to WebSocket disconnect`);
736
- for (const [requestId, controller] of activeFetchControllers) {
737
- controller.abort();
738
- console.log(`[Injector] ✅ Aborted fetch request ${requestId}`);
739
- }
740
- activeFetchControllers.clear();
741
- }
742
-
743
- setTimeout(connect, 5000);
744
- };
745
-
746
- socket.onerror = (error) => {
747
- console.error("[Injector] ❌ WebSocket error:", error);
748
- socket.close(); // This will trigger the onclose reconnect logic
749
- };
750
- }
751
-
752
- function isCloudflareChallenge(responseText) {
753
- // Check for common Cloudflare challenge indicators
754
- return responseText.includes('Checking your browser before accessing') ||
755
- responseText.includes('DDoS protection by Cloudflare') ||
756
- responseText.includes('cf-browser-verification') ||
757
- responseText.includes('cf-challenge-running') ||
758
- responseText.includes('__cf_chl_jschl_tk__') ||
759
- responseText.includes('cloudflare-static') ||
760
- responseText.includes('<title>Just a moment...</title>') ||
761
- responseText.includes('Enable JavaScript and cookies to continue') ||
762
- responseText.includes('window._cf_chl_opt') ||
763
- (responseText.includes('cloudflare') && responseText.includes('challenge'));
764
- }
765
-
766
- function isCurrentPageCloudflareChallenge() {
767
- // Check the current page DOM for CF challenge indicators
768
- try {
769
- // Check page title
770
- if (document.title.includes('Just a moment') ||
771
- document.title.includes('Checking your browser') ||
772
- document.title.includes('Please wait')) {
773
- console.log("[Injector] 🛡️ CF challenge detected in page title");
774
- return true;
775
- }
776
-
777
- // Check for CF challenge elements in the DOM
778
- const cfIndicators = [
779
- 'cf-browser-verification',
780
- 'cf-challenge-running',
781
- 'cf-wrapper',
782
- 'cf-error-details',
783
- 'cloudflare-static'
784
- ];
785
-
786
- for (const indicator of cfIndicators) {
787
- if (document.getElementById(indicator) ||
788
- document.querySelector(`[class*="${indicator}"]`) ||
789
- document.querySelector(`[id*="${indicator}"]`)) {
790
- console.log(`[Injector] 🛡️ CF challenge detected: found element with ${indicator}`);
791
- return true;
792
- }
793
- }
794
-
795
- // Check for CF challenge text content
796
- const bodyText = document.body ? document.body.textContent || document.body.innerText : '';
797
- if (bodyText.includes('Checking your browser before accessing') ||
798
- bodyText.includes('DDoS protection by Cloudflare') ||
799
- bodyText.includes('Enable JavaScript and cookies to continue') ||
800
- bodyText.includes('Please complete the security check') ||
801
- bodyText.includes('Verifying you are human')) {
802
- console.log("[Injector] 🛡️ CF challenge detected in page text content");
803
- return true;
804
- }
805
-
806
- // Check for CF challenge scripts
807
- const scripts = document.querySelectorAll('script');
808
- for (const script of scripts) {
809
- const scriptContent = script.textContent || script.innerHTML;
810
- if (scriptContent.includes('__cf_chl_jschl_tk__') ||
811
- scriptContent.includes('window._cf_chl_opt') ||
812
- scriptContent.includes('cf_challenge_response')) {
813
- console.log("[Injector] 🛡️ CF challenge detected in script content");
814
- return true;
815
- }
816
- }
817
-
818
- // Check if the page looks like the normal LMArena interface
819
- // Look for key elements that should be present on the normal page
820
- const normalPageIndicators = [
821
- 'nav', 'header', 'main',
822
- '[data-testid]', '[class*="chat"]', '[class*="model"]',
823
- 'input[type="text"]', 'textarea'
824
- ];
825
-
826
- let normalElementsFound = 0;
827
- for (const selector of normalPageIndicators) {
828
- if (document.querySelector(selector)) {
829
- normalElementsFound++;
830
- }
831
- }
832
-
833
- // If we found several normal page elements, it's likely not a CF challenge
834
- if (normalElementsFound >= 3) {
835
- console.log(`[Injector] ✅ Normal page detected: found ${normalElementsFound} normal elements`);
836
- return false;
837
- }
838
-
839
- // If the page is mostly empty or has very few elements, it might be a CF challenge
840
- const totalElements = document.querySelectorAll('*').length;
841
- if (totalElements < 50) {
842
- console.log(`[Injector] 🛡️ Possible CF challenge: page has only ${totalElements} elements`);
843
- return true;
844
- }
845
-
846
- console.log("[Injector] ✅ No CF challenge indicators found in current page");
847
- return false;
848
-
849
- } catch (error) {
850
- console.warn(`[Injector] ⚠️ Error checking current page for CF challenge: ${error.message}`);
851
- // If we can't check, assume no challenge to avoid blocking
852
- return false;
853
- }
854
- }
855
-
856
- async function handleCloudflareRefresh() {
857
- if (isRefreshing) {
858
- console.log("[Injector] 🔄 Already refreshing, skipping duplicate refresh request");
859
- return;
860
- }
861
-
862
- isRefreshing = true;
863
- console.log("[Injector] 🔄 Cloudflare challenge detected! Refreshing page to get new token...");
864
-
865
- try {
866
- // Check if we have any pending requests stored
867
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
868
- if (storedRequests) {
869
- const requests = JSON.parse(storedRequests);
870
- console.log(`[Injector] 💾 Found ${requests.length} pending requests, refreshing page...`);
871
- }
872
-
873
- // Refresh the page to trigger new CF authentication
874
- window.location.reload();
875
-
876
- // Wait for page to reload and CF auth to complete
877
- // The script will restart after reload, so this won't continue
878
- } catch (error) {
879
- console.error("[Injector] ❌ Error during CF refresh:", error);
880
- isRefreshing = false;
881
- }
882
- }
883
-
884
- async function handleRateLimitRefresh() {
885
- if (isRefreshing) {
886
- console.log("[Injector] 🔄 Already refreshing, skipping duplicate rate limit refresh request");
887
- return;
888
- }
889
-
890
- isRefreshing = true;
891
- console.log("[Injector] 🚫 Rate limit (429) detected! Deleting auth cookie and refreshing to create new identity...");
892
-
893
- try {
894
- // Delete ALL cookies to create a completely fresh identity
895
- console.log(`[Injector] 🗑️ Deleting ALL cookies to ensure fresh identity...`);
896
-
897
- // Get all cookies and delete them
898
- const cookies = document.cookie.split(";");
899
- for (let cookie of cookies) {
900
- const eqPos = cookie.indexOf("=");
901
- const name = eqPos > -1 ? cookie.substr(0, eqPos).trim() : cookie.trim();
902
- if (name) {
903
- // Delete for current domain
904
- document.cookie = `${name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
905
- // Delete for lmarena.ai domain
906
- document.cookie = `${name}=; path=/; domain=lmarena.ai; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
907
- // Delete for .lmarena.ai domain
908
- document.cookie = `${name}=; path=/; domain=.lmarena.ai; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
909
- // Delete for lmarena.ai domain
910
- document.cookie = `${name}=; path=/; domain=lmarena.ai; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
911
- }
912
- }
913
- console.log(`[Injector] 🗑️ Deleted ${cookies.length} cookies`);
914
-
915
- // Also clear stored auth data
916
- localStorage.removeItem('lmarena_auth_data');
917
- localStorage.removeItem('lmarena_auth_timestamp');
918
- console.log(`[Injector] 🗑️ Cleared stored auth data`);
919
-
920
- // Check if we have any pending requests stored
921
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
922
- if (storedRequests) {
923
- const requests = JSON.parse(storedRequests);
924
- console.log(`[Injector] 💾 Found ${requests.length} pending requests, refreshing page...`);
925
- }
926
-
927
- // Refresh the page to get new identity
928
- window.location.reload();
929
-
930
- // Wait for page to reload and new auth to complete
931
- // The script will restart after reload, so this won't continue
932
- } catch (error) {
933
- console.error("[Injector] ❌ Error during rate limit refresh:", error);
934
- isRefreshing = false;
935
- }
936
- }
937
-
938
- // Helper function to convert base64 to a Blob
939
- function base64ToBlob(base64, contentType) {
940
- const byteCharacters = atob(base64);
941
- const byteNumbers = new Array(byteCharacters.length);
942
- for (let i = 0; i < byteCharacters.length; i++) {
943
- byteNumbers[i] = byteCharacters.charCodeAt(i);
944
- }
945
- const byteArray = new Uint8Array(byteNumbers);
946
- return new Blob([byteArray], { type: contentType });
947
- }
948
-
949
- async function handleUploadAndChat(requestId, payload, filesToUpload) {
950
- // Create abort controller for this request
951
- const abortController = new AbortController();
952
- activeFetchControllers.set(requestId, abortController);
953
-
954
- try {
955
- console.log(`[Uploader] 🚀 Starting upload and chat for request ${requestId}`);
956
-
957
- // Ensure authentication is ready before making requests
958
- await ensureAuthenticationReady(requestId);
959
-
960
- const attachments = [];
961
- for (const file of filesToUpload) {
962
- console.log(`[Uploader] Processing file: ${file.fileName}`);
963
-
964
- // Step 1: Get Signed URL
965
- console.log(`[Uploader] Step 1: Getting signed URL for ${file.fileName}`);
966
- const signUrlResponse = await fetch('https://lmarena.ai/?mode=direct', {
967
- method: 'POST',
968
- headers: {
969
- 'Content-Type': 'text/plain;charset=UTF-8',
970
- 'Accept': 'text/x-component',
971
- 'next-action': '70921b78972dce2a8502e777b245519ec3b4304009',
972
- 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(app)%22%2C%7B%22children%22%3A%5B%22(with-sidebar)%22%2C%7B%22children%22%3A%5B%22__PAGE__%3F%7B%5C%22mode%5C%22%3A%5C%22direct%5C%22%7D%22%2C%7B%7D%2C%22%2F%3Fmode%3Ddirect%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%2Ctrue%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D',
973
- 'origin': 'https://lmarena.ai',
974
- 'referer': 'https://lmarena.ai/'
975
- },
976
- body: JSON.stringify([file.fileName, file.contentType]),
977
- signal: abortController.signal
978
- });
979
-
980
- const signUrlText = await signUrlResponse.text();
981
- console.log("[Uploader] Received for signed URL:", signUrlText);
982
-
983
- // The response format may vary. Try different parsing strategies.
984
- let signUrlData = null;
985
-
986
- // Strategy 1: Look for "1:{...}" pattern (original format)
987
- let match = signUrlText.match(/1:({.*})/);
988
- if (match && match.length >= 2) {
989
- console.log("[Uploader] Found data with '1:' prefix");
990
- signUrlData = JSON.parse(match[1]);
991
- } else {
992
- // Strategy 2: Look for any numbered prefix pattern like "0:{...}", "2:{...}", etc.
993
- match = signUrlText.match(/\d+:({.*})/);
994
- if (match && match.length >= 2) {
995
- console.log(`[Uploader] Found data with '${match[0].split(':')[0]}:' prefix`);
996
- signUrlData = JSON.parse(match[1]);
997
- } else {
998
- // Strategy 3: Try to parse the entire response as JSON
999
- try {
1000
- signUrlData = JSON.parse(signUrlText);
1001
- console.log("[Uploader] Parsed entire response as JSON");
1002
- } catch (e) {
1003
- // Strategy 4: Look for JSON objects in the response
1004
- const jsonMatches = signUrlText.match(/{[^}]*"uploadUrl"[^}]*}/g);
1005
- if (jsonMatches && jsonMatches.length > 0) {
1006
- signUrlData = JSON.parse(jsonMatches[0]);
1007
- console.log("[Uploader] Found JSON object containing uploadUrl");
1008
- } else {
1009
- throw new Error(`Could not parse signed URL response. Response: ${signUrlText}`);
1010
- }
1011
- }
1012
- }
1013
- }
1014
-
1015
- if (!signUrlData || !signUrlData.data || !signUrlData.data.uploadUrl) {
1016
- throw new Error('Signed URL data is incomplete or invalid after parsing.');
1017
- }
1018
- const { uploadUrl, key } = signUrlData.data;
1019
- console.log(`[Uploader] Got signed URL. Key: ${key}`);
1020
-
1021
- // Step 2: Upload file to storage
1022
- console.log(`[Uploader] Step 2: Uploading file to cloud storage...`);
1023
- const blob = base64ToBlob(file.data, file.contentType);
1024
- const uploadResponse = await fetch(uploadUrl, {
1025
- method: 'PUT',
1026
- headers: { 'Content-Type': file.contentType },
1027
- body: blob,
1028
- signal: abortController.signal
1029
- });
1030
- if (!uploadResponse.ok) throw new Error(`File upload failed with status ${uploadResponse.status}`);
1031
- console.log(`[Uploader] File uploaded successfully.`);
1032
-
1033
- // Step 3: Notify LMArena of upload
1034
- console.log(`[Uploader] Step 3: Notifying LMArena of upload completion...`);
1035
- const notifyResponse = await fetch('https://lmarena.ai/?mode=direct', {
1036
- method: 'POST',
1037
- headers: {
1038
- 'Content-Type': 'text/plain;charset=UTF-8',
1039
- 'Accept': 'text/x-component',
1040
- 'next-action': '6022a52184b31a48befd4697f8aa5cca57a0c68dd5',
1041
- 'next-router-state-tree': '%5B%22%22%2C%7B%22children%22%3A%5B%5B%22locale%22%2C%22en%22%2C%22d%22%5D%2C%7B%22children%22%3A%5B%22(app)%22%2C%7B%22children%22%3A%5B%22(with-sidebar)%22%2C%7B%22children%22%3A%5B%22__PAGE__%3F%7B%5C%22mode%5C%22%3A%5C%22direct%5C%22%7D%22%2C%7B%7D%2C%22%2F%3Fmode%3Ddirect%22%2C%22refresh%22%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%2Ctrue%5D%7D%2Cnull%2Cnull%5D%7D%2Cnull%2Cnull%5D',
1042
- 'origin': 'https://lmarena.ai',
1043
- 'referer': 'https://lmarena.ai/'
1044
- },
1045
- body: JSON.stringify([key]),
1046
- signal: abortController.signal
1047
- });
1048
-
1049
- const notifyText = await notifyResponse.text();
1050
- console.log(`[Uploader] Notification sent. Response:`, notifyText);
1051
-
1052
- // Parse the response from the notification step to get the final URL
1053
- const finalUrlDataLine = notifyText.split('\n').find(line => line.startsWith('1:'));
1054
- if (!finalUrlDataLine) throw new Error('Could not find final URL data in notification response.');
1055
-
1056
- const finalUrlData = JSON.parse(finalUrlDataLine.substring(2));
1057
- const finalUrl = finalUrlData.data.url;
1058
- if (!finalUrl) throw new Error('Final URL not found in notification response data.');
1059
-
1060
- console.log(`[Uploader] Extracted final GetObject URL: ${finalUrl}`);
1061
-
1062
- attachments.push({
1063
- name: key,
1064
- contentType: file.contentType,
1065
- url: finalUrl
1066
- });
1067
- }
1068
-
1069
- // Step 4: Modify payload with attachments and send final request
1070
- console.log('[Uploader] All files uploaded. Modifying final payload...');
1071
- const userMessage = payload.messages.find(m => m.role === 'user');
1072
- if (userMessage) {
1073
- userMessage.experimental_attachments = attachments;
1074
- } else {
1075
- throw new Error("Could not find user message in payload to attach files to.");
1076
- }
1077
-
1078
- console.log('[Uploader] Payload modified. Initiating final chat stream.');
1079
- await executeFetchAndStreamBack(requestId, payload);
1080
-
1081
- } catch (error) {
1082
- if (error.name === 'AbortError') {
1083
- console.log(`[Uploader] Upload process aborted for request ${requestId}`);
1084
- // Don't send error back to server since client has disconnected
1085
- } else {
1086
- console.error(`[Uploader] Error during file upload process for request ${requestId}:`, error);
1087
- // === 添加429错误处理 ===
1088
- // 检查是否是429错误(可能在上传文件的任何步骤中发生)
1089
- if (error.message && error.message.includes('429')) {
1090
- console.log(`[Uploader] 🚫 Rate limit detected during upload`);
1091
-
1092
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1093
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1094
-
1095
- if (!alreadyStored) {
1096
- existingRequests.push({
1097
- requestId,
1098
- payload,
1099
- files_to_upload: filesToUpload // 保存文件信息!这是关键
1100
- });
1101
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1102
- console.log(`[Uploader] 💾 Stored upload request ${requestId} with ${filesToUpload.length} files for retry`);
1103
- }
1104
-
1105
- handleRateLimitRefresh();
1106
- return;
1107
- }
1108
- sendToServer(requestId, JSON.stringify({ error: `File upload failed: ${error.message}` }));
1109
- sendToServer(requestId, "[DONE]");
1110
- }
1111
- } finally {
1112
- // Clean up abort controller
1113
- activeFetchControllers.delete(requestId);
1114
- }
1115
- }
1116
-
1117
- async function executeFetchAndStreamBack(requestId, payload) {
1118
- // Create abort controller for this request
1119
- const abortController = new AbortController();
1120
- activeFetchControllers.set(requestId, abortController);
1121
-
1122
- try {
1123
- console.log(`[Injector] 🚀 Starting fetch for request ${requestId}`);
1124
-
1125
- // Ensure authentication is ready before making request
1126
- await ensureAuthenticationReady(requestId);
1127
-
1128
- const response = await fetch(`https://lmarena.ai${TARGET_API_PATH}`, {
1129
- method: 'POST',
1130
- headers: {
1131
- 'Content-Type': 'text/plain;charset=UTF-8',
1132
- 'Accept': '*/*',
1133
- // The browser automatically adds critical headers:
1134
- // Cookie, User-Agent, sec-ch-ua, etc.
1135
- },
1136
- body: JSON.stringify(payload),
1137
- signal: abortController.signal
1138
- });
1139
-
1140
- // Check for rate limit (429) error first
1141
- if (response.status === 429) {
1142
- console.log(`[Injector] 🚫 Rate limit (429) detected for request ${requestId}`);
1143
-
1144
- // Check if this request is already stored to prevent duplicates
1145
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1146
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1147
-
1148
- if (!alreadyStored) {
1149
- existingRequests.push({
1150
- requestId,
1151
- payload,
1152
- files_to_upload: [] // 普通请求没有文件
1153
- });
1154
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1155
- console.log(`[Injector] 💾 Stored request ${requestId} for retry after rate limit refresh`);
1156
- } else {
1157
- console.log(`[Injector] ⚠️ Request ${requestId} already stored, skipping duplicate`);
1158
- }
1159
-
1160
- // Trigger rate limit refresh (don't await to prevent blocking)
1161
- handleRateLimitRefresh();
1162
- return; // Function will not continue after page refresh
1163
- }
1164
-
1165
- // Check if we got a Cloudflare challenge instead of the expected response
1166
- if (!response.ok || response.headers.get('content-type')?.includes('text/html')) {
1167
- const responseText = await response.text();
1168
-
1169
- if (isCloudflareChallenge(responseText)) {
1170
- console.log(`[Injector] 🛡️ Cloudflare challenge detected for request ${requestId} (Status: ${response.status})`);
1171
-
1172
- // Check if this request is already stored to prevent duplicates
1173
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1174
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1175
-
1176
- if (!alreadyStored) {
1177
- existingRequests.push({ requestId, payload });
1178
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1179
- console.log(`[Injector] 💾 Stored request ${requestId} for retry after CF refresh`);
1180
- } else {
1181
- console.log(`[Injector] ⚠️ Request ${requestId} already stored, skipping duplicate`);
1182
- }
1183
-
1184
- // Trigger automatic refresh (don't await to prevent blocking)
1185
- handleCloudflareRefresh();
1186
- return; // Function will not continue after page refresh
1187
- }
1188
-
1189
- // If it's not a CF challenge, treat as regular error
1190
- throw new Error(`Fetch failed with status ${response.status}: ${responseText}`);
1191
- }
1192
-
1193
- if (!response.body) {
1194
- throw new Error(`No response body received for request ${requestId}`);
1195
- }
1196
-
1197
- console.log(`[Injector] 📡 Starting to stream response for request ${requestId}`);
1198
- const reader = response.body.getReader();
1199
- const decoder = new TextDecoder();
1200
-
1201
- while (true) {
1202
- // Check if we've been aborted before reading
1203
- if (abortController.signal.aborted) {
1204
- console.log(`[Injector] Stream aborted for request ${requestId}, cancelling reader`);
1205
- await reader.cancel();
1206
- break;
1207
- }
1208
-
1209
- const { value, done } = await reader.read();
1210
- if (done) {
1211
- console.log(`[Injector] ✅ Stream finished for request ${requestId}.`);
1212
- sendToServer(requestId, "[DONE]");
1213
- break;
1214
- }
1215
-
1216
- const chunk = decoder.decode(value);
1217
-
1218
- // Additional check: if we get HTML in the stream, it might be a CF challenge
1219
- if (chunk.includes('<html') || chunk.includes('<!DOCTYPE')) {
1220
- if (isCloudflareChallenge(chunk)) {
1221
- console.log(`[Injector] 🛡️ Cloudflare challenge detected in stream for request ${requestId}`);
1222
-
1223
- // Check if this request is already stored to prevent duplicates
1224
- const existingRequests = JSON.parse(localStorage.getItem('lmarena_pending_requests') || '[]');
1225
- const alreadyStored = existingRequests.some(req => req.requestId === requestId);
1226
-
1227
- if (!alreadyStored) {
1228
- existingRequests.push({ requestId, payload });
1229
- localStorage.setItem('lmarena_pending_requests', JSON.stringify(existingRequests));
1230
- console.log(`[Injector] 💾 Stored request ${requestId} for retry after CF refresh (detected in stream)`);
1231
- }
1232
-
1233
- // Trigger automatic refresh (don't await to prevent blocking)
1234
- handleCloudflareRefresh();
1235
- return;
1236
- }
1237
- }
1238
-
1239
- // Check abort signal again before sending data
1240
- if (abortController.signal.aborted) {
1241
- console.log(`[Injector] Stream aborted for request ${requestId}, stopping data transmission`);
1242
- await reader.cancel();
1243
- break;
1244
- }
1245
-
1246
- // The stream often sends multiple lines in one chunk
1247
- const lines = chunk.split('\n').filter(line => line.trim() !== '');
1248
- for (const line of lines) {
1249
- // One more check before each send
1250
- if (abortController.signal.aborted) {
1251
- console.log(`[Injector] Aborting mid-chunk for request ${requestId}`);
1252
- await reader.cancel();
1253
- return; // Exit the entire function
1254
- }
1255
- sendToServer(requestId, line);
1256
- }
1257
- }
1258
-
1259
- } catch (error) {
1260
- if (error.name === 'AbortError') {
1261
- console.log(`[Injector] Fetch aborted for request ${requestId}`);
1262
- // Don't send error back to server since client has disconnected
1263
- } else {
1264
- console.error(`[Injector] ❌ Error during fetch for request ${requestId}:`, error);
1265
- sendToServer(requestId, JSON.stringify({ error: error.message }));
1266
- sendToServer(requestId, "[DONE]"); // Ensure the stream is always terminated
1267
- }
1268
- } finally {
1269
- // Clean up abort controller
1270
- activeFetchControllers.delete(requestId);
1271
- }
1272
- }
1273
-
1274
- function sendToServer(requestId, data) {
1275
- // Check if this request has been aborted
1276
- const controller = activeFetchControllers.get(requestId);
1277
- if (controller && controller.signal.aborted) {
1278
- console.log(`[Injector] Not sending data for aborted request ${requestId}`);
1279
- return;
1280
- }
1281
-
1282
- if (socket && socket.readyState === WebSocket.OPEN) {
1283
- const message = {
1284
- request_id: requestId,
1285
- data: data
1286
- };
1287
- socket.send(JSON.stringify(message));
1288
- } else {
1289
- console.error("[Injector] Cannot send data, socket is not open.");
1290
- }
1291
- }
1292
-
1293
- function extractModelRegistry() {
1294
- console.log('[Injector] 🔍 Extracting model registry from script tags...');
1295
-
1296
- try {
1297
- const scripts = document.querySelectorAll('script');
1298
- let modelData = null;
1299
- const searchString = CONFIG.MODEL_REGISTRY.SEARCH_STRING;
1300
-
1301
- for (const script of scripts) {
1302
- const content = script.textContent || script.innerHTML;
1303
- if (content.includes(searchString)) {
1304
- console.log('[Injector] Found the target script tag.');
1305
-
1306
- // The entire payload is inside this one script's content.
1307
- const startIndex = content.indexOf(searchString);
1308
- const payloadStartIndex = startIndex + searchString.length; // Start at the first '[' after the ':'
1309
-
1310
- let balance = 1;
1311
- let endIndex = -1;
1312
- let inString = false;
1313
-
1314
- // Start searching from after the first bracket
1315
- for (let i = payloadStartIndex + 1; i < content.length; i++) {
1316
- const char = content[i];
1317
- const prevChar = content[i-1];
1318
-
1319
- // Toggle inString state if we encounter a quote that is not escaped
1320
- if (char === '"' && prevChar !== '\\') {
1321
- inString = !inString;
1322
- }
1323
-
1324
- // Only count brackets if we're not inside a string
1325
- if (!inString) {
1326
- if (char === '[') {
1327
- balance++;
1328
- } else if (char === ']') {
1329
- balance--;
1330
- }
1331
- }
1332
-
1333
- // If balance is zero, we've found the end of our JSON object
1334
- if (balance === 0) {
1335
- endIndex = i + 1;
1336
- break;
1337
- }
1338
- }
1339
-
1340
- if (endIndex === -1) {
1341
- console.error('[Injector] Could not find the end of the JSON payload using bracket counting.');
1342
- continue;
1343
- }
1344
-
1345
- const rawPayload = content.substring(payloadStartIndex, endIndex);
1346
- const jsonString = rawPayload.replace(/\\"/g, '"').replace(/\\\\/g, '\\');
1347
-
1348
- console.log('[Injector] Payload extracted via bracket counting. Parsing JSON...');
1349
- const parsedData = JSON.parse(jsonString);
1350
-
1351
- function findAllInitialStates(obj) {
1352
- let allModels = [];
1353
- function search(currentObj) {
1354
- if (!currentObj || typeof currentObj !== 'object') return;
1355
- if (currentObj.hasOwnProperty('initialState') && Array.isArray(currentObj.initialState)) {
1356
- if (currentObj.initialState.length > 0 && currentObj.initialState[0] && currentObj.initialState[0].publicName) {
1357
- allModels = allModels.concat(currentObj.initialState);
1358
- }
1359
- }
1360
- for (const key in currentObj) {
1361
- if (currentObj.hasOwnProperty(key)) search(currentObj[key]);
1362
- }
1363
- }
1364
- search(obj);
1365
- return allModels;
1366
- }
1367
-
1368
- modelData = findAllInitialStates(parsedData);
1369
- if (modelData && modelData.length > 0) {
1370
- console.log(`[Injector] Successfully aggregated ${modelData.length} models.`);
1371
- break; // Exit after processing the correct script
1372
- }
1373
- }
1374
- }
1375
-
1376
- if (!modelData || modelData.length === 0) {
1377
- console.warn('[Injector] Model extraction failed.');
1378
- return null;
1379
- }
1380
-
1381
- const registry = {};
1382
- modelData.forEach(model => {
1383
- if (!model || typeof model !== 'object' || !model.publicName) return;
1384
- if (registry[model.publicName]) return;
1385
-
1386
- let type = 'chat';
1387
- if (model.capabilities && model.capabilities.outputCapabilities) {
1388
- if (model.capabilities.outputCapabilities.image) type = 'image';
1389
- else if (model.capabilities.outputCapabilities.video) type = 'video';
1390
- }
1391
-
1392
- registry[model.publicName] = { type: type, ...model };
1393
- });
1394
-
1395
- console.log(`[Injector] ✅ Extracted ${Object.keys(registry).length} unique models.`);
1396
- return registry;
1397
-
1398
- } catch (error) {
1399
- console.error('[Injector] ❌ Error extracting model registry:', error);
1400
- return null;
1401
- }
1402
- }
1403
-
1404
- function sendReconnectionHandshake() {
1405
- if (!socket || socket.readyState !== WebSocket.OPEN) {
1406
- console.log('[Injector] ⚠️ WebSocket not ready, cannot send reconnection handshake');
1407
- return;
1408
- }
1409
-
1410
- // Get pending request IDs from localStorage
1411
- const storedRequests = localStorage.getItem('lmarena_pending_requests');
1412
- let pendingRequestIds = [];
1413
-
1414
- if (storedRequests) {
1415
- try {
1416
- const requests = JSON.parse(storedRequests);
1417
- pendingRequestIds = requests.map(req => req.requestId);
1418
- console.log(`[Injector] 🤝 Sending reconnection handshake with ${pendingRequestIds.length} pending requests`);
1419
- } catch (error) {
1420
- console.error("[Injector] Error parsing stored requests for handshake:", error);
1421
- }
1422
- }
1423
-
1424
- const handshakeMessage = {
1425
- type: 'reconnection_handshake',
1426
- pending_request_ids: pendingRequestIds,
1427
- timestamp: Date.now()
1428
- };
1429
-
1430
- socket.send(JSON.stringify(handshakeMessage));
1431
- console.log(`[Injector] 📤 Sent reconnection handshake`);
1432
- }
1433
-
1434
- function sendModelRegistry() {
1435
- if (!socket || socket.readyState !== WebSocket.OPEN) {
1436
- console.log('[Injector] ⚠️ WebSocket not ready, cannot send model registry');
1437
- return;
1438
- }
1439
-
1440
- const models = extractModelRegistry();
1441
-
1442
- if (models && Object.keys(models).length > 0) {
1443
- const message = {
1444
- type: 'model_registry',
1445
- models: models
1446
- };
1447
-
1448
- socket.send(JSON.stringify(message));
1449
- console.log(`[Injector] 📤 Sent model registry with ${Object.keys(models).length} models`);
1450
- } else {
1451
- console.warn('[Injector] ⚠️ No models extracted, not sending registry');
1452
- }
1453
- }
1454
-
1455
- // --- Start the connection ---
1456
- connect();
1457
-
1458
- // Also try to send model registry when page loads
1459
- if (document.readyState === 'loading') {
1460
- document.addEventListener('DOMContentLoaded', () => {
1461
- setTimeout(sendModelRegistry, 3000);
1462
- });
1463
- } else {
1464
- setTimeout(sendModelRegistry, 3000);
1465
- }
1466
-
1467
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/__pycache__/main.cpython-313.pyc ADDED
Binary file (79 kB). View file
 
src/main.py CHANGED
@@ -4,8 +4,10 @@ import re
4
  import uuid
5
  import time
6
  import secrets
 
 
7
  from collections import defaultdict
8
- from typing import Optional, Dict
9
  from datetime import datetime, timezone, timedelta
10
 
11
  import uvicorn
@@ -20,7 +22,7 @@ import httpx
20
  # CONFIGURATION
21
  # ============================================================
22
  # Set to True for detailed logging, False for minimal logging
23
- DEBUG = True
24
 
25
  # Port to run the server on
26
  PORT = 8000
@@ -48,6 +50,185 @@ def uuid7():
48
  hex_str = f"{uuid_int:032x}"
49
  return f"{hex_str[0:8]}-{hex_str[8:12]}-{hex_str[12:16]}-{hex_str[16:20]}-{hex_str[20:32]}"
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  app = FastAPI()
52
 
53
  # --- Constants & Global State ---
@@ -1091,6 +1272,15 @@ async def api_chat_completions(request: Request, api_key: dict = Depends(rate_li
1091
 
1092
  debug_print(f"✅ Found model ID: {model_id}")
1093
 
 
 
 
 
 
 
 
 
 
1094
  # Log usage
1095
  model_usage_stats[model_public_name] += 1
1096
  # Save stats immediately after incrementing
@@ -1098,20 +1288,20 @@ async def api_chat_completions(request: Request, api_key: dict = Depends(rate_li
1098
  config["usage_stats"] = dict(model_usage_stats)
1099
  save_config(config)
1100
 
1101
- # Use last message as prompt
1102
- prompt = messages[-1].get("content", "")
1103
-
1104
- # Validate prompt is a string and not too large
1105
- if not isinstance(prompt, str):
1106
- debug_print("❌ Prompt content must be a string")
1107
- raise HTTPException(status_code=400, detail="Message content must be a string.")
1108
 
 
1109
  if not prompt:
1110
- debug_print("❌ Last message has no content")
1111
- raise HTTPException(status_code=400, detail="Last message must have content.")
 
 
1112
 
1113
  # Log prompt length for debugging character limit issues
1114
  debug_print(f"📝 User prompt length: {len(prompt)} characters")
 
1115
  debug_print(f"📝 User prompt preview: {prompt[:100]}..." if len(prompt) > 100 else f"📝 User prompt: {prompt}")
1116
 
1117
  # Check for reasonable character limit (LMArena appears to have limits)
@@ -1157,7 +1347,7 @@ async def api_chat_completions(request: Request, api_key: dict = Depends(rate_li
1157
  "id": user_msg_id,
1158
  "role": "user",
1159
  "content": prompt,
1160
- "experimental_attachments": [],
1161
  "parentMessageIds": [],
1162
  "participantPosition": "a",
1163
  "modelId": None,
@@ -1184,6 +1374,7 @@ async def api_chat_completions(request: Request, api_key: dict = Depends(rate_li
1184
  url = "https://lmarena.ai/nextjs-api/stream/create-evaluation"
1185
  debug_print(f"📤 Target URL: {url}")
1186
  debug_print(f"📦 Payload structure: {len(payload['messages'])} messages")
 
1187
  else:
1188
  debug_print("🔄 Using EXISTING conversation session")
1189
  # Follow-up message - Generate new message IDs
@@ -1218,7 +1409,7 @@ async def api_chat_completions(request: Request, api_key: dict = Depends(rate_li
1218
  "id": user_msg_id,
1219
  "role": "user",
1220
  "content": prompt,
1221
- "experimental_attachments": [],
1222
  "parentMessageIds": [last_msg_id],
1223
  "participantPosition": "a",
1224
  "modelId": None,
@@ -1254,6 +1445,7 @@ async def api_chat_completions(request: Request, api_key: dict = Depends(rate_li
1254
  url = f"https://lmarena.ai/nextjs-api/stream/post-to-evaluation/{session['conversation_id']}"
1255
  debug_print(f"📤 Target URL: {url}")
1256
  debug_print(f"📦 Payload structure: {len(payload['messages'])} messages")
 
1257
 
1258
  debug_print(f"\n🚀 Making API request to LMArena...")
1259
  debug_print(f"⏱️ Timeout set to: 120 seconds")
 
4
  import uuid
5
  import time
6
  import secrets
7
+ import base64
8
+ import mimetypes
9
  from collections import defaultdict
10
+ from typing import Optional, Dict, List
11
  from datetime import datetime, timezone, timedelta
12
 
13
  import uvicorn
 
22
  # CONFIGURATION
23
  # ============================================================
24
  # Set to True for detailed logging, False for minimal logging
25
+ DEBUG = False
26
 
27
  # Port to run the server on
28
  PORT = 8000
 
50
  hex_str = f"{uuid_int:032x}"
51
  return f"{hex_str[0:8]}-{hex_str[8:12]}-{hex_str[12:16]}-{hex_str[16:20]}-{hex_str[20:32]}"
52
 
53
+ # Image upload helper functions
54
+ async def upload_image_to_lmarena(image_data: bytes, mime_type: str, filename: str) -> Optional[tuple]:
55
+ """
56
+ Upload an image to LMArena R2 storage and return the key and download URL.
57
+
58
+ Args:
59
+ image_data: Binary image data
60
+ mime_type: MIME type of the image (e.g., 'image/png')
61
+ filename: Original filename for the image
62
+
63
+ Returns:
64
+ Tuple of (key, download_url) if successful, or None if upload fails
65
+ """
66
+ try:
67
+ # Step 1: Request upload URL
68
+ debug_print(f"📤 Step 1: Requesting upload URL for {filename}")
69
+
70
+ # Prepare headers for Next.js Server Action
71
+ request_headers = get_request_headers()
72
+ request_headers.update({
73
+ "Accept": "text/x-component",
74
+ "Content-Type": "text/plain;charset=UTF-8",
75
+ "Next-Action": "70cb393626e05a5f0ce7dcb46977c36c139fa85f91",
76
+ "Referer": "https://lmarena.ai/?mode=direct",
77
+ })
78
+
79
+ async with httpx.AsyncClient() as client:
80
+ response = await client.post(
81
+ "https://lmarena.ai/?mode=direct",
82
+ headers=request_headers,
83
+ content=json.dumps([filename, mime_type]),
84
+ timeout=30.0
85
+ )
86
+ response.raise_for_status()
87
+
88
+ # Parse response - format: 0:{...}\n1:{...}\n
89
+ lines = response.text.strip().split('\n')
90
+ upload_data = None
91
+ for line in lines:
92
+ if line.startswith('1:'):
93
+ upload_data = json.loads(line[2:])
94
+ break
95
+
96
+ if not upload_data or not upload_data.get('success'):
97
+ debug_print(f"❌ Failed to get upload URL: {response.text}")
98
+ return None
99
+
100
+ upload_url = upload_data['data']['uploadUrl']
101
+ key = upload_data['data']['key']
102
+ debug_print(f"✅ Got upload URL and key: {key}")
103
+
104
+ # Step 2: Upload image to R2 storage
105
+ debug_print(f"📤 Step 2: Uploading image to R2 storage ({len(image_data)} bytes)")
106
+ response = await client.put(
107
+ upload_url,
108
+ content=image_data,
109
+ headers={"Content-Type": mime_type},
110
+ timeout=60.0
111
+ )
112
+ response.raise_for_status()
113
+ debug_print(f"✅ Image uploaded successfully")
114
+
115
+ # Step 3: Get signed download URL (uses different Next-Action)
116
+ debug_print(f"📤 Step 3: Requesting signed download URL")
117
+ request_headers_step3 = request_headers.copy()
118
+ request_headers_step3["Next-Action"] = "6064c365792a3eaf40a60a874b327fe031ea6f22d7"
119
+
120
+ response = await client.post(
121
+ "https://lmarena.ai/?mode=direct",
122
+ headers=request_headers_step3,
123
+ content=json.dumps([key]),
124
+ timeout=30.0
125
+ )
126
+ response.raise_for_status()
127
+
128
+ # Parse response
129
+ lines = response.text.strip().split('\n')
130
+ download_data = None
131
+ for line in lines:
132
+ if line.startswith('1:'):
133
+ download_data = json.loads(line[2:])
134
+ break
135
+
136
+ if not download_data or not download_data.get('success'):
137
+ debug_print(f"❌ Failed to get download URL: {response.text}")
138
+ return None
139
+
140
+ download_url = download_data['data']['url']
141
+ debug_print(f"✅ Got signed download URL: {download_url[:100]}...")
142
+ return (key, download_url)
143
+
144
+ except Exception as e:
145
+ debug_print(f"❌ Error uploading image: {e}")
146
+ return None
147
+
148
+ async def process_message_content(content, model_capabilities: dict) -> tuple[str, List[dict]]:
149
+ """
150
+ Process message content, handle images if present and model supports them.
151
+
152
+ Args:
153
+ content: Message content (string or list of content parts)
154
+ model_capabilities: Model's capability dictionary
155
+
156
+ Returns:
157
+ Tuple of (text_content, experimental_attachments)
158
+ """
159
+ # Check if model supports image input
160
+ supports_images = model_capabilities.get('inputCapabilities', {}).get('image', False)
161
+
162
+ # If content is a string, return it as-is
163
+ if isinstance(content, str):
164
+ return content, []
165
+
166
+ # If content is a list (OpenAI format with multiple parts)
167
+ if isinstance(content, list):
168
+ text_parts = []
169
+ attachments = []
170
+
171
+ for part in content:
172
+ if isinstance(part, dict):
173
+ if part.get('type') == 'text':
174
+ text_parts.append(part.get('text', ''))
175
+
176
+ elif part.get('type') == 'image_url' and supports_images:
177
+ image_url = part.get('image_url', {})
178
+ if isinstance(image_url, dict):
179
+ url = image_url.get('url', '')
180
+ else:
181
+ url = image_url
182
+
183
+ # Handle base64-encoded images
184
+ if url.startswith('data:'):
185
+ # Format: data:image/png;base64,iVBORw0KGgo...
186
+ try:
187
+ header, data = url.split(',', 1)
188
+ mime_type = header.split(';')[0].split(':')[1]
189
+
190
+ # Decode base64
191
+ image_data = base64.b64decode(data)
192
+
193
+ # Generate filename
194
+ ext = mimetypes.guess_extension(mime_type) or '.png'
195
+ filename = f"upload-{uuid.uuid4()}{ext}"
196
+
197
+ debug_print(f"🖼️ Processing base64 image: {filename}, size: {len(image_data)} bytes")
198
+
199
+ # Upload to LMArena
200
+ upload_result = await upload_image_to_lmarena(image_data, mime_type, filename)
201
+
202
+ if upload_result:
203
+ key, download_url = upload_result
204
+ # Add as attachment in LMArena format
205
+ attachments.append({
206
+ "name": key,
207
+ "contentType": mime_type,
208
+ "url": download_url
209
+ })
210
+ debug_print(f"✅ Image uploaded and added to attachments")
211
+ else:
212
+ debug_print(f"⚠️ Failed to upload image, skipping")
213
+ except Exception as e:
214
+ debug_print(f"❌ Error processing base64 image: {e}")
215
+
216
+ # Handle URL images (direct URLs)
217
+ elif url.startswith('http://') or url.startswith('https://'):
218
+ # For external URLs, we'd need to download and re-upload
219
+ # For now, skip this case
220
+ debug_print(f"⚠️ External image URLs not yet supported: {url[:100]}")
221
+
222
+ elif part.get('type') == 'image_url' and not supports_images:
223
+ debug_print(f"⚠️ Image provided but model doesn't support images")
224
+
225
+ # Combine text parts
226
+ text_content = '\n'.join(text_parts).strip()
227
+ return text_content, attachments
228
+
229
+ # Fallback
230
+ return str(content), []
231
+
232
  app = FastAPI()
233
 
234
  # --- Constants & Global State ---
 
1272
 
1273
  debug_print(f"✅ Found model ID: {model_id}")
1274
 
1275
+ # Get model capabilities
1276
+ model_capabilities = {}
1277
+ for m in models:
1278
+ if m.get("id") == model_id:
1279
+ model_capabilities = m.get("capabilities", {})
1280
+ break
1281
+
1282
+ debug_print(f"🔧 Model capabilities: {model_capabilities}")
1283
+
1284
  # Log usage
1285
  model_usage_stats[model_public_name] += 1
1286
  # Save stats immediately after incrementing
 
1288
  config["usage_stats"] = dict(model_usage_stats)
1289
  save_config(config)
1290
 
1291
+ # Process last message content (may include images)
1292
+ last_message_content = messages[-1].get("content", "")
1293
+ prompt, experimental_attachments = await process_message_content(last_message_content, model_capabilities)
 
 
 
 
1294
 
1295
+ # Validate prompt
1296
  if not prompt:
1297
+ # If no text but has attachments, that's okay for vision models
1298
+ if not experimental_attachments:
1299
+ debug_print("❌ Last message has no content")
1300
+ raise HTTPException(status_code=400, detail="Last message must have content.")
1301
 
1302
  # Log prompt length for debugging character limit issues
1303
  debug_print(f"📝 User prompt length: {len(prompt)} characters")
1304
+ debug_print(f"🖼️ Attachments: {len(experimental_attachments)} images")
1305
  debug_print(f"📝 User prompt preview: {prompt[:100]}..." if len(prompt) > 100 else f"📝 User prompt: {prompt}")
1306
 
1307
  # Check for reasonable character limit (LMArena appears to have limits)
 
1347
  "id": user_msg_id,
1348
  "role": "user",
1349
  "content": prompt,
1350
+ "experimental_attachments": experimental_attachments,
1351
  "parentMessageIds": [],
1352
  "participantPosition": "a",
1353
  "modelId": None,
 
1374
  url = "https://lmarena.ai/nextjs-api/stream/create-evaluation"
1375
  debug_print(f"📤 Target URL: {url}")
1376
  debug_print(f"📦 Payload structure: {len(payload['messages'])} messages")
1377
+ debug_print(f"🔍 Full payload: {json.dumps(payload, indent=2)}")
1378
  else:
1379
  debug_print("🔄 Using EXISTING conversation session")
1380
  # Follow-up message - Generate new message IDs
 
1409
  "id": user_msg_id,
1410
  "role": "user",
1411
  "content": prompt,
1412
+ "experimental_attachments": experimental_attachments,
1413
  "parentMessageIds": [last_msg_id],
1414
  "participantPosition": "a",
1415
  "modelId": None,
 
1445
  url = f"https://lmarena.ai/nextjs-api/stream/post-to-evaluation/{session['conversation_id']}"
1446
  debug_print(f"📤 Target URL: {url}")
1447
  debug_print(f"📦 Payload structure: {len(payload['messages'])} messages")
1448
+ debug_print(f"🔍 Full payload: {json.dumps(payload, indent=2)}")
1449
 
1450
  debug_print(f"\n🚀 Making API request to LMArena...")
1451
  debug_print(f"⏱️ Timeout set to: 120 seconds")
test_image_support.py ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Test script for image upload support in LMArenaBridge.
3
+
4
+ This script tests the image upload functionality by sending a base64-encoded image
5
+ to a vision-capable model through the OpenAI-compatible API.
6
+ """
7
+
8
+ import openai
9
+ import base64
10
+ import sys
11
+
12
+ # Configuration
13
+ API_BASE_URL = "http://localhost:8000/api/v1"
14
+ API_KEY = "sk-lmab-4d4c13f6-7846-4f94-a261-f59911838196" # Replace with your actual API key
15
+ MODEL = "gemini-2.5-flash" # Replace with an actual vision-capable model from LMArena
16
+
17
+ def create_test_image():
18
+ """Read test image from test.png file"""
19
+ try:
20
+ with open('test.png', 'rb') as f:
21
+ png_data = f.read()
22
+ return base64.b64encode(png_data).decode('utf-8')
23
+ except FileNotFoundError:
24
+ print("❌ Error: test.png not found. Please create a test.png file in the current directory.")
25
+ sys.exit(1)
26
+
27
+ def test_image_api():
28
+ """Test sending an image through the API"""
29
+
30
+ # Create client
31
+ client = openai.OpenAI(
32
+ base_url=API_BASE_URL,
33
+ api_key=API_KEY
34
+ )
35
+
36
+ print("Reading test image from test.png...")
37
+ image_data = create_test_image()
38
+ print(f"Image data length: {len(image_data)} characters")
39
+
40
+ print(f"\nSending request to model: {MODEL}")
41
+ print("Message: 'What color is this pixel?'")
42
+
43
+ try:
44
+ response = client.chat.completions.create(
45
+ model=MODEL,
46
+ messages=[
47
+ {
48
+ "role": "user",
49
+ "content": [
50
+ {"type": "text", "text": "What color is this pixel? Please describe what you see."},
51
+ {
52
+ "type": "image_url",
53
+ "image_url": {
54
+ "url": f"data:image/png;base64,{image_data}"
55
+ }
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ )
61
+
62
+ print("\n✅ Success!")
63
+ print(f"Response object: {response}")
64
+ print(f"Response type: {type(response)}")
65
+ print(f"Has choices: {hasattr(response, 'choices')}")
66
+ if hasattr(response, 'choices') and response.choices:
67
+ print(f"Choices length: {len(response.choices)}")
68
+ print(f"First choice: {response.choices[0]}")
69
+ if response.choices[0]:
70
+ print(f"Response: {response.choices[0].message.content}")
71
+ print(f"\nModel: {response.model}")
72
+ print(f"Finish reason: {response.choices[0].finish_reason}")
73
+ else:
74
+ print("⚠️ No choices in response!")
75
+
76
+ except Exception as e:
77
+ print(f"\n❌ Error: {e}")
78
+ import traceback
79
+ traceback.print_exc()
80
+ sys.exit(1)
81
+
82
+ if __name__ == "__main__":
83
+ print("=" * 60)
84
+ print("LMArenaBridge Image Upload Test")
85
+ print("=" * 60)
86
+
87
+ if API_KEY == "your-api-key-here":
88
+ print("\n⚠️ Please set your API_KEY in the script first!")
89
+ sys.exit(1)
90
+
91
+ test_image_api()
92
+
93
+ print("\n" + "=" * 60)
94
+ print("Test completed!")
95
+ print("=" * 60)