@devqubit/ui 0.1.10-beta-1 → 0.1.10
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/README.md +2 -3
- package/dist/components/RunsTable/RunsTable.d.ts +1 -2
- package/dist/components/RunsTable/RunsTable.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +2 -2
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/primitives.d.ts +0 -10
- package/dist/components/ui/primitives.d.ts.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.js +1036 -1165
- package/dist/pages/ArtifactPage.d.ts.map +1 -1
- package/dist/pages/DiffPage.d.ts.map +1 -1
- package/dist/pages/GroupDetailPage.d.ts.map +1 -1
- package/dist/pages/RunDetailPage.d.ts.map +1 -1
- package/dist/pages/RunsPage.d.ts.map +1 -1
- package/dist/pages/SearchPage.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ React frontend for devqubit experiment tracking UI (open-core).
|
|
|
14
14
|
```bash
|
|
15
15
|
npm install
|
|
16
16
|
npm run dev # Start dev server (localhost:5173)
|
|
17
|
-
npm run build # Build for production
|
|
17
|
+
npm run build # Build for production
|
|
18
18
|
npm run build:lib # Build as npm library
|
|
19
19
|
npm run lint # Run ESLint
|
|
20
20
|
npm run typecheck # TypeScript type check
|
|
@@ -24,8 +24,7 @@ Dev server proxies `/api` requests to `localhost:8000`.
|
|
|
24
24
|
|
|
25
25
|
## Build for Python Package
|
|
26
26
|
|
|
27
|
-
The build process automatically copies production files to `../src/devqubit_ui/static/`:
|
|
28
|
-
|
|
29
27
|
```bash
|
|
30
28
|
npm run build
|
|
29
|
+
cp -r dist/* ../src/devqubit_ui/static/
|
|
31
30
|
```
|
|
@@ -4,11 +4,10 @@ export interface RunsTableProps {
|
|
|
4
4
|
onDelete?: (runId: string) => void;
|
|
5
5
|
loading?: boolean;
|
|
6
6
|
emptyHint?: string;
|
|
7
|
-
baselineRunId?: string;
|
|
8
7
|
}
|
|
9
8
|
declare function StatusBadge({ status }: {
|
|
10
9
|
status: RunStatus;
|
|
11
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare function RunsTable({ runs, onDelete, loading, emptyHint
|
|
11
|
+
export declare function RunsTable({ runs, onDelete, loading, emptyHint }: RunsTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export { StatusBadge };
|
|
14
13
|
//# sourceMappingURL=RunsTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunsTable.d.ts","sourceRoot":"","sources":["../../../src/components/RunsTable/RunsTable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"RunsTable.d.ts","sourceRoot":"","sources":["../../../src/components/RunsTable/RunsTable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,2CAQrD;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,cAAc,2CA8D/E;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Badge, Button, Card, CardHeader, CardTitle, Alert, Spinner, EmptyState, KVList, Modal, Toast,
|
|
2
|
-
export type { BadgeVariant, BadgeProps, ButtonVariant, ButtonSize, ButtonProps, CardProps, CardHeaderProps, CardTitleProps, AlertVariant, AlertProps, SpinnerProps, EmptyStateProps, KVListProps, ModalProps, ToastVariant, ToastProps,
|
|
1
|
+
export { Badge, Button, Card, CardHeader, CardTitle, Alert, Spinner, EmptyState, KVList, Modal, Toast, } from './primitives';
|
|
2
|
+
export type { BadgeVariant, BadgeProps, ButtonVariant, ButtonSize, ButtonProps, CardProps, CardHeaderProps, CardTitleProps, AlertVariant, AlertProps, SpinnerProps, EmptyStateProps, KVListProps, ModalProps, ToastVariant, ToastProps, } from './primitives';
|
|
3
3
|
export { FormGroup, FormRow, Label, Input, Select, } from './forms';
|
|
4
4
|
export type { FormGroupProps, FormRowProps, LabelProps, InputProps, SelectProps, } from './forms';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,KAAK,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,KAAK,EACL,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,KAAK,EACL,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -53,14 +53,4 @@ export interface ToastProps {
|
|
|
53
53
|
onClose: () => void;
|
|
54
54
|
}
|
|
55
55
|
export declare function Toast({ message, variant, visible, onClose }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
|
|
56
|
-
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
57
|
-
width?: string | number;
|
|
58
|
-
height?: string | number;
|
|
59
|
-
}
|
|
60
|
-
export declare function Skeleton({ width, height, className, style, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
-
export interface TableSkeletonProps {
|
|
62
|
-
rows?: number;
|
|
63
|
-
cols?: number;
|
|
64
|
-
}
|
|
65
|
-
export declare function TableSkeleton({ rows, cols }: TableSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
66
56
|
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/components/ui/primitives.tsx"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../src/components/ui/primitives.tsx"],"names":[],"mappings":"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"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`+
|
|
3
|
-
`),M=
|
|
4
|
-
`),
|
|
5
|
-
`+
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react"),P=require("react-router-dom");var Ee={exports:{}},me={};var vr;function ys(){if(vr)return me;vr=1;var s=y,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function f(i,x,o){var p,I={},_=null,V=null;o!==void 0&&(_=""+o),x.key!==void 0&&(_=""+x.key),x.ref!==void 0&&(V=x.ref);for(p in x)a.call(x,p)&&!h.hasOwnProperty(p)&&(I[p]=x[p]);if(i&&i.defaultProps)for(p in x=i.defaultProps,x)I[p]===void 0&&(I[p]=x[p]);return{$$typeof:t,type:i,key:_,ref:V,props:I,_owner:d.current}}return me.Fragment=n,me.jsx=f,me.jsxs=f,me}var fe={};var br;function _s(){return br||(br=1,process.env.NODE_ENV!=="production"&&(function(){var s=y,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),i=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),K=Symbol.iterator,de="@@iterator";function ve(r){if(r===null||typeof r!="object")return null;var l=K&&r[K]||r[de];return typeof l=="function"?l:null}var Q=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(r){{for(var l=arguments.length,u=new Array(l>1?l-1:0),j=1;j<l;j++)u[j-1]=arguments[j];be("error",r,u)}}function be(r,l,u){{var j=Q.ReactDebugCurrentFrame,R=j.getStackAddendum();R!==""&&(l+="%s",u=u.concat([R]));var w=u.map(function(N){return String(N)});w.unshift("Warning: "+l),Function.prototype.apply.call(console[r],console,w)}}var ue=!1,Ne=!1,Oe=!1,Fe=!1,$e=!1,S;S=Symbol.for("react.module.reference");function F(r){return!!(typeof r=="string"||typeof r=="function"||r===a||r===h||$e||r===d||r===o||r===p||Fe||r===V||ue||Ne||Oe||typeof r=="object"&&r!==null&&(r.$$typeof===_||r.$$typeof===I||r.$$typeof===f||r.$$typeof===i||r.$$typeof===x||r.$$typeof===S||r.getModuleId!==void 0))}function ye(r,l,u){var j=r.displayName;if(j)return j;var R=l.displayName||l.name||"";return R!==""?u+"("+R+")":u}function _e(r){return r.displayName||"Context"}function Y(r){if(r==null)return null;if(typeof r.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case a:return"Fragment";case n:return"Portal";case h:return"Profiler";case d:return"StrictMode";case o:return"Suspense";case p:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case i:var l=r;return _e(l)+".Consumer";case f:var u=r;return _e(u._context)+".Provider";case x:return ye(r,r.render,"ForwardRef");case I:var j=r.displayName||null;return j!==null?j:Y(r.type)||"Memo";case _:{var R=r,w=R._payload,N=R._init;try{return Y(N(w))}catch{return null}}}return null}var se=Object.assign,he=0,Je,Xe,Qe,Ze,er,rr,sr;function tr(){}tr.__reactDisabledLog=!0;function Kr(){{if(he===0){Je=console.log,Xe=console.info,Qe=console.warn,Ze=console.error,er=console.group,rr=console.groupCollapsed,sr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:tr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}he++}}function Jr(){{if(he--,he===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:se({},r,{value:Je}),info:se({},r,{value:Xe}),warn:se({},r,{value:Qe}),error:se({},r,{value:Ze}),group:se({},r,{value:er}),groupCollapsed:se({},r,{value:rr}),groupEnd:se({},r,{value:sr})})}he<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Le=Q.ReactCurrentDispatcher,Be;function Re(r,l,u){{if(Be===void 0)try{throw Error()}catch(R){var j=R.stack.trim().match(/\n( *(at )?)/);Be=j&&j[1]||""}return`
|
|
2
|
+
`+Be+r}}var Ie=!1,we;{var Xr=typeof WeakMap=="function"?WeakMap:Map;we=new Xr}function nr(r,l){if(!r||Ie)return"";{var u=we.get(r);if(u!==void 0)return u}var j;Ie=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var w;w=Le.current,Le.current=null,Kr();try{if(l){var N=function(){throw Error()};if(Object.defineProperty(N.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(N,[])}catch(q){j=q}Reflect.construct(r,[],N)}else{try{N.call()}catch(q){j=q}r.call(N.prototype)}}else{try{throw Error()}catch(q){j=q}r()}}catch(q){if(q&&j&&typeof q.stack=="string"){for(var g=q.stack.split(`
|
|
3
|
+
`),M=j.stack.split(`
|
|
4
|
+
`),C=g.length-1,k=M.length-1;C>=1&&k>=0&&g[C]!==M[k];)k--;for(;C>=1&&k>=0;C--,k--)if(g[C]!==M[k]){if(C!==1||k!==1)do if(C--,k--,k<0||g[C]!==M[k]){var H=`
|
|
5
|
+
`+g[C].replace(" at new "," at ");return r.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",r.displayName)),typeof r=="function"&&we.set(r,H),H}while(C>=1&&k>=0);break}}}finally{Ie=!1,Le.current=w,Jr(),Error.prepareStackTrace=R}var ie=r?r.displayName||r.name:"",te=ie?Re(ie):"";return typeof r=="function"&&we.set(r,te),te}function Qr(r,l,u){return nr(r,!1)}function Zr(r){var l=r.prototype;return!!(l&&l.isReactComponent)}function Se(r,l,u){if(r==null)return"";if(typeof r=="function")return nr(r,Zr(r));if(typeof r=="string")return Re(r);switch(r){case o:return Re("Suspense");case p:return Re("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case x:return Qr(r.render);case I:return Se(r.type,l,u);case _:{var j=r,R=j._payload,w=j._init;try{return Se(w(R),l,u)}catch{}}}return""}var xe=Object.prototype.hasOwnProperty,ar={},ir=Q.ReactDebugCurrentFrame;function Pe(r){if(r){var l=r._owner,u=Se(r.type,r._source,l?l.type:null);ir.setExtraStackFrame(u)}else ir.setExtraStackFrame(null)}function es(r,l,u,j,R){{var w=Function.call.bind(xe);for(var N in r)if(w(r,N)){var g=void 0;try{if(typeof r[N]!="function"){var M=Error((j||"React class")+": "+u+" type `"+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[N]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw M.name="Invariant Violation",M}g=r[N](l,N,j,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(C){g=C}g&&!(g instanceof Error)&&(Pe(R),O("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",j||"React class",u,N,typeof g),Pe(null)),g instanceof Error&&!(g.message in ar)&&(ar[g.message]=!0,Pe(R),O("Failed %s type: %s",u,g.message),Pe(null))}}}var rs=Array.isArray;function Me(r){return rs(r)}function ss(r){{var l=typeof Symbol=="function"&&Symbol.toStringTag,u=l&&r[Symbol.toStringTag]||r.constructor.name||"Object";return u}}function ts(r){try{return cr(r),!1}catch{return!0}}function cr(r){return""+r}function lr(r){if(ts(r))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ss(r)),cr(r)}var or=Q.ReactCurrentOwner,ns={key:!0,ref:!0,__self:!0,__source:!0},dr,ur;function as(r){if(xe.call(r,"ref")){var l=Object.getOwnPropertyDescriptor(r,"ref").get;if(l&&l.isReactWarning)return!1}return r.ref!==void 0}function is(r){if(xe.call(r,"key")){var l=Object.getOwnPropertyDescriptor(r,"key").get;if(l&&l.isReactWarning)return!1}return r.key!==void 0}function cs(r,l){typeof r.ref=="string"&&or.current}function ls(r,l){{var u=function(){dr||(dr=!0,O("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};u.isReactWarning=!0,Object.defineProperty(r,"key",{get:u,configurable:!0})}}function os(r,l){{var u=function(){ur||(ur=!0,O("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};u.isReactWarning=!0,Object.defineProperty(r,"ref",{get:u,configurable:!0})}}var ds=function(r,l,u,j,R,w,N){var g={$$typeof:t,type:r,key:l,ref:u,props:N,_owner:w};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:j}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function us(r,l,u,j,R){{var w,N={},g=null,M=null;u!==void 0&&(lr(u),g=""+u),is(l)&&(lr(l.key),g=""+l.key),as(l)&&(M=l.ref,cs(l,R));for(w in l)xe.call(l,w)&&!ns.hasOwnProperty(w)&&(N[w]=l[w]);if(r&&r.defaultProps){var C=r.defaultProps;for(w in C)N[w]===void 0&&(N[w]=C[w])}if(g||M){var k=typeof r=="function"?r.displayName||r.name||"Unknown":r;g&&ls(N,k),M&&os(N,k)}return ds(r,g,M,R,j,or.current,N)}}var Ue=Q.ReactCurrentOwner,hr=Q.ReactDebugCurrentFrame;function ae(r){if(r){var l=r._owner,u=Se(r.type,r._source,l?l.type:null);hr.setExtraStackFrame(u)}else hr.setExtraStackFrame(null)}var qe;qe=!1;function Ge(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function xr(){{if(Ue.current){var r=Y(Ue.current.type);if(r)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+
|
|
7
|
+
Check the render method of \``+r+"`."}return""}}function hs(r){return""}var mr={};function xs(r){{var l=xr();if(!l){var u=typeof r=="string"?r:r.displayName||r.name;u&&(l=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+
|
|
9
|
+
Check the top-level render call using <`+u+">.")}return l}}function fr(r,l){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var u=xs(l);if(mr[u])return;mr[u]=!0;var j="";r&&r._owner&&r._owner!==Ue.current&&(j=" It was passed a child from "+Y(r._owner.type)+"."),ae(r),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,j),ae(null)}}function jr(r,l){{if(typeof r!="object")return;if(Me(r))for(var u=0;u<r.length;u++){var j=r[u];Ge(j)&&fr(j,l)}else if(Ge(r))r._store&&(r._store.validated=!0);else if(r){var R=ve(r);if(typeof R=="function"&&R!==r.entries)for(var w=R.call(r),N;!(N=w.next()).done;)Ge(N.value)&&fr(N.value,l)}}}function ms(r){{var l=r.type;if(l==null||typeof l=="string")return;var u;if(typeof l=="function")u=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===x||l.$$typeof===I))u=l.propTypes;else return;if(u){var j=Y(l);es(u,r.props,"prop",j,r)}else if(l.PropTypes!==void 0&&!qe){qe=!0;var R=Y(l);O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function fs(r){{for(var l=Object.keys(r.props),u=0;u<l.length;u++){var j=l[u];if(j!=="children"&&j!=="key"){ae(r),O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",j),ae(null);break}}r.ref!==null&&(ae(r),O("Invalid attribute `ref` supplied to `React.Fragment`."),ae(null))}}var pr={};function gr(r,l,u,j,R,w){{var N=F(r);if(!N){var g="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(g+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var M=hs();M?g+=M:g+=xr();var C;r===null?C="null":Me(r)?C="array":r!==void 0&&r.$$typeof===t?(C="<"+(Y(r.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):C=typeof r,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,g)}var k=us(r,l,u,R,w);if(k==null)return k;if(N){var H=l.children;if(H!==void 0)if(j)if(Me(H)){for(var ie=0;ie<H.length;ie++)jr(H[ie],r);Object.freeze&&Object.freeze(H)}else O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else jr(H,r)}if(xe.call(l,"key")){var te=Y(r),q=Object.keys(l).filter(function(Ns){return Ns!=="key"}),We=q.length>0?"{key: someKey, "+q.join(": ..., ")+": ...}":"{key: someKey}";if(!pr[te+We]){var bs=q.length>0?"{"+q.join(": ..., ")+": ...}":"{}";O(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,He,ie,br,ie),vs[ie+He]=!0}}return s===i?fr($):mr($),$}}function jr(s,l,h){return bs(s,l,h,!0)}function pr(s,l,h){return bs(s,l,h,!1)}var gr=pr,vr=jr;be.Fragment=i,be.jsx=gr,be.jsxs=vr})()),be}var _s;function Rr(){return _s||(_s=1,process.env.NODE_ENV==="production"?Fe.exports=yr():Fe.exports=_r()),Fe.exports}var e=Rr();class xe extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}class Rs{baseUrl;headers;constructor(t={}){this.baseUrl=t.baseUrl??"",this.headers={"Content-Type":"application/json",...t.headers}}async request(t,n,i={}){let d=`${this.baseUrl}${n}`;if(i.params){const m=new URLSearchParams;Object.entries(i.params).forEach(([u,x])=>{x!=null&&x!==""&&m.set(u,String(x))});const a=m.toString();a&&(d+=`?${a}`)}const o=await fetch(d,{method:t,headers:this.headers,body:i.body?JSON.stringify(i.body):void 0});if(!o.ok){const m=await o.json().catch(()=>({detail:"Unknown error"}));throw new xe(o.status,m.detail||o.statusText)}if(!(o.status===204||o.headers.get("content-length")==="0"))return o.json()}async getCapabilities(){return this.request("GET","/api/v1/capabilities")}async listRuns(t){return this.request("GET","/api/runs",{params:t})}async getRun(t){return this.request("GET",`/api/runs/${t}`)}async deleteRun(t){await this.request("DELETE",`/api/runs/${t}`)}async setBaseline(t,n){return this.request("POST",`/api/projects/${t}/baseline/${n}`,{params:{redirect:"false"}})}async listProjects(t){return this.request("GET","/api/projects",{params:t})}async listGroups(t){return this.request("GET","/api/groups",{params:t})}async getGroup(t){return this.request("GET",`/api/groups/${t}`)}async getDiff(t,n){return this.request("GET","/api/diff",{params:{a:t,b:n}})}async getArtifact(t,n){return this.request("GET",`/api/runs/${t}/artifacts/${n}`)}getArtifactDownloadUrl(t,n){return`${this.baseUrl}/api/runs/${t}/artifacts/${n}/raw`}}const ws=new Rs,Ss=v.createContext(null);function Es({children:r,api:t=ws,initialWorkspace:n=null}){const[i,d]=v.useState(null),[o,m]=v.useState(n);return v.useEffect(()=>{t.getCapabilities().then(d).catch(console.error)},[t]),e.jsx(Ss.Provider,{value:{api:t,capabilities:i,currentWorkspace:o,setCurrentWorkspace:m},children:r})}function W(){const r=v.useContext(Ss);if(!r)throw new Error("useApp must be used within AppProvider");return r}function ce(r,t=[]){const[n,i]=v.useState({data:null,loading:!0,error:null}),d=v.useRef(!0),o=v.useRef(r);o.current=r;const m=v.useCallback(async()=>{i(a=>({...a,loading:!0,error:null}));try{const a=await o.current();d.current&&i({data:a,loading:!1,error:null})}catch(a){d.current&&i({data:null,loading:!1,error:a instanceof xe?a:new xe(500,String(a))})}},[]);return v.useEffect(()=>(d.current=!0,m(),()=>{d.current=!1}),t),{...n,refetch:m}}function Ke(r){const{api:t,currentWorkspace:n}=W();return ce(()=>t.listRuns({...r,workspace:n?.id}),[t,n?.id,r?.project,r?.status,r?.q,r?.limit])}function Je(r){const{api:t}=W();return ce(async()=>{const{run:n}=await t.getRun(r);return n},[t,r])}function Re(){const{api:r,currentWorkspace:t}=W();return ce(async()=>{const{projects:n}=await r.listProjects({workspace:t?.id});return n},[r,t?.id])}function Ps(r){const{api:t,currentWorkspace:n}=W();return ce(async()=>{const{groups:i}=await t.listGroups({...r,workspace:n?.id});return i},[t,n?.id,r?.project])}function Ts(r){const{api:t}=W();return ce(()=>t.getGroup(r),[t,r])}function Cs(r,t){const{api:n}=W();return ce(()=>n.getDiff(r,t),[n,r,t])}function ks(r,t){const{api:n}=W();return ce(()=>n.getArtifact(r,t),[n,r,t])}function me(r){const[t,n]=v.useState(!1),[i,d]=v.useState(null);return{mutate:v.useCallback(async(...m)=>{n(!0),d(null);try{return await r(...m)}catch(a){const u=a instanceof xe?a:new xe(500,String(a));throw d(u),u}finally{n(!1)}},[r]),loading:t,error:i}}function Y(r){return r?.slice(0,8)??""}function Oe(r){return r?.slice(0,12)??"N/A"}function _e(r){const t=new Date(r),i=Math.floor((new Date().getTime()-t.getTime())/1e3);if(i<60)return"just now";if(i<3600){const o=Math.floor(i/60);return`${o} minute${o!==1?"s":""} ago`}if(i<86400){const o=Math.floor(i/3600);return`${o} hour${o!==1?"s":""} ago`}if(i<2592e3){const o=Math.floor(i/86400);return`${o} day${o!==1?"s":""} ago`}if(i<31536e3){const o=Math.floor(i/2592e3);return`${o} month${o!==1?"s":""} ago`}const d=Math.floor(i/31536e3);return`${d} year${d!==1?"s":""} ago`}function Ds(r,t=6){return typeof r!="number"||isNaN(r)?String(r):Number(r.toPrecision(t)).toString()}function ye(r){return r<1024?`${r} bytes`:r<1048576?`${(r/1024).toFixed(1)} KB`:`${(r/1048576).toFixed(1)} MB`}function As(r){return JSON.stringify(r,null,2)}function Fs(r,t=60){return r?r.length<=t?r:r.slice(0,t-3)+"...":""}function wr(r,t){const n=new URLSearchParams;Object.entries(t).forEach(([d,o])=>{o!=null&&o!==""&&n.set(d,String(o))});const i=n.toString();return i?`${r}?${i}`:r}function L(...r){return r.filter(Boolean).join(" ")}const Sr=[{href:"/runs",label:"Runs",matchPaths:["/runs"]},{href:"/projects",label:"Projects",matchPaths:["/projects"]},{href:"/groups",label:"Groups",matchPaths:["/groups"]},{href:"/diff",label:"Compare",matchPaths:["/diff"]},{href:"/search",label:"Search",matchPaths:["/search"]}],Os=v.createContext(null);function Er({config:r,children:t}){return e.jsx(Os.Provider,{value:r,children:t})}function $s(){return v.useContext(Os)}function q({children:r,config:t}){const n=T.useLocation(),d={...$s(),...t},o=d?.navLinks??Sr,m=[...d?.prependNavLinks??[],...o,...d?.appendNavLinks??[]],a=d?.logo??{text:"devqubit",icon:"⚛"},u=x=>x.matchPaths?x.matchPaths.some(g=>n.pathname.startsWith(g)):n.pathname===x.href;return e.jsxs("div",{className:"min-h-screen bg-gray-50",children:[e.jsx("header",{className:"bg-gray-900 h-14 sticky top-0 z-50 border-b border-gray-800",children:e.jsxs("div",{className:"max-w-container mx-auto px-6 h-full flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs(T.Link,{to:"/",className:"text-lg font-semibold text-primary hover:text-primary-light flex items-center gap-2 transition-colors hover:no-underline",children:[a.icon&&e.jsx("span",{className:"text-xl",children:a.icon}),a.text]}),e.jsx("nav",{className:"flex gap-1",children:m.map(x=>e.jsx(T.Link,{to:x.href,className:L("px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-150 hover:no-underline",u(x)?"text-white bg-white/10":"text-gray-400 hover:text-white hover:bg-white/5"),children:x.label},x.href))})]}),e.jsx("div",{className:"flex items-center gap-4",children:d?.headerRight})]})}),e.jsx("main",{className:"max-w-container mx-auto p-6 fade-in",children:r})]})}function fe({title:r,subtitle:t,actions:n}){return e.jsxs("div",{className:"flex items-start justify-between mb-6 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900 flex items-center gap-2 flex-wrap",children:r}),t&&e.jsx("p",{className:"text-sm text-muted mt-1",children:t})]}),n&&e.jsx("div",{className:"flex gap-2",children:n})]})}function B({variant:r="gray",className:t,children:n,...i}){return e.jsx("span",{className:L("badge",`badge-${r}`,t),...i,children:n})}const O=v.forwardRef(({variant:r="secondary",size:t="default",loading:n,className:i,children:d,disabled:o,...m},a)=>e.jsxs("button",{ref:a,className:L("btn",r==="ghost-danger"?"btn-ghost-danger":`btn-${r}`,t==="sm"&&"btn-sm",i),disabled:o||n,...m,children:[n&&e.jsx(G,{}),d]}));O.displayName="Button";function N({className:r,children:t,...n}){return e.jsx("div",{className:L("card",r),...n,children:t})}function D({className:r,children:t,...n}){return e.jsx("div",{className:L("card-header",r),...n,children:t})}function A({className:r,children:t,...n}){return e.jsx("h3",{className:L("card-title",r),...n,children:t})}function Pr({variant:r="info",className:t,children:n,...i}){return e.jsx("div",{className:L("alert",`alert-${r}`,t),...i,children:n})}function G({className:r,...t}){return e.jsx("span",{className:L("spinner",r),...t})}function te({message:r,hint:t,className:n,...i}){return e.jsxs("div",{className:L("empty-state",n),...i,children:[e.jsx("p",{children:r}),t&&e.jsx("p",{className:"text-sm text-muted mt-2",children:t})]})}function $e({items:r,className:t,...n}){return e.jsx("dl",{className:L("kv-list",t),...n,children:r.map(({label:i,value:d})=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:i}),e.jsx("dd",{children:d})]},i))})}function Xe({open:r,onClose:t,title:n,children:i,actions:d}){return r?e.jsx("div",{className:L("modal-backdrop",r&&"active"),onClick:o=>o.target===o.currentTarget&&t(),children:e.jsxs("div",{className:"modal",onClick:o=>o.stopPropagation(),children:[e.jsx("h3",{className:"modal-title",children:n}),e.jsx("div",{className:"modal-body",children:i}),d&&e.jsx("div",{className:"modal-actions",children:d})]})}):null}function we({message:r,variant:t="info",visible:n,onClose:i}){if(!n)return null;const d={success:"✓",error:"✕",info:"i"}[t],o={success:"text-[#059669]",error:"text-[#DC4A4A]",info:"text-[#2563EB]"}[t];return e.jsxs("div",{className:"toast",onClick:i,children:[e.jsx("span",{className:L("mr-2 font-bold",o),children:d}),r]})}function X({children:r,className:t}){return e.jsx("div",{className:L("form-group",t),children:r})}function se({className:r,children:t,...n}){return e.jsx("label",{className:L("form-label",r),...n,children:t})}const Le=v.forwardRef(({className:r,...t},n)=>e.jsx("input",{ref:n,className:L("form-input",r),...t}));Le.displayName="Input";const re=v.forwardRef(({className:r,children:t,...n},i)=>e.jsx("select",{ref:i,className:L("form-input",r),...n,children:t}));re.displayName="Select";function Qe({children:r,className:t}){return e.jsx("div",{className:L("form-row",t),children:r})}function I({className:r,children:t,...n}){return e.jsx("table",{className:L("table",r),...n,children:t})}function Q({className:r,children:t,...n}){return e.jsx("thead",{className:r,...n,children:t})}function U({className:r,children:t,...n}){return e.jsx("tbody",{className:r,...n,children:t})}function f({className:r,children:t,...n}){return e.jsx("tr",{className:r,...n,children:t})}function y({className:r,children:t,...n}){return e.jsx("th",{className:r,...n,children:t})}function c({className:r,children:t,...n}){return e.jsx("td",{className:r,...n,children:t})}function Ze({status:r}){const t={FINISHED:"success",FAILED:"danger",RUNNING:"warning",UNKNOWN:"gray"}[r];return e.jsx(B,{variant:t,children:r})}function Be({runs:r,onDelete:t,loading:n,emptyHint:i,baselineRunId:d}){const[o,m]=v.useState(null),a=()=>{o&&t&&(t(o.run_id),m(null))};return r.length?e.jsxs(e.Fragment,{children:[e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Run ID"}),e.jsx(y,{children:"Name"}),e.jsx(y,{children:"Project"}),e.jsx(y,{children:"Status"}),e.jsx(y,{children:"Created"}),e.jsx(y,{children:"Actions"})]})}),e.jsx(U,{children:r.map(u=>e.jsxs(f,{children:[e.jsxs(c,{children:[e.jsx(T.Link,{to:`/runs/${u.run_id}`,className:"font-mono",children:Y(u.run_id)}),u.run_id===d&&e.jsx(B,{variant:"info",className:"ml-2",children:"Baseline"})]}),e.jsx(c,{children:u.run_name||"—"}),e.jsx(c,{children:u.project}),e.jsx(c,{children:e.jsx(Ze,{status:u.status})}),e.jsx(c,{className:"text-muted",children:_e(u.created_at)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T.Link,{to:`/runs/${u.run_id}`,children:e.jsx(O,{variant:"secondary",size:"sm",children:"View"})}),t&&e.jsx(O,{variant:"ghost-danger",size:"sm",onClick:()=>m(u),disabled:n,children:"Delete"})]})})]},u.run_id))})]}),e.jsxs(Xe,{open:!!o,onClose:()=>m(null),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(O,{variant:"secondary",onClick:()=>m(null),children:"Cancel"}),e.jsxs(O,{variant:"danger",onClick:a,disabled:n,children:[n&&e.jsx(G,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),o&&e.jsx("p",{className:"font-mono text-sm mt-2",children:Y(o.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]})]}):e.jsx(te,{message:"No runs found",hint:i??"Try adjusting your filters"})}function Ls(){const[r,t]=T.useSearchParams(),{api:n}=W(),{data:i}=Re(),[d,o]=v.useState(null),[m,a]=v.useState({project:r.get("project")||"",status:r.get("status")||"",q:r.get("q")||"",limit:parseInt(r.get("limit")||"25",10)}),{data:u,loading:x,refetch:g}=Ke(m),j=me(S=>n.deleteRun(S));v.useEffect(()=>{if(d){const S=setTimeout(()=>o(null),3e3);return()=>clearTimeout(S)}},[d]);const w=v.useCallback((S,Z)=>{a(J=>({...J,[S]:Z}));const K=new URLSearchParams(r);Z?K.set(S,String(Z)):K.delete(S),t(K,{replace:!0})},[r,t]),H=v.useCallback(async S=>{try{await j.mutate(S),o({message:"Run deleted",variant:"success"}),g()}catch{o({message:"Failed to delete run",variant:"error"})}},[j,g]);return e.jsxs(q,{children:[e.jsx(fe,{title:"Runs"}),e.jsx(N,{className:"mb-4",children:e.jsxs(Qe,{children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"project",children:"Project"}),e.jsxs(re,{id:"project",value:m.project,onChange:S=>w("project",S.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),i?.map(S=>e.jsx("option",{value:S.name,children:S.name},S.name))]})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"status",children:"Status"}),e.jsxs(re,{id:"status",value:m.status,onChange:S=>w("status",S.target.value),children:[e.jsx("option",{value:"",children:"All"}),e.jsx("option",{value:"FINISHED",children:"Finished"}),e.jsx("option",{value:"FAILED",children:"Failed"}),e.jsx("option",{value:"RUNNING",children:"Running"})]})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"q",children:"Query"}),e.jsx(Le,{id:"q",value:m.q,onChange:S=>w("q",S.target.value),placeholder:"metric.fidelity > 0.9"})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"limit",children:"Limit"}),e.jsxs(re,{id:"limit",value:m.limit,onChange:S=>w("limit",parseInt(S.target.value,10)),children:[e.jsx("option",{value:"25",children:"25"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]}),e.jsxs(X,{className:"flex items-end gap-2",children:[e.jsx(O,{variant:"primary",onClick:()=>g(),children:"Filter"}),x&&e.jsx(G,{})]})]})}),e.jsx(N,{children:x&&!u?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Be,{runs:u?.runs??[],onDelete:H,loading:j.loading,baselineRunId:m.project?i?.find(S=>S.name===m.project)?.baseline?.run_id:void 0})}),d&&e.jsx(we,{message:d.message,variant:d.variant,visible:!!d,onClose:()=>o(null)})]})}function Bs({projects:r,currentWorkspace:t}){if(!r.length)return e.jsx(te,{message:"No projects yet",hint:"Projects are created automatically when you log runs"});const n=i=>{const d=new URLSearchParams({project:i});return t&&d.set("workspace",t.id),`/runs?${d}`};return e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Project"}),e.jsx(y,{children:"Runs"}),e.jsx(y,{children:"Baseline"}),e.jsx(y,{})]})}),e.jsx(U,{children:r.map(i=>e.jsxs(f,{children:[e.jsxs(c,{children:[e.jsx("span",{className:"font-medium",children:i.name}),i.description&&e.jsx("p",{className:"text-muted text-sm",children:Fs(i.description)})]}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:i.run_count??0})}),e.jsx(c,{children:i.baseline?e.jsxs(e.Fragment,{children:[e.jsx(T.Link,{to:`/runs/${i.baseline.run_id}`,className:"font-mono text-sm",children:Y(i.baseline.run_id)}),i.baseline.run_name&&e.jsx("p",{className:"text-muted text-sm",children:i.baseline.run_name})]}):e.jsx("span",{className:"text-muted",children:"—"})}),e.jsx(c,{className:"text-right",children:e.jsx(T.Link,{to:n(i.name),children:e.jsx(O,{variant:"secondary",size:"sm",children:"View Runs"})})})]},i.name))})]})}function Is({groups:r}){return r.length?e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Group ID"}),e.jsx(y,{children:"Name"}),e.jsx(y,{children:"Project"}),e.jsx(y,{children:"Runs"}),e.jsx(y,{children:"Actions"})]})}),e.jsx(U,{children:r.map(t=>e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:Y(t.group_id)}),e.jsx(c,{children:t.group_name||"—"}),e.jsx(c,{children:t.project}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:t.run_count})}),e.jsx(c,{children:e.jsx(T.Link,{to:`/groups/${t.group_id}`,children:e.jsx(O,{variant:"secondary",size:"sm",children:"View Runs"})})})]},t.group_id))})]}):e.jsx(te,{message:"No groups found",hint:"Groups are created when runs have a group_id set"})}function Us(){const{runId:r}=T.useParams(),t=T.useNavigate(),{api:n}=W(),{data:i,loading:d,error:o,refetch:m}=Je(r),{data:a,refetch:u}=Re(),[x,g]=v.useState(!1),[j,w]=v.useState(null),{mutate:H,loading:S}=me(()=>n.setBaseline(i.project,i.run_id)),{mutate:Z,loading:K}=me(()=>n.deleteRun(r)),k=a?.find(_=>_.name===i?.project)?.baseline?.run_id===r;if(v.useEffect(()=>{if(j){const _=setTimeout(()=>w(null),3e3);return()=>clearTimeout(_)}},[j]),d)return e.jsx(q,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(o||!i)return e.jsx(q,{children:e.jsx(N,{children:e.jsx(te,{message:"Run not found",hint:o?.message||`Run ${r} does not exist`})})});const le=i.backend||{},oe=i.fingerprints||{},ee=i.data?.params||{},Se=i.data?.metrics||{},Ee=i.data?.tags||{},de=i.artifacts||[],je=i.errors||[],Ie=async()=>{try{await H(),await u(),m(),w({message:"Baseline updated",variant:"success"})}catch{w({message:"Failed to set baseline",variant:"error"})}},Ue=async()=>{try{await Z(),g(!1),w({message:"Run deleted",variant:"success"}),setTimeout(()=>t("/runs"),1e3)}catch{w({message:"Failed to delete run",variant:"error"}),g(!1)}},Pe=async _=>{const C=de[_];try{const ne=n.getArtifactDownloadUrl(i.run_id,_),pe=await fetch(ne);if(!pe.ok)throw new Error("Download failed");const Te=await pe.blob(),ae=document.createElement("a");ae.href=URL.createObjectURL(Te),ae.download=C?.kind||`artifact-${_}`,ae.click(),URL.revokeObjectURL(ae.href),w({message:"Download started",variant:"success"})}catch{w({message:"Download failed",variant:"error"})}};return e.jsxs(q,{children:[k&&e.jsxs("div",{className:"alert alert-info mb-4",children:['This run is the current baseline for project "',i.project,'"']}),e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:i.run_name||"Unnamed Run"}),e.jsx("p",{className:"text-muted text-sm font-mono",children:i.run_id})]}),e.jsxs("div",{className:"flex gap-2",children:[!k&&e.jsxs(O,{variant:"secondary",size:"sm",onClick:Ie,disabled:S,children:[S&&e.jsx(G,{}),"Set as Baseline"]}),e.jsx(O,{variant:"ghost-danger",size:"sm",onClick:()=>g(!0),children:"Delete"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Overview"})}),e.jsx($e,{items:[{label:"Project",value:e.jsx(T.Link,{to:`/runs?project=${i.project}`,children:i.project})},{label:"Name",value:i.run_name||"—"},{label:"Adapter",value:i.adapter||"N/A"},{label:"Status",value:e.jsx(Ze,{status:i.status})},{label:"Created",value:`${i.created_at} (${_e(i.created_at)})`},{label:"Backend",value:le.name||"N/A"},...i.group_id?[{label:"Group",value:e.jsx(T.Link,{to:`/groups/${i.group_id}`,children:i.group_name||Y(i.group_id)})}]:[]]})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Fingerprints"})}),e.jsx($e,{items:[{label:"Run",value:e.jsx("span",{className:"font-mono text-sm truncate",children:oe.run||"N/A"})},{label:"Program",value:e.jsx("span",{className:"font-mono text-sm truncate",children:oe.program||"N/A"})}]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Parameters"})}),Object.keys(ee).length?e.jsx(I,{children:e.jsx(U,{children:Object.entries(ee).map(([_,C])=>e.jsxs(f,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:String(C)})]},_))})}):e.jsx("p",{className:"text-muted",children:"No parameters"})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Metrics"})}),Object.keys(Se).length?e.jsx(I,{children:e.jsx(U,{children:Object.entries(Se).map(([_,C])=>e.jsxs(f,{children:[e.jsx(c,{children:_}),e.jsx(c,{className:"font-mono",children:typeof C=="number"?Ds(C):String(C)})]},_))})}):e.jsx("p",{className:"text-muted",children:"No metrics"})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Tags"})}),Object.keys(Ee).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(Ee).map(([_,C])=>e.jsxs(B,{variant:"gray",children:[_,": ",String(C)]},_))}):e.jsx("p",{className:"text-muted",children:"No tags"})]})]}),e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Artifacts (",de.length,")"]})}),de.length?e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"#"}),e.jsx(y,{children:"Kind"}),e.jsx(y,{children:"Role"}),e.jsx(y,{children:"Media Type"}),e.jsx(y,{children:"Digest"}),e.jsx(y,{children:"Actions"})]})}),e.jsx(U,{children:de.map((_,C)=>e.jsxs(f,{children:[e.jsx(c,{children:C}),e.jsx(c,{className:"font-mono text-sm",children:_.kind}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:_.role})}),e.jsx(c,{className:"text-muted text-sm",children:_.media_type}),e.jsx(c,{className:"font-mono text-sm",children:Oe(_.digest)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T.Link,{to:`/runs/${i.run_id}/artifacts/${C}`,children:e.jsx(O,{variant:"secondary",size:"sm",children:"View"})}),e.jsx(O,{variant:"secondary",size:"sm",onClick:()=>Pe(C),children:"Download"})]})})]},C))})]}):e.jsx("p",{className:"text-muted",children:"No artifacts"})]}),je.length>0&&e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{className:"text-danger",children:"Errors"})}),je.map((_,C)=>e.jsxs("div",{className:"mb-2",children:[e.jsx("strong",{children:_.type}),": ",_.message,_.traceback&&e.jsx("pre",{className:"mt-2",children:_.traceback})]},C))]}),e.jsxs(Xe,{open:x,onClose:()=>g(!1),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(O,{variant:"secondary",onClick:()=>g(!1),children:"Cancel"}),e.jsxs(O,{variant:"danger",onClick:Ue,disabled:K,children:[K&&e.jsx(G,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),e.jsx("p",{className:"font-mono text-sm mt-2",children:Y(i.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]}),j&&e.jsx(we,{message:j.message,variant:j.variant,visible:!!j,onClose:()=>w(null)})]})}function Ms(){const{currentWorkspace:r}=W(),{data:t,loading:n}=Re();return e.jsxs(q,{children:[e.jsx(fe,{title:"Projects"}),e.jsx(N,{children:n?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Bs,{projects:t??[],currentWorkspace:r})})]})}function qs(){const[r,t]=T.useSearchParams(),{data:n}=Re(),[i,d]=v.useState(r.get("project")||""),{data:o,loading:m,refetch:a}=Ps({project:i||void 0}),u=v.useCallback(x=>{d(x);const g=new URLSearchParams(r);x?g.set("project",x):g.delete("project"),t(g,{replace:!0})},[r,t]);return e.jsxs(q,{children:[e.jsx(fe,{title:"Run Groups"}),e.jsx(N,{className:"mb-4",children:e.jsxs(Qe,{children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"project",children:"Project"}),e.jsxs(re,{id:"project",value:i,onChange:x=>u(x.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),n?.map(x=>e.jsx("option",{value:x.name,children:x.name},x.name))]})]}),e.jsxs(X,{className:"flex items-end gap-2",children:[e.jsx(O,{variant:"primary",onClick:()=>a(),children:"Filter"}),m&&e.jsx(G,{})]})]})}),e.jsx(N,{children:m&&!o?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Is,{groups:o??[]})})]})}function Gs(){const{groupId:r}=T.useParams(),{api:t}=W(),{data:n,loading:i,error:d,refetch:o}=Ts(r),[m,a]=v.useState(null),u=me(g=>t.deleteRun(g));v.useEffect(()=>{if(m){const g=setTimeout(()=>a(null),3e3);return()=>clearTimeout(g)}},[m]);const x=async g=>{try{await u.mutate(g),a({message:"Run deleted",variant:"success"}),o()}catch{a({message:"Failed to delete run",variant:"error"})}};return i?e.jsx(q,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})}):d||!n?e.jsx(q,{children:e.jsx(N,{children:e.jsx(te,{message:"Group not found",hint:d?.message})})}):e.jsxs(q,{children:[e.jsx(fe,{title:e.jsxs(e.Fragment,{children:["Group ",e.jsx("span",{className:"font-mono",children:Y(r)})]}),subtitle:e.jsx("span",{className:"font-mono text-muted",children:r})}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsxs(A,{children:["Runs in Group (",n.runs.length,")"]})}),e.jsx(Be,{runs:n.runs,onDelete:x,loading:u.loading})]}),m&&e.jsx(we,{message:m.message,variant:m.variant,visible:!!m,onClose:()=>a(null)})]})}function Ne({match:r,yesText:t="✓ Match",noText:n="✗ Different"}){return e.jsx("span",{className:r?"diff-match":"diff-mismatch",children:r?t:n})}function Tr(){const[r,t]=T.useSearchParams(),{data:n}=Ke({limit:100}),i=n?.runs??[],[d,o]=v.useState(r.get("a")||""),[m,a]=v.useState(r.get("b")||""),[u,x]=v.useState(""),g=j=>{if(j.preventDefault(),!d||!m){x("Please select both runs to compare");return}x(""),t({a:d,b:m})};return e.jsxs(e.Fragment,{children:[e.jsx(N,{children:e.jsxs("form",{onSubmit:g,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"a",children:"Run A (Baseline)"}),e.jsxs(re,{id:"a",value:d,onChange:j=>{o(j.target.value),x("")},children:[e.jsx("option",{value:"",children:"Select run..."}),i.map(j=>e.jsxs("option",{value:j.run_id,children:[j.run_name||"Unnamed"," (",Y(j.run_id),") — ",j.project]},j.run_id))]})]}),e.jsxs(X,{children:[e.jsx(se,{htmlFor:"b",children:"Run B (Candidate)"}),e.jsxs(re,{id:"b",value:m,onChange:j=>{a(j.target.value),x("")},children:[e.jsx("option",{value:"",children:"Select run..."}),i.map(j=>e.jsxs("option",{value:j.run_id,children:[j.run_name||"Unnamed"," (",Y(j.run_id),") — ",j.project]},j.run_id))]})]})]}),u&&e.jsx("p",{className:"text-sm text-danger mb-3",children:u}),e.jsx("div",{className:"pt-2",children:e.jsx(O,{type:"submit",variant:"primary",children:"Compare"})})]})}),e.jsxs(N,{className:"mt-4",children:[e.jsx(D,{children:e.jsx(A,{children:"Tips"})}),e.jsxs("ul",{className:"text-muted text-sm list-disc pl-6 space-y-1",children:[e.jsx("li",{children:"Select two runs to compare their parameters, metrics, and artifacts"}),e.jsx("li",{children:"The diff will show changed values and compute TVD for result distributions"}),e.jsx("li",{children:"You can also compare from the run detail page"})]})]})]})}function Cr({runIdA:r,runIdB:t}){const{data:n,loading:i,error:d}=Cs(r,t);if(i)return e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})});if(d||!n)return e.jsx(N,{children:e.jsx(te,{message:"Failed to load diff",hint:d?.message})});const{run_a:o,run_b:m,report:a}=n;return e.jsxs(e.Fragment,{children:[a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"alert alert-warning mb-4",children:[e.jsx("strong",{children:"Warnings:"}),e.jsx("ul",{className:"list-disc pl-6 mt-1",children:a.warnings.map((u,x)=>e.jsx("li",{children:u},x))})]}),e.jsx(N,{className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run A (Baseline)"}),e.jsx("p",{children:e.jsx(T.Link,{to:`/runs/${o.run_id}`,children:o.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:Y(o.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[o.project," · ",_e(o.created_at)]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run B (Candidate)"}),e.jsx("p",{children:e.jsx(T.Link,{to:`/runs/${m.run_id}`,children:m.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:Y(m.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[m.project," · ",_e(m.created_at)]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Metadata"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Project"}),e.jsx(c,{children:e.jsx(Ne,{match:a.metadata.project_match})})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Backend"}),e.jsx(c,{children:e.jsx(Ne,{match:a.metadata.backend_match})})]}),!a.metadata.project_match&&e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project A"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.project_a||"N/A"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project B"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.project_b||"N/A"})]})]}),!a.metadata.backend_match&&e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend A"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.backend_a||"N/A"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend B"}),e.jsx(c,{className:"font-mono text-sm",children:a.metadata.backend_b||"N/A"})]})]})]})})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Fingerprints"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono text-sm",children:Oe(a.fingerprints.a)})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono text-sm",children:Oe(a.fingerprints.b)})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Match"}),e.jsx(c,{children:e.jsx(Ne,{match:a.fingerprints.a===a.fingerprints.b,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsxs(A,{children:["Program",a.program.exact_match?e.jsx(B,{variant:"success",children:"Exact Match"}):a.program.structural_match?e.jsx(B,{variant:"info",children:"Structural Match"}):e.jsx(B,{variant:"warning",children:"Different"})]})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Exact Match"}),e.jsx(c,{children:e.jsx(Ne,{match:a.program.exact_match,yesText:"✓ Yes",noText:"✗ No"})})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Structural Match"}),e.jsx(c,{children:e.jsx(Ne,{match:a.program.structural_match,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsxs(A,{children:["Device Calibration",a.device_drift?.significant_drift?e.jsx(B,{variant:"warning",children:"Drifted"}):a.device_drift?.has_calibration_data?e.jsx(B,{variant:"success",children:"Stable"}):e.jsx(B,{variant:"gray",children:"N/A"})]})}),a.device_drift?.significant_drift?e.jsx("p",{className:"text-sm text-warning",children:"⚠ Significant calibration drift detected"}):a.device_drift?.has_calibration_data?e.jsx("p",{className:"text-muted",children:"Calibration within acceptable thresholds"}):e.jsx("p",{className:"text-muted",children:"No calibration data available"})]})]}),e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Parameters ",e.jsx(B,{variant:a.params.match?"success":"warning",children:a.params.match?"Match":"Different"})]})}),a.params.match?e.jsx("p",{className:"text-muted",children:"All parameters match"}):e.jsx(e.Fragment,{children:a.params.changed&&Object.keys(a.params.changed).length>0&&e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Parameter"}),e.jsx(y,{children:"Run A"}),e.jsx(y,{children:"Run B"})]})}),e.jsx(U,{children:Object.entries(a.params.changed).map(([u,x])=>e.jsxs(f,{children:[e.jsx(c,{children:u}),e.jsx(c,{className:"font-mono",children:String(x.a)}),e.jsx(c,{className:"font-mono",children:String(x.b)})]},u))})]})})]}),e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Metrics ",e.jsx(B,{variant:a.metrics.match?"success":"warning",children:a.metrics.match?"Match":"Different"})]})}),a.metrics.match?e.jsx("p",{className:"text-muted",children:"All metrics match"}):e.jsx(e.Fragment,{children:a.metrics.changed&&Object.keys(a.metrics.changed).length>0&&e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Metric"}),e.jsx(y,{children:"Run A"}),e.jsx(y,{children:"Run B"})]})}),e.jsx(U,{children:Object.entries(a.metrics.changed).map(([u,x])=>e.jsxs(f,{children:[e.jsx(c,{children:u}),e.jsx(c,{className:"font-mono",children:x.a}),e.jsx(c,{className:"font-mono",children:x.b})]},u))})]})})]}),a.circuit_diff&&e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsxs(A,{children:["Circuit",e.jsx(B,{variant:a.circuit_diff.match?"success":"warning",children:a.circuit_diff.match?"Match":"Different"})]})}),a.circuit_diff.match?e.jsx("p",{className:"text-muted",children:"Circuit structure matches"}):e.jsxs(e.Fragment,{children:[a.circuit_diff.changed&&Object.keys(a.circuit_diff.changed).length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Changed"}),e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Property"}),e.jsx(y,{children:"Run A"}),e.jsx(y,{children:"Run B"}),e.jsx(y,{children:"Delta"})]})}),e.jsx(U,{children:Object.entries(a.circuit_diff.changed).map(([u,x])=>e.jsxs(f,{children:[e.jsx(c,{children:x.label||u}),e.jsx(c,{className:"font-mono",children:String(x.a)}),e.jsx(c,{className:"font-mono",children:String(x.b)}),e.jsx(c,{className:"font-mono",children:x.delta!=null&&e.jsxs(e.Fragment,{children:[x.delta>0?"+":"",x.delta,x.pct!=null&&` (${x.pct>0?"+":""}${x.pct.toFixed(1)}%)`]})})]},u))})]})]}),a.circuit_diff.is_clifford_changed&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Clifford Status"}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono",children:a.circuit_diff.is_clifford_a!=null?String(a.circuit_diff.is_clifford_a):"unknown"})]}),e.jsxs(f,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono",children:a.circuit_diff.is_clifford_b!=null?String(a.circuit_diff.is_clifford_b):"unknown"})]})]})})]}),a.circuit_diff.added_gates&&a.circuit_diff.added_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"New Gate Types (in B)"}),e.jsx("p",{className:"font-mono text-sm",children:a.circuit_diff.added_gates.join(", ")})]}),a.circuit_diff.removed_gates&&a.circuit_diff.removed_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Removed Gate Types (from A)"}),e.jsx("p",{className:"font-mono text-sm",children:a.circuit_diff.removed_gates.join(", ")})]})]})]}),a.tvd!=null&&e.jsxs(N,{className:"mb-4",children:[e.jsx(D,{children:e.jsx(A,{children:"Results"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{children:"Total Variation Distance (TVD)"}),e.jsx(c,{className:"font-mono",children:a.tvd.toFixed(6)})]}),a.shots&&e.jsxs(f,{children:[e.jsx(c,{children:"Total Shots (A / B)"}),e.jsxs(c,{className:"font-mono",children:[a.shots.a," / ",a.shots.b]})]}),a.noise_context?.noise_p95&&e.jsxs(f,{children:[e.jsx(c,{children:"Noise Threshold (p95)"}),e.jsx(c,{className:"font-mono",children:a.noise_context.noise_p95.toFixed(6)})]}),a.noise_context?.p_value!=null&&e.jsxs(f,{children:[e.jsx(c,{children:"p-value"}),e.jsx(c,{className:"font-mono",children:a.noise_context.p_value.toFixed(3)})]})]})}),a.tvd>0&&a.noise_context&&e.jsx("p",{className:"text-sm mt-4",children:a.noise_context.p_value!=null?a.noise_context.p_value>=.1?e.jsx("span",{className:"text-success",children:"✓ Consistent with sampling noise — difference is not statistically significant."}):a.noise_context.p_value>=.05?e.jsxs("span",{className:"text-warning",children:["⚠ Borderline (p=",a.noise_context.p_value.toFixed(2),"). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ Statistically significant difference (p=",a.noise_context.p_value.toFixed(2),") — results show meaningful divergence."]}):a.noise_context.noise_ratio!=null?a.noise_context.noise_ratio<1.5?e.jsx("span",{className:"text-success",children:"✓ TVD is within expected shot noise range."}):a.noise_context.noise_ratio<3?e.jsxs("span",{className:"text-warning",children:["⚠ Ambiguous (",a.noise_context.noise_ratio.toFixed(1),"× expected noise). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ TVD exceeds expected noise (",a.noise_context.noise_ratio.toFixed(1),"×) — results show meaningful differences."]}):null})]})]})}function Vs(){const[r]=T.useSearchParams(),t=r.get("a"),n=r.get("b"),i=t&&n;return e.jsxs(q,{children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"page-title",children:["Compare Runs",i&&e.jsx(B,{variant:"info",children:"Comparing"})]}),i&&e.jsx("p",{className:"text-muted text-sm",children:e.jsx(T.Link,{to:"/diff",children:"← Select different runs"})})]})}),i?e.jsx(Cr,{runIdA:t,runIdB:n}):e.jsx(Tr,{})]})}function Ws(){const{api:r}=W(),[t,n]=v.useState(""),[i,d]=v.useState(null),[o,m]=v.useState(!1),[a,u]=v.useState(""),{mutate:x,loading:g}=me(async()=>{const w=await r.listRuns({q:t,limit:100});return d(w.runs),m(!0),w}),j=w=>{if(w.preventDefault(),!t.trim()){u("Please enter a search query");return}u(""),x()};return e.jsxs(q,{children:[e.jsx("div",{className:"page-header",children:e.jsx("h1",{className:"page-title",children:"Search Runs"})}),e.jsx(N,{className:"mb-4",children:e.jsxs("form",{onSubmit:j,children:[e.jsxs(X,{children:[e.jsx(se,{htmlFor:"q",children:"Query"}),e.jsx(Le,{id:"q",type:"text",value:t,onChange:w=>{n(w.target.value),u("")},placeholder:"metric.fidelity > 0.95 and params.shots = 1000",className:"font-mono"})]}),a&&e.jsx("p",{className:"text-sm text-danger mb-3",children:a}),e.jsxs("div",{className:"flex gap-3 items-center pt-2",children:[e.jsxs(O,{type:"submit",variant:"primary",disabled:g,children:[g&&e.jsx(G,{}),"Search"]}),g&&e.jsx("span",{className:"text-muted text-sm",children:"Searching..."})]})]})}),o&&i&&e.jsx(N,{className:"mb-4",children:i.length>0?e.jsx(Be,{runs:i}):e.jsx("p",{className:"text-muted text-center py-8",children:"No runs match your query"})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Query Syntax"})}),e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Field"}),e.jsx(y,{children:"Description"})]})}),e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"params.X"}),e.jsx(c,{children:"Parameter value"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"metric.X"}),e.jsx(c,{children:"Metric value"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"tags.X"}),e.jsx(c,{children:"Tag value"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"status"}),e.jsx(c,{children:"Run status"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"project"}),e.jsx(c,{children:"Project name"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"backend"}),e.jsx(c,{children:"Backend name"})]})]})]})]}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Operators"})}),e.jsxs(I,{children:[e.jsx(Q,{children:e.jsxs(f,{children:[e.jsx(y,{children:"Operator"}),e.jsx(y,{children:"Description"})]})}),e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"="}),e.jsx(c,{children:"Equals"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"!="}),e.jsx(c,{children:"Not equals"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:">"}),e.jsx(c,{children:"Greater than"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:">="}),e.jsx(c,{children:"Greater or equal"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"<"}),e.jsx(c,{children:"Less than"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"<="}),e.jsx(c,{children:"Less or equal"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"~"}),e.jsx(c,{children:"Contains"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"and"}),e.jsx(c,{children:"Combine conditions"})]})]})]})]})]}),e.jsxs(N,{className:"mt-4",children:[e.jsx(D,{children:e.jsx(A,{children:"Examples"})}),e.jsx(I,{children:e.jsxs(U,{children:[e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"metric.fidelity > 0.95"}),e.jsx(c,{children:"High fidelity runs"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"params.shots = 1000 and status = FINISHED"}),e.jsx(c,{children:"Finished runs with 1000 shots"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"tags.backend ~ ibm"}),e.jsx(c,{children:"Runs with IBM backends"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"metric.error < 0.01"}),e.jsx(c,{children:"Low error runs"})]}),e.jsxs(f,{children:[e.jsx(c,{className:"font-mono",children:"project = vqe and metric.energy < -2.0"}),e.jsx(c,{children:"VQE runs with low energy"})]})]})})]})]})}function Ys(){const{runId:r,index:t}=T.useParams(),n=parseInt(t,10),{api:i}=W(),{data:d}=Je(r),{data:o,loading:m,error:a}=ks(r,n),[u,x]=v.useState(null);v.useEffect(()=>{if(u){const k=setTimeout(()=>x(null),3e3);return()=>clearTimeout(k)}},[u]);const g=async()=>{try{const k=i.getArtifactDownloadUrl(r,n),le=await fetch(k);if(!le.ok)throw new Error("Download failed");const oe=await le.blob(),ee=document.createElement("a");ee.href=URL.createObjectURL(oe),ee.download=j?.kind||`artifact-${n}`,ee.click(),URL.revokeObjectURL(ee.href),x({message:"Download started",variant:"success"})}catch{x({message:"Download failed",variant:"error"})}};if(m)return e.jsx(q,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(a||!o)return e.jsx(q,{children:e.jsx(N,{children:e.jsx(te,{message:"Artifact not found",hint:a?.message})})});const{artifact:j,size:w,content:H,content_json:S,preview_available:Z,error:K}=o,J=10*1024*1024;return e.jsxs(q,{children:[e.jsx(fe,{title:j.kind,subtitle:e.jsxs(e.Fragment,{children:["← Back to run ",e.jsxs(T.Link,{to:`/runs/${r}`,children:[Y(r),d?.run_name&&` — ${d.run_name}`]})]}),actions:e.jsx(O,{variant:"primary",onClick:g,children:"Download"})}),e.jsx(N,{className:"mb-4",children:e.jsx($e,{items:[{label:"Kind",value:e.jsx("span",{className:"font-mono",children:j.kind})},{label:"Role",value:e.jsx(B,{variant:"gray",children:j.role})},{label:"Media Type",value:j.media_type},{label:"Digest",value:e.jsx("span",{className:"font-mono text-sm",children:j.digest})},{label:"Size",value:ye(w)}]})}),e.jsxs(N,{children:[e.jsx(D,{children:e.jsx(A,{children:"Content"})}),K?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-danger",children:["Error loading artifact: ",K]}),e.jsx("p",{className:"text-muted mt-2",children:e.jsx(O,{variant:"primary",onClick:g,children:"Download to view"})})]}):Z?S?e.jsx("pre",{children:As(S)}):H?e.jsx("pre",{children:H}):e.jsxs("p",{className:"text-muted",children:["Binary content (",ye(w),") — download to view"]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted",children:[e.jsx("strong",{children:"Artifact too large for preview"})," (",ye(w)," exceeds ",ye(J)," limit)"]}),e.jsx("p",{className:"text-sm text-muted mt-2",children:"Download the artifact to view its contents."}),e.jsx("p",{className:"mt-4",children:e.jsx(O,{variant:"primary",onClick:g,children:"Download"})})]})]}),u&&e.jsx(we,{message:u.message,variant:u.variant,visible:!!u,onClose:()=>x(null)})]})}const zs=[{path:"/",element:e.jsx(T.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(Ls,{})},{path:"/runs/:runId",element:e.jsx(Us,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(Ys,{})},{path:"/projects",element:e.jsx(Ms,{})},{path:"/groups",element:e.jsx(qs,{})},{path:"/groups/:groupId",element:e.jsx(Gs,{})},{path:"/diff",element:e.jsx(Vs,{})},{path:"/search",element:e.jsx(Ws,{})}];function es(r=[]){return T.createBrowserRouter([...zs,...r])}const Hs=es();function kr({additionalRoutes:r,...t}){const n=r?.length?es(r):Hs;return e.jsx(Es,{...t,children:e.jsx(T.RouterProvider,{router:n})})}exports.Alert=Pr;exports.ApiClient=Rs;exports.ApiError=xe;exports.App=kr;exports.AppProvider=Es;exports.ArtifactPage=Ys;exports.Badge=B;exports.Button=O;exports.Card=N;exports.CardHeader=D;exports.CardTitle=A;exports.DiffPage=Vs;exports.EmptyState=te;exports.FormGroup=X;exports.FormRow=Qe;exports.GroupDetailPage=Gs;exports.GroupsPage=qs;exports.GroupsTable=Is;exports.Input=Le;exports.KVList=$e;exports.Label=se;exports.Layout=q;exports.LayoutConfigProvider=Er;exports.Modal=Xe;exports.PageHeader=fe;exports.ProjectsPage=Ms;exports.ProjectsTable=Bs;exports.RunDetailPage=Us;exports.RunsPage=Ls;exports.RunsTable=Be;exports.SearchPage=Ws;exports.Select=re;exports.Spinner=G;exports.StatusBadge=Ze;exports.Table=I;exports.TableBody=U;exports.TableCell=c;exports.TableHead=Q;exports.TableHeader=y;exports.TableRow=f;exports.Toast=we;exports.api=ws;exports.buildUrl=wr;exports.cn=L;exports.coreRoutes=zs;exports.createRouter=es;exports.formatBytes=ye;exports.formatNumber=Ds;exports.jsonPretty=As;exports.router=Hs;exports.shortDigest=Oe;exports.shortId=Y;exports.timeAgo=_e;exports.truncate=Fs;exports.useApp=W;exports.useArtifact=ks;exports.useDiff=Cs;exports.useGroup=Ts;exports.useGroups=Ps;exports.useLayoutConfig=$s;exports.useMutation=me;exports.useProjects=Re;exports.useRun=Je;exports.useRuns=Ke;
|
|
14
|
+
<%s key={someKey} {...props} />`,We,te,bs,te),pr[te+We]=!0}}return r===a?fs(k):ms(k),k}}function js(r,l,u){return gr(r,l,u,!0)}function ps(r,l,u){return gr(r,l,u,!1)}var gs=ps,vs=js;fe.Fragment=a,fe.jsx=gs,fe.jsxs=vs})()),fe}var Nr;function Rs(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?Ee.exports=ys():Ee.exports=_s()),Ee.exports}var e=Rs();class ce extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}class yr{baseUrl;headers;constructor(t={}){this.baseUrl=t.baseUrl??"",this.headers={"Content-Type":"application/json",...t.headers}}async request(t,n,a={}){let d=`${this.baseUrl}${n}`;if(a.params){const f=new URLSearchParams;Object.entries(a.params).forEach(([x,o])=>{o!=null&&o!==""&&f.set(x,String(o))});const i=f.toString();i&&(d+=`?${i}`)}const h=await fetch(d,{method:t,headers:this.headers,body:a.body?JSON.stringify(a.body):void 0});if(!h.ok){const f=await h.json().catch(()=>({detail:"Unknown error"}));throw new ce(h.status,f.detail||h.statusText)}if(!(h.status===204||h.headers.get("content-length")==="0"))return h.json()}async getCapabilities(){return this.request("GET","/api/v1/capabilities")}async listRuns(t){return this.request("GET","/api/runs",{params:t})}async getRun(t){return this.request("GET",`/api/runs/${t}`)}async deleteRun(t){await this.request("DELETE",`/api/runs/${t}`)}async setBaseline(t,n){return this.request("POST",`/api/projects/${t}/baseline/${n}`,{params:{redirect:"false"}})}async listProjects(t){return this.request("GET","/api/projects",{params:t})}async listGroups(t){return this.request("GET","/api/groups",{params:t})}async getGroup(t){return this.request("GET",`/api/groups/${t}`)}async getDiff(t,n){return this.request("GET","/api/diff",{params:{a:t,b:n}})}async getArtifact(t,n){return this.request("GET",`/api/runs/${t}/artifacts/${n}`)}getArtifactDownloadUrl(t,n){return`${this.baseUrl}/api/runs/${t}/artifacts/${n}/raw`}}const _r=new yr,Rr=y.createContext(null);function wr({children:s,api:t=_r,initialWorkspace:n=null}){const[a,d]=y.useState(null),[h,f]=y.useState(n);return y.useEffect(()=>{t.getCapabilities().then(d).catch(console.error)},[t]),e.jsx(Rr.Provider,{value:{api:t,capabilities:a,currentWorkspace:h,setCurrentWorkspace:f},children:s})}function W(){const s=y.useContext(Rr);if(!s)throw new Error("useApp must be used within AppProvider");return s}function ne(s,t=[]){const[n,a]=y.useState({data:null,loading:!0,error:null}),d=y.useRef(!0),h=y.useRef(s);h.current=s;const f=y.useCallback(async()=>{a(i=>({...i,loading:!0,error:null}));try{const i=await h.current();d.current&&a({data:i,loading:!1,error:null})}catch(i){d.current&&a({data:null,loading:!1,error:i instanceof ce?i:new ce(500,String(i))})}},[]);return y.useEffect(()=>(d.current=!0,f(),()=>{d.current=!1}),t),{...n,refetch:f}}function Ve(s){const{api:t,currentWorkspace:n}=W();return ne(()=>t.listRuns({...s,workspace:n?.id}),[t,n?.id,s?.project,s?.status,s?.q,s?.limit])}function Ye(s){const{api:t}=W();return ne(async()=>{const{run:n}=await t.getRun(s);return n},[t,s])}function ke(){const{api:s,currentWorkspace:t}=W();return ne(async()=>{const{projects:n}=await s.listProjects({workspace:t?.id});return n},[s,t?.id])}function Sr(s){const{api:t,currentWorkspace:n}=W();return ne(async()=>{const{groups:a}=await t.listGroups({...s,workspace:n?.id});return a},[t,n?.id,s?.project])}function Pr(s){const{api:t}=W();return ne(()=>t.getGroup(s),[t,s])}function Er(s,t){const{api:n}=W();return ne(()=>n.getDiff(s,t),[n,s,t])}function Tr(s,t){const{api:n}=W();return ne(()=>n.getArtifact(s,t),[n,s,t])}function le(s){const[t,n]=y.useState(!1),[a,d]=y.useState(null);return{mutate:y.useCallback(async(...f)=>{n(!0),d(null);try{return await s(...f)}catch(i){const x=i instanceof ce?i:new ce(500,String(i));throw d(x),x}finally{n(!1)}},[s]),loading:t,error:a}}function z(s){return s?.slice(0,8)??""}function Te(s){return s?.slice(0,12)??"N/A"}function ge(s){const t=new Date(s),a=Math.floor((new Date().getTime()-t.getTime())/1e3);if(a<60)return"just now";if(a<3600){const h=Math.floor(a/60);return`${h} minute${h!==1?"s":""} ago`}if(a<86400){const h=Math.floor(a/3600);return`${h} hour${h!==1?"s":""} ago`}if(a<2592e3){const h=Math.floor(a/86400);return`${h} day${h!==1?"s":""} ago`}if(a<31536e3){const h=Math.floor(a/2592e3);return`${h} month${h!==1?"s":""} ago`}const d=Math.floor(a/31536e3);return`${d} year${d!==1?"s":""} ago`}function Cr(s,t=6){return typeof s!="number"||isNaN(s)?String(s):Number(s.toPrecision(t)).toString()}function pe(s){return s<1024?`${s} bytes`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`}function kr(s){return JSON.stringify(s,null,2)}function Dr(s,t=60){return s?s.length<=t?s:s.slice(0,t-3)+"...":""}function ws(s,t){const n=new URLSearchParams;Object.entries(t).forEach(([d,h])=>{h!=null&&h!==""&&n.set(d,String(h))});const a=n.toString();return a?`${s}?${a}`:s}function A(...s){return s.filter(Boolean).join(" ")}const Ss=[{href:"/runs",label:"Runs",matchPaths:["/runs"]},{href:"/projects",label:"Projects",matchPaths:["/projects"]},{href:"/groups",label:"Groups",matchPaths:["/groups"]},{href:"/diff",label:"Compare",matchPaths:["/diff"]},{href:"/search",label:"Search",matchPaths:["/search"]}],Ar=y.createContext(null);function Ps({config:s,children:t}){return e.jsx(Ar.Provider,{value:s,children:t})}function Or(){return y.useContext(Ar)}function U({children:s,config:t}){const n=P.useLocation(),d={...Or(),...t},h=d?.navLinks??Ss,f=[...d?.prependNavLinks??[],...h,...d?.appendNavLinks??[]],i=d?.logo??{text:"devqubit",icon:"⚛"},x=o=>o.matchPaths?o.matchPaths.some(p=>n.pathname.startsWith(p)):n.pathname===o.href;return e.jsxs("div",{className:"min-h-screen bg-primary-bg",children:[e.jsx("header",{className:"bg-gray-900 h-14 sticky top-0 z-50",children:e.jsxs("div",{className:"max-w-container mx-auto px-6 h-full flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsxs(P.Link,{to:"/",className:"text-lg font-bold text-primary hover:text-primary-light flex items-center gap-1.5",children:[i.icon&&e.jsx("span",{children:i.icon}),i.text]}),e.jsx("nav",{className:"flex gap-1",children:f.map(o=>e.jsx(P.Link,{to:o.href,className:A("px-3 py-2 rounded-md text-sm font-medium transition-all",x(o)?"text-white bg-primary/20":"text-gray-400 hover:text-white hover:bg-white/10"),children:o.label},o.href))})]}),e.jsx("div",{className:"flex items-center gap-4",children:d?.headerRight})]})}),e.jsx("main",{className:"max-w-container mx-auto p-6",children:s})]})}function oe({title:s,subtitle:t,actions:n}){return e.jsxs("div",{className:"flex items-start justify-between mb-6 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-gray-900 flex items-center gap-2 flex-wrap",children:s}),t&&e.jsx("p",{className:"text-sm text-muted mt-1",children:t})]}),n&&e.jsx("div",{className:"flex gap-2",children:n})]})}function B({variant:s="gray",className:t,children:n,...a}){return e.jsx("span",{className:A("badge",`badge-${s}`,t),...a,children:n})}const D=y.forwardRef(({variant:s="secondary",size:t="default",loading:n,className:a,children:d,disabled:h,...f},i)=>e.jsxs("button",{ref:i,className:A("btn",s==="ghost-danger"?"btn-ghost-danger":`btn-${s}`,t==="sm"&&"btn-sm",a),disabled:h||n,...f,children:[n&&e.jsx(G,{}),d]}));D.displayName="Button";function v({className:s,children:t,...n}){return e.jsx("div",{className:A("card",s),...n,children:t})}function E({className:s,children:t,...n}){return e.jsx("div",{className:A("card-header",s),...n,children:t})}function T({className:s,children:t,...n}){return e.jsx("h3",{className:A("card-title",s),...n,children:t})}function Es({variant:s="info",className:t,children:n,...a}){return e.jsx("div",{className:A("alert",`alert-${s}`,t),...a,children:n})}function G({className:s,...t}){return e.jsx("span",{className:A("spinner",s),...t})}function re({message:s,hint:t,className:n,...a}){return e.jsxs("div",{className:A("empty-state",n),...a,children:[e.jsx("p",{children:s}),t&&e.jsx("p",{className:"text-sm text-muted mt-2",children:t})]})}function Ce({items:s,className:t,...n}){return e.jsx("dl",{className:A("kv-list",t),...n,children:s.map(({label:a,value:d})=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:d})]},a))})}function Fr({open:s,onClose:t,title:n,children:a,actions:d}){return s?e.jsx("div",{className:A("modal-backdrop",s&&"active"),onClick:h=>h.target===h.currentTarget&&t(),children:e.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),children:[e.jsx("h3",{className:"modal-title",children:n}),e.jsx("div",{className:"modal-body",children:a}),d&&e.jsx("div",{className:"modal-actions",children:d})]})}):null}function $r({message:s,variant:t="info",visible:n,onClose:a}){if(!n)return null;const d={success:"bg-success-bg text-[#065f46] border-[#a7f3d0]",error:"bg-danger-bg text-[#991b1b] border-[#fecaca]",info:"bg-info-bg text-[#1e40af] border-[#bfdbfe]"}[t];return e.jsx("div",{className:A("toast",d),onClick:a,children:s})}function J({children:s,className:t}){return e.jsx("div",{className:A("form-group",t),children:s})}function Z({className:s,children:t,...n}){return e.jsx("label",{className:A("form-label",s),...n,children:t})}const De=y.forwardRef(({className:s,...t},n)=>e.jsx("input",{ref:n,className:A("form-input",s),...t}));De.displayName="Input";const ee=y.forwardRef(({className:s,children:t,...n},a)=>e.jsx("select",{ref:a,className:A("form-input",s),...n,children:t}));ee.displayName="Select";function ze({children:s,className:t}){return e.jsx("div",{className:A("form-row",t),children:s})}function $({className:s,children:t,...n}){return e.jsx("table",{className:A("table",s),...n,children:t})}function X({className:s,children:t,...n}){return e.jsx("thead",{className:s,...n,children:t})}function L({className:s,children:t,...n}){return e.jsx("tbody",{className:s,...n,children:t})}function m({className:s,children:t,...n}){return e.jsx("tr",{className:s,...n,children:t})}function b({className:s,children:t,...n}){return e.jsx("th",{className:s,...n,children:t})}function c({className:s,children:t,...n}){return e.jsx("td",{className:s,...n,children:t})}function He({status:s}){const t={FINISHED:"success",FAILED:"danger",RUNNING:"warning",UNKNOWN:"gray"}[s];return e.jsx(B,{variant:t,children:s})}function Ae({runs:s,onDelete:t,loading:n,emptyHint:a}){return s.length?e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Run ID"}),e.jsx(b,{children:"Name"}),e.jsx(b,{children:"Project"}),e.jsx(b,{children:"Status"}),e.jsx(b,{children:"Created"}),e.jsx(b,{children:"Actions"})]})}),e.jsx(L,{children:s.map(d=>e.jsxs(m,{children:[e.jsx(c,{children:e.jsx(P.Link,{to:`/runs/${d.run_id}`,className:"font-mono",children:z(d.run_id)})}),e.jsx(c,{children:d.run_name||"—"}),e.jsx(c,{children:d.project}),e.jsx(c,{children:e.jsx(He,{status:d.status})}),e.jsx(c,{className:"text-muted",children:ge(d.created_at)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P.Link,{to:`/runs/${d.run_id}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View"})}),t&&e.jsx(D,{variant:"ghost-danger",size:"sm",onClick:()=>{confirm(`Delete run ${z(d.run_id)}? This cannot be undone.`)&&t(d.run_id)},disabled:n,children:"Delete"})]})})]},d.run_id))})]}):e.jsx(re,{message:"No runs found",hint:a??"Try adjusting your filters"})}function Lr(){const[s,t]=P.useSearchParams(),{api:n}=W(),{data:a}=ke(),[d,h]=y.useState({project:s.get("project")||"",status:s.get("status")||"",q:s.get("q")||"",limit:parseInt(s.get("limit")||"25",10)}),{data:f,loading:i,refetch:x}=Ve(d),o=le(_=>n.deleteRun(_)),p=y.useCallback((_,V)=>{h(de=>({...de,[_]:V}));const K=new URLSearchParams(s);V?K.set(_,String(V)):K.delete(_),t(K,{replace:!0})},[s,t]),I=y.useCallback(async _=>{await o.mutate(_),x()},[o,x]);return e.jsxs(U,{children:[e.jsx(oe,{title:"Runs"}),e.jsx(v,{className:"mb-4",children:e.jsxs(ze,{children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"project",children:"Project"}),e.jsxs(ee,{id:"project",value:d.project,onChange:_=>p("project",_.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),a?.map(_=>e.jsx("option",{value:_.name,children:_.name},_.name))]})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"status",children:"Status"}),e.jsxs(ee,{id:"status",value:d.status,onChange:_=>p("status",_.target.value),children:[e.jsx("option",{value:"",children:"All"}),e.jsx("option",{value:"FINISHED",children:"Finished"}),e.jsx("option",{value:"FAILED",children:"Failed"}),e.jsx("option",{value:"RUNNING",children:"Running"})]})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"q",children:"Query"}),e.jsx(De,{id:"q",value:d.q,onChange:_=>p("q",_.target.value),placeholder:"metric.fidelity > 0.9"})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"limit",children:"Limit"}),e.jsxs(ee,{id:"limit",value:d.limit,onChange:_=>p("limit",parseInt(_.target.value,10)),children:[e.jsx("option",{value:"25",children:"25"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]}),e.jsxs(J,{className:"flex items-end gap-2",children:[e.jsx(D,{variant:"primary",onClick:()=>x(),children:"Filter"}),i&&e.jsx(G,{})]})]})}),e.jsx(v,{children:i&&!f?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Ae,{runs:f?.runs??[],onDelete:I,loading:o.loading})})]})}function Br({projects:s,currentWorkspace:t}){if(!s.length)return e.jsx(re,{message:"No projects yet",hint:"Projects are created automatically when you log runs"});const n=a=>{const d=new URLSearchParams({project:a});return t&&d.set("workspace",t.id),`/runs?${d}`};return e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Project"}),e.jsx(b,{children:"Runs"}),e.jsx(b,{children:"Baseline"}),e.jsx(b,{})]})}),e.jsx(L,{children:s.map(a=>e.jsxs(m,{children:[e.jsxs(c,{children:[e.jsx("span",{className:"font-medium",children:a.name}),a.description&&e.jsx("p",{className:"text-muted text-sm",children:Dr(a.description)})]}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:a.run_count??0})}),e.jsx(c,{children:a.baseline?e.jsxs(e.Fragment,{children:[e.jsx(P.Link,{to:`/runs/${a.baseline.run_id}`,className:"font-mono text-sm",children:z(a.baseline.run_id)}),a.baseline.run_name&&e.jsx("p",{className:"text-muted text-sm",children:a.baseline.run_name})]}):e.jsx("span",{className:"text-muted",children:"—"})}),e.jsx(c,{className:"text-right",children:e.jsx(P.Link,{to:n(a.name),children:e.jsx(D,{variant:"secondary",size:"sm",children:"View Runs"})})})]},a.name))})]})}function Ir({groups:s}){return s.length?e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Group ID"}),e.jsx(b,{children:"Name"}),e.jsx(b,{children:"Project"}),e.jsx(b,{children:"Runs"}),e.jsx(b,{children:"Actions"})]})}),e.jsx(L,{children:s.map(t=>e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:z(t.group_id)}),e.jsx(c,{children:t.group_name||"—"}),e.jsx(c,{children:t.project}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:t.run_count})}),e.jsx(c,{children:e.jsx(P.Link,{to:`/groups/${t.group_id}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View Runs"})})})]},t.group_id))})]}):e.jsx(re,{message:"No groups found",hint:"Groups are created when runs have a group_id set"})}function Mr(){const{runId:s}=P.useParams(),t=P.useNavigate(),{api:n}=W(),{data:a,loading:d,error:h,refetch:f}=Ye(s),[i,x]=y.useState(!1),[o,p]=y.useState(null),{mutate:I,loading:_}=le(()=>n.setBaseline(a.project,a.run_id)),{mutate:V,loading:K}=le(()=>n.deleteRun(s));if(y.useEffect(()=>{if(o){const S=setTimeout(()=>p(null),3e3);return()=>clearTimeout(S)}},[o]),d)return e.jsx(U,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(h||!a)return e.jsx(U,{children:e.jsx(v,{children:e.jsx(re,{message:"Run not found",hint:h?.message||`Run ${s} does not exist`})})});const de=a.backend||{},ve=a.fingerprints||{},Q=a.data?.params||{},O=a.data?.metrics||{},be=a.data?.tags||{},ue=a.artifacts||[],Ne=a.errors||[],Oe=async()=>{await I(),f()},Fe=async()=>{await V(),t("/runs")},$e=async S=>{try{const F=n.getArtifactDownloadUrl(a.run_id,S),ye=await fetch(F);if(!ye.ok)throw new Error("Download failed");const _e=await ye.blob(),Y=document.createElement("a");Y.href=URL.createObjectURL(_e),Y.download=`artifact-${S}`,Y.click(),URL.revokeObjectURL(Y.href),p({message:"Download started",variant:"success"})}catch{p({message:"Download failed",variant:"error"})}};return e.jsxs(U,{children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"page-title",children:a.run_name||"Unnamed Run"}),e.jsx("p",{className:"text-muted text-sm font-mono",children:a.run_id})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(D,{variant:"secondary",size:"sm",onClick:Oe,disabled:_,children:[_&&e.jsx(G,{}),"Set as Baseline"]}),e.jsx(D,{variant:"ghost-danger",size:"sm",onClick:()=>x(!0),children:"Delete"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Overview"})}),e.jsx(Ce,{items:[{label:"Project",value:e.jsx(P.Link,{to:`/runs?project=${a.project}`,children:a.project})},{label:"Name",value:a.run_name||"—"},{label:"Adapter",value:a.adapter||"N/A"},{label:"Status",value:e.jsx(He,{status:a.status})},{label:"Created",value:`${a.created_at} (${ge(a.created_at)})`},{label:"Backend",value:de.name||"N/A"},...a.group_id?[{label:"Group",value:e.jsx(P.Link,{to:`/groups/${a.group_id}`,children:a.group_name||z(a.group_id)})}]:[]]})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Fingerprints"})}),e.jsx(Ce,{items:[{label:"Run",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ve.run||"N/A"})},{label:"Program",value:e.jsx("span",{className:"font-mono text-sm truncate",children:ve.program||"N/A"})}]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Parameters"})}),Object.keys(Q).length?e.jsx($,{children:e.jsx(L,{children:Object.entries(Q).map(([S,F])=>e.jsxs(m,{children:[e.jsx(c,{children:S}),e.jsx(c,{className:"font-mono",children:String(F)})]},S))})}):e.jsx("p",{className:"text-muted",children:"No parameters"})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Metrics"})}),Object.keys(O).length?e.jsx($,{children:e.jsx(L,{children:Object.entries(O).map(([S,F])=>e.jsxs(m,{children:[e.jsx(c,{children:S}),e.jsx(c,{className:"font-mono",children:typeof F=="number"?Cr(F):String(F)})]},S))})}):e.jsx("p",{className:"text-muted",children:"No metrics"})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Tags"})}),Object.keys(be).length?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(be).map(([S,F])=>e.jsxs(B,{variant:"gray",children:[S,": ",String(F)]},S))}):e.jsx("p",{className:"text-muted",children:"No tags"})]})]}),e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Artifacts (",ue.length,")"]})}),ue.length?e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"#"}),e.jsx(b,{children:"Kind"}),e.jsx(b,{children:"Role"}),e.jsx(b,{children:"Media Type"}),e.jsx(b,{children:"Digest"}),e.jsx(b,{children:"Actions"})]})}),e.jsx(L,{children:ue.map((S,F)=>e.jsxs(m,{children:[e.jsx(c,{children:F}),e.jsx(c,{className:"font-mono text-sm",children:S.kind}),e.jsx(c,{children:e.jsx(B,{variant:"gray",children:S.role})}),e.jsx(c,{className:"text-muted text-sm",children:S.media_type}),e.jsx(c,{className:"font-mono text-sm",children:Te(S.digest)}),e.jsx(c,{children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P.Link,{to:`/runs/${a.run_id}/artifacts/${F}`,children:e.jsx(D,{variant:"secondary",size:"sm",children:"View"})}),e.jsx(D,{variant:"secondary",size:"sm",onClick:()=>$e(F),children:"Download"})]})})]},F))})]}):e.jsx("p",{className:"text-muted",children:"No artifacts"})]}),Ne.length>0&&e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{className:"text-danger",children:"Errors"})}),Ne.map((S,F)=>e.jsxs("div",{className:"mb-2",children:[e.jsx("strong",{children:S.type}),": ",S.message,S.traceback&&e.jsx("pre",{className:"mt-2",children:S.traceback})]},F))]}),e.jsxs(Fr,{open:i,onClose:()=>x(!1),title:"Delete Run",actions:e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"secondary",onClick:()=>x(!1),children:"Cancel"}),e.jsxs(D,{variant:"danger",onClick:Fe,disabled:K,children:[K&&e.jsx(G,{}),"Delete"]})]}),children:[e.jsx("p",{children:"Are you sure you want to delete this run?"}),e.jsx("p",{className:"font-mono text-sm mt-2",children:z(a.run_id)}),e.jsx("p",{className:"text-sm text-danger mt-2",children:"This action cannot be undone."})]}),o&&e.jsx($r,{message:o.message,variant:o.variant,visible:!!o,onClose:()=>p(null)})]})}function Ur(){const{currentWorkspace:s}=W(),{data:t,loading:n}=ke();return e.jsxs(U,{children:[e.jsx(oe,{title:"Projects"}),e.jsx(v,{children:n?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Br,{projects:t??[],currentWorkspace:s})})]})}function qr(){const[s,t]=P.useSearchParams(),{data:n}=ke(),[a,d]=y.useState(s.get("project")||""),{data:h,loading:f,refetch:i}=Sr({project:a||void 0}),x=y.useCallback(o=>{d(o);const p=new URLSearchParams(s);o?p.set("project",o):p.delete("project"),t(p,{replace:!0})},[s,t]);return e.jsxs(U,{children:[e.jsx(oe,{title:"Run Groups"}),e.jsx(v,{className:"mb-4",children:e.jsxs(ze,{children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"project",children:"Project"}),e.jsxs(ee,{id:"project",value:a,onChange:o=>x(o.target.value),children:[e.jsx("option",{value:"",children:"All projects"}),n?.map(o=>e.jsx("option",{value:o.name,children:o.name},o.name))]})]}),e.jsxs(J,{className:"flex items-end gap-2",children:[e.jsx(D,{variant:"primary",onClick:()=>i(),children:"Filter"}),f&&e.jsx(G,{})]})]})}),e.jsx(v,{children:f&&!h?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(G,{})}):e.jsx(Ir,{groups:h??[]})})]})}function Gr(){const{groupId:s}=P.useParams(),{api:t}=W(),{data:n,loading:a,error:d,refetch:h}=Pr(s),f=le(x=>t.deleteRun(x)),i=async x=>{await f.mutate(x),h()};return a?e.jsx(U,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})}):d||!n?e.jsx(U,{children:e.jsx(v,{children:e.jsx(re,{message:"Group not found",hint:d?.message})})}):e.jsxs(U,{children:[e.jsx(oe,{title:e.jsxs(e.Fragment,{children:["Group ",e.jsx("span",{className:"font-mono",children:z(s)})]}),subtitle:e.jsx("span",{className:"font-mono text-muted",children:s})}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsxs(T,{children:["Runs in Group (",n.runs.length,")"]})}),e.jsx(Ae,{runs:n.runs,onDelete:i,loading:f.loading})]})]})}function je({match:s,yesText:t="✓ Match",noText:n="✗ Different"}){return e.jsx("span",{className:s?"diff-match":"diff-mismatch",children:s?t:n})}function Ts(){const[s,t]=P.useSearchParams(),{data:n}=Ve({limit:100}),a=n?.runs??[],[d,h]=y.useState(s.get("a")||""),[f,i]=y.useState(s.get("b")||""),x=o=>{o.preventDefault(),d&&f&&t({a:d,b:f})};return e.jsxs(e.Fragment,{children:[e.jsx(v,{children:e.jsxs("form",{onSubmit:x,children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"a",children:"Run A (Baseline)"}),e.jsxs(ee,{id:"a",value:d,onChange:o=>h(o.target.value),required:!0,children:[e.jsx("option",{value:"",children:"Select run..."}),a.map(o=>e.jsxs("option",{value:o.run_id,children:[o.run_name||"Unnamed"," (",z(o.run_id),") — ",o.project]},o.run_id))]})]}),e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"b",children:"Run B (Candidate)"}),e.jsxs(ee,{id:"b",value:f,onChange:o=>i(o.target.value),required:!0,children:[e.jsx("option",{value:"",children:"Select run..."}),a.map(o=>e.jsxs("option",{value:o.run_id,children:[o.run_name||"Unnamed"," (",z(o.run_id),") — ",o.project]},o.run_id))]})]})]}),e.jsx(D,{type:"submit",variant:"primary",disabled:!d||!f,children:"Compare"})]})}),e.jsxs(v,{className:"mt-4",children:[e.jsx(E,{children:e.jsx(T,{children:"Tips"})}),e.jsxs("ul",{className:"text-muted text-sm list-disc pl-6 space-y-1",children:[e.jsx("li",{children:"Select two runs to compare their parameters, metrics, and artifacts"}),e.jsx("li",{children:"The diff will show changed values and compute TVD for result distributions"}),e.jsx("li",{children:"You can also compare from the run detail page"})]})]})]})}function Cs({runIdA:s,runIdB:t}){const{data:n,loading:a,error:d}=Er(s,t);if(a)return e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})});if(d||!n)return e.jsx(v,{children:e.jsx(re,{message:"Failed to load diff",hint:d?.message})});const{run_a:h,run_b:f,report:i}=n;return e.jsxs(e.Fragment,{children:[i.warnings&&i.warnings.length>0&&e.jsxs("div",{className:"alert alert-warning mb-4",children:[e.jsx("strong",{children:"Warnings:"}),e.jsx("ul",{className:"list-disc pl-6 mt-1",children:i.warnings.map((x,o)=>e.jsx("li",{children:x},o))})]}),e.jsx(v,{className:"mb-4",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run A (Baseline)"}),e.jsx("p",{children:e.jsx(P.Link,{to:`/runs/${h.run_id}`,children:h.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:z(h.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[h.project," · ",ge(h.created_at)]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm text-muted uppercase tracking-wider mb-1",children:"Run B (Candidate)"}),e.jsx("p",{children:e.jsx(P.Link,{to:`/runs/${f.run_id}`,children:f.run_name||"Unnamed Run"})}),e.jsx("p",{className:"font-mono text-sm text-muted",children:z(f.run_id)}),e.jsxs("p",{className:"text-muted text-sm",children:[f.project," · ",ge(f.created_at)]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Metadata"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Project"}),e.jsx(c,{children:e.jsx(je,{match:i.metadata.project_match})})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Backend"}),e.jsx(c,{children:e.jsx(je,{match:i.metadata.backend_match})})]}),!i.metadata.project_match&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_a||"N/A"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Project B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.project_b||"N/A"})]})]}),!i.metadata.backend_match&&e.jsxs(e.Fragment,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend A"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_a||"N/A"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"text-muted text-sm",children:"Backend B"}),e.jsx(c,{className:"font-mono text-sm",children:i.metadata.backend_b||"N/A"})]})]})]})})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Fingerprints"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono text-sm",children:Te(i.fingerprints.a)})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono text-sm",children:Te(i.fingerprints.b)})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Match"}),e.jsx(c,{children:e.jsx(je,{match:i.fingerprints.a===i.fingerprints.b,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsxs(T,{children:["Program",i.program.exact_match?e.jsx(B,{variant:"success",children:"Exact Match"}):i.program.structural_match?e.jsx(B,{variant:"info",children:"Structural Match"}):e.jsx(B,{variant:"warning",children:"Different"})]})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Exact Match"}),e.jsx(c,{children:e.jsx(je,{match:i.program.exact_match,yesText:"✓ Yes",noText:"✗ No"})})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Structural Match"}),e.jsx(c,{children:e.jsx(je,{match:i.program.structural_match,yesText:"✓ Yes",noText:"✗ No"})})]})]})})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsxs(T,{children:["Device Calibration",i.device_drift?.significant_drift?e.jsx(B,{variant:"warning",children:"Drifted"}):i.device_drift?.has_calibration_data?e.jsx(B,{variant:"success",children:"Stable"}):e.jsx(B,{variant:"gray",children:"N/A"})]})}),i.device_drift?.significant_drift?e.jsx("p",{className:"text-sm text-warning",children:"⚠ Significant calibration drift detected"}):i.device_drift?.has_calibration_data?e.jsx("p",{className:"text-muted",children:"Calibration within acceptable thresholds"}):e.jsx("p",{className:"text-muted",children:"No calibration data available"})]})]}),e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Parameters ",e.jsx(B,{variant:i.params.match?"success":"warning",children:i.params.match?"Match":"Different"})]})}),i.params.match?e.jsx("p",{className:"text-muted",children:"All parameters match"}):e.jsx(e.Fragment,{children:i.params.changed&&Object.keys(i.params.changed).length>0&&e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Parameter"}),e.jsx(b,{children:"Run A"}),e.jsx(b,{children:"Run B"})]})}),e.jsx(L,{children:Object.entries(i.params.changed).map(([x,o])=>e.jsxs(m,{children:[e.jsx(c,{children:x}),e.jsx(c,{className:"font-mono",children:String(o.a)}),e.jsx(c,{className:"font-mono",children:String(o.b)})]},x))})]})})]}),e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Metrics ",e.jsx(B,{variant:i.metrics.match?"success":"warning",children:i.metrics.match?"Match":"Different"})]})}),i.metrics.match?e.jsx("p",{className:"text-muted",children:"All metrics match"}):e.jsx(e.Fragment,{children:i.metrics.changed&&Object.keys(i.metrics.changed).length>0&&e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Metric"}),e.jsx(b,{children:"Run A"}),e.jsx(b,{children:"Run B"})]})}),e.jsx(L,{children:Object.entries(i.metrics.changed).map(([x,o])=>e.jsxs(m,{children:[e.jsx(c,{children:x}),e.jsx(c,{className:"font-mono",children:o.a}),e.jsx(c,{className:"font-mono",children:o.b})]},x))})]})})]}),i.circuit_diff&&e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsxs(T,{children:["Circuit",e.jsx(B,{variant:i.circuit_diff.match?"success":"warning",children:i.circuit_diff.match?"Match":"Different"})]})}),i.circuit_diff.match?e.jsx("p",{className:"text-muted",children:"Circuit structure matches"}):e.jsxs(e.Fragment,{children:[i.circuit_diff.changed&&Object.keys(i.circuit_diff.changed).length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Changed"}),e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Property"}),e.jsx(b,{children:"Run A"}),e.jsx(b,{children:"Run B"}),e.jsx(b,{children:"Delta"})]})}),e.jsx(L,{children:Object.entries(i.circuit_diff.changed).map(([x,o])=>e.jsxs(m,{children:[e.jsx(c,{children:o.label||x}),e.jsx(c,{className:"font-mono",children:String(o.a)}),e.jsx(c,{className:"font-mono",children:String(o.b)}),e.jsx(c,{className:"font-mono",children:o.delta!=null&&e.jsxs(e.Fragment,{children:[o.delta>0?"+":"",o.delta,o.pct!=null&&` (${o.pct>0?"+":""}${o.pct.toFixed(1)}%)`]})})]},x))})]})]}),i.circuit_diff.is_clifford_changed&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Clifford Status"}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Run A"}),e.jsx(c,{className:"font-mono",children:i.circuit_diff.is_clifford_a!=null?String(i.circuit_diff.is_clifford_a):"unknown"})]}),e.jsxs(m,{children:[e.jsx(c,{children:"Run B"}),e.jsx(c,{className:"font-mono",children:i.circuit_diff.is_clifford_b!=null?String(i.circuit_diff.is_clifford_b):"unknown"})]})]})})]}),i.circuit_diff.added_gates&&i.circuit_diff.added_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"New Gate Types (in B)"}),e.jsx("p",{className:"font-mono text-sm",children:i.circuit_diff.added_gates.join(", ")})]}),i.circuit_diff.removed_gates&&i.circuit_diff.removed_gates.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h4",{className:"text-sm text-muted mb-2",children:"Removed Gate Types (from A)"}),e.jsx("p",{className:"font-mono text-sm",children:i.circuit_diff.removed_gates.join(", ")})]})]})]}),i.tvd!=null&&e.jsxs(v,{className:"mb-4",children:[e.jsx(E,{children:e.jsx(T,{children:"Results"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{children:"Total Variation Distance (TVD)"}),e.jsx(c,{className:"font-mono",children:i.tvd.toFixed(6)})]}),i.shots&&e.jsxs(m,{children:[e.jsx(c,{children:"Total Shots (A / B)"}),e.jsxs(c,{className:"font-mono",children:[i.shots.a," / ",i.shots.b]})]}),i.noise_context?.noise_p95&&e.jsxs(m,{children:[e.jsx(c,{children:"Noise Threshold (p95)"}),e.jsx(c,{className:"font-mono",children:i.noise_context.noise_p95.toFixed(6)})]}),i.noise_context?.p_value!=null&&e.jsxs(m,{children:[e.jsx(c,{children:"p-value"}),e.jsx(c,{className:"font-mono",children:i.noise_context.p_value.toFixed(3)})]})]})}),i.tvd>0&&i.noise_context&&e.jsx("p",{className:"text-sm mt-4",children:i.noise_context.p_value!=null?i.noise_context.p_value>=.1?e.jsx("span",{className:"text-success",children:"✓ Consistent with sampling noise — difference is not statistically significant."}):i.noise_context.p_value>=.05?e.jsxs("span",{className:"text-warning",children:["⚠ Borderline (p=",i.noise_context.p_value.toFixed(2),"). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ Statistically significant difference (p=",i.noise_context.p_value.toFixed(2),") — results show meaningful divergence."]}):i.noise_context.noise_ratio!=null?i.noise_context.noise_ratio<1.5?e.jsx("span",{className:"text-success",children:"✓ TVD is within expected shot noise range."}):i.noise_context.noise_ratio<3?e.jsxs("span",{className:"text-warning",children:["⚠ Ambiguous (",i.noise_context.noise_ratio.toFixed(1),"× expected noise). Consider increasing shots."]}):e.jsxs("span",{className:"text-danger",children:["✗ TVD exceeds expected noise (",i.noise_context.noise_ratio.toFixed(1),"×) — results show meaningful differences."]}):null})]})]})}function Wr(){const[s]=P.useSearchParams(),t=s.get("a"),n=s.get("b"),a=t&&n;return e.jsxs(U,{children:[e.jsx("div",{className:"page-header",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"page-title",children:["Compare Runs",a&&e.jsx(B,{variant:"info",children:"Comparing"})]}),a&&e.jsx("p",{className:"text-muted text-sm",children:e.jsx(P.Link,{to:"/diff",children:"← Select different runs"})})]})}),a?e.jsx(Cs,{runIdA:t,runIdB:n}):e.jsx(Ts,{})]})}function Vr(){const{api:s}=W(),[t,n]=y.useState(""),[a,d]=y.useState(null),[h,f]=y.useState(!1),{mutate:i,loading:x}=le(async()=>{const p=await s.listRuns({q:t,limit:100});return d(p.runs),f(!0),p}),o=p=>{p.preventDefault(),t.trim()&&i()};return e.jsxs(U,{children:[e.jsx("div",{className:"page-header",children:e.jsx("h1",{className:"page-title",children:"Search Runs"})}),e.jsx(v,{className:"mb-4",children:e.jsxs("form",{onSubmit:o,children:[e.jsxs(J,{children:[e.jsx(Z,{htmlFor:"q",children:"Query"}),e.jsx(De,{id:"q",type:"text",value:t,onChange:p=>n(p.target.value),placeholder:"metric.fidelity > 0.95 and params.shots = 1000",className:"font-mono"})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs(D,{type:"submit",variant:"primary",disabled:x||!t.trim(),children:[x&&e.jsx(G,{}),"Search"]}),x&&e.jsx("span",{className:"text-muted text-sm",children:"Searching..."})]})]})}),h&&a&&e.jsx(v,{className:"mb-4",children:a.length>0?e.jsx(Ae,{runs:a}):e.jsx("p",{className:"text-muted text-center py-8",children:"No runs match your query"})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Query Syntax"})}),e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Field"}),e.jsx(b,{children:"Description"})]})}),e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"params.X"}),e.jsx(c,{children:"Parameter value"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"metric.X"}),e.jsx(c,{children:"Metric value"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"tags.X"}),e.jsx(c,{children:"Tag value"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"status"}),e.jsx(c,{children:"Run status"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"project"}),e.jsx(c,{children:"Project name"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"backend"}),e.jsx(c,{children:"Backend name"})]})]})]})]}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Operators"})}),e.jsxs($,{children:[e.jsx(X,{children:e.jsxs(m,{children:[e.jsx(b,{children:"Operator"}),e.jsx(b,{children:"Description"})]})}),e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"="}),e.jsx(c,{children:"Equals"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"!="}),e.jsx(c,{children:"Not equals"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:">"}),e.jsx(c,{children:"Greater than"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:">="}),e.jsx(c,{children:"Greater or equal"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"<"}),e.jsx(c,{children:"Less than"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"<="}),e.jsx(c,{children:"Less or equal"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"~"}),e.jsx(c,{children:"Contains"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"and"}),e.jsx(c,{children:"Combine conditions"})]})]})]})]})]}),e.jsxs(v,{className:"mt-4",children:[e.jsx(E,{children:e.jsx(T,{children:"Examples"})}),e.jsx($,{children:e.jsxs(L,{children:[e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"metric.fidelity > 0.95"}),e.jsx(c,{children:"High fidelity runs"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"params.shots = 1000 and status = FINISHED"}),e.jsx(c,{children:"Finished runs with 1000 shots"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"tags.backend ~ ibm"}),e.jsx(c,{children:"Runs with IBM backends"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"metric.error < 0.01"}),e.jsx(c,{children:"Low error runs"})]}),e.jsxs(m,{children:[e.jsx(c,{className:"font-mono",children:"project = vqe and metric.energy < -2.0"}),e.jsx(c,{children:"VQE runs with low energy"})]})]})})]})]})}function Yr(){const{runId:s,index:t}=P.useParams(),n=parseInt(t,10),{api:a}=W(),{data:d}=Ye(s),{data:h,loading:f,error:i}=Tr(s,n);if(f)return e.jsx(U,{children:e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(G,{})})});if(i||!h)return e.jsx(U,{children:e.jsx(v,{children:e.jsx(re,{message:"Artifact not found",hint:i?.message})})});const{artifact:x,size:o,content:p,content_json:I,preview_available:_,error:V}=h,K=10*1024*1024;return e.jsxs(U,{children:[e.jsx(oe,{title:x.kind,subtitle:e.jsxs(e.Fragment,{children:["← Back to run ",e.jsxs(P.Link,{to:`/runs/${s}`,children:[z(s),d?.run_name&&` — ${d.run_name}`]})]}),actions:e.jsx("a",{href:a.getArtifactDownloadUrl(s,n),children:e.jsx(D,{variant:"primary",children:"Download"})})}),e.jsx(v,{className:"mb-4",children:e.jsx(Ce,{items:[{label:"Kind",value:e.jsx("span",{className:"font-mono",children:x.kind})},{label:"Role",value:e.jsx(B,{variant:"gray",children:x.role})},{label:"Media Type",value:x.media_type},{label:"Digest",value:e.jsx("span",{className:"font-mono text-sm",children:x.digest})},{label:"Size",value:pe(o)}]})}),e.jsxs(v,{children:[e.jsx(E,{children:e.jsx(T,{children:"Content"})}),V?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-danger",children:["⚠ Error loading artifact: ",V]}),e.jsx("p",{className:"text-muted mt-2",children:e.jsx("a",{href:a.getArtifactDownloadUrl(s,n),children:e.jsx(D,{variant:"primary",children:"Download to view"})})})]}):_?I?e.jsx("pre",{children:kr(I)}):p?e.jsx("pre",{children:p}):e.jsxs("p",{className:"text-muted",children:["Binary content (",pe(o),") — download to view"]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted",children:[e.jsx("strong",{children:"Artifact too large for preview"})," (",pe(o)," exceeds ",pe(K)," limit)"]}),e.jsx("p",{className:"text-sm text-muted mt-2",children:"Download the artifact to view its contents."}),e.jsx("p",{className:"mt-4",children:e.jsx("a",{href:a.getArtifactDownloadUrl(s,n),children:e.jsx(D,{variant:"primary",children:"Download"})})})]})]})]})}const zr=[{path:"/",element:e.jsx(P.Navigate,{to:"/runs",replace:!0})},{path:"/runs",element:e.jsx(Lr,{})},{path:"/runs/:runId",element:e.jsx(Mr,{})},{path:"/runs/:runId/artifacts/:index",element:e.jsx(Yr,{})},{path:"/projects",element:e.jsx(Ur,{})},{path:"/groups",element:e.jsx(qr,{})},{path:"/groups/:groupId",element:e.jsx(Gr,{})},{path:"/diff",element:e.jsx(Wr,{})},{path:"/search",element:e.jsx(Vr,{})}];function Ke(s=[]){return P.createBrowserRouter([...zr,...s])}const Hr=Ke();function ks({additionalRoutes:s,...t}){const n=s?.length?Ke(s):Hr;return e.jsx(wr,{...t,children:e.jsx(P.RouterProvider,{router:n})})}exports.Alert=Es;exports.ApiClient=yr;exports.ApiError=ce;exports.App=ks;exports.AppProvider=wr;exports.ArtifactPage=Yr;exports.Badge=B;exports.Button=D;exports.Card=v;exports.CardHeader=E;exports.CardTitle=T;exports.DiffPage=Wr;exports.EmptyState=re;exports.FormGroup=J;exports.FormRow=ze;exports.GroupDetailPage=Gr;exports.GroupsPage=qr;exports.GroupsTable=Ir;exports.Input=De;exports.KVList=Ce;exports.Label=Z;exports.Layout=U;exports.LayoutConfigProvider=Ps;exports.Modal=Fr;exports.PageHeader=oe;exports.ProjectsPage=Ur;exports.ProjectsTable=Br;exports.RunDetailPage=Mr;exports.RunsPage=Lr;exports.RunsTable=Ae;exports.SearchPage=Vr;exports.Select=ee;exports.Spinner=G;exports.StatusBadge=He;exports.Table=$;exports.TableBody=L;exports.TableCell=c;exports.TableHead=X;exports.TableHeader=b;exports.TableRow=m;exports.Toast=$r;exports.api=_r;exports.buildUrl=ws;exports.cn=A;exports.coreRoutes=zr;exports.createRouter=Ke;exports.formatBytes=pe;exports.formatNumber=Cr;exports.jsonPretty=kr;exports.router=Hr;exports.shortDigest=Te;exports.shortId=z;exports.timeAgo=ge;exports.truncate=Dr;exports.useApp=W;exports.useArtifact=Tr;exports.useDiff=Er;exports.useGroup=Pr;exports.useGroups=Sr;exports.useLayoutConfig=Or;exports.useMutation=le;exports.useProjects=ke;exports.useRun=Ye;exports.useRuns=Ve;
|