agentv 4.1.0 → 4.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/cli.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
3
3
  import {
4
4
  runCli
5
- } from "./chunk-2W5JKKXC.js";
6
- import "./chunk-4Z326WWF.js";
7
- import "./chunk-XEAW7OQT.js";
5
+ } from "./chunk-UXSQQHCI.js";
6
+ import "./chunk-HAZJO7OY.js";
7
+ import "./chunk-XLM3RNN7.js";
8
8
  import "./chunk-C5GOHBQM.js";
9
9
  import "./chunk-HQDCIXVH.js";
10
10
  import "./chunk-BJV6MDBE.js";
@@ -17,6 +17,7 @@ import {
17
17
  OTEL_BACKEND_PRESETS,
18
18
  OtelStreamingObserver,
19
19
  OtelTraceExporter,
20
+ PASS_THRESHOLD,
20
21
  ProviderRegistry,
21
22
  RepoManager,
22
23
  ResponseCache,
@@ -151,7 +152,7 @@ import {
151
152
  transpileEvalYaml,
152
153
  transpileEvalYamlFile,
153
154
  trimBaselineResult
154
- } from "./chunk-XEAW7OQT.js";
155
+ } from "./chunk-XLM3RNN7.js";
155
156
  import {
156
157
  OtlpJsonFileExporter
157
158
  } from "./chunk-C5GOHBQM.js";
@@ -179,6 +180,7 @@ export {
179
180
  OtelStreamingObserver,
180
181
  OtelTraceExporter,
181
182
  OtlpJsonFileExporter,
183
+ PASS_THRESHOLD,
182
184
  ProviderRegistry,
183
185
  RepoManager,
184
186
  ResponseCache,
@@ -316,4 +318,4 @@ export {
316
318
  transpileEvalYamlFile,
317
319
  trimBaselineResult
318
320
  };
319
- //# sourceMappingURL=dist-2JUUJ6PT.js.map
321
+ //# sourceMappingURL=dist-VVXR6TYM.js.map
package/dist/index.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  app,
4
4
  preprocessArgv,
5
5
  runCli
6
- } from "./chunk-2W5JKKXC.js";
7
- import "./chunk-4Z326WWF.js";
8
- import "./chunk-XEAW7OQT.js";
6
+ } from "./chunk-UXSQQHCI.js";
7
+ import "./chunk-HAZJO7OY.js";
8
+ import "./chunk-XLM3RNN7.js";
9
9
  import "./chunk-C5GOHBQM.js";
10
10
  import "./chunk-HQDCIXVH.js";
11
11
  import "./chunk-BJV6MDBE.js";
@@ -4,7 +4,7 @@ import {
4
4
  fileExists,
5
5
  findRepoRoot,
6
6
  runEvalCommand
7
- } from "./chunk-4Z326WWF.js";
7
+ } from "./chunk-HAZJO7OY.js";
8
8
  import {
9
9
  DEFAULT_EVAL_PATTERNS,
10
10
  deriveCategory,
@@ -12,7 +12,7 @@ import {
12
12
  listTargetNames,
13
13
  loadConfig,
14
14
  readTargetDefinitions
15
- } from "./chunk-XEAW7OQT.js";
15
+ } from "./chunk-XLM3RNN7.js";
16
16
  import "./chunk-C5GOHBQM.js";
17
17
  import "./chunk-HQDCIXVH.js";
18
18
  import "./chunk-BJV6MDBE.js";
@@ -363,4 +363,4 @@ ${ANSI_DIM}Retrying execution errors...${ANSI_RESET}
363
363
  export {
364
364
  launchInteractiveWizard
365
365
  };
366
- //# sourceMappingURL=interactive-7ZYS6IOC.js.map
366
+ //# sourceMappingURL=interactive-NVNOLL2H.js.map
@@ -1,4 +1,4 @@
1
- import{r as u,W as T}from"./index-CDGReinH.js";function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function be(e){if(Array.isArray(e))return e}function ye(e,t,r){return(t=Ee(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function we(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,s,p=[],g=!0,v=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(g=(n=i.call(r)).done)&&(p.push(n.value),p.length!==t);g=!0);}catch(P){v=!0,o=P}finally{try{if(!g&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(v)throw o}}return p}}function Oe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as u,W as T}from"./index-D8LVkz9x.js";function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function be(e){if(Array.isArray(e))return e}function ye(e,t,r){return(t=Ee(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function we(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,s,p=[],g=!0,v=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(g=(n=i.call(r)).done)&&(p.push(n.value),p.length!==t);g=!0);}catch(P){v=!0,o=P}finally{try{if(!g&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(v)throw o}}return p}}function Oe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ae(Object(r),!0).forEach(function(n){ye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function je(e,t){if(e==null)return{};var r,n,o=Me(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Me(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Pe(e,t){return be(e)||we(e,t)||Ie(e,t)||Oe()}function Se(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ee(e){var t=Se(e,"string");return typeof t=="symbol"?t:t+""}function Ie(e,t){if(e){if(typeof e=="string")return ie(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ie(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ce(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function q(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,p=new Array(s),g=0;g<s;g++)p[g]=arguments[g];return t.apply(r,[].concat(o,p))}}}function K(e){return{}.toString.call(e).includes("Object")}function Le(e){return!Object.keys(e).length}function U(e){return typeof e=="function"}function Ae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Te(e,t){return K(t)||E("changeType"),Object.keys(t).some(function(r){return!Ae(e,r)})&&E("changeField"),t}function $e(e){U(e)||E("selectorType")}function De(e){U(e)||K(e)||E("handlerType"),K(e)&&Object.values(e).some(function(t){return!U(t)})&&E("handlersType")}function Ve(e){e||E("initialIsRequired"),K(e)||E("initialType"),Le(e)&&E("initialContent")}function xe(e,t){throw new Error(e[t]||e.default)}var Ne={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},E=q(xe)(Ne),_={changes:Te,selector:$e,handler:De,initial:Ve};function qe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_.initial(e),_.handler(t);var r={current:e},n=q(Fe)(r,t),o=q(Ue)(r),i=q(_.changes)(e),s=q(ze)(r);function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(P){return P};return _.selector(v),v(r.current)}function g(v){Ce(n,o,i,s)(v)}return[p,g]}function ze(e,t){return U(t)?t(e.current):t}function Ue(e,t){return e.current=le(le({},e.current),t),t}function Fe(e,t,r){return U(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var We={create:qe},He={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function _e(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,p=new Array(s),g=0;g<s;g++)p[g]=arguments[g];return t.apply(r,[].concat(o,p))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||se("configIsRequired"),Be(e)||se("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(fe.deprecation)}function Ye(e,t){throw new Error(e[t]||e.default)}var fe={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
3
  You are using deprecated way of configuration.
4
4
 
@@ -62,7 +62,7 @@ Error generating stack: `+l.message+`
62
62
  *
63
63
  * This source code is licensed under the MIT license found in the
64
64
  * LICENSE file in the root directory of this source tree.
65
- */var w0;function ES(){if(w0)return lf;w0=1;var n=qi(),s=_S();function i(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var r=typeof Object.is=="function"?Object.is:i,o=s.useSyncExternalStore,f=n.useRef,h=n.useEffect,g=n.useMemo,p=n.useDebugValue;return lf.useSyncExternalStoreWithSelector=function(y,b,v,S,j){var R=f(null);if(R.current===null){var M={hasValue:!1,value:null};R.current=M}else M=R.current;R=g(function(){function U($){if(!P){if(P=!0,K=$,$=S($),j!==void 0&&M.hasValue){var Z=M.value;if(j(Z,$))return L=Z}return L=$}if(Z=L,r(K,$))return Z;var J=S($);return j!==void 0&&j(Z,J)?(K=$,Z):(K=$,L=J)}var P=!1,K,L,X=v===void 0?null:v;return[function(){return U(b())},X===null?void 0:function(){return U(X())}]},[b,v,S,j]);var C=o(y,R[0],R[1]);return h(function(){M.hasValue=!0,M.value=C},[C]),p(C),C},lf}var U0;function NS(){return U0||(U0=1,nf.exports=ES()),nf.exports}var TS=NS();function MS(n,s){return n===s}function he(n,s,i=MS){const r=W.useCallback(h=>{if(!n)return()=>{};const{unsubscribe:g}=n.subscribe(h);return g},[n]),o=W.useCallback(()=>n==null?void 0:n.get(),[n]);return TS.useSyncExternalStoreWithSelector(r,o,o,s,i)}var CS={state:void 0,get:()=>{},subscribe:()=>()=>{}};function hl(n){const s=pe(),i=W.useContext(n.from?gS:Tr),r=n.from??i,o=r?n.from?s.stores.getMatchStoreByRouteId(r):s.stores.activeMatchStoresById.get(r):void 0,f=W.useRef(void 0);return he(o??CS,h=>{if((n.shouldThrow??!0)&&!h&&Ba(),h===void 0)return;const g=n.select?n.select(h):h;if(n.structuralSharing??s.options.defaultStructuralSharing){const p=En(f.current,g);return f.current=p,p}return g})}function Mg(n){return hl({from:n.from,strict:n.strict,structuralSharing:n.structuralSharing,select:s=>n.select?n.select(s.loaderData):s.loaderData})}function Cg(n){const{select:s,...i}=n;return hl({...i,select:r=>s?s(r.loaderDeps):r.loaderDeps})}function Ag(n){return hl({from:n.from,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,strict:n.strict,select:s=>{const i=n.strict===!1?s.params:s._strictParams;return n.select?n.select(i):i}})}function Og(n){return hl({from:n.from,strict:n.strict,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,select:s=>n.select?n.select(s.search):s.search})}function Gf(n){const s=pe();return W.useCallback(i=>s.navigate({...i,from:i.from??(n==null?void 0:n.from)}),[n==null?void 0:n.from,s])}function zg(n){return hl({...n,select:s=>n.select?n.select(s.context):s.context})}var AS=I0();function OS(n,s){const i=pe(),r=fb(s),{activeProps:o,inactiveProps:f,activeOptions:h,to:g,preload:p,preloadDelay:y,hashScrollIntoView:b,replace:v,startTransition:S,resetScroll:j,viewTransition:R,children:M,target:C,disabled:U,style:P,className:K,onClick:L,onBlur:X,onFocus:$,onMouseEnter:Z,onMouseLeave:J,onTouchStart:k,ignoreBlocker:G,params:F,search:st,hash:it,state:ot,mask:nt,reloadDocument:D,unsafeRelative:V,from:at,_fromLocation:yt,...ft}=n,N=Rg(),Q=W.useMemo(()=>n,[i,n.from,n._fromLocation,n.hash,n.to,n.search,n.params,n.state,n.mask,n.unsafeRelative]),I=he(i.stores.location,St=>St,(St,oe)=>St.href===oe.href),tt=W.useMemo(()=>{const St={_fromLocation:I,...Q};return i.buildLocation(St)},[i,I,Q]),ht=tt.maskedLocation?tt.maskedLocation.publicHref:tt.publicHref,xt=tt.maskedLocation?tt.maskedLocation.external:tt.external,bt=W.useMemo(()=>BS(ht,xt,i.history,U),[U,xt,ht,i.history]),Jt=W.useMemo(()=>{if(bt!=null&&bt.external)return pr(bt.href,i.protocolAllowlist)?void 0:bt.href;if(!HS(g)&&!(typeof g!="string"||g.indexOf(":")===-1))try{return new URL(g),pr(g,i.protocolAllowlist)?void 0:g}catch{}},[g,bt,i.protocolAllowlist]),Ht=W.useMemo(()=>{if(Jt)return!1;if(h!=null&&h.exact){if(!Cb(I.pathname,tt.pathname,i.basepath))return!1}else{const St=xr(I.pathname,i.basepath),oe=xr(tt.pathname,i.basepath);if(!(St.startsWith(oe)&&(St.length===oe.length||St[oe.length]==="/")))return!1}return((h==null?void 0:h.includeSearch)??!0)&&!cl(I.search,tt.search,{partial:!(h!=null&&h.exact),ignoreUndefined:!(h!=null&&h.explicitUndefined)})?!1:h!=null&&h.includeHash?N&&I.hash===tt.hash:!0},[h==null?void 0:h.exact,h==null?void 0:h.explicitUndefined,h==null?void 0:h.includeHash,h==null?void 0:h.includeSearch,I,Jt,N,tt.hash,tt.pathname,tt.search,i.basepath]),aa=Ht?_n(o,{})??zS:rf,da=Ht?rf:_n(f,{})??rf,yl=[K,aa.className,da.className].filter(Boolean).join(" "),js=(P||aa.style||da.style)&&{...P,...aa.style,...da.style},[ha,gl]=W.useState(!1),vl=W.useRef(!1),Qa=n.reloadDocument||Jt?!1:p??i.options.defaultPreload,pl=y??i.options.defaultPreloadDelay??0,$e=W.useCallback(()=>{i.preloadRoute({...Q,_builtLocation:tt}).catch(St=>{console.warn(St),console.warn(oS)})},[i,Q,tt]);ob(r,W.useCallback(St=>{St!=null&&St.isIntersecting&&$e()},[$e]),LS,{disabled:!!U||Qa!=="viewport"}),W.useEffect(()=>{vl.current||!U&&Qa==="render"&&($e(),vl.current=!0)},[U,$e,Qa]);const _s=St=>{const oe=St.currentTarget.getAttribute("target"),na=C!==void 0?C:oe;if(!U&&!qS(St)&&!St.defaultPrevented&&(!na||na==="_self")&&St.button===0){St.preventDefault(),AS.flushSync(()=>{gl(!0)});const Gi=i.subscribe("onResolved",()=>{Gi(),gl(!1)});i.navigate({...Q,replace:v,resetScroll:j,hashScrollIntoView:b,startTransition:S,viewTransition:R,ignoreBlocker:G})}};if(Jt)return{...ft,ref:r,href:Jt,...M&&{children:M},...C&&{target:C},...U&&{disabled:U},...P&&{style:P},...K&&{className:K},...L&&{onClick:L},...X&&{onBlur:X},...$&&{onFocus:$},...Z&&{onMouseEnter:Z},...J&&{onMouseLeave:J},...k&&{onTouchStart:k}};const xl=St=>{if(U||Qa!=="intent")return;if(!pl){$e();return}const oe=St.currentTarget;if(ji.has(oe))return;const na=setTimeout(()=>{ji.delete(oe),$e()},pl);ji.set(oe,na)},Mr=St=>{U||Qa!=="intent"||$e()},Yi=St=>{if(U||!Qa||!pl)return;const oe=St.currentTarget,na=ji.get(oe);na&&(clearTimeout(na),ji.delete(oe))};return{...ft,...aa,...da,href:bt==null?void 0:bt.href,ref:r,onClick:ls([L,_s]),onBlur:ls([X,Yi]),onFocus:ls([$,xl]),onMouseEnter:ls([Z,xl]),onMouseLeave:ls([J,Yi]),onTouchStart:ls([k,Mr]),disabled:!!U,target:C,...js&&{style:js},...yl&&{className:yl},...U&&DS,...Ht&&wS,...N&&ha&&US}}var rf={},zS={className:"active"},DS={role:"link","aria-disabled":!0},wS={"data-status":"active","aria-current":"page"},US={"data-transitioning":"transitioning"},ji=new WeakMap,LS={rootMargin:"100px"},ls=n=>s=>{for(const i of n)if(i){if(s.defaultPrevented)return;i(s)}};function BS(n,s,i,r){if(!r)return s?{href:n,external:!0}:{href:i.createHref(n)||"/",external:!1}}function HS(n){if(typeof n!="string")return!1;const s=n.charCodeAt(0);return s===47?n.charCodeAt(1)!==47:s===46}var Vt=W.forwardRef((n,s)=>{const{_asChild:i,...r}=n,{type:o,...f}=OS(r,s),h=typeof r.children=="function"?r.children({isActive:f["data-status"]==="active"}):r.children;if(!i){const{disabled:g,...p}=f;return W.createElement("a",p,h)}return W.createElement(i,f,h)});function qS(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}var QS=class extends Sg{constructor(s){super(s),this.useMatch=i=>hl({select:i==null?void 0:i.select,from:this.id,structuralSharing:i==null?void 0:i.structuralSharing}),this.useRouteContext=i=>zg({...i,from:this.id}),this.useSearch=i=>Og({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useParams=i=>Ag({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Cg({...i,from:this.id}),this.useLoaderData=i=>Mg({...i,from:this.id}),this.useNavigate=()=>Gf({from:this.fullPath}),this.Link=Ti.forwardRef((i,r)=>m.jsx(Vt,{ref:r,from:this.fullPath,...i}))}};function YS(n){return new QS(n)}var GS=class extends fS{constructor(n){super(n),this.useMatch=s=>hl({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>zg({...s,from:this.id}),this.useSearch=s=>Og({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>Ag({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Cg({...s,from:this.id}),this.useLoaderData=s=>Mg({...s,from:this.id}),this.useNavigate=()=>Gf({from:this.fullPath}),this.Link=Ti.forwardRef((s,i)=>m.jsx(Vt,{ref:i,from:this.fullPath,...s}))}};function VS(n){return new GS(n)}function Rs(n){return typeof n=="object"?new L0(n,{silent:!0}).createRoute(n):new L0(n,{silent:!0}).createRoute}var L0=class{constructor(n,s){this.path=n,this.createRoute=i=>{const r=YS(i);return r.isRoot=!1,r},this.silent=s==null?void 0:s.silent}};function XS(n){const s=pe(),i=`not-found-${he(s.stores.location,r=>r.pathname)}-${he(s.stores.status,r=>r)}`;return m.jsx(qf,{getResetKey:()=>i,onCatch:(r,o)=>{var f;if(ve(r))(f=n.onCatch)==null||f.call(n,r,o);else throw r},errorComponent:({error:r})=>{var o;if(ve(r))return(o=n.fallback)==null?void 0:o.call(n,r);throw r},children:n.children})}function KS(){return m.jsx("p",{children:"Not Found"})}function ss(n){return m.jsx(m.Fragment,{children:n.children})}function Dg(n,s,i){return s.options.notFoundComponent?m.jsx(s.options.notFoundComponent,{...i}):n.options.defaultNotFoundComponent?m.jsx(n.options.defaultNotFoundComponent,{...i}):m.jsx(KS,{})}function ZS(n){return null}function JS(){return ZS(pe()),null}var wg=W.memo(function({matchId:s}){const i=pe(),r=i.stores.activeMatchStoresById.get(s);r||Ba();const o=he(i.stores.loadedAt,h=>h),f=he(r,h=>h);return m.jsx(PS,{router:i,matchId:s,resetKey:o,matchState:W.useMemo(()=>{var p;const h=f.routeId,g=(p=i.routesById[h].parentRoute)==null?void 0:p.id;return{routeId:h,ssr:f.ssr,_displayPending:f._displayPending,parentRouteId:g}},[f._displayPending,f.routeId,f.ssr,i.routesById])})});function PS({router:n,matchId:s,resetKey:i,matchState:r}){var R,M;const o=n.routesById[r.routeId],f=o.options.pendingComponent??n.options.defaultPendingComponent,h=f?m.jsx(f,{}):null,g=o.options.errorComponent??n.options.defaultErrorComponent,p=o.options.onCatch??n.options.defaultOnCatch,y=o.isRoot?o.options.notFoundComponent??((R=n.options.notFoundRoute)==null?void 0:R.options.component):o.options.notFoundComponent,b=r.ssr===!1||r.ssr==="data-only",v=(!o.isRoot||o.options.wrapInSuspense||b)&&(o.options.wrapInSuspense??f??(((M=o.options.errorComponent)==null?void 0:M.preload)||b))?W.Suspense:ss,S=g?qf:ss,j=y?XS:ss;return m.jsxs(o.isRoot?o.options.shellComponent??ss:ss,{children:[m.jsx(Tr.Provider,{value:s,children:m.jsx(v,{fallback:h,children:m.jsx(S,{getResetKey:()=>i,errorComponent:g||Qf,onCatch:(C,U)=>{if(ve(C))throw C;p==null||p(C,U)},children:m.jsx(j,{fallback:C=>{if(!y||C.routeId&&C.routeId!==r.routeId||!C.routeId&&!o.isRoot)throw C;return W.createElement(y,C)},children:b||r._displayPending?m.jsx(mS,{fallback:h,children:m.jsx(B0,{matchId:s})}):m.jsx(B0,{matchId:s})})})})}),r.parentRouteId===ol?m.jsxs(m.Fragment,{children:[m.jsx(kS,{resetKey:i}),n.options.scrollRestoration&&fg?m.jsx(JS,{}):null]}):null]})}function kS({resetKey:n}){const s=pe(),i=W.useRef(void 0);return Ni(()=>{const r=s.latestLocation.href;(i.current===void 0||i.current!==r)&&(s.emit({type:"onRendered",...is(s.stores.location.state,s.stores.resolvedLocation.state)}),i.current=r)},[s.latestLocation.state.__TSR_key,n,s]),null}var B0=W.memo(function({matchId:s}){var y,b,v,S;const i=pe(),r=i.stores.activeMatchStoresById.get(s);r||Ba();const o=he(r,j=>j),f=o.routeId,h=i.routesById[f],g=W.useMemo(()=>{var R;const j=(R=i.routesById[f].options.remountDeps??i.options.defaultRemountDeps)==null?void 0:R({routeId:f,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return j?JSON.stringify(j):void 0},[f,o.loaderDeps,o._strictParams,o._strictSearch,i.options.defaultRemountDeps,i.routesById]),p=W.useMemo(()=>{const j=h.options.component??i.options.defaultComponent;return j?m.jsx(j,{},g):m.jsx(Ug,{})},[g,h.options.component,i.options.defaultComponent]);if(o._displayPending)throw(y=i.getMatch(o.id))==null?void 0:y._nonReactive.displayPendingPromise;if(o._forcePending)throw(b=i.getMatch(o.id))==null?void 0:b._nonReactive.minPendingPromise;if(o.status==="pending"){const j=h.options.pendingMinMs??i.options.defaultPendingMinMs;if(j){const R=i.getMatch(o.id);if(R&&!R._nonReactive.minPendingPromise){const M=bs();R._nonReactive.minPendingPromise=M,setTimeout(()=>{M.resolve(),R._nonReactive.minPendingPromise=void 0},j)}}throw(v=i.getMatch(o.id))==null?void 0:v._nonReactive.loadPromise}if(o.status==="notFound")return ve(o.error)||Ba(),Dg(i,h,o.error);if(o.status==="redirected")throw Me(o.error)||Ba(),(S=i.getMatch(o.id))==null?void 0:S._nonReactive.loadPromise;if(o.status==="error")throw o.error;return p}),Ug=W.memo(function(){const s=pe(),i=W.useContext(Tr);let r,o=!1,f;{const y=i?s.stores.activeMatchStoresById.get(i):void 0;[r,o]=he(y,b=>[b==null?void 0:b.routeId,(b==null?void 0:b.globalNotFound)??!1]),f=he(s.stores.matchesId,b=>b[b.findIndex(v=>v===i)+1])}const h=r?s.routesById[r]:void 0,g=s.options.defaultPendingComponent?m.jsx(s.options.defaultPendingComponent,{}):null;if(o)return h||Ba(),Dg(s,h,void 0);if(!f)return null;const p=m.jsx(wg,{matchId:f});return r===ol?m.jsx(W.Suspense,{fallback:g,children:p}):p});function FS(){const n=pe(),s=W.useRef({router:n,mounted:!1}),[i,r]=W.useState(!1),o=he(n.stores.isLoading,v=>v),f=he(n.stores.hasPendingMatches,v=>v),h=ko(o),g=o||i||f,p=ko(g),y=o||f,b=ko(y);return n.startTransition=v=>{r(!0),W.startTransition(()=>{v(),r(!1)})},W.useEffect(()=>{const v=n.history.subscribe(n.load),S=n.buildLocation({to:n.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Mn(n.latestLocation.publicHref)!==Mn(S.publicHref)&&n.commitLocation({...S,replace:!0}),()=>{v()}},[n,n.history]),Ni(()=>{if(typeof window<"u"&&n.ssr||s.current.router===n&&s.current.mounted)return;s.current={router:n,mounted:!0},(async()=>{try{await n.load()}catch(S){console.error(S)}})()},[n]),Ni(()=>{h&&!o&&n.emit({type:"onLoad",...is(n.stores.location.state,n.stores.resolvedLocation.state)})},[h,n,o]),Ni(()=>{b&&!y&&n.emit({type:"onBeforeRouteMount",...is(n.stores.location.state,n.stores.resolvedLocation.state)})},[y,b,n]),Ni(()=>{if(p&&!g){const v=is(n.stores.location.state,n.stores.resolvedLocation.state);n.emit({type:"onResolved",...v}),Eg(()=>{n.stores.status.setState(()=>"idle"),n.stores.resolvedLocation.setState(()=>n.stores.location.state)}),v.hrefChanged&&dS(n)}},[g,p,n]),null}function $S(){const n=pe(),s=n.routesById[ol].options.pendingComponent??n.options.defaultPendingComponent,i=s?m.jsx(s,{}):null,r=m.jsxs(typeof document<"u"&&n.ssr?ss:W.Suspense,{fallback:i,children:[m.jsx(FS,{}),m.jsx(IS,{})]});return n.options.InnerWrap?m.jsx(n.options.InnerWrap,{children:r}):r}function IS(){const n=pe(),s=he(n.stores.firstMatchId,o=>o),i=he(n.stores.loadedAt,o=>o),r=s?m.jsx(wg,{matchId:s}):null;return m.jsx(Tr.Provider,{value:s,children:n.options.disableGlobalCatchBoundary?r:m.jsx(qf,{getResetKey:()=>i,errorComponent:Qf,onCatch:void 0,children:r})})}function Lg(){const n=pe();return he(n.stores.matchRouteReactivity,s=>s),W.useCallback(s=>{const{pending:i,caseSensitive:r,fuzzy:o,includeSearch:f,...h}=s;return n.matchRoute(h,{pending:i,caseSensitive:r,fuzzy:o,includeSearch:f})},[n])}function WS(n){const s=pe(),i=W.useRef(void 0);return he(s.stores.activeMatchesSnapshot,r=>{const o=r;if(s.options.defaultStructuralSharing){const f=En(i.current,o);return i.current=f,f}return o})}var t1=n=>({createMutableStore:O0,createReadonlyStore:O0,batch:Eg}),e1=n=>new a1(n),a1=class extends nS{constructor(n){super(n,t1)}};function n1({router:n,children:s,...i}){Object.keys(i).length>0&&n.update({...n.options,...i,context:{...n.options.context,...i.context}});const r=m.jsx(jg.Provider,{value:n,children:s});return n.options.Wrap?m.jsx(n.options.Wrap,{children:r}):r}function l1({router:n,...s}){return m.jsx(n1,{router:n,...s,children:m.jsx($S,{})})}function s1(n){const i=pe();return W.useRef(void 0),he(i.stores.__store,r=>r)}function i1(n){const s=[];for(let i=1;i<n.length;i++){const r=n[i],o=r.routeId??r.id,f=r.params;o==="/"||o==="/_layout"||(o.includes("/runs/$runId/category/$category")?(s.some(h=>h.label===f.runId)||s.push({label:f.runId??"Run",to:`/runs/${encodeURIComponent(f.runId)}`}),s.push({label:f.category??"Category",to:r.pathname})):o.includes("/runs/$runId/dataset/$dataset")?s.push({label:f.dataset??"Dataset",to:r.pathname}):o.includes("/runs/$runId")?s.push({label:f.runId??"Run",to:r.pathname}):o.includes("/evals/$runId/$evalId")?(s.some(h=>h.label===f.runId)||s.push({label:f.runId??"Run",to:`/runs/${encodeURIComponent(f.runId)}`}),s.push({label:f.evalId??"Eval",to:r.pathname})):o.includes("/experiments/$experimentName")?s.push({label:f.experimentName??"Experiment",to:r.pathname}):(o==="/index"||o==="/")&&s.push({label:"Home",to:"/"}))}return s}function u1(){const n=WS(),s=i1(n);return s.length===0?null:m.jsxs("div",{className:"flex items-center gap-2 border-b border-gray-800 bg-gray-950 px-6 py-2 text-sm",children:[m.jsx(Vt,{to:"/",className:"text-cyan-400 hover:text-cyan-300 hover:underline",children:"Home"}),s.map((i,r)=>{const o=r===s.length-1;return m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-gray-600",children:">"}),o?m.jsx("span",{className:"text-gray-400",children:i.label}):m.jsx(Vt,{to:i.to??"/",className:"text-cyan-400 hover:text-cyan-300 hover:underline",children:i.label})]},`${i.label}-${r}`)})]})}async function On(n){const s=await fetch(n);if(!s.ok)throw new Error(`API error: ${s.status} ${s.statusText}`);return s.json()}const r1={queryKey:["runs"],queryFn:()=>On("/api/runs"),refetchInterval:5e3};function c1(n){return{queryKey:["runs",n],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}`),enabled:!!n}}const o1={queryKey:["feedback"],queryFn:()=>On("/api/feedback")},f1={queryKey:["experiments"],queryFn:()=>On("/api/experiments")},d1={queryKey:["targets"],queryFn:()=>On("/api/targets")};function h1(n,s){return{queryKey:["runs",n,"evals",s,"files"],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}/evals/${encodeURIComponent(s)}/files`),enabled:!!n&&!!s}}function m1(n,s,i){return{queryKey:["runs",n,"evals",s,"files",i],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}/evals/${encodeURIComponent(s)}/files/${i}`),enabled:!!n&&!!s&&!!i}}function y1(n,s){return{queryKey:["runs",n,"categories",s,"datasets"],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}/categories/${encodeURIComponent(s)}/datasets`),enabled:!!n&&!!s}}function Vf(){return An(r1)}function Qi(n){return An(c1(n))}function g1(){return An(o1)}function Xf(){return An(f1)}function v1(){return An(d1)}function Bg(n,s){return An(h1(n,s))}function Hg(n,s,i){return An(m1(n,s,i))}function qg(n,s){return An(y1(n,s))}function p1(){const n=Lg(),s=n({to:"/evals/$runId/$evalId",fuzzy:!0}),i=n({to:"/runs/$runId/category/$category",fuzzy:!0}),r=n({to:"/runs/$runId/dataset/$dataset",fuzzy:!0}),o=n({to:"/experiments/$experimentName",fuzzy:!0});if(i&&typeof i=="object"&&"runId"in i){const{runId:f,category:h}=i;return m.jsx(R1,{runId:f,category:h})}if(r&&typeof r=="object"&&"runId"in r){const{runId:f,dataset:h}=r;return m.jsx(S1,{runId:f,dataset:h})}if(s&&typeof s=="object"&&"runId"in s){const{runId:f,evalId:h}=s;return m.jsx(b1,{runId:f,currentEvalId:h})}if(o&&typeof o=="object"&&"experimentName"in o){const{experimentName:f}=o;return m.jsx(j1,{currentExperiment:f})}return m.jsx(x1,{})}function x1(){const n=Lg(),{data:s}=Vf(),i=n({to:"/"}),r=n({to:"/runs/$runId",fuzzy:!0});return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Runs"}),s==null?void 0:s.runs.map(o=>{const f=i===!1&&r&&typeof r=="object"&&"runId"in r&&r.runId===o.filename;return m.jsx(Vt,{to:"/runs/$runId",params:{runId:o.filename},className:`mb-0.5 block truncate rounded-md px-2 py-1.5 text-sm transition-colors ${f?"bg-gray-800 text-cyan-400":"text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,children:o.filename},o.filename)})]})]})}function b1({runId:n,currentEvalId:s}){const{data:i}=Qi(n);return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("div",{className:"border-b border-gray-800 px-4 py-2",children:[m.jsx(Vt,{to:"/runs/$runId",params:{runId:n},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← Back to run"}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-300",children:n})]}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Evaluations"}),i==null?void 0:i.results.map(r=>{const o=r.testId===s,f=r.score>=1;return m.jsxs(Vt,{to:"/evals/$runId/$evalId",params:{runId:n,evalId:r.testId},className:`mb-0.5 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors ${o?"bg-gray-800 text-cyan-400":"text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,children:[m.jsx("span",{className:`text-xs ${f?"text-emerald-400":"text-red-400"}`,children:f?"✓":"✗"}),m.jsx("span",{className:"truncate",children:r.testId})]},r.testId)})]})]})}function S1({runId:n,dataset:s}){const{data:i}=Qi(n),r=((i==null?void 0:i.results)??[]).filter(o=>(o.dataset??"Uncategorized")===s);return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("div",{className:"border-b border-gray-800 px-4 py-2",children:[m.jsx(Vt,{to:"/runs/$runId",params:{runId:n},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← Back to run"}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-300",children:n}),m.jsx("p",{className:"truncate text-xs text-gray-500",children:s})]}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Evaluations"}),r.map(o=>{const f=o.score>=1;return m.jsxs(Vt,{to:"/evals/$runId/$evalId",params:{runId:n,evalId:o.testId},className:"mb-0.5 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-gray-400 transition-colors hover:bg-gray-800/50 hover:text-gray-200",children:[m.jsx("span",{className:`text-xs ${f?"text-emerald-400":"text-red-400"}`,children:f?"✓":"✗"}),m.jsx("span",{className:"truncate",children:o.testId})]},o.testId)})]})]})}function R1({runId:n,category:s}){const{data:i}=qg(n,s),r=(i==null?void 0:i.datasets)??[];return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("div",{className:"border-b border-gray-800 px-4 py-2",children:[m.jsx(Vt,{to:"/runs/$runId",params:{runId:n},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← Back to run"}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-300",children:n}),m.jsx("p",{className:"truncate text-xs text-gray-500",children:s})]}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Datasets"}),r.map(o=>m.jsxs(Vt,{to:"/runs/$runId/dataset/$dataset",params:{runId:n,dataset:o.name},className:"mb-0.5 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-gray-400 transition-colors hover:bg-gray-800/50 hover:text-gray-200",children:[m.jsx("span",{className:`text-xs ${o.passed===o.total?"text-emerald-400":"text-red-400"}`,children:o.passed===o.total?"✓":"✗"}),m.jsx("span",{className:"truncate",children:o.name})]},o.name))]})]})}function j1({currentExperiment:n}){const{data:s}=Xf(),i=(s==null?void 0:s.experiments)??[];return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsx("div",{className:"border-b border-gray-800 px-4 py-2",children:m.jsx(Vt,{to:"/",search:{tab:"experiments"},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← All experiments"})}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Experiments"}),i.map(r=>{const o=r.name===n;return m.jsx(Vt,{to:"/experiments/$experimentName",params:{experimentName:r.name},className:`mb-0.5 block truncate rounded-md px-2 py-1.5 text-sm transition-colors ${o?"bg-gray-800 text-cyan-400":"text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,children:r.name},r.name)})]})]})}function _1(){return m.jsxs("div",{className:"flex h-screen overflow-hidden",children:[m.jsx(p1,{}),m.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[m.jsx(u1,{}),m.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:m.jsx(Ug,{})})]})]})}const ml=VS({component:_1});function qa({score:n,className:s=""}){const i=Math.round(Math.max(0,Math.min(1,n))*100);return m.jsxs("div",{className:`flex items-center gap-3 ${s}`,children:[m.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-gray-800",children:m.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-cyan-400 to-blue-500 transition-all duration-300",style:{width:`${i}%`}})}),m.jsxs("span",{className:"w-12 text-right text-sm font-medium tabular-nums text-gray-300",children:[i,"%"]})]})}function E1(){const{data:n,isLoading:s}=Xf();if(s)return m.jsx(T1,{});const i=(n==null?void 0:n.experiments)??[];return i.length===0?m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No experiments found"}),m.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Experiments will appear here once evaluations are run with experiment labels."})]}):m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Experiment"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Runs"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Targets"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",children:"Pass Rate"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Last Run"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:i.map(r=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3",children:m.jsx(Vt,{to:"/experiments/$experimentName",params:{experimentName:r.name},className:"font-medium text-cyan-400 hover:text-cyan-300 hover:underline",children:r.name})}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.run_count}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.target_count}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:r.pass_rate})}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:N1(r.last_run)})]},r.name))})]})})}function N1(n){if(!n)return"N/A";try{const s=new Date(n);return Number.isNaN(s.getTime())?"N/A":s.toLocaleString()}catch{return"N/A"}}function T1(){return m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("div",{className:"animate-pulse",children:[m.jsx("div",{className:"border-b border-gray-800 bg-gray-900/50 px-4 py-3",children:m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"})}),["sk-1","sk-2","sk-3","sk-4","sk-5"].map(n=>m.jsxs("div",{className:"flex gap-4 border-b border-gray-800/50 px-4 py-3",children:[m.jsx("div",{className:"h-4 w-32 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-24 rounded bg-gray-800"})]},n))]})})}function M1(n){if(!n)return"N/A";try{const s=new Date(n);return Number.isNaN(s.getTime())?"N/A":s.toLocaleString()}catch{return"N/A"}}function Qg({runs:n}){return n.length===0?m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No evaluation runs found."}),m.jsxs("p",{className:"mt-2 text-sm text-gray-500",children:["Run an evaluation first:"," ",m.jsx("code",{className:"rounded bg-gray-800 px-2 py-1 text-cyan-400",children:"agentv eval <eval-file>"})]})]}):m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Run"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Target"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Experiment"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Timestamp"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Tests"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",title:"Percentage of tests with a perfect score (1.0)",children:"Tests Passing"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",title:"Mean score across all tests (0-100%)",children:"Mean Score"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:n.map(s=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3",children:m.jsx(Vt,{to:"/runs/$runId",params:{runId:s.filename},className:"font-medium text-cyan-400 hover:text-cyan-300 hover:underline",children:s.filename})}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:s.target??"-"}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:s.experiment??"-"}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:M1(s.timestamp)}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:s.test_count}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:s.pass_rate})}),m.jsxs("td",{className:"px-4 py-3 text-right tabular-nums",children:[(s.avg_score*100).toFixed(1),"%"]})]},s.filename))})]})})}function C1(){const{data:n,isLoading:s}=v1();if(s)return m.jsx(A1,{});const i=(n==null?void 0:n.targets)??[];return i.length===0?m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No targets found"}),m.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Targets will appear here once evaluations are run with target labels."})]}):m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Target"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Runs"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Experiments"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",children:"Pass Rate"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Evals"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:i.map(r=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3 font-medium text-gray-200",children:r.name}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.run_count}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.experiment_count}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:r.pass_rate})}),m.jsxs("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:[m.jsx("span",{className:"text-emerald-400",children:r.passed_count}),m.jsx("span",{className:"text-gray-600",children:"/"}),m.jsx("span",{children:r.eval_count})]})]},r.name))})]})})}function A1(){return m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("div",{className:"animate-pulse",children:[m.jsx("div",{className:"border-b border-gray-800 bg-gray-900/50 px-4 py-3",children:m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"})}),["sk-1","sk-2","sk-3","sk-4","sk-5"].map(n=>m.jsxs("div",{className:"flex gap-4 border-b border-gray-800/50 px-4 py-3",children:[m.jsx("div",{className:"h-4 w-32 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-20 rounded bg-gray-800"})]},n))]})})}const H0=[{id:"runs",label:"Recent Runs"},{id:"experiments",label:"Experiments"},{id:"targets",label:"Targets"}],O1=Rs("/")({component:z1});function z1(){const i=s1().location.search.tab,r=Gf(),{data:o,isLoading:f,error:h}=Vf(),g=H0.some(p=>p.id===i)?i:"runs";return m.jsxs("div",{className:"space-y-6",children:[m.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Evaluation Runs"}),m.jsx("div",{className:"border-b border-gray-800",children:m.jsx("div",{className:"flex gap-1",children:H0.map(p=>m.jsx("button",{type:"button",onClick:()=>r({to:"/",search:{tab:p.id}}),className:`px-4 py-2 text-sm font-medium transition-colors ${g===p.id?"border-b-2 border-cyan-400 text-cyan-400":"text-gray-400 hover:text-gray-300"}`,children:p.label},p.id))})}),g==="runs"&&m.jsx(D1,{data:o,isLoading:f,error:h}),g==="experiments"&&m.jsx(E1,{}),g==="targets"&&m.jsx(C1,{})]})}function D1({data:n,isLoading:s,error:i}){return s?m.jsx(w1,{}):i?m.jsxs("div",{className:"rounded-lg border border-red-900/50 bg-red-950/20 p-6 text-red-400",children:["Failed to load runs: ",i.message]}):m.jsx(Qg,{runs:(n==null?void 0:n.runs)??[]})}function w1(){return m.jsx("div",{className:"space-y-2",children:["s1","s2","s3","s4","s5"].map(n=>m.jsx("div",{className:"h-12 animate-pulse rounded-lg bg-gray-900"},n))})}function _i({label:n,value:s,accent:i}){return m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("p",{className:"text-sm text-gray-400",children:n}),m.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i??"text-white"}`,children:s})]})}function jr({total:n,passed:s,failed:i,passRate:r,totalCost:o}){return m.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-5",children:[m.jsx(_i,{label:"Total",value:String(n)}),m.jsx(_i,{label:"Passed",value:String(s),accent:"text-emerald-400"}),m.jsx(_i,{label:"Failed",value:String(i),accent:"text-red-400"}),m.jsx(_i,{label:"Pass Rate",value:`${Math.round(r*100)}%`,accent:"text-cyan-400"}),o!==void 0&&m.jsx(_i,{label:"Cost",value:`$${o.toFixed(4)}`,accent:"text-amber-400"})]})}function U1(n){const s=new Map;for(const i of n){const r=i.category??"Uncategorized",o=i.dataset??"Uncategorized";s.has(r)||s.set(r,new Map);const f=s.get(r),h=f.get(o)??{passed:0,failed:0,total:0,scoreSum:0};h.total+=1,h.scoreSum+=i.score,i.score>=1?h.passed+=1:h.failed+=1,f.set(o,h)}return Array.from(s.entries()).map(([i,r])=>{const o=Array.from(r.entries()).map(([y,b])=>({name:y,...b,avgScore:b.total>0?b.scoreSum/b.total:0})).sort((y,b)=>y.name.localeCompare(b.name)),f=o.reduce((y,b)=>y+b.total,0),h=o.reduce((y,b)=>y+b.passed,0),g=o.reduce((y,b)=>y+b.failed,0),p=o.reduce((y,b)=>y+b.avgScore*b.total,0);return{name:i,datasets:o,total:f,passed:h,failed:g,avgScore:f>0?p/f:0}}).sort((i,r)=>i.name.localeCompare(r.name))}function L1({results:n,runId:s}){var y;const i=n.length,r=n.filter(b=>b.score>=1).length,o=i-r,f=i>0?r/i:0,h=n.reduce((b,v)=>b+(v.costUsd??0),0),g=U1(n),p=g.length>1;return i===0?m.jsxs("div",{className:"space-y-6",children:[m.jsx(jr,{total:0,passed:0,failed:0,passRate:0}),m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No evaluations found"}),m.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"This run has no results yet."})]})]}):m.jsxs("div",{className:"space-y-6",children:[m.jsx(jr,{total:i,passed:r,failed:o,passRate:f,totalCost:h>0?h:void 0}),p?m.jsxs("div",{className:"space-y-4",children:[m.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Categories"}),g.map(b=>m.jsx(B1,{category:b,runId:s},b.name))]}):m.jsxs("div",{className:"space-y-3",children:[m.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Datasets"}),m.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:(y=g[0])==null?void 0:y.datasets.map(b=>m.jsx(Yg,{dataset:b,runId:s},b.name))})]}),m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Test ID"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Target"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",children:"Score"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Status"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Duration"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Cost"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:n.map((b,v)=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3",children:m.jsx(Vt,{to:"/evals/$runId/$evalId",params:{runId:s,evalId:b.testId},className:"font-medium text-cyan-400 hover:text-cyan-300 hover:underline",children:b.testId})}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:b.target??"-"}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:b.score})}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(H1,{status:b.executionStatus})}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:b.durationMs!=null?`${(b.durationMs/1e3).toFixed(1)}s`:"-"}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:b.costUsd!=null?`$${b.costUsd.toFixed(4)}`:"-"})]},`${b.testId}-${v}`))})]})})]})}function B1({category:n,runId:s}){const[i,r]=W.useState(!0);return m.jsxs("div",{className:"rounded-lg border border-gray-800",children:[m.jsxs("button",{type:"button",onClick:()=>r(!i),className:"flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-gray-900/50",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"text-xs text-gray-500",children:i?"▼":"▶"}),m.jsx("span",{className:"text-sm font-medium text-gray-200",children:n.name}),m.jsxs("span",{className:"text-xs text-gray-500",children:[n.datasets.length," dataset",n.datasets.length!==1?"s":""]})]}),m.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[m.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&m.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]}),m.jsxs("span",{className:"text-gray-500",children:[n.passed,"/",n.total]})]})]}),i&&m.jsx("div",{className:"border-t border-gray-800 p-3",children:m.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:n.datasets.map(o=>m.jsx(Yg,{dataset:o,runId:s},o.name))})})]})}function Yg({dataset:n,runId:s}){return m.jsxs(Vt,{to:"/runs/$runId/dataset/$dataset",params:{runId:s,dataset:n.name},className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-left transition-colors hover:border-gray-700",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:n.name}),m.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:[n.passed,"/",n.total]})]}),m.jsx("div",{className:"mt-2",children:m.jsx(qa,{score:n.avgScore})}),m.jsxs("div",{className:"mt-1 flex gap-3 text-xs",children:[m.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&m.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]})]})]})}function H1({status:n}){if(!n)return m.jsx("span",{className:"text-gray-500",children:"-"});const s=n==="success"||n==="completed",i=n==="error"||n==="failed";return m.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${s?"bg-emerald-900/50 text-emerald-400":i?"bg-red-900/50 text-red-400":"bg-gray-800 text-gray-400"}`,children:n})}const Gg=Rs("/runs/$runId")({component:q1});function q1(){const{runId:n}=Gg.useParams(),{data:s,isLoading:i,error:r}=Qi(n);return i?m.jsxs("div",{className:"space-y-4",children:[m.jsx("div",{className:"h-8 w-64 animate-pulse rounded bg-gray-800"}),m.jsx("div",{className:"grid grid-cols-5 gap-4",children:["s1","s2","s3","s4","s5"].map(o=>m.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-gray-900"},o))})]}):r?m.jsxs("div",{className:"rounded-lg border border-red-900/50 bg-red-950/20 p-6 text-red-400",children:["Failed to load run: ",r.message]}):m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{children:[m.jsxs("h1",{className:"text-2xl font-semibold text-white",children:["Run: ",n]}),m.jsxs("p",{className:"mt-1 text-sm text-gray-400",children:["Source: ",s==null?void 0:s.source]})]}),m.jsx(L1,{results:(s==null?void 0:s.results)??[],runId:n})]})}const Vg=Rs("/experiments/$experimentName")({component:Q1});function Q1(){var v;const{experimentName:n}=Vg.useParams(),{data:s,isLoading:i}=Xf(),{data:r,isLoading:o}=Vf();if(i||o)return m.jsxs("div",{className:"space-y-4",children:[m.jsx("div",{className:"h-8 w-64 animate-pulse rounded bg-gray-800"}),m.jsx("div",{className:"grid grid-cols-4 gap-4",children:["s1","s2","s3","s4"].map(S=>m.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-gray-900"},S))})]});const h=(v=s==null?void 0:s.experiments)==null?void 0:v.find(S=>S.name===n),g=(r==null?void 0:r.runs)??[],p=(h==null?void 0:h.pass_rate)??0,y=(h==null?void 0:h.run_count)??0,b=(h==null?void 0:h.target_count)??0;return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-2xl font-semibold text-white",children:n}),m.jsxs("p",{className:"mt-1 text-sm text-gray-400",children:[y," run",y!==1?"s":""," · ",b," target",b!==1?"s":"",(h==null?void 0:h.last_run)&&m.jsxs("span",{className:"ml-2",children:["· Last run: ",q0(h.last_run)]})]})]}),h&&m.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[m.jsx(or,{label:"Runs",value:String(y)}),m.jsx(or,{label:"Targets",value:String(b)}),m.jsx(or,{label:"Pass Rate",value:`${Math.round(p*100)}%`,accent:"text-cyan-400"}),m.jsx(or,{label:"Last Run",value:q0(h.last_run)})]}),m.jsxs("div",{children:[m.jsx("h2",{className:"mb-4 text-lg font-medium text-gray-200",children:"All Runs"}),m.jsx(Qg,{runs:g})]})]})}function or({label:n,value:s,accent:i}){return m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("p",{className:"text-sm text-gray-400",children:n}),m.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i??"text-white"}`,children:s})]})}function q0(n){if(!n)return"N/A";try{const s=new Date(n);return Number.isNaN(s.getTime())?"N/A":s.toLocaleString()}catch{return"N/A"}}async function Y1(n,s){const i=await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviews:[{test_id:n,comment:s}]})});if(!i.ok)throw new Error(`Failed to save feedback: ${i.status}`);return i.json()}function G1({testId:n}){var b;const{data:s}=g1(),i=wf(),r=(b=s==null?void 0:s.reviews)==null?void 0:b.find(v=>v.test_id===n),[o,f]=W.useState((r==null?void 0:r.comment)??""),[h,g]=W.useState(!1);W.useEffect(()=>{f((r==null?void 0:r.comment)??""),g(!1)},[r==null?void 0:r.comment]);const p=cb({mutationFn:()=>Y1(n,o),onSuccess:()=>{i.invalidateQueries({queryKey:["feedback"]}),g(!0),setTimeout(()=>g(!1),2e3)}}),y=W.useCallback(()=>{p.mutate()},[p]);return m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("h4",{className:"mb-2 text-sm font-medium text-gray-400",children:"Feedback"}),m.jsx("textarea",{value:o,onChange:v=>{f(v.target.value),g(!1)},placeholder:"Add feedback for this test...",className:"w-full rounded-md border border-gray-700 bg-gray-800 p-3 text-sm text-gray-200 placeholder-gray-500 focus:border-cyan-400 focus:outline-none",rows:3}),m.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[m.jsx("button",{type:"button",onClick:y,disabled:p.isPending,className:"rounded-md bg-cyan-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-cyan-500 disabled:opacity-50",children:p.isPending?"Saving...":"Save Feedback"}),h&&m.jsx("span",{className:"text-sm text-emerald-400",children:"Saved"}),p.isError&&m.jsx("span",{className:"text-sm text-red-400",children:"Error saving feedback"})]})]})}function V1(n){var i;switch((i=n.split(".").pop())==null?void 0:i.toLowerCase()){case"ts":case"tsx":return"📘";case"json":return"📋";case"log":case"txt":return"📜";case"md":return"📝";default:return"📄"}}function Xg(n){const s=[];for(const i of n)i.type==="dir"&&(s.push(i.path),i.children&&s.push(...Xg(i.children)));return s}function Kg({node:n,selectedPath:s,onSelect:i,openFolders:r,toggleFolder:o,depth:f=0}){const h=n.type==="dir",g=r.has(n.path),p=s===n.path;return m.jsxs("div",{children:[m.jsxs("button",{type:"button",onClick:()=>{h?o(n.path):i(n.path)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm transition-colors ${p?"bg-cyan-400/20 text-cyan-400":"text-gray-300 hover:bg-gray-800/50 hover:text-gray-200"}`,style:{paddingLeft:`${f*16+8}px`},children:[m.jsx("span",{className:"flex-shrink-0 text-xs",children:h?g?"📂":"📁":V1(n.name)}),m.jsx("span",{className:"truncate",children:n.name})]}),h&&g&&n.children&&m.jsx("div",{children:n.children.map(y=>m.jsx(Kg,{node:y,selectedPath:s,onSelect:i,openFolders:r,toggleFolder:o,depth:f+1},y.path))})]})}function Zg({files:n,selectedPath:s,onSelect:i}){const[r,o]=W.useState(()=>new Set(Xg(n))),f=h=>{o(g=>{const p=new Set(g);return p.has(h)?p.delete(h):p.add(h),p})};return m.jsxs("div",{className:"w-64 overflow-y-auto rounded-lg border border-gray-800 bg-gray-900 py-2",children:[n.length===0&&m.jsx("p",{className:"px-4 py-2 text-sm text-gray-500",children:"No files."}),n.map(h=>m.jsx(Kg,{node:h,selectedPath:s,onSelect:i,openFolders:r,toggleFolder:f},h.path))]})}const X1="modulepreload",K1=function(n){return"/"+n},Q0={},Z1=function(s,i,r){let o=Promise.resolve();if(i&&i.length>0){let h=function(y){return Promise.all(y.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),p=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(i.map(y=>{if(y=K1(y),y in Q0)return;Q0[y]=!0;const b=y.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=b?"stylesheet":X1,b||(S.as="script"),S.crossOrigin="",S.href=y,p&&S.setAttribute("nonce",p),document.head.appendChild(S),b)return new Promise((j,R)=>{S.addEventListener("load",j),S.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return o.then(h=>{for(const g of h||[])g.status==="rejected"&&f(g.reason);return s().catch(f)})},J1=W.lazy(()=>Z1(()=>import("./index-DofvSOmX.js"),[]));function _r({value:n,language:s="json",height:i="400px"}){return m.jsx(W.Suspense,{fallback:m.jsx("div",{className:"flex items-center justify-center rounded-lg bg-gray-900 p-8 text-gray-500",children:"Loading editor..."}),children:m.jsx(J1,{height:i,language:s,value:n,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",wordWrap:"on",padding:{top:12}}})})}function Kf(n){for(const s of n){if(s.type==="file")return s.path;if(s.children){const i=Kf(s.children);if(i)return i}}return null}function P1({eval:n,runId:s}){const[i,r]=W.useState("steps"),o=[{id:"steps",label:"Steps"},{id:"output",label:"Output"},{id:"task",label:"Task"}];return m.jsxs("div",{className:"space-y-6",children:[m.jsx("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-lg font-medium",children:n.testId}),m.jsxs("p",{className:"mt-1 text-sm text-gray-400",children:[n.target&&m.jsxs("span",{children:["Target: ",n.target]}),n.durationMs!=null&&m.jsxs("span",{className:"ml-4",children:[(n.durationMs/1e3).toFixed(1),"s"]}),n.costUsd!=null&&m.jsxs("span",{className:"ml-4",children:["$",n.costUsd.toFixed(4)]})]})]}),m.jsx("div",{className:"w-48",children:m.jsx(qa,{score:n.score})})]})}),n.scores&&n.scores.length>0&&m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("h4",{className:"mb-3 text-sm font-medium text-gray-400",children:"Evaluator Scores"}),m.jsx("div",{className:"space-y-3",children:n.scores.map((f,h)=>m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("span",{className:"w-40 truncate text-sm text-gray-300",children:f.name??f.type??`Score ${h+1}`}),m.jsx("div",{className:"flex-1",children:m.jsx(qa,{score:f.score})})]},`${f.name??f.type??h}`))})]}),m.jsx("div",{className:"border-b border-gray-800",children:m.jsx("div",{className:"flex gap-1",children:o.map(f=>m.jsx("button",{type:"button",onClick:()=>r(f.id),className:`px-4 py-2 text-sm font-medium transition-colors ${i===f.id?"border-b-2 border-cyan-400 text-cyan-400":"text-gray-400 hover:text-gray-300"}`,children:f.label},f.id))})}),m.jsxs("div",{children:[i==="steps"&&m.jsx(k1,{result:n}),i==="output"&&m.jsx(F1,{result:n,runId:s}),i==="task"&&m.jsx($1,{result:n,runId:s})]}),m.jsx(G1,{testId:n.testId})]})}function k1({result:n}){const s=n.assertions??[],i=n.score<1||n.executionStatus==="error"||n.executionStatus==="failed",r=[];n.error&&r.push(n.error),(n.executionStatus==="error"||n.executionStatus==="failed")&&r.push(`Execution status: ${n.executionStatus}`);const o=s.filter(f=>!f.passed);for(const f of o){const h=f.evidence?`${f.text}: ${f.evidence}`:f.text;r.push(h)}if(n.scores)for(const f of n.scores){if(f.score<1&&f.details){const h=typeof f.details=="string"?f.details:JSON.stringify(f.details,null,2);r.push(`[${f.name??f.type??"evaluator"}] ${h}`)}if(f.assertions){for(const h of f.assertions)if(!h.passed){const g=h.evidence?`${h.text}: ${h.evidence}`:h.text;r.includes(g)||r.push(g)}}}return m.jsxs("div",{className:"space-y-4",children:[s.length===0&&m.jsx("p",{className:"text-sm text-gray-500",children:"No assertion steps recorded."}),s.length>0&&m.jsx("div",{className:"space-y-2",children:s.map(f=>m.jsxs("div",{className:`flex items-start gap-3 rounded-lg border p-3 ${f.passed?"border-emerald-900/50 bg-emerald-950/20":"border-red-900/50 bg-red-950/20"}`,children:[m.jsx("span",{className:`mt-0.5 text-lg ${f.passed?"text-emerald-400":"text-red-400"}`,children:f.passed?"✓":"✗"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("p",{className:"text-sm text-gray-200",children:[f.text,f.durationMs!=null&&m.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:["(",(f.durationMs/1e3).toFixed(1),"s)"]})]}),f.evidence&&m.jsx("p",{className:"mt-1 text-xs text-gray-400",children:f.evidence})]})]},`${f.text}-${f.passed}`))}),i&&r.length>0&&m.jsxs("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 p-4",children:[m.jsx("h4",{className:"mb-2 text-sm font-medium text-red-400",children:"Failure Reason"}),m.jsx("div",{className:"space-y-2",children:r.map(f=>m.jsx("p",{className:"text-sm text-gray-300",children:f},f))})]})]})}function F1({result:n,runId:s}){const i=n.testId,{data:r}=Bg(s,i),o=(r==null?void 0:r.files)??[],f=o.length>0,[h,g]=W.useState(null),p=h??(f?Kf(o):null),{data:y,isLoading:b}=Hg(s,i,p??""),v=n.output,S=v&&v.length>0?v.map(M=>`[${M.role}]
65
+ */var w0;function ES(){if(w0)return lf;w0=1;var n=qi(),s=_S();function i(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var r=typeof Object.is=="function"?Object.is:i,o=s.useSyncExternalStore,f=n.useRef,h=n.useEffect,g=n.useMemo,p=n.useDebugValue;return lf.useSyncExternalStoreWithSelector=function(y,b,v,S,j){var R=f(null);if(R.current===null){var M={hasValue:!1,value:null};R.current=M}else M=R.current;R=g(function(){function U($){if(!P){if(P=!0,K=$,$=S($),j!==void 0&&M.hasValue){var Z=M.value;if(j(Z,$))return L=Z}return L=$}if(Z=L,r(K,$))return Z;var J=S($);return j!==void 0&&j(Z,J)?(K=$,Z):(K=$,L=J)}var P=!1,K,L,X=v===void 0?null:v;return[function(){return U(b())},X===null?void 0:function(){return U(X())}]},[b,v,S,j]);var C=o(y,R[0],R[1]);return h(function(){M.hasValue=!0,M.value=C},[C]),p(C),C},lf}var U0;function NS(){return U0||(U0=1,nf.exports=ES()),nf.exports}var TS=NS();function MS(n,s){return n===s}function he(n,s,i=MS){const r=W.useCallback(h=>{if(!n)return()=>{};const{unsubscribe:g}=n.subscribe(h);return g},[n]),o=W.useCallback(()=>n==null?void 0:n.get(),[n]);return TS.useSyncExternalStoreWithSelector(r,o,o,s,i)}var CS={state:void 0,get:()=>{},subscribe:()=>()=>{}};function hl(n){const s=pe(),i=W.useContext(n.from?gS:Tr),r=n.from??i,o=r?n.from?s.stores.getMatchStoreByRouteId(r):s.stores.activeMatchStoresById.get(r):void 0,f=W.useRef(void 0);return he(o??CS,h=>{if((n.shouldThrow??!0)&&!h&&Ba(),h===void 0)return;const g=n.select?n.select(h):h;if(n.structuralSharing??s.options.defaultStructuralSharing){const p=En(f.current,g);return f.current=p,p}return g})}function Mg(n){return hl({from:n.from,strict:n.strict,structuralSharing:n.structuralSharing,select:s=>n.select?n.select(s.loaderData):s.loaderData})}function Cg(n){const{select:s,...i}=n;return hl({...i,select:r=>s?s(r.loaderDeps):r.loaderDeps})}function Ag(n){return hl({from:n.from,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,strict:n.strict,select:s=>{const i=n.strict===!1?s.params:s._strictParams;return n.select?n.select(i):i}})}function Og(n){return hl({from:n.from,strict:n.strict,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,select:s=>n.select?n.select(s.search):s.search})}function Gf(n){const s=pe();return W.useCallback(i=>s.navigate({...i,from:i.from??(n==null?void 0:n.from)}),[n==null?void 0:n.from,s])}function zg(n){return hl({...n,select:s=>n.select?n.select(s.context):s.context})}var AS=I0();function OS(n,s){const i=pe(),r=fb(s),{activeProps:o,inactiveProps:f,activeOptions:h,to:g,preload:p,preloadDelay:y,hashScrollIntoView:b,replace:v,startTransition:S,resetScroll:j,viewTransition:R,children:M,target:C,disabled:U,style:P,className:K,onClick:L,onBlur:X,onFocus:$,onMouseEnter:Z,onMouseLeave:J,onTouchStart:k,ignoreBlocker:G,params:F,search:st,hash:it,state:ot,mask:nt,reloadDocument:D,unsafeRelative:V,from:at,_fromLocation:yt,...ft}=n,N=Rg(),Q=W.useMemo(()=>n,[i,n.from,n._fromLocation,n.hash,n.to,n.search,n.params,n.state,n.mask,n.unsafeRelative]),I=he(i.stores.location,St=>St,(St,oe)=>St.href===oe.href),tt=W.useMemo(()=>{const St={_fromLocation:I,...Q};return i.buildLocation(St)},[i,I,Q]),ht=tt.maskedLocation?tt.maskedLocation.publicHref:tt.publicHref,xt=tt.maskedLocation?tt.maskedLocation.external:tt.external,bt=W.useMemo(()=>BS(ht,xt,i.history,U),[U,xt,ht,i.history]),Jt=W.useMemo(()=>{if(bt!=null&&bt.external)return pr(bt.href,i.protocolAllowlist)?void 0:bt.href;if(!HS(g)&&!(typeof g!="string"||g.indexOf(":")===-1))try{return new URL(g),pr(g,i.protocolAllowlist)?void 0:g}catch{}},[g,bt,i.protocolAllowlist]),Ht=W.useMemo(()=>{if(Jt)return!1;if(h!=null&&h.exact){if(!Cb(I.pathname,tt.pathname,i.basepath))return!1}else{const St=xr(I.pathname,i.basepath),oe=xr(tt.pathname,i.basepath);if(!(St.startsWith(oe)&&(St.length===oe.length||St[oe.length]==="/")))return!1}return((h==null?void 0:h.includeSearch)??!0)&&!cl(I.search,tt.search,{partial:!(h!=null&&h.exact),ignoreUndefined:!(h!=null&&h.explicitUndefined)})?!1:h!=null&&h.includeHash?N&&I.hash===tt.hash:!0},[h==null?void 0:h.exact,h==null?void 0:h.explicitUndefined,h==null?void 0:h.includeHash,h==null?void 0:h.includeSearch,I,Jt,N,tt.hash,tt.pathname,tt.search,i.basepath]),aa=Ht?_n(o,{})??zS:rf,da=Ht?rf:_n(f,{})??rf,yl=[K,aa.className,da.className].filter(Boolean).join(" "),js=(P||aa.style||da.style)&&{...P,...aa.style,...da.style},[ha,gl]=W.useState(!1),vl=W.useRef(!1),Qa=n.reloadDocument||Jt?!1:p??i.options.defaultPreload,pl=y??i.options.defaultPreloadDelay??0,$e=W.useCallback(()=>{i.preloadRoute({...Q,_builtLocation:tt}).catch(St=>{console.warn(St),console.warn(oS)})},[i,Q,tt]);ob(r,W.useCallback(St=>{St!=null&&St.isIntersecting&&$e()},[$e]),LS,{disabled:!!U||Qa!=="viewport"}),W.useEffect(()=>{vl.current||!U&&Qa==="render"&&($e(),vl.current=!0)},[U,$e,Qa]);const _s=St=>{const oe=St.currentTarget.getAttribute("target"),na=C!==void 0?C:oe;if(!U&&!qS(St)&&!St.defaultPrevented&&(!na||na==="_self")&&St.button===0){St.preventDefault(),AS.flushSync(()=>{gl(!0)});const Gi=i.subscribe("onResolved",()=>{Gi(),gl(!1)});i.navigate({...Q,replace:v,resetScroll:j,hashScrollIntoView:b,startTransition:S,viewTransition:R,ignoreBlocker:G})}};if(Jt)return{...ft,ref:r,href:Jt,...M&&{children:M},...C&&{target:C},...U&&{disabled:U},...P&&{style:P},...K&&{className:K},...L&&{onClick:L},...X&&{onBlur:X},...$&&{onFocus:$},...Z&&{onMouseEnter:Z},...J&&{onMouseLeave:J},...k&&{onTouchStart:k}};const xl=St=>{if(U||Qa!=="intent")return;if(!pl){$e();return}const oe=St.currentTarget;if(ji.has(oe))return;const na=setTimeout(()=>{ji.delete(oe),$e()},pl);ji.set(oe,na)},Mr=St=>{U||Qa!=="intent"||$e()},Yi=St=>{if(U||!Qa||!pl)return;const oe=St.currentTarget,na=ji.get(oe);na&&(clearTimeout(na),ji.delete(oe))};return{...ft,...aa,...da,href:bt==null?void 0:bt.href,ref:r,onClick:ls([L,_s]),onBlur:ls([X,Yi]),onFocus:ls([$,xl]),onMouseEnter:ls([Z,xl]),onMouseLeave:ls([J,Yi]),onTouchStart:ls([k,Mr]),disabled:!!U,target:C,...js&&{style:js},...yl&&{className:yl},...U&&DS,...Ht&&wS,...N&&ha&&US}}var rf={},zS={className:"active"},DS={role:"link","aria-disabled":!0},wS={"data-status":"active","aria-current":"page"},US={"data-transitioning":"transitioning"},ji=new WeakMap,LS={rootMargin:"100px"},ls=n=>s=>{for(const i of n)if(i){if(s.defaultPrevented)return;i(s)}};function BS(n,s,i,r){if(!r)return s?{href:n,external:!0}:{href:i.createHref(n)||"/",external:!1}}function HS(n){if(typeof n!="string")return!1;const s=n.charCodeAt(0);return s===47?n.charCodeAt(1)!==47:s===46}var Vt=W.forwardRef((n,s)=>{const{_asChild:i,...r}=n,{type:o,...f}=OS(r,s),h=typeof r.children=="function"?r.children({isActive:f["data-status"]==="active"}):r.children;if(!i){const{disabled:g,...p}=f;return W.createElement("a",p,h)}return W.createElement(i,f,h)});function qS(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}var QS=class extends Sg{constructor(s){super(s),this.useMatch=i=>hl({select:i==null?void 0:i.select,from:this.id,structuralSharing:i==null?void 0:i.structuralSharing}),this.useRouteContext=i=>zg({...i,from:this.id}),this.useSearch=i=>Og({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useParams=i=>Ag({select:i==null?void 0:i.select,structuralSharing:i==null?void 0:i.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Cg({...i,from:this.id}),this.useLoaderData=i=>Mg({...i,from:this.id}),this.useNavigate=()=>Gf({from:this.fullPath}),this.Link=Ti.forwardRef((i,r)=>m.jsx(Vt,{ref:r,from:this.fullPath,...i}))}};function YS(n){return new QS(n)}var GS=class extends fS{constructor(n){super(n),this.useMatch=s=>hl({select:s==null?void 0:s.select,from:this.id,structuralSharing:s==null?void 0:s.structuralSharing}),this.useRouteContext=s=>zg({...s,from:this.id}),this.useSearch=s=>Og({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useParams=s=>Ag({select:s==null?void 0:s.select,structuralSharing:s==null?void 0:s.structuralSharing,from:this.id}),this.useLoaderDeps=s=>Cg({...s,from:this.id}),this.useLoaderData=s=>Mg({...s,from:this.id}),this.useNavigate=()=>Gf({from:this.fullPath}),this.Link=Ti.forwardRef((s,i)=>m.jsx(Vt,{ref:i,from:this.fullPath,...s}))}};function VS(n){return new GS(n)}function Rs(n){return typeof n=="object"?new L0(n,{silent:!0}).createRoute(n):new L0(n,{silent:!0}).createRoute}var L0=class{constructor(n,s){this.path=n,this.createRoute=i=>{const r=YS(i);return r.isRoot=!1,r},this.silent=s==null?void 0:s.silent}};function XS(n){const s=pe(),i=`not-found-${he(s.stores.location,r=>r.pathname)}-${he(s.stores.status,r=>r)}`;return m.jsx(qf,{getResetKey:()=>i,onCatch:(r,o)=>{var f;if(ve(r))(f=n.onCatch)==null||f.call(n,r,o);else throw r},errorComponent:({error:r})=>{var o;if(ve(r))return(o=n.fallback)==null?void 0:o.call(n,r);throw r},children:n.children})}function KS(){return m.jsx("p",{children:"Not Found"})}function ss(n){return m.jsx(m.Fragment,{children:n.children})}function Dg(n,s,i){return s.options.notFoundComponent?m.jsx(s.options.notFoundComponent,{...i}):n.options.defaultNotFoundComponent?m.jsx(n.options.defaultNotFoundComponent,{...i}):m.jsx(KS,{})}function ZS(n){return null}function JS(){return ZS(pe()),null}var wg=W.memo(function({matchId:s}){const i=pe(),r=i.stores.activeMatchStoresById.get(s);r||Ba();const o=he(i.stores.loadedAt,h=>h),f=he(r,h=>h);return m.jsx(PS,{router:i,matchId:s,resetKey:o,matchState:W.useMemo(()=>{var p;const h=f.routeId,g=(p=i.routesById[h].parentRoute)==null?void 0:p.id;return{routeId:h,ssr:f.ssr,_displayPending:f._displayPending,parentRouteId:g}},[f._displayPending,f.routeId,f.ssr,i.routesById])})});function PS({router:n,matchId:s,resetKey:i,matchState:r}){var R,M;const o=n.routesById[r.routeId],f=o.options.pendingComponent??n.options.defaultPendingComponent,h=f?m.jsx(f,{}):null,g=o.options.errorComponent??n.options.defaultErrorComponent,p=o.options.onCatch??n.options.defaultOnCatch,y=o.isRoot?o.options.notFoundComponent??((R=n.options.notFoundRoute)==null?void 0:R.options.component):o.options.notFoundComponent,b=r.ssr===!1||r.ssr==="data-only",v=(!o.isRoot||o.options.wrapInSuspense||b)&&(o.options.wrapInSuspense??f??(((M=o.options.errorComponent)==null?void 0:M.preload)||b))?W.Suspense:ss,S=g?qf:ss,j=y?XS:ss;return m.jsxs(o.isRoot?o.options.shellComponent??ss:ss,{children:[m.jsx(Tr.Provider,{value:s,children:m.jsx(v,{fallback:h,children:m.jsx(S,{getResetKey:()=>i,errorComponent:g||Qf,onCatch:(C,U)=>{if(ve(C))throw C;p==null||p(C,U)},children:m.jsx(j,{fallback:C=>{if(!y||C.routeId&&C.routeId!==r.routeId||!C.routeId&&!o.isRoot)throw C;return W.createElement(y,C)},children:b||r._displayPending?m.jsx(mS,{fallback:h,children:m.jsx(B0,{matchId:s})}):m.jsx(B0,{matchId:s})})})})}),r.parentRouteId===ol?m.jsxs(m.Fragment,{children:[m.jsx(kS,{resetKey:i}),n.options.scrollRestoration&&fg?m.jsx(JS,{}):null]}):null]})}function kS({resetKey:n}){const s=pe(),i=W.useRef(void 0);return Ni(()=>{const r=s.latestLocation.href;(i.current===void 0||i.current!==r)&&(s.emit({type:"onRendered",...is(s.stores.location.state,s.stores.resolvedLocation.state)}),i.current=r)},[s.latestLocation.state.__TSR_key,n,s]),null}var B0=W.memo(function({matchId:s}){var y,b,v,S;const i=pe(),r=i.stores.activeMatchStoresById.get(s);r||Ba();const o=he(r,j=>j),f=o.routeId,h=i.routesById[f],g=W.useMemo(()=>{var R;const j=(R=i.routesById[f].options.remountDeps??i.options.defaultRemountDeps)==null?void 0:R({routeId:f,loaderDeps:o.loaderDeps,params:o._strictParams,search:o._strictSearch});return j?JSON.stringify(j):void 0},[f,o.loaderDeps,o._strictParams,o._strictSearch,i.options.defaultRemountDeps,i.routesById]),p=W.useMemo(()=>{const j=h.options.component??i.options.defaultComponent;return j?m.jsx(j,{},g):m.jsx(Ug,{})},[g,h.options.component,i.options.defaultComponent]);if(o._displayPending)throw(y=i.getMatch(o.id))==null?void 0:y._nonReactive.displayPendingPromise;if(o._forcePending)throw(b=i.getMatch(o.id))==null?void 0:b._nonReactive.minPendingPromise;if(o.status==="pending"){const j=h.options.pendingMinMs??i.options.defaultPendingMinMs;if(j){const R=i.getMatch(o.id);if(R&&!R._nonReactive.minPendingPromise){const M=bs();R._nonReactive.minPendingPromise=M,setTimeout(()=>{M.resolve(),R._nonReactive.minPendingPromise=void 0},j)}}throw(v=i.getMatch(o.id))==null?void 0:v._nonReactive.loadPromise}if(o.status==="notFound")return ve(o.error)||Ba(),Dg(i,h,o.error);if(o.status==="redirected")throw Me(o.error)||Ba(),(S=i.getMatch(o.id))==null?void 0:S._nonReactive.loadPromise;if(o.status==="error")throw o.error;return p}),Ug=W.memo(function(){const s=pe(),i=W.useContext(Tr);let r,o=!1,f;{const y=i?s.stores.activeMatchStoresById.get(i):void 0;[r,o]=he(y,b=>[b==null?void 0:b.routeId,(b==null?void 0:b.globalNotFound)??!1]),f=he(s.stores.matchesId,b=>b[b.findIndex(v=>v===i)+1])}const h=r?s.routesById[r]:void 0,g=s.options.defaultPendingComponent?m.jsx(s.options.defaultPendingComponent,{}):null;if(o)return h||Ba(),Dg(s,h,void 0);if(!f)return null;const p=m.jsx(wg,{matchId:f});return r===ol?m.jsx(W.Suspense,{fallback:g,children:p}):p});function FS(){const n=pe(),s=W.useRef({router:n,mounted:!1}),[i,r]=W.useState(!1),o=he(n.stores.isLoading,v=>v),f=he(n.stores.hasPendingMatches,v=>v),h=ko(o),g=o||i||f,p=ko(g),y=o||f,b=ko(y);return n.startTransition=v=>{r(!0),W.startTransition(()=>{v(),r(!1)})},W.useEffect(()=>{const v=n.history.subscribe(n.load),S=n.buildLocation({to:n.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Mn(n.latestLocation.publicHref)!==Mn(S.publicHref)&&n.commitLocation({...S,replace:!0}),()=>{v()}},[n,n.history]),Ni(()=>{if(typeof window<"u"&&n.ssr||s.current.router===n&&s.current.mounted)return;s.current={router:n,mounted:!0},(async()=>{try{await n.load()}catch(S){console.error(S)}})()},[n]),Ni(()=>{h&&!o&&n.emit({type:"onLoad",...is(n.stores.location.state,n.stores.resolvedLocation.state)})},[h,n,o]),Ni(()=>{b&&!y&&n.emit({type:"onBeforeRouteMount",...is(n.stores.location.state,n.stores.resolvedLocation.state)})},[y,b,n]),Ni(()=>{if(p&&!g){const v=is(n.stores.location.state,n.stores.resolvedLocation.state);n.emit({type:"onResolved",...v}),Eg(()=>{n.stores.status.setState(()=>"idle"),n.stores.resolvedLocation.setState(()=>n.stores.location.state)}),v.hrefChanged&&dS(n)}},[g,p,n]),null}function $S(){const n=pe(),s=n.routesById[ol].options.pendingComponent??n.options.defaultPendingComponent,i=s?m.jsx(s,{}):null,r=m.jsxs(typeof document<"u"&&n.ssr?ss:W.Suspense,{fallback:i,children:[m.jsx(FS,{}),m.jsx(IS,{})]});return n.options.InnerWrap?m.jsx(n.options.InnerWrap,{children:r}):r}function IS(){const n=pe(),s=he(n.stores.firstMatchId,o=>o),i=he(n.stores.loadedAt,o=>o),r=s?m.jsx(wg,{matchId:s}):null;return m.jsx(Tr.Provider,{value:s,children:n.options.disableGlobalCatchBoundary?r:m.jsx(qf,{getResetKey:()=>i,errorComponent:Qf,onCatch:void 0,children:r})})}function Lg(){const n=pe();return he(n.stores.matchRouteReactivity,s=>s),W.useCallback(s=>{const{pending:i,caseSensitive:r,fuzzy:o,includeSearch:f,...h}=s;return n.matchRoute(h,{pending:i,caseSensitive:r,fuzzy:o,includeSearch:f})},[n])}function WS(n){const s=pe(),i=W.useRef(void 0);return he(s.stores.activeMatchesSnapshot,r=>{const o=r;if(s.options.defaultStructuralSharing){const f=En(i.current,o);return i.current=f,f}return o})}var t1=n=>({createMutableStore:O0,createReadonlyStore:O0,batch:Eg}),e1=n=>new a1(n),a1=class extends nS{constructor(n){super(n,t1)}};function n1({router:n,children:s,...i}){Object.keys(i).length>0&&n.update({...n.options,...i,context:{...n.options.context,...i.context}});const r=m.jsx(jg.Provider,{value:n,children:s});return n.options.Wrap?m.jsx(n.options.Wrap,{children:r}):r}function l1({router:n,...s}){return m.jsx(n1,{router:n,...s,children:m.jsx($S,{})})}function s1(n){const i=pe();return W.useRef(void 0),he(i.stores.__store,r=>r)}function i1(n){const s=[];for(let i=1;i<n.length;i++){const r=n[i],o=r.routeId??r.id,f=r.params;o==="/"||o==="/_layout"||(o.includes("/runs/$runId/category/$category")?(s.some(h=>h.label===f.runId)||s.push({label:f.runId??"Run",to:`/runs/${encodeURIComponent(f.runId)}`}),s.push({label:f.category??"Category",to:r.pathname})):o.includes("/runs/$runId/dataset/$dataset")?s.push({label:f.dataset??"Dataset",to:r.pathname}):o.includes("/runs/$runId")?s.push({label:f.runId??"Run",to:r.pathname}):o.includes("/evals/$runId/$evalId")?(s.some(h=>h.label===f.runId)||s.push({label:f.runId??"Run",to:`/runs/${encodeURIComponent(f.runId)}`}),s.push({label:f.evalId??"Eval",to:r.pathname})):o.includes("/experiments/$experimentName")?s.push({label:f.experimentName??"Experiment",to:r.pathname}):(o==="/index"||o==="/")&&s.push({label:"Home",to:"/"}))}return s}function u1(){const n=WS(),s=i1(n);return s.length===0?null:m.jsxs("div",{className:"flex items-center gap-2 border-b border-gray-800 bg-gray-950 px-6 py-2 text-sm",children:[m.jsx(Vt,{to:"/",className:"text-cyan-400 hover:text-cyan-300 hover:underline",children:"Home"}),s.map((i,r)=>{const o=r===s.length-1;return m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-gray-600",children:">"}),o?m.jsx("span",{className:"text-gray-400",children:i.label}):m.jsx(Vt,{to:i.to??"/",className:"text-cyan-400 hover:text-cyan-300 hover:underline",children:i.label})]},`${i.label}-${r}`)})]})}async function On(n){const s=await fetch(n);if(!s.ok)throw new Error(`API error: ${s.status} ${s.statusText}`);return s.json()}const r1={queryKey:["runs"],queryFn:()=>On("/api/runs"),refetchInterval:5e3};function c1(n){return{queryKey:["runs",n],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}`),enabled:!!n}}const o1={queryKey:["feedback"],queryFn:()=>On("/api/feedback")},f1={queryKey:["experiments"],queryFn:()=>On("/api/experiments")},d1={queryKey:["targets"],queryFn:()=>On("/api/targets")};function h1(n,s){return{queryKey:["runs",n,"evals",s,"files"],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}/evals/${encodeURIComponent(s)}/files`),enabled:!!n&&!!s}}function m1(n,s,i){return{queryKey:["runs",n,"evals",s,"files",i],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}/evals/${encodeURIComponent(s)}/files/${i}`),enabled:!!n&&!!s&&!!i}}function y1(n,s){return{queryKey:["runs",n,"categories",s,"datasets"],queryFn:()=>On(`/api/runs/${encodeURIComponent(n)}/categories/${encodeURIComponent(s)}/datasets`),enabled:!!n&&!!s}}function Vf(){return An(r1)}function Qi(n){return An(c1(n))}function g1(){return An(o1)}function Xf(){return An(f1)}function v1(){return An(d1)}function Bg(n,s){return An(h1(n,s))}function Hg(n,s,i){return An(m1(n,s,i))}function qg(n,s){return An(y1(n,s))}function p1(){const n=Lg(),s=n({to:"/evals/$runId/$evalId",fuzzy:!0}),i=n({to:"/runs/$runId/category/$category",fuzzy:!0}),r=n({to:"/runs/$runId/dataset/$dataset",fuzzy:!0}),o=n({to:"/experiments/$experimentName",fuzzy:!0});if(i&&typeof i=="object"&&"runId"in i){const{runId:f,category:h}=i;return m.jsx(R1,{runId:f,category:h})}if(r&&typeof r=="object"&&"runId"in r){const{runId:f,dataset:h}=r;return m.jsx(S1,{runId:f,dataset:h})}if(s&&typeof s=="object"&&"runId"in s){const{runId:f,evalId:h}=s;return m.jsx(b1,{runId:f,currentEvalId:h})}if(o&&typeof o=="object"&&"experimentName"in o){const{experimentName:f}=o;return m.jsx(j1,{currentExperiment:f})}return m.jsx(x1,{})}function x1(){const n=Lg(),{data:s}=Vf(),i=n({to:"/"}),r=n({to:"/runs/$runId",fuzzy:!0});return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Runs"}),s==null?void 0:s.runs.map(o=>{const f=i===!1&&r&&typeof r=="object"&&"runId"in r&&r.runId===o.filename;return m.jsx(Vt,{to:"/runs/$runId",params:{runId:o.filename},className:`mb-0.5 block truncate rounded-md px-2 py-1.5 text-sm transition-colors ${f?"bg-gray-800 text-cyan-400":"text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,children:o.filename},o.filename)})]})]})}function b1({runId:n,currentEvalId:s}){const{data:i}=Qi(n);return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("div",{className:"border-b border-gray-800 px-4 py-2",children:[m.jsx(Vt,{to:"/runs/$runId",params:{runId:n},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← Back to run"}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-300",children:n})]}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Evaluations"}),i==null?void 0:i.results.map(r=>{const o=r.testId===s,f=r.score>=1;return m.jsxs(Vt,{to:"/evals/$runId/$evalId",params:{runId:n,evalId:r.testId},className:`mb-0.5 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors ${o?"bg-gray-800 text-cyan-400":"text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,children:[m.jsx("span",{className:`text-xs ${f?"text-emerald-400":"text-red-400"}`,children:f?"✓":"✗"}),m.jsx("span",{className:"truncate",children:r.testId})]},r.testId)})]})]})}function S1({runId:n,dataset:s}){const{data:i}=Qi(n),r=((i==null?void 0:i.results)??[]).filter(o=>(o.dataset??"Uncategorized")===s);return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("div",{className:"border-b border-gray-800 px-4 py-2",children:[m.jsx(Vt,{to:"/runs/$runId",params:{runId:n},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← Back to run"}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-300",children:n}),m.jsx("p",{className:"truncate text-xs text-gray-500",children:s})]}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Evaluations"}),r.map(o=>{const f=o.score>=1;return m.jsxs(Vt,{to:"/evals/$runId/$evalId",params:{runId:n,evalId:o.testId},className:"mb-0.5 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-gray-400 transition-colors hover:bg-gray-800/50 hover:text-gray-200",children:[m.jsx("span",{className:`text-xs ${f?"text-emerald-400":"text-red-400"}`,children:f?"✓":"✗"}),m.jsx("span",{className:"truncate",children:o.testId})]},o.testId)})]})]})}function R1({runId:n,category:s}){const{data:i}=qg(n,s),r=(i==null?void 0:i.datasets)??[];return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsxs("div",{className:"border-b border-gray-800 px-4 py-2",children:[m.jsx(Vt,{to:"/runs/$runId",params:{runId:n},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← Back to run"}),m.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-300",children:n}),m.jsx("p",{className:"truncate text-xs text-gray-500",children:s})]}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Datasets"}),r.map(o=>m.jsxs(Vt,{to:"/runs/$runId/dataset/$dataset",params:{runId:n,dataset:o.name},className:"mb-0.5 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-gray-400 transition-colors hover:bg-gray-800/50 hover:text-gray-200",children:[m.jsx("span",{className:`text-xs ${o.passed===o.total?"text-emerald-400":"text-red-400"}`,children:o.passed===o.total?"✓":"✗"}),m.jsx("span",{className:"truncate",children:o.name})]},o.name))]})]})}function j1({currentExperiment:n}){const{data:s}=Xf(),i=(s==null?void 0:s.experiments)??[];return m.jsxs("aside",{className:"flex w-64 flex-col border-r border-gray-800 bg-gray-900/50",children:[m.jsx("div",{className:"flex items-center gap-2 border-b border-gray-800 px-4 py-4",children:m.jsx(Vt,{to:"/",className:"text-lg font-semibold text-white hover:text-cyan-400",children:"AgentV Studio"})}),m.jsx("div",{className:"border-b border-gray-800 px-4 py-2",children:m.jsx(Vt,{to:"/",search:{tab:"experiments"},className:"text-xs text-gray-400 hover:text-cyan-400",children:"← All experiments"})}),m.jsxs("nav",{className:"flex-1 overflow-y-auto px-2 py-3",children:[m.jsx("div",{className:"mb-2 px-2 text-xs font-medium uppercase tracking-wider text-gray-500",children:"Experiments"}),i.map(r=>{const o=r.name===n;return m.jsx(Vt,{to:"/experiments/$experimentName",params:{experimentName:r.name},className:`mb-0.5 block truncate rounded-md px-2 py-1.5 text-sm transition-colors ${o?"bg-gray-800 text-cyan-400":"text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,children:r.name},r.name)})]})]})}function _1(){return m.jsxs("div",{className:"flex h-screen overflow-hidden",children:[m.jsx(p1,{}),m.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[m.jsx(u1,{}),m.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:m.jsx(Ug,{})})]})]})}const ml=VS({component:_1});function qa({score:n,className:s=""}){const i=Math.round(Math.max(0,Math.min(1,n))*100);return m.jsxs("div",{className:`flex items-center gap-3 ${s}`,children:[m.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-gray-800",children:m.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-cyan-400 to-blue-500 transition-all duration-300",style:{width:`${i}%`}})}),m.jsxs("span",{className:"w-12 text-right text-sm font-medium tabular-nums text-gray-300",children:[i,"%"]})]})}function E1(){const{data:n,isLoading:s}=Xf();if(s)return m.jsx(T1,{});const i=(n==null?void 0:n.experiments)??[];return i.length===0?m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No experiments found"}),m.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Experiments will appear here once evaluations are run with experiment labels."})]}):m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Experiment"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Runs"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Targets"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",children:"Pass Rate"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Last Run"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:i.map(r=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3",children:m.jsx(Vt,{to:"/experiments/$experimentName",params:{experimentName:r.name},className:"font-medium text-cyan-400 hover:text-cyan-300 hover:underline",children:r.name})}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.run_count}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.target_count}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:r.pass_rate})}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:N1(r.last_run)})]},r.name))})]})})}function N1(n){if(!n)return"N/A";try{const s=new Date(n);return Number.isNaN(s.getTime())?"N/A":s.toLocaleString()}catch{return"N/A"}}function T1(){return m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("div",{className:"animate-pulse",children:[m.jsx("div",{className:"border-b border-gray-800 bg-gray-900/50 px-4 py-3",children:m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"})}),["sk-1","sk-2","sk-3","sk-4","sk-5"].map(n=>m.jsxs("div",{className:"flex gap-4 border-b border-gray-800/50 px-4 py-3",children:[m.jsx("div",{className:"h-4 w-32 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-24 rounded bg-gray-800"})]},n))]})})}function M1(n){if(!n)return"N/A";try{const s=new Date(n);return Number.isNaN(s.getTime())?"N/A":s.toLocaleString()}catch{return"N/A"}}function Qg({runs:n}){return n.length===0?m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No evaluation runs found."}),m.jsxs("p",{className:"mt-2 text-sm text-gray-500",children:["Run an evaluation first:"," ",m.jsx("code",{className:"rounded bg-gray-800 px-2 py-1 text-cyan-400",children:"agentv eval <eval-file>"})]})]}):m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Run"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Target"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Experiment"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Timestamp"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Tests"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",title:"Percentage of tests with a perfect score (1.0)",children:"Tests Passing"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",title:"Mean score across all tests (0-100%)",children:"Mean Score"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:n.map(s=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3",children:m.jsx(Vt,{to:"/runs/$runId",params:{runId:s.filename},className:"font-medium text-cyan-400 hover:text-cyan-300 hover:underline",children:s.filename})}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:s.target??"-"}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:s.experiment??"-"}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:M1(s.timestamp)}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums",children:s.test_count}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:s.pass_rate})}),m.jsxs("td",{className:"px-4 py-3 text-right tabular-nums",children:[(s.avg_score*100).toFixed(1),"%"]})]},s.filename))})]})})}function C1(){const{data:n,isLoading:s}=v1();if(s)return m.jsx(A1,{});const i=(n==null?void 0:n.targets)??[];return i.length===0?m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No targets found"}),m.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Targets will appear here once evaluations are run with target labels."})]}):m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Target"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Runs"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Experiments"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",children:"Pass Rate"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Evals"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:i.map(r=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3 font-medium text-gray-200",children:r.name}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.run_count}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:r.experiment_count}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:r.pass_rate})}),m.jsxs("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:[m.jsx("span",{className:"text-emerald-400",children:r.passed_count}),m.jsx("span",{className:"text-gray-600",children:"/"}),m.jsx("span",{children:r.eval_count})]})]},r.name))})]})})}function A1(){return m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("div",{className:"animate-pulse",children:[m.jsx("div",{className:"border-b border-gray-800 bg-gray-900/50 px-4 py-3",children:m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"})}),["sk-1","sk-2","sk-3","sk-4","sk-5"].map(n=>m.jsxs("div",{className:"flex gap-4 border-b border-gray-800/50 px-4 py-3",children:[m.jsx("div",{className:"h-4 w-32 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-12 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-48 rounded bg-gray-800"}),m.jsx("div",{className:"h-4 w-20 rounded bg-gray-800"})]},n))]})})}const H0=[{id:"runs",label:"Recent Runs"},{id:"experiments",label:"Experiments"},{id:"targets",label:"Targets"}],O1=Rs("/")({component:z1});function z1(){const i=s1().location.search.tab,r=Gf(),{data:o,isLoading:f,error:h}=Vf(),g=H0.some(p=>p.id===i)?i:"runs";return m.jsxs("div",{className:"space-y-6",children:[m.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Evaluation Runs"}),m.jsx("div",{className:"border-b border-gray-800",children:m.jsx("div",{className:"flex gap-1",children:H0.map(p=>m.jsx("button",{type:"button",onClick:()=>r({to:"/",search:{tab:p.id}}),className:`px-4 py-2 text-sm font-medium transition-colors ${g===p.id?"border-b-2 border-cyan-400 text-cyan-400":"text-gray-400 hover:text-gray-300"}`,children:p.label},p.id))})}),g==="runs"&&m.jsx(D1,{data:o,isLoading:f,error:h}),g==="experiments"&&m.jsx(E1,{}),g==="targets"&&m.jsx(C1,{})]})}function D1({data:n,isLoading:s,error:i}){return s?m.jsx(w1,{}):i?m.jsxs("div",{className:"rounded-lg border border-red-900/50 bg-red-950/20 p-6 text-red-400",children:["Failed to load runs: ",i.message]}):m.jsx(Qg,{runs:(n==null?void 0:n.runs)??[]})}function w1(){return m.jsx("div",{className:"space-y-2",children:["s1","s2","s3","s4","s5"].map(n=>m.jsx("div",{className:"h-12 animate-pulse rounded-lg bg-gray-900"},n))})}function _i({label:n,value:s,accent:i}){return m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("p",{className:"text-sm text-gray-400",children:n}),m.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i??"text-white"}`,children:s})]})}function jr({total:n,passed:s,failed:i,passRate:r,totalCost:o}){return m.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-5",children:[m.jsx(_i,{label:"Total",value:String(n)}),m.jsx(_i,{label:"Passed",value:String(s),accent:"text-emerald-400"}),m.jsx(_i,{label:"Failed",value:String(i),accent:"text-red-400"}),m.jsx(_i,{label:"Pass Rate",value:`${Math.round(r*100)}%`,accent:"text-cyan-400"}),o!==void 0&&m.jsx(_i,{label:"Cost",value:`$${o.toFixed(4)}`,accent:"text-amber-400"})]})}function U1(n){const s=new Map;for(const i of n){const r=i.category??"Uncategorized",o=i.dataset??"Uncategorized";s.has(r)||s.set(r,new Map);const f=s.get(r),h=f.get(o)??{passed:0,failed:0,total:0,scoreSum:0};h.total+=1,h.scoreSum+=i.score,i.score>=1?h.passed+=1:h.failed+=1,f.set(o,h)}return Array.from(s.entries()).map(([i,r])=>{const o=Array.from(r.entries()).map(([y,b])=>({name:y,...b,avgScore:b.total>0?b.scoreSum/b.total:0})).sort((y,b)=>y.name.localeCompare(b.name)),f=o.reduce((y,b)=>y+b.total,0),h=o.reduce((y,b)=>y+b.passed,0),g=o.reduce((y,b)=>y+b.failed,0),p=o.reduce((y,b)=>y+b.avgScore*b.total,0);return{name:i,datasets:o,total:f,passed:h,failed:g,avgScore:f>0?p/f:0}}).sort((i,r)=>i.name.localeCompare(r.name))}function L1({results:n,runId:s}){var y;const i=n.length,r=n.filter(b=>b.score>=1).length,o=i-r,f=i>0?r/i:0,h=n.reduce((b,v)=>b+(v.costUsd??0),0),g=U1(n),p=g.length>1;return i===0?m.jsxs("div",{className:"space-y-6",children:[m.jsx(jr,{total:0,passed:0,failed:0,passRate:0}),m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-8 text-center",children:[m.jsx("p",{className:"text-lg text-gray-400",children:"No evaluations found"}),m.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"This run has no results yet."})]})]}):m.jsxs("div",{className:"space-y-6",children:[m.jsx(jr,{total:i,passed:r,failed:o,passRate:f,totalCost:h>0?h:void 0}),p?m.jsxs("div",{className:"space-y-4",children:[m.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Categories"}),g.map(b=>m.jsx(B1,{category:b,runId:s},b.name))]}):m.jsxs("div",{className:"space-y-3",children:[m.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Datasets"}),m.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:(y=g[0])==null?void 0:y.datasets.map(b=>m.jsx(Yg,{dataset:b,runId:s},b.name))})]}),m.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-800",children:m.jsxs("table",{className:"w-full text-left text-sm",children:[m.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Test ID"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Target"}),m.jsx("th",{className:"w-48 px-4 py-3 font-medium text-gray-400",children:"Score"}),m.jsx("th",{className:"px-4 py-3 font-medium text-gray-400",children:"Status"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Duration"}),m.jsx("th",{className:"px-4 py-3 text-right font-medium text-gray-400",children:"Cost"})]})}),m.jsx("tbody",{className:"divide-y divide-gray-800/50",children:n.map((b,v)=>m.jsxs("tr",{className:"transition-colors hover:bg-gray-900/30",children:[m.jsx("td",{className:"px-4 py-3",children:m.jsx(Vt,{to:"/evals/$runId/$evalId",params:{runId:s,evalId:b.testId},className:"font-medium text-cyan-400 hover:text-cyan-300 hover:underline",children:b.testId})}),m.jsx("td",{className:"px-4 py-3 text-gray-400",children:b.target??"-"}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(qa,{score:b.score})}),m.jsx("td",{className:"px-4 py-3",children:m.jsx(H1,{status:b.executionStatus})}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:b.durationMs!=null?`${(b.durationMs/1e3).toFixed(1)}s`:"-"}),m.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-gray-400",children:b.costUsd!=null?`$${b.costUsd.toFixed(4)}`:"-"})]},`${b.testId}-${v}`))})]})})]})}function B1({category:n,runId:s}){const[i,r]=W.useState(!0);return m.jsxs("div",{className:"rounded-lg border border-gray-800",children:[m.jsxs("button",{type:"button",onClick:()=>r(!i),className:"flex w-full items-center justify-between px-4 py-3 text-left transition-colors hover:bg-gray-900/50",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"text-xs text-gray-500",children:i?"▼":"▶"}),m.jsx("span",{className:"text-sm font-medium text-gray-200",children:n.name}),m.jsxs("span",{className:"text-xs text-gray-500",children:[n.datasets.length," dataset",n.datasets.length!==1?"s":""]})]}),m.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[m.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&m.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]}),m.jsxs("span",{className:"text-gray-500",children:[n.passed,"/",n.total]})]})]}),i&&m.jsx("div",{className:"border-t border-gray-800 p-3",children:m.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:n.datasets.map(o=>m.jsx(Yg,{dataset:o,runId:s},o.name))})})]})}function Yg({dataset:n,runId:s}){return m.jsxs(Vt,{to:"/runs/$runId/dataset/$dataset",params:{runId:s,dataset:n.name},className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-left transition-colors hover:border-gray-700",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:n.name}),m.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:[n.passed,"/",n.total]})]}),m.jsx("div",{className:"mt-2",children:m.jsx(qa,{score:n.avgScore})}),m.jsxs("div",{className:"mt-1 flex gap-3 text-xs",children:[m.jsxs("span",{className:"text-emerald-400",children:[n.passed," passed"]}),n.failed>0&&m.jsxs("span",{className:"text-red-400",children:[n.failed," failed"]})]})]})}function H1({status:n}){if(!n)return m.jsx("span",{className:"text-gray-500",children:"-"});const s=n==="success"||n==="completed",i=n==="error"||n==="failed";return m.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${s?"bg-emerald-900/50 text-emerald-400":i?"bg-red-900/50 text-red-400":"bg-gray-800 text-gray-400"}`,children:n})}const Gg=Rs("/runs/$runId")({component:q1});function q1(){const{runId:n}=Gg.useParams(),{data:s,isLoading:i,error:r}=Qi(n);return i?m.jsxs("div",{className:"space-y-4",children:[m.jsx("div",{className:"h-8 w-64 animate-pulse rounded bg-gray-800"}),m.jsx("div",{className:"grid grid-cols-5 gap-4",children:["s1","s2","s3","s4","s5"].map(o=>m.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-gray-900"},o))})]}):r?m.jsxs("div",{className:"rounded-lg border border-red-900/50 bg-red-950/20 p-6 text-red-400",children:["Failed to load run: ",r.message]}):m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{children:[m.jsxs("h1",{className:"text-2xl font-semibold text-white",children:["Run: ",n]}),m.jsxs("p",{className:"mt-1 text-sm text-gray-400",children:["Source: ",s==null?void 0:s.source]})]}),m.jsx(L1,{results:(s==null?void 0:s.results)??[],runId:n})]})}const Vg=Rs("/experiments/$experimentName")({component:Q1});function Q1(){var v;const{experimentName:n}=Vg.useParams(),{data:s,isLoading:i}=Xf(),{data:r,isLoading:o}=Vf();if(i||o)return m.jsxs("div",{className:"space-y-4",children:[m.jsx("div",{className:"h-8 w-64 animate-pulse rounded bg-gray-800"}),m.jsx("div",{className:"grid grid-cols-4 gap-4",children:["s1","s2","s3","s4"].map(S=>m.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-gray-900"},S))})]});const h=(v=s==null?void 0:s.experiments)==null?void 0:v.find(S=>S.name===n),g=(r==null?void 0:r.runs)??[],p=(h==null?void 0:h.pass_rate)??0,y=(h==null?void 0:h.run_count)??0,b=(h==null?void 0:h.target_count)??0;return m.jsxs("div",{className:"space-y-6",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-2xl font-semibold text-white",children:n}),m.jsxs("p",{className:"mt-1 text-sm text-gray-400",children:[y," run",y!==1?"s":""," · ",b," target",b!==1?"s":"",(h==null?void 0:h.last_run)&&m.jsxs("span",{className:"ml-2",children:["· Last run: ",q0(h.last_run)]})]})]}),h&&m.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[m.jsx(or,{label:"Runs",value:String(y)}),m.jsx(or,{label:"Targets",value:String(b)}),m.jsx(or,{label:"Pass Rate",value:`${Math.round(p*100)}%`,accent:"text-cyan-400"}),m.jsx(or,{label:"Last Run",value:q0(h.last_run)})]}),m.jsxs("div",{children:[m.jsx("h2",{className:"mb-4 text-lg font-medium text-gray-200",children:"All Runs"}),m.jsx(Qg,{runs:g})]})]})}function or({label:n,value:s,accent:i}){return m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("p",{className:"text-sm text-gray-400",children:n}),m.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i??"text-white"}`,children:s})]})}function q0(n){if(!n)return"N/A";try{const s=new Date(n);return Number.isNaN(s.getTime())?"N/A":s.toLocaleString()}catch{return"N/A"}}async function Y1(n,s){const i=await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reviews:[{test_id:n,comment:s}]})});if(!i.ok)throw new Error(`Failed to save feedback: ${i.status}`);return i.json()}function G1({testId:n}){var b;const{data:s}=g1(),i=wf(),r=(b=s==null?void 0:s.reviews)==null?void 0:b.find(v=>v.test_id===n),[o,f]=W.useState((r==null?void 0:r.comment)??""),[h,g]=W.useState(!1);W.useEffect(()=>{f((r==null?void 0:r.comment)??""),g(!1)},[r==null?void 0:r.comment]);const p=cb({mutationFn:()=>Y1(n,o),onSuccess:()=>{i.invalidateQueries({queryKey:["feedback"]}),g(!0),setTimeout(()=>g(!1),2e3)}}),y=W.useCallback(()=>{p.mutate()},[p]);return m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("h4",{className:"mb-2 text-sm font-medium text-gray-400",children:"Feedback"}),m.jsx("textarea",{value:o,onChange:v=>{f(v.target.value),g(!1)},placeholder:"Add feedback for this test...",className:"w-full rounded-md border border-gray-700 bg-gray-800 p-3 text-sm text-gray-200 placeholder-gray-500 focus:border-cyan-400 focus:outline-none",rows:3}),m.jsxs("div",{className:"mt-2 flex items-center gap-3",children:[m.jsx("button",{type:"button",onClick:y,disabled:p.isPending,className:"rounded-md bg-cyan-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-cyan-500 disabled:opacity-50",children:p.isPending?"Saving...":"Save Feedback"}),h&&m.jsx("span",{className:"text-sm text-emerald-400",children:"Saved"}),p.isError&&m.jsx("span",{className:"text-sm text-red-400",children:"Error saving feedback"})]})]})}function V1(n){var i;switch((i=n.split(".").pop())==null?void 0:i.toLowerCase()){case"ts":case"tsx":return"📘";case"json":return"📋";case"log":case"txt":return"📜";case"md":return"📝";default:return"📄"}}function Xg(n){const s=[];for(const i of n)i.type==="dir"&&(s.push(i.path),i.children&&s.push(...Xg(i.children)));return s}function Kg({node:n,selectedPath:s,onSelect:i,openFolders:r,toggleFolder:o,depth:f=0}){const h=n.type==="dir",g=r.has(n.path),p=s===n.path;return m.jsxs("div",{children:[m.jsxs("button",{type:"button",onClick:()=>{h?o(n.path):i(n.path)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm transition-colors ${p?"bg-cyan-400/20 text-cyan-400":"text-gray-300 hover:bg-gray-800/50 hover:text-gray-200"}`,style:{paddingLeft:`${f*16+8}px`},children:[m.jsx("span",{className:"flex-shrink-0 text-xs",children:h?g?"📂":"📁":V1(n.name)}),m.jsx("span",{className:"truncate",children:n.name})]}),h&&g&&n.children&&m.jsx("div",{children:n.children.map(y=>m.jsx(Kg,{node:y,selectedPath:s,onSelect:i,openFolders:r,toggleFolder:o,depth:f+1},y.path))})]})}function Zg({files:n,selectedPath:s,onSelect:i}){const[r,o]=W.useState(()=>new Set(Xg(n))),f=h=>{o(g=>{const p=new Set(g);return p.has(h)?p.delete(h):p.add(h),p})};return m.jsxs("div",{className:"w-64 overflow-y-auto rounded-lg border border-gray-800 bg-gray-900 py-2",children:[n.length===0&&m.jsx("p",{className:"px-4 py-2 text-sm text-gray-500",children:"No files."}),n.map(h=>m.jsx(Kg,{node:h,selectedPath:s,onSelect:i,openFolders:r,toggleFolder:f},h.path))]})}const X1="modulepreload",K1=function(n){return"/"+n},Q0={},Z1=function(s,i,r){let o=Promise.resolve();if(i&&i.length>0){let h=function(y){return Promise.all(y.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),p=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(i.map(y=>{if(y=K1(y),y in Q0)return;Q0[y]=!0;const b=y.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=b?"stylesheet":X1,b||(S.as="script"),S.crossOrigin="",S.href=y,p&&S.setAttribute("nonce",p),document.head.appendChild(S),b)return new Promise((j,R)=>{S.addEventListener("load",j),S.addEventListener("error",()=>R(Error(`Unable to preload CSS for ${y}`)))})}))}function f(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return o.then(h=>{for(const g of h||[])g.status==="rejected"&&f(g.reason);return s().catch(f)})},J1=W.lazy(()=>Z1(()=>import("./index-Cir5Hc8S.js"),[]));function _r({value:n,language:s="json",height:i="400px"}){return m.jsx(W.Suspense,{fallback:m.jsx("div",{className:"flex items-center justify-center rounded-lg bg-gray-900 p-8 text-gray-500",children:"Loading editor..."}),children:m.jsx(J1,{height:i,language:s,value:n,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",wordWrap:"on",padding:{top:12}}})})}function Kf(n){for(const s of n){if(s.type==="file")return s.path;if(s.children){const i=Kf(s.children);if(i)return i}}return null}function P1({eval:n,runId:s}){const[i,r]=W.useState("steps"),o=[{id:"steps",label:"Steps"},{id:"output",label:"Output"},{id:"task",label:"Task"}];return m.jsxs("div",{className:"space-y-6",children:[m.jsx("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h3",{className:"text-lg font-medium",children:n.testId}),m.jsxs("p",{className:"mt-1 text-sm text-gray-400",children:[n.target&&m.jsxs("span",{children:["Target: ",n.target]}),n.durationMs!=null&&m.jsxs("span",{className:"ml-4",children:[(n.durationMs/1e3).toFixed(1),"s"]}),n.costUsd!=null&&m.jsxs("span",{className:"ml-4",children:["$",n.costUsd.toFixed(4)]})]})]}),m.jsx("div",{className:"w-48",children:m.jsx(qa,{score:n.score})})]})}),n.scores&&n.scores.length>0&&m.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-4",children:[m.jsx("h4",{className:"mb-3 text-sm font-medium text-gray-400",children:"Evaluator Scores"}),m.jsx("div",{className:"space-y-3",children:n.scores.map((f,h)=>m.jsxs("div",{className:"flex items-center gap-4",children:[m.jsx("span",{className:"w-40 truncate text-sm text-gray-300",children:f.name??f.type??`Score ${h+1}`}),m.jsx("div",{className:"flex-1",children:m.jsx(qa,{score:f.score})})]},`${f.name??f.type??h}`))})]}),m.jsx("div",{className:"border-b border-gray-800",children:m.jsx("div",{className:"flex gap-1",children:o.map(f=>m.jsx("button",{type:"button",onClick:()=>r(f.id),className:`px-4 py-2 text-sm font-medium transition-colors ${i===f.id?"border-b-2 border-cyan-400 text-cyan-400":"text-gray-400 hover:text-gray-300"}`,children:f.label},f.id))})}),m.jsxs("div",{children:[i==="steps"&&m.jsx(k1,{result:n}),i==="output"&&m.jsx(F1,{result:n,runId:s}),i==="task"&&m.jsx($1,{result:n,runId:s})]}),m.jsx(G1,{testId:n.testId})]})}function k1({result:n}){const s=n.assertions??[],i=n.score<1||n.executionStatus==="error"||n.executionStatus==="failed",r=[];n.error&&r.push(n.error),(n.executionStatus==="error"||n.executionStatus==="failed")&&r.push(`Execution status: ${n.executionStatus}`);const o=s.filter(f=>!f.passed);for(const f of o){const h=f.evidence?`${f.text}: ${f.evidence}`:f.text;r.push(h)}if(n.scores)for(const f of n.scores){if(f.score<1&&f.details){const h=typeof f.details=="string"?f.details:JSON.stringify(f.details,null,2);r.push(`[${f.name??f.type??"evaluator"}] ${h}`)}if(f.assertions){for(const h of f.assertions)if(!h.passed){const g=h.evidence?`${h.text}: ${h.evidence}`:h.text;r.includes(g)||r.push(g)}}}return m.jsxs("div",{className:"space-y-4",children:[s.length===0&&m.jsx("p",{className:"text-sm text-gray-500",children:"No assertion steps recorded."}),s.length>0&&m.jsx("div",{className:"space-y-2",children:s.map(f=>m.jsxs("div",{className:`flex items-start gap-3 rounded-lg border p-3 ${f.passed?"border-emerald-900/50 bg-emerald-950/20":"border-red-900/50 bg-red-950/20"}`,children:[m.jsx("span",{className:`mt-0.5 text-lg ${f.passed?"text-emerald-400":"text-red-400"}`,children:f.passed?"✓":"✗"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("p",{className:"text-sm text-gray-200",children:[f.text,f.durationMs!=null&&m.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:["(",(f.durationMs/1e3).toFixed(1),"s)"]})]}),f.evidence&&m.jsx("p",{className:"mt-1 text-xs text-gray-400",children:f.evidence})]})]},`${f.text}-${f.passed}`))}),i&&r.length>0&&m.jsxs("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 p-4",children:[m.jsx("h4",{className:"mb-2 text-sm font-medium text-red-400",children:"Failure Reason"}),m.jsx("div",{className:"space-y-2",children:r.map(f=>m.jsx("p",{className:"text-sm text-gray-300",children:f},f))})]})]})}function F1({result:n,runId:s}){const i=n.testId,{data:r}=Bg(s,i),o=(r==null?void 0:r.files)??[],f=o.length>0,[h,g]=W.useState(null),p=h??(f?Kf(o):null),{data:y,isLoading:b}=Hg(s,i,p??""),v=n.output,S=v&&v.length>0?v.map(M=>`[${M.role}]
66
66
  ${M.content}`).join(`
67
67
 
68
68
  `):"";if(!f)return!v||v.length===0?m.jsx("p",{className:"text-sm text-gray-500",children:"No output available."}):m.jsx(_r,{value:S,language:"markdown"});const j=p?b?"Loading...":(y==null?void 0:y.content)??S:S,R=p?(y==null?void 0:y.language)??"plaintext":"markdown";return m.jsxs("div",{className:"flex h-[500px] gap-4",children:[m.jsx(Zg,{files:o,selectedPath:p,onSelect:g}),m.jsx("div",{className:"flex-1",children:m.jsx(_r,{value:j,language:R})})]})}function $1({result:n,runId:s}){const i=n.testId,{data:r}=Bg(s,i),o=(r==null?void 0:r.files)??[],f=o.length>0,[h,g]=W.useState(null),p=h??(f?Kf(o):null),{data:y,isLoading:b}=Hg(s,i,p??""),v=n.input,S=v&&v.length>0?v.map(M=>`[${M.role}]
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>AgentV Studio</title>
7
- <script type="module" crossorigin src="/assets/index-CDGReinH.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-D8LVkz9x.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-izxfmBKC.css">
9
9
  </head>
10
10
  <body class="bg-gray-950 text-gray-100">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentv",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "CLI entry point for AgentV",
5
5
  "type": "module",
6
6
  "repository": {