reeval 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-DVHkx8aT.js → agent-D-6z0Z3F.js} +3 -3
- package/dist/{agent-DVHkx8aT.js.map → agent-D-6z0Z3F.js.map} +1 -1
- package/dist/assemble-Dm4gD1TU.js +2 -0
- package/dist/{assemble-B-nmz8oH.js → assemble-DtouO0iQ.js} +4 -3
- package/dist/assemble-DtouO0iQ.js.map +1 -0
- package/dist/{cli--CQ3Iy9q.js → cli-CGuUdOPK.js} +22 -22
- package/dist/{cli--CQ3Iy9q.js.map → cli-CGuUdOPK.js.map} +1 -1
- package/dist/cli.js +1 -1
- package/dist/{command-DQAvbG7d.js → command-BekzrvZI.js} +2 -2
- package/dist/{command-DQAvbG7d.js.map → command-BekzrvZI.js.map} +1 -1
- package/dist/{command-D-jnQWVG.js → command-CCuYRGsI.js} +3 -3
- package/dist/{command-D-jnQWVG.js.map → command-CCuYRGsI.js.map} +1 -1
- package/dist/{command-BSJzHMtP.js → command-CLKuXn6Z.js} +2 -2
- package/dist/{command-BSJzHMtP.js.map → command-CLKuXn6Z.js.map} +1 -1
- package/dist/{config-Cuj0kVYj.js → config-DqJvSqYo.js} +5 -5
- package/dist/{config-Cuj0kVYj.js.map → config-DqJvSqYo.js.map} +1 -1
- package/dist/{docker-DnWAVdEm.js → docker-Buu3a60z.js} +1 -1
- package/dist/{docker-oSbCExHL.js → docker-w0CSdQq0.js} +2 -2
- package/dist/{docker-oSbCExHL.js.map → docker-w0CSdQq0.js.map} +1 -1
- package/dist/{doctor-CxlH1pDM.js → doctor-Bs1_pG9_.js} +7 -7
- package/dist/{doctor-CxlH1pDM.js.map → doctor-Bs1_pG9_.js.map} +1 -1
- package/dist/{egress-73SQfKdx.js → egress-QJMzVtbw.js} +2 -2
- package/dist/{egress-73SQfKdx.js.map → egress-QJMzVtbw.js.map} +1 -1
- package/dist/{environment-Mz7wvrtD.js → environment-9WHSWLxH.js} +5 -15
- package/dist/{environment-Mz7wvrtD.js.map → environment-9WHSWLxH.js.map} +1 -1
- package/dist/harness.d.ts +1 -1
- package/dist/{images-Cc1-coFc.js → images-2m2U-UQc.js} +5 -5
- package/dist/{images-Cc1-coFc.js.map → images-2m2U-UQc.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/{init-CFljS8BJ.js → init-CH9UY7Bt.js} +4 -4
- package/dist/{init-CFljS8BJ.js.map → init-CH9UY7Bt.js.map} +1 -1
- package/dist/init-DJuxvYCW.js +2 -0
- package/dist/judge.d.ts +1 -1
- package/dist/{options-CAQhu--C.js → options-k25fjaER.js} +30 -32
- package/dist/options-k25fjaER.js.map +1 -0
- package/dist/{preflight-BypZMNBG.js → preflight-B6hfAXhh.js} +2 -2
- package/dist/{preflight-BypZMNBG.js.map → preflight-B6hfAXhh.js.map} +1 -1
- package/dist/{preflight-BtubXKQ8.js → preflight-D2Hce5Jp.js} +1 -1
- package/dist/{prepare-Cwv0bHs_.js → prepare-C3fefNnV.js} +1 -1
- package/dist/{prepare-D6Uzcubb.js → prepare-NuWsT11j.js} +3 -3
- package/dist/{prepare-D6Uzcubb.js.map → prepare-NuWsT11j.js.map} +1 -1
- package/dist/{providers-BUOxitcT.js → providers-BMIGzPPG.js} +1 -1
- package/dist/{providers-2p3ylMHI.js → providers-Bfx5Mnk9.js} +2 -2
- package/dist/{providers-2p3ylMHI.js.map → providers-Bfx5Mnk9.js.map} +1 -1
- package/dist/{results-CeXb8Wde.js → results-BtvBJAp-.js} +2 -2
- package/dist/{results-CeXb8Wde.js.map → results-BtvBJAp-.js.map} +1 -1
- package/dist/{sandbox-By2gkdkC.js → sandbox-BJPWuQE9.js} +2 -2
- package/dist/{sandbox-By2gkdkC.js.map → sandbox-BJPWuQE9.js.map} +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +1 -1
- package/dist/{server-Bi61uiY0.js → server-5DWmKKfV.js} +2 -2
- package/dist/{server-Bi61uiY0.js.map → server-5DWmKKfV.js.map} +1 -1
- package/dist/server-buV3adNS.js +2 -0
- package/dist/studio-app/assets/{index-D6XyfFSH.js → index-Da1XDzx8.js} +1 -1
- package/dist/studio-app/index.html +1 -1
- package/dist/{types-DLec-6Cx.d.ts → types-CYJldf5N.d.ts} +44 -13
- package/dist/view/index.d.ts +1 -1
- package/dist/{workspace-CyoXG6CY.js → workspace-BVgNhC9h.js} +1 -1
- package/dist/{workspace-C2S0Z6gl.js → workspace-uPapQj16.js} +2 -2
- package/dist/{workspace-C2S0Z6gl.js.map → workspace-uPapQj16.js.map} +1 -1
- package/package.json +1 -1
- package/dist/assemble-B-nmz8oH.js.map +0 -1
- package/dist/assemble-CmRVDZ2Q.js +0 -2
- package/dist/init-z2ZPn9Tj.js +0 -2
- package/dist/options-CAQhu--C.js.map +0 -1
- package/dist/server-CsSBL8NC.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-
|
|
1
|
+
{"version":3,"file":"sandbox-BJPWuQE9.js","names":[],"sources":["../src/sandbox.ts"],"mappings":"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"}
|
package/dist/sandbox.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as SandboxDescriptor, j as FakeSandboxDescriptor, m as DockerSandboxDescriptor } from "./types-
|
|
1
|
+
import { Q as SandboxDescriptor, j as FakeSandboxDescriptor, m as DockerSandboxDescriptor } from "./types-CYJldf5N.js";
|
|
2
2
|
//#region src/sandbox.d.ts
|
|
3
3
|
export type DockerOptions = Omit<DockerSandboxDescriptor, 'kind' | 'dockerfile'> & {
|
|
4
4
|
/** Relative to the file that calls `docker()`, or an absolute path or `URL`. */
|
package/dist/sandbox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as fakeSandbox, t as docker } from "./sandbox-
|
|
1
|
+
import { n as fakeSandbox, t as docker } from "./sandbox-BJPWuQE9.js";
|
|
2
2
|
export { docker, fakeSandbox };
|
|
@@ -75,7 +75,7 @@ async function liveTranscript(source, runId, key) {
|
|
|
75
75
|
const [realBase, real] = await Promise.all([realpath(base), realpath(join(base, "evals", recordFileName(key)))]);
|
|
76
76
|
if (!real.startsWith(realBase + sep)) return null;
|
|
77
77
|
const record = JSON.parse(await readFile(real, "utf8"));
|
|
78
|
-
const { transcriptLines } = await import("./assemble-
|
|
78
|
+
const { transcriptLines } = await import("./assemble-Dm4gD1TU.js");
|
|
79
79
|
return redactSecrets(transcriptLines(record));
|
|
80
80
|
} catch {
|
|
81
81
|
return null;
|
|
@@ -347,4 +347,4 @@ async function serveApp(c, dir, path) {
|
|
|
347
347
|
//#endregion
|
|
348
348
|
export { watchLive as a, newToken as i, allowedHosts as n, createStudioApp as r, COOKIE as t };
|
|
349
349
|
|
|
350
|
-
//# sourceMappingURL=server-
|
|
350
|
+
//# sourceMappingURL=server-5DWmKKfV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-
|
|
1
|
+
{"version":3,"file":"server-5DWmKKfV.js","names":[],"sources":["../src/studio/live.ts","../src/studio/server.ts"],"mappings":"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"}
|
|
@@ -54,5 +54,5 @@ Error generating stack: `+e.message+`
|
|
|
54
54
|
`).filter(e=>e&&(!i||e.includes(i)));return(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(jC,{placeholder:`Filter lines, e.g. docker or gateway`,value:i,onChange:e=>a(e.target.value),className:`max-w-sm`}),(0,m.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto rounded-lg border bg-muted/30 p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap break-all`,children:s.join(`
|
|
55
55
|
`)})]})}function IC({runId:e,attemptKey:t,view:n}){return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Local debug data from `,(0,m.jsx)(`code`,{className:`font-mono`,children:`.reeval/debug`}),`. It stays on this machine: it isn't recorded, and static builds leave it out.`]}),(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Phase timeline`}),(0,m.jsx)(NC,{lines:n.lines})]}),(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Network requests`}),(0,m.jsx)(PC,{requests:n.requests})]}),(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Raw trace`}),n.trace?(0,m.jsx)(FC,{runId:e,attemptKey:t}):(0,m.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No trace.ndjson: it's kept when an attempt fails, or with`,` `,(0,m.jsx)(`code`,{className:`font-mono`,children:`reeval run --trace`}),`.`]})]})]})}var LC=5e3;function RC(e){return e.startsWith(`+++ `)||e.startsWith(`--- `)?`text-muted-foreground`:e.startsWith(`+`)?`bg-pass/10 text-pass`:e.startsWith(`-`)?`bg-fail/10 text-fail`:e.startsWith(`@@`)?`bg-brand/8 text-brand`:/^(diff --git|index |new file|deleted file|similarity|rename )/.test(e)?`text-muted-foreground`:``}function zC({text:e,className:t}){let n=e.split(`
|
|
56
56
|
`),r=n.slice(0,LC);return(0,m.jsxs)(`div`,{className:Q(`overflow-auto rounded-lg border bg-card`,t),children:[(0,m.jsx)(`pre`,{className:`min-w-fit py-2 font-mono text-xs leading-5`,children:r.map((e,t)=>(0,m.jsx)(`div`,{className:Q(`px-4 whitespace-pre`,RC(e)),children:e||` `},t))}),n.length>LC?(0,m.jsxs)(`p`,{className:`border-t px-4 py-2 text-xs text-muted-foreground`,children:[`Showing the first `,LC,` of `,n.length,` lines.`]}):null]})}var BC={added:`text-pass`,deleted:`text-fail`,modified:`text-infra`,renamed:`text-drift`,binary:`text-muted-foreground`};function VC({text:e}){let t=(0,p.useMemo)(()=>Jy(e),[e]),[n,r]=(0,p.useState)(0);if(t.length===0)return(0,m.jsx)(aC,{icon:Ex,title:`No changes`,children:`The agent didn't change any files in the workspace.`});let i=t[Math.min(n,t.length-1)],a=t.reduce((e,t)=>e+t.added,0),o=t.reduce((e,t)=>e+t.removed,0);return(0,m.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-[260px_1fr]`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-1 text-xs text-muted-foreground`,children:[(0,m.jsxs)(`span`,{children:[t.length,` files`]}),(0,m.jsxs)(`span`,{className:`font-mono`,children:[(0,m.jsxs)(`span`,{className:`text-pass`,children:[`+`,a]}),` `,(0,m.jsxs)(`span`,{className:`text-fail`,children:[`−`,o]})]})]}),(0,m.jsx)(`div`,{className:`overflow-hidden rounded-lg border bg-card`,children:t.map((e,t)=>(0,m.jsxs)(`button`,{type:`button`,onClick:()=>r(t),className:Q(`flex w-full items-center gap-2 border-b px-3 py-2 text-left last:border-b-0 hover:bg-accent/50`,t===n&&`bg-accent`),children:[(0,m.jsx)(`span`,{className:Q(`text-[10px] font-semibold uppercase`,BC[e.status]),children:e.status[0]}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:e.path}),(0,m.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px]`,children:[(0,m.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),` `,(0,m.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]})]})]},e.path))})]}),(0,m.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`truncate font-mono text-sm`,children:i.path}),(0,m.jsx)(pC,{variant:`outline`,className:BC[i.status],children:i.status})]}),(0,m.jsx)(zC,{text:i.text,className:`max-h-[70vh]`})]})]})}function HC({score:e,threshold:t,pass:n}){return(0,m.jsxs)(`div`,{className:`relative h-2 rounded-full bg-muted`,children:[(0,m.jsx)(`div`,{className:Q(`absolute inset-y-0 left-0 rounded-full`,n?`bg-pass`:`bg-fail`),style:{width:`${Math.max(2,e*100)}%`}}),(0,m.jsx)(`div`,{className:`absolute -top-1 -bottom-1 w-0.5 rounded bg-foreground`,style:{left:`${t*100}%`},title:`threshold ${t}`})]})}function UC({j:e}){let t=e.verdict===`pass`;return(0,m.jsxs)(`div`,{className:`rounded-lg border bg-card p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,m.jsx)(`p`,{className:`text-sm font-medium leading-relaxed`,children:e.question}),(0,m.jsx)(pC,{variant:`outline`,className:t?`border-pass/30 text-pass`:`border-fail/30 text-fail`,children:e.verdict})]}),(0,m.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-[1fr_auto] sm:items-center`,children:[(0,m.jsx)(HC,{score:e.score,threshold:e.threshold,pass:t}),(0,m.jsxs)(`div`,{className:`tabular text-sm`,children:[(0,m.jsx)(`span`,{className:`font-semibold`,children:e.score.toFixed(2)}),(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` / threshold `,e.threshold]})]})]}),(0,m.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-xs`,children:[(0,m.jsx)(`dt`,{className:`text-muted-foreground`,children:`Model`}),(0,m.jsx)(`dd`,{className:`font-mono`,children:e.model}),e.resolvedModel&&e.resolvedModel!==e.model?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`dt`,{className:`text-muted-foreground`,children:`Served by`}),(0,m.jsx)(`dd`,{className:`font-mono`,children:e.resolvedModel})]}):null]})]})}function WC({name:e,value:t}){let n=t&&typeof t==`object`&&`$ref`in t?String(t.$ref):null;return(0,m.jsxs)(`div`,{className:`border-b px-4 py-3 last:border-b-0`,children:[(0,m.jsx)(`div`,{className:`mb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase`,children:e}),n?(0,m.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`The judge saw `,(0,m.jsx)(`code`,{className:`font-mono text-foreground`,children:n}),` (see the Diff tab).`]}):Array.isArray(t)?(0,m.jsx)(`ul`,{className:`space-y-0.5 font-mono text-xs`,children:t.map(e=>(0,m.jsx)(`li`,{children:typeof e==`string`?e:JSON.stringify(e)},String(e)))}):(0,m.jsx)(`pre`,{className:`max-h-72 overflow-auto font-mono text-xs leading-relaxed whitespace-pre-wrap`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})]})}function GC({record:e,attempt:t}){return t.judgements.length===0&&!t.files.judgeInput?(0,m.jsxs)(aC,{icon:Hx,title:`No judge`,children:[`This eval made no `,(0,m.jsx)(`code`,{className:`font-mono`,children:`t.judge()`}),` calls.`]}):(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(`section`,{className:`space-y-3`,children:t.judgements.map(e=>(0,m.jsx)(UC,{j:e},e.question))}),(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`What the judge saw`}),(0,m.jsx)(dC,{record:e,file:t.files.judgeInput,what:`judge input`,children:e=>{let t=[];try{t=JSON.parse(e)}catch{return(0,m.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap`,children:e})}return(0,m.jsx)(`div`,{className:`space-y-3`,children:t.map(e=>(0,m.jsxs)(`div`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,m.jsxs)(`div`,{className:`border-b bg-muted/40 px-4 py-2 text-xs`,children:[(0,m.jsx)(`span`,{className:`font-medium`,children:e.question}),(0,m.jsx)(`span`,{className:`ml-2 font-mono text-muted-foreground`,children:e.model})]}),Object.entries(e.state).map(([e,t])=>(0,m.jsx)(WC,{name:e,value:t},e))]},e.question))})}})]})]})}function KC({value:e,label:t,className:n}){let[r,i]=(0,p.useState)(!1);return(0,m.jsxs)(VS,{variant:`outline`,size:`sm`,className:Q(`h-7 gap-1.5 font-mono text-xs`,n),onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),1200)})},children:[r?(0,m.jsx)(Hb,{className:`size-3.5 text-pass`}):(0,m.jsx)(Sx,{className:`size-3.5`}),t??e]})}function qC({title:e,children:t,action:n}){return(0,m.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between border-b bg-muted/40 px-4 py-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:e}),n]}),(0,m.jsx)(`dl`,{className:`grid grid-cols-[minmax(7rem,auto)_1fr] gap-x-6 gap-y-2 px-4 py-3 text-sm`,children:t})]})}function JC({k:e,children:t,mono:n=!0}){return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,m.jsx)(`dd`,{className:n?`min-w-0 font-mono text-xs leading-5 break-all`:`min-w-0`,children:t})]})}var YC=(0,m.jsx)(`span`,{className:`font-sans text-muted-foreground`,children:`none`}),XC=e=>e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:`${(e/1024**2).toFixed(1)} MB`;function ZC({egress:e}){let t=typeof e.policy==`string`?e.policy:`allow ${e.policy.allow.join(`, `)||`none`}`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{children:[t,e.allowed?(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· allows `,e.allowed.join(`, `)||`nothing`]}):null]}),e.recorded?null:(0,m.jsx)(`div`,{className:`font-sans text-muted-foreground`,children:`not recorded by this sandbox`}),e.contacted.map(e=>(0,m.jsxs)(`div`,{children:[e.host,`:`,e.port,` `,(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[`×`,e.connections,` · ↑`,XC(e.sent),` ↓`,XC(e.received)]})]},`${e.host}:${e.port}`)),e.blocked.map(e=>(0,m.jsxs)(`div`,{className:`text-fail`,children:[`blocked `,e.host,`:`,e.port,` `,(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[`×`,e.connections,` · `,e.reason]})]},`blocked ${e.host}:${e.port}`)),e.expectedBlocked.map(e=>(0,m.jsxs)(`div`,{className:`text-muted-foreground`,children:[`blocked `,e.host,`:`,e.port,` ×`,e.connections,` · expected: the harness always tries it`]},`expected ${e.host}:${e.port}`))]})}function QC({record:e,attempt:t}){let{git:n,stack:r}=e,i=r.images.find(e=>e.id===t.imageId);return(0,m.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,m.jsxs)(qC,{title:`Source`,action:n?(0,m.jsx)(KC,{value:`reeval checkout ${e.runId}`,label:`reeval checkout`}):null,children:[n?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(JC,{k:`Commit`,children:n.sha}),(0,m.jsx)(JC,{k:`Branch`,children:n.branch??YC}),(0,m.jsx)(JC,{k:`Committed`,children:n.commitTime}),(0,m.jsx)(JC,{k:`Worktree`,mono:!1,children:n.dirty?(0,m.jsxs)(`span`,{className:`text-infra`,children:[`dirty`,n.worktreePatch?` · worktree.patch, ${n.worktreePatch.bytes} bytes`:``,n.worktreePatchNote?` · ${n.worktreePatchNote}`:``]}):`clean`}),n.remote?(0,m.jsx)(JC,{k:`Remote`,children:n.remote}):null,n.shallow?(0,m.jsx)(JC,{k:`Clone`,mono:!1,children:`shallow`}):null]}):(0,m.jsx)(JC,{k:`Git`,mono:!1,children:`Not run in a git repository`}),(0,m.jsx)(JC,{k:`Lockfiles`,children:e.dependencies.lockfiles.length?e.dependencies.lockfiles.map(e=>(0,m.jsxs)(`div`,{children:[e.path,` `,(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.sha256.slice(0,12)})]},e.path)):YC})]}),(0,m.jsxs)(qC,{title:`This attempt`,children:[(0,m.jsx)(JC,{k:`Cell`,children:t.cell}),(0,m.jsx)(JC,{k:`Image`,children:i?(0,m.jsxs)(m.Fragment,{children:[i.ref,` `,(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:i.id.slice(0,19)}),i.agentCli?(0,m.jsxs)(`div`,{children:[`agent CLI `,i.agentCli]}):null,i.dockerfile?(0,m.jsxs)(`div`,{children:[`dockerfile `,i.dockerfile.path,` `,(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:i.dockerfile.sha256.slice(0,12)})]}):null,i.install?.length?(0,m.jsxs)(`div`,{children:[`install on `,i.base,i.install.map(e=>(0,m.jsxs)(`div`,{className:`text-muted-foreground`,children:[`$ `,e]},e))]}):null]}):(0,m.jsx)(`span`,{className:`font-sans text-muted-foreground`,children:`none (fake sandbox)`})}),(0,m.jsx)(JC,{k:`Env vars`,children:t.env.vars.length?t.env.vars.join(`, `):YC}),(0,m.jsx)(JC,{k:`Secrets`,children:t.env.secrets.length?t.env.secrets.join(`, `):YC}),(0,m.jsx)(JC,{k:`Egress`,children:t.egress?(0,m.jsx)(ZC,{egress:t.egress}):YC}),(0,m.jsx)(JC,{k:`Context`,children:t.context.length?t.context.map(e=>(0,m.jsxs)(`div`,{children:[e.path,` `,(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.sha256.slice(0,12)})]},e.path)):YC})]}),(0,m.jsxs)(qC,{title:`Stack`,children:[(0,m.jsxs)(JC,{k:`reeval`,children:[r.es,` · node `,r.node,` · `,r.os,`/`,r.arch]}),(0,m.jsx)(JC,{k:`Harnesses`,children:r.harnesses.map(Ty).join(`, `)}),(0,m.jsxs)(JC,{k:`Judge`,children:[r.judge.model??`none`,` · threshold `,r.judge.threshold,` · version`,` `,r.judge.version,r.judge.resolvedModels.length?` · served ${r.judge.resolvedModels.join(`, `)}`:``]}),(0,m.jsx)(JC,{k:`Environments`,children:e.environments.map(e=>(0,m.jsxs)(`div`,{children:[e.name,` `,(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.digest.replace(/^sha256:/,``).slice(0,12)}),e.parent?` · extends ${e.parent}`:``,e.skills.length?` · skills ${e.skills.map(e=>e.name).join(`, `)}`:``,e.overrides.length?` · overrides ${e.overrides.join(`, `)}`:``]},e.name))}),(0,m.jsx)(JC,{k:`Images`,children:r.images.length?r.images.map(e=>(0,m.jsx)(`div`,{children:e.ref},e.id)):YC})]}),(0,m.jsx)(qC,{title:`Package versions`,children:Object.entries(r.packages).map(([e,t])=>(0,m.jsx)(JC,{k:e,children:t},e))}),n?.dirty?(0,m.jsxs)(`div`,{className:`space-y-2 xl:col-span-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Uncommitted changes when the run started`}),(0,m.jsx)(dC,{record:e,file:n.worktreePatch??void 0,what:`worktree patch`,children:e=>(0,m.jsx)(zC,{text:e,className:`max-h-[50vh]`})})]}):null]})}function $C(e){return typeof e==`object`?e.key:e}function ew(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function tw(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function nw(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var rw=(e,t)=>Math.abs(e-t)<1.01,iw=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},aw,ow=()=>{if(aw!==void 0)return aw;if(typeof navigator>`u`)return aw=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return aw=!0;let e=navigator.maxTouchPoints;return aw=navigator.platform===`MacIntel`&&e!==void 0&&e>0},sw=e=>e,cw=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},lw={passive:!0},uw=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=()=>{t({width:n.innerWidth,height:n.innerHeight})};return r(),n.addEventListener(`resize`,r,lw),()=>{n.removeEventListener(`resize`,r)}},dw=typeof window>`u`||`onscrollend`in window,fw=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&dw,o=0,s=a?null:iw(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,lw),a&&r.addEventListener(`scrollend`,u,lw),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},pw=(e,t)=>fw(e,t,t=>e.options.horizontal?t.scrollX:t.scrollY),mw=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},hw=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function gw(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var _w=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:sw,rangeExtractor:cw,onChange:()=>{},measureElement:mw,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>$C(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||gw(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=tw(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,ow()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,lw),e.addEventListener(`touchend`,n,lw),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(ow()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!rw(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=tw(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=tw(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=ew(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=tw(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=bw(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=tw(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=tw(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return nw(t[vw(0,t.length-1,r?e=>n[e*2]:e=>nw(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(ow()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&rw(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},vw=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function yw(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function bw(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=yw(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=vw(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var xw=typeof document<`u`?p.useLayoutEffect:p.useEffect;function Sw({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=p.useReducer(e=>e+1,0)[1],a=p.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=p.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=e=>{let t=a.current;if(!t.enabled||!t.container)return;s(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,o=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let s=a.start-o,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==s&&(t.lastPositions.set(c,s),r?c.style.transform=n?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`:c.style[i]=`${s}px`)}},l={...r,onChange:(t,n)=>{var s;let l=a.current,u=!0;if(l.enabled){c(t);let e=t.range,n=l.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(l.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,co.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[u]=p.useState(()=>{let e=new _w(l),t=e.measureElement;return e.measureElement=e=>{o.current=!0;try{t(e)}finally{o.current=!1}},Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return u.setOptions(l),xw(()=>u._didMount(),[]),xw(()=>(s(u),u._willUpdate())),xw(()=>{c(u)}),u}function Cw(e){return Sw({getScrollElement:()=>typeof document<`u`?window:null,observeElementRect:uw,observeElementOffset:pw,scrollToFn:hw,initialOffset:()=>typeof document<`u`?window.scrollY:0,...e})}var ww=e=>e<1e3?`+${e}ms`:`+${(e/1e3).toFixed(1)}s`,Tw=e=>typeof e==`string`?e:e===void 0?``:JSON.stringify(e,null,2);function Ew(e){if(typeof e==`string`)return e;if(!e||typeof e!=`object`)return``;let t=e;for(let e of[`command`,`cmd`,`path`,`file`,`filePath`,`pattern`,`query`,`url`])if(typeof t[e]==`string`)return t[e];let n=Object.values(t).find(e=>typeof e==`string`);return typeof n==`string`?n:``}function Dw({open:e,onToggle:t,icon:n,tone:r,title:i,meta:a,children:o}){return(0,m.jsxs)(`div`,{className:`overflow-hidden rounded-lg border bg-card`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:t,className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-accent/50`,children:[(0,m.jsx)(Jb,{className:Q(`size-3.5 shrink-0 text-muted-foreground transition-transform`,e&&`rotate-90`)}),(0,m.jsx)(n,{className:Q(`size-4 shrink-0 text-muted-foreground`,r)}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i}),a?(0,m.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:a}):null]}),e?(0,m.jsx)(`div`,{className:`border-t bg-muted/30`,children:o}):null]})}function Ow({label:e,text:t}){return t?(0,m.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,m.jsx)(`div`,{className:`mb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase`,children:e}),(0,m.jsx)(`pre`,{className:`max-h-96 overflow-auto font-mono text-xs leading-relaxed break-words whitespace-pre-wrap`,children:t})]}):null}function kw({e,open:t,toggle:n}){let r=`durationMs`in e&&e.durationMs?Cy(e.durationMs):null;switch(e.type){case`text`:return(0,m.jsxs)(`div`,{className:`flex gap-3`,children:[(0,m.jsx)(`div`,{className:`mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-brand/15 text-brand`,children:(0,m.jsx)(oS,{className:`size-3.5`})}),(0,m.jsx)(`p`,{className:`min-w-0 flex-1 pt-0.5 text-sm leading-relaxed break-words whitespace-pre-wrap`,children:e.text})]});case`reasoning`:return(0,m.jsx)(Dw,{open:t,onToggle:n,icon:Bb,tone:`text-drift`,title:(0,m.jsx)(`span`,{className:`text-muted-foreground italic`,children:t?`Reasoning`:e.text.split(`
|
|
57
|
-
`)[0]}),meta:r?`thought for ${r}`:`reasoning`,children:(0,m.jsx)(`p`,{className:`px-3 py-2 text-sm leading-relaxed whitespace-pre-wrap text-muted-foreground italic`,children:e.text})});case`tool`:return(0,m.jsxs)(Dw,{open:t,onToggle:n,icon:e.tool.toLowerCase().includes(`shell`)||e.tool===`bash`?ES:IS,tone:e.ok?void 0:`text-fail`,title:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,m.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:Ew(e.input)})]}),meta:(0,m.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.ok?null:(0,m.jsx)(`span`,{className:`text-fail`,children:`failed`}),r]}),children:[(0,m.jsx)(Ow,{label:`Input`,text:Tw(e.input)}),(0,m.jsx)(Ow,{label:`Output`,text:Tw(e.output)})]});case`file-edit`:{let t=e.kind===`create`?Mx:e.kind===`delete`?Ox:Ax;return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm`,children:[(0,m.jsx)(t,{className:`size-4 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.kind===`create`?`Created`:e.kind===`delete`?`Deleted`:`Edited`}),(0,m.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,m.jsxs)(`span`,{className:`ml-auto flex shrink-0 gap-2 font-mono text-xs`,children:[e.added===null?null:(0,m.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),e.removed===null?null:(0,m.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]}),r?(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:r}):null]})]})}case`web-search`:return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm`,children:[(0,m.jsx)(bS,{className:`size-4 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`Searched`}),(0,m.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`“`,e.query,`”`]}),(0,m.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[e.references===null?``:`${e.references} sources · `,r]})]});case`web-fetch`:return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm`,children:[(0,m.jsx)(Xx,{className:Q(`size-4 text-muted-foreground`,!e.ok&&`text-fail`)}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`Fetched`}),(0,m.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.url}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:r})]});case`retry`:return(0,m.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-dashed px-3 py-2 text-sm text-muted-foreground`,children:[(0,m.jsx)(mS,{className:`mt-0.5 size-4 shrink-0`}),(0,m.jsx)(`span`,{className:`font-mono text-xs break-words whitespace-pre-wrap`,children:e.message})]});case`error`:return(0,m.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-fail/30 bg-fail/5 px-3 py-2 text-sm text-fail`,children:[(0,m.jsx)(Qb,{className:`mt-0.5 size-4 shrink-0`}),(0,m.jsx)(`span`,{className:`font-mono text-xs break-words whitespace-pre-wrap`,children:e.message})]})}}function Aw({item:e,open:t,toggle:n}){if(e.kind===`turn`)return(0,m.jsxs)(`div`,{className:`pt-2`,children:[(0,m.jsxs)(`div`,{className:`mb-2 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Turn `,e.turn+1]}),(0,m.jsxs)(`div`,{className:`flex gap-3`,children:[(0,m.jsx)(`div`,{className:`mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-muted`,children:(0,m.jsx)(MS,{className:`size-3.5`})}),(0,m.jsx)(`div`,{className:`min-w-0 flex-1 rounded-lg bg-muted/60 px-3.5 py-2.5 text-sm leading-relaxed break-words whitespace-pre-wrap`,children:e.prompt})]})]});if(e.kind===`turn-end`)return(0,m.jsxs)(`div`,{className:`flex items-center gap-3 py-1 text-xs text-muted-foreground`,children:[(0,m.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,m.jsxs)(`span`,{children:[`Turn `,e.turn+1,` `,e.status,` in `,Cy(e.durationMs)]}),(0,m.jsx)(`div`,{className:`h-px flex-1 bg-border`})]});let r=e.event;return(0,m.jsxs)(`div`,{className:`flex gap-2`,children:[(0,m.jsx)(`span`,{className:`tabular w-14 shrink-0 pt-2 text-right font-mono text-[10px] text-muted-foreground/70`,children:ww(r.atMs)}),(0,m.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,m.jsx)(kw,{e:r,open:t,toggle:n})})]})}var jw=e=>e.kind===`event`&&(e.event.type===`tool`||e.event.type===`reasoning`);function Mw({text:e}){let t=(0,p.useMemo)(()=>Ky(Gy(e)),[e]),[n,r]=(0,p.useState)(()=>new Set),i=(0,p.useRef)(null),[a,o]=(0,p.useState)(0);(0,p.useLayoutEffect)(()=>{o((i.current?.getBoundingClientRect().top??0)+window.scrollY)},[]);let s=Cw({count:t.length,estimateSize:()=>56,overscan:8,scrollMargin:a}),c=(0,p.useCallback)(e=>r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]),l=(0,p.useMemo)(()=>{let e=0,n=0,r=0;for(let i of t)i.kind===`event`&&(i.event.type===`tool`&&e++,i.event.type===`reasoning`&&n++,i.event.type===`file-edit`&&r++);return{tools:e,reasoning:n,edits:r}},[t]),u=t.flatMap((e,t)=>jw(e)?[t]:[]),d=u.length>0&&u.every(e=>n.has(e));return t.length===0?(0,m.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:`The transcript is empty.`}):(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(pC,{variant:`secondary`,children:[l.tools,` tool calls`]}),(0,m.jsxs)(pC,{variant:`secondary`,children:[l.edits,` file edits`]}),(0,m.jsxs)(pC,{variant:`secondary`,children:[l.reasoning,` reasoning blocks`]}),u.length?(0,m.jsx)(VS,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:()=>r(d?new Set:new Set(u)),children:d?`Collapse all`:`Expand all`}):null]}),(0,m.jsx)(`div`,{ref:i,className:`relative w-full`,style:{height:s.getTotalSize()},children:s.getVirtualItems().map(e=>{let r=t[e.index];return(0,m.jsx)(`div`,{"data-index":e.index,ref:s.measureElement,className:`absolute top-0 left-0 w-full pb-2.5`,style:{transform:`translateY(${e.start-s.options.scrollMargin}px)`},children:(0,m.jsx)(Aw,{item:r,open:n.has(e.index),toggle:()=>c(e.index)})},e.key)})})]})}var Nw=[`transcript`,`diff`,`checks`,`judge`,`state`,`debug`],Pw=ca(`/runs/$runId/evals/$slug/attempts/$attempt`),Fw=[[`setupMs`,`Setup`,`bg-skip/60`],[`agentMs`,`Agent`,`bg-brand`],[`diffMs`,`Diff`,`bg-drift/70`],[`checksMs`,`Checks`,`bg-infra`],[`judgeMs`,`Judge`,`bg-pass`]];function Iw({attempt:e}){let t=Fw.reduce((t,[n])=>t+e.timings[n],0)||1;return(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-muted`,children:Fw.map(([n,r,i])=>e.timings[n]>0?(0,m.jsxs)(dv,{children:[(0,m.jsx)(fv,{asChild:!0,children:(0,m.jsx)(`div`,{className:i,style:{width:`${e.timings[n]/t*100}%`}})}),(0,m.jsxs)(pv,{children:[r,` `,Cy(e.timings[n])]})]},n):null)}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:Fw.map(([t,n,r])=>(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:Q(`size-2 rounded-full`,r)}),n,` `,(0,m.jsx)(`span`,{className:`tabular text-foreground`,children:Cy(e.timings[t])})]},t))})]})}function Lw(){let{runId:e,slug:t,attempt:n}=Pw.useParams(),{tab:r=`transcript`}=Pw.useSearch(),i=Ki({from:`/runs/$runId/evals/$slug/attempts/$attempt`}),{data:a,error:o,isPending:s}=et(rb(e)),{data:c}=cb(),l=a&&Yy(a,t),u=(l&&Xy(l,n)?.key)??``,{data:d}=et(ob(e,u,!!c?.features.debug&&!!u));if(o)return(0,m.jsx)(oC,{error:o});if(s)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:6})]});let f=Yy(a,t),p=f&&Xy(f,n);if(!f||!p)return(0,m.jsxs)(aC,{icon:vS,title:`Attempt not found`,children:[`This run has no attempt `,(0,m.jsx)(`code`,{className:`font-mono`,children:n}),` of that eval.`,` `,(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e},className:`underline`,children:`Back to the run`})]});let h=f.attempts.indexOf(p),g=f.attempts[h-1],_=f.attempts[h+1],v=p.judgements[0],y=p.checks.filter(e=>e.exitCode!==0).length,b=[...new Set(p.turns.flatMap(e=>e.model?[e.model]:[]))];return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`nav`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,m.jsx)(z,{to:`/`,className:`hover:text-foreground`,children:`Runs`}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e},className:`font-mono text-xs hover:text-foreground`,children:$S(e)}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e},search:{eval:t},className:`max-w-64 truncate hover:text-foreground`,children:f.name}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:p.id})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:[f.file,...f.group].join(` › `)}),(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2.5`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:f.name}),(0,m.jsx)(_C,{outcome:p.outcome})]}),(0,m.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:p.id}),` ·`,` `,Cy(p.durationMs),` · `,QS(p.turns.length,`turn`),` ·`,` `,Oy(p.activity),p.activity.reasoningMs?` · ${Cy(p.activity.reasoningMs)} reasoning`:``,p.usage?` · ${Ey(p.usage)} tokens`:``,b.length?` · served by ${b.join(`, `)}`:``]})]}),f.attempts.length>1?(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(VS,{variant:`outline`,size:`icon`,className:`size-8`,disabled:!g,asChild:!!g,children:g?(0,m.jsx)(z,{to:`.`,params:{runId:e,slug:t,attempt:g.id},search:{tab:r},"aria-label":`Previous attempt`,children:(0,m.jsx)(Kb,{})}):(0,m.jsx)(Kb,{})}),(0,m.jsx)(`div`,{className:`flex items-center gap-0.5 px-1`,children:f.attempts.map(n=>(0,m.jsx)(z,{to:`.`,params:{runId:e,slug:t,attempt:n.id},search:{tab:r},title:n.id,className:Q(`rounded p-0.5`,n.id===p.id?`bg-accent ring-1 ring-border`:`hover:bg-accent/60`),children:(0,m.jsx)(gC,{outcome:n.outcome,className:`size-3.5`})},n.id))}),(0,m.jsx)(VS,{variant:`outline`,size:`icon`,className:`size-8`,disabled:!_,asChild:!!_,children:_?(0,m.jsx)(z,{to:`.`,params:{runId:e,slug:t,attempt:_.id},search:{tab:r},"aria-label":`Next attempt`,children:(0,m.jsx)(Jb,{})}):(0,m.jsx)(Jb,{})})]}):null]}),p.error?(0,m.jsxs)(`div`,{className:`rounded-lg border border-fail/30 bg-fail/5 px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs font-medium tracking-wide text-fail uppercase`,children:p.error.kind}),(0,m.jsx)(`pre`,{className:`mt-1 max-h-60 overflow-auto font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail`,children:p.error.message})]}):null,(0,m.jsx)(`div`,{className:`rounded-xl border bg-card p-4`,children:(0,m.jsx)(Iw,{attempt:p})}),(0,m.jsxs)(wC,{value:r,onValueChange:e=>i({search:{tab:e},replace:!0}),children:[(0,m.jsxs)(EC,{className:`w-full justify-start overflow-x-auto sm:w-auto`,children:[(0,m.jsx)(DC,{value:`transcript`,children:`Transcript`}),(0,m.jsxs)(DC,{value:`diff`,children:[`Diff`,p.changedFiles.length?(0,m.jsx)(`span`,{className:`tabular text-xs text-muted-foreground`,children:p.changedFiles.length}):null]}),(0,m.jsxs)(DC,{value:`checks`,children:[`Checks`,p.checks.length?(0,m.jsx)(`span`,{className:Q(`tabular text-xs`,y?`text-fail`:`text-muted-foreground`),children:y?`${y}/${p.checks.length}`:p.checks.length}):null]}),(0,m.jsxs)(DC,{value:`judge`,children:[`Judge`,v?(0,m.jsx)(`span`,{className:Q(`tabular text-xs`,v.verdict===`pass`?`text-pass`:`text-fail`),children:v.score.toFixed(2)}):null]}),(0,m.jsx)(DC,{value:`state`,children:`State`}),d?(0,m.jsx)(DC,{value:`debug`,children:`Debug`}):null]}),(0,m.jsxs)(`div`,{className:`mt-4`,children:[(0,m.jsx)(OC,{value:`transcript`,children:(0,m.jsx)(dC,{record:a,file:p.files.transcript,what:`transcript`,children:e=>(0,m.jsx)(Mw,{text:e},p.id)})}),(0,m.jsx)(OC,{value:`diff`,children:(0,m.jsx)(dC,{record:a,file:p.files.diff,what:`diff`,children:e=>(0,m.jsx)(VC,{text:e},p.id)})}),(0,m.jsx)(OC,{value:`checks`,children:(0,m.jsx)(AC,{record:a,attempt:p})}),(0,m.jsx)(OC,{value:`judge`,children:(0,m.jsx)(GC,{record:a,attempt:p})}),(0,m.jsx)(OC,{value:`state`,children:(0,m.jsx)(QC,{record:a,attempt:p})}),d?(0,m.jsx)(OC,{value:`debug`,children:(0,m.jsx)(IC,{runId:e,attemptKey:p.key,view:d})}):null]})]})]})}function Rw({...e}){return(0,m.jsx)(zm,{"data-slot":`select`,...e})}function zw({...e}){return(0,m.jsx)(Um,{"data-slot":`select-value`,...e})}function Bw({className:e,size:t=`default`,children:n,...r}){return(0,m.jsxs)(Vm,{"data-slot":`select-trigger`,"data-size":t,className:Q(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,m.jsx)(Wm,{asChild:!0,children:(0,m.jsx)(Wb,{className:`size-4 opacity-50`})})]})}function Vw({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,m.jsx)(qm,{children:(0,m.jsxs)(Ym,{"data-slot":`select-content`,className:Q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,m.jsx)(Uw,{}),(0,m.jsx)(sh,{className:Q(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,m.jsx)(Ww,{})]})})}function Hw({className:e,children:t,...n}){return(0,m.jsxs)(ph,{"data-slot":`select-item`,className:Q(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,m.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,m.jsx)(_h,{children:(0,m.jsx)(Hb,{className:`size-4`})})}),(0,m.jsx)(hh,{children:t})]})}function Uw({className:e,...t}){return(0,m.jsx)(yh,{"data-slot":`select-scroll-up-button`,className:Q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,m.jsx)(Xb,{className:`size-4`})})}function Ww({className:e,...t}){return(0,m.jsx)(xh,{"data-slot":`select-scroll-down-button`,className:Q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,m.jsx)(Wb,{className:`size-4`})})}function Gw({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,m.jsx)(`table`,{"data-slot":`table`,className:Q(`w-full caption-bottom text-sm`,e),...t})})}function Kw({className:e,...t}){return(0,m.jsx)(`thead`,{"data-slot":`table-header`,className:Q(`[&_tr]:border-b`,e),...t})}function qw({className:e,...t}){return(0,m.jsx)(`tbody`,{"data-slot":`table-body`,className:Q(`[&_tr:last-child]:border-0`,e),...t})}function Jw({className:e,...t}){return(0,m.jsx)(`tr`,{"data-slot":`table-row`,className:Q(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Yw({className:e,...t}){return(0,m.jsx)(`th`,{"data-slot":`table-head`,className:Q(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function Xw({className:e,...t}){return(0,m.jsx)(`td`,{"data-slot":`table-cell`,className:Q(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}var Zw=ca(`/compare`),Qw={regressed:{label:`Regressed`,className:`border-fail/30 bg-fail/10 text-fail`},fixed:{label:`Fixed`,className:`border-pass/30 bg-pass/10 text-pass`},drift:{label:`Not comparable`,className:`border-drift/30 bg-drift/10 text-drift`},infra:{label:`Infra error`,className:`border-infra/30 bg-infra/10 text-infra`},added:{label:`New`,className:`text-brand border-brand/30`},removed:{label:`Removed`,className:`text-muted-foreground`},same:{label:`Same`,className:`text-muted-foreground`}};function $w({label:e,value:t,runs:n,onChange:r}){return(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,m.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,m.jsxs)(Rw,{value:t,onValueChange:r,children:[(0,m.jsx)(Bw,{className:`w-full`,children:(0,m.jsx)(zw,{placeholder:`Choose a run`})}),(0,m.jsx)(Vw,{children:n.map(e=>(0,m.jsxs)(Hw,{value:e.runId,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:Dy(e.git?.sha)}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:YS(e.startedAt)}),(0,m.jsxs)(`span`,{className:`tabular text-xs text-muted-foreground`,children:[e.summary.pass,`/`,e.summary.pass+e.summary.fail+e.summary.infraError]}),e.recorded?null:(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`scratch`})]},e.runId))})]})]})}function eT({base:e,head:t,kind:n}){let r=n===`score`?rT:iT;if(e===null&&t===null)return(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`–`});if(e===null||t===null)return(0,m.jsx)(`span`,{className:`tabular`,children:r(t===null?e:t)});let i=t-e;return(0,m.jsxs)(`span`,{className:`tabular`,children:[(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:r(e)}),(0,m.jsx)(Ib,{className:`mx-1 inline size-3 text-muted-foreground`}),r(t),Math.abs(i)>1e-9?(0,m.jsxs)(`span`,{className:Q(`ml-1.5 text-xs`,i>0?`text-pass`:`text-fail`),children:[i>0?`+`:``,n===`score`?i.toFixed(2):`${Math.round(i*100)} pts`]}):null]})}var tT=e=>`${e>=0?`+`:`−`}${Math.round(Math.abs(e)*100)}`,nT=e=>e?`${tT(e.points)} (${tT(e.lo)}…${tT(e.hi)})${e.withinNoise?` noise`:``}`:`–`,rT=e=>e.toFixed(2),iT=e=>wy(e);function aT({row:e,head:t}){let n=Qw[e.status],r=e.id.split(` › `).slice(1).join(` › `)||e.id;return(0,m.jsxs)(Jw,{className:e.status===`same`?`opacity-70`:void 0,children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(pC,{variant:`outline`,className:n.className,children:n.label})}),(0,m.jsxs)(Xw,{className:`max-w-md`,children:[e.slug?(0,m.jsx)(z,{to:`/evals/$slug`,params:{slug:e.slug},className:`font-medium hover:underline`,children:r}):r,(0,m.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id.split(` › `)[0]}),e.cells?(0,m.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`compared on the cells both runs have`,e.cells.added.length?` · added ${e.cells.added.join(`, `)}`:``,e.cells.removed.length?` · removed ${e.cells.removed.join(`, `)}`:``]}):null,e.perCell.length?(0,m.jsx)(`ul`,{className:`mt-1.5 space-y-0.5 text-[11px] text-muted-foreground`,children:e.perCell.map(e=>(0,m.jsxs)(`li`,{className:`tabular`,children:[(0,m.jsx)(`span`,{className:`font-mono`,children:e.key}),e.base.lift||e.head.lift?(0,m.jsxs)(m.Fragment,{children:[` · lift `,nT(e.base.lift),` → `,nT(e.head.lift)]}):null,e.base.effort&&e.head.effort?(0,m.jsxs)(m.Fragment,{children:[` · `,ty(e.base.effort,e.head.effort)]}):null]},e.key))}):null]}),(0,m.jsx)(Xw,{children:(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(gC,{outcome:e.base}),(0,m.jsx)(Ib,{className:`size-3 text-muted-foreground`}),e.slug&&e.head?(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:t},search:{eval:e.slug},children:(0,m.jsx)(gC,{outcome:e.head})}):(0,m.jsx)(gC,{outcome:e.head})]})}),(0,m.jsx)(Xw,{className:`hidden md:table-cell`,children:(0,m.jsx)(eT,{base:e.basePassRate,head:e.headPassRate,kind:`rate`})}),(0,m.jsx)(Xw,{className:`hidden pr-4 md:table-cell`,children:(0,m.jsx)(eT,{base:e.baseScore,head:e.headScore,kind:`score`})})]})}function oT(){let e=Zw.useSearch(),t=Ki({from:`/compare`}),{data:n,error:r,isPending:i}=et(nb),a=n?.headers??[],o=a.find(t=>t.runId===e.head)??(e.head?void 0:a[0]),s=a.find(t=>t.runId===e.base)??(e.base?void 0:a.find(e=>o&&e.runId<o.runId&&e.status===`complete`)),c=et({...rb(s?.runId??``),enabled:!!s}),l=et({...rb(o?.runId??``),enabled:!!o}),u=(0,p.useMemo)(()=>s&&o?Wy(s,o,{base:c.data,head:l.data}):null,[s,o,c.data,l.data]);return r?(0,m.jsx)(oC,{error:r}):i?(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:6})]}):(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Compare runs`}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[`What flipped between two runs, with pass-rate and judge-score deltas, and each cell's lift and effort (tool calls, agent time). Uses the same rules as`,` `,(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:`reeval compare`}),`.`]})]}),a.length<2?(0,m.jsx)(aC,{icon:Jx,title:`Two runs needed`,children:`Record at least two runs to compare them.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border bg-card p-4 sm:flex-row sm:items-end`,children:[(0,m.jsx)($w,{label:`Base`,value:s?.runId,runs:a,onChange:e=>t({search:t=>({...t,base:e}),replace:!0})}),(0,m.jsx)(Ib,{className:`mx-auto hidden size-4 shrink-0 text-muted-foreground sm:mb-2.5 sm:block`}),(0,m.jsx)($w,{label:`Head`,value:o?.runId,runs:a,onChange:e=>t({search:t=>({...t,head:e}),replace:!0})})]}),!s||!o||!u?(0,m.jsx)(aC,{icon:Jx,title:`Pick two runs`,children:`Choose a base and a head run to see what changed.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[`regressed`,`fixed`,`drift`,`same`].map(e=>(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:Qw[e].label}),(0,m.jsx)(`div`,{className:Q(`mt-1 text-2xl font-semibold tracking-tight`,u.counts[e]&&e===`regressed`&&`text-fail`,u.counts[e]&&e===`fixed`&&`text-pass`,u.counts[e]&&e===`drift`&&`text-drift`),children:u.counts[e]})]},e))}),u.changes.length?(0,m.jsxs)(`div`,{className:`rounded-xl border border-drift/30 bg-drift/5 p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-drift`,children:[(0,m.jsx)(AS,{className:`size-4`}),` The stack changed between these runs`]}),(0,m.jsx)(`ul`,{className:`mt-2 space-y-1 text-sm`,children:u.changes.map(e=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:e.base}),(0,m.jsx)(Ib,{className:`size-3 text-muted-foreground`}),(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:e.head}),e.outsideFingerprint?(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(not in fingerprints: flips count as not comparable)`}):null]},e.field))})]}):null,(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-36 pl-4`,children:`Change`}),(0,m.jsx)(Yw,{children:`Eval`}),(0,m.jsx)(Yw,{className:`w-24`,children:`Outcome`}),(0,m.jsx)(Yw,{className:`hidden md:table-cell`,children:`Pass rate`}),(0,m.jsx)(Yw,{className:`hidden pr-4 md:table-cell`,children:`Judge score`})]})}),(0,m.jsx)(qw,{children:u.rows.map(e=>(0,m.jsx)(aT,{row:e,head:o.runId},e.id))})]})})]})]})]})}var sT=ca(`/evals/$slug`);function cT(){let{slug:e}=sT.useParams(),{data:t,error:n,isPending:r}=et(nb),i=(0,p.useMemo)(()=>t?Ry(t.headers,e):[],[t,e]);if(n)return(0,m.jsx)(oC,{error:n});if(r)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:8})]});let a=t.manifest.evals.find(t=>t.slug===e);if(!a||i.length===0)return(0,m.jsx)(aC,{icon:vS,title:`No history for this eval`,children:`No recorded run includes it. It may have been renamed: evals are keyed by file, group and name.`});let{file:o,path:s}=Sy(a.id),c=i.filter(e=>e.outcome===`pass`||e.outcome===`fail`),l=c.filter(e=>e.outcome===`pass`).length,u=[...i].reverse(),d=i.filter(e=>e.changed).length;return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`nav`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,m.jsx)(z,{to:`/evals`,className:`hover:text-foreground`,children:`Evals`}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:`truncate text-foreground`,children:s.at(-1)})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:[o,...s.slice(0,-1)].join(` › `)}),(0,m.jsx)(`h1`,{className:`mt-1.5 text-2xl font-semibold tracking-tight`,children:s.at(-1)}),(0,m.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[`Passed in `,l,` of `,QS(c.length,`run`),` with a verdict`,d?` · the eval or its stack changed ${QS(d,`time`)}`:``,`.`]})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card p-5`,children:[(0,m.jsxs)(`div`,{className:`mb-3 flex items-center justify-between text-xs text-muted-foreground`,children:[(0,m.jsx)(`span`,{children:`Oldest`}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`mr-1 inline-block h-3 w-px bg-drift align-middle`}),` changed`]}),(0,m.jsx)(`span`,{children:`Newest`})]}),(0,m.jsx)(CC,{items:i.map(e=>({key:e.run.runId,outcome:e.outcome,changed:e.changed,title:`${Dy(e.run.git?.sha)} · ${YS(e.run.startedAt)} · ${e.outcome}`}))})]}),(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-10`}),(0,m.jsx)(Yw,{children:`Run`}),(0,m.jsx)(Yw,{children:`Commit`}),(0,m.jsx)(Yw,{className:`w-48`,children:`Attempts`}),(0,m.jsx)(Yw,{className:`text-right`,children:`Pass rate`}),(0,m.jsx)(Yw,{className:`hidden text-right sm:table-cell`,children:`Run time`})]})}),(0,m.jsx)(qw,{children:u.map(t=>{let n=t.cells.reduce((e,t)=>e+t.pass,0),r=t.cells.reduce((e,t)=>e+t.fail,0),i=t.cells.reduce((e,t)=>e+t.infraError,0);return(0,m.jsxs)(Jw,{children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(gC,{outcome:t.outcome})}),(0,m.jsxs)(Xw,{children:[(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:t.run.runId},search:{eval:e},className:`font-medium hover:underline`,children:(0,m.jsx)(`span`,{title:ZS(t.run.startedAt),children:YS(t.run.startedAt)})}),(0,m.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:t.run.runId}),t.changed?(0,m.jsx)(pC,{variant:`outline`,className:`h-4 border-drift/30 px-1.5 text-[10px] text-drift`,children:`changed`}):null]})]}),(0,m.jsxs)(Xw,{children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:Dy(t.run.git?.sha)}),t.run.git?.branch?(0,m.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,m.jsx)(Wx,{className:`size-3`}),t.run.git.branch]}):null]}),(0,m.jsxs)(Xw,{children:[(0,m.jsxs)(`span`,{className:`tabular text-xs`,children:[n,`/`,n+r+i,t.cells.length>1?(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,QS(t.cells.length,`cell`)]}):null]}),(0,m.jsx)(vC,{className:`mt-1.5`,pass:n,fail:r,infra:i})]}),(0,m.jsxs)(Xw,{className:`text-right`,children:[(0,m.jsx)(yC,{rate:t.passRate}),Vy(t.cells)?(0,m.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:`gated`}):null]}),(0,m.jsx)(Xw,{className:`tabular hidden text-right text-muted-foreground sm:table-cell`,children:Cy(t.run.durationMs)})]},t.run.runId)})})]})})]})}var lT=ca(`/evals`);function uT(){let{q:e}=lT.useSearch(),t=Ki({from:`/evals`}),{data:n,error:r,isPending:i}=et(nb),a=(0,p.useMemo)(()=>{let t=new Map,r=e?.toLowerCase();for(let e of n?.manifest.evals??[]){if(r&&!e.id.toLowerCase().includes(r))continue;let n=t.get(e.file)??[];n.push(e),t.set(e.file,n)}return[...t]},[n,e]);if(r)return(0,m.jsx)(oC,{error:r});if(i)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:8})]});let o=n.headers.slice(0,20);return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Evals`}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[QS(n.manifest.evals.length,`eval`),` across `,QS(n.headers.length,`run`),`. The strip shows the last 20 runs, oldest to newest.`]})]}),(0,m.jsxs)(`div`,{className:`relative sm:w-72`,children:[(0,m.jsx)(bS,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,m.jsx)(jC,{value:e??``,onChange:e=>t({search:{q:e.target.value||void 0},replace:!0}),placeholder:`Filter evals`,className:`h-9 pl-8`})]})]}),n.manifest.evals.length===0?(0,m.jsx)(aC,{icon:Rx,title:`No evals yet`,children:`Evals appear here once a run that includes them is recorded.`}):a.length===0?(0,m.jsxs)(aC,{icon:bS,title:`No evals match`,children:[`Nothing matches “`,e,`”.`]}):a.map(([e,t])=>(0,m.jsxs)(`section`,{className:`overflow-hidden rounded-xl border bg-card`,children:[(0,m.jsx)(`div`,{className:`border-b bg-muted/40 px-4 py-2 font-mono text-xs text-muted-foreground`,children:e}),(0,m.jsx)(`div`,{className:`divide-y`,children:t.map(e=>{let t=Ry(o,e.slug).filter(e=>e.outcome===`pass`||e.outcome===`fail`),n=t.length?t.filter(e=>e.outcome===`pass`).length/t.length:null;return(0,m.jsxs)(z,{to:`/evals/$slug`,params:{slug:e.slug},className:`flex flex-col gap-2 px-4 py-3 transition-colors hover:bg-accent/50 sm:flex-row sm:items-center sm:gap-4`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,m.jsx)(gC,{outcome:e.latest.outcome}),(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.path.at(-1)}),e.path.length>1?(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.path.slice(0,-1).join(` › `)}):null]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-4 pl-6 sm:pl-0`,children:[(0,m.jsx)(CC,{size:`sm`,items:o.slice().reverse().map(t=>({key:t.runId,outcome:t.evals.find(t=>t.slug===e.slug)?.outcome??null}))}),(0,m.jsx)(yC,{rate:n,className:`w-10 text-right text-sm`})]})]},e.slug)})})]},e))]})}var dT={running:{label:`Running`,tone:`border-brand/30 bg-brand/10 text-brand`},cancelling:{label:`Cancelling`,tone:`border-infra/30 bg-infra/10 text-infra`},finishing:{label:`Finishing`,tone:`border-brand/30 bg-brand/10 text-brand`},stopped:{label:`Stopped`,tone:`border-border bg-muted text-muted-foreground`}};function fT(e=1e3){let[t,n]=(0,p.useState)(()=>Date.now());return(0,p.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function pT({run:e,className:t}){let{label:n,tone:r}=dT[e.state];return(0,m.jsxs)(pC,{variant:`outline`,className:Q(`gap-1.5 tabular`,r,t),children:[e.state===`stopped`?(0,m.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/60`}):(0,m.jsxs)(`span`,{className:`relative flex size-1.5`,children:[(0,m.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-current opacity-60`}),(0,m.jsx)(`span`,{className:`relative inline-flex size-1.5 rounded-full bg-current`})]}),n,` `,e.counts.done,`/`,e.planned]})}function mT({run:e,className:t}){let{passed:n,failed:r,errored:i,skipped:a,running:o,done:s}=e.counts,c=Math.max(e.planned,1),l=(e,t)=>e>0?(0,m.jsx)(`div`,{className:Q(`transition-[width] duration-500`,t),style:{width:`${e/c*100}%`}}):null;return(0,m.jsxs)(`div`,{className:Q(`flex h-2 overflow-hidden rounded-full bg-muted`,t),role:`progressbar`,"aria-label":`Attempts finished`,"aria-valuemin":0,"aria-valuemax":e.planned,"aria-valuenow":s,children:[l(n,`bg-pass`),l(r,`bg-fail`),l(i,`bg-infra`),l(a,`bg-skip/50`),e.state===`stopped`?null:l(o,`animate-pulse bg-brand/40`)]})}function hT({status:e,stopped:t=!1,className:n}){return e===`running`&&!t?(0,m.jsx)(iS,{className:Q(`size-4 shrink-0 animate-spin text-brand`,n),"aria-label":`Running`}):e===`queued`||e===`running`?(0,m.jsx)(gC,{outcome:null,className:n}):(0,m.jsx)(gC,{outcome:e,className:n})}var gT={queued:`Queued`,running:`Running`,pass:`Passed`,fail:`Failed`,infra_error:`Infra error`,skipped:`Skipped`},_T=(e,t)=>Cy(Math.max(0,t-Date.parse(e.startedAt)));function vT({runs:e}){let t=fT();return e.length?(0,m.jsx)(`section`,{"aria-label":`Runs in progress`,className:`space-y-2`,children:e.map(e=>(0,m.jsxs)(z,{to:`/live/$runId`,params:{runId:e.runId},"data-live-run":e.runId,className:`block rounded-xl border bg-card px-4 py-3 transition-colors hover:bg-accent/50`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,m.jsx)(pT,{run:e}),(0,m.jsxs)(`span`,{className:`text-sm font-medium`,title:ZS(e.startedAt),children:[`Started `,YS(e.startedAt,t)]}),(0,m.jsx)(`span`,{className:`hidden font-mono text-[11px] text-muted-foreground sm:inline`,children:e.runId}),(0,m.jsxs)(`span`,{className:`tabular ml-auto text-xs text-muted-foreground`,children:[e.counts.passed,` passed · `,e.counts.failed+e.counts.errored,` failed`,e.state!==`stopped`&&e.counts.running?` · ${e.counts.running} running`:``,` `,`· `,_T(e,t)]})]}),(0,m.jsx)(mT,{run:e,className:`mt-2.5`})]},e.runId))}):null}var yT=ca(`/live/$runId`),bT=ca(`/live/$runId/attempt`);function xT(e){let t=ub(),n=et(nb),r=t.runs.find(t=>t.runId===e);return{run:r,landed:!r&&!!n.data?.headers.some(t=>t.runId===e),isPending:t.isPending||n.isPending,error:t.error??n.error}}function ST({label:e,children:t}){return(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,m.jsx)(`div`,{className:`tabular mt-1 text-lg font-semibold tracking-tight`,children:t})]})}function CT({runId:e}){return(0,m.jsxs)(aC,{icon:uS,title:`This run isn't in progress`,children:[`No running `,(0,m.jsx)(`span`,{className:`font-mono`,children:`reeval run`}),` has the id`,` `,(0,m.jsx)(`span`,{className:`font-mono`,children:e}),`, and no record of it has landed.`,` `,(0,m.jsx)(z,{to:`/`,className:`underline`,children:`Back to runs`})]})}function wT({attempt:e,run:t,now:n}){return e.durationMs===null?e.status===`running`&&e.startedAt&&t.state!==`stopped`?(0,m.jsx)(m.Fragment,{children:Cy(Math.max(0,n-Date.parse(e.startedAt)))}):(0,m.jsx)(m.Fragment,{children:`–`}):(0,m.jsx)(m.Fragment,{children:Cy(e.durationMs)})}function TT(){let{runId:e}=yT.useParams(),t=Ki(),n=fT(),{run:r,landed:i,isPending:a,error:o}=xT(e);(0,p.useEffect)(()=>{i&&t({to:`/runs/$runId`,params:{runId:e},replace:!0})},[i,t,e]);let s=(0,p.useMemo)(()=>{let e=new Map;for(let t of r?.attempts??[])e.set(t.evalId,[...e.get(t.evalId)??[],t]);return[...e.values()]},[r]);if(o)return(0,m.jsx)(oC,{error:o});if(a||i)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:6})]});if(!r)return(0,m.jsx)(CT,{runId:e});let c=r.state===`stopped`;return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(VS,{asChild:!0,variant:`ghost`,size:`sm`,className:`-ml-2 text-muted-foreground`,children:(0,m.jsxs)(z,{to:`/`,children:[(0,m.jsx)(Pb,{}),` Runs`]})}),(0,m.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:c?`Run stopped`:`Run in progress`}),(0,m.jsx)(pT,{run:r})]}),(0,m.jsxs)(`p`,{className:`mt-1 flex flex-wrap gap-x-2 text-sm text-muted-foreground`,children:[(0,m.jsxs)(`span`,{title:ZS(r.startedAt),children:[`Started `,YS(r.startedAt,n)]}),(0,m.jsx)(`span`,{children:`·`}),(0,m.jsx)(`span`,{className:`font-mono text-xs leading-5`,children:r.runId})]})]}),c?(0,m.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-infra/30 bg-infra/5 px-4 py-3 text-sm`,children:[(0,m.jsx)(cx,{className:`mt-0.5 size-4 shrink-0 text-infra`}),(0,m.jsxs)(`p`,{children:[`This run stopped without writing a record: its`,` `,(0,m.jsx)(`span`,{className:`font-mono`,children:`reeval run`}),` exited or stopped responding. The attempts below are what finished before it did.`]})]}):null,(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(mT,{run:r,className:`h-2.5`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-4`,children:[(0,m.jsxs)(ST,{label:`Finished`,children:[r.counts.done,(0,m.jsxs)(`span`,{className:`ml-1 text-sm font-normal text-muted-foreground`,children:[`of `,QS(r.planned,`attempt`)]})]}),(0,m.jsx)(ST,{label:`Passed`,children:(0,m.jsx)(`span`,{className:`text-pass`,children:r.counts.passed})}),(0,m.jsx)(ST,{label:`Failed`,children:(0,m.jsx)(`span`,{className:r.counts.failed+r.counts.errored?`text-fail`:``,children:r.counts.failed+r.counts.errored})}),(0,m.jsx)(ST,{label:`Elapsed`,children:c?`Stopped`:_T(r,n)})]}),r.state===`finishing`?(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every attempt has finished; writing the run's record.`}):null]}),(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-10`}),(0,m.jsx)(Yw,{children:`Attempt`}),(0,m.jsx)(Yw,{className:`hidden md:table-cell`,children:`Cell`}),(0,m.jsx)(Yw,{className:`hidden sm:table-cell`,children:`Status`}),(0,m.jsx)(Yw,{className:`text-right`,children:`Duration`})]})}),(0,m.jsx)(qw,{children:s.flat().map(t=>{let i=hy(t.status)&&t.status!==`skipped`,a=`${t.name} · #${t.n}`;return(0,m.jsxs)(Jw,{"data-live-attempt":t.status,children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(hT,{status:t.status,stopped:c})}),(0,m.jsxs)(Xw,{children:[i?(0,m.jsx)(z,{to:`/live/$runId/attempt`,params:{runId:e},search:{key:t.key},className:`font-medium hover:underline`,children:a}):(0,m.jsx)(`span`,{className:`font-medium`,children:a}),(0,m.jsxs)(`div`,{className:`mt-0.5 font-mono text-[11px] text-muted-foreground`,children:[t.file,(0,m.jsxs)(`span`,{className:`md:hidden`,children:[` · `,t.cell]})]})]}),(0,m.jsx)(Xw,{className:`hidden font-mono text-xs md:table-cell`,children:t.cell}),(0,m.jsx)(Xw,{className:`hidden text-sm text-muted-foreground sm:table-cell`,children:c&&t.status===`running`?`Stopped`:c&&t.status===`queued`?`Never started`:gT[t.status]}),(0,m.jsx)(Xw,{className:`tabular pr-4 text-right text-muted-foreground`,children:(0,m.jsx)(wT,{attempt:t,run:r,now:n})})]},t.key)})})]})})]})}function ET(){let{runId:e}=bT.useParams(),{key:t=``}=bT.useSearch(),n=Ki(),{run:r,landed:i,isPending:a,error:o}=xT(e),s=r?.attempts.find(e=>e.key===t),c=et({...db(e,t),enabled:!!s&&hy(s.status)}),l=et({...rb(e),enabled:i});return(0,p.useEffect)(()=>{if(l.data){for(let r of l.data.evals){let i=r.attempts.find(e=>e.key===t);if(i){n({to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:e,slug:r.slug,attempt:i.id},replace:!0});return}}n({to:`/runs/$runId`,params:{runId:e},replace:!0})}},[l.data,t,n,e]),o?(0,m.jsx)(oC,{error:o}):a||i?(0,m.jsx)(cC,{rows:6}):r?s?(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(VS,{asChild:!0,variant:`ghost`,size:`sm`,className:`-ml-2 text-muted-foreground`,children:(0,m.jsxs)(z,{to:`/live/$runId`,params:{runId:e},children:[(0,m.jsx)(Pb,{}),` Run in progress`]})}),(0,m.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(hT,{status:s.status,className:`size-5`}),(0,m.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:s.name}),(0,m.jsxs)(`span`,{className:`font-mono text-sm text-muted-foreground`,children:[s.cell,`#`,s.n]})]}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[gT[s.status],s.durationMs===null?``:` in ${Cy(s.durationMs)}`,` · The diff, checks and judge tabs arrive with the run's record.`]})]}),hy(s.status)?c.error?(0,m.jsx)(aC,{icon:Ix,title:`No transcript`,children:`This attempt didn't write one.`}):c.isPending?(0,m.jsx)(cC,{rows:5}):(0,m.jsx)(Mw,{text:c.data}):(0,m.jsx)(aC,{icon:Ix,title:`Not finished yet`,children:`The transcript is here once this attempt finishes.`})]}):(0,m.jsxs)(aC,{icon:Ix,title:`No such attempt`,children:[`This run has no attempt `,(0,m.jsx)(`span`,{className:`font-mono`,children:t}),`.`]}):(0,m.jsx)(CT,{runId:e})}function DT(){return(0,m.jsxs)(aC,{icon:bx,title:`Page not found`,children:[`That link doesn't point anywhere in the studio.`,` `,(0,m.jsx)(z,{to:`/`,className:`underline`,children:`Go to runs`})]})}function OT({doc:e,id:t}){let n=e.attempts[t.replace(/:check\d+$/,``)],r=`inline-flex rounded border bg-muted/60 px-1 font-mono text-[10px] text-muted-foreground`;return n?(0,m.jsx)(z,{to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:n.runId,slug:n.evalSlug,attempt:n.attempt},className:`${r} hover:text-foreground`,children:t}):(0,m.jsx)(`span`,{className:r,title:e.cited[t]??t,children:t})}function kT({doc:e,ids:t}){return(0,m.jsx)(`span`,{className:`ml-1 inline-flex flex-wrap gap-1 align-middle`,children:t.map(t=>(0,m.jsx)(OT,{doc:e,id:t},t))})}function AT({doc:e,title:t,items:n}){return n.length?(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,m.jsx)(`ul`,{className:`list-disc space-y-1.5 pl-5 text-sm`,children:n.map(t=>(0,m.jsxs)(`li`,{children:[t.text,(0,m.jsx)(kT,{doc:e,ids:t.cites}),t.confidence===`high`?null:(0,m.jsxs)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:[`(`,t.confidence,` confidence)`]}),t.unverifiedNumbers?.length?(0,m.jsxs)(`span`,{className:`ml-1 text-xs text-infra`,children:[`(not in the cited facts: `,t.unverifiedNumbers.join(`, `),`)`]}):null]},t.text))})]}):null}function jT({entry:e}){let{doc:t}=e,n=t.analysis,r=t.validation;return(0,m.jsxs)(`div`,{className:`space-y-5`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,m.jsx)(pC,{variant:e.source===`saved`?`secondary`:`outline`,children:e.source===`saved`?`saved`:`local cache`}),hv(t)?(0,m.jsx)(pC,{variant:`outline`,className:`text-infra`,children:`superseded: re-run reeval analyze`}):null,(0,m.jsxs)(`span`,{children:[t.scope.base?`vs ${t.scope.base}`:`no base run`,t.scope.evals?` · evals matching "${t.scope.evals}"`:``,` · by `,t.author,` ·`,` `,ZS(t.createdAt)]})]}),(0,m.jsxs)(`p`,{className:`rounded-lg border bg-muted/40 p-3 text-sm leading-relaxed`,children:[(0,m.jsx)(`span`,{className:`font-semibold`,children:`TL;DR. `}),n.tldr]}),(0,m.jsx)(AT,{doc:t,title:`What happened`,items:n.whatHappened}),(0,m.jsx)(AT,{doc:t,title:`Results`,items:n.results}),(0,m.jsx)(AT,{doc:t,title:`Why`,items:n.why}),n.anomalies.length?(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Anomalies`}),(0,m.jsx)(`ul`,{className:`space-y-1.5 text-sm`,children:n.anomalies.map(e=>(0,m.jsxs)(`li`,{children:[(0,m.jsx)(pC,{variant:`outline`,className:`mr-1.5 text-[10px]`,children:e.kind}),e.text,(0,m.jsx)(kT,{doc:t,ids:e.cites})]},e.text))})]}):null,(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Suggested actions`}),n.actions.length===0?(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`None: nothing here is worth acting on.`}):(0,m.jsx)(`ol`,{className:`space-y-3`,children:n.actions.map((e,n)=>(0,m.jsxs)(`li`,{className:`rounded-lg border p-3 text-sm`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(`span`,{className:`font-medium`,children:[n+1,`. `,e.title]}),(0,m.jsx)(pC,{variant:`secondary`,className:`text-[10px]`,children:e.kind}),(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`impact `,e.impact,` · effort `,e.effort]})]}),(0,m.jsxs)(`p`,{className:`mt-1.5`,children:[(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:e.target}),`: `,e.change]}),(0,m.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Expect: `,e.expectedEffect]}),(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2 text-xs`,children:[e.verify?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono`,children:e.verify}),(0,m.jsx)(KC,{value:e.verify,label:`copy`})]}):(0,m.jsxs)(`span`,{className:`text-infra`,children:[`Verify command rejected: `,e.verifyProblem??`not reeval’s CLI`]}),(0,m.jsx)(kT,{doc:t,ids:e.cites})]})]},e.title))})]}),(0,m.jsxs)(`p`,{className:`text-sm`,children:[(0,m.jsxs)(`span`,{className:`font-medium`,children:[`Confidence: `,n.confidence.overall,`.`]}),` `,n.confidence.why]}),(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t.resolvedModel??t.model,` · `,t.promptVersion,` · digest v`,t.inputs.digestVersion,t.usage.inputTokens===null?``:` · ${t.usage.inputTokens} in / ${t.usage.outputTokens??`?`} out tokens`,` `,`· `,r.citations,` citations checked, `,r.invalid.length,` invalid, `,r.dropped,` dropped ·`,` `,r.commands,` commands checked, `,r.invalidCommands.length,` rejected · `,e.file]})]})}function MT({runId:e}){let{data:t,error:n,isPending:r}=et(ab(e)),[i,a]=(0,p.useState)();if(n)return(0,m.jsx)(oC,{error:n});if(r)return(0,m.jsx)(cC,{rows:5});let o=t?.entries??[];if(o.length===0)return(0,m.jsxs)(aC,{icon:wS,title:`No analysis for this run yet`,children:[`Run `,(0,m.jsxs)(`code`,{className:`font-mono text-xs`,children:[`reeval analyze `,e,` --save`]}),` to write one into the run's history folder, or`,` `,(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:`reeval analyze --context`}),` to hand the digest to your own coding agent.`]});let s=o.find(e=>e.file===i)??o[0];return(0,m.jsxs)(`div`,{className:`space-y-4`,children:[o.length>1?(0,m.jsxs)(Rw,{value:s.file,onValueChange:a,children:[(0,m.jsx)(Bw,{className:`w-full sm:w-auto`,children:(0,m.jsx)(zw,{})}),(0,m.jsx)(Vw,{children:o.map(e=>(0,m.jsxs)(Hw,{value:e.file,children:[ZS(e.doc.createdAt),` · `,e.source,` · `,e.doc.model]},e.file))})]}):null,(0,m.jsx)(jT,{entry:s})]})}var NT=ca(`/runs/$runId`);function PT({icon:e,children:t}){return(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(e,{className:`size-3.5`}),t]})}function FT({record:e,children:t}){return(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:ZS(e.startedAt)}),(0,m.jsx)(_C,{outcome:ky(e)}),e.status===`interrupted`?(0,m.jsx)(pC,{variant:`outline`,className:`text-infra`,children:`interrupted`}):null]}),(0,m.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-sm text-muted-foreground`,children:[(0,m.jsxs)(PT,{icon:Kx,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:Dy(e.git?.sha)}),e.git?.dirty?(0,m.jsx)(`span`,{className:`text-infra`,children:`· dirty`}):null]}),e.git?.branch?(0,m.jsx)(PT,{icon:Wx,children:e.git.branch}):null,(0,m.jsx)(PT,{icon:PS,children:e.runner.kind===`ci`?`CI · ${e.runner.provider}`:e.author}),(0,m.jsx)(PT,{icon:mx,children:Cy(e.durationMs)}),e.cost.usage?(0,m.jsxs)(PT,{icon:vx,children:[Ey(e.cost.usage),` tokens`]}):null]})]}),t]})}function IT({warnings:e}){if(e.length===0)return null;let t=e.some(e=>e.kind===`root`);return(0,m.jsxs)(`div`,{role:`alert`,className:Q(`flex gap-3 rounded-xl border p-4 text-sm`,t?`border-fail/40 bg-fail/5`:`border-infra/40 bg-infra/5`),children:[(0,m.jsx)(SS,{className:Q(`mt-0.5 size-4 shrink-0`,t?`text-fail`:`text-infra`)}),(0,m.jsx)(`ul`,{className:`min-w-0 space-y-1`,children:e.map(e=>(0,m.jsxs)(`li`,{className:`break-words`,children:[(0,m.jsx)(`span`,{className:Q(`font-semibold`,e.kind===`root`?`text-fail`:`text-infra`),children:e.kind===`root`?`Root`:`Capabilities`}),` `,(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:e.message}),e.file?(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.file]}):null]},`${e.file}\0${e.message}`))})]})}function LT({node:e,depth:t,selected:n,onSelect:r}){let[i,a]=(0,p.useState)(!0),o={paddingLeft:`${t*14+8}px`};if(e.kind===`eval`){let t=n===e.eval.slug;return(0,m.jsxs)(`button`,{type:`button`,onClick:()=>r(e.eval.slug),style:o,className:Q(`flex w-full items-center gap-2 rounded-md py-1.5 pr-2 text-left text-sm transition-colors`,t?`bg-accent text-foreground`:`text-foreground/85 hover:bg-accent/60`),children:[(0,m.jsx)(gC,{outcome:e.eval.outcome}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.eval.todo?(0,m.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`todo`}):Ly(e.eval)?(0,m.jsxs)(`span`,{className:`tabular shrink-0 text-xs text-muted-foreground`,children:[e.tally.pass,`/`,e.tally.pass+e.tally.fail+e.tally.missed+e.tally.infra]}):null]})}let s=t===0,c=s?wx:Bx;return(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>a(!i),style:o,className:`flex w-full items-center gap-1.5 rounded-md py-1.5 pr-2 text-left text-xs font-medium text-muted-foreground hover:bg-accent/60`,children:[(0,m.jsx)(Jb,{className:Q(`size-3.5 transition-transform`,i&&`rotate-90`)}),(0,m.jsx)(c,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:Q(`min-w-0 flex-1 truncate`,s&&`font-mono`),children:e.name}),e.tally.fail?(0,m.jsxs)(`span`,{className:`tabular text-fail`,children:[e.tally.fail,` failed`]}):e.tally.missed?(0,m.jsxs)(`span`,{className:`tabular`,children:[e.tally.missed,` missed, not gated`]}):null]}),i?e.children.map(e=>(0,m.jsx)(LT,{node:e,depth:t+1,selected:n,onSelect:r},e.key)):null]})}function RT(e){return e.flatMap(e=>{if(e.kind===`eval`)return e.eval.outcome===`pass`||e.eval.outcome===`skipped`?[]:[e];let t=RT(e.children);return t.length?[{...e,children:t}]:[]})}function zT({rows:e,runId:t,slug:n}){let r=e.some(e=>e.lift!==null),i=e.some(e=>e.effort!==null),a=e.some(e=>e.role===`variant`);return(0,m.jsx)(`div`,{className:`overflow-hidden rounded-lg border`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{children:`Harness`}),(0,m.jsx)(Yw,{children:`Environment`}),a?(0,m.jsx)(Yw,{children:`Role`}):null,(0,m.jsx)(Yw,{className:`hidden 2xl:table-cell`,children:`Sandbox`}),(0,m.jsx)(Yw,{children:`Attempts`}),(0,m.jsx)(Yw,{className:`text-right`,children:`Pass rate`}),r||i?(0,m.jsx)(Yw,{className:`text-right`,children:r&&i?`Lift and effort`:r?`Lift`:`Effort`}):null]})}),(0,m.jsx)(qw,{children:e.map(e=>(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Xw,{className:`font-mono text-xs`,children:e.harness}),(0,m.jsxs)(Xw,{className:`font-mono text-xs`,children:[e.environment===`-`?(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`none`}):e.environment,e.overrides.length?(0,m.jsxs)(`div`,{className:`mt-0.5 font-sans text-[11px] text-muted-foreground`,children:[`overrides `,e.overrides.join(`, `)]}):null]}),a?(0,m.jsx)(Xw,{children:(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[e.role,e.gated?null:(0,m.jsx)(pC,{variant:`outline`,className:`text-[10px] text-muted-foreground`,children:`not gated`})]})}):null,(0,m.jsx)(Xw,{className:`hidden font-mono text-xs 2xl:table-cell`,children:e.sandbox}),(0,m.jsx)(Xw,{children:(0,m.jsx)(`div`,{className:`flex items-center gap-1`,children:e.attempts.map(r=>(0,m.jsx)(z,{to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:t,slug:n,attempt:r.id},title:`${r.id} · ${Cy(r.durationMs)}`,className:`rounded-sm p-0.5 hover:bg-accent`,children:(0,m.jsx)(gC,{outcome:r.outcome,missed:!e.gated})},r.id))})}),(0,m.jsxs)(Xw,{className:`text-right`,children:[(0,m.jsx)(yC,{rate:e.passRate}),(0,m.jsxs)(`span`,{className:`tabular ml-1.5 text-xs text-muted-foreground`,children:[e.pass,`/`,e.pass+e.fail]})]}),r||i?(0,m.jsxs)(Xw,{className:`min-w-44 whitespace-normal text-right`,children:[r?(0,m.jsx)(xC,{points:e.lift,interval:e.liftInterval}):null,e.belowMinLift?(0,m.jsx)(`div`,{className:`text-[11px] text-fail`,children:`lower bound below minLift`}):null,i?(0,m.jsx)(`div`,{className:r?`mt-1`:void 0,children:(0,m.jsx)(BT,{row:e})}):null]}):null]},e.key))})]})})}function BT({row:e}){if(!e.effort)return(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`–`});let t=e.effortVsControl,n=t&&(t.verdict===`fewer`||t.verdict===`more`);return(0,m.jsxs)(`div`,{className:`tabular text-xs`,children:[(0,m.jsx)(`div`,{children:ey(e.effort)}),t?(0,m.jsxs)(`div`,{className:Q(`text-[11px]`,n?t.verdict===`fewer`?`text-pass`:`text-fail`:`text-muted-foreground`),title:t.toolsP===null?void 0:`exact rank test p = ${t.toolsP.toFixed(3)}`,children:[`tools `,Zv(t.toolsRatio),` vs control · `,$v[t.verdict](`tool calls`)]}):null]})}function VT({record:e,entry:t}){let n=Iy(t),r=Ly(t);return(0,m.jsxs)(`div`,{className:`space-y-5`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`flex items-center gap-1.5 font-mono text-xs text-muted-foreground`,children:[t.file,...t.group].join(` › `)}),(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2.5`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:t.name}),(0,m.jsx)(_C,{outcome:t.outcome,label:t.todo?`Todo`:void 0})]}),(0,m.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,m.jsx)(VS,{asChild:!0,variant:`outline`,size:`sm`,children:(0,m.jsxs)(z,{to:`/evals/$slug`,params:{slug:t.slug},children:[(0,m.jsx)(fS,{}),` History`]})}),t.tags.map(e=>(0,m.jsxs)(pC,{variant:`secondary`,children:[`#`,e]},e))]})]}),r?(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Cells`}),(0,m.jsx)(zT,{rows:n,runId:e.runId,slug:t.slug})]}):null,(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:QS(t.attempts.length,`attempt`)}),(0,m.jsx)(`div`,{className:`divide-y overflow-hidden rounded-lg border`,children:t.attempts.map(n=>{let r=n.judgements[0],i=Hy(t,n);return(0,m.jsxs)(z,{to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:e.runId,slug:t.slug,attempt:n.id},className:`group flex items-start gap-3 px-3.5 py-3 transition-colors hover:bg-accent/50`,children:[(0,m.jsx)(gC,{outcome:n.outcome,missed:i,className:`mt-0.5`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-sm`,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:n.id}),(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[Cy(n.durationMs),` · `,QS(n.turns.length,`turn`),` ·`,` `,Oy(n.activity)]}),r?(0,m.jsxs)(`span`,{className:Q(`tabular text-xs`,r.verdict===`pass`?`text-pass`:`text-fail`),children:[`judge `,r.score.toFixed(2),` / `,r.threshold]}):null,i?(0,m.jsx)(pC,{variant:`outline`,className:`text-[10px] text-muted-foreground`,children:`missed, not gated`}):null]}),n.error?(0,m.jsxs)(`p`,{className:Q(`mt-1 line-clamp-2 font-mono text-xs`,i?`text-muted-foreground`:`text-fail`),children:[n.error.kind,`: `,n.error.message.split(`
|
|
57
|
+
`)[0]}),meta:r?`thought for ${r}`:`reasoning`,children:(0,m.jsx)(`p`,{className:`px-3 py-2 text-sm leading-relaxed whitespace-pre-wrap text-muted-foreground italic`,children:e.text})});case`tool`:return(0,m.jsxs)(Dw,{open:t,onToggle:n,icon:e.tool.toLowerCase().includes(`shell`)||e.tool===`bash`?ES:IS,tone:e.ok?void 0:`text-fail`,title:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,m.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:Ew(e.input)})]}),meta:(0,m.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.ok?null:(0,m.jsx)(`span`,{className:`text-fail`,children:`failed`}),r]}),children:[(0,m.jsx)(Ow,{label:`Input`,text:Tw(e.input)}),(0,m.jsx)(Ow,{label:`Output`,text:Tw(e.output)})]});case`file-edit`:{let t=e.kind===`create`?Mx:e.kind===`delete`?Ox:Ax;return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm`,children:[(0,m.jsx)(t,{className:`size-4 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.kind===`create`?`Created`:e.kind===`delete`?`Deleted`:`Edited`}),(0,m.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.path}),(0,m.jsxs)(`span`,{className:`ml-auto flex shrink-0 gap-2 font-mono text-xs`,children:[e.added===null?null:(0,m.jsxs)(`span`,{className:`text-pass`,children:[`+`,e.added]}),e.removed===null?null:(0,m.jsxs)(`span`,{className:`text-fail`,children:[`−`,e.removed]}),r?(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:r}):null]})]})}case`web-search`:return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm`,children:[(0,m.jsx)(bS,{className:`size-4 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`Searched`}),(0,m.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`“`,e.query,`”`]}),(0,m.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:[e.references===null?``:`${e.references} sources · `,r]})]});case`web-fetch`:return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-sm`,children:[(0,m.jsx)(Xx,{className:Q(`size-4 text-muted-foreground`,!e.ok&&`text-fail`)}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`Fetched`}),(0,m.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs`,children:e.url}),(0,m.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground`,children:r})]});case`retry`:return(0,m.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-dashed px-3 py-2 text-sm text-muted-foreground`,children:[(0,m.jsx)(mS,{className:`mt-0.5 size-4 shrink-0`}),(0,m.jsx)(`span`,{className:`font-mono text-xs break-words whitespace-pre-wrap`,children:e.message})]});case`error`:return(0,m.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-fail/30 bg-fail/5 px-3 py-2 text-sm text-fail`,children:[(0,m.jsx)(Qb,{className:`mt-0.5 size-4 shrink-0`}),(0,m.jsx)(`span`,{className:`font-mono text-xs break-words whitespace-pre-wrap`,children:e.message})]})}}function Aw({item:e,open:t,toggle:n}){if(e.kind===`turn`)return(0,m.jsxs)(`div`,{className:`pt-2`,children:[(0,m.jsxs)(`div`,{className:`mb-2 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:[`Turn `,e.turn+1]}),(0,m.jsxs)(`div`,{className:`flex gap-3`,children:[(0,m.jsx)(`div`,{className:`mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-muted`,children:(0,m.jsx)(MS,{className:`size-3.5`})}),(0,m.jsx)(`div`,{className:`min-w-0 flex-1 rounded-lg bg-muted/60 px-3.5 py-2.5 text-sm leading-relaxed break-words whitespace-pre-wrap`,children:e.prompt})]})]});if(e.kind===`turn-end`)return(0,m.jsxs)(`div`,{className:`flex items-center gap-3 py-1 text-xs text-muted-foreground`,children:[(0,m.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,m.jsxs)(`span`,{children:[`Turn `,e.turn+1,` `,e.status,` in `,Cy(e.durationMs)]}),(0,m.jsx)(`div`,{className:`h-px flex-1 bg-border`})]});let r=e.event;return(0,m.jsxs)(`div`,{className:`flex gap-2`,children:[(0,m.jsx)(`span`,{className:`tabular w-14 shrink-0 pt-2 text-right font-mono text-[10px] text-muted-foreground/70`,children:ww(r.atMs)}),(0,m.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,m.jsx)(kw,{e:r,open:t,toggle:n})})]})}var jw=e=>e.kind===`event`&&(e.event.type===`tool`||e.event.type===`reasoning`);function Mw({text:e}){let t=(0,p.useMemo)(()=>Ky(Gy(e)),[e]),[n,r]=(0,p.useState)(()=>new Set),i=(0,p.useRef)(null),[a,o]=(0,p.useState)(0);(0,p.useLayoutEffect)(()=>{o((i.current?.getBoundingClientRect().top??0)+window.scrollY)},[]);let s=Cw({count:t.length,estimateSize:()=>56,overscan:8,scrollMargin:a}),c=(0,p.useCallback)(e=>r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]),l=(0,p.useMemo)(()=>{let e=0,n=0,r=0;for(let i of t)i.kind===`event`&&(i.event.type===`tool`&&e++,i.event.type===`reasoning`&&n++,i.event.type===`file-edit`&&r++);return{tools:e,reasoning:n,edits:r}},[t]),u=t.flatMap((e,t)=>jw(e)?[t]:[]),d=u.length>0&&u.every(e=>n.has(e));return t.length===0?(0,m.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:`The transcript is empty.`}):(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(pC,{variant:`secondary`,children:[l.tools,` tool calls`]}),(0,m.jsxs)(pC,{variant:`secondary`,children:[l.edits,` file edits`]}),(0,m.jsxs)(pC,{variant:`secondary`,children:[l.reasoning,` reasoning blocks`]}),u.length?(0,m.jsx)(VS,{variant:`ghost`,size:`sm`,className:`ml-auto`,onClick:()=>r(d?new Set:new Set(u)),children:d?`Collapse all`:`Expand all`}):null]}),(0,m.jsx)(`div`,{ref:i,className:`relative w-full`,style:{height:s.getTotalSize()},children:s.getVirtualItems().map(e=>{let r=t[e.index];return(0,m.jsx)(`div`,{"data-index":e.index,ref:s.measureElement,className:`absolute top-0 left-0 w-full pb-2.5`,style:{transform:`translateY(${e.start-s.options.scrollMargin}px)`},children:(0,m.jsx)(Aw,{item:r,open:n.has(e.index),toggle:()=>c(e.index)})},e.key)})})]})}var Nw=[`transcript`,`diff`,`checks`,`judge`,`state`,`debug`],Pw=ca(`/runs/$runId/evals/$slug/attempts/$attempt`),Fw=[[`setupMs`,`Setup`,`bg-skip/60`],[`agentMs`,`Agent`,`bg-brand`],[`diffMs`,`Diff`,`bg-drift/70`],[`checksMs`,`Checks`,`bg-infra`],[`judgeMs`,`Judge`,`bg-pass`]];function Iw({attempt:e}){let t=Fw.reduce((t,[n])=>t+e.timings[n],0)||1;return(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-muted`,children:Fw.map(([n,r,i])=>e.timings[n]>0?(0,m.jsxs)(dv,{children:[(0,m.jsx)(fv,{asChild:!0,children:(0,m.jsx)(`div`,{className:i,style:{width:`${e.timings[n]/t*100}%`}})}),(0,m.jsxs)(pv,{children:[r,` `,Cy(e.timings[n])]})]},n):null)}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:Fw.map(([t,n,r])=>(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:Q(`size-2 rounded-full`,r)}),n,` `,(0,m.jsx)(`span`,{className:`tabular text-foreground`,children:Cy(e.timings[t])})]},t))})]})}function Lw(){let{runId:e,slug:t,attempt:n}=Pw.useParams(),{tab:r=`transcript`}=Pw.useSearch(),i=Ki({from:`/runs/$runId/evals/$slug/attempts/$attempt`}),{data:a,error:o,isPending:s}=et(rb(e)),{data:c}=cb(),l=a&&Yy(a,t),u=(l&&Xy(l,n)?.key)??``,{data:d}=et(ob(e,u,!!c?.features.debug&&!!u));if(o)return(0,m.jsx)(oC,{error:o});if(s)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:6})]});let f=Yy(a,t),p=f&&Xy(f,n);if(!f||!p)return(0,m.jsxs)(aC,{icon:vS,title:`Attempt not found`,children:[`This run has no attempt `,(0,m.jsx)(`code`,{className:`font-mono`,children:n}),` of that eval.`,` `,(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e},className:`underline`,children:`Back to the run`})]});let h=f.attempts.indexOf(p),g=f.attempts[h-1],_=f.attempts[h+1],v=p.judgements[0],y=p.checks.filter(e=>e.exitCode!==0).length,b=[...new Set(p.turns.flatMap(e=>e.model?[e.model]:[]))];return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`nav`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,m.jsx)(z,{to:`/`,className:`hover:text-foreground`,children:`Runs`}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e},className:`font-mono text-xs hover:text-foreground`,children:$S(e)}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e},search:{eval:t},className:`max-w-64 truncate hover:text-foreground`,children:f.name}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:p.id})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:[f.file,...f.group].join(` › `)}),(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2.5`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:f.name}),(0,m.jsx)(_C,{outcome:p.outcome})]}),(0,m.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:p.id}),` ·`,` `,Cy(p.durationMs),` · `,QS(p.turns.length,`turn`),` ·`,` `,Oy(p.activity),p.activity.reasoningMs?` · ${Cy(p.activity.reasoningMs)} reasoning`:``,p.usage?` · ${Ey(p.usage)} tokens`:``,b.length?` · served by ${b.join(`, `)}`:``]})]}),f.attempts.length>1?(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(VS,{variant:`outline`,size:`icon`,className:`size-8`,disabled:!g,asChild:!!g,children:g?(0,m.jsx)(z,{to:`.`,params:{runId:e,slug:t,attempt:g.id},search:{tab:r},"aria-label":`Previous attempt`,children:(0,m.jsx)(Kb,{})}):(0,m.jsx)(Kb,{})}),(0,m.jsx)(`div`,{className:`flex items-center gap-0.5 px-1`,children:f.attempts.map(n=>(0,m.jsx)(z,{to:`.`,params:{runId:e,slug:t,attempt:n.id},search:{tab:r},title:n.id,className:Q(`rounded p-0.5`,n.id===p.id?`bg-accent ring-1 ring-border`:`hover:bg-accent/60`),children:(0,m.jsx)(gC,{outcome:n.outcome,className:`size-3.5`})},n.id))}),(0,m.jsx)(VS,{variant:`outline`,size:`icon`,className:`size-8`,disabled:!_,asChild:!!_,children:_?(0,m.jsx)(z,{to:`.`,params:{runId:e,slug:t,attempt:_.id},search:{tab:r},"aria-label":`Next attempt`,children:(0,m.jsx)(Jb,{})}):(0,m.jsx)(Jb,{})})]}):null]}),p.error?(0,m.jsxs)(`div`,{className:`rounded-lg border border-fail/30 bg-fail/5 px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs font-medium tracking-wide text-fail uppercase`,children:p.error.kind}),(0,m.jsx)(`pre`,{className:`mt-1 max-h-60 overflow-auto font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail`,children:p.error.message})]}):null,(0,m.jsx)(`div`,{className:`rounded-xl border bg-card p-4`,children:(0,m.jsx)(Iw,{attempt:p})}),(0,m.jsxs)(wC,{value:r,onValueChange:e=>i({search:{tab:e},replace:!0}),children:[(0,m.jsxs)(EC,{className:`w-full justify-start overflow-x-auto sm:w-auto`,children:[(0,m.jsx)(DC,{value:`transcript`,children:`Transcript`}),(0,m.jsxs)(DC,{value:`diff`,children:[`Diff`,p.changedFiles.length?(0,m.jsx)(`span`,{className:`tabular text-xs text-muted-foreground`,children:p.changedFiles.length}):null]}),(0,m.jsxs)(DC,{value:`checks`,children:[`Checks`,p.checks.length?(0,m.jsx)(`span`,{className:Q(`tabular text-xs`,y?`text-fail`:`text-muted-foreground`),children:y?`${y}/${p.checks.length}`:p.checks.length}):null]}),(0,m.jsxs)(DC,{value:`judge`,children:[`Judge`,v?(0,m.jsx)(`span`,{className:Q(`tabular text-xs`,v.verdict===`pass`?`text-pass`:`text-fail`),children:v.score.toFixed(2)}):null]}),(0,m.jsx)(DC,{value:`state`,children:`State`}),d?(0,m.jsx)(DC,{value:`debug`,children:`Debug`}):null]}),(0,m.jsxs)(`div`,{className:`mt-4`,children:[(0,m.jsx)(OC,{value:`transcript`,children:(0,m.jsx)(dC,{record:a,file:p.files.transcript,what:`transcript`,children:e=>(0,m.jsx)(Mw,{text:e},p.id)})}),(0,m.jsx)(OC,{value:`diff`,children:(0,m.jsx)(dC,{record:a,file:p.files.diff,what:`diff`,children:e=>(0,m.jsx)(VC,{text:e},p.id)})}),(0,m.jsx)(OC,{value:`checks`,children:(0,m.jsx)(AC,{record:a,attempt:p})}),(0,m.jsx)(OC,{value:`judge`,children:(0,m.jsx)(GC,{record:a,attempt:p})}),(0,m.jsx)(OC,{value:`state`,children:(0,m.jsx)(QC,{record:a,attempt:p})}),d?(0,m.jsx)(OC,{value:`debug`,children:(0,m.jsx)(IC,{runId:e,attemptKey:p.key,view:d})}):null]})]})]})}function Rw({...e}){return(0,m.jsx)(zm,{"data-slot":`select`,...e})}function zw({...e}){return(0,m.jsx)(Um,{"data-slot":`select-value`,...e})}function Bw({className:e,size:t=`default`,children:n,...r}){return(0,m.jsxs)(Vm,{"data-slot":`select-trigger`,"data-size":t,className:Q(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,m.jsx)(Wm,{asChild:!0,children:(0,m.jsx)(Wb,{className:`size-4 opacity-50`})})]})}function Vw({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,m.jsx)(qm,{children:(0,m.jsxs)(Ym,{"data-slot":`select-content`,className:Q(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,m.jsx)(Uw,{}),(0,m.jsx)(sh,{className:Q(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,m.jsx)(Ww,{})]})})}function Hw({className:e,children:t,...n}){return(0,m.jsxs)(ph,{"data-slot":`select-item`,className:Q(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,m.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,m.jsx)(_h,{children:(0,m.jsx)(Hb,{className:`size-4`})})}),(0,m.jsx)(hh,{children:t})]})}function Uw({className:e,...t}){return(0,m.jsx)(yh,{"data-slot":`select-scroll-up-button`,className:Q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,m.jsx)(Xb,{className:`size-4`})})}function Ww({className:e,...t}){return(0,m.jsx)(xh,{"data-slot":`select-scroll-down-button`,className:Q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,m.jsx)(Wb,{className:`size-4`})})}function Gw({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,m.jsx)(`table`,{"data-slot":`table`,className:Q(`w-full caption-bottom text-sm`,e),...t})})}function Kw({className:e,...t}){return(0,m.jsx)(`thead`,{"data-slot":`table-header`,className:Q(`[&_tr]:border-b`,e),...t})}function qw({className:e,...t}){return(0,m.jsx)(`tbody`,{"data-slot":`table-body`,className:Q(`[&_tr:last-child]:border-0`,e),...t})}function Jw({className:e,...t}){return(0,m.jsx)(`tr`,{"data-slot":`table-row`,className:Q(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Yw({className:e,...t}){return(0,m.jsx)(`th`,{"data-slot":`table-head`,className:Q(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function Xw({className:e,...t}){return(0,m.jsx)(`td`,{"data-slot":`table-cell`,className:Q(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}var Zw=ca(`/compare`),Qw={regressed:{label:`Regressed`,className:`border-fail/30 bg-fail/10 text-fail`},fixed:{label:`Fixed`,className:`border-pass/30 bg-pass/10 text-pass`},drift:{label:`Not comparable`,className:`border-drift/30 bg-drift/10 text-drift`},infra:{label:`Infra error`,className:`border-infra/30 bg-infra/10 text-infra`},added:{label:`New`,className:`text-brand border-brand/30`},removed:{label:`Removed`,className:`text-muted-foreground`},same:{label:`Same`,className:`text-muted-foreground`}};function $w({label:e,value:t,runs:n,onChange:r}){return(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,m.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,m.jsxs)(Rw,{value:t,onValueChange:r,children:[(0,m.jsx)(Bw,{className:`w-full`,children:(0,m.jsx)(zw,{placeholder:`Choose a run`})}),(0,m.jsx)(Vw,{children:n.map(e=>(0,m.jsxs)(Hw,{value:e.runId,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:Dy(e.git?.sha)}),(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:YS(e.startedAt)}),(0,m.jsxs)(`span`,{className:`tabular text-xs text-muted-foreground`,children:[e.summary.pass,`/`,e.summary.pass+e.summary.fail+e.summary.infraError]}),e.recorded?null:(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`scratch`})]},e.runId))})]})]})}function eT({base:e,head:t,kind:n}){let r=n===`score`?rT:iT;if(e===null&&t===null)return(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`–`});if(e===null||t===null)return(0,m.jsx)(`span`,{className:`tabular`,children:r(t===null?e:t)});let i=t-e;return(0,m.jsxs)(`span`,{className:`tabular`,children:[(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:r(e)}),(0,m.jsx)(Ib,{className:`mx-1 inline size-3 text-muted-foreground`}),r(t),Math.abs(i)>1e-9?(0,m.jsxs)(`span`,{className:Q(`ml-1.5 text-xs`,i>0?`text-pass`:`text-fail`),children:[i>0?`+`:``,n===`score`?i.toFixed(2):`${Math.round(i*100)} pts`]}):null]})}var tT=e=>`${e>=0?`+`:`−`}${Math.round(Math.abs(e)*100)}`,nT=e=>e?`${tT(e.points)} (${tT(e.lo)}…${tT(e.hi)})${e.withinNoise?` noise`:``}`:`–`,rT=e=>e.toFixed(2),iT=e=>wy(e);function aT({row:e,head:t}){let n=Qw[e.status],r=e.id.split(` › `).slice(1).join(` › `)||e.id;return(0,m.jsxs)(Jw,{className:e.status===`same`?`opacity-70`:void 0,children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(pC,{variant:`outline`,className:n.className,children:n.label})}),(0,m.jsxs)(Xw,{className:`max-w-md`,children:[e.slug?(0,m.jsx)(z,{to:`/evals/$slug`,params:{slug:e.slug},className:`font-medium hover:underline`,children:r}):r,(0,m.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id.split(` › `)[0]}),e.cells?(0,m.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`compared on the cells both runs have`,e.cells.added.length?` · added ${e.cells.added.join(`, `)}`:``,e.cells.removed.length?` · removed ${e.cells.removed.join(`, `)}`:``]}):null,e.perCell.length?(0,m.jsx)(`ul`,{className:`mt-1.5 space-y-0.5 text-[11px] text-muted-foreground`,children:e.perCell.map(e=>(0,m.jsxs)(`li`,{className:`tabular`,children:[(0,m.jsx)(`span`,{className:`font-mono`,children:e.key}),e.base.lift||e.head.lift?(0,m.jsxs)(m.Fragment,{children:[` · lift `,nT(e.base.lift),` → `,nT(e.head.lift)]}):null,e.base.effort&&e.head.effort?(0,m.jsxs)(m.Fragment,{children:[` · `,ty(e.base.effort,e.head.effort)]}):null]},e.key))}):null]}),(0,m.jsx)(Xw,{children:(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(gC,{outcome:e.base}),(0,m.jsx)(Ib,{className:`size-3 text-muted-foreground`}),e.slug&&e.head?(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:t},search:{eval:e.slug},children:(0,m.jsx)(gC,{outcome:e.head})}):(0,m.jsx)(gC,{outcome:e.head})]})}),(0,m.jsx)(Xw,{className:`hidden md:table-cell`,children:(0,m.jsx)(eT,{base:e.basePassRate,head:e.headPassRate,kind:`rate`})}),(0,m.jsx)(Xw,{className:`hidden pr-4 md:table-cell`,children:(0,m.jsx)(eT,{base:e.baseScore,head:e.headScore,kind:`score`})})]})}function oT(){let e=Zw.useSearch(),t=Ki({from:`/compare`}),{data:n,error:r,isPending:i}=et(nb),a=n?.headers??[],o=a.find(t=>t.runId===e.head)??(e.head?void 0:a[0]),s=a.find(t=>t.runId===e.base)??(e.base?void 0:a.find(e=>o&&e.runId<o.runId&&e.status===`complete`)),c=et({...rb(s?.runId??``),enabled:!!s}),l=et({...rb(o?.runId??``),enabled:!!o}),u=(0,p.useMemo)(()=>s&&o?Wy(s,o,{base:c.data,head:l.data}):null,[s,o,c.data,l.data]);return r?(0,m.jsx)(oC,{error:r}):i?(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:6})]}):(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Compare runs`}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[`What flipped between two runs, with pass-rate and judge-score deltas, and each cell's lift and effort (tool calls, agent time). Uses the same rules as`,` `,(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:`reeval compare`}),`.`]})]}),a.length<2?(0,m.jsx)(aC,{icon:Jx,title:`Two runs needed`,children:`Record at least two runs to compare them.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border bg-card p-4 sm:flex-row sm:items-end`,children:[(0,m.jsx)($w,{label:`Base`,value:s?.runId,runs:a,onChange:e=>t({search:t=>({...t,base:e}),replace:!0})}),(0,m.jsx)(Ib,{className:`mx-auto hidden size-4 shrink-0 text-muted-foreground sm:mb-2.5 sm:block`}),(0,m.jsx)($w,{label:`Head`,value:o?.runId,runs:a,onChange:e=>t({search:t=>({...t,head:e}),replace:!0})})]}),!s||!o||!u?(0,m.jsx)(aC,{icon:Jx,title:`Pick two runs`,children:`Choose a base and a head run to see what changed.`}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[`regressed`,`fixed`,`drift`,`same`].map(e=>(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:Qw[e].label}),(0,m.jsx)(`div`,{className:Q(`mt-1 text-2xl font-semibold tracking-tight`,u.counts[e]&&e===`regressed`&&`text-fail`,u.counts[e]&&e===`fixed`&&`text-pass`,u.counts[e]&&e===`drift`&&`text-drift`),children:u.counts[e]})]},e))}),u.changes.length?(0,m.jsxs)(`div`,{className:`rounded-xl border border-drift/30 bg-drift/5 p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-drift`,children:[(0,m.jsx)(AS,{className:`size-4`}),` The stack changed between these runs`]}),(0,m.jsx)(`ul`,{className:`mt-2 space-y-1 text-sm`,children:u.changes.map(e=>(0,m.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2`,children:[(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:e.base}),(0,m.jsx)(Ib,{className:`size-3 text-muted-foreground`}),(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:e.head}),e.outsideFingerprint?(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`(not in fingerprints: flips count as not comparable)`}):null]},e.field))})]}):null,(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-36 pl-4`,children:`Change`}),(0,m.jsx)(Yw,{children:`Eval`}),(0,m.jsx)(Yw,{className:`w-24`,children:`Outcome`}),(0,m.jsx)(Yw,{className:`hidden md:table-cell`,children:`Pass rate`}),(0,m.jsx)(Yw,{className:`hidden pr-4 md:table-cell`,children:`Judge score`})]})}),(0,m.jsx)(qw,{children:u.rows.map(e=>(0,m.jsx)(aT,{row:e,head:o.runId},e.id))})]})})]})]})]})}var sT=ca(`/evals/$slug`);function cT(){let{slug:e}=sT.useParams(),{data:t,error:n,isPending:r}=et(nb),i=(0,p.useMemo)(()=>t?Ry(t.headers,e):[],[t,e]);if(n)return(0,m.jsx)(oC,{error:n});if(r)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:8})]});let a=t.manifest.evals.find(t=>t.slug===e);if(!a||i.length===0)return(0,m.jsx)(aC,{icon:vS,title:`No history for this eval`,children:`No recorded run includes it. It may have been renamed: evals are keyed by file, group and name.`});let{file:o,path:s}=Sy(a.id),c=i.filter(e=>e.outcome===`pass`||e.outcome===`fail`),l=c.filter(e=>e.outcome===`pass`).length,u=[...i].reverse(),d=i.filter(e=>e.changed).length;return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`nav`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,m.jsx)(z,{to:`/evals`,className:`hover:text-foreground`,children:`Evals`}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:`truncate text-foreground`,children:s.at(-1)})]}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:[o,...s.slice(0,-1)].join(` › `)}),(0,m.jsx)(`h1`,{className:`mt-1.5 text-2xl font-semibold tracking-tight`,children:s.at(-1)}),(0,m.jsxs)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:[`Passed in `,l,` of `,QS(c.length,`run`),` with a verdict`,d?` · the eval or its stack changed ${QS(d,`time`)}`:``,`.`]})]}),(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card p-5`,children:[(0,m.jsxs)(`div`,{className:`mb-3 flex items-center justify-between text-xs text-muted-foreground`,children:[(0,m.jsx)(`span`,{children:`Oldest`}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`mr-1 inline-block h-3 w-px bg-drift align-middle`}),` changed`]}),(0,m.jsx)(`span`,{children:`Newest`})]}),(0,m.jsx)(CC,{items:i.map(e=>({key:e.run.runId,outcome:e.outcome,changed:e.changed,title:`${Dy(e.run.git?.sha)} · ${YS(e.run.startedAt)} · ${e.outcome}`}))})]}),(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-10`}),(0,m.jsx)(Yw,{children:`Run`}),(0,m.jsx)(Yw,{children:`Commit`}),(0,m.jsx)(Yw,{className:`w-48`,children:`Attempts`}),(0,m.jsx)(Yw,{className:`text-right`,children:`Pass rate`}),(0,m.jsx)(Yw,{className:`hidden text-right sm:table-cell`,children:`Run time`})]})}),(0,m.jsx)(qw,{children:u.map(t=>{let n=t.cells.reduce((e,t)=>e+t.pass,0),r=t.cells.reduce((e,t)=>e+t.fail,0),i=t.cells.reduce((e,t)=>e+t.infraError,0);return(0,m.jsxs)(Jw,{children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(gC,{outcome:t.outcome})}),(0,m.jsxs)(Xw,{children:[(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:t.run.runId},search:{eval:e},className:`font-medium hover:underline`,children:(0,m.jsx)(`span`,{title:ZS(t.run.startedAt),children:YS(t.run.startedAt)})}),(0,m.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:t.run.runId}),t.changed?(0,m.jsx)(pC,{variant:`outline`,className:`h-4 border-drift/30 px-1.5 text-[10px] text-drift`,children:`changed`}):null]})]}),(0,m.jsxs)(Xw,{children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:Dy(t.run.git?.sha)}),t.run.git?.branch?(0,m.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,m.jsx)(Wx,{className:`size-3`}),t.run.git.branch]}):null]}),(0,m.jsxs)(Xw,{children:[(0,m.jsxs)(`span`,{className:`tabular text-xs`,children:[n,`/`,n+r+i,t.cells.length>1?(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`· `,QS(t.cells.length,`cell`)]}):null]}),(0,m.jsx)(vC,{className:`mt-1.5`,pass:n,fail:r,infra:i})]}),(0,m.jsxs)(Xw,{className:`text-right`,children:[(0,m.jsx)(yC,{rate:t.passRate}),Vy(t.cells)?(0,m.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:`gated`}):null]}),(0,m.jsx)(Xw,{className:`tabular hidden text-right text-muted-foreground sm:table-cell`,children:Cy(t.run.durationMs)})]},t.run.runId)})})]})})]})}var lT=ca(`/evals`);function uT(){let{q:e}=lT.useSearch(),t=Ki({from:`/evals`}),{data:n,error:r,isPending:i}=et(nb),a=(0,p.useMemo)(()=>{let t=new Map,r=e?.toLowerCase();for(let e of n?.manifest.evals??[]){if(r&&!e.id.toLowerCase().includes(r))continue;let n=t.get(e.file)??[];n.push(e),t.set(e.file,n)}return[...t]},[n,e]);if(r)return(0,m.jsx)(oC,{error:r});if(i)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:8})]});let o=n.headers.slice(0,20);return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Evals`}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[QS(n.manifest.evals.length,`eval`),` across `,QS(n.headers.length,`run`),`. The strip shows the last 20 runs, oldest to newest.`]})]}),(0,m.jsxs)(`div`,{className:`relative sm:w-72`,children:[(0,m.jsx)(bS,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,m.jsx)(jC,{value:e??``,onChange:e=>t({search:{q:e.target.value||void 0},replace:!0}),placeholder:`Filter evals`,className:`h-9 pl-8`})]})]}),n.manifest.evals.length===0?(0,m.jsx)(aC,{icon:Rx,title:`No evals yet`,children:`Evals appear here once a run that includes them is recorded.`}):a.length===0?(0,m.jsxs)(aC,{icon:bS,title:`No evals match`,children:[`Nothing matches “`,e,`”.`]}):a.map(([e,t])=>(0,m.jsxs)(`section`,{className:`overflow-hidden rounded-xl border bg-card`,children:[(0,m.jsx)(`div`,{className:`border-b bg-muted/40 px-4 py-2 font-mono text-xs text-muted-foreground`,children:e}),(0,m.jsx)(`div`,{className:`divide-y`,children:t.map(e=>{let t=Ry(o,e.slug).filter(e=>e.outcome===`pass`||e.outcome===`fail`),n=t.length?t.filter(e=>e.outcome===`pass`).length/t.length:null;return(0,m.jsxs)(z,{to:`/evals/$slug`,params:{slug:e.slug},className:`flex flex-col gap-2 px-4 py-3 transition-colors hover:bg-accent/50 sm:flex-row sm:items-center sm:gap-4`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2.5`,children:[(0,m.jsx)(gC,{outcome:e.latest.outcome}),(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.path.at(-1)}),e.path.length>1?(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.path.slice(0,-1).join(` › `)}):null]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-4 pl-6 sm:pl-0`,children:[(0,m.jsx)(CC,{size:`sm`,items:o.slice().reverse().map(t=>({key:t.runId,outcome:t.evals.find(t=>t.slug===e.slug)?.outcome??null}))}),(0,m.jsx)(yC,{rate:n,className:`w-10 text-right text-sm`})]})]},e.slug)})})]},e))]})}var dT={running:{label:`Running`,tone:`border-brand/30 bg-brand/10 text-brand`},cancelling:{label:`Cancelling`,tone:`border-infra/30 bg-infra/10 text-infra`},finishing:{label:`Finishing`,tone:`border-brand/30 bg-brand/10 text-brand`},stopped:{label:`Stopped`,tone:`border-border bg-muted text-muted-foreground`}};function fT(e=1e3){let[t,n]=(0,p.useState)(()=>Date.now());return(0,p.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function pT({run:e,className:t}){let{label:n,tone:r}=dT[e.state];return(0,m.jsxs)(pC,{variant:`outline`,className:Q(`gap-1.5 tabular`,r,t),children:[e.state===`stopped`?(0,m.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/60`}):(0,m.jsxs)(`span`,{className:`relative flex size-1.5`,children:[(0,m.jsx)(`span`,{className:`absolute inline-flex size-full animate-ping rounded-full bg-current opacity-60`}),(0,m.jsx)(`span`,{className:`relative inline-flex size-1.5 rounded-full bg-current`})]}),n,` `,e.counts.done,`/`,e.planned]})}function mT({run:e,className:t}){let{passed:n,failed:r,errored:i,skipped:a,running:o,done:s}=e.counts,c=Math.max(e.planned,1),l=(e,t)=>e>0?(0,m.jsx)(`div`,{className:Q(`transition-[width] duration-500`,t),style:{width:`${e/c*100}%`}}):null;return(0,m.jsxs)(`div`,{className:Q(`flex h-2 overflow-hidden rounded-full bg-muted`,t),role:`progressbar`,"aria-label":`Attempts finished`,"aria-valuemin":0,"aria-valuemax":e.planned,"aria-valuenow":s,children:[l(n,`bg-pass`),l(r,`bg-fail`),l(i,`bg-infra`),l(a,`bg-skip/50`),e.state===`stopped`?null:l(o,`animate-pulse bg-brand/40`)]})}function hT({status:e,stopped:t=!1,className:n}){return e===`running`&&!t?(0,m.jsx)(iS,{className:Q(`size-4 shrink-0 animate-spin text-brand`,n),"aria-label":`Running`}):e===`queued`||e===`running`?(0,m.jsx)(gC,{outcome:null,className:n}):(0,m.jsx)(gC,{outcome:e,className:n})}var gT={queued:`Queued`,running:`Running`,pass:`Passed`,fail:`Failed`,infra_error:`Infra error`,skipped:`Skipped`},_T=(e,t)=>Cy(Math.max(0,t-Date.parse(e.startedAt)));function vT({runs:e}){let t=fT();return e.length?(0,m.jsx)(`section`,{"aria-label":`Runs in progress`,className:`space-y-2`,children:e.map(e=>(0,m.jsxs)(z,{to:`/live/$runId`,params:{runId:e.runId},"data-live-run":e.runId,className:`block rounded-xl border bg-card px-4 py-3 transition-colors hover:bg-accent/50`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,m.jsx)(pT,{run:e}),(0,m.jsxs)(`span`,{className:`text-sm font-medium`,title:ZS(e.startedAt),children:[`Started `,YS(e.startedAt,t)]}),(0,m.jsx)(`span`,{className:`hidden font-mono text-[11px] text-muted-foreground sm:inline`,children:e.runId}),(0,m.jsxs)(`span`,{className:`tabular ml-auto text-xs text-muted-foreground`,children:[e.counts.passed,` passed · `,e.counts.failed+e.counts.errored,` failed`,e.state!==`stopped`&&e.counts.running?` · ${e.counts.running} running`:``,` `,`· `,_T(e,t)]})]}),(0,m.jsx)(mT,{run:e,className:`mt-2.5`})]},e.runId))}):null}var yT=ca(`/live/$runId`),bT=ca(`/live/$runId/attempt`);function xT(e){let t=ub(),n=et(nb),r=t.runs.find(t=>t.runId===e);return{run:r,landed:!r&&!!n.data?.headers.some(t=>t.runId===e),isPending:t.isPending||n.isPending,error:t.error??n.error}}function ST({label:e,children:t}){return(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,m.jsx)(`div`,{className:`tabular mt-1 text-lg font-semibold tracking-tight`,children:t})]})}function CT({runId:e}){return(0,m.jsxs)(aC,{icon:uS,title:`This run isn't in progress`,children:[`No running `,(0,m.jsx)(`span`,{className:`font-mono`,children:`reeval run`}),` has the id`,` `,(0,m.jsx)(`span`,{className:`font-mono`,children:e}),`, and no record of it has landed.`,` `,(0,m.jsx)(z,{to:`/`,className:`underline`,children:`Back to runs`})]})}function wT({attempt:e,run:t,now:n}){return e.durationMs===null?e.status===`running`&&e.startedAt&&t.state!==`stopped`?(0,m.jsx)(m.Fragment,{children:Cy(Math.max(0,n-Date.parse(e.startedAt)))}):(0,m.jsx)(m.Fragment,{children:`–`}):(0,m.jsx)(m.Fragment,{children:Cy(e.durationMs)})}function TT(){let{runId:e}=yT.useParams(),t=Ki(),n=fT(),{run:r,landed:i,isPending:a,error:o}=xT(e);(0,p.useEffect)(()=>{i&&t({to:`/runs/$runId`,params:{runId:e},replace:!0})},[i,t,e]);let s=(0,p.useMemo)(()=>{let e=new Map;for(let t of r?.attempts??[])e.set(t.evalId,[...e.get(t.evalId)??[],t]);return[...e.values()]},[r]);if(o)return(0,m.jsx)(oC,{error:o});if(a||i)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:6})]});if(!r)return(0,m.jsx)(CT,{runId:e});let c=r.state===`stopped`;return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(VS,{asChild:!0,variant:`ghost`,size:`sm`,className:`-ml-2 text-muted-foreground`,children:(0,m.jsxs)(z,{to:`/`,children:[(0,m.jsx)(Pb,{}),` Runs`]})}),(0,m.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:c?`Run stopped`:`Run in progress`}),(0,m.jsx)(pT,{run:r})]}),(0,m.jsxs)(`p`,{className:`mt-1 flex flex-wrap gap-x-2 text-sm text-muted-foreground`,children:[(0,m.jsxs)(`span`,{title:ZS(r.startedAt),children:[`Started `,YS(r.startedAt,n)]}),(0,m.jsx)(`span`,{children:`·`}),(0,m.jsx)(`span`,{className:`font-mono text-xs leading-5`,children:r.runId})]})]}),c?(0,m.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-infra/30 bg-infra/5 px-4 py-3 text-sm`,children:[(0,m.jsx)(cx,{className:`mt-0.5 size-4 shrink-0 text-infra`}),(0,m.jsxs)(`p`,{children:[`This run stopped without writing a record: its`,` `,(0,m.jsx)(`span`,{className:`font-mono`,children:`reeval run`}),` exited or stopped responding. The attempts below are what finished before it did.`]})]}):null,(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(mT,{run:r,className:`h-2.5`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-4`,children:[(0,m.jsxs)(ST,{label:`Finished`,children:[r.counts.done,(0,m.jsxs)(`span`,{className:`ml-1 text-sm font-normal text-muted-foreground`,children:[`of `,QS(r.planned,`attempt`)]})]}),(0,m.jsx)(ST,{label:`Passed`,children:(0,m.jsx)(`span`,{className:`text-pass`,children:r.counts.passed})}),(0,m.jsx)(ST,{label:`Failed`,children:(0,m.jsx)(`span`,{className:r.counts.failed+r.counts.errored?`text-fail`:``,children:r.counts.failed+r.counts.errored})}),(0,m.jsx)(ST,{label:`Elapsed`,children:c?`Stopped`:_T(r,n)})]}),r.state===`finishing`?(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Every attempt has finished; writing the run's record.`}):null]}),(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-10`}),(0,m.jsx)(Yw,{children:`Attempt`}),(0,m.jsx)(Yw,{className:`hidden md:table-cell`,children:`Cell`}),(0,m.jsx)(Yw,{className:`hidden sm:table-cell`,children:`Status`}),(0,m.jsx)(Yw,{className:`text-right`,children:`Duration`})]})}),(0,m.jsx)(qw,{children:s.flat().map(t=>{let i=hy(t.status)&&t.status!==`skipped`,a=`${t.name} · #${t.n}`;return(0,m.jsxs)(Jw,{"data-live-attempt":t.status,children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(hT,{status:t.status,stopped:c})}),(0,m.jsxs)(Xw,{children:[i?(0,m.jsx)(z,{to:`/live/$runId/attempt`,params:{runId:e},search:{key:t.key},className:`font-medium hover:underline`,children:a}):(0,m.jsx)(`span`,{className:`font-medium`,children:a}),(0,m.jsxs)(`div`,{className:`mt-0.5 font-mono text-[11px] text-muted-foreground`,children:[t.file,(0,m.jsxs)(`span`,{className:`md:hidden`,children:[` · `,t.cell]})]})]}),(0,m.jsx)(Xw,{className:`hidden font-mono text-xs md:table-cell`,children:t.cell}),(0,m.jsx)(Xw,{className:`hidden text-sm text-muted-foreground sm:table-cell`,children:c&&t.status===`running`?`Stopped`:c&&t.status===`queued`?`Never started`:gT[t.status]}),(0,m.jsx)(Xw,{className:`tabular pr-4 text-right text-muted-foreground`,children:(0,m.jsx)(wT,{attempt:t,run:r,now:n})})]},t.key)})})]})})]})}function ET(){let{runId:e}=bT.useParams(),{key:t=``}=bT.useSearch(),n=Ki(),{run:r,landed:i,isPending:a,error:o}=xT(e),s=r?.attempts.find(e=>e.key===t),c=et({...db(e,t),enabled:!!s&&hy(s.status)}),l=et({...rb(e),enabled:i});return(0,p.useEffect)(()=>{if(l.data){for(let r of l.data.evals){let i=r.attempts.find(e=>e.key===t);if(i){n({to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:e,slug:r.slug,attempt:i.id},replace:!0});return}}n({to:`/runs/$runId`,params:{runId:e},replace:!0})}},[l.data,t,n,e]),o?(0,m.jsx)(oC,{error:o}):a||i?(0,m.jsx)(cC,{rows:6}):r?s?(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(VS,{asChild:!0,variant:`ghost`,size:`sm`,className:`-ml-2 text-muted-foreground`,children:(0,m.jsxs)(z,{to:`/live/$runId`,params:{runId:e},children:[(0,m.jsx)(Pb,{}),` Run in progress`]})}),(0,m.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3`,children:[(0,m.jsx)(hT,{status:s.status,className:`size-5`}),(0,m.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight`,children:s.name}),(0,m.jsxs)(`span`,{className:`font-mono text-sm text-muted-foreground`,children:[s.cell,`#`,s.n]})]}),(0,m.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[gT[s.status],s.durationMs===null?``:` in ${Cy(s.durationMs)}`,` · The diff, checks and judge tabs arrive with the run's record.`]})]}),hy(s.status)?c.error?(0,m.jsx)(aC,{icon:Ix,title:`No transcript`,children:`This attempt didn't write one.`}):c.isPending?(0,m.jsx)(cC,{rows:5}):(0,m.jsx)(Mw,{text:c.data}):(0,m.jsx)(aC,{icon:Ix,title:`Not finished yet`,children:`The transcript is here once this attempt finishes.`})]}):(0,m.jsxs)(aC,{icon:Ix,title:`No such attempt`,children:[`This run has no attempt `,(0,m.jsx)(`span`,{className:`font-mono`,children:t}),`.`]}):(0,m.jsx)(CT,{runId:e})}function DT(){return(0,m.jsxs)(aC,{icon:bx,title:`Page not found`,children:[`That link doesn't point anywhere in the studio.`,` `,(0,m.jsx)(z,{to:`/`,className:`underline`,children:`Go to runs`})]})}function OT({doc:e,id:t}){let n=e.attempts[t.replace(/:check\d+$/,``)],r=`inline-flex rounded border bg-muted/60 px-1 font-mono text-[10px] text-muted-foreground`;return n?(0,m.jsx)(z,{to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:n.runId,slug:n.evalSlug,attempt:n.attempt},className:`${r} hover:text-foreground`,children:t}):(0,m.jsx)(`span`,{className:r,title:e.cited[t]??t,children:t})}function kT({doc:e,ids:t}){return(0,m.jsx)(`span`,{className:`ml-1 inline-flex flex-wrap gap-1 align-middle`,children:t.map(t=>(0,m.jsx)(OT,{doc:e,id:t},t))})}function AT({doc:e,title:t,items:n}){return n.length?(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,m.jsx)(`ul`,{className:`list-disc space-y-1.5 pl-5 text-sm`,children:n.map(t=>(0,m.jsxs)(`li`,{children:[t.text,(0,m.jsx)(kT,{doc:e,ids:t.cites}),t.confidence===`high`?null:(0,m.jsxs)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:[`(`,t.confidence,` confidence)`]}),t.unverifiedNumbers?.length?(0,m.jsxs)(`span`,{className:`ml-1 text-xs text-infra`,children:[`(not in the cited facts: `,t.unverifiedNumbers.join(`, `),`)`]}):null]},t.text))})]}):null}function jT({entry:e}){let{doc:t}=e,n=t.analysis,r=t.validation;return(0,m.jsxs)(`div`,{className:`space-y-5`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,m.jsx)(pC,{variant:e.source===`saved`?`secondary`:`outline`,children:e.source===`saved`?`saved`:`local cache`}),hv(t)?(0,m.jsx)(pC,{variant:`outline`,className:`text-infra`,children:`superseded: re-run reeval analyze`}):null,(0,m.jsxs)(`span`,{children:[t.scope.base?`vs ${t.scope.base}`:`no base run`,t.scope.evals?` · evals matching "${t.scope.evals}"`:``,` · by `,t.author,` ·`,` `,ZS(t.createdAt)]})]}),(0,m.jsxs)(`p`,{className:`rounded-lg border bg-muted/40 p-3 text-sm leading-relaxed`,children:[(0,m.jsx)(`span`,{className:`font-semibold`,children:`TL;DR. `}),n.tldr]}),(0,m.jsx)(AT,{doc:t,title:`What happened`,items:n.whatHappened}),(0,m.jsx)(AT,{doc:t,title:`Results`,items:n.results}),(0,m.jsx)(AT,{doc:t,title:`Why`,items:n.why}),n.anomalies.length?(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Anomalies`}),(0,m.jsx)(`ul`,{className:`space-y-1.5 text-sm`,children:n.anomalies.map(e=>(0,m.jsxs)(`li`,{children:[(0,m.jsx)(pC,{variant:`outline`,className:`mr-1.5 text-[10px]`,children:e.kind}),e.text,(0,m.jsx)(kT,{doc:t,ids:e.cites})]},e.text))})]}):null,(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Suggested actions`}),n.actions.length===0?(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`None: nothing here is worth acting on.`}):(0,m.jsx)(`ol`,{className:`space-y-3`,children:n.actions.map((e,n)=>(0,m.jsxs)(`li`,{className:`rounded-lg border p-3 text-sm`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(`span`,{className:`font-medium`,children:[n+1,`. `,e.title]}),(0,m.jsx)(pC,{variant:`secondary`,className:`text-[10px]`,children:e.kind}),(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`impact `,e.impact,` · effort `,e.effort]})]}),(0,m.jsxs)(`p`,{className:`mt-1.5`,children:[(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:e.target}),`: `,e.change]}),(0,m.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Expect: `,e.expectedEffect]}),(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2 text-xs`,children:[e.verify?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono`,children:e.verify}),(0,m.jsx)(KC,{value:e.verify,label:`copy`})]}):(0,m.jsxs)(`span`,{className:`text-infra`,children:[`Verify command rejected: `,e.verifyProblem??`not reeval’s CLI`]}),(0,m.jsx)(kT,{doc:t,ids:e.cites})]})]},e.title))})]}),(0,m.jsxs)(`p`,{className:`text-sm`,children:[(0,m.jsxs)(`span`,{className:`font-medium`,children:[`Confidence: `,n.confidence.overall,`.`]}),` `,n.confidence.why]}),(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t.resolvedModel??t.model,` · `,t.promptVersion,` · digest v`,t.inputs.digestVersion,t.usage.inputTokens===null?``:` · ${t.usage.inputTokens} in / ${t.usage.outputTokens??`?`} out tokens`,` `,`· `,r.citations,` citations checked, `,r.invalid.length,` invalid, `,r.dropped,` dropped ·`,` `,r.commands,` commands checked, `,r.invalidCommands.length,` rejected · `,e.file]})]})}function MT({runId:e}){let{data:t,error:n,isPending:r}=et(ab(e)),[i,a]=(0,p.useState)();if(n)return(0,m.jsx)(oC,{error:n});if(r)return(0,m.jsx)(cC,{rows:5});let o=t?.entries??[];if(o.length===0)return(0,m.jsxs)(aC,{icon:wS,title:`No analysis for this run yet`,children:[`Run `,(0,m.jsxs)(`code`,{className:`font-mono text-xs`,children:[`reeval analyze `,e,` --save`]}),` to write one into the run's history folder, or`,` `,(0,m.jsx)(`code`,{className:`font-mono text-xs`,children:`reeval analyze --context`}),` to hand the digest to your own coding agent.`]});let s=o.find(e=>e.file===i)??o[0];return(0,m.jsxs)(`div`,{className:`space-y-4`,children:[o.length>1?(0,m.jsxs)(Rw,{value:s.file,onValueChange:a,children:[(0,m.jsx)(Bw,{className:`w-full sm:w-auto`,children:(0,m.jsx)(zw,{})}),(0,m.jsx)(Vw,{children:o.map(e=>(0,m.jsxs)(Hw,{value:e.file,children:[ZS(e.doc.createdAt),` · `,e.source,` · `,e.doc.model]},e.file))})]}):null,(0,m.jsx)(jT,{entry:s})]})}var NT=ca(`/runs/$runId`);function PT({icon:e,children:t}){return(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,m.jsx)(e,{className:`size-3.5`}),t]})}function FT({record:e,children:t}){return(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:ZS(e.startedAt)}),(0,m.jsx)(_C,{outcome:ky(e)}),e.status===`interrupted`?(0,m.jsx)(pC,{variant:`outline`,className:`text-infra`,children:`interrupted`}):null]}),(0,m.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-sm text-muted-foreground`,children:[(0,m.jsxs)(PT,{icon:Kx,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:Dy(e.git?.sha)}),e.git?.dirty?(0,m.jsx)(`span`,{className:`text-infra`,children:`· dirty`}):null]}),e.git?.branch?(0,m.jsx)(PT,{icon:Wx,children:e.git.branch}):null,(0,m.jsx)(PT,{icon:PS,children:e.runner.kind===`ci`?`CI · ${e.runner.provider}`:e.author}),(0,m.jsx)(PT,{icon:mx,children:Cy(e.durationMs)}),e.cost.usage?(0,m.jsxs)(PT,{icon:vx,children:[Ey(e.cost.usage),` tokens`]}):null]})]}),t]})}function IT({warnings:e}){if(e.length===0)return null;let t=e.some(e=>e.kind===`root`);return(0,m.jsxs)(`div`,{role:`alert`,className:Q(`flex gap-3 rounded-xl border p-4 text-sm`,t?`border-fail/40 bg-fail/5`:`border-infra/40 bg-infra/5`),children:[(0,m.jsx)(SS,{className:Q(`mt-0.5 size-4 shrink-0`,t?`text-fail`:`text-infra`)}),(0,m.jsx)(`ul`,{className:`min-w-0 space-y-1`,children:e.map(e=>(0,m.jsxs)(`li`,{className:`break-words`,children:[(0,m.jsx)(`span`,{className:Q(`font-semibold`,e.kind===`root`?`text-fail`:`text-infra`),children:e.kind===`root`?`Root`:`Capabilities`}),` `,(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:e.message}),e.file?(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.file]}):null]},`${e.file}\0${e.message}`))})]})}function LT({node:e,depth:t,selected:n,onSelect:r}){let[i,a]=(0,p.useState)(!0),o={paddingLeft:`${t*14+8}px`};if(e.kind===`eval`){let t=n===e.eval.slug;return(0,m.jsxs)(`button`,{type:`button`,onClick:()=>r(e.eval.slug),style:o,className:Q(`flex w-full items-center gap-2 rounded-md py-1.5 pr-2 text-left text-sm transition-colors`,t?`bg-accent text-foreground`:`text-foreground/85 hover:bg-accent/60`),children:[(0,m.jsx)(gC,{outcome:e.eval.outcome}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.eval.todo?(0,m.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`todo`}):Ly(e.eval)?(0,m.jsxs)(`span`,{className:`tabular shrink-0 text-xs text-muted-foreground`,children:[e.tally.pass,`/`,e.tally.pass+e.tally.fail+e.tally.missed+e.tally.infra]}):null]})}let s=t===0,c=s?wx:Bx;return(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>a(!i),style:o,className:`flex w-full items-center gap-1.5 rounded-md py-1.5 pr-2 text-left text-xs font-medium text-muted-foreground hover:bg-accent/60`,children:[(0,m.jsx)(Jb,{className:Q(`size-3.5 transition-transform`,i&&`rotate-90`)}),(0,m.jsx)(c,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:Q(`min-w-0 flex-1 truncate`,s&&`font-mono`),children:e.name}),e.tally.fail?(0,m.jsxs)(`span`,{className:`tabular text-fail`,children:[e.tally.fail,` failed`]}):e.tally.missed?(0,m.jsxs)(`span`,{className:`tabular`,children:[e.tally.missed,` missed, not gated`]}):null]}),i?e.children.map(e=>(0,m.jsx)(LT,{node:e,depth:t+1,selected:n,onSelect:r},e.key)):null]})}function RT(e){return e.flatMap(e=>{if(e.kind===`eval`)return e.eval.outcome===`pass`||e.eval.outcome===`skipped`?[]:[e];let t=RT(e.children);return t.length?[{...e,children:t}]:[]})}function zT({rows:e,runId:t,slug:n}){let r=e.some(e=>e.lift!==null),i=e.some(e=>e.effort!==null),a=e.some(e=>e.role===`variant`);return(0,m.jsx)(`div`,{className:`overflow-hidden rounded-lg border`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{children:`Harness`}),(0,m.jsx)(Yw,{children:`Environment`}),a?(0,m.jsx)(Yw,{children:`Role`}):null,(0,m.jsx)(Yw,{className:`hidden 2xl:table-cell`,children:`Sandbox`}),(0,m.jsx)(Yw,{children:`Attempts`}),(0,m.jsx)(Yw,{className:`text-right`,children:`Pass rate`}),r||i?(0,m.jsx)(Yw,{className:`text-right`,children:r&&i?`Lift and effort`:r?`Lift`:`Effort`}):null]})}),(0,m.jsx)(qw,{children:e.map(e=>(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Xw,{className:`font-mono text-xs`,children:e.harness}),(0,m.jsxs)(Xw,{className:`font-mono text-xs`,children:[e.environment===`-`?(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`none`}):e.environment,e.overrides.length?(0,m.jsxs)(`div`,{className:`mt-0.5 font-sans text-[11px] text-muted-foreground`,children:[`overrides `,e.overrides.join(`, `)]}):null]}),a?(0,m.jsx)(Xw,{children:(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs`,children:[e.role,e.gated?null:(0,m.jsx)(pC,{variant:`outline`,className:`text-[10px] text-muted-foreground`,children:`not gated`})]})}):null,(0,m.jsx)(Xw,{className:`hidden font-mono text-xs 2xl:table-cell`,children:e.sandbox}),(0,m.jsx)(Xw,{children:(0,m.jsx)(`div`,{className:`flex items-center gap-1`,children:e.attempts.map(r=>(0,m.jsx)(z,{to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:t,slug:n,attempt:r.id},title:`${r.id} · ${Cy(r.durationMs)}`,className:`rounded-sm p-0.5 hover:bg-accent`,children:(0,m.jsx)(gC,{outcome:r.outcome,missed:!e.gated})},r.id))})}),(0,m.jsxs)(Xw,{className:`text-right`,children:[(0,m.jsx)(yC,{rate:e.passRate}),(0,m.jsxs)(`span`,{className:`tabular ml-1.5 text-xs text-muted-foreground`,children:[e.pass,`/`,e.pass+e.fail]})]}),r||i?(0,m.jsxs)(Xw,{className:`min-w-44 whitespace-normal text-right`,children:[r?(0,m.jsx)(xC,{points:e.lift,interval:e.liftInterval}):null,e.belowMinLift?(0,m.jsx)(`div`,{className:`text-[11px] text-fail`,children:`lower bound below minLift`}):null,i?(0,m.jsx)(`div`,{className:r?`mt-1`:void 0,children:(0,m.jsx)(BT,{row:e})}):null]}):null]},e.key))})]})})}function BT({row:e}){if(!e.effort)return(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`–`});let t=e.effortVsControl,n=t&&(t.verdict===`fewer`||t.verdict===`more`);return(0,m.jsxs)(`div`,{className:`tabular text-xs`,children:[(0,m.jsx)(`div`,{children:ey(e.effort)}),t?(0,m.jsxs)(`div`,{className:Q(`text-[11px]`,n?t.verdict===`fewer`?`text-pass`:`text-fail`:`text-muted-foreground`),title:t.toolsP===null?void 0:`exact rank test p = ${t.toolsP.toFixed(3)}`,children:[`tools `,Zv(t.toolsRatio),` vs control · `,$v[t.verdict](`tool calls`)]}):null]})}function VT({record:e,entry:t}){let n=Iy(t),r=Ly(t);return(0,m.jsxs)(`div`,{className:`space-y-5`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`flex items-center gap-1.5 font-mono text-xs text-muted-foreground`,children:[t.file,...t.group].join(` › `)}),(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2.5`,children:[(0,m.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:t.name}),(0,m.jsx)(_C,{outcome:t.outcome,label:t.todo?`Todo`:void 0})]}),(0,m.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,m.jsx)(VS,{asChild:!0,variant:`outline`,size:`sm`,children:(0,m.jsxs)(z,{to:`/evals/$slug`,params:{slug:t.slug},children:[(0,m.jsx)(fS,{}),` History`]})}),t.tags.map(e=>(0,m.jsxs)(pC,{variant:`secondary`,children:[`#`,e]},e)),t.compare?(0,m.jsxs)(pC,{variant:`outline`,className:`font-mono text-[11px]`,children:[`baseline `,t.compare.baseline]}):null]})]}),r?(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:`Cells`}),(0,m.jsx)(zT,{rows:n,runId:e.runId,slug:t.slug})]}):null,(0,m.jsxs)(`section`,{className:`space-y-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:QS(t.attempts.length,`attempt`)}),(0,m.jsx)(`div`,{className:`divide-y overflow-hidden rounded-lg border`,children:t.attempts.map(n=>{let r=n.judgements[0],i=Hy(t,n);return(0,m.jsxs)(z,{to:`/runs/$runId/evals/$slug/attempts/$attempt`,params:{runId:e.runId,slug:t.slug,attempt:n.id},className:`group flex items-start gap-3 px-3.5 py-3 transition-colors hover:bg-accent/50`,children:[(0,m.jsx)(gC,{outcome:n.outcome,missed:i,className:`mt-0.5`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-sm`,children:[(0,m.jsx)(`span`,{className:`font-mono text-xs`,children:n.id}),(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[Cy(n.durationMs),` · `,QS(n.turns.length,`turn`),` ·`,` `,Oy(n.activity)]}),r?(0,m.jsxs)(`span`,{className:Q(`tabular text-xs`,r.verdict===`pass`?`text-pass`:`text-fail`),children:[`judge `,r.score.toFixed(2),` / `,r.threshold]}):null,i?(0,m.jsx)(pC,{variant:`outline`,className:`text-[10px] text-muted-foreground`,children:`missed, not gated`}):null]}),n.error?(0,m.jsxs)(`p`,{className:Q(`mt-1 line-clamp-2 font-mono text-xs`,i?`text-muted-foreground`:`text-fail`),children:[n.error.kind,`: `,n.error.message.split(`
|
|
58
58
|
`)[0]]}):n.turns.at(-1)?.text?(0,m.jsx)(`p`,{className:`mt-1 line-clamp-1 text-xs text-muted-foreground`,children:n.turns.at(-1)?.text}):null]}),(0,m.jsx)(Jb,{className:`mt-0.5 size-4 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100`})]},n.id)})})]})]})}function HT(){let{runId:e}=NT.useParams(),t=NT.useSearch(),n=Ki({from:`/runs/$runId`}),{data:r,error:i,isPending:a}=et(rb(e)),{data:o}=et(nb),s=(0,p.useMemo)(()=>r?Py(r):[],[r]);if(i)return(0,m.jsx)(oC,{error:i});if(a)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[320px_1fr]`,children:[(0,m.jsx)(cC,{rows:8}),(0,m.jsx)(cC,{rows:4})]})]});let c=t.show===`failed`?RT(s):s,l=r.evals.find(e=>e.slug===t.eval)??r.evals.find(e=>e.outcome===`fail`||e.outcome===`infra_error`)??r.evals[0],u=(o?.headers??[]).find(t=>t.runId<e&&t.status===`complete`),{pass:d,fail:f,notGated:h,infraError:g,skipped:_}=r.summary,v=f-h;return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`nav`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground`,children:[(0,m.jsx)(z,{to:`/`,className:`hover:text-foreground`,children:`Runs`}),(0,m.jsx)(Jb,{className:`size-3.5`}),(0,m.jsx)(`span`,{className:`truncate font-mono text-xs text-foreground`,children:e})]}),(0,m.jsx)(FT,{record:r,children:(0,m.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[u?(0,m.jsx)(VS,{asChild:!0,variant:`outline`,size:`sm`,children:(0,m.jsxs)(z,{to:`/compare`,search:{base:u.runId,head:e},children:[(0,m.jsx)(Jx,{}),` Compare with previous`]})}):null,r.git?(0,m.jsx)(KC,{value:`reeval checkout ${e}`,label:`reeval checkout`}):null]})}),(0,m.jsx)(IT,{warnings:r.plan.sandboxWarnings}),(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card p-4`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 text-sm`,children:[(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:`font-semibold`,children:d}),` passed`,v?(0,m.jsxs)(m.Fragment,{children:[` · `,(0,m.jsx)(`span`,{className:`font-semibold text-fail`,children:v}),` failed`]}):null,h?(0,m.jsxs)(m.Fragment,{children:[` · `,(0,m.jsx)(`span`,{className:`font-semibold`,children:h}),` missed, not gated`]}):null,g?(0,m.jsxs)(m.Fragment,{children:[` · `,(0,m.jsx)(`span`,{className:`font-semibold text-infra`,children:g}),` infra errors`]}):null,_?` · ${_} skipped`:``,(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,`across `,QS(r.summary.evals,`eval`),`,`,` `,QS(r.summary.attempts,`attempt`)]})]}),(0,m.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[r.stack.harnesses.map(e=>e.id).join(`, `),` · judge`,` `,r.config.judgeModel??`none`,r.profile?` · profile ${r.profile.name}`:``]})]}),(0,m.jsx)(vC,{className:`mt-3 h-2`,pass:d,fail:v,missed:h,infra:g,skipped:_})]}),(0,m.jsxs)(wC,{value:t.tab??`evals`,onValueChange:e=>n({search:t=>({...t,tab:e===`analysis`?`analysis`:void 0}),replace:!0}),children:[(0,m.jsxs)(EC,{children:[(0,m.jsx)(DC,{value:`evals`,children:`Evals`}),(0,m.jsx)(DC,{value:`analysis`,children:`Analysis`})]}),(0,m.jsx)(OC,{value:`evals`,className:`mt-4`,children:r.evals.length===0?(0,m.jsx)(aC,{icon:nS,title:`No evals ran`,children:`This run matched no evals, so there's nothing to show.`}):(0,m.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-[340px_minmax(0,1fr)]`,children:[(0,m.jsx)(`aside`,{className:`min-w-0 lg:sticky lg:top-20 lg:self-start`,children:(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2`,children:[(0,m.jsx)(`span`,{className:`text-sm font-medium`,children:`Evals`}),(0,m.jsx)(`div`,{className:`inline-flex rounded-md bg-muted p-0.5 text-xs`,children:[[void 0,`All`],[`failed`,`Failing`]].map(([e,r])=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>n({search:t=>({...t,show:e}),replace:!0}),className:Q(`rounded px-2 py-0.5`,t.show===e?`bg-background shadow-sm`:`text-muted-foreground`),children:r},r))})]}),(0,m.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto p-1.5 lg:max-h-[calc(100dvh-14rem)]`,children:c.length===0?(0,m.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:`Nothing failed in this run.`}):c.map(e=>(0,m.jsx)(LT,{node:e,depth:0,selected:l?.slug,onSelect:e=>n({search:t=>({...t,eval:e}),replace:!0})},e.key))})]})}),(0,m.jsx)(`section`,{className:`min-w-0 rounded-xl border bg-card p-5`,children:l?(0,m.jsx)(VT,{record:r,entry:l}):null})]})}),(0,m.jsx)(OC,{value:`analysis`,className:`mt-4`,children:(0,m.jsx)(`section`,{className:`rounded-xl border bg-card p-5`,children:(0,m.jsx)(MT,{runId:e})})})]}),(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Started `,YS(r.startedAt),` · artifacts: `,r.artifacts,` · reeval`,` `,r.stack.es]})]})}var UT=ca(`/`);function WT({entry:e}){if(e.ci){let t=(0,m.jsxs)(pC,{variant:`secondary`,className:`gap-1 font-normal`,children:[(0,m.jsx)(Rb,{}),` `,e.ci.provider]});return e.ci.runUrl?(0,m.jsx)(`a`,{href:e.ci.runUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:t}):t}return(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-muted-foreground`,children:[(0,m.jsx)(PS,{className:`size-3.5`}),e.author]})}function GT({hasScratch:e}){let t=UT.useSearch(),n=Ki({from:`/`}),r=e=>n({search:t=>({...t,...e}),replace:!0}),i=({value:e,label:n})=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>r({status:e}),className:Q(`rounded-md px-3 py-1 text-sm transition-colors`,t.status===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:n});return(0,m.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,m.jsxs)(`div`,{className:`relative sm:w-80`,children:[(0,m.jsx)(bS,{className:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,m.jsx)(jC,{value:t.q??``,onChange:e=>r({q:e.target.value||void 0}),placeholder:`Filter by branch, commit, author or run id`,className:`h-9 pl-8`})]}),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(`div`,{className:`inline-flex rounded-lg bg-muted p-0.5`,children:[(0,m.jsx)(i,{value:void 0,label:`All`}),(0,m.jsx)(i,{value:`failed`,label:`Failing`}),(0,m.jsx)(i,{value:`passed`,label:`Passing`})]}),e?(0,m.jsx)(`div`,{className:`inline-flex rounded-lg bg-muted p-0.5`,children:[[void 0,`Everything`],[`recorded`,`Recorded`],[`scratch`,`Scratch`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,onClick:()=>r({source:e}),className:Q(`rounded-md px-3 py-1 text-sm transition-colors`,t.source===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:n},n))}):null]})]})}function KT({rows:e}){let t=e.slice(0,30).reverse();return(0,m.jsx)(`div`,{className:`flex h-10 items-end gap-[3px]`,children:t.map(e=>{let t=e.total?e.passed/e.total:0;return(0,m.jsxs)(dv,{children:[(0,m.jsx)(fv,{asChild:!0,children:(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:e.entry.runId},className:`group flex h-full w-2 flex-col justify-end sm:w-2.5`,children:(0,m.jsx)(`div`,{className:Q(`w-full rounded-sm transition-opacity group-hover:opacity-70`,t>=.999?`bg-pass`:t===0?`bg-fail`:`bg-infra`),style:{height:`${Math.max(12,t*100)}%`}})})}),(0,m.jsxs)(pv,{children:[wy(e.total?t:null),` · `,Dy(e.entry.git?.sha),` ·`,` `,YS(e.entry.startedAt)]})]},e.entry.runId)})})}function qT({label:e,children:t}){return(0,m.jsxs)(`div`,{className:`rounded-xl border bg-card px-4 py-3`,children:[(0,m.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,m.jsx)(`div`,{className:`mt-1 text-lg font-semibold tracking-tight`,children:t})]})}function JT(){let e=UT.useSearch(),t=Ki(),{data:n}=cb(),{data:r,error:i,isPending:a}=et(nb),{runs:o}=ub(),s=(0,p.useMemo)(()=>r?Ay(r.headers):[],[r]),c=(0,p.useMemo)(()=>{let t=e.q?.toLowerCase();return s.filter(({entry:n})=>e.status===`failed`&&ky(n)===`pass`||e.status===`passed`&&ky(n)!==`pass`||e.source===`recorded`&&!n.recorded||e.source===`scratch`&&n.recorded?!1:!t||[n.runId,n.author,n.git?.branch??``,n.git?.sha??``,n.ci?.provider??``].join(` `).toLowerCase().includes(t))},[s,e]);if(i)return(0,m.jsx)(oC,{error:i});if(a)return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(lC,{}),(0,m.jsx)(cC,{rows:8})]});let l=s[0],u=s.some(e=>!e.entry.recorded);return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Runs`}),(0,m.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:s.length?`${QS(s.length,`run`)} · ${QS(r.manifest.evals.length,`eval`)} tracked`:`Every recorded run of this project, newest first.`})]}),s.length>1?(0,m.jsx)(KT,{rows:s}):null]}),(0,m.jsx)(vT,{runs:o.filter(e=>!s.some(t=>t.entry.runId===e.runId))}),s.length===0&&o.length?null:s.length===0?(0,m.jsxs)(aC,{icon:fS,title:`No runs yet`,children:[`Record one with `,(0,m.jsx)(sC,{children:`reeval run --record`}),`, or promote your latest scratch run with`,` `,(0,m.jsx)(sC,{children:`reeval record latest`}),`.`,` `,n?.mode===`live`?`It shows up here as soon as it lands.`:``]}):(0,m.jsxs)(m.Fragment,{children:[l?(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 md:grid-cols-4`,children:[(0,m.jsx)(qT,{label:`Latest run`,children:(0,m.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(gC,{outcome:ky(l.entry),className:`size-5`}),YS(l.entry.startedAt)]})}),(0,m.jsxs)(qT,{label:`Latest pass rate`,children:[wy(l.total?l.passed/l.total:null),(0,m.jsxs)(`span`,{className:`ml-1.5 text-sm font-normal text-muted-foreground`,children:[l.passed,`/`,l.total]})]}),(0,m.jsxs)(qT,{label:`Failing runs`,children:[s.filter(e=>ky(e.entry)!==`pass`).length,(0,m.jsxs)(`span`,{className:`ml-1.5 text-sm font-normal text-muted-foreground`,children:[`of `,s.length]})]}),(0,m.jsx)(qT,{label:`Branches`,children:new Set(s.map(e=>e.entry.git?.branch??`–`)).size})]}):null,(0,m.jsx)(GT,{hasScratch:u}),c.length===0?(0,m.jsxs)(aC,{icon:bS,title:`No runs match`,children:[`Try a different filter, or clear it to see all `,s.length,` runs.`]}):(0,m.jsx)(`div`,{className:`overflow-hidden rounded-xl border bg-card`,children:(0,m.jsxs)(Gw,{children:[(0,m.jsx)(Kw,{children:(0,m.jsxs)(Jw,{className:`hover:bg-transparent`,children:[(0,m.jsx)(Yw,{className:`w-10`}),(0,m.jsx)(Yw,{children:`Run`}),(0,m.jsx)(Yw,{children:`Commit`}),(0,m.jsx)(Yw,{className:`hidden md:table-cell`,children:`Who`}),(0,m.jsx)(Yw,{className:`w-44`,children:`Result`}),(0,m.jsx)(Yw,{className:`hidden text-right lg:table-cell`,children:`Tokens`}),(0,m.jsx)(Yw,{className:`hidden text-right sm:table-cell`,children:`Duration`}),(0,m.jsx)(Yw,{className:`w-24`})]})}),(0,m.jsx)(qw,{children:c.map(e=>{let{entry:n}=e;return(0,m.jsxs)(Jw,{className:`cursor-pointer`,onClick:()=>t({to:`/runs/$runId`,params:{runId:n.runId}}),children:[(0,m.jsx)(Xw,{className:`pl-4`,children:(0,m.jsx)(gC,{outcome:ky(n)})}),(0,m.jsxs)(Xw,{children:[(0,m.jsx)(z,{to:`/runs/$runId`,params:{runId:n.runId},className:`font-medium hover:underline`,onClick:e=>e.stopPropagation(),children:(0,m.jsx)(`span`,{title:ZS(n.startedAt),children:YS(n.startedAt)})}),(0,m.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5`,children:[(0,m.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground`,children:n.runId}),n.recorded?null:(0,m.jsx)(pC,{variant:`outline`,className:`h-4 px-1.5 text-[10px] text-muted-foreground`,children:`scratch`}),n.status===`interrupted`?(0,m.jsx)(pC,{variant:`outline`,className:`h-4 px-1.5 text-[10px] text-infra`,children:`interrupted`}):null]})]}),(0,m.jsxs)(Xw,{children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-xs`,children:[Dy(n.git?.sha),n.git?.dirty?(0,m.jsx)(`span`,{className:`size-1.5 rounded-full bg-infra`,title:`Uncommitted changes`}):null]}),n.git?.branch?(0,m.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,m.jsx)(Wx,{className:`size-3`}),(0,m.jsx)(`span`,{className:`max-w-40 truncate`,children:n.git.branch})]}):null]}),(0,m.jsx)(Xw,{className:`hidden md:table-cell`,children:(0,m.jsx)(WT,{entry:n})}),(0,m.jsxs)(Xw,{children:[(0,m.jsx)(`div`,{className:`flex items-center justify-between gap-2 text-xs`,children:(0,m.jsxs)(`span`,{className:`tabular font-medium`,children:[e.passed,`/`,e.total,(0,m.jsx)(`span`,{className:`ml-1 font-normal text-muted-foreground`,children:`passed`})]})}),(0,m.jsx)(vC,{className:`mt-1.5`,pass:n.summary.pass,fail:n.summary.fail-n.summary.notGated,missed:n.summary.notGated,infra:n.summary.infraError,skipped:n.summary.skipped})]}),(0,m.jsx)(Xw,{className:`tabular hidden text-right text-muted-foreground lg:table-cell`,children:Ey(n.usage)??`–`}),(0,m.jsx)(Xw,{className:`tabular hidden text-right text-muted-foreground sm:table-cell`,children:Cy(n.durationMs)}),(0,m.jsx)(Xw,{className:`pr-4 text-right`,children:(0,m.jsx)(SC,{changes:e.drift,evals:e.changedEvals})})]},n.runId)})})]})})]})]})}var YT=e=>typeof e==`string`&&e?e:void 0,XT=(e,t)=>e.includes(t)?t:void 0,ZT=fa()({component:rC,notFoundComponent:DT}),QT=da({getParentRoute:()=>ZT,path:`/`,validateSearch:e=>({q:YT(e.q),status:XT([`passed`,`failed`],e.status),source:XT([`recorded`,`scratch`],e.source)}),loader:({context:e})=>e.queryClient.prefetchQuery(nb),component:JT}),$T=da({getParentRoute:()=>ZT,path:`/runs/$runId`,validateSearch:e=>({eval:YT(e.eval),show:XT([`failed`],e.show),tab:XT([`analysis`],e.tab)}),loader:({context:e,params:t})=>e.queryClient.prefetchQuery(rb(t.runId)),component:HT}),eE=da({getParentRoute:()=>ZT,path:`/runs/$runId/evals/$slug/attempts/$attempt`,validateSearch:e=>({tab:XT(Nw,e.tab)}),loader:({context:e,params:t})=>e.queryClient.prefetchQuery(rb(t.runId)),component:Lw}),tE=da({getParentRoute:()=>ZT,path:`/live/$runId`,component:TT}),nE=da({getParentRoute:()=>ZT,path:`/live/$runId/attempt`,validateSearch:e=>({key:YT(e.key)}),component:ET}),rE=da({getParentRoute:()=>ZT,path:`/evals`,validateSearch:e=>({q:YT(e.q)}),component:uT}),iE=da({getParentRoute:()=>ZT,path:`/evals/$slug`,component:cT}),aE=da({getParentRoute:()=>ZT,path:`/compare`,validateSearch:e=>({base:YT(e.base),head:YT(e.head)}),component:oT}),oE=ZT.addChildren([QT,$T,eE,tE,nE,rE,iE,aE]);function sE(e){return ja({routeTree:oE,history:Vn(),context:{queryClient:e},defaultPreload:`intent`,defaultPreloadStaleTime:0,scrollRestoration:!0})}vb();var cE=new Ve({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!0,retry:(e,t)=>!(t instanceof Zy)&&e<2}}}),lE=sE(cE);(0,Ig.createRoot)(document.getElementById(`root`)).render((0,m.jsx)(p.StrictMode,{children:(0,m.jsx)(_,{client:cE,children:(0,m.jsx)(uv,{delayDuration:200,children:(0,m.jsx)(Pa,{router:lE})})})}));
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="referrer" content="no-referrer" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
8
8
|
<title>reeval Studio</title>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-Da1XDzx8.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-xwzWdcE_.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|