evalution 1.0.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSING.md +26 -44
- package/dist/{check-BTg6THHB.d.ts → check-ci7RhMcB.d.ts} +21 -848
- package/dist/checks/index.d.ts +2 -1
- package/dist/cli/index.js +257 -77
- package/dist/client/assets/DatasetView-BqSWI_pm.js +15 -0
- package/dist/client/assets/EvalRunView-CR6ZksSu.js +2 -0
- package/dist/client/assets/EvalView-JPEM5IY8.js +1 -0
- package/dist/client/assets/{data-grid-overlay-editor-CBVV2omk.js → data-grid-overlay-editor-B_nPhXKR.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-BqsjUFPI.js → highlighted-body-KPVGNVTW-dPpneB8R.js} +1 -1
- package/dist/client/assets/{index-B7OFMd2c.css → index-BGcZZetP.css} +1 -1
- package/dist/client/assets/{index-DOmAST6D.js → index-CwjMcK6S.js} +137 -137
- package/dist/client/assets/{number-overlay-editor-DhCVhD05.js → number-overlay-editor-CRWFlaQs.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/{dataset-types-CSjbM_Vz.d.ts → dataset-types-8cDpOFYi.d.ts} +6 -236
- package/dist/index.d.ts +302 -1279
- package/dist/index.js +148 -485
- package/dist/{trace-Dn6Pfcc5.d.ts → trace-BlnjMp7o.d.ts} +2 -1
- package/dist/{trace-event-ingestor-DI-HkA4Q.js → trace-event-ingestor-DwI1hxGX.js} +2471 -8458
- package/dist/views/datasets/index.d.ts +1 -1
- package/dist/views/index.d.ts +3 -2
- package/dist/views/index.js +0 -4
- package/dist/views/react/index.d.ts +1 -1
- package/package.json +19 -16
- package/dist/client/assets/DatasetView-CWw3B_XI.js +0 -15
- package/dist/client/assets/EvalRunView-DJNSAydj.js +0 -2
- package/dist/client/assets/EvalView-R0Nkikzs.js +0 -1
package/dist/client/assets/{number-overlay-editor-DhCVhD05.js → number-overlay-editor-CRWFlaQs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ab as Y,r as O}from"./index-DOmAST6D.js";import{s as Be}from"./DatasetView-CWw3B_XI.js";const Fe=Be("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function pe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var ee;(function(e){e.event="event",e.props="prop"})(ee||(ee={}));function q(){}function _e(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(i,f){return i===t[f]})||(t=n,r=e.apply(void 0,n)),r}}function ae(e){return!!(e||"").match(/\d/)}function z(e){return e==null}function je(e){return typeof e=="number"&&isNaN(e)}function xe(e){return z(e)||je(e)||typeof e=="number"&&!isFinite(e)}function ye(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Me(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Le(e,t,r){var n=Me(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function de(e){var t=O.useRef(e);t.current=e;var r=O.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function se(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),i=a[0],f=a[1]||"";return{beforeDecimal:i,afterDecimal:f,hasNegation:r,addNegation:n}}function ke(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function be(e,t,r){for(var n="",a=r?"0":"",i=0;i<=t-1;i++)n+=e[i]||a;return n}function ge(e,t){return Array(t+1).join(e)}function Ve(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],i=n[1];if(i=Number(i),!i)return r+a;a=a.replace(".","");var f=1+i,p=a.length;return f<0?a="0."+ge("0",Math.abs(f))+a:f>=p?a=a+ge("0",f-p):a=(a.substring(0,f)||"0")+"."+a.substring(f),r+a}function me(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=se(e),i=a.beforeDecimal,f=a.afterDecimal,p=a.hasNegation,m=parseFloat("0."+(f||"0")),x=f.length<=t?"0."+f:m.toFixed(t),h=x.split("."),s=i;i&&Number(h[0])&&(s=i.split("").reverse().reduce(function(I,C,g){return I.length>g?(Number(I[0])+Number(C)).toString()+I.substring(1,I.length):C+I},h[0]));var S=be(h[1]||"",t,r),y=p?"-":"",l=n?".":"";return""+y+s+l+S}function J(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ne=_e(function(e,t){for(var r=0,n=0,a=e.length,i=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[i-1-n]&&i-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:i-n}}}),Pe=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Ke(e,t,r){return Math.min(Math.max(e,t),r)}function ce(e){return Math.max(e.selectionStart,e.selectionEnd)}function We(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ue(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function Ge(e,t,r,n,a,i,f){f===void 0&&(f=$e);var p=a.findIndex(function(k){return k}),m=e.slice(0,p);!t&&!r.startsWith(m)&&(t=m,r=m+r,n=n+m.length);for(var x=r.length,h=e.length,s={},S=new Array(x),y=0;y<x;y++){S[y]=-1;for(var l=0,I=h;l<I;l++){var C=f({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:l});if(C&&s[l]!==!0){S[y]=l,s[l]=!0;break}}}for(var g=n;g<x&&(S[g]===-1||!i(r[g]));)g++;var B=g===x||S[g]===-1?h:S[g];for(g=n-1;g>0&&S[g]===-1;)g--;var F=g===-1||S[g]===-1?0:S[g]+1;return F>B?B:n-F<B-n?F:B}function he(e,t,r,n){var a=e.length;if(t=Ke(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Ze(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ae(e[r])||ae(e[r-1]));return t}function we(e,t,r,n,a,i){i===void 0&&(i=q);var f=de(function(l,I){var C,g;return xe(l)?(g="",C=""):typeof l=="number"||I?(g=typeof l=="number"?Ve(l):l,C=n(g)):(g=a(l,void 0),C=n(g)),{formattedValue:C,numAsString:g}}),p=O.useState(function(){return f(z(e)?t:e,r)}),m=p[0],x=p[1],h=de(function(l,I){l.formattedValue!==m.formattedValue&&x({formattedValue:l.formattedValue,numAsString:l.value}),i(l,I)}),s=e,S=r;z(e)&&(s=m.numAsString,S=!0);var y=f(s,S);return O.useMemo(function(){x(y)},[y.formattedValue]),O.useEffect(function(){if(!z(t)&&z(e)&&m.formattedValue!==""){var l=parseFloat(m.numAsString);h({formattedValue:m.formattedValue,value:m.numAsString,floatValue:isNaN(l)?void 0:l},{event:void 0,source:ee.props})}},[]),[m,h]}function qe(e){return e.replace(/[^0-9]/g,"")}function ze(e){return e}function He(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,i=e.getInputRef,f=e.format;f===void 0&&(f=ze);var p=e.removeFormatting;p===void 0&&(p=qe);var m=e.defaultValue,x=e.valueIsNumericString,h=e.onValueChange,s=e.isAllowed,S=e.onChange;S===void 0&&(S=q);var y=e.onKeyDown;y===void 0&&(y=q);var l=e.onMouseUp;l===void 0&&(l=q);var I=e.onFocus;I===void 0&&(I=q);var C=e.onBlur;C===void 0&&(C=q);var g=e.value,B=e.getCaretBoundary;B===void 0&&(B=Ze);var F=e.isValidInputCharacter;F===void 0&&(F=ae);var k=e.isCharacterSame,j=pe(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),H=we(g,m,!!x,f,p,h),P=H[0],V=P.formattedValue,M=P.numAsString,W=H[1],L=O.useRef(),U=O.useRef({formattedValue:V,numAsString:M}),$=function(o,u){U.current={formattedValue:o.formattedValue,numAsString:o.value},W(o,u)},Q=O.useState(!1),te=Q[0],d=Q[1],c=O.useRef(null),N=O.useRef({setCaretTimeout:null,focusTimeout:null});O.useEffect(function(){return d(!0),function(){clearTimeout(N.current.setCaretTimeout),clearTimeout(N.current.focusTimeout)}},[]);var R=f,A=function(o,u){var v=parseFloat(u);return{formattedValue:o,value:u,floatValue:isNaN(v)?void 0:v}},E=function(o,u,v){o.selectionStart===0&&o.selectionEnd===o.value.length||(J(o,u),N.current.setCaretTimeout=setTimeout(function(){o.value===v&&o.selectionStart!==u&&J(o,u)},0))},T=function(o,u,v){return he(o,u,B(o),v)},X=function(o,u,v){var w=B(u),_=Ge(u,V,o,v,w,F,k);return _=he(u,_,w),_},oe=function(o){var u=o.formattedValue;u===void 0&&(u="");var v=o.input,w=o.source,_=o.event,D=o.numAsString,b;if(v){var K=o.inputValue||v.value,G=ce(v);v.value=u,b=X(K,u,G),b!==void 0&&E(v,b,u)}u!==V&&$(A(u,D),{event:_,source:w})};O.useEffect(function(){var o=U.current,u=o.formattedValue,v=o.numAsString;(V!==u||M!==v)&&$(A(V,M),{event:void 0,source:ee.props})},[V,M]);var re=c.current?ce(c.current):void 0,ne=typeof window<"u"?O.useLayoutEffect:O.useEffect;ne(function(){var o=c.current;if(V!==U.current.formattedValue&&o){var u=X(U.current.formattedValue,V,re);o.value=V,E(o,u,V)}},[V]);var ue=function(o,u,v){var w=u.target,_=L.current?Pe(L.current,w.selectionEnd):Ne(V,o),D=Object.assign(Object.assign({},_),{lastValue:V}),b=p(o,D),K=R(b);if(b=p(K,void 0),s&&!s(A(K,b))){var G=u.target,Z=ce(G),le=X(o,V,Z);return G.value=V,E(G,le,V),!1}return oe({formattedValue:K,numAsString:b,inputValue:o,event:u,source:v,input:u.target}),!0},fe=function(o,u){u===void 0&&(u=0);var v=o.selectionStart,w=o.selectionEnd;L.current={selectionStart:v,selectionEnd:w+u}},Ie=function(o){var u=o.target,v=u.value,w=ue(v,o,ee.event);w&&S(o),L.current=void 0},Ce=function(o){var u=o.target,v=o.key,w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b;v==="ArrowLeft"||v==="Backspace"?b=Math.max(w-1,0):v==="ArrowRight"?b=Math.min(w+1,D.length):v==="Delete"&&(b=w);var K=0;v==="Delete"&&w===_&&(K=1);var G=v==="ArrowLeft"||v==="ArrowRight";if(b===void 0||w!==_&&!G){y(o),fe(u,K);return}var Z=b;if(G){var le=v==="ArrowLeft"?"left":"right";Z=T(D,b,le),Z!==b&&o.preventDefault()}else v==="Delete"&&!F(D[b])?Z=T(D,b,"right"):v==="Backspace"&&!F(D[b])&&(Z=T(D,b,"left"));Z!==b&&E(u,Z,D),y(o),fe(u,K)},Ee=function(o){var u=o.target,v=function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;if(D===void 0&&(D=""),w===_){var b=T(D,w);b!==w&&E(u,b,D)}};v(),requestAnimationFrame(function(){v()}),l(o),fe(u)},Re=function(o){o.persist&&o.persist();var u=o.target,v=o.currentTarget;c.current=u,N.current.focusTimeout=setTimeout(function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b=T(D,w);b!==w&&!(w===0&&_===D.length)&&E(u,b,D),I(Object.assign(Object.assign({},o),{currentTarget:v}))},0)},Ae=function(o){c.current=null,clearTimeout(N.current.focusTimeout),clearTimeout(N.current.setCaretTimeout),C(o)},Oe=te&&We()?"numeric":void 0,ve=Object.assign({inputMode:Oe},j,{type:t,value:V,onChange:Ie,onKeyDown:Ce,onMouseUp:Ee,onFocus:Re,onBlur:Ae});if(r==="text")return a?Y.createElement(Y.Fragment,null,a(V,j)||null):Y.createElement("span",Object.assign({},j,{ref:i}),V);if(n){var Te=n;return Y.createElement(Te,Object.assign({},ve,{ref:i}))}return Y.createElement("input",Object.assign({},ve,{ref:i}))}function Se(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var i=t.suffix;i===void 0&&(i="");var f=t.allowNegative,p=t.thousandsGroupStyle;if(p===void 0&&(p="thousand"),e===""||e==="-")return e;var m=ie(t),x=m.thousandSeparator,h=m.decimalSeparator,s=r!==0&&e.indexOf(".")!==-1||r&&n,S=se(e,f),y=S.beforeDecimal,l=S.afterDecimal,I=S.addNegation;return r!==void 0&&(l=be(l,r,!!n)),x&&(y=Le(y,x,p)),a&&(y=a+y),i&&(l=l+i),I&&(y="-"+y),e=y+(s&&h||"")+l,e}function ie(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Je(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),i=n.test(e);return e=e.replace(/-/g,""),a&&!i&&t&&(e="-"+e),e}function Qe(e,t){return new RegExp("(^-)|[0-9]|"+ye(e),"g")}function Xe(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Ye(e,t,r){var n;t===void 0&&(t=Ue(e));var a=r.allowNegative,i=r.prefix;i===void 0&&(i="");var f=r.suffix;f===void 0&&(f="");var p=r.decimalScale,m=t.from,x=t.to,h=x.start,s=x.end,S=ie(r),y=S.allowedDecimalSeparators,l=S.decimalSeparator,I=e[s]===l;if(ae(e)&&(e===i||e===f)&&t.lastValue==="")return e;if(s-h===1&&y.indexOf(e[h])!==-1){var C=p===0?"":l;e=e.substring(0,h)+C+e.substring(h+1,e.length)}var g=function(c,N,R){var A=!1,E=!1;i.startsWith("-")?A=!1:c.startsWith("--")?(A=!1,E=!0):f.startsWith("-")&&c.length===f.length?A=!1:c[0]==="-"&&(A=!0);var T=A?1:0;return E&&(T=2),T&&(c=c.substring(T),N-=T,R-=T),{value:c,start:N,end:R,hasNegation:A}},B=g(e,h,s),F=B.hasNegation;n=B,e=n.value,h=n.start,s=n.end;var k=g(t.lastValue,m.start,m.end),j=k.start,H=k.end,P=k.value,V=e.substring(h,s);e.length&&P.length&&(j>P.length-f.length||H<i.length)&&!(V&&f.startsWith(V))&&(e=P);var M=0;e.startsWith(i)?M+=i.length:h<i.length&&(M=h),e=e.substring(M),s-=M;var W=e.length,L=e.length-f.length;e.endsWith(f)?W=L:(s>L||s>e.length-f.length)&&(W=s),e=e.substring(0,W),e=Je(F?"-"+e:e,a),e=(e.match(Qe(l))||[]).join("");var U=e.indexOf(l);e=e.replace(new RegExp(ye(l),"g"),function(c,N){return N===U?".":""});var $=se(e,a),Q=$.beforeDecimal,te=$.afterDecimal,d=$.addNegation;return x.end-x.start<m.end-m.start&&Q===""&&I&&!parseFloat(te)&&(e=d?"-":""),e}function et(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";a.fill(!1,0,Math.min(r.length+(i?1:0),e.length));var f=e.length;return a.fill(!1,f-n.length+1,f+1),a}function tt(e){var t=ie(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var i=e.allowNegative;if(i===void 0&&(i=!0),r===n)throw new Error(`
|
|
1
|
+
import{ad as Y,r as O}from"./index-CwjMcK6S.js";import{s as Be}from"./DatasetView-BqSWI_pm.js";const Fe=Be("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function pe(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var ee;(function(e){e.event="event",e.props="prop"})(ee||(ee={}));function q(){}function _e(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(i,f){return i===t[f]})||(t=n,r=e.apply(void 0,n)),r}}function ae(e){return!!(e||"").match(/\d/)}function z(e){return e==null}function je(e){return typeof e=="number"&&isNaN(e)}function xe(e){return z(e)||je(e)||typeof e=="number"&&!isFinite(e)}function ye(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Me(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Le(e,t,r){var n=Me(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function de(e){var t=O.useRef(e);t.current=e;var r=O.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function se(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),i=a[0],f=a[1]||"";return{beforeDecimal:i,afterDecimal:f,hasNegation:r,addNegation:n}}function ke(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function be(e,t,r){for(var n="",a=r?"0":"",i=0;i<=t-1;i++)n+=e[i]||a;return n}function ge(e,t){return Array(t+1).join(e)}function Ve(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],i=n[1];if(i=Number(i),!i)return r+a;a=a.replace(".","");var f=1+i,p=a.length;return f<0?a="0."+ge("0",Math.abs(f))+a:f>=p?a=a+ge("0",f-p):a=(a.substring(0,f)||"0")+"."+a.substring(f),r+a}function me(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=se(e),i=a.beforeDecimal,f=a.afterDecimal,p=a.hasNegation,m=parseFloat("0."+(f||"0")),x=f.length<=t?"0."+f:m.toFixed(t),h=x.split("."),s=i;i&&Number(h[0])&&(s=i.split("").reverse().reduce(function(I,C,g){return I.length>g?(Number(I[0])+Number(C)).toString()+I.substring(1,I.length):C+I},h[0]));var S=be(h[1]||"",t,r),y=p?"-":"",l=n?".":"";return""+y+s+l+S}function J(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var Ne=_e(function(e,t){for(var r=0,n=0,a=e.length,i=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[i-1-n]&&i-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:i-n}}}),Pe=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function Ke(e,t,r){return Math.min(Math.max(e,t),r)}function ce(e){return Math.max(e.selectionStart,e.selectionEnd)}function We(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Ue(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function $e(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function Ge(e,t,r,n,a,i,f){f===void 0&&(f=$e);var p=a.findIndex(function(k){return k}),m=e.slice(0,p);!t&&!r.startsWith(m)&&(t=m,r=m+r,n=n+m.length);for(var x=r.length,h=e.length,s={},S=new Array(x),y=0;y<x;y++){S[y]=-1;for(var l=0,I=h;l<I;l++){var C=f({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:l});if(C&&s[l]!==!0){S[y]=l,s[l]=!0;break}}}for(var g=n;g<x&&(S[g]===-1||!i(r[g]));)g++;var B=g===x||S[g]===-1?h:S[g];for(g=n-1;g>0&&S[g]===-1;)g--;var F=g===-1||S[g]===-1?0:S[g]+1;return F>B?B:n-F<B-n?F:B}function he(e,t,r,n){var a=e.length;if(t=Ke(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Ze(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ae(e[r])||ae(e[r-1]));return t}function we(e,t,r,n,a,i){i===void 0&&(i=q);var f=de(function(l,I){var C,g;return xe(l)?(g="",C=""):typeof l=="number"||I?(g=typeof l=="number"?Ve(l):l,C=n(g)):(g=a(l,void 0),C=n(g)),{formattedValue:C,numAsString:g}}),p=O.useState(function(){return f(z(e)?t:e,r)}),m=p[0],x=p[1],h=de(function(l,I){l.formattedValue!==m.formattedValue&&x({formattedValue:l.formattedValue,numAsString:l.value}),i(l,I)}),s=e,S=r;z(e)&&(s=m.numAsString,S=!0);var y=f(s,S);return O.useMemo(function(){x(y)},[y.formattedValue]),O.useEffect(function(){if(!z(t)&&z(e)&&m.formattedValue!==""){var l=parseFloat(m.numAsString);h({formattedValue:m.formattedValue,value:m.numAsString,floatValue:isNaN(l)?void 0:l},{event:void 0,source:ee.props})}},[]),[m,h]}function qe(e){return e.replace(/[^0-9]/g,"")}function ze(e){return e}function He(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,i=e.getInputRef,f=e.format;f===void 0&&(f=ze);var p=e.removeFormatting;p===void 0&&(p=qe);var m=e.defaultValue,x=e.valueIsNumericString,h=e.onValueChange,s=e.isAllowed,S=e.onChange;S===void 0&&(S=q);var y=e.onKeyDown;y===void 0&&(y=q);var l=e.onMouseUp;l===void 0&&(l=q);var I=e.onFocus;I===void 0&&(I=q);var C=e.onBlur;C===void 0&&(C=q);var g=e.value,B=e.getCaretBoundary;B===void 0&&(B=Ze);var F=e.isValidInputCharacter;F===void 0&&(F=ae);var k=e.isCharacterSame,j=pe(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),H=we(g,m,!!x,f,p,h),P=H[0],V=P.formattedValue,M=P.numAsString,W=H[1],L=O.useRef(),U=O.useRef({formattedValue:V,numAsString:M}),$=function(o,u){U.current={formattedValue:o.formattedValue,numAsString:o.value},W(o,u)},Q=O.useState(!1),te=Q[0],d=Q[1],c=O.useRef(null),N=O.useRef({setCaretTimeout:null,focusTimeout:null});O.useEffect(function(){return d(!0),function(){clearTimeout(N.current.setCaretTimeout),clearTimeout(N.current.focusTimeout)}},[]);var R=f,A=function(o,u){var v=parseFloat(u);return{formattedValue:o,value:u,floatValue:isNaN(v)?void 0:v}},E=function(o,u,v){o.selectionStart===0&&o.selectionEnd===o.value.length||(J(o,u),N.current.setCaretTimeout=setTimeout(function(){o.value===v&&o.selectionStart!==u&&J(o,u)},0))},T=function(o,u,v){return he(o,u,B(o),v)},X=function(o,u,v){var w=B(u),_=Ge(u,V,o,v,w,F,k);return _=he(u,_,w),_},oe=function(o){var u=o.formattedValue;u===void 0&&(u="");var v=o.input,w=o.source,_=o.event,D=o.numAsString,b;if(v){var K=o.inputValue||v.value,G=ce(v);v.value=u,b=X(K,u,G),b!==void 0&&E(v,b,u)}u!==V&&$(A(u,D),{event:_,source:w})};O.useEffect(function(){var o=U.current,u=o.formattedValue,v=o.numAsString;(V!==u||M!==v)&&$(A(V,M),{event:void 0,source:ee.props})},[V,M]);var re=c.current?ce(c.current):void 0,ne=typeof window<"u"?O.useLayoutEffect:O.useEffect;ne(function(){var o=c.current;if(V!==U.current.formattedValue&&o){var u=X(U.current.formattedValue,V,re);o.value=V,E(o,u,V)}},[V]);var ue=function(o,u,v){var w=u.target,_=L.current?Pe(L.current,w.selectionEnd):Ne(V,o),D=Object.assign(Object.assign({},_),{lastValue:V}),b=p(o,D),K=R(b);if(b=p(K,void 0),s&&!s(A(K,b))){var G=u.target,Z=ce(G),le=X(o,V,Z);return G.value=V,E(G,le,V),!1}return oe({formattedValue:K,numAsString:b,inputValue:o,event:u,source:v,input:u.target}),!0},fe=function(o,u){u===void 0&&(u=0);var v=o.selectionStart,w=o.selectionEnd;L.current={selectionStart:v,selectionEnd:w+u}},Ie=function(o){var u=o.target,v=u.value,w=ue(v,o,ee.event);w&&S(o),L.current=void 0},Ce=function(o){var u=o.target,v=o.key,w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b;v==="ArrowLeft"||v==="Backspace"?b=Math.max(w-1,0):v==="ArrowRight"?b=Math.min(w+1,D.length):v==="Delete"&&(b=w);var K=0;v==="Delete"&&w===_&&(K=1);var G=v==="ArrowLeft"||v==="ArrowRight";if(b===void 0||w!==_&&!G){y(o),fe(u,K);return}var Z=b;if(G){var le=v==="ArrowLeft"?"left":"right";Z=T(D,b,le),Z!==b&&o.preventDefault()}else v==="Delete"&&!F(D[b])?Z=T(D,b,"right"):v==="Backspace"&&!F(D[b])&&(Z=T(D,b,"left"));Z!==b&&E(u,Z,D),y(o),fe(u,K)},Ee=function(o){var u=o.target,v=function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;if(D===void 0&&(D=""),w===_){var b=T(D,w);b!==w&&E(u,b,D)}};v(),requestAnimationFrame(function(){v()}),l(o),fe(u)},Re=function(o){o.persist&&o.persist();var u=o.target,v=o.currentTarget;c.current=u,N.current.focusTimeout=setTimeout(function(){var w=u.selectionStart,_=u.selectionEnd,D=u.value;D===void 0&&(D="");var b=T(D,w);b!==w&&!(w===0&&_===D.length)&&E(u,b,D),I(Object.assign(Object.assign({},o),{currentTarget:v}))},0)},Ae=function(o){c.current=null,clearTimeout(N.current.focusTimeout),clearTimeout(N.current.setCaretTimeout),C(o)},Oe=te&&We()?"numeric":void 0,ve=Object.assign({inputMode:Oe},j,{type:t,value:V,onChange:Ie,onKeyDown:Ce,onMouseUp:Ee,onFocus:Re,onBlur:Ae});if(r==="text")return a?Y.createElement(Y.Fragment,null,a(V,j)||null):Y.createElement("span",Object.assign({},j,{ref:i}),V);if(n){var Te=n;return Y.createElement(Te,Object.assign({},ve,{ref:i}))}return Y.createElement("input",Object.assign({},ve,{ref:i}))}function Se(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var i=t.suffix;i===void 0&&(i="");var f=t.allowNegative,p=t.thousandsGroupStyle;if(p===void 0&&(p="thousand"),e===""||e==="-")return e;var m=ie(t),x=m.thousandSeparator,h=m.decimalSeparator,s=r!==0&&e.indexOf(".")!==-1||r&&n,S=se(e,f),y=S.beforeDecimal,l=S.afterDecimal,I=S.addNegation;return r!==void 0&&(l=be(l,r,!!n)),x&&(y=Le(y,x,p)),a&&(y=a+y),i&&(l=l+i),I&&(y="-"+y),e=y+(s&&h||"")+l,e}function ie(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function Je(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),i=n.test(e);return e=e.replace(/-/g,""),a&&!i&&t&&(e="-"+e),e}function Qe(e,t){return new RegExp("(^-)|[0-9]|"+ye(e),"g")}function Xe(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Ye(e,t,r){var n;t===void 0&&(t=Ue(e));var a=r.allowNegative,i=r.prefix;i===void 0&&(i="");var f=r.suffix;f===void 0&&(f="");var p=r.decimalScale,m=t.from,x=t.to,h=x.start,s=x.end,S=ie(r),y=S.allowedDecimalSeparators,l=S.decimalSeparator,I=e[s]===l;if(ae(e)&&(e===i||e===f)&&t.lastValue==="")return e;if(s-h===1&&y.indexOf(e[h])!==-1){var C=p===0?"":l;e=e.substring(0,h)+C+e.substring(h+1,e.length)}var g=function(c,N,R){var A=!1,E=!1;i.startsWith("-")?A=!1:c.startsWith("--")?(A=!1,E=!0):f.startsWith("-")&&c.length===f.length?A=!1:c[0]==="-"&&(A=!0);var T=A?1:0;return E&&(T=2),T&&(c=c.substring(T),N-=T,R-=T),{value:c,start:N,end:R,hasNegation:A}},B=g(e,h,s),F=B.hasNegation;n=B,e=n.value,h=n.start,s=n.end;var k=g(t.lastValue,m.start,m.end),j=k.start,H=k.end,P=k.value,V=e.substring(h,s);e.length&&P.length&&(j>P.length-f.length||H<i.length)&&!(V&&f.startsWith(V))&&(e=P);var M=0;e.startsWith(i)?M+=i.length:h<i.length&&(M=h),e=e.substring(M),s-=M;var W=e.length,L=e.length-f.length;e.endsWith(f)?W=L:(s>L||s>e.length-f.length)&&(W=s),e=e.substring(0,W),e=Je(F?"-"+e:e,a),e=(e.match(Qe(l))||[]).join("");var U=e.indexOf(l);e=e.replace(new RegExp(ye(l),"g"),function(c,N){return N===U?".":""});var $=se(e,a),Q=$.beforeDecimal,te=$.afterDecimal,d=$.addNegation;return x.end-x.start<m.end-m.start&&Q===""&&I&&!parseFloat(te)&&(e=d?"-":""),e}function et(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";a.fill(!1,0,Math.min(r.length+(i?1:0),e.length));var f=e.length;return a.fill(!1,f-n.length+1,f+1),a}function tt(e){var t=ie(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var i=e.allowNegative;if(i===void 0&&(i=!0),r===n)throw new Error(`
|
|
2
2
|
Decimal separator can't be same as thousand separator.
|
|
3
3
|
thousandSeparator: `+r+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
4
4
|
decimalSeparator: `+n+` (default value for decimalSeparator is .)
|
package/dist/client/index.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
9
|
<title>Evalution</title>
|
|
10
10
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-CwjMcK6S.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BGcZZetP.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -1,236 +1,6 @@
|
|
|
1
|
+
import { PromptID } from "@evalution/sdk";
|
|
1
2
|
import { PropDefinition, PropValue } from "ts-proppy";
|
|
2
3
|
|
|
3
|
-
//#region src/trace/trace-types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* A reference to a prompt.
|
|
6
|
-
*
|
|
7
|
-
* `id` is interpreted as a globally-unique prompt ID unless `providerId` is
|
|
8
|
-
* present, in which case `id` is scoped to that specific prompt provider. This
|
|
9
|
-
* mirrors the OpenTelemetry attributes `evalution.prompt.id` (always present)
|
|
10
|
-
* and `evalution.prompt.provider.id` (optional, scoping).
|
|
11
|
-
*/
|
|
12
|
-
interface PromptID {
|
|
13
|
-
/** The prompt ID — global unless {@link providerId} scopes it. */
|
|
14
|
-
id: string;
|
|
15
|
-
/** When set, {@link id} is scoped to this prompt provider. */
|
|
16
|
-
providerId?: string;
|
|
17
|
-
/** Positional arguments the prompt function was called with. */
|
|
18
|
-
functionParameters?: unknown[];
|
|
19
|
-
/**
|
|
20
|
-
* The unresolved inputs the run was launched with — the recipe, not the
|
|
21
|
-
* resolution.
|
|
22
|
-
*
|
|
23
|
-
* Replaying them is only exactly faithful for the `value` kind. A `resource`
|
|
24
|
-
* re-runs its `create()`, producing an *equivalent* value rather than the
|
|
25
|
-
* same one — a fresh handle, a newly seeded row — so a UI must present it as
|
|
26
|
-
* something that will be re-created, never as a restored value.
|
|
27
|
-
*/
|
|
28
|
-
functionInputs?: unknown[];
|
|
29
|
-
/** The unresolved execute-parameter inputs, keyed by parameter name. */
|
|
30
|
-
executeInputs?: Record<string, unknown>;
|
|
31
|
-
/**
|
|
32
|
-
* The run's named resource instances, by name, with the receipt each
|
|
33
|
-
* `create()` produced. See `specs/resource-instances.md` §F.
|
|
34
|
-
*/
|
|
35
|
-
resources?: Record<string, unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* The prompt's parameter definitions as they stood when the run was
|
|
38
|
-
* launched, so a replay can diff them against today's signature rather than
|
|
39
|
-
* guess whether the recorded inputs still fit.
|
|
40
|
-
*/
|
|
41
|
-
parameterDefinitions?: unknown[];
|
|
42
|
-
/**
|
|
43
|
-
* The prompt's execute-parameter definitions as they stood when the run was
|
|
44
|
-
* launched — the types of {@link executeInputs}, as
|
|
45
|
-
* {@link parameterDefinitions} is for {@link functionInputs}.
|
|
46
|
-
*/
|
|
47
|
-
executeParameterDefinitions?: unknown[];
|
|
48
|
-
/** The version the run executed against. */
|
|
49
|
-
version?: string;
|
|
50
|
-
/** The variation applied on top of {@link version}, if any. */
|
|
51
|
-
variation?: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Classification of a {@link Span}. See also:
|
|
55
|
-
* - `lmnr.span.type` from https://laminar.sh/docs/tracing/otel
|
|
56
|
-
* - `mlflow.spanType` from https://mlflow.org/docs/latest/genai/tracing/opentelemetry/attribute-mapping/#translated-span-attributes
|
|
57
|
-
*
|
|
58
|
-
* Mapped from `gen_ai.operation.name`. `CHECK` is evalution's own: an eval
|
|
59
|
-
* check that traced something while judging the run — see
|
|
60
|
-
* {@link CHECK_ATTRIBUTE}.
|
|
61
|
-
*/
|
|
62
|
-
type SpanKind = "LLM" | "TOOL" | "AGENT" | "EMBEDDING" | "CHECK" | "DEFAULT";
|
|
63
|
-
/** A text segment within a multi-part {@link SpanMessage} content. */
|
|
64
|
-
interface SpanTextPart {
|
|
65
|
-
type: "text";
|
|
66
|
-
text: string;
|
|
67
|
-
}
|
|
68
|
-
/** An image segment within a multi-part {@link SpanMessage} content. */
|
|
69
|
-
interface SpanImagePart {
|
|
70
|
-
type: "image";
|
|
71
|
-
/** A URL, or base64/data-URI image data. */
|
|
72
|
-
image: string;
|
|
73
|
-
/** MIME type (e.g. `image/png`), when known. */
|
|
74
|
-
mediaType?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A tool call the assistant made, within a multi-part {@link SpanMessage}
|
|
78
|
-
* content. Matched to its {@link SpanToolResultPart} by `toolCallId`.
|
|
79
|
-
*/
|
|
80
|
-
interface SpanToolCallPart {
|
|
81
|
-
type: "tool-call";
|
|
82
|
-
toolCallId: string;
|
|
83
|
-
toolName: string;
|
|
84
|
-
/** The arguments the model passed, as JSON. */
|
|
85
|
-
input: unknown;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* A tool's result fed back to the model, within a multi-part
|
|
89
|
-
* {@link SpanMessage} content (usually a `tool` message).
|
|
90
|
-
*/
|
|
91
|
-
interface SpanToolResultPart {
|
|
92
|
-
type: "tool-result";
|
|
93
|
-
toolCallId: string;
|
|
94
|
-
toolName: string;
|
|
95
|
-
/** What the tool returned, unwrapped from the SDK's output envelope. */
|
|
96
|
-
output: unknown;
|
|
97
|
-
/** Whether the result reports a failure (an error, or a denied call). */
|
|
98
|
-
isError?: boolean;
|
|
99
|
-
}
|
|
100
|
-
type SpanMessageRole = "user" | "assistant" | "system" | "tool" | (string & {});
|
|
101
|
-
/** One segment of a multi-part {@link SpanMessage} content. */
|
|
102
|
-
type SpanContentPart = SpanTextPart | SpanImagePart | SpanToolCallPart | SpanToolResultPart;
|
|
103
|
-
/**
|
|
104
|
-
* A single message within an LLM span's input/output.
|
|
105
|
-
*
|
|
106
|
-
* `content` is a plain string for the common text-only case. It is an array
|
|
107
|
-
* of {@link SpanContentPart} when the message carries non-text content (e.g.
|
|
108
|
-
* an image, or a tool call or result) — the `string` form stays in the union so existing consumers and
|
|
109
|
-
* already-stored rows keep working unchanged.
|
|
110
|
-
*/
|
|
111
|
-
interface SpanMessage {
|
|
112
|
-
role: SpanMessageRole;
|
|
113
|
-
content: string | SpanContentPart[];
|
|
114
|
-
}
|
|
115
|
-
/** LLM-specific attributes attached to `LLM` spans. */
|
|
116
|
-
interface LLMSpanDetails {
|
|
117
|
-
provider?: string;
|
|
118
|
-
model?: string;
|
|
119
|
-
/** Model parameters (temperature, max_tokens, …). */
|
|
120
|
-
modelParameters?: Record<string, unknown>;
|
|
121
|
-
/**
|
|
122
|
-
* Why the model stopped generating, as the provider or SDK reports it
|
|
123
|
-
* (`stop`, `length`, `tool-calls`, …). Not normalized across providers.
|
|
124
|
-
*/
|
|
125
|
-
finishReason?: string;
|
|
126
|
-
/**
|
|
127
|
-
* What the model was given: a message list for a chat model, or any JSON
|
|
128
|
-
* for a model that takes something else (a System One call records
|
|
129
|
-
* `{ state, questions }`). Array-ness is the discriminant — see
|
|
130
|
-
* {@link spanMessages}.
|
|
131
|
-
*/
|
|
132
|
-
input?: SpanMessage[] | {
|
|
133
|
-
[key: string]: unknown;
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* What it returned: text for a chat model, the assistant message of a turn
|
|
137
|
-
* that called tools (see `toolCallingOutput`), or JSON for structured
|
|
138
|
-
* output and for any model whose answer is data rather than prose.
|
|
139
|
-
*/
|
|
140
|
-
output?: unknown;
|
|
141
|
-
/** Input tokens, counting any read from or written to a prompt cache. */
|
|
142
|
-
promptTokens?: number;
|
|
143
|
-
completionTokens?: number;
|
|
144
|
-
totalTokens?: number;
|
|
145
|
-
/** How many of {@link promptTokens} were read from a prompt cache. */
|
|
146
|
-
cacheReadTokens?: number;
|
|
147
|
-
/** How many of {@link promptTokens} were written to a prompt cache. */
|
|
148
|
-
cacheWriteTokens?: number;
|
|
149
|
-
/**
|
|
150
|
-
* Dollar cost of the call, broken down by token type, if known. The total
|
|
151
|
-
* cost is `cost.prompt + cost.completion`; `cost.prompt` includes cache
|
|
152
|
-
* reads and writes, each at its own price.
|
|
153
|
-
*/
|
|
154
|
-
cost?: {
|
|
155
|
-
prompt: number;
|
|
156
|
-
completion: number; /** The part of `prompt` spent on {@link cacheReadTokens}. */
|
|
157
|
-
cacheRead?: number; /** The part of `prompt` spent on {@link cacheWriteTokens}. */
|
|
158
|
-
cacheWrite?: number;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
interface ToolSpanDetails {
|
|
162
|
-
toolName: string;
|
|
163
|
-
/**
|
|
164
|
-
* The id the model gave this call, when the integration reports it — the
|
|
165
|
-
* same id as the {@link SpanToolCallPart} that requested it.
|
|
166
|
-
*/
|
|
167
|
-
toolCallId?: string;
|
|
168
|
-
input: unknown;
|
|
169
|
-
output?: unknown;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* A span in a {@link Trace}. Spans form a tree via {@link parentId}.
|
|
173
|
-
* Durations are derived from `startTime` and `endTime`; an in-progress span has
|
|
174
|
-
* no `endTime` yet.
|
|
175
|
-
*/
|
|
176
|
-
interface Span {
|
|
177
|
-
id: string;
|
|
178
|
-
traceId: string;
|
|
179
|
-
/** `undefined` for the root span of the trace. */
|
|
180
|
-
parentId?: string;
|
|
181
|
-
name: string;
|
|
182
|
-
kind: SpanKind;
|
|
183
|
-
/** Start timestamp in milliseconds since epoch. */
|
|
184
|
-
startTime: number;
|
|
185
|
-
/** End timestamp in milliseconds since epoch, or `undefined` while running. */
|
|
186
|
-
endTime?: number;
|
|
187
|
-
status?: "ok" | "error";
|
|
188
|
-
/** Error message if `status` is `'error'`. */
|
|
189
|
-
errorMessage?: string;
|
|
190
|
-
/** Free-form attributes to show in the span's details pane. */
|
|
191
|
-
attributes?: Record<string, unknown>;
|
|
192
|
-
/**
|
|
193
|
-
* The OpenTelemetry resource that produced the span: attributes describing
|
|
194
|
-
* the process or service it ran in rather than the span itself
|
|
195
|
-
* (`service.name`, `deployment.environment.name`, …).
|
|
196
|
-
*/
|
|
197
|
-
resource?: Record<string, unknown>;
|
|
198
|
-
/** LLM-specific details (present for `chat`/`completion`/`embedding` spans). */
|
|
199
|
-
llm?: LLMSpanDetails;
|
|
200
|
-
/**
|
|
201
|
-
* The prompt this span is attributed to, if any.
|
|
202
|
-
*
|
|
203
|
-
* Stored as emitted (`evalution.prompt.id` plus optional
|
|
204
|
-
* `evalution.prompt.provider.id`): a {@link PromptID} whose `id` is global
|
|
205
|
-
* unless `providerId` is set. The server resolves it against the prompt
|
|
206
|
-
* registry to a provider-scoped reference when a trace is served.
|
|
207
|
-
*/
|
|
208
|
-
prompt?: PromptID;
|
|
209
|
-
tool?: ToolSpanDetails;
|
|
210
|
-
}
|
|
211
|
-
interface TraceBase {
|
|
212
|
-
id: string;
|
|
213
|
-
providerId?: string;
|
|
214
|
-
name: string;
|
|
215
|
-
/** Start timestamp (ms). */
|
|
216
|
-
startTime: number;
|
|
217
|
-
/** End timestamp (ms), or `undefined` while the trace is still running. */
|
|
218
|
-
endTime?: number;
|
|
219
|
-
status: "running" | "ok" | "error";
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Top-level trace for a single invocation (e.g. one prompt execution).
|
|
223
|
-
*/
|
|
224
|
-
interface Trace extends TraceBase {
|
|
225
|
-
/** Free-form attributes (e.g. prompt ID, function params). */
|
|
226
|
-
attributes?: Record<string, unknown>;
|
|
227
|
-
}
|
|
228
|
-
/** A trace together with all of its spans. */
|
|
229
|
-
interface TraceWithSpans {
|
|
230
|
-
trace: Trace;
|
|
231
|
-
spans: Span[];
|
|
232
|
-
}
|
|
233
|
-
//#endregion
|
|
234
4
|
//#region src/shared/types.d.ts
|
|
235
5
|
/**
|
|
236
6
|
* One prompt input, *before* resolution — the recipe rather than the value.
|
|
@@ -440,10 +210,10 @@ interface DatasetField {
|
|
|
440
210
|
/** Name, type, description — the checker's view of the slot this field came from. */
|
|
441
211
|
def: PropDefinition;
|
|
442
212
|
/**
|
|
443
|
-
* Set on a field added by hand
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* parameters.
|
|
213
|
+
* Set on a field added by hand — through `DatasetProvider.addField`, or
|
|
214
|
+
* given as `{ name, type }` or `{ from }` when the dataset was created —
|
|
215
|
+
* rather than derived from the linked prompt. Such a field never came from
|
|
216
|
+
* that prompt, so it isn't flagged when it matches none of its parameters.
|
|
447
217
|
*/
|
|
448
218
|
added?: true;
|
|
449
219
|
}
|
|
@@ -561,4 +331,4 @@ interface DatasetRowsOverview {
|
|
|
561
331
|
instances: Record<string, DatasetInstanceShape>;
|
|
562
332
|
}
|
|
563
333
|
//#endregion
|
|
564
|
-
export { ResourceInstanceInput as _, ColumnPath as a,
|
|
334
|
+
export { ResourceInstanceInput as _, ColumnPath as a, PathRow as c, childInputs as d, fieldPath as f, ExecutionInput as g, resolveColumnPath as h, DatasetRowsOverview as i, PathValue as l, readColumnPath as m, DatasetRow as n, InstanceArgument as o, instancePath as p, DatasetRowUpdate as r, MAX_REFERENCE_HOPS as s, Dataset as t, ResolvedPath as u, RunResources as v };
|